diff --git a/.env.template b/.env.template new file mode 100644 index 0000000..c475336 --- /dev/null +++ b/.env.template @@ -0,0 +1,7 @@ +# copy to .env.test and fill in the blanks +VITE_NEON_DB_URL="postgresql:// ..." +VITE_NEON_DB_POOLER_URL="postgresql:// ..." +VITE_WSPROXY="... .workers.dev" +VITE_VERCEL_TOKEN="..." +VITE_CLERK_USER="... @neon.tech" +VITE_CLERK_SECRET_KEY="sk_test_ ..." diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 50d5535..8d46933 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,14 +11,14 @@ jobs: steps: # setup - uses: actions/checkout@v4 - - uses: oven-sh/setup-bun@v2 + - uses: actions/setup-node@v4 - name: Install package dependencies - run: bun install + run: npm install # goal - name: Check TypeScript types - run: bun run check + run: npm run check - name: Check code formatting - run: bun run format + run: npm run format diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2cf54ae..651a0eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,17 +5,48 @@ on: branches: - main +env: + VITE_NEON_DB_URL: ${{ secrets.VITE_NEON_DB_URL }} + VITE_NEON_DB_POOLER_URL: ${{ secrets.VITE_NEON_DB_POOLER_URL }} + VITE_VERCEL_TOKEN: ${{ secrets.VITE_VERCEL_TOKEN }} + VITE_CLERK_SECRET_KEY: ${{ secrets.VITE_CLERK_SECRET_KEY }} + VITE_WSPROXY: ${{ vars.VITE_WSPROXY }} + VITE_CLERK_USER: ${{ vars.VITE_CLERK_USER }} + jobs: - test: + test-node-16: + runs-on: ubuntu-latest + steps: + # setup + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 16 + + - name: Install package dependencies + run: | + # strip Prisma, whose preinstall script throws on Node versions less than 18.x + sudo apt-get install jq && \ + mv package.json package.json.old && \ + jq 'del(.devDependencies.prisma, .devDependencies."@prisma/client")' package.json.old > package.json + npm install + + # goal + - name: Run CLI-based tests in Node 16 (no native WebSocket or fetch), node environment + run: npm run test:node + + test-node-lts: runs-on: ubuntu-latest steps: # setup - uses: actions/checkout@v4 - - uses: oven-sh/setup-bun@v2 + - uses: actions/setup-node@v4 + with: + node-version: lts/* - name: Install package dependencies - run: bun install + run: npm install # goal - - name: Run tests - run: bun run test + - name: Run all tests in Node LTS + run: npm run test diff --git a/.gitignore b/.gitignore index 05d3425..d1eee11 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .dev.vars -.env.local +.env.* +!.env.template node_modules tmp +.DS_Store diff --git a/api-extractor.json b/api-extractor.json new file mode 100644 index 0000000..eb63b62 --- /dev/null +++ b/api-extractor.json @@ -0,0 +1,29 @@ +{ + "mainEntryPointFilePath": "dist/dts/export/index.d.ts", + "newlineKind": "lf", + "enumMemberOrder": "preserve", + "bundledPackages": ["subtls"], + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "dist/dts/_extracted.d.ts" + }, + "apiReport": { + "enabled": false + }, + "docModel": { + "enabled": false + }, + "tsdocMetadata": { + "enabled": false + }, + "messages": { + "extractorMessageReporting": { + "ae-wrong-input-file-type": { + "logLevel": "none" + }, + "ae-missing-release-tag": { + "logLevel": "none" + } + } + } +} diff --git a/dist/dts/_extracted.d.ts b/dist/dts/_extracted.d.ts new file mode 100644 index 0000000..82e9d68 --- /dev/null +++ b/dist/dts/_extracted.d.ts @@ -0,0 +1,784 @@ +/// + +import { BindConfig } from 'pg'; +import { Client as Client_2 } from 'pg'; +import { ClientBase } from 'pg'; +import { ClientConfig } from 'pg'; +import { Connection } from 'pg'; +import { ConnectionConfig } from 'pg'; +import { CustomTypesConfig } from 'pg'; +import { Defaults } from 'pg'; +import { defaults } from 'pg'; +import { EventEmitter } from 'events'; +import { Events } from 'pg'; +import { ExecuteConfig } from 'pg'; +import { FieldDef } from 'pg'; +import { MessageConfig } from 'pg'; +import { Notification } from 'pg'; +import { Pool as Pool_2 } from 'pg'; +import { PoolConfig } from 'pg'; +import { Query } from 'pg'; +import { QueryArrayConfig } from 'pg'; +import { QueryArrayResult } from 'pg'; +import { QueryConfig } from 'pg'; +import type { QueryConfigValues } from 'pg'; +import { QueryParse } from 'pg'; +import { QueryResult } from 'pg'; +import { QueryResultBase } from 'pg'; +import { QueryResultRow } from 'pg'; +import { ResultBuilder } from 'pg'; +import type { Socket } from 'net'; +import { Submittable } from 'pg'; +import { types } from 'pg'; + +declare const allKeyUsages: readonly ["digitalSignature", "nonRepudiation", "keyEncipherment", "dataEncipherment", "keyAgreement", "keyCertSign", "cRLSign", "encipherOnly", "decipherOnly"]; + +declare class ASN1Bytes extends Bytes { + readASN1Length(comment?: string): number; + expectASN1Length(comment?: string): readonly [() => void, () => number]; + readASN1OID(comment?: string): string; + readASN1Boolean(comment?: string): boolean; + readASN1UTCTime(): Date; + readASN1GeneralizedTime(): Date; + readASN1BitString(): Uint8Array; +} + +declare function base64Decode(input: string, charCodes?: typeof stdCharCodes, autoPad?: boolean): Uint8Array; + +export { BindConfig } + +export declare const _bundleExt: 'js' | 'mjs'; + +declare class Bytes { + offset: number; + dataView: DataView; + data: Uint8Array; + comments: Record; + indents: Record; + indent: number; + constructor(arrayOrMaxBytes: number | Uint8Array); + extend(arrayOrMaxBytes: number | Uint8Array): void; + remaining(): number; + subarray(length: number): Uint8Array; + skip(length: number, comment?: string): this; + comment(s: string, offset?: number): this; + lengthComment(length: number, comment?: string, inclusive?: boolean): string; + readBytes(length: number): Uint8Array; + readUTF8String(length: number): string; + readUTF8StringNullTerminated(): string; + readUint8(comment?: string): number; + readUint16(comment?: string): number; + readUint24(comment?: string): number; + readUint32(comment?: string): number; + expectBytes(expected: Uint8Array | number[], comment?: string): void; + expectUint8(expectedValue: number, comment?: string): void; + expectUint16(expectedValue: number, comment?: string): void; + expectUint24(expectedValue: number, comment?: string): void; + expectUint32(expectedValue: number, comment?: string): void; + expectLength(length: number, indentDelta?: number): readonly [() => void, () => number]; + expectLengthUint8(comment?: string): readonly [() => void, () => number]; + expectLengthUint16(comment?: string): readonly [() => void, () => number]; + expectLengthUint24(comment?: string): readonly [() => void, () => number]; + expectLengthUint32(comment?: string): readonly [() => void, () => number]; + expectLengthUint8Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint16Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint24Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint32Incl(comment?: string): readonly [() => void, () => number]; + writeBytes(bytes: number[] | Uint8Array): this; + writeUTF8String(s: string): this; + writeUTF8StringNullTerminated(s: string): this; + writeUint8(value: number, comment?: string): Bytes; + writeUint16(value: number, comment?: string): Bytes; + writeUint24(value: number, comment?: string): Bytes; + writeUint32(value: number, comment?: string): Bytes; + _writeLengthGeneric(lengthBytes: 1 | 2 | 3 | 4, inclusive: boolean, comment?: string): () => void; + writeLengthUint8(comment?: string): () => void; + writeLengthUint16(comment?: string): () => void; + writeLengthUint24(comment?: string): () => void; + writeLengthUint32(comment?: string): () => void; + writeLengthUint8Incl(comment?: string): () => void; + writeLengthUint16Incl(comment?: string): () => void; + writeLengthUint24Incl(comment?: string): () => void; + writeLengthUint32Incl(comment?: string): () => void; + array(): Uint8Array; + commentedString(all?: boolean): string; +} + +declare class Cert { + serialNumber: Uint8Array; + algorithm: OID; + issuer: DistinguishedName; + validityPeriod: { + notBefore: Date; + notAfter: Date; + }; + subject: DistinguishedName; + publicKey: { + identifiers: OID[]; + data: Uint8Array; + all: Uint8Array; + }; + signature: Uint8Array; + keyUsage?: { + critical?: boolean; + usages: Set; + }; + subjectAltNames?: string[]; + extKeyUsage?: { + clientTls?: true; + serverTls?: true; + }; + authorityKeyIdentifier?: Uint8Array; + subjectKeyIdentifier?: Uint8Array; + basicConstraints?: { + critical?: boolean; + ca?: boolean; + pathLength?: number; + } | undefined; + signedData: Uint8Array; + static distinguishedNamesAreEqual(dn1: DistinguishedName, dn2: DistinguishedName): boolean; + static stringFromDistinguishedName(dn: DistinguishedName): string; + constructor(certData: Uint8Array | ASN1Bytes | CertJSON); + subjectAltNameMatchingHost(host: string): string | undefined; + isValidAtMoment(moment?: Date): boolean; + description(): string; + toJSON(): { + serialNumber: string; + algorithm: string; + issuer: DistinguishedName; + validityPeriod: { + notBefore: string; + notAfter: string; + }; + subject: DistinguishedName; + publicKey: { + identifiers: string[]; + data: string; + all: string; + }; + signature: string; + keyUsage: { + critical: boolean | undefined; + usages: ("digitalSignature" | "nonRepudiation" | "keyEncipherment" | "dataEncipherment" | "keyAgreement" | "keyCertSign" | "cRLSign" | "encipherOnly" | "decipherOnly")[]; + }; + subjectAltNames: string[] | undefined; + extKeyUsage: { + clientTls?: true; + serverTls?: true; + } | undefined; + authorityKeyIdentifier: string | undefined; + subjectKeyIdentifier: string | undefined; + basicConstraints: { + critical?: boolean; + ca?: boolean; + pathLength?: number; + } | undefined; + signedData: string; + }; + static uint8ArraysFromPEM(pem: string): Uint8Array[]; + static fromPEM(pem: string): Cert[]; +} + +declare type CertJSON = ReturnType; + +export declare interface Client { + connection: Connection & { + stream: neonConfig; + sendSCRAMClientFinalMessage: (response: any) => void; + ssl: any; + }; + _handleReadyForQuery: any; + _handleAuthCleartextPassword: any; + startup: any; + getStartupConf: any; + saslSession: any; +} + +/** + * The node-postgres `Client` object re-exported with minor modifications. + * https://node-postgres.com/apis/client + */ +export declare class Client extends Client_2 { + config: any; + get neonConfig(): neonConfig; + constructor(config: any); + connect(): Promise; + connect(callback: (err?: Error) => void): void; + _handleAuthSASLContinue(msg: any): Promise; +} + +export { ClientBase } + +export { ClientConfig } + +export { Connection } + +export { ConnectionConfig } + +export { CustomTypesConfig } + +declare interface DataRequest { + bytes: number; + resolve: (data: Uint8Array | undefined) => void; +} + +export { Defaults } + +export { defaults } + +declare type DistinguishedName = Record; + +export { Events } + +export { ExecuteConfig } + +export declare interface FetchEndpointOptions { + jwtAuth?: boolean; +} + +export { FieldDef } + +export declare interface FullQueryResults { + fields: FieldDef[]; + command: string; + rowCount: number; + rows: QueryRows; + rowAsArray: ArrayMode; +} + +declare function hexFromU8(u8: Uint8Array | number[], spacer?: string): string; + +export declare interface HTTPQueryOptions { + /** + * When `arrayMode` is `false`, which is the default, result rows are + * returned as objects whose keys represent column names, such as + * `{ id: 1 }`). + * + * When `arrayMode` is `true`, rows are returned as arrays (and keys are not + * provided), e.g. `[1]`. + */ + arrayMode?: ArrayMode; + /** + * When `fullResults` is `false`, which is the default, only result rows are + * returned, e.g. `[{ id: 1 }]`). + * + * When `fullResults` is `true`, a result object is returned that matches + * what's returned by node-postgres. This has a `rows` property, which is an + * array of result rows, plus `fields`, which provides column names and + * types, `command` and `rowCount`. + */ + fullResults?: FullResults; + /** + * Any options in `fetchOptions` are merged in to the options passed to + * `fetch`. In case of conflict with what would otherwise be passed, these + * options take precedence. + */ + fetchOptions?: Record; + /** + * JWT auth token to be passed as the Bearer token in the Authorization header. + * Can be string, or a function (sync or async) returning a string. + * + * Default: `undefined` + */ + authToken?: string | (() => Promise | string); + /** + * Custom type parsers. See https://github.com/brianc/node-pg-types. + */ + types?: typeof types; + queryCallback?: (query: ParameterizedQuery) => void; + resultCallback?: (query: ParameterizedQuery, result: any, rows: any, opts: any) => void; +} + +export declare interface HTTPTransactionOptions extends HTTPQueryOptions { + isolationLevel?: 'ReadUncommitted' | 'ReadCommitted' | 'RepeatableRead' | 'Serializable'; + readOnly?: boolean; + deferrable?: boolean; +} + +export { MessageConfig } + +/** + * This function returns an async tagged-template function that runs a single + * SQL query (no session or transactions) with low latency over https. Support + * for multiple queries (as a non-interactive transaction) is provided by + * the `transaction` property of the query function. + * + * By default, the query function returns database rows directly. Types should + * match those returned by this driver (i.e. Pool or Client) over WebSockets. + * + * The returned function can also be called directly (i.e. not as a template + * function). In that case, pass it a query string with embedded `$1`, `$2` + * (etc.), followed by an array of query parameters, followed (optionally) by + * any of the same options you can pass to this function. + * + * Some examples: + * ``` + * import { neon } from "@neondatabase/serverless"; + * const h = "hello", w = "world"; + * + * // example 1: default options, tagged-template usage + * const sql = neon("postgres://user:pass@host/db"); + * const rows = await sql`SELECT ${h} || ' ' || ${w} AS greeting`; + * // -> [ { greeting: "hello world" } ] + * + * // example 2: `arrayMode` and `fullResults` options, ordinary function usage + * const options = { arrayMode: true, fullResults: true }; + * const sql = neon("postgres://user:pass@host/db", options); + * const rows = await sql("SELECT $1 || ' ' || $2 AS greeting", [h, w]); + * // -> { + * // command: "SELECT", + * // fields: [ { name: "greeting", dataTypeID: 25 } ], + * // rowAsArray: true, + * // rowCount: 1, + * // rows: [ [ "hello world" ] ] + * // } + * + * // example 3: `fetchOptions` option, ordinary function usage + * const sql = neon("postgres://user:pass@host/db"); + * const rows = await sql( + * "SELECT $1 || ' ' || $2 AS greeting", [h, w], + * { fetchOptions: { priority: "high" } } + * ); + * // -> [ { greeting: "hello world" } ] + * ``` + * + * @param connectionString - this has the format `postgres://user:pass@host/db` + * @param options - pass `arrayMode: true` to receive results as an array of + * arrays, instead of the default array of objects; pass `fullResults: true` + * to receive a complete result object similar to one returned by node-postgres + * (with properties `rows`, `fields`, `command`, `rowCount`, `rowAsArray`); + * pass as `fetchOptions` an object which will be merged into the options + * passed to `fetch`. + */ +export declare function neon(connectionString: string, { arrayMode: neonOptArrayMode, fullResults: neonOptFullResults, fetchOptions: neonOptFetchOptions, isolationLevel: neonOptIsolationLevel, readOnly: neonOptReadOnly, deferrable: neonOptDeferrable, queryCallback, resultCallback, authToken, }?: HTTPTransactionOptions): NeonQueryFunction; + +export declare class neonConfig extends EventEmitter { + static defaults: SocketDefaults; + static opts: Partial; + /** + * **Experimentally**, when `poolQueryViaFetch` is `true`, and no listeners + * for the `"connect"`, `"acquire"`, `"release"` or `"remove"` events are set + * on the `Pool`, queries via `Pool.query()` will be sent by low-latency HTTP + * fetch request. + * + * Default: `false`. + */ + static get poolQueryViaFetch(): SocketDefaults["poolQueryViaFetch"]; + static set poolQueryViaFetch(newValue: SocketDefaults['poolQueryViaFetch']); + /** + * Set `fetchEndpoint` to set the server endpoint to be sent queries via http + * fetch. May be useful in local development (e.g. to set a port that's not + * the default 443). + * + * Provide either the full endpoint URL, or a function that takes the + * database host address, port and options, and returns the full endpoint URL + * (including protocol). + * + * Default: custom logic to connect to Neon endpoints. + */ + static get fetchEndpoint(): SocketDefaults["fetchEndpoint"]; + static set fetchEndpoint(newValue: SocketDefaults['fetchEndpoint']); + /** + * **DEPRECATED**. Previously, only when `fetchConnectionCache` was `true` + * did queries carried via HTTP fetch make use of a connection pool/cache + * on the server. All queries now use the connection pool/cache: this setting + * is ignored. + * + * Default: `true`. + */ + static get fetchConnectionCache(): SocketDefaults["fetchConnectionCache"]; + static set fetchConnectionCache(newValue: SocketDefaults['fetchConnectionCache']); + /** + * The `fetchFunction` option allows you to supply an alternative function + * for making http requests. The function must accept the same arguments as + * native `fetch`. + * + * Default: `undefined`. + */ + static get fetchFunction(): SocketDefaults["fetchFunction"]; + static set fetchFunction(newValue: SocketDefaults['fetchFunction']); + /** + * Only if no global `WebSocket` object is available, such as in older + * versions of Node, set `webSocketConstructor` to the constructor for a + * custom WebSocket implementation, such as those provided by `ws` or + * `undici`. + * + * Default: `undefined`. + */ + static get webSocketConstructor(): SocketDefaults["webSocketConstructor"]; + static set webSocketConstructor(newValue: SocketDefaults['webSocketConstructor']); + get webSocketConstructor(): SocketDefaults["webSocketConstructor"]; + set webSocketConstructor(newValue: SocketDefaults['webSocketConstructor']); + /** + * Set `wsProxy` to use your own WebSocket proxy server. + * + * Provide either the proxy server’s domain name, or a function that takes + * the database host and port and returns the proxy server address (without + * protocol). + * + * Example: `(host, port) => "myproxy.example.net?address=" + host + ":" + port` + * + * Default: `host => host + '/v2'` + */ + static get wsProxy(): SocketDefaults["wsProxy"]; + static set wsProxy(newValue: SocketDefaults['wsProxy']); + get wsProxy(): SocketDefaults["wsProxy"]; + set wsProxy(newValue: SocketDefaults['wsProxy']); + /** + * Batch multiple network writes per run-loop into a single outgoing + * WebSocket message. + * + * Default: `true`. + */ + static get coalesceWrites(): SocketDefaults["coalesceWrites"]; + static set coalesceWrites(newValue: SocketDefaults['coalesceWrites']); + get coalesceWrites(): SocketDefaults["coalesceWrites"]; + set coalesceWrites(newValue: SocketDefaults['coalesceWrites']); + /** + * Use a secure (`wss:`) connection to the WebSocket proxy. + * + * Default: `true`. + */ + static get useSecureWebSocket(): SocketDefaults["useSecureWebSocket"]; + static set useSecureWebSocket(newValue: SocketDefaults['useSecureWebSocket']); + get useSecureWebSocket(): SocketDefaults["useSecureWebSocket"]; + set useSecureWebSocket(newValue: SocketDefaults['useSecureWebSocket']); + /** + * Disable TLS encryption in the Postgres protocol (as set via e.g. + * `?sslmode=require` in the connection string). Connection remains secure + * as long as `useSecureWebSocket` is `true`, which is the default. + * + * Default: `true` + */ + static get forceDisablePgSSL(): SocketDefaults["forceDisablePgSSL"]; + static set forceDisablePgSSL(newValue: SocketDefaults['forceDisablePgSSL']); + get forceDisablePgSSL(): SocketDefaults["forceDisablePgSSL"]; + set forceDisablePgSSL(newValue: SocketDefaults['forceDisablePgSSL']); + /** + * When using subtls with `forceDisablePgSSL = false` and Postgres connection + * parameters that specify TLS, setting `disableSNI = true` means that no SNI + * data in included in the Postgres TLS handshake. + * + * On Neon, disabling SNI and including the Neon project name in the password + * avoids CPU-intensive SCRAM authentication, but this is only relevant for + * earlier iterations of Neon's WebSocket support. + * + * Default: `false`. + */ + static get disableSNI(): SocketDefaults["disableSNI"]; + static set disableSNI(newValue: SocketDefaults['disableSNI']); + get disableSNI(): SocketDefaults["disableSNI"]; + set disableSNI(newValue: SocketDefaults['disableSNI']); + /** + * Pipelines the startup message, cleartext password message and first query + * when set to `"password"`. This works only for cleartext password auth. + * + * Default: `"password"`. + */ + static get pipelineConnect(): SocketDefaults["pipelineConnect"]; + static set pipelineConnect(newValue: SocketDefaults['pipelineConnect']); + get pipelineConnect(): SocketDefaults["pipelineConnect"]; + set pipelineConnect(newValue: SocketDefaults['pipelineConnect']); + /** + * If `forceDisablePgSSL` is `false` and the Postgres connection parameters + * specify TLS, you must supply the subtls TLS library to this option: + * + * ``` + * import { neonConfig } from '@neondatabase/serverless'; + * import * as subtls from 'subtls'; + * neonConfig.subtls = subtls; + * ``` + * + * Default: `undefined`. + */ + static get subtls(): SocketDefaults["subtls"]; + static set subtls(newValue: SocketDefaults['subtls']); + get subtls(): SocketDefaults["subtls"]; + set subtls(newValue: SocketDefaults['subtls']); + /** + * Pipeline the pg SSL request and TLS handshake when `forceDisablePgSSL` is + * `false` and the Postgres connection parameters specify TLS. Currently + * compatible only with Neon hosts. + * + * Default: `false`. + */ + static get pipelineTLS(): SocketDefaults["pipelineTLS"]; + static set pipelineTLS(newValue: SocketDefaults['pipelineTLS']); + get pipelineTLS(): SocketDefaults["pipelineTLS"]; + set pipelineTLS(newValue: SocketDefaults['pipelineTLS']); + /** + * Set `rootCerts` to a string comprising one or more PEM files. These are + * the trusted root certificates for a TLS connection to Postgres when + * `forceDisablePgSSL` is `false` and the Postgres connection parameters + * specify TLS. + * + * Default: `""`. + */ + static get rootCerts(): SocketDefaults["rootCerts"]; + static set rootCerts(newValue: SocketDefaults['rootCerts']); + get rootCerts(): SocketDefaults["rootCerts"]; + set rootCerts(newValue: SocketDefaults['rootCerts']); + wsProxyAddrForHost(host: string, port: number): string; + connecting: boolean; + pending: boolean; + writable: boolean; + encrypted: boolean; + authorized: boolean; + destroyed: boolean; + setNoDelay(): this; + setKeepAlive(): this; + ref(): this; + unref(): this; + connect(port: number | string, host: string, connectListener?: () => void): void; + startTls(host: string): Promise; + tlsReadLoop(): Promise; + rawWrite(data: Uint8Array): void; + write(data: Buffer | string, encoding?: string, callback?: (err?: any) => void): boolean; + end(data?: Buffer | string, encoding?: string, callback?: () => void): this; + destroy(): this; +} + +export declare class NeonDbError extends Error { + name: "NeonDbError"; + severity: string | undefined; + code: string | undefined; + detail: string | undefined; + hint: string | undefined; + position: string | undefined; + internalPosition: string | undefined; + internalQuery: string | undefined; + where: string | undefined; + schema: string | undefined; + table: string | undefined; + column: string | undefined; + dataType: string | undefined; + constraint: string | undefined; + file: string | undefined; + line: string | undefined; + routine: string | undefined; + sourceError: Error | undefined; + constructor(message: string); +} + +export declare interface NeonQueryFunction { + (strings: TemplateStringsArray, ...params: any[]): NeonQueryPromise : QueryRows>; + (string: string, params?: any[], opts?: HTTPQueryOptions): NeonQueryPromise : QueryRows>; + /** + * The `transaction()` function allows multiple queries to be submitted (over + * HTTP) as a single, non-interactive Postgres transaction. + * + * For example: + * ``` + * import { neon } from "@neondatabase/serverless"; + * const sql = neon("postgres://user:pass@host/db"); + * + * const results = await sql.transaction([ + * sql`SELECT 1 AS num`, + * sql`SELECT 'a' AS str`, + * ]); + * // -> [[{ num: 1 }], [{ str: "a" }]] + * + * // or equivalently: + * const results = await sql.transaction(txn => [ + * txn`SELECT 1 AS num`, + * txn`SELECT 'a' AS str`, + * ]); + * // -> [[{ num: 1 }], [{ str: "a" }]] + * ``` + * @param queriesOrFn - Either an array of queries, or a (non-`async`) function + * that receives a query function and returns an array of queries. + * @param opts - The same options that may be set on individual queries in a + * non-transaction setting -- that is, `arrayMode` `fullResults` and + * `fetchOptions` -- plus the transaction options `isolationLevel`, + * `readOnly` and `deferrable`. Note that none of these options can be set on + * individual queries within a transaction. + * @returns An array of results. The structure of each result object depends + * on the `arrayMode` and `fullResults` options. + */ + transaction: (queriesOrFn: NeonQueryPromise[] | ((sql: NeonQueryFunctionInTransaction) => NeonQueryInTransaction[]), opts?: HTTPTransactionOptions) => Promise[] : QueryRows[]>; +} + +export declare interface NeonQueryFunctionInTransaction { + (strings: TemplateStringsArray, ...params: any[]): NeonQueryPromise : QueryRows>; + (string: string, params?: any[]): NeonQueryPromise : QueryRows>; +} + +export declare interface NeonQueryInTransaction { + parameterizedQuery: ParameterizedQuery; +} + +export declare interface NeonQueryPromise extends Promise { + parameterizedQuery: ParameterizedQuery; + opts?: HTTPQueryOptions; +} + +export { Notification } + +declare type OID = string; + +export declare interface ParameterizedQuery { + query: string; + params: any[]; +} + +/** + * The node-postgres `Pool` object re-exported with minor modifications. + * https://node-postgres.com/apis/pool + */ +export declare class Pool extends Pool_2 { + Client: typeof Client; + hasFetchUnsupportedListeners: boolean; + on(event: 'error' | 'connect' | 'acquire' | 'release' | 'remove', listener: any): this; + addListener: (event: "error" | "connect" | "acquire" | "release" | "remove", listener: any) => this; + query(queryStream: T): T; + query(queryConfig: QueryArrayConfig, values?: QueryConfigValues): Promise>; + query(queryConfig: QueryConfig): Promise>; + query(queryTextOrConfig: string | QueryConfig, values?: QueryConfigValues): Promise>; + query(queryConfig: QueryArrayConfig, callback: (err: Error, result: QueryArrayResult) => void): void; + query(queryTextOrConfig: string | QueryConfig, callback: (err: Error, result: QueryResult) => void): void; + query(queryText: string, values: QueryConfigValues, callback: (err: Error, result: QueryResult) => void): void; +} + +export { PoolConfig } + +export declare interface ProcessQueryResultOptions { + arrayMode: boolean; + fullResults: boolean; + parameterizedQuery: ParameterizedQuery; + resultCallback: HTTPQueryOptions['resultCallback']; + types?: typeof types; +} + +export { Query } + +export { QueryArrayConfig } + +export { QueryArrayResult } + +export { QueryConfig } + +export { QueryParse } + +export { QueryResult } + +export { QueryResultBase } + +export { QueryResultRow } + +export declare type QueryRows = ArrayMode extends true ? any[][] : Record[]; + +declare abstract class ReadQueue { + queue: Uint8Array[]; + outstandingRequest: DataRequest | undefined; + constructor(); + abstract socketIsNotClosed(): boolean; + enqueue(data: Uint8Array): void; + dequeue(): void; + bytesInQueue(): number; + read(bytes: number): Promise | undefined>; +} + +export { ResultBuilder } + +declare type RootCertsData = Uint8Array; + +declare interface RootCertsDatabase { + index: RootCertsIndex; + data: RootCertsData; +} + +declare interface RootCertsIndex { + offsets: number[]; + subjects: Record; +} + +export declare interface SocketDefaults { + poolQueryViaFetch: boolean; + fetchEndpoint: string | ((host: string, port: number | string, options?: FetchEndpointOptions) => string); + fetchConnectionCache: boolean; + fetchFunction: any; + webSocketConstructor: WebSocketConstructor | undefined; + wsProxy: string | ((host: string, port: number | string) => string); + useSecureWebSocket: boolean; + forceDisablePgSSL: boolean; + coalesceWrites: boolean; + pipelineConnect: 'password' | false; + subtls: typeof subtls | undefined; + rootCerts: string; + pipelineTLS: boolean; + disableSNI: boolean; +} + +declare class SocketReadQueue extends ReadQueue { + constructor(socket: Socket); + socketIsNotClosed(): boolean; +} + +declare function stableStringify(x: any, replacer?: (key: string, value: any) => any, indent?: string | number): string; + +declare function startTls(host: string, rootCertsDatabase: RootCertsDatabase | string, networkRead: (bytes: number) => Promise, networkWrite: (data: Uint8Array) => void, { useSNI, requireServerTlsExtKeyUsage, requireDigitalSigKeyUsage, writePreData, expectPreData, commentPreData }?: { + useSNI?: boolean; + requireServerTlsExtKeyUsage?: boolean; + requireDigitalSigKeyUsage?: boolean; + writePreData?: Uint8Array; + expectPreData?: Uint8Array; + commentPreData?: string; +}): Promise Promise | undefined>, (data: Uint8Array) => Promise]>; + +declare function stdCharCodes(charCode: number): number | void; + +export { Submittable } + +declare namespace subtls { + export { + base64Decode, + hexFromU8, + stableStringify, + startTls, + stdCharCodes, + u8FromHex, + allKeyUsages, + ASN1Bytes, + Bytes, + Cert, + CertJSON, + DataRequest, + DistinguishedName, + OID, + ReadQueue, + RootCertsData, + RootCertsDatabase, + RootCertsIndex, + SocketReadQueue, + TrustedCert, + WebSocketReadQueue + } +} +export { subtls } + +declare class TrustedCert extends Cert { + static databaseFromPEM(pem: string): RootCertsDatabase; + static findInDatabase(subjectOrSubjectKeyId: DistinguishedName | string, db: RootCertsDatabase): TrustedCert | undefined; +} + +export { types } + +declare function u8FromHex(hex: string): Uint8Array; + +export declare interface WebSocketConstructor { + new (...args: any[]): WebSocketLike; +} + +export declare interface WebSocketLike { + readonly readyState: number; + binaryType: string; + close(code?: number, reason?: string): void; + send(data: any): void; + addEventListener(type: 'open' | 'message' | 'close' | 'error', listener: (this: WebSocketLike, ev: any) => any, options?: any): void; +} + +declare class WebSocketReadQueue extends ReadQueue { + constructor(socket: WebSocket); + socketIsNotClosed(): boolean; +} + diff --git a/dist/dts/_extracted.d.ts.orig b/dist/dts/_extracted.d.ts.orig new file mode 100644 index 0000000..ca92e54 --- /dev/null +++ b/dist/dts/_extracted.d.ts.orig @@ -0,0 +1,793 @@ +/// + +import { BindConfig } from 'pg'; +import { Client as Client_2 } from 'pg'; +import { ClientBase } from 'pg'; +import { ClientConfig } from 'pg'; +import { Connection } from 'pg'; +import { ConnectionConfig } from 'pg'; +import { CustomTypesConfig } from 'pg'; +import { Defaults } from 'pg'; +import { defaults } from 'pg'; +import { EventEmitter } from 'events'; +import { Events } from 'pg'; +import { ExecuteConfig } from 'pg'; +import { FieldDef } from 'pg'; +import { MessageConfig } from 'pg'; +import { Notification } from 'pg'; +import { Pool as Pool_2 } from 'pg'; +import { PoolConfig } from 'pg'; +import { Query } from 'pg'; +import { QueryArrayConfig } from 'pg'; +import { QueryArrayResult } from 'pg'; +import { QueryConfig } from 'pg'; +import type { QueryConfigValues } from 'pg'; +import { QueryParse } from 'pg'; +import { QueryResult } from 'pg'; +import { QueryResultBase } from 'pg'; +import { QueryResultRow } from 'pg'; +import { ResultBuilder } from 'pg'; +import type { Socket } from 'net'; +import { Submittable } from 'pg'; +import { types } from 'pg'; + +declare const allKeyUsages: readonly ["digitalSignature", "nonRepudiation", "keyEncipherment", "dataEncipherment", "keyAgreement", "keyCertSign", "cRLSign", "encipherOnly", "decipherOnly"]; + +declare class ASN1Bytes extends Bytes { + readASN1Length(comment?: string): number; + expectASN1Length(comment?: string): readonly [() => void, () => number]; + readASN1OID(comment?: string): string; + readASN1Boolean(comment?: string): boolean; + readASN1UTCTime(): Date; + readASN1GeneralizedTime(): Date; + readASN1BitString(): Uint8Array; +} + +declare function base64Decode(input: string, charCodes?: typeof stdCharCodes, autoPad?: boolean): Uint8Array; + +export { BindConfig } + +export declare const _bundleExt: 'js' | 'mjs'; + +declare class Bytes { + offset: number; + dataView: DataView; + data: Uint8Array; + comments: Record; + indents: Record; + indent: number; + constructor(arrayOrMaxBytes: number | Uint8Array); + extend(arrayOrMaxBytes: number | Uint8Array): void; + remaining(): number; + subarray(length: number): Uint8Array; + skip(length: number, comment?: string): this; + comment(s: string, offset?: number): this; + lengthComment(length: number, comment?: string, inclusive?: boolean): string; + readBytes(length: number): Uint8Array; + readUTF8String(length: number): string; + readUTF8StringNullTerminated(): string; + readUint8(comment?: string): number; + readUint16(comment?: string): number; + readUint24(comment?: string): number; + readUint32(comment?: string): number; + expectBytes(expected: Uint8Array | number[], comment?: string): void; + expectUint8(expectedValue: number, comment?: string): void; + expectUint16(expectedValue: number, comment?: string): void; + expectUint24(expectedValue: number, comment?: string): void; + expectUint32(expectedValue: number, comment?: string): void; + expectLength(length: number, indentDelta?: number): readonly [() => void, () => number]; + expectLengthUint8(comment?: string): readonly [() => void, () => number]; + expectLengthUint16(comment?: string): readonly [() => void, () => number]; + expectLengthUint24(comment?: string): readonly [() => void, () => number]; + expectLengthUint32(comment?: string): readonly [() => void, () => number]; + expectLengthUint8Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint16Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint24Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint32Incl(comment?: string): readonly [() => void, () => number]; + writeBytes(bytes: number[] | Uint8Array): this; + writeUTF8String(s: string): this; + writeUTF8StringNullTerminated(s: string): this; + writeUint8(value: number, comment?: string): Bytes; + writeUint16(value: number, comment?: string): Bytes; + writeUint24(value: number, comment?: string): Bytes; + writeUint32(value: number, comment?: string): Bytes; + _writeLengthGeneric(lengthBytes: 1 | 2 | 3 | 4, inclusive: boolean, comment?: string): () => void; + writeLengthUint8(comment?: string): () => void; + writeLengthUint16(comment?: string): () => void; + writeLengthUint24(comment?: string): () => void; + writeLengthUint32(comment?: string): () => void; + writeLengthUint8Incl(comment?: string): () => void; + writeLengthUint16Incl(comment?: string): () => void; + writeLengthUint24Incl(comment?: string): () => void; + writeLengthUint32Incl(comment?: string): () => void; + array(): Uint8Array; + commentedString(all?: boolean): string; +} + +declare class Cert { + serialNumber: Uint8Array; + algorithm: OID; + issuer: DistinguishedName; + validityPeriod: { + notBefore: Date; + notAfter: Date; + }; + subject: DistinguishedName; + publicKey: { + identifiers: OID[]; + data: Uint8Array; + all: Uint8Array; + }; + signature: Uint8Array; + keyUsage?: { + critical?: boolean; + usages: Set; + }; + subjectAltNames?: string[]; + extKeyUsage?: { + clientTls?: true; + serverTls?: true; + }; + authorityKeyIdentifier?: Uint8Array; + subjectKeyIdentifier?: Uint8Array; + basicConstraints?: { + critical?: boolean; + ca?: boolean; + pathLength?: number; + } | undefined; + signedData: Uint8Array; + static distinguishedNamesAreEqual(dn1: DistinguishedName, dn2: DistinguishedName): boolean; + static stringFromDistinguishedName(dn: DistinguishedName): string; + constructor(certData: Uint8Array | ASN1Bytes | CertJSON); + subjectAltNameMatchingHost(host: string): string | undefined; + isValidAtMoment(moment?: Date): boolean; + description(): string; + toJSON(): { + serialNumber: string; + algorithm: string; + issuer: DistinguishedName; + validityPeriod: { + notBefore: string; + notAfter: string; + }; + subject: DistinguishedName; + publicKey: { + identifiers: string[]; + data: string; + all: string; + }; + signature: string; + keyUsage: { + critical: boolean | undefined; + usages: ("digitalSignature" | "nonRepudiation" | "keyEncipherment" | "dataEncipherment" | "keyAgreement" | "keyCertSign" | "cRLSign" | "encipherOnly" | "decipherOnly")[]; + }; + subjectAltNames: string[] | undefined; + extKeyUsage: { + clientTls?: true; + serverTls?: true; + } | undefined; + authorityKeyIdentifier: string | undefined; + subjectKeyIdentifier: string | undefined; + basicConstraints: { + critical?: boolean; + ca?: boolean; + pathLength?: number; + } | undefined; + signedData: string; + }; + static uint8ArraysFromPEM(pem: string): Uint8Array[]; + static fromPEM(pem: string): Cert[]; +} + +declare type CertJSON = ReturnType; + +export declare interface Client { + connection: Connection & { + stream: neonConfig; + sendSCRAMClientFinalMessage: (response: any) => void; + ssl: any; + }; + _handleReadyForQuery: any; + _handleAuthCleartextPassword: any; + startup: any; + getStartupConf: any; + saslSession: any; +} + +/** + * The node-postgres `Client` object re-exported with minor modifications. + * https://node-postgres.com/apis/client + */ +export declare class Client extends Client_2 { + config: any; + get neonConfig(): neonConfig; + constructor(config: any); + connect(): Promise; + connect(callback: (err?: Error) => void): void; + _handleAuthSASLContinue(msg: any): Promise; +} + +export { ClientBase } + +export { ClientConfig } + +export { Connection } + +export { ConnectionConfig } + +export { CustomTypesConfig } + +declare interface DataRequest { + bytes: number; + resolve: (data: Uint8Array | undefined) => void; +} + +export { Defaults } + +export { defaults } + +declare type DistinguishedName = Record; + +export { Events } + +export { ExecuteConfig } + +export declare interface FetchEndpointOptions { + jwtAuth?: boolean; +} + +export { FieldDef } + +export declare interface FullQueryResults { + fields: FieldDef[]; + command: string; + rowCount: number; + rows: QueryRows; + rowAsArray: ArrayMode; +} + +declare function hexFromU8(u8: Uint8Array | number[], spacer?: string): string; + +export declare interface HTTPQueryOptions { + /** + * When `arrayMode` is `false`, which is the default, result rows are + * returned as objects whose keys represent column names, such as + * `{ id: 1 }`). + * + * When `arrayMode` is `true`, rows are returned as arrays (and keys are not + * provided), e.g. `[1]`. + */ + arrayMode?: ArrayMode; + /** + * When `fullResults` is `false`, which is the default, only result rows are + * returned, e.g. `[{ id: 1 }]`). + * + * When `fullResults` is `true`, a result object is returned that matches + * what's returned by node-postgres. This has a `rows` property, which is an + * array of result rows, plus `fields`, which provides column names and + * types, `command` and `rowCount`. + */ + fullResults?: FullResults; + /** + * Any options in `fetchOptions` are merged in to the options passed to + * `fetch`. In case of conflict with what would otherwise be passed, these + * options take precedence. + */ + fetchOptions?: Record; + /** + * JWT auth token to be passed as the Bearer token in the Authorization header. + * Can be string, or a function (sync or async) returning a string. + * + * Default: `undefined` + */ + authToken?: string | (() => Promise | string); + /** + * Custom type parsers. See https://github.com/brianc/node-pg-types. + */ + types?: typeof types; + queryCallback?: (query: ParameterizedQuery) => void; + resultCallback?: (query: ParameterizedQuery, result: any, rows: any, opts: any) => void; +} + +export declare interface HTTPTransactionOptions extends HTTPQueryOptions { + isolationLevel?: 'ReadUncommitted' | 'ReadCommitted' | 'RepeatableRead' | 'Serializable'; + readOnly?: boolean; + deferrable?: boolean; +} + +export { MessageConfig } + +/** + * This function returns an async tagged-template function that runs a single + * SQL query (no session or transactions) with low latency over https. Support + * for multiple queries (as a non-interactive transaction) is provided by + * the `transaction` property of the query function. + * + * By default, the query function returns database rows directly. Types should + * match those returned by this driver (i.e. Pool or Client) over WebSockets. + * + * The returned function can also be called directly (i.e. not as a template + * function). In that case, pass it a query string with embedded `$1`, `$2` + * (etc.), followed by an array of query parameters, followed (optionally) by + * any of the same options you can pass to this function. + * + * Some examples: + * ``` + * import { neon } from "@neondatabase/serverless"; + * const h = "hello", w = "world"; + * + * // example 1: default options, tagged-template usage + * const sql = neon("postgres://user:pass@host/db"); + * const rows = await sql`SELECT ${h} || ' ' || ${w} AS greeting`; + * // -> [ { greeting: "hello world" } ] + * + * // example 2: `arrayMode` and `fullResults` options, ordinary function usage + * const options = { arrayMode: true, fullResults: true }; + * const sql = neon("postgres://user:pass@host/db", options); + * const rows = await sql("SELECT $1 || ' ' || $2 AS greeting", [h, w]); + * // -> { + * // command: "SELECT", + * // fields: [ { name: "greeting", dataTypeID: 25 } ], + * // rowAsArray: true, + * // rowCount: 1, + * // rows: [ [ "hello world" ] ] + * // } + * + * // example 3: `fetchOptions` option, ordinary function usage + * const sql = neon("postgres://user:pass@host/db"); + * const rows = await sql( + * "SELECT $1 || ' ' || $2 AS greeting", [h, w], + * { fetchOptions: { priority: "high" } } + * ); + * // -> [ { greeting: "hello world" } ] + * ``` + * + * @param connectionString - this has the format `postgres://user:pass@host/db` + * @param options - pass `arrayMode: true` to receive results as an array of + * arrays, instead of the default array of objects; pass `fullResults: true` + * to receive a complete result object similar to one returned by node-postgres + * (with properties `rows`, `fields`, `command`, `rowCount`, `rowAsArray`); + * pass as `fetchOptions` an object which will be merged into the options + * passed to `fetch`. + */ +export declare function neon(connectionString: string, { arrayMode: neonOptArrayMode, fullResults: neonOptFullResults, fetchOptions: neonOptFetchOptions, isolationLevel: neonOptIsolationLevel, readOnly: neonOptReadOnly, deferrable: neonOptDeferrable, queryCallback, resultCallback, authToken, }?: HTTPTransactionOptions): NeonQueryFunction; + +export declare class neonConfig extends EventEmitter { + static defaults: SocketDefaults; + static opts: Partial; + private opts; + /** + * **Experimentally**, when `poolQueryViaFetch` is `true`, and no listeners + * for the `"connect"`, `"acquire"`, `"release"` or `"remove"` events are set + * on the `Pool`, queries via `Pool.query()` will be sent by low-latency HTTP + * fetch request. + * + * Default: `false`. + */ + static get poolQueryViaFetch(): SocketDefaults["poolQueryViaFetch"]; + static set poolQueryViaFetch(newValue: SocketDefaults['poolQueryViaFetch']); + /** + * Set `fetchEndpoint` to set the server endpoint to be sent queries via http + * fetch. May be useful in local development (e.g. to set a port that's not + * the default 443). + * + * Provide either the full endpoint URL, or a function that takes the + * database host address, port and options, and returns the full endpoint URL + * (including protocol). + * + * Default: custom logic to connect to Neon endpoints. + */ + static get fetchEndpoint(): SocketDefaults["fetchEndpoint"]; + static set fetchEndpoint(newValue: SocketDefaults['fetchEndpoint']); + /** + * **DEPRECATED**. Previously, only when `fetchConnectionCache` was `true` + * did queries carried via HTTP fetch make use of a connection pool/cache + * on the server. All queries now use the connection pool/cache: this setting + * is ignored. + * + * Default: `true`. + */ + static get fetchConnectionCache(): SocketDefaults["fetchConnectionCache"]; + static set fetchConnectionCache(newValue: SocketDefaults['fetchConnectionCache']); + /** + * The `fetchFunction` option allows you to supply an alternative function + * for making http requests. The function must accept the same arguments as + * native `fetch`. + * + * Default: `undefined`. + */ + static get fetchFunction(): SocketDefaults["fetchFunction"]; + static set fetchFunction(newValue: SocketDefaults['fetchFunction']); + /** + * Only if no global `WebSocket` object is available, such as in older + * versions of Node, set `webSocketConstructor` to the constructor for a + * custom WebSocket implementation, such as those provided by `ws` or + * `undici`. + * + * Default: `undefined`. + */ + static get webSocketConstructor(): SocketDefaults["webSocketConstructor"]; + static set webSocketConstructor(newValue: SocketDefaults['webSocketConstructor']); + get webSocketConstructor(): SocketDefaults["webSocketConstructor"]; + set webSocketConstructor(newValue: SocketDefaults['webSocketConstructor']); + /** + * Set `wsProxy` to use your own WebSocket proxy server. + * + * Provide either the proxy server’s domain name, or a function that takes + * the database host and port and returns the proxy server address (without + * protocol). + * + * Example: `(host, port) => "myproxy.example.net?address=" + host + ":" + port` + * + * Default: `host => host + '/v2'` + */ + static get wsProxy(): SocketDefaults["wsProxy"]; + static set wsProxy(newValue: SocketDefaults['wsProxy']); + get wsProxy(): SocketDefaults["wsProxy"]; + set wsProxy(newValue: SocketDefaults['wsProxy']); + /** + * Batch multiple network writes per run-loop into a single outgoing + * WebSocket message. + * + * Default: `true`. + */ + static get coalesceWrites(): SocketDefaults["coalesceWrites"]; + static set coalesceWrites(newValue: SocketDefaults['coalesceWrites']); + get coalesceWrites(): SocketDefaults["coalesceWrites"]; + set coalesceWrites(newValue: SocketDefaults['coalesceWrites']); + /** + * Use a secure (`wss:`) connection to the WebSocket proxy. + * + * Default: `true`. + */ + static get useSecureWebSocket(): SocketDefaults["useSecureWebSocket"]; + static set useSecureWebSocket(newValue: SocketDefaults['useSecureWebSocket']); + get useSecureWebSocket(): SocketDefaults["useSecureWebSocket"]; + set useSecureWebSocket(newValue: SocketDefaults['useSecureWebSocket']); + /** + * Disable TLS encryption in the Postgres protocol (as set via e.g. + * `?sslmode=require` in the connection string). Connection remains secure + * as long as `useSecureWebSocket` is `true`, which is the default. + * + * Default: `true` + */ + static get forceDisablePgSSL(): SocketDefaults["forceDisablePgSSL"]; + static set forceDisablePgSSL(newValue: SocketDefaults['forceDisablePgSSL']); + get forceDisablePgSSL(): SocketDefaults["forceDisablePgSSL"]; + set forceDisablePgSSL(newValue: SocketDefaults['forceDisablePgSSL']); + /** + * When using subtls with `forceDisablePgSSL = false` and Postgres connection + * parameters that specify TLS, setting `disableSNI = true` means that no SNI + * data in included in the Postgres TLS handshake. + * + * On Neon, disabling SNI and including the Neon project name in the password + * avoids CPU-intensive SCRAM authentication, but this is only relevant for + * earlier iterations of Neon's WebSocket support. + * + * Default: `false`. + */ + static get disableSNI(): SocketDefaults["disableSNI"]; + static set disableSNI(newValue: SocketDefaults['disableSNI']); + get disableSNI(): SocketDefaults["disableSNI"]; + set disableSNI(newValue: SocketDefaults['disableSNI']); + /** + * Pipelines the startup message, cleartext password message and first query + * when set to `"password"`. This works only for cleartext password auth. + * + * Default: `"password"`. + */ + static get pipelineConnect(): SocketDefaults["pipelineConnect"]; + static set pipelineConnect(newValue: SocketDefaults['pipelineConnect']); + get pipelineConnect(): SocketDefaults["pipelineConnect"]; + set pipelineConnect(newValue: SocketDefaults['pipelineConnect']); + /** + * If `forceDisablePgSSL` is `false` and the Postgres connection parameters + * specify TLS, you must supply the subtls TLS library to this option: + * + * ``` + * import { neonConfig } from '@neondatabase/serverless'; + * import * as subtls from 'subtls'; + * neonConfig.subtls = subtls; + * ``` + * + * Default: `undefined`. + */ + static get subtls(): SocketDefaults["subtls"]; + static set subtls(newValue: SocketDefaults['subtls']); + get subtls(): SocketDefaults["subtls"]; + set subtls(newValue: SocketDefaults['subtls']); + /** + * Pipeline the pg SSL request and TLS handshake when `forceDisablePgSSL` is + * `false` and the Postgres connection parameters specify TLS. Currently + * compatible only with Neon hosts. + * + * Default: `false`. + */ + static get pipelineTLS(): SocketDefaults["pipelineTLS"]; + static set pipelineTLS(newValue: SocketDefaults['pipelineTLS']); + get pipelineTLS(): SocketDefaults["pipelineTLS"]; + set pipelineTLS(newValue: SocketDefaults['pipelineTLS']); + /** + * Set `rootCerts` to a string comprising one or more PEM files. These are + * the trusted root certificates for a TLS connection to Postgres when + * `forceDisablePgSSL` is `false` and the Postgres connection parameters + * specify TLS. + * + * Default: `""`. + */ + static get rootCerts(): SocketDefaults["rootCerts"]; + static set rootCerts(newValue: SocketDefaults['rootCerts']); + get rootCerts(): SocketDefaults["rootCerts"]; + set rootCerts(newValue: SocketDefaults['rootCerts']); + wsProxyAddrForHost(host: string, port: number): string; + connecting: boolean; + pending: boolean; + writable: boolean; + encrypted: boolean; + authorized: boolean; + destroyed: boolean; + private ws; + private writeBuffer; + private tlsState; + private tlsRead; + private tlsWrite; + setNoDelay(): this; + setKeepAlive(): this; + ref(): this; + unref(): this; + connect(port: number | string, host: string, connectListener?: () => void): void; + startTls(host: string): Promise; + tlsReadLoop(): Promise; + rawWrite(data: Uint8Array): void; + write(data: Buffer | string, encoding?: string, callback?: (err?: any) => void): boolean; + end(data?: Buffer | string, encoding?: string, callback?: () => void): this; + destroy(): this; +} + +export declare class NeonDbError extends Error { + name: "NeonDbError"; + severity: string | undefined; + code: string | undefined; + detail: string | undefined; + hint: string | undefined; + position: string | undefined; + internalPosition: string | undefined; + internalQuery: string | undefined; + where: string | undefined; + schema: string | undefined; + table: string | undefined; + column: string | undefined; + dataType: string | undefined; + constraint: string | undefined; + file: string | undefined; + line: string | undefined; + routine: string | undefined; + sourceError: Error | undefined; + constructor(message: string); +} + +export declare interface NeonQueryFunction { + (strings: TemplateStringsArray, ...params: any[]): NeonQueryPromise : QueryRows>; + (string: string, params?: any[], opts?: HTTPQueryOptions): NeonQueryPromise : QueryRows>; + /** + * The `transaction()` function allows multiple queries to be submitted (over + * HTTP) as a single, non-interactive Postgres transaction. + * + * For example: + * ``` + * import { neon } from "@neondatabase/serverless"; + * const sql = neon("postgres://user:pass@host/db"); + * + * const results = await sql.transaction([ + * sql`SELECT 1 AS num`, + * sql`SELECT 'a' AS str`, + * ]); + * // -> [[{ num: 1 }], [{ str: "a" }]] + * + * // or equivalently: + * const results = await sql.transaction(txn => [ + * txn`SELECT 1 AS num`, + * txn`SELECT 'a' AS str`, + * ]); + * // -> [[{ num: 1 }], [{ str: "a" }]] + * ``` + * @param queriesOrFn - Either an array of queries, or a (non-`async`) function + * that receives a query function and returns an array of queries. + * @param opts - The same options that may be set on individual queries in a + * non-transaction setting -- that is, `arrayMode` `fullResults` and + * `fetchOptions` -- plus the transaction options `isolationLevel`, + * `readOnly` and `deferrable`. Note that none of these options can be set on + * individual queries within a transaction. + * @returns An array of results. The structure of each result object depends + * on the `arrayMode` and `fullResults` options. + */ + transaction: (queriesOrFn: NeonQueryPromise[] | ((sql: NeonQueryFunctionInTransaction) => NeonQueryInTransaction[]), opts?: HTTPTransactionOptions) => Promise[] : QueryRows[]>; +} + +export declare interface NeonQueryFunctionInTransaction { + (strings: TemplateStringsArray, ...params: any[]): NeonQueryPromise : QueryRows>; + (string: string, params?: any[]): NeonQueryPromise : QueryRows>; +} + +export declare interface NeonQueryInTransaction { + parameterizedQuery: ParameterizedQuery; +} + +export declare interface NeonQueryPromise extends Promise { + parameterizedQuery: ParameterizedQuery; + opts?: HTTPQueryOptions; +} + +export { Notification } + +declare type OID = string; + +export declare interface ParameterizedQuery { + query: string; + params: any[]; +} + +/** + * The node-postgres `Pool` object re-exported with minor modifications. + * https://node-postgres.com/apis/pool + */ +export declare class Pool extends Pool_2 { + Client: typeof Client; + hasFetchUnsupportedListeners: boolean; + on(event: 'error' | 'connect' | 'acquire' | 'release' | 'remove', listener: any): this; + addListener: (event: "error" | "connect" | "acquire" | "release" | "remove", listener: any) => this; + query(queryStream: T): T; + query(queryConfig: QueryArrayConfig, values?: QueryConfigValues): Promise>; + query(queryConfig: QueryConfig): Promise>; + query(queryTextOrConfig: string | QueryConfig, values?: QueryConfigValues): Promise>; + query(queryConfig: QueryArrayConfig, callback: (err: Error, result: QueryArrayResult) => void): void; + query(queryTextOrConfig: string | QueryConfig, callback: (err: Error, result: QueryResult) => void): void; + query(queryText: string, values: QueryConfigValues, callback: (err: Error, result: QueryResult) => void): void; +} + +export { PoolConfig } + +export declare interface ProcessQueryResultOptions { + arrayMode: boolean; + fullResults: boolean; + parameterizedQuery: ParameterizedQuery; + resultCallback: HTTPQueryOptions['resultCallback']; + types?: typeof types; +} + +export { Query } + +export { QueryArrayConfig } + +export { QueryArrayResult } + +export { QueryConfig } + +export { QueryParse } + +export { QueryResult } + +export { QueryResultBase } + +export { QueryResultRow } + +export declare type QueryRows = ArrayMode extends true ? any[][] : Record[]; + +declare abstract class ReadQueue { + queue: Uint8Array[]; + outstandingRequest: DataRequest | undefined; + constructor(); + abstract socketIsNotClosed(): boolean; + enqueue(data: Uint8Array): void; + dequeue(): void; + bytesInQueue(): number; + read(bytes: number): Promise | undefined>; +} + +export { ResultBuilder } + +declare type RootCertsData = Uint8Array; + +declare interface RootCertsDatabase { + index: RootCertsIndex; + data: RootCertsData; +} + +declare interface RootCertsIndex { + offsets: number[]; + subjects: Record; +} + +export declare interface SocketDefaults { + poolQueryViaFetch: boolean; + fetchEndpoint: string | ((host: string, port: number | string, options?: FetchEndpointOptions) => string); + fetchConnectionCache: boolean; + fetchFunction: any; + webSocketConstructor: WebSocketConstructor | undefined; + wsProxy: string | ((host: string, port: number | string) => string); + useSecureWebSocket: boolean; + forceDisablePgSSL: boolean; + coalesceWrites: boolean; + pipelineConnect: 'password' | false; + subtls: typeof subtls | undefined; + rootCerts: string; + pipelineTLS: boolean; + disableSNI: boolean; +} + +declare class SocketReadQueue extends ReadQueue { + private socket; + constructor(socket: Socket); + socketIsNotClosed(): boolean; +} + +declare function stableStringify(x: any, replacer?: (key: string, value: any) => any, indent?: string | number): string; + +declare function startTls(host: string, rootCertsDatabase: RootCertsDatabase | string, networkRead: (bytes: number) => Promise, networkWrite: (data: Uint8Array) => void, { useSNI, requireServerTlsExtKeyUsage, requireDigitalSigKeyUsage, writePreData, expectPreData, commentPreData }?: { + useSNI?: boolean; + requireServerTlsExtKeyUsage?: boolean; + requireDigitalSigKeyUsage?: boolean; + writePreData?: Uint8Array; + expectPreData?: Uint8Array; + commentPreData?: string; +}): Promise Promise | undefined>, (data: Uint8Array) => Promise]>; + +declare function stdCharCodes(charCode: number): number | void; + +export { Submittable } + +declare namespace subtls { + export { + base64Decode, + hexFromU8, + stableStringify, + startTls, + stdCharCodes, + u8FromHex, + allKeyUsages, + ASN1Bytes, + Bytes, + Cert, + CertJSON, + DataRequest, + DistinguishedName, + OID, + ReadQueue, + RootCertsData, + RootCertsDatabase, + RootCertsIndex, + SocketReadQueue, + TrustedCert, + WebSocketReadQueue + } +} +export { subtls } + +declare class TrustedCert extends Cert { + static databaseFromPEM(pem: string): RootCertsDatabase; + static findInDatabase(subjectOrSubjectKeyId: DistinguishedName | string, db: RootCertsDatabase): TrustedCert | undefined; +} + +export { types } + +declare function u8FromHex(hex: string): Uint8Array; + +export declare interface WebSocketConstructor { + new (...args: any[]): WebSocketLike; +} + +export declare interface WebSocketLike { + readonly readyState: number; + binaryType: string; + close(code?: number, reason?: string): void; + send(data: any): void; + addEventListener(type: 'open' | 'message' | 'close' | 'error', listener: (this: WebSocketLike, ev: any) => any, options?: any): void; +} + +declare class WebSocketReadQueue extends ReadQueue { + private socket; + constructor(socket: WebSocket); + socketIsNotClosed(): boolean; +} + +export { } diff --git a/dist/dts/export/httpQuery.d.ts b/dist/dts/export/httpQuery.d.ts new file mode 100644 index 0000000..b51b3f4 --- /dev/null +++ b/dist/dts/export/httpQuery.d.ts @@ -0,0 +1,189 @@ +import { types as defaultTypes } from '.'; +import type { FieldDef, types as PgTypes } from 'pg'; +export declare class NeonDbError extends Error { + name: "NeonDbError"; + severity: string | undefined; + code: string | undefined; + detail: string | undefined; + hint: string | undefined; + position: string | undefined; + internalPosition: string | undefined; + internalQuery: string | undefined; + where: string | undefined; + schema: string | undefined; + table: string | undefined; + column: string | undefined; + dataType: string | undefined; + constraint: string | undefined; + file: string | undefined; + line: string | undefined; + routine: string | undefined; + sourceError: Error | undefined; + constructor(message: string); +} +export type QueryRows = ArrayMode extends true ? any[][] : Record[]; +export interface FullQueryResults { + fields: FieldDef[]; + command: string; + rowCount: number; + rows: QueryRows; + rowAsArray: ArrayMode; +} +export interface ParameterizedQuery { + query: string; + params: any[]; +} +export interface HTTPQueryOptions { + /** + * When `arrayMode` is `false`, which is the default, result rows are + * returned as objects whose keys represent column names, such as + * `{ id: 1 }`). + * + * When `arrayMode` is `true`, rows are returned as arrays (and keys are not + * provided), e.g. `[1]`. + */ + arrayMode?: ArrayMode; + /** + * When `fullResults` is `false`, which is the default, only result rows are + * returned, e.g. `[{ id: 1 }]`). + * + * When `fullResults` is `true`, a result object is returned that matches + * what's returned by node-postgres. This has a `rows` property, which is an + * array of result rows, plus `fields`, which provides column names and + * types, `command` and `rowCount`. + */ + fullResults?: FullResults; + /** + * Any options in `fetchOptions` are merged in to the options passed to + * `fetch`. In case of conflict with what would otherwise be passed, these + * options take precedence. + */ + fetchOptions?: Record; + /** + * JWT auth token to be passed as the Bearer token in the Authorization header. + * Can be string, or a function (sync or async) returning a string. + * + * Default: `undefined` + */ + authToken?: string | (() => Promise | string); + /** + * Custom type parsers. See https://github.com/brianc/node-pg-types. + */ + types?: typeof PgTypes; + queryCallback?: (query: ParameterizedQuery) => void; + resultCallback?: (query: ParameterizedQuery, result: any, rows: any, opts: any) => void; +} +export interface HTTPTransactionOptions extends HTTPQueryOptions { + isolationLevel?: 'ReadUncommitted' | 'ReadCommitted' | 'RepeatableRead' | 'Serializable'; + readOnly?: boolean; + deferrable?: boolean; +} +export interface NeonQueryPromise extends Promise { + parameterizedQuery: ParameterizedQuery; + opts?: HTTPQueryOptions; +} +export interface ProcessQueryResultOptions { + arrayMode: boolean; + fullResults: boolean; + parameterizedQuery: ParameterizedQuery; + resultCallback: HTTPQueryOptions['resultCallback']; + types?: typeof defaultTypes; +} +export interface NeonQueryFunctionInTransaction { + (strings: TemplateStringsArray, ...params: any[]): NeonQueryPromise : QueryRows>; + (string: string, params?: any[]): NeonQueryPromise : QueryRows>; +} +export interface NeonQueryInTransaction { + parameterizedQuery: ParameterizedQuery; +} +export interface NeonQueryFunction { + (strings: TemplateStringsArray, ...params: any[]): NeonQueryPromise : QueryRows>; + (string: string, params?: any[], opts?: HTTPQueryOptions): NeonQueryPromise : QueryRows>; + /** + * The `transaction()` function allows multiple queries to be submitted (over + * HTTP) as a single, non-interactive Postgres transaction. + * + * For example: + * ``` + * import { neon } from "@neondatabase/serverless"; + * const sql = neon("postgres://user:pass@host/db"); + * + * const results = await sql.transaction([ + * sql`SELECT 1 AS num`, + * sql`SELECT 'a' AS str`, + * ]); + * // -> [[{ num: 1 }], [{ str: "a" }]] + * + * // or equivalently: + * const results = await sql.transaction(txn => [ + * txn`SELECT 1 AS num`, + * txn`SELECT 'a' AS str`, + * ]); + * // -> [[{ num: 1 }], [{ str: "a" }]] + * ``` + * @param queriesOrFn - Either an array of queries, or a (non-`async`) function + * that receives a query function and returns an array of queries. + * @param opts - The same options that may be set on individual queries in a + * non-transaction setting -- that is, `arrayMode` `fullResults` and + * `fetchOptions` -- plus the transaction options `isolationLevel`, + * `readOnly` and `deferrable`. Note that none of these options can be set on + * individual queries within a transaction. + * @returns An array of results. The structure of each result object depends + * on the `arrayMode` and `fullResults` options. + */ + transaction: (queriesOrFn: NeonQueryPromise[] | ((sql: NeonQueryFunctionInTransaction) => NeonQueryInTransaction[]), opts?: HTTPTransactionOptions) => Promise[] : QueryRows[]>; +} +/** + * This function returns an async tagged-template function that runs a single + * SQL query (no session or transactions) with low latency over https. Support + * for multiple queries (as a non-interactive transaction) is provided by + * the `transaction` property of the query function. + * + * By default, the query function returns database rows directly. Types should + * match those returned by this driver (i.e. Pool or Client) over WebSockets. + * + * The returned function can also be called directly (i.e. not as a template + * function). In that case, pass it a query string with embedded `$1`, `$2` + * (etc.), followed by an array of query parameters, followed (optionally) by + * any of the same options you can pass to this function. + * + * Some examples: + * ``` + * import { neon } from "@neondatabase/serverless"; + * const h = "hello", w = "world"; + * + * // example 1: default options, tagged-template usage + * const sql = neon("postgres://user:pass@host/db"); + * const rows = await sql`SELECT ${h} || ' ' || ${w} AS greeting`; + * // -> [ { greeting: "hello world" } ] + * + * // example 2: `arrayMode` and `fullResults` options, ordinary function usage + * const options = { arrayMode: true, fullResults: true }; + * const sql = neon("postgres://user:pass@host/db", options); + * const rows = await sql("SELECT $1 || ' ' || $2 AS greeting", [h, w]); + * // -> { + * // command: "SELECT", + * // fields: [ { name: "greeting", dataTypeID: 25 } ], + * // rowAsArray: true, + * // rowCount: 1, + * // rows: [ [ "hello world" ] ] + * // } + * + * // example 3: `fetchOptions` option, ordinary function usage + * const sql = neon("postgres://user:pass@host/db"); + * const rows = await sql( + * "SELECT $1 || ' ' || $2 AS greeting", [h, w], + * { fetchOptions: { priority: "high" } } + * ); + * // -> [ { greeting: "hello world" } ] + * ``` + * + * @param connectionString - this has the format `postgres://user:pass@host/db` + * @param options - pass `arrayMode: true` to receive results as an array of + * arrays, instead of the default array of objects; pass `fullResults: true` + * to receive a complete result object similar to one returned by node-postgres + * (with properties `rows`, `fields`, `command`, `rowCount`, `rowAsArray`); + * pass as `fetchOptions` an object which will be merged into the options + * passed to `fetch`. + */ +export declare function neon(connectionString: string, { arrayMode: neonOptArrayMode, fullResults: neonOptFullResults, fetchOptions: neonOptFetchOptions, isolationLevel: neonOptIsolationLevel, readOnly: neonOptReadOnly, deferrable: neonOptDeferrable, queryCallback, resultCallback, authToken, }?: HTTPTransactionOptions): NeonQueryFunction; diff --git a/dist/dts/export/index.d.ts b/dist/dts/export/index.d.ts new file mode 100644 index 0000000..e496e93 --- /dev/null +++ b/dist/dts/export/index.d.ts @@ -0,0 +1,52 @@ +import { Client, Connection, Pool } from 'pg'; +import { Socket } from '../shims/net'; +import { neon, NeonDbError } from './httpQuery'; +import type { QueryResultRow, Submittable, QueryArrayConfig, QueryConfigValues, QueryConfig, QueryArrayResult, QueryResult } from 'pg'; +declare interface NeonClient { + connection: Connection & { + stream: Socket; + sendSCRAMClientFinalMessage: (response: any) => void; + ssl: any; + }; + _handleReadyForQuery: any; + _handleAuthCleartextPassword: any; + startup: any; + getStartupConf: any; + saslSession: any; +} +/** + * The node-postgres `Client` object re-exported with minor modifications. + * https://node-postgres.com/apis/client + */ +declare class NeonClient extends Client { + config: any; + get neonConfig(): Socket; + constructor(config: any); + connect(): Promise; + connect(callback: (err?: Error) => void): void; + _handleAuthSASLContinue(msg: any): Promise; +} +/** + * The node-postgres `Pool` object re-exported with minor modifications. + * https://node-postgres.com/apis/pool + */ +declare class NeonPool extends Pool { + Client: typeof NeonClient; + hasFetchUnsupportedListeners: boolean; + on(event: 'error' | 'connect' | 'acquire' | 'release' | 'remove', listener: any): this; + addListener: (event: "error" | "connect" | "acquire" | "release" | "remove", listener: any) => this; + query(queryStream: T): T; + query(queryConfig: QueryArrayConfig, values?: QueryConfigValues): Promise>; + query(queryConfig: QueryConfig): Promise>; + query(queryTextOrConfig: string | QueryConfig, values?: QueryConfigValues): Promise>; + query(queryConfig: QueryArrayConfig, callback: (err: Error, result: QueryArrayResult) => void): void; + query(queryTextOrConfig: string | QueryConfig, callback: (err: Error, result: QueryResult) => void): void; + query(queryText: string, values: QueryConfigValues, callback: (err: Error, result: QueryResult) => void): void; +} +export { defaults, types, ClientBase } from 'pg'; +export type { BindConfig, ClientConfig, Connection, ConnectionConfig, CustomTypesConfig, Defaults, Events, ExecuteConfig, FieldDef, MessageConfig, Notification, PoolConfig, Query, QueryArrayConfig, QueryArrayResult, QueryConfig, QueryParse, QueryResult, QueryResultBase, QueryResultRow, ResultBuilder, Submittable, } from 'pg'; +export * from './httpQuery'; +export { Socket as neonConfig, NeonPool as Pool, NeonClient as Client, neon, NeonDbError, }; +export type { SocketDefaults, FetchEndpointOptions, WebSocketConstructor, WebSocketLike, subtls, } from '../shims/net'; +declare const _bundleExt: 'js' | 'mjs'; +export { _bundleExt }; diff --git a/dist/dts/export/index.d.ts.orig b/dist/dts/export/index.d.ts.orig new file mode 100644 index 0000000..761e01a --- /dev/null +++ b/dist/dts/export/index.d.ts.orig @@ -0,0 +1,49 @@ +import { Client, Connection, Pool } from 'pg'; +import { Socket } from '../shims/net'; +import { neon, NeonDbError } from './httpQuery'; +import type { NeonConfigGlobalAndClient } from './neonConfig'; +/** + * We export the pg library mostly unchanged, but we do make a few tweaks. + * + * (1) Connecting and querying can require a lot of network round-trips. We + * add a pipelining option for the connection (startup + auth + first query), + * but this works with cleartext password auth only. We can also pipeline TLS + * startup, but currently this works only with Neon hosts (not vanilla pg or + * pgbouncer). + * + * (2) SCRAM auth is deliberately CPU-intensive, and this is not appropriate + * for a serverless environment. In case it is still used, however, we replace + * the standard (synchronous) pg implementation with one that uses SubtleCrypto + * for repeated SHA-256 digests. This saves some time and CPU. + * + * (3) We now (experimentally) redirect Pool.query over a fetch request if the + * circumstances are right. + */ +declare interface NeonClient { + connection: Connection & { + stream: Socket; + sendSCRAMClientFinalMessage: (response: any) => void; + ssl: any; + }; + _handleReadyForQuery: any; + _handleAuthCleartextPassword: any; + startup: any; + getStartupConf: any; + saslSession: any; +} +declare class NeonClient extends Client { + config: any; + get neonConfig(): NeonConfigGlobalAndClient; + constructor(config: any); + connect(): Promise; + connect(callback: (err?: Error) => void): void; + _handleAuthSASLContinue(msg: any): Promise; +} +declare class NeonPool extends Pool { + Client: typeof NeonClient; + hasFetchUnsupportedListeners: boolean; + on(event: 'error' | 'connect' | 'acquire' | 'release' | 'remove', listener: any): this; + query(config?: any, values?: any, cb?: any): any; +} +export { Socket as neonConfig, NeonPool as Pool, NeonClient as Client, neon, NeonDbError, }; +export { Connection, DatabaseError, Query, ClientBase, defaults, types, } from 'pg'; diff --git a/dist/dts/export/neonConfig.d.ts b/dist/dts/export/neonConfig.d.ts new file mode 100644 index 0000000..dfc246c --- /dev/null +++ b/dist/dts/export/neonConfig.d.ts @@ -0,0 +1,131 @@ +export interface NeonConfigGlobalOnly { + /** + * Set `fetchEndpoint` to set the server endpoint to be sent queries via http + * fetch. May be useful in local development (e.g. to set a port that's not + * the default 443). + * + * Provide either the full endpoint URL, or a function that takes the + * database host address and port and returns the full endpoint URL + * (including protocol). + * + * Default: `host => 'https://' + host + '/sql'` + * + */ + fetchEndpoint: string | ((host: string, port: number | string) => string); + /** + * **Experimentally**, when `poolQueryViaFetch` is `true`, and no listeners + * for the `"connect"`, `"acquire"`, `"release"` or `"remove"` events are set + * on the `Pool`, queries via `Pool.query()` will be sent by low-latency HTTP + * fetch request. + * + * Default: `false`. + */ + poolQueryViaFetch: boolean; + /** + * **Experimentally**, when `fetchConnectionCache` is `true`, queries carried + * via HTTP fetch make use of a connection cache on the server. + * + * Default: `false`. + */ + fetchConnectionCache: boolean; + /** + * The `fetchFunction` option allows you to supply an alternative function + * for making http requests. The function must accept the same arguments as + * native `fetch`. + * + * Default: `undefined`. + */ + fetchFunction: any; +} +export interface NeonConfigGlobalAndClient { + /** + * If no global `WebSocket` object is available, set `webSocketConstructor` + * to the constructor for a custom WebSocket implementation, such as those + * provided by `ws` or `undici`. + */ + webSocketConstructor: any; + /** + * Set `wsProxy` to use your own WebSocket proxy server. + * + * Provide either the proxy server’s domain name, or a function that takes + * the database host and port and returns the proxy server address (without + * protocol). + * + * Example: `(host, port) => "myproxy.example.net?address=" + host + ":" + port` + * + * Default: `host => host + '/v2'` + */ + wsProxy: string | ((host: string, port: number | string) => string) | undefined; + /** + * Use a secure (`wss:`) connection to the WebSocket proxy. + * + * Default: `true`. + */ + useSecureWebSocket: boolean; + /** + * Disable TLS encryption in the Postgres protocol (as set via e.g. + * `?sslmode=require` in the connection string). Connection remains secure + * if `useSecureWebSocket` is `true`. + * + * Default: `true` + */ + forceDisablePgSSL: boolean; + /** + * Pipelines the startup message, cleartext password message and first query + * when set to `"password"`. This works only for cleartext password auth. + * + * Default: `"password"`. + */ + pipelineConnect: 'password' | false; + /** + * If `forceDisablePgSSL` is `false` and the Postgres connection parameters + * specify TLS, you must supply the subtls TLS library to this option: + * + * ``` + * import { neonConfig } from '@neondatabase/serverless'; + * import * as subtls from 'subtls'; + * neonConfig.subtls = subtls; + * ``` + * + * Default: `undefined`. + */ + subtls: any; + /** + * Pipeline the pg SSL request and TLS handshake when `forceDisablePgSSL` is + * `false` and the Postgres connection parameters specify TLS. Currently + * compatible only with Neon hosts. + * + * Default: `false`. + */ + pipelineTLS: boolean; + /** + * Set `rootCerts` to a string comprising one or more PEM files. These are + * the trusted root certificates for a TLS connection to Postgres when + * `forceDisablePgSSL` is `false` and the Postgres connection parameters + * specify TLS. + * + * Default: `""`. + */ + rootCerts: string; + /** + * Batch multiple network writes per run-loop into a single outgoing + * WebSocket message. + * + * Default: `true`. + */ + coalesceWrites: boolean; + /** + * When `disableSNI` is `true`, `forceDisablePgSSL` is `false` and the + * Postgres connection parameters specify TLS, we send no SNI data in the + * Postgres TLS handshake. + * + * On Neon, disabling SNI and including the Neon project name in the password + * avoids CPU-intensive SCRAM authentication, but this is only relevant for + * earlier iterations of Neon's WebSocket support. + * + * Default: `false`. + */ + disableSNI: boolean; +} +export interface NeonConfig extends NeonConfigGlobalOnly, NeonConfigGlobalAndClient { +} diff --git a/dist/dts/ext/events.d.ts b/dist/dts/ext/events.d.ts new file mode 100644 index 0000000..d04af49 --- /dev/null +++ b/dist/dts/ext/events.d.ts @@ -0,0 +1,22 @@ +export type Listener = (...args: any[]) => void; + +export class EventEmitter { + static listenerCount(emitter: EventEmitter, type: string | number): number; + static defaultMaxListeners: number; + + eventNames(): Array; + setMaxListeners(n: number): this; + getMaxListeners(): number; + emit(type: string | number, ...args: any[]): boolean; + addListener(type: string | number, listener: Listener): this; + on(type: string | number, listener: Listener): this; + once(type: string | number, listener: Listener): this; + prependListener(type: string | number, listener: Listener): this; + prependOnceListener(type: string | number, listener: Listener): this; + removeListener(type: string | number, listener: Listener): this; + off(type: string | number, listener: Listener): this; + removeAllListeners(type?: string | number): this; + listeners(type: string | number): Listener[]; + listenerCount(type: string | number): number; + rawListeners(type: string | number): Listener[]; +} diff --git a/dist/dts/ext/pg.d.ts b/dist/dts/ext/pg.d.ts new file mode 100644 index 0000000..94a942e --- /dev/null +++ b/dist/dts/ext/pg.d.ts @@ -0,0 +1,325 @@ +/// + +import events = require("events"); +import stream = require("stream"); +import pgTypes = require("pg-types"); +import { NoticeMessage } from "pg-protocol/dist/messages"; + +import { ConnectionOptions } from "tls"; + +export type QueryConfigValues = T extends Array ? T : never; + +export interface ClientConfig { + user?: string | undefined; + database?: string | undefined; + password?: string | (() => string | Promise) | undefined; + port?: number | undefined; + host?: string | undefined; + connectionString?: string | undefined; + keepAlive?: boolean | undefined; + stream?: () => stream.Duplex | stream.Duplex | undefined; + statement_timeout?: false | number | undefined; + ssl?: boolean | ConnectionOptions | undefined; + query_timeout?: number | undefined; + keepAliveInitialDelayMillis?: number | undefined; + idle_in_transaction_session_timeout?: number | undefined; + application_name?: string | undefined; + connectionTimeoutMillis?: number | undefined; + types?: CustomTypesConfig | undefined; + options?: string | undefined; +} + +export type ConnectionConfig = ClientConfig; + +export interface Defaults extends ClientConfig { + poolSize?: number | undefined; + poolIdleTimeout?: number | undefined; + reapIntervalMillis?: number | undefined; + binary?: boolean | undefined; + parseInt8?: boolean | undefined; + parseInputDatesAsUTC?: boolean | undefined; +} + +export interface PoolConfig extends ClientConfig { + // properties from module 'node-pool' + max?: number | undefined; + min?: number | undefined; + idleTimeoutMillis?: number | undefined | null; + log?: ((...messages: any[]) => void) | undefined; + Promise?: PromiseConstructorLike | undefined; + allowExitOnIdle?: boolean | undefined; + maxUses?: number | undefined; + maxLifetimeSeconds?: number | undefined; + Client?: (new() => ClientBase) | undefined; +} + +export interface QueryConfig { + name?: string | undefined; + text: string; + values?: QueryConfigValues; + types?: CustomTypesConfig | undefined; +} + +export interface CustomTypesConfig { + getTypeParser: typeof pgTypes.getTypeParser; +} + +export interface Submittable { + submit: (connection: Connection) => void; +} + +export interface QueryArrayConfig extends QueryConfig { + rowMode: "array"; +} + +export interface FieldDef { + name: string; + tableID: number; + columnID: number; + dataTypeID: number; + dataTypeSize: number; + dataTypeModifier: number; + format: string; +} + +export interface QueryResultBase { + command: string; + rowCount: number | null; + oid: number; + fields: FieldDef[]; +} + +export interface QueryResultRow { + [column: string]: any; +} + +export interface QueryResult extends QueryResultBase { + rows: R[]; +} + +export interface QueryArrayResult extends QueryResultBase { + rows: R[]; +} + +export interface Notification { + processId: number; + channel: string; + payload?: string | undefined; +} + +export interface ResultBuilder extends QueryResult { + addRow(row: R): void; +} + +export interface QueryParse { + name: string; + text: string; + types: string[]; +} + +type ValueMapper = (param: any, index: number) => any; + +export interface BindConfig { + portal?: string | undefined; + statement?: string | undefined; + binary?: string | undefined; + values?: Array | undefined; + valueMapper?: ValueMapper | undefined; +} + +export interface ExecuteConfig { + portal?: string | undefined; + rows?: string | undefined; +} + +export interface MessageConfig { + type: string; + name?: string | undefined; +} + +export function escapeIdentifier(str: string): string; + +export function escapeLiteral(str: string): string; + +export class Connection extends events.EventEmitter { + readonly stream: stream.Duplex; + + constructor(config?: ConnectionConfig); + + bind(config: BindConfig | null, more: boolean): void; + execute(config: ExecuteConfig | null, more: boolean): void; + parse(query: QueryParse, more: boolean): void; + + query(text: string): void; + + describe(msg: MessageConfig, more: boolean): void; + close(msg: MessageConfig, more: boolean): void; + + flush(): void; + sync(): void; + end(): void; +} + +export interface PoolOptions extends PoolConfig { + max: number; + maxUses: number; + allowExitOnIdle: boolean; + maxLifetimeSeconds: number; + idleTimeoutMillis: number | null; +} + +/** + * {@link https://node-postgres.com/apis/pool} + */ +export class Pool extends events.EventEmitter { + /** + * Every field of the config object is entirely optional. + * The config passed to the pool is also passed to every client + * instance within the pool when the pool creates that client. + */ + constructor(config?: PoolConfig); + + readonly totalCount: number; + readonly idleCount: number; + readonly waitingCount: number; + readonly expiredCount: number; + + readonly ending: boolean; + readonly ended: boolean; + + options: PoolOptions; + + connect(): Promise; + connect( + callback: (err: Error | undefined, client: PoolClient | undefined, done: (release?: any) => void) => void, + ): void; + + end(): Promise; + end(callback: () => void): void; + + query(queryStream: T): T; + // tslint:disable:no-unnecessary-generics + query( + queryConfig: QueryArrayConfig, + values?: QueryConfigValues, + ): Promise>; + query( + queryConfig: QueryConfig, + ): Promise>; + query( + queryTextOrConfig: string | QueryConfig, + values?: QueryConfigValues, + ): Promise>; + query( + queryConfig: QueryArrayConfig, + callback: (err: Error, result: QueryArrayResult) => void, + ): void; + query( + queryTextOrConfig: string | QueryConfig, + callback: (err: Error, result: QueryResult) => void, + ): void; + query( + queryText: string, + values: QueryConfigValues, + callback: (err: Error, result: QueryResult) => void, + ): void; + // tslint:enable:no-unnecessary-generics + + on(event: "release" | "error", listener: (err: Error, client: PoolClient) => void): this; + on(event: "connect" | "acquire" | "remove", listener: (client: PoolClient) => void): this; +} + +export class ClientBase extends events.EventEmitter { + constructor(config?: string | ClientConfig); + + connect(): Promise; + connect(callback: (err: Error) => void): void; + + query(queryStream: T): T; + // tslint:disable:no-unnecessary-generics + query( + queryConfig: QueryArrayConfig, + values?: QueryConfigValues, + ): Promise>; + query( + queryConfig: QueryConfig, + ): Promise>; + query( + queryTextOrConfig: string | QueryConfig, + values?: QueryConfigValues, + ): Promise>; + query( + queryConfig: QueryArrayConfig, + callback: (err: Error, result: QueryArrayResult) => void, + ): void; + query( + queryTextOrConfig: string | QueryConfig, + callback: (err: Error, result: QueryResult) => void, + ): void; + query( + queryText: string, + values: QueryConfigValues, + callback: (err: Error, result: QueryResult) => void, + ): void; + // tslint:enable:no-unnecessary-generics + + copyFrom(queryText: string): stream.Writable; + copyTo(queryText: string): stream.Readable; + + pauseDrain(): void; + resumeDrain(): void; + + escapeIdentifier: typeof escapeIdentifier; + escapeLiteral: typeof escapeLiteral; + setTypeParser: typeof pgTypes.setTypeParser; + getTypeParser: typeof pgTypes.getTypeParser; + + on(event: "drain", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "notice", listener: (notice: NoticeMessage) => void): this; + on(event: "notification", listener: (message: Notification) => void): this; + // tslint:disable-next-line unified-signatures + on(event: "end", listener: () => void): this; +} + +export class Client extends ClientBase { + user?: string | undefined; + database?: string | undefined; + port: number; + host: string; + password?: string | undefined; + ssl: boolean; + + constructor(config?: string | ClientConfig); + + end(): Promise; + end(callback: (err: Error) => void): void; +} + +export interface PoolClient extends ClientBase { + release(err?: Error | boolean): void; +} + +export class Query extends events.EventEmitter + implements Submittable +{ + constructor(queryTextOrConfig?: string | QueryConfig, values?: QueryConfigValues); + submit: (connection: Connection) => void; + on(event: "row", listener: (row: R, result?: ResultBuilder) => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "end", listener: (result: ResultBuilder) => void): this; +} + +export class Events extends events.EventEmitter { + on(event: "error", listener: (err: Error, client: Client) => void): this; +} + +export const types: typeof pgTypes; + +export const defaults: Defaults & ClientConfig; + +import * as Pg from "."; + +export const native: typeof Pg | null; + +export { DatabaseError } from "pg-protocol"; diff --git a/dist/dts/ext/subtls.d.ts b/dist/dts/ext/subtls.d.ts new file mode 100644 index 0000000..f40e94b --- /dev/null +++ b/dist/dts/ext/subtls.d.ts @@ -0,0 +1,215 @@ +import type { Socket } from 'net'; + +declare const allKeyUsages: readonly ["digitalSignature", "nonRepudiation", "keyEncipherment", "dataEncipherment", "keyAgreement", "keyCertSign", "cRLSign", "encipherOnly", "decipherOnly"]; + +declare class ASN1Bytes extends Bytes { + readASN1Length(comment?: string): number; + expectASN1Length(comment?: string): readonly [() => void, () => number]; + readASN1OID(comment?: string): string; + readASN1Boolean(comment?: string): boolean; + readASN1UTCTime(): Date; + readASN1GeneralizedTime(): Date; + readASN1BitString(): Uint8Array; +} + +export declare function base64Decode(input: string, charCodes?: typeof stdCharCodes, autoPad?: boolean): Uint8Array; + +declare class Bytes { + offset: number; + dataView: DataView; + data: Uint8Array; + comments: Record; + indents: Record; + indent: number; + constructor(arrayOrMaxBytes: number | Uint8Array); + extend(arrayOrMaxBytes: number | Uint8Array): void; + remaining(): number; + subarray(length: number): Uint8Array; + skip(length: number, comment?: string): this; + comment(s: string, offset?: number): this; + lengthComment(length: number, comment?: string, inclusive?: boolean): string; + readBytes(length: number): Uint8Array; + readUTF8String(length: number): string; + readUTF8StringNullTerminated(): string; + readUint8(comment?: string): number; + readUint16(comment?: string): number; + readUint24(comment?: string): number; + readUint32(comment?: string): number; + expectBytes(expected: Uint8Array | number[], comment?: string): void; + expectUint8(expectedValue: number, comment?: string): void; + expectUint16(expectedValue: number, comment?: string): void; + expectUint24(expectedValue: number, comment?: string): void; + expectUint32(expectedValue: number, comment?: string): void; + expectLength(length: number, indentDelta?: number): readonly [() => void, () => number]; + expectLengthUint8(comment?: string): readonly [() => void, () => number]; + expectLengthUint16(comment?: string): readonly [() => void, () => number]; + expectLengthUint24(comment?: string): readonly [() => void, () => number]; + expectLengthUint32(comment?: string): readonly [() => void, () => number]; + expectLengthUint8Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint16Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint24Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint32Incl(comment?: string): readonly [() => void, () => number]; + writeBytes(bytes: number[] | Uint8Array): this; + writeUTF8String(s: string): this; + writeUTF8StringNullTerminated(s: string): this; + writeUint8(value: number, comment?: string): Bytes; + writeUint16(value: number, comment?: string): Bytes; + writeUint24(value: number, comment?: string): Bytes; + writeUint32(value: number, comment?: string): Bytes; + _writeLengthGeneric(lengthBytes: 1 | 2 | 3 | 4, inclusive: boolean, comment?: string): () => void; + writeLengthUint8(comment?: string): () => void; + writeLengthUint16(comment?: string): () => void; + writeLengthUint24(comment?: string): () => void; + writeLengthUint32(comment?: string): () => void; + writeLengthUint8Incl(comment?: string): () => void; + writeLengthUint16Incl(comment?: string): () => void; + writeLengthUint24Incl(comment?: string): () => void; + writeLengthUint32Incl(comment?: string): () => void; + array(): Uint8Array; + commentedString(all?: boolean): string; +} + +declare class Cert { + serialNumber: Uint8Array; + algorithm: OID; + issuer: DistinguishedName; + validityPeriod: { + notBefore: Date; + notAfter: Date; + }; + subject: DistinguishedName; + publicKey: { + identifiers: OID[]; + data: Uint8Array; + all: Uint8Array; + }; + signature: Uint8Array; + keyUsage?: { + critical?: boolean; + usages: Set; + }; + subjectAltNames?: string[]; + extKeyUsage?: { + clientTls?: true; + serverTls?: true; + }; + authorityKeyIdentifier?: Uint8Array; + subjectKeyIdentifier?: Uint8Array; + basicConstraints?: { + critical?: boolean; + ca?: boolean; + pathLength?: number; + } | undefined; + signedData: Uint8Array; + static distinguishedNamesAreEqual(dn1: DistinguishedName, dn2: DistinguishedName): boolean; + static stringFromDistinguishedName(dn: DistinguishedName): string; + constructor(certData: Uint8Array | ASN1Bytes | CertJSON); + subjectAltNameMatchingHost(host: string): string | undefined; + isValidAtMoment(moment?: Date): boolean; + description(): string; + toJSON(): { + serialNumber: string; + algorithm: string; + issuer: DistinguishedName; + validityPeriod: { + notBefore: string; + notAfter: string; + }; + subject: DistinguishedName; + publicKey: { + identifiers: string[]; + data: string; + all: string; + }; + signature: string; + keyUsage: { + critical: boolean | undefined; + usages: ("digitalSignature" | "nonRepudiation" | "keyEncipherment" | "dataEncipherment" | "keyAgreement" | "keyCertSign" | "cRLSign" | "encipherOnly" | "decipherOnly")[]; + }; + subjectAltNames: string[] | undefined; + extKeyUsage: { + clientTls?: true; + serverTls?: true; + } | undefined; + authorityKeyIdentifier: string | undefined; + subjectKeyIdentifier: string | undefined; + basicConstraints: { + critical?: boolean; + ca?: boolean; + pathLength?: number; + } | undefined; + signedData: string; + }; + static uint8ArraysFromPEM(pem: string): Uint8Array[]; + static fromPEM(pem: string): Cert[]; +} + +declare type CertJSON = ReturnType; + +declare interface DataRequest { + bytes: number; + resolve: (data: Uint8Array | undefined) => void; +} + +declare type DistinguishedName = Record; + +export declare function hexFromU8(u8: Uint8Array | number[], spacer?: string): string; + +declare type OID = string; + +declare abstract class ReadQueue { + queue: Uint8Array[]; + outstandingRequest: DataRequest | undefined; + constructor(); + abstract socketIsNotClosed(): boolean; + enqueue(data: Uint8Array): void; + dequeue(): void; + bytesInQueue(): number; + read(bytes: number): Promise | undefined>; +} + +declare type RootCertsData = Uint8Array; + +declare interface RootCertsDatabase { + index: RootCertsIndex; + data: RootCertsData; +} + +declare interface RootCertsIndex { + offsets: number[]; + subjects: Record; +} + +export declare class SocketReadQueue extends ReadQueue { + private socket; + constructor(socket: Socket); + socketIsNotClosed(): boolean; +} + +export declare function stableStringify(x: any, replacer?: (key: string, value: any) => any, indent?: string | number): string; + +export declare function startTls(host: string, rootCertsDatabase: RootCertsDatabase | string, networkRead: (bytes: number) => Promise, networkWrite: (data: Uint8Array) => void, { useSNI, requireServerTlsExtKeyUsage, requireDigitalSigKeyUsage, writePreData, expectPreData, commentPreData }?: { + useSNI?: boolean; + requireServerTlsExtKeyUsage?: boolean; + requireDigitalSigKeyUsage?: boolean; + writePreData?: Uint8Array; + expectPreData?: Uint8Array; + commentPreData?: string; +}): Promise Promise | undefined>, (data: Uint8Array) => Promise]>; + +declare function stdCharCodes(charCode: number): number | void; + +export declare class TrustedCert extends Cert { + static databaseFromPEM(pem: string): RootCertsDatabase; + static findInDatabase(subjectOrSubjectKeyId: DistinguishedName | string, db: RootCertsDatabase): TrustedCert | undefined; +} + +export declare function u8FromHex(hex: string): Uint8Array; + +export declare class WebSocketReadQueue extends ReadQueue { + private socket; + constructor(socket: WebSocket); + socketIsNotClosed(): boolean; +} + +export { } diff --git a/dist/dts/shims/net/index.d.ts b/dist/dts/shims/net/index.d.ts new file mode 100644 index 0000000..3146028 --- /dev/null +++ b/dist/dts/shims/net/index.d.ts @@ -0,0 +1,231 @@ +/** + * This file shims parts of the Node.js built-in net and tls packages, by + * implementing net.Socket and tls.connect() on top of WebSockets. It's + * designed to work both in browsers and in Cloudflare Workers (where + * WebSockets work a bit differently). The calling client is assumed to be pg + * (node-postgres). + */ +import { EventEmitter } from 'events'; +import type * as subtls from 'subtls'; +export type { subtls }; +export interface WebSocketLike { + readonly readyState: number; + binaryType: string; + close(code?: number, reason?: string): void; + send(data: any): void; + addEventListener(type: 'open' | 'message' | 'close' | 'error', listener: (this: WebSocketLike, ev: any) => any, options?: any): void; +} +export interface WebSocketConstructor { + new (...args: any[]): WebSocketLike; +} +export declare function isIP(input: string): number; +export interface FetchEndpointOptions { + jwtAuth?: boolean; +} +export interface SocketDefaults { + poolQueryViaFetch: boolean; + fetchEndpoint: string | ((host: string, port: number | string, options?: FetchEndpointOptions) => string); + fetchConnectionCache: boolean; + fetchFunction: any; + webSocketConstructor: WebSocketConstructor | undefined; + wsProxy: string | ((host: string, port: number | string) => string); + useSecureWebSocket: boolean; + forceDisablePgSSL: boolean; + coalesceWrites: boolean; + pipelineConnect: 'password' | false; + subtls: typeof subtls | undefined; + rootCerts: string; + pipelineTLS: boolean; + disableSNI: boolean; +} +export declare class Socket extends EventEmitter { + static defaults: SocketDefaults; + static opts: Partial; + private opts; + /** + * **Experimentally**, when `poolQueryViaFetch` is `true`, and no listeners + * for the `"connect"`, `"acquire"`, `"release"` or `"remove"` events are set + * on the `Pool`, queries via `Pool.query()` will be sent by low-latency HTTP + * fetch request. + * + * Default: `false`. + */ + static get poolQueryViaFetch(): SocketDefaults["poolQueryViaFetch"]; + static set poolQueryViaFetch(newValue: SocketDefaults['poolQueryViaFetch']); + /** + * Set `fetchEndpoint` to set the server endpoint to be sent queries via http + * fetch. May be useful in local development (e.g. to set a port that's not + * the default 443). + * + * Provide either the full endpoint URL, or a function that takes the + * database host address, port and options, and returns the full endpoint URL + * (including protocol). + * + * Default: custom logic to connect to Neon endpoints. + */ + static get fetchEndpoint(): SocketDefaults["fetchEndpoint"]; + static set fetchEndpoint(newValue: SocketDefaults['fetchEndpoint']); + /** + * **DEPRECATED**. Previously, only when `fetchConnectionCache` was `true` + * did queries carried via HTTP fetch make use of a connection pool/cache + * on the server. All queries now use the connection pool/cache: this setting + * is ignored. + * + * Default: `true`. + */ + static get fetchConnectionCache(): SocketDefaults["fetchConnectionCache"]; + static set fetchConnectionCache(newValue: SocketDefaults['fetchConnectionCache']); + /** + * The `fetchFunction` option allows you to supply an alternative function + * for making http requests. The function must accept the same arguments as + * native `fetch`. + * + * Default: `undefined`. + */ + static get fetchFunction(): SocketDefaults["fetchFunction"]; + static set fetchFunction(newValue: SocketDefaults['fetchFunction']); + /** + * Only if no global `WebSocket` object is available, such as in older + * versions of Node, set `webSocketConstructor` to the constructor for a + * custom WebSocket implementation, such as those provided by `ws` or + * `undici`. + * + * Default: `undefined`. + */ + static get webSocketConstructor(): SocketDefaults["webSocketConstructor"]; + static set webSocketConstructor(newValue: SocketDefaults['webSocketConstructor']); + get webSocketConstructor(): SocketDefaults["webSocketConstructor"]; + set webSocketConstructor(newValue: SocketDefaults['webSocketConstructor']); + /** + * Set `wsProxy` to use your own WebSocket proxy server. + * + * Provide either the proxy server’s domain name, or a function that takes + * the database host and port and returns the proxy server address (without + * protocol). + * + * Example: `(host, port) => "myproxy.example.net?address=" + host + ":" + port` + * + * Default: `host => host + '/v2'` + */ + static get wsProxy(): SocketDefaults["wsProxy"]; + static set wsProxy(newValue: SocketDefaults['wsProxy']); + get wsProxy(): SocketDefaults["wsProxy"]; + set wsProxy(newValue: SocketDefaults['wsProxy']); + /** + * Batch multiple network writes per run-loop into a single outgoing + * WebSocket message. + * + * Default: `true`. + */ + static get coalesceWrites(): SocketDefaults["coalesceWrites"]; + static set coalesceWrites(newValue: SocketDefaults['coalesceWrites']); + get coalesceWrites(): SocketDefaults["coalesceWrites"]; + set coalesceWrites(newValue: SocketDefaults['coalesceWrites']); + /** + * Use a secure (`wss:`) connection to the WebSocket proxy. + * + * Default: `true`. + */ + static get useSecureWebSocket(): SocketDefaults["useSecureWebSocket"]; + static set useSecureWebSocket(newValue: SocketDefaults['useSecureWebSocket']); + get useSecureWebSocket(): SocketDefaults["useSecureWebSocket"]; + set useSecureWebSocket(newValue: SocketDefaults['useSecureWebSocket']); + /** + * Disable TLS encryption in the Postgres protocol (as set via e.g. + * `?sslmode=require` in the connection string). Connection remains secure + * as long as `useSecureWebSocket` is `true`, which is the default. + * + * Default: `true` + */ + static get forceDisablePgSSL(): SocketDefaults["forceDisablePgSSL"]; + static set forceDisablePgSSL(newValue: SocketDefaults['forceDisablePgSSL']); + get forceDisablePgSSL(): SocketDefaults["forceDisablePgSSL"]; + set forceDisablePgSSL(newValue: SocketDefaults['forceDisablePgSSL']); + /** + * When using subtls with `forceDisablePgSSL = false` and Postgres connection + * parameters that specify TLS, setting `disableSNI = true` means that no SNI + * data in included in the Postgres TLS handshake. + * + * On Neon, disabling SNI and including the Neon project name in the password + * avoids CPU-intensive SCRAM authentication, but this is only relevant for + * earlier iterations of Neon's WebSocket support. + * + * Default: `false`. + */ + static get disableSNI(): SocketDefaults["disableSNI"]; + static set disableSNI(newValue: SocketDefaults['disableSNI']); + get disableSNI(): SocketDefaults["disableSNI"]; + set disableSNI(newValue: SocketDefaults['disableSNI']); + /** + * Pipelines the startup message, cleartext password message and first query + * when set to `"password"`. This works only for cleartext password auth. + * + * Default: `"password"`. + */ + static get pipelineConnect(): SocketDefaults["pipelineConnect"]; + static set pipelineConnect(newValue: SocketDefaults['pipelineConnect']); + get pipelineConnect(): SocketDefaults["pipelineConnect"]; + set pipelineConnect(newValue: SocketDefaults['pipelineConnect']); + /** + * If `forceDisablePgSSL` is `false` and the Postgres connection parameters + * specify TLS, you must supply the subtls TLS library to this option: + * + * ``` + * import { neonConfig } from '@neondatabase/serverless'; + * import * as subtls from 'subtls'; + * neonConfig.subtls = subtls; + * ``` + * + * Default: `undefined`. + */ + static get subtls(): SocketDefaults["subtls"]; + static set subtls(newValue: SocketDefaults['subtls']); + get subtls(): SocketDefaults["subtls"]; + set subtls(newValue: SocketDefaults['subtls']); + /** + * Pipeline the pg SSL request and TLS handshake when `forceDisablePgSSL` is + * `false` and the Postgres connection parameters specify TLS. Currently + * compatible only with Neon hosts. + * + * Default: `false`. + */ + static get pipelineTLS(): SocketDefaults["pipelineTLS"]; + static set pipelineTLS(newValue: SocketDefaults['pipelineTLS']); + get pipelineTLS(): SocketDefaults["pipelineTLS"]; + set pipelineTLS(newValue: SocketDefaults['pipelineTLS']); + /** + * Set `rootCerts` to a string comprising one or more PEM files. These are + * the trusted root certificates for a TLS connection to Postgres when + * `forceDisablePgSSL` is `false` and the Postgres connection parameters + * specify TLS. + * + * Default: `""`. + */ + static get rootCerts(): SocketDefaults["rootCerts"]; + static set rootCerts(newValue: SocketDefaults['rootCerts']); + get rootCerts(): SocketDefaults["rootCerts"]; + set rootCerts(newValue: SocketDefaults['rootCerts']); + wsProxyAddrForHost(host: string, port: number): string; + connecting: boolean; + pending: boolean; + writable: boolean; + encrypted: boolean; + authorized: boolean; + destroyed: boolean; + private ws; + private writeBuffer; + private tlsState; + private tlsRead; + private tlsWrite; + setNoDelay(): this; + setKeepAlive(): this; + ref(): this; + unref(): this; + connect(port: number | string, host: string, connectListener?: () => void): void; + startTls(host: string): Promise; + tlsReadLoop(): Promise; + rawWrite(data: Uint8Array): void; + write(data: Buffer | string, encoding?: string, callback?: (err?: any) => void): boolean; + end(data?: Buffer | string, encoding?: string, callback?: () => void): this; + destroy(): this; +} diff --git a/dist/dts/shims/net/index.d.ts.orig b/dist/dts/shims/net/index.d.ts.orig new file mode 100644 index 0000000..26edac2 --- /dev/null +++ b/dist/dts/shims/net/index.d.ts.orig @@ -0,0 +1,234 @@ +/** + * This file shims parts of the Node.js built-in net and tls packages, by + * implementing net.Socket and tls.connect() on top of WebSockets. It's + * designed to work both in browsers and in Cloudflare Workers (where + * WebSockets work a bit differently). The calling client is assumed to be pg + * (node-postgres). + */ +import { EventEmitter } from 'events'; +import type * as subtls from 'subtls'; +export type { subtls }; +declare global { + const debug: boolean; +} +export interface WebSocketLike { + readonly readyState: number; + binaryType: string; + close(code?: number, reason?: string): void; + send(data: any): void; + addEventListener(type: 'open' | 'message' | 'close' | 'error', listener: (this: WebSocketLike, ev: any) => any, options?: any): void; +} +export interface WebSocketConstructor { + new (...args: any[]): WebSocketLike; +} +export declare function isIP(input: string): number; +export interface FetchEndpointOptions { + jwtAuth?: boolean; +} +export interface SocketDefaults { + poolQueryViaFetch: boolean; + fetchEndpoint: string | ((host: string, port: number | string, options?: FetchEndpointOptions) => string); + fetchConnectionCache: boolean; + fetchFunction: any; + webSocketConstructor: WebSocketConstructor | undefined; + wsProxy: string | ((host: string, port: number | string) => string); + useSecureWebSocket: boolean; + forceDisablePgSSL: boolean; + coalesceWrites: boolean; + pipelineConnect: 'password' | false; + subtls: typeof subtls | undefined; + rootCerts: string; + pipelineTLS: boolean; + disableSNI: boolean; +} +export declare class Socket extends EventEmitter { + static defaults: SocketDefaults; + static opts: Partial; + private opts; + /** + * **Experimentally**, when `poolQueryViaFetch` is `true`, and no listeners + * for the `"connect"`, `"acquire"`, `"release"` or `"remove"` events are set + * on the `Pool`, queries via `Pool.query()` will be sent by low-latency HTTP + * fetch request. + * + * Default: `false`. + */ + static get poolQueryViaFetch(): SocketDefaults["poolQueryViaFetch"]; + static set poolQueryViaFetch(newValue: SocketDefaults['poolQueryViaFetch']); + /** + * Set `fetchEndpoint` to set the server endpoint to be sent queries via http + * fetch. May be useful in local development (e.g. to set a port that's not + * the default 443). + * + * Provide either the full endpoint URL, or a function that takes the + * database host address, port and options, and returns the full endpoint URL + * (including protocol). + * + * Default: custom logic to connect to Neon endpoints. + */ + static get fetchEndpoint(): SocketDefaults["fetchEndpoint"]; + static set fetchEndpoint(newValue: SocketDefaults['fetchEndpoint']); + /** + * **DEPRECATED**. Previously, only when `fetchConnectionCache` was `true` + * did queries carried via HTTP fetch make use of a connection pool/cache + * on the server. All queries now use the connection pool/cache: this setting + * is ignored. + * + * Default: `true`. + */ + static get fetchConnectionCache(): SocketDefaults["fetchConnectionCache"]; + static set fetchConnectionCache(newValue: SocketDefaults['fetchConnectionCache']); + /** + * The `fetchFunction` option allows you to supply an alternative function + * for making http requests. The function must accept the same arguments as + * native `fetch`. + * + * Default: `undefined`. + */ + static get fetchFunction(): SocketDefaults["fetchFunction"]; + static set fetchFunction(newValue: SocketDefaults['fetchFunction']); + /** + * Only if no global `WebSocket` object is available, such as in older + * versions of Node, set `webSocketConstructor` to the constructor for a + * custom WebSocket implementation, such as those provided by `ws` or + * `undici`. + * + * Default: `undefined`. + */ + static get webSocketConstructor(): SocketDefaults["webSocketConstructor"]; + static set webSocketConstructor(newValue: SocketDefaults['webSocketConstructor']); + get webSocketConstructor(): SocketDefaults["webSocketConstructor"]; + set webSocketConstructor(newValue: SocketDefaults['webSocketConstructor']); + /** + * Set `wsProxy` to use your own WebSocket proxy server. + * + * Provide either the proxy server’s domain name, or a function that takes + * the database host and port and returns the proxy server address (without + * protocol). + * + * Example: `(host, port) => "myproxy.example.net?address=" + host + ":" + port` + * + * Default: `host => host + '/v2'` + */ + static get wsProxy(): SocketDefaults["wsProxy"]; + static set wsProxy(newValue: SocketDefaults['wsProxy']); + get wsProxy(): SocketDefaults["wsProxy"]; + set wsProxy(newValue: SocketDefaults['wsProxy']); + /** + * Batch multiple network writes per run-loop into a single outgoing + * WebSocket message. + * + * Default: `true`. + */ + static get coalesceWrites(): SocketDefaults["coalesceWrites"]; + static set coalesceWrites(newValue: SocketDefaults['coalesceWrites']); + get coalesceWrites(): SocketDefaults["coalesceWrites"]; + set coalesceWrites(newValue: SocketDefaults['coalesceWrites']); + /** + * Use a secure (`wss:`) connection to the WebSocket proxy. + * + * Default: `true`. + */ + static get useSecureWebSocket(): SocketDefaults["useSecureWebSocket"]; + static set useSecureWebSocket(newValue: SocketDefaults['useSecureWebSocket']); + get useSecureWebSocket(): SocketDefaults["useSecureWebSocket"]; + set useSecureWebSocket(newValue: SocketDefaults['useSecureWebSocket']); + /** + * Disable TLS encryption in the Postgres protocol (as set via e.g. + * `?sslmode=require` in the connection string). Connection remains secure + * as long as `useSecureWebSocket` is `true`, which is the default. + * + * Default: `true` + */ + static get forceDisablePgSSL(): SocketDefaults["forceDisablePgSSL"]; + static set forceDisablePgSSL(newValue: SocketDefaults['forceDisablePgSSL']); + get forceDisablePgSSL(): SocketDefaults["forceDisablePgSSL"]; + set forceDisablePgSSL(newValue: SocketDefaults['forceDisablePgSSL']); + /** + * When using subtls with `forceDisablePgSSL = false` and Postgres connection + * parameters that specify TLS, setting `disableSNI = true` means that no SNI + * data in included in the Postgres TLS handshake. + * + * On Neon, disabling SNI and including the Neon project name in the password + * avoids CPU-intensive SCRAM authentication, but this is only relevant for + * earlier iterations of Neon's WebSocket support. + * + * Default: `false`. + */ + static get disableSNI(): SocketDefaults["disableSNI"]; + static set disableSNI(newValue: SocketDefaults['disableSNI']); + get disableSNI(): SocketDefaults["disableSNI"]; + set disableSNI(newValue: SocketDefaults['disableSNI']); + /** + * Pipelines the startup message, cleartext password message and first query + * when set to `"password"`. This works only for cleartext password auth. + * + * Default: `"password"`. + */ + static get pipelineConnect(): SocketDefaults["pipelineConnect"]; + static set pipelineConnect(newValue: SocketDefaults['pipelineConnect']); + get pipelineConnect(): SocketDefaults["pipelineConnect"]; + set pipelineConnect(newValue: SocketDefaults['pipelineConnect']); + /** + * If `forceDisablePgSSL` is `false` and the Postgres connection parameters + * specify TLS, you must supply the subtls TLS library to this option: + * + * ``` + * import { neonConfig } from '@neondatabase/serverless'; + * import * as subtls from 'subtls'; + * neonConfig.subtls = subtls; + * ``` + * + * Default: `undefined`. + */ + static get subtls(): SocketDefaults["subtls"]; + static set subtls(newValue: SocketDefaults['subtls']); + get subtls(): SocketDefaults["subtls"]; + set subtls(newValue: SocketDefaults['subtls']); + /** + * Pipeline the pg SSL request and TLS handshake when `forceDisablePgSSL` is + * `false` and the Postgres connection parameters specify TLS. Currently + * compatible only with Neon hosts. + * + * Default: `false`. + */ + static get pipelineTLS(): SocketDefaults["pipelineTLS"]; + static set pipelineTLS(newValue: SocketDefaults['pipelineTLS']); + get pipelineTLS(): SocketDefaults["pipelineTLS"]; + set pipelineTLS(newValue: SocketDefaults['pipelineTLS']); + /** + * Set `rootCerts` to a string comprising one or more PEM files. These are + * the trusted root certificates for a TLS connection to Postgres when + * `forceDisablePgSSL` is `false` and the Postgres connection parameters + * specify TLS. + * + * Default: `""`. + */ + static get rootCerts(): SocketDefaults["rootCerts"]; + static set rootCerts(newValue: SocketDefaults['rootCerts']); + get rootCerts(): SocketDefaults["rootCerts"]; + set rootCerts(newValue: SocketDefaults['rootCerts']); + wsProxyAddrForHost(host: string, port: number): string; + connecting: boolean; + pending: boolean; + writable: boolean; + encrypted: boolean; + authorized: boolean; + destroyed: boolean; + private ws; + private writeBuffer; + private tlsState; + private tlsRead; + private tlsWrite; + setNoDelay(): this; + setKeepAlive(): this; + ref(): this; + unref(): this; + connect(port: number | string, host: string, connectListener?: () => void): void; + startTls(host: string): Promise; + tlsReadLoop(): Promise; + rawWrite(data: Uint8Array): void; + write(data: Buffer | string, encoding?: string, callback?: (err?: any) => void): boolean; + end(data?: Buffer | string, encoding?: string, callback?: () => void): this; + destroy(): this; +} diff --git a/dist/dts/shims/url/index.d.ts b/dist/dts/shims/url/index.d.ts new file mode 100644 index 0000000..6744d8b --- /dev/null +++ b/dist/dts/shims/url/index.d.ts @@ -0,0 +1,16 @@ +export declare function parse(url: string, parseQueryString?: boolean): { + href: string; + protocol: string; + auth: string; + username: string; + password: string; + host: string; + hostname: string; + port: string; + pathname: string; + search: string; + query: string | { + [k: string]: string; + }; + hash: string; +}; diff --git a/dist/dts/subtls.d.ts b/dist/dts/subtls.d.ts new file mode 100644 index 0000000..f40e94b --- /dev/null +++ b/dist/dts/subtls.d.ts @@ -0,0 +1,215 @@ +import type { Socket } from 'net'; + +declare const allKeyUsages: readonly ["digitalSignature", "nonRepudiation", "keyEncipherment", "dataEncipherment", "keyAgreement", "keyCertSign", "cRLSign", "encipherOnly", "decipherOnly"]; + +declare class ASN1Bytes extends Bytes { + readASN1Length(comment?: string): number; + expectASN1Length(comment?: string): readonly [() => void, () => number]; + readASN1OID(comment?: string): string; + readASN1Boolean(comment?: string): boolean; + readASN1UTCTime(): Date; + readASN1GeneralizedTime(): Date; + readASN1BitString(): Uint8Array; +} + +export declare function base64Decode(input: string, charCodes?: typeof stdCharCodes, autoPad?: boolean): Uint8Array; + +declare class Bytes { + offset: number; + dataView: DataView; + data: Uint8Array; + comments: Record; + indents: Record; + indent: number; + constructor(arrayOrMaxBytes: number | Uint8Array); + extend(arrayOrMaxBytes: number | Uint8Array): void; + remaining(): number; + subarray(length: number): Uint8Array; + skip(length: number, comment?: string): this; + comment(s: string, offset?: number): this; + lengthComment(length: number, comment?: string, inclusive?: boolean): string; + readBytes(length: number): Uint8Array; + readUTF8String(length: number): string; + readUTF8StringNullTerminated(): string; + readUint8(comment?: string): number; + readUint16(comment?: string): number; + readUint24(comment?: string): number; + readUint32(comment?: string): number; + expectBytes(expected: Uint8Array | number[], comment?: string): void; + expectUint8(expectedValue: number, comment?: string): void; + expectUint16(expectedValue: number, comment?: string): void; + expectUint24(expectedValue: number, comment?: string): void; + expectUint32(expectedValue: number, comment?: string): void; + expectLength(length: number, indentDelta?: number): readonly [() => void, () => number]; + expectLengthUint8(comment?: string): readonly [() => void, () => number]; + expectLengthUint16(comment?: string): readonly [() => void, () => number]; + expectLengthUint24(comment?: string): readonly [() => void, () => number]; + expectLengthUint32(comment?: string): readonly [() => void, () => number]; + expectLengthUint8Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint16Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint24Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint32Incl(comment?: string): readonly [() => void, () => number]; + writeBytes(bytes: number[] | Uint8Array): this; + writeUTF8String(s: string): this; + writeUTF8StringNullTerminated(s: string): this; + writeUint8(value: number, comment?: string): Bytes; + writeUint16(value: number, comment?: string): Bytes; + writeUint24(value: number, comment?: string): Bytes; + writeUint32(value: number, comment?: string): Bytes; + _writeLengthGeneric(lengthBytes: 1 | 2 | 3 | 4, inclusive: boolean, comment?: string): () => void; + writeLengthUint8(comment?: string): () => void; + writeLengthUint16(comment?: string): () => void; + writeLengthUint24(comment?: string): () => void; + writeLengthUint32(comment?: string): () => void; + writeLengthUint8Incl(comment?: string): () => void; + writeLengthUint16Incl(comment?: string): () => void; + writeLengthUint24Incl(comment?: string): () => void; + writeLengthUint32Incl(comment?: string): () => void; + array(): Uint8Array; + commentedString(all?: boolean): string; +} + +declare class Cert { + serialNumber: Uint8Array; + algorithm: OID; + issuer: DistinguishedName; + validityPeriod: { + notBefore: Date; + notAfter: Date; + }; + subject: DistinguishedName; + publicKey: { + identifiers: OID[]; + data: Uint8Array; + all: Uint8Array; + }; + signature: Uint8Array; + keyUsage?: { + critical?: boolean; + usages: Set; + }; + subjectAltNames?: string[]; + extKeyUsage?: { + clientTls?: true; + serverTls?: true; + }; + authorityKeyIdentifier?: Uint8Array; + subjectKeyIdentifier?: Uint8Array; + basicConstraints?: { + critical?: boolean; + ca?: boolean; + pathLength?: number; + } | undefined; + signedData: Uint8Array; + static distinguishedNamesAreEqual(dn1: DistinguishedName, dn2: DistinguishedName): boolean; + static stringFromDistinguishedName(dn: DistinguishedName): string; + constructor(certData: Uint8Array | ASN1Bytes | CertJSON); + subjectAltNameMatchingHost(host: string): string | undefined; + isValidAtMoment(moment?: Date): boolean; + description(): string; + toJSON(): { + serialNumber: string; + algorithm: string; + issuer: DistinguishedName; + validityPeriod: { + notBefore: string; + notAfter: string; + }; + subject: DistinguishedName; + publicKey: { + identifiers: string[]; + data: string; + all: string; + }; + signature: string; + keyUsage: { + critical: boolean | undefined; + usages: ("digitalSignature" | "nonRepudiation" | "keyEncipherment" | "dataEncipherment" | "keyAgreement" | "keyCertSign" | "cRLSign" | "encipherOnly" | "decipherOnly")[]; + }; + subjectAltNames: string[] | undefined; + extKeyUsage: { + clientTls?: true; + serverTls?: true; + } | undefined; + authorityKeyIdentifier: string | undefined; + subjectKeyIdentifier: string | undefined; + basicConstraints: { + critical?: boolean; + ca?: boolean; + pathLength?: number; + } | undefined; + signedData: string; + }; + static uint8ArraysFromPEM(pem: string): Uint8Array[]; + static fromPEM(pem: string): Cert[]; +} + +declare type CertJSON = ReturnType; + +declare interface DataRequest { + bytes: number; + resolve: (data: Uint8Array | undefined) => void; +} + +declare type DistinguishedName = Record; + +export declare function hexFromU8(u8: Uint8Array | number[], spacer?: string): string; + +declare type OID = string; + +declare abstract class ReadQueue { + queue: Uint8Array[]; + outstandingRequest: DataRequest | undefined; + constructor(); + abstract socketIsNotClosed(): boolean; + enqueue(data: Uint8Array): void; + dequeue(): void; + bytesInQueue(): number; + read(bytes: number): Promise | undefined>; +} + +declare type RootCertsData = Uint8Array; + +declare interface RootCertsDatabase { + index: RootCertsIndex; + data: RootCertsData; +} + +declare interface RootCertsIndex { + offsets: number[]; + subjects: Record; +} + +export declare class SocketReadQueue extends ReadQueue { + private socket; + constructor(socket: Socket); + socketIsNotClosed(): boolean; +} + +export declare function stableStringify(x: any, replacer?: (key: string, value: any) => any, indent?: string | number): string; + +export declare function startTls(host: string, rootCertsDatabase: RootCertsDatabase | string, networkRead: (bytes: number) => Promise, networkWrite: (data: Uint8Array) => void, { useSNI, requireServerTlsExtKeyUsage, requireDigitalSigKeyUsage, writePreData, expectPreData, commentPreData }?: { + useSNI?: boolean; + requireServerTlsExtKeyUsage?: boolean; + requireDigitalSigKeyUsage?: boolean; + writePreData?: Uint8Array; + expectPreData?: Uint8Array; + commentPreData?: string; +}): Promise Promise | undefined>, (data: Uint8Array) => Promise]>; + +declare function stdCharCodes(charCode: number): number | void; + +export declare class TrustedCert extends Cert { + static databaseFromPEM(pem: string): RootCertsDatabase; + static findInDatabase(subjectOrSubjectKeyId: DistinguishedName | string, db: RootCertsDatabase): TrustedCert | undefined; +} + +export declare function u8FromHex(hex: string): Uint8Array; + +export declare class WebSocketReadQueue extends ReadQueue { + private socket; + constructor(socket: WebSocket); + socketIsNotClosed(): boolean; +} + +export { } diff --git a/dist/jsr/README.md b/dist/jsr/README.md index e361b09..5da601c 100644 --- a/dist/jsr/README.md +++ b/dist/jsr/README.md @@ -196,22 +196,25 @@ export default async (req: Request, ctx: any) => { // create a `Pool` inside the request handler const pool = new Pool({ connectionString: process.env.DATABASE_URL }); - // get and validate the `postId` query parameter - const postId = parseInt(new URL(req.url).searchParams.get('postId'), 10); - if (isNaN(postId)) return new Response('Bad request', { status: 400 }); - - // query and validate the post - const [post] = await pool.query('SELECT * FROM posts WHERE id = $1', [postId]); - if (!post) return new Response('Not found', { status: 404 }); - - // end the `Pool` inside the same request handler - // (unlike `await`, `ctx.waitUntil` won't hold up the response) - ctx.waitUntil(pool.end()); - - // return the post as JSON - return new Response(JSON.stringify(post), { - headers: { 'content-type': 'application/json' } - }); + try { + // get and validate the `postId` query parameter + const postId = parseInt(new URL(req.url).searchParams.get('postId'), 10); + if (isNaN(postId)) return new Response('Bad request', { status: 400 }); + + // query and validate the post + const { rows: [post] } = await pool.query('SELECT * FROM posts WHERE id = $1', [postId]); + if (!post) return new Response('Not found', { status: 404 }); + + // return the post as JSON + return new Response(JSON.stringify(post), { + headers: { 'content-type': 'application/json' } + }); + + } finally { + // end the `Pool` inside the same request handler + // (unlike `await`, `ctx.waitUntil` won't hold up the response) + ctx.waitUntil(pool.end()); + } } export const config = { @@ -236,22 +239,25 @@ export default async (req: Request, ctx: any) => { const client = new Client(process.env.DATABASE_URL); await client.connect(); - // get and validate the `postId` query parameter - const postId = parseInt(new URL(req.url).searchParams.get('postId'), 10); - if (isNaN(postId)) return new Response('Bad request', { status: 400 }); - - // query and validate the post - const [post] = await client.query('SELECT * FROM posts WHERE id = $1', [postId]); - if (!post) return new Response('Not found', { status: 404 }); - - // end the `Client` inside the same request handler - // (unlike `await`, `ctx.waitUntil` won't hold up the response) - ctx.waitUntil(client.end()); - - // return the post as JSON - return new Response(JSON.stringify(post), { - headers: { 'content-type': 'application/json' } - }); + try { + // get and validate the `postId` query parameter + const postId = parseInt(new URL(req.url).searchParams.get('postId'), 10); + if (isNaN(postId)) return new Response('Bad request', { status: 400 }); + + // query and validate the post + const { rows: [post] } = await client.query('SELECT * FROM posts WHERE id = $1', [postId]); + if (!post) return new Response('Not found', { status: 404 }); + + // return the post as JSON + return new Response(JSON.stringify(post), { + headers: { 'content-type': 'application/json' } + }); + + } finally { + // end the `Client` inside the same request handler + // (unlike `await`, `ctx.waitUntil` won't hold up the response) + ctx.waitUntil(client.end()); + } } export const config = { diff --git a/dist/jsr/index.d.ts b/dist/jsr/index.d.ts index ec5c7b4..82e9d68 100644 --- a/dist/jsr/index.d.ts +++ b/dist/jsr/index.d.ts @@ -1,389 +1,335 @@ +/// + +import { BindConfig } from 'pg'; +import { Client as Client_2 } from 'pg'; +import { ClientBase } from 'pg'; +import { ClientConfig } from 'pg'; +import { Connection } from 'pg'; +import { ConnectionConfig } from 'pg'; +import { CustomTypesConfig } from 'pg'; +import { Defaults } from 'pg'; +import { defaults } from 'pg'; +import { EventEmitter } from 'events'; +import { Events } from 'pg'; +import { ExecuteConfig } from 'pg'; +import { FieldDef } from 'pg'; +import { MessageConfig } from 'pg'; +import { Notification } from 'pg'; +import { Pool as Pool_2 } from 'pg'; +import { PoolConfig } from 'pg'; +import { Query } from 'pg'; +import { QueryArrayConfig } from 'pg'; +import { QueryArrayResult } from 'pg'; +import { QueryConfig } from 'pg'; +import type { QueryConfigValues } from 'pg'; +import { QueryParse } from 'pg'; +import { QueryResult } from 'pg'; +import { QueryResultBase } from 'pg'; +import { QueryResultRow } from 'pg'; +import { ResultBuilder } from 'pg'; +import type { Socket } from 'net'; +import { Submittable } from 'pg'; +import { types } from 'pg'; + +declare const allKeyUsages: readonly ["digitalSignature", "nonRepudiation", "keyEncipherment", "dataEncipherment", "keyAgreement", "keyCertSign", "cRLSign", "encipherOnly", "decipherOnly"]; + +declare class ASN1Bytes extends Bytes { + readASN1Length(comment?: string): number; + expectASN1Length(comment?: string): readonly [() => void, () => number]; + readASN1OID(comment?: string): string; + readASN1Boolean(comment?: string): boolean; + readASN1UTCTime(): Date; + readASN1GeneralizedTime(): Date; + readASN1BitString(): Uint8Array; +} -// @neondatabase/serverless driver types, mimicking pg - -export { - BindConfig, ClientConfig, Connection, ConnectionConfig, CustomTypesConfig, Defaults, defaults, Events, ExecuteConfig, FieldDef, MessageConfig, native, Notification, PoolConfig, Query, QueryArrayConfig, QueryArrayResult, QueryConfig, QueryParse, QueryResult, QueryResultBase, - QueryResultRow, ResultBuilder, Submittable, types -} from "pg"; -export { DatabaseError } from "pg-protocol"; +declare function base64Decode(input: string, charCodes?: typeof stdCharCodes, autoPad?: boolean): Uint8Array; + +export { BindConfig } + +export declare const _bundleExt: 'js' | 'mjs'; + +declare class Bytes { + offset: number; + dataView: DataView; + data: Uint8Array; + comments: Record; + indents: Record; + indent: number; + constructor(arrayOrMaxBytes: number | Uint8Array); + extend(arrayOrMaxBytes: number | Uint8Array): void; + remaining(): number; + subarray(length: number): Uint8Array; + skip(length: number, comment?: string): this; + comment(s: string, offset?: number): this; + lengthComment(length: number, comment?: string, inclusive?: boolean): string; + readBytes(length: number): Uint8Array; + readUTF8String(length: number): string; + readUTF8StringNullTerminated(): string; + readUint8(comment?: string): number; + readUint16(comment?: string): number; + readUint24(comment?: string): number; + readUint32(comment?: string): number; + expectBytes(expected: Uint8Array | number[], comment?: string): void; + expectUint8(expectedValue: number, comment?: string): void; + expectUint16(expectedValue: number, comment?: string): void; + expectUint24(expectedValue: number, comment?: string): void; + expectUint32(expectedValue: number, comment?: string): void; + expectLength(length: number, indentDelta?: number): readonly [() => void, () => number]; + expectLengthUint8(comment?: string): readonly [() => void, () => number]; + expectLengthUint16(comment?: string): readonly [() => void, () => number]; + expectLengthUint24(comment?: string): readonly [() => void, () => number]; + expectLengthUint32(comment?: string): readonly [() => void, () => number]; + expectLengthUint8Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint16Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint24Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint32Incl(comment?: string): readonly [() => void, () => number]; + writeBytes(bytes: number[] | Uint8Array): this; + writeUTF8String(s: string): this; + writeUTF8StringNullTerminated(s: string): this; + writeUint8(value: number, comment?: string): Bytes; + writeUint16(value: number, comment?: string): Bytes; + writeUint24(value: number, comment?: string): Bytes; + writeUint32(value: number, comment?: string): Bytes; + _writeLengthGeneric(lengthBytes: 1 | 2 | 3 | 4, inclusive: boolean, comment?: string): () => void; + writeLengthUint8(comment?: string): () => void; + writeLengthUint16(comment?: string): () => void; + writeLengthUint24(comment?: string): () => void; + writeLengthUint32(comment?: string): () => void; + writeLengthUint8Incl(comment?: string): () => void; + writeLengthUint16Incl(comment?: string): () => void; + writeLengthUint24Incl(comment?: string): () => void; + writeLengthUint32Incl(comment?: string): () => void; + array(): Uint8Array; + commentedString(all?: boolean): string; +} -interface FetchEndpointOptions { - jwtAuth?: boolean; +declare class Cert { + serialNumber: Uint8Array; + algorithm: OID; + issuer: DistinguishedName; + validityPeriod: { + notBefore: Date; + notAfter: Date; + }; + subject: DistinguishedName; + publicKey: { + identifiers: OID[]; + data: Uint8Array; + all: Uint8Array; + }; + signature: Uint8Array; + keyUsage?: { + critical?: boolean; + usages: Set; + }; + subjectAltNames?: string[]; + extKeyUsage?: { + clientTls?: true; + serverTls?: true; + }; + authorityKeyIdentifier?: Uint8Array; + subjectKeyIdentifier?: Uint8Array; + basicConstraints?: { + critical?: boolean; + ca?: boolean; + pathLength?: number; + } | undefined; + signedData: Uint8Array; + static distinguishedNamesAreEqual(dn1: DistinguishedName, dn2: DistinguishedName): boolean; + static stringFromDistinguishedName(dn: DistinguishedName): string; + constructor(certData: Uint8Array | ASN1Bytes | CertJSON); + subjectAltNameMatchingHost(host: string): string | undefined; + isValidAtMoment(moment?: Date): boolean; + description(): string; + toJSON(): { + serialNumber: string; + algorithm: string; + issuer: DistinguishedName; + validityPeriod: { + notBefore: string; + notAfter: string; + }; + subject: DistinguishedName; + publicKey: { + identifiers: string[]; + data: string; + all: string; + }; + signature: string; + keyUsage: { + critical: boolean | undefined; + usages: ("digitalSignature" | "nonRepudiation" | "keyEncipherment" | "dataEncipherment" | "keyAgreement" | "keyCertSign" | "cRLSign" | "encipherOnly" | "decipherOnly")[]; + }; + subjectAltNames: string[] | undefined; + extKeyUsage: { + clientTls?: true; + serverTls?: true; + } | undefined; + authorityKeyIdentifier: string | undefined; + subjectKeyIdentifier: string | undefined; + basicConstraints: { + critical?: boolean; + ca?: boolean; + pathLength?: number; + } | undefined; + signedData: string; + }; + static uint8ArraysFromPEM(pem: string): Uint8Array[]; + static fromPEM(pem: string): Cert[]; } -export interface NeonConfigGlobalOnly { - /** - * Set `fetchEndpoint` to set the server endpoint to be sent queries via http - * fetch. May be useful in local development (e.g. to set a port that's not - * the default 443). - * - * Provide either the full endpoint URL, or a function that takes the - * database host address and port and returns the full endpoint URL - * (including protocol). - * - * Default: `host => 'https://' + host + '/sql'` - * - */ - fetchEndpoint: string | ((host: string, port: number | string, options?: FetchEndpointOptions) => string); - - /** - * **Experimentally**, when `poolQueryViaFetch` is `true`, and no listeners - * for the `"connect"`, `"acquire"`, `"release"` or `"remove"` events are set - * on the `Pool`, queries via `Pool.query()` will be sent by low-latency HTTP - * fetch request. - * - * Default: `false`. - */ - poolQueryViaFetch: boolean; - - /** - * **DEPRECATED**. Previously, only when `fetchConnectionCache` was `true` - * did queries carried via HTTP fetch make use of a connection pool/cache - * on the server. All queries now use the connection pool/cache: this setting - * is ignored. - * - * Default: `true`. - */ - fetchConnectionCache: boolean; - - /** - * The `fetchFunction` option allows you to supply an alternative function - * for making http requests. The function must accept the same arguments as - * native `fetch`. - * - * Default: `undefined`. - */ - fetchFunction: any; +declare type CertJSON = ReturnType; + +export declare interface Client { + connection: Connection & { + stream: neonConfig; + sendSCRAMClientFinalMessage: (response: any) => void; + ssl: any; + }; + _handleReadyForQuery: any; + _handleAuthCleartextPassword: any; + startup: any; + getStartupConf: any; + saslSession: any; } -export interface NeonConfigGlobalAndClient { - /** - * If no global `WebSocket` object is available, set `webSocketConstructor` - * to the constructor for a custom WebSocket implementation, such as those - * provided by `ws` or `undici`. - */ - webSocketConstructor: any; - - /** - * Set `wsProxy` to use your own WebSocket proxy server. - * - * Provide either the proxy server’s domain name, or a function that takes - * the database host and port and returns the proxy server address (without - * protocol). - * - * Example: `(host, port) => "myproxy.example.net?address=" + host + ":" + port` - * - * Default: `host => host + '/v2'` - */ - wsProxy: string | ((host: string, port: number | string) => string) | undefined; - - /** - * Use a secure (`wss:`) connection to the WebSocket proxy. - * - * Default: `true`. - */ - useSecureWebSocket: boolean; - - /** - * Disable TLS encryption in the Postgres protocol (as set via e.g. - * `?sslmode=require` in the connection string). Connection remains secure - * if `useSecureWebSocket` is `true`. - * - * Default: `true` - */ - forceDisablePgSSL: boolean; - - /** - * Pipelines the startup message, cleartext password message and first query - * when set to `"password"`. This works only for cleartext password auth. - * - * Default: `"password"`. - */ - pipelineConnect: "password" | false; - - /** - * If `forceDisablePgSSL` is `false` and the Postgres connection parameters - * specify TLS, you must supply the subtls TLS library to this option: - * - * ``` - * import { neonConfig } from '@neondatabase/serverless'; - * import * as subtls from 'subtls'; - * neonConfig.subtls = subtls; - * ``` - * - * Default: `undefined`. - */ - subtls: any; - - /** - * Pipeline the pg SSL request and TLS handshake when `forceDisablePgSSL` is - * `false` and the Postgres connection parameters specify TLS. Currently - * compatible only with Neon hosts. - * - * Default: `false`. - */ - pipelineTLS: boolean; - - /** - * Set `rootCerts` to a string comprising one or more PEM files. These are - * the trusted root certificates for a TLS connection to Postgres when - * `forceDisablePgSSL` is `false` and the Postgres connection parameters - * specify TLS. - * - * Default: `""`. - */ - rootCerts: string; - - /** - * Batch multiple network writes per run-loop into a single outgoing - * WebSocket message. - * - * Default: `true`. - */ - coalesceWrites: boolean; - - /** - * When `disableSNI` is `true`, `forceDisablePgSSL` is `false` and the - * Postgres connection parameters specify TLS, we send no SNI data in the - * Postgres TLS handshake. - * - * On Neon, disabling SNI and including the Neon project name in the password - * avoids CPU-intensive SCRAM authentication, but this is only relevant for - * earlier iterations of Neon's WebSocket support. - * - * Default: `false`. - */ - disableSNI: boolean; +/** + * The node-postgres `Client` object re-exported with minor modifications. + * https://node-postgres.com/apis/client + */ +export declare class Client extends Client_2 { + config: any; + get neonConfig(): neonConfig; + constructor(config: any); + connect(): Promise; + connect(callback: (err?: Error) => void): void; + _handleAuthSASLContinue(msg: any): Promise; } -export interface NeonConfig extends NeonConfigGlobalOnly, NeonConfigGlobalAndClient { } +export { ClientBase } -import { - Client as PgClient, - ClientBase as PgClientBase, - Pool as PgPool, - PoolClient as PgPoolClient, - types as PgTypes -} from "pg"; +export { ClientConfig } -export class ClientBase extends PgClientBase { - neonConfig: NeonConfigGlobalAndClient; -} +export { Connection } -export class Client extends PgClient { - neonConfig: NeonConfigGlobalAndClient; -} +export { ConnectionConfig } -export interface PoolClient extends PgPoolClient { - neonConfig: NeonConfigGlobalAndClient; -} +export { CustomTypesConfig } -export class Pool extends PgPool { - connect(): Promise; - connect(callback: (err: Error, client: PoolClient, done: (release?: any) => void) => void): void; - on(event: 'error', listener: (err: Error, client: PoolClient) => void): this; - on(event: 'connect' | 'acquire' | 'remove', listener: (client: PoolClient) => void): this; +declare interface DataRequest { + bytes: number; + resolve: (data: Uint8Array | undefined) => void; } -export const neonConfig: NeonConfig; - - -// SQL-over-HTTP +export { Defaults } -import { FieldDef } from "pg"; +export { defaults } -export type QueryRows = - ArrayMode extends true ? any[][] : Record[]; +declare type DistinguishedName = Record; -export interface FullQueryResults { - fields: FieldDef[]; - command: string; - rowCount: number; - rows: QueryRows; - rowAsArray: ArrayMode; -} +export { Events } -export interface ParameterizedQuery { - query: string; - params: any[]; -} +export { ExecuteConfig } -export interface HTTPQueryOptions { - /** - * When `arrayMode` is `false`, which is the default, result rows are - * returned as objects whose keys represent column names, such as - * `{ id: 1 }`). - * - * When `arrayMode` is `true`, rows are returned as arrays (and keys are not - * provided), e.g. `[1]`. - */ - arrayMode?: ArrayMode; - /** - * When `fullResults` is `false`, which is the default, only result rows are - * returned, e.g. `[{ id: 1 }]`). - * - * When `fullResults` is `true`, a result object is returned that matches - * what's returned by node-postgres. This has a `rows` property, which is an - * array of result rows, plus `fields`, which provides column names and - * types, `command` and `rowCount`. - */ - fullResults?: FullResults; // default false - /** - * Any options in `fetchOptions` are merged in to the options passed to - * `fetch`. In case of conflict with what would otherwise be passed, these - * options take precedence. - */ - fetchOptions?: Record; - - /** - * JWT auth token to be passed as the Bearer token in the Authorization header - * - * Default: `undefined` - */ - authToken?: string | (() => Promise | string); - - /** - * Custom type parsers - * See https://github.com/brianc/node-pg-types - */ - types?: typeof PgTypes; +export declare interface FetchEndpointOptions { + jwtAuth?: boolean; } -export interface HTTPTransactionOptions extends HTTPQueryOptions { - /** - * Postgres transaction isolation level: see https://www.postgresql.org/docs/current/transaction-iso.html. - * Note that `ReadUncommitted` actually gets you `ReadCommitted` in Postgres. - * */ - isolationLevel?: 'ReadUncommitted' | 'ReadCommitted' | 'RepeatableRead' | 'Serializable'; - /** - * When `readOnly` is `false`, which is the default, a `READ WRITE` Postgres - * transaction is used. - * - * When `readOnly` is `true`, a `READ ONLY` Postgres transaction is used. - * */ - readOnly?: boolean; - /** - * When `deferrable` is `false`, which is the default, a `NOT DEFERRABLE` - * Postgres transaction is used. - * - * When `deferrable` is `true` (and `isolationLevel` is `Serializable` and - * `readOnly` is `true`), a `DEFERRABLE` Postgres transaction is used. - * */ - deferrable?: boolean; -} +export { FieldDef } -export interface NeonQueryPromise extends Promise { - parameterizedQuery: ParameterizedQuery; - opts?: HTTPQueryOptions; +export declare interface FullQueryResults { + fields: FieldDef[]; + command: string; + rowCount: number; + rows: QueryRows; + rowAsArray: ArrayMode; } -export interface NeonQueryInTransaction { - // this is a simplified form of query, which has only a `parameterizedQuery` (no `opts` and not a `Promise`) - parameterizedQuery: ParameterizedQuery; +declare function hexFromU8(u8: Uint8Array | number[], spacer?: string): string; + +export declare interface HTTPQueryOptions { + /** + * When `arrayMode` is `false`, which is the default, result rows are + * returned as objects whose keys represent column names, such as + * `{ id: 1 }`). + * + * When `arrayMode` is `true`, rows are returned as arrays (and keys are not + * provided), e.g. `[1]`. + */ + arrayMode?: ArrayMode; + /** + * When `fullResults` is `false`, which is the default, only result rows are + * returned, e.g. `[{ id: 1 }]`). + * + * When `fullResults` is `true`, a result object is returned that matches + * what's returned by node-postgres. This has a `rows` property, which is an + * array of result rows, plus `fields`, which provides column names and + * types, `command` and `rowCount`. + */ + fullResults?: FullResults; + /** + * Any options in `fetchOptions` are merged in to the options passed to + * `fetch`. In case of conflict with what would otherwise be passed, these + * options take precedence. + */ + fetchOptions?: Record; + /** + * JWT auth token to be passed as the Bearer token in the Authorization header. + * Can be string, or a function (sync or async) returning a string. + * + * Default: `undefined` + */ + authToken?: string | (() => Promise | string); + /** + * Custom type parsers. See https://github.com/brianc/node-pg-types. + */ + types?: typeof types; + queryCallback?: (query: ParameterizedQuery) => void; + resultCallback?: (query: ParameterizedQuery, result: any, rows: any, opts: any) => void; } -export interface NeonQueryFunctionInTransaction { - // this is a simplified form of NeonQueryFunction (below): - // * `opts` cannot be passed - // * no `transaction()` method is available - - // tagged-template function usage - (strings: TemplateStringsArray, ...params: any[]): - NeonQueryPromise : QueryRows>; - - // ordinary function usage (*no* options overrides) - (string: string, params?: any[]): - NeonQueryPromise : QueryRows>; +export declare interface HTTPTransactionOptions extends HTTPQueryOptions { + isolationLevel?: 'ReadUncommitted' | 'ReadCommitted' | 'RepeatableRead' | 'Serializable'; + readOnly?: boolean; + deferrable?: boolean; } -export interface NeonQueryFunction { - // tagged-template function usage - (strings: TemplateStringsArray, ...params: any[]): - NeonQueryPromise : QueryRows>; - - // ordinary function usage, with options overrides - ( - string: string, - params?: any[], - opts?: HTTPQueryOptions - ): NeonQueryPromise< - ArrayModeOverride, - FullResultsOverride, - FullResultsOverride extends true ? FullQueryResults : QueryRows - >; - - /** - * The `transaction()` function allows multiple queries to be submitted (over - * HTTP) as a single, non-interactive Postgres transaction. - * - * For example: - * ``` - * import { neon } from "@neondatabase/serverless"; - * const sql = neon("postgres://user:pass@host/db"); - * - * const results = await sql.transaction([ - * sql`SELECT 1 AS num`, - * sql`SELECT 'a' AS str`, - * ]); - * // -> [[{ num: 1 }], [{ str: "a" }]] - * - * // or equivalently: - * const results = await sql.transaction(txn => [ - * txn`SELECT 1 AS num`, - * txn`SELECT 'a' AS str`, - * ]); - * // -> [[{ num: 1 }], [{ str: "a" }]] - * ``` - * @param queriesOrFn Either an array of queries, or a (non-`async`) function - * that receives a query function and returns an array of queries. - * @param opts The same options that may be set on individual queries in a - * non-transaction setting -- that is, `arrayMode` `fullResults` and - * `fetchOptions` -- plus the transaction options `isolationLevel`, - * `readOnly` and `deferrable`. Note that none of these options can be set on - * individual queries within a transaction. - * @returns An array of results. The structure of each result object depends - * on the `arrayMode` and `fullResults` options. - */ - transaction: ( - queriesOrFn: NeonQueryPromise[] | // not ArrayModeOverride or FullResultsOverride: clamp these values to the current ones - ((sql: NeonQueryFunctionInTransaction) => NeonQueryInTransaction[]), - opts?: HTTPTransactionOptions - ) => Promise[] : QueryRows[]>; -} +export { MessageConfig } /** * This function returns an async tagged-template function that runs a single * SQL query (no session or transactions) with low latency over https. Support - * for multiple queries as a non-interactive transaction is provided by + * for multiple queries (as a non-interactive transaction) is provided by * the `transaction` property of the query function. - * + * * By default, the query function returns database rows directly. Types should * match those returned by this driver (i.e. Pool or Client) over WebSockets. - * - * The returned function can also be called directly (i.e. not as a template - * function). In that case, pass it a query string with embedded `$1`, `$2` + * + * The returned function can also be called directly (i.e. not as a template + * function). In that case, pass it a query string with embedded `$1`, `$2` * (etc.), followed by an array of query parameters, followed (optionally) by * any of the same options you can pass to this function. - * + * * Some examples: * ``` * import { neon } from "@neondatabase/serverless"; * const h = "hello", w = "world"; - * + * * // example 1: default options, tagged-template usage * const sql = neon("postgres://user:pass@host/db"); - * const rows = await sql`SELECT ${h} || ' ' || ${w} AS greeting`; + * const rows = await sql`SELECT ${h} || ' ' || ${w} AS greeting`; * // -> [ { greeting: "hello world" } ] - * + * * // example 2: `arrayMode` and `fullResults` options, ordinary function usage * const options = { arrayMode: true, fullResults: true }; * const sql = neon("postgres://user:pass@host/db", options); * const rows = await sql("SELECT $1 || ' ' || $2 AS greeting", [h, w]); - * // -> { - * // command: "SELECT", + * // -> { + * // command: "SELECT", * // fields: [ { name: "greeting", dataTypeID: 25 } ], - * // rowAsArray: true, - * // rowCount: 1, + * // rowAsArray: true, + * // rowCount: 1, * // rows: [ [ "hello world" ] ] * // } * @@ -395,39 +341,444 @@ export interface NeonQueryFunction [ { greeting: "hello world" } ] * ``` - * - * @param connectionString this has the format `postgres://user:pass@host/db` - * @param options pass `arrayMode: true` to receive results as an array of + * + * @param connectionString - this has the format `postgres://user:pass@host/db` + * @param options - pass `arrayMode: true` to receive results as an array of * arrays, instead of the default array of objects; pass `fullResults: true` * to receive a complete result object similar to one returned by node-postgres * (with properties `rows`, `fields`, `command`, `rowCount`, `rowAsArray`); * pass as `fetchOptions` an object which will be merged into the options * passed to `fetch`. */ -export function neon( - connectionString: string, - options?: HTTPTransactionOptions, -): NeonQueryFunction; - -export class NeonDbError extends Error { - name: 'NeonDbError'; - - severity: string | undefined; - code: string | undefined; - detail: string | undefined; - hint: string | undefined; - position: string | undefined; - internalPosition: string | undefined; - internalQuery: string | undefined; - where: string | undefined; - schema: string | undefined; - table: string | undefined; - column: string | undefined; - dataType: string | undefined; - constraint: string | undefined; - file: string | undefined; - line: string | undefined; - routine: string | undefined; - - sourceError: Error | undefined; +export declare function neon(connectionString: string, { arrayMode: neonOptArrayMode, fullResults: neonOptFullResults, fetchOptions: neonOptFetchOptions, isolationLevel: neonOptIsolationLevel, readOnly: neonOptReadOnly, deferrable: neonOptDeferrable, queryCallback, resultCallback, authToken, }?: HTTPTransactionOptions): NeonQueryFunction; + +export declare class neonConfig extends EventEmitter { + static defaults: SocketDefaults; + static opts: Partial; + /** + * **Experimentally**, when `poolQueryViaFetch` is `true`, and no listeners + * for the `"connect"`, `"acquire"`, `"release"` or `"remove"` events are set + * on the `Pool`, queries via `Pool.query()` will be sent by low-latency HTTP + * fetch request. + * + * Default: `false`. + */ + static get poolQueryViaFetch(): SocketDefaults["poolQueryViaFetch"]; + static set poolQueryViaFetch(newValue: SocketDefaults['poolQueryViaFetch']); + /** + * Set `fetchEndpoint` to set the server endpoint to be sent queries via http + * fetch. May be useful in local development (e.g. to set a port that's not + * the default 443). + * + * Provide either the full endpoint URL, or a function that takes the + * database host address, port and options, and returns the full endpoint URL + * (including protocol). + * + * Default: custom logic to connect to Neon endpoints. + */ + static get fetchEndpoint(): SocketDefaults["fetchEndpoint"]; + static set fetchEndpoint(newValue: SocketDefaults['fetchEndpoint']); + /** + * **DEPRECATED**. Previously, only when `fetchConnectionCache` was `true` + * did queries carried via HTTP fetch make use of a connection pool/cache + * on the server. All queries now use the connection pool/cache: this setting + * is ignored. + * + * Default: `true`. + */ + static get fetchConnectionCache(): SocketDefaults["fetchConnectionCache"]; + static set fetchConnectionCache(newValue: SocketDefaults['fetchConnectionCache']); + /** + * The `fetchFunction` option allows you to supply an alternative function + * for making http requests. The function must accept the same arguments as + * native `fetch`. + * + * Default: `undefined`. + */ + static get fetchFunction(): SocketDefaults["fetchFunction"]; + static set fetchFunction(newValue: SocketDefaults['fetchFunction']); + /** + * Only if no global `WebSocket` object is available, such as in older + * versions of Node, set `webSocketConstructor` to the constructor for a + * custom WebSocket implementation, such as those provided by `ws` or + * `undici`. + * + * Default: `undefined`. + */ + static get webSocketConstructor(): SocketDefaults["webSocketConstructor"]; + static set webSocketConstructor(newValue: SocketDefaults['webSocketConstructor']); + get webSocketConstructor(): SocketDefaults["webSocketConstructor"]; + set webSocketConstructor(newValue: SocketDefaults['webSocketConstructor']); + /** + * Set `wsProxy` to use your own WebSocket proxy server. + * + * Provide either the proxy server’s domain name, or a function that takes + * the database host and port and returns the proxy server address (without + * protocol). + * + * Example: `(host, port) => "myproxy.example.net?address=" + host + ":" + port` + * + * Default: `host => host + '/v2'` + */ + static get wsProxy(): SocketDefaults["wsProxy"]; + static set wsProxy(newValue: SocketDefaults['wsProxy']); + get wsProxy(): SocketDefaults["wsProxy"]; + set wsProxy(newValue: SocketDefaults['wsProxy']); + /** + * Batch multiple network writes per run-loop into a single outgoing + * WebSocket message. + * + * Default: `true`. + */ + static get coalesceWrites(): SocketDefaults["coalesceWrites"]; + static set coalesceWrites(newValue: SocketDefaults['coalesceWrites']); + get coalesceWrites(): SocketDefaults["coalesceWrites"]; + set coalesceWrites(newValue: SocketDefaults['coalesceWrites']); + /** + * Use a secure (`wss:`) connection to the WebSocket proxy. + * + * Default: `true`. + */ + static get useSecureWebSocket(): SocketDefaults["useSecureWebSocket"]; + static set useSecureWebSocket(newValue: SocketDefaults['useSecureWebSocket']); + get useSecureWebSocket(): SocketDefaults["useSecureWebSocket"]; + set useSecureWebSocket(newValue: SocketDefaults['useSecureWebSocket']); + /** + * Disable TLS encryption in the Postgres protocol (as set via e.g. + * `?sslmode=require` in the connection string). Connection remains secure + * as long as `useSecureWebSocket` is `true`, which is the default. + * + * Default: `true` + */ + static get forceDisablePgSSL(): SocketDefaults["forceDisablePgSSL"]; + static set forceDisablePgSSL(newValue: SocketDefaults['forceDisablePgSSL']); + get forceDisablePgSSL(): SocketDefaults["forceDisablePgSSL"]; + set forceDisablePgSSL(newValue: SocketDefaults['forceDisablePgSSL']); + /** + * When using subtls with `forceDisablePgSSL = false` and Postgres connection + * parameters that specify TLS, setting `disableSNI = true` means that no SNI + * data in included in the Postgres TLS handshake. + * + * On Neon, disabling SNI and including the Neon project name in the password + * avoids CPU-intensive SCRAM authentication, but this is only relevant for + * earlier iterations of Neon's WebSocket support. + * + * Default: `false`. + */ + static get disableSNI(): SocketDefaults["disableSNI"]; + static set disableSNI(newValue: SocketDefaults['disableSNI']); + get disableSNI(): SocketDefaults["disableSNI"]; + set disableSNI(newValue: SocketDefaults['disableSNI']); + /** + * Pipelines the startup message, cleartext password message and first query + * when set to `"password"`. This works only for cleartext password auth. + * + * Default: `"password"`. + */ + static get pipelineConnect(): SocketDefaults["pipelineConnect"]; + static set pipelineConnect(newValue: SocketDefaults['pipelineConnect']); + get pipelineConnect(): SocketDefaults["pipelineConnect"]; + set pipelineConnect(newValue: SocketDefaults['pipelineConnect']); + /** + * If `forceDisablePgSSL` is `false` and the Postgres connection parameters + * specify TLS, you must supply the subtls TLS library to this option: + * + * ``` + * import { neonConfig } from '@neondatabase/serverless'; + * import * as subtls from 'subtls'; + * neonConfig.subtls = subtls; + * ``` + * + * Default: `undefined`. + */ + static get subtls(): SocketDefaults["subtls"]; + static set subtls(newValue: SocketDefaults['subtls']); + get subtls(): SocketDefaults["subtls"]; + set subtls(newValue: SocketDefaults['subtls']); + /** + * Pipeline the pg SSL request and TLS handshake when `forceDisablePgSSL` is + * `false` and the Postgres connection parameters specify TLS. Currently + * compatible only with Neon hosts. + * + * Default: `false`. + */ + static get pipelineTLS(): SocketDefaults["pipelineTLS"]; + static set pipelineTLS(newValue: SocketDefaults['pipelineTLS']); + get pipelineTLS(): SocketDefaults["pipelineTLS"]; + set pipelineTLS(newValue: SocketDefaults['pipelineTLS']); + /** + * Set `rootCerts` to a string comprising one or more PEM files. These are + * the trusted root certificates for a TLS connection to Postgres when + * `forceDisablePgSSL` is `false` and the Postgres connection parameters + * specify TLS. + * + * Default: `""`. + */ + static get rootCerts(): SocketDefaults["rootCerts"]; + static set rootCerts(newValue: SocketDefaults['rootCerts']); + get rootCerts(): SocketDefaults["rootCerts"]; + set rootCerts(newValue: SocketDefaults['rootCerts']); + wsProxyAddrForHost(host: string, port: number): string; + connecting: boolean; + pending: boolean; + writable: boolean; + encrypted: boolean; + authorized: boolean; + destroyed: boolean; + setNoDelay(): this; + setKeepAlive(): this; + ref(): this; + unref(): this; + connect(port: number | string, host: string, connectListener?: () => void): void; + startTls(host: string): Promise; + tlsReadLoop(): Promise; + rawWrite(data: Uint8Array): void; + write(data: Buffer | string, encoding?: string, callback?: (err?: any) => void): boolean; + end(data?: Buffer | string, encoding?: string, callback?: () => void): this; + destroy(): this; +} + +export declare class NeonDbError extends Error { + name: "NeonDbError"; + severity: string | undefined; + code: string | undefined; + detail: string | undefined; + hint: string | undefined; + position: string | undefined; + internalPosition: string | undefined; + internalQuery: string | undefined; + where: string | undefined; + schema: string | undefined; + table: string | undefined; + column: string | undefined; + dataType: string | undefined; + constraint: string | undefined; + file: string | undefined; + line: string | undefined; + routine: string | undefined; + sourceError: Error | undefined; + constructor(message: string); +} + +export declare interface NeonQueryFunction { + (strings: TemplateStringsArray, ...params: any[]): NeonQueryPromise : QueryRows>; + (string: string, params?: any[], opts?: HTTPQueryOptions): NeonQueryPromise : QueryRows>; + /** + * The `transaction()` function allows multiple queries to be submitted (over + * HTTP) as a single, non-interactive Postgres transaction. + * + * For example: + * ``` + * import { neon } from "@neondatabase/serverless"; + * const sql = neon("postgres://user:pass@host/db"); + * + * const results = await sql.transaction([ + * sql`SELECT 1 AS num`, + * sql`SELECT 'a' AS str`, + * ]); + * // -> [[{ num: 1 }], [{ str: "a" }]] + * + * // or equivalently: + * const results = await sql.transaction(txn => [ + * txn`SELECT 1 AS num`, + * txn`SELECT 'a' AS str`, + * ]); + * // -> [[{ num: 1 }], [{ str: "a" }]] + * ``` + * @param queriesOrFn - Either an array of queries, or a (non-`async`) function + * that receives a query function and returns an array of queries. + * @param opts - The same options that may be set on individual queries in a + * non-transaction setting -- that is, `arrayMode` `fullResults` and + * `fetchOptions` -- plus the transaction options `isolationLevel`, + * `readOnly` and `deferrable`. Note that none of these options can be set on + * individual queries within a transaction. + * @returns An array of results. The structure of each result object depends + * on the `arrayMode` and `fullResults` options. + */ + transaction: (queriesOrFn: NeonQueryPromise[] | ((sql: NeonQueryFunctionInTransaction) => NeonQueryInTransaction[]), opts?: HTTPTransactionOptions) => Promise[] : QueryRows[]>; +} + +export declare interface NeonQueryFunctionInTransaction { + (strings: TemplateStringsArray, ...params: any[]): NeonQueryPromise : QueryRows>; + (string: string, params?: any[]): NeonQueryPromise : QueryRows>; +} + +export declare interface NeonQueryInTransaction { + parameterizedQuery: ParameterizedQuery; } + +export declare interface NeonQueryPromise extends Promise { + parameterizedQuery: ParameterizedQuery; + opts?: HTTPQueryOptions; +} + +export { Notification } + +declare type OID = string; + +export declare interface ParameterizedQuery { + query: string; + params: any[]; +} + +/** + * The node-postgres `Pool` object re-exported with minor modifications. + * https://node-postgres.com/apis/pool + */ +export declare class Pool extends Pool_2 { + Client: typeof Client; + hasFetchUnsupportedListeners: boolean; + on(event: 'error' | 'connect' | 'acquire' | 'release' | 'remove', listener: any): this; + addListener: (event: "error" | "connect" | "acquire" | "release" | "remove", listener: any) => this; + query(queryStream: T): T; + query(queryConfig: QueryArrayConfig, values?: QueryConfigValues): Promise>; + query(queryConfig: QueryConfig): Promise>; + query(queryTextOrConfig: string | QueryConfig, values?: QueryConfigValues): Promise>; + query(queryConfig: QueryArrayConfig, callback: (err: Error, result: QueryArrayResult) => void): void; + query(queryTextOrConfig: string | QueryConfig, callback: (err: Error, result: QueryResult) => void): void; + query(queryText: string, values: QueryConfigValues, callback: (err: Error, result: QueryResult) => void): void; +} + +export { PoolConfig } + +export declare interface ProcessQueryResultOptions { + arrayMode: boolean; + fullResults: boolean; + parameterizedQuery: ParameterizedQuery; + resultCallback: HTTPQueryOptions['resultCallback']; + types?: typeof types; +} + +export { Query } + +export { QueryArrayConfig } + +export { QueryArrayResult } + +export { QueryConfig } + +export { QueryParse } + +export { QueryResult } + +export { QueryResultBase } + +export { QueryResultRow } + +export declare type QueryRows = ArrayMode extends true ? any[][] : Record[]; + +declare abstract class ReadQueue { + queue: Uint8Array[]; + outstandingRequest: DataRequest | undefined; + constructor(); + abstract socketIsNotClosed(): boolean; + enqueue(data: Uint8Array): void; + dequeue(): void; + bytesInQueue(): number; + read(bytes: number): Promise | undefined>; +} + +export { ResultBuilder } + +declare type RootCertsData = Uint8Array; + +declare interface RootCertsDatabase { + index: RootCertsIndex; + data: RootCertsData; +} + +declare interface RootCertsIndex { + offsets: number[]; + subjects: Record; +} + +export declare interface SocketDefaults { + poolQueryViaFetch: boolean; + fetchEndpoint: string | ((host: string, port: number | string, options?: FetchEndpointOptions) => string); + fetchConnectionCache: boolean; + fetchFunction: any; + webSocketConstructor: WebSocketConstructor | undefined; + wsProxy: string | ((host: string, port: number | string) => string); + useSecureWebSocket: boolean; + forceDisablePgSSL: boolean; + coalesceWrites: boolean; + pipelineConnect: 'password' | false; + subtls: typeof subtls | undefined; + rootCerts: string; + pipelineTLS: boolean; + disableSNI: boolean; +} + +declare class SocketReadQueue extends ReadQueue { + constructor(socket: Socket); + socketIsNotClosed(): boolean; +} + +declare function stableStringify(x: any, replacer?: (key: string, value: any) => any, indent?: string | number): string; + +declare function startTls(host: string, rootCertsDatabase: RootCertsDatabase | string, networkRead: (bytes: number) => Promise, networkWrite: (data: Uint8Array) => void, { useSNI, requireServerTlsExtKeyUsage, requireDigitalSigKeyUsage, writePreData, expectPreData, commentPreData }?: { + useSNI?: boolean; + requireServerTlsExtKeyUsage?: boolean; + requireDigitalSigKeyUsage?: boolean; + writePreData?: Uint8Array; + expectPreData?: Uint8Array; + commentPreData?: string; +}): Promise Promise | undefined>, (data: Uint8Array) => Promise]>; + +declare function stdCharCodes(charCode: number): number | void; + +export { Submittable } + +declare namespace subtls { + export { + base64Decode, + hexFromU8, + stableStringify, + startTls, + stdCharCodes, + u8FromHex, + allKeyUsages, + ASN1Bytes, + Bytes, + Cert, + CertJSON, + DataRequest, + DistinguishedName, + OID, + ReadQueue, + RootCertsData, + RootCertsDatabase, + RootCertsIndex, + SocketReadQueue, + TrustedCert, + WebSocketReadQueue + } +} +export { subtls } + +declare class TrustedCert extends Cert { + static databaseFromPEM(pem: string): RootCertsDatabase; + static findInDatabase(subjectOrSubjectKeyId: DistinguishedName | string, db: RootCertsDatabase): TrustedCert | undefined; +} + +export { types } + +declare function u8FromHex(hex: string): Uint8Array; + +export declare interface WebSocketConstructor { + new (...args: any[]): WebSocketLike; +} + +export declare interface WebSocketLike { + readonly readyState: number; + binaryType: string; + close(code?: number, reason?: string): void; + send(data: any): void; + addEventListener(type: 'open' | 'message' | 'close' | 'error', listener: (this: WebSocketLike, ev: any) => any, options?: any): void; +} + +declare class WebSocketReadQueue extends ReadQueue { + constructor(socket: WebSocket); + socketIsNotClosed(): boolean; +} + diff --git a/dist/jsr/index.js b/dist/jsr/index.js index 7ff28f6..dcc0134 100644 --- a/dist/jsr/index.js +++ b/dist/jsr/index.js @@ -1,57 +1,60 @@ /// -var io=Object.create;var Ce=Object.defineProperty;var so=Object.getOwnPropertyDescriptor;var oo=Object.getOwnPropertyNames;var ao=Object.getPrototypeOf,uo=Object.prototype.hasOwnProperty;var co=(r,e,t)=>e in r?Ce(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}): -r[e]=t;var a=(r,e)=>Ce(r,"name",{value:e,configurable:!0});var z=(r,e)=>()=>(r&&(e=r(r=0)),e);var I=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),se=(r,e)=>{for(var t in e) -Ce(r,t,{get:e[t],enumerable:!0})},Tn=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e== -"function")for(let i of oo(e))!uo.call(r,i)&&i!==t&&Ce(r,i,{get:()=>e[i],enumerable:!(n= -so(e,i))||n.enumerable});return r};var Te=(r,e,t)=>(t=r!=null?io(ao(r)):{},Tn(e||!r||!r.__esModule?Ce(t,"default",{ -value:r,enumerable:!0}):t,r)),O=r=>Tn(Ce({},"__esModule",{value:!0}),r);var _=(r,e,t)=>co(r,typeof e!="symbol"?e+"":e,t);var Bn=I(st=>{"use strict";p();st.byteLength=lo;st.toByteArray=po;st.fromByteArray= -go;var ae=[],re=[],ho=typeof Uint8Array<"u"?Uint8Array:Array,Rt="ABCDEFGHIJKLMNO\ -PQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ee=0,In=Rt.length;Eee in r?Ce(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}): +r[e]=t;var a=(r,e)=>Ce(r,"name",{value:e,configurable:!0}),Tn=(r=>typeof require<"u"?require: +typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)( +function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error( +'Dynamic require of "'+r+'" is not supported')});var z=(r,e)=>()=>(r&&(e=r(r=0)),e);var I=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ie=(r,e)=>{for(var t in e) +Ce(r,t,{get:e[t],enumerable:!0})},In=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e== +"function")for(let i of ao(e))!co.call(r,i)&&i!==t&&Ce(r,i,{get:()=>e[i],enumerable:!(n= +oo(e,i))||n.enumerable});return r};var Te=(r,e,t)=>(t=r!=null?so(uo(r)):{},In(e||!r||!r.__esModule?Ce(t,"default",{ +value:r,enumerable:!0}):t,r)),U=r=>In(Ce({},"__esModule",{value:!0}),r);var A=(r,e,t)=>lo(r,typeof e!="symbol"?e+"":e,t);var Fn=I(it=>{"use strict";d();it.byteLength=fo;it.toByteArray=yo;it.fromByteArray= +wo;var ae=[],te=[],ho=typeof Uint8Array<"u"?Uint8Array:Array,Ft="ABCDEFGHIJKLMNO\ +PQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ee=0,Rn=Ft.length;Ee0)throw new Error("Invalid string. Length must be a multip\ le of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}a(Pn, -"getLens");function lo(r){var e=Pn(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(lo,"byte\ -Length");function fo(r,e,t){return(e+t)*3/4-t}a(fo,"_byteLength");function po(r){ -var e,t=Pn(r),n=t[0],i=t[1],s=new ho(fo(r,n,i)),o=0,u=i>0?n-4:n,c;for(c=0;c0?n-4:n,c;for(c=0;c>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e= -re[r.charCodeAt(c)]<<2|re[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=re[r.charCodeAt( -c)]<<10|re[r.charCodeAt(c+1)]<<4|re[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]= -e&255),s}a(po,"toByteArray");function yo(r){return ae[r>>18&63]+ae[r>>12&63]+ae[r>> -6&63]+ae[r&63]}a(yo,"tripletToBase64");function mo(r,e,t){for(var n,i=[],s=e;su?u:o+s));return n===1?(e=r[t-1],i.push(ae[e>>2]+ +te[r.charCodeAt(c)]<<2|te[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=te[r.charCodeAt( +c)]<<10|te[r.charCodeAt(c+1)]<<4|te[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]= +e&255),s}a(yo,"toByteArray");function mo(r){return ae[r>>18&63]+ae[r>>12&63]+ae[r>> +6&63]+ae[r&63]}a(mo,"tripletToBase64");function go(r,e,t){for(var n,i=[],s=e;su?u:o+s));return n===1?(e=r[t-1],i.push(ae[e>>2]+ ae[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(ae[e>>10]+ae[e>>4&63]+ae[e<< -2&63]+"=")),i.join("")}a(go,"fromByteArray")});var Ln=I(Ft=>{p();Ft.read=function(r,e,t,n,i){var s,o,u=i*8-n-1,c=(1<> -1,l=-7,d=t?i-1:0,b=t?-1:1,C=r[e+d];for(d+=b,s=C&(1<<-l)-1,C>>=-l,l+=u;l>0;s=s*256+ -r[e+d],d+=b,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=o*256+r[e+d],d+=b,l-=8);if(s=== -0)s=1-h;else{if(s===c)return o?NaN:(C?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-h}return(C? --1:1)*o*Math.pow(2,s-n)};Ft.write=function(r,e,t,n,i,s){var o,u,c,h=s*8-i-1,l=(1<< -h)-1,d=l>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=n?0:s-1,B=n?1:-1,Q=e<0|| -e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=l):(o=Math. -floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+d>=1?e+=b/c:e+= -b*Math.pow(2,1-d),e*c>=2&&(o++,c/=2),o+d>=l?(u=0,o=l):o+d>=1?(u=(e*c-1)*Math.pow( -2,i),o=o+d):(u=e*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;r[t+C]=u&255,C+=B,u/=256, -i-=8);for(o=o<0;r[t+C]=o&255,C+=B,o/=256,h-=8);r[t+C-B]|=Q*128}});var Kn=I(Le=>{"use strict";p();var Mt=Bn(),Pe=Ln(),Rn=typeof Symbol=="function"&& -typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Le.Buffer= -f;Le.SlowBuffer=vo;Le.INSPECT_MAX_BYTES=50;var ot=2147483647;Le.kMaxLength=ot;f. -TYPED_ARRAY_SUPPORT=wo();!f.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console. +2&63]+"=")),i.join("")}a(wo,"fromByteArray")});var Ln=I(Lt=>{d();Lt.read=function(r,e,t,n,i){var s,o,u=i*8-n-1,c=(1<> +1,h=-7,p=t?i-1:0,S=t?-1:1,_=r[e+p];for(p+=S,s=_&(1<<-h)-1,_>>=-h,h+=u;h>0;s=s*256+ +r[e+p],p+=S,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=n;h>0;o=o*256+r[e+p],p+=S,h-=8);if(s=== +0)s=1-l;else{if(s===c)return o?NaN:(_?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(_? +-1:1)*o*Math.pow(2,s-n)};Lt.write=function(r,e,t,n,i,s){var o,u,c,l=s*8-i-1,h=(1<< +l)-1,p=h>>1,S=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:s-1,P=n?1:-1,G=e<0|| +e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=h):(o=Math. +floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+p>=1?e+=S/c:e+= +S*Math.pow(2,1-p),e*c>=2&&(o++,c/=2),o+p>=h?(u=0,o=h):o+p>=1?(u=(e*c-1)*Math.pow( +2,i),o=o+p):(u=e*Math.pow(2,p-1)*Math.pow(2,i),o=0));i>=8;r[t+_]=u&255,_+=P,u/=256, +i-=8);for(o=o<0;r[t+_]=o&255,_+=P,o/=256,l-=8);r[t+_-P]|=G*128}});var zn=I(Fe=>{"use strict";d();var Bt=Fn(),Re=Ln(),Bn=typeof Symbol=="function"&& +typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Fe.Buffer= +f;Fe.SlowBuffer=Ao;Fe.INSPECT_MAX_BYTES=50;var st=2147483647;Fe.kMaxLength=st;f. +TYPED_ARRAY_SUPPORT=bo();!f.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console. error=="function"&&console.error("This browser lacks typed array (Uint8Array) su\ pport which is required by `buffer` v5.x. Use `buffer` v4.x if you require old b\ -rowser support.");function wo(){try{let r=new Uint8Array(1),e={foo:a(function(){ +rowser support.");function bo(){try{let r=new Uint8Array(1),e={foo:a(function(){ return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf( -r,e),r.foo()===42}catch{return!1}}a(wo,"typedArraySupport");Object.defineProperty( +r,e),r.foo()===42}catch{return!1}}a(bo,"typedArraySupport");Object.defineProperty( f.prototype,"parent",{enumerable:!0,get:a(function(){if(f.isBuffer(this))return this. buffer},"get")});Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:a( -function(){if(f.isBuffer(this))return this.byteOffset},"get")});function le(r){if(r> -ot)throw new RangeError('The value "'+r+'" is invalid for option "size"');let e=new Uint8Array( -r);return Object.setPrototypeOf(e,f.prototype),e}a(le,"createBuffer");function f(r,e,t){ +function(){if(f.isBuffer(this))return this.byteOffset},"get")});function he(r){if(r> +st)throw new RangeError('The value "'+r+'" is invalid for option "size"');let e=new Uint8Array( +r);return Object.setPrototypeOf(e,f.prototype),e}a(he,"createBuffer");function f(r,e,t){ if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" a\ -rgument must be of type string. Received type number');return Ot(r)}return kn(r, -e,t)}a(f,"Buffer");f.poolSize=8192;function kn(r,e,t){if(typeof r=="string")return So( -r,e);if(ArrayBuffer.isView(r))return xo(r);if(r==null)throw new TypeError("The f\ +rgument must be of type string. Received type number');return Qt(r)}return Qn(r, +e,t)}a(f,"Buffer");f.poolSize=8192;function Qn(r,e,t){if(typeof r=="string")return xo( +r,e);if(ArrayBuffer.isView(r))return vo(r);if(r==null)throw new TypeError("The f\ irst argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-l\ ike Object. Received type "+typeof r);if(ue(r,ArrayBuffer)||r&&ue(r.buffer,ArrayBuffer)|| typeof SharedArrayBuffer<"u"&&(ue(r,SharedArrayBuffer)||r&&ue(r.buffer,SharedArrayBuffer))) @@ -61,31 +64,31 @@ if(n!=null&&n!==r)return f.from(n,e,t);let i=Eo(r);if(i)return i;if(typeof Symbo "u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return f. from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argumen\ t must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. \ -Received type "+typeof r)}a(kn,"from");f.from=function(r,e,t){return kn(r,e,t)}; +Received type "+typeof r)}a(Qn,"from");f.from=function(r,e,t){return Qn(r,e,t)}; Object.setPrototypeOf(f.prototype,Uint8Array.prototype);Object.setPrototypeOf(f, -Uint8Array);function Un(r){if(typeof r!="number")throw new TypeError('"size" arg\ +Uint8Array);function Dn(r){if(typeof r!="number")throw new TypeError('"size" arg\ ument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is\ - invalid for option "size"')}a(Un,"assertSize");function bo(r,e,t){return Un(r), -r<=0?le(r):e!==void 0?typeof t=="string"?le(r).fill(e,t):le(r).fill(e):le(r)}a(bo, -"alloc");f.alloc=function(r,e,t){return bo(r,e,t)};function Ot(r){return Un(r),le( -r<0?0:Nt(r)|0)}a(Ot,"allocUnsafe");f.allocUnsafe=function(r){return Ot(r)};f.allocUnsafeSlow= -function(r){return Ot(r)};function So(r,e){if((typeof e!="string"||e==="")&&(e="\ -utf8"),!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=On(r,e)| -0,n=le(t),i=n.write(r,e);return i!==t&&(n=n.slice(0,i)),n}a(So,"fromString");function Dt(r){ -let e=r.length<0?0:Nt(r.length)|0,t=le(e);for(let n=0;n= -ot)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ -ot.toString(16)+" bytes");return r|0}a(Nt,"checked");function vo(r){return+r!=r&& -(r=0),f.alloc(+r)}a(vo,"SlowBuffer");f.isBuffer=a(function(e){return e!=null&&e. +n,f.prototype),n}a(kt,"fromArrayBuffer");function Eo(r){if(f.isBuffer(r)){let e=Dt( +r.length)|0,t=he(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0) +return typeof r.length!="number"||qt(r.length)?he(0):Mt(r);if(r.type==="Buffer"&& +Array.isArray(r.data))return Mt(r.data)}a(Eo,"fromObject");function Dt(r){if(r>= +st)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ +st.toString(16)+" bytes");return r|0}a(Dt,"checked");function Ao(r){return+r!=r&& +(r=0),f.alloc(+r)}a(Ao,"SlowBuffer");f.isBuffer=a(function(e){return e!=null&&e. _isBuffer===!0&&e!==f.prototype},"isBuffer");f.compare=a(function(e,t){if(ue(e,Uint8Array)&& (e=f.from(e,e.offset,e.byteLength)),ue(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)), !f.isBuffer(e)||!f.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments\ @@ -100,150 +103,150 @@ if(t===void 0)for(t=0,n=0;ni.length?(f.isBuffer( o)||(o=f.from(o)),o.copy(i,s)):Uint8Array.prototype.set.call(i,o,s);else if(f.isBuffer( o))o.copy(i,s);else throw new TypeError('"list" argument must be an Array of Buf\ -fers');s+=o.length}return i},"concat");function On(r,e){if(f.isBuffer(r))return r. +fers');s+=o.length}return i},"concat");function Un(r,e){if(f.isBuffer(r))return r. length;if(ArrayBuffer.isView(r)||ue(r,ArrayBuffer))return r.byteLength;if(typeof r!= "string")throw new TypeError('The "string" argument must be one of type string, \ Buffer, or ArrayBuffer. Received type '+typeof r);let t=r.length,n=arguments.length> 2&&arguments[2]===!0;if(!n&&t===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"\ -latin1":case"binary":return t;case"utf8":case"utf-8":return Ut(r).length;case"uc\ +latin1":case"binary":return t;case"utf8":case"utf-8":return Ot(r).length;case"uc\ s2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"\ -base64":return Vn(r).length;default:if(i)return n?-1:Ut(r).length;e=(""+e).toLowerCase(), -i=!0}}a(On,"byteLength");f.byteLength=On;function _o(r,e,t){let n=!1;if((e===void 0|| +base64":return Kn(r).length;default:if(i)return n?-1:Ot(r).length;e=(""+e).toLowerCase(), +i=!0}}a(Un,"byteLength");f.byteLength=Un;function _o(r,e,t){let n=!1;if((e===void 0|| e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)|| -(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Mo( -this,e,t);case"utf8":case"utf-8":return qn(this,e,t);case"ascii":return Ro(this, -e,t);case"latin1":case"binary":return Fo(this,e,t);case"base64":return Bo(this,e, -t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Do(this,e,t);default: +(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return ko( +this,e,t);case"utf8":case"utf-8":return Nn(this,e,t);case"ascii":return Bo(this, +e,t);case"latin1":case"binary":return Mo(this,e,t);case"base64":return Fo(this,e, +t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Oo(this,e,t);default: if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a( -_o,"slowToString");f.prototype._isBuffer=!0;function ve(r,e,t){let n=r[e];r[e]=r[t], -r[t]=n}a(ve,"swap");f.prototype.swap16=a(function(){let e=this.length;if(e%2!==0) +_o,"slowToString");f.prototype._isBuffer=!0;function Ae(r,e,t){let n=r[e];r[e]=r[t], +r[t]=n}a(Ae,"swap");f.prototype.swap16=a(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;t< -e;t+=2)ve(this,t,t+1);return this},"swap16");f.prototype.swap32=a(function(){let e=this. +e;t+=2)Ae(this,t,t+1);return this},"swap16");f.prototype.swap32=a(function(){let e=this. length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bit\ -s");for(let t=0;tt&&(e+=" ... "),""},"inspect");Rn&&(f.prototype[Rn]=f.prototype.inspect);f.prototype.compare= +e+">"},"inspect");Bn&&(f.prototype[Bn]=f.prototype.inspect);f.prototype.compare= a(function(e,t,n,i,s){if(ue(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f. isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffe\ r or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e? e.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),t<0||n>e.length||i<0|| s>this.length)throw new RangeError("out of range index");if(i>=s&&t>=n)return 0; if(i>=s)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,s>>>=0,this===e)return 0; -let o=s-i,u=n-t,c=Math.min(o,u),h=this.slice(i,s),l=e.slice(t,n);for(let d=0;d2147483647?t=2147483647: -t<-2147483648&&(t=-2147483648),t=+t,Qt(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t), +t<-2147483648&&(t=-2147483648),t=+t,qt(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t), t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e== -"string"&&(e=f.from(e,n)),f.isBuffer(e))return e.length===0?-1:Fn(r,e,t,n,i);if(typeof e== +"string"&&(e=f.from(e,n)),f.isBuffer(e))return e.length===0?-1:Mn(r,e,t,n,i);if(typeof e== "number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array. -prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Fn(r, -[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Nn,"bid\ -irectionalIndexOf");function Fn(r,e,t,n,i){let s=1,o=r.length,u=e.length;if(n!== +prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Mn(r, +[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(qn,"bid\ +irectionalIndexOf");function Mn(r,e,t,n,i){let s=1,o=r.length,u=e.length;if(n!== void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="\ -utf-16le")){if(r.length<2||e.length<2)return-1;s=2,o/=2,u/=2,t/=2}function c(l,d){ -return s===1?l[d]:l.readUInt16BE(d*s)}a(c,"read");let h;if(i){let l=-1;for(h=t;h< -o;h++)if(c(r,h)===c(e,l===-1?0:h-l)){if(l===-1&&(l=h),h-l+1===u)return l*s}else l!== --1&&(h-=h-l),l=-1}else for(t+u>o&&(t=o-u),h=t;h>=0;h--){let l=!0;for(let d=0;do&&(t=o-u),l=t;l>=0;l--){let h=!0;for(let p=0;pi&&(n=i)):n=i;let s=e.length;n> -s/2&&(n=s/2);let o;for(o=0;o>>0,isFinite(n)? (n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.wri\ te(string, encoding, offset[, length]) is no longer supported");let s=this.length- t;if((n===void 0||n>s)&&(n=s),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError( "Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"\ -hex":return Ao(this,e,t,n);case"utf8":case"utf-8":return Co(this,e,t,n);case"asc\ -ii":case"latin1":case"binary":return To(this,e,t,n);case"base64":return Io(this, +hex":return Co(this,e,t,n);case"utf8":case"utf-8":return To(this,e,t,n);case"asc\ +ii":case"latin1":case"binary":return Io(this,e,t,n);case"base64":return Ro(this, e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Po(this,e,t,n);default: if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"\ write");f.prototype.toJSON=a(function(){return{type:"Buffer",data:Array.prototype. -slice.call(this._arr||this,0)}},"toJSON");function Bo(r,e,t){return e===0&&t===r. -length?Mt.fromByteArray(r):Mt.fromByteArray(r.slice(e,t))}a(Bo,"base64Slice");function qn(r,e,t){ +slice.call(this._arr||this,0)}},"toJSON");function Fo(r,e,t){return e===0&&t===r. +length?Bt.fromByteArray(r):Bt.fromByteArray(r.slice(e,t))}a(Fo,"base64Slice");function Nn(r,e,t){ t=Math.min(r.length,t);let n=[],i=e;for(;i239?4:s>223? -3:s>191?2:1;if(i+u<=t){let c,h,l,d;switch(u){case 1:s<128&&(o=s);break;case 2:c= -r[i+1],(c&192)===128&&(d=(s&31)<<6|c&63,d>127&&(o=d));break;case 3:c=r[i+1],h=r[i+ -2],(c&192)===128&&(h&192)===128&&(d=(s&15)<<12|(c&63)<<6|h&63,d>2047&&(d<55296|| -d>57343)&&(o=d));break;case 4:c=r[i+1],h=r[i+2],l=r[i+3],(c&192)===128&&(h&192)=== -128&&(l&192)===128&&(d=(s&15)<<18|(c&63)<<12|(h&63)<<6|l&63,d>65535&&d<1114112&& -(o=d))}}o===null?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320| -o&1023),n.push(o),i+=u}return Lo(n)}a(qn,"utf8Slice");var Mn=4096;function Lo(r){ -let e=r.length;if(e<=Mn)return String.fromCharCode.apply(String,r);let t="",n=0; -for(;n191?2:1;if(i+u<=t){let c,l,h,p;switch(u){case 1:s<128&&(o=s);break;case 2:c= +r[i+1],(c&192)===128&&(p=(s&31)<<6|c&63,p>127&&(o=p));break;case 3:c=r[i+1],l=r[i+ +2],(c&192)===128&&(l&192)===128&&(p=(s&15)<<12|(c&63)<<6|l&63,p>2047&&(p<55296|| +p>57343)&&(o=p));break;case 4:c=r[i+1],l=r[i+2],h=r[i+3],(c&192)===128&&(l&192)=== +128&&(h&192)===128&&(p=(s&15)<<18|(c&63)<<12|(l&63)<<6|h&63,p>65535&&p<1114112&& +(o=p))}}o===null?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320| +o&1023),n.push(o),i+=u}return Lo(n)}a(Nn,"utf8Slice");var kn=4096;function Lo(r){ +let e=r.length;if(e<=kn)return String.fromCharCode.apply(String,r);let t="",n=0; +for(;nn)&&(t=n);let i="";for(let s=e;sn)&&(t=n);let i="";for(let s=e;sn&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),tt)throw new RangeError( -"Trying to access beyond buffer length")}a(N,"checkOffset");f.prototype.readUintLE= -f.prototype.readUIntLE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||N(e,t,this.length);let i=this[e], +"Trying to access beyond buffer length")}a(q,"checkOffset");f.prototype.readUintLE= +f.prototype.readUIntLE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||q(e,t,this.length);let i=this[e], s=1,o=0;for(;++o>>0,t=t>>>0,n||N(e,t,this. +readUintBE=f.prototype.readUIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||q(e,t,this. length);let i=this[e+--t],s=1;for(;t>0&&(s*=256);)i+=this[e+--t]*s;return i},"re\ adUIntBE");f.prototype.readUint8=f.prototype.readUInt8=a(function(e,t){return e= -e>>>0,t||N(e,1,this.length),this[e]},"readUInt8");f.prototype.readUint16LE=f.prototype. -readUInt16LE=a(function(e,t){return e=e>>>0,t||N(e,2,this.length),this[e]|this[e+ +e>>>0,t||q(e,1,this.length),this[e]},"readUInt8");f.prototype.readUint16LE=f.prototype. +readUInt16LE=a(function(e,t){return e=e>>>0,t||q(e,2,this.length),this[e]|this[e+ 1]<<8},"readUInt16LE");f.prototype.readUint16BE=f.prototype.readUInt16BE=a(function(e,t){ -return e=e>>>0,t||N(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");f.prototype. -readUint32LE=f.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||N(e,4,this. +return e=e>>>0,t||q(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");f.prototype. +readUint32LE=f.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||q(e,4,this. length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE"); f.prototype.readUint32BE=f.prototype.readUInt32BE=a(function(e,t){return e=e>>>0, -t||N(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"\ -readUInt32BE");f.prototype.readBigUInt64LE=me(a(function(e){e=e>>>0,Be(e,"offset"); +t||q(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"\ +readUInt32BE");f.prototype.readBigUInt64LE=ge(a(function(e){e=e>>>0,Pe(e,"offset"); let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&We(e,this.length-8);let i=t+ this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]* 2**16+n*2**24;return BigInt(i)+(BigInt(s)<>>0,Be(e,"offset");let t=this[e],n=this[e+7]; +readBigUInt64BE=ge(a(function(e){e=e>>>0,Pe(e,"offset");let t=this[e],n=this[e+7]; (t===void 0||n===void 0)&&We(e,this.length-8);let i=t*2**24+this[++e]*2**16+this[++e]* 2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt( i)<>>0,t=t>>>0,n||N(e,t,this.length);let i=this[e],s=1,o=0;for(;++o>>0,t=t>>>0,n||q(e,t,this.length);let i=this[e],s=1,o=0;for(;++o=s&&(i-=Math.pow(2,8*t)),i},"readIntLE");f.prototype. -readIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||N(e,t,this.length);let i=t,s=1,o=this[e+ +readIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||q(e,t,this.length);let i=t,s=1,o=this[e+ --i];for(;i>0&&(s*=256);)o+=this[e+--i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*t)), -o},"readIntBE");f.prototype.readInt8=a(function(e,t){return e=e>>>0,t||N(e,1,this. +o},"readIntBE");f.prototype.readInt8=a(function(e,t){return e=e>>>0,t||q(e,1,this. length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");f.prototype.readInt16LE= -a(function(e,t){e=e>>>0,t||N(e,2,this.length);let n=this[e]|this[e+1]<<8;return n& +a(function(e,t){e=e>>>0,t||q(e,2,this.length);let n=this[e]|this[e+1]<<8;return n& 32768?n|4294901760:n},"readInt16LE");f.prototype.readInt16BE=a(function(e,t){e=e>>> -0,t||N(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n}, -"readInt16BE");f.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||N(e,4,this. +0,t||q(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n}, +"readInt16BE");f.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||q(e,4,this. length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");f.prototype. -readInt32BE=a(function(e,t){return e=e>>>0,t||N(e,4,this.length),this[e]<<24|this[e+ -1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");f.prototype.readBigInt64LE=me(a(function(e){ -e=e>>>0,Be(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&We(e, +readInt32BE=a(function(e,t){return e=e>>>0,t||q(e,4,this.length),this[e]<<24|this[e+ +1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");f.prototype.readBigInt64LE=ge(a(function(e){ +e=e>>>0,Pe(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&We(e, this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt( i)<>>0,Be(e,"offset"); +igInt64LE"));f.prototype.readBigInt64BE=ge(a(function(e){e=e>>>0,Pe(e,"offset"); let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&We(e,this.length-8);let i=(t<< 24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,t||N(e,4,this.length),Pe.read(this,e, +readFloatLE=a(function(e,t){return e=e>>>0,t||q(e,4,this.length),Re.read(this,e, !0,23,4)},"readFloatLE");f.prototype.readFloatBE=a(function(e,t){return e=e>>>0, -t||N(e,4,this.length),Pe.read(this,e,!1,23,4)},"readFloatBE");f.prototype.readDoubleLE= -a(function(e,t){return e=e>>>0,t||N(e,8,this.length),Pe.read(this,e,!0,52,8)},"r\ -eadDoubleLE");f.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||N(e,8,this. -length),Pe.read(this,e,!1,52,8)},"readDoubleBE");function Y(r,e,t,n,i,s){if(!f.isBuffer( +t||q(e,4,this.length),Re.read(this,e,!1,23,4)},"readFloatBE");f.prototype.readDoubleLE= +a(function(e,t){return e=e>>>0,t||q(e,8,this.length),Re.read(this,e,!0,52,8)},"r\ +eadDoubleLE");f.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||q(e,8,this. +length),Re.read(this,e,!1,52,8)},"readDoubleBE");function Y(r,e,t,n,i,s){if(!f.isBuffer( r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e< s)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError( "Index out of range")}a(Y,"checkInt");f.prototype.writeUintLE=f.prototype.writeUIntLE= @@ -262,15 +265,15 @@ f.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||Y(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},"writeUInt32LE");f.prototype.writeUint32BE=f.prototype.writeUInt32BE=a(function(e,t,n){ return e=+e,t=t>>>0,n||Y(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},"writeUInt32BE");function Qn(r,e,t,n,i){$n( +this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeUInt32BE");function Wn(r,e,t,n,i){Vn( e,n,i,r,t,7);let s=Number(e&BigInt(4294967295));r[t++]=s,s=s>>8,r[t++]=s,s=s>>8, r[t++]=s,s=s>>8,r[t++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]= -o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,t}a(Qn,"wrtBigUInt64LE");function jn(r,e,t,n,i){ -$n(e,n,i,r,t,7);let s=Number(e&BigInt(4294967295));r[t+7]=s,s=s>>8,r[t+6]=s,s=s>> +o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,t}a(Wn,"wrtBigUInt64LE");function jn(r,e,t,n,i){ +Vn(e,n,i,r,t,7);let s=Number(e&BigInt(4294967295));r[t+7]=s,s=s>>8,r[t+6]=s,s=s>> 8,r[t+5]=s,s=s>>8,r[t+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+ 3]=o,o=o>>8,r[t+2]=o,o=o>>8,r[t+1]=o,o=o>>8,r[t]=o,t+8}a(jn,"wrtBigUInt64BE");f. -prototype.writeBigUInt64LE=me(a(function(e,t=0){return Qn(this,e,t,BigInt(0),BigInt( -"0xffffffffffffffff"))},"writeBigUInt64LE"));f.prototype.writeBigUInt64BE=me(a(function(e,t=0){ +prototype.writeBigUInt64LE=ge(a(function(e,t=0){return Wn(this,e,t,BigInt(0),BigInt( +"0xffffffffffffffff"))},"writeBigUInt64LE"));f.prototype.writeBigUInt64BE=ge(a(function(e,t=0){ return jn(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE")); f.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2, 8*n-1);Y(this,e,t,n,c-1,-c)}let s=0,o=1,u=0;for(this[t]=e&255;++s e>>>16,this[t+3]=e>>>24,t+4},"writeInt32LE");f.prototype.writeInt32BE=a(function(e,t,n){ return e=+e,t=t>>>0,n||Y(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},"writeIn\ -t32BE");f.prototype.writeBigInt64LE=me(a(function(e,t=0){return Qn(this,e,t,-BigInt( +t32BE");f.prototype.writeBigInt64LE=ge(a(function(e,t=0){return Wn(this,e,t,-BigInt( "0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));f.prototype. -writeBigInt64BE=me(a(function(e,t=0){return jn(this,e,t,-BigInt("0x8000000000000\ -000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Wn(r,e,t,n,i,s){ +writeBigInt64BE=ge(a(function(e,t=0){return jn(this,e,t,-BigInt("0x8000000000000\ +000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Hn(r,e,t,n,i,s){ if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError( -"Index out of range")}a(Wn,"checkIEEE754");function Hn(r,e,t,n,i){return e=+e,t= -t>>>0,i||Wn(r,e,t,4,34028234663852886e22,-34028234663852886e22),Pe.write(r,e,t,n, -23,4),t+4}a(Hn,"writeFloat");f.prototype.writeFloatLE=a(function(e,t,n){return Hn( -this,e,t,!0,n)},"writeFloatLE");f.prototype.writeFloatBE=a(function(e,t,n){return Hn( -this,e,t,!1,n)},"writeFloatBE");function Gn(r,e,t,n,i){return e=+e,t=t>>>0,i||Wn( -r,e,t,8,17976931348623157e292,-17976931348623157e292),Pe.write(r,e,t,n,52,8),t+8} -a(Gn,"writeDouble");f.prototype.writeDoubleLE=a(function(e,t,n){return Gn(this,e, -t,!0,n)},"writeDoubleLE");f.prototype.writeDoubleBE=a(function(e,t,n){return Gn( +"Index out of range")}a(Hn,"checkIEEE754");function Gn(r,e,t,n,i){return e=+e,t= +t>>>0,i||Hn(r,e,t,4,34028234663852886e22,-34028234663852886e22),Re.write(r,e,t,n, +23,4),t+4}a(Gn,"writeFloat");f.prototype.writeFloatLE=a(function(e,t,n){return Gn( +this,e,t,!0,n)},"writeFloatLE");f.prototype.writeFloatBE=a(function(e,t,n){return Gn( +this,e,t,!1,n)},"writeFloatBE");function $n(r,e,t,n,i){return e=+e,t=t>>>0,i||Hn( +r,e,t,8,17976931348623157e292,-17976931348623157e292),Re.write(r,e,t,n,52,8),t+8} +a($n,"writeDouble");f.prototype.writeDoubleLE=a(function(e,t,n){return $n(this,e, +t,!0,n)},"writeDoubleLE");f.prototype.writeDoubleBE=a(function(e,t,n){return $n( this,e,t,!1,n)},"writeDoubleBE");f.prototype.copy=a(function(e,t,n,i){if(!f.isBuffer( e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i= this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i>>0, n=n===void 0?this.length:n>>>0,e||(e=0);let s;if(typeof e=="number")for(s=t;s2**32?i=Dn(String(t)):typeof t=="bigint"&&(i=String(t), -(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Dn(i)),i+="n"),n+=` It\ - must be ${e}. Received ${i}`,n},RangeError);function Dn(r){let e="",t=r.length, +isInteger(t)&&Math.abs(t)>2**32?i=On(String(t)):typeof t=="bigint"&&(i=String(t), +(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=On(i)),i+="n"),n+=` It\ + must be ${e}. Received ${i}`,n},RangeError);function On(r){let e="",t=r.length, n=r[0]==="-"?1:0;for(;t>=n+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0, -t)}${e}`}a(Dn,"addNumericalSeparator");function ko(r,e,t){Be(e,"offset"),(r[e]=== -void 0||r[e+t]===void 0)&&We(e,r.length-(t+1))}a(ko,"checkBounds");function $n(r,e,t,n,i,s){ +t)}${e}`}a(On,"addNumericalSeparator");function Qo(r,e,t){Pe(e,"offset"),(r[e]=== +void 0||r[e+t]===void 0)&&We(e,r.length-(t+1))}a(Qo,"checkBounds");function Vn(r,e,t,n,i,s){ if(r>t||r3?e===0||e===BigInt(0)?u= `>= 0${o} and < 2${o} ** ${(s+1)*8}${o}`:u=`>= -(2${o} ** ${(s+1)*8-1}${o}) and \ < 2 ** ${(s+1)*8-1}${o}`:u=`>= ${e}${o} and <= ${t}${o}`,new Ie.ERR_OUT_OF_RANGE( -"value",u,r)}ko(n,i,s)}a($n,"checkIntBI");function Be(r,e){if(typeof r!="number") -throw new Ie.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Be,"validateNumber");function We(r,e,t){ -throw Math.floor(r)!==r?(Be(r,t),new Ie.ERR_OUT_OF_RANGE(t||"offset","an integer", +"value",u,r)}Qo(n,i,s)}a(Vn,"checkIntBI");function Pe(r,e){if(typeof r!="number") +throw new Ie.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Pe,"validateNumber");function We(r,e,t){ +throw Math.floor(r)!==r?(Pe(r,t),new Ie.ERR_OUT_OF_RANGE(t||"offset","an integer", r)):e<0?new Ie.ERR_BUFFER_OUT_OF_BOUNDS:new Ie.ERR_OUT_OF_RANGE(t||"offset",`>= ${t? -1:0} and <= ${e}`,r)}a(We,"boundsError");var Uo=/[^+/0-9A-Za-z-_]/g;function Oo(r){ -if(r=r.split("=")[0],r=r.trim().replace(Uo,""),r.length<2)return"";for(;r.length% -4!==0;)r=r+"=";return r}a(Oo,"base64clean");function Ut(r,e){e=e||1/0;let t,n=r. +1:0} and <= ${e}`,r)}a(We,"boundsError");var Do=/[^+/0-9A-Za-z-_]/g;function Uo(r){ +if(r=r.split("=")[0],r=r.trim().replace(Do,""),r.length<2)return"";for(;r.length% +4!==0;)r=r+"=";return r}a(Uo,"base64clean");function Ot(r,e){e=e||1/0;let t,n=r. length,i=null,s=[];for(let o=0;o55295&&t<57344){if(!i){ if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&& s.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191, @@ -353,75 +356,75 @@ s.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191, s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>> 6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63| 128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}a( -Ut,"utf8ToBytes");function No(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s} -a(qo,"utf16leToBytes");function Vn(r){return Mt.toByteArray(Oo(r))}a(Vn,"base64T\ -oBytes");function at(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) -e[i+t]=r[i];return i}a(at,"blitBuffer");function ue(r,e){return r instanceof e|| +a(No,"utf16leToBytes");function Kn(r){return Bt.toByteArray(Uo(r))}a(Kn,"base64T\ +oBytes");function ot(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) +e[i+t]=r[i];return i}a(ot,"blitBuffer");function ue(r,e){return r instanceof e|| r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name} -a(ue,"isInstance");function Qt(r){return r!==r}a(Qt,"numberIsNaN");var Qo=function(){ +a(ue,"isInstance");function qt(r){return r!==r}a(qt,"numberIsNaN");var Wo=function(){ let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){let n=t*16;for(let i=0;i< -16;++i)e[n+i]=r[t]+r[i]}return e}();function me(r){return typeof BigInt>"u"?jo:r} -a(me,"defineBigIntMethod");function jo(){throw new Error("BigInt not supported")} -a(jo,"BufferBigIntNotDefined")});var S,x,E,w,y,m,p=z(()=>{"use strict";S=globalThis,x=globalThis.setImmediate??(r=>setTimeout( -r,0)),E=globalThis.clearImmediate??(r=>clearTimeout(r)),w=globalThis.crypto??{}; +16;++i)e[n+i]=r[t]+r[i]}return e}();function ge(r){return typeof BigInt>"u"?jo:r} +a(ge,"defineBigIntMethod");function jo(){throw new Error("BigInt not supported")} +a(jo,"BufferBigIntNotDefined")});var b,x,v,w,y,m,d=z(()=>{"use strict";b=globalThis,x=globalThis.setImmediate??(r=>setTimeout( +r,0)),v=globalThis.clearImmediate??(r=>clearTimeout(r)),w=globalThis.crypto??{}; w.subtle??(w.subtle={});y=typeof globalThis.Buffer=="function"&&typeof globalThis. -Buffer.allocUnsafe=="function"?globalThis.Buffer:Kn().Buffer,m=globalThis.process?? +Buffer.allocUnsafe=="function"?globalThis.Buffer:zn().Buffer,m=globalThis.process?? {};m.env??(m.env={});try{m.nextTick(()=>{})}catch{let e=Promise.resolve();m.nextTick= -e.then.bind(e)}});var ge=I((nh,jt)=>{"use strict";p();var Re=typeof Reflect=="object"?Reflect:null, -zn=Re&&typeof Re.apply=="function"?Re.apply:a(function(e,t,n){return Function.prototype. -apply.call(e,t,n)},"ReflectApply"),ut;Re&&typeof Re.ownKeys=="function"?ut=Re.ownKeys: -Object.getOwnPropertySymbols?ut=a(function(e){return Object.getOwnPropertyNames( -e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):ut=a(function(e){return Object. -getOwnPropertyNames(e)},"ReflectOwnKeys");function Wo(r){console&&console.warn&& -console.warn(r)}a(Wo,"ProcessEmitWarning");var Zn=Number.isNaN||a(function(e){return e!== -e},"NumberIsNaN");function L(){L.init.call(this)}a(L,"EventEmitter");jt.exports= -L;jt.exports.once=Vo;L.EventEmitter=L;L.prototype._events=void 0;L.prototype._eventsCount= -0;L.prototype._maxListeners=void 0;var Yn=10;function ct(r){if(typeof r!="functi\ +e.then.bind(e)}});var we=I((sl,Nt)=>{"use strict";d();var Le=typeof Reflect=="object"?Reflect:null, +Yn=Le&&typeof Le.apply=="function"?Le.apply:a(function(e,t,n){return Function.prototype. +apply.call(e,t,n)},"ReflectApply"),at;Le&&typeof Le.ownKeys=="function"?at=Le.ownKeys: +Object.getOwnPropertySymbols?at=a(function(e){return Object.getOwnPropertyNames( +e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):at=a(function(e){return Object. +getOwnPropertyNames(e)},"ReflectOwnKeys");function Ho(r){console&&console.warn&& +console.warn(r)}a(Ho,"ProcessEmitWarning");var Jn=Number.isNaN||a(function(e){return e!== +e},"NumberIsNaN");function F(){F.init.call(this)}a(F,"EventEmitter");Nt.exports= +F;Nt.exports.once=Ko;F.EventEmitter=F;F.prototype._events=void 0;F.prototype._eventsCount= +0;F.prototype._maxListeners=void 0;var Zn=10;function ut(r){if(typeof r!="functi\ on")throw new TypeError('The "listener" argument must be of type Function. Recei\ -ved type '+typeof r)}a(ct,"checkListener");Object.defineProperty(L,"defaultMaxLi\ -steners",{enumerable:!0,get:a(function(){return Yn},"get"),set:a(function(r){if(typeof r!= -"number"||r<0||Zn(r))throw new RangeError('The value of "defaultMaxListeners" is\ - out of range. It must be a non-negative number. Received '+r+".");Yn=r},"set")}); -L.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this). +ved type '+typeof r)}a(ut,"checkListener");Object.defineProperty(F,"defaultMaxLi\ +steners",{enumerable:!0,get:a(function(){return Zn},"get"),set:a(function(r){if(typeof r!= +"number"||r<0||Jn(r))throw new RangeError('The value of "defaultMaxListeners" is\ + out of range. It must be a non-negative number. Received '+r+".");Zn=r},"set")}); +F.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this). _events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners= -this._maxListeners||void 0};L.prototype.setMaxListeners=a(function(e){if(typeof e!= -"number"||e<0||Zn(e))throw new RangeError('The value of "n" is out of range. It \ +this._maxListeners||void 0};F.prototype.setMaxListeners=a(function(e){if(typeof e!= +"number"||e<0||Jn(e))throw new RangeError('The value of "n" is out of range. It \ must be a non-negative number. Received '+e+".");return this._maxListeners=e,this}, -"setMaxListeners");function Jn(r){return r._maxListeners===void 0?L.defaultMaxListeners: -r._maxListeners}a(Jn,"_getMaxListeners");L.prototype.getMaxListeners=a(function(){ -return Jn(this)},"getMaxListeners");L.prototype.emit=a(function(e){for(var t=[], +"setMaxListeners");function Xn(r){return r._maxListeners===void 0?F.defaultMaxListeners: +r._maxListeners}a(Xn,"_getMaxListeners");F.prototype.getMaxListeners=a(function(){ +return Xn(this)},"getMaxListeners");F.prototype.emit=a(function(e){for(var t=[], n=1;n 0&&(o=t[0]),o instanceof Error)throw o;var u=new Error("Unhandled error."+(o?" ("+ o.message+")":""));throw u.context=o,u}var c=s[e];if(c===void 0)return!1;if(typeof c== -"function")zn(c,this,t);else for(var h=c.length,l=ni(c,h),n=0;n0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Po\ +t):o.push(t),i=Xn(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Po\ ssible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners a\ dded. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExce\ -ededWarning",u.emitter=r,u.type=e,u.count=o.length,Wo(u)}return r}a(Xn,"_addList\ -ener");L.prototype.addListener=a(function(e,t){return Xn(this,e,t,!1)},"addListe\ -ner");L.prototype.on=L.prototype.addListener;L.prototype.prependListener=a(function(e,t){ -return Xn(this,e,t,!0)},"prependListener");function Ho(){if(!this.fired)return this. +ededWarning",u.emitter=r,u.type=e,u.count=o.length,Ho(u)}return r}a(ei,"_addList\ +ener");F.prototype.addListener=a(function(e,t){return ei(this,e,t,!1)},"addListe\ +ner");F.prototype.on=F.prototype.addListener;F.prototype.prependListener=a(function(e,t){ +return ei(this,e,t,!0)},"prependListener");function Go(){if(!this.fired)return this. target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0? -this.listener.call(this.target):this.listener.apply(this.target,arguments)}a(Ho, -"onceWrapper");function ei(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e, -listener:t},i=Ho.bind(n);return i.listener=t,n.wrapFn=i,i}a(ei,"_onceWrap");L.prototype. -once=a(function(e,t){return ct(t),this.on(e,ei(this,e,t)),this},"once");L.prototype. -prependOnceListener=a(function(e,t){return ct(t),this.prependListener(e,ei(this, -e,t)),this},"prependOnceListener");L.prototype.removeListener=a(function(e,t){var n, -i,s,o,u;if(ct(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this; +this.listener.call(this.target):this.listener.apply(this.target,arguments)}a(Go, +"onceWrapper");function ti(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e, +listener:t},i=Go.bind(n);return i.listener=t,n.wrapFn=i,i}a(ti,"_onceWrap");F.prototype. +once=a(function(e,t){return ut(t),this.on(e,ti(this,e,t)),this},"once");F.prototype. +prependOnceListener=a(function(e,t){return ut(t),this.prependListener(e,ti(this, +e,t)),this},"prependOnceListener");F.prototype.removeListener=a(function(e,t){var n, +i,s,o,u;if(ut(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this; if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null): (delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!= "function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){u=n[o]. -listener,s=o;break}if(s<0)return this;s===0?n.shift():Go(n,s),n.length===1&&(i[e]= +listener,s=o;break}if(s<0)return this;s===0?n.shift():$o(n,s),n.length===1&&(i[e]= n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||t)}return this}, -"removeListener");L.prototype.off=L.prototype.removeListener;L.prototype.removeAllListeners= +"removeListener");F.prototype.off=F.prototype.removeListener;F.prototype.removeAllListeners= a(function(e){var t,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener=== void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount= 0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]), @@ -429,29 +432,29 @@ this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i=0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function ti(r,e,t){ +1;i>=0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function ri(r,e,t){ var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i== -"function"?t?[i.listener||i]:[i]:t?$o(i):ni(i,i.length)}a(ti,"_listeners");L.prototype. -listeners=a(function(e){return ti(this,e,!0)},"listeners");L.prototype.rawListeners= -a(function(e){return ti(this,e,!1)},"rawListeners");L.listenerCount=function(r,e){ -return typeof r.listenerCount=="function"?r.listenerCount(e):ri.call(r,e)};L.prototype. -listenerCount=ri;function ri(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t== -"function")return 1;if(t!==void 0)return t.length}return 0}a(ri,"listenerCount"); -L.prototype.eventNames=a(function(){return this._eventsCount>0?ut(this._events): -[]},"eventNames");function ni(r,e){for(var t=new Array(e),n=0;n0?at(this._events): +[]},"eventNames");function ii(r,e){for(var t=new Array(e),n=0;nzo});var zo,Ge=z(()=>{"use strict";p();zo={}});function $e(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119, -o=2600822924,u=528734635,c=1541459225,h=0,l=0,d=[1116352408,1899447441,3049323471, +ed type '+typeof r)}a(si,"eventTargetAgnosticAddListener")});var je={};ie(je,{default:()=>Yo});var Yo,He=z(()=>{"use strict";d();Yo={}});function Ge(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119, +o=2600822924,u=528734635,c=1541459225,l=0,h=0,p=[1116352408,1899447441,3049323471, 3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278, 1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078, 604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808, @@ -459,33 +462,33 @@ o=2600822924,u=528734635,c=1541459225,h=0,l=0,d=[1116352408,1899447441,304932347 1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800, 3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556, 883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452, -2361852424,2428436474,2756734187,3204031479,3329325298],b=a((A,g)=>A>>>g|A<<32-g, -"rrot"),C=new Uint32Array(64),B=new Uint8Array(64),Q=a(()=>{for(let R=0,$=0;R<16;R++, -$+=4)C[R]=B[$]<<24|B[$+1]<<16|B[$+2]<<8|B[$+3];for(let R=16;R<64;R++){let $=b(C[R- -15],7)^b(C[R-15],18)^C[R-15]>>>3,ce=b(C[R-2],17)^b(C[R-2],19)^C[R-2]>>>10;C[R]=C[R- -16]+$+C[R-7]+ce|0}let A=e,g=t,P=n,K=i,k=s,j=o,ee=u,oe=c;for(let R=0;R<64;R++){let $=b( -k,6)^b(k,11)^b(k,25),ce=k&j^~k&ee,ye=oe+$+ce+d[R]+C[R]|0,Se=b(A,2)^b(A,13)^b(A,22), -je=A&g^A&P^g&P,he=Se+je|0;oe=ee,ee=j,j=k,k=K+ye|0,K=P,P=g,g=A,A=ye+he|0}e=e+A|0, -t=t+g|0,n=n+P|0,i=i+K|0,s=s+k|0,o=o+j|0,u=u+ee|0,c=c+oe|0,l=0},"process"),X=a(A=>{ -typeof A=="string"&&(A=new TextEncoder().encode(A));for(let g=0;g{if(B[l++]=128,l==64&&Q(),l+8>64){ -for(;l<64;)B[l++]=0;Q()}for(;l<58;)B[l++]=0;let A=h*8;B[l++]=A/1099511627776&255, -B[l++]=A/4294967296&255,B[l++]=A>>>24,B[l++]=A>>>16&255,B[l++]=A>>>8&255,B[l++]= -A&255,Q();let g=new Uint8Array(32);return g[0]=e>>>24,g[1]=e>>>16&255,g[2]=e>>>8& +2361852424,2428436474,2756734187,3204031479,3329325298],S=a((C,g)=>C>>>g|C<<32-g, +"rrot"),_=new Uint32Array(64),P=new Uint8Array(64),G=a(()=>{for(let L=0,$=0;L<16;L++, +$+=4)_[L]=P[$]<<24|P[$+1]<<16|P[$+2]<<8|P[$+3];for(let L=16;L<64;L++){let $=S(_[L- +15],7)^S(_[L-15],18)^_[L-15]>>>3,ce=S(_[L-2],17)^S(_[L-2],19)^_[L-2]>>>10;_[L]=_[L- +16]+$+_[L-7]+ce|0}let C=e,g=t,R=n,W=i,Q=s,j=o,ee=u,oe=c;for(let L=0;L<64;L++){let $=S( +Q,6)^S(Q,11)^S(Q,25),ce=Q&j^~Q&ee,pe=oe+$+ce+p[L]+_[L]|0,xe=S(C,2)^S(C,13)^S(C,22), +Ne=C&g^C&R^g&R,le=xe+Ne|0;oe=ee,ee=j,j=Q,Q=W+pe|0,W=R,R=g,g=C,C=pe+le|0}e=e+C|0, +t=t+g|0,n=n+R|0,i=i+W|0,s=s+Q|0,o=o+j|0,u=u+ee|0,c=c+oe|0,h=0},"process"),X=a(C=>{ +typeof C=="string"&&(C=new TextEncoder().encode(C));for(let g=0;g{if(P[h++]=128,h==64&&G(),h+8>64){ +for(;h<64;)P[h++]=0;G()}for(;h<58;)P[h++]=0;let C=l*8;P[h++]=C/1099511627776&255, +P[h++]=C/4294967296&255,P[h++]=C>>>24,P[h++]=C>>>16&255,P[h++]=C>>>8&255,P[h++]= +C&255,G();let g=new Uint8Array(32);return g[0]=e>>>24,g[1]=e>>>16&255,g[2]=e>>>8& 255,g[3]=e&255,g[4]=t>>>24,g[5]=t>>>16&255,g[6]=t>>>8&255,g[7]=t&255,g[8]=n>>>24, g[9]=n>>>16&255,g[10]=n>>>8&255,g[11]=n&255,g[12]=i>>>24,g[13]=i>>>16&255,g[14]= i>>>8&255,g[15]=i&255,g[16]=s>>>24,g[17]=s>>>16&255,g[18]=s>>>8&255,g[19]=s&255, g[20]=o>>>24,g[21]=o>>>16&255,g[22]=o>>>8&255,g[23]=o&255,g[24]=u>>>24,g[25]=u>>> 16&255,g[26]=u>>>8&255,g[27]=u&255,g[28]=c>>>24,g[29]=c>>>16&255,g[30]=c>>>8&255, -g[31]=c&255,g},"digest");return r===void 0?{add:X,digest:de}:(X(r),de())}var si=z( -()=>{"use strict";p();a($e,"sha256")});var U,Ve,oi=z(()=>{"use strict";p();U=class U{constructor(){_(this,"_dataLength", -0);_(this,"_bufferLength",0);_(this,"_state",new Int32Array(4));_(this,"_buffer", -new ArrayBuffer(68));_(this,"_buffer8");_(this,"_buffer32");this._buffer8=new Uint8Array( +g[31]=c&255,g},"digest");return r===void 0?{add:X,digest:se}:(X(r),se())}var oi=z( +()=>{"use strict";d();a(Ge,"sha256")});var D,$e,ai=z(()=>{"use strict";d();D=class D{constructor(){A(this,"_dataLength", +0);A(this,"_bufferLength",0);A(this,"_state",new Int32Array(4));A(this,"_buffer", +new ArrayBuffer(68));A(this,"_buffer8");A(this,"_buffer32");this._buffer8=new Uint8Array( this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}static hashByteArray(e,t=!1){ return this.onePassHasher.start().appendByteArray(e).end(t)}static hashStr(e,t=!1){ return this.onePassHasher.start().appendStr(e).end(t)}static hashAsciiStr(e,t=!1){ -return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(e){let t=U. -hexChars,n=U.hexOut,i,s,o,u;for(u=0;u<4;u+=1)for(s=u*8,i=e[u],o=0;o<8;o+=2)n[s+1+ +return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(e){let t=D. +hexChars,n=D.hexOut,i,s,o,u;for(u=0;u<4;u+=1)for(s=u*8,i=e[u],o=0;o<8;o+=2)n[s+1+ o]=t.charAt(i&15),i>>>=4,n[s+0+o]=t.charAt(i&15),i>>>=4;return n.join("")}static _md5cycle(e,t){ let n=e[0],i=e[1],s=e[2],o=e[3];n+=(i&s|~i&o)+t[0]-680876936|0,n=(n<<7|n>>>25)+i| 0,o+=(n&i|~n&s)+t[1]-389564586|0,o=(o<<12|o>>>20)+n|0,s+=(o&n|~o&i)+t[2]+606105819| @@ -529,47 +532,48 @@ i>>>11)+s|0,n+=(s^(i|~o))+t[4]-145523070|0,n=(n<<6|n>>>26)+i|0,o+=(i^(n|~s))+t[1 1120210379|0,o=(o<<10|o>>>22)+n|0,s+=(n^(o|~i))+t[2]+718787259|0,s=(s<<15|s>>>17)+ o|0,i+=(o^(s|~n))+t[9]-343485551|0,i=(i<<21|i>>>11)+s|0,e[0]=n+e[0]|0,e[1]=i+e[1]| 0,e[2]=s+e[2]|0,e[3]=o+e[3]|0}start(){return this._dataLength=0,this._bufferLength= -0,this._state.set(U.stateIdentity),this}appendStr(e){let t=this._buffer8,n=this. +0,this._state.set(D.stateIdentity),this}appendStr(e){let t=this._buffer8,n=this. _buffer32,i=this._bufferLength,s,o;for(o=0;o>>6)+192,t[i++]=s&63|128;else if(s<55296|| s>56319)t[i++]=(s>>>12)+224,t[i++]=s>>>6&63|128,t[i++]=s&63|128;else{if(s=(s-55296)* 1024+(e.charCodeAt(++o)-56320)+65536,s>1114111)throw new Error("Unicode standard\ supports code points up to U+10FFFF");t[i++]=(s>>>18)+240,t[i++]=s>>>12&63|128, -t[i++]=s>>>6&63|128,t[i++]=s&63|128}i>=64&&(this._dataLength+=64,U._md5cycle(this. +t[i++]=s>>>6&63|128,t[i++]=s&63|128}i>=64&&(this._dataLength+=64,D._md5cycle(this. _state,n),i-=64,n[0]=n[16])}return this._bufferLength=i,this}appendAsciiStr(e){let t=this. _buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(e.length- -o,64-i);s--;)t[i++]=e.charCodeAt(o++);if(i<64)break;this._dataLength+=64,U._md5cycle( +o,64-i);s--;)t[i++]=e.charCodeAt(o++);if(i<64)break;this._dataLength+=64,D._md5cycle( this._state,n),i=0}return this._bufferLength=i,this}appendByteArray(e){let t=this. _buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(e.length- -o,64-i);s--;)t[i++]=e[o++];if(i<64)break;this._dataLength+=64,U._md5cycle(this._state, +o,64-i);s--;)t[i++]=e[o++];if(i<64)break;this._dataLength+=64,D._md5cycle(this._state, n),i=0}return this._bufferLength=i,this}getState(){let e=this._state;return{buffer:String. fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this. _dataLength,state:[e[0],e[1],e[2],e[3]]}}setState(e){let t=e.buffer,n=e.state,i=this. _state,s;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=n[0],i[1]= n[1],i[2]=n[2],i[3]=n[3],s=0;s>2)+1;this._dataLength+= -t;let o=this._dataLength*8;if(n[t]=128,n[t+1]=n[t+2]=n[t+3]=0,i.set(U.buffer32Identity. -subarray(s),s),t>55&&(U._md5cycle(this._state,i),i.set(U.buffer32Identity)),o<=4294967295) +t;let o=this._dataLength*8;if(n[t]=128,n[t+1]=n[t+2]=n[t+3]=0,i.set(D.buffer32Identity. +subarray(s),s),t>55&&(D._md5cycle(this._state,i),i.set(D.buffer32Identity)),o<=4294967295) i[14]=o;else{let u=o.toString(16).match(/(.*?)(.{0,8})$/);if(u===null)return;let c=parseInt( -u[2],16),h=parseInt(u[1],16)||0;i[14]=c,i[15]=h}return U._md5cycle(this._state,i), -e?this._state:U._hex(this._state)}};a(U,"Md5"),_(U,"stateIdentity",new Int32Array( -[1732584193,-271733879,-1732584194,271733878])),_(U,"buffer32Identity",new Int32Array( -[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),_(U,"hexChars","0123456789abcdef"),_(U,"hexO\ -ut",[]),_(U,"onePassHasher",new U);Ve=U});var Wt={};se(Wt,{createHash:()=>Zo,createHmac:()=>Jo,randomBytes:()=>Yo});function Yo(r){ -return w.getRandomValues(y.alloc(r))}function Zo(r){if(r==="sha256")return{update:a( -function(e){return{digest:a(function(){return y.from($e(e))},"digest")}},"update")}; -if(r==="md5")return{update:a(function(e){return{digest:a(function(){return typeof e== -"string"?Ve.hashStr(e):Ve.hashByteArray(e)},"digest")}},"update")};throw new Error( -`Hash type '${r}' not supported`)}function Jo(r,e){if(r!=="sha256")throw new Error( +u[2],16),l=parseInt(u[1],16)||0;i[14]=c,i[15]=l}return D._md5cycle(this._state,i), +e?this._state:D._hex(this._state)}};a(D,"Md5"),A(D,"stateIdentity",new Int32Array( +[1732584193,-271733879,-1732584194,271733878])),A(D,"buffer32Identity",new Int32Array( +[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),A(D,"hexChars","0123456789abcdef"),A(D,"hexO\ +ut",[]),A(D,"onePassHasher",new D);$e=D});var Wt={};ie(Wt,{createHash:()=>Xo,createHmac:()=>ea,randomBytes:()=>Jo});function Jo(r){ +return typeof w<"u"&&w.randomBytes!==void 0?(w.webcrypto??w).getRandomValues(y.alloc( +r)):Tn(Zo).randomBytes(r)}function Xo(r){if(r==="sha256")return{update:a(function(e){ +return{digest:a(function(){return y.from(Ge(e))},"digest")}},"update")};if(r==="\ +md5")return{update:a(function(e){return{digest:a(function(){return typeof e=="st\ +ring"?$e.hashStr(e):$e.hashByteArray(e)},"digest")}},"update")};throw new Error( +`Hash type '${r}' not supported`)}function ea(r,e){if(r!=="sha256")throw new Error( `Only sha256 is supported (requested: '${r}')`);return{update:a(function(t){return{ digest:a(function(){typeof e=="string"&&(e=new TextEncoder().encode(e)),typeof t== -"string"&&(t=new TextEncoder().encode(t));let n=e.length;if(n>64)e=$e(e);else if(n< +"string"&&(t=new TextEncoder().encode(t));let n=e.length;if(n>64)e=Ge(e);else if(n< 64){let c=new Uint8Array(64);c.set(e),e=c}let i=new Uint8Array(64),s=new Uint8Array( 64);for(let c=0;c<64;c++)i[c]=54^e[c],s[c]=92^e[c];let o=new Uint8Array(t.length+ -64);o.set(i,0),o.set(t,64);let u=new Uint8Array(96);return u.set(s,0),u.set($e(o), -64),y.from($e(u))},"digest")}},"update")}}var Ht=z(()=>{"use strict";p();si();oi(); -a(Yo,"randomBytes");a(Zo,"createHash");a(Jo,"createHmac")});var $t=I(ai=>{"use strict";p();ai.parse=function(r,e){return new Gt(r,e).parse()}; -var ht=class ht{constructor(e,t){this.source=e,this.transform=t||Xo,this.position= +64);o.set(i,0),o.set(t,64);let u=new Uint8Array(96);return u.set(s,0),u.set(Ge(o), +64),y.from(Ge(u))},"digest")}},"update")}}var Zo,jt=z(()=>{"use strict";d();oi(); +ai();Zo="node:crypto";a(Jo,"randomBytes");a(Xo,"createHash");a(ea,"createHmac")});var Gt=I(ui=>{"use strict";d();ui.parse=function(r,e){return new Ht(r,e).parse()}; +var ct=class ct{constructor(e,t){this.source=e,this.transform=t||ta,this.position= 0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){return this.position>= this.source.length}nextCharacter(){var e=this.source[this.position++];return e=== "\\"?{value:this.source[this.position++],escaped:!0}:{value:e,escaped:!1}}record(e){ @@ -578,117 +582,117 @@ join(""),t==="NULL"&&!e&&(t=null),t!==null&&(t=this.transform(t)),this.entries.p t),this.recorded=[])}consumeDimensions(){if(this.source[0]==="[")for(;!this.isEof();){ var e=this.nextCharacter();if(e.value==="=")break}}parse(e){var t,n,i;for(this.consumeDimensions();!this. isEof();)if(t=this.nextCharacter(),t.value==="{"&&!i)this.dimension++,this.dimension> -1&&(n=new ht(this.source.substr(this.position-1),this.transform),this.entries.push( +1&&(n=new ct(this.source.substr(this.position-1),this.transform),this.entries.push( n.parse(!0)),this.position+=n.position-2);else if(t.value==="}"&&!i){if(this.dimension--, !this.dimension&&(this.newEntry(),e))return this.entries}else t.value==='"'&&!t. escaped?(i&&this.newEntry(!0),i=!i):t.value===","&&!i?this.newEntry():this.record( t.value);if(this.dimension!==0)throw new Error("array dimension not balanced");return this. -entries}};a(ht,"ArrayParser");var Gt=ht;function Xo(r){return r}a(Xo,"identity")});var Vt=I((Sh,ui)=>{p();var ea=$t();ui.exports={create:a(function(r,e){return{parse:a( -function(){return ea.parse(r,e)},"parse")}},"create")}});var li=I((vh,hi)=>{"use strict";p();var ta=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, -ra=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,na=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,ia=/^-?infinity$/; -hi.exports=a(function(e){if(ia.test(e))return Number(e.replace("i","I"));var t=ta. -exec(e);if(!t)return sa(e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=ci(i));var s=parseInt( -t[2],10)-1,o=t[3],u=parseInt(t[4],10),c=parseInt(t[5],10),h=parseInt(t[6],10),l=t[7]; -l=l?1e3*parseFloat(l):0;var d,b=oa(e);return b!=null?(d=new Date(Date.UTC(i,s,o, -u,c,h,l)),Kt(i)&&d.setUTCFullYear(i),b!==0&&d.setTime(d.getTime()-b)):(d=new Date( -i,s,o,u,c,h,l),Kt(i)&&d.setFullYear(i)),d},"parseDate");function sa(r){var e=ra. -exec(r);if(e){var t=parseInt(e[1],10),n=!!e[4];n&&(t=ci(t));var i=parseInt(e[2], -10)-1,s=e[3],o=new Date(t,i,s);return Kt(t)&&o.setFullYear(t),o}}a(sa,"getDate"); -function oa(r){if(r.endsWith("+00"))return 0;var e=na.exec(r.split(" ")[1]);if(e){ +entries}};a(ct,"ArrayParser");var Ht=ct;function ta(r){return r}a(ta,"identity")});var $t=I((vl,ci)=>{d();var ra=Gt();ci.exports={create:a(function(r,e){return{parse:a( +function(){return ra.parse(r,e)},"parse")}},"create")}});var fi=I((_l,hi)=>{"use strict";d();var na=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, +ia=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,sa=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,oa=/^-?infinity$/; +hi.exports=a(function(e){if(oa.test(e))return Number(e.replace("i","I"));var t=na. +exec(e);if(!t)return aa(e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=li(i));var s=parseInt( +t[2],10)-1,o=t[3],u=parseInt(t[4],10),c=parseInt(t[5],10),l=parseInt(t[6],10),h=t[7]; +h=h?1e3*parseFloat(h):0;var p,S=ua(e);return S!=null?(p=new Date(Date.UTC(i,s,o, +u,c,l,h)),Vt(i)&&p.setUTCFullYear(i),S!==0&&p.setTime(p.getTime()-S)):(p=new Date( +i,s,o,u,c,l,h),Vt(i)&&p.setFullYear(i)),p},"parseDate");function aa(r){var e=ia. +exec(r);if(e){var t=parseInt(e[1],10),n=!!e[4];n&&(t=li(t));var i=parseInt(e[2], +10)-1,s=e[3],o=new Date(t,i,s);return Vt(t)&&o.setFullYear(t),o}}a(aa,"getDate"); +function ua(r){if(r.endsWith("+00"))return 0;var e=sa.exec(r.split(" ")[1]);if(e){ var t=e[1];if(t==="Z")return 0;var n=t==="-"?-1:1,i=parseInt(e[2],10)*3600+parseInt( -e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(oa,"timeZoneOffset");function ci(r){ -return-(r-1)}a(ci,"bcYearToNegativeYear");function Kt(r){return r>=0&&r<100}a(Kt, -"is0To99")});var pi=I((Ch,fi)=>{p();fi.exports=ua;var aa=Object.prototype.hasOwnProperty;function ua(r){ -for(var e=1;e{"use strict";p();var ca=pi();yi.exports=Fe;function Fe(r){if(!(this instanceof -Fe))return new Fe(r);ca(this,xa(r))}a(Fe,"PostgresInterval");var ha=["seconds","\ -minutes","hours","days","months","years"];Fe.prototype.toPostgres=function(){var r=ha. +e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(ua,"timeZoneOffset");function li(r){ +return-(r-1)}a(li,"bcYearToNegativeYear");function Vt(r){return r>=0&&r<100}a(Vt, +"is0To99")});var pi=I((Il,di)=>{d();di.exports=la;var ca=Object.prototype.hasOwnProperty;function la(r){ +for(var e=1;e{"use strict";d();var ha=pi();mi.exports=Be;function Be(r){if(!(this instanceof +Be))return new Be(r);ha(this,Ea(r))}a(Be,"PostgresInterval");var fa=["seconds","\ +minutes","hours","days","months","years"];Be.prototype.toPostgres=function(){var r=fa. filter(this.hasOwnProperty,this);return this.milliseconds&&r.indexOf("seconds")< 0&&r.push("seconds"),r.length===0?"0":r.map(function(e){var t=this[e]||0;return e=== "seconds"&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/, -"")),t+" "+e},this).join(" ")};var la={years:"Y",months:"M",days:"D",hours:"H",minutes:"\ -M",seconds:"S"},fa=["years","months","days"],pa=["hours","minutes","seconds"];Fe. -prototype.toISOString=Fe.prototype.toISO=function(){var r=fa.map(t,this).join(""), -e=pa.map(t,this).join("");return"P"+r+"T"+e;function t(n){var i=this[n]||0;return n=== +"")),t+" "+e},this).join(" ")};var da={years:"Y",months:"M",days:"D",hours:"H",minutes:"\ +M",seconds:"S"},pa=["years","months","days"],ya=["hours","minutes","seconds"];Be. +prototype.toISOString=Be.prototype.toISO=function(){var r=pa.map(t,this).join(""), +e=ya.map(t,this).join("");return"P"+r+"T"+e;function t(n){var i=this[n]||0;return n=== "seconds"&&this.milliseconds&&(i=(i+this.milliseconds/1e3).toFixed(6).replace(/0+$/, -"")),i+la[n]}};var zt="([+-]?\\d+)",da=zt+"\\s+years?",ya=zt+"\\s+mons?",ma=zt+"\ -\\s+days?",ga="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",wa=new RegExp([ -da,ya,ma,ga].map(function(r){return"("+r+")?"}).join("\\s*")),di={years:2,months:4, -days:6,hours:9,minutes:10,seconds:11,milliseconds:12},ba=["hours","minutes","sec\ -onds","milliseconds"];function Sa(r){var e=r+"000000".slice(r.length);return parseInt( -e,10)/1e3}a(Sa,"parseMilliseconds");function xa(r){if(!r)return{};var e=wa.exec( -r),t=e[8]==="-";return Object.keys(di).reduce(function(n,i){var s=di[i],o=e[s];return!o|| -(o=i==="milliseconds"?Sa(o):parseInt(o,10),!o)||(t&&~ba.indexOf(i)&&(o*=-1),n[i]= -o),n},{})}a(xa,"parse")});var wi=I((Rh,gi)=>{"use strict";p();gi.exports=a(function(e){if(/^\\x/.test(e))return new y( +"")),i+da[n]}};var Kt="([+-]?\\d+)",ma=Kt+"\\s+years?",ga=Kt+"\\s+mons?",wa=Kt+"\ +\\s+days?",ba="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",Sa=new RegExp([ +ma,ga,wa,ba].map(function(r){return"("+r+")?"}).join("\\s*")),yi={years:2,months:4, +days:6,hours:9,minutes:10,seconds:11,milliseconds:12},xa=["hours","minutes","sec\ +onds","milliseconds"];function va(r){var e=r+"000000".slice(r.length);return parseInt( +e,10)/1e3}a(va,"parseMilliseconds");function Ea(r){if(!r)return{};var e=Sa.exec( +r),t=e[8]==="-";return Object.keys(yi).reduce(function(n,i){var s=yi[i],o=e[s];return!o|| +(o=i==="milliseconds"?va(o):parseInt(o,10),!o)||(t&&~xa.indexOf(i)&&(o*=-1),n[i]= +o),n},{})}a(Ea,"parse")});var bi=I((Ml,wi)=>{"use strict";d();wi.exports=a(function(e){if(/^\\x/.test(e))return new y( e.substr(2),"hex");for(var t="",n=0;n{p();var Ke=$t(),ze=Vt(),lt=li(),Si=mi(),xi=wi();function ft(r){ -return a(function(t){return t===null?t:r(t)},"nullAllowed")}a(ft,"allowNull");function Ei(r){ +"\\";n+=Math.floor(i/2)*2}return new y(t,"binary")},"parseBytea")});var Ci=I((Ql,_i)=>{d();var Ve=Gt(),Ke=$t(),lt=fi(),xi=gi(),vi=bi();function ht(r){ +return a(function(t){return t===null?t:r(t)},"nullAllowed")}a(ht,"allowNull");function Ei(r){ return r===null?r:r==="TRUE"||r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"|| -r==="1"}a(Ei,"parseBool");function Ea(r){return r?Ke.parse(r,Ei):null}a(Ea,"pars\ -eBoolArray");function va(r){return parseInt(r,10)}a(va,"parseBaseTenInt");function Yt(r){ -return r?Ke.parse(r,ft(va)):null}a(Yt,"parseIntegerArray");function _a(r){return r? -Ke.parse(r,ft(function(e){return vi(e).trim()})):null}a(_a,"parseBigIntegerArray"); -var Aa=a(function(r){if(!r)return null;var e=ze.create(r,function(t){return t!== -null&&(t=er(t)),t});return e.parse()},"parsePointArray"),Zt=a(function(r){if(!r) -return null;var e=ze.create(r,function(t){return t!==null&&(t=parseFloat(t)),t}); -return e.parse()},"parseFloatArray"),ne=a(function(r){if(!r)return null;var e=ze. -create(r);return e.parse()},"parseStringArray"),Jt=a(function(r){if(!r)return null; -var e=ze.create(r,function(t){return t!==null&&(t=lt(t)),t});return e.parse()},"\ -parseDateArray"),Ca=a(function(r){if(!r)return null;var e=ze.create(r,function(t){ -return t!==null&&(t=Si(t)),t});return e.parse()},"parseIntervalArray"),Ta=a(function(r){ -return r?Ke.parse(r,ft(xi)):null},"parseByteAArray"),Xt=a(function(r){return parseInt( -r,10)},"parseInteger"),vi=a(function(r){var e=String(r);return/^\d+$/.test(e)?e: -r},"parseBigInteger"),bi=a(function(r){return r?Ke.parse(r,ft(JSON.parse)):null}, -"parseJsonArray"),er=a(function(r){return r[0]!=="("?null:(r=r.substring(1,r.length- -1).split(","),{x:parseFloat(r[0]),y:parseFloat(r[1])})},"parsePoint"),Ia=a(function(r){ +r==="1"}a(Ei,"parseBool");function Aa(r){return r?Ve.parse(r,Ei):null}a(Aa,"pars\ +eBoolArray");function _a(r){return parseInt(r,10)}a(_a,"parseBaseTenInt");function zt(r){ +return r?Ve.parse(r,ht(_a)):null}a(zt,"parseIntegerArray");function Ca(r){return r? +Ve.parse(r,ht(function(e){return Ai(e).trim()})):null}a(Ca,"parseBigIntegerArray"); +var Ta=a(function(r){if(!r)return null;var e=Ke.create(r,function(t){return t!== +null&&(t=Xt(t)),t});return e.parse()},"parsePointArray"),Yt=a(function(r){if(!r) +return null;var e=Ke.create(r,function(t){return t!==null&&(t=parseFloat(t)),t}); +return e.parse()},"parseFloatArray"),re=a(function(r){if(!r)return null;var e=Ke. +create(r);return e.parse()},"parseStringArray"),Zt=a(function(r){if(!r)return null; +var e=Ke.create(r,function(t){return t!==null&&(t=lt(t)),t});return e.parse()},"\ +parseDateArray"),Ia=a(function(r){if(!r)return null;var e=Ke.create(r,function(t){ +return t!==null&&(t=xi(t)),t});return e.parse()},"parseIntervalArray"),Ra=a(function(r){ +return r?Ve.parse(r,ht(vi)):null},"parseByteAArray"),Jt=a(function(r){return parseInt( +r,10)},"parseInteger"),Ai=a(function(r){var e=String(r);return/^\d+$/.test(e)?e: +r},"parseBigInteger"),Si=a(function(r){return r?Ve.parse(r,ht(JSON.parse)):null}, +"parseJsonArray"),Xt=a(function(r){return r[0]!=="("?null:(r=r.substring(1,r.length- +1).split(","),{x:parseFloat(r[0]),y:parseFloat(r[1])})},"parsePoint"),Pa=a(function(r){ if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1,i=2;i{"use strict";p();var Z=1e6;function Ba(r){var e=r.readInt32BE( +var s=Xt(e);return s.radius=parseFloat(t),s},"parseCircle"),Fa=a(function(r){r(20, +Ai),r(21,Jt),r(23,Jt),r(26,Jt),r(700,parseFloat),r(701,parseFloat),r(16,Ei),r(1082, +lt),r(1114,lt),r(1184,lt),r(600,Xt),r(651,re),r(718,Pa),r(1e3,Aa),r(1001,Ra),r(1005, +zt),r(1007,zt),r(1028,zt),r(1016,Ca),r(1017,Ta),r(1021,Yt),r(1022,Yt),r(1231,Yt), +r(1014,re),r(1015,re),r(1008,re),r(1009,re),r(1040,re),r(1041,re),r(1115,Zt),r(1182, +Zt),r(1185,Zt),r(1186,xi),r(1187,Ia),r(17,vi),r(114,JSON.parse.bind(JSON)),r(3802, +JSON.parse.bind(JSON)),r(199,Si),r(3807,Si),r(3907,re),r(2951,re),r(791,re),r(1183, +re),r(1270,re)},"init");_i.exports={init:Fa}});var Ii=I((ql,Ti)=>{"use strict";d();var Z=1e6;function La(r){var e=r.readInt32BE( 0),t=r.readUInt32BE(4),n="";e<0&&(e=~e+(t===0),t=~t+1>>>0,n="-");var i="",s,o,u, -c,h,l;{if(s=e%Z,e=e/Z>>>0,o=4294967296*s+t,t=o/Z>>>0,u=""+(o-Z*t),t===0&&e===0)return n+ -u+i;for(c="",h=6-u.length,l=0;l>>0,o=4294967296* -s+t,t=o/Z>>>0,u=""+(o-Z*t),t===0&&e===0)return n+u+i;for(c="",h=6-u.length,l=0;l< -h;l++)c+="0";i=c+u+i}{if(s=e%Z,e=e/Z>>>0,o=4294967296*s+t,t=o/Z>>>0,u=""+(o-Z*t), -t===0&&e===0)return n+u+i;for(c="",h=6-u.length,l=0;l{p();var La=Ti(),F=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(C,B,Q){ -return C*Math.pow(2,Q)+B};var s=t>>3,o=a(function(C){return n?~C&255:C},"inv"),u=255, -c=8-t%8;e>t%8);var h=0;t%8+e>=8&&(h=i(0,o(r[s])& -u,c));for(var l=e+t>>3,d=s+1;d0&& -(h=i(h,o(r[l])>>8-b,b)),h},"parseBits"),Bi=a(function(r,e,t){var n=Math.pow(2,t- -1)-1,i=F(r,1),s=F(r,t,1);if(s===0)return 0;var o=1,u=a(function(h,l,d){h===0&&(h= -1);for(var b=1;b<=d;b++)o/=2,(l&1<0&&(h+=o);return h},"parsePrecisionBits"), -c=F(r,e,t+1,!1,u);return s==Math.pow(2,t+1)-1?c===0?i===0?1/0:-1/0:NaN:(i===0?1: --1)*Math.pow(2,s-n)*c},"parseFloatFromBits"),Ra=a(function(r){return F(r,1)==1?-1* -(F(r,15,1,!0)+1):F(r,15,1)},"parseInt16"),Ii=a(function(r){return F(r,1)==1?-1*(F( -r,31,1,!0)+1):F(r,31,1)},"parseInt32"),Fa=a(function(r){return Bi(r,23,8)},"pars\ -eFloat32"),Ma=a(function(r){return Bi(r,52,11)},"parseFloat64"),Da=a(function(r){ -var e=F(r,16,32);if(e==49152)return NaN;for(var t=Math.pow(1e4,F(r,16,16)),n=0,i=[], -s=F(r,16),o=0;o>>0,o=4294967296*s+t,t=o/Z>>>0,u=""+(o-Z*t),t===0&&e===0)return n+ +u+i;for(c="",l=6-u.length,h=0;h>>0,o=4294967296* +s+t,t=o/Z>>>0,u=""+(o-Z*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,h=0;h< +l;h++)c+="0";i=c+u+i}{if(s=e%Z,e=e/Z>>>0,o=4294967296*s+t,t=o/Z>>>0,u=""+(o-Z*t), +t===0&&e===0)return n+u+i;for(c="",l=6-u.length,h=0;h{d();var Ba=Ii(),B=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(_,P,G){ +return _*Math.pow(2,G)+P};var s=t>>3,o=a(function(_){return n?~_&255:_},"inv"),u=255, +c=8-t%8;e>t%8);var l=0;t%8+e>=8&&(l=i(0,o(r[s])& +u,c));for(var h=e+t>>3,p=s+1;p0&& +(l=i(l,o(r[h])>>8-S,S)),l},"parseBits"),Fi=a(function(r,e,t){var n=Math.pow(2,t- +1)-1,i=B(r,1),s=B(r,t,1);if(s===0)return 0;var o=1,u=a(function(l,h,p){l===0&&(l= +1);for(var S=1;S<=p;S++)o/=2,(h&1<0&&(l+=o);return l},"parsePrecisionBits"), +c=B(r,e,t+1,!1,u);return s==Math.pow(2,t+1)-1?c===0?i===0?1/0:-1/0:NaN:(i===0?1: +-1)*Math.pow(2,s-n)*c},"parseFloatFromBits"),Ma=a(function(r){return B(r,1)==1?-1* +(B(r,15,1,!0)+1):B(r,15,1)},"parseInt16"),Ri=a(function(r){return B(r,1)==1?-1*(B( +r,31,1,!0)+1):B(r,31,1)},"parseInt32"),ka=a(function(r){return Fi(r,23,8)},"pars\ +eFloat32"),Oa=a(function(r){return Fi(r,52,11)},"parseFloat64"),Qa=a(function(r){ +var e=B(r,16,32);if(e==49152)return NaN;for(var t=Math.pow(1e4,B(r,16,16)),n=0,i=[], +s=B(r,16),o=0;o>3,(i+=l<<3)>>3), -d;console.log("ERROR: ElementType not implemented: "+h)},"parseElement"),c=a(function(h,l){ -var d=[],b;if(h.length>1){var C=h.shift();for(b=0;b0},"parseBool"),Oa=a(function(r){r(20,La),r(21,Ra),r(23,Ii),r(26, -Ii),r(1700,Da),r(700,Fa),r(701,Ma),r(16,Ua),r(1114,Pi.bind(null,!1)),r(1184,Pi.bind( -null,!0)),r(1e3,Ye),r(1007,Ye),r(1016,Ye),r(1008,Ye),r(1009,Ye),r(25,ka)},"init"); -Li.exports={init:Oa}});var Mi=I((Hh,Fi)=>{p();Fi.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23, +return this.usec},i},"parseDate"),ze=a(function(r){for(var e=B(r,32),t=B(r,32,32), +n=B(r,32,64),i=96,s=[],o=0;o>3,(i+=h<<3)>>3), +p;console.log("ERROR: ElementType not implemented: "+l)},"parseElement"),c=a(function(l,h){ +var p=[],S;if(l.length>1){var _=l.shift();for(S=0;S<_;S++)p[S]=c(l,h);l.unshift( +_)}else for(S=0;S0},"parseBool"),qa=a(function(r){r(20,Ba),r(21,Ma),r(23,Ri),r(26, +Ri),r(1700,Qa),r(700,ka),r(701,Oa),r(16,Ua),r(1114,Pi.bind(null,!1)),r(1184,Pi.bind( +null,!0)),r(1e3,ze),r(1007,ze),r(1016,ze),r(1008,ze),r(1009,ze),r(25,Da)},"init"); +Li.exports={init:qa}});var ki=I(($l,Mi)=>{d();Mi.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23, REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194, SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703, TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033, @@ -696,157 +700,157 @@ BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INT TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203, REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220, PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642, -REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}});var Xe=I(Je=>{p();var Na=Ai(),qa=Ri(),Qa=Vt(),ja=Mi();Je.getTypeParser=Wa;Je.setTypeParser= -Ha;Je.arrayParser=Qa;Je.builtins=ja;var Ze={text:{},binary:{}};function Di(r){return String( -r)}a(Di,"noParse");function Wa(r,e){return e=e||"text",Ze[e]&&Ze[e][r]||Di}a(Wa, -"getTypeParser");function Ha(r,e,t){typeof e=="function"&&(t=e,e="text"),Ze[e][r]= -t}a(Ha,"setTypeParser");Na.init(function(r,e){Ze.text[r]=e});qa.init(function(r,e){ -Ze.binary[r]=e})});var et=I((zh,tr)=>{"use strict";p();tr.exports={host:"localhost",user:m.platform=== +REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}});var Je=I(Ze=>{d();var Na=Ci(),Wa=Bi(),ja=$t(),Ha=ki();Ze.getTypeParser=Ga;Ze.setTypeParser= +$a;Ze.arrayParser=ja;Ze.builtins=Ha;var Ye={text:{},binary:{}};function Oi(r){return String( +r)}a(Oi,"noParse");function Ga(r,e){return e=e||"text",Ye[e]&&Ye[e][r]||Oi}a(Ga, +"getTypeParser");function $a(r,e,t){typeof e=="function"&&(t=e,e="text"),Ye[e][r]= +t}a($a,"setTypeParser");Na.init(function(r,e){Ye.text[r]=e});Wa.init(function(r,e){ +Ye.binary[r]=e})});var Xe=I((Zl,er)=>{"use strict";d();er.exports={host:"localhost",user:m.platform=== "win32"?m.env.USERNAME:m.env.USER,database:void 0,password:null,connectionString:void 0, port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4,client_encoding:"",ssl:!1, application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1, statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1, -connect_timeout:0,keepalives:1,keepalives_idle:0};var Me=Xe(),Ga=Me.getTypeParser( -20,"text"),$a=Me.getTypeParser(1016,"text");tr.exports.__defineSetter__("parseIn\ -t8",function(r){Me.setTypeParser(20,"text",r?Me.getTypeParser(23,"text"):Ga),Me. -setTypeParser(1016,"text",r?Me.getTypeParser(1007,"text"):$a)})});var tt=I((Zh,Ui)=>{"use strict";p();var Va=(Ht(),O(Wt)),Ka=et();function za(r){var e=r. -replace(/\\/g,"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(za,"escapeElement"); -function ki(r){for(var e="{",t=0;t0&&(e=e+","),r[t]===null||typeof r[t]> -"u"?e=e+"NULL":Array.isArray(r[t])?e=e+ki(r[t]):r[t]instanceof y?e+="\\\\x"+r[t]. -toString("hex"):e+=za(pt(r[t]));return e=e+"}",e}a(ki,"arrayString");var pt=a(function(r,e){ +connect_timeout:0,keepalives:1,keepalives_idle:0};var Me=Je(),Va=Me.getTypeParser( +20,"text"),Ka=Me.getTypeParser(1016,"text");er.exports.__defineSetter__("parseIn\ +t8",function(r){Me.setTypeParser(20,"text",r?Me.getTypeParser(23,"text"):Va),Me. +setTypeParser(1016,"text",r?Me.getTypeParser(1007,"text"):Ka)})});var et=I((Xl,Di)=>{"use strict";d();var za=(jt(),U(Wt)),Ya=Xe();function Za(r){var e=r. +replace(/\\/g,"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(Za,"escapeElement"); +function Qi(r){for(var e="{",t=0;t0&&(e=e+","),r[t]===null||typeof r[t]> +"u"?e=e+"NULL":Array.isArray(r[t])?e=e+Qi(r[t]):r[t]instanceof y?e+="\\\\x"+r[t]. +toString("hex"):e+=Za(ft(r[t]));return e=e+"}",e}a(Qi,"arrayString");var ft=a(function(r,e){ if(r==null)return null;if(r instanceof y)return r;if(ArrayBuffer.isView(r)){var t=y. from(r.buffer,r.byteOffset,r.byteLength);return t.length===r.byteLength?t:t.slice( -r.byteOffset,r.byteOffset+r.byteLength)}return r instanceof Date?Ka.parseInputDatesAsUTC? -Ja(r):Za(r):Array.isArray(r)?ki(r):typeof r=="object"?Ya(r,e):r.toString()},"pre\ -pareValue");function Ya(r,e){if(r&&typeof r.toPostgres=="function"){if(e=e||[],e. +r.byteOffset,r.byteOffset+r.byteLength)}return r instanceof Date?Ya.parseInputDatesAsUTC? +eu(r):Xa(r):Array.isArray(r)?Qi(r):typeof r=="object"?Ja(r,e):r.toString()},"pre\ +pareValue");function Ja(r,e){if(r&&typeof r.toPostgres=="function"){if(e=e||[],e. indexOf(r)!==-1)throw new Error('circular reference detected while preparing "'+ -r+'" for query');return e.push(r),pt(r.toPostgres(pt),e)}return JSON.stringify(r)} -a(Ya,"prepareObject");function G(r,e){for(r=""+r;r.length{"use strict";p();var nr=(Ht(),O(Wt));function tu(r){if(r.indexOf( +r+'" for query');return e.push(r),ft(r.toPostgres(ft),e)}return JSON.stringify(r)} +a(Ja,"prepareObject");function H(r,e){for(r=""+r;r.length{"use strict";d();var rr=(jt(),U(Wt));function nu(r){if(r.indexOf( "SCRAM-SHA-256")===-1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is cur\ -rently supported");let e=nr.randomBytes(18).toString("base64");return{mechanism:"\ +rently supported");let e=rr.randomBytes(18).toString("base64");return{mechanism:"\ SCRAM-SHA-256",clientNonce:e,response:"n,,n=*,r="+e,message:"SASLInitialResponse"}} -a(tu,"startSession");function ru(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( +a(nu,"startSession");function iu(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( "SASL: Last message was not SASLInitialResponse");if(typeof e!="string")throw new Error( "SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if(typeof t!= "string")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a\ - string");let n=su(t);if(n.nonce.startsWith(r.clientNonce)){if(n.nonce.length=== + string");let n=au(t);if(n.nonce.startsWith(r.clientNonce)){if(n.nonce.length=== r.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server n\ once is too short")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serv\ -er nonce does not start with client nonce");var i=y.from(n.salt,"base64"),s=uu(e, -i,n.iteration),o=De(s,"Client Key"),u=au(o),c="n=*,r="+r.clientNonce,h="r="+n.nonce+ -",s="+n.salt+",i="+n.iteration,l="c=biws,r="+n.nonce,d=c+","+h+","+l,b=De(u,d),C=qi( -o,b),B=C.toString("base64"),Q=De(s,"Server Key"),X=De(Q,d);r.message="SASLRespon\ -se",r.serverSignature=X.toString("base64"),r.response=l+",p="+B}a(ru,"continueSe\ -ssion");function nu(r,e){if(r.message!=="SASLResponse")throw new Error("SASL: La\ +er nonce does not start with client nonce");var i=y.from(n.salt,"base64"),s=lu(e, +i,n.iteration),o=ke(s,"Client Key"),u=cu(o),c="n=*,r="+r.clientNonce,l="r="+n.nonce+ +",s="+n.salt+",i="+n.iteration,h="c=biws,r="+n.nonce,p=c+","+l+","+h,S=ke(u,p),_=Ni( +o,S),P=_.toString("base64"),G=ke(s,"Server Key"),X=ke(G,p);r.message="SASLRespon\ +se",r.serverSignature=X.toString("base64"),r.response=h+",p="+P}a(iu,"continueSe\ +ssion");function su(r,e){if(r.message!=="SASLResponse")throw new Error("SASL: La\ st message was not SASLResponse");if(typeof e!="string")throw new Error("SASL: S\ -CRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=ou( +CRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=uu( e);if(t!==r.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: s\ -erver signature does not match")}a(nu,"finalizeSession");function iu(r){if(typeof r!= +erver signature does not match")}a(su,"finalizeSession");function ou(r){if(typeof r!= "string")throw new TypeError("SASL: text must be a string");return r.split("").map( -(e,t)=>r.charCodeAt(t)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}a(iu,"isPrintableC\ -hars");function Oi(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(r)}a(Oi,"isBase64");function Ni(r){if(typeof r!="string")throw new TypeError( +(e,t)=>r.charCodeAt(t)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}a(ou,"isPrintableC\ +hars");function Ui(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(r)}a(Ui,"isBase64");function qi(r){if(typeof r!="string")throw new TypeError( "SASL: attribute pairs text must be a string");return new Map(r.split(",").map(e=>{ if(!/^.=/.test(e))throw new Error("SASL: Invalid attribute pair entry");let t=e[0], -n=e.substring(2);return[t,n]}))}a(Ni,"parseAttributePairs");function su(r){let e=Ni( -r),t=e.get("r");if(t){if(!iu(t))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAG\ +n=e.substring(2);return[t,n]}))}a(qi,"parseAttributePairs");function au(r){let e=qi( +r),t=e.get("r");if(t){if(!ou(t))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAG\ E: nonce must only contain printable characters")}else throw new Error("SASL: SC\ -RAM-SERVER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!Oi(n))throw new Error( +RAM-SERVER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!Ui(n))throw new Error( "SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64")}else throw new Error("S\ ASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");let i=e.get("i");if(i){if(!/^[1-9][0-9]*$/. test(i))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration cou\ nt")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing"); -let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(su,"parseServerFirstMe\ -ssage");function ou(r){let t=Ni(r).get("v");if(t){if(!Oi(t))throw new Error("SAS\ +let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(au,"parseServerFirstMe\ +ssage");function uu(r){let t=qi(r).get("v");if(t){if(!Ui(t))throw new Error("SAS\ L: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64")}else throw new Error( "SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");return{serverSignature:t}} -a(ou,"parseServerFinalMessage");function qi(r,e){if(!y.isBuffer(r))throw new TypeError( +a(uu,"parseServerFinalMessage");function Ni(r,e){if(!y.isBuffer(r))throw new TypeError( "first argument must be a Buffer");if(!y.isBuffer(e))throw new TypeError("second\ argument must be a Buffer");if(r.length!==e.length)throw new Error("Buffer leng\ ths must match");if(r.length===0)throw new Error("Buffers cannot be empty");return y. -from(r.map((t,n)=>r[n]^e[n]))}a(qi,"xorBuffers");function au(r){return nr.createHash( -"sha256").update(r).digest()}a(au,"sha256");function De(r,e){return nr.createHmac( -"sha256",r).update(e).digest()}a(De,"hmacSha256");function uu(r,e,t){for(var n=De( -r,y.concat([e,y.from([0,0,0,1])])),i=n,s=0;scu});function cu(...r){return r.join("/")}var sr=z(()=>{ -"use strict";p();a(cu,"join")});var or={};se(or,{stat:()=>hu});function hu(r,e){e(new Error("No filesystem"))}var ar=z( -()=>{"use strict";p();a(hu,"stat")});var ur={};se(ur,{default:()=>lu});var lu,cr=z(()=>{"use strict";p();lu={}});var Wi={};se(Wi,{StringDecoder:()=>hr});var lr,hr,Hi=z(()=>{"use strict";p();lr= -class lr{constructor(e){_(this,"td");this.td=new TextDecoder(e)}write(e){return this. +from(r.map((t,n)=>r[n]^e[n]))}a(Ni,"xorBuffers");function cu(r){return rr.createHash( +"sha256").update(r).digest()}a(cu,"sha256");function ke(r,e){return rr.createHmac( +"sha256",r).update(e).digest()}a(ke,"hmacSha256");function lu(r,e,t){for(var n=ke( +r,y.concat([e,y.from([0,0,0,1])])),i=n,s=0;shu});function hu(...r){return r.join("/")}var ir=z(()=>{ +"use strict";d();a(hu,"join")});var sr={};ie(sr,{stat:()=>fu});function fu(r,e){e(new Error("No filesystem"))}var or=z( +()=>{"use strict";d();a(fu,"stat")});var ar={};ie(ar,{default:()=>du});var du,ur=z(()=>{"use strict";d();du={}});var Hi={};ie(Hi,{StringDecoder:()=>cr});var lr,cr,Gi=z(()=>{"use strict";d();lr= +class lr{constructor(e){A(this,"td");this.td=new TextDecoder(e)}write(e){return this. td.decode(e,{stream:!0})}end(e){return this.td.decode(e)}};a(lr,"StringDecoder"); -hr=lr});var Ki=I((hl,Vi)=>{"use strict";p();var{Transform:fu}=(cr(),O(ur)),{StringDecoder:pu}=(Hi(),O(Wi)), -we=Symbol("last"),dt=Symbol("decoder");function du(r,e,t){let n;if(this.overflow){ +cr=lr});var zi=I((fh,Ki)=>{"use strict";d();var{Transform:pu}=(ur(),U(ar)),{StringDecoder:yu}=(Gi(),U(Hi)), +be=Symbol("last"),dt=Symbol("decoder");function mu(r,e,t){let n;if(this.overflow){ if(n=this[dt].write(r).split(this.matcher),n.length===1)return t();n.shift(),this. -overflow=!1}else this[we]+=this[dt].write(r),n=this[we].split(this.matcher);this[we]= -n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){ -t(new Error("maximum buffer reached"));return}t()}a(du,"transform");function yu(r){ -if(this[we]+=this[dt].end(),this[we])try{$i(this,this.mapper(this[we]))}catch(e){ -return r(e)}r()}a(yu,"flush");function $i(r,e){e!==void 0&&r.push(e)}a($i,"push"); -function Gi(r){return r}a(Gi,"noop");function mu(r,e,t){switch(r=r||/\r?\n/,e=e|| -Gi,t=t||{},arguments.length){case 1:typeof r=="function"?(e=r,r=/\r?\n/):typeof r== +overflow=!1}else this[be]+=this[dt].write(r),n=this[be].split(this.matcher);this[be]= +n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){ +t(new Error("maximum buffer reached"));return}t()}a(mu,"transform");function gu(r){ +if(this[be]+=this[dt].end(),this[be])try{Vi(this,this.mapper(this[be]))}catch(e){ +return r(e)}r()}a(gu,"flush");function Vi(r,e){e!==void 0&&r.push(e)}a(Vi,"push"); +function $i(r){return r}a($i,"noop");function wu(r,e,t){switch(r=r||/\r?\n/,e=e|| +$i,t=t||{},arguments.length){case 1:typeof r=="function"?(e=r,r=/\r?\n/):typeof r== "object"&&!(r instanceof RegExp)&&!r[Symbol.split]&&(t=r,r=/\r?\n/);break;case 2: -typeof r=="function"?(t=e,e=r,r=/\r?\n/):typeof e=="object"&&(t=e,e=Gi)}t=Object. -assign({},t),t.autoDestroy=!0,t.transform=du,t.flush=yu,t.readableObjectMode=!0; -let n=new fu(t);return n[we]="",n[dt]=new pu("utf8"),n.matcher=r,n.mapper=e,n.maxLength= +typeof r=="function"?(t=e,e=r,r=/\r?\n/):typeof e=="object"&&(t=e,e=$i)}t=Object. +assign({},t),t.autoDestroy=!0,t.transform=mu,t.flush=gu,t.readableObjectMode=!0; +let n=new pu(t);return n[be]="",n[dt]=new yu("utf8"),n.matcher=r,n.mapper=e,n.maxLength= t.maxLength,n.skipOverflow=t.skipOverflow||!1,n.overflow=!1,n._destroy=function(i,s){ -this._writableState.errorEmitted=!1,s(i)},n}a(mu,"split");Vi.exports=mu});var Zi=I((pl,fe)=>{"use strict";p();var zi=(sr(),O(ir)),gu=(cr(),O(ur)).Stream,wu=Ki(), -Yi=(Ge(),O(He)),bu=5432,yt=m.platform==="win32",rt=m.stderr,Su=56,xu=7,Eu=61440, -vu=32768;function _u(r){return(r&Eu)==vu}a(_u,"isRegFile");var ke=["host","port", -"database","user","password"],fr=ke.length,Au=ke[fr-1];function pr(){var r=rt instanceof -gu&&rt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` -`);rt.write(Yi.format.apply(Yi,e))}}a(pr,"warn");Object.defineProperty(fe.exports, -"isWin",{get:a(function(){return yt},"get"),set:a(function(r){yt=r},"set")});fe. -exports.warnTo=function(r){var e=rt;return rt=r,e};fe.exports.getFileName=function(r){ -var e=r||m.env,t=e.PGPASSFILE||(yt?zi.join(e.APPDATA||"./","postgresql","pgpass.\ -conf"):zi.join(e.HOME||"./",".pgpass"));return t};fe.exports.usePgPass=function(r,e){ -return Object.prototype.hasOwnProperty.call(m.env,"PGPASSWORD")?!1:yt?!0:(e=e||"\ -",_u(r.mode)?r.mode&(Su|xu)?(pr('WARNING: password file "%s" has group or \ -world access; permissions should be u=rw (0600) or less',e),!1):!0:(pr('WARNING:\ - password file "%s" is not a plain file',e),!1))};var Cu=fe.exports.match=function(r,e){ -return ke.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||bu)===Number( +this._writableState.errorEmitted=!1,s(i)},n}a(wu,"split");Ki.exports=wu});var Ji=I((yh,fe)=>{"use strict";d();var Yi=(ir(),U(nr)),bu=(ur(),U(ar)).Stream,Su=zi(), +Zi=(He(),U(je)),xu=5432,pt=m.platform==="win32",tt=m.stderr,vu=56,Eu=7,Au=61440, +_u=32768;function Cu(r){return(r&Au)==_u}a(Cu,"isRegFile");var Oe=["host","port", +"database","user","password"],hr=Oe.length,Tu=Oe[hr-1];function fr(){var r=tt instanceof +bu&&tt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` +`);tt.write(Zi.format.apply(Zi,e))}}a(fr,"warn");Object.defineProperty(fe.exports, +"isWin",{get:a(function(){return pt},"get"),set:a(function(r){pt=r},"set")});fe. +exports.warnTo=function(r){var e=tt;return tt=r,e};fe.exports.getFileName=function(r){ +var e=r||m.env,t=e.PGPASSFILE||(pt?Yi.join(e.APPDATA||"./","postgresql","pgpass.\ +conf"):Yi.join(e.HOME||"./",".pgpass"));return t};fe.exports.usePgPass=function(r,e){ +return Object.prototype.hasOwnProperty.call(m.env,"PGPASSWORD")?!1:pt?!0:(e=e||"\ +",Cu(r.mode)?r.mode&(vu|Eu)?(fr('WARNING: password file "%s" has group or \ +world access; permissions should be u=rw (0600) or less',e),!1):!0:(fr('WARNING:\ + password file "%s" is not a plain file',e),!1))};var Iu=fe.exports.match=function(r,e){ +return Oe.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||xu)===Number( e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};fe.exports.getPassword=function(r,e,t){ -var n,i=e.pipe(wu());function s(c){var h=Tu(c);h&&Iu(h)&&Cu(r,h)&&(n=h[Au],i.end())} +var n,i=e.pipe(Su());function s(c){var l=Ru(c);l&&Pu(l)&&Iu(r,l)&&(n=l[Tu],i.end())} a(s,"onLine");var o=a(function(){e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(), -pr("WARNING: error on reading file: %s",c),t(void 0)},"onErr");e.on("error",u),i. -on("data",s).on("end",o).on("error",u)};var Tu=fe.exports.parseLine=function(r){ +fr("WARNING: error on reading file: %s",c),t(void 0)},"onErr");e.on("error",u),i. +on("data",s).on("end",o).on("error",u)};var Ru=fe.exports.parseLine=function(r){ if(r.length<11||r.match(/^\s+#/))return null;for(var e="",t="",n=0,i=0,s=0,o={}, -u=!1,c=a(function(l,d,b){var C=r.substring(d,b);Object.hasOwnProperty.call(m.env, -"PGPASS_NO_DEESCAPE")||(C=C.replace(/\\([:\\])/g,"$1")),o[ke[l]]=C},"addToObj"), -h=0;h=0&&e==":"&&t!=="\\"&&(c(n,i,h+1),i=h+2,n+=1)}return o=Object.keys(o).length=== -fr?o:null,o},Iu=fe.exports.isValidEntry=function(r){for(var e={0:function(o){return o. +u=!1,c=a(function(h,p,S){var _=r.substring(p,S);Object.hasOwnProperty.call(m.env, +"PGPASS_NO_DEESCAPE")||(_=_.replace(/\\([:\\])/g,"$1")),o[Oe[h]]=_},"addToObj"), +l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o).length=== +hr?o:null,o},Pu=fe.exports.isValidEntry=function(r){for(var e={0:function(o){return o. length>0},1:function(o){return o==="*"?!0:(o=Number(o),isFinite(o)&&o>0&&o<9007199254740992&& Math.floor(o)===o)},2:function(o){return o.length>0},3:function(o){return o.length> -0},4:function(o){return o.length>0}},t=0;t{"use strict";p();var ml=(sr(),O(ir)),Ji=(ar(),O(or)),mt=Zi(); -dr.exports=function(r,e){var t=mt.getFileName();Ji.stat(t,function(n,i){if(n||!mt. -usePgPass(i,t))return e(void 0);var s=Ji.createReadStream(t);mt.getPassword(r,s, -e)})};dr.exports.warnTo=mt.warnTo});var wt=I((bl,es)=>{"use strict";p();var Pu=Xe();function gt(r){this._types=r||Pu, -this.text={},this.binary={}}a(gt,"TypeOverrides");gt.prototype.getOverrides=function(r){ +0},4:function(o){return o.length>0}},t=0;t{"use strict";d();var wh=(ir(),U(nr)),Xi=(or(),U(sr)),yt=Ji(); +dr.exports=function(r,e){var t=yt.getFileName();Xi.stat(t,function(n,i){if(n||!yt. +usePgPass(i,t))return e(void 0);var s=Xi.createReadStream(t);yt.getPassword(r,s, +e)})};dr.exports.warnTo=yt.warnTo});var gt=I((xh,ts)=>{"use strict";d();var Fu=Je();function mt(r){this._types=r||Fu, +this.text={},this.binary={}}a(mt,"TypeOverrides");mt.prototype.getOverrides=function(r){ switch(r){case"text":return this.text;case"binary":return this.binary;default:return{}}}; -gt.prototype.setTypeParser=function(r,e,t){typeof e=="function"&&(t=e,e="text"), -this.getOverrides(e)[r]=t};gt.prototype.getTypeParser=function(r,e){return e=e|| -"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};es.exports=gt});var ts={};se(ts,{default:()=>Bu});var Bu,rs=z(()=>{"use strict";p();Bu={}});var ns={};se(ns,{parse:()=>yr});function yr(r,e=!1){let{protocol:t}=new URL(r),n="\ -http:"+r.substring(t.length),{username:i,password:s,host:o,hostname:u,port:c,pathname:h, -search:l,searchParams:d,hash:b}=new URL(n);s=decodeURIComponent(s),i=decodeURIComponent( -i),h=decodeURIComponent(h);let C=i+":"+s,B=e?Object.fromEntries(d.entries()):l;return{ -href:r,protocol:t,auth:C,username:i,password:s,host:o,hostname:u,port:c,pathname:h, -search:l,query:B,hash:b}}var mr=z(()=>{"use strict";p();a(yr,"parse")});var ss=I((Al,is)=>{"use strict";p();var Lu=(mr(),O(ns)),gr=(ar(),O(or));function wr(r){ -if(r.charAt(0)==="/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Lu. +mt.prototype.setTypeParser=function(r,e,t){typeof e=="function"&&(t=e,e="text"), +this.getOverrides(e)[r]=t};mt.prototype.getTypeParser=function(r,e){return e=e|| +"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};ts.exports=mt});var rs={};ie(rs,{default:()=>Lu});var Lu,ns=z(()=>{"use strict";d();Lu={}});var is={};ie(is,{parse:()=>pr});function pr(r,e=!1){let{protocol:t}=new URL(r),n="\ +http:"+r.substring(t.length),{username:i,password:s,host:o,hostname:u,port:c,pathname:l, +search:h,searchParams:p,hash:S}=new URL(n);s=decodeURIComponent(s),i=decodeURIComponent( +i),l=decodeURIComponent(l);let _=i+":"+s,P=e?Object.fromEntries(p.entries()):h;return{ +href:r,protocol:t,auth:_,username:i,password:s,host:o,hostname:u,port:c,pathname:l, +search:h,query:P,hash:S}}var yr=z(()=>{"use strict";d();a(pr,"parse")});var os=I((Th,ss)=>{"use strict";d();var Bu=(yr(),U(is)),mr=(or(),U(sr));function gr(r){ +if(r.charAt(0)==="/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Bu. parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(r)?encodeURI(r).replace(/\%25(\d\d)/g, "%$1"):r,!0),t=e.query;for(var n in t)Array.isArray(t[n])&&(t[n]=t[n][t[n].length- 1]);var i=(e.auth||":").split(":");if(t.user=i[0],t.password=i.splice(1).join(":"), @@ -856,23 +860,23 @@ pathname;if(!t.host&&s&&/^%2f/i.test(s)){var o=s.split("/");t.host=decodeURIComp o[0]),s=o.splice(1).join("/")}switch(s&&s.charAt(0)==="/"&&(s=s.slice(1)||null), t.database=s&&decodeURI(s),(t.ssl==="true"||t.ssl==="1")&&(t.ssl=!0),t.ssl==="0"&& (t.ssl=!1),(t.sslcert||t.sslkey||t.sslrootcert||t.sslmode)&&(t.ssl={}),t.sslcert&& -(t.ssl.cert=gr.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=gr.readFileSync( -t.sslkey).toString()),t.sslrootcert&&(t.ssl.ca=gr.readFileSync(t.sslrootcert).toString()), +(t.ssl.cert=mr.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=mr.readFileSync( +t.sslkey).toString()),t.sslrootcert&&(t.ssl.ca=mr.readFileSync(t.sslrootcert).toString()), t.sslmode){case"disable":{t.ssl=!1;break}case"prefer":case"require":case"verify-\ ca":case"verify-full":break;case"no-verify":{t.ssl.rejectUnauthorized=!1;break}} -return t}a(wr,"parse");is.exports=wr;wr.parse=wr});var bt=I((Il,us)=>{"use strict";p();var Ru=(rs(),O(ts)),as=et(),os=ss().parse,V=a( +return t}a(gr,"parse");ss.exports=gr;gr.parse=gr});var wt=I((Ph,cs)=>{"use strict";d();var Mu=(ns(),U(rs)),us=Xe(),as=os().parse,V=a( function(r,e,t){return t===void 0?t=m.env["PG"+r.toUpperCase()]:t===!1||(t=m.env[t]), -e[r]||t||as[r]},"val"),Fu=a(function(){switch(m.env.PGSSLMODE){case"disable":return!1;case"\ +e[r]||t||us[r]},"val"),ku=a(function(){switch(m.env.PGSSLMODE){case"disable":return!1;case"\ prefer":case"require":case"verify-ca":case"verify-full":return!0;case"no-verify": -return{rejectUnauthorized:!1}}return as.ssl},"readSSLConfigFromEnvironment"),Ue=a( +return{rejectUnauthorized:!1}}return us.ssl},"readSSLConfigFromEnvironment"),Qe=a( function(r){return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quo\ -teParamValue"),ie=a(function(r,e,t){var n=e[t];n!=null&&r.push(t+"="+Ue(n))},"ad\ -d"),Sr=class Sr{constructor(e){e=typeof e=="string"?os(e):e||{},e.connectionString&& -(e=Object.assign({},e,os(e.connectionString))),this.user=V("user",e),this.database= +teParamValue"),ne=a(function(r,e,t){var n=e[t];n!=null&&r.push(t+"="+Qe(n))},"ad\ +d"),br=class br{constructor(e){e=typeof e=="string"?as(e):e||{},e.connectionString&& +(e=Object.assign({},e,as(e.connectionString))),this.user=V("user",e),this.database= V("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt( V("port",e),10),this.host=V("host",e),Object.defineProperty(this,"password",{configurable:!0, enumerable:!1,writable:!0,value:V("password",e)}),this.binary=V("binary",e),this. -options=V("options",e),this.ssl=typeof e.ssl>"u"?Fu():e.ssl,typeof this.ssl=="st\ +options=V("options",e),this.ssl=typeof e.ssl>"u"?ku():e.ssl,typeof this.ssl=="st\ ring"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="no-verify"&&(this.ssl={rejectUnauthorized:!1}), this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this. client_encoding=V("client_encoding",e),this.replication=V("replication",e),this. @@ -885,20 +889,20 @@ void 0?this.connect_timeout=m.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math floor(e.connectionTimeoutMillis/1e3),e.keepAlive===!1?this.keepalives=0:e.keepAlive=== !0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis=="number"&&(this.keepalives_idle= Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){var t=[]; -ie(t,this,"user"),ie(t,this,"password"),ie(t,this,"port"),ie(t,this,"application\ -_name"),ie(t,this,"fallback_application_name"),ie(t,this,"connect_timeout"),ie(t, +ne(t,this,"user"),ne(t,this,"password"),ne(t,this,"port"),ne(t,this,"application\ +_name"),ne(t,this,"fallback_application_name"),ne(t,this,"connect_timeout"),ne(t, this,"options");var n=typeof this.ssl=="object"?this.ssl:this.ssl?{sslmode:this. -ssl}:{};if(ie(t,n,"sslmode"),ie(t,n,"sslca"),ie(t,n,"sslkey"),ie(t,n,"sslcert"), -ie(t,n,"sslrootcert"),this.database&&t.push("dbname="+Ue(this.database)),this.replication&& -t.push("replication="+Ue(this.replication)),this.host&&t.push("host="+Ue(this.host)), +ssl}:{};if(ne(t,n,"sslmode"),ne(t,n,"sslca"),ne(t,n,"sslkey"),ne(t,n,"sslcert"), +ne(t,n,"sslrootcert"),this.database&&t.push("dbname="+Qe(this.database)),this.replication&& +t.push("replication="+Qe(this.replication)),this.host&&t.push("host="+Qe(this.host)), this.isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("cli\ -ent_encoding="+Ue(this.client_encoding)),Ru.lookup(this.host,function(i,s){return i? -e(i,null):(t.push("hostaddr="+Ue(s)),e(null,t.join(" ")))})}};a(Sr,"ConnectionPa\ -rameters");var br=Sr;us.exports=br});var ls=I((Ll,hs)=>{"use strict";p();var Mu=Xe(),cs=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/, -Er=class Er{constructor(e,t){this.command=null,this.rowCount=null,this.oid=null, +ent_encoding="+Qe(this.client_encoding)),Mu.lookup(this.host,function(i,s){return i? +e(i,null):(t.push("hostaddr="+Qe(s)),e(null,t.join(" ")))})}};a(br,"ConnectionPa\ +rameters");var wr=br;cs.exports=wr});var fs=I((Bh,hs)=>{"use strict";d();var Ou=Je(),ls=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/, +xr=class xr{constructor(e,t){this.command=null,this.rowCount=null,this.oid=null, this.rows=[],this.fields=[],this._parsers=void 0,this._types=t,this.RowCtor=null, this.rowAsArray=e==="array",this.rowAsArray&&(this.parseRow=this._parseRowAsArray)}addCommandComplete(e){ -var t;e.text?t=cs.exec(e.text):t=cs.exec(e.command),t&&(this.command=t[1],t[3]?(this. +var t;e.text?t=ls.exec(e.text):t=ls.exec(e.command),t&&(this.command=t[1],t[3]?(this. oid=parseInt(t[2],10),this.rowCount=parseInt(t[3],10)):t[2]&&(this.rowCount=parseInt( t[2],10)))}_parseRowAsArray(e){for(var t=new Array(e.length),n=0,i=e.length;n{"use strict";p();var{EventEmitter:Du}=ge(),fs=ls(),ps=tt(),_r=class _r extends Du{constructor(e,t,n){ +ext"):this._parsers[t]=Ou.getTypeParser(n.dataTypeID,n.format||"text")}}};a(xr,"\ +Result");var Sr=xr;hs.exports=Sr});var ms=I((Oh,ys)=>{"use strict";d();var{EventEmitter:Qu}=we(),ds=fs(),ps=et(),Er=class Er extends Qu{constructor(e,t,n){ super(),e=ps.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this. rows=e.rows,this.types=e.types,this.name=e.name,this.binary=e.binary,this.portal= e.portal||"",this.callback=e.callback,this._rowMode=e.rowMode,m.domain&&e.callback&& -(this.callback=m.domain.bind(e.callback)),this._result=new fs(this._rowMode,this. +(this.callback=m.domain.bind(e.callback)),this._result=new ds(this._rowMode,this. types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError= !1,this._promise=null}requiresPreparation(){return this.name||this.rows?!0:!this. text||!this.values?!1:this.values.length>0}_checkForMultirow(){this._result.command&& -(Array.isArray(this._results)||(this._results=[this._result]),this._result=new fs( +(Array.isArray(this._results)||(this._results=[this._result]),this._result=new ds( this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){ this._checkForMultirow(),this._result.addFields(e.fields),this._accumulateRows=this. callback||!this.listeners("row").length}handleDataRow(e){let t;if(!this._canceledDueToError){ @@ -939,89 +943,89 @@ name]}handlePortalSuspended(e){this._getRows(e,this.rows)}_getRows(e,t){e.execut try{e.bind({portal:this.portal,statement:this.name,values:this.values,binary:this. binary,valueMapper:ps.prepareValue})}catch(t){this.handleError(t,e);return}e.describe( {type:"P",name:this.portal||""}),this._getRows(e,this.rows)}handleCopyInResponse(e){ -e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(_r,"Query"); -var vr=_r;ds.exports=vr});var ws={};se(ws,{Socket:()=>_e,isIP:()=>ku});function ku(r){return 0}var gs,ms,v, -_e,St=z(()=>{"use strict";p();gs=Te(ge(),1);a(ku,"isIP");ms=/^[^.]+\./,v=class v extends gs.EventEmitter{constructor(){ -super(...arguments);_(this,"opts",{});_(this,"connecting",!1);_(this,"pending",!0); -_(this,"writable",!0);_(this,"encrypted",!1);_(this,"authorized",!1);_(this,"des\ -troyed",!1);_(this,"ws",null);_(this,"writeBuffer");_(this,"tlsState",0);_(this, -"tlsRead");_(this,"tlsWrite")}static get poolQueryViaFetch(){return v.opts.poolQueryViaFetch?? -v.defaults.poolQueryViaFetch}static set poolQueryViaFetch(t){v.opts.poolQueryViaFetch= -t}static get fetchEndpoint(){return v.opts.fetchEndpoint??v.defaults.fetchEndpoint}static set fetchEndpoint(t){ -v.opts.fetchEndpoint=t}static get fetchConnectionCache(){return!0}static set fetchConnectionCache(t){ +e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(Er,"Query"); +var vr=Er;ys.exports=vr});var bs={};ie(bs,{Socket:()=>_e,isIP:()=>Du});function Du(r){return 0}var ws,gs,E, +_e,bt=z(()=>{"use strict";d();ws=Te(we(),1);a(Du,"isIP");gs=/^[^.]+\./,E=class E extends ws.EventEmitter{constructor(){ +super(...arguments);A(this,"opts",{});A(this,"connecting",!1);A(this,"pending",!0); +A(this,"writable",!0);A(this,"encrypted",!1);A(this,"authorized",!1);A(this,"des\ +troyed",!1);A(this,"ws",null);A(this,"writeBuffer");A(this,"tlsState",0);A(this, +"tlsRead");A(this,"tlsWrite")}static get poolQueryViaFetch(){return E.opts.poolQueryViaFetch?? +E.defaults.poolQueryViaFetch}static set poolQueryViaFetch(t){E.opts.poolQueryViaFetch= +t}static get fetchEndpoint(){return E.opts.fetchEndpoint??E.defaults.fetchEndpoint}static set fetchEndpoint(t){ +E.opts.fetchEndpoint=t}static get fetchConnectionCache(){return!0}static set fetchConnectionCache(t){ console.warn("The `fetchConnectionCache` option is deprecated (now always `true`\ -)")}static get fetchFunction(){return v.opts.fetchFunction??v.defaults.fetchFunction}static set fetchFunction(t){ -v.opts.fetchFunction=t}static get webSocketConstructor(){return v.opts.webSocketConstructor?? -v.defaults.webSocketConstructor}static set webSocketConstructor(t){v.opts.webSocketConstructor= -t}get webSocketConstructor(){return this.opts.webSocketConstructor??v.webSocketConstructor}set webSocketConstructor(t){ -this.opts.webSocketConstructor=t}static get wsProxy(){return v.opts.wsProxy??v.defaults. -wsProxy}static set wsProxy(t){v.opts.wsProxy=t}get wsProxy(){return this.opts.wsProxy?? -v.wsProxy}set wsProxy(t){this.opts.wsProxy=t}static get coalesceWrites(){return v. -opts.coalesceWrites??v.defaults.coalesceWrites}static set coalesceWrites(t){v.opts. -coalesceWrites=t}get coalesceWrites(){return this.opts.coalesceWrites??v.coalesceWrites}set coalesceWrites(t){ -this.opts.coalesceWrites=t}static get useSecureWebSocket(){return v.opts.useSecureWebSocket?? -v.defaults.useSecureWebSocket}static set useSecureWebSocket(t){v.opts.useSecureWebSocket= -t}get useSecureWebSocket(){return this.opts.useSecureWebSocket??v.useSecureWebSocket}set useSecureWebSocket(t){ -this.opts.useSecureWebSocket=t}static get forceDisablePgSSL(){return v.opts.forceDisablePgSSL?? -v.defaults.forceDisablePgSSL}static set forceDisablePgSSL(t){v.opts.forceDisablePgSSL= -t}get forceDisablePgSSL(){return this.opts.forceDisablePgSSL??v.forceDisablePgSSL}set forceDisablePgSSL(t){ -this.opts.forceDisablePgSSL=t}static get disableSNI(){return v.opts.disableSNI?? -v.defaults.disableSNI}static set disableSNI(t){v.opts.disableSNI=t}get disableSNI(){ -return this.opts.disableSNI??v.disableSNI}set disableSNI(t){this.opts.disableSNI= -t}static get pipelineConnect(){return v.opts.pipelineConnect??v.defaults.pipelineConnect}static set pipelineConnect(t){ -v.opts.pipelineConnect=t}get pipelineConnect(){return this.opts.pipelineConnect?? -v.pipelineConnect}set pipelineConnect(t){this.opts.pipelineConnect=t}static get subtls(){ -return v.opts.subtls??v.defaults.subtls}static set subtls(t){v.opts.subtls=t}get subtls(){ -return this.opts.subtls??v.subtls}set subtls(t){this.opts.subtls=t}static get pipelineTLS(){ -return v.opts.pipelineTLS??v.defaults.pipelineTLS}static set pipelineTLS(t){v.opts. -pipelineTLS=t}get pipelineTLS(){return this.opts.pipelineTLS??v.pipelineTLS}set pipelineTLS(t){ -this.opts.pipelineTLS=t}static get rootCerts(){return v.opts.rootCerts??v.defaults. -rootCerts}static set rootCerts(t){v.opts.rootCerts=t}get rootCerts(){return this. -opts.rootCerts??v.rootCerts}set rootCerts(t){this.opts.rootCerts=t}wsProxyAddrForHost(t,n){ +)")}static get fetchFunction(){return E.opts.fetchFunction??E.defaults.fetchFunction}static set fetchFunction(t){ +E.opts.fetchFunction=t}static get webSocketConstructor(){return E.opts.webSocketConstructor?? +E.defaults.webSocketConstructor}static set webSocketConstructor(t){E.opts.webSocketConstructor= +t}get webSocketConstructor(){return this.opts.webSocketConstructor??E.webSocketConstructor}set webSocketConstructor(t){ +this.opts.webSocketConstructor=t}static get wsProxy(){return E.opts.wsProxy??E.defaults. +wsProxy}static set wsProxy(t){E.opts.wsProxy=t}get wsProxy(){return this.opts.wsProxy?? +E.wsProxy}set wsProxy(t){this.opts.wsProxy=t}static get coalesceWrites(){return E. +opts.coalesceWrites??E.defaults.coalesceWrites}static set coalesceWrites(t){E.opts. +coalesceWrites=t}get coalesceWrites(){return this.opts.coalesceWrites??E.coalesceWrites}set coalesceWrites(t){ +this.opts.coalesceWrites=t}static get useSecureWebSocket(){return E.opts.useSecureWebSocket?? +E.defaults.useSecureWebSocket}static set useSecureWebSocket(t){E.opts.useSecureWebSocket= +t}get useSecureWebSocket(){return this.opts.useSecureWebSocket??E.useSecureWebSocket}set useSecureWebSocket(t){ +this.opts.useSecureWebSocket=t}static get forceDisablePgSSL(){return E.opts.forceDisablePgSSL?? +E.defaults.forceDisablePgSSL}static set forceDisablePgSSL(t){E.opts.forceDisablePgSSL= +t}get forceDisablePgSSL(){return this.opts.forceDisablePgSSL??E.forceDisablePgSSL}set forceDisablePgSSL(t){ +this.opts.forceDisablePgSSL=t}static get disableSNI(){return E.opts.disableSNI?? +E.defaults.disableSNI}static set disableSNI(t){E.opts.disableSNI=t}get disableSNI(){ +return this.opts.disableSNI??E.disableSNI}set disableSNI(t){this.opts.disableSNI= +t}static get pipelineConnect(){return E.opts.pipelineConnect??E.defaults.pipelineConnect}static set pipelineConnect(t){ +E.opts.pipelineConnect=t}get pipelineConnect(){return this.opts.pipelineConnect?? +E.pipelineConnect}set pipelineConnect(t){this.opts.pipelineConnect=t}static get subtls(){ +return E.opts.subtls??E.defaults.subtls}static set subtls(t){E.opts.subtls=t}get subtls(){ +return this.opts.subtls??E.subtls}set subtls(t){this.opts.subtls=t}static get pipelineTLS(){ +return E.opts.pipelineTLS??E.defaults.pipelineTLS}static set pipelineTLS(t){E.opts. +pipelineTLS=t}get pipelineTLS(){return this.opts.pipelineTLS??E.pipelineTLS}set pipelineTLS(t){ +this.opts.pipelineTLS=t}static get rootCerts(){return E.opts.rootCerts??E.defaults. +rootCerts}static set rootCerts(t){E.opts.rootCerts=t}get rootCerts(){return this. +opts.rootCerts??E.rootCerts}set rootCerts(t){this.opts.rootCerts=t}wsProxyAddrForHost(t,n){ let i=this.wsProxy;if(i===void 0)throw new Error("No WebSocket proxy is configur\ ed. Please see https://github.com/neondatabase/serverless/blob/main/CONFIG.md#ws\ proxy-string--host-string-port-number--string--string");return typeof i=="functi\ on"?i(t,n):`${i}?address=${t}:${n}`}setNoDelay(){return this}setKeepAlive(){return this}ref(){ return this}unref(){return this}connect(t,n,i){this.connecting=!0,i&&this.once("\ connect",i);let s=a(()=>{this.connecting=!1,this.pending=!1,this.emit("connect"), -this.emit("ready")},"handleWebSocketOpen"),o=a((c,h=!1)=>{c.binaryType="arraybuf\ -fer",c.addEventListener("error",l=>{this.emit("error",l),this.emit("close")}),c. -addEventListener("message",l=>{if(this.tlsState===0){let d=y.from(l.data);this.emit( -"data",d)}}),c.addEventListener("close",()=>{this.emit("close")}),h?s():c.addEventListener( +this.emit("ready")},"handleWebSocketOpen"),o=a((c,l=!1)=>{c.binaryType="arraybuf\ +fer",c.addEventListener("error",h=>{this.emit("error",h),this.emit("close")}),c. +addEventListener("message",h=>{if(this.tlsState===0){let p=y.from(h.data);this.emit( +"data",p)}}),c.addEventListener("close",()=>{this.emit("close")}),l?s():c.addEventListener( "open",s)},"configureWebSocket"),u;try{u=this.wsProxyAddrForHost(n,typeof t=="st\ ring"?parseInt(t,10):t)}catch(c){this.emit("error",c),this.emit("close");return} -try{let h=(this.useSecureWebSocket?"wss:":"ws:")+"//"+u;if(this.webSocketConstructor!== -void 0)this.ws=new this.webSocketConstructor(h),o(this.ws);else try{this.ws=new WebSocket( -h),o(this.ws)}catch{this.ws=new __unstable_WebSocket(h),o(this.ws)}}catch(c){let l=(this. -useSecureWebSocket?"https:":"http:")+"//"+u;fetch(l,{headers:{Upgrade:"websocket"}}). -then(d=>{if(this.ws=d.webSocket,this.ws==null)throw c;this.ws.accept(),o(this.ws, -!0)}).catch(d=>{this.emit("error",new Error(`All attempts to open a WebSocket to\ +try{let l=(this.useSecureWebSocket?"wss:":"ws:")+"//"+u;if(this.webSocketConstructor!== +void 0)this.ws=new this.webSocketConstructor(l),o(this.ws);else try{this.ws=new WebSocket( +l),o(this.ws)}catch{this.ws=new __unstable_WebSocket(l),o(this.ws)}}catch(c){let h=(this. +useSecureWebSocket?"https:":"http:")+"//"+u;fetch(h,{headers:{Upgrade:"websocket"}}). +then(p=>{if(this.ws=p.webSocket,this.ws==null)throw c;this.ws.accept(),o(this.ws, +!0)}).catch(p=>{this.emit("error",new Error(`All attempts to open a WebSocket to\ connect to the database failed. Please refer to https://github.com/neondatabase\ /serverless/blob/main/CONFIG.md#websocketconstructor-typeof-websocket--undefined\ -. Details: ${d.message}`)),this.emit("close")})}}async startTls(t){if(this.subtls=== -void 0)throw new Error("For Postgres SSL connections, you must set `neonConfig.s\ -ubtls` to the subtls library. See https://github.com/neondatabase/serverless/blo\ -b/main/CONFIG.md for more information.");this.tlsState=1;let n=this.subtls.TrustedCert. -fromPEM(this.rootCerts),i=new this.subtls.WebSocketReadQueue(this.ws),s=i.read.bind( -i),o=this.rawWrite.bind(this),[u,c]=await this.subtls.startTls(t,n,s,o,{useSNI:!this. -disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0});this.tlsRead= -u,this.tlsWrite=c,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit( -"secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){for(;;){let t=await this. -tlsRead();if(t===void 0)break;{let n=y.from(t);this.emit("data",n)}}}rawWrite(t){ -if(!this.coalesceWrites){this.ws.send(t);return}if(this.writeBuffer===void 0)this. -writeBuffer=t,setTimeout(()=>{this.ws.send(this.writeBuffer),this.writeBuffer=void 0}, -0);else{let n=new Uint8Array(this.writeBuffer.length+t.length);n.set(this.writeBuffer), -n.set(t,this.writeBuffer.length),this.writeBuffer=n}}write(t,n="utf8",i=s=>{}){return t. -length===0?(i(),!0):(typeof t=="string"&&(t=y.from(t,n)),this.tlsState===0?(this. -rawWrite(t),i()):this.tlsState===1?this.once("secureConnection",()=>{this.write( -t,n,i)}):(this.tlsWrite(t),i()),!0)}end(t=y.alloc(0),n="utf8",i=()=>{}){return this. -write(t,n,()=>{this.ws.close(),i()}),this}destroy(){return this.destroyed=!0,this. -end()}};a(v,"Socket"),_(v,"defaults",{poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{ -let s;return i?.jwtAuth?s=t.replace(ms,"apiauth."):s=t.replace(ms,"api."),"https\ -://"+s+"/sql"},"fetchEndpoint"),fetchConnectionCache:!0,fetchFunction:void 0,webSocketConstructor:void 0, -wsProxy:a(t=>t+"/v2","wsProxy"),useSecureWebSocket:!0,forceDisablePgSSL:!0,coalesceWrites:!0, -pipelineConnect:"password",subtls:void 0,rootCerts:"",pipelineTLS:!1,disableSNI:!1}), -_(v,"opts",{});_e=v});var Xr=I(T=>{"use strict";p();Object.defineProperty(T,"__esModule",{value:!0});T. +. Details: ${p}`)),this.emit("close")})}}async startTls(t){if(this.subtls===void 0) +throw new Error("For Postgres SSL connections, you must set `neonConfig.subtls` \ +to the subtls library. See https://github.com/neondatabase/serverless/blob/main/\ +CONFIG.md for more information.");this.tlsState=1;let n=this.subtls.TrustedCert. +databaseFromPEM(this.rootCerts),i=new this.subtls.WebSocketReadQueue(this.ws),s=i. +read.bind(i),o=this.rawWrite.bind(this),[u,c]=await this.subtls.startTls(t,n,s,o, +{useSNI:!this.disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0}); +this.tlsRead=u,this.tlsWrite=c,this.tlsState=2,this.encrypted=!0,this.authorized= +!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){for(;;){ +let t=await this.tlsRead();if(t===void 0)break;{let n=y.from(t);this.emit("data", +n)}}}rawWrite(t){if(!this.coalesceWrites){this.ws.send(t);return}if(this.writeBuffer=== +void 0)this.writeBuffer=t,setTimeout(()=>{this.ws.send(this.writeBuffer),this.writeBuffer= +void 0},0);else{let n=new Uint8Array(this.writeBuffer.length+t.length);n.set(this. +writeBuffer),n.set(t,this.writeBuffer.length),this.writeBuffer=n}}write(t,n="utf\ +8",i=s=>{}){return t.length===0?(i(),!0):(typeof t=="string"&&(t=y.from(t,n)),this. +tlsState===0?(this.rawWrite(t),i()):this.tlsState===1?this.once("secureConnectio\ +n",()=>{this.write(t,n,i)}):(this.tlsWrite(t),i()),!0)}end(t=y.alloc(0),n="utf8",i=()=>{}){ +return this.write(t,n,()=>{this.ws.close(),i()}),this}destroy(){return this.destroyed= +!0,this.end()}};a(E,"Socket"),A(E,"defaults",{poolQueryViaFetch:!1,fetchEndpoint:a( +(t,n,i)=>{let s;return i?.jwtAuth?s=t.replace(gs,"apiauth."):s=t.replace(gs,"api\ +."),"https://"+s+"/sql"},"fetchEndpoint"),fetchConnectionCache:!0,fetchFunction:void 0, +webSocketConstructor:void 0,wsProxy:a(t=>t+"/v2","wsProxy"),useSecureWebSocket:!0, +forceDisablePgSSL:!0,coalesceWrites:!0,pipelineConnect:"password",subtls:void 0, +rootCerts:"",pipelineTLS:!1,disableSNI:!1}),A(E,"opts",{});_e=E});var Jr=I(T=>{"use strict";d();Object.defineProperty(T,"__esModule",{value:!0});T. NoticeMessage=T.DataRowMessage=T.CommandCompleteMessage=T.ReadyForQueryMessage=T. NotificationResponseMessage=T.BackendKeyDataMessage=T.AuthenticationMD5Password= T.ParameterStatusMessage=T.ParameterDescriptionMessage=T.RowDescriptionMessage=T. @@ -1031,36 +1035,36 @@ void 0;T.parseComplete={name:"parseComplete",length:5};T.bindComplete={name:"bin dComplete",length:5};T.closeComplete={name:"closeComplete",length:5};T.noData={name:"\ noData",length:5};T.portalSuspended={name:"portalSuspended",length:5};T.replicationStart= {name:"replicationStart",length:4};T.emptyQuery={name:"emptyQuery",length:4};T.copyDone= -{name:"copyDone",length:4};var Nr=class Nr extends Error{constructor(e,t,n){super( -e),this.length=t,this.name=n}};a(Nr,"DatabaseError");var Ar=Nr;T.DatabaseError=Ar; -var qr=class qr{constructor(e,t){this.length=e,this.chunk=t,this.name="copyData"}}; -a(qr,"CopyDataMessage");var Cr=qr;T.CopyDataMessage=Cr;var Qr=class Qr{constructor(e,t,n,i){ -this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(Qr,"Co\ -pyResponse");var Tr=Qr;T.CopyResponse=Tr;var jr=class jr{constructor(e,t,n,i,s,o,u){ +{name:"copyDone",length:4};var Dr=class Dr extends Error{constructor(e,t,n){super( +e),this.length=t,this.name=n}};a(Dr,"DatabaseError");var Ar=Dr;T.DatabaseError=Ar; +var Ur=class Ur{constructor(e,t){this.length=e,this.chunk=t,this.name="copyData"}}; +a(Ur,"CopyDataMessage");var _r=Ur;T.CopyDataMessage=_r;var qr=class qr{constructor(e,t,n,i){ +this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(qr,"Co\ +pyResponse");var Cr=qr;T.CopyResponse=Cr;var Nr=class Nr{constructor(e,t,n,i,s,o,u){ this.name=e,this.tableID=t,this.columnID=n,this.dataTypeID=i,this.dataTypeSize=s, -this.dataTypeModifier=o,this.format=u}};a(jr,"Field");var Ir=jr;T.Field=Ir;var Wr=class Wr{constructor(e,t){ +this.dataTypeModifier=o,this.format=u}};a(Nr,"Field");var Tr=Nr;T.Field=Tr;var Wr=class Wr{constructor(e,t){ this.length=e,this.fieldCount=t,this.name="rowDescription",this.fields=new Array( -this.fieldCount)}};a(Wr,"RowDescriptionMessage");var Pr=Wr;T.RowDescriptionMessage= -Pr;var Hr=class Hr{constructor(e,t){this.length=e,this.parameterCount=t,this.name= -"parameterDescription",this.dataTypeIDs=new Array(this.parameterCount)}};a(Hr,"P\ -arameterDescriptionMessage");var Br=Hr;T.ParameterDescriptionMessage=Br;var Gr=class Gr{constructor(e,t,n){ +this.fieldCount)}};a(Wr,"RowDescriptionMessage");var Ir=Wr;T.RowDescriptionMessage= +Ir;var jr=class jr{constructor(e,t){this.length=e,this.parameterCount=t,this.name= +"parameterDescription",this.dataTypeIDs=new Array(this.parameterCount)}};a(jr,"P\ +arameterDescriptionMessage");var Rr=jr;T.ParameterDescriptionMessage=Rr;var Hr=class Hr{constructor(e,t,n){ this.length=e,this.parameterName=t,this.parameterValue=n,this.name="parameterSta\ -tus"}};a(Gr,"ParameterStatusMessage");var Lr=Gr;T.ParameterStatusMessage=Lr;var $r=class $r{constructor(e,t){ -this.length=e,this.salt=t,this.name="authenticationMD5Password"}};a($r,"Authenti\ -cationMD5Password");var Rr=$r;T.AuthenticationMD5Password=Rr;var Vr=class Vr{constructor(e,t,n){ -this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Vr, -"BackendKeyDataMessage");var Fr=Vr;T.BackendKeyDataMessage=Fr;var Kr=class Kr{constructor(e,t,n,i){ +tus"}};a(Hr,"ParameterStatusMessage");var Pr=Hr;T.ParameterStatusMessage=Pr;var Gr=class Gr{constructor(e,t){ +this.length=e,this.salt=t,this.name="authenticationMD5Password"}};a(Gr,"Authenti\ +cationMD5Password");var Fr=Gr;T.AuthenticationMD5Password=Fr;var $r=class $r{constructor(e,t,n){ +this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a($r, +"BackendKeyDataMessage");var Lr=$r;T.BackendKeyDataMessage=Lr;var Vr=class Vr{constructor(e,t,n,i){ this.length=e,this.processId=t,this.channel=n,this.payload=i,this.name="notifica\ -tion"}};a(Kr,"NotificationResponseMessage");var Mr=Kr;T.NotificationResponseMessage= -Mr;var zr=class zr{constructor(e,t){this.length=e,this.status=t,this.name="ready\ -ForQuery"}};a(zr,"ReadyForQueryMessage");var Dr=zr;T.ReadyForQueryMessage=Dr;var Yr=class Yr{constructor(e,t){ -this.length=e,this.text=t,this.name="commandComplete"}};a(Yr,"CommandCompleteMes\ -sage");var kr=Yr;T.CommandCompleteMessage=kr;var Zr=class Zr{constructor(e,t){this. -length=e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(Zr,"Data\ -RowMessage");var Ur=Zr;T.DataRowMessage=Ur;var Jr=class Jr{constructor(e,t){this. -length=e,this.message=t,this.name="notice"}};a(Jr,"NoticeMessage");var Or=Jr;T.NoticeMessage= -Or});var bs=I(xt=>{"use strict";p();Object.defineProperty(xt,"__esModule",{value:!0}); -xt.Writer=void 0;var tn=class tn{constructor(e=256){this.size=e,this.offset=5,this. +tion"}};a(Vr,"NotificationResponseMessage");var Br=Vr;T.NotificationResponseMessage= +Br;var Kr=class Kr{constructor(e,t){this.length=e,this.status=t,this.name="ready\ +ForQuery"}};a(Kr,"ReadyForQueryMessage");var Mr=Kr;T.ReadyForQueryMessage=Mr;var zr=class zr{constructor(e,t){ +this.length=e,this.text=t,this.name="commandComplete"}};a(zr,"CommandCompleteMes\ +sage");var kr=zr;T.CommandCompleteMessage=kr;var Yr=class Yr{constructor(e,t){this. +length=e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(Yr,"Data\ +RowMessage");var Or=Yr;T.DataRowMessage=Or;var Zr=class Zr{constructor(e,t){this. +length=e,this.message=t,this.name="notice"}};a(Zr,"NoticeMessage");var Qr=Zr;T.NoticeMessage= +Qr});var Ss=I(St=>{"use strict";d();Object.defineProperty(St,"__esModule",{value:!0}); +St.Writer=void 0;var en=class en{constructor(e=256){this.size=e,this.offset=5,this. headerPosition=0,this.buffer=y.allocUnsafe(e)}ensure(e){var t=this.buffer.length- this.offset;if(t>1)+e;this.buffer=y.allocUnsafe( i),n.copy(this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]= @@ -1074,59 +1078,59 @@ offset+=t,this}add(e){return this.ensure(e.length),e.copy(this.buffer,this.offse this.offset+=e.length,this}join(e){if(e){this.buffer[this.headerPosition]=e;let t=this. offset-(this.headerPosition+1);this.buffer.writeInt32BE(t,this.headerPosition+1)} return this.buffer.slice(e?0:5,this.offset)}flush(e){var t=this.join(e);return this. -offset=5,this.headerPosition=0,this.buffer=y.allocUnsafe(this.size),t}};a(tn,"Wr\ -iter");var en=tn;xt.Writer=en});var xs=I(vt=>{"use strict";p();Object.defineProperty(vt,"__esModule",{value:!0}); -vt.serialize=void 0;var rn=bs(),M=new rn.Writer,Uu=a(r=>{M.addInt16(3).addInt16( +offset=5,this.headerPosition=0,this.buffer=y.allocUnsafe(this.size),t}};a(en,"Wr\ +iter");var Xr=en;St.Writer=Xr});var vs=I(vt=>{"use strict";d();Object.defineProperty(vt,"__esModule",{value:!0}); +vt.serialize=void 0;var tn=Ss(),M=new tn.Writer,Uu=a(r=>{M.addInt16(3).addInt16( 0);for(let n of Object.keys(r))M.addCString(n).addCString(r[n]);M.addCString("cl\ -ient_encoding").addCString("UTF8");var e=M.addCString("").flush(),t=e.length+4;return new rn. -Writer().addInt32(t).add(e).flush()},"startup"),Ou=a(()=>{let r=y.allocUnsafe(8); +ient_encoding").addCString("UTF8");var e=M.addCString("").flush(),t=e.length+4;return new tn. +Writer().addInt32(t).add(e).flush()},"startup"),qu=a(()=>{let r=y.allocUnsafe(8); return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Nu=a(r=>M. -addCString(r).flush(112),"password"),qu=a(function(r,e){return M.addCString(r).addInt32( -y.byteLength(e)).addString(e),M.flush(112)},"sendSASLInitialResponseMessage"),Qu=a( -function(r){return M.addString(r).flush(112)},"sendSCRAMClientFinalMessage"),ju=a( -r=>M.addCString(r).flush(81),"query"),Ss=[],Wu=a(r=>{let e=r.name||"";e.length>63&& +addCString(r).flush(112),"password"),Wu=a(function(r,e){return M.addCString(r).addInt32( +y.byteLength(e)).addString(e),M.flush(112)},"sendSASLInitialResponseMessage"),ju=a( +function(r){return M.addString(r).flush(112)},"sendSCRAMClientFinalMessage"),Hu=a( +r=>M.addCString(r).flush(81),"query"),xs=[],Gu=a(r=>{let e=r.name||"";e.length>63&& (console.error("Warning! Postgres only supports 63 characters for query names."), console.error("You supplied %s (%s)",e,e.length),console.error("This can cause c\ -onflicts and silent errors executing queries"));let t=r.types||Ss;for(var n=t.length, +onflicts and silent errors executing queries"));let t=r.types||xs;for(var n=t.length, i=M.addCString(e).addCString(r.text).addInt16(n),s=0;s{let e=r.portal||"",t=r.statement|| -"",n=r.binary||!1,i=r.values||Ss,s=i.length;return M.addCString(e).addCString(t), -M.addInt16(s),Hu(i,r.valueMapper),M.addInt16(s),M.add(Oe.flush()),M.addInt16(n?1: -0),M.flush(66)},"bind"),$u=y.from([69,0,0,0,9,0,0,0,0,0]),Vu=a(r=>{if(!r||!r.portal&& -!r.rows)return $u;let e=r.portal||"",t=r.rows||0,n=y.byteLength(e),i=4+n+1+4,s=y. +flush(80)},"parse"),De=new tn.Writer,$u=a(function(r,e){for(let t=0;t{let e=r.portal||"",t=r.statement|| +"",n=r.binary||!1,i=r.values||xs,s=i.length;return M.addCString(e).addCString(t), +M.addInt16(s),$u(i,r.valueMapper),M.addInt16(s),M.add(De.flush()),M.addInt16(n?1: +0),M.flush(66)},"bind"),Ku=y.from([69,0,0,0,9,0,0,0,0,0]),zu=a(r=>{if(!r||!r.portal&& +!r.rows)return Ku;let e=r.portal||"",t=r.rows||0,n=y.byteLength(e),i=4+n+1+4,s=y. allocUnsafe(1+i);return s[0]=69,s.writeInt32BE(i,1),s.write(e,5,"utf-8"),s[n+5]= -0,s.writeUInt32BE(t,s.length-4),s},"execute"),Ku=a((r,e)=>{let t=y.allocUnsafe(16); +0,s.writeUInt32BE(t,s.length-4),s},"execute"),Yu=a((r,e)=>{let t=y.allocUnsafe(16); return t.writeInt32BE(16,0),t.writeInt16BE(1234,4),t.writeInt16BE(5678,6),t.writeInt32BE( -r,8),t.writeInt32BE(e,12),t},"cancel"),nn=a((r,e)=>{let n=4+y.byteLength(e)+1,i=y. +r,8),t.writeInt32BE(e,12),t},"cancel"),rn=a((r,e)=>{let n=4+y.byteLength(e)+1,i=y. allocUnsafe(1+n);return i[0]=r,i.writeInt32BE(n,1),i.write(e,5,"utf-8"),i[n]=0,i}, -"cstringMessage"),zu=M.addCString("P").flush(68),Yu=M.addCString("S").flush(68), -Zu=a(r=>r.name?nn(68,`${r.type}${r.name||""}`):r.type==="P"?zu:Yu,"describe"),Ju=a( -r=>{let e=`${r.type}${r.name||""}`;return nn(67,e)},"close"),Xu=a(r=>M.add(r).flush( -100),"copyData"),ec=a(r=>nn(102,r),"copyFail"),Et=a(r=>y.from([r,0,0,0,4]),"code\ -OnlyBuffer"),tc=Et(72),rc=Et(83),nc=Et(88),ic=Et(99),sc={startup:Uu,password:Nu, -requestSsl:Ou,sendSASLInitialResponseMessage:qu,sendSCRAMClientFinalMessage:Qu,query:ju, -parse:Wu,bind:Gu,execute:Vu,describe:Zu,close:Ju,flush:a(()=>tc,"flush"),sync:a( -()=>rc,"sync"),end:a(()=>nc,"end"),copyData:Xu,copyDone:a(()=>ic,"copyDone"),copyFail:ec, -cancel:Ku};vt.serialize=sc});var Es=I(_t=>{"use strict";p();Object.defineProperty(_t,"__esModule",{value:!0}); -_t.BufferReader=void 0;var oc=y.allocUnsafe(0),on=class on{constructor(e=0){this. -offset=e,this.buffer=oc,this.encoding="utf-8"}setBuffer(e,t){this.offset=e,this. +"cstringMessage"),Zu=M.addCString("P").flush(68),Ju=M.addCString("S").flush(68), +Xu=a(r=>r.name?rn(68,`${r.type}${r.name||""}`):r.type==="P"?Zu:Ju,"describe"),ec=a( +r=>{let e=`${r.type}${r.name||""}`;return rn(67,e)},"close"),tc=a(r=>M.add(r).flush( +100),"copyData"),rc=a(r=>rn(102,r),"copyFail"),xt=a(r=>y.from([r,0,0,0,4]),"code\ +OnlyBuffer"),nc=xt(72),ic=xt(83),sc=xt(88),oc=xt(99),ac={startup:Uu,password:Nu, +requestSsl:qu,sendSASLInitialResponseMessage:Wu,sendSCRAMClientFinalMessage:ju,query:Hu, +parse:Gu,bind:Vu,execute:zu,describe:Xu,close:ec,flush:a(()=>nc,"flush"),sync:a( +()=>ic,"sync"),end:a(()=>sc,"end"),copyData:tc,copyDone:a(()=>oc,"copyDone"),copyFail:rc, +cancel:Yu};vt.serialize=ac});var Es=I(Et=>{"use strict";d();Object.defineProperty(Et,"__esModule",{value:!0}); +Et.BufferReader=void 0;var uc=y.allocUnsafe(0),sn=class sn{constructor(e=0){this. +offset=e,this.buffer=uc,this.encoding="utf-8"}setBuffer(e,t){this.offset=e,this. buffer=t}int16(){let e=this.buffer.readInt16BE(this.offset);return this.offset+= 2,e}byte(){let e=this.buffer[this.offset];return this.offset++,e}int32(){let e=this. buffer.readInt32BE(this.offset);return this.offset+=4,e}string(e){let t=this.buffer. toString(this.encoding,this.offset,this.offset+e);return this.offset+=e,t}cstring(){ let e=this.offset,t=e;for(;this.buffer[t++]!==0;);return this.offset=t,this.buffer. toString(this.encoding,e,t-1)}bytes(e){let t=this.buffer.slice(this.offset,this. -offset+e);return this.offset+=e,t}};a(on,"BufferReader");var sn=on;_t.BufferReader= -sn});var As=I(At=>{"use strict";p();Object.defineProperty(At,"__esModule",{value:!0}); -At.Parser=void 0;var D=Xr(),ac=Es(),an=1,uc=4,vs=an+uc,_s=y.allocUnsafe(0),cn=class cn{constructor(e){ -if(this.buffer=_s,this.bufferLength=0,this.bufferOffset=0,this.reader=new ac.BufferReader, +offset+e);return this.offset+=e,t}};a(sn,"BufferReader");var nn=sn;Et.BufferReader= +nn});var Cs=I(At=>{"use strict";d();Object.defineProperty(At,"__esModule",{value:!0}); +At.Parser=void 0;var k=Jr(),cc=Es(),on=1,lc=4,As=on+lc,_s=y.allocUnsafe(0),un=class un{constructor(e){ +if(this.buffer=_s,this.bufferLength=0,this.bufferOffset=0,this.reader=new cc.BufferReader, e?.mode==="binary")throw new Error("Binary mode not supported yet");this.mode=e?. mode||"text"}parse(e,t){this.mergeBuffer(e);let n=this.bufferOffset+this.bufferLength, -i=this.bufferOffset;for(;i+vs<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( -i+an),u=an+o;if(u+i<=n){let c=this.handlePacket(i+vs,s,o,this.buffer);t(c),i+=u}else +i=this.bufferOffset;for(;i+As<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( +i+on),u=on+o;if(u+i<=n){let c=this.handlePacket(i+As,s,o,this.buffer);t(c),i+=u}else break}i===n?(this.buffer=_s,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength= n-i,this.bufferOffset=i)}mergeBuffer(e){if(this.bufferLength>0){let t=this.bufferLength+ e.byteLength;if(t+this.bufferOffset>this.buffer.byteLength){let i;if(t<=this.buffer. @@ -1135,9 +1139,9 @@ byteLength*2;for(;t>=s;)s*=2;i=y.allocUnsafe(s)}this.buffer.copy(i,0,this.buffer this.bufferOffset+this.bufferLength),this.buffer=i,this.bufferOffset=0}e.copy(this. buffer,this.bufferOffset+this.bufferLength),this.bufferLength=t}else this.buffer= e,this.bufferOffset=0,this.bufferLength=e.byteLength}handlePacket(e,t,n,i){switch(t){case 50: -return D.bindComplete;case 49:return D.parseComplete;case 51:return D.closeComplete;case 110: -return D.noData;case 115:return D.portalSuspended;case 99:return D.copyDone;case 87: -return D.replicationStart;case 73:return D.emptyQuery;case 68:return this.parseDataRowMessage( +return k.bindComplete;case 49:return k.parseComplete;case 51:return k.closeComplete;case 110: +return k.noData;case 115:return k.portalSuspended;case 99:return k.copyDone;case 87: +return k.replicationStart;case 73:return k.emptyQuery;case 68:return this.parseDataRowMessage( e,n,i);case 67:return this.parseCommandCompleteMessage(e,n,i);case 90:return this. parseReadyForQueryMessage(e,n,i);case 65:return this.parseNotificationMessage(e, n,i);case 82:return this.parseAuthenticationResponse(e,n,i);case 83:return this. @@ -1146,54 +1150,54 @@ return this.parseErrorMessage(e,n,i,"error");case 78:return this.parseErrorMessa e,n,i,"notice");case 84:return this.parseRowDescriptionMessage(e,n,i);case 116:return this. parseParameterDescriptionMessage(e,n,i);case 71:return this.parseCopyInMessage(e, n,i);case 72:return this.parseCopyOutMessage(e,n,i);case 100:return this.parseCopyData( -e,n,i);default:return new D.DatabaseError("received invalid response: "+t.toString( +e,n,i);default:return new k.DatabaseError("received invalid response: "+t.toString( 16),n,"error")}}parseReadyForQueryMessage(e,t,n){this.reader.setBuffer(e,n);let i=this. -reader.string(1);return new D.ReadyForQueryMessage(t,i)}parseCommandCompleteMessage(e,t,n){ -this.reader.setBuffer(e,n);let i=this.reader.cstring();return new D.CommandCompleteMessage( -t,i)}parseCopyData(e,t,n){let i=n.slice(e,e+(t-4));return new D.CopyDataMessage( +reader.string(1);return new k.ReadyForQueryMessage(t,i)}parseCommandCompleteMessage(e,t,n){ +this.reader.setBuffer(e,n);let i=this.reader.cstring();return new k.CommandCompleteMessage( +t,i)}parseCopyData(e,t,n){let i=n.slice(e,e+(t-4));return new k.CopyDataMessage( t,i)}parseCopyInMessage(e,t,n){return this.parseCopyMessage(e,t,n,"copyInRespons\ e")}parseCopyOutMessage(e,t,n){return this.parseCopyMessage(e,t,n,"copyOutRespon\ se")}parseCopyMessage(e,t,n,i){this.reader.setBuffer(e,n);let s=this.reader.byte()!== -0,o=this.reader.int16(),u=new D.CopyResponse(t,i,s,o);for(let c=0;c{"use strict";p();Object.defineProperty(be,"__esModule",{value:!0}); -be.DatabaseError=be.serialize=be.parse=void 0;var cc=Xr();Object.defineProperty( -be,"DatabaseError",{enumerable:!0,get:a(function(){return cc.DatabaseError},"get")}); -var hc=xs();Object.defineProperty(be,"serialize",{enumerable:!0,get:a(function(){ -return hc.serialize},"get")});var lc=As();function fc(r,e){let t=new lc.Parser;return r. -on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(fc,"parse");be. -parse=fc});var Cs={};se(Cs,{connect:()=>pc});function pc({socket:r,servername:e}){return r. -startTls(e),r}var Ts=z(()=>{"use strict";p();a(pc,"connect")});var pn=I((of,Bs)=>{"use strict";p();var Is=(St(),O(ws)),dc=ge().EventEmitter,{parse:yc, -serialize:q}=hn(),Ps=q.flush(),mc=q.sync(),gc=q.end(),fn=class fn extends dc{constructor(e){ -super(),e=e||{},this.stream=e.stream||new Is.Socket,this._keepAlive=e.keepAlive, +line=s.L,c.routine=s.R,c}};a(un,"Parser");var an=un;At.Parser=an});var cn=I(Se=>{"use strict";d();Object.defineProperty(Se,"__esModule",{value:!0}); +Se.DatabaseError=Se.serialize=Se.parse=void 0;var hc=Jr();Object.defineProperty( +Se,"DatabaseError",{enumerable:!0,get:a(function(){return hc.DatabaseError},"get")}); +var fc=vs();Object.defineProperty(Se,"serialize",{enumerable:!0,get:a(function(){ +return fc.serialize},"get")});var dc=Cs();function pc(r,e){let t=new dc.Parser;return r. +on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(pc,"parse");Se. +parse=pc});var Ts={};ie(Ts,{connect:()=>yc});function yc({socket:r,servername:e}){return r. +startTls(e),r}var Is=z(()=>{"use strict";d();a(yc,"connect")});var fn=I((uf,Fs)=>{"use strict";d();var Rs=(bt(),U(bs)),mc=we().EventEmitter,{parse:gc, +serialize:N}=cn(),Ps=N.flush(),wc=N.sync(),bc=N.end(),hn=class hn extends mc{constructor(e){ +super(),e=e||{},this.stream=e.stream||new Rs.Socket,this._keepAlive=e.keepAlive, this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis,this.lastBuffer= !1,this.parsedStatements={},this.ssl=e.ssl||!1,this._ending=!1,this._emitMessage= !1;var t=this;this.on("newListener",function(n){n==="message"&&(t._emitMessage=!0)})}connect(e,t){ @@ -1206,36 +1210,36 @@ ssl)return this.attachListeners(this.stream);this.stream.once("data",function(s) var o=s.toString("utf8");switch(o){case"S":break;case"N":return n.stream.end(),n. emit("error",new Error("The server does not support SSL connections"));default:return n. stream.end(),n.emit("error",new Error("There was an error establishing an SSL co\ -nnection"))}var u=(Ts(),O(Cs));let c={socket:n.stream};n.ssl!==!0&&(Object.assign( -c,n.ssl),"key"in n.ssl&&(c.key=n.ssl.key)),Is.isIP(t)===0&&(c.servername=t);try{ -n.stream=u.connect(c)}catch(h){return n.emit("error",h)}n.attachListeners(n.stream), +nnection"))}var u=(Is(),U(Ts));let c={socket:n.stream};n.ssl!==!0&&(Object.assign( +c,n.ssl),"key"in n.ssl&&(c.key=n.ssl.key)),Rs.isIP(t)===0&&(c.servername=t);try{ +n.stream=u.connect(c)}catch(l){return n.emit("error",l)}n.attachListeners(n.stream), n.stream.on("error",i),n.emit("sslconnect")})}attachListeners(e){e.on("end",()=>{ -this.emit("end")}),yc(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& -this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(q.requestSsl())}startup(e){ -this.stream.write(q.startup(e))}cancel(e,t){this._send(q.cancel(e,t))}password(e){ -this._send(q.password(e))}sendSASLInitialResponseMessage(e,t){this._send(q.sendSASLInitialResponseMessage( -e,t))}sendSCRAMClientFinalMessage(e){this._send(q.sendSCRAMClientFinalMessage(e))}_send(e){ -return this.stream.writable?this.stream.write(e):!1}query(e){this._send(q.query( -e))}parse(e){this._send(q.parse(e))}bind(e){this._send(q.bind(e))}execute(e){this. -_send(q.execute(e))}flush(){this.stream.writable&&this.stream.write(Ps)}sync(){this. -_ending=!0,this._send(Ps),this._send(mc)}ref(){this.stream.ref()}unref(){this.stream. +this.emit("end")}),gc(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& +this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(N.requestSsl())}startup(e){ +this.stream.write(N.startup(e))}cancel(e,t){this._send(N.cancel(e,t))}password(e){ +this._send(N.password(e))}sendSASLInitialResponseMessage(e,t){this._send(N.sendSASLInitialResponseMessage( +e,t))}sendSCRAMClientFinalMessage(e){this._send(N.sendSCRAMClientFinalMessage(e))}_send(e){ +return this.stream.writable?this.stream.write(e):!1}query(e){this._send(N.query( +e))}parse(e){this._send(N.parse(e))}bind(e){this._send(N.bind(e))}execute(e){this. +_send(N.execute(e))}flush(){this.stream.writable&&this.stream.write(Ps)}sync(){this. +_ending=!0,this._send(Ps),this._send(wc)}ref(){this.stream.ref()}unref(){this.stream. unref()}end(){if(this._ending=!0,!this._connecting||!this.stream.writable){this. -stream.end();return}return this.stream.write(gc,()=>{this.stream.end()})}close(e){ -this._send(q.close(e))}describe(e){this._send(q.describe(e))}sendCopyFromChunk(e){ -this._send(q.copyData(e))}endCopyFrom(){this._send(q.copyDone())}sendCopyFail(e){ -this._send(q.copyFail(e))}};a(fn,"Connection");var ln=fn;Bs.exports=ln});var Fs=I((hf,Rs)=>{"use strict";p();var wc=ge().EventEmitter,cf=(Ge(),O(He)),bc=tt(), -dn=ji(),Sc=Xi(),xc=wt(),Ec=bt(),Ls=ys(),vc=et(),_c=pn(),yn=class yn extends wc{constructor(e){ -super(),this.connectionParameters=new Ec(e),this.user=this.connectionParameters. +stream.end();return}return this.stream.write(bc,()=>{this.stream.end()})}close(e){ +this._send(N.close(e))}describe(e){this._send(N.describe(e))}sendCopyFromChunk(e){ +this._send(N.copyData(e))}endCopyFrom(){this._send(N.copyDone())}sendCopyFail(e){ +this._send(N.copyFail(e))}};a(hn,"Connection");var ln=hn;Fs.exports=ln});var Ms=I((ff,Bs)=>{"use strict";d();var Sc=we().EventEmitter,hf=(He(),U(je)),xc=et(), +dn=ji(),vc=es(),Ec=gt(),Ac=wt(),Ls=ms(),_c=Xe(),Cc=fn(),pn=class pn extends Sc{constructor(e){ +super(),this.connectionParameters=new Ac(e),this.user=this.connectionParameters. user,this.database=this.connectionParameters.database,this.port=this.connectionParameters. port,this.host=this.connectionParameters.host,Object.defineProperty(this,"passwo\ rd",{configurable:!0,enumerable:!1,writable:!0,value:this.connectionParameters.password}), this.replication=this.connectionParameters.replication;var t=e||{};this._Promise= -t.Promise||S.Promise,this._types=new xc(t.types),this._ending=!1,this._connecting= +t.Promise||b.Promise,this._types=new Ec(t.types),this._ending=!1,this._connecting= !1,this._connected=!1,this._connectionError=!1,this._queryable=!0,this.connection= -t.connection||new _c({stream:t.stream,ssl:this.connectionParameters.ssl,keepAlive:t. +t.connection||new Cc({stream:t.stream,ssl:this.connectionParameters.ssl,keepAlive:t. keepAlive||!1,keepAliveInitialDelayMillis:t.keepAliveInitialDelayMillis||0,encoding:this. connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t. -binary||vc.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters. +binary||_c.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters. ssl||!1,this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}), this._connectionTimeoutMillis=t.connectionTimeoutMillis||0}_errorAllQueries(e){let t=a( n=>{m.nextTick(()=>{n.handleError(e,this.connection)})},"enqueueError");this.activeQuery&& @@ -1273,10 +1277,10 @@ let t=this.connection;typeof this.password=="function"?this._Promise.resolve().t ()=>this.password()).then(n=>{if(n!==void 0){if(typeof n!="string"){t.emit("erro\ r",new TypeError("Password must be a string"));return}this.connectionParameters. password=this.password=n}else this.connectionParameters.password=this.password=null; -e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():Sc(this.connectionParameters, +e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():vc(this.connectionParameters, n=>{n!==void 0&&(this.connectionParameters.password=this.password=n),e()})}_handleAuthCleartextPassword(e){ this._checkPgPass(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){ -this._checkPgPass(()=>{let t=bc.postgresMd5PasswordHash(this.user,this.password, +this._checkPgPass(()=>{let t=xc.postgresMd5PasswordHash(this.user,this.password, e.salt);this.connection.password(t)})}_handleAuthSASL(e){this._checkPgPass(()=>{ this.saslSession=dn.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){ @@ -1323,11 +1327,11 @@ emit("drain"))}query(e,t,n){var i,s,o,u,c;if(e==null)throw new TypeError("Client was passed a null or undefined query");return typeof e.submit=="function"?(o=e. query_timeout||this.connectionParameters.query_timeout,s=i=e,typeof t=="function"&& (i.callback=i.callback||t)):(o=this.connectionParameters.query_timeout,i=new Ls( -e,t,n),i.callback||(s=new this._Promise((h,l)=>{i.callback=(d,b)=>d?l(d):h(b)}))), -o&&(c=i.callback,u=setTimeout(()=>{var h=new Error("Query read timeout");m.nextTick( -()=>{i.handleError(h,this.connection)}),c(h),i.callback=()=>{};var l=this.queryQueue. -indexOf(i);l>-1&&this.queryQueue.splice(l,1),this._pulseQueryQueue()},o),i.callback= -(h,l)=>{clearTimeout(u),c(h,l)}),this.binary&&!i.binary&&(i.binary=!0),i._result&& +e,t,n),i.callback||(s=new this._Promise((l,h)=>{i.callback=(p,S)=>p?h(p):l(S)}))), +o&&(c=i.callback,u=setTimeout(()=>{var l=new Error("Query read timeout");m.nextTick( +()=>{i.handleError(l,this.connection)}),c(l),i.callback=()=>{};var h=this.queryQueue. +indexOf(i);h>-1&&this.queryQueue.splice(h,1),this._pulseQueryQueue()},o),i.callback= +(l,h)=>{clearTimeout(u),c(l,h)}),this.binary&&!i.binary&&(i.binary=!0),i._result&& !i._result._types&&(i._result._types=this._types),this._queryable?this._ending?(m. nextTick(()=>{i.handleError(new Error("Client was closed and is not queryable"), this.connection)}),s):(this.queryQueue.push(i),this._pulseQueryQueue(),s):(m.nextTick( @@ -1336,27 +1340,27 @@ ot queryable"),this.connection)}),s)}ref(){this.connection.ref()}unref(){this.co unref()}end(e){if(this._ending=!0,!this.connection._connecting)if(e)e();else return this. _Promise.resolve();if(this.activeQuery||!this._queryable?this.connection.stream. destroy():this.connection.end(),e)this.connection.once("end",e);else return new this. -_Promise(t=>{this.connection.once("end",t)})}};a(yn,"Client");var Ct=yn;Ct.Query= -Ls;Rs.exports=Ct});var Us=I((pf,ks)=>{"use strict";p();var Ac=ge().EventEmitter,Ms=a(function(){},"\ -NOOP"),Ds=a((r,e)=>{let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]}, -"removeWhere"),wn=class wn{constructor(e,t,n){this.client=e,this.idleListener=t, -this.timeoutId=n}};a(wn,"IdleItem");var mn=wn,bn=class bn{constructor(e){this.callback= -e}};a(bn,"PendingItem");var Ne=bn;function Cc(){throw new Error("Release called \ -on client which has already been released to the pool.")}a(Cc,"throwOnDoubleRele\ -ase");function Tt(r,e){if(e)return{callback:e,result:void 0};let t,n,i=a(function(o,u){ +_Promise(t=>{this.connection.once("end",t)})}};a(pn,"Client");var _t=pn;_t.Query= +Ls;Bs.exports=_t});var Ds=I((yf,Qs)=>{"use strict";d();var Tc=we().EventEmitter,ks=a(function(){},"\ +NOOP"),Os=a((r,e)=>{let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]}, +"removeWhere"),gn=class gn{constructor(e,t,n){this.client=e,this.idleListener=t, +this.timeoutId=n}};a(gn,"IdleItem");var yn=gn,wn=class wn{constructor(e){this.callback= +e}};a(wn,"PendingItem");var Ue=wn;function Ic(){throw new Error("Release called \ +on client which has already been released to the pool.")}a(Ic,"throwOnDoubleRele\ +ase");function Ct(r,e){if(e)return{callback:e,result:void 0};let t,n,i=a(function(o,u){ o?t(o):n(u)},"cb"),s=new r(function(o,u){n=o,t=u}).catch(o=>{throw Error.captureStackTrace( -o),o});return{callback:i,result:s}}a(Tt,"promisify");function Tc(r,e){return a(function t(n){ +o),o});return{callback:i,result:s}}a(Ct,"promisify");function Rc(r,e){return a(function t(n){ n.client=e,e.removeListener("error",t),e.on("error",()=>{r.log("additional clien\ t error after disconnection due to error",n)}),r._remove(e),r.emit("error",n,e)}, -"idleListener")}a(Tc,"makeIdleListener");var Sn=class Sn extends Ac{constructor(e,t){ +"idleListener")}a(Rc,"makeIdleListener");var bn=class bn extends Tc{constructor(e,t){ super(),this.options=Object.assign({},e),e!=null&&"password"in e&&Object.defineProperty( this.options,"password",{configurable:!0,enumerable:!1,writable:!0,value:e.password}), e!=null&&e.ssl&&e.ssl.key&&Object.defineProperty(this.options.ssl,"key",{enumerable:!1}), this.options.max=this.options.max||this.options.poolSize||10,this.options.maxUses= this.options.maxUses||1/0,this.options.allowExitOnIdle=this.options.allowExitOnIdle|| !1,this.options.maxLifetimeSeconds=this.options.maxLifetimeSeconds||0,this.log=this. -options.log||function(){},this.Client=this.options.Client||t||It().Client,this.Promise= -this.options.Promise||S.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this. +options.log||function(){},this.Client=this.options.Client||t||Tt().Client,this.Promise= +this.options.Promise||b.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this. options.idleTimeoutMillis=1e4),this._clients=[],this._idle=[],this._expired=new WeakSet, this._pendingQueue=[],this._endCallback=void 0,this.ending=!1,this.ended=!1}_isFull(){ return this._clients.length>=this.options.max}_pulseQueue(){if(this.log("pulse q\ @@ -1367,34 +1371,34 @@ _pendingQueue.length){this.log("no queued requests");return}if(!this._idle.lengt this._isFull())return;let e=this._pendingQueue.shift();if(this._idle.length){let t=this. _idle.pop();clearTimeout(t.timeoutId);let n=t.client;n.ref&&n.ref();let i=t.idleListener; return this._acquireClient(n,e,i,!1)}if(!this._isFull())return this.newClient(e); -throw new Error("unexpected condition")}_remove(e){let t=Ds(this._idle,n=>n.client=== +throw new Error("unexpected condition")}_remove(e){let t=Os(this._idle,n=>n.client=== e);t!==void 0&&clearTimeout(t.timeoutId),this._clients=this._clients.filter(n=>n!== e),e.end(),this.emit("remove",e)}connect(e){if(this.ending){let i=new Error("Can\ not use a pool after calling end on the pool");return e?e(i):this.Promise.reject( -i)}let t=Tt(this.Promise,e),n=t.result;if(this._isFull()||this._idle.length){if(this. +i)}let t=Ct(this.Promise,e),n=t.result;if(this._isFull()||this._idle.length){if(this. _idle.length&&m.nextTick(()=>this._pulseQueue()),!this.options.connectionTimeoutMillis) -return this._pendingQueue.push(new Ne(t.callback)),n;let i=a((u,c,h)=>{clearTimeout( -o),t.callback(u,c,h)},"queueCallback"),s=new Ne(i),o=setTimeout(()=>{Ds(this._pendingQueue, +return this._pendingQueue.push(new Ue(t.callback)),n;let i=a((u,c,l)=>{clearTimeout( +o),t.callback(u,c,l)},"queueCallback"),s=new Ue(i),o=setTimeout(()=>{Os(this._pendingQueue, u=>u.callback===i),s.timedOut=!0,t.callback(new Error("timeout exceeded when try\ ing to connect"))},this.options.connectionTimeoutMillis);return this._pendingQueue. -push(s),n}return this.newClient(new Ne(t.callback)),n}newClient(e){let t=new this. -Client(this.options);this._clients.push(t);let n=Tc(this,t);this.log("checking c\ +push(s),n}return this.newClient(new Ue(t.callback)),n}newClient(e){let t=new this. +Client(this.options);this._clients.push(t);let n=Rc(this,t);this.log("checking c\ lient timeout");let i,s=!1;this.options.connectionTimeoutMillis&&(i=setTimeout(()=>{ this.log("ending client due to timeout"),s=!0,t.connection?t.connection.stream.destroy(): t.end()},this.options.connectionTimeoutMillis)),this.log("connecting new client"), t.connect(o=>{if(i&&clearTimeout(i),t.on("error",n),o)this.log("client failed to\ connect",o),this._clients=this._clients.filter(u=>u!==t),s&&(o.message="Connect\ ion terminated due to connection timeout"),this._pulseQueue(),e.timedOut||e.callback( -o,void 0,Ms);else{if(this.log("new client connected"),this.options.maxLifetimeSeconds!== +o,void 0,ks);else{if(this.log("new client connected"),this.options.maxLifetimeSeconds!== 0){let u=setTimeout(()=>{this.log("ending client due to expired lifetime"),this. -_expired.add(t),this._idle.findIndex(h=>h.client===t)!==-1&&this._acquireClient( -t,new Ne((h,l,d)=>d()),n,!1)},this.options.maxLifetimeSeconds*1e3);u.unref(),t.once( +_expired.add(t),this._idle.findIndex(l=>l.client===t)!==-1&&this._acquireClient( +t,new Ue((l,h,p)=>p()),n,!1)},this.options.maxLifetimeSeconds*1e3);u.unref(),t.once( "end",()=>clearTimeout(u))}return this._acquireClient(t,e,n,!0)}})}_acquireClient(e,t,n,i){ i&&this.emit("connect",e),this.emit("acquire",e),e.release=this._releaseOnce(e,n), e.removeListener("error",n),t.timedOut?i&&this.options.verify?this.options.verify( e,e.release):e.release():i&&this.options.verify?this.options.verify(e,s=>{if(s)return e. -release(s),t.callback(s,void 0,Ms);t.callback(void 0,e,e.release)}):t.callback(void 0, -e,e.release)}_releaseOnce(e,t){let n=!1;return i=>{n&&Cc(),n=!0,this._release(e, +release(s),t.callback(s,void 0,ks);t.callback(void 0,e,e.release)}):t.callback(void 0, +e,e.release)}_releaseOnce(e,t){let n=!1;return i=>{n&&Ic(),n=!0,this._release(e, t,i)}}_release(e,t,n){if(e.on("error",t),e._poolUseCount=(e._poolUseCount||0)+1, this.emit("release",n,e),n||this.ending||!e._queryable||e._ending||e._poolUseCount>= this.options.maxUses){e._poolUseCount>=this.options.maxUses&&this.log("remove ex\ @@ -1402,21 +1406,21 @@ pended client"),this._remove(e),this._pulseQueue();return}if(this._expired.has(e this.log("remove expired client"),this._expired.delete(e),this._remove(e),this._pulseQueue(); return}let s;this.options.idleTimeoutMillis&&(s=setTimeout(()=>{this.log("remove\ idle client"),this._remove(e)},this.options.idleTimeoutMillis),this.options.allowExitOnIdle&& -s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new mn(e,t,s)), -this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=Tt(this.Promise,e); +s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new yn(e,t,s)), +this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=Ct(this.Promise,e); return x(function(){return s.callback(new Error("Passing a function as the first\ parameter to pool.query is not supported"))}),s.result}typeof t=="function"&&(n= -t,t=void 0);let i=Tt(this.Promise,n);return n=i.callback,this.connect((s,o)=>{if(s) -return n(s);let u=!1,c=a(h=>{u||(u=!0,o.release(h),n(h))},"onError");o.once("err\ -or",c),this.log("dispatching query");try{o.query(e,t,(h,l)=>{if(this.log("query \ -dispatched"),o.removeListener("error",c),!u)return u=!0,o.release(h),h?n(h):n(void 0, -l)})}catch(h){return o.release(h),n(h)}}),i.result}end(e){if(this.log("ending"), +t,t=void 0);let i=Ct(this.Promise,n);return n=i.callback,this.connect((s,o)=>{if(s) +return n(s);let u=!1,c=a(l=>{u||(u=!0,o.release(l),n(l))},"onError");o.once("err\ +or",c),this.log("dispatching query");try{o.query(e,t,(l,h)=>{if(this.log("query \ +dispatched"),o.removeListener("error",c),!u)return u=!0,o.release(l),l?n(l):n(void 0, +h)})}catch(l){return o.release(l),n(l)}}),i.result}end(e){if(this.log("ending"), this.ending){let n=new Error("Called end on pool more than once");return e?e(n): -this.Promise.reject(n)}this.ending=!0;let t=Tt(this.Promise,e);return this._endCallback= +this.Promise.reject(n)}this.ending=!0;let t=Ct(this.Promise,e);return this._endCallback= t.callback,this._pulseQueue(),t.result}get waitingCount(){return this._pendingQueue. length}get idleCount(){return this._idle.length}get expiredCount(){return this._clients. reduce((e,t)=>e+(this._expired.has(t)?1:0),0)}get totalCount(){return this._clients. -length}};a(Sn,"Pool");var gn=Sn;ks.exports=gn});var Os={};se(Os,{default:()=>Ic});var Ic,Ns=z(()=>{"use strict";p();Ic={}});var qs=I((gf,Pc)=>{Pc.exports={name:"pg",version:"8.8.0",description:"PostgreSQL\ +length}};a(bn,"Pool");var mn=bn;Qs.exports=mn});var Us={};ie(Us,{default:()=>Pc});var Pc,qs=z(()=>{"use strict";d();Pc={}});var Ns=I((bf,Fc)=>{Fc.exports={name:"pg",version:"8.8.0",description:"PostgreSQL\ client - pure javascript & libpq with the same API",keywords:["database","libpq", "pg","postgre","postgres","postgresql","rdbms"],homepage:"https://github.com/bri\ anc/node-postgres",repository:{type:"git",url:"git://github.com/brianc/node-post\ @@ -1427,16 +1431,16 @@ pes":"^2.1.0",pgpass:"1.x"},devDependencies:{async:"2.6.4",bluebird:"3.5.2",co:" 4.6.0","pg-copy-streams":"0.3.0"},peerDependencies:{"pg-native":">=3.0.1"},peerDependenciesMeta:{ "pg-native":{optional:!0}},scripts:{test:"make test-all"},files:["lib","SPONSORS\ .md"],license:"MIT",engines:{node:">= 8.0.0"},gitHead:"c99fb2c127ddf8d712500db2c\ -7b9a5491a178655"}});var Ws=I((wf,js)=>{"use strict";p();var Qs=ge().EventEmitter,Bc=(Ge(),O(He)),xn=tt(), -qe=js.exports=function(r,e,t){Qs.call(this),r=xn.normalizeQueryConfig(r,e,t),this. +7b9a5491a178655"}});var Hs=I((Sf,js)=>{"use strict";d();var Ws=we().EventEmitter,Lc=(He(),U(je)),Sn=et(), +qe=js.exports=function(r,e,t){Ws.call(this),r=Sn.normalizeQueryConfig(r,e,t),this. text=r.text,this.values=r.values,this.name=r.name,this.callback=r.callback,this. state="new",this._arrayMode=r.rowMode==="array",this._emitRowEvents=!1,this.on("\ -newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};Bc.inherits( -qe,Qs);var Lc={sqlState:"code",statementPosition:"position",messagePrimary:"mess\ +newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};Lc.inherits( +qe,Ws);var Bc={sqlState:"code",statementPosition:"position",messagePrimary:"mess\ age",context:"where",schemaName:"schema",tableName:"table",columnName:"column",dataTypeName:"\ dataType",constraintName:"constraint",sourceFile:"file",sourceLine:"line",sourceFunction:"\ routine"};qe.prototype.handleError=function(r){var e=this.native.pq.resultErrorFields(); -if(e)for(var t in e){var n=Lc[t]||t;r[n]=e[t]}this.callback?this.callback(r):this. +if(e)for(var t in e){var n=Bc[t]||t;r[n]=e[t]}this.callback?this.callback(r):this. emit("error",r),this.state="error"};qe.prototype.then=function(r,e){return this. _getPromise().then(r,e)};qe.prototype.catch=function(r){return this._getPromise(). catch(r)};qe.prototype._getPromise=function(){return this._promise?this._promise: @@ -1444,28 +1448,28 @@ catch(r)};qe.prototype._getPromise=function(){return this._promise?this._promise e)}.bind(this)),this._promise)};qe.prototype.submit=function(r){this.state="runn\ ing";var e=this;this.native=r.native,r.native.arrayMode=this._arrayMode;var t=a( function(s,o,u){if(r.native.arrayMode=!1,x(function(){e.emit("_done")}),s)return e. -handleError(s);e._emitRowEvents&&(u.length>1?o.forEach((c,h)=>{c.forEach(l=>{e.emit( -"row",l,u[h])})}):o.forEach(function(c){e.emit("row",c,u)})),e.state="end",e.emit( +handleError(s);e._emitRowEvents&&(u.length>1?o.forEach((c,l)=>{c.forEach(h=>{e.emit( +"row",h,u[l])})}):o.forEach(function(c){e.emit("row",c,u)})),e.state="end",e.emit( "end",u),e.callback&&e.callback(null,u)},"after");if(m.domain&&(t=m.domain.bind( t)),this.name){this.name.length>63&&(console.error("Warning! Postgres only suppo\ rts 63 characters for query names."),console.error("You supplied %s (%s)",this.name, this.name.length),console.error("This can cause conflicts and silent errors exec\ -uting queries"));var n=(this.values||[]).map(xn.prepareValue);if(r.namedQueries[this. +uting queries"));var n=(this.values||[]).map(Sn.prepareValue);if(r.namedQueries[this. name]){if(this.text&&r.namedQueries[this.name]!==this.text){let s=new Error(`Pre\ pared statements must be unique - '${this.name}' was used for a different statem\ ent`);return t(s)}return r.native.execute(this.name,n,t)}return r.native.prepare( this.name,this.text,n.length,function(s){return s?t(s):(r.namedQueries[e.name]=e. text,e.native.execute(e.name,n,t))})}else if(this.values){if(!Array.isArray(this. values)){let s=new Error("Query values must be an array");return t(s)}var i=this. -values.map(xn.prepareValue);r.native.query(this.text,i,t)}else r.native.query(this. -text,t)}});var Vs=I((Ef,$s)=>{"use strict";p();var Rc=(Ns(),O(Os)),Fc=wt(),xf=qs(),Hs=ge(). -EventEmitter,Mc=(Ge(),O(He)),Dc=bt(),Gs=Ws(),J=$s.exports=function(r){Hs.call(this), -r=r||{},this._Promise=r.Promise||S.Promise,this._types=new Fc(r.types),this.native= -new Rc({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting= -!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Dc( +values.map(Sn.prepareValue);r.native.query(this.text,i,t)}else r.native.query(this. +text,t)}});var Ks=I((Af,Vs)=>{"use strict";d();var Mc=(qs(),U(Us)),kc=gt(),Ef=Ns(),Gs=we(). +EventEmitter,Oc=(He(),U(je)),Qc=wt(),$s=Hs(),J=Vs.exports=function(r){Gs.call(this), +r=r||{},this._Promise=r.Promise||b.Promise,this._types=new kc(r.types),this.native= +new Mc({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting= +!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Qc( r);this.user=e.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, writable:!0,value:e.password}),this.database=e.database,this.host=e.host,this.port= -e.port,this.namedQueries={}};J.Query=Gs;Mc.inherits(J,Hs);J.prototype._errorAllQueries= +e.port,this.namedQueries={}};J.Query=$s;Oc.inherits(J,Gs);J.prototype._errorAllQueries= function(r){let e=a(t=>{m.nextTick(()=>{t.native=this.native,t.handleError(r)})}, "enqueueError");this._hasActiveQuery()&&(e(this._activeQuery),this._activeQuery= null),this._queryQueue.forEach(e),this._queryQueue.length=0};J.prototype._connect= @@ -1481,11 +1485,11 @@ prototype.connect=function(r){if(r){this._connect(r);return}return new this._Pro i,s,o,u;if(r==null)throw new TypeError("Client was passed a null or undefined qu\ ery");if(typeof r.submit=="function")s=r.query_timeout||this.connectionParameters. query_timeout,i=n=r,typeof e=="function"&&(r.callback=e);else if(s=this.connectionParameters. -query_timeout,n=new Gs(r,e,t),!n.callback){let c,h;i=new this._Promise((l,d)=>{c= -l,h=d}),n.callback=(l,d)=>l?h(l):c(d)}return s&&(u=n.callback,o=setTimeout(()=>{ +query_timeout,n=new $s(r,e,t),!n.callback){let c,l;i=new this._Promise((h,p)=>{c= +h,l=p}),n.callback=(h,p)=>h?l(h):c(p)}return s&&(u=n.callback,o=setTimeout(()=>{ var c=new Error("Query read timeout");m.nextTick(()=>{n.handleError(c,this.connection)}), -u(c),n.callback=()=>{};var h=this._queryQueue.indexOf(n);h>-1&&this._queryQueue. -splice(h,1),this._pulseQueryQueue()},s),n.callback=(c,h)=>{clearTimeout(o),u(c,h)}), +u(c),n.callback=()=>{};var l=this._queryQueue.indexOf(n);l>-1&&this._queryQueue. +splice(l,1),this._pulseQueryQueue()},s),n.callback=(c,l)=>{clearTimeout(o),u(c,l)}), this._queryable?this._ending?(n.native=this.native,m.nextTick(()=>{n.handleError( new Error("Client was closed and is not queryable"))}),i):(this._queryQueue.push( n),this._pulseQueryQueue(),i):(n.native=this.native,m.nextTick(()=>{n.handleError( @@ -1503,73 +1507,73 @@ _activeQuery===r?this.native.cancel(function(){}):this._queryQueue.indexOf(r)!== -1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};J.prototype.ref=function(){}; J.prototype.unref=function(){};J.prototype.setTypeParser=function(r,e,t){return this. _types.setTypeParser(r,e,t)};J.prototype.getTypeParser=function(r,e){return this. -_types.getTypeParser(r,e)}});var En=I((Af,Ks)=>{"use strict";p();Ks.exports=Vs()});var It=I((Tf,nt)=>{"use strict";p();var kc=Fs(),Uc=et(),Oc=pn(),Nc=Us(),{DatabaseError:qc}=hn(), -Qc=a(r=>{var e;return e=class extends Nc{constructor(n){super(n,r)}},a(e,"BoundP\ +_types.getTypeParser(r,e)}});var xn=I((Tf,zs)=>{"use strict";d();zs.exports=Ks()});var Tt=I((Rf,rt)=>{"use strict";d();var Dc=Ms(),Uc=Xe(),qc=fn(),Nc=Ds(),{DatabaseError:Wc}=cn(), +jc=a(r=>{var e;return e=class extends Nc{constructor(n){super(n,r)}},a(e,"BoundP\ ool"),e},"poolFactory"),vn=a(function(r){this.defaults=Uc,this.Client=r,this.Query= -this.Client.Query,this.Pool=Qc(this.Client),this._pools=[],this.Connection=Oc,this. -types=Xe(),this.DatabaseError=qc},"PG");typeof m.env.NODE_PG_FORCE_NATIVE<"u"?nt. -exports=new vn(En()):(nt.exports=new vn(kc),Object.defineProperty(nt.exports,"na\ -tive",{configurable:!0,enumerable:!1,get(){var r=null;try{r=new vn(En())}catch(e){ -if(e.code!=="MODULE_NOT_FOUND")throw e}return Object.defineProperty(nt.exports,"\ -native",{value:r}),r}}))});p();var Bt=Te(It());St();p();St();mr();var Zs=Te(tt()),Js=Te(wt());function jc(r){return r instanceof y?"\\x"+r.toString("hex"):r}a(jc,"encodeBuffe\ -rsAsBytea");var Pt=class Pt extends Error{constructor(t){super(t);_(this,"name", -"NeonDbError");_(this,"severity");_(this,"code");_(this,"detail");_(this,"hint"); -_(this,"position");_(this,"internalPosition");_(this,"internalQuery");_(this,"wh\ -ere");_(this,"schema");_(this,"table");_(this,"column");_(this,"dataType");_(this, -"constraint");_(this,"file");_(this,"line");_(this,"routine");_(this,"sourceErro\ +this.Client.Query,this.Pool=jc(this.Client),this._pools=[],this.Connection=qc,this. +types=Je(),this.DatabaseError=Wc},"PG");typeof m.env.NODE_PG_FORCE_NATIVE<"u"?rt. +exports=new vn(xn()):(rt.exports=new vn(Dc),Object.defineProperty(rt.exports,"na\ +tive",{configurable:!0,enumerable:!1,get(){var r=null;try{r=new vn(xn())}catch(e){ +if(e.code!=="MODULE_NOT_FOUND")throw e}return Object.defineProperty(rt.exports,"\ +native",{value:r}),r}}))});d();var Rt=Te(Tt());bt();d();bt();yr();var Js=Te(et()),Xs=Te(gt());function Hc(r){return r instanceof y?"\\x"+r.toString("hex"):r}a(Hc,"encodeBuffe\ +rsAsBytea");var It=class It extends Error{constructor(t){super(t);A(this,"name", +"NeonDbError");A(this,"severity");A(this,"code");A(this,"detail");A(this,"hint"); +A(this,"position");A(this,"internalPosition");A(this,"internalQuery");A(this,"wh\ +ere");A(this,"schema");A(this,"table");A(this,"column");A(this,"dataType");A(this, +"constraint");A(this,"file");A(this,"line");A(this,"routine");A(this,"sourceErro\ r");"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error. -captureStackTrace(this,Pt)}};a(Pt,"NeonDbError");var pe=Pt,zs="transaction() exp\ -ects an array of queries, or a function returning an array of queries",Wc=["seve\ +captureStackTrace(this,It)}};a(It,"NeonDbError");var de=It,Ys="transaction() exp\ +ects an array of queries, or a function returning an array of queries",Gc=["seve\ rity","code","detail","hint","position","internalPosition","internalQuery","wher\ -e","schema","table","column","dataType","constraint","file","line","routine"];function Xs(r,{ +e","schema","table","column","dataType","constraint","file","line","routine"];function eo(r,{ arrayMode:e,fullResults:t,fetchOptions:n,isolationLevel:i,readOnly:s,deferrable:o, -queryCallback:u,resultCallback:c,authToken:h}={}){if(!r)throw new Error("No data\ +queryCallback:u,resultCallback:c,authToken:l}={}){if(!r)throw new Error("No data\ base connection string was provided to `neon()`. Perhaps an environment variable\ - has not been set?");let l;try{l=yr(r)}catch{throw new Error("Database connectio\ + has not been set?");let h;try{h=pr(r)}catch{throw new Error("Database connectio\ n string provided to `neon()` is not a valid URL. Connection string: "+String(r))} -let{protocol:d,username:b,hostname:C,port:B,pathname:Q}=l;if(d!=="postgres:"&&d!== -"postgresql:"||!b||!C||!Q)throw new Error("Database connection string format for\ - `neon()` should be: postgresql://user:password@host.tld/dbname?option=value");function X(A,...g){ -let P,K;if(typeof A=="string")P=A,K=g[1],g=g[0]??[];else{P="";for(let j=0;jjc((0,Zs.prepareValue)(j)));let k={ -query:P,params:g};return u&&u(k),Hc(de,k,K)}a(X,"resolve"),X.transaction=async(A,g)=>{ -if(typeof A=="function"&&(A=A(X)),!Array.isArray(A))throw new Error(zs);A.forEach( -k=>{if(k[Symbol.toStringTag]!=="NeonQueryPromise")throw new Error(zs)});let P=A. -map(k=>k.parameterizedQuery),K=A.map(k=>k.opts??{});return de(P,K,g)};async function de(A,g,P){ -let{fetchEndpoint:K,fetchFunction:k}=_e,j=Array.isArray(A)?{queries:A}:A,ee=n??{}, -oe=e??!1,R=t??!1,$=i,ce=s,ye=o;P!==void 0&&(P.fetchOptions!==void 0&&(ee={...ee, -...P.fetchOptions}),P.arrayMode!==void 0&&(oe=P.arrayMode),P.fullResults!==void 0&& -(R=P.fullResults),P.isolationLevel!==void 0&&($=P.isolationLevel),P.readOnly!==void 0&& -(ce=P.readOnly),P.deferrable!==void 0&&(ye=P.deferrable)),g!==void 0&&!Array.isArray( -g)&&g.fetchOptions!==void 0&&(ee={...ee,...g.fetchOptions});let Se=h;!Array.isArray( -g)&&g?.authToken!==void 0&&(Se=g.authToken);let je=typeof K=="function"?K(C,B,{jwtAuth:Se!== -void 0}):K,he={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"true","Neon-Ar\ -ray-Mode":"true"},it=await Gc(Se);it&&(he.Authorization=`Bearer ${it}`),Array.isArray( -A)&&($!==void 0&&(he["Neon-Batch-Isolation-Level"]=$),ce!==void 0&&(he["Neon-Bat\ -ch-Read-Only"]=String(ce)),ye!==void 0&&(he["Neon-Batch-Deferrable"]=String(ye))); -let te;try{te=await(k??fetch)(je,{method:"POST",body:JSON.stringify(j),headers:he, -...ee})}catch(W){let H=new pe(`Error connecting to database: ${W.message}`);throw H. -sourceError=W,H}if(te.ok){let W=await te.json();if(Array.isArray(A)){let H=W.results; -if(!Array.isArray(H))throw new pe("Neon internal error: unexpected result format"); -return H.map((Ae,xe)=>{let Lt=g[xe]??{},ro=Lt.arrayMode??oe,no=Lt.fullResults??R; -return Ys(Ae,{arrayMode:ro,fullResults:no,parameterizedQuery:A[xe],resultCallback:c, -types:Lt.types})})}else{let H=g??{},Ae=H.arrayMode??oe,xe=H.fullResults??R;return Ys( -W,{arrayMode:Ae,fullResults:xe,parameterizedQuery:A,resultCallback:c,types:H.types})}}else{ -let{status:W}=te;if(W===400){let H=await te.json(),Ae=new pe(H.message);for(let xe of Wc) -Ae[xe]=H[xe]??void 0;throw Ae}else{let H=await te.text();throw new pe(`Server er\ -ror (HTTP status ${W}): ${H}`)}}}return a(de,"execute"),X}a(Xs,"neon");function Hc(r,e,t){ -return{[Symbol.toStringTag]:"NeonQueryPromise",parameterizedQuery:e,opts:t,then:a( -(n,i)=>r(e,t).then(n,i),"then"),catch:a(n=>r(e,t).catch(n),"catch"),finally:a(n=>r( -e,t).finally(n),"finally")}}a(Hc,"createNeonQueryPromise");function Ys(r,{arrayMode:e, -fullResults:t,parameterizedQuery:n,resultCallback:i,types:s}){let o=new Js.default( -s),u=r.fields.map(l=>l.name),c=r.fields.map(l=>o.getTypeParser(l.dataTypeID)),h=e=== -!0?r.rows.map(l=>l.map((d,b)=>d===null?null:c[b](d))):r.rows.map(l=>Object.fromEntries( -l.map((d,b)=>[u[b],d===null?null:c[b](d)])));return i&&i(n,r,h,{arrayMode:e,fullResults:t}), -t?(r.viaNeonFetch=!0,r.rowAsArray=e,r.rows=h,r._parsers=c,r._types=o,r):h}a(Ys,"\ -processQueryResult");async function Gc(r){if(typeof r=="string")return r;if(typeof r== -"function")try{return await Promise.resolve(r())}catch(e){let t=new pe("Error ge\ -tting auth token.");throw e instanceof Error&&(t=new pe(`Error getting auth toke\ -n: ${e.message}`)),t}}a(Gc,"getAuthToken");var to=Te(bt()),Qe=Te(It());var An=class An extends Bt.Client{constructor(t){super(t);this.config=t}get neonConfig(){ +let{protocol:p,username:S,hostname:_,port:P,pathname:G}=h;if(p!=="postgres:"&&p!== +"postgresql:"||!S||!_||!G)throw new Error("Database connection string format for\ + `neon()` should be: postgresql://user:password@host.tld/dbname?option=value");function X(C,...g){ +let R,W;if(typeof C=="string")R=C,W=g[1],g=g[0]??[];else{R="";for(let j=0;jHc((0,Js.prepareValue)(j)));let Q={ +query:R,params:g};return u&&u(Q),$c(se,Q,W)}a(X,"resolve"),X.transaction=async(C,g)=>{ +if(typeof C=="function"&&(C=C(X)),!Array.isArray(C))throw new Error(Ys);C.forEach( +Q=>{if(Q[Symbol.toStringTag]!=="NeonQueryPromise")throw new Error(Ys)});let R=C. +map(Q=>Q.parameterizedQuery),W=C.map(Q=>Q.opts??{});return se(R,W,g)};async function se(C,g,R){ +let{fetchEndpoint:W,fetchFunction:Q}=_e,j=Array.isArray(C)?{queries:C}:C,ee=n??{}, +oe=e??!1,L=t??!1,$=i,ce=s,pe=o;R!==void 0&&(R.fetchOptions!==void 0&&(ee={...ee, +...R.fetchOptions}),R.arrayMode!==void 0&&(oe=R.arrayMode),R.fullResults!==void 0&& +(L=R.fullResults),R.isolationLevel!==void 0&&($=R.isolationLevel),R.readOnly!==void 0&& +(ce=R.readOnly),R.deferrable!==void 0&&(pe=R.deferrable)),g!==void 0&&!Array.isArray( +g)&&g.fetchOptions!==void 0&&(ee={...ee,...g.fetchOptions});let xe=l;!Array.isArray( +g)&&g?.authToken!==void 0&&(xe=g.authToken);let Ne=typeof W=="function"?W(_,P,{jwtAuth:xe!== +void 0}):W,le={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"true","Neon-Ar\ +ray-Mode":"true"},nt=await Vc(xe);nt&&(le.Authorization=`Bearer ${nt}`),Array.isArray( +C)&&($!==void 0&&(le["Neon-Batch-Isolation-Level"]=$),ce!==void 0&&(le["Neon-Bat\ +ch-Read-Only"]=String(ce)),pe!==void 0&&(le["Neon-Batch-Deferrable"]=String(pe))); +let ye;try{ye=await(Q??fetch)(Ne,{method:"POST",body:JSON.stringify(j),headers:le, +...ee})}catch(K){let O=new de(`Error connecting to database: ${K}`);throw O.sourceError= +K,O}if(ye.ok){let K=await ye.json();if(Array.isArray(C)){let O=K.results;if(!Array. +isArray(O))throw new de("Neon internal error: unexpected result format");return O. +map((me,ve)=>{let Pt=g[ve]??{},no=Pt.arrayMode??oe,io=Pt.fullResults??L;return Zs( +me,{arrayMode:no,fullResults:io,parameterizedQuery:C[ve],resultCallback:c,types:Pt. +types})})}else{let O=g??{},me=O.arrayMode??oe,ve=O.fullResults??L;return Zs(K,{arrayMode:me, +fullResults:ve,parameterizedQuery:C,resultCallback:c,types:O.types})}}else{let{status:K}=ye; +if(K===400){let O=await ye.json(),me=new de(O.message);for(let ve of Gc)me[ve]=O[ve]?? +void 0;throw me}else{let O=await ye.text();throw new de(`Server error (HTTP stat\ +us ${K}): ${O}`)}}}return a(se,"execute"),X}a(eo,"neon");function $c(r,e,t){return{ +[Symbol.toStringTag]:"NeonQueryPromise",parameterizedQuery:e,opts:t,then:a((n,i)=>r( +e,t).then(n,i),"then"),catch:a(n=>r(e,t).catch(n),"catch"),finally:a(n=>r(e,t).finally( +n),"finally")}}a($c,"createNeonQueryPromise");function Zs(r,{arrayMode:e,fullResults:t, +parameterizedQuery:n,resultCallback:i,types:s}){let o=new Xs.default(s),u=r.fields. +map(h=>h.name),c=r.fields.map(h=>o.getTypeParser(h.dataTypeID)),l=e===!0?r.rows. +map(h=>h.map((p,S)=>p===null?null:c[S](p))):r.rows.map(h=>Object.fromEntries(h.map( +(p,S)=>[u[S],p===null?null:c[S](p)])));return i&&i(n,r,l,{arrayMode:e,fullResults:t}), +t?(r.viaNeonFetch=!0,r.rowAsArray=e,r.rows=l,r._parsers=c,r._types=o,r):l}a(Zs,"\ +processQueryResult");async function Vc(r){if(typeof r=="string")return r;if(typeof r== +"function")try{return await Promise.resolve(r())}catch(e){let t=new de("Error ge\ +tting auth token.");throw e instanceof Error&&(t=new de(`Error getting auth toke\ +n: ${e.message}`)),t}}a(Vc,"getAuthToken");var ro=Te(wt()),Cn=Te(Tt());var An=class An extends Rt.Client{constructor(t){super(t);this.config=t}get neonConfig(){ return this.connection.stream}connect(t){let{neonConfig:n}=this;n.forceDisablePgSSL&& (this.ssl=this.connection.ssl=!1),this.ssl&&n.useSecureWebSocket&&console.warn("\ SSL is enabled for both Postgres (e.g. ?sslmode=require in the connection string\ @@ -1583,55 +1587,54 @@ ase host or connection string was set, and key parameters have default values (h ost: localhost, user: ${s}, db: ${s}, password: null). Is an environment variabl\ e missing? Alternatively, if you intended to connect with these parameters, plea\ se set the host to 'localhost' explicitly.`);let o=super.connect(t),u=n.pipelineTLS&& -this.ssl,c=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let h=this. -connection;if(u&&h.on("connect",()=>h.stream.emit("data","S")),c){h.removeAllListeners( -"authenticationCleartextPassword"),h.removeAllListeners("readyForQuery"),h.once( -"readyForQuery",()=>h.on("readyForQuery",this._handleReadyForQuery.bind(this))); -let l=this.ssl?"sslconnect":"connect";h.on(l,()=>{this._handleAuthCleartextPassword(), -this._handleReadyForQuery()})}return o}async _handleAuthSASLContinue(t){let n=this. -saslSession,i=this.password,s=t.data;if(n.message!=="SASLInitialResponse"||typeof i!= -"string"||typeof s!="string")throw new Error("SASL: protocol error");let o=Object. -fromEntries(s.split(",").map(te=>{if(!/^.=/.test(te))throw new Error("SASL: Inva\ -lid attribute pair entry");let W=te[0],H=te.substring(2);return[W,H]})),u=o.r,c=o. -s,h=o.i;if(!u||!/^[!-+--~]+$/.test(u))throw new Error("SASL: SCRAM-SERVER-FIRST-\ -MESSAGE: nonce missing/unprintable");if(!c||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base\ +this.ssl,c=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let l=this. +connection;if(u&&l.on("connect",()=>l.stream.emit("data","S")),c){l.removeAllListeners( +"authenticationCleartextPassword"),l.removeAllListeners("readyForQuery"),l.once( +"readyForQuery",()=>l.on("readyForQuery",this._handleReadyForQuery.bind(this))); +let h=this.ssl?"sslconnect":"connect";l.on(h,()=>{this._handleAuthCleartextPassword(), +this._handleReadyForQuery()})}return o}async _handleAuthSASLContinue(t){if(typeof w> +"u"||w.subtle===void 0||w.subtle.importKey===void 0)throw new Error("Cannot use \ +SASL auth when `crypto.subtle` is not defined");let n=w.subtle,i=this.saslSession, +s=this.password,o=t.data;if(i.message!=="SASLInitialResponse"||typeof s!="string"|| +typeof o!="string")throw new Error("SASL: protocol error");let u=Object.fromEntries( +o.split(",").map(K=>{if(!/^.=/.test(K))throw new Error("SASL: Invalid attribute \ +pair entry");let O=K[0],me=K.substring(2);return[O,me]})),c=u.r,l=u.s,h=u.i;if(!c|| +!/^[!-+--~]+$/.test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce \ +missing/unprintable");if(!l||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(l))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base\ 64");if(!h||!/^[1-9][0-9]*$/.test(h))throw new Error("SASL: SCRAM-SERVER-FIRST-M\ -ESSAGE: missing/invalid iteration count");if(!u.startsWith(n.clientNonce))throw new Error( +ESSAGE: missing/invalid iteration count");if(!c.startsWith(i.clientNonce))throw new Error( "SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce"); -if(u.length===n.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MES\ -SAGE: server nonce is too short");let l=parseInt(h,10),d=y.from(c,"base64"),b=new TextEncoder, -C=b.encode(i),B=await w.subtle.importKey("raw",C,{name:"HMAC",hash:{name:"SHA-25\ -6"}},!1,["sign"]),Q=new Uint8Array(await w.subtle.sign("HMAC",B,y.concat([d,y.from( -[0,0,0,1])]))),X=Q;for(var de=0;deX[W]^Q[W]));let A=X,g=await w.subtle.importKey( -"raw",A,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),P=new Uint8Array(await w. -subtle.sign("HMAC",g,b.encode("Client Key"))),K=await w.subtle.digest("SHA-256", -P),k="n=*,r="+n.clientNonce,j="r="+u+",s="+c+",i="+l,ee="c=biws,r="+u,oe=k+","+j+ -","+ee,R=await w.subtle.importKey("raw",K,{name:"HMAC",hash:{name:"SHA-256"}},!1, -["sign"]);var $=new Uint8Array(await w.subtle.sign("HMAC",R,b.encode(oe))),ce=y. -from(P.map((te,W)=>P[W]^$[W])),ye=ce.toString("base64");let Se=await w.subtle.importKey( -"raw",A,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),je=await w.subtle.sign( -"HMAC",Se,b.encode("Server Key")),he=await w.subtle.importKey("raw",je,{name:"HM\ -AC",hash:{name:"SHA-256"}},!1,["sign"]);var it=y.from(await w.subtle.sign("HMAC", -he,b.encode(oe)));n.message="SASLResponse",n.serverSignature=it.toString("base64"), -n.response=ee+",p="+ye,this.connection.sendSCRAMClientFinalMessage(this.saslSession. -response)}};a(An,"NeonClient");var _n=An;function $c(r,e){if(e)return{callback:e, +if(c.length===i.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MES\ +SAGE: server nonce is too short");let p=parseInt(h,10),S=y.from(l,"base64"),_=new TextEncoder, +P=_.encode(s),G=await n.importKey("raw",P,{name:"HMAC",hash:{name:"SHA-256"}},!1, +["sign"]),X=new Uint8Array(await n.sign("HMAC",G,y.concat([S,y.from([0,0,0,1])]))), +se=X;for(var C=0;Cse[O]^X[O]));let g=se,R=await n.importKey("raw",g,{name:"HMAC",hash:{ +name:"SHA-256"}},!1,["sign"]),W=new Uint8Array(await n.sign("HMAC",R,_.encode("C\ +lient Key"))),Q=await n.digest("SHA-256",W),j="n=*,r="+i.clientNonce,ee="r="+c+"\ +,s="+l+",i="+p,oe="c=biws,r="+c,L=j+","+ee+","+oe,$=await n.importKey("raw",Q,{name:"\ +HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var ce=new Uint8Array(await n.sign("HM\ +AC",$,_.encode(L))),pe=y.from(W.map((K,O)=>W[O]^ce[O])),xe=pe.toString("base64"); +let Ne=await n.importKey("raw",g,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]), +le=await n.sign("HMAC",Ne,_.encode("Server Key")),nt=await n.importKey("raw",le, +{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var ye=y.from(await n.sign("HMA\ +C",nt,_.encode(L)));i.message="SASLResponse",i.serverSignature=ye.toString("base\ +64"),i.response=oe+",p="+xe,this.connection.sendSCRAMClientFinalMessage(this.saslSession. +response)}};a(An,"NeonClient");var En=An;function Kc(r,e){if(e)return{callback:e, result:void 0};let t,n,i=a(function(o,u){o?t(o):n(u)},"cb"),s=new r(function(o,u){ -n=o,t=u});return{callback:i,result:s}}a($c,"promisify");var Cn=class Cn extends Bt.Pool{constructor(){ -super(...arguments);_(this,"Client",_n);_(this,"hasFetchUnsupportedListeners",!1)}on(t,n){ -return t!=="error"&&(this.hasFetchUnsupportedListeners=!0),super.on(t,n)}query(t,n,i){ -if(!_e.poolQueryViaFetch||this.hasFetchUnsupportedListeners||typeof t=="function") -return super.query(t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=$c(this.Promise, -i);i=s.callback;try{let o=new to.default(this.options),u=encodeURIComponent,c=encodeURI, -h=`postgresql://${u(o.user)}:${u(o.password)}@${u(o.host)}/${c(o.database)}`,l=typeof t== -"string"?t:t.text,d=n??t.values??[];Xs(h,{fullResults:!0,arrayMode:t.rowMode==="\ -array"})(l,d,{types:t.types??this.options?.types}).then(C=>i(void 0,C)).catch(C=>i( -C))}catch(o){i(o)}return s.result}};a(Cn,"NeonPool");var eo=Cn;var export_ClientBase=Qe.ClientBase;var export_Connection=Qe.Connection;var export_DatabaseError=Qe.DatabaseError; -var export_Query=Qe.Query;var export_defaults=Qe.defaults;var export_types=Qe.types; -export{_n as Client,export_ClientBase as ClientBase,export_Connection as Connection, -export_DatabaseError as DatabaseError,pe as NeonDbError,eo as Pool,export_Query as Query, -export_defaults as defaults,Xs as neon,_e as neonConfig,export_types as types}; +n=o,t=u});return{callback:i,result:s}}a(Kc,"promisify");var _n=class _n extends Rt.Pool{constructor(){ +super(...arguments);A(this,"Client",En);A(this,"hasFetchUnsupportedListeners",!1); +A(this,"addListener",this.on)}on(t,n){return t!=="error"&&(this.hasFetchUnsupportedListeners= +!0),super.on(t,n)}query(t,n,i){if(!_e.poolQueryViaFetch||this.hasFetchUnsupportedListeners|| +typeof t=="function")return super.query(t,n,i);typeof n=="function"&&(i=n,n=void 0); +let s=Kc(this.Promise,i);i=s.callback;try{let o=new ro.default(this.options),u=encodeURIComponent, +c=encodeURI,l=`postgresql://${u(o.user)}:${u(o.password)}@${u(o.host)}/${c(o.database)}`, +h=typeof t=="string"?t:t.text,p=n??t.values??[];eo(l,{fullResults:!0,arrayMode:t. +rowMode==="array"})(h,p,{types:t.types??this.options?.types}).then(_=>i(void 0,_)). +catch(_=>i(_))}catch(o){i(o)}return s.result}};a(_n,"NeonPool");var to=_n;var qf="mjs";var export_ClientBase=Cn.ClientBase;var export_defaults=Cn.defaults;var export_types=Cn.types; +export{En as Client,export_ClientBase as ClientBase,de as NeonDbError,to as Pool, +qf as _bundleExt,export_defaults as defaults,eo as neon,_e as neonConfig,export_types as types}; /*! Bundled license information: ieee754/index.js: diff --git a/dist/npm/README.md b/dist/npm/README.md index e361b09..5da601c 100644 --- a/dist/npm/README.md +++ b/dist/npm/README.md @@ -196,22 +196,25 @@ export default async (req: Request, ctx: any) => { // create a `Pool` inside the request handler const pool = new Pool({ connectionString: process.env.DATABASE_URL }); - // get and validate the `postId` query parameter - const postId = parseInt(new URL(req.url).searchParams.get('postId'), 10); - if (isNaN(postId)) return new Response('Bad request', { status: 400 }); - - // query and validate the post - const [post] = await pool.query('SELECT * FROM posts WHERE id = $1', [postId]); - if (!post) return new Response('Not found', { status: 404 }); - - // end the `Pool` inside the same request handler - // (unlike `await`, `ctx.waitUntil` won't hold up the response) - ctx.waitUntil(pool.end()); - - // return the post as JSON - return new Response(JSON.stringify(post), { - headers: { 'content-type': 'application/json' } - }); + try { + // get and validate the `postId` query parameter + const postId = parseInt(new URL(req.url).searchParams.get('postId'), 10); + if (isNaN(postId)) return new Response('Bad request', { status: 400 }); + + // query and validate the post + const { rows: [post] } = await pool.query('SELECT * FROM posts WHERE id = $1', [postId]); + if (!post) return new Response('Not found', { status: 404 }); + + // return the post as JSON + return new Response(JSON.stringify(post), { + headers: { 'content-type': 'application/json' } + }); + + } finally { + // end the `Pool` inside the same request handler + // (unlike `await`, `ctx.waitUntil` won't hold up the response) + ctx.waitUntil(pool.end()); + } } export const config = { @@ -236,22 +239,25 @@ export default async (req: Request, ctx: any) => { const client = new Client(process.env.DATABASE_URL); await client.connect(); - // get and validate the `postId` query parameter - const postId = parseInt(new URL(req.url).searchParams.get('postId'), 10); - if (isNaN(postId)) return new Response('Bad request', { status: 400 }); - - // query and validate the post - const [post] = await client.query('SELECT * FROM posts WHERE id = $1', [postId]); - if (!post) return new Response('Not found', { status: 404 }); - - // end the `Client` inside the same request handler - // (unlike `await`, `ctx.waitUntil` won't hold up the response) - ctx.waitUntil(client.end()); - - // return the post as JSON - return new Response(JSON.stringify(post), { - headers: { 'content-type': 'application/json' } - }); + try { + // get and validate the `postId` query parameter + const postId = parseInt(new URL(req.url).searchParams.get('postId'), 10); + if (isNaN(postId)) return new Response('Bad request', { status: 400 }); + + // query and validate the post + const { rows: [post] } = await client.query('SELECT * FROM posts WHERE id = $1', [postId]); + if (!post) return new Response('Not found', { status: 404 }); + + // return the post as JSON + return new Response(JSON.stringify(post), { + headers: { 'content-type': 'application/json' } + }); + + } finally { + // end the `Client` inside the same request handler + // (unlike `await`, `ctx.waitUntil` won't hold up the response) + ctx.waitUntil(client.end()); + } } export const config = { diff --git a/dist/npm/index.d.mts b/dist/npm/index.d.mts index 6c98c62..82e9d68 100644 --- a/dist/npm/index.d.mts +++ b/dist/npm/index.d.mts @@ -1,393 +1,335 @@ +/// + +import { BindConfig } from 'pg'; +import { Client as Client_2 } from 'pg'; +import { ClientBase } from 'pg'; +import { ClientConfig } from 'pg'; +import { Connection } from 'pg'; +import { ConnectionConfig } from 'pg'; +import { CustomTypesConfig } from 'pg'; +import { Defaults } from 'pg'; +import { defaults } from 'pg'; +import { EventEmitter } from 'events'; +import { Events } from 'pg'; +import { ExecuteConfig } from 'pg'; +import { FieldDef } from 'pg'; +import { MessageConfig } from 'pg'; +import { Notification } from 'pg'; +import { Pool as Pool_2 } from 'pg'; +import { PoolConfig } from 'pg'; +import { Query } from 'pg'; +import { QueryArrayConfig } from 'pg'; +import { QueryArrayResult } from 'pg'; +import { QueryConfig } from 'pg'; +import type { QueryConfigValues } from 'pg'; +import { QueryParse } from 'pg'; +import { QueryResult } from 'pg'; +import { QueryResultBase } from 'pg'; +import { QueryResultRow } from 'pg'; +import { ResultBuilder } from 'pg'; +import type { Socket } from 'net'; +import { Submittable } from 'pg'; +import { types } from 'pg'; + +declare const allKeyUsages: readonly ["digitalSignature", "nonRepudiation", "keyEncipherment", "dataEncipherment", "keyAgreement", "keyCertSign", "cRLSign", "encipherOnly", "decipherOnly"]; + +declare class ASN1Bytes extends Bytes { + readASN1Length(comment?: string): number; + expectASN1Length(comment?: string): readonly [() => void, () => number]; + readASN1OID(comment?: string): string; + readASN1Boolean(comment?: string): boolean; + readASN1UTCTime(): Date; + readASN1GeneralizedTime(): Date; + readASN1BitString(): Uint8Array; +} -// DON'T EDIT THIS FILE -// It's a simple automatic copy of index.d.ts - - -// @neondatabase/serverless driver types, mimicking pg - -export { - BindConfig, ClientConfig, Connection, ConnectionConfig, CustomTypesConfig, Defaults, defaults, Events, ExecuteConfig, FieldDef, MessageConfig, native, Notification, PoolConfig, Query, QueryArrayConfig, QueryArrayResult, QueryConfig, QueryParse, QueryResult, QueryResultBase, - QueryResultRow, ResultBuilder, Submittable, types -} from "pg"; -export { DatabaseError } from "pg-protocol"; +declare function base64Decode(input: string, charCodes?: typeof stdCharCodes, autoPad?: boolean): Uint8Array; + +export { BindConfig } + +export declare const _bundleExt: 'js' | 'mjs'; + +declare class Bytes { + offset: number; + dataView: DataView; + data: Uint8Array; + comments: Record; + indents: Record; + indent: number; + constructor(arrayOrMaxBytes: number | Uint8Array); + extend(arrayOrMaxBytes: number | Uint8Array): void; + remaining(): number; + subarray(length: number): Uint8Array; + skip(length: number, comment?: string): this; + comment(s: string, offset?: number): this; + lengthComment(length: number, comment?: string, inclusive?: boolean): string; + readBytes(length: number): Uint8Array; + readUTF8String(length: number): string; + readUTF8StringNullTerminated(): string; + readUint8(comment?: string): number; + readUint16(comment?: string): number; + readUint24(comment?: string): number; + readUint32(comment?: string): number; + expectBytes(expected: Uint8Array | number[], comment?: string): void; + expectUint8(expectedValue: number, comment?: string): void; + expectUint16(expectedValue: number, comment?: string): void; + expectUint24(expectedValue: number, comment?: string): void; + expectUint32(expectedValue: number, comment?: string): void; + expectLength(length: number, indentDelta?: number): readonly [() => void, () => number]; + expectLengthUint8(comment?: string): readonly [() => void, () => number]; + expectLengthUint16(comment?: string): readonly [() => void, () => number]; + expectLengthUint24(comment?: string): readonly [() => void, () => number]; + expectLengthUint32(comment?: string): readonly [() => void, () => number]; + expectLengthUint8Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint16Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint24Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint32Incl(comment?: string): readonly [() => void, () => number]; + writeBytes(bytes: number[] | Uint8Array): this; + writeUTF8String(s: string): this; + writeUTF8StringNullTerminated(s: string): this; + writeUint8(value: number, comment?: string): Bytes; + writeUint16(value: number, comment?: string): Bytes; + writeUint24(value: number, comment?: string): Bytes; + writeUint32(value: number, comment?: string): Bytes; + _writeLengthGeneric(lengthBytes: 1 | 2 | 3 | 4, inclusive: boolean, comment?: string): () => void; + writeLengthUint8(comment?: string): () => void; + writeLengthUint16(comment?: string): () => void; + writeLengthUint24(comment?: string): () => void; + writeLengthUint32(comment?: string): () => void; + writeLengthUint8Incl(comment?: string): () => void; + writeLengthUint16Incl(comment?: string): () => void; + writeLengthUint24Incl(comment?: string): () => void; + writeLengthUint32Incl(comment?: string): () => void; + array(): Uint8Array; + commentedString(all?: boolean): string; +} -interface FetchEndpointOptions { - jwtAuth?: boolean; +declare class Cert { + serialNumber: Uint8Array; + algorithm: OID; + issuer: DistinguishedName; + validityPeriod: { + notBefore: Date; + notAfter: Date; + }; + subject: DistinguishedName; + publicKey: { + identifiers: OID[]; + data: Uint8Array; + all: Uint8Array; + }; + signature: Uint8Array; + keyUsage?: { + critical?: boolean; + usages: Set; + }; + subjectAltNames?: string[]; + extKeyUsage?: { + clientTls?: true; + serverTls?: true; + }; + authorityKeyIdentifier?: Uint8Array; + subjectKeyIdentifier?: Uint8Array; + basicConstraints?: { + critical?: boolean; + ca?: boolean; + pathLength?: number; + } | undefined; + signedData: Uint8Array; + static distinguishedNamesAreEqual(dn1: DistinguishedName, dn2: DistinguishedName): boolean; + static stringFromDistinguishedName(dn: DistinguishedName): string; + constructor(certData: Uint8Array | ASN1Bytes | CertJSON); + subjectAltNameMatchingHost(host: string): string | undefined; + isValidAtMoment(moment?: Date): boolean; + description(): string; + toJSON(): { + serialNumber: string; + algorithm: string; + issuer: DistinguishedName; + validityPeriod: { + notBefore: string; + notAfter: string; + }; + subject: DistinguishedName; + publicKey: { + identifiers: string[]; + data: string; + all: string; + }; + signature: string; + keyUsage: { + critical: boolean | undefined; + usages: ("digitalSignature" | "nonRepudiation" | "keyEncipherment" | "dataEncipherment" | "keyAgreement" | "keyCertSign" | "cRLSign" | "encipherOnly" | "decipherOnly")[]; + }; + subjectAltNames: string[] | undefined; + extKeyUsage: { + clientTls?: true; + serverTls?: true; + } | undefined; + authorityKeyIdentifier: string | undefined; + subjectKeyIdentifier: string | undefined; + basicConstraints: { + critical?: boolean; + ca?: boolean; + pathLength?: number; + } | undefined; + signedData: string; + }; + static uint8ArraysFromPEM(pem: string): Uint8Array[]; + static fromPEM(pem: string): Cert[]; } -export interface NeonConfigGlobalOnly { - /** - * Set `fetchEndpoint` to set the server endpoint to be sent queries via http - * fetch. May be useful in local development (e.g. to set a port that's not - * the default 443). - * - * Provide either the full endpoint URL, or a function that takes the - * database host address and port and returns the full endpoint URL - * (including protocol). - * - * Default: `host => 'https://' + host + '/sql'` - * - */ - fetchEndpoint: string | ((host: string, port: number | string, options?: FetchEndpointOptions) => string); - - /** - * **Experimentally**, when `poolQueryViaFetch` is `true`, and no listeners - * for the `"connect"`, `"acquire"`, `"release"` or `"remove"` events are set - * on the `Pool`, queries via `Pool.query()` will be sent by low-latency HTTP - * fetch request. - * - * Default: `false`. - */ - poolQueryViaFetch: boolean; - - /** - * **DEPRECATED**. Previously, only when `fetchConnectionCache` was `true` - * did queries carried via HTTP fetch make use of a connection pool/cache - * on the server. All queries now use the connection pool/cache: this setting - * is ignored. - * - * Default: `true`. - */ - fetchConnectionCache: boolean; - - /** - * The `fetchFunction` option allows you to supply an alternative function - * for making http requests. The function must accept the same arguments as - * native `fetch`. - * - * Default: `undefined`. - */ - fetchFunction: any; +declare type CertJSON = ReturnType; + +export declare interface Client { + connection: Connection & { + stream: neonConfig; + sendSCRAMClientFinalMessage: (response: any) => void; + ssl: any; + }; + _handleReadyForQuery: any; + _handleAuthCleartextPassword: any; + startup: any; + getStartupConf: any; + saslSession: any; } -export interface NeonConfigGlobalAndClient { - /** - * If no global `WebSocket` object is available, set `webSocketConstructor` - * to the constructor for a custom WebSocket implementation, such as those - * provided by `ws` or `undici`. - */ - webSocketConstructor: any; - - /** - * Set `wsProxy` to use your own WebSocket proxy server. - * - * Provide either the proxy server’s domain name, or a function that takes - * the database host and port and returns the proxy server address (without - * protocol). - * - * Example: `(host, port) => "myproxy.example.net?address=" + host + ":" + port` - * - * Default: `host => host + '/v2'` - */ - wsProxy: string | ((host: string, port: number | string) => string) | undefined; - - /** - * Use a secure (`wss:`) connection to the WebSocket proxy. - * - * Default: `true`. - */ - useSecureWebSocket: boolean; - - /** - * Disable TLS encryption in the Postgres protocol (as set via e.g. - * `?sslmode=require` in the connection string). Connection remains secure - * if `useSecureWebSocket` is `true`. - * - * Default: `true` - */ - forceDisablePgSSL: boolean; - - /** - * Pipelines the startup message, cleartext password message and first query - * when set to `"password"`. This works only for cleartext password auth. - * - * Default: `"password"`. - */ - pipelineConnect: "password" | false; - - /** - * If `forceDisablePgSSL` is `false` and the Postgres connection parameters - * specify TLS, you must supply the subtls TLS library to this option: - * - * ``` - * import { neonConfig } from '@neondatabase/serverless'; - * import * as subtls from 'subtls'; - * neonConfig.subtls = subtls; - * ``` - * - * Default: `undefined`. - */ - subtls: any; - - /** - * Pipeline the pg SSL request and TLS handshake when `forceDisablePgSSL` is - * `false` and the Postgres connection parameters specify TLS. Currently - * compatible only with Neon hosts. - * - * Default: `false`. - */ - pipelineTLS: boolean; - - /** - * Set `rootCerts` to a string comprising one or more PEM files. These are - * the trusted root certificates for a TLS connection to Postgres when - * `forceDisablePgSSL` is `false` and the Postgres connection parameters - * specify TLS. - * - * Default: `""`. - */ - rootCerts: string; - - /** - * Batch multiple network writes per run-loop into a single outgoing - * WebSocket message. - * - * Default: `true`. - */ - coalesceWrites: boolean; - - /** - * When `disableSNI` is `true`, `forceDisablePgSSL` is `false` and the - * Postgres connection parameters specify TLS, we send no SNI data in the - * Postgres TLS handshake. - * - * On Neon, disabling SNI and including the Neon project name in the password - * avoids CPU-intensive SCRAM authentication, but this is only relevant for - * earlier iterations of Neon's WebSocket support. - * - * Default: `false`. - */ - disableSNI: boolean; +/** + * The node-postgres `Client` object re-exported with minor modifications. + * https://node-postgres.com/apis/client + */ +export declare class Client extends Client_2 { + config: any; + get neonConfig(): neonConfig; + constructor(config: any); + connect(): Promise; + connect(callback: (err?: Error) => void): void; + _handleAuthSASLContinue(msg: any): Promise; } -export interface NeonConfig extends NeonConfigGlobalOnly, NeonConfigGlobalAndClient { } +export { ClientBase } -import { - Client as PgClient, - ClientBase as PgClientBase, - Pool as PgPool, - PoolClient as PgPoolClient, - types as PgTypes -} from "pg"; +export { ClientConfig } -export class ClientBase extends PgClientBase { - neonConfig: NeonConfigGlobalAndClient; -} +export { Connection } -export class Client extends PgClient { - neonConfig: NeonConfigGlobalAndClient; -} +export { ConnectionConfig } -export interface PoolClient extends PgPoolClient { - neonConfig: NeonConfigGlobalAndClient; -} +export { CustomTypesConfig } -export class Pool extends PgPool { - connect(): Promise; - connect(callback: (err: Error, client: PoolClient, done: (release?: any) => void) => void): void; - on(event: 'error', listener: (err: Error, client: PoolClient) => void): this; - on(event: 'connect' | 'acquire' | 'remove', listener: (client: PoolClient) => void): this; +declare interface DataRequest { + bytes: number; + resolve: (data: Uint8Array | undefined) => void; } -export const neonConfig: NeonConfig; +export { Defaults } +export { defaults } -// SQL-over-HTTP +declare type DistinguishedName = Record; -import { FieldDef } from "pg"; +export { Events } -export type QueryRows = - ArrayMode extends true ? any[][] : Record[]; +export { ExecuteConfig } -export interface FullQueryResults { - fields: FieldDef[]; - command: string; - rowCount: number; - rows: QueryRows; - rowAsArray: ArrayMode; +export declare interface FetchEndpointOptions { + jwtAuth?: boolean; } -export interface ParameterizedQuery { - query: string; - params: any[]; -} - -export interface HTTPQueryOptions { - /** - * When `arrayMode` is `false`, which is the default, result rows are - * returned as objects whose keys represent column names, such as - * `{ id: 1 }`). - * - * When `arrayMode` is `true`, rows are returned as arrays (and keys are not - * provided), e.g. `[1]`. - */ - arrayMode?: ArrayMode; - /** - * When `fullResults` is `false`, which is the default, only result rows are - * returned, e.g. `[{ id: 1 }]`). - * - * When `fullResults` is `true`, a result object is returned that matches - * what's returned by node-postgres. This has a `rows` property, which is an - * array of result rows, plus `fields`, which provides column names and - * types, `command` and `rowCount`. - */ - fullResults?: FullResults; // default false - /** - * Any options in `fetchOptions` are merged in to the options passed to - * `fetch`. In case of conflict with what would otherwise be passed, these - * options take precedence. - */ - fetchOptions?: Record; - - /** - * JWT auth token to be passed as the Bearer token in the Authorization header - * - * Default: `undefined` - */ - authToken?: string | (() => Promise | string); - - /** - * Custom type parsers - * See https://github.com/brianc/node-pg-types - */ - types?: typeof PgTypes; -} - -export interface HTTPTransactionOptions extends HTTPQueryOptions { - /** - * Postgres transaction isolation level: see https://www.postgresql.org/docs/current/transaction-iso.html. - * Note that `ReadUncommitted` actually gets you `ReadCommitted` in Postgres. - * */ - isolationLevel?: 'ReadUncommitted' | 'ReadCommitted' | 'RepeatableRead' | 'Serializable'; - /** - * When `readOnly` is `false`, which is the default, a `READ WRITE` Postgres - * transaction is used. - * - * When `readOnly` is `true`, a `READ ONLY` Postgres transaction is used. - * */ - readOnly?: boolean; - /** - * When `deferrable` is `false`, which is the default, a `NOT DEFERRABLE` - * Postgres transaction is used. - * - * When `deferrable` is `true` (and `isolationLevel` is `Serializable` and - * `readOnly` is `true`), a `DEFERRABLE` Postgres transaction is used. - * */ - deferrable?: boolean; -} +export { FieldDef } -export interface NeonQueryPromise extends Promise { - parameterizedQuery: ParameterizedQuery; - opts?: HTTPQueryOptions; +export declare interface FullQueryResults { + fields: FieldDef[]; + command: string; + rowCount: number; + rows: QueryRows; + rowAsArray: ArrayMode; } -export interface NeonQueryInTransaction { - // this is a simplified form of query, which has only a `parameterizedQuery` (no `opts` and not a `Promise`) - parameterizedQuery: ParameterizedQuery; +declare function hexFromU8(u8: Uint8Array | number[], spacer?: string): string; + +export declare interface HTTPQueryOptions { + /** + * When `arrayMode` is `false`, which is the default, result rows are + * returned as objects whose keys represent column names, such as + * `{ id: 1 }`). + * + * When `arrayMode` is `true`, rows are returned as arrays (and keys are not + * provided), e.g. `[1]`. + */ + arrayMode?: ArrayMode; + /** + * When `fullResults` is `false`, which is the default, only result rows are + * returned, e.g. `[{ id: 1 }]`). + * + * When `fullResults` is `true`, a result object is returned that matches + * what's returned by node-postgres. This has a `rows` property, which is an + * array of result rows, plus `fields`, which provides column names and + * types, `command` and `rowCount`. + */ + fullResults?: FullResults; + /** + * Any options in `fetchOptions` are merged in to the options passed to + * `fetch`. In case of conflict with what would otherwise be passed, these + * options take precedence. + */ + fetchOptions?: Record; + /** + * JWT auth token to be passed as the Bearer token in the Authorization header. + * Can be string, or a function (sync or async) returning a string. + * + * Default: `undefined` + */ + authToken?: string | (() => Promise | string); + /** + * Custom type parsers. See https://github.com/brianc/node-pg-types. + */ + types?: typeof types; + queryCallback?: (query: ParameterizedQuery) => void; + resultCallback?: (query: ParameterizedQuery, result: any, rows: any, opts: any) => void; } -export interface NeonQueryFunctionInTransaction { - // this is a simplified form of NeonQueryFunction (below): - // * `opts` cannot be passed - // * no `transaction()` method is available - - // tagged-template function usage - (strings: TemplateStringsArray, ...params: any[]): - NeonQueryPromise : QueryRows>; - - // ordinary function usage (*no* options overrides) - (string: string, params?: any[]): - NeonQueryPromise : QueryRows>; +export declare interface HTTPTransactionOptions extends HTTPQueryOptions { + isolationLevel?: 'ReadUncommitted' | 'ReadCommitted' | 'RepeatableRead' | 'Serializable'; + readOnly?: boolean; + deferrable?: boolean; } -export interface NeonQueryFunction { - // tagged-template function usage - (strings: TemplateStringsArray, ...params: any[]): - NeonQueryPromise : QueryRows>; - - // ordinary function usage, with options overrides - ( - string: string, - params?: any[], - opts?: HTTPQueryOptions - ): NeonQueryPromise< - ArrayModeOverride, - FullResultsOverride, - FullResultsOverride extends true ? FullQueryResults : QueryRows - >; - - /** - * The `transaction()` function allows multiple queries to be submitted (over - * HTTP) as a single, non-interactive Postgres transaction. - * - * For example: - * ``` - * import { neon } from "@neondatabase/serverless"; - * const sql = neon("postgres://user:pass@host/db"); - * - * const results = await sql.transaction([ - * sql`SELECT 1 AS num`, - * sql`SELECT 'a' AS str`, - * ]); - * // -> [[{ num: 1 }], [{ str: "a" }]] - * - * // or equivalently: - * const results = await sql.transaction(txn => [ - * txn`SELECT 1 AS num`, - * txn`SELECT 'a' AS str`, - * ]); - * // -> [[{ num: 1 }], [{ str: "a" }]] - * ``` - * @param queriesOrFn Either an array of queries, or a (non-`async`) function - * that receives a query function and returns an array of queries. - * @param opts The same options that may be set on individual queries in a - * non-transaction setting -- that is, `arrayMode` `fullResults` and - * `fetchOptions` -- plus the transaction options `isolationLevel`, - * `readOnly` and `deferrable`. Note that none of these options can be set on - * individual queries within a transaction. - * @returns An array of results. The structure of each result object depends - * on the `arrayMode` and `fullResults` options. - */ - transaction: ( - queriesOrFn: NeonQueryPromise[] | // not ArrayModeOverride or FullResultsOverride: clamp these values to the current ones - ((sql: NeonQueryFunctionInTransaction) => NeonQueryInTransaction[]), - opts?: HTTPTransactionOptions - ) => Promise[] : QueryRows[]>; -} +export { MessageConfig } /** * This function returns an async tagged-template function that runs a single * SQL query (no session or transactions) with low latency over https. Support - * for multiple queries as a non-interactive transaction is provided by + * for multiple queries (as a non-interactive transaction) is provided by * the `transaction` property of the query function. - * + * * By default, the query function returns database rows directly. Types should * match those returned by this driver (i.e. Pool or Client) over WebSockets. - * - * The returned function can also be called directly (i.e. not as a template - * function). In that case, pass it a query string with embedded `$1`, `$2` + * + * The returned function can also be called directly (i.e. not as a template + * function). In that case, pass it a query string with embedded `$1`, `$2` * (etc.), followed by an array of query parameters, followed (optionally) by * any of the same options you can pass to this function. - * + * * Some examples: * ``` * import { neon } from "@neondatabase/serverless"; * const h = "hello", w = "world"; - * + * * // example 1: default options, tagged-template usage * const sql = neon("postgres://user:pass@host/db"); - * const rows = await sql`SELECT ${h} || ' ' || ${w} AS greeting`; + * const rows = await sql`SELECT ${h} || ' ' || ${w} AS greeting`; * // -> [ { greeting: "hello world" } ] - * + * * // example 2: `arrayMode` and `fullResults` options, ordinary function usage * const options = { arrayMode: true, fullResults: true }; * const sql = neon("postgres://user:pass@host/db", options); * const rows = await sql("SELECT $1 || ' ' || $2 AS greeting", [h, w]); - * // -> { - * // command: "SELECT", + * // -> { + * // command: "SELECT", * // fields: [ { name: "greeting", dataTypeID: 25 } ], - * // rowAsArray: true, - * // rowCount: 1, + * // rowAsArray: true, + * // rowCount: 1, * // rows: [ [ "hello world" ] ] * // } * @@ -399,39 +341,444 @@ export interface NeonQueryFunction [ { greeting: "hello world" } ] * ``` - * - * @param connectionString this has the format `postgres://user:pass@host/db` - * @param options pass `arrayMode: true` to receive results as an array of + * + * @param connectionString - this has the format `postgres://user:pass@host/db` + * @param options - pass `arrayMode: true` to receive results as an array of * arrays, instead of the default array of objects; pass `fullResults: true` * to receive a complete result object similar to one returned by node-postgres * (with properties `rows`, `fields`, `command`, `rowCount`, `rowAsArray`); * pass as `fetchOptions` an object which will be merged into the options * passed to `fetch`. */ -export function neon( - connectionString: string, - options?: HTTPTransactionOptions, -): NeonQueryFunction; - -export class NeonDbError extends Error { - name: 'NeonDbError'; - - severity: string | undefined; - code: string | undefined; - detail: string | undefined; - hint: string | undefined; - position: string | undefined; - internalPosition: string | undefined; - internalQuery: string | undefined; - where: string | undefined; - schema: string | undefined; - table: string | undefined; - column: string | undefined; - dataType: string | undefined; - constraint: string | undefined; - file: string | undefined; - line: string | undefined; - routine: string | undefined; - - sourceError: Error | undefined; +export declare function neon(connectionString: string, { arrayMode: neonOptArrayMode, fullResults: neonOptFullResults, fetchOptions: neonOptFetchOptions, isolationLevel: neonOptIsolationLevel, readOnly: neonOptReadOnly, deferrable: neonOptDeferrable, queryCallback, resultCallback, authToken, }?: HTTPTransactionOptions): NeonQueryFunction; + +export declare class neonConfig extends EventEmitter { + static defaults: SocketDefaults; + static opts: Partial; + /** + * **Experimentally**, when `poolQueryViaFetch` is `true`, and no listeners + * for the `"connect"`, `"acquire"`, `"release"` or `"remove"` events are set + * on the `Pool`, queries via `Pool.query()` will be sent by low-latency HTTP + * fetch request. + * + * Default: `false`. + */ + static get poolQueryViaFetch(): SocketDefaults["poolQueryViaFetch"]; + static set poolQueryViaFetch(newValue: SocketDefaults['poolQueryViaFetch']); + /** + * Set `fetchEndpoint` to set the server endpoint to be sent queries via http + * fetch. May be useful in local development (e.g. to set a port that's not + * the default 443). + * + * Provide either the full endpoint URL, or a function that takes the + * database host address, port and options, and returns the full endpoint URL + * (including protocol). + * + * Default: custom logic to connect to Neon endpoints. + */ + static get fetchEndpoint(): SocketDefaults["fetchEndpoint"]; + static set fetchEndpoint(newValue: SocketDefaults['fetchEndpoint']); + /** + * **DEPRECATED**. Previously, only when `fetchConnectionCache` was `true` + * did queries carried via HTTP fetch make use of a connection pool/cache + * on the server. All queries now use the connection pool/cache: this setting + * is ignored. + * + * Default: `true`. + */ + static get fetchConnectionCache(): SocketDefaults["fetchConnectionCache"]; + static set fetchConnectionCache(newValue: SocketDefaults['fetchConnectionCache']); + /** + * The `fetchFunction` option allows you to supply an alternative function + * for making http requests. The function must accept the same arguments as + * native `fetch`. + * + * Default: `undefined`. + */ + static get fetchFunction(): SocketDefaults["fetchFunction"]; + static set fetchFunction(newValue: SocketDefaults['fetchFunction']); + /** + * Only if no global `WebSocket` object is available, such as in older + * versions of Node, set `webSocketConstructor` to the constructor for a + * custom WebSocket implementation, such as those provided by `ws` or + * `undici`. + * + * Default: `undefined`. + */ + static get webSocketConstructor(): SocketDefaults["webSocketConstructor"]; + static set webSocketConstructor(newValue: SocketDefaults['webSocketConstructor']); + get webSocketConstructor(): SocketDefaults["webSocketConstructor"]; + set webSocketConstructor(newValue: SocketDefaults['webSocketConstructor']); + /** + * Set `wsProxy` to use your own WebSocket proxy server. + * + * Provide either the proxy server’s domain name, or a function that takes + * the database host and port and returns the proxy server address (without + * protocol). + * + * Example: `(host, port) => "myproxy.example.net?address=" + host + ":" + port` + * + * Default: `host => host + '/v2'` + */ + static get wsProxy(): SocketDefaults["wsProxy"]; + static set wsProxy(newValue: SocketDefaults['wsProxy']); + get wsProxy(): SocketDefaults["wsProxy"]; + set wsProxy(newValue: SocketDefaults['wsProxy']); + /** + * Batch multiple network writes per run-loop into a single outgoing + * WebSocket message. + * + * Default: `true`. + */ + static get coalesceWrites(): SocketDefaults["coalesceWrites"]; + static set coalesceWrites(newValue: SocketDefaults['coalesceWrites']); + get coalesceWrites(): SocketDefaults["coalesceWrites"]; + set coalesceWrites(newValue: SocketDefaults['coalesceWrites']); + /** + * Use a secure (`wss:`) connection to the WebSocket proxy. + * + * Default: `true`. + */ + static get useSecureWebSocket(): SocketDefaults["useSecureWebSocket"]; + static set useSecureWebSocket(newValue: SocketDefaults['useSecureWebSocket']); + get useSecureWebSocket(): SocketDefaults["useSecureWebSocket"]; + set useSecureWebSocket(newValue: SocketDefaults['useSecureWebSocket']); + /** + * Disable TLS encryption in the Postgres protocol (as set via e.g. + * `?sslmode=require` in the connection string). Connection remains secure + * as long as `useSecureWebSocket` is `true`, which is the default. + * + * Default: `true` + */ + static get forceDisablePgSSL(): SocketDefaults["forceDisablePgSSL"]; + static set forceDisablePgSSL(newValue: SocketDefaults['forceDisablePgSSL']); + get forceDisablePgSSL(): SocketDefaults["forceDisablePgSSL"]; + set forceDisablePgSSL(newValue: SocketDefaults['forceDisablePgSSL']); + /** + * When using subtls with `forceDisablePgSSL = false` and Postgres connection + * parameters that specify TLS, setting `disableSNI = true` means that no SNI + * data in included in the Postgres TLS handshake. + * + * On Neon, disabling SNI and including the Neon project name in the password + * avoids CPU-intensive SCRAM authentication, but this is only relevant for + * earlier iterations of Neon's WebSocket support. + * + * Default: `false`. + */ + static get disableSNI(): SocketDefaults["disableSNI"]; + static set disableSNI(newValue: SocketDefaults['disableSNI']); + get disableSNI(): SocketDefaults["disableSNI"]; + set disableSNI(newValue: SocketDefaults['disableSNI']); + /** + * Pipelines the startup message, cleartext password message and first query + * when set to `"password"`. This works only for cleartext password auth. + * + * Default: `"password"`. + */ + static get pipelineConnect(): SocketDefaults["pipelineConnect"]; + static set pipelineConnect(newValue: SocketDefaults['pipelineConnect']); + get pipelineConnect(): SocketDefaults["pipelineConnect"]; + set pipelineConnect(newValue: SocketDefaults['pipelineConnect']); + /** + * If `forceDisablePgSSL` is `false` and the Postgres connection parameters + * specify TLS, you must supply the subtls TLS library to this option: + * + * ``` + * import { neonConfig } from '@neondatabase/serverless'; + * import * as subtls from 'subtls'; + * neonConfig.subtls = subtls; + * ``` + * + * Default: `undefined`. + */ + static get subtls(): SocketDefaults["subtls"]; + static set subtls(newValue: SocketDefaults['subtls']); + get subtls(): SocketDefaults["subtls"]; + set subtls(newValue: SocketDefaults['subtls']); + /** + * Pipeline the pg SSL request and TLS handshake when `forceDisablePgSSL` is + * `false` and the Postgres connection parameters specify TLS. Currently + * compatible only with Neon hosts. + * + * Default: `false`. + */ + static get pipelineTLS(): SocketDefaults["pipelineTLS"]; + static set pipelineTLS(newValue: SocketDefaults['pipelineTLS']); + get pipelineTLS(): SocketDefaults["pipelineTLS"]; + set pipelineTLS(newValue: SocketDefaults['pipelineTLS']); + /** + * Set `rootCerts` to a string comprising one or more PEM files. These are + * the trusted root certificates for a TLS connection to Postgres when + * `forceDisablePgSSL` is `false` and the Postgres connection parameters + * specify TLS. + * + * Default: `""`. + */ + static get rootCerts(): SocketDefaults["rootCerts"]; + static set rootCerts(newValue: SocketDefaults['rootCerts']); + get rootCerts(): SocketDefaults["rootCerts"]; + set rootCerts(newValue: SocketDefaults['rootCerts']); + wsProxyAddrForHost(host: string, port: number): string; + connecting: boolean; + pending: boolean; + writable: boolean; + encrypted: boolean; + authorized: boolean; + destroyed: boolean; + setNoDelay(): this; + setKeepAlive(): this; + ref(): this; + unref(): this; + connect(port: number | string, host: string, connectListener?: () => void): void; + startTls(host: string): Promise; + tlsReadLoop(): Promise; + rawWrite(data: Uint8Array): void; + write(data: Buffer | string, encoding?: string, callback?: (err?: any) => void): boolean; + end(data?: Buffer | string, encoding?: string, callback?: () => void): this; + destroy(): this; +} + +export declare class NeonDbError extends Error { + name: "NeonDbError"; + severity: string | undefined; + code: string | undefined; + detail: string | undefined; + hint: string | undefined; + position: string | undefined; + internalPosition: string | undefined; + internalQuery: string | undefined; + where: string | undefined; + schema: string | undefined; + table: string | undefined; + column: string | undefined; + dataType: string | undefined; + constraint: string | undefined; + file: string | undefined; + line: string | undefined; + routine: string | undefined; + sourceError: Error | undefined; + constructor(message: string); +} + +export declare interface NeonQueryFunction { + (strings: TemplateStringsArray, ...params: any[]): NeonQueryPromise : QueryRows>; + (string: string, params?: any[], opts?: HTTPQueryOptions): NeonQueryPromise : QueryRows>; + /** + * The `transaction()` function allows multiple queries to be submitted (over + * HTTP) as a single, non-interactive Postgres transaction. + * + * For example: + * ``` + * import { neon } from "@neondatabase/serverless"; + * const sql = neon("postgres://user:pass@host/db"); + * + * const results = await sql.transaction([ + * sql`SELECT 1 AS num`, + * sql`SELECT 'a' AS str`, + * ]); + * // -> [[{ num: 1 }], [{ str: "a" }]] + * + * // or equivalently: + * const results = await sql.transaction(txn => [ + * txn`SELECT 1 AS num`, + * txn`SELECT 'a' AS str`, + * ]); + * // -> [[{ num: 1 }], [{ str: "a" }]] + * ``` + * @param queriesOrFn - Either an array of queries, or a (non-`async`) function + * that receives a query function and returns an array of queries. + * @param opts - The same options that may be set on individual queries in a + * non-transaction setting -- that is, `arrayMode` `fullResults` and + * `fetchOptions` -- plus the transaction options `isolationLevel`, + * `readOnly` and `deferrable`. Note that none of these options can be set on + * individual queries within a transaction. + * @returns An array of results. The structure of each result object depends + * on the `arrayMode` and `fullResults` options. + */ + transaction: (queriesOrFn: NeonQueryPromise[] | ((sql: NeonQueryFunctionInTransaction) => NeonQueryInTransaction[]), opts?: HTTPTransactionOptions) => Promise[] : QueryRows[]>; +} + +export declare interface NeonQueryFunctionInTransaction { + (strings: TemplateStringsArray, ...params: any[]): NeonQueryPromise : QueryRows>; + (string: string, params?: any[]): NeonQueryPromise : QueryRows>; } + +export declare interface NeonQueryInTransaction { + parameterizedQuery: ParameterizedQuery; +} + +export declare interface NeonQueryPromise extends Promise { + parameterizedQuery: ParameterizedQuery; + opts?: HTTPQueryOptions; +} + +export { Notification } + +declare type OID = string; + +export declare interface ParameterizedQuery { + query: string; + params: any[]; +} + +/** + * The node-postgres `Pool` object re-exported with minor modifications. + * https://node-postgres.com/apis/pool + */ +export declare class Pool extends Pool_2 { + Client: typeof Client; + hasFetchUnsupportedListeners: boolean; + on(event: 'error' | 'connect' | 'acquire' | 'release' | 'remove', listener: any): this; + addListener: (event: "error" | "connect" | "acquire" | "release" | "remove", listener: any) => this; + query(queryStream: T): T; + query(queryConfig: QueryArrayConfig, values?: QueryConfigValues): Promise>; + query(queryConfig: QueryConfig): Promise>; + query(queryTextOrConfig: string | QueryConfig, values?: QueryConfigValues): Promise>; + query(queryConfig: QueryArrayConfig, callback: (err: Error, result: QueryArrayResult) => void): void; + query(queryTextOrConfig: string | QueryConfig, callback: (err: Error, result: QueryResult) => void): void; + query(queryText: string, values: QueryConfigValues, callback: (err: Error, result: QueryResult) => void): void; +} + +export { PoolConfig } + +export declare interface ProcessQueryResultOptions { + arrayMode: boolean; + fullResults: boolean; + parameterizedQuery: ParameterizedQuery; + resultCallback: HTTPQueryOptions['resultCallback']; + types?: typeof types; +} + +export { Query } + +export { QueryArrayConfig } + +export { QueryArrayResult } + +export { QueryConfig } + +export { QueryParse } + +export { QueryResult } + +export { QueryResultBase } + +export { QueryResultRow } + +export declare type QueryRows = ArrayMode extends true ? any[][] : Record[]; + +declare abstract class ReadQueue { + queue: Uint8Array[]; + outstandingRequest: DataRequest | undefined; + constructor(); + abstract socketIsNotClosed(): boolean; + enqueue(data: Uint8Array): void; + dequeue(): void; + bytesInQueue(): number; + read(bytes: number): Promise | undefined>; +} + +export { ResultBuilder } + +declare type RootCertsData = Uint8Array; + +declare interface RootCertsDatabase { + index: RootCertsIndex; + data: RootCertsData; +} + +declare interface RootCertsIndex { + offsets: number[]; + subjects: Record; +} + +export declare interface SocketDefaults { + poolQueryViaFetch: boolean; + fetchEndpoint: string | ((host: string, port: number | string, options?: FetchEndpointOptions) => string); + fetchConnectionCache: boolean; + fetchFunction: any; + webSocketConstructor: WebSocketConstructor | undefined; + wsProxy: string | ((host: string, port: number | string) => string); + useSecureWebSocket: boolean; + forceDisablePgSSL: boolean; + coalesceWrites: boolean; + pipelineConnect: 'password' | false; + subtls: typeof subtls | undefined; + rootCerts: string; + pipelineTLS: boolean; + disableSNI: boolean; +} + +declare class SocketReadQueue extends ReadQueue { + constructor(socket: Socket); + socketIsNotClosed(): boolean; +} + +declare function stableStringify(x: any, replacer?: (key: string, value: any) => any, indent?: string | number): string; + +declare function startTls(host: string, rootCertsDatabase: RootCertsDatabase | string, networkRead: (bytes: number) => Promise, networkWrite: (data: Uint8Array) => void, { useSNI, requireServerTlsExtKeyUsage, requireDigitalSigKeyUsage, writePreData, expectPreData, commentPreData }?: { + useSNI?: boolean; + requireServerTlsExtKeyUsage?: boolean; + requireDigitalSigKeyUsage?: boolean; + writePreData?: Uint8Array; + expectPreData?: Uint8Array; + commentPreData?: string; +}): Promise Promise | undefined>, (data: Uint8Array) => Promise]>; + +declare function stdCharCodes(charCode: number): number | void; + +export { Submittable } + +declare namespace subtls { + export { + base64Decode, + hexFromU8, + stableStringify, + startTls, + stdCharCodes, + u8FromHex, + allKeyUsages, + ASN1Bytes, + Bytes, + Cert, + CertJSON, + DataRequest, + DistinguishedName, + OID, + ReadQueue, + RootCertsData, + RootCertsDatabase, + RootCertsIndex, + SocketReadQueue, + TrustedCert, + WebSocketReadQueue + } +} +export { subtls } + +declare class TrustedCert extends Cert { + static databaseFromPEM(pem: string): RootCertsDatabase; + static findInDatabase(subjectOrSubjectKeyId: DistinguishedName | string, db: RootCertsDatabase): TrustedCert | undefined; +} + +export { types } + +declare function u8FromHex(hex: string): Uint8Array; + +export declare interface WebSocketConstructor { + new (...args: any[]): WebSocketLike; +} + +export declare interface WebSocketLike { + readonly readyState: number; + binaryType: string; + close(code?: number, reason?: string): void; + send(data: any): void; + addEventListener(type: 'open' | 'message' | 'close' | 'error', listener: (this: WebSocketLike, ev: any) => any, options?: any): void; +} + +declare class WebSocketReadQueue extends ReadQueue { + constructor(socket: WebSocket); + socketIsNotClosed(): boolean; +} + diff --git a/dist/npm/index.d.ts b/dist/npm/index.d.ts index ec5c7b4..82e9d68 100644 --- a/dist/npm/index.d.ts +++ b/dist/npm/index.d.ts @@ -1,389 +1,335 @@ +/// + +import { BindConfig } from 'pg'; +import { Client as Client_2 } from 'pg'; +import { ClientBase } from 'pg'; +import { ClientConfig } from 'pg'; +import { Connection } from 'pg'; +import { ConnectionConfig } from 'pg'; +import { CustomTypesConfig } from 'pg'; +import { Defaults } from 'pg'; +import { defaults } from 'pg'; +import { EventEmitter } from 'events'; +import { Events } from 'pg'; +import { ExecuteConfig } from 'pg'; +import { FieldDef } from 'pg'; +import { MessageConfig } from 'pg'; +import { Notification } from 'pg'; +import { Pool as Pool_2 } from 'pg'; +import { PoolConfig } from 'pg'; +import { Query } from 'pg'; +import { QueryArrayConfig } from 'pg'; +import { QueryArrayResult } from 'pg'; +import { QueryConfig } from 'pg'; +import type { QueryConfigValues } from 'pg'; +import { QueryParse } from 'pg'; +import { QueryResult } from 'pg'; +import { QueryResultBase } from 'pg'; +import { QueryResultRow } from 'pg'; +import { ResultBuilder } from 'pg'; +import type { Socket } from 'net'; +import { Submittable } from 'pg'; +import { types } from 'pg'; + +declare const allKeyUsages: readonly ["digitalSignature", "nonRepudiation", "keyEncipherment", "dataEncipherment", "keyAgreement", "keyCertSign", "cRLSign", "encipherOnly", "decipherOnly"]; + +declare class ASN1Bytes extends Bytes { + readASN1Length(comment?: string): number; + expectASN1Length(comment?: string): readonly [() => void, () => number]; + readASN1OID(comment?: string): string; + readASN1Boolean(comment?: string): boolean; + readASN1UTCTime(): Date; + readASN1GeneralizedTime(): Date; + readASN1BitString(): Uint8Array; +} -// @neondatabase/serverless driver types, mimicking pg - -export { - BindConfig, ClientConfig, Connection, ConnectionConfig, CustomTypesConfig, Defaults, defaults, Events, ExecuteConfig, FieldDef, MessageConfig, native, Notification, PoolConfig, Query, QueryArrayConfig, QueryArrayResult, QueryConfig, QueryParse, QueryResult, QueryResultBase, - QueryResultRow, ResultBuilder, Submittable, types -} from "pg"; -export { DatabaseError } from "pg-protocol"; +declare function base64Decode(input: string, charCodes?: typeof stdCharCodes, autoPad?: boolean): Uint8Array; + +export { BindConfig } + +export declare const _bundleExt: 'js' | 'mjs'; + +declare class Bytes { + offset: number; + dataView: DataView; + data: Uint8Array; + comments: Record; + indents: Record; + indent: number; + constructor(arrayOrMaxBytes: number | Uint8Array); + extend(arrayOrMaxBytes: number | Uint8Array): void; + remaining(): number; + subarray(length: number): Uint8Array; + skip(length: number, comment?: string): this; + comment(s: string, offset?: number): this; + lengthComment(length: number, comment?: string, inclusive?: boolean): string; + readBytes(length: number): Uint8Array; + readUTF8String(length: number): string; + readUTF8StringNullTerminated(): string; + readUint8(comment?: string): number; + readUint16(comment?: string): number; + readUint24(comment?: string): number; + readUint32(comment?: string): number; + expectBytes(expected: Uint8Array | number[], comment?: string): void; + expectUint8(expectedValue: number, comment?: string): void; + expectUint16(expectedValue: number, comment?: string): void; + expectUint24(expectedValue: number, comment?: string): void; + expectUint32(expectedValue: number, comment?: string): void; + expectLength(length: number, indentDelta?: number): readonly [() => void, () => number]; + expectLengthUint8(comment?: string): readonly [() => void, () => number]; + expectLengthUint16(comment?: string): readonly [() => void, () => number]; + expectLengthUint24(comment?: string): readonly [() => void, () => number]; + expectLengthUint32(comment?: string): readonly [() => void, () => number]; + expectLengthUint8Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint16Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint24Incl(comment?: string): readonly [() => void, () => number]; + expectLengthUint32Incl(comment?: string): readonly [() => void, () => number]; + writeBytes(bytes: number[] | Uint8Array): this; + writeUTF8String(s: string): this; + writeUTF8StringNullTerminated(s: string): this; + writeUint8(value: number, comment?: string): Bytes; + writeUint16(value: number, comment?: string): Bytes; + writeUint24(value: number, comment?: string): Bytes; + writeUint32(value: number, comment?: string): Bytes; + _writeLengthGeneric(lengthBytes: 1 | 2 | 3 | 4, inclusive: boolean, comment?: string): () => void; + writeLengthUint8(comment?: string): () => void; + writeLengthUint16(comment?: string): () => void; + writeLengthUint24(comment?: string): () => void; + writeLengthUint32(comment?: string): () => void; + writeLengthUint8Incl(comment?: string): () => void; + writeLengthUint16Incl(comment?: string): () => void; + writeLengthUint24Incl(comment?: string): () => void; + writeLengthUint32Incl(comment?: string): () => void; + array(): Uint8Array; + commentedString(all?: boolean): string; +} -interface FetchEndpointOptions { - jwtAuth?: boolean; +declare class Cert { + serialNumber: Uint8Array; + algorithm: OID; + issuer: DistinguishedName; + validityPeriod: { + notBefore: Date; + notAfter: Date; + }; + subject: DistinguishedName; + publicKey: { + identifiers: OID[]; + data: Uint8Array; + all: Uint8Array; + }; + signature: Uint8Array; + keyUsage?: { + critical?: boolean; + usages: Set; + }; + subjectAltNames?: string[]; + extKeyUsage?: { + clientTls?: true; + serverTls?: true; + }; + authorityKeyIdentifier?: Uint8Array; + subjectKeyIdentifier?: Uint8Array; + basicConstraints?: { + critical?: boolean; + ca?: boolean; + pathLength?: number; + } | undefined; + signedData: Uint8Array; + static distinguishedNamesAreEqual(dn1: DistinguishedName, dn2: DistinguishedName): boolean; + static stringFromDistinguishedName(dn: DistinguishedName): string; + constructor(certData: Uint8Array | ASN1Bytes | CertJSON); + subjectAltNameMatchingHost(host: string): string | undefined; + isValidAtMoment(moment?: Date): boolean; + description(): string; + toJSON(): { + serialNumber: string; + algorithm: string; + issuer: DistinguishedName; + validityPeriod: { + notBefore: string; + notAfter: string; + }; + subject: DistinguishedName; + publicKey: { + identifiers: string[]; + data: string; + all: string; + }; + signature: string; + keyUsage: { + critical: boolean | undefined; + usages: ("digitalSignature" | "nonRepudiation" | "keyEncipherment" | "dataEncipherment" | "keyAgreement" | "keyCertSign" | "cRLSign" | "encipherOnly" | "decipherOnly")[]; + }; + subjectAltNames: string[] | undefined; + extKeyUsage: { + clientTls?: true; + serverTls?: true; + } | undefined; + authorityKeyIdentifier: string | undefined; + subjectKeyIdentifier: string | undefined; + basicConstraints: { + critical?: boolean; + ca?: boolean; + pathLength?: number; + } | undefined; + signedData: string; + }; + static uint8ArraysFromPEM(pem: string): Uint8Array[]; + static fromPEM(pem: string): Cert[]; } -export interface NeonConfigGlobalOnly { - /** - * Set `fetchEndpoint` to set the server endpoint to be sent queries via http - * fetch. May be useful in local development (e.g. to set a port that's not - * the default 443). - * - * Provide either the full endpoint URL, or a function that takes the - * database host address and port and returns the full endpoint URL - * (including protocol). - * - * Default: `host => 'https://' + host + '/sql'` - * - */ - fetchEndpoint: string | ((host: string, port: number | string, options?: FetchEndpointOptions) => string); - - /** - * **Experimentally**, when `poolQueryViaFetch` is `true`, and no listeners - * for the `"connect"`, `"acquire"`, `"release"` or `"remove"` events are set - * on the `Pool`, queries via `Pool.query()` will be sent by low-latency HTTP - * fetch request. - * - * Default: `false`. - */ - poolQueryViaFetch: boolean; - - /** - * **DEPRECATED**. Previously, only when `fetchConnectionCache` was `true` - * did queries carried via HTTP fetch make use of a connection pool/cache - * on the server. All queries now use the connection pool/cache: this setting - * is ignored. - * - * Default: `true`. - */ - fetchConnectionCache: boolean; - - /** - * The `fetchFunction` option allows you to supply an alternative function - * for making http requests. The function must accept the same arguments as - * native `fetch`. - * - * Default: `undefined`. - */ - fetchFunction: any; +declare type CertJSON = ReturnType; + +export declare interface Client { + connection: Connection & { + stream: neonConfig; + sendSCRAMClientFinalMessage: (response: any) => void; + ssl: any; + }; + _handleReadyForQuery: any; + _handleAuthCleartextPassword: any; + startup: any; + getStartupConf: any; + saslSession: any; } -export interface NeonConfigGlobalAndClient { - /** - * If no global `WebSocket` object is available, set `webSocketConstructor` - * to the constructor for a custom WebSocket implementation, such as those - * provided by `ws` or `undici`. - */ - webSocketConstructor: any; - - /** - * Set `wsProxy` to use your own WebSocket proxy server. - * - * Provide either the proxy server’s domain name, or a function that takes - * the database host and port and returns the proxy server address (without - * protocol). - * - * Example: `(host, port) => "myproxy.example.net?address=" + host + ":" + port` - * - * Default: `host => host + '/v2'` - */ - wsProxy: string | ((host: string, port: number | string) => string) | undefined; - - /** - * Use a secure (`wss:`) connection to the WebSocket proxy. - * - * Default: `true`. - */ - useSecureWebSocket: boolean; - - /** - * Disable TLS encryption in the Postgres protocol (as set via e.g. - * `?sslmode=require` in the connection string). Connection remains secure - * if `useSecureWebSocket` is `true`. - * - * Default: `true` - */ - forceDisablePgSSL: boolean; - - /** - * Pipelines the startup message, cleartext password message and first query - * when set to `"password"`. This works only for cleartext password auth. - * - * Default: `"password"`. - */ - pipelineConnect: "password" | false; - - /** - * If `forceDisablePgSSL` is `false` and the Postgres connection parameters - * specify TLS, you must supply the subtls TLS library to this option: - * - * ``` - * import { neonConfig } from '@neondatabase/serverless'; - * import * as subtls from 'subtls'; - * neonConfig.subtls = subtls; - * ``` - * - * Default: `undefined`. - */ - subtls: any; - - /** - * Pipeline the pg SSL request and TLS handshake when `forceDisablePgSSL` is - * `false` and the Postgres connection parameters specify TLS. Currently - * compatible only with Neon hosts. - * - * Default: `false`. - */ - pipelineTLS: boolean; - - /** - * Set `rootCerts` to a string comprising one or more PEM files. These are - * the trusted root certificates for a TLS connection to Postgres when - * `forceDisablePgSSL` is `false` and the Postgres connection parameters - * specify TLS. - * - * Default: `""`. - */ - rootCerts: string; - - /** - * Batch multiple network writes per run-loop into a single outgoing - * WebSocket message. - * - * Default: `true`. - */ - coalesceWrites: boolean; - - /** - * When `disableSNI` is `true`, `forceDisablePgSSL` is `false` and the - * Postgres connection parameters specify TLS, we send no SNI data in the - * Postgres TLS handshake. - * - * On Neon, disabling SNI and including the Neon project name in the password - * avoids CPU-intensive SCRAM authentication, but this is only relevant for - * earlier iterations of Neon's WebSocket support. - * - * Default: `false`. - */ - disableSNI: boolean; +/** + * The node-postgres `Client` object re-exported with minor modifications. + * https://node-postgres.com/apis/client + */ +export declare class Client extends Client_2 { + config: any; + get neonConfig(): neonConfig; + constructor(config: any); + connect(): Promise; + connect(callback: (err?: Error) => void): void; + _handleAuthSASLContinue(msg: any): Promise; } -export interface NeonConfig extends NeonConfigGlobalOnly, NeonConfigGlobalAndClient { } +export { ClientBase } -import { - Client as PgClient, - ClientBase as PgClientBase, - Pool as PgPool, - PoolClient as PgPoolClient, - types as PgTypes -} from "pg"; +export { ClientConfig } -export class ClientBase extends PgClientBase { - neonConfig: NeonConfigGlobalAndClient; -} +export { Connection } -export class Client extends PgClient { - neonConfig: NeonConfigGlobalAndClient; -} +export { ConnectionConfig } -export interface PoolClient extends PgPoolClient { - neonConfig: NeonConfigGlobalAndClient; -} +export { CustomTypesConfig } -export class Pool extends PgPool { - connect(): Promise; - connect(callback: (err: Error, client: PoolClient, done: (release?: any) => void) => void): void; - on(event: 'error', listener: (err: Error, client: PoolClient) => void): this; - on(event: 'connect' | 'acquire' | 'remove', listener: (client: PoolClient) => void): this; +declare interface DataRequest { + bytes: number; + resolve: (data: Uint8Array | undefined) => void; } -export const neonConfig: NeonConfig; - - -// SQL-over-HTTP +export { Defaults } -import { FieldDef } from "pg"; +export { defaults } -export type QueryRows = - ArrayMode extends true ? any[][] : Record[]; +declare type DistinguishedName = Record; -export interface FullQueryResults { - fields: FieldDef[]; - command: string; - rowCount: number; - rows: QueryRows; - rowAsArray: ArrayMode; -} +export { Events } -export interface ParameterizedQuery { - query: string; - params: any[]; -} +export { ExecuteConfig } -export interface HTTPQueryOptions { - /** - * When `arrayMode` is `false`, which is the default, result rows are - * returned as objects whose keys represent column names, such as - * `{ id: 1 }`). - * - * When `arrayMode` is `true`, rows are returned as arrays (and keys are not - * provided), e.g. `[1]`. - */ - arrayMode?: ArrayMode; - /** - * When `fullResults` is `false`, which is the default, only result rows are - * returned, e.g. `[{ id: 1 }]`). - * - * When `fullResults` is `true`, a result object is returned that matches - * what's returned by node-postgres. This has a `rows` property, which is an - * array of result rows, plus `fields`, which provides column names and - * types, `command` and `rowCount`. - */ - fullResults?: FullResults; // default false - /** - * Any options in `fetchOptions` are merged in to the options passed to - * `fetch`. In case of conflict with what would otherwise be passed, these - * options take precedence. - */ - fetchOptions?: Record; - - /** - * JWT auth token to be passed as the Bearer token in the Authorization header - * - * Default: `undefined` - */ - authToken?: string | (() => Promise | string); - - /** - * Custom type parsers - * See https://github.com/brianc/node-pg-types - */ - types?: typeof PgTypes; +export declare interface FetchEndpointOptions { + jwtAuth?: boolean; } -export interface HTTPTransactionOptions extends HTTPQueryOptions { - /** - * Postgres transaction isolation level: see https://www.postgresql.org/docs/current/transaction-iso.html. - * Note that `ReadUncommitted` actually gets you `ReadCommitted` in Postgres. - * */ - isolationLevel?: 'ReadUncommitted' | 'ReadCommitted' | 'RepeatableRead' | 'Serializable'; - /** - * When `readOnly` is `false`, which is the default, a `READ WRITE` Postgres - * transaction is used. - * - * When `readOnly` is `true`, a `READ ONLY` Postgres transaction is used. - * */ - readOnly?: boolean; - /** - * When `deferrable` is `false`, which is the default, a `NOT DEFERRABLE` - * Postgres transaction is used. - * - * When `deferrable` is `true` (and `isolationLevel` is `Serializable` and - * `readOnly` is `true`), a `DEFERRABLE` Postgres transaction is used. - * */ - deferrable?: boolean; -} +export { FieldDef } -export interface NeonQueryPromise extends Promise { - parameterizedQuery: ParameterizedQuery; - opts?: HTTPQueryOptions; +export declare interface FullQueryResults { + fields: FieldDef[]; + command: string; + rowCount: number; + rows: QueryRows; + rowAsArray: ArrayMode; } -export interface NeonQueryInTransaction { - // this is a simplified form of query, which has only a `parameterizedQuery` (no `opts` and not a `Promise`) - parameterizedQuery: ParameterizedQuery; +declare function hexFromU8(u8: Uint8Array | number[], spacer?: string): string; + +export declare interface HTTPQueryOptions { + /** + * When `arrayMode` is `false`, which is the default, result rows are + * returned as objects whose keys represent column names, such as + * `{ id: 1 }`). + * + * When `arrayMode` is `true`, rows are returned as arrays (and keys are not + * provided), e.g. `[1]`. + */ + arrayMode?: ArrayMode; + /** + * When `fullResults` is `false`, which is the default, only result rows are + * returned, e.g. `[{ id: 1 }]`). + * + * When `fullResults` is `true`, a result object is returned that matches + * what's returned by node-postgres. This has a `rows` property, which is an + * array of result rows, plus `fields`, which provides column names and + * types, `command` and `rowCount`. + */ + fullResults?: FullResults; + /** + * Any options in `fetchOptions` are merged in to the options passed to + * `fetch`. In case of conflict with what would otherwise be passed, these + * options take precedence. + */ + fetchOptions?: Record; + /** + * JWT auth token to be passed as the Bearer token in the Authorization header. + * Can be string, or a function (sync or async) returning a string. + * + * Default: `undefined` + */ + authToken?: string | (() => Promise | string); + /** + * Custom type parsers. See https://github.com/brianc/node-pg-types. + */ + types?: typeof types; + queryCallback?: (query: ParameterizedQuery) => void; + resultCallback?: (query: ParameterizedQuery, result: any, rows: any, opts: any) => void; } -export interface NeonQueryFunctionInTransaction { - // this is a simplified form of NeonQueryFunction (below): - // * `opts` cannot be passed - // * no `transaction()` method is available - - // tagged-template function usage - (strings: TemplateStringsArray, ...params: any[]): - NeonQueryPromise : QueryRows>; - - // ordinary function usage (*no* options overrides) - (string: string, params?: any[]): - NeonQueryPromise : QueryRows>; +export declare interface HTTPTransactionOptions extends HTTPQueryOptions { + isolationLevel?: 'ReadUncommitted' | 'ReadCommitted' | 'RepeatableRead' | 'Serializable'; + readOnly?: boolean; + deferrable?: boolean; } -export interface NeonQueryFunction { - // tagged-template function usage - (strings: TemplateStringsArray, ...params: any[]): - NeonQueryPromise : QueryRows>; - - // ordinary function usage, with options overrides - ( - string: string, - params?: any[], - opts?: HTTPQueryOptions - ): NeonQueryPromise< - ArrayModeOverride, - FullResultsOverride, - FullResultsOverride extends true ? FullQueryResults : QueryRows - >; - - /** - * The `transaction()` function allows multiple queries to be submitted (over - * HTTP) as a single, non-interactive Postgres transaction. - * - * For example: - * ``` - * import { neon } from "@neondatabase/serverless"; - * const sql = neon("postgres://user:pass@host/db"); - * - * const results = await sql.transaction([ - * sql`SELECT 1 AS num`, - * sql`SELECT 'a' AS str`, - * ]); - * // -> [[{ num: 1 }], [{ str: "a" }]] - * - * // or equivalently: - * const results = await sql.transaction(txn => [ - * txn`SELECT 1 AS num`, - * txn`SELECT 'a' AS str`, - * ]); - * // -> [[{ num: 1 }], [{ str: "a" }]] - * ``` - * @param queriesOrFn Either an array of queries, or a (non-`async`) function - * that receives a query function and returns an array of queries. - * @param opts The same options that may be set on individual queries in a - * non-transaction setting -- that is, `arrayMode` `fullResults` and - * `fetchOptions` -- plus the transaction options `isolationLevel`, - * `readOnly` and `deferrable`. Note that none of these options can be set on - * individual queries within a transaction. - * @returns An array of results. The structure of each result object depends - * on the `arrayMode` and `fullResults` options. - */ - transaction: ( - queriesOrFn: NeonQueryPromise[] | // not ArrayModeOverride or FullResultsOverride: clamp these values to the current ones - ((sql: NeonQueryFunctionInTransaction) => NeonQueryInTransaction[]), - opts?: HTTPTransactionOptions - ) => Promise[] : QueryRows[]>; -} +export { MessageConfig } /** * This function returns an async tagged-template function that runs a single * SQL query (no session or transactions) with low latency over https. Support - * for multiple queries as a non-interactive transaction is provided by + * for multiple queries (as a non-interactive transaction) is provided by * the `transaction` property of the query function. - * + * * By default, the query function returns database rows directly. Types should * match those returned by this driver (i.e. Pool or Client) over WebSockets. - * - * The returned function can also be called directly (i.e. not as a template - * function). In that case, pass it a query string with embedded `$1`, `$2` + * + * The returned function can also be called directly (i.e. not as a template + * function). In that case, pass it a query string with embedded `$1`, `$2` * (etc.), followed by an array of query parameters, followed (optionally) by * any of the same options you can pass to this function. - * + * * Some examples: * ``` * import { neon } from "@neondatabase/serverless"; * const h = "hello", w = "world"; - * + * * // example 1: default options, tagged-template usage * const sql = neon("postgres://user:pass@host/db"); - * const rows = await sql`SELECT ${h} || ' ' || ${w} AS greeting`; + * const rows = await sql`SELECT ${h} || ' ' || ${w} AS greeting`; * // -> [ { greeting: "hello world" } ] - * + * * // example 2: `arrayMode` and `fullResults` options, ordinary function usage * const options = { arrayMode: true, fullResults: true }; * const sql = neon("postgres://user:pass@host/db", options); * const rows = await sql("SELECT $1 || ' ' || $2 AS greeting", [h, w]); - * // -> { - * // command: "SELECT", + * // -> { + * // command: "SELECT", * // fields: [ { name: "greeting", dataTypeID: 25 } ], - * // rowAsArray: true, - * // rowCount: 1, + * // rowAsArray: true, + * // rowCount: 1, * // rows: [ [ "hello world" ] ] * // } * @@ -395,39 +341,444 @@ export interface NeonQueryFunction [ { greeting: "hello world" } ] * ``` - * - * @param connectionString this has the format `postgres://user:pass@host/db` - * @param options pass `arrayMode: true` to receive results as an array of + * + * @param connectionString - this has the format `postgres://user:pass@host/db` + * @param options - pass `arrayMode: true` to receive results as an array of * arrays, instead of the default array of objects; pass `fullResults: true` * to receive a complete result object similar to one returned by node-postgres * (with properties `rows`, `fields`, `command`, `rowCount`, `rowAsArray`); * pass as `fetchOptions` an object which will be merged into the options * passed to `fetch`. */ -export function neon( - connectionString: string, - options?: HTTPTransactionOptions, -): NeonQueryFunction; - -export class NeonDbError extends Error { - name: 'NeonDbError'; - - severity: string | undefined; - code: string | undefined; - detail: string | undefined; - hint: string | undefined; - position: string | undefined; - internalPosition: string | undefined; - internalQuery: string | undefined; - where: string | undefined; - schema: string | undefined; - table: string | undefined; - column: string | undefined; - dataType: string | undefined; - constraint: string | undefined; - file: string | undefined; - line: string | undefined; - routine: string | undefined; - - sourceError: Error | undefined; +export declare function neon(connectionString: string, { arrayMode: neonOptArrayMode, fullResults: neonOptFullResults, fetchOptions: neonOptFetchOptions, isolationLevel: neonOptIsolationLevel, readOnly: neonOptReadOnly, deferrable: neonOptDeferrable, queryCallback, resultCallback, authToken, }?: HTTPTransactionOptions): NeonQueryFunction; + +export declare class neonConfig extends EventEmitter { + static defaults: SocketDefaults; + static opts: Partial; + /** + * **Experimentally**, when `poolQueryViaFetch` is `true`, and no listeners + * for the `"connect"`, `"acquire"`, `"release"` or `"remove"` events are set + * on the `Pool`, queries via `Pool.query()` will be sent by low-latency HTTP + * fetch request. + * + * Default: `false`. + */ + static get poolQueryViaFetch(): SocketDefaults["poolQueryViaFetch"]; + static set poolQueryViaFetch(newValue: SocketDefaults['poolQueryViaFetch']); + /** + * Set `fetchEndpoint` to set the server endpoint to be sent queries via http + * fetch. May be useful in local development (e.g. to set a port that's not + * the default 443). + * + * Provide either the full endpoint URL, or a function that takes the + * database host address, port and options, and returns the full endpoint URL + * (including protocol). + * + * Default: custom logic to connect to Neon endpoints. + */ + static get fetchEndpoint(): SocketDefaults["fetchEndpoint"]; + static set fetchEndpoint(newValue: SocketDefaults['fetchEndpoint']); + /** + * **DEPRECATED**. Previously, only when `fetchConnectionCache` was `true` + * did queries carried via HTTP fetch make use of a connection pool/cache + * on the server. All queries now use the connection pool/cache: this setting + * is ignored. + * + * Default: `true`. + */ + static get fetchConnectionCache(): SocketDefaults["fetchConnectionCache"]; + static set fetchConnectionCache(newValue: SocketDefaults['fetchConnectionCache']); + /** + * The `fetchFunction` option allows you to supply an alternative function + * for making http requests. The function must accept the same arguments as + * native `fetch`. + * + * Default: `undefined`. + */ + static get fetchFunction(): SocketDefaults["fetchFunction"]; + static set fetchFunction(newValue: SocketDefaults['fetchFunction']); + /** + * Only if no global `WebSocket` object is available, such as in older + * versions of Node, set `webSocketConstructor` to the constructor for a + * custom WebSocket implementation, such as those provided by `ws` or + * `undici`. + * + * Default: `undefined`. + */ + static get webSocketConstructor(): SocketDefaults["webSocketConstructor"]; + static set webSocketConstructor(newValue: SocketDefaults['webSocketConstructor']); + get webSocketConstructor(): SocketDefaults["webSocketConstructor"]; + set webSocketConstructor(newValue: SocketDefaults['webSocketConstructor']); + /** + * Set `wsProxy` to use your own WebSocket proxy server. + * + * Provide either the proxy server’s domain name, or a function that takes + * the database host and port and returns the proxy server address (without + * protocol). + * + * Example: `(host, port) => "myproxy.example.net?address=" + host + ":" + port` + * + * Default: `host => host + '/v2'` + */ + static get wsProxy(): SocketDefaults["wsProxy"]; + static set wsProxy(newValue: SocketDefaults['wsProxy']); + get wsProxy(): SocketDefaults["wsProxy"]; + set wsProxy(newValue: SocketDefaults['wsProxy']); + /** + * Batch multiple network writes per run-loop into a single outgoing + * WebSocket message. + * + * Default: `true`. + */ + static get coalesceWrites(): SocketDefaults["coalesceWrites"]; + static set coalesceWrites(newValue: SocketDefaults['coalesceWrites']); + get coalesceWrites(): SocketDefaults["coalesceWrites"]; + set coalesceWrites(newValue: SocketDefaults['coalesceWrites']); + /** + * Use a secure (`wss:`) connection to the WebSocket proxy. + * + * Default: `true`. + */ + static get useSecureWebSocket(): SocketDefaults["useSecureWebSocket"]; + static set useSecureWebSocket(newValue: SocketDefaults['useSecureWebSocket']); + get useSecureWebSocket(): SocketDefaults["useSecureWebSocket"]; + set useSecureWebSocket(newValue: SocketDefaults['useSecureWebSocket']); + /** + * Disable TLS encryption in the Postgres protocol (as set via e.g. + * `?sslmode=require` in the connection string). Connection remains secure + * as long as `useSecureWebSocket` is `true`, which is the default. + * + * Default: `true` + */ + static get forceDisablePgSSL(): SocketDefaults["forceDisablePgSSL"]; + static set forceDisablePgSSL(newValue: SocketDefaults['forceDisablePgSSL']); + get forceDisablePgSSL(): SocketDefaults["forceDisablePgSSL"]; + set forceDisablePgSSL(newValue: SocketDefaults['forceDisablePgSSL']); + /** + * When using subtls with `forceDisablePgSSL = false` and Postgres connection + * parameters that specify TLS, setting `disableSNI = true` means that no SNI + * data in included in the Postgres TLS handshake. + * + * On Neon, disabling SNI and including the Neon project name in the password + * avoids CPU-intensive SCRAM authentication, but this is only relevant for + * earlier iterations of Neon's WebSocket support. + * + * Default: `false`. + */ + static get disableSNI(): SocketDefaults["disableSNI"]; + static set disableSNI(newValue: SocketDefaults['disableSNI']); + get disableSNI(): SocketDefaults["disableSNI"]; + set disableSNI(newValue: SocketDefaults['disableSNI']); + /** + * Pipelines the startup message, cleartext password message and first query + * when set to `"password"`. This works only for cleartext password auth. + * + * Default: `"password"`. + */ + static get pipelineConnect(): SocketDefaults["pipelineConnect"]; + static set pipelineConnect(newValue: SocketDefaults['pipelineConnect']); + get pipelineConnect(): SocketDefaults["pipelineConnect"]; + set pipelineConnect(newValue: SocketDefaults['pipelineConnect']); + /** + * If `forceDisablePgSSL` is `false` and the Postgres connection parameters + * specify TLS, you must supply the subtls TLS library to this option: + * + * ``` + * import { neonConfig } from '@neondatabase/serverless'; + * import * as subtls from 'subtls'; + * neonConfig.subtls = subtls; + * ``` + * + * Default: `undefined`. + */ + static get subtls(): SocketDefaults["subtls"]; + static set subtls(newValue: SocketDefaults['subtls']); + get subtls(): SocketDefaults["subtls"]; + set subtls(newValue: SocketDefaults['subtls']); + /** + * Pipeline the pg SSL request and TLS handshake when `forceDisablePgSSL` is + * `false` and the Postgres connection parameters specify TLS. Currently + * compatible only with Neon hosts. + * + * Default: `false`. + */ + static get pipelineTLS(): SocketDefaults["pipelineTLS"]; + static set pipelineTLS(newValue: SocketDefaults['pipelineTLS']); + get pipelineTLS(): SocketDefaults["pipelineTLS"]; + set pipelineTLS(newValue: SocketDefaults['pipelineTLS']); + /** + * Set `rootCerts` to a string comprising one or more PEM files. These are + * the trusted root certificates for a TLS connection to Postgres when + * `forceDisablePgSSL` is `false` and the Postgres connection parameters + * specify TLS. + * + * Default: `""`. + */ + static get rootCerts(): SocketDefaults["rootCerts"]; + static set rootCerts(newValue: SocketDefaults['rootCerts']); + get rootCerts(): SocketDefaults["rootCerts"]; + set rootCerts(newValue: SocketDefaults['rootCerts']); + wsProxyAddrForHost(host: string, port: number): string; + connecting: boolean; + pending: boolean; + writable: boolean; + encrypted: boolean; + authorized: boolean; + destroyed: boolean; + setNoDelay(): this; + setKeepAlive(): this; + ref(): this; + unref(): this; + connect(port: number | string, host: string, connectListener?: () => void): void; + startTls(host: string): Promise; + tlsReadLoop(): Promise; + rawWrite(data: Uint8Array): void; + write(data: Buffer | string, encoding?: string, callback?: (err?: any) => void): boolean; + end(data?: Buffer | string, encoding?: string, callback?: () => void): this; + destroy(): this; +} + +export declare class NeonDbError extends Error { + name: "NeonDbError"; + severity: string | undefined; + code: string | undefined; + detail: string | undefined; + hint: string | undefined; + position: string | undefined; + internalPosition: string | undefined; + internalQuery: string | undefined; + where: string | undefined; + schema: string | undefined; + table: string | undefined; + column: string | undefined; + dataType: string | undefined; + constraint: string | undefined; + file: string | undefined; + line: string | undefined; + routine: string | undefined; + sourceError: Error | undefined; + constructor(message: string); +} + +export declare interface NeonQueryFunction { + (strings: TemplateStringsArray, ...params: any[]): NeonQueryPromise : QueryRows>; + (string: string, params?: any[], opts?: HTTPQueryOptions): NeonQueryPromise : QueryRows>; + /** + * The `transaction()` function allows multiple queries to be submitted (over + * HTTP) as a single, non-interactive Postgres transaction. + * + * For example: + * ``` + * import { neon } from "@neondatabase/serverless"; + * const sql = neon("postgres://user:pass@host/db"); + * + * const results = await sql.transaction([ + * sql`SELECT 1 AS num`, + * sql`SELECT 'a' AS str`, + * ]); + * // -> [[{ num: 1 }], [{ str: "a" }]] + * + * // or equivalently: + * const results = await sql.transaction(txn => [ + * txn`SELECT 1 AS num`, + * txn`SELECT 'a' AS str`, + * ]); + * // -> [[{ num: 1 }], [{ str: "a" }]] + * ``` + * @param queriesOrFn - Either an array of queries, or a (non-`async`) function + * that receives a query function and returns an array of queries. + * @param opts - The same options that may be set on individual queries in a + * non-transaction setting -- that is, `arrayMode` `fullResults` and + * `fetchOptions` -- plus the transaction options `isolationLevel`, + * `readOnly` and `deferrable`. Note that none of these options can be set on + * individual queries within a transaction. + * @returns An array of results. The structure of each result object depends + * on the `arrayMode` and `fullResults` options. + */ + transaction: (queriesOrFn: NeonQueryPromise[] | ((sql: NeonQueryFunctionInTransaction) => NeonQueryInTransaction[]), opts?: HTTPTransactionOptions) => Promise[] : QueryRows[]>; +} + +export declare interface NeonQueryFunctionInTransaction { + (strings: TemplateStringsArray, ...params: any[]): NeonQueryPromise : QueryRows>; + (string: string, params?: any[]): NeonQueryPromise : QueryRows>; +} + +export declare interface NeonQueryInTransaction { + parameterizedQuery: ParameterizedQuery; } + +export declare interface NeonQueryPromise extends Promise { + parameterizedQuery: ParameterizedQuery; + opts?: HTTPQueryOptions; +} + +export { Notification } + +declare type OID = string; + +export declare interface ParameterizedQuery { + query: string; + params: any[]; +} + +/** + * The node-postgres `Pool` object re-exported with minor modifications. + * https://node-postgres.com/apis/pool + */ +export declare class Pool extends Pool_2 { + Client: typeof Client; + hasFetchUnsupportedListeners: boolean; + on(event: 'error' | 'connect' | 'acquire' | 'release' | 'remove', listener: any): this; + addListener: (event: "error" | "connect" | "acquire" | "release" | "remove", listener: any) => this; + query(queryStream: T): T; + query(queryConfig: QueryArrayConfig, values?: QueryConfigValues): Promise>; + query(queryConfig: QueryConfig): Promise>; + query(queryTextOrConfig: string | QueryConfig, values?: QueryConfigValues): Promise>; + query(queryConfig: QueryArrayConfig, callback: (err: Error, result: QueryArrayResult) => void): void; + query(queryTextOrConfig: string | QueryConfig, callback: (err: Error, result: QueryResult) => void): void; + query(queryText: string, values: QueryConfigValues, callback: (err: Error, result: QueryResult) => void): void; +} + +export { PoolConfig } + +export declare interface ProcessQueryResultOptions { + arrayMode: boolean; + fullResults: boolean; + parameterizedQuery: ParameterizedQuery; + resultCallback: HTTPQueryOptions['resultCallback']; + types?: typeof types; +} + +export { Query } + +export { QueryArrayConfig } + +export { QueryArrayResult } + +export { QueryConfig } + +export { QueryParse } + +export { QueryResult } + +export { QueryResultBase } + +export { QueryResultRow } + +export declare type QueryRows = ArrayMode extends true ? any[][] : Record[]; + +declare abstract class ReadQueue { + queue: Uint8Array[]; + outstandingRequest: DataRequest | undefined; + constructor(); + abstract socketIsNotClosed(): boolean; + enqueue(data: Uint8Array): void; + dequeue(): void; + bytesInQueue(): number; + read(bytes: number): Promise | undefined>; +} + +export { ResultBuilder } + +declare type RootCertsData = Uint8Array; + +declare interface RootCertsDatabase { + index: RootCertsIndex; + data: RootCertsData; +} + +declare interface RootCertsIndex { + offsets: number[]; + subjects: Record; +} + +export declare interface SocketDefaults { + poolQueryViaFetch: boolean; + fetchEndpoint: string | ((host: string, port: number | string, options?: FetchEndpointOptions) => string); + fetchConnectionCache: boolean; + fetchFunction: any; + webSocketConstructor: WebSocketConstructor | undefined; + wsProxy: string | ((host: string, port: number | string) => string); + useSecureWebSocket: boolean; + forceDisablePgSSL: boolean; + coalesceWrites: boolean; + pipelineConnect: 'password' | false; + subtls: typeof subtls | undefined; + rootCerts: string; + pipelineTLS: boolean; + disableSNI: boolean; +} + +declare class SocketReadQueue extends ReadQueue { + constructor(socket: Socket); + socketIsNotClosed(): boolean; +} + +declare function stableStringify(x: any, replacer?: (key: string, value: any) => any, indent?: string | number): string; + +declare function startTls(host: string, rootCertsDatabase: RootCertsDatabase | string, networkRead: (bytes: number) => Promise, networkWrite: (data: Uint8Array) => void, { useSNI, requireServerTlsExtKeyUsage, requireDigitalSigKeyUsage, writePreData, expectPreData, commentPreData }?: { + useSNI?: boolean; + requireServerTlsExtKeyUsage?: boolean; + requireDigitalSigKeyUsage?: boolean; + writePreData?: Uint8Array; + expectPreData?: Uint8Array; + commentPreData?: string; +}): Promise Promise | undefined>, (data: Uint8Array) => Promise]>; + +declare function stdCharCodes(charCode: number): number | void; + +export { Submittable } + +declare namespace subtls { + export { + base64Decode, + hexFromU8, + stableStringify, + startTls, + stdCharCodes, + u8FromHex, + allKeyUsages, + ASN1Bytes, + Bytes, + Cert, + CertJSON, + DataRequest, + DistinguishedName, + OID, + ReadQueue, + RootCertsData, + RootCertsDatabase, + RootCertsIndex, + SocketReadQueue, + TrustedCert, + WebSocketReadQueue + } +} +export { subtls } + +declare class TrustedCert extends Cert { + static databaseFromPEM(pem: string): RootCertsDatabase; + static findInDatabase(subjectOrSubjectKeyId: DistinguishedName | string, db: RootCertsDatabase): TrustedCert | undefined; +} + +export { types } + +declare function u8FromHex(hex: string): Uint8Array; + +export declare interface WebSocketConstructor { + new (...args: any[]): WebSocketLike; +} + +export declare interface WebSocketLike { + readonly readyState: number; + binaryType: string; + close(code?: number, reason?: string): void; + send(data: any): void; + addEventListener(type: 'open' | 'message' | 'close' | 'error', listener: (this: WebSocketLike, ev: any) => any, options?: any): void; +} + +declare class WebSocketReadQueue extends ReadQueue { + constructor(socket: WebSocket); + socketIsNotClosed(): boolean; +} + diff --git a/dist/npm/index.js b/dist/npm/index.js index 889d230..252903d 100644 --- a/dist/npm/index.js +++ b/dist/npm/index.js @@ -1,40 +1,40 @@ -"use strict";var io=Object.create;var Te=Object.defineProperty;var so=Object.getOwnPropertyDescriptor;var oo=Object.getOwnPropertyNames;var ao=Object.getPrototypeOf,uo=Object.prototype.hasOwnProperty;var co=(r,e,t)=>e in r?Te(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}): -r[e]=t;var a=(r,e)=>Te(r,"name",{value:e,configurable:!0});var z=(r,e)=>()=>(r&&(e=r(r=0)),e);var I=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),re=(r,e)=>{for(var t in e) -Te(r,t,{get:e[t],enumerable:!0})},Pn=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e== -"function")for(let i of oo(e))!uo.call(r,i)&&i!==t&&Te(r,i,{get:()=>e[i],enumerable:!(n= -so(e,i))||n.enumerable});return r};var Ie=(r,e,t)=>(t=r!=null?io(ao(r)):{},Pn(e||!r||!r.__esModule?Te(t,"default",{ -value:r,enumerable:!0}):t,r)),O=r=>Pn(Te({},"__esModule",{value:!0}),r);var _=(r,e,t)=>co(r,typeof e!="symbol"?e+"":e,t);var Rn=I(st=>{"use strict";p();st.byteLength=lo;st.toByteArray=po;st.fromByteArray= -go;var ue=[],ne=[],ho=typeof Uint8Array<"u"?Uint8Array:Array,Ft="ABCDEFGHIJKLMNO\ -PQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(_e=0,Bn=Ft.length;_ee in r?Ce(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}): +r[e]=t;var a=(r,e)=>Ce(r,"name",{value:e,configurable:!0});var z=(r,e)=>()=>(r&&(e=r(r=0)),e);var I=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),te=(r,e)=>{for(var t in e) +Ce(r,t,{get:e[t],enumerable:!0})},Rn=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e== +"function")for(let i of oo(e))!uo.call(r,i)&&i!==t&&Ce(r,i,{get:()=>e[i],enumerable:!(n= +so(e,i))||n.enumerable});return r};var Te=(r,e,t)=>(t=r!=null?io(ao(r)):{},Rn(e||!r||!r.__esModule?Ce(t,"default",{ +value:r,enumerable:!0}):t,r)),U=r=>Rn(Ce({},"__esModule",{value:!0}),r);var A=(r,e,t)=>co(r,typeof e!="symbol"?e+"":e,t);var Ln=I(st=>{"use strict";d();st.byteLength=ho;st.toByteArray=po;st.fromByteArray= +go;var ae=[],re=[],lo=typeof Uint8Array<"u"?Uint8Array:Array,Bt="ABCDEFGHIJKLMNO\ +PQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ae=0,Pn=Bt.length;Ae0)throw new Error("Invalid string. Length must be a multip\ -le of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}a(Ln, -"getLens");function lo(r){var e=Ln(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(lo,"byte\ +le of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}a(Fn, +"getLens");function ho(r){var e=Fn(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(ho,"byte\ Length");function fo(r,e,t){return(e+t)*3/4-t}a(fo,"_byteLength");function po(r){ -var e,t=Ln(r),n=t[0],i=t[1],s=new ho(fo(r,n,i)),o=0,u=i>0?n-4:n,c;for(c=0;c0?n-4:n,c;for(c=0;c>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e= -ne[r.charCodeAt(c)]<<2|ne[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=ne[r.charCodeAt( -c)]<<10|ne[r.charCodeAt(c+1)]<<4|ne[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]= -e&255),s}a(po,"toByteArray");function yo(r){return ue[r>>18&63]+ue[r>>12&63]+ue[r>> -6&63]+ue[r&63]}a(yo,"tripletToBase64");function mo(r,e,t){for(var n,i=[],s=e;s>4,s[o++]=e&255),i===1&&(e=re[r.charCodeAt( +c)]<<10|re[r.charCodeAt(c+1)]<<4|re[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]= +e&255),s}a(po,"toByteArray");function yo(r){return ae[r>>18&63]+ae[r>>12&63]+ae[r>> +6&63]+ae[r&63]}a(yo,"tripletToBase64");function mo(r,e,t){for(var n,i=[],s=e;su?u:o+s));return n===1?(e=r[t-1],i.push(ue[e>>2]+ -ue[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(ue[e>>10]+ue[e>>4&63]+ue[e<< -2&63]+"=")),i.join("")}a(go,"fromByteArray")});var Fn=I(Mt=>{p();Mt.read=function(r,e,t,n,i){var s,o,u=i*8-n-1,c=(1<> -1,l=-7,d=t?i-1:0,b=t?-1:1,C=r[e+d];for(d+=b,s=C&(1<<-l)-1,C>>=-l,l+=u;l>0;s=s*256+ -r[e+d],d+=b,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=o*256+r[e+d],d+=b,l-=8);if(s=== -0)s=1-h;else{if(s===c)return o?NaN:(C?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-h}return(C? --1:1)*o*Math.pow(2,s-n)};Mt.write=function(r,e,t,n,i,s){var o,u,c,h=s*8-i-1,l=(1<< -h)-1,d=l>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=n?0:s-1,B=n?1:-1,Q=e<0|| -e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=l):(o=Math. -floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+d>=1?e+=b/c:e+= -b*Math.pow(2,1-d),e*c>=2&&(o++,c/=2),o+d>=l?(u=0,o=l):o+d>=1?(u=(e*c-1)*Math.pow( -2,i),o=o+d):(u=e*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;r[t+C]=u&255,C+=B,u/=256, -i-=8);for(o=o<0;r[t+C]=o&255,C+=B,o/=256,h-=8);r[t+C-B]|=Q*128}});var Yn=I(Re=>{"use strict";p();var Dt=Rn(),Be=Fn(),Mn=typeof Symbol=="function"&& -typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Re.Buffer= -f;Re.SlowBuffer=vo;Re.INSPECT_MAX_BYTES=50;var ot=2147483647;Re.kMaxLength=ot;f. +u=t-n;ou?u:o+s));return n===1?(e=r[t-1],i.push(ae[e>>2]+ +ae[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(ae[e>>10]+ae[e>>4&63]+ae[e<< +2&63]+"=")),i.join("")}a(go,"fromByteArray")});var Bn=I(Mt=>{d();Mt.read=function(r,e,t,n,i){var s,o,u=i*8-n-1,c=(1<> +1,h=-7,p=t?i-1:0,S=t?-1:1,_=r[e+p];for(p+=S,s=_&(1<<-h)-1,_>>=-h,h+=u;h>0;s=s*256+ +r[e+p],p+=S,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=n;h>0;o=o*256+r[e+p],p+=S,h-=8);if(s=== +0)s=1-l;else{if(s===c)return o?NaN:(_?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(_? +-1:1)*o*Math.pow(2,s-n)};Mt.write=function(r,e,t,n,i,s){var o,u,c,l=s*8-i-1,h=(1<< +l)-1,p=h>>1,S=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:s-1,P=n?1:-1,G=e<0|| +e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=h):(o=Math. +floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+p>=1?e+=S/c:e+= +S*Math.pow(2,1-p),e*c>=2&&(o++,c/=2),o+p>=h?(u=0,o=h):o+p>=1?(u=(e*c-1)*Math.pow( +2,i),o=o+p):(u=e*Math.pow(2,p-1)*Math.pow(2,i),o=0));i>=8;r[t+_]=u&255,_+=P,u/=256, +i-=8);for(o=o<0;r[t+_]=o&255,_+=P,o/=256,l-=8);r[t+_-P]|=G*128}});var Yn=I(Fe=>{"use strict";d();var kt=Ln(),Re=Bn(),Mn=typeof Symbol=="function"&& +typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Fe.Buffer= +f;Fe.SlowBuffer=Eo;Fe.INSPECT_MAX_BYTES=50;var ot=2147483647;Fe.kMaxLength=ot;f. TYPED_ARRAY_SUPPORT=wo();!f.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console. error=="function"&&console.error("This browser lacks typed array (Uint8Array) su\ pport which is required by `buffer` v5.x. Use `buffer` v4.x if you require old b\ @@ -43,49 +43,49 @@ return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.s r,e),r.foo()===42}catch{return!1}}a(wo,"typedArraySupport");Object.defineProperty( f.prototype,"parent",{enumerable:!0,get:a(function(){if(f.isBuffer(this))return this. buffer},"get")});Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:a( -function(){if(f.isBuffer(this))return this.byteOffset},"get")});function pe(r){if(r> +function(){if(f.isBuffer(this))return this.byteOffset},"get")});function fe(r){if(r> ot)throw new RangeError('The value "'+r+'" is invalid for option "size"');let e=new Uint8Array( -r);return Object.setPrototypeOf(e,f.prototype),e}a(pe,"createBuffer");function f(r,e,t){ +r);return Object.setPrototypeOf(e,f.prototype),e}a(fe,"createBuffer");function f(r,e,t){ if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" a\ -rgument must be of type string. Received type number');return Nt(r)}return On(r, -e,t)}a(f,"Buffer");f.poolSize=8192;function On(r,e,t){if(typeof r=="string")return So( +rgument must be of type string. Received type number');return Ut(r)}return Dn(r, +e,t)}a(f,"Buffer");f.poolSize=8192;function Dn(r,e,t){if(typeof r=="string")return So( r,e);if(ArrayBuffer.isView(r))return xo(r);if(r==null)throw new TypeError("The f\ irst argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-l\ -ike Object. Received type "+typeof r);if(ce(r,ArrayBuffer)||r&&ce(r.buffer,ArrayBuffer)|| -typeof SharedArrayBuffer<"u"&&(ce(r,SharedArrayBuffer)||r&&ce(r.buffer,SharedArrayBuffer))) -return Ut(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument\ +ike Object. Received type "+typeof r);if(ue(r,ArrayBuffer)||r&&ue(r.buffer,ArrayBuffer)|| +typeof SharedArrayBuffer<"u"&&(ue(r,SharedArrayBuffer)||r&&ue(r.buffer,SharedArrayBuffer))) +return Qt(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument\ must not be of type number. Received type number');let n=r.valueOf&&r.valueOf(); -if(n!=null&&n!==r)return f.from(n,e,t);let i=Eo(r);if(i)return i;if(typeof Symbol< +if(n!=null&&n!==r)return f.from(n,e,t);let i=vo(r);if(i)return i;if(typeof Symbol< "u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return f. from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argumen\ t must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. \ -Received type "+typeof r)}a(On,"from");f.from=function(r,e,t){return On(r,e,t)}; +Received type "+typeof r)}a(Dn,"from");f.from=function(r,e,t){return Dn(r,e,t)}; Object.setPrototypeOf(f.prototype,Uint8Array.prototype);Object.setPrototypeOf(f, -Uint8Array);function Nn(r){if(typeof r!="number")throw new TypeError('"size" arg\ +Uint8Array);function Un(r){if(typeof r!="number")throw new TypeError('"size" arg\ ument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is\ - invalid for option "size"')}a(Nn,"assertSize");function bo(r,e,t){return Nn(r), -r<=0?pe(r):e!==void 0?typeof t=="string"?pe(r).fill(e,t):pe(r).fill(e):pe(r)}a(bo, -"alloc");f.alloc=function(r,e,t){return bo(r,e,t)};function Nt(r){return Nn(r),pe( -r<0?0:qt(r)|0)}a(Nt,"allocUnsafe");f.allocUnsafe=function(r){return Nt(r)};f.allocUnsafeSlow= -function(r){return Nt(r)};function So(r,e){if((typeof e!="string"||e==="")&&(e="\ + invalid for option "size"')}a(Un,"assertSize");function bo(r,e,t){return Un(r), +r<=0?fe(r):e!==void 0?typeof t=="string"?fe(r).fill(e,t):fe(r).fill(e):fe(r)}a(bo, +"alloc");f.alloc=function(r,e,t){return bo(r,e,t)};function Ut(r){return Un(r),fe( +r<0?0:qt(r)|0)}a(Ut,"allocUnsafe");f.allocUnsafe=function(r){return Ut(r)};f.allocUnsafeSlow= +function(r){return Ut(r)};function So(r,e){if((typeof e!="string"||e==="")&&(e="\ utf8"),!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=qn(r,e)| -0,n=pe(t),i=n.write(r,e);return i!==t&&(n=n.slice(0,i)),n}a(So,"fromString");function kt(r){ -let e=r.length<0?0:qt(r.length)|0,t=pe(e);for(let n=0;n= +n,f.prototype),n}a(Qt,"fromArrayBuffer");function vo(r){if(f.isBuffer(r)){let e=qt( +r.length)|0,t=fe(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0) +return typeof r.length!="number"||Wt(r.length)?fe(0):Ot(r);if(r.type==="Buffer"&& +Array.isArray(r.data))return Ot(r.data)}a(vo,"fromObject");function qt(r){if(r>= ot)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ -ot.toString(16)+" bytes");return r|0}a(qt,"checked");function vo(r){return+r!=r&& -(r=0),f.alloc(+r)}a(vo,"SlowBuffer");f.isBuffer=a(function(e){return e!=null&&e. -_isBuffer===!0&&e!==f.prototype},"isBuffer");f.compare=a(function(e,t){if(ce(e,Uint8Array)&& -(e=f.from(e,e.offset,e.byteLength)),ce(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)), +ot.toString(16)+" bytes");return r|0}a(qt,"checked");function Eo(r){return+r!=r&& +(r=0),f.alloc(+r)}a(Eo,"SlowBuffer");f.isBuffer=a(function(e){return e!=null&&e. +_isBuffer===!0&&e!==f.prototype},"isBuffer");f.compare=a(function(e,t){if(ue(e,Uint8Array)&& +(e=f.from(e,e.offset,e.byteLength)),ue(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)), !f.isBuffer(e)||!f.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments\ must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,i=t. length;for(let s=0,o=Math.min(n,i);si.length?(f.isBuffer( +for(n=0;ni.length?(f.isBuffer( o)||(o=f.from(o)),o.copy(i,s)):Uint8Array.prototype.set.call(i,o,s);else if(f.isBuffer( o))o.copy(i,s);else throw new TypeError('"list" argument must be an Array of Buf\ fers');s+=o.length}return i},"concat");function qn(r,e){if(f.isBuffer(r))return r. -length;if(ArrayBuffer.isView(r)||ce(r,ArrayBuffer))return r.byteLength;if(typeof r!= +length;if(ArrayBuffer.isView(r)||ue(r,ArrayBuffer))return r.byteLength;if(typeof r!= "string")throw new TypeError('The "string" argument must be one of type string, \ Buffer, or ArrayBuffer. Received type '+typeof r);let t=r.length,n=arguments.length> 2&&arguments[2]===!0;if(!n&&t===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"\ -latin1":case"binary":return t;case"utf8":case"utf-8":return Ot(r).length;case"uc\ +latin1":case"binary":return t;case"utf8":case"utf-8":return Dt(r).length;case"uc\ s2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"\ -base64":return zn(r).length;default:if(i)return n?-1:Ot(r).length;e=(""+e).toLowerCase(), -i=!0}}a(qn,"byteLength");f.byteLength=qn;function _o(r,e,t){let n=!1;if((e===void 0|| +base64":return zn(r).length;default:if(i)return n?-1:Dt(r).length;e=(""+e).toLowerCase(), +i=!0}}a(qn,"byteLength");f.byteLength=qn;function Ao(r,e,t){let n=!1;if((e===void 0|| e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)|| (t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Mo( -this,e,t);case"utf8":case"utf-8":return jn(this,e,t);case"ascii":return Ro(this, -e,t);case"latin1":case"binary":return Fo(this,e,t);case"base64":return Bo(this,e, -t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Do(this,e,t);default: +this,e,t);case"utf8":case"utf-8":return Wn(this,e,t);case"ascii":return Lo(this, +e,t);case"latin1":case"binary":return Bo(this,e,t);case"base64":return Po(this,e, +t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ko(this,e,t);default: if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a( -_o,"slowToString");f.prototype._isBuffer=!0;function Ae(r,e,t){let n=r[e];r[e]=r[t], -r[t]=n}a(Ae,"swap");f.prototype.swap16=a(function(){let e=this.length;if(e%2!==0) +Ao,"slowToString");f.prototype._isBuffer=!0;function _e(r,e,t){let n=r[e];r[e]=r[t], +r[t]=n}a(_e,"swap");f.prototype.swap16=a(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;t< -e;t+=2)Ae(this,t,t+1);return this},"swap16");f.prototype.swap32=a(function(){let e=this. +e;t+=2)_e(this,t,t+1);return this},"swap16");f.prototype.swap32=a(function(){let e=this. length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bit\ -s");for(let t=0;tt&&(e+=" ... "),""},"inspect");Mn&&(f.prototype[Mn]=f.prototype.inspect);f.prototype.compare= -a(function(e,t,n,i,s){if(ce(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f. +a(function(e,t,n,i,s){if(ue(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f. isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffe\ r or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e? e.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),t<0||n>e.length||i<0|| s>this.length)throw new RangeError("out of range index");if(i>=s&&t>=n)return 0; if(i>=s)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,s>>>=0,this===e)return 0; -let o=s-i,u=n-t,c=Math.min(o,u),h=this.slice(i,s),l=e.slice(t,n);for(let d=0;d2147483647?t=2147483647: -t<-2147483648&&(t=-2147483648),t=+t,jt(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t), +t<-2147483648&&(t=-2147483648),t=+t,Wt(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t), t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e== -"string"&&(e=f.from(e,n)),f.isBuffer(e))return e.length===0?-1:Dn(r,e,t,n,i);if(typeof e== +"string"&&(e=f.from(e,n)),f.isBuffer(e))return e.length===0?-1:kn(r,e,t,n,i);if(typeof e== "number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array. -prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Dn(r, -[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Qn,"bid\ -irectionalIndexOf");function Dn(r,e,t,n,i){let s=1,o=r.length,u=e.length;if(n!== +prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):kn(r, +[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Nn,"bid\ +irectionalIndexOf");function kn(r,e,t,n,i){let s=1,o=r.length,u=e.length;if(n!== void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="\ -utf-16le")){if(r.length<2||e.length<2)return-1;s=2,o/=2,u/=2,t/=2}function c(l,d){ -return s===1?l[d]:l.readUInt16BE(d*s)}a(c,"read");let h;if(i){let l=-1;for(h=t;h< -o;h++)if(c(r,h)===c(e,l===-1?0:h-l)){if(l===-1&&(l=h),h-l+1===u)return l*s}else l!== --1&&(h-=h-l),l=-1}else for(t+u>o&&(t=o-u),h=t;h>=0;h--){let l=!0;for(let d=0;do&&(t=o-u),l=t;l>=0;l--){let h=!0;for(let p=0;pi&&(n=i)):n=i;let s=e.length;n> -s/2&&(n=s/2);let o;for(o=0;o>>0,isFinite(n)? (n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.wri\ te(string, encoding, offset[, length]) is no longer supported");let s=this.length- t;if((n===void 0||n>s)&&(n=s),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError( "Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"\ -hex":return Ao(this,e,t,n);case"utf8":case"utf-8":return Co(this,e,t,n);case"asc\ +hex":return _o(this,e,t,n);case"utf8":case"utf-8":return Co(this,e,t,n);case"asc\ ii":case"latin1":case"binary":return To(this,e,t,n);case"base64":return Io(this, -e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Po(this,e,t,n);default: +e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ro(this,e,t,n);default: if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"\ write");f.prototype.toJSON=a(function(){return{type:"Buffer",data:Array.prototype. -slice.call(this._arr||this,0)}},"toJSON");function Bo(r,e,t){return e===0&&t===r. -length?Dt.fromByteArray(r):Dt.fromByteArray(r.slice(e,t))}a(Bo,"base64Slice");function jn(r,e,t){ +slice.call(this._arr||this,0)}},"toJSON");function Po(r,e,t){return e===0&&t===r. +length?kt.fromByteArray(r):kt.fromByteArray(r.slice(e,t))}a(Po,"base64Slice");function Wn(r,e,t){ t=Math.min(r.length,t);let n=[],i=e;for(;i239?4:s>223? -3:s>191?2:1;if(i+u<=t){let c,h,l,d;switch(u){case 1:s<128&&(o=s);break;case 2:c= -r[i+1],(c&192)===128&&(d=(s&31)<<6|c&63,d>127&&(o=d));break;case 3:c=r[i+1],h=r[i+ -2],(c&192)===128&&(h&192)===128&&(d=(s&15)<<12|(c&63)<<6|h&63,d>2047&&(d<55296|| -d>57343)&&(o=d));break;case 4:c=r[i+1],h=r[i+2],l=r[i+3],(c&192)===128&&(h&192)=== -128&&(l&192)===128&&(d=(s&15)<<18|(c&63)<<12|(h&63)<<6|l&63,d>65535&&d<1114112&& -(o=d))}}o===null?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320| -o&1023),n.push(o),i+=u}return Lo(n)}a(jn,"utf8Slice");var kn=4096;function Lo(r){ -let e=r.length;if(e<=kn)return String.fromCharCode.apply(String,r);let t="",n=0; -for(;n191?2:1;if(i+u<=t){let c,l,h,p;switch(u){case 1:s<128&&(o=s);break;case 2:c= +r[i+1],(c&192)===128&&(p=(s&31)<<6|c&63,p>127&&(o=p));break;case 3:c=r[i+1],l=r[i+ +2],(c&192)===128&&(l&192)===128&&(p=(s&15)<<12|(c&63)<<6|l&63,p>2047&&(p<55296|| +p>57343)&&(o=p));break;case 4:c=r[i+1],l=r[i+2],h=r[i+3],(c&192)===128&&(l&192)=== +128&&(h&192)===128&&(p=(s&15)<<18|(c&63)<<12|(l&63)<<6|h&63,p>65535&&p<1114112&& +(o=p))}}o===null?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320| +o&1023),n.push(o),i+=u}return Fo(n)}a(Wn,"utf8Slice");var On=4096;function Fo(r){ +let e=r.length;if(e<=On)return String.fromCharCode.apply(String,r);let t="",n=0; +for(;nn)&&(t=n);let i="";for(let s=e;sn)&&(t=n);let i="";for(let s=e;sn&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),tt)throw new RangeError( -"Trying to access beyond buffer length")}a(N,"checkOffset");f.prototype.readUintLE= -f.prototype.readUIntLE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||N(e,t,this.length);let i=this[e], +"Trying to access beyond buffer length")}a(q,"checkOffset");f.prototype.readUintLE= +f.prototype.readUIntLE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||q(e,t,this.length);let i=this[e], s=1,o=0;for(;++o>>0,t=t>>>0,n||N(e,t,this. +readUintBE=f.prototype.readUIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||q(e,t,this. length);let i=this[e+--t],s=1;for(;t>0&&(s*=256);)i+=this[e+--t]*s;return i},"re\ adUIntBE");f.prototype.readUint8=f.prototype.readUInt8=a(function(e,t){return e= -e>>>0,t||N(e,1,this.length),this[e]},"readUInt8");f.prototype.readUint16LE=f.prototype. -readUInt16LE=a(function(e,t){return e=e>>>0,t||N(e,2,this.length),this[e]|this[e+ +e>>>0,t||q(e,1,this.length),this[e]},"readUInt8");f.prototype.readUint16LE=f.prototype. +readUInt16LE=a(function(e,t){return e=e>>>0,t||q(e,2,this.length),this[e]|this[e+ 1]<<8},"readUInt16LE");f.prototype.readUint16BE=f.prototype.readUInt16BE=a(function(e,t){ -return e=e>>>0,t||N(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");f.prototype. -readUint32LE=f.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||N(e,4,this. +return e=e>>>0,t||q(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");f.prototype. +readUint32LE=f.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||q(e,4,this. length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE"); f.prototype.readUint32BE=f.prototype.readUInt32BE=a(function(e,t){return e=e>>>0, -t||N(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"\ -readUInt32BE");f.prototype.readBigUInt64LE=ge(a(function(e){e=e>>>0,Le(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&We(e,this.length-8);let i=t+ +t||q(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"\ +readUInt32BE");f.prototype.readBigUInt64LE=ge(a(function(e){e=e>>>0,Pe(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&je(e,this.length-8);let i=t+ this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]* 2**16+n*2**24;return BigInt(i)+(BigInt(s)<>>0,Le(e,"offset");let t=this[e],n=this[e+7]; -(t===void 0||n===void 0)&&We(e,this.length-8);let i=t*2**24+this[++e]*2**16+this[++e]* +readBigUInt64BE=ge(a(function(e){e=e>>>0,Pe(e,"offset");let t=this[e],n=this[e+7]; +(t===void 0||n===void 0)&&je(e,this.length-8);let i=t*2**24+this[++e]*2**16+this[++e]* 2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt( i)<>>0,t=t>>>0,n||N(e,t,this.length);let i=this[e],s=1,o=0;for(;++o>>0,t=t>>>0,n||q(e,t,this.length);let i=this[e],s=1,o=0;for(;++o=s&&(i-=Math.pow(2,8*t)),i},"readIntLE");f.prototype. -readIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||N(e,t,this.length);let i=t,s=1,o=this[e+ +readIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||q(e,t,this.length);let i=t,s=1,o=this[e+ --i];for(;i>0&&(s*=256);)o+=this[e+--i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*t)), -o},"readIntBE");f.prototype.readInt8=a(function(e,t){return e=e>>>0,t||N(e,1,this. +o},"readIntBE");f.prototype.readInt8=a(function(e,t){return e=e>>>0,t||q(e,1,this. length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");f.prototype.readInt16LE= -a(function(e,t){e=e>>>0,t||N(e,2,this.length);let n=this[e]|this[e+1]<<8;return n& +a(function(e,t){e=e>>>0,t||q(e,2,this.length);let n=this[e]|this[e+1]<<8;return n& 32768?n|4294901760:n},"readInt16LE");f.prototype.readInt16BE=a(function(e,t){e=e>>> -0,t||N(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n}, -"readInt16BE");f.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||N(e,4,this. +0,t||q(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n}, +"readInt16BE");f.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||q(e,4,this. length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");f.prototype. -readInt32BE=a(function(e,t){return e=e>>>0,t||N(e,4,this.length),this[e]<<24|this[e+ +readInt32BE=a(function(e,t){return e=e>>>0,t||q(e,4,this.length),this[e]<<24|this[e+ 1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");f.prototype.readBigInt64LE=ge(a(function(e){ -e=e>>>0,Le(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&We(e, +e=e>>>0,Pe(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&je(e, this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt( i)<>>0,Le(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&We(e,this.length-8);let i=(t<< +igInt64LE"));f.prototype.readBigInt64BE=ge(a(function(e){e=e>>>0,Pe(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&je(e,this.length-8);let i=(t<< 24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,t||N(e,4,this.length),Be.read(this,e, +readFloatLE=a(function(e,t){return e=e>>>0,t||q(e,4,this.length),Re.read(this,e, !0,23,4)},"readFloatLE");f.prototype.readFloatBE=a(function(e,t){return e=e>>>0, -t||N(e,4,this.length),Be.read(this,e,!1,23,4)},"readFloatBE");f.prototype.readDoubleLE= -a(function(e,t){return e=e>>>0,t||N(e,8,this.length),Be.read(this,e,!0,52,8)},"r\ -eadDoubleLE");f.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||N(e,8,this. -length),Be.read(this,e,!1,52,8)},"readDoubleBE");function Y(r,e,t,n,i,s){if(!f.isBuffer( +t||q(e,4,this.length),Re.read(this,e,!1,23,4)},"readFloatBE");f.prototype.readDoubleLE= +a(function(e,t){return e=e>>>0,t||q(e,8,this.length),Re.read(this,e,!0,52,8)},"r\ +eadDoubleLE");f.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||q(e,8,this. +length),Re.read(this,e,!1,52,8)},"readDoubleBE");function Y(r,e,t,n,i,s){if(!f.isBuffer( r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e< s)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError( "Index out of range")}a(Y,"checkInt");f.prototype.writeUintLE=f.prototype.writeUIntLE= @@ -260,14 +260,14 @@ f.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||Y(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},"writeUInt32LE");f.prototype.writeUint32BE=f.prototype.writeUInt32BE=a(function(e,t,n){ return e=+e,t=t>>>0,n||Y(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},"writeUInt32BE");function Wn(r,e,t,n,i){Kn( +this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeUInt32BE");function jn(r,e,t,n,i){Kn( e,n,i,r,t,7);let s=Number(e&BigInt(4294967295));r[t++]=s,s=s>>8,r[t++]=s,s=s>>8, r[t++]=s,s=s>>8,r[t++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]= -o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,t}a(Wn,"wrtBigUInt64LE");function Hn(r,e,t,n,i){ +o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,t}a(jn,"wrtBigUInt64LE");function Hn(r,e,t,n,i){ Kn(e,n,i,r,t,7);let s=Number(e&BigInt(4294967295));r[t+7]=s,s=s>>8,r[t+6]=s,s=s>> 8,r[t+5]=s,s=s>>8,r[t+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+ 3]=o,o=o>>8,r[t+2]=o,o=o>>8,r[t+1]=o,o=o>>8,r[t]=o,t+8}a(Hn,"wrtBigUInt64BE");f. -prototype.writeBigUInt64LE=ge(a(function(e,t=0){return Wn(this,e,t,BigInt(0),BigInt( +prototype.writeBigUInt64LE=ge(a(function(e,t=0){return jn(this,e,t,BigInt(0),BigInt( "0xffffffffffffffff"))},"writeBigUInt64LE"));f.prototype.writeBigUInt64BE=ge(a(function(e,t=0){ return Hn(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE")); f.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2, @@ -286,17 +286,17 @@ t+2},"writeInt16BE");f.prototype.writeInt32LE=a(function(e,t,n){return e=+e,t=t> e>>>16,this[t+3]=e>>>24,t+4},"writeInt32LE");f.prototype.writeInt32BE=a(function(e,t,n){ return e=+e,t=t>>>0,n||Y(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},"writeIn\ -t32BE");f.prototype.writeBigInt64LE=ge(a(function(e,t=0){return Wn(this,e,t,-BigInt( +t32BE");f.prototype.writeBigInt64LE=ge(a(function(e,t=0){return jn(this,e,t,-BigInt( "0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));f.prototype. writeBigInt64BE=ge(a(function(e,t=0){return Hn(this,e,t,-BigInt("0x8000000000000\ 000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Gn(r,e,t,n,i,s){ if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError( "Index out of range")}a(Gn,"checkIEEE754");function $n(r,e,t,n,i){return e=+e,t= -t>>>0,i||Gn(r,e,t,4,34028234663852886e22,-34028234663852886e22),Be.write(r,e,t,n, +t>>>0,i||Gn(r,e,t,4,34028234663852886e22,-34028234663852886e22),Re.write(r,e,t,n, 23,4),t+4}a($n,"writeFloat");f.prototype.writeFloatLE=a(function(e,t,n){return $n( this,e,t,!0,n)},"writeFloatLE");f.prototype.writeFloatBE=a(function(e,t,n){return $n( this,e,t,!1,n)},"writeFloatBE");function Vn(r,e,t,n,i){return e=+e,t=t>>>0,i||Gn( -r,e,t,8,17976931348623157e292,-17976931348623157e292),Be.write(r,e,t,n,52,8),t+8} +r,e,t,8,17976931348623157e292,-17976931348623157e292),Re.write(r,e,t,n,52,8),t+8} a(Vn,"writeDouble");f.prototype.writeDoubleLE=a(function(e,t,n){return Vn(this,e, t,!0,n)},"writeDoubleLE");f.prototype.writeDoubleBE=a(function(e,t,n){return Vn( this,e,t,!1,n)},"writeDoubleBE");f.prototype.copy=a(function(e,t,n,i){if(!f.isBuffer( @@ -317,32 +317,32 @@ length>>0, n=n===void 0?this.length:n>>>0,e||(e=0);let s;if(typeof e=="number")for(s=t;s2**32?i=Un(String(t)):typeof t=="bigint"&&(i=String(t), -(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Un(i)),i+="n"),n+=` It\ - must be ${e}. Received ${i}`,n},RangeError);function Un(r){let e="",t=r.length, +isInteger(t)&&Math.abs(t)>2**32?i=Qn(String(t)):typeof t=="bigint"&&(i=String(t), +(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Qn(i)),i+="n"),n+=` It\ + must be ${e}. Received ${i}`,n},RangeError);function Qn(r){let e="",t=r.length, n=r[0]==="-"?1:0;for(;t>=n+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0, -t)}${e}`}a(Un,"addNumericalSeparator");function ko(r,e,t){Le(e,"offset"),(r[e]=== -void 0||r[e+t]===void 0)&&We(e,r.length-(t+1))}a(ko,"checkBounds");function Kn(r,e,t,n,i,s){ +t)}${e}`}a(Qn,"addNumericalSeparator");function Oo(r,e,t){Pe(e,"offset"),(r[e]=== +void 0||r[e+t]===void 0)&&je(e,r.length-(t+1))}a(Oo,"checkBounds");function Kn(r,e,t,n,i,s){ if(r>t||r3?e===0||e===BigInt(0)?u= `>= 0${o} and < 2${o} ** ${(s+1)*8}${o}`:u=`>= -(2${o} ** ${(s+1)*8-1}${o}) and \ -< 2 ** ${(s+1)*8-1}${o}`:u=`>= ${e}${o} and <= ${t}${o}`,new Pe.ERR_OUT_OF_RANGE( -"value",u,r)}ko(n,i,s)}a(Kn,"checkIntBI");function Le(r,e){if(typeof r!="number") -throw new Pe.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Le,"validateNumber");function We(r,e,t){ -throw Math.floor(r)!==r?(Le(r,t),new Pe.ERR_OUT_OF_RANGE(t||"offset","an integer", -r)):e<0?new Pe.ERR_BUFFER_OUT_OF_BOUNDS:new Pe.ERR_OUT_OF_RANGE(t||"offset",`>= ${t? -1:0} and <= ${e}`,r)}a(We,"boundsError");var Uo=/[^+/0-9A-Za-z-_]/g;function Oo(r){ -if(r=r.split("=")[0],r=r.trim().replace(Uo,""),r.length<2)return"";for(;r.length% -4!==0;)r=r+"=";return r}a(Oo,"base64clean");function Ot(r,e){e=e||1/0;let t,n=r. +< 2 ** ${(s+1)*8-1}${o}`:u=`>= ${e}${o} and <= ${t}${o}`,new Ie.ERR_OUT_OF_RANGE( +"value",u,r)}Oo(n,i,s)}a(Kn,"checkIntBI");function Pe(r,e){if(typeof r!="number") +throw new Ie.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Pe,"validateNumber");function je(r,e,t){ +throw Math.floor(r)!==r?(Pe(r,t),new Ie.ERR_OUT_OF_RANGE(t||"offset","an integer", +r)):e<0?new Ie.ERR_BUFFER_OUT_OF_BOUNDS:new Ie.ERR_OUT_OF_RANGE(t||"offset",`>= ${t? +1:0} and <= ${e}`,r)}a(je,"boundsError");var Qo=/[^+/0-9A-Za-z-_]/g;function Do(r){ +if(r=r.split("=")[0],r=r.trim().replace(Qo,""),r.length<2)return"";for(;r.length% +4!==0;)r=r+"=";return r}a(Do,"base64clean");function Dt(r,e){e=e||1/0;let t,n=r. length,i=null,s=[];for(let o=0;o55295&&t<57344){if(!i){ if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&& s.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191, @@ -351,50 +351,50 @@ s.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191, s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>> 6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63| 128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}a( -Ot,"utf8ToBytes");function No(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s} -a(qo,"utf16leToBytes");function zn(r){return Dt.toByteArray(Oo(r))}a(zn,"base64T\ +a(qo,"utf16leToBytes");function zn(r){return kt.toByteArray(Do(r))}a(zn,"base64T\ oBytes");function at(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) -e[i+t]=r[i];return i}a(at,"blitBuffer");function ce(r,e){return r instanceof e|| +e[i+t]=r[i];return i}a(at,"blitBuffer");function ue(r,e){return r instanceof e|| r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name} -a(ce,"isInstance");function jt(r){return r!==r}a(jt,"numberIsNaN");var Qo=function(){ +a(ue,"isInstance");function Wt(r){return r!==r}a(Wt,"numberIsNaN");var No=function(){ let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){let n=t*16;for(let i=0;i< -16;++i)e[n+i]=r[t]+r[i]}return e}();function ge(r){return typeof BigInt>"u"?jo:r} -a(ge,"defineBigIntMethod");function jo(){throw new Error("BigInt not supported")} -a(jo,"BufferBigIntNotDefined")});var S,x,E,w,y,m,p=z(()=>{"use strict";S=globalThis,x=globalThis.setImmediate??(r=>setTimeout( -r,0)),E=globalThis.clearImmediate??(r=>clearTimeout(r)),w=globalThis.crypto??{}; +16;++i)e[n+i]=r[t]+r[i]}return e}();function ge(r){return typeof BigInt>"u"?Wo:r} +a(ge,"defineBigIntMethod");function Wo(){throw new Error("BigInt not supported")} +a(Wo,"BufferBigIntNotDefined")});var b,x,v,w,y,m,d=z(()=>{"use strict";b=globalThis,x=globalThis.setImmediate??(r=>setTimeout( +r,0)),v=globalThis.clearImmediate??(r=>clearTimeout(r)),w=globalThis.crypto??{}; w.subtle??(w.subtle={});y=typeof globalThis.Buffer=="function"&&typeof globalThis. Buffer.allocUnsafe=="function"?globalThis.Buffer:Yn().Buffer,m=globalThis.process?? {};m.env??(m.env={});try{m.nextTick(()=>{})}catch{let e=Promise.resolve();m.nextTick= -e.then.bind(e)}});var we=I((ih,Wt)=>{"use strict";p();var Fe=typeof Reflect=="object"?Reflect:null, -Zn=Fe&&typeof Fe.apply=="function"?Fe.apply:a(function(e,t,n){return Function.prototype. -apply.call(e,t,n)},"ReflectApply"),ut;Fe&&typeof Fe.ownKeys=="function"?ut=Fe.ownKeys: +e.then.bind(e)}});var we=I((ol,jt)=>{"use strict";d();var Le=typeof Reflect=="object"?Reflect:null, +Zn=Le&&typeof Le.apply=="function"?Le.apply:a(function(e,t,n){return Function.prototype. +apply.call(e,t,n)},"ReflectApply"),ut;Le&&typeof Le.ownKeys=="function"?ut=Le.ownKeys: Object.getOwnPropertySymbols?ut=a(function(e){return Object.getOwnPropertyNames( e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):ut=a(function(e){return Object. -getOwnPropertyNames(e)},"ReflectOwnKeys");function Wo(r){console&&console.warn&& -console.warn(r)}a(Wo,"ProcessEmitWarning");var Xn=Number.isNaN||a(function(e){return e!== -e},"NumberIsNaN");function L(){L.init.call(this)}a(L,"EventEmitter");Wt.exports= -L;Wt.exports.once=Vo;L.EventEmitter=L;L.prototype._events=void 0;L.prototype._eventsCount= -0;L.prototype._maxListeners=void 0;var Jn=10;function ct(r){if(typeof r!="functi\ +getOwnPropertyNames(e)},"ReflectOwnKeys");function jo(r){console&&console.warn&& +console.warn(r)}a(jo,"ProcessEmitWarning");var Xn=Number.isNaN||a(function(e){return e!== +e},"NumberIsNaN");function F(){F.init.call(this)}a(F,"EventEmitter");jt.exports= +F;jt.exports.once=Vo;F.EventEmitter=F;F.prototype._events=void 0;F.prototype._eventsCount= +0;F.prototype._maxListeners=void 0;var Jn=10;function ct(r){if(typeof r!="functi\ on")throw new TypeError('The "listener" argument must be of type Function. Recei\ -ved type '+typeof r)}a(ct,"checkListener");Object.defineProperty(L,"defaultMaxLi\ +ved type '+typeof r)}a(ct,"checkListener");Object.defineProperty(F,"defaultMaxLi\ steners",{enumerable:!0,get:a(function(){return Jn},"get"),set:a(function(r){if(typeof r!= "number"||r<0||Xn(r))throw new RangeError('The value of "defaultMaxListeners" is\ out of range. It must be a non-negative number. Received '+r+".");Jn=r},"set")}); -L.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this). +F.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this). _events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners= -this._maxListeners||void 0};L.prototype.setMaxListeners=a(function(e){if(typeof e!= +this._maxListeners||void 0};F.prototype.setMaxListeners=a(function(e){if(typeof e!= "number"||e<0||Xn(e))throw new RangeError('The value of "n" is out of range. It \ must be a non-negative number. Received '+e+".");return this._maxListeners=e,this}, -"setMaxListeners");function ei(r){return r._maxListeners===void 0?L.defaultMaxListeners: -r._maxListeners}a(ei,"_getMaxListeners");L.prototype.getMaxListeners=a(function(){ -return ei(this)},"getMaxListeners");L.prototype.emit=a(function(e){for(var t=[], +"setMaxListeners");function ei(r){return r._maxListeners===void 0?F.defaultMaxListeners: +r._maxListeners}a(ei,"_getMaxListeners");F.prototype.getMaxListeners=a(function(){ +return ei(this)},"getMaxListeners");F.prototype.emit=a(function(e){for(var t=[], n=1;n 0&&(o=t[0]),o instanceof Error)throw o;var u=new Error("Unhandled error."+(o?" ("+ o.message+")":""));throw u.context=o,u}var c=s[e];if(c===void 0)return!1;if(typeof c== -"function")Zn(c,this,t);else for(var h=c.length,l=si(c,h),n=0;n0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Po\ ssible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners a\ dded. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExce\ -ededWarning",u.emitter=r,u.type=e,u.count=o.length,Wo(u)}return r}a(ti,"_addList\ -ener");L.prototype.addListener=a(function(e,t){return ti(this,e,t,!1)},"addListe\ -ner");L.prototype.on=L.prototype.addListener;L.prototype.prependListener=a(function(e,t){ +ededWarning",u.emitter=r,u.type=e,u.count=o.length,jo(u)}return r}a(ti,"_addList\ +ener");F.prototype.addListener=a(function(e,t){return ti(this,e,t,!1)},"addListe\ +ner");F.prototype.on=F.prototype.addListener;F.prototype.prependListener=a(function(e,t){ return ti(this,e,t,!0)},"prependListener");function Ho(){if(!this.fired)return this. target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0? this.listener.call(this.target):this.listener.apply(this.target,arguments)}a(Ho, "onceWrapper");function ri(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e, -listener:t},i=Ho.bind(n);return i.listener=t,n.wrapFn=i,i}a(ri,"_onceWrap");L.prototype. -once=a(function(e,t){return ct(t),this.on(e,ri(this,e,t)),this},"once");L.prototype. +listener:t},i=Ho.bind(n);return i.listener=t,n.wrapFn=i,i}a(ri,"_onceWrap");F.prototype. +once=a(function(e,t){return ct(t),this.on(e,ri(this,e,t)),this},"once");F.prototype. prependOnceListener=a(function(e,t){return ct(t),this.prependListener(e,ri(this, -e,t)),this},"prependOnceListener");L.prototype.removeListener=a(function(e,t){var n, +e,t)),this},"prependOnceListener");F.prototype.removeListener=a(function(e,t){var n, i,s,o,u;if(ct(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this; if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null): (delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!= "function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){u=n[o]. listener,s=o;break}if(s<0)return this;s===0?n.shift():Go(n,s),n.length===1&&(i[e]= n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||t)}return this}, -"removeListener");L.prototype.off=L.prototype.removeListener;L.prototype.removeAllListeners= +"removeListener");F.prototype.off=F.prototype.removeListener;F.prototype.removeAllListeners= a(function(e){var t,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener=== void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount= 0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]), @@ -429,13 +429,13 @@ o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners( n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(i=t.length- 1;i>=0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function ni(r,e,t){ var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i== -"function"?t?[i.listener||i]:[i]:t?$o(i):si(i,i.length)}a(ni,"_listeners");L.prototype. -listeners=a(function(e){return ni(this,e,!0)},"listeners");L.prototype.rawListeners= -a(function(e){return ni(this,e,!1)},"rawListeners");L.listenerCount=function(r,e){ -return typeof r.listenerCount=="function"?r.listenerCount(e):ii.call(r,e)};L.prototype. +"function"?t?[i.listener||i]:[i]:t?$o(i):si(i,i.length)}a(ni,"_listeners");F.prototype. +listeners=a(function(e){return ni(this,e,!0)},"listeners");F.prototype.rawListeners= +a(function(e){return ni(this,e,!1)},"rawListeners");F.listenerCount=function(r,e){ +return typeof r.listenerCount=="function"?r.listenerCount(e):ii.call(r,e)};F.prototype. listenerCount=ii;function ii(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t== "function")return 1;if(t!==void 0)return t.length}return 0}a(ii,"listenerCount"); -L.prototype.eventNames=a(function(){return this._eventsCount>0?ut(this._events): +F.prototype.eventNames=a(function(){return this._eventsCount>0?ut(this._events): []},"eventNames");function si(r,e){for(var t=new Array(e),n=0;nzo});var zo,Ge=z(()=>{"use strict";p();zo={}});function $e(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119, -o=2600822924,u=528734635,c=1541459225,h=0,l=0,d=[1116352408,1899447441,3049323471, +ed type '+typeof r)}a(oi,"eventTargetAgnosticAddListener")});var He={};te(He,{default:()=>zo});var zo,Ge=z(()=>{"use strict";d();zo={}});function $e(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119, +o=2600822924,u=528734635,c=1541459225,l=0,h=0,p=[1116352408,1899447441,3049323471, 3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278, 1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078, 604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808, @@ -457,33 +457,33 @@ o=2600822924,u=528734635,c=1541459225,h=0,l=0,d=[1116352408,1899447441,304932347 1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800, 3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556, 883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452, -2361852424,2428436474,2756734187,3204031479,3329325298],b=a((A,g)=>A>>>g|A<<32-g, -"rrot"),C=new Uint32Array(64),B=new Uint8Array(64),Q=a(()=>{for(let R=0,$=0;R<16;R++, -$+=4)C[R]=B[$]<<24|B[$+1]<<16|B[$+2]<<8|B[$+3];for(let R=16;R<64;R++){let $=b(C[R- -15],7)^b(C[R-15],18)^C[R-15]>>>3,le=b(C[R-2],17)^b(C[R-2],19)^C[R-2]>>>10;C[R]=C[R- -16]+$+C[R-7]+le|0}let A=e,g=t,P=n,K=i,k=s,j=o,ee=u,ae=c;for(let R=0;R<64;R++){let $=b( -k,6)^b(k,11)^b(k,25),le=k&j^~k&ee,me=ae+$+le+d[R]+C[R]|0,Ee=b(A,2)^b(A,13)^b(A,22), -je=A&g^A&P^g&P,fe=Ee+je|0;ae=ee,ee=j,j=k,k=K+me|0,K=P,P=g,g=A,A=me+fe|0}e=e+A|0, -t=t+g|0,n=n+P|0,i=i+K|0,s=s+k|0,o=o+j|0,u=u+ee|0,c=c+ae|0,l=0},"process"),X=a(A=>{ -typeof A=="string"&&(A=new TextEncoder().encode(A));for(let g=0;g{if(B[l++]=128,l==64&&Q(),l+8>64){ -for(;l<64;)B[l++]=0;Q()}for(;l<58;)B[l++]=0;let A=h*8;B[l++]=A/1099511627776&255, -B[l++]=A/4294967296&255,B[l++]=A>>>24,B[l++]=A>>>16&255,B[l++]=A>>>8&255,B[l++]= -A&255,Q();let g=new Uint8Array(32);return g[0]=e>>>24,g[1]=e>>>16&255,g[2]=e>>>8& +2361852424,2428436474,2756734187,3204031479,3329325298],S=a((C,g)=>C>>>g|C<<32-g, +"rrot"),_=new Uint32Array(64),P=new Uint8Array(64),G=a(()=>{for(let L=0,$=0;L<16;L++, +$+=4)_[L]=P[$]<<24|P[$+1]<<16|P[$+2]<<8|P[$+3];for(let L=16;L<64;L++){let $=S(_[L- +15],7)^S(_[L-15],18)^_[L-15]>>>3,le=S(_[L-2],17)^S(_[L-2],19)^_[L-2]>>>10;_[L]=_[L- +16]+$+_[L-7]+le|0}let C=e,g=t,R=n,W=i,Q=s,j=o,ee=u,oe=c;for(let L=0;L<64;L++){let $=S( +Q,6)^S(Q,11)^S(Q,25),le=Q&j^~Q&ee,pe=oe+$+le+p[L]+_[L]|0,ve=S(C,2)^S(C,13)^S(C,22), +We=C&g^C&R^g&R,he=ve+We|0;oe=ee,ee=j,j=Q,Q=W+pe|0,W=R,R=g,g=C,C=pe+he|0}e=e+C|0, +t=t+g|0,n=n+R|0,i=i+W|0,s=s+Q|0,o=o+j|0,u=u+ee|0,c=c+oe|0,h=0},"process"),X=a(C=>{ +typeof C=="string"&&(C=new TextEncoder().encode(C));for(let g=0;g{if(P[h++]=128,h==64&&G(),h+8>64){ +for(;h<64;)P[h++]=0;G()}for(;h<58;)P[h++]=0;let C=l*8;P[h++]=C/1099511627776&255, +P[h++]=C/4294967296&255,P[h++]=C>>>24,P[h++]=C>>>16&255,P[h++]=C>>>8&255,P[h++]= +C&255,G();let g=new Uint8Array(32);return g[0]=e>>>24,g[1]=e>>>16&255,g[2]=e>>>8& 255,g[3]=e&255,g[4]=t>>>24,g[5]=t>>>16&255,g[6]=t>>>8&255,g[7]=t&255,g[8]=n>>>24, g[9]=n>>>16&255,g[10]=n>>>8&255,g[11]=n&255,g[12]=i>>>24,g[13]=i>>>16&255,g[14]= i>>>8&255,g[15]=i&255,g[16]=s>>>24,g[17]=s>>>16&255,g[18]=s>>>8&255,g[19]=s&255, g[20]=o>>>24,g[21]=o>>>16&255,g[22]=o>>>8&255,g[23]=o&255,g[24]=u>>>24,g[25]=u>>> 16&255,g[26]=u>>>8&255,g[27]=u&255,g[28]=c>>>24,g[29]=c>>>16&255,g[30]=c>>>8&255, -g[31]=c&255,g},"digest");return r===void 0?{add:X,digest:ye}:(X(r),ye())}var ai=z( -()=>{"use strict";p();a($e,"sha256")});var U,Ve,ui=z(()=>{"use strict";p();U=class U{constructor(){_(this,"_dataLength", -0);_(this,"_bufferLength",0);_(this,"_state",new Int32Array(4));_(this,"_buffer", -new ArrayBuffer(68));_(this,"_buffer8");_(this,"_buffer32");this._buffer8=new Uint8Array( +g[31]=c&255,g},"digest");return r===void 0?{add:X,digest:se}:(X(r),se())}var ai=z( +()=>{"use strict";d();a($e,"sha256")});var D,Ve,ui=z(()=>{"use strict";d();D=class D{constructor(){A(this,"_dataLength", +0);A(this,"_bufferLength",0);A(this,"_state",new Int32Array(4));A(this,"_buffer", +new ArrayBuffer(68));A(this,"_buffer8");A(this,"_buffer32");this._buffer8=new Uint8Array( this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}static hashByteArray(e,t=!1){ return this.onePassHasher.start().appendByteArray(e).end(t)}static hashStr(e,t=!1){ return this.onePassHasher.start().appendStr(e).end(t)}static hashAsciiStr(e,t=!1){ -return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(e){let t=U. -hexChars,n=U.hexOut,i,s,o,u;for(u=0;u<4;u+=1)for(s=u*8,i=e[u],o=0;o<8;o+=2)n[s+1+ +return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(e){let t=D. +hexChars,n=D.hexOut,i,s,o,u;for(u=0;u<4;u+=1)for(s=u*8,i=e[u],o=0;o<8;o+=2)n[s+1+ o]=t.charAt(i&15),i>>>=4,n[s+0+o]=t.charAt(i&15),i>>>=4;return n.join("")}static _md5cycle(e,t){ let n=e[0],i=e[1],s=e[2],o=e[3];n+=(i&s|~i&o)+t[0]-680876936|0,n=(n<<7|n>>>25)+i| 0,o+=(n&i|~n&s)+t[1]-389564586|0,o=(o<<12|o>>>20)+n|0,s+=(o&n|~o&i)+t[2]+606105819| @@ -527,47 +527,48 @@ i>>>11)+s|0,n+=(s^(i|~o))+t[4]-145523070|0,n=(n<<6|n>>>26)+i|0,o+=(i^(n|~s))+t[1 1120210379|0,o=(o<<10|o>>>22)+n|0,s+=(n^(o|~i))+t[2]+718787259|0,s=(s<<15|s>>>17)+ o|0,i+=(o^(s|~n))+t[9]-343485551|0,i=(i<<21|i>>>11)+s|0,e[0]=n+e[0]|0,e[1]=i+e[1]| 0,e[2]=s+e[2]|0,e[3]=o+e[3]|0}start(){return this._dataLength=0,this._bufferLength= -0,this._state.set(U.stateIdentity),this}appendStr(e){let t=this._buffer8,n=this. +0,this._state.set(D.stateIdentity),this}appendStr(e){let t=this._buffer8,n=this. _buffer32,i=this._bufferLength,s,o;for(o=0;o>>6)+192,t[i++]=s&63|128;else if(s<55296|| s>56319)t[i++]=(s>>>12)+224,t[i++]=s>>>6&63|128,t[i++]=s&63|128;else{if(s=(s-55296)* 1024+(e.charCodeAt(++o)-56320)+65536,s>1114111)throw new Error("Unicode standard\ supports code points up to U+10FFFF");t[i++]=(s>>>18)+240,t[i++]=s>>>12&63|128, -t[i++]=s>>>6&63|128,t[i++]=s&63|128}i>=64&&(this._dataLength+=64,U._md5cycle(this. +t[i++]=s>>>6&63|128,t[i++]=s&63|128}i>=64&&(this._dataLength+=64,D._md5cycle(this. _state,n),i-=64,n[0]=n[16])}return this._bufferLength=i,this}appendAsciiStr(e){let t=this. _buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(e.length- -o,64-i);s--;)t[i++]=e.charCodeAt(o++);if(i<64)break;this._dataLength+=64,U._md5cycle( +o,64-i);s--;)t[i++]=e.charCodeAt(o++);if(i<64)break;this._dataLength+=64,D._md5cycle( this._state,n),i=0}return this._bufferLength=i,this}appendByteArray(e){let t=this. _buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(e.length- -o,64-i);s--;)t[i++]=e[o++];if(i<64)break;this._dataLength+=64,U._md5cycle(this._state, +o,64-i);s--;)t[i++]=e[o++];if(i<64)break;this._dataLength+=64,D._md5cycle(this._state, n),i=0}return this._bufferLength=i,this}getState(){let e=this._state;return{buffer:String. fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this. _dataLength,state:[e[0],e[1],e[2],e[3]]}}setState(e){let t=e.buffer,n=e.state,i=this. _state,s;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=n[0],i[1]= n[1],i[2]=n[2],i[3]=n[3],s=0;s>2)+1;this._dataLength+= -t;let o=this._dataLength*8;if(n[t]=128,n[t+1]=n[t+2]=n[t+3]=0,i.set(U.buffer32Identity. -subarray(s),s),t>55&&(U._md5cycle(this._state,i),i.set(U.buffer32Identity)),o<=4294967295) +t;let o=this._dataLength*8;if(n[t]=128,n[t+1]=n[t+2]=n[t+3]=0,i.set(D.buffer32Identity. +subarray(s),s),t>55&&(D._md5cycle(this._state,i),i.set(D.buffer32Identity)),o<=4294967295) i[14]=o;else{let u=o.toString(16).match(/(.*?)(.{0,8})$/);if(u===null)return;let c=parseInt( -u[2],16),h=parseInt(u[1],16)||0;i[14]=c,i[15]=h}return U._md5cycle(this._state,i), -e?this._state:U._hex(this._state)}};a(U,"Md5"),_(U,"stateIdentity",new Int32Array( -[1732584193,-271733879,-1732584194,271733878])),_(U,"buffer32Identity",new Int32Array( -[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),_(U,"hexChars","0123456789abcdef"),_(U,"hexO\ -ut",[]),_(U,"onePassHasher",new U);Ve=U});var Ht={};re(Ht,{createHash:()=>Zo,createHmac:()=>Jo,randomBytes:()=>Yo});function Yo(r){ -return w.getRandomValues(y.alloc(r))}function Zo(r){if(r==="sha256")return{update:a( -function(e){return{digest:a(function(){return y.from($e(e))},"digest")}},"update")}; -if(r==="md5")return{update:a(function(e){return{digest:a(function(){return typeof e== -"string"?Ve.hashStr(e):Ve.hashByteArray(e)},"digest")}},"update")};throw new Error( -`Hash type '${r}' not supported`)}function Jo(r,e){if(r!=="sha256")throw new Error( +u[2],16),l=parseInt(u[1],16)||0;i[14]=c,i[15]=l}return D._md5cycle(this._state,i), +e?this._state:D._hex(this._state)}};a(D,"Md5"),A(D,"stateIdentity",new Int32Array( +[1732584193,-271733879,-1732584194,271733878])),A(D,"buffer32Identity",new Int32Array( +[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),A(D,"hexChars","0123456789abcdef"),A(D,"hexO\ +ut",[]),A(D,"onePassHasher",new D);Ve=D});var Ht={};te(Ht,{createHash:()=>Jo,createHmac:()=>Xo,randomBytes:()=>Zo});function Zo(r){ +return typeof w<"u"&&w.randomBytes!==void 0?(w.webcrypto??w).getRandomValues(y.alloc( +r)):require(Yo).randomBytes(r)}function Jo(r){if(r==="sha256")return{update:a(function(e){ +return{digest:a(function(){return y.from($e(e))},"digest")}},"update")};if(r==="\ +md5")return{update:a(function(e){return{digest:a(function(){return typeof e=="st\ +ring"?Ve.hashStr(e):Ve.hashByteArray(e)},"digest")}},"update")};throw new Error( +`Hash type '${r}' not supported`)}function Xo(r,e){if(r!=="sha256")throw new Error( `Only sha256 is supported (requested: '${r}')`);return{update:a(function(t){return{ digest:a(function(){typeof e=="string"&&(e=new TextEncoder().encode(e)),typeof t== "string"&&(t=new TextEncoder().encode(t));let n=e.length;if(n>64)e=$e(e);else if(n< 64){let c=new Uint8Array(64);c.set(e),e=c}let i=new Uint8Array(64),s=new Uint8Array( 64);for(let c=0;c<64;c++)i[c]=54^e[c],s[c]=92^e[c];let o=new Uint8Array(t.length+ 64);o.set(i,0),o.set(t,64);let u=new Uint8Array(96);return u.set(s,0),u.set($e(o), -64),y.from($e(u))},"digest")}},"update")}}var Gt=z(()=>{"use strict";p();ai();ui(); -a(Yo,"randomBytes");a(Zo,"createHash");a(Jo,"createHmac")});var Vt=I(ci=>{"use strict";p();ci.parse=function(r,e){return new $t(r,e).parse()}; -var ht=class ht{constructor(e,t){this.source=e,this.transform=t||Xo,this.position= +64),y.from($e(u))},"digest")}},"update")}}var Yo,Gt=z(()=>{"use strict";d();ai(); +ui();Yo="node:crypto";a(Zo,"randomBytes");a(Jo,"createHash");a(Xo,"createHmac")});var Vt=I(ci=>{"use strict";d();ci.parse=function(r,e){return new $t(r,e).parse()}; +var lt=class lt{constructor(e,t){this.source=e,this.transform=t||ea,this.position= 0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){return this.position>= this.source.length}nextCharacter(){var e=this.source[this.position++];return e=== "\\"?{value:this.source[this.position++],escaped:!0}:{value:e,escaped:!1}}record(e){ @@ -576,117 +577,117 @@ join(""),t==="NULL"&&!e&&(t=null),t!==null&&(t=this.transform(t)),this.entries.p t),this.recorded=[])}consumeDimensions(){if(this.source[0]==="[")for(;!this.isEof();){ var e=this.nextCharacter();if(e.value==="=")break}}parse(e){var t,n,i;for(this.consumeDimensions();!this. isEof();)if(t=this.nextCharacter(),t.value==="{"&&!i)this.dimension++,this.dimension> -1&&(n=new ht(this.source.substr(this.position-1),this.transform),this.entries.push( +1&&(n=new lt(this.source.substr(this.position-1),this.transform),this.entries.push( n.parse(!0)),this.position+=n.position-2);else if(t.value==="}"&&!i){if(this.dimension--, !this.dimension&&(this.newEntry(),e))return this.entries}else t.value==='"'&&!t. escaped?(i&&this.newEntry(!0),i=!i):t.value===","&&!i?this.newEntry():this.record( t.value);if(this.dimension!==0)throw new Error("array dimension not balanced");return this. -entries}};a(ht,"ArrayParser");var $t=ht;function Xo(r){return r}a(Xo,"identity")});var Kt=I((xh,hi)=>{p();var ea=Vt();hi.exports={create:a(function(r,e){return{parse:a( -function(){return ea.parse(r,e)},"parse")}},"create")}});var pi=I((_h,fi)=>{"use strict";p();var ta=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, -ra=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,na=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,ia=/^-?infinity$/; -fi.exports=a(function(e){if(ia.test(e))return Number(e.replace("i","I"));var t=ta. -exec(e);if(!t)return sa(e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=li(i));var s=parseInt( -t[2],10)-1,o=t[3],u=parseInt(t[4],10),c=parseInt(t[5],10),h=parseInt(t[6],10),l=t[7]; -l=l?1e3*parseFloat(l):0;var d,b=oa(e);return b!=null?(d=new Date(Date.UTC(i,s,o, -u,c,h,l)),zt(i)&&d.setUTCFullYear(i),b!==0&&d.setTime(d.getTime()-b)):(d=new Date( -i,s,o,u,c,h,l),zt(i)&&d.setFullYear(i)),d},"parseDate");function sa(r){var e=ra. -exec(r);if(e){var t=parseInt(e[1],10),n=!!e[4];n&&(t=li(t));var i=parseInt(e[2], -10)-1,s=e[3],o=new Date(t,i,s);return zt(t)&&o.setFullYear(t),o}}a(sa,"getDate"); -function oa(r){if(r.endsWith("+00"))return 0;var e=na.exec(r.split(" ")[1]);if(e){ +entries}};a(lt,"ArrayParser");var $t=lt;function ea(r){return r}a(ea,"identity")});var Kt=I((El,li)=>{d();var ta=Vt();li.exports={create:a(function(r,e){return{parse:a( +function(){return ta.parse(r,e)},"parse")}},"create")}});var di=I((Cl,fi)=>{"use strict";d();var ra=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, +na=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,ia=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,sa=/^-?infinity$/; +fi.exports=a(function(e){if(sa.test(e))return Number(e.replace("i","I"));var t=ra. +exec(e);if(!t)return oa(e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=hi(i));var s=parseInt( +t[2],10)-1,o=t[3],u=parseInt(t[4],10),c=parseInt(t[5],10),l=parseInt(t[6],10),h=t[7]; +h=h?1e3*parseFloat(h):0;var p,S=aa(e);return S!=null?(p=new Date(Date.UTC(i,s,o, +u,c,l,h)),zt(i)&&p.setUTCFullYear(i),S!==0&&p.setTime(p.getTime()-S)):(p=new Date( +i,s,o,u,c,l,h),zt(i)&&p.setFullYear(i)),p},"parseDate");function oa(r){var e=na. +exec(r);if(e){var t=parseInt(e[1],10),n=!!e[4];n&&(t=hi(t));var i=parseInt(e[2], +10)-1,s=e[3],o=new Date(t,i,s);return zt(t)&&o.setFullYear(t),o}}a(oa,"getDate"); +function aa(r){if(r.endsWith("+00"))return 0;var e=ia.exec(r.split(" ")[1]);if(e){ var t=e[1];if(t==="Z")return 0;var n=t==="-"?-1:1,i=parseInt(e[2],10)*3600+parseInt( -e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(oa,"timeZoneOffset");function li(r){ -return-(r-1)}a(li,"bcYearToNegativeYear");function zt(r){return r>=0&&r<100}a(zt, -"is0To99")});var yi=I((Th,di)=>{p();di.exports=ua;var aa=Object.prototype.hasOwnProperty;function ua(r){ -for(var e=1;e{"use strict";p();var ca=yi();gi.exports=Me;function Me(r){if(!(this instanceof -Me))return new Me(r);ca(this,xa(r))}a(Me,"PostgresInterval");var ha=["seconds","\ -minutes","hours","days","months","years"];Me.prototype.toPostgres=function(){var r=ha. +e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(aa,"timeZoneOffset");function hi(r){ +return-(r-1)}a(hi,"bcYearToNegativeYear");function zt(r){return r>=0&&r<100}a(zt, +"is0To99")});var yi=I((Rl,pi)=>{d();pi.exports=ca;var ua=Object.prototype.hasOwnProperty;function ca(r){ +for(var e=1;e{"use strict";d();var la=yi();gi.exports=Be;function Be(r){if(!(this instanceof +Be))return new Be(r);la(this,va(r))}a(Be,"PostgresInterval");var ha=["seconds","\ +minutes","hours","days","months","years"];Be.prototype.toPostgres=function(){var r=ha. filter(this.hasOwnProperty,this);return this.milliseconds&&r.indexOf("seconds")< 0&&r.push("seconds"),r.length===0?"0":r.map(function(e){var t=this[e]||0;return e=== "seconds"&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/, -"")),t+" "+e},this).join(" ")};var la={years:"Y",months:"M",days:"D",hours:"H",minutes:"\ -M",seconds:"S"},fa=["years","months","days"],pa=["hours","minutes","seconds"];Me. -prototype.toISOString=Me.prototype.toISO=function(){var r=fa.map(t,this).join(""), +"")),t+" "+e},this).join(" ")};var fa={years:"Y",months:"M",days:"D",hours:"H",minutes:"\ +M",seconds:"S"},da=["years","months","days"],pa=["hours","minutes","seconds"];Be. +prototype.toISOString=Be.prototype.toISO=function(){var r=da.map(t,this).join(""), e=pa.map(t,this).join("");return"P"+r+"T"+e;function t(n){var i=this[n]||0;return n=== "seconds"&&this.milliseconds&&(i=(i+this.milliseconds/1e3).toFixed(6).replace(/0+$/, -"")),i+la[n]}};var Yt="([+-]?\\d+)",da=Yt+"\\s+years?",ya=Yt+"\\s+mons?",ma=Yt+"\ -\\s+days?",ga="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",wa=new RegExp([ -da,ya,ma,ga].map(function(r){return"("+r+")?"}).join("\\s*")),mi={years:2,months:4, -days:6,hours:9,minutes:10,seconds:11,milliseconds:12},ba=["hours","minutes","sec\ -onds","milliseconds"];function Sa(r){var e=r+"000000".slice(r.length);return parseInt( -e,10)/1e3}a(Sa,"parseMilliseconds");function xa(r){if(!r)return{};var e=wa.exec( +"")),i+fa[n]}};var Yt="([+-]?\\d+)",ya=Yt+"\\s+years?",ma=Yt+"\\s+mons?",ga=Yt+"\ +\\s+days?",wa="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",ba=new RegExp([ +ya,ma,ga,wa].map(function(r){return"("+r+")?"}).join("\\s*")),mi={years:2,months:4, +days:6,hours:9,minutes:10,seconds:11,milliseconds:12},Sa=["hours","minutes","sec\ +onds","milliseconds"];function xa(r){var e=r+"000000".slice(r.length);return parseInt( +e,10)/1e3}a(xa,"parseMilliseconds");function va(r){if(!r)return{};var e=ba.exec( r),t=e[8]==="-";return Object.keys(mi).reduce(function(n,i){var s=mi[i],o=e[s];return!o|| -(o=i==="milliseconds"?Sa(o):parseInt(o,10),!o)||(t&&~ba.indexOf(i)&&(o*=-1),n[i]= -o),n},{})}a(xa,"parse")});var Si=I((Fh,bi)=>{"use strict";p();bi.exports=a(function(e){if(/^\\x/.test(e))return new y( +(o=i==="milliseconds"?xa(o):parseInt(o,10),!o)||(t&&~Sa.indexOf(i)&&(o*=-1),n[i]= +o),n},{})}a(va,"parse")});var Si=I((kl,bi)=>{"use strict";d();bi.exports=a(function(e){if(/^\\x/.test(e))return new y( e.substr(2),"hex");for(var t="",n=0;n{p();var Ke=Vt(),ze=Kt(),lt=pi(),Ei=wi(),vi=Si();function ft(r){ -return a(function(t){return t===null?t:r(t)},"nullAllowed")}a(ft,"allowNull");function _i(r){ +"\\";n+=Math.floor(i/2)*2}return new y(t,"binary")},"parseBytea")});var Ti=I((Dl,Ci)=>{d();var Ke=Vt(),ze=Kt(),ht=di(),vi=wi(),Ei=Si();function ft(r){ +return a(function(t){return t===null?t:r(t)},"nullAllowed")}a(ft,"allowNull");function Ai(r){ return r===null?r:r==="TRUE"||r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"|| -r==="1"}a(_i,"parseBool");function Ea(r){return r?Ke.parse(r,_i):null}a(Ea,"pars\ -eBoolArray");function va(r){return parseInt(r,10)}a(va,"parseBaseTenInt");function Zt(r){ -return r?Ke.parse(r,ft(va)):null}a(Zt,"parseIntegerArray");function _a(r){return r? -Ke.parse(r,ft(function(e){return Ai(e).trim()})):null}a(_a,"parseBigIntegerArray"); -var Aa=a(function(r){if(!r)return null;var e=ze.create(r,function(t){return t!== +r==="1"}a(Ai,"parseBool");function Ea(r){return r?Ke.parse(r,Ai):null}a(Ea,"pars\ +eBoolArray");function Aa(r){return parseInt(r,10)}a(Aa,"parseBaseTenInt");function Zt(r){ +return r?Ke.parse(r,ft(Aa)):null}a(Zt,"parseIntegerArray");function _a(r){return r? +Ke.parse(r,ft(function(e){return _i(e).trim()})):null}a(_a,"parseBigIntegerArray"); +var Ca=a(function(r){if(!r)return null;var e=ze.create(r,function(t){return t!== null&&(t=tr(t)),t});return e.parse()},"parsePointArray"),Jt=a(function(r){if(!r) return null;var e=ze.create(r,function(t){return t!==null&&(t=parseFloat(t)),t}); -return e.parse()},"parseFloatArray"),ie=a(function(r){if(!r)return null;var e=ze. +return e.parse()},"parseFloatArray"),ne=a(function(r){if(!r)return null;var e=ze. create(r);return e.parse()},"parseStringArray"),Xt=a(function(r){if(!r)return null; -var e=ze.create(r,function(t){return t!==null&&(t=lt(t)),t});return e.parse()},"\ -parseDateArray"),Ca=a(function(r){if(!r)return null;var e=ze.create(r,function(t){ -return t!==null&&(t=Ei(t)),t});return e.parse()},"parseIntervalArray"),Ta=a(function(r){ -return r?Ke.parse(r,ft(vi)):null},"parseByteAArray"),er=a(function(r){return parseInt( -r,10)},"parseInteger"),Ai=a(function(r){var e=String(r);return/^\d+$/.test(e)?e: +var e=ze.create(r,function(t){return t!==null&&(t=ht(t)),t});return e.parse()},"\ +parseDateArray"),Ta=a(function(r){if(!r)return null;var e=ze.create(r,function(t){ +return t!==null&&(t=vi(t)),t});return e.parse()},"parseIntervalArray"),Ia=a(function(r){ +return r?Ke.parse(r,ft(Ei)):null},"parseByteAArray"),er=a(function(r){return parseInt( +r,10)},"parseInteger"),_i=a(function(r){var e=String(r);return/^\d+$/.test(e)?e: r},"parseBigInteger"),xi=a(function(r){return r?Ke.parse(r,ft(JSON.parse)):null}, "parseJsonArray"),tr=a(function(r){return r[0]!=="("?null:(r=r.substring(1,r.length- -1).split(","),{x:parseFloat(r[0]),y:parseFloat(r[1])})},"parsePoint"),Ia=a(function(r){ +1).split(","),{x:parseFloat(r[0]),y:parseFloat(r[1])})},"parsePoint"),Ra=a(function(r){ if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1,i=2;i{"use strict";p();var Z=1e6;function Ba(r){var e=r.readInt32BE( +_i),r(21,er),r(23,er),r(26,er),r(700,parseFloat),r(701,parseFloat),r(16,Ai),r(1082, +ht),r(1114,ht),r(1184,ht),r(600,tr),r(651,ne),r(718,Ra),r(1e3,Ea),r(1001,Ia),r(1005, +Zt),r(1007,Zt),r(1028,Zt),r(1016,_a),r(1017,Ca),r(1021,Jt),r(1022,Jt),r(1231,Jt), +r(1014,ne),r(1015,ne),r(1008,ne),r(1009,ne),r(1040,ne),r(1041,ne),r(1115,Xt),r(1182, +Xt),r(1185,Xt),r(1186,vi),r(1187,Ta),r(17,Ei),r(114,JSON.parse.bind(JSON)),r(3802, +JSON.parse.bind(JSON)),r(199,xi),r(3807,xi),r(3907,ne),r(2951,ne),r(791,ne),r(1183, +ne),r(1270,ne)},"init");Ci.exports={init:Pa}});var Ri=I((Nl,Ii)=>{"use strict";d();var Z=1e6;function Fa(r){var e=r.readInt32BE( 0),t=r.readUInt32BE(4),n="";e<0&&(e=~e+(t===0),t=~t+1>>>0,n="-");var i="",s,o,u, -c,h,l;{if(s=e%Z,e=e/Z>>>0,o=4294967296*s+t,t=o/Z>>>0,u=""+(o-Z*t),t===0&&e===0)return n+ -u+i;for(c="",h=6-u.length,l=0;l>>0,o=4294967296* -s+t,t=o/Z>>>0,u=""+(o-Z*t),t===0&&e===0)return n+u+i;for(c="",h=6-u.length,l=0;l< -h;l++)c+="0";i=c+u+i}{if(s=e%Z,e=e/Z>>>0,o=4294967296*s+t,t=o/Z>>>0,u=""+(o-Z*t), -t===0&&e===0)return n+u+i;for(c="",h=6-u.length,l=0;l{p();var La=Pi(),F=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(C,B,Q){ -return C*Math.pow(2,Q)+B};var s=t>>3,o=a(function(C){return n?~C&255:C},"inv"),u=255, -c=8-t%8;e>t%8);var h=0;t%8+e>=8&&(h=i(0,o(r[s])& -u,c));for(var l=e+t>>3,d=s+1;d0&& -(h=i(h,o(r[l])>>8-b,b)),h},"parseBits"),Ri=a(function(r,e,t){var n=Math.pow(2,t- -1)-1,i=F(r,1),s=F(r,t,1);if(s===0)return 0;var o=1,u=a(function(h,l,d){h===0&&(h= -1);for(var b=1;b<=d;b++)o/=2,(l&1<0&&(h+=o);return h},"parsePrecisionBits"), -c=F(r,e,t+1,!1,u);return s==Math.pow(2,t+1)-1?c===0?i===0?1/0:-1/0:NaN:(i===0?1: --1)*Math.pow(2,s-n)*c},"parseFloatFromBits"),Ra=a(function(r){return F(r,1)==1?-1* -(F(r,15,1,!0)+1):F(r,15,1)},"parseInt16"),Bi=a(function(r){return F(r,1)==1?-1*(F( -r,31,1,!0)+1):F(r,31,1)},"parseInt32"),Fa=a(function(r){return Ri(r,23,8)},"pars\ -eFloat32"),Ma=a(function(r){return Ri(r,52,11)},"parseFloat64"),Da=a(function(r){ -var e=F(r,16,32);if(e==49152)return NaN;for(var t=Math.pow(1e4,F(r,16,16)),n=0,i=[], -s=F(r,16),o=0;o>>0,o=4294967296*s+t,t=o/Z>>>0,u=""+(o-Z*t),t===0&&e===0)return n+ +u+i;for(c="",l=6-u.length,h=0;h>>0,o=4294967296* +s+t,t=o/Z>>>0,u=""+(o-Z*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,h=0;h< +l;h++)c+="0";i=c+u+i}{if(s=e%Z,e=e/Z>>>0,o=4294967296*s+t,t=o/Z>>>0,u=""+(o-Z*t), +t===0&&e===0)return n+u+i;for(c="",l=6-u.length,h=0;h{d();var La=Ri(),B=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(_,P,G){ +return _*Math.pow(2,G)+P};var s=t>>3,o=a(function(_){return n?~_&255:_},"inv"),u=255, +c=8-t%8;e>t%8);var l=0;t%8+e>=8&&(l=i(0,o(r[s])& +u,c));for(var h=e+t>>3,p=s+1;p0&& +(l=i(l,o(r[h])>>8-S,S)),l},"parseBits"),Li=a(function(r,e,t){var n=Math.pow(2,t- +1)-1,i=B(r,1),s=B(r,t,1);if(s===0)return 0;var o=1,u=a(function(l,h,p){l===0&&(l= +1);for(var S=1;S<=p;S++)o/=2,(h&1<0&&(l+=o);return l},"parsePrecisionBits"), +c=B(r,e,t+1,!1,u);return s==Math.pow(2,t+1)-1?c===0?i===0?1/0:-1/0:NaN:(i===0?1: +-1)*Math.pow(2,s-n)*c},"parseFloatFromBits"),Ba=a(function(r){return B(r,1)==1?-1* +(B(r,15,1,!0)+1):B(r,15,1)},"parseInt16"),Pi=a(function(r){return B(r,1)==1?-1*(B( +r,31,1,!0)+1):B(r,31,1)},"parseInt32"),Ma=a(function(r){return Li(r,23,8)},"pars\ +eFloat32"),ka=a(function(r){return Li(r,52,11)},"parseFloat64"),Oa=a(function(r){ +var e=B(r,16,32);if(e==49152)return NaN;for(var t=Math.pow(1e4,B(r,16,16)),n=0,i=[], +s=B(r,16),o=0;o>3,(i+=l<<3)>>3), -d;console.log("ERROR: ElementType not implemented: "+h)},"parseElement"),c=a(function(h,l){ -var d=[],b;if(h.length>1){var C=h.shift();for(b=0;b0},"parseBool"),Oa=a(function(r){r(20,La),r(21,Ra),r(23,Bi),r(26, -Bi),r(1700,Da),r(700,Fa),r(701,Ma),r(16,Ua),r(1114,Li.bind(null,!1)),r(1184,Li.bind( -null,!0)),r(1e3,Ye),r(1007,Ye),r(1016,Ye),r(1008,Ye),r(1009,Ye),r(25,ka)},"init"); -Fi.exports={init:Oa}});var ki=I((Gh,Di)=>{p();Di.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23, +return this.usec},i},"parseDate"),Ye=a(function(r){for(var e=B(r,32),t=B(r,32,32), +n=B(r,32,64),i=96,s=[],o=0;o>3,(i+=h<<3)>>3), +p;console.log("ERROR: ElementType not implemented: "+l)},"parseElement"),c=a(function(l,h){ +var p=[],S;if(l.length>1){var _=l.shift();for(S=0;S<_;S++)p[S]=c(l,h);l.unshift( +_)}else for(S=0;S0},"parseBool"),Ua=a(function(r){r(20,La),r(21,Ba),r(23,Pi),r(26, +Pi),r(1700,Oa),r(700,Ma),r(701,ka),r(16,Da),r(1114,Fi.bind(null,!1)),r(1184,Fi.bind( +null,!0)),r(1e3,Ye),r(1007,Ye),r(1016,Ye),r(1008,Ye),r(1009,Ye),r(25,Qa)},"init"); +Bi.exports={init:Ua}});var Oi=I((Vl,ki)=>{d();ki.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23, REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194, SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703, TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033, @@ -694,156 +695,156 @@ BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INT TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203, REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220, PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642, -REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}});var Xe=I(Je=>{p();var Na=Ti(),qa=Mi(),Qa=Kt(),ja=ki();Je.getTypeParser=Wa;Je.setTypeParser= -Ha;Je.arrayParser=Qa;Je.builtins=ja;var Ze={text:{},binary:{}};function Ui(r){return String( -r)}a(Ui,"noParse");function Wa(r,e){return e=e||"text",Ze[e]&&Ze[e][r]||Ui}a(Wa, -"getTypeParser");function Ha(r,e,t){typeof e=="function"&&(t=e,e="text"),Ze[e][r]= -t}a(Ha,"setTypeParser");Na.init(function(r,e){Ze.text[r]=e});qa.init(function(r,e){ -Ze.binary[r]=e})});var et=I((Yh,rr)=>{"use strict";p();rr.exports={host:"localhost",user:m.platform=== +REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}});var Xe=I(Je=>{d();var qa=Ti(),Na=Mi(),Wa=Kt(),ja=Oi();Je.getTypeParser=Ha;Je.setTypeParser= +Ga;Je.arrayParser=Wa;Je.builtins=ja;var Ze={text:{},binary:{}};function Qi(r){return String( +r)}a(Qi,"noParse");function Ha(r,e){return e=e||"text",Ze[e]&&Ze[e][r]||Qi}a(Ha, +"getTypeParser");function Ga(r,e,t){typeof e=="function"&&(t=e,e="text"),Ze[e][r]= +t}a(Ga,"setTypeParser");qa.init(function(r,e){Ze.text[r]=e});Na.init(function(r,e){ +Ze.binary[r]=e})});var et=I((Jl,rr)=>{"use strict";d();rr.exports={host:"localhost",user:m.platform=== "win32"?m.env.USERNAME:m.env.USER,database:void 0,password:null,connectionString:void 0, port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4,client_encoding:"",ssl:!1, application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1, statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1, -connect_timeout:0,keepalives:1,keepalives_idle:0};var De=Xe(),Ga=De.getTypeParser( -20,"text"),$a=De.getTypeParser(1016,"text");rr.exports.__defineSetter__("parseIn\ -t8",function(r){De.setTypeParser(20,"text",r?De.getTypeParser(23,"text"):Ga),De. -setTypeParser(1016,"text",r?De.getTypeParser(1007,"text"):$a)})});var tt=I((Jh,Ni)=>{"use strict";p();var Va=(Gt(),O(Ht)),Ka=et();function za(r){var e=r. -replace(/\\/g,"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(za,"escapeElement"); -function Oi(r){for(var e="{",t=0;t0&&(e=e+","),r[t]===null||typeof r[t]> -"u"?e=e+"NULL":Array.isArray(r[t])?e=e+Oi(r[t]):r[t]instanceof y?e+="\\\\x"+r[t]. -toString("hex"):e+=za(pt(r[t]));return e=e+"}",e}a(Oi,"arrayString");var pt=a(function(r,e){ +connect_timeout:0,keepalives:1,keepalives_idle:0};var Me=Xe(),$a=Me.getTypeParser( +20,"text"),Va=Me.getTypeParser(1016,"text");rr.exports.__defineSetter__("parseIn\ +t8",function(r){Me.setTypeParser(20,"text",r?Me.getTypeParser(23,"text"):$a),Me. +setTypeParser(1016,"text",r?Me.getTypeParser(1007,"text"):Va)})});var tt=I((eh,Ui)=>{"use strict";d();var Ka=(Gt(),U(Ht)),za=et();function Ya(r){var e=r. +replace(/\\/g,"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(Ya,"escapeElement"); +function Di(r){for(var e="{",t=0;t0&&(e=e+","),r[t]===null||typeof r[t]> +"u"?e=e+"NULL":Array.isArray(r[t])?e=e+Di(r[t]):r[t]instanceof y?e+="\\\\x"+r[t]. +toString("hex"):e+=Ya(dt(r[t]));return e=e+"}",e}a(Di,"arrayString");var dt=a(function(r,e){ if(r==null)return null;if(r instanceof y)return r;if(ArrayBuffer.isView(r)){var t=y. from(r.buffer,r.byteOffset,r.byteLength);return t.length===r.byteLength?t:t.slice( -r.byteOffset,r.byteOffset+r.byteLength)}return r instanceof Date?Ka.parseInputDatesAsUTC? -Ja(r):Za(r):Array.isArray(r)?Oi(r):typeof r=="object"?Ya(r,e):r.toString()},"pre\ -pareValue");function Ya(r,e){if(r&&typeof r.toPostgres=="function"){if(e=e||[],e. +r.byteOffset,r.byteOffset+r.byteLength)}return r instanceof Date?za.parseInputDatesAsUTC? +Xa(r):Ja(r):Array.isArray(r)?Di(r):typeof r=="object"?Za(r,e):r.toString()},"pre\ +pareValue");function Za(r,e){if(r&&typeof r.toPostgres=="function"){if(e=e||[],e. indexOf(r)!==-1)throw new Error('circular reference detected while preparing "'+ -r+'" for query');return e.push(r),pt(r.toPostgres(pt),e)}return JSON.stringify(r)} -a(Ya,"prepareObject");function G(r,e){for(r=""+r;r.length{"use strict";p();var ir=(Gt(),O(Ht));function tu(r){if(r.indexOf( +r+'" for query');return e.push(r),dt(r.toPostgres(dt),e)}return JSON.stringify(r)} +a(Za,"prepareObject");function H(r,e){for(r=""+r;r.length{"use strict";d();var ir=(Gt(),U(Ht));function ru(r){if(r.indexOf( "SCRAM-SHA-256")===-1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is cur\ rently supported");let e=ir.randomBytes(18).toString("base64");return{mechanism:"\ SCRAM-SHA-256",clientNonce:e,response:"n,,n=*,r="+e,message:"SASLInitialResponse"}} -a(tu,"startSession");function ru(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( +a(ru,"startSession");function nu(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( "SASL: Last message was not SASLInitialResponse");if(typeof e!="string")throw new Error( "SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if(typeof t!= "string")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a\ - string");let n=su(t);if(n.nonce.startsWith(r.clientNonce)){if(n.nonce.length=== + string");let n=ou(t);if(n.nonce.startsWith(r.clientNonce)){if(n.nonce.length=== r.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server n\ once is too short")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serv\ -er nonce does not start with client nonce");var i=y.from(n.salt,"base64"),s=uu(e, -i,n.iteration),o=ke(s,"Client Key"),u=au(o),c="n=*,r="+r.clientNonce,h="r="+n.nonce+ -",s="+n.salt+",i="+n.iteration,l="c=biws,r="+n.nonce,d=c+","+h+","+l,b=ke(u,d),C=ji( -o,b),B=C.toString("base64"),Q=ke(s,"Server Key"),X=ke(Q,d);r.message="SASLRespon\ -se",r.serverSignature=X.toString("base64"),r.response=l+",p="+B}a(ru,"continueSe\ -ssion");function nu(r,e){if(r.message!=="SASLResponse")throw new Error("SASL: La\ +er nonce does not start with client nonce");var i=y.from(n.salt,"base64"),s=cu(e, +i,n.iteration),o=ke(s,"Client Key"),u=uu(o),c="n=*,r="+r.clientNonce,l="r="+n.nonce+ +",s="+n.salt+",i="+n.iteration,h="c=biws,r="+n.nonce,p=c+","+l+","+h,S=ke(u,p),_=Wi( +o,S),P=_.toString("base64"),G=ke(s,"Server Key"),X=ke(G,p);r.message="SASLRespon\ +se",r.serverSignature=X.toString("base64"),r.response=h+",p="+P}a(nu,"continueSe\ +ssion");function iu(r,e){if(r.message!=="SASLResponse")throw new Error("SASL: La\ st message was not SASLResponse");if(typeof e!="string")throw new Error("SASL: S\ -CRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=ou( +CRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=au( e);if(t!==r.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: s\ -erver signature does not match")}a(nu,"finalizeSession");function iu(r){if(typeof r!= +erver signature does not match")}a(iu,"finalizeSession");function su(r){if(typeof r!= "string")throw new TypeError("SASL: text must be a string");return r.split("").map( -(e,t)=>r.charCodeAt(t)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}a(iu,"isPrintableC\ +(e,t)=>r.charCodeAt(t)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}a(su,"isPrintableC\ hars");function qi(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(r)}a(qi,"isBase64");function Qi(r){if(typeof r!="string")throw new TypeError( +test(r)}a(qi,"isBase64");function Ni(r){if(typeof r!="string")throw new TypeError( "SASL: attribute pairs text must be a string");return new Map(r.split(",").map(e=>{ if(!/^.=/.test(e))throw new Error("SASL: Invalid attribute pair entry");let t=e[0], -n=e.substring(2);return[t,n]}))}a(Qi,"parseAttributePairs");function su(r){let e=Qi( -r),t=e.get("r");if(t){if(!iu(t))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAG\ +n=e.substring(2);return[t,n]}))}a(Ni,"parseAttributePairs");function ou(r){let e=Ni( +r),t=e.get("r");if(t){if(!su(t))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAG\ E: nonce must only contain printable characters")}else throw new Error("SASL: SC\ RAM-SERVER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!qi(n))throw new Error( "SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64")}else throw new Error("S\ ASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");let i=e.get("i");if(i){if(!/^[1-9][0-9]*$/. test(i))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration cou\ nt")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing"); -let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(su,"parseServerFirstMe\ -ssage");function ou(r){let t=Qi(r).get("v");if(t){if(!qi(t))throw new Error("SAS\ +let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(ou,"parseServerFirstMe\ +ssage");function au(r){let t=Ni(r).get("v");if(t){if(!qi(t))throw new Error("SAS\ L: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64")}else throw new Error( "SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");return{serverSignature:t}} -a(ou,"parseServerFinalMessage");function ji(r,e){if(!y.isBuffer(r))throw new TypeError( +a(au,"parseServerFinalMessage");function Wi(r,e){if(!y.isBuffer(r))throw new TypeError( "first argument must be a Buffer");if(!y.isBuffer(e))throw new TypeError("second\ argument must be a Buffer");if(r.length!==e.length)throw new Error("Buffer leng\ ths must match");if(r.length===0)throw new Error("Buffers cannot be empty");return y. -from(r.map((t,n)=>r[n]^e[n]))}a(ji,"xorBuffers");function au(r){return ir.createHash( -"sha256").update(r).digest()}a(au,"sha256");function ke(r,e){return ir.createHmac( -"sha256",r).update(e).digest()}a(ke,"hmacSha256");function uu(r,e,t){for(var n=ke( -r,y.concat([e,y.from([0,0,0,1])])),i=n,s=0;scu});function cu(...r){return r.join("/")}var or=z(()=>{ -"use strict";p();a(cu,"join")});var ar={};re(ar,{stat:()=>hu});function hu(r,e){e(new Error("No filesystem"))}var ur=z( -()=>{"use strict";p();a(hu,"stat")});var cr={};re(cr,{default:()=>lu});var lu,hr=z(()=>{"use strict";p();lu={}});var Gi={};re(Gi,{StringDecoder:()=>lr});var fr,lr,$i=z(()=>{"use strict";p();fr= -class fr{constructor(e){_(this,"td");this.td=new TextDecoder(e)}write(e){return this. +from(r.map((t,n)=>r[n]^e[n]))}a(Wi,"xorBuffers");function uu(r){return ir.createHash( +"sha256").update(r).digest()}a(uu,"sha256");function ke(r,e){return ir.createHmac( +"sha256",r).update(e).digest()}a(ke,"hmacSha256");function cu(r,e,t){for(var n=ke( +r,y.concat([e,y.from([0,0,0,1])])),i=n,s=0;slu});function lu(...r){return r.join("/")}var or=z(()=>{ +"use strict";d();a(lu,"join")});var ar={};te(ar,{stat:()=>hu});function hu(r,e){e(new Error("No filesystem"))}var ur=z( +()=>{"use strict";d();a(hu,"stat")});var cr={};te(cr,{default:()=>fu});var fu,lr=z(()=>{"use strict";d();fu={}});var Gi={};te(Gi,{StringDecoder:()=>hr});var fr,hr,$i=z(()=>{"use strict";d();fr= +class fr{constructor(e){A(this,"td");this.td=new TextDecoder(e)}write(e){return this. td.decode(e,{stream:!0})}end(e){return this.td.decode(e)}};a(fr,"StringDecoder"); -lr=fr});var Yi=I((ll,zi)=>{"use strict";p();var{Transform:fu}=(hr(),O(cr)),{StringDecoder:pu}=($i(),O(Gi)), -be=Symbol("last"),dt=Symbol("decoder");function du(r,e,t){let n;if(this.overflow){ -if(n=this[dt].write(r).split(this.matcher),n.length===1)return t();n.shift(),this. -overflow=!1}else this[be]+=this[dt].write(r),n=this[be].split(this.matcher);this[be]= +hr=fr});var Yi=I((dh,zi)=>{"use strict";d();var{Transform:du}=(lr(),U(cr)),{StringDecoder:pu}=($i(),U(Gi)), +be=Symbol("last"),pt=Symbol("decoder");function yu(r,e,t){let n;if(this.overflow){ +if(n=this[pt].write(r).split(this.matcher),n.length===1)return t();n.shift(),this. +overflow=!1}else this[be]+=this[pt].write(r),n=this[be].split(this.matcher);this[be]= n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){ -t(new Error("maximum buffer reached"));return}t()}a(du,"transform");function yu(r){ -if(this[be]+=this[dt].end(),this[be])try{Ki(this,this.mapper(this[be]))}catch(e){ -return r(e)}r()}a(yu,"flush");function Ki(r,e){e!==void 0&&r.push(e)}a(Ki,"push"); -function Vi(r){return r}a(Vi,"noop");function mu(r,e,t){switch(r=r||/\r?\n/,e=e|| +t(new Error("maximum buffer reached"));return}t()}a(yu,"transform");function mu(r){ +if(this[be]+=this[pt].end(),this[be])try{Ki(this,this.mapper(this[be]))}catch(e){ +return r(e)}r()}a(mu,"flush");function Ki(r,e){e!==void 0&&r.push(e)}a(Ki,"push"); +function Vi(r){return r}a(Vi,"noop");function gu(r,e,t){switch(r=r||/\r?\n/,e=e|| Vi,t=t||{},arguments.length){case 1:typeof r=="function"?(e=r,r=/\r?\n/):typeof r== "object"&&!(r instanceof RegExp)&&!r[Symbol.split]&&(t=r,r=/\r?\n/);break;case 2: typeof r=="function"?(t=e,e=r,r=/\r?\n/):typeof e=="object"&&(t=e,e=Vi)}t=Object. -assign({},t),t.autoDestroy=!0,t.transform=du,t.flush=yu,t.readableObjectMode=!0; -let n=new fu(t);return n[be]="",n[dt]=new pu("utf8"),n.matcher=r,n.mapper=e,n.maxLength= +assign({},t),t.autoDestroy=!0,t.transform=yu,t.flush=mu,t.readableObjectMode=!0; +let n=new du(t);return n[be]="",n[pt]=new pu("utf8"),n.matcher=r,n.mapper=e,n.maxLength= t.maxLength,n.skipOverflow=t.skipOverflow||!1,n.overflow=!1,n._destroy=function(i,s){ -this._writableState.errorEmitted=!1,s(i)},n}a(mu,"split");zi.exports=mu});var Xi=I((dl,de)=>{"use strict";p();var Zi=(or(),O(sr)),gu=(hr(),O(cr)).Stream,wu=Yi(), -Ji=(Ge(),O(He)),bu=5432,yt=m.platform==="win32",rt=m.stderr,Su=56,xu=7,Eu=61440, -vu=32768;function _u(r){return(r&Eu)==vu}a(_u,"isRegFile");var Ue=["host","port", -"database","user","password"],pr=Ue.length,Au=Ue[pr-1];function dr(){var r=rt instanceof -gu&&rt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` -`);rt.write(Ji.format.apply(Ji,e))}}a(dr,"warn");Object.defineProperty(de.exports, +this._writableState.errorEmitted=!1,s(i)},n}a(gu,"split");zi.exports=gu});var Xi=I((mh,de)=>{"use strict";d();var Zi=(or(),U(sr)),wu=(lr(),U(cr)).Stream,bu=Yi(), +Ji=(Ge(),U(He)),Su=5432,yt=m.platform==="win32",rt=m.stderr,xu=56,vu=7,Eu=61440, +Au=32768;function _u(r){return(r&Eu)==Au}a(_u,"isRegFile");var Oe=["host","port", +"database","user","password"],dr=Oe.length,Cu=Oe[dr-1];function pr(){var r=rt instanceof +wu&&rt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` +`);rt.write(Ji.format.apply(Ji,e))}}a(pr,"warn");Object.defineProperty(de.exports, "isWin",{get:a(function(){return yt},"get"),set:a(function(r){yt=r},"set")});de. exports.warnTo=function(r){var e=rt;return rt=r,e};de.exports.getFileName=function(r){ var e=r||m.env,t=e.PGPASSFILE||(yt?Zi.join(e.APPDATA||"./","postgresql","pgpass.\ conf"):Zi.join(e.HOME||"./",".pgpass"));return t};de.exports.usePgPass=function(r,e){ return Object.prototype.hasOwnProperty.call(m.env,"PGPASSWORD")?!1:yt?!0:(e=e||"\ -",_u(r.mode)?r.mode&(Su|xu)?(dr('WARNING: password file "%s" has group or \ -world access; permissions should be u=rw (0600) or less',e),!1):!0:(dr('WARNING:\ - password file "%s" is not a plain file',e),!1))};var Cu=de.exports.match=function(r,e){ -return Ue.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||bu)===Number( +",_u(r.mode)?r.mode&(xu|vu)?(pr('WARNING: password file "%s" has group or \ +world access; permissions should be u=rw (0600) or less',e),!1):!0:(pr('WARNING:\ + password file "%s" is not a plain file',e),!1))};var Tu=de.exports.match=function(r,e){ +return Oe.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||Su)===Number( e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};de.exports.getPassword=function(r,e,t){ -var n,i=e.pipe(wu());function s(c){var h=Tu(c);h&&Iu(h)&&Cu(r,h)&&(n=h[Au],i.end())} +var n,i=e.pipe(bu());function s(c){var l=Iu(c);l&&Ru(l)&&Tu(r,l)&&(n=l[Cu],i.end())} a(s,"onLine");var o=a(function(){e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(), -dr("WARNING: error on reading file: %s",c),t(void 0)},"onErr");e.on("error",u),i. -on("data",s).on("end",o).on("error",u)};var Tu=de.exports.parseLine=function(r){ +pr("WARNING: error on reading file: %s",c),t(void 0)},"onErr");e.on("error",u),i. +on("data",s).on("end",o).on("error",u)};var Iu=de.exports.parseLine=function(r){ if(r.length<11||r.match(/^\s+#/))return null;for(var e="",t="",n=0,i=0,s=0,o={}, -u=!1,c=a(function(l,d,b){var C=r.substring(d,b);Object.hasOwnProperty.call(m.env, -"PGPASS_NO_DEESCAPE")||(C=C.replace(/\\([:\\])/g,"$1")),o[Ue[l]]=C},"addToObj"), -h=0;h=0&&e==":"&&t!=="\\"&&(c(n,i,h+1),i=h+2,n+=1)}return o=Object.keys(o).length=== -pr?o:null,o},Iu=de.exports.isValidEntry=function(r){for(var e={0:function(o){return o. +u=!1,c=a(function(h,p,S){var _=r.substring(p,S);Object.hasOwnProperty.call(m.env, +"PGPASS_NO_DEESCAPE")||(_=_.replace(/\\([:\\])/g,"$1")),o[Oe[h]]=_},"addToObj"), +l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o).length=== +dr?o:null,o},Ru=de.exports.isValidEntry=function(r){for(var e={0:function(o){return o. length>0},1:function(o){return o==="*"?!0:(o=Number(o),isFinite(o)&&o>0&&o<9007199254740992&& Math.floor(o)===o)},2:function(o){return o.length>0},3:function(o){return o.length> -0},4:function(o){return o.length>0}},t=0;t{"use strict";p();var gl=(or(),O(sr)),es=(ur(),O(ar)),mt=Xi(); +0},4:function(o){return o.length>0}},t=0;t{"use strict";d();var bh=(or(),U(sr)),es=(ur(),U(ar)),mt=Xi(); yr.exports=function(r,e){var t=mt.getFileName();es.stat(t,function(n,i){if(n||!mt. usePgPass(i,t))return e(void 0);var s=es.createReadStream(t);mt.getPassword(r,s, -e)})};yr.exports.warnTo=mt.warnTo});var wt=I((Sl,rs)=>{"use strict";p();var Pu=Xe();function gt(r){this._types=r||Pu, +e)})};yr.exports.warnTo=mt.warnTo});var wt=I((vh,rs)=>{"use strict";d();var Pu=Xe();function gt(r){this._types=r||Pu, this.text={},this.binary={}}a(gt,"TypeOverrides");gt.prototype.getOverrides=function(r){ switch(r){case"text":return this.text;case"binary":return this.binary;default:return{}}}; gt.prototype.setTypeParser=function(r,e,t){typeof e=="function"&&(t=e,e="text"), this.getOverrides(e)[r]=t};gt.prototype.getTypeParser=function(r,e){return e=e|| -"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};rs.exports=gt});var ns={};re(ns,{default:()=>Bu});var Bu,is=z(()=>{"use strict";p();Bu={}});var ss={};re(ss,{parse:()=>mr});function mr(r,e=!1){let{protocol:t}=new URL(r),n="\ -http:"+r.substring(t.length),{username:i,password:s,host:o,hostname:u,port:c,pathname:h, -search:l,searchParams:d,hash:b}=new URL(n);s=decodeURIComponent(s),i=decodeURIComponent( -i),h=decodeURIComponent(h);let C=i+":"+s,B=e?Object.fromEntries(d.entries()):l;return{ -href:r,protocol:t,auth:C,username:i,password:s,host:o,hostname:u,port:c,pathname:h, -search:l,query:B,hash:b}}var gr=z(()=>{"use strict";p();a(mr,"parse")});var as=I((Cl,os)=>{"use strict";p();var Lu=(gr(),O(ss)),wr=(ur(),O(ar));function br(r){ +"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};rs.exports=gt});var ns={};te(ns,{default:()=>Fu});var Fu,is=z(()=>{"use strict";d();Fu={}});var ss={};te(ss,{parse:()=>mr});function mr(r,e=!1){let{protocol:t}=new URL(r),n="\ +http:"+r.substring(t.length),{username:i,password:s,host:o,hostname:u,port:c,pathname:l, +search:h,searchParams:p,hash:S}=new URL(n);s=decodeURIComponent(s),i=decodeURIComponent( +i),l=decodeURIComponent(l);let _=i+":"+s,P=e?Object.fromEntries(p.entries()):h;return{ +href:r,protocol:t,auth:_,username:i,password:s,host:o,hostname:u,port:c,pathname:l, +search:h,query:P,hash:S}}var gr=z(()=>{"use strict";d();a(mr,"parse")});var as=I((Ih,os)=>{"use strict";d();var Lu=(gr(),U(ss)),wr=(ur(),U(ar));function br(r){ if(r.charAt(0)==="/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Lu. parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(r)?encodeURI(r).replace(/\%25(\d\d)/g, "%$1"):r,!0),t=e.query;for(var n in t)Array.isArray(t[n])&&(t[n]=t[n][t[n].length- @@ -858,19 +859,19 @@ t.database=s&&decodeURI(s),(t.ssl==="true"||t.ssl==="1")&&(t.ssl=!0),t.ssl==="0" t.sslkey).toString()),t.sslrootcert&&(t.ssl.ca=wr.readFileSync(t.sslrootcert).toString()), t.sslmode){case"disable":{t.ssl=!1;break}case"prefer":case"require":case"verify-\ ca":case"verify-full":break;case"no-verify":{t.ssl.rejectUnauthorized=!1;break}} -return t}a(br,"parse");os.exports=br;br.parse=br});var bt=I((Pl,hs)=>{"use strict";p();var Ru=(is(),O(ns)),cs=et(),us=as().parse,V=a( +return t}a(br,"parse");os.exports=br;br.parse=br});var bt=I((Fh,ls)=>{"use strict";d();var Bu=(is(),U(ns)),cs=et(),us=as().parse,V=a( function(r,e,t){return t===void 0?t=m.env["PG"+r.toUpperCase()]:t===!1||(t=m.env[t]), -e[r]||t||cs[r]},"val"),Fu=a(function(){switch(m.env.PGSSLMODE){case"disable":return!1;case"\ +e[r]||t||cs[r]},"val"),Mu=a(function(){switch(m.env.PGSSLMODE){case"disable":return!1;case"\ prefer":case"require":case"verify-ca":case"verify-full":return!0;case"no-verify": -return{rejectUnauthorized:!1}}return cs.ssl},"readSSLConfigFromEnvironment"),Oe=a( +return{rejectUnauthorized:!1}}return cs.ssl},"readSSLConfigFromEnvironment"),Qe=a( function(r){return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quo\ -teParamValue"),se=a(function(r,e,t){var n=e[t];n!=null&&r.push(t+"="+Oe(n))},"ad\ +teParamValue"),ie=a(function(r,e,t){var n=e[t];n!=null&&r.push(t+"="+Qe(n))},"ad\ d"),xr=class xr{constructor(e){e=typeof e=="string"?us(e):e||{},e.connectionString&& (e=Object.assign({},e,us(e.connectionString))),this.user=V("user",e),this.database= V("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt( V("port",e),10),this.host=V("host",e),Object.defineProperty(this,"password",{configurable:!0, enumerable:!1,writable:!0,value:V("password",e)}),this.binary=V("binary",e),this. -options=V("options",e),this.ssl=typeof e.ssl>"u"?Fu():e.ssl,typeof this.ssl=="st\ +options=V("options",e),this.ssl=typeof e.ssl>"u"?Mu():e.ssl,typeof this.ssl=="st\ ring"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="no-verify"&&(this.ssl={rejectUnauthorized:!1}), this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this. client_encoding=V("client_encoding",e),this.replication=V("replication",e),this. @@ -883,20 +884,20 @@ void 0?this.connect_timeout=m.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math floor(e.connectionTimeoutMillis/1e3),e.keepAlive===!1?this.keepalives=0:e.keepAlive=== !0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis=="number"&&(this.keepalives_idle= Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){var t=[]; -se(t,this,"user"),se(t,this,"password"),se(t,this,"port"),se(t,this,"application\ -_name"),se(t,this,"fallback_application_name"),se(t,this,"connect_timeout"),se(t, +ie(t,this,"user"),ie(t,this,"password"),ie(t,this,"port"),ie(t,this,"application\ +_name"),ie(t,this,"fallback_application_name"),ie(t,this,"connect_timeout"),ie(t, this,"options");var n=typeof this.ssl=="object"?this.ssl:this.ssl?{sslmode:this. -ssl}:{};if(se(t,n,"sslmode"),se(t,n,"sslca"),se(t,n,"sslkey"),se(t,n,"sslcert"), -se(t,n,"sslrootcert"),this.database&&t.push("dbname="+Oe(this.database)),this.replication&& -t.push("replication="+Oe(this.replication)),this.host&&t.push("host="+Oe(this.host)), +ssl}:{};if(ie(t,n,"sslmode"),ie(t,n,"sslca"),ie(t,n,"sslkey"),ie(t,n,"sslcert"), +ie(t,n,"sslrootcert"),this.database&&t.push("dbname="+Qe(this.database)),this.replication&& +t.push("replication="+Qe(this.replication)),this.host&&t.push("host="+Qe(this.host)), this.isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("cli\ -ent_encoding="+Oe(this.client_encoding)),Ru.lookup(this.host,function(i,s){return i? -e(i,null):(t.push("hostaddr="+Oe(s)),e(null,t.join(" ")))})}};a(xr,"ConnectionPa\ -rameters");var Sr=xr;hs.exports=Sr});var ps=I((Rl,fs)=>{"use strict";p();var Mu=Xe(),ls=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/, -vr=class vr{constructor(e,t){this.command=null,this.rowCount=null,this.oid=null, +ent_encoding="+Qe(this.client_encoding)),Bu.lookup(this.host,function(i,s){return i? +e(i,null):(t.push("hostaddr="+Qe(s)),e(null,t.join(" ")))})}};a(xr,"ConnectionPa\ +rameters");var Sr=xr;ls.exports=Sr});var ds=I((Mh,fs)=>{"use strict";d();var ku=Xe(),hs=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/, +Er=class Er{constructor(e,t){this.command=null,this.rowCount=null,this.oid=null, this.rows=[],this.fields=[],this._parsers=void 0,this._types=t,this.RowCtor=null, this.rowAsArray=e==="array",this.rowAsArray&&(this.parseRow=this._parseRowAsArray)}addCommandComplete(e){ -var t;e.text?t=ls.exec(e.text):t=ls.exec(e.command),t&&(this.command=t[1],t[3]?(this. +var t;e.text?t=hs.exec(e.text):t=hs.exec(e.command),t&&(this.command=t[1],t[3]?(this. oid=parseInt(t[2],10),this.rowCount=parseInt(t[3],10)):t[2]&&(this.rowCount=parseInt( t[2],10)))}_parseRowAsArray(e){for(var t=new Array(e.length),n=0,i=e.length;n{"use strict";p();var{EventEmitter:Du}=we(),ds=ps(),ys=tt(),Ar=class Ar extends Du{constructor(e,t,n){ +ext"):this._parsers[t]=ku.getTypeParser(n.dataTypeID,n.format||"text")}}};a(Er,"\ +Result");var vr=Er;fs.exports=vr});var gs=I((Qh,ms)=>{"use strict";d();var{EventEmitter:Ou}=we(),ps=ds(),ys=tt(),_r=class _r extends Ou{constructor(e,t,n){ super(),e=ys.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this. rows=e.rows,this.types=e.types,this.name=e.name,this.binary=e.binary,this.portal= e.portal||"",this.callback=e.callback,this._rowMode=e.rowMode,m.domain&&e.callback&& -(this.callback=m.domain.bind(e.callback)),this._result=new ds(this._rowMode,this. +(this.callback=m.domain.bind(e.callback)),this._result=new ps(this._rowMode,this. types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError= !1,this._promise=null}requiresPreparation(){return this.name||this.rows?!0:!this. text||!this.values?!1:this.values.length>0}_checkForMultirow(){this._result.command&& -(Array.isArray(this._results)||(this._results=[this._result]),this._result=new ds( +(Array.isArray(this._results)||(this._results=[this._result]),this._result=new ps( this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){ this._checkForMultirow(),this._result.addFields(e.fields),this._accumulateRows=this. callback||!this.listeners("row").length}handleDataRow(e){let t;if(!this._canceledDueToError){ @@ -937,89 +938,89 @@ name]}handlePortalSuspended(e){this._getRows(e,this.rows)}_getRows(e,t){e.execut try{e.bind({portal:this.portal,statement:this.name,values:this.values,binary:this. binary,valueMapper:ys.prepareValue})}catch(t){this.handleError(t,e);return}e.describe( {type:"P",name:this.portal||""}),this._getRows(e,this.rows)}handleCopyInResponse(e){ -e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(Ar,"Query"); -var _r=Ar;ms.exports=_r});var Ss={};re(Ss,{Socket:()=>Se,isIP:()=>ku});function ku(r){return 0}var bs,ws,v, -Se,St=z(()=>{"use strict";p();bs=Ie(we(),1);a(ku,"isIP");ws=/^[^.]+\./,v=class v extends bs.EventEmitter{constructor(){ -super(...arguments);_(this,"opts",{});_(this,"connecting",!1);_(this,"pending",!0); -_(this,"writable",!0);_(this,"encrypted",!1);_(this,"authorized",!1);_(this,"des\ -troyed",!1);_(this,"ws",null);_(this,"writeBuffer");_(this,"tlsState",0);_(this, -"tlsRead");_(this,"tlsWrite")}static get poolQueryViaFetch(){return v.opts.poolQueryViaFetch?? -v.defaults.poolQueryViaFetch}static set poolQueryViaFetch(t){v.opts.poolQueryViaFetch= -t}static get fetchEndpoint(){return v.opts.fetchEndpoint??v.defaults.fetchEndpoint}static set fetchEndpoint(t){ -v.opts.fetchEndpoint=t}static get fetchConnectionCache(){return!0}static set fetchConnectionCache(t){ +e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(_r,"Query"); +var Ar=_r;ms.exports=Ar});var Ss={};te(Ss,{Socket:()=>Se,isIP:()=>Qu});function Qu(r){return 0}var bs,ws,E, +Se,St=z(()=>{"use strict";d();bs=Te(we(),1);a(Qu,"isIP");ws=/^[^.]+\./,E=class E extends bs.EventEmitter{constructor(){ +super(...arguments);A(this,"opts",{});A(this,"connecting",!1);A(this,"pending",!0); +A(this,"writable",!0);A(this,"encrypted",!1);A(this,"authorized",!1);A(this,"des\ +troyed",!1);A(this,"ws",null);A(this,"writeBuffer");A(this,"tlsState",0);A(this, +"tlsRead");A(this,"tlsWrite")}static get poolQueryViaFetch(){return E.opts.poolQueryViaFetch?? +E.defaults.poolQueryViaFetch}static set poolQueryViaFetch(t){E.opts.poolQueryViaFetch= +t}static get fetchEndpoint(){return E.opts.fetchEndpoint??E.defaults.fetchEndpoint}static set fetchEndpoint(t){ +E.opts.fetchEndpoint=t}static get fetchConnectionCache(){return!0}static set fetchConnectionCache(t){ console.warn("The `fetchConnectionCache` option is deprecated (now always `true`\ -)")}static get fetchFunction(){return v.opts.fetchFunction??v.defaults.fetchFunction}static set fetchFunction(t){ -v.opts.fetchFunction=t}static get webSocketConstructor(){return v.opts.webSocketConstructor?? -v.defaults.webSocketConstructor}static set webSocketConstructor(t){v.opts.webSocketConstructor= -t}get webSocketConstructor(){return this.opts.webSocketConstructor??v.webSocketConstructor}set webSocketConstructor(t){ -this.opts.webSocketConstructor=t}static get wsProxy(){return v.opts.wsProxy??v.defaults. -wsProxy}static set wsProxy(t){v.opts.wsProxy=t}get wsProxy(){return this.opts.wsProxy?? -v.wsProxy}set wsProxy(t){this.opts.wsProxy=t}static get coalesceWrites(){return v. -opts.coalesceWrites??v.defaults.coalesceWrites}static set coalesceWrites(t){v.opts. -coalesceWrites=t}get coalesceWrites(){return this.opts.coalesceWrites??v.coalesceWrites}set coalesceWrites(t){ -this.opts.coalesceWrites=t}static get useSecureWebSocket(){return v.opts.useSecureWebSocket?? -v.defaults.useSecureWebSocket}static set useSecureWebSocket(t){v.opts.useSecureWebSocket= -t}get useSecureWebSocket(){return this.opts.useSecureWebSocket??v.useSecureWebSocket}set useSecureWebSocket(t){ -this.opts.useSecureWebSocket=t}static get forceDisablePgSSL(){return v.opts.forceDisablePgSSL?? -v.defaults.forceDisablePgSSL}static set forceDisablePgSSL(t){v.opts.forceDisablePgSSL= -t}get forceDisablePgSSL(){return this.opts.forceDisablePgSSL??v.forceDisablePgSSL}set forceDisablePgSSL(t){ -this.opts.forceDisablePgSSL=t}static get disableSNI(){return v.opts.disableSNI?? -v.defaults.disableSNI}static set disableSNI(t){v.opts.disableSNI=t}get disableSNI(){ -return this.opts.disableSNI??v.disableSNI}set disableSNI(t){this.opts.disableSNI= -t}static get pipelineConnect(){return v.opts.pipelineConnect??v.defaults.pipelineConnect}static set pipelineConnect(t){ -v.opts.pipelineConnect=t}get pipelineConnect(){return this.opts.pipelineConnect?? -v.pipelineConnect}set pipelineConnect(t){this.opts.pipelineConnect=t}static get subtls(){ -return v.opts.subtls??v.defaults.subtls}static set subtls(t){v.opts.subtls=t}get subtls(){ -return this.opts.subtls??v.subtls}set subtls(t){this.opts.subtls=t}static get pipelineTLS(){ -return v.opts.pipelineTLS??v.defaults.pipelineTLS}static set pipelineTLS(t){v.opts. -pipelineTLS=t}get pipelineTLS(){return this.opts.pipelineTLS??v.pipelineTLS}set pipelineTLS(t){ -this.opts.pipelineTLS=t}static get rootCerts(){return v.opts.rootCerts??v.defaults. -rootCerts}static set rootCerts(t){v.opts.rootCerts=t}get rootCerts(){return this. -opts.rootCerts??v.rootCerts}set rootCerts(t){this.opts.rootCerts=t}wsProxyAddrForHost(t,n){ +)")}static get fetchFunction(){return E.opts.fetchFunction??E.defaults.fetchFunction}static set fetchFunction(t){ +E.opts.fetchFunction=t}static get webSocketConstructor(){return E.opts.webSocketConstructor?? +E.defaults.webSocketConstructor}static set webSocketConstructor(t){E.opts.webSocketConstructor= +t}get webSocketConstructor(){return this.opts.webSocketConstructor??E.webSocketConstructor}set webSocketConstructor(t){ +this.opts.webSocketConstructor=t}static get wsProxy(){return E.opts.wsProxy??E.defaults. +wsProxy}static set wsProxy(t){E.opts.wsProxy=t}get wsProxy(){return this.opts.wsProxy?? +E.wsProxy}set wsProxy(t){this.opts.wsProxy=t}static get coalesceWrites(){return E. +opts.coalesceWrites??E.defaults.coalesceWrites}static set coalesceWrites(t){E.opts. +coalesceWrites=t}get coalesceWrites(){return this.opts.coalesceWrites??E.coalesceWrites}set coalesceWrites(t){ +this.opts.coalesceWrites=t}static get useSecureWebSocket(){return E.opts.useSecureWebSocket?? +E.defaults.useSecureWebSocket}static set useSecureWebSocket(t){E.opts.useSecureWebSocket= +t}get useSecureWebSocket(){return this.opts.useSecureWebSocket??E.useSecureWebSocket}set useSecureWebSocket(t){ +this.opts.useSecureWebSocket=t}static get forceDisablePgSSL(){return E.opts.forceDisablePgSSL?? +E.defaults.forceDisablePgSSL}static set forceDisablePgSSL(t){E.opts.forceDisablePgSSL= +t}get forceDisablePgSSL(){return this.opts.forceDisablePgSSL??E.forceDisablePgSSL}set forceDisablePgSSL(t){ +this.opts.forceDisablePgSSL=t}static get disableSNI(){return E.opts.disableSNI?? +E.defaults.disableSNI}static set disableSNI(t){E.opts.disableSNI=t}get disableSNI(){ +return this.opts.disableSNI??E.disableSNI}set disableSNI(t){this.opts.disableSNI= +t}static get pipelineConnect(){return E.opts.pipelineConnect??E.defaults.pipelineConnect}static set pipelineConnect(t){ +E.opts.pipelineConnect=t}get pipelineConnect(){return this.opts.pipelineConnect?? +E.pipelineConnect}set pipelineConnect(t){this.opts.pipelineConnect=t}static get subtls(){ +return E.opts.subtls??E.defaults.subtls}static set subtls(t){E.opts.subtls=t}get subtls(){ +return this.opts.subtls??E.subtls}set subtls(t){this.opts.subtls=t}static get pipelineTLS(){ +return E.opts.pipelineTLS??E.defaults.pipelineTLS}static set pipelineTLS(t){E.opts. +pipelineTLS=t}get pipelineTLS(){return this.opts.pipelineTLS??E.pipelineTLS}set pipelineTLS(t){ +this.opts.pipelineTLS=t}static get rootCerts(){return E.opts.rootCerts??E.defaults. +rootCerts}static set rootCerts(t){E.opts.rootCerts=t}get rootCerts(){return this. +opts.rootCerts??E.rootCerts}set rootCerts(t){this.opts.rootCerts=t}wsProxyAddrForHost(t,n){ let i=this.wsProxy;if(i===void 0)throw new Error("No WebSocket proxy is configur\ ed. Please see https://github.com/neondatabase/serverless/blob/main/CONFIG.md#ws\ proxy-string--host-string-port-number--string--string");return typeof i=="functi\ on"?i(t,n):`${i}?address=${t}:${n}`}setNoDelay(){return this}setKeepAlive(){return this}ref(){ return this}unref(){return this}connect(t,n,i){this.connecting=!0,i&&this.once("\ connect",i);let s=a(()=>{this.connecting=!1,this.pending=!1,this.emit("connect"), -this.emit("ready")},"handleWebSocketOpen"),o=a((c,h=!1)=>{c.binaryType="arraybuf\ -fer",c.addEventListener("error",l=>{this.emit("error",l),this.emit("close")}),c. -addEventListener("message",l=>{if(this.tlsState===0){let d=y.from(l.data);this.emit( -"data",d)}}),c.addEventListener("close",()=>{this.emit("close")}),h?s():c.addEventListener( +this.emit("ready")},"handleWebSocketOpen"),o=a((c,l=!1)=>{c.binaryType="arraybuf\ +fer",c.addEventListener("error",h=>{this.emit("error",h),this.emit("close")}),c. +addEventListener("message",h=>{if(this.tlsState===0){let p=y.from(h.data);this.emit( +"data",p)}}),c.addEventListener("close",()=>{this.emit("close")}),l?s():c.addEventListener( "open",s)},"configureWebSocket"),u;try{u=this.wsProxyAddrForHost(n,typeof t=="st\ ring"?parseInt(t,10):t)}catch(c){this.emit("error",c),this.emit("close");return} -try{let h=(this.useSecureWebSocket?"wss:":"ws:")+"//"+u;if(this.webSocketConstructor!== -void 0)this.ws=new this.webSocketConstructor(h),o(this.ws);else try{this.ws=new WebSocket( -h),o(this.ws)}catch{this.ws=new __unstable_WebSocket(h),o(this.ws)}}catch(c){let l=(this. -useSecureWebSocket?"https:":"http:")+"//"+u;fetch(l,{headers:{Upgrade:"websocket"}}). -then(d=>{if(this.ws=d.webSocket,this.ws==null)throw c;this.ws.accept(),o(this.ws, -!0)}).catch(d=>{this.emit("error",new Error(`All attempts to open a WebSocket to\ +try{let l=(this.useSecureWebSocket?"wss:":"ws:")+"//"+u;if(this.webSocketConstructor!== +void 0)this.ws=new this.webSocketConstructor(l),o(this.ws);else try{this.ws=new WebSocket( +l),o(this.ws)}catch{this.ws=new __unstable_WebSocket(l),o(this.ws)}}catch(c){let h=(this. +useSecureWebSocket?"https:":"http:")+"//"+u;fetch(h,{headers:{Upgrade:"websocket"}}). +then(p=>{if(this.ws=p.webSocket,this.ws==null)throw c;this.ws.accept(),o(this.ws, +!0)}).catch(p=>{this.emit("error",new Error(`All attempts to open a WebSocket to\ connect to the database failed. Please refer to https://github.com/neondatabase\ /serverless/blob/main/CONFIG.md#websocketconstructor-typeof-websocket--undefined\ -. Details: ${d.message}`)),this.emit("close")})}}async startTls(t){if(this.subtls=== -void 0)throw new Error("For Postgres SSL connections, you must set `neonConfig.s\ -ubtls` to the subtls library. See https://github.com/neondatabase/serverless/blo\ -b/main/CONFIG.md for more information.");this.tlsState=1;let n=this.subtls.TrustedCert. -fromPEM(this.rootCerts),i=new this.subtls.WebSocketReadQueue(this.ws),s=i.read.bind( -i),o=this.rawWrite.bind(this),[u,c]=await this.subtls.startTls(t,n,s,o,{useSNI:!this. -disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0});this.tlsRead= -u,this.tlsWrite=c,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit( -"secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){for(;;){let t=await this. -tlsRead();if(t===void 0)break;{let n=y.from(t);this.emit("data",n)}}}rawWrite(t){ -if(!this.coalesceWrites){this.ws.send(t);return}if(this.writeBuffer===void 0)this. -writeBuffer=t,setTimeout(()=>{this.ws.send(this.writeBuffer),this.writeBuffer=void 0}, -0);else{let n=new Uint8Array(this.writeBuffer.length+t.length);n.set(this.writeBuffer), -n.set(t,this.writeBuffer.length),this.writeBuffer=n}}write(t,n="utf8",i=s=>{}){return t. -length===0?(i(),!0):(typeof t=="string"&&(t=y.from(t,n)),this.tlsState===0?(this. -rawWrite(t),i()):this.tlsState===1?this.once("secureConnection",()=>{this.write( -t,n,i)}):(this.tlsWrite(t),i()),!0)}end(t=y.alloc(0),n="utf8",i=()=>{}){return this. -write(t,n,()=>{this.ws.close(),i()}),this}destroy(){return this.destroyed=!0,this. -end()}};a(v,"Socket"),_(v,"defaults",{poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{ -let s;return i?.jwtAuth?s=t.replace(ws,"apiauth."):s=t.replace(ws,"api."),"https\ -://"+s+"/sql"},"fetchEndpoint"),fetchConnectionCache:!0,fetchFunction:void 0,webSocketConstructor:void 0, -wsProxy:a(t=>t+"/v2","wsProxy"),useSecureWebSocket:!0,forceDisablePgSSL:!0,coalesceWrites:!0, -pipelineConnect:"password",subtls:void 0,rootCerts:"",pipelineTLS:!1,disableSNI:!1}), -_(v,"opts",{});Se=v});var en=I(T=>{"use strict";p();Object.defineProperty(T,"__esModule",{value:!0});T. +. Details: ${p}`)),this.emit("close")})}}async startTls(t){if(this.subtls===void 0) +throw new Error("For Postgres SSL connections, you must set `neonConfig.subtls` \ +to the subtls library. See https://github.com/neondatabase/serverless/blob/main/\ +CONFIG.md for more information.");this.tlsState=1;let n=this.subtls.TrustedCert. +databaseFromPEM(this.rootCerts),i=new this.subtls.WebSocketReadQueue(this.ws),s=i. +read.bind(i),o=this.rawWrite.bind(this),[u,c]=await this.subtls.startTls(t,n,s,o, +{useSNI:!this.disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0}); +this.tlsRead=u,this.tlsWrite=c,this.tlsState=2,this.encrypted=!0,this.authorized= +!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){for(;;){ +let t=await this.tlsRead();if(t===void 0)break;{let n=y.from(t);this.emit("data", +n)}}}rawWrite(t){if(!this.coalesceWrites){this.ws.send(t);return}if(this.writeBuffer=== +void 0)this.writeBuffer=t,setTimeout(()=>{this.ws.send(this.writeBuffer),this.writeBuffer= +void 0},0);else{let n=new Uint8Array(this.writeBuffer.length+t.length);n.set(this. +writeBuffer),n.set(t,this.writeBuffer.length),this.writeBuffer=n}}write(t,n="utf\ +8",i=s=>{}){return t.length===0?(i(),!0):(typeof t=="string"&&(t=y.from(t,n)),this. +tlsState===0?(this.rawWrite(t),i()):this.tlsState===1?this.once("secureConnectio\ +n",()=>{this.write(t,n,i)}):(this.tlsWrite(t),i()),!0)}end(t=y.alloc(0),n="utf8",i=()=>{}){ +return this.write(t,n,()=>{this.ws.close(),i()}),this}destroy(){return this.destroyed= +!0,this.end()}};a(E,"Socket"),A(E,"defaults",{poolQueryViaFetch:!1,fetchEndpoint:a( +(t,n,i)=>{let s;return i?.jwtAuth?s=t.replace(ws,"apiauth."):s=t.replace(ws,"api\ +."),"https://"+s+"/sql"},"fetchEndpoint"),fetchConnectionCache:!0,fetchFunction:void 0, +webSocketConstructor:void 0,wsProxy:a(t=>t+"/v2","wsProxy"),useSecureWebSocket:!0, +forceDisablePgSSL:!0,coalesceWrites:!0,pipelineConnect:"password",subtls:void 0, +rootCerts:"",pipelineTLS:!1,disableSNI:!1}),A(E,"opts",{});Se=E});var en=I(T=>{"use strict";d();Object.defineProperty(T,"__esModule",{value:!0});T. NoticeMessage=T.DataRowMessage=T.CommandCompleteMessage=T.ReadyForQueryMessage=T. NotificationResponseMessage=T.BackendKeyDataMessage=T.AuthenticationMD5Password= T.ParameterStatusMessage=T.ParameterDescriptionMessage=T.RowDescriptionMessage=T. @@ -1031,33 +1032,33 @@ noData",length:5};T.portalSuspended={name:"portalSuspended",length:5};T.replicat {name:"replicationStart",length:4};T.emptyQuery={name:"emptyQuery",length:4};T.copyDone= {name:"copyDone",length:4};var qr=class qr extends Error{constructor(e,t,n){super( e),this.length=t,this.name=n}};a(qr,"DatabaseError");var Cr=qr;T.DatabaseError=Cr; -var Qr=class Qr{constructor(e,t){this.length=e,this.chunk=t,this.name="copyData"}}; -a(Qr,"CopyDataMessage");var Tr=Qr;T.CopyDataMessage=Tr;var jr=class jr{constructor(e,t,n,i){ -this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(jr,"Co\ -pyResponse");var Ir=jr;T.CopyResponse=Ir;var Wr=class Wr{constructor(e,t,n,i,s,o,u){ +var Nr=class Nr{constructor(e,t){this.length=e,this.chunk=t,this.name="copyData"}}; +a(Nr,"CopyDataMessage");var Tr=Nr;T.CopyDataMessage=Tr;var Wr=class Wr{constructor(e,t,n,i){ +this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(Wr,"Co\ +pyResponse");var Ir=Wr;T.CopyResponse=Ir;var jr=class jr{constructor(e,t,n,i,s,o,u){ this.name=e,this.tableID=t,this.columnID=n,this.dataTypeID=i,this.dataTypeSize=s, -this.dataTypeModifier=o,this.format=u}};a(Wr,"Field");var Pr=Wr;T.Field=Pr;var Hr=class Hr{constructor(e,t){ +this.dataTypeModifier=o,this.format=u}};a(jr,"Field");var Rr=jr;T.Field=Rr;var Hr=class Hr{constructor(e,t){ this.length=e,this.fieldCount=t,this.name="rowDescription",this.fields=new Array( -this.fieldCount)}};a(Hr,"RowDescriptionMessage");var Br=Hr;T.RowDescriptionMessage= -Br;var Gr=class Gr{constructor(e,t){this.length=e,this.parameterCount=t,this.name= +this.fieldCount)}};a(Hr,"RowDescriptionMessage");var Pr=Hr;T.RowDescriptionMessage= +Pr;var Gr=class Gr{constructor(e,t){this.length=e,this.parameterCount=t,this.name= "parameterDescription",this.dataTypeIDs=new Array(this.parameterCount)}};a(Gr,"P\ -arameterDescriptionMessage");var Lr=Gr;T.ParameterDescriptionMessage=Lr;var $r=class $r{constructor(e,t,n){ +arameterDescriptionMessage");var Fr=Gr;T.ParameterDescriptionMessage=Fr;var $r=class $r{constructor(e,t,n){ this.length=e,this.parameterName=t,this.parameterValue=n,this.name="parameterSta\ -tus"}};a($r,"ParameterStatusMessage");var Rr=$r;T.ParameterStatusMessage=Rr;var Vr=class Vr{constructor(e,t){ +tus"}};a($r,"ParameterStatusMessage");var Lr=$r;T.ParameterStatusMessage=Lr;var Vr=class Vr{constructor(e,t){ this.length=e,this.salt=t,this.name="authenticationMD5Password"}};a(Vr,"Authenti\ -cationMD5Password");var Fr=Vr;T.AuthenticationMD5Password=Fr;var Kr=class Kr{constructor(e,t,n){ +cationMD5Password");var Br=Vr;T.AuthenticationMD5Password=Br;var Kr=class Kr{constructor(e,t,n){ this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Kr, "BackendKeyDataMessage");var Mr=Kr;T.BackendKeyDataMessage=Mr;var zr=class zr{constructor(e,t,n,i){ this.length=e,this.processId=t,this.channel=n,this.payload=i,this.name="notifica\ -tion"}};a(zr,"NotificationResponseMessage");var Dr=zr;T.NotificationResponseMessage= -Dr;var Yr=class Yr{constructor(e,t){this.length=e,this.status=t,this.name="ready\ -ForQuery"}};a(Yr,"ReadyForQueryMessage");var kr=Yr;T.ReadyForQueryMessage=kr;var Zr=class Zr{constructor(e,t){ +tion"}};a(zr,"NotificationResponseMessage");var kr=zr;T.NotificationResponseMessage= +kr;var Yr=class Yr{constructor(e,t){this.length=e,this.status=t,this.name="ready\ +ForQuery"}};a(Yr,"ReadyForQueryMessage");var Or=Yr;T.ReadyForQueryMessage=Or;var Zr=class Zr{constructor(e,t){ this.length=e,this.text=t,this.name="commandComplete"}};a(Zr,"CommandCompleteMes\ -sage");var Ur=Zr;T.CommandCompleteMessage=Ur;var Jr=class Jr{constructor(e,t){this. +sage");var Qr=Zr;T.CommandCompleteMessage=Qr;var Jr=class Jr{constructor(e,t){this. length=e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(Jr,"Data\ -RowMessage");var Or=Jr;T.DataRowMessage=Or;var Xr=class Xr{constructor(e,t){this. -length=e,this.message=t,this.name="notice"}};a(Xr,"NoticeMessage");var Nr=Xr;T.NoticeMessage= -Nr});var xs=I(xt=>{"use strict";p();Object.defineProperty(xt,"__esModule",{value:!0}); +RowMessage");var Dr=Jr;T.DataRowMessage=Dr;var Xr=class Xr{constructor(e,t){this. +length=e,this.message=t,this.name="notice"}};a(Xr,"NoticeMessage");var Ur=Xr;T.NoticeMessage= +Ur});var xs=I(xt=>{"use strict";d();Object.defineProperty(xt,"__esModule",{value:!0}); xt.Writer=void 0;var rn=class rn{constructor(e=256){this.size=e,this.offset=5,this. headerPosition=0,this.buffer=y.allocUnsafe(e)}ensure(e){var t=this.buffer.length- this.offset;if(t>1)+e;this.buffer=y.allocUnsafe( @@ -1073,58 +1074,58 @@ this.offset+=e.length,this}join(e){if(e){this.buffer[this.headerPosition]=e;let offset-(this.headerPosition+1);this.buffer.writeInt32BE(t,this.headerPosition+1)} return this.buffer.slice(e?0:5,this.offset)}flush(e){var t=this.join(e);return this. offset=5,this.headerPosition=0,this.buffer=y.allocUnsafe(this.size),t}};a(rn,"Wr\ -iter");var tn=rn;xt.Writer=tn});var vs=I(vt=>{"use strict";p();Object.defineProperty(vt,"__esModule",{value:!0}); -vt.serialize=void 0;var nn=xs(),M=new nn.Writer,Uu=a(r=>{M.addInt16(3).addInt16( +iter");var tn=rn;xt.Writer=tn});var Es=I(Et=>{"use strict";d();Object.defineProperty(Et,"__esModule",{value:!0}); +Et.serialize=void 0;var nn=xs(),M=new nn.Writer,Du=a(r=>{M.addInt16(3).addInt16( 0);for(let n of Object.keys(r))M.addCString(n).addCString(r[n]);M.addCString("cl\ ient_encoding").addCString("UTF8");var e=M.addCString("").flush(),t=e.length+4;return new nn. -Writer().addInt32(t).add(e).flush()},"startup"),Ou=a(()=>{let r=y.allocUnsafe(8); -return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Nu=a(r=>M. -addCString(r).flush(112),"password"),qu=a(function(r,e){return M.addCString(r).addInt32( -y.byteLength(e)).addString(e),M.flush(112)},"sendSASLInitialResponseMessage"),Qu=a( +Writer().addInt32(t).add(e).flush()},"startup"),Uu=a(()=>{let r=y.allocUnsafe(8); +return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),qu=a(r=>M. +addCString(r).flush(112),"password"),Nu=a(function(r,e){return M.addCString(r).addInt32( +y.byteLength(e)).addString(e),M.flush(112)},"sendSASLInitialResponseMessage"),Wu=a( function(r){return M.addString(r).flush(112)},"sendSCRAMClientFinalMessage"),ju=a( -r=>M.addCString(r).flush(81),"query"),Es=[],Wu=a(r=>{let e=r.name||"";e.length>63&& +r=>M.addCString(r).flush(81),"query"),vs=[],Hu=a(r=>{let e=r.name||"";e.length>63&& (console.error("Warning! Postgres only supports 63 characters for query names."), console.error("You supplied %s (%s)",e,e.length),console.error("This can cause c\ -onflicts and silent errors executing queries"));let t=r.types||Es;for(var n=t.length, +onflicts and silent errors executing queries"));let t=r.types||vs;for(var n=t.length, i=M.addCString(e).addCString(r.text).addInt16(n),s=0;s{let e=r.portal||"",t=r.statement|| -"",n=r.binary||!1,i=r.values||Es,s=i.length;return M.addCString(e).addCString(t), -M.addInt16(s),Hu(i,r.valueMapper),M.addInt16(s),M.add(Ne.flush()),M.addInt16(n?1: -0),M.flush(66)},"bind"),$u=y.from([69,0,0,0,9,0,0,0,0,0]),Vu=a(r=>{if(!r||!r.portal&& -!r.rows)return $u;let e=r.portal||"",t=r.rows||0,n=y.byteLength(e),i=4+n+1+4,s=y. +flush(80)},"parse"),De=new nn.Writer,Gu=a(function(r,e){for(let t=0;t{let e=r.portal||"",t=r.statement|| +"",n=r.binary||!1,i=r.values||vs,s=i.length;return M.addCString(e).addCString(t), +M.addInt16(s),Gu(i,r.valueMapper),M.addInt16(s),M.add(De.flush()),M.addInt16(n?1: +0),M.flush(66)},"bind"),Vu=y.from([69,0,0,0,9,0,0,0,0,0]),Ku=a(r=>{if(!r||!r.portal&& +!r.rows)return Vu;let e=r.portal||"",t=r.rows||0,n=y.byteLength(e),i=4+n+1+4,s=y. allocUnsafe(1+i);return s[0]=69,s.writeInt32BE(i,1),s.write(e,5,"utf-8"),s[n+5]= -0,s.writeUInt32BE(t,s.length-4),s},"execute"),Ku=a((r,e)=>{let t=y.allocUnsafe(16); +0,s.writeUInt32BE(t,s.length-4),s},"execute"),zu=a((r,e)=>{let t=y.allocUnsafe(16); return t.writeInt32BE(16,0),t.writeInt16BE(1234,4),t.writeInt16BE(5678,6),t.writeInt32BE( r,8),t.writeInt32BE(e,12),t},"cancel"),sn=a((r,e)=>{let n=4+y.byteLength(e)+1,i=y. allocUnsafe(1+n);return i[0]=r,i.writeInt32BE(n,1),i.write(e,5,"utf-8"),i[n]=0,i}, -"cstringMessage"),zu=M.addCString("P").flush(68),Yu=M.addCString("S").flush(68), -Zu=a(r=>r.name?sn(68,`${r.type}${r.name||""}`):r.type==="P"?zu:Yu,"describe"),Ju=a( -r=>{let e=`${r.type}${r.name||""}`;return sn(67,e)},"close"),Xu=a(r=>M.add(r).flush( -100),"copyData"),ec=a(r=>sn(102,r),"copyFail"),Et=a(r=>y.from([r,0,0,0,4]),"code\ -OnlyBuffer"),tc=Et(72),rc=Et(83),nc=Et(88),ic=Et(99),sc={startup:Uu,password:Nu, -requestSsl:Ou,sendSASLInitialResponseMessage:qu,sendSCRAMClientFinalMessage:Qu,query:ju, -parse:Wu,bind:Gu,execute:Vu,describe:Zu,close:Ju,flush:a(()=>tc,"flush"),sync:a( -()=>rc,"sync"),end:a(()=>nc,"end"),copyData:Xu,copyDone:a(()=>ic,"copyDone"),copyFail:ec, -cancel:Ku};vt.serialize=sc});var _s=I(_t=>{"use strict";p();Object.defineProperty(_t,"__esModule",{value:!0}); -_t.BufferReader=void 0;var oc=y.allocUnsafe(0),an=class an{constructor(e=0){this. -offset=e,this.buffer=oc,this.encoding="utf-8"}setBuffer(e,t){this.offset=e,this. +"cstringMessage"),Yu=M.addCString("P").flush(68),Zu=M.addCString("S").flush(68), +Ju=a(r=>r.name?sn(68,`${r.type}${r.name||""}`):r.type==="P"?Yu:Zu,"describe"),Xu=a( +r=>{let e=`${r.type}${r.name||""}`;return sn(67,e)},"close"),ec=a(r=>M.add(r).flush( +100),"copyData"),tc=a(r=>sn(102,r),"copyFail"),vt=a(r=>y.from([r,0,0,0,4]),"code\ +OnlyBuffer"),rc=vt(72),nc=vt(83),ic=vt(88),sc=vt(99),oc={startup:Du,password:qu, +requestSsl:Uu,sendSASLInitialResponseMessage:Nu,sendSCRAMClientFinalMessage:Wu,query:ju, +parse:Hu,bind:$u,execute:Ku,describe:Ju,close:Xu,flush:a(()=>rc,"flush"),sync:a( +()=>nc,"sync"),end:a(()=>ic,"end"),copyData:ec,copyDone:a(()=>sc,"copyDone"),copyFail:tc, +cancel:zu};Et.serialize=oc});var As=I(At=>{"use strict";d();Object.defineProperty(At,"__esModule",{value:!0}); +At.BufferReader=void 0;var ac=y.allocUnsafe(0),an=class an{constructor(e=0){this. +offset=e,this.buffer=ac,this.encoding="utf-8"}setBuffer(e,t){this.offset=e,this. buffer=t}int16(){let e=this.buffer.readInt16BE(this.offset);return this.offset+= 2,e}byte(){let e=this.buffer[this.offset];return this.offset++,e}int32(){let e=this. buffer.readInt32BE(this.offset);return this.offset+=4,e}string(e){let t=this.buffer. toString(this.encoding,this.offset,this.offset+e);return this.offset+=e,t}cstring(){ let e=this.offset,t=e;for(;this.buffer[t++]!==0;);return this.offset=t,this.buffer. toString(this.encoding,e,t-1)}bytes(e){let t=this.buffer.slice(this.offset,this. -offset+e);return this.offset+=e,t}};a(an,"BufferReader");var on=an;_t.BufferReader= -on});var Ts=I(At=>{"use strict";p();Object.defineProperty(At,"__esModule",{value:!0}); -At.Parser=void 0;var D=en(),ac=_s(),un=1,uc=4,As=un+uc,Cs=y.allocUnsafe(0),hn=class hn{constructor(e){ -if(this.buffer=Cs,this.bufferLength=0,this.bufferOffset=0,this.reader=new ac.BufferReader, +offset+e);return this.offset+=e,t}};a(an,"BufferReader");var on=an;At.BufferReader= +on});var Ts=I(_t=>{"use strict";d();Object.defineProperty(_t,"__esModule",{value:!0}); +_t.Parser=void 0;var k=en(),uc=As(),un=1,cc=4,_s=un+cc,Cs=y.allocUnsafe(0),ln=class ln{constructor(e){ +if(this.buffer=Cs,this.bufferLength=0,this.bufferOffset=0,this.reader=new uc.BufferReader, e?.mode==="binary")throw new Error("Binary mode not supported yet");this.mode=e?. mode||"text"}parse(e,t){this.mergeBuffer(e);let n=this.bufferOffset+this.bufferLength, -i=this.bufferOffset;for(;i+As<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( -i+un),u=un+o;if(u+i<=n){let c=this.handlePacket(i+As,s,o,this.buffer);t(c),i+=u}else +i=this.bufferOffset;for(;i+_s<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( +i+un),u=un+o;if(u+i<=n){let c=this.handlePacket(i+_s,s,o,this.buffer);t(c),i+=u}else break}i===n?(this.buffer=Cs,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength= n-i,this.bufferOffset=i)}mergeBuffer(e){if(this.bufferLength>0){let t=this.bufferLength+ e.byteLength;if(t+this.bufferOffset>this.buffer.byteLength){let i;if(t<=this.buffer. @@ -1133,9 +1134,9 @@ byteLength*2;for(;t>=s;)s*=2;i=y.allocUnsafe(s)}this.buffer.copy(i,0,this.buffer this.bufferOffset+this.bufferLength),this.buffer=i,this.bufferOffset=0}e.copy(this. buffer,this.bufferOffset+this.bufferLength),this.bufferLength=t}else this.buffer= e,this.bufferOffset=0,this.bufferLength=e.byteLength}handlePacket(e,t,n,i){switch(t){case 50: -return D.bindComplete;case 49:return D.parseComplete;case 51:return D.closeComplete;case 110: -return D.noData;case 115:return D.portalSuspended;case 99:return D.copyDone;case 87: -return D.replicationStart;case 73:return D.emptyQuery;case 68:return this.parseDataRowMessage( +return k.bindComplete;case 49:return k.parseComplete;case 51:return k.closeComplete;case 110: +return k.noData;case 115:return k.portalSuspended;case 99:return k.copyDone;case 87: +return k.replicationStart;case 73:return k.emptyQuery;case 68:return this.parseDataRowMessage( e,n,i);case 67:return this.parseCommandCompleteMessage(e,n,i);case 90:return this. parseReadyForQueryMessage(e,n,i);case 65:return this.parseNotificationMessage(e, n,i);case 82:return this.parseAuthenticationResponse(e,n,i);case 83:return this. @@ -1144,54 +1145,54 @@ return this.parseErrorMessage(e,n,i,"error");case 78:return this.parseErrorMessa e,n,i,"notice");case 84:return this.parseRowDescriptionMessage(e,n,i);case 116:return this. parseParameterDescriptionMessage(e,n,i);case 71:return this.parseCopyInMessage(e, n,i);case 72:return this.parseCopyOutMessage(e,n,i);case 100:return this.parseCopyData( -e,n,i);default:return new D.DatabaseError("received invalid response: "+t.toString( +e,n,i);default:return new k.DatabaseError("received invalid response: "+t.toString( 16),n,"error")}}parseReadyForQueryMessage(e,t,n){this.reader.setBuffer(e,n);let i=this. -reader.string(1);return new D.ReadyForQueryMessage(t,i)}parseCommandCompleteMessage(e,t,n){ -this.reader.setBuffer(e,n);let i=this.reader.cstring();return new D.CommandCompleteMessage( -t,i)}parseCopyData(e,t,n){let i=n.slice(e,e+(t-4));return new D.CopyDataMessage( +reader.string(1);return new k.ReadyForQueryMessage(t,i)}parseCommandCompleteMessage(e,t,n){ +this.reader.setBuffer(e,n);let i=this.reader.cstring();return new k.CommandCompleteMessage( +t,i)}parseCopyData(e,t,n){let i=n.slice(e,e+(t-4));return new k.CopyDataMessage( t,i)}parseCopyInMessage(e,t,n){return this.parseCopyMessage(e,t,n,"copyInRespons\ e")}parseCopyOutMessage(e,t,n){return this.parseCopyMessage(e,t,n,"copyOutRespon\ se")}parseCopyMessage(e,t,n,i){this.reader.setBuffer(e,n);let s=this.reader.byte()!== -0,o=this.reader.int16(),u=new D.CopyResponse(t,i,s,o);for(let c=0;c{"use strict";p();Object.defineProperty(xe,"__esModule",{value:!0}); -xe.DatabaseError=xe.serialize=xe.parse=void 0;var cc=en();Object.defineProperty( -xe,"DatabaseError",{enumerable:!0,get:a(function(){return cc.DatabaseError},"get")}); -var hc=vs();Object.defineProperty(xe,"serialize",{enumerable:!0,get:a(function(){ -return hc.serialize},"get")});var lc=Ts();function fc(r,e){let t=new lc.Parser;return r. -on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(fc,"parse");xe. -parse=fc});var Is={};re(Is,{connect:()=>pc});function pc({socket:r,servername:e}){return r. -startTls(e),r}var Ps=z(()=>{"use strict";p();a(pc,"connect")});var dn=I((af,Rs)=>{"use strict";p();var Bs=(St(),O(Ss)),dc=we().EventEmitter,{parse:yc, -serialize:q}=ln(),Ls=q.flush(),mc=q.sync(),gc=q.end(),pn=class pn extends dc{constructor(e){ -super(),e=e||{},this.stream=e.stream||new Bs.Socket,this._keepAlive=e.keepAlive, +line=s.L,c.routine=s.R,c}};a(ln,"Parser");var cn=ln;_t.Parser=cn});var hn=I(xe=>{"use strict";d();Object.defineProperty(xe,"__esModule",{value:!0}); +xe.DatabaseError=xe.serialize=xe.parse=void 0;var lc=en();Object.defineProperty( +xe,"DatabaseError",{enumerable:!0,get:a(function(){return lc.DatabaseError},"get")}); +var hc=Es();Object.defineProperty(xe,"serialize",{enumerable:!0,get:a(function(){ +return hc.serialize},"get")});var fc=Ts();function dc(r,e){let t=new fc.Parser;return r. +on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(dc,"parse");xe. +parse=dc});var Is={};te(Is,{connect:()=>pc});function pc({socket:r,servername:e}){return r. +startTls(e),r}var Rs=z(()=>{"use strict";d();a(pc,"connect")});var pn=I((cf,Ls)=>{"use strict";d();var Ps=(St(),U(Ss)),yc=we().EventEmitter,{parse:mc, +serialize:N}=hn(),Fs=N.flush(),gc=N.sync(),wc=N.end(),dn=class dn extends yc{constructor(e){ +super(),e=e||{},this.stream=e.stream||new Ps.Socket,this._keepAlive=e.keepAlive, this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis,this.lastBuffer= !1,this.parsedStatements={},this.ssl=e.ssl||!1,this._ending=!1,this._emitMessage= !1;var t=this;this.on("newListener",function(n){n==="message"&&(t._emitMessage=!0)})}connect(e,t){ @@ -1204,36 +1205,36 @@ ssl)return this.attachListeners(this.stream);this.stream.once("data",function(s) var o=s.toString("utf8");switch(o){case"S":break;case"N":return n.stream.end(),n. emit("error",new Error("The server does not support SSL connections"));default:return n. stream.end(),n.emit("error",new Error("There was an error establishing an SSL co\ -nnection"))}var u=(Ps(),O(Is));let c={socket:n.stream};n.ssl!==!0&&(Object.assign( -c,n.ssl),"key"in n.ssl&&(c.key=n.ssl.key)),Bs.isIP(t)===0&&(c.servername=t);try{ -n.stream=u.connect(c)}catch(h){return n.emit("error",h)}n.attachListeners(n.stream), +nnection"))}var u=(Rs(),U(Is));let c={socket:n.stream};n.ssl!==!0&&(Object.assign( +c,n.ssl),"key"in n.ssl&&(c.key=n.ssl.key)),Ps.isIP(t)===0&&(c.servername=t);try{ +n.stream=u.connect(c)}catch(l){return n.emit("error",l)}n.attachListeners(n.stream), n.stream.on("error",i),n.emit("sslconnect")})}attachListeners(e){e.on("end",()=>{ -this.emit("end")}),yc(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& -this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(q.requestSsl())}startup(e){ -this.stream.write(q.startup(e))}cancel(e,t){this._send(q.cancel(e,t))}password(e){ -this._send(q.password(e))}sendSASLInitialResponseMessage(e,t){this._send(q.sendSASLInitialResponseMessage( -e,t))}sendSCRAMClientFinalMessage(e){this._send(q.sendSCRAMClientFinalMessage(e))}_send(e){ -return this.stream.writable?this.stream.write(e):!1}query(e){this._send(q.query( -e))}parse(e){this._send(q.parse(e))}bind(e){this._send(q.bind(e))}execute(e){this. -_send(q.execute(e))}flush(){this.stream.writable&&this.stream.write(Ls)}sync(){this. -_ending=!0,this._send(Ls),this._send(mc)}ref(){this.stream.ref()}unref(){this.stream. +this.emit("end")}),mc(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& +this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(N.requestSsl())}startup(e){ +this.stream.write(N.startup(e))}cancel(e,t){this._send(N.cancel(e,t))}password(e){ +this._send(N.password(e))}sendSASLInitialResponseMessage(e,t){this._send(N.sendSASLInitialResponseMessage( +e,t))}sendSCRAMClientFinalMessage(e){this._send(N.sendSCRAMClientFinalMessage(e))}_send(e){ +return this.stream.writable?this.stream.write(e):!1}query(e){this._send(N.query( +e))}parse(e){this._send(N.parse(e))}bind(e){this._send(N.bind(e))}execute(e){this. +_send(N.execute(e))}flush(){this.stream.writable&&this.stream.write(Fs)}sync(){this. +_ending=!0,this._send(Fs),this._send(gc)}ref(){this.stream.ref()}unref(){this.stream. unref()}end(){if(this._ending=!0,!this._connecting||!this.stream.writable){this. -stream.end();return}return this.stream.write(gc,()=>{this.stream.end()})}close(e){ -this._send(q.close(e))}describe(e){this._send(q.describe(e))}sendCopyFromChunk(e){ -this._send(q.copyData(e))}endCopyFrom(){this._send(q.copyDone())}sendCopyFail(e){ -this._send(q.copyFail(e))}};a(pn,"Connection");var fn=pn;Rs.exports=fn});var Ds=I((lf,Ms)=>{"use strict";p();var wc=we().EventEmitter,hf=(Ge(),O(He)),bc=tt(), -yn=Hi(),Sc=ts(),xc=wt(),Ec=bt(),Fs=gs(),vc=et(),_c=dn(),mn=class mn extends wc{constructor(e){ +stream.end();return}return this.stream.write(wc,()=>{this.stream.end()})}close(e){ +this._send(N.close(e))}describe(e){this._send(N.describe(e))}sendCopyFromChunk(e){ +this._send(N.copyData(e))}endCopyFrom(){this._send(N.copyDone())}sendCopyFail(e){ +this._send(N.copyFail(e))}};a(dn,"Connection");var fn=dn;Ls.exports=fn});var ks=I((df,Ms)=>{"use strict";d();var bc=we().EventEmitter,ff=(Ge(),U(He)),Sc=tt(), +yn=Hi(),xc=ts(),vc=wt(),Ec=bt(),Bs=gs(),Ac=et(),_c=pn(),mn=class mn extends bc{constructor(e){ super(),this.connectionParameters=new Ec(e),this.user=this.connectionParameters. user,this.database=this.connectionParameters.database,this.port=this.connectionParameters. port,this.host=this.connectionParameters.host,Object.defineProperty(this,"passwo\ rd",{configurable:!0,enumerable:!1,writable:!0,value:this.connectionParameters.password}), this.replication=this.connectionParameters.replication;var t=e||{};this._Promise= -t.Promise||S.Promise,this._types=new xc(t.types),this._ending=!1,this._connecting= +t.Promise||b.Promise,this._types=new vc(t.types),this._ending=!1,this._connecting= !1,this._connected=!1,this._connectionError=!1,this._queryable=!0,this.connection= t.connection||new _c({stream:t.stream,ssl:this.connectionParameters.ssl,keepAlive:t. keepAlive||!1,keepAliveInitialDelayMillis:t.keepAliveInitialDelayMillis||0,encoding:this. connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t. -binary||vc.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters. +binary||Ac.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters. ssl||!1,this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}), this._connectionTimeoutMillis=t.connectionTimeoutMillis||0}_errorAllQueries(e){let t=a( n=>{m.nextTick(()=>{n.handleError(e,this.connection)})},"enqueueError");this.activeQuery&& @@ -1271,10 +1272,10 @@ let t=this.connection;typeof this.password=="function"?this._Promise.resolve().t ()=>this.password()).then(n=>{if(n!==void 0){if(typeof n!="string"){t.emit("erro\ r",new TypeError("Password must be a string"));return}this.connectionParameters. password=this.password=n}else this.connectionParameters.password=this.password=null; -e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():Sc(this.connectionParameters, +e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():xc(this.connectionParameters, n=>{n!==void 0&&(this.connectionParameters.password=this.password=n),e()})}_handleAuthCleartextPassword(e){ this._checkPgPass(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){ -this._checkPgPass(()=>{let t=bc.postgresMd5PasswordHash(this.user,this.password, +this._checkPgPass(()=>{let t=Sc.postgresMd5PasswordHash(this.user,this.password, e.salt);this.connection.password(t)})}_handleAuthSASL(e){this._checkPgPass(()=>{ this.saslSession=yn.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){ @@ -1320,12 +1321,12 @@ e&&m.nextTick(()=>{this.activeQuery.handleError(e,this.connection),this.readyFor emit("drain"))}query(e,t,n){var i,s,o,u,c;if(e==null)throw new TypeError("Client\ was passed a null or undefined query");return typeof e.submit=="function"?(o=e. query_timeout||this.connectionParameters.query_timeout,s=i=e,typeof t=="function"&& -(i.callback=i.callback||t)):(o=this.connectionParameters.query_timeout,i=new Fs( -e,t,n),i.callback||(s=new this._Promise((h,l)=>{i.callback=(d,b)=>d?l(d):h(b)}))), -o&&(c=i.callback,u=setTimeout(()=>{var h=new Error("Query read timeout");m.nextTick( -()=>{i.handleError(h,this.connection)}),c(h),i.callback=()=>{};var l=this.queryQueue. -indexOf(i);l>-1&&this.queryQueue.splice(l,1),this._pulseQueryQueue()},o),i.callback= -(h,l)=>{clearTimeout(u),c(h,l)}),this.binary&&!i.binary&&(i.binary=!0),i._result&& +(i.callback=i.callback||t)):(o=this.connectionParameters.query_timeout,i=new Bs( +e,t,n),i.callback||(s=new this._Promise((l,h)=>{i.callback=(p,S)=>p?h(p):l(S)}))), +o&&(c=i.callback,u=setTimeout(()=>{var l=new Error("Query read timeout");m.nextTick( +()=>{i.handleError(l,this.connection)}),c(l),i.callback=()=>{};var h=this.queryQueue. +indexOf(i);h>-1&&this.queryQueue.splice(h,1),this._pulseQueryQueue()},o),i.callback= +(l,h)=>{clearTimeout(u),c(l,h)}),this.binary&&!i.binary&&(i.binary=!0),i._result&& !i._result._types&&(i._result._types=this._types),this._queryable?this._ending?(m. nextTick(()=>{i.handleError(new Error("Client was closed and is not queryable"), this.connection)}),s):(this.queryQueue.push(i),this._pulseQueryQueue(),s):(m.nextTick( @@ -1335,18 +1336,18 @@ unref()}end(e){if(this._ending=!0,!this.connection._connecting)if(e)e();else ret _Promise.resolve();if(this.activeQuery||!this._queryable?this.connection.stream. destroy():this.connection.end(),e)this.connection.once("end",e);else return new this. _Promise(t=>{this.connection.once("end",t)})}};a(mn,"Client");var Ct=mn;Ct.Query= -Fs;Ms.exports=Ct});var Ns=I((df,Os)=>{"use strict";p();var Ac=we().EventEmitter,ks=a(function(){},"\ -NOOP"),Us=a((r,e)=>{let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]}, +Bs;Ms.exports=Ct});var Us=I((mf,Ds)=>{"use strict";d();var Cc=we().EventEmitter,Os=a(function(){},"\ +NOOP"),Qs=a((r,e)=>{let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]}, "removeWhere"),bn=class bn{constructor(e,t,n){this.client=e,this.idleListener=t, this.timeoutId=n}};a(bn,"IdleItem");var gn=bn,Sn=class Sn{constructor(e){this.callback= -e}};a(Sn,"PendingItem");var qe=Sn;function Cc(){throw new Error("Release called \ -on client which has already been released to the pool.")}a(Cc,"throwOnDoubleRele\ +e}};a(Sn,"PendingItem");var Ue=Sn;function Tc(){throw new Error("Release called \ +on client which has already been released to the pool.")}a(Tc,"throwOnDoubleRele\ ase");function Tt(r,e){if(e)return{callback:e,result:void 0};let t,n,i=a(function(o,u){ o?t(o):n(u)},"cb"),s=new r(function(o,u){n=o,t=u}).catch(o=>{throw Error.captureStackTrace( -o),o});return{callback:i,result:s}}a(Tt,"promisify");function Tc(r,e){return a(function t(n){ +o),o});return{callback:i,result:s}}a(Tt,"promisify");function Ic(r,e){return a(function t(n){ n.client=e,e.removeListener("error",t),e.on("error",()=>{r.log("additional clien\ t error after disconnection due to error",n)}),r._remove(e),r.emit("error",n,e)}, -"idleListener")}a(Tc,"makeIdleListener");var xn=class xn extends Ac{constructor(e,t){ +"idleListener")}a(Ic,"makeIdleListener");var xn=class xn extends Cc{constructor(e,t){ super(),this.options=Object.assign({},e),e!=null&&"password"in e&&Object.defineProperty( this.options,"password",{configurable:!0,enumerable:!1,writable:!0,value:e.password}), e!=null&&e.ssl&&e.ssl.key&&Object.defineProperty(this.options.ssl,"key",{enumerable:!1}), @@ -1354,7 +1355,7 @@ this.options.max=this.options.max||this.options.poolSize||10,this.options.maxUse this.options.maxUses||1/0,this.options.allowExitOnIdle=this.options.allowExitOnIdle|| !1,this.options.maxLifetimeSeconds=this.options.maxLifetimeSeconds||0,this.log=this. options.log||function(){},this.Client=this.options.Client||t||It().Client,this.Promise= -this.options.Promise||S.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this. +this.options.Promise||b.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this. options.idleTimeoutMillis=1e4),this._clients=[],this._idle=[],this._expired=new WeakSet, this._pendingQueue=[],this._endCallback=void 0,this.ending=!1,this.ended=!1}_isFull(){ return this._clients.length>=this.options.max}_pulseQueue(){if(this.log("pulse q\ @@ -1365,34 +1366,34 @@ _pendingQueue.length){this.log("no queued requests");return}if(!this._idle.lengt this._isFull())return;let e=this._pendingQueue.shift();if(this._idle.length){let t=this. _idle.pop();clearTimeout(t.timeoutId);let n=t.client;n.ref&&n.ref();let i=t.idleListener; return this._acquireClient(n,e,i,!1)}if(!this._isFull())return this.newClient(e); -throw new Error("unexpected condition")}_remove(e){let t=Us(this._idle,n=>n.client=== +throw new Error("unexpected condition")}_remove(e){let t=Qs(this._idle,n=>n.client=== e);t!==void 0&&clearTimeout(t.timeoutId),this._clients=this._clients.filter(n=>n!== e),e.end(),this.emit("remove",e)}connect(e){if(this.ending){let i=new Error("Can\ not use a pool after calling end on the pool");return e?e(i):this.Promise.reject( i)}let t=Tt(this.Promise,e),n=t.result;if(this._isFull()||this._idle.length){if(this. _idle.length&&m.nextTick(()=>this._pulseQueue()),!this.options.connectionTimeoutMillis) -return this._pendingQueue.push(new qe(t.callback)),n;let i=a((u,c,h)=>{clearTimeout( -o),t.callback(u,c,h)},"queueCallback"),s=new qe(i),o=setTimeout(()=>{Us(this._pendingQueue, +return this._pendingQueue.push(new Ue(t.callback)),n;let i=a((u,c,l)=>{clearTimeout( +o),t.callback(u,c,l)},"queueCallback"),s=new Ue(i),o=setTimeout(()=>{Qs(this._pendingQueue, u=>u.callback===i),s.timedOut=!0,t.callback(new Error("timeout exceeded when try\ ing to connect"))},this.options.connectionTimeoutMillis);return this._pendingQueue. -push(s),n}return this.newClient(new qe(t.callback)),n}newClient(e){let t=new this. -Client(this.options);this._clients.push(t);let n=Tc(this,t);this.log("checking c\ +push(s),n}return this.newClient(new Ue(t.callback)),n}newClient(e){let t=new this. +Client(this.options);this._clients.push(t);let n=Ic(this,t);this.log("checking c\ lient timeout");let i,s=!1;this.options.connectionTimeoutMillis&&(i=setTimeout(()=>{ this.log("ending client due to timeout"),s=!0,t.connection?t.connection.stream.destroy(): t.end()},this.options.connectionTimeoutMillis)),this.log("connecting new client"), t.connect(o=>{if(i&&clearTimeout(i),t.on("error",n),o)this.log("client failed to\ connect",o),this._clients=this._clients.filter(u=>u!==t),s&&(o.message="Connect\ ion terminated due to connection timeout"),this._pulseQueue(),e.timedOut||e.callback( -o,void 0,ks);else{if(this.log("new client connected"),this.options.maxLifetimeSeconds!== +o,void 0,Os);else{if(this.log("new client connected"),this.options.maxLifetimeSeconds!== 0){let u=setTimeout(()=>{this.log("ending client due to expired lifetime"),this. -_expired.add(t),this._idle.findIndex(h=>h.client===t)!==-1&&this._acquireClient( -t,new qe((h,l,d)=>d()),n,!1)},this.options.maxLifetimeSeconds*1e3);u.unref(),t.once( +_expired.add(t),this._idle.findIndex(l=>l.client===t)!==-1&&this._acquireClient( +t,new Ue((l,h,p)=>p()),n,!1)},this.options.maxLifetimeSeconds*1e3);u.unref(),t.once( "end",()=>clearTimeout(u))}return this._acquireClient(t,e,n,!0)}})}_acquireClient(e,t,n,i){ i&&this.emit("connect",e),this.emit("acquire",e),e.release=this._releaseOnce(e,n), e.removeListener("error",n),t.timedOut?i&&this.options.verify?this.options.verify( e,e.release):e.release():i&&this.options.verify?this.options.verify(e,s=>{if(s)return e. -release(s),t.callback(s,void 0,ks);t.callback(void 0,e,e.release)}):t.callback(void 0, -e,e.release)}_releaseOnce(e,t){let n=!1;return i=>{n&&Cc(),n=!0,this._release(e, +release(s),t.callback(s,void 0,Os);t.callback(void 0,e,e.release)}):t.callback(void 0, +e,e.release)}_releaseOnce(e,t){let n=!1;return i=>{n&&Tc(),n=!0,this._release(e, t,i)}}_release(e,t,n){if(e.on("error",t),e._poolUseCount=(e._poolUseCount||0)+1, this.emit("release",n,e),n||this.ending||!e._queryable||e._ending||e._poolUseCount>= this.options.maxUses){e._poolUseCount>=this.options.maxUses&&this.log("remove ex\ @@ -1405,16 +1406,16 @@ this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=Tt(this.Promise,e return x(function(){return s.callback(new Error("Passing a function as the first\ parameter to pool.query is not supported"))}),s.result}typeof t=="function"&&(n= t,t=void 0);let i=Tt(this.Promise,n);return n=i.callback,this.connect((s,o)=>{if(s) -return n(s);let u=!1,c=a(h=>{u||(u=!0,o.release(h),n(h))},"onError");o.once("err\ -or",c),this.log("dispatching query");try{o.query(e,t,(h,l)=>{if(this.log("query \ -dispatched"),o.removeListener("error",c),!u)return u=!0,o.release(h),h?n(h):n(void 0, -l)})}catch(h){return o.release(h),n(h)}}),i.result}end(e){if(this.log("ending"), +return n(s);let u=!1,c=a(l=>{u||(u=!0,o.release(l),n(l))},"onError");o.once("err\ +or",c),this.log("dispatching query");try{o.query(e,t,(l,h)=>{if(this.log("query \ +dispatched"),o.removeListener("error",c),!u)return u=!0,o.release(l),l?n(l):n(void 0, +h)})}catch(l){return o.release(l),n(l)}}),i.result}end(e){if(this.log("ending"), this.ending){let n=new Error("Called end on pool more than once");return e?e(n): this.Promise.reject(n)}this.ending=!0;let t=Tt(this.Promise,e);return this._endCallback= t.callback,this._pulseQueue(),t.result}get waitingCount(){return this._pendingQueue. length}get idleCount(){return this._idle.length}get expiredCount(){return this._clients. reduce((e,t)=>e+(this._expired.has(t)?1:0),0)}get totalCount(){return this._clients. -length}};a(xn,"Pool");var wn=xn;Os.exports=wn});var qs={};re(qs,{default:()=>Ic});var Ic,Qs=z(()=>{"use strict";p();Ic={}});var js=I((wf,Pc)=>{Pc.exports={name:"pg",version:"8.8.0",description:"PostgreSQL\ +length}};a(xn,"Pool");var wn=xn;Ds.exports=wn});var qs={};te(qs,{default:()=>Rc});var Rc,Ns=z(()=>{"use strict";d();Rc={}});var Ws=I((Sf,Pc)=>{Pc.exports={name:"pg",version:"8.8.0",description:"PostgreSQL\ client - pure javascript & libpq with the same API",keywords:["database","libpq", "pg","postgre","postgres","postgresql","rdbms"],homepage:"https://github.com/bri\ anc/node-postgres",repository:{type:"git",url:"git://github.com/brianc/node-post\ @@ -1425,45 +1426,45 @@ pes":"^2.1.0",pgpass:"1.x"},devDependencies:{async:"2.6.4",bluebird:"3.5.2",co:" 4.6.0","pg-copy-streams":"0.3.0"},peerDependencies:{"pg-native":">=3.0.1"},peerDependenciesMeta:{ "pg-native":{optional:!0}},scripts:{test:"make test-all"},files:["lib","SPONSORS\ .md"],license:"MIT",engines:{node:">= 8.0.0"},gitHead:"c99fb2c127ddf8d712500db2c\ -7b9a5491a178655"}});var Gs=I((bf,Hs)=>{"use strict";p();var Ws=we().EventEmitter,Bc=(Ge(),O(He)),En=tt(), -Qe=Hs.exports=function(r,e,t){Ws.call(this),r=En.normalizeQueryConfig(r,e,t),this. +7b9a5491a178655"}});var Gs=I((xf,Hs)=>{"use strict";d();var js=we().EventEmitter,Fc=(Ge(),U(He)),vn=tt(), +qe=Hs.exports=function(r,e,t){js.call(this),r=vn.normalizeQueryConfig(r,e,t),this. text=r.text,this.values=r.values,this.name=r.name,this.callback=r.callback,this. state="new",this._arrayMode=r.rowMode==="array",this._emitRowEvents=!1,this.on("\ -newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};Bc.inherits( -Qe,Ws);var Lc={sqlState:"code",statementPosition:"position",messagePrimary:"mess\ +newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};Fc.inherits( +qe,js);var Lc={sqlState:"code",statementPosition:"position",messagePrimary:"mess\ age",context:"where",schemaName:"schema",tableName:"table",columnName:"column",dataTypeName:"\ dataType",constraintName:"constraint",sourceFile:"file",sourceLine:"line",sourceFunction:"\ -routine"};Qe.prototype.handleError=function(r){var e=this.native.pq.resultErrorFields(); +routine"};qe.prototype.handleError=function(r){var e=this.native.pq.resultErrorFields(); if(e)for(var t in e){var n=Lc[t]||t;r[n]=e[t]}this.callback?this.callback(r):this. -emit("error",r),this.state="error"};Qe.prototype.then=function(r,e){return this. -_getPromise().then(r,e)};Qe.prototype.catch=function(r){return this._getPromise(). -catch(r)};Qe.prototype._getPromise=function(){return this._promise?this._promise: +emit("error",r),this.state="error"};qe.prototype.then=function(r,e){return this. +_getPromise().then(r,e)};qe.prototype.catch=function(r){return this._getPromise(). +catch(r)};qe.prototype._getPromise=function(){return this._promise?this._promise: (this._promise=new Promise(function(r,e){this._once("end",r),this._once("error", -e)}.bind(this)),this._promise)};Qe.prototype.submit=function(r){this.state="runn\ +e)}.bind(this)),this._promise)};qe.prototype.submit=function(r){this.state="runn\ ing";var e=this;this.native=r.native,r.native.arrayMode=this._arrayMode;var t=a( function(s,o,u){if(r.native.arrayMode=!1,x(function(){e.emit("_done")}),s)return e. -handleError(s);e._emitRowEvents&&(u.length>1?o.forEach((c,h)=>{c.forEach(l=>{e.emit( -"row",l,u[h])})}):o.forEach(function(c){e.emit("row",c,u)})),e.state="end",e.emit( +handleError(s);e._emitRowEvents&&(u.length>1?o.forEach((c,l)=>{c.forEach(h=>{e.emit( +"row",h,u[l])})}):o.forEach(function(c){e.emit("row",c,u)})),e.state="end",e.emit( "end",u),e.callback&&e.callback(null,u)},"after");if(m.domain&&(t=m.domain.bind( t)),this.name){this.name.length>63&&(console.error("Warning! Postgres only suppo\ rts 63 characters for query names."),console.error("You supplied %s (%s)",this.name, this.name.length),console.error("This can cause conflicts and silent errors exec\ -uting queries"));var n=(this.values||[]).map(En.prepareValue);if(r.namedQueries[this. +uting queries"));var n=(this.values||[]).map(vn.prepareValue);if(r.namedQueries[this. name]){if(this.text&&r.namedQueries[this.name]!==this.text){let s=new Error(`Pre\ pared statements must be unique - '${this.name}' was used for a different statem\ ent`);return t(s)}return r.native.execute(this.name,n,t)}return r.native.prepare( this.name,this.text,n.length,function(s){return s?t(s):(r.namedQueries[e.name]=e. text,e.native.execute(e.name,n,t))})}else if(this.values){if(!Array.isArray(this. values)){let s=new Error("Query values must be an array");return t(s)}var i=this. -values.map(En.prepareValue);r.native.query(this.text,i,t)}else r.native.query(this. -text,t)}});var zs=I((vf,Ks)=>{"use strict";p();var Rc=(Qs(),O(qs)),Fc=wt(),Ef=js(),$s=we(). -EventEmitter,Mc=(Ge(),O(He)),Dc=bt(),Vs=Gs(),J=Ks.exports=function(r){$s.call(this), -r=r||{},this._Promise=r.Promise||S.Promise,this._types=new Fc(r.types),this.native= -new Rc({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting= -!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Dc( +values.map(vn.prepareValue);r.native.query(this.text,i,t)}else r.native.query(this. +text,t)}});var zs=I((_f,Ks)=>{"use strict";d();var Bc=(Ns(),U(qs)),Mc=wt(),Af=Ws(),$s=we(). +EventEmitter,kc=(Ge(),U(He)),Oc=bt(),Vs=Gs(),J=Ks.exports=function(r){$s.call(this), +r=r||{},this._Promise=r.Promise||b.Promise,this._types=new Mc(r.types),this.native= +new Bc({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting= +!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Oc( r);this.user=e.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, writable:!0,value:e.password}),this.database=e.database,this.host=e.host,this.port= -e.port,this.namedQueries={}};J.Query=Vs;Mc.inherits(J,$s);J.prototype._errorAllQueries= +e.port,this.namedQueries={}};J.Query=Vs;kc.inherits(J,$s);J.prototype._errorAllQueries= function(r){let e=a(t=>{m.nextTick(()=>{t.native=this.native,t.handleError(r)})}, "enqueueError");this._hasActiveQuery()&&(e(this._activeQuery),this._activeQuery= null),this._queryQueue.forEach(e),this._queryQueue.length=0};J.prototype._connect= @@ -1479,11 +1480,11 @@ prototype.connect=function(r){if(r){this._connect(r);return}return new this._Pro i,s,o,u;if(r==null)throw new TypeError("Client was passed a null or undefined qu\ ery");if(typeof r.submit=="function")s=r.query_timeout||this.connectionParameters. query_timeout,i=n=r,typeof e=="function"&&(r.callback=e);else if(s=this.connectionParameters. -query_timeout,n=new Vs(r,e,t),!n.callback){let c,h;i=new this._Promise((l,d)=>{c= -l,h=d}),n.callback=(l,d)=>l?h(l):c(d)}return s&&(u=n.callback,o=setTimeout(()=>{ +query_timeout,n=new Vs(r,e,t),!n.callback){let c,l;i=new this._Promise((h,p)=>{c= +h,l=p}),n.callback=(h,p)=>h?l(h):c(p)}return s&&(u=n.callback,o=setTimeout(()=>{ var c=new Error("Query read timeout");m.nextTick(()=>{n.handleError(c,this.connection)}), -u(c),n.callback=()=>{};var h=this._queryQueue.indexOf(n);h>-1&&this._queryQueue. -splice(h,1),this._pulseQueryQueue()},s),n.callback=(c,h)=>{clearTimeout(o),u(c,h)}), +u(c),n.callback=()=>{};var l=this._queryQueue.indexOf(n);l>-1&&this._queryQueue. +splice(l,1),this._pulseQueryQueue()},s),n.callback=(c,l)=>{clearTimeout(o),u(c,l)}), this._queryable?this._ending?(n.native=this.native,m.nextTick(()=>{n.handleError( new Error("Client was closed and is not queryable"))}),i):(this._queryQueue.push( n),this._pulseQueryQueue(),i):(n.native=this.native,m.nextTick(()=>{n.handleError( @@ -1501,76 +1502,75 @@ _activeQuery===r?this.native.cancel(function(){}):this._queryQueue.indexOf(r)!== -1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};J.prototype.ref=function(){}; J.prototype.unref=function(){};J.prototype.setTypeParser=function(r,e,t){return this. _types.setTypeParser(r,e,t)};J.prototype.getTypeParser=function(r,e){return this. -_types.getTypeParser(r,e)}});var vn=I((Cf,Ys)=>{"use strict";p();Ys.exports=zs()});var It=I((If,nt)=>{"use strict";p();var kc=Ds(),Uc=et(),Oc=dn(),Nc=Ns(),{DatabaseError:qc}=ln(), -Qc=a(r=>{var e;return e=class extends Nc{constructor(n){super(n,r)}},a(e,"BoundP\ -ool"),e},"poolFactory"),_n=a(function(r){this.defaults=Uc,this.Client=r,this.Query= -this.Client.Query,this.Pool=Qc(this.Client),this._pools=[],this.Connection=Oc,this. -types=Xe(),this.DatabaseError=qc},"PG");typeof m.env.NODE_PG_FORCE_NATIVE<"u"?nt. -exports=new _n(vn()):(nt.exports=new _n(kc),Object.defineProperty(nt.exports,"na\ -tive",{configurable:!0,enumerable:!1,get(){var r=null;try{r=new _n(vn())}catch(e){ +_types.getTypeParser(r,e)}});var En=I((If,Ys)=>{"use strict";d();Ys.exports=zs()});var It=I((Pf,nt)=>{"use strict";d();var Qc=ks(),Dc=et(),Uc=pn(),qc=Us(),{DatabaseError:Nc}=hn(), +Wc=a(r=>{var e;return e=class extends qc{constructor(n){super(n,r)}},a(e,"BoundP\ +ool"),e},"poolFactory"),An=a(function(r){this.defaults=Dc,this.Client=r,this.Query= +this.Client.Query,this.Pool=Wc(this.Client),this._pools=[],this.Connection=Uc,this. +types=Xe(),this.DatabaseError=Nc},"PG");typeof m.env.NODE_PG_FORCE_NATIVE<"u"?nt. +exports=new An(En()):(nt.exports=new An(Qc),Object.defineProperty(nt.exports,"na\ +tive",{configurable:!0,enumerable:!1,get(){var r=null;try{r=new An(En())}catch(e){ if(e.code!=="MODULE_NOT_FOUND")throw e}return Object.defineProperty(nt.exports,"\ -native",{value:r}),r}}))});var Vc={};re(Vc,{Client:()=>Bt,ClientBase:()=>oe.ClientBase,Connection:()=>oe.Connection, -DatabaseError:()=>oe.DatabaseError,NeonDbError:()=>he,Pool:()=>Cn,Query:()=>oe.Query, -defaults:()=>oe.defaults,neon:()=>An,neonConfig:()=>Se,types:()=>oe.types});module. -exports=O(Vc);p();var Lt=Ie(It());St();p();St();gr();var Xs=Ie(tt()),eo=Ie(wt());function jc(r){return r instanceof y?"\\x"+r.toString("hex"):r}a(jc,"encodeBuffe\ -rsAsBytea");var Pt=class Pt extends Error{constructor(t){super(t);_(this,"name", -"NeonDbError");_(this,"severity");_(this,"code");_(this,"detail");_(this,"hint"); -_(this,"position");_(this,"internalPosition");_(this,"internalQuery");_(this,"wh\ -ere");_(this,"schema");_(this,"table");_(this,"column");_(this,"dataType");_(this, -"constraint");_(this,"file");_(this,"line");_(this,"routine");_(this,"sourceErro\ +native",{value:r}),r}}))});var zc={};te(zc,{Client:()=>Pt,ClientBase:()=>Ne.ClientBase,NeonDbError:()=>ce,Pool:()=>Cn, +_bundleExt:()=>Kc,defaults:()=>Ne.defaults,neon:()=>_n,neonConfig:()=>Se,types:()=>Ne.types}); +module.exports=U(zc);d();var Ft=Te(It());St();d();St();gr();var Xs=Te(tt()),eo=Te(wt());function jc(r){return r instanceof y?"\\x"+r.toString("hex"):r}a(jc,"encodeBuffe\ +rsAsBytea");var Rt=class Rt extends Error{constructor(t){super(t);A(this,"name", +"NeonDbError");A(this,"severity");A(this,"code");A(this,"detail");A(this,"hint"); +A(this,"position");A(this,"internalPosition");A(this,"internalQuery");A(this,"wh\ +ere");A(this,"schema");A(this,"table");A(this,"column");A(this,"dataType");A(this, +"constraint");A(this,"file");A(this,"line");A(this,"routine");A(this,"sourceErro\ r");"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error. -captureStackTrace(this,Pt)}};a(Pt,"NeonDbError");var he=Pt,Zs="transaction() exp\ -ects an array of queries, or a function returning an array of queries",Wc=["seve\ +captureStackTrace(this,Rt)}};a(Rt,"NeonDbError");var ce=Rt,Zs="transaction() exp\ +ects an array of queries, or a function returning an array of queries",Hc=["seve\ rity","code","detail","hint","position","internalPosition","internalQuery","wher\ -e","schema","table","column","dataType","constraint","file","line","routine"];function An(r,{ +e","schema","table","column","dataType","constraint","file","line","routine"];function _n(r,{ arrayMode:e,fullResults:t,fetchOptions:n,isolationLevel:i,readOnly:s,deferrable:o, -queryCallback:u,resultCallback:c,authToken:h}={}){if(!r)throw new Error("No data\ +queryCallback:u,resultCallback:c,authToken:l}={}){if(!r)throw new Error("No data\ base connection string was provided to `neon()`. Perhaps an environment variable\ - has not been set?");let l;try{l=mr(r)}catch{throw new Error("Database connectio\ + has not been set?");let h;try{h=mr(r)}catch{throw new Error("Database connectio\ n string provided to `neon()` is not a valid URL. Connection string: "+String(r))} -let{protocol:d,username:b,hostname:C,port:B,pathname:Q}=l;if(d!=="postgres:"&&d!== -"postgresql:"||!b||!C||!Q)throw new Error("Database connection string format for\ - `neon()` should be: postgresql://user:password@host.tld/dbname?option=value");function X(A,...g){ -let P,K;if(typeof A=="string")P=A,K=g[1],g=g[0]??[];else{P="";for(let j=0;jjc((0,Xs.prepareValue)(j)));let k={ -query:P,params:g};return u&&u(k),Hc(ye,k,K)}a(X,"resolve"),X.transaction=async(A,g)=>{ -if(typeof A=="function"&&(A=A(X)),!Array.isArray(A))throw new Error(Zs);A.forEach( -k=>{if(k[Symbol.toStringTag]!=="NeonQueryPromise")throw new Error(Zs)});let P=A. -map(k=>k.parameterizedQuery),K=A.map(k=>k.opts??{});return ye(P,K,g)};async function ye(A,g,P){ -let{fetchEndpoint:K,fetchFunction:k}=Se,j=Array.isArray(A)?{queries:A}:A,ee=n??{}, -ae=e??!1,R=t??!1,$=i,le=s,me=o;P!==void 0&&(P.fetchOptions!==void 0&&(ee={...ee, -...P.fetchOptions}),P.arrayMode!==void 0&&(ae=P.arrayMode),P.fullResults!==void 0&& -(R=P.fullResults),P.isolationLevel!==void 0&&($=P.isolationLevel),P.readOnly!==void 0&& -(le=P.readOnly),P.deferrable!==void 0&&(me=P.deferrable)),g!==void 0&&!Array.isArray( -g)&&g.fetchOptions!==void 0&&(ee={...ee,...g.fetchOptions});let Ee=h;!Array.isArray( -g)&&g?.authToken!==void 0&&(Ee=g.authToken);let je=typeof K=="function"?K(C,B,{jwtAuth:Ee!== -void 0}):K,fe={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"true","Neon-Ar\ -ray-Mode":"true"},it=await Gc(Ee);it&&(fe.Authorization=`Bearer ${it}`),Array.isArray( -A)&&($!==void 0&&(fe["Neon-Batch-Isolation-Level"]=$),le!==void 0&&(fe["Neon-Bat\ -ch-Read-Only"]=String(le)),me!==void 0&&(fe["Neon-Batch-Deferrable"]=String(me))); -let te;try{te=await(k??fetch)(je,{method:"POST",body:JSON.stringify(j),headers:fe, -...ee})}catch(W){let H=new he(`Error connecting to database: ${W.message}`);throw H. -sourceError=W,H}if(te.ok){let W=await te.json();if(Array.isArray(A)){let H=W.results; -if(!Array.isArray(H))throw new he("Neon internal error: unexpected result format"); -return H.map((Ce,ve)=>{let Rt=g[ve]??{},ro=Rt.arrayMode??ae,no=Rt.fullResults??R; -return Js(Ce,{arrayMode:ro,fullResults:no,parameterizedQuery:A[ve],resultCallback:c, -types:Rt.types})})}else{let H=g??{},Ce=H.arrayMode??ae,ve=H.fullResults??R;return Js( -W,{arrayMode:Ce,fullResults:ve,parameterizedQuery:A,resultCallback:c,types:H.types})}}else{ -let{status:W}=te;if(W===400){let H=await te.json(),Ce=new he(H.message);for(let ve of Wc) -Ce[ve]=H[ve]??void 0;throw Ce}else{let H=await te.text();throw new he(`Server er\ -ror (HTTP status ${W}): ${H}`)}}}return a(ye,"execute"),X}a(An,"neon");function Hc(r,e,t){ -return{[Symbol.toStringTag]:"NeonQueryPromise",parameterizedQuery:e,opts:t,then:a( -(n,i)=>r(e,t).then(n,i),"then"),catch:a(n=>r(e,t).catch(n),"catch"),finally:a(n=>r( -e,t).finally(n),"finally")}}a(Hc,"createNeonQueryPromise");function Js(r,{arrayMode:e, -fullResults:t,parameterizedQuery:n,resultCallback:i,types:s}){let o=new eo.default( -s),u=r.fields.map(l=>l.name),c=r.fields.map(l=>o.getTypeParser(l.dataTypeID)),h=e=== -!0?r.rows.map(l=>l.map((d,b)=>d===null?null:c[b](d))):r.rows.map(l=>Object.fromEntries( -l.map((d,b)=>[u[b],d===null?null:c[b](d)])));return i&&i(n,r,h,{arrayMode:e,fullResults:t}), -t?(r.viaNeonFetch=!0,r.rowAsArray=e,r.rows=h,r._parsers=c,r._types=o,r):h}a(Js,"\ -processQueryResult");async function Gc(r){if(typeof r=="string")return r;if(typeof r== -"function")try{return await Promise.resolve(r())}catch(e){let t=new he("Error ge\ -tting auth token.");throw e instanceof Error&&(t=new he(`Error getting auth toke\ -n: ${e.message}`)),t}}a(Gc,"getAuthToken");var to=Ie(bt()),oe=Ie(It());var Tn=class Tn extends Lt.Client{constructor(t){super(t);this.config=t}get neonConfig(){ +let{protocol:p,username:S,hostname:_,port:P,pathname:G}=h;if(p!=="postgres:"&&p!== +"postgresql:"||!S||!_||!G)throw new Error("Database connection string format for\ + `neon()` should be: postgresql://user:password@host.tld/dbname?option=value");function X(C,...g){ +let R,W;if(typeof C=="string")R=C,W=g[1],g=g[0]??[];else{R="";for(let j=0;jjc((0,Xs.prepareValue)(j)));let Q={ +query:R,params:g};return u&&u(Q),Gc(se,Q,W)}a(X,"resolve"),X.transaction=async(C,g)=>{ +if(typeof C=="function"&&(C=C(X)),!Array.isArray(C))throw new Error(Zs);C.forEach( +Q=>{if(Q[Symbol.toStringTag]!=="NeonQueryPromise")throw new Error(Zs)});let R=C. +map(Q=>Q.parameterizedQuery),W=C.map(Q=>Q.opts??{});return se(R,W,g)};async function se(C,g,R){ +let{fetchEndpoint:W,fetchFunction:Q}=Se,j=Array.isArray(C)?{queries:C}:C,ee=n??{}, +oe=e??!1,L=t??!1,$=i,le=s,pe=o;R!==void 0&&(R.fetchOptions!==void 0&&(ee={...ee, +...R.fetchOptions}),R.arrayMode!==void 0&&(oe=R.arrayMode),R.fullResults!==void 0&& +(L=R.fullResults),R.isolationLevel!==void 0&&($=R.isolationLevel),R.readOnly!==void 0&& +(le=R.readOnly),R.deferrable!==void 0&&(pe=R.deferrable)),g!==void 0&&!Array.isArray( +g)&&g.fetchOptions!==void 0&&(ee={...ee,...g.fetchOptions});let ve=l;!Array.isArray( +g)&&g?.authToken!==void 0&&(ve=g.authToken);let We=typeof W=="function"?W(_,P,{jwtAuth:ve!== +void 0}):W,he={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"true","Neon-Ar\ +ray-Mode":"true"},it=await $c(ve);it&&(he.Authorization=`Bearer ${it}`),Array.isArray( +C)&&($!==void 0&&(he["Neon-Batch-Isolation-Level"]=$),le!==void 0&&(he["Neon-Bat\ +ch-Read-Only"]=String(le)),pe!==void 0&&(he["Neon-Batch-Deferrable"]=String(pe))); +let ye;try{ye=await(Q??fetch)(We,{method:"POST",body:JSON.stringify(j),headers:he, +...ee})}catch(K){let O=new ce(`Error connecting to database: ${K}`);throw O.sourceError= +K,O}if(ye.ok){let K=await ye.json();if(Array.isArray(C)){let O=K.results;if(!Array. +isArray(O))throw new ce("Neon internal error: unexpected result format");return O. +map((me,Ee)=>{let Lt=g[Ee]??{},ro=Lt.arrayMode??oe,no=Lt.fullResults??L;return Js( +me,{arrayMode:ro,fullResults:no,parameterizedQuery:C[Ee],resultCallback:c,types:Lt. +types})})}else{let O=g??{},me=O.arrayMode??oe,Ee=O.fullResults??L;return Js(K,{arrayMode:me, +fullResults:Ee,parameterizedQuery:C,resultCallback:c,types:O.types})}}else{let{status:K}=ye; +if(K===400){let O=await ye.json(),me=new ce(O.message);for(let Ee of Hc)me[Ee]=O[Ee]?? +void 0;throw me}else{let O=await ye.text();throw new ce(`Server error (HTTP stat\ +us ${K}): ${O}`)}}}return a(se,"execute"),X}a(_n,"neon");function Gc(r,e,t){return{ +[Symbol.toStringTag]:"NeonQueryPromise",parameterizedQuery:e,opts:t,then:a((n,i)=>r( +e,t).then(n,i),"then"),catch:a(n=>r(e,t).catch(n),"catch"),finally:a(n=>r(e,t).finally( +n),"finally")}}a(Gc,"createNeonQueryPromise");function Js(r,{arrayMode:e,fullResults:t, +parameterizedQuery:n,resultCallback:i,types:s}){let o=new eo.default(s),u=r.fields. +map(h=>h.name),c=r.fields.map(h=>o.getTypeParser(h.dataTypeID)),l=e===!0?r.rows. +map(h=>h.map((p,S)=>p===null?null:c[S](p))):r.rows.map(h=>Object.fromEntries(h.map( +(p,S)=>[u[S],p===null?null:c[S](p)])));return i&&i(n,r,l,{arrayMode:e,fullResults:t}), +t?(r.viaNeonFetch=!0,r.rowAsArray=e,r.rows=l,r._parsers=c,r._types=o,r):l}a(Js,"\ +processQueryResult");async function $c(r){if(typeof r=="string")return r;if(typeof r== +"function")try{return await Promise.resolve(r())}catch(e){let t=new ce("Error ge\ +tting auth token.");throw e instanceof Error&&(t=new ce(`Error getting auth toke\ +n: ${e.message}`)),t}}a($c,"getAuthToken");var to=Te(bt()),Ne=Te(It());var Tn=class Tn extends Ft.Client{constructor(t){super(t);this.config=t}get neonConfig(){ return this.connection.stream}connect(t){let{neonConfig:n}=this;n.forceDisablePgSSL&& (this.ssl=this.connection.ssl=!1),this.ssl&&n.useSecureWebSocket&&console.warn("\ SSL is enabled for both Postgres (e.g. ?sslmode=require in the connection string\ @@ -1584,51 +1584,52 @@ ase host or connection string was set, and key parameters have default values (h ost: localhost, user: ${s}, db: ${s}, password: null). Is an environment variabl\ e missing? Alternatively, if you intended to connect with these parameters, plea\ se set the host to 'localhost' explicitly.`);let o=super.connect(t),u=n.pipelineTLS&& -this.ssl,c=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let h=this. -connection;if(u&&h.on("connect",()=>h.stream.emit("data","S")),c){h.removeAllListeners( -"authenticationCleartextPassword"),h.removeAllListeners("readyForQuery"),h.once( -"readyForQuery",()=>h.on("readyForQuery",this._handleReadyForQuery.bind(this))); -let l=this.ssl?"sslconnect":"connect";h.on(l,()=>{this._handleAuthCleartextPassword(), -this._handleReadyForQuery()})}return o}async _handleAuthSASLContinue(t){let n=this. -saslSession,i=this.password,s=t.data;if(n.message!=="SASLInitialResponse"||typeof i!= -"string"||typeof s!="string")throw new Error("SASL: protocol error");let o=Object. -fromEntries(s.split(",").map(te=>{if(!/^.=/.test(te))throw new Error("SASL: Inva\ -lid attribute pair entry");let W=te[0],H=te.substring(2);return[W,H]})),u=o.r,c=o. -s,h=o.i;if(!u||!/^[!-+--~]+$/.test(u))throw new Error("SASL: SCRAM-SERVER-FIRST-\ -MESSAGE: nonce missing/unprintable");if(!c||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base\ +this.ssl,c=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let l=this. +connection;if(u&&l.on("connect",()=>l.stream.emit("data","S")),c){l.removeAllListeners( +"authenticationCleartextPassword"),l.removeAllListeners("readyForQuery"),l.once( +"readyForQuery",()=>l.on("readyForQuery",this._handleReadyForQuery.bind(this))); +let h=this.ssl?"sslconnect":"connect";l.on(h,()=>{this._handleAuthCleartextPassword(), +this._handleReadyForQuery()})}return o}async _handleAuthSASLContinue(t){if(typeof w> +"u"||w.subtle===void 0||w.subtle.importKey===void 0)throw new Error("Cannot use \ +SASL auth when `crypto.subtle` is not defined");let n=w.subtle,i=this.saslSession, +s=this.password,o=t.data;if(i.message!=="SASLInitialResponse"||typeof s!="string"|| +typeof o!="string")throw new Error("SASL: protocol error");let u=Object.fromEntries( +o.split(",").map(K=>{if(!/^.=/.test(K))throw new Error("SASL: Invalid attribute \ +pair entry");let O=K[0],me=K.substring(2);return[O,me]})),c=u.r,l=u.s,h=u.i;if(!c|| +!/^[!-+--~]+$/.test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce \ +missing/unprintable");if(!l||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(l))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base\ 64");if(!h||!/^[1-9][0-9]*$/.test(h))throw new Error("SASL: SCRAM-SERVER-FIRST-M\ -ESSAGE: missing/invalid iteration count");if(!u.startsWith(n.clientNonce))throw new Error( +ESSAGE: missing/invalid iteration count");if(!c.startsWith(i.clientNonce))throw new Error( "SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce"); -if(u.length===n.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MES\ -SAGE: server nonce is too short");let l=parseInt(h,10),d=y.from(c,"base64"),b=new TextEncoder, -C=b.encode(i),B=await w.subtle.importKey("raw",C,{name:"HMAC",hash:{name:"SHA-25\ -6"}},!1,["sign"]),Q=new Uint8Array(await w.subtle.sign("HMAC",B,y.concat([d,y.from( -[0,0,0,1])]))),X=Q;for(var ye=0;yeX[W]^Q[W]));let A=X,g=await w.subtle.importKey( -"raw",A,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),P=new Uint8Array(await w. -subtle.sign("HMAC",g,b.encode("Client Key"))),K=await w.subtle.digest("SHA-256", -P),k="n=*,r="+n.clientNonce,j="r="+u+",s="+c+",i="+l,ee="c=biws,r="+u,ae=k+","+j+ -","+ee,R=await w.subtle.importKey("raw",K,{name:"HMAC",hash:{name:"SHA-256"}},!1, -["sign"]);var $=new Uint8Array(await w.subtle.sign("HMAC",R,b.encode(ae))),le=y. -from(P.map((te,W)=>P[W]^$[W])),me=le.toString("base64");let Ee=await w.subtle.importKey( -"raw",A,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),je=await w.subtle.sign( -"HMAC",Ee,b.encode("Server Key")),fe=await w.subtle.importKey("raw",je,{name:"HM\ -AC",hash:{name:"SHA-256"}},!1,["sign"]);var it=y.from(await w.subtle.sign("HMAC", -fe,b.encode(ae)));n.message="SASLResponse",n.serverSignature=it.toString("base64"), -n.response=ee+",p="+me,this.connection.sendSCRAMClientFinalMessage(this.saslSession. -response)}};a(Tn,"NeonClient");var Bt=Tn;function $c(r,e){if(e)return{callback:e, +if(c.length===i.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MES\ +SAGE: server nonce is too short");let p=parseInt(h,10),S=y.from(l,"base64"),_=new TextEncoder, +P=_.encode(s),G=await n.importKey("raw",P,{name:"HMAC",hash:{name:"SHA-256"}},!1, +["sign"]),X=new Uint8Array(await n.sign("HMAC",G,y.concat([S,y.from([0,0,0,1])]))), +se=X;for(var C=0;Cse[O]^X[O]));let g=se,R=await n.importKey("raw",g,{name:"HMAC",hash:{ +name:"SHA-256"}},!1,["sign"]),W=new Uint8Array(await n.sign("HMAC",R,_.encode("C\ +lient Key"))),Q=await n.digest("SHA-256",W),j="n=*,r="+i.clientNonce,ee="r="+c+"\ +,s="+l+",i="+p,oe="c=biws,r="+c,L=j+","+ee+","+oe,$=await n.importKey("raw",Q,{name:"\ +HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var le=new Uint8Array(await n.sign("HM\ +AC",$,_.encode(L))),pe=y.from(W.map((K,O)=>W[O]^le[O])),ve=pe.toString("base64"); +let We=await n.importKey("raw",g,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]), +he=await n.sign("HMAC",We,_.encode("Server Key")),it=await n.importKey("raw",he, +{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var ye=y.from(await n.sign("HMA\ +C",it,_.encode(L)));i.message="SASLResponse",i.serverSignature=ye.toString("base\ +64"),i.response=oe+",p="+ve,this.connection.sendSCRAMClientFinalMessage(this.saslSession. +response)}};a(Tn,"NeonClient");var Pt=Tn;function Vc(r,e){if(e)return{callback:e, result:void 0};let t,n,i=a(function(o,u){o?t(o):n(u)},"cb"),s=new r(function(o,u){ -n=o,t=u});return{callback:i,result:s}}a($c,"promisify");var In=class In extends Lt.Pool{constructor(){ -super(...arguments);_(this,"Client",Bt);_(this,"hasFetchUnsupportedListeners",!1)}on(t,n){ -return t!=="error"&&(this.hasFetchUnsupportedListeners=!0),super.on(t,n)}query(t,n,i){ -if(!Se.poolQueryViaFetch||this.hasFetchUnsupportedListeners||typeof t=="function") -return super.query(t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=$c(this.Promise, -i);i=s.callback;try{let o=new to.default(this.options),u=encodeURIComponent,c=encodeURI, -h=`postgresql://${u(o.user)}:${u(o.password)}@${u(o.host)}/${c(o.database)}`,l=typeof t== -"string"?t:t.text,d=n??t.values??[];An(h,{fullResults:!0,arrayMode:t.rowMode==="\ -array"})(l,d,{types:t.types??this.options?.types}).then(C=>i(void 0,C)).catch(C=>i( -C))}catch(o){i(o)}return s.result}};a(In,"NeonPool");var Cn=In; +n=o,t=u});return{callback:i,result:s}}a(Vc,"promisify");var In=class In extends Ft.Pool{constructor(){ +super(...arguments);A(this,"Client",Pt);A(this,"hasFetchUnsupportedListeners",!1); +A(this,"addListener",this.on)}on(t,n){return t!=="error"&&(this.hasFetchUnsupportedListeners= +!0),super.on(t,n)}query(t,n,i){if(!Se.poolQueryViaFetch||this.hasFetchUnsupportedListeners|| +typeof t=="function")return super.query(t,n,i);typeof n=="function"&&(i=n,n=void 0); +let s=Vc(this.Promise,i);i=s.callback;try{let o=new to.default(this.options),u=encodeURIComponent, +c=encodeURI,l=`postgresql://${u(o.user)}:${u(o.password)}@${u(o.host)}/${c(o.database)}`, +h=typeof t=="string"?t:t.text,p=n??t.values??[];_n(l,{fullResults:!0,arrayMode:t. +rowMode==="array"})(h,p,{types:t.types??this.options?.types}).then(_=>i(void 0,_)). +catch(_=>i(_))}catch(o){i(o)}return s.result}};a(In,"NeonPool");var Cn=In;var Kc="js"; /*! Bundled license information: ieee754/index.js: diff --git a/dist/npm/index.mjs b/dist/npm/index.mjs index 5fbd961..6b60277 100644 --- a/dist/npm/index.mjs +++ b/dist/npm/index.mjs @@ -1,55 +1,58 @@ -var io=Object.create;var Ce=Object.defineProperty;var so=Object.getOwnPropertyDescriptor;var oo=Object.getOwnPropertyNames;var ao=Object.getPrototypeOf,uo=Object.prototype.hasOwnProperty;var co=(r,e,t)=>e in r?Ce(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}): -r[e]=t;var a=(r,e)=>Ce(r,"name",{value:e,configurable:!0});var z=(r,e)=>()=>(r&&(e=r(r=0)),e);var I=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),se=(r,e)=>{for(var t in e) -Ce(r,t,{get:e[t],enumerable:!0})},Tn=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e== -"function")for(let i of oo(e))!uo.call(r,i)&&i!==t&&Ce(r,i,{get:()=>e[i],enumerable:!(n= -so(e,i))||n.enumerable});return r};var Te=(r,e,t)=>(t=r!=null?io(ao(r)):{},Tn(e||!r||!r.__esModule?Ce(t,"default",{ -value:r,enumerable:!0}):t,r)),O=r=>Tn(Ce({},"__esModule",{value:!0}),r);var _=(r,e,t)=>co(r,typeof e!="symbol"?e+"":e,t);var Bn=I(st=>{"use strict";p();st.byteLength=lo;st.toByteArray=po;st.fromByteArray= -go;var ae=[],re=[],ho=typeof Uint8Array<"u"?Uint8Array:Array,Rt="ABCDEFGHIJKLMNO\ -PQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ee=0,In=Rt.length;Eee in r?Ce(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}): +r[e]=t;var a=(r,e)=>Ce(r,"name",{value:e,configurable:!0}),Tn=(r=>typeof require<"u"?require: +typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)( +function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error( +'Dynamic require of "'+r+'" is not supported')});var z=(r,e)=>()=>(r&&(e=r(r=0)),e);var I=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ie=(r,e)=>{for(var t in e) +Ce(r,t,{get:e[t],enumerable:!0})},In=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e== +"function")for(let i of ao(e))!co.call(r,i)&&i!==t&&Ce(r,i,{get:()=>e[i],enumerable:!(n= +oo(e,i))||n.enumerable});return r};var Te=(r,e,t)=>(t=r!=null?so(uo(r)):{},In(e||!r||!r.__esModule?Ce(t,"default",{ +value:r,enumerable:!0}):t,r)),U=r=>In(Ce({},"__esModule",{value:!0}),r);var A=(r,e,t)=>lo(r,typeof e!="symbol"?e+"":e,t);var Fn=I(it=>{"use strict";d();it.byteLength=fo;it.toByteArray=yo;it.fromByteArray= +wo;var ae=[],te=[],ho=typeof Uint8Array<"u"?Uint8Array:Array,Ft="ABCDEFGHIJKLMNO\ +PQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ee=0,Rn=Ft.length;Ee0)throw new Error("Invalid string. Length must be a multip\ le of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}a(Pn, -"getLens");function lo(r){var e=Pn(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(lo,"byte\ -Length");function fo(r,e,t){return(e+t)*3/4-t}a(fo,"_byteLength");function po(r){ -var e,t=Pn(r),n=t[0],i=t[1],s=new ho(fo(r,n,i)),o=0,u=i>0?n-4:n,c;for(c=0;c0?n-4:n,c;for(c=0;c>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e= -re[r.charCodeAt(c)]<<2|re[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=re[r.charCodeAt( -c)]<<10|re[r.charCodeAt(c+1)]<<4|re[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]= -e&255),s}a(po,"toByteArray");function yo(r){return ae[r>>18&63]+ae[r>>12&63]+ae[r>> -6&63]+ae[r&63]}a(yo,"tripletToBase64");function mo(r,e,t){for(var n,i=[],s=e;su?u:o+s));return n===1?(e=r[t-1],i.push(ae[e>>2]+ +te[r.charCodeAt(c)]<<2|te[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=te[r.charCodeAt( +c)]<<10|te[r.charCodeAt(c+1)]<<4|te[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]= +e&255),s}a(yo,"toByteArray");function mo(r){return ae[r>>18&63]+ae[r>>12&63]+ae[r>> +6&63]+ae[r&63]}a(mo,"tripletToBase64");function go(r,e,t){for(var n,i=[],s=e;su?u:o+s));return n===1?(e=r[t-1],i.push(ae[e>>2]+ ae[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(ae[e>>10]+ae[e>>4&63]+ae[e<< -2&63]+"=")),i.join("")}a(go,"fromByteArray")});var Ln=I(Ft=>{p();Ft.read=function(r,e,t,n,i){var s,o,u=i*8-n-1,c=(1<> -1,l=-7,d=t?i-1:0,b=t?-1:1,C=r[e+d];for(d+=b,s=C&(1<<-l)-1,C>>=-l,l+=u;l>0;s=s*256+ -r[e+d],d+=b,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=o*256+r[e+d],d+=b,l-=8);if(s=== -0)s=1-h;else{if(s===c)return o?NaN:(C?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-h}return(C? --1:1)*o*Math.pow(2,s-n)};Ft.write=function(r,e,t,n,i,s){var o,u,c,h=s*8-i-1,l=(1<< -h)-1,d=l>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=n?0:s-1,B=n?1:-1,Q=e<0|| -e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=l):(o=Math. -floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+d>=1?e+=b/c:e+= -b*Math.pow(2,1-d),e*c>=2&&(o++,c/=2),o+d>=l?(u=0,o=l):o+d>=1?(u=(e*c-1)*Math.pow( -2,i),o=o+d):(u=e*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;r[t+C]=u&255,C+=B,u/=256, -i-=8);for(o=o<0;r[t+C]=o&255,C+=B,o/=256,h-=8);r[t+C-B]|=Q*128}});var Kn=I(Le=>{"use strict";p();var Mt=Bn(),Pe=Ln(),Rn=typeof Symbol=="function"&& -typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Le.Buffer= -f;Le.SlowBuffer=vo;Le.INSPECT_MAX_BYTES=50;var ot=2147483647;Le.kMaxLength=ot;f. -TYPED_ARRAY_SUPPORT=wo();!f.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console. +2&63]+"=")),i.join("")}a(wo,"fromByteArray")});var Ln=I(Lt=>{d();Lt.read=function(r,e,t,n,i){var s,o,u=i*8-n-1,c=(1<> +1,h=-7,p=t?i-1:0,S=t?-1:1,_=r[e+p];for(p+=S,s=_&(1<<-h)-1,_>>=-h,h+=u;h>0;s=s*256+ +r[e+p],p+=S,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=n;h>0;o=o*256+r[e+p],p+=S,h-=8);if(s=== +0)s=1-l;else{if(s===c)return o?NaN:(_?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(_? +-1:1)*o*Math.pow(2,s-n)};Lt.write=function(r,e,t,n,i,s){var o,u,c,l=s*8-i-1,h=(1<< +l)-1,p=h>>1,S=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:s-1,P=n?1:-1,G=e<0|| +e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=h):(o=Math. +floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+p>=1?e+=S/c:e+= +S*Math.pow(2,1-p),e*c>=2&&(o++,c/=2),o+p>=h?(u=0,o=h):o+p>=1?(u=(e*c-1)*Math.pow( +2,i),o=o+p):(u=e*Math.pow(2,p-1)*Math.pow(2,i),o=0));i>=8;r[t+_]=u&255,_+=P,u/=256, +i-=8);for(o=o<0;r[t+_]=o&255,_+=P,o/=256,l-=8);r[t+_-P]|=G*128}});var zn=I(Fe=>{"use strict";d();var Bt=Fn(),Re=Ln(),Bn=typeof Symbol=="function"&& +typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Fe.Buffer= +f;Fe.SlowBuffer=Ao;Fe.INSPECT_MAX_BYTES=50;var st=2147483647;Fe.kMaxLength=st;f. +TYPED_ARRAY_SUPPORT=bo();!f.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console. error=="function"&&console.error("This browser lacks typed array (Uint8Array) su\ pport which is required by `buffer` v5.x. Use `buffer` v4.x if you require old b\ -rowser support.");function wo(){try{let r=new Uint8Array(1),e={foo:a(function(){ +rowser support.");function bo(){try{let r=new Uint8Array(1),e={foo:a(function(){ return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf( -r,e),r.foo()===42}catch{return!1}}a(wo,"typedArraySupport");Object.defineProperty( +r,e),r.foo()===42}catch{return!1}}a(bo,"typedArraySupport");Object.defineProperty( f.prototype,"parent",{enumerable:!0,get:a(function(){if(f.isBuffer(this))return this. buffer},"get")});Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:a( -function(){if(f.isBuffer(this))return this.byteOffset},"get")});function le(r){if(r> -ot)throw new RangeError('The value "'+r+'" is invalid for option "size"');let e=new Uint8Array( -r);return Object.setPrototypeOf(e,f.prototype),e}a(le,"createBuffer");function f(r,e,t){ +function(){if(f.isBuffer(this))return this.byteOffset},"get")});function he(r){if(r> +st)throw new RangeError('The value "'+r+'" is invalid for option "size"');let e=new Uint8Array( +r);return Object.setPrototypeOf(e,f.prototype),e}a(he,"createBuffer");function f(r,e,t){ if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" a\ -rgument must be of type string. Received type number');return Ot(r)}return kn(r, -e,t)}a(f,"Buffer");f.poolSize=8192;function kn(r,e,t){if(typeof r=="string")return So( -r,e);if(ArrayBuffer.isView(r))return xo(r);if(r==null)throw new TypeError("The f\ +rgument must be of type string. Received type number');return Qt(r)}return Qn(r, +e,t)}a(f,"Buffer");f.poolSize=8192;function Qn(r,e,t){if(typeof r=="string")return xo( +r,e);if(ArrayBuffer.isView(r))return vo(r);if(r==null)throw new TypeError("The f\ irst argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-l\ ike Object. Received type "+typeof r);if(ue(r,ArrayBuffer)||r&&ue(r.buffer,ArrayBuffer)|| typeof SharedArrayBuffer<"u"&&(ue(r,SharedArrayBuffer)||r&&ue(r.buffer,SharedArrayBuffer))) @@ -59,31 +62,31 @@ if(n!=null&&n!==r)return f.from(n,e,t);let i=Eo(r);if(i)return i;if(typeof Symbo "u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return f. from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argumen\ t must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. \ -Received type "+typeof r)}a(kn,"from");f.from=function(r,e,t){return kn(r,e,t)}; +Received type "+typeof r)}a(Qn,"from");f.from=function(r,e,t){return Qn(r,e,t)}; Object.setPrototypeOf(f.prototype,Uint8Array.prototype);Object.setPrototypeOf(f, -Uint8Array);function Un(r){if(typeof r!="number")throw new TypeError('"size" arg\ +Uint8Array);function Dn(r){if(typeof r!="number")throw new TypeError('"size" arg\ ument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is\ - invalid for option "size"')}a(Un,"assertSize");function bo(r,e,t){return Un(r), -r<=0?le(r):e!==void 0?typeof t=="string"?le(r).fill(e,t):le(r).fill(e):le(r)}a(bo, -"alloc");f.alloc=function(r,e,t){return bo(r,e,t)};function Ot(r){return Un(r),le( -r<0?0:Nt(r)|0)}a(Ot,"allocUnsafe");f.allocUnsafe=function(r){return Ot(r)};f.allocUnsafeSlow= -function(r){return Ot(r)};function So(r,e){if((typeof e!="string"||e==="")&&(e="\ -utf8"),!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=On(r,e)| -0,n=le(t),i=n.write(r,e);return i!==t&&(n=n.slice(0,i)),n}a(So,"fromString");function Dt(r){ -let e=r.length<0?0:Nt(r.length)|0,t=le(e);for(let n=0;n= -ot)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ -ot.toString(16)+" bytes");return r|0}a(Nt,"checked");function vo(r){return+r!=r&& -(r=0),f.alloc(+r)}a(vo,"SlowBuffer");f.isBuffer=a(function(e){return e!=null&&e. +n,f.prototype),n}a(kt,"fromArrayBuffer");function Eo(r){if(f.isBuffer(r)){let e=Dt( +r.length)|0,t=he(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0) +return typeof r.length!="number"||qt(r.length)?he(0):Mt(r);if(r.type==="Buffer"&& +Array.isArray(r.data))return Mt(r.data)}a(Eo,"fromObject");function Dt(r){if(r>= +st)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ +st.toString(16)+" bytes");return r|0}a(Dt,"checked");function Ao(r){return+r!=r&& +(r=0),f.alloc(+r)}a(Ao,"SlowBuffer");f.isBuffer=a(function(e){return e!=null&&e. _isBuffer===!0&&e!==f.prototype},"isBuffer");f.compare=a(function(e,t){if(ue(e,Uint8Array)&& (e=f.from(e,e.offset,e.byteLength)),ue(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)), !f.isBuffer(e)||!f.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments\ @@ -98,150 +101,150 @@ if(t===void 0)for(t=0,n=0;ni.length?(f.isBuffer( o)||(o=f.from(o)),o.copy(i,s)):Uint8Array.prototype.set.call(i,o,s);else if(f.isBuffer( o))o.copy(i,s);else throw new TypeError('"list" argument must be an Array of Buf\ -fers');s+=o.length}return i},"concat");function On(r,e){if(f.isBuffer(r))return r. +fers');s+=o.length}return i},"concat");function Un(r,e){if(f.isBuffer(r))return r. length;if(ArrayBuffer.isView(r)||ue(r,ArrayBuffer))return r.byteLength;if(typeof r!= "string")throw new TypeError('The "string" argument must be one of type string, \ Buffer, or ArrayBuffer. Received type '+typeof r);let t=r.length,n=arguments.length> 2&&arguments[2]===!0;if(!n&&t===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"\ -latin1":case"binary":return t;case"utf8":case"utf-8":return Ut(r).length;case"uc\ +latin1":case"binary":return t;case"utf8":case"utf-8":return Ot(r).length;case"uc\ s2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"\ -base64":return Vn(r).length;default:if(i)return n?-1:Ut(r).length;e=(""+e).toLowerCase(), -i=!0}}a(On,"byteLength");f.byteLength=On;function _o(r,e,t){let n=!1;if((e===void 0|| +base64":return Kn(r).length;default:if(i)return n?-1:Ot(r).length;e=(""+e).toLowerCase(), +i=!0}}a(Un,"byteLength");f.byteLength=Un;function _o(r,e,t){let n=!1;if((e===void 0|| e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)|| -(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Mo( -this,e,t);case"utf8":case"utf-8":return qn(this,e,t);case"ascii":return Ro(this, -e,t);case"latin1":case"binary":return Fo(this,e,t);case"base64":return Bo(this,e, -t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Do(this,e,t);default: +(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return ko( +this,e,t);case"utf8":case"utf-8":return Nn(this,e,t);case"ascii":return Bo(this, +e,t);case"latin1":case"binary":return Mo(this,e,t);case"base64":return Fo(this,e, +t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Oo(this,e,t);default: if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a( -_o,"slowToString");f.prototype._isBuffer=!0;function ve(r,e,t){let n=r[e];r[e]=r[t], -r[t]=n}a(ve,"swap");f.prototype.swap16=a(function(){let e=this.length;if(e%2!==0) +_o,"slowToString");f.prototype._isBuffer=!0;function Ae(r,e,t){let n=r[e];r[e]=r[t], +r[t]=n}a(Ae,"swap");f.prototype.swap16=a(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;t< -e;t+=2)ve(this,t,t+1);return this},"swap16");f.prototype.swap32=a(function(){let e=this. +e;t+=2)Ae(this,t,t+1);return this},"swap16");f.prototype.swap32=a(function(){let e=this. length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bit\ -s");for(let t=0;tt&&(e+=" ... "),""},"inspect");Rn&&(f.prototype[Rn]=f.prototype.inspect);f.prototype.compare= +e+">"},"inspect");Bn&&(f.prototype[Bn]=f.prototype.inspect);f.prototype.compare= a(function(e,t,n,i,s){if(ue(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f. isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffe\ r or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e? e.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),t<0||n>e.length||i<0|| s>this.length)throw new RangeError("out of range index");if(i>=s&&t>=n)return 0; if(i>=s)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,s>>>=0,this===e)return 0; -let o=s-i,u=n-t,c=Math.min(o,u),h=this.slice(i,s),l=e.slice(t,n);for(let d=0;d2147483647?t=2147483647: -t<-2147483648&&(t=-2147483648),t=+t,Qt(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t), +t<-2147483648&&(t=-2147483648),t=+t,qt(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t), t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e== -"string"&&(e=f.from(e,n)),f.isBuffer(e))return e.length===0?-1:Fn(r,e,t,n,i);if(typeof e== +"string"&&(e=f.from(e,n)),f.isBuffer(e))return e.length===0?-1:Mn(r,e,t,n,i);if(typeof e== "number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array. -prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Fn(r, -[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Nn,"bid\ -irectionalIndexOf");function Fn(r,e,t,n,i){let s=1,o=r.length,u=e.length;if(n!== +prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Mn(r, +[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(qn,"bid\ +irectionalIndexOf");function Mn(r,e,t,n,i){let s=1,o=r.length,u=e.length;if(n!== void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="\ -utf-16le")){if(r.length<2||e.length<2)return-1;s=2,o/=2,u/=2,t/=2}function c(l,d){ -return s===1?l[d]:l.readUInt16BE(d*s)}a(c,"read");let h;if(i){let l=-1;for(h=t;h< -o;h++)if(c(r,h)===c(e,l===-1?0:h-l)){if(l===-1&&(l=h),h-l+1===u)return l*s}else l!== --1&&(h-=h-l),l=-1}else for(t+u>o&&(t=o-u),h=t;h>=0;h--){let l=!0;for(let d=0;do&&(t=o-u),l=t;l>=0;l--){let h=!0;for(let p=0;pi&&(n=i)):n=i;let s=e.length;n> -s/2&&(n=s/2);let o;for(o=0;o>>0,isFinite(n)? (n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.wri\ te(string, encoding, offset[, length]) is no longer supported");let s=this.length- t;if((n===void 0||n>s)&&(n=s),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError( "Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"\ -hex":return Ao(this,e,t,n);case"utf8":case"utf-8":return Co(this,e,t,n);case"asc\ -ii":case"latin1":case"binary":return To(this,e,t,n);case"base64":return Io(this, +hex":return Co(this,e,t,n);case"utf8":case"utf-8":return To(this,e,t,n);case"asc\ +ii":case"latin1":case"binary":return Io(this,e,t,n);case"base64":return Ro(this, e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Po(this,e,t,n);default: if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"\ write");f.prototype.toJSON=a(function(){return{type:"Buffer",data:Array.prototype. -slice.call(this._arr||this,0)}},"toJSON");function Bo(r,e,t){return e===0&&t===r. -length?Mt.fromByteArray(r):Mt.fromByteArray(r.slice(e,t))}a(Bo,"base64Slice");function qn(r,e,t){ +slice.call(this._arr||this,0)}},"toJSON");function Fo(r,e,t){return e===0&&t===r. +length?Bt.fromByteArray(r):Bt.fromByteArray(r.slice(e,t))}a(Fo,"base64Slice");function Nn(r,e,t){ t=Math.min(r.length,t);let n=[],i=e;for(;i239?4:s>223? -3:s>191?2:1;if(i+u<=t){let c,h,l,d;switch(u){case 1:s<128&&(o=s);break;case 2:c= -r[i+1],(c&192)===128&&(d=(s&31)<<6|c&63,d>127&&(o=d));break;case 3:c=r[i+1],h=r[i+ -2],(c&192)===128&&(h&192)===128&&(d=(s&15)<<12|(c&63)<<6|h&63,d>2047&&(d<55296|| -d>57343)&&(o=d));break;case 4:c=r[i+1],h=r[i+2],l=r[i+3],(c&192)===128&&(h&192)=== -128&&(l&192)===128&&(d=(s&15)<<18|(c&63)<<12|(h&63)<<6|l&63,d>65535&&d<1114112&& -(o=d))}}o===null?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320| -o&1023),n.push(o),i+=u}return Lo(n)}a(qn,"utf8Slice");var Mn=4096;function Lo(r){ -let e=r.length;if(e<=Mn)return String.fromCharCode.apply(String,r);let t="",n=0; -for(;n191?2:1;if(i+u<=t){let c,l,h,p;switch(u){case 1:s<128&&(o=s);break;case 2:c= +r[i+1],(c&192)===128&&(p=(s&31)<<6|c&63,p>127&&(o=p));break;case 3:c=r[i+1],l=r[i+ +2],(c&192)===128&&(l&192)===128&&(p=(s&15)<<12|(c&63)<<6|l&63,p>2047&&(p<55296|| +p>57343)&&(o=p));break;case 4:c=r[i+1],l=r[i+2],h=r[i+3],(c&192)===128&&(l&192)=== +128&&(h&192)===128&&(p=(s&15)<<18|(c&63)<<12|(l&63)<<6|h&63,p>65535&&p<1114112&& +(o=p))}}o===null?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320| +o&1023),n.push(o),i+=u}return Lo(n)}a(Nn,"utf8Slice");var kn=4096;function Lo(r){ +let e=r.length;if(e<=kn)return String.fromCharCode.apply(String,r);let t="",n=0; +for(;nn)&&(t=n);let i="";for(let s=e;sn)&&(t=n);let i="";for(let s=e;sn&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),tt)throw new RangeError( -"Trying to access beyond buffer length")}a(N,"checkOffset");f.prototype.readUintLE= -f.prototype.readUIntLE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||N(e,t,this.length);let i=this[e], +"Trying to access beyond buffer length")}a(q,"checkOffset");f.prototype.readUintLE= +f.prototype.readUIntLE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||q(e,t,this.length);let i=this[e], s=1,o=0;for(;++o>>0,t=t>>>0,n||N(e,t,this. +readUintBE=f.prototype.readUIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||q(e,t,this. length);let i=this[e+--t],s=1;for(;t>0&&(s*=256);)i+=this[e+--t]*s;return i},"re\ adUIntBE");f.prototype.readUint8=f.prototype.readUInt8=a(function(e,t){return e= -e>>>0,t||N(e,1,this.length),this[e]},"readUInt8");f.prototype.readUint16LE=f.prototype. -readUInt16LE=a(function(e,t){return e=e>>>0,t||N(e,2,this.length),this[e]|this[e+ +e>>>0,t||q(e,1,this.length),this[e]},"readUInt8");f.prototype.readUint16LE=f.prototype. +readUInt16LE=a(function(e,t){return e=e>>>0,t||q(e,2,this.length),this[e]|this[e+ 1]<<8},"readUInt16LE");f.prototype.readUint16BE=f.prototype.readUInt16BE=a(function(e,t){ -return e=e>>>0,t||N(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");f.prototype. -readUint32LE=f.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||N(e,4,this. +return e=e>>>0,t||q(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");f.prototype. +readUint32LE=f.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||q(e,4,this. length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE"); f.prototype.readUint32BE=f.prototype.readUInt32BE=a(function(e,t){return e=e>>>0, -t||N(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"\ -readUInt32BE");f.prototype.readBigUInt64LE=me(a(function(e){e=e>>>0,Be(e,"offset"); +t||q(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"\ +readUInt32BE");f.prototype.readBigUInt64LE=ge(a(function(e){e=e>>>0,Pe(e,"offset"); let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&We(e,this.length-8);let i=t+ this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]* 2**16+n*2**24;return BigInt(i)+(BigInt(s)<>>0,Be(e,"offset");let t=this[e],n=this[e+7]; +readBigUInt64BE=ge(a(function(e){e=e>>>0,Pe(e,"offset");let t=this[e],n=this[e+7]; (t===void 0||n===void 0)&&We(e,this.length-8);let i=t*2**24+this[++e]*2**16+this[++e]* 2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt( i)<>>0,t=t>>>0,n||N(e,t,this.length);let i=this[e],s=1,o=0;for(;++o>>0,t=t>>>0,n||q(e,t,this.length);let i=this[e],s=1,o=0;for(;++o=s&&(i-=Math.pow(2,8*t)),i},"readIntLE");f.prototype. -readIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||N(e,t,this.length);let i=t,s=1,o=this[e+ +readIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||q(e,t,this.length);let i=t,s=1,o=this[e+ --i];for(;i>0&&(s*=256);)o+=this[e+--i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*t)), -o},"readIntBE");f.prototype.readInt8=a(function(e,t){return e=e>>>0,t||N(e,1,this. +o},"readIntBE");f.prototype.readInt8=a(function(e,t){return e=e>>>0,t||q(e,1,this. length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");f.prototype.readInt16LE= -a(function(e,t){e=e>>>0,t||N(e,2,this.length);let n=this[e]|this[e+1]<<8;return n& +a(function(e,t){e=e>>>0,t||q(e,2,this.length);let n=this[e]|this[e+1]<<8;return n& 32768?n|4294901760:n},"readInt16LE");f.prototype.readInt16BE=a(function(e,t){e=e>>> -0,t||N(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n}, -"readInt16BE");f.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||N(e,4,this. +0,t||q(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n}, +"readInt16BE");f.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||q(e,4,this. length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");f.prototype. -readInt32BE=a(function(e,t){return e=e>>>0,t||N(e,4,this.length),this[e]<<24|this[e+ -1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");f.prototype.readBigInt64LE=me(a(function(e){ -e=e>>>0,Be(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&We(e, +readInt32BE=a(function(e,t){return e=e>>>0,t||q(e,4,this.length),this[e]<<24|this[e+ +1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");f.prototype.readBigInt64LE=ge(a(function(e){ +e=e>>>0,Pe(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&We(e, this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt( i)<>>0,Be(e,"offset"); +igInt64LE"));f.prototype.readBigInt64BE=ge(a(function(e){e=e>>>0,Pe(e,"offset"); let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&We(e,this.length-8);let i=(t<< 24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,t||N(e,4,this.length),Pe.read(this,e, +readFloatLE=a(function(e,t){return e=e>>>0,t||q(e,4,this.length),Re.read(this,e, !0,23,4)},"readFloatLE");f.prototype.readFloatBE=a(function(e,t){return e=e>>>0, -t||N(e,4,this.length),Pe.read(this,e,!1,23,4)},"readFloatBE");f.prototype.readDoubleLE= -a(function(e,t){return e=e>>>0,t||N(e,8,this.length),Pe.read(this,e,!0,52,8)},"r\ -eadDoubleLE");f.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||N(e,8,this. -length),Pe.read(this,e,!1,52,8)},"readDoubleBE");function Y(r,e,t,n,i,s){if(!f.isBuffer( +t||q(e,4,this.length),Re.read(this,e,!1,23,4)},"readFloatBE");f.prototype.readDoubleLE= +a(function(e,t){return e=e>>>0,t||q(e,8,this.length),Re.read(this,e,!0,52,8)},"r\ +eadDoubleLE");f.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||q(e,8,this. +length),Re.read(this,e,!1,52,8)},"readDoubleBE");function Y(r,e,t,n,i,s){if(!f.isBuffer( r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e< s)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError( "Index out of range")}a(Y,"checkInt");f.prototype.writeUintLE=f.prototype.writeUIntLE= @@ -260,15 +263,15 @@ f.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||Y(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},"writeUInt32LE");f.prototype.writeUint32BE=f.prototype.writeUInt32BE=a(function(e,t,n){ return e=+e,t=t>>>0,n||Y(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},"writeUInt32BE");function Qn(r,e,t,n,i){$n( +this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeUInt32BE");function Wn(r,e,t,n,i){Vn( e,n,i,r,t,7);let s=Number(e&BigInt(4294967295));r[t++]=s,s=s>>8,r[t++]=s,s=s>>8, r[t++]=s,s=s>>8,r[t++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]= -o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,t}a(Qn,"wrtBigUInt64LE");function jn(r,e,t,n,i){ -$n(e,n,i,r,t,7);let s=Number(e&BigInt(4294967295));r[t+7]=s,s=s>>8,r[t+6]=s,s=s>> +o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,t}a(Wn,"wrtBigUInt64LE");function jn(r,e,t,n,i){ +Vn(e,n,i,r,t,7);let s=Number(e&BigInt(4294967295));r[t+7]=s,s=s>>8,r[t+6]=s,s=s>> 8,r[t+5]=s,s=s>>8,r[t+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+ 3]=o,o=o>>8,r[t+2]=o,o=o>>8,r[t+1]=o,o=o>>8,r[t]=o,t+8}a(jn,"wrtBigUInt64BE");f. -prototype.writeBigUInt64LE=me(a(function(e,t=0){return Qn(this,e,t,BigInt(0),BigInt( -"0xffffffffffffffff"))},"writeBigUInt64LE"));f.prototype.writeBigUInt64BE=me(a(function(e,t=0){ +prototype.writeBigUInt64LE=ge(a(function(e,t=0){return Wn(this,e,t,BigInt(0),BigInt( +"0xffffffffffffffff"))},"writeBigUInt64LE"));f.prototype.writeBigUInt64BE=ge(a(function(e,t=0){ return jn(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE")); f.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2, 8*n-1);Y(this,e,t,n,c-1,-c)}let s=0,o=1,u=0;for(this[t]=e&255;++s e>>>16,this[t+3]=e>>>24,t+4},"writeInt32LE");f.prototype.writeInt32BE=a(function(e,t,n){ return e=+e,t=t>>>0,n||Y(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},"writeIn\ -t32BE");f.prototype.writeBigInt64LE=me(a(function(e,t=0){return Qn(this,e,t,-BigInt( +t32BE");f.prototype.writeBigInt64LE=ge(a(function(e,t=0){return Wn(this,e,t,-BigInt( "0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));f.prototype. -writeBigInt64BE=me(a(function(e,t=0){return jn(this,e,t,-BigInt("0x8000000000000\ -000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Wn(r,e,t,n,i,s){ +writeBigInt64BE=ge(a(function(e,t=0){return jn(this,e,t,-BigInt("0x8000000000000\ +000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Hn(r,e,t,n,i,s){ if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError( -"Index out of range")}a(Wn,"checkIEEE754");function Hn(r,e,t,n,i){return e=+e,t= -t>>>0,i||Wn(r,e,t,4,34028234663852886e22,-34028234663852886e22),Pe.write(r,e,t,n, -23,4),t+4}a(Hn,"writeFloat");f.prototype.writeFloatLE=a(function(e,t,n){return Hn( -this,e,t,!0,n)},"writeFloatLE");f.prototype.writeFloatBE=a(function(e,t,n){return Hn( -this,e,t,!1,n)},"writeFloatBE");function Gn(r,e,t,n,i){return e=+e,t=t>>>0,i||Wn( -r,e,t,8,17976931348623157e292,-17976931348623157e292),Pe.write(r,e,t,n,52,8),t+8} -a(Gn,"writeDouble");f.prototype.writeDoubleLE=a(function(e,t,n){return Gn(this,e, -t,!0,n)},"writeDoubleLE");f.prototype.writeDoubleBE=a(function(e,t,n){return Gn( +"Index out of range")}a(Hn,"checkIEEE754");function Gn(r,e,t,n,i){return e=+e,t= +t>>>0,i||Hn(r,e,t,4,34028234663852886e22,-34028234663852886e22),Re.write(r,e,t,n, +23,4),t+4}a(Gn,"writeFloat");f.prototype.writeFloatLE=a(function(e,t,n){return Gn( +this,e,t,!0,n)},"writeFloatLE");f.prototype.writeFloatBE=a(function(e,t,n){return Gn( +this,e,t,!1,n)},"writeFloatBE");function $n(r,e,t,n,i){return e=+e,t=t>>>0,i||Hn( +r,e,t,8,17976931348623157e292,-17976931348623157e292),Re.write(r,e,t,n,52,8),t+8} +a($n,"writeDouble");f.prototype.writeDoubleLE=a(function(e,t,n){return $n(this,e, +t,!0,n)},"writeDoubleLE");f.prototype.writeDoubleBE=a(function(e,t,n){return $n( this,e,t,!1,n)},"writeDoubleBE");f.prototype.copy=a(function(e,t,n,i){if(!f.isBuffer( e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i= this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i>>0, n=n===void 0?this.length:n>>>0,e||(e=0);let s;if(typeof e=="number")for(s=t;s2**32?i=Dn(String(t)):typeof t=="bigint"&&(i=String(t), -(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Dn(i)),i+="n"),n+=` It\ - must be ${e}. Received ${i}`,n},RangeError);function Dn(r){let e="",t=r.length, +isInteger(t)&&Math.abs(t)>2**32?i=On(String(t)):typeof t=="bigint"&&(i=String(t), +(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=On(i)),i+="n"),n+=` It\ + must be ${e}. Received ${i}`,n},RangeError);function On(r){let e="",t=r.length, n=r[0]==="-"?1:0;for(;t>=n+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0, -t)}${e}`}a(Dn,"addNumericalSeparator");function ko(r,e,t){Be(e,"offset"),(r[e]=== -void 0||r[e+t]===void 0)&&We(e,r.length-(t+1))}a(ko,"checkBounds");function $n(r,e,t,n,i,s){ +t)}${e}`}a(On,"addNumericalSeparator");function Qo(r,e,t){Pe(e,"offset"),(r[e]=== +void 0||r[e+t]===void 0)&&We(e,r.length-(t+1))}a(Qo,"checkBounds");function Vn(r,e,t,n,i,s){ if(r>t||r3?e===0||e===BigInt(0)?u= `>= 0${o} and < 2${o} ** ${(s+1)*8}${o}`:u=`>= -(2${o} ** ${(s+1)*8-1}${o}) and \ < 2 ** ${(s+1)*8-1}${o}`:u=`>= ${e}${o} and <= ${t}${o}`,new Ie.ERR_OUT_OF_RANGE( -"value",u,r)}ko(n,i,s)}a($n,"checkIntBI");function Be(r,e){if(typeof r!="number") -throw new Ie.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Be,"validateNumber");function We(r,e,t){ -throw Math.floor(r)!==r?(Be(r,t),new Ie.ERR_OUT_OF_RANGE(t||"offset","an integer", +"value",u,r)}Qo(n,i,s)}a(Vn,"checkIntBI");function Pe(r,e){if(typeof r!="number") +throw new Ie.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Pe,"validateNumber");function We(r,e,t){ +throw Math.floor(r)!==r?(Pe(r,t),new Ie.ERR_OUT_OF_RANGE(t||"offset","an integer", r)):e<0?new Ie.ERR_BUFFER_OUT_OF_BOUNDS:new Ie.ERR_OUT_OF_RANGE(t||"offset",`>= ${t? -1:0} and <= ${e}`,r)}a(We,"boundsError");var Uo=/[^+/0-9A-Za-z-_]/g;function Oo(r){ -if(r=r.split("=")[0],r=r.trim().replace(Uo,""),r.length<2)return"";for(;r.length% -4!==0;)r=r+"=";return r}a(Oo,"base64clean");function Ut(r,e){e=e||1/0;let t,n=r. +1:0} and <= ${e}`,r)}a(We,"boundsError");var Do=/[^+/0-9A-Za-z-_]/g;function Uo(r){ +if(r=r.split("=")[0],r=r.trim().replace(Do,""),r.length<2)return"";for(;r.length% +4!==0;)r=r+"=";return r}a(Uo,"base64clean");function Ot(r,e){e=e||1/0;let t,n=r. length,i=null,s=[];for(let o=0;o55295&&t<57344){if(!i){ if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&& s.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191, @@ -351,75 +354,75 @@ s.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191, s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>> 6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63| 128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}a( -Ut,"utf8ToBytes");function No(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s} -a(qo,"utf16leToBytes");function Vn(r){return Mt.toByteArray(Oo(r))}a(Vn,"base64T\ -oBytes");function at(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) -e[i+t]=r[i];return i}a(at,"blitBuffer");function ue(r,e){return r instanceof e|| +a(No,"utf16leToBytes");function Kn(r){return Bt.toByteArray(Uo(r))}a(Kn,"base64T\ +oBytes");function ot(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) +e[i+t]=r[i];return i}a(ot,"blitBuffer");function ue(r,e){return r instanceof e|| r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name} -a(ue,"isInstance");function Qt(r){return r!==r}a(Qt,"numberIsNaN");var Qo=function(){ +a(ue,"isInstance");function qt(r){return r!==r}a(qt,"numberIsNaN");var Wo=function(){ let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){let n=t*16;for(let i=0;i< -16;++i)e[n+i]=r[t]+r[i]}return e}();function me(r){return typeof BigInt>"u"?jo:r} -a(me,"defineBigIntMethod");function jo(){throw new Error("BigInt not supported")} -a(jo,"BufferBigIntNotDefined")});var S,x,E,w,y,m,p=z(()=>{"use strict";S=globalThis,x=globalThis.setImmediate??(r=>setTimeout( -r,0)),E=globalThis.clearImmediate??(r=>clearTimeout(r)),w=globalThis.crypto??{}; +16;++i)e[n+i]=r[t]+r[i]}return e}();function ge(r){return typeof BigInt>"u"?jo:r} +a(ge,"defineBigIntMethod");function jo(){throw new Error("BigInt not supported")} +a(jo,"BufferBigIntNotDefined")});var b,x,v,w,y,m,d=z(()=>{"use strict";b=globalThis,x=globalThis.setImmediate??(r=>setTimeout( +r,0)),v=globalThis.clearImmediate??(r=>clearTimeout(r)),w=globalThis.crypto??{}; w.subtle??(w.subtle={});y=typeof globalThis.Buffer=="function"&&typeof globalThis. -Buffer.allocUnsafe=="function"?globalThis.Buffer:Kn().Buffer,m=globalThis.process?? +Buffer.allocUnsafe=="function"?globalThis.Buffer:zn().Buffer,m=globalThis.process?? {};m.env??(m.env={});try{m.nextTick(()=>{})}catch{let e=Promise.resolve();m.nextTick= -e.then.bind(e)}});var ge=I((nh,jt)=>{"use strict";p();var Re=typeof Reflect=="object"?Reflect:null, -zn=Re&&typeof Re.apply=="function"?Re.apply:a(function(e,t,n){return Function.prototype. -apply.call(e,t,n)},"ReflectApply"),ut;Re&&typeof Re.ownKeys=="function"?ut=Re.ownKeys: -Object.getOwnPropertySymbols?ut=a(function(e){return Object.getOwnPropertyNames( -e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):ut=a(function(e){return Object. -getOwnPropertyNames(e)},"ReflectOwnKeys");function Wo(r){console&&console.warn&& -console.warn(r)}a(Wo,"ProcessEmitWarning");var Zn=Number.isNaN||a(function(e){return e!== -e},"NumberIsNaN");function L(){L.init.call(this)}a(L,"EventEmitter");jt.exports= -L;jt.exports.once=Vo;L.EventEmitter=L;L.prototype._events=void 0;L.prototype._eventsCount= -0;L.prototype._maxListeners=void 0;var Yn=10;function ct(r){if(typeof r!="functi\ +e.then.bind(e)}});var we=I((sl,Nt)=>{"use strict";d();var Le=typeof Reflect=="object"?Reflect:null, +Yn=Le&&typeof Le.apply=="function"?Le.apply:a(function(e,t,n){return Function.prototype. +apply.call(e,t,n)},"ReflectApply"),at;Le&&typeof Le.ownKeys=="function"?at=Le.ownKeys: +Object.getOwnPropertySymbols?at=a(function(e){return Object.getOwnPropertyNames( +e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):at=a(function(e){return Object. +getOwnPropertyNames(e)},"ReflectOwnKeys");function Ho(r){console&&console.warn&& +console.warn(r)}a(Ho,"ProcessEmitWarning");var Jn=Number.isNaN||a(function(e){return e!== +e},"NumberIsNaN");function F(){F.init.call(this)}a(F,"EventEmitter");Nt.exports= +F;Nt.exports.once=Ko;F.EventEmitter=F;F.prototype._events=void 0;F.prototype._eventsCount= +0;F.prototype._maxListeners=void 0;var Zn=10;function ut(r){if(typeof r!="functi\ on")throw new TypeError('The "listener" argument must be of type Function. Recei\ -ved type '+typeof r)}a(ct,"checkListener");Object.defineProperty(L,"defaultMaxLi\ -steners",{enumerable:!0,get:a(function(){return Yn},"get"),set:a(function(r){if(typeof r!= -"number"||r<0||Zn(r))throw new RangeError('The value of "defaultMaxListeners" is\ - out of range. It must be a non-negative number. Received '+r+".");Yn=r},"set")}); -L.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this). +ved type '+typeof r)}a(ut,"checkListener");Object.defineProperty(F,"defaultMaxLi\ +steners",{enumerable:!0,get:a(function(){return Zn},"get"),set:a(function(r){if(typeof r!= +"number"||r<0||Jn(r))throw new RangeError('The value of "defaultMaxListeners" is\ + out of range. It must be a non-negative number. Received '+r+".");Zn=r},"set")}); +F.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this). _events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners= -this._maxListeners||void 0};L.prototype.setMaxListeners=a(function(e){if(typeof e!= -"number"||e<0||Zn(e))throw new RangeError('The value of "n" is out of range. It \ +this._maxListeners||void 0};F.prototype.setMaxListeners=a(function(e){if(typeof e!= +"number"||e<0||Jn(e))throw new RangeError('The value of "n" is out of range. It \ must be a non-negative number. Received '+e+".");return this._maxListeners=e,this}, -"setMaxListeners");function Jn(r){return r._maxListeners===void 0?L.defaultMaxListeners: -r._maxListeners}a(Jn,"_getMaxListeners");L.prototype.getMaxListeners=a(function(){ -return Jn(this)},"getMaxListeners");L.prototype.emit=a(function(e){for(var t=[], +"setMaxListeners");function Xn(r){return r._maxListeners===void 0?F.defaultMaxListeners: +r._maxListeners}a(Xn,"_getMaxListeners");F.prototype.getMaxListeners=a(function(){ +return Xn(this)},"getMaxListeners");F.prototype.emit=a(function(e){for(var t=[], n=1;n 0&&(o=t[0]),o instanceof Error)throw o;var u=new Error("Unhandled error."+(o?" ("+ o.message+")":""));throw u.context=o,u}var c=s[e];if(c===void 0)return!1;if(typeof c== -"function")zn(c,this,t);else for(var h=c.length,l=ni(c,h),n=0;n0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Po\ +t):o.push(t),i=Xn(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Po\ ssible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners a\ dded. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExce\ -ededWarning",u.emitter=r,u.type=e,u.count=o.length,Wo(u)}return r}a(Xn,"_addList\ -ener");L.prototype.addListener=a(function(e,t){return Xn(this,e,t,!1)},"addListe\ -ner");L.prototype.on=L.prototype.addListener;L.prototype.prependListener=a(function(e,t){ -return Xn(this,e,t,!0)},"prependListener");function Ho(){if(!this.fired)return this. +ededWarning",u.emitter=r,u.type=e,u.count=o.length,Ho(u)}return r}a(ei,"_addList\ +ener");F.prototype.addListener=a(function(e,t){return ei(this,e,t,!1)},"addListe\ +ner");F.prototype.on=F.prototype.addListener;F.prototype.prependListener=a(function(e,t){ +return ei(this,e,t,!0)},"prependListener");function Go(){if(!this.fired)return this. target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0? -this.listener.call(this.target):this.listener.apply(this.target,arguments)}a(Ho, -"onceWrapper");function ei(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e, -listener:t},i=Ho.bind(n);return i.listener=t,n.wrapFn=i,i}a(ei,"_onceWrap");L.prototype. -once=a(function(e,t){return ct(t),this.on(e,ei(this,e,t)),this},"once");L.prototype. -prependOnceListener=a(function(e,t){return ct(t),this.prependListener(e,ei(this, -e,t)),this},"prependOnceListener");L.prototype.removeListener=a(function(e,t){var n, -i,s,o,u;if(ct(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this; +this.listener.call(this.target):this.listener.apply(this.target,arguments)}a(Go, +"onceWrapper");function ti(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e, +listener:t},i=Go.bind(n);return i.listener=t,n.wrapFn=i,i}a(ti,"_onceWrap");F.prototype. +once=a(function(e,t){return ut(t),this.on(e,ti(this,e,t)),this},"once");F.prototype. +prependOnceListener=a(function(e,t){return ut(t),this.prependListener(e,ti(this, +e,t)),this},"prependOnceListener");F.prototype.removeListener=a(function(e,t){var n, +i,s,o,u;if(ut(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this; if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null): (delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!= "function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){u=n[o]. -listener,s=o;break}if(s<0)return this;s===0?n.shift():Go(n,s),n.length===1&&(i[e]= +listener,s=o;break}if(s<0)return this;s===0?n.shift():$o(n,s),n.length===1&&(i[e]= n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||t)}return this}, -"removeListener");L.prototype.off=L.prototype.removeListener;L.prototype.removeAllListeners= +"removeListener");F.prototype.off=F.prototype.removeListener;F.prototype.removeAllListeners= a(function(e){var t,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener=== void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount= 0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]), @@ -427,29 +430,29 @@ this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i=0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function ti(r,e,t){ +1;i>=0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function ri(r,e,t){ var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i== -"function"?t?[i.listener||i]:[i]:t?$o(i):ni(i,i.length)}a(ti,"_listeners");L.prototype. -listeners=a(function(e){return ti(this,e,!0)},"listeners");L.prototype.rawListeners= -a(function(e){return ti(this,e,!1)},"rawListeners");L.listenerCount=function(r,e){ -return typeof r.listenerCount=="function"?r.listenerCount(e):ri.call(r,e)};L.prototype. -listenerCount=ri;function ri(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t== -"function")return 1;if(t!==void 0)return t.length}return 0}a(ri,"listenerCount"); -L.prototype.eventNames=a(function(){return this._eventsCount>0?ut(this._events): -[]},"eventNames");function ni(r,e){for(var t=new Array(e),n=0;n0?at(this._events): +[]},"eventNames");function ii(r,e){for(var t=new Array(e),n=0;nzo});var zo,Ge=z(()=>{"use strict";p();zo={}});function $e(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119, -o=2600822924,u=528734635,c=1541459225,h=0,l=0,d=[1116352408,1899447441,3049323471, +ed type '+typeof r)}a(si,"eventTargetAgnosticAddListener")});var je={};ie(je,{default:()=>Yo});var Yo,He=z(()=>{"use strict";d();Yo={}});function Ge(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119, +o=2600822924,u=528734635,c=1541459225,l=0,h=0,p=[1116352408,1899447441,3049323471, 3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278, 1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078, 604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808, @@ -457,33 +460,33 @@ o=2600822924,u=528734635,c=1541459225,h=0,l=0,d=[1116352408,1899447441,304932347 1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800, 3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556, 883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452, -2361852424,2428436474,2756734187,3204031479,3329325298],b=a((A,g)=>A>>>g|A<<32-g, -"rrot"),C=new Uint32Array(64),B=new Uint8Array(64),Q=a(()=>{for(let R=0,$=0;R<16;R++, -$+=4)C[R]=B[$]<<24|B[$+1]<<16|B[$+2]<<8|B[$+3];for(let R=16;R<64;R++){let $=b(C[R- -15],7)^b(C[R-15],18)^C[R-15]>>>3,ce=b(C[R-2],17)^b(C[R-2],19)^C[R-2]>>>10;C[R]=C[R- -16]+$+C[R-7]+ce|0}let A=e,g=t,P=n,K=i,k=s,j=o,ee=u,oe=c;for(let R=0;R<64;R++){let $=b( -k,6)^b(k,11)^b(k,25),ce=k&j^~k&ee,ye=oe+$+ce+d[R]+C[R]|0,Se=b(A,2)^b(A,13)^b(A,22), -je=A&g^A&P^g&P,he=Se+je|0;oe=ee,ee=j,j=k,k=K+ye|0,K=P,P=g,g=A,A=ye+he|0}e=e+A|0, -t=t+g|0,n=n+P|0,i=i+K|0,s=s+k|0,o=o+j|0,u=u+ee|0,c=c+oe|0,l=0},"process"),X=a(A=>{ -typeof A=="string"&&(A=new TextEncoder().encode(A));for(let g=0;g{if(B[l++]=128,l==64&&Q(),l+8>64){ -for(;l<64;)B[l++]=0;Q()}for(;l<58;)B[l++]=0;let A=h*8;B[l++]=A/1099511627776&255, -B[l++]=A/4294967296&255,B[l++]=A>>>24,B[l++]=A>>>16&255,B[l++]=A>>>8&255,B[l++]= -A&255,Q();let g=new Uint8Array(32);return g[0]=e>>>24,g[1]=e>>>16&255,g[2]=e>>>8& +2361852424,2428436474,2756734187,3204031479,3329325298],S=a((C,g)=>C>>>g|C<<32-g, +"rrot"),_=new Uint32Array(64),P=new Uint8Array(64),G=a(()=>{for(let L=0,$=0;L<16;L++, +$+=4)_[L]=P[$]<<24|P[$+1]<<16|P[$+2]<<8|P[$+3];for(let L=16;L<64;L++){let $=S(_[L- +15],7)^S(_[L-15],18)^_[L-15]>>>3,ce=S(_[L-2],17)^S(_[L-2],19)^_[L-2]>>>10;_[L]=_[L- +16]+$+_[L-7]+ce|0}let C=e,g=t,R=n,W=i,Q=s,j=o,ee=u,oe=c;for(let L=0;L<64;L++){let $=S( +Q,6)^S(Q,11)^S(Q,25),ce=Q&j^~Q&ee,pe=oe+$+ce+p[L]+_[L]|0,xe=S(C,2)^S(C,13)^S(C,22), +Ne=C&g^C&R^g&R,le=xe+Ne|0;oe=ee,ee=j,j=Q,Q=W+pe|0,W=R,R=g,g=C,C=pe+le|0}e=e+C|0, +t=t+g|0,n=n+R|0,i=i+W|0,s=s+Q|0,o=o+j|0,u=u+ee|0,c=c+oe|0,h=0},"process"),X=a(C=>{ +typeof C=="string"&&(C=new TextEncoder().encode(C));for(let g=0;g{if(P[h++]=128,h==64&&G(),h+8>64){ +for(;h<64;)P[h++]=0;G()}for(;h<58;)P[h++]=0;let C=l*8;P[h++]=C/1099511627776&255, +P[h++]=C/4294967296&255,P[h++]=C>>>24,P[h++]=C>>>16&255,P[h++]=C>>>8&255,P[h++]= +C&255,G();let g=new Uint8Array(32);return g[0]=e>>>24,g[1]=e>>>16&255,g[2]=e>>>8& 255,g[3]=e&255,g[4]=t>>>24,g[5]=t>>>16&255,g[6]=t>>>8&255,g[7]=t&255,g[8]=n>>>24, g[9]=n>>>16&255,g[10]=n>>>8&255,g[11]=n&255,g[12]=i>>>24,g[13]=i>>>16&255,g[14]= i>>>8&255,g[15]=i&255,g[16]=s>>>24,g[17]=s>>>16&255,g[18]=s>>>8&255,g[19]=s&255, g[20]=o>>>24,g[21]=o>>>16&255,g[22]=o>>>8&255,g[23]=o&255,g[24]=u>>>24,g[25]=u>>> 16&255,g[26]=u>>>8&255,g[27]=u&255,g[28]=c>>>24,g[29]=c>>>16&255,g[30]=c>>>8&255, -g[31]=c&255,g},"digest");return r===void 0?{add:X,digest:de}:(X(r),de())}var si=z( -()=>{"use strict";p();a($e,"sha256")});var U,Ve,oi=z(()=>{"use strict";p();U=class U{constructor(){_(this,"_dataLength", -0);_(this,"_bufferLength",0);_(this,"_state",new Int32Array(4));_(this,"_buffer", -new ArrayBuffer(68));_(this,"_buffer8");_(this,"_buffer32");this._buffer8=new Uint8Array( +g[31]=c&255,g},"digest");return r===void 0?{add:X,digest:se}:(X(r),se())}var oi=z( +()=>{"use strict";d();a(Ge,"sha256")});var D,$e,ai=z(()=>{"use strict";d();D=class D{constructor(){A(this,"_dataLength", +0);A(this,"_bufferLength",0);A(this,"_state",new Int32Array(4));A(this,"_buffer", +new ArrayBuffer(68));A(this,"_buffer8");A(this,"_buffer32");this._buffer8=new Uint8Array( this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}static hashByteArray(e,t=!1){ return this.onePassHasher.start().appendByteArray(e).end(t)}static hashStr(e,t=!1){ return this.onePassHasher.start().appendStr(e).end(t)}static hashAsciiStr(e,t=!1){ -return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(e){let t=U. -hexChars,n=U.hexOut,i,s,o,u;for(u=0;u<4;u+=1)for(s=u*8,i=e[u],o=0;o<8;o+=2)n[s+1+ +return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(e){let t=D. +hexChars,n=D.hexOut,i,s,o,u;for(u=0;u<4;u+=1)for(s=u*8,i=e[u],o=0;o<8;o+=2)n[s+1+ o]=t.charAt(i&15),i>>>=4,n[s+0+o]=t.charAt(i&15),i>>>=4;return n.join("")}static _md5cycle(e,t){ let n=e[0],i=e[1],s=e[2],o=e[3];n+=(i&s|~i&o)+t[0]-680876936|0,n=(n<<7|n>>>25)+i| 0,o+=(n&i|~n&s)+t[1]-389564586|0,o=(o<<12|o>>>20)+n|0,s+=(o&n|~o&i)+t[2]+606105819| @@ -527,47 +530,48 @@ i>>>11)+s|0,n+=(s^(i|~o))+t[4]-145523070|0,n=(n<<6|n>>>26)+i|0,o+=(i^(n|~s))+t[1 1120210379|0,o=(o<<10|o>>>22)+n|0,s+=(n^(o|~i))+t[2]+718787259|0,s=(s<<15|s>>>17)+ o|0,i+=(o^(s|~n))+t[9]-343485551|0,i=(i<<21|i>>>11)+s|0,e[0]=n+e[0]|0,e[1]=i+e[1]| 0,e[2]=s+e[2]|0,e[3]=o+e[3]|0}start(){return this._dataLength=0,this._bufferLength= -0,this._state.set(U.stateIdentity),this}appendStr(e){let t=this._buffer8,n=this. +0,this._state.set(D.stateIdentity),this}appendStr(e){let t=this._buffer8,n=this. _buffer32,i=this._bufferLength,s,o;for(o=0;o>>6)+192,t[i++]=s&63|128;else if(s<55296|| s>56319)t[i++]=(s>>>12)+224,t[i++]=s>>>6&63|128,t[i++]=s&63|128;else{if(s=(s-55296)* 1024+(e.charCodeAt(++o)-56320)+65536,s>1114111)throw new Error("Unicode standard\ supports code points up to U+10FFFF");t[i++]=(s>>>18)+240,t[i++]=s>>>12&63|128, -t[i++]=s>>>6&63|128,t[i++]=s&63|128}i>=64&&(this._dataLength+=64,U._md5cycle(this. +t[i++]=s>>>6&63|128,t[i++]=s&63|128}i>=64&&(this._dataLength+=64,D._md5cycle(this. _state,n),i-=64,n[0]=n[16])}return this._bufferLength=i,this}appendAsciiStr(e){let t=this. _buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(e.length- -o,64-i);s--;)t[i++]=e.charCodeAt(o++);if(i<64)break;this._dataLength+=64,U._md5cycle( +o,64-i);s--;)t[i++]=e.charCodeAt(o++);if(i<64)break;this._dataLength+=64,D._md5cycle( this._state,n),i=0}return this._bufferLength=i,this}appendByteArray(e){let t=this. _buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(e.length- -o,64-i);s--;)t[i++]=e[o++];if(i<64)break;this._dataLength+=64,U._md5cycle(this._state, +o,64-i);s--;)t[i++]=e[o++];if(i<64)break;this._dataLength+=64,D._md5cycle(this._state, n),i=0}return this._bufferLength=i,this}getState(){let e=this._state;return{buffer:String. fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this. _dataLength,state:[e[0],e[1],e[2],e[3]]}}setState(e){let t=e.buffer,n=e.state,i=this. _state,s;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=n[0],i[1]= n[1],i[2]=n[2],i[3]=n[3],s=0;s>2)+1;this._dataLength+= -t;let o=this._dataLength*8;if(n[t]=128,n[t+1]=n[t+2]=n[t+3]=0,i.set(U.buffer32Identity. -subarray(s),s),t>55&&(U._md5cycle(this._state,i),i.set(U.buffer32Identity)),o<=4294967295) +t;let o=this._dataLength*8;if(n[t]=128,n[t+1]=n[t+2]=n[t+3]=0,i.set(D.buffer32Identity. +subarray(s),s),t>55&&(D._md5cycle(this._state,i),i.set(D.buffer32Identity)),o<=4294967295) i[14]=o;else{let u=o.toString(16).match(/(.*?)(.{0,8})$/);if(u===null)return;let c=parseInt( -u[2],16),h=parseInt(u[1],16)||0;i[14]=c,i[15]=h}return U._md5cycle(this._state,i), -e?this._state:U._hex(this._state)}};a(U,"Md5"),_(U,"stateIdentity",new Int32Array( -[1732584193,-271733879,-1732584194,271733878])),_(U,"buffer32Identity",new Int32Array( -[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),_(U,"hexChars","0123456789abcdef"),_(U,"hexO\ -ut",[]),_(U,"onePassHasher",new U);Ve=U});var Wt={};se(Wt,{createHash:()=>Zo,createHmac:()=>Jo,randomBytes:()=>Yo});function Yo(r){ -return w.getRandomValues(y.alloc(r))}function Zo(r){if(r==="sha256")return{update:a( -function(e){return{digest:a(function(){return y.from($e(e))},"digest")}},"update")}; -if(r==="md5")return{update:a(function(e){return{digest:a(function(){return typeof e== -"string"?Ve.hashStr(e):Ve.hashByteArray(e)},"digest")}},"update")};throw new Error( -`Hash type '${r}' not supported`)}function Jo(r,e){if(r!=="sha256")throw new Error( +u[2],16),l=parseInt(u[1],16)||0;i[14]=c,i[15]=l}return D._md5cycle(this._state,i), +e?this._state:D._hex(this._state)}};a(D,"Md5"),A(D,"stateIdentity",new Int32Array( +[1732584193,-271733879,-1732584194,271733878])),A(D,"buffer32Identity",new Int32Array( +[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),A(D,"hexChars","0123456789abcdef"),A(D,"hexO\ +ut",[]),A(D,"onePassHasher",new D);$e=D});var Wt={};ie(Wt,{createHash:()=>Xo,createHmac:()=>ea,randomBytes:()=>Jo});function Jo(r){ +return typeof w<"u"&&w.randomBytes!==void 0?(w.webcrypto??w).getRandomValues(y.alloc( +r)):Tn(Zo).randomBytes(r)}function Xo(r){if(r==="sha256")return{update:a(function(e){ +return{digest:a(function(){return y.from(Ge(e))},"digest")}},"update")};if(r==="\ +md5")return{update:a(function(e){return{digest:a(function(){return typeof e=="st\ +ring"?$e.hashStr(e):$e.hashByteArray(e)},"digest")}},"update")};throw new Error( +`Hash type '${r}' not supported`)}function ea(r,e){if(r!=="sha256")throw new Error( `Only sha256 is supported (requested: '${r}')`);return{update:a(function(t){return{ digest:a(function(){typeof e=="string"&&(e=new TextEncoder().encode(e)),typeof t== -"string"&&(t=new TextEncoder().encode(t));let n=e.length;if(n>64)e=$e(e);else if(n< +"string"&&(t=new TextEncoder().encode(t));let n=e.length;if(n>64)e=Ge(e);else if(n< 64){let c=new Uint8Array(64);c.set(e),e=c}let i=new Uint8Array(64),s=new Uint8Array( 64);for(let c=0;c<64;c++)i[c]=54^e[c],s[c]=92^e[c];let o=new Uint8Array(t.length+ -64);o.set(i,0),o.set(t,64);let u=new Uint8Array(96);return u.set(s,0),u.set($e(o), -64),y.from($e(u))},"digest")}},"update")}}var Ht=z(()=>{"use strict";p();si();oi(); -a(Yo,"randomBytes");a(Zo,"createHash");a(Jo,"createHmac")});var $t=I(ai=>{"use strict";p();ai.parse=function(r,e){return new Gt(r,e).parse()}; -var ht=class ht{constructor(e,t){this.source=e,this.transform=t||Xo,this.position= +64);o.set(i,0),o.set(t,64);let u=new Uint8Array(96);return u.set(s,0),u.set(Ge(o), +64),y.from(Ge(u))},"digest")}},"update")}}var Zo,jt=z(()=>{"use strict";d();oi(); +ai();Zo="node:crypto";a(Jo,"randomBytes");a(Xo,"createHash");a(ea,"createHmac")});var Gt=I(ui=>{"use strict";d();ui.parse=function(r,e){return new Ht(r,e).parse()}; +var ct=class ct{constructor(e,t){this.source=e,this.transform=t||ta,this.position= 0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){return this.position>= this.source.length}nextCharacter(){var e=this.source[this.position++];return e=== "\\"?{value:this.source[this.position++],escaped:!0}:{value:e,escaped:!1}}record(e){ @@ -576,117 +580,117 @@ join(""),t==="NULL"&&!e&&(t=null),t!==null&&(t=this.transform(t)),this.entries.p t),this.recorded=[])}consumeDimensions(){if(this.source[0]==="[")for(;!this.isEof();){ var e=this.nextCharacter();if(e.value==="=")break}}parse(e){var t,n,i;for(this.consumeDimensions();!this. isEof();)if(t=this.nextCharacter(),t.value==="{"&&!i)this.dimension++,this.dimension> -1&&(n=new ht(this.source.substr(this.position-1),this.transform),this.entries.push( +1&&(n=new ct(this.source.substr(this.position-1),this.transform),this.entries.push( n.parse(!0)),this.position+=n.position-2);else if(t.value==="}"&&!i){if(this.dimension--, !this.dimension&&(this.newEntry(),e))return this.entries}else t.value==='"'&&!t. escaped?(i&&this.newEntry(!0),i=!i):t.value===","&&!i?this.newEntry():this.record( t.value);if(this.dimension!==0)throw new Error("array dimension not balanced");return this. -entries}};a(ht,"ArrayParser");var Gt=ht;function Xo(r){return r}a(Xo,"identity")});var Vt=I((Sh,ui)=>{p();var ea=$t();ui.exports={create:a(function(r,e){return{parse:a( -function(){return ea.parse(r,e)},"parse")}},"create")}});var li=I((vh,hi)=>{"use strict";p();var ta=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, -ra=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,na=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,ia=/^-?infinity$/; -hi.exports=a(function(e){if(ia.test(e))return Number(e.replace("i","I"));var t=ta. -exec(e);if(!t)return sa(e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=ci(i));var s=parseInt( -t[2],10)-1,o=t[3],u=parseInt(t[4],10),c=parseInt(t[5],10),h=parseInt(t[6],10),l=t[7]; -l=l?1e3*parseFloat(l):0;var d,b=oa(e);return b!=null?(d=new Date(Date.UTC(i,s,o, -u,c,h,l)),Kt(i)&&d.setUTCFullYear(i),b!==0&&d.setTime(d.getTime()-b)):(d=new Date( -i,s,o,u,c,h,l),Kt(i)&&d.setFullYear(i)),d},"parseDate");function sa(r){var e=ra. -exec(r);if(e){var t=parseInt(e[1],10),n=!!e[4];n&&(t=ci(t));var i=parseInt(e[2], -10)-1,s=e[3],o=new Date(t,i,s);return Kt(t)&&o.setFullYear(t),o}}a(sa,"getDate"); -function oa(r){if(r.endsWith("+00"))return 0;var e=na.exec(r.split(" ")[1]);if(e){ +entries}};a(ct,"ArrayParser");var Ht=ct;function ta(r){return r}a(ta,"identity")});var $t=I((vl,ci)=>{d();var ra=Gt();ci.exports={create:a(function(r,e){return{parse:a( +function(){return ra.parse(r,e)},"parse")}},"create")}});var fi=I((_l,hi)=>{"use strict";d();var na=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, +ia=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,sa=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,oa=/^-?infinity$/; +hi.exports=a(function(e){if(oa.test(e))return Number(e.replace("i","I"));var t=na. +exec(e);if(!t)return aa(e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=li(i));var s=parseInt( +t[2],10)-1,o=t[3],u=parseInt(t[4],10),c=parseInt(t[5],10),l=parseInt(t[6],10),h=t[7]; +h=h?1e3*parseFloat(h):0;var p,S=ua(e);return S!=null?(p=new Date(Date.UTC(i,s,o, +u,c,l,h)),Vt(i)&&p.setUTCFullYear(i),S!==0&&p.setTime(p.getTime()-S)):(p=new Date( +i,s,o,u,c,l,h),Vt(i)&&p.setFullYear(i)),p},"parseDate");function aa(r){var e=ia. +exec(r);if(e){var t=parseInt(e[1],10),n=!!e[4];n&&(t=li(t));var i=parseInt(e[2], +10)-1,s=e[3],o=new Date(t,i,s);return Vt(t)&&o.setFullYear(t),o}}a(aa,"getDate"); +function ua(r){if(r.endsWith("+00"))return 0;var e=sa.exec(r.split(" ")[1]);if(e){ var t=e[1];if(t==="Z")return 0;var n=t==="-"?-1:1,i=parseInt(e[2],10)*3600+parseInt( -e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(oa,"timeZoneOffset");function ci(r){ -return-(r-1)}a(ci,"bcYearToNegativeYear");function Kt(r){return r>=0&&r<100}a(Kt, -"is0To99")});var pi=I((Ch,fi)=>{p();fi.exports=ua;var aa=Object.prototype.hasOwnProperty;function ua(r){ -for(var e=1;e{"use strict";p();var ca=pi();yi.exports=Fe;function Fe(r){if(!(this instanceof -Fe))return new Fe(r);ca(this,xa(r))}a(Fe,"PostgresInterval");var ha=["seconds","\ -minutes","hours","days","months","years"];Fe.prototype.toPostgres=function(){var r=ha. +e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(ua,"timeZoneOffset");function li(r){ +return-(r-1)}a(li,"bcYearToNegativeYear");function Vt(r){return r>=0&&r<100}a(Vt, +"is0To99")});var pi=I((Il,di)=>{d();di.exports=la;var ca=Object.prototype.hasOwnProperty;function la(r){ +for(var e=1;e{"use strict";d();var ha=pi();mi.exports=Be;function Be(r){if(!(this instanceof +Be))return new Be(r);ha(this,Ea(r))}a(Be,"PostgresInterval");var fa=["seconds","\ +minutes","hours","days","months","years"];Be.prototype.toPostgres=function(){var r=fa. filter(this.hasOwnProperty,this);return this.milliseconds&&r.indexOf("seconds")< 0&&r.push("seconds"),r.length===0?"0":r.map(function(e){var t=this[e]||0;return e=== "seconds"&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/, -"")),t+" "+e},this).join(" ")};var la={years:"Y",months:"M",days:"D",hours:"H",minutes:"\ -M",seconds:"S"},fa=["years","months","days"],pa=["hours","minutes","seconds"];Fe. -prototype.toISOString=Fe.prototype.toISO=function(){var r=fa.map(t,this).join(""), -e=pa.map(t,this).join("");return"P"+r+"T"+e;function t(n){var i=this[n]||0;return n=== +"")),t+" "+e},this).join(" ")};var da={years:"Y",months:"M",days:"D",hours:"H",minutes:"\ +M",seconds:"S"},pa=["years","months","days"],ya=["hours","minutes","seconds"];Be. +prototype.toISOString=Be.prototype.toISO=function(){var r=pa.map(t,this).join(""), +e=ya.map(t,this).join("");return"P"+r+"T"+e;function t(n){var i=this[n]||0;return n=== "seconds"&&this.milliseconds&&(i=(i+this.milliseconds/1e3).toFixed(6).replace(/0+$/, -"")),i+la[n]}};var zt="([+-]?\\d+)",da=zt+"\\s+years?",ya=zt+"\\s+mons?",ma=zt+"\ -\\s+days?",ga="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",wa=new RegExp([ -da,ya,ma,ga].map(function(r){return"("+r+")?"}).join("\\s*")),di={years:2,months:4, -days:6,hours:9,minutes:10,seconds:11,milliseconds:12},ba=["hours","minutes","sec\ -onds","milliseconds"];function Sa(r){var e=r+"000000".slice(r.length);return parseInt( -e,10)/1e3}a(Sa,"parseMilliseconds");function xa(r){if(!r)return{};var e=wa.exec( -r),t=e[8]==="-";return Object.keys(di).reduce(function(n,i){var s=di[i],o=e[s];return!o|| -(o=i==="milliseconds"?Sa(o):parseInt(o,10),!o)||(t&&~ba.indexOf(i)&&(o*=-1),n[i]= -o),n},{})}a(xa,"parse")});var wi=I((Rh,gi)=>{"use strict";p();gi.exports=a(function(e){if(/^\\x/.test(e))return new y( +"")),i+da[n]}};var Kt="([+-]?\\d+)",ma=Kt+"\\s+years?",ga=Kt+"\\s+mons?",wa=Kt+"\ +\\s+days?",ba="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",Sa=new RegExp([ +ma,ga,wa,ba].map(function(r){return"("+r+")?"}).join("\\s*")),yi={years:2,months:4, +days:6,hours:9,minutes:10,seconds:11,milliseconds:12},xa=["hours","minutes","sec\ +onds","milliseconds"];function va(r){var e=r+"000000".slice(r.length);return parseInt( +e,10)/1e3}a(va,"parseMilliseconds");function Ea(r){if(!r)return{};var e=Sa.exec( +r),t=e[8]==="-";return Object.keys(yi).reduce(function(n,i){var s=yi[i],o=e[s];return!o|| +(o=i==="milliseconds"?va(o):parseInt(o,10),!o)||(t&&~xa.indexOf(i)&&(o*=-1),n[i]= +o),n},{})}a(Ea,"parse")});var bi=I((Ml,wi)=>{"use strict";d();wi.exports=a(function(e){if(/^\\x/.test(e))return new y( e.substr(2),"hex");for(var t="",n=0;n{p();var Ke=$t(),ze=Vt(),lt=li(),Si=mi(),xi=wi();function ft(r){ -return a(function(t){return t===null?t:r(t)},"nullAllowed")}a(ft,"allowNull");function Ei(r){ +"\\";n+=Math.floor(i/2)*2}return new y(t,"binary")},"parseBytea")});var Ci=I((Ql,_i)=>{d();var Ve=Gt(),Ke=$t(),lt=fi(),xi=gi(),vi=bi();function ht(r){ +return a(function(t){return t===null?t:r(t)},"nullAllowed")}a(ht,"allowNull");function Ei(r){ return r===null?r:r==="TRUE"||r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"|| -r==="1"}a(Ei,"parseBool");function Ea(r){return r?Ke.parse(r,Ei):null}a(Ea,"pars\ -eBoolArray");function va(r){return parseInt(r,10)}a(va,"parseBaseTenInt");function Yt(r){ -return r?Ke.parse(r,ft(va)):null}a(Yt,"parseIntegerArray");function _a(r){return r? -Ke.parse(r,ft(function(e){return vi(e).trim()})):null}a(_a,"parseBigIntegerArray"); -var Aa=a(function(r){if(!r)return null;var e=ze.create(r,function(t){return t!== -null&&(t=er(t)),t});return e.parse()},"parsePointArray"),Zt=a(function(r){if(!r) -return null;var e=ze.create(r,function(t){return t!==null&&(t=parseFloat(t)),t}); -return e.parse()},"parseFloatArray"),ne=a(function(r){if(!r)return null;var e=ze. -create(r);return e.parse()},"parseStringArray"),Jt=a(function(r){if(!r)return null; -var e=ze.create(r,function(t){return t!==null&&(t=lt(t)),t});return e.parse()},"\ -parseDateArray"),Ca=a(function(r){if(!r)return null;var e=ze.create(r,function(t){ -return t!==null&&(t=Si(t)),t});return e.parse()},"parseIntervalArray"),Ta=a(function(r){ -return r?Ke.parse(r,ft(xi)):null},"parseByteAArray"),Xt=a(function(r){return parseInt( -r,10)},"parseInteger"),vi=a(function(r){var e=String(r);return/^\d+$/.test(e)?e: -r},"parseBigInteger"),bi=a(function(r){return r?Ke.parse(r,ft(JSON.parse)):null}, -"parseJsonArray"),er=a(function(r){return r[0]!=="("?null:(r=r.substring(1,r.length- -1).split(","),{x:parseFloat(r[0]),y:parseFloat(r[1])})},"parsePoint"),Ia=a(function(r){ +r==="1"}a(Ei,"parseBool");function Aa(r){return r?Ve.parse(r,Ei):null}a(Aa,"pars\ +eBoolArray");function _a(r){return parseInt(r,10)}a(_a,"parseBaseTenInt");function zt(r){ +return r?Ve.parse(r,ht(_a)):null}a(zt,"parseIntegerArray");function Ca(r){return r? +Ve.parse(r,ht(function(e){return Ai(e).trim()})):null}a(Ca,"parseBigIntegerArray"); +var Ta=a(function(r){if(!r)return null;var e=Ke.create(r,function(t){return t!== +null&&(t=Xt(t)),t});return e.parse()},"parsePointArray"),Yt=a(function(r){if(!r) +return null;var e=Ke.create(r,function(t){return t!==null&&(t=parseFloat(t)),t}); +return e.parse()},"parseFloatArray"),re=a(function(r){if(!r)return null;var e=Ke. +create(r);return e.parse()},"parseStringArray"),Zt=a(function(r){if(!r)return null; +var e=Ke.create(r,function(t){return t!==null&&(t=lt(t)),t});return e.parse()},"\ +parseDateArray"),Ia=a(function(r){if(!r)return null;var e=Ke.create(r,function(t){ +return t!==null&&(t=xi(t)),t});return e.parse()},"parseIntervalArray"),Ra=a(function(r){ +return r?Ve.parse(r,ht(vi)):null},"parseByteAArray"),Jt=a(function(r){return parseInt( +r,10)},"parseInteger"),Ai=a(function(r){var e=String(r);return/^\d+$/.test(e)?e: +r},"parseBigInteger"),Si=a(function(r){return r?Ve.parse(r,ht(JSON.parse)):null}, +"parseJsonArray"),Xt=a(function(r){return r[0]!=="("?null:(r=r.substring(1,r.length- +1).split(","),{x:parseFloat(r[0]),y:parseFloat(r[1])})},"parsePoint"),Pa=a(function(r){ if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1,i=2;i{"use strict";p();var Z=1e6;function Ba(r){var e=r.readInt32BE( +var s=Xt(e);return s.radius=parseFloat(t),s},"parseCircle"),Fa=a(function(r){r(20, +Ai),r(21,Jt),r(23,Jt),r(26,Jt),r(700,parseFloat),r(701,parseFloat),r(16,Ei),r(1082, +lt),r(1114,lt),r(1184,lt),r(600,Xt),r(651,re),r(718,Pa),r(1e3,Aa),r(1001,Ra),r(1005, +zt),r(1007,zt),r(1028,zt),r(1016,Ca),r(1017,Ta),r(1021,Yt),r(1022,Yt),r(1231,Yt), +r(1014,re),r(1015,re),r(1008,re),r(1009,re),r(1040,re),r(1041,re),r(1115,Zt),r(1182, +Zt),r(1185,Zt),r(1186,xi),r(1187,Ia),r(17,vi),r(114,JSON.parse.bind(JSON)),r(3802, +JSON.parse.bind(JSON)),r(199,Si),r(3807,Si),r(3907,re),r(2951,re),r(791,re),r(1183, +re),r(1270,re)},"init");_i.exports={init:Fa}});var Ii=I((ql,Ti)=>{"use strict";d();var Z=1e6;function La(r){var e=r.readInt32BE( 0),t=r.readUInt32BE(4),n="";e<0&&(e=~e+(t===0),t=~t+1>>>0,n="-");var i="",s,o,u, -c,h,l;{if(s=e%Z,e=e/Z>>>0,o=4294967296*s+t,t=o/Z>>>0,u=""+(o-Z*t),t===0&&e===0)return n+ -u+i;for(c="",h=6-u.length,l=0;l>>0,o=4294967296* -s+t,t=o/Z>>>0,u=""+(o-Z*t),t===0&&e===0)return n+u+i;for(c="",h=6-u.length,l=0;l< -h;l++)c+="0";i=c+u+i}{if(s=e%Z,e=e/Z>>>0,o=4294967296*s+t,t=o/Z>>>0,u=""+(o-Z*t), -t===0&&e===0)return n+u+i;for(c="",h=6-u.length,l=0;l{p();var La=Ti(),F=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(C,B,Q){ -return C*Math.pow(2,Q)+B};var s=t>>3,o=a(function(C){return n?~C&255:C},"inv"),u=255, -c=8-t%8;e>t%8);var h=0;t%8+e>=8&&(h=i(0,o(r[s])& -u,c));for(var l=e+t>>3,d=s+1;d0&& -(h=i(h,o(r[l])>>8-b,b)),h},"parseBits"),Bi=a(function(r,e,t){var n=Math.pow(2,t- -1)-1,i=F(r,1),s=F(r,t,1);if(s===0)return 0;var o=1,u=a(function(h,l,d){h===0&&(h= -1);for(var b=1;b<=d;b++)o/=2,(l&1<0&&(h+=o);return h},"parsePrecisionBits"), -c=F(r,e,t+1,!1,u);return s==Math.pow(2,t+1)-1?c===0?i===0?1/0:-1/0:NaN:(i===0?1: --1)*Math.pow(2,s-n)*c},"parseFloatFromBits"),Ra=a(function(r){return F(r,1)==1?-1* -(F(r,15,1,!0)+1):F(r,15,1)},"parseInt16"),Ii=a(function(r){return F(r,1)==1?-1*(F( -r,31,1,!0)+1):F(r,31,1)},"parseInt32"),Fa=a(function(r){return Bi(r,23,8)},"pars\ -eFloat32"),Ma=a(function(r){return Bi(r,52,11)},"parseFloat64"),Da=a(function(r){ -var e=F(r,16,32);if(e==49152)return NaN;for(var t=Math.pow(1e4,F(r,16,16)),n=0,i=[], -s=F(r,16),o=0;o>>0,o=4294967296*s+t,t=o/Z>>>0,u=""+(o-Z*t),t===0&&e===0)return n+ +u+i;for(c="",l=6-u.length,h=0;h>>0,o=4294967296* +s+t,t=o/Z>>>0,u=""+(o-Z*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,h=0;h< +l;h++)c+="0";i=c+u+i}{if(s=e%Z,e=e/Z>>>0,o=4294967296*s+t,t=o/Z>>>0,u=""+(o-Z*t), +t===0&&e===0)return n+u+i;for(c="",l=6-u.length,h=0;h{d();var Ba=Ii(),B=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(_,P,G){ +return _*Math.pow(2,G)+P};var s=t>>3,o=a(function(_){return n?~_&255:_},"inv"),u=255, +c=8-t%8;e>t%8);var l=0;t%8+e>=8&&(l=i(0,o(r[s])& +u,c));for(var h=e+t>>3,p=s+1;p0&& +(l=i(l,o(r[h])>>8-S,S)),l},"parseBits"),Fi=a(function(r,e,t){var n=Math.pow(2,t- +1)-1,i=B(r,1),s=B(r,t,1);if(s===0)return 0;var o=1,u=a(function(l,h,p){l===0&&(l= +1);for(var S=1;S<=p;S++)o/=2,(h&1<0&&(l+=o);return l},"parsePrecisionBits"), +c=B(r,e,t+1,!1,u);return s==Math.pow(2,t+1)-1?c===0?i===0?1/0:-1/0:NaN:(i===0?1: +-1)*Math.pow(2,s-n)*c},"parseFloatFromBits"),Ma=a(function(r){return B(r,1)==1?-1* +(B(r,15,1,!0)+1):B(r,15,1)},"parseInt16"),Ri=a(function(r){return B(r,1)==1?-1*(B( +r,31,1,!0)+1):B(r,31,1)},"parseInt32"),ka=a(function(r){return Fi(r,23,8)},"pars\ +eFloat32"),Oa=a(function(r){return Fi(r,52,11)},"parseFloat64"),Qa=a(function(r){ +var e=B(r,16,32);if(e==49152)return NaN;for(var t=Math.pow(1e4,B(r,16,16)),n=0,i=[], +s=B(r,16),o=0;o>3,(i+=l<<3)>>3), -d;console.log("ERROR: ElementType not implemented: "+h)},"parseElement"),c=a(function(h,l){ -var d=[],b;if(h.length>1){var C=h.shift();for(b=0;b0},"parseBool"),Oa=a(function(r){r(20,La),r(21,Ra),r(23,Ii),r(26, -Ii),r(1700,Da),r(700,Fa),r(701,Ma),r(16,Ua),r(1114,Pi.bind(null,!1)),r(1184,Pi.bind( -null,!0)),r(1e3,Ye),r(1007,Ye),r(1016,Ye),r(1008,Ye),r(1009,Ye),r(25,ka)},"init"); -Li.exports={init:Oa}});var Mi=I((Hh,Fi)=>{p();Fi.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23, +return this.usec},i},"parseDate"),ze=a(function(r){for(var e=B(r,32),t=B(r,32,32), +n=B(r,32,64),i=96,s=[],o=0;o>3,(i+=h<<3)>>3), +p;console.log("ERROR: ElementType not implemented: "+l)},"parseElement"),c=a(function(l,h){ +var p=[],S;if(l.length>1){var _=l.shift();for(S=0;S<_;S++)p[S]=c(l,h);l.unshift( +_)}else for(S=0;S0},"parseBool"),qa=a(function(r){r(20,Ba),r(21,Ma),r(23,Ri),r(26, +Ri),r(1700,Qa),r(700,ka),r(701,Oa),r(16,Ua),r(1114,Pi.bind(null,!1)),r(1184,Pi.bind( +null,!0)),r(1e3,ze),r(1007,ze),r(1016,ze),r(1008,ze),r(1009,ze),r(25,Da)},"init"); +Li.exports={init:qa}});var ki=I(($l,Mi)=>{d();Mi.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23, REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194, SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703, TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033, @@ -694,157 +698,157 @@ BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INT TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203, REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220, PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642, -REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}});var Xe=I(Je=>{p();var Na=Ai(),qa=Ri(),Qa=Vt(),ja=Mi();Je.getTypeParser=Wa;Je.setTypeParser= -Ha;Je.arrayParser=Qa;Je.builtins=ja;var Ze={text:{},binary:{}};function Di(r){return String( -r)}a(Di,"noParse");function Wa(r,e){return e=e||"text",Ze[e]&&Ze[e][r]||Di}a(Wa, -"getTypeParser");function Ha(r,e,t){typeof e=="function"&&(t=e,e="text"),Ze[e][r]= -t}a(Ha,"setTypeParser");Na.init(function(r,e){Ze.text[r]=e});qa.init(function(r,e){ -Ze.binary[r]=e})});var et=I((zh,tr)=>{"use strict";p();tr.exports={host:"localhost",user:m.platform=== +REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}});var Je=I(Ze=>{d();var Na=Ci(),Wa=Bi(),ja=$t(),Ha=ki();Ze.getTypeParser=Ga;Ze.setTypeParser= +$a;Ze.arrayParser=ja;Ze.builtins=Ha;var Ye={text:{},binary:{}};function Oi(r){return String( +r)}a(Oi,"noParse");function Ga(r,e){return e=e||"text",Ye[e]&&Ye[e][r]||Oi}a(Ga, +"getTypeParser");function $a(r,e,t){typeof e=="function"&&(t=e,e="text"),Ye[e][r]= +t}a($a,"setTypeParser");Na.init(function(r,e){Ye.text[r]=e});Wa.init(function(r,e){ +Ye.binary[r]=e})});var Xe=I((Zl,er)=>{"use strict";d();er.exports={host:"localhost",user:m.platform=== "win32"?m.env.USERNAME:m.env.USER,database:void 0,password:null,connectionString:void 0, port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4,client_encoding:"",ssl:!1, application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1, statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1, -connect_timeout:0,keepalives:1,keepalives_idle:0};var Me=Xe(),Ga=Me.getTypeParser( -20,"text"),$a=Me.getTypeParser(1016,"text");tr.exports.__defineSetter__("parseIn\ -t8",function(r){Me.setTypeParser(20,"text",r?Me.getTypeParser(23,"text"):Ga),Me. -setTypeParser(1016,"text",r?Me.getTypeParser(1007,"text"):$a)})});var tt=I((Zh,Ui)=>{"use strict";p();var Va=(Ht(),O(Wt)),Ka=et();function za(r){var e=r. -replace(/\\/g,"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(za,"escapeElement"); -function ki(r){for(var e="{",t=0;t0&&(e=e+","),r[t]===null||typeof r[t]> -"u"?e=e+"NULL":Array.isArray(r[t])?e=e+ki(r[t]):r[t]instanceof y?e+="\\\\x"+r[t]. -toString("hex"):e+=za(pt(r[t]));return e=e+"}",e}a(ki,"arrayString");var pt=a(function(r,e){ +connect_timeout:0,keepalives:1,keepalives_idle:0};var Me=Je(),Va=Me.getTypeParser( +20,"text"),Ka=Me.getTypeParser(1016,"text");er.exports.__defineSetter__("parseIn\ +t8",function(r){Me.setTypeParser(20,"text",r?Me.getTypeParser(23,"text"):Va),Me. +setTypeParser(1016,"text",r?Me.getTypeParser(1007,"text"):Ka)})});var et=I((Xl,Di)=>{"use strict";d();var za=(jt(),U(Wt)),Ya=Xe();function Za(r){var e=r. +replace(/\\/g,"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(Za,"escapeElement"); +function Qi(r){for(var e="{",t=0;t0&&(e=e+","),r[t]===null||typeof r[t]> +"u"?e=e+"NULL":Array.isArray(r[t])?e=e+Qi(r[t]):r[t]instanceof y?e+="\\\\x"+r[t]. +toString("hex"):e+=Za(ft(r[t]));return e=e+"}",e}a(Qi,"arrayString");var ft=a(function(r,e){ if(r==null)return null;if(r instanceof y)return r;if(ArrayBuffer.isView(r)){var t=y. from(r.buffer,r.byteOffset,r.byteLength);return t.length===r.byteLength?t:t.slice( -r.byteOffset,r.byteOffset+r.byteLength)}return r instanceof Date?Ka.parseInputDatesAsUTC? -Ja(r):Za(r):Array.isArray(r)?ki(r):typeof r=="object"?Ya(r,e):r.toString()},"pre\ -pareValue");function Ya(r,e){if(r&&typeof r.toPostgres=="function"){if(e=e||[],e. +r.byteOffset,r.byteOffset+r.byteLength)}return r instanceof Date?Ya.parseInputDatesAsUTC? +eu(r):Xa(r):Array.isArray(r)?Qi(r):typeof r=="object"?Ja(r,e):r.toString()},"pre\ +pareValue");function Ja(r,e){if(r&&typeof r.toPostgres=="function"){if(e=e||[],e. indexOf(r)!==-1)throw new Error('circular reference detected while preparing "'+ -r+'" for query');return e.push(r),pt(r.toPostgres(pt),e)}return JSON.stringify(r)} -a(Ya,"prepareObject");function G(r,e){for(r=""+r;r.length{"use strict";p();var nr=(Ht(),O(Wt));function tu(r){if(r.indexOf( +r+'" for query');return e.push(r),ft(r.toPostgres(ft),e)}return JSON.stringify(r)} +a(Ja,"prepareObject");function H(r,e){for(r=""+r;r.length{"use strict";d();var rr=(jt(),U(Wt));function nu(r){if(r.indexOf( "SCRAM-SHA-256")===-1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is cur\ -rently supported");let e=nr.randomBytes(18).toString("base64");return{mechanism:"\ +rently supported");let e=rr.randomBytes(18).toString("base64");return{mechanism:"\ SCRAM-SHA-256",clientNonce:e,response:"n,,n=*,r="+e,message:"SASLInitialResponse"}} -a(tu,"startSession");function ru(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( +a(nu,"startSession");function iu(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( "SASL: Last message was not SASLInitialResponse");if(typeof e!="string")throw new Error( "SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if(typeof t!= "string")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a\ - string");let n=su(t);if(n.nonce.startsWith(r.clientNonce)){if(n.nonce.length=== + string");let n=au(t);if(n.nonce.startsWith(r.clientNonce)){if(n.nonce.length=== r.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server n\ once is too short")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serv\ -er nonce does not start with client nonce");var i=y.from(n.salt,"base64"),s=uu(e, -i,n.iteration),o=De(s,"Client Key"),u=au(o),c="n=*,r="+r.clientNonce,h="r="+n.nonce+ -",s="+n.salt+",i="+n.iteration,l="c=biws,r="+n.nonce,d=c+","+h+","+l,b=De(u,d),C=qi( -o,b),B=C.toString("base64"),Q=De(s,"Server Key"),X=De(Q,d);r.message="SASLRespon\ -se",r.serverSignature=X.toString("base64"),r.response=l+",p="+B}a(ru,"continueSe\ -ssion");function nu(r,e){if(r.message!=="SASLResponse")throw new Error("SASL: La\ +er nonce does not start with client nonce");var i=y.from(n.salt,"base64"),s=lu(e, +i,n.iteration),o=ke(s,"Client Key"),u=cu(o),c="n=*,r="+r.clientNonce,l="r="+n.nonce+ +",s="+n.salt+",i="+n.iteration,h="c=biws,r="+n.nonce,p=c+","+l+","+h,S=ke(u,p),_=Ni( +o,S),P=_.toString("base64"),G=ke(s,"Server Key"),X=ke(G,p);r.message="SASLRespon\ +se",r.serverSignature=X.toString("base64"),r.response=h+",p="+P}a(iu,"continueSe\ +ssion");function su(r,e){if(r.message!=="SASLResponse")throw new Error("SASL: La\ st message was not SASLResponse");if(typeof e!="string")throw new Error("SASL: S\ -CRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=ou( +CRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=uu( e);if(t!==r.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: s\ -erver signature does not match")}a(nu,"finalizeSession");function iu(r){if(typeof r!= +erver signature does not match")}a(su,"finalizeSession");function ou(r){if(typeof r!= "string")throw new TypeError("SASL: text must be a string");return r.split("").map( -(e,t)=>r.charCodeAt(t)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}a(iu,"isPrintableC\ -hars");function Oi(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(r)}a(Oi,"isBase64");function Ni(r){if(typeof r!="string")throw new TypeError( +(e,t)=>r.charCodeAt(t)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}a(ou,"isPrintableC\ +hars");function Ui(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(r)}a(Ui,"isBase64");function qi(r){if(typeof r!="string")throw new TypeError( "SASL: attribute pairs text must be a string");return new Map(r.split(",").map(e=>{ if(!/^.=/.test(e))throw new Error("SASL: Invalid attribute pair entry");let t=e[0], -n=e.substring(2);return[t,n]}))}a(Ni,"parseAttributePairs");function su(r){let e=Ni( -r),t=e.get("r");if(t){if(!iu(t))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAG\ +n=e.substring(2);return[t,n]}))}a(qi,"parseAttributePairs");function au(r){let e=qi( +r),t=e.get("r");if(t){if(!ou(t))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAG\ E: nonce must only contain printable characters")}else throw new Error("SASL: SC\ -RAM-SERVER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!Oi(n))throw new Error( +RAM-SERVER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!Ui(n))throw new Error( "SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64")}else throw new Error("S\ ASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");let i=e.get("i");if(i){if(!/^[1-9][0-9]*$/. test(i))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration cou\ nt")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing"); -let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(su,"parseServerFirstMe\ -ssage");function ou(r){let t=Ni(r).get("v");if(t){if(!Oi(t))throw new Error("SAS\ +let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(au,"parseServerFirstMe\ +ssage");function uu(r){let t=qi(r).get("v");if(t){if(!Ui(t))throw new Error("SAS\ L: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64")}else throw new Error( "SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");return{serverSignature:t}} -a(ou,"parseServerFinalMessage");function qi(r,e){if(!y.isBuffer(r))throw new TypeError( +a(uu,"parseServerFinalMessage");function Ni(r,e){if(!y.isBuffer(r))throw new TypeError( "first argument must be a Buffer");if(!y.isBuffer(e))throw new TypeError("second\ argument must be a Buffer");if(r.length!==e.length)throw new Error("Buffer leng\ ths must match");if(r.length===0)throw new Error("Buffers cannot be empty");return y. -from(r.map((t,n)=>r[n]^e[n]))}a(qi,"xorBuffers");function au(r){return nr.createHash( -"sha256").update(r).digest()}a(au,"sha256");function De(r,e){return nr.createHmac( -"sha256",r).update(e).digest()}a(De,"hmacSha256");function uu(r,e,t){for(var n=De( -r,y.concat([e,y.from([0,0,0,1])])),i=n,s=0;scu});function cu(...r){return r.join("/")}var sr=z(()=>{ -"use strict";p();a(cu,"join")});var or={};se(or,{stat:()=>hu});function hu(r,e){e(new Error("No filesystem"))}var ar=z( -()=>{"use strict";p();a(hu,"stat")});var ur={};se(ur,{default:()=>lu});var lu,cr=z(()=>{"use strict";p();lu={}});var Wi={};se(Wi,{StringDecoder:()=>hr});var lr,hr,Hi=z(()=>{"use strict";p();lr= -class lr{constructor(e){_(this,"td");this.td=new TextDecoder(e)}write(e){return this. +from(r.map((t,n)=>r[n]^e[n]))}a(Ni,"xorBuffers");function cu(r){return rr.createHash( +"sha256").update(r).digest()}a(cu,"sha256");function ke(r,e){return rr.createHmac( +"sha256",r).update(e).digest()}a(ke,"hmacSha256");function lu(r,e,t){for(var n=ke( +r,y.concat([e,y.from([0,0,0,1])])),i=n,s=0;shu});function hu(...r){return r.join("/")}var ir=z(()=>{ +"use strict";d();a(hu,"join")});var sr={};ie(sr,{stat:()=>fu});function fu(r,e){e(new Error("No filesystem"))}var or=z( +()=>{"use strict";d();a(fu,"stat")});var ar={};ie(ar,{default:()=>du});var du,ur=z(()=>{"use strict";d();du={}});var Hi={};ie(Hi,{StringDecoder:()=>cr});var lr,cr,Gi=z(()=>{"use strict";d();lr= +class lr{constructor(e){A(this,"td");this.td=new TextDecoder(e)}write(e){return this. td.decode(e,{stream:!0})}end(e){return this.td.decode(e)}};a(lr,"StringDecoder"); -hr=lr});var Ki=I((hl,Vi)=>{"use strict";p();var{Transform:fu}=(cr(),O(ur)),{StringDecoder:pu}=(Hi(),O(Wi)), -we=Symbol("last"),dt=Symbol("decoder");function du(r,e,t){let n;if(this.overflow){ +cr=lr});var zi=I((fh,Ki)=>{"use strict";d();var{Transform:pu}=(ur(),U(ar)),{StringDecoder:yu}=(Gi(),U(Hi)), +be=Symbol("last"),dt=Symbol("decoder");function mu(r,e,t){let n;if(this.overflow){ if(n=this[dt].write(r).split(this.matcher),n.length===1)return t();n.shift(),this. -overflow=!1}else this[we]+=this[dt].write(r),n=this[we].split(this.matcher);this[we]= -n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){ -t(new Error("maximum buffer reached"));return}t()}a(du,"transform");function yu(r){ -if(this[we]+=this[dt].end(),this[we])try{$i(this,this.mapper(this[we]))}catch(e){ -return r(e)}r()}a(yu,"flush");function $i(r,e){e!==void 0&&r.push(e)}a($i,"push"); -function Gi(r){return r}a(Gi,"noop");function mu(r,e,t){switch(r=r||/\r?\n/,e=e|| -Gi,t=t||{},arguments.length){case 1:typeof r=="function"?(e=r,r=/\r?\n/):typeof r== +overflow=!1}else this[be]+=this[dt].write(r),n=this[be].split(this.matcher);this[be]= +n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){ +t(new Error("maximum buffer reached"));return}t()}a(mu,"transform");function gu(r){ +if(this[be]+=this[dt].end(),this[be])try{Vi(this,this.mapper(this[be]))}catch(e){ +return r(e)}r()}a(gu,"flush");function Vi(r,e){e!==void 0&&r.push(e)}a(Vi,"push"); +function $i(r){return r}a($i,"noop");function wu(r,e,t){switch(r=r||/\r?\n/,e=e|| +$i,t=t||{},arguments.length){case 1:typeof r=="function"?(e=r,r=/\r?\n/):typeof r== "object"&&!(r instanceof RegExp)&&!r[Symbol.split]&&(t=r,r=/\r?\n/);break;case 2: -typeof r=="function"?(t=e,e=r,r=/\r?\n/):typeof e=="object"&&(t=e,e=Gi)}t=Object. -assign({},t),t.autoDestroy=!0,t.transform=du,t.flush=yu,t.readableObjectMode=!0; -let n=new fu(t);return n[we]="",n[dt]=new pu("utf8"),n.matcher=r,n.mapper=e,n.maxLength= +typeof r=="function"?(t=e,e=r,r=/\r?\n/):typeof e=="object"&&(t=e,e=$i)}t=Object. +assign({},t),t.autoDestroy=!0,t.transform=mu,t.flush=gu,t.readableObjectMode=!0; +let n=new pu(t);return n[be]="",n[dt]=new yu("utf8"),n.matcher=r,n.mapper=e,n.maxLength= t.maxLength,n.skipOverflow=t.skipOverflow||!1,n.overflow=!1,n._destroy=function(i,s){ -this._writableState.errorEmitted=!1,s(i)},n}a(mu,"split");Vi.exports=mu});var Zi=I((pl,fe)=>{"use strict";p();var zi=(sr(),O(ir)),gu=(cr(),O(ur)).Stream,wu=Ki(), -Yi=(Ge(),O(He)),bu=5432,yt=m.platform==="win32",rt=m.stderr,Su=56,xu=7,Eu=61440, -vu=32768;function _u(r){return(r&Eu)==vu}a(_u,"isRegFile");var ke=["host","port", -"database","user","password"],fr=ke.length,Au=ke[fr-1];function pr(){var r=rt instanceof -gu&&rt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` -`);rt.write(Yi.format.apply(Yi,e))}}a(pr,"warn");Object.defineProperty(fe.exports, -"isWin",{get:a(function(){return yt},"get"),set:a(function(r){yt=r},"set")});fe. -exports.warnTo=function(r){var e=rt;return rt=r,e};fe.exports.getFileName=function(r){ -var e=r||m.env,t=e.PGPASSFILE||(yt?zi.join(e.APPDATA||"./","postgresql","pgpass.\ -conf"):zi.join(e.HOME||"./",".pgpass"));return t};fe.exports.usePgPass=function(r,e){ -return Object.prototype.hasOwnProperty.call(m.env,"PGPASSWORD")?!1:yt?!0:(e=e||"\ -",_u(r.mode)?r.mode&(Su|xu)?(pr('WARNING: password file "%s" has group or \ -world access; permissions should be u=rw (0600) or less',e),!1):!0:(pr('WARNING:\ - password file "%s" is not a plain file',e),!1))};var Cu=fe.exports.match=function(r,e){ -return ke.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||bu)===Number( +this._writableState.errorEmitted=!1,s(i)},n}a(wu,"split");Ki.exports=wu});var Ji=I((yh,fe)=>{"use strict";d();var Yi=(ir(),U(nr)),bu=(ur(),U(ar)).Stream,Su=zi(), +Zi=(He(),U(je)),xu=5432,pt=m.platform==="win32",tt=m.stderr,vu=56,Eu=7,Au=61440, +_u=32768;function Cu(r){return(r&Au)==_u}a(Cu,"isRegFile");var Oe=["host","port", +"database","user","password"],hr=Oe.length,Tu=Oe[hr-1];function fr(){var r=tt instanceof +bu&&tt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` +`);tt.write(Zi.format.apply(Zi,e))}}a(fr,"warn");Object.defineProperty(fe.exports, +"isWin",{get:a(function(){return pt},"get"),set:a(function(r){pt=r},"set")});fe. +exports.warnTo=function(r){var e=tt;return tt=r,e};fe.exports.getFileName=function(r){ +var e=r||m.env,t=e.PGPASSFILE||(pt?Yi.join(e.APPDATA||"./","postgresql","pgpass.\ +conf"):Yi.join(e.HOME||"./",".pgpass"));return t};fe.exports.usePgPass=function(r,e){ +return Object.prototype.hasOwnProperty.call(m.env,"PGPASSWORD")?!1:pt?!0:(e=e||"\ +",Cu(r.mode)?r.mode&(vu|Eu)?(fr('WARNING: password file "%s" has group or \ +world access; permissions should be u=rw (0600) or less',e),!1):!0:(fr('WARNING:\ + password file "%s" is not a plain file',e),!1))};var Iu=fe.exports.match=function(r,e){ +return Oe.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||xu)===Number( e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};fe.exports.getPassword=function(r,e,t){ -var n,i=e.pipe(wu());function s(c){var h=Tu(c);h&&Iu(h)&&Cu(r,h)&&(n=h[Au],i.end())} +var n,i=e.pipe(Su());function s(c){var l=Ru(c);l&&Pu(l)&&Iu(r,l)&&(n=l[Tu],i.end())} a(s,"onLine");var o=a(function(){e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(), -pr("WARNING: error on reading file: %s",c),t(void 0)},"onErr");e.on("error",u),i. -on("data",s).on("end",o).on("error",u)};var Tu=fe.exports.parseLine=function(r){ +fr("WARNING: error on reading file: %s",c),t(void 0)},"onErr");e.on("error",u),i. +on("data",s).on("end",o).on("error",u)};var Ru=fe.exports.parseLine=function(r){ if(r.length<11||r.match(/^\s+#/))return null;for(var e="",t="",n=0,i=0,s=0,o={}, -u=!1,c=a(function(l,d,b){var C=r.substring(d,b);Object.hasOwnProperty.call(m.env, -"PGPASS_NO_DEESCAPE")||(C=C.replace(/\\([:\\])/g,"$1")),o[ke[l]]=C},"addToObj"), -h=0;h=0&&e==":"&&t!=="\\"&&(c(n,i,h+1),i=h+2,n+=1)}return o=Object.keys(o).length=== -fr?o:null,o},Iu=fe.exports.isValidEntry=function(r){for(var e={0:function(o){return o. +u=!1,c=a(function(h,p,S){var _=r.substring(p,S);Object.hasOwnProperty.call(m.env, +"PGPASS_NO_DEESCAPE")||(_=_.replace(/\\([:\\])/g,"$1")),o[Oe[h]]=_},"addToObj"), +l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o).length=== +hr?o:null,o},Pu=fe.exports.isValidEntry=function(r){for(var e={0:function(o){return o. length>0},1:function(o){return o==="*"?!0:(o=Number(o),isFinite(o)&&o>0&&o<9007199254740992&& Math.floor(o)===o)},2:function(o){return o.length>0},3:function(o){return o.length> -0},4:function(o){return o.length>0}},t=0;t{"use strict";p();var ml=(sr(),O(ir)),Ji=(ar(),O(or)),mt=Zi(); -dr.exports=function(r,e){var t=mt.getFileName();Ji.stat(t,function(n,i){if(n||!mt. -usePgPass(i,t))return e(void 0);var s=Ji.createReadStream(t);mt.getPassword(r,s, -e)})};dr.exports.warnTo=mt.warnTo});var wt=I((bl,es)=>{"use strict";p();var Pu=Xe();function gt(r){this._types=r||Pu, -this.text={},this.binary={}}a(gt,"TypeOverrides");gt.prototype.getOverrides=function(r){ +0},4:function(o){return o.length>0}},t=0;t{"use strict";d();var wh=(ir(),U(nr)),Xi=(or(),U(sr)),yt=Ji(); +dr.exports=function(r,e){var t=yt.getFileName();Xi.stat(t,function(n,i){if(n||!yt. +usePgPass(i,t))return e(void 0);var s=Xi.createReadStream(t);yt.getPassword(r,s, +e)})};dr.exports.warnTo=yt.warnTo});var gt=I((xh,ts)=>{"use strict";d();var Fu=Je();function mt(r){this._types=r||Fu, +this.text={},this.binary={}}a(mt,"TypeOverrides");mt.prototype.getOverrides=function(r){ switch(r){case"text":return this.text;case"binary":return this.binary;default:return{}}}; -gt.prototype.setTypeParser=function(r,e,t){typeof e=="function"&&(t=e,e="text"), -this.getOverrides(e)[r]=t};gt.prototype.getTypeParser=function(r,e){return e=e|| -"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};es.exports=gt});var ts={};se(ts,{default:()=>Bu});var Bu,rs=z(()=>{"use strict";p();Bu={}});var ns={};se(ns,{parse:()=>yr});function yr(r,e=!1){let{protocol:t}=new URL(r),n="\ -http:"+r.substring(t.length),{username:i,password:s,host:o,hostname:u,port:c,pathname:h, -search:l,searchParams:d,hash:b}=new URL(n);s=decodeURIComponent(s),i=decodeURIComponent( -i),h=decodeURIComponent(h);let C=i+":"+s,B=e?Object.fromEntries(d.entries()):l;return{ -href:r,protocol:t,auth:C,username:i,password:s,host:o,hostname:u,port:c,pathname:h, -search:l,query:B,hash:b}}var mr=z(()=>{"use strict";p();a(yr,"parse")});var ss=I((Al,is)=>{"use strict";p();var Lu=(mr(),O(ns)),gr=(ar(),O(or));function wr(r){ -if(r.charAt(0)==="/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Lu. +mt.prototype.setTypeParser=function(r,e,t){typeof e=="function"&&(t=e,e="text"), +this.getOverrides(e)[r]=t};mt.prototype.getTypeParser=function(r,e){return e=e|| +"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};ts.exports=mt});var rs={};ie(rs,{default:()=>Lu});var Lu,ns=z(()=>{"use strict";d();Lu={}});var is={};ie(is,{parse:()=>pr});function pr(r,e=!1){let{protocol:t}=new URL(r),n="\ +http:"+r.substring(t.length),{username:i,password:s,host:o,hostname:u,port:c,pathname:l, +search:h,searchParams:p,hash:S}=new URL(n);s=decodeURIComponent(s),i=decodeURIComponent( +i),l=decodeURIComponent(l);let _=i+":"+s,P=e?Object.fromEntries(p.entries()):h;return{ +href:r,protocol:t,auth:_,username:i,password:s,host:o,hostname:u,port:c,pathname:l, +search:h,query:P,hash:S}}var yr=z(()=>{"use strict";d();a(pr,"parse")});var os=I((Th,ss)=>{"use strict";d();var Bu=(yr(),U(is)),mr=(or(),U(sr));function gr(r){ +if(r.charAt(0)==="/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Bu. parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(r)?encodeURI(r).replace(/\%25(\d\d)/g, "%$1"):r,!0),t=e.query;for(var n in t)Array.isArray(t[n])&&(t[n]=t[n][t[n].length- 1]);var i=(e.auth||":").split(":");if(t.user=i[0],t.password=i.splice(1).join(":"), @@ -854,23 +858,23 @@ pathname;if(!t.host&&s&&/^%2f/i.test(s)){var o=s.split("/");t.host=decodeURIComp o[0]),s=o.splice(1).join("/")}switch(s&&s.charAt(0)==="/"&&(s=s.slice(1)||null), t.database=s&&decodeURI(s),(t.ssl==="true"||t.ssl==="1")&&(t.ssl=!0),t.ssl==="0"&& (t.ssl=!1),(t.sslcert||t.sslkey||t.sslrootcert||t.sslmode)&&(t.ssl={}),t.sslcert&& -(t.ssl.cert=gr.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=gr.readFileSync( -t.sslkey).toString()),t.sslrootcert&&(t.ssl.ca=gr.readFileSync(t.sslrootcert).toString()), +(t.ssl.cert=mr.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=mr.readFileSync( +t.sslkey).toString()),t.sslrootcert&&(t.ssl.ca=mr.readFileSync(t.sslrootcert).toString()), t.sslmode){case"disable":{t.ssl=!1;break}case"prefer":case"require":case"verify-\ ca":case"verify-full":break;case"no-verify":{t.ssl.rejectUnauthorized=!1;break}} -return t}a(wr,"parse");is.exports=wr;wr.parse=wr});var bt=I((Il,us)=>{"use strict";p();var Ru=(rs(),O(ts)),as=et(),os=ss().parse,V=a( +return t}a(gr,"parse");ss.exports=gr;gr.parse=gr});var wt=I((Ph,cs)=>{"use strict";d();var Mu=(ns(),U(rs)),us=Xe(),as=os().parse,V=a( function(r,e,t){return t===void 0?t=m.env["PG"+r.toUpperCase()]:t===!1||(t=m.env[t]), -e[r]||t||as[r]},"val"),Fu=a(function(){switch(m.env.PGSSLMODE){case"disable":return!1;case"\ +e[r]||t||us[r]},"val"),ku=a(function(){switch(m.env.PGSSLMODE){case"disable":return!1;case"\ prefer":case"require":case"verify-ca":case"verify-full":return!0;case"no-verify": -return{rejectUnauthorized:!1}}return as.ssl},"readSSLConfigFromEnvironment"),Ue=a( +return{rejectUnauthorized:!1}}return us.ssl},"readSSLConfigFromEnvironment"),Qe=a( function(r){return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quo\ -teParamValue"),ie=a(function(r,e,t){var n=e[t];n!=null&&r.push(t+"="+Ue(n))},"ad\ -d"),Sr=class Sr{constructor(e){e=typeof e=="string"?os(e):e||{},e.connectionString&& -(e=Object.assign({},e,os(e.connectionString))),this.user=V("user",e),this.database= +teParamValue"),ne=a(function(r,e,t){var n=e[t];n!=null&&r.push(t+"="+Qe(n))},"ad\ +d"),br=class br{constructor(e){e=typeof e=="string"?as(e):e||{},e.connectionString&& +(e=Object.assign({},e,as(e.connectionString))),this.user=V("user",e),this.database= V("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt( V("port",e),10),this.host=V("host",e),Object.defineProperty(this,"password",{configurable:!0, enumerable:!1,writable:!0,value:V("password",e)}),this.binary=V("binary",e),this. -options=V("options",e),this.ssl=typeof e.ssl>"u"?Fu():e.ssl,typeof this.ssl=="st\ +options=V("options",e),this.ssl=typeof e.ssl>"u"?ku():e.ssl,typeof this.ssl=="st\ ring"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="no-verify"&&(this.ssl={rejectUnauthorized:!1}), this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this. client_encoding=V("client_encoding",e),this.replication=V("replication",e),this. @@ -883,20 +887,20 @@ void 0?this.connect_timeout=m.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math floor(e.connectionTimeoutMillis/1e3),e.keepAlive===!1?this.keepalives=0:e.keepAlive=== !0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis=="number"&&(this.keepalives_idle= Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){var t=[]; -ie(t,this,"user"),ie(t,this,"password"),ie(t,this,"port"),ie(t,this,"application\ -_name"),ie(t,this,"fallback_application_name"),ie(t,this,"connect_timeout"),ie(t, +ne(t,this,"user"),ne(t,this,"password"),ne(t,this,"port"),ne(t,this,"application\ +_name"),ne(t,this,"fallback_application_name"),ne(t,this,"connect_timeout"),ne(t, this,"options");var n=typeof this.ssl=="object"?this.ssl:this.ssl?{sslmode:this. -ssl}:{};if(ie(t,n,"sslmode"),ie(t,n,"sslca"),ie(t,n,"sslkey"),ie(t,n,"sslcert"), -ie(t,n,"sslrootcert"),this.database&&t.push("dbname="+Ue(this.database)),this.replication&& -t.push("replication="+Ue(this.replication)),this.host&&t.push("host="+Ue(this.host)), +ssl}:{};if(ne(t,n,"sslmode"),ne(t,n,"sslca"),ne(t,n,"sslkey"),ne(t,n,"sslcert"), +ne(t,n,"sslrootcert"),this.database&&t.push("dbname="+Qe(this.database)),this.replication&& +t.push("replication="+Qe(this.replication)),this.host&&t.push("host="+Qe(this.host)), this.isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("cli\ -ent_encoding="+Ue(this.client_encoding)),Ru.lookup(this.host,function(i,s){return i? -e(i,null):(t.push("hostaddr="+Ue(s)),e(null,t.join(" ")))})}};a(Sr,"ConnectionPa\ -rameters");var br=Sr;us.exports=br});var ls=I((Ll,hs)=>{"use strict";p();var Mu=Xe(),cs=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/, -Er=class Er{constructor(e,t){this.command=null,this.rowCount=null,this.oid=null, +ent_encoding="+Qe(this.client_encoding)),Mu.lookup(this.host,function(i,s){return i? +e(i,null):(t.push("hostaddr="+Qe(s)),e(null,t.join(" ")))})}};a(br,"ConnectionPa\ +rameters");var wr=br;cs.exports=wr});var fs=I((Bh,hs)=>{"use strict";d();var Ou=Je(),ls=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/, +xr=class xr{constructor(e,t){this.command=null,this.rowCount=null,this.oid=null, this.rows=[],this.fields=[],this._parsers=void 0,this._types=t,this.RowCtor=null, this.rowAsArray=e==="array",this.rowAsArray&&(this.parseRow=this._parseRowAsArray)}addCommandComplete(e){ -var t;e.text?t=cs.exec(e.text):t=cs.exec(e.command),t&&(this.command=t[1],t[3]?(this. +var t;e.text?t=ls.exec(e.text):t=ls.exec(e.command),t&&(this.command=t[1],t[3]?(this. oid=parseInt(t[2],10),this.rowCount=parseInt(t[3],10)):t[2]&&(this.rowCount=parseInt( t[2],10)))}_parseRowAsArray(e){for(var t=new Array(e.length),n=0,i=e.length;n{"use strict";p();var{EventEmitter:Du}=ge(),fs=ls(),ps=tt(),_r=class _r extends Du{constructor(e,t,n){ +ext"):this._parsers[t]=Ou.getTypeParser(n.dataTypeID,n.format||"text")}}};a(xr,"\ +Result");var Sr=xr;hs.exports=Sr});var ms=I((Oh,ys)=>{"use strict";d();var{EventEmitter:Qu}=we(),ds=fs(),ps=et(),Er=class Er extends Qu{constructor(e,t,n){ super(),e=ps.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this. rows=e.rows,this.types=e.types,this.name=e.name,this.binary=e.binary,this.portal= e.portal||"",this.callback=e.callback,this._rowMode=e.rowMode,m.domain&&e.callback&& -(this.callback=m.domain.bind(e.callback)),this._result=new fs(this._rowMode,this. +(this.callback=m.domain.bind(e.callback)),this._result=new ds(this._rowMode,this. types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError= !1,this._promise=null}requiresPreparation(){return this.name||this.rows?!0:!this. text||!this.values?!1:this.values.length>0}_checkForMultirow(){this._result.command&& -(Array.isArray(this._results)||(this._results=[this._result]),this._result=new fs( +(Array.isArray(this._results)||(this._results=[this._result]),this._result=new ds( this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){ this._checkForMultirow(),this._result.addFields(e.fields),this._accumulateRows=this. callback||!this.listeners("row").length}handleDataRow(e){let t;if(!this._canceledDueToError){ @@ -937,89 +941,89 @@ name]}handlePortalSuspended(e){this._getRows(e,this.rows)}_getRows(e,t){e.execut try{e.bind({portal:this.portal,statement:this.name,values:this.values,binary:this. binary,valueMapper:ps.prepareValue})}catch(t){this.handleError(t,e);return}e.describe( {type:"P",name:this.portal||""}),this._getRows(e,this.rows)}handleCopyInResponse(e){ -e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(_r,"Query"); -var vr=_r;ds.exports=vr});var ws={};se(ws,{Socket:()=>_e,isIP:()=>ku});function ku(r){return 0}var gs,ms,v, -_e,St=z(()=>{"use strict";p();gs=Te(ge(),1);a(ku,"isIP");ms=/^[^.]+\./,v=class v extends gs.EventEmitter{constructor(){ -super(...arguments);_(this,"opts",{});_(this,"connecting",!1);_(this,"pending",!0); -_(this,"writable",!0);_(this,"encrypted",!1);_(this,"authorized",!1);_(this,"des\ -troyed",!1);_(this,"ws",null);_(this,"writeBuffer");_(this,"tlsState",0);_(this, -"tlsRead");_(this,"tlsWrite")}static get poolQueryViaFetch(){return v.opts.poolQueryViaFetch?? -v.defaults.poolQueryViaFetch}static set poolQueryViaFetch(t){v.opts.poolQueryViaFetch= -t}static get fetchEndpoint(){return v.opts.fetchEndpoint??v.defaults.fetchEndpoint}static set fetchEndpoint(t){ -v.opts.fetchEndpoint=t}static get fetchConnectionCache(){return!0}static set fetchConnectionCache(t){ +e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(Er,"Query"); +var vr=Er;ys.exports=vr});var bs={};ie(bs,{Socket:()=>_e,isIP:()=>Du});function Du(r){return 0}var ws,gs,E, +_e,bt=z(()=>{"use strict";d();ws=Te(we(),1);a(Du,"isIP");gs=/^[^.]+\./,E=class E extends ws.EventEmitter{constructor(){ +super(...arguments);A(this,"opts",{});A(this,"connecting",!1);A(this,"pending",!0); +A(this,"writable",!0);A(this,"encrypted",!1);A(this,"authorized",!1);A(this,"des\ +troyed",!1);A(this,"ws",null);A(this,"writeBuffer");A(this,"tlsState",0);A(this, +"tlsRead");A(this,"tlsWrite")}static get poolQueryViaFetch(){return E.opts.poolQueryViaFetch?? +E.defaults.poolQueryViaFetch}static set poolQueryViaFetch(t){E.opts.poolQueryViaFetch= +t}static get fetchEndpoint(){return E.opts.fetchEndpoint??E.defaults.fetchEndpoint}static set fetchEndpoint(t){ +E.opts.fetchEndpoint=t}static get fetchConnectionCache(){return!0}static set fetchConnectionCache(t){ console.warn("The `fetchConnectionCache` option is deprecated (now always `true`\ -)")}static get fetchFunction(){return v.opts.fetchFunction??v.defaults.fetchFunction}static set fetchFunction(t){ -v.opts.fetchFunction=t}static get webSocketConstructor(){return v.opts.webSocketConstructor?? -v.defaults.webSocketConstructor}static set webSocketConstructor(t){v.opts.webSocketConstructor= -t}get webSocketConstructor(){return this.opts.webSocketConstructor??v.webSocketConstructor}set webSocketConstructor(t){ -this.opts.webSocketConstructor=t}static get wsProxy(){return v.opts.wsProxy??v.defaults. -wsProxy}static set wsProxy(t){v.opts.wsProxy=t}get wsProxy(){return this.opts.wsProxy?? -v.wsProxy}set wsProxy(t){this.opts.wsProxy=t}static get coalesceWrites(){return v. -opts.coalesceWrites??v.defaults.coalesceWrites}static set coalesceWrites(t){v.opts. -coalesceWrites=t}get coalesceWrites(){return this.opts.coalesceWrites??v.coalesceWrites}set coalesceWrites(t){ -this.opts.coalesceWrites=t}static get useSecureWebSocket(){return v.opts.useSecureWebSocket?? -v.defaults.useSecureWebSocket}static set useSecureWebSocket(t){v.opts.useSecureWebSocket= -t}get useSecureWebSocket(){return this.opts.useSecureWebSocket??v.useSecureWebSocket}set useSecureWebSocket(t){ -this.opts.useSecureWebSocket=t}static get forceDisablePgSSL(){return v.opts.forceDisablePgSSL?? -v.defaults.forceDisablePgSSL}static set forceDisablePgSSL(t){v.opts.forceDisablePgSSL= -t}get forceDisablePgSSL(){return this.opts.forceDisablePgSSL??v.forceDisablePgSSL}set forceDisablePgSSL(t){ -this.opts.forceDisablePgSSL=t}static get disableSNI(){return v.opts.disableSNI?? -v.defaults.disableSNI}static set disableSNI(t){v.opts.disableSNI=t}get disableSNI(){ -return this.opts.disableSNI??v.disableSNI}set disableSNI(t){this.opts.disableSNI= -t}static get pipelineConnect(){return v.opts.pipelineConnect??v.defaults.pipelineConnect}static set pipelineConnect(t){ -v.opts.pipelineConnect=t}get pipelineConnect(){return this.opts.pipelineConnect?? -v.pipelineConnect}set pipelineConnect(t){this.opts.pipelineConnect=t}static get subtls(){ -return v.opts.subtls??v.defaults.subtls}static set subtls(t){v.opts.subtls=t}get subtls(){ -return this.opts.subtls??v.subtls}set subtls(t){this.opts.subtls=t}static get pipelineTLS(){ -return v.opts.pipelineTLS??v.defaults.pipelineTLS}static set pipelineTLS(t){v.opts. -pipelineTLS=t}get pipelineTLS(){return this.opts.pipelineTLS??v.pipelineTLS}set pipelineTLS(t){ -this.opts.pipelineTLS=t}static get rootCerts(){return v.opts.rootCerts??v.defaults. -rootCerts}static set rootCerts(t){v.opts.rootCerts=t}get rootCerts(){return this. -opts.rootCerts??v.rootCerts}set rootCerts(t){this.opts.rootCerts=t}wsProxyAddrForHost(t,n){ +)")}static get fetchFunction(){return E.opts.fetchFunction??E.defaults.fetchFunction}static set fetchFunction(t){ +E.opts.fetchFunction=t}static get webSocketConstructor(){return E.opts.webSocketConstructor?? +E.defaults.webSocketConstructor}static set webSocketConstructor(t){E.opts.webSocketConstructor= +t}get webSocketConstructor(){return this.opts.webSocketConstructor??E.webSocketConstructor}set webSocketConstructor(t){ +this.opts.webSocketConstructor=t}static get wsProxy(){return E.opts.wsProxy??E.defaults. +wsProxy}static set wsProxy(t){E.opts.wsProxy=t}get wsProxy(){return this.opts.wsProxy?? +E.wsProxy}set wsProxy(t){this.opts.wsProxy=t}static get coalesceWrites(){return E. +opts.coalesceWrites??E.defaults.coalesceWrites}static set coalesceWrites(t){E.opts. +coalesceWrites=t}get coalesceWrites(){return this.opts.coalesceWrites??E.coalesceWrites}set coalesceWrites(t){ +this.opts.coalesceWrites=t}static get useSecureWebSocket(){return E.opts.useSecureWebSocket?? +E.defaults.useSecureWebSocket}static set useSecureWebSocket(t){E.opts.useSecureWebSocket= +t}get useSecureWebSocket(){return this.opts.useSecureWebSocket??E.useSecureWebSocket}set useSecureWebSocket(t){ +this.opts.useSecureWebSocket=t}static get forceDisablePgSSL(){return E.opts.forceDisablePgSSL?? +E.defaults.forceDisablePgSSL}static set forceDisablePgSSL(t){E.opts.forceDisablePgSSL= +t}get forceDisablePgSSL(){return this.opts.forceDisablePgSSL??E.forceDisablePgSSL}set forceDisablePgSSL(t){ +this.opts.forceDisablePgSSL=t}static get disableSNI(){return E.opts.disableSNI?? +E.defaults.disableSNI}static set disableSNI(t){E.opts.disableSNI=t}get disableSNI(){ +return this.opts.disableSNI??E.disableSNI}set disableSNI(t){this.opts.disableSNI= +t}static get pipelineConnect(){return E.opts.pipelineConnect??E.defaults.pipelineConnect}static set pipelineConnect(t){ +E.opts.pipelineConnect=t}get pipelineConnect(){return this.opts.pipelineConnect?? +E.pipelineConnect}set pipelineConnect(t){this.opts.pipelineConnect=t}static get subtls(){ +return E.opts.subtls??E.defaults.subtls}static set subtls(t){E.opts.subtls=t}get subtls(){ +return this.opts.subtls??E.subtls}set subtls(t){this.opts.subtls=t}static get pipelineTLS(){ +return E.opts.pipelineTLS??E.defaults.pipelineTLS}static set pipelineTLS(t){E.opts. +pipelineTLS=t}get pipelineTLS(){return this.opts.pipelineTLS??E.pipelineTLS}set pipelineTLS(t){ +this.opts.pipelineTLS=t}static get rootCerts(){return E.opts.rootCerts??E.defaults. +rootCerts}static set rootCerts(t){E.opts.rootCerts=t}get rootCerts(){return this. +opts.rootCerts??E.rootCerts}set rootCerts(t){this.opts.rootCerts=t}wsProxyAddrForHost(t,n){ let i=this.wsProxy;if(i===void 0)throw new Error("No WebSocket proxy is configur\ ed. Please see https://github.com/neondatabase/serverless/blob/main/CONFIG.md#ws\ proxy-string--host-string-port-number--string--string");return typeof i=="functi\ on"?i(t,n):`${i}?address=${t}:${n}`}setNoDelay(){return this}setKeepAlive(){return this}ref(){ return this}unref(){return this}connect(t,n,i){this.connecting=!0,i&&this.once("\ connect",i);let s=a(()=>{this.connecting=!1,this.pending=!1,this.emit("connect"), -this.emit("ready")},"handleWebSocketOpen"),o=a((c,h=!1)=>{c.binaryType="arraybuf\ -fer",c.addEventListener("error",l=>{this.emit("error",l),this.emit("close")}),c. -addEventListener("message",l=>{if(this.tlsState===0){let d=y.from(l.data);this.emit( -"data",d)}}),c.addEventListener("close",()=>{this.emit("close")}),h?s():c.addEventListener( +this.emit("ready")},"handleWebSocketOpen"),o=a((c,l=!1)=>{c.binaryType="arraybuf\ +fer",c.addEventListener("error",h=>{this.emit("error",h),this.emit("close")}),c. +addEventListener("message",h=>{if(this.tlsState===0){let p=y.from(h.data);this.emit( +"data",p)}}),c.addEventListener("close",()=>{this.emit("close")}),l?s():c.addEventListener( "open",s)},"configureWebSocket"),u;try{u=this.wsProxyAddrForHost(n,typeof t=="st\ ring"?parseInt(t,10):t)}catch(c){this.emit("error",c),this.emit("close");return} -try{let h=(this.useSecureWebSocket?"wss:":"ws:")+"//"+u;if(this.webSocketConstructor!== -void 0)this.ws=new this.webSocketConstructor(h),o(this.ws);else try{this.ws=new WebSocket( -h),o(this.ws)}catch{this.ws=new __unstable_WebSocket(h),o(this.ws)}}catch(c){let l=(this. -useSecureWebSocket?"https:":"http:")+"//"+u;fetch(l,{headers:{Upgrade:"websocket"}}). -then(d=>{if(this.ws=d.webSocket,this.ws==null)throw c;this.ws.accept(),o(this.ws, -!0)}).catch(d=>{this.emit("error",new Error(`All attempts to open a WebSocket to\ +try{let l=(this.useSecureWebSocket?"wss:":"ws:")+"//"+u;if(this.webSocketConstructor!== +void 0)this.ws=new this.webSocketConstructor(l),o(this.ws);else try{this.ws=new WebSocket( +l),o(this.ws)}catch{this.ws=new __unstable_WebSocket(l),o(this.ws)}}catch(c){let h=(this. +useSecureWebSocket?"https:":"http:")+"//"+u;fetch(h,{headers:{Upgrade:"websocket"}}). +then(p=>{if(this.ws=p.webSocket,this.ws==null)throw c;this.ws.accept(),o(this.ws, +!0)}).catch(p=>{this.emit("error",new Error(`All attempts to open a WebSocket to\ connect to the database failed. Please refer to https://github.com/neondatabase\ /serverless/blob/main/CONFIG.md#websocketconstructor-typeof-websocket--undefined\ -. Details: ${d.message}`)),this.emit("close")})}}async startTls(t){if(this.subtls=== -void 0)throw new Error("For Postgres SSL connections, you must set `neonConfig.s\ -ubtls` to the subtls library. See https://github.com/neondatabase/serverless/blo\ -b/main/CONFIG.md for more information.");this.tlsState=1;let n=this.subtls.TrustedCert. -fromPEM(this.rootCerts),i=new this.subtls.WebSocketReadQueue(this.ws),s=i.read.bind( -i),o=this.rawWrite.bind(this),[u,c]=await this.subtls.startTls(t,n,s,o,{useSNI:!this. -disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0});this.tlsRead= -u,this.tlsWrite=c,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit( -"secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){for(;;){let t=await this. -tlsRead();if(t===void 0)break;{let n=y.from(t);this.emit("data",n)}}}rawWrite(t){ -if(!this.coalesceWrites){this.ws.send(t);return}if(this.writeBuffer===void 0)this. -writeBuffer=t,setTimeout(()=>{this.ws.send(this.writeBuffer),this.writeBuffer=void 0}, -0);else{let n=new Uint8Array(this.writeBuffer.length+t.length);n.set(this.writeBuffer), -n.set(t,this.writeBuffer.length),this.writeBuffer=n}}write(t,n="utf8",i=s=>{}){return t. -length===0?(i(),!0):(typeof t=="string"&&(t=y.from(t,n)),this.tlsState===0?(this. -rawWrite(t),i()):this.tlsState===1?this.once("secureConnection",()=>{this.write( -t,n,i)}):(this.tlsWrite(t),i()),!0)}end(t=y.alloc(0),n="utf8",i=()=>{}){return this. -write(t,n,()=>{this.ws.close(),i()}),this}destroy(){return this.destroyed=!0,this. -end()}};a(v,"Socket"),_(v,"defaults",{poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{ -let s;return i?.jwtAuth?s=t.replace(ms,"apiauth."):s=t.replace(ms,"api."),"https\ -://"+s+"/sql"},"fetchEndpoint"),fetchConnectionCache:!0,fetchFunction:void 0,webSocketConstructor:void 0, -wsProxy:a(t=>t+"/v2","wsProxy"),useSecureWebSocket:!0,forceDisablePgSSL:!0,coalesceWrites:!0, -pipelineConnect:"password",subtls:void 0,rootCerts:"",pipelineTLS:!1,disableSNI:!1}), -_(v,"opts",{});_e=v});var Xr=I(T=>{"use strict";p();Object.defineProperty(T,"__esModule",{value:!0});T. +. Details: ${p}`)),this.emit("close")})}}async startTls(t){if(this.subtls===void 0) +throw new Error("For Postgres SSL connections, you must set `neonConfig.subtls` \ +to the subtls library. See https://github.com/neondatabase/serverless/blob/main/\ +CONFIG.md for more information.");this.tlsState=1;let n=this.subtls.TrustedCert. +databaseFromPEM(this.rootCerts),i=new this.subtls.WebSocketReadQueue(this.ws),s=i. +read.bind(i),o=this.rawWrite.bind(this),[u,c]=await this.subtls.startTls(t,n,s,o, +{useSNI:!this.disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0}); +this.tlsRead=u,this.tlsWrite=c,this.tlsState=2,this.encrypted=!0,this.authorized= +!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){for(;;){ +let t=await this.tlsRead();if(t===void 0)break;{let n=y.from(t);this.emit("data", +n)}}}rawWrite(t){if(!this.coalesceWrites){this.ws.send(t);return}if(this.writeBuffer=== +void 0)this.writeBuffer=t,setTimeout(()=>{this.ws.send(this.writeBuffer),this.writeBuffer= +void 0},0);else{let n=new Uint8Array(this.writeBuffer.length+t.length);n.set(this. +writeBuffer),n.set(t,this.writeBuffer.length),this.writeBuffer=n}}write(t,n="utf\ +8",i=s=>{}){return t.length===0?(i(),!0):(typeof t=="string"&&(t=y.from(t,n)),this. +tlsState===0?(this.rawWrite(t),i()):this.tlsState===1?this.once("secureConnectio\ +n",()=>{this.write(t,n,i)}):(this.tlsWrite(t),i()),!0)}end(t=y.alloc(0),n="utf8",i=()=>{}){ +return this.write(t,n,()=>{this.ws.close(),i()}),this}destroy(){return this.destroyed= +!0,this.end()}};a(E,"Socket"),A(E,"defaults",{poolQueryViaFetch:!1,fetchEndpoint:a( +(t,n,i)=>{let s;return i?.jwtAuth?s=t.replace(gs,"apiauth."):s=t.replace(gs,"api\ +."),"https://"+s+"/sql"},"fetchEndpoint"),fetchConnectionCache:!0,fetchFunction:void 0, +webSocketConstructor:void 0,wsProxy:a(t=>t+"/v2","wsProxy"),useSecureWebSocket:!0, +forceDisablePgSSL:!0,coalesceWrites:!0,pipelineConnect:"password",subtls:void 0, +rootCerts:"",pipelineTLS:!1,disableSNI:!1}),A(E,"opts",{});_e=E});var Jr=I(T=>{"use strict";d();Object.defineProperty(T,"__esModule",{value:!0});T. NoticeMessage=T.DataRowMessage=T.CommandCompleteMessage=T.ReadyForQueryMessage=T. NotificationResponseMessage=T.BackendKeyDataMessage=T.AuthenticationMD5Password= T.ParameterStatusMessage=T.ParameterDescriptionMessage=T.RowDescriptionMessage=T. @@ -1029,36 +1033,36 @@ void 0;T.parseComplete={name:"parseComplete",length:5};T.bindComplete={name:"bin dComplete",length:5};T.closeComplete={name:"closeComplete",length:5};T.noData={name:"\ noData",length:5};T.portalSuspended={name:"portalSuspended",length:5};T.replicationStart= {name:"replicationStart",length:4};T.emptyQuery={name:"emptyQuery",length:4};T.copyDone= -{name:"copyDone",length:4};var Nr=class Nr extends Error{constructor(e,t,n){super( -e),this.length=t,this.name=n}};a(Nr,"DatabaseError");var Ar=Nr;T.DatabaseError=Ar; -var qr=class qr{constructor(e,t){this.length=e,this.chunk=t,this.name="copyData"}}; -a(qr,"CopyDataMessage");var Cr=qr;T.CopyDataMessage=Cr;var Qr=class Qr{constructor(e,t,n,i){ -this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(Qr,"Co\ -pyResponse");var Tr=Qr;T.CopyResponse=Tr;var jr=class jr{constructor(e,t,n,i,s,o,u){ +{name:"copyDone",length:4};var Dr=class Dr extends Error{constructor(e,t,n){super( +e),this.length=t,this.name=n}};a(Dr,"DatabaseError");var Ar=Dr;T.DatabaseError=Ar; +var Ur=class Ur{constructor(e,t){this.length=e,this.chunk=t,this.name="copyData"}}; +a(Ur,"CopyDataMessage");var _r=Ur;T.CopyDataMessage=_r;var qr=class qr{constructor(e,t,n,i){ +this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(qr,"Co\ +pyResponse");var Cr=qr;T.CopyResponse=Cr;var Nr=class Nr{constructor(e,t,n,i,s,o,u){ this.name=e,this.tableID=t,this.columnID=n,this.dataTypeID=i,this.dataTypeSize=s, -this.dataTypeModifier=o,this.format=u}};a(jr,"Field");var Ir=jr;T.Field=Ir;var Wr=class Wr{constructor(e,t){ +this.dataTypeModifier=o,this.format=u}};a(Nr,"Field");var Tr=Nr;T.Field=Tr;var Wr=class Wr{constructor(e,t){ this.length=e,this.fieldCount=t,this.name="rowDescription",this.fields=new Array( -this.fieldCount)}};a(Wr,"RowDescriptionMessage");var Pr=Wr;T.RowDescriptionMessage= -Pr;var Hr=class Hr{constructor(e,t){this.length=e,this.parameterCount=t,this.name= -"parameterDescription",this.dataTypeIDs=new Array(this.parameterCount)}};a(Hr,"P\ -arameterDescriptionMessage");var Br=Hr;T.ParameterDescriptionMessage=Br;var Gr=class Gr{constructor(e,t,n){ +this.fieldCount)}};a(Wr,"RowDescriptionMessage");var Ir=Wr;T.RowDescriptionMessage= +Ir;var jr=class jr{constructor(e,t){this.length=e,this.parameterCount=t,this.name= +"parameterDescription",this.dataTypeIDs=new Array(this.parameterCount)}};a(jr,"P\ +arameterDescriptionMessage");var Rr=jr;T.ParameterDescriptionMessage=Rr;var Hr=class Hr{constructor(e,t,n){ this.length=e,this.parameterName=t,this.parameterValue=n,this.name="parameterSta\ -tus"}};a(Gr,"ParameterStatusMessage");var Lr=Gr;T.ParameterStatusMessage=Lr;var $r=class $r{constructor(e,t){ -this.length=e,this.salt=t,this.name="authenticationMD5Password"}};a($r,"Authenti\ -cationMD5Password");var Rr=$r;T.AuthenticationMD5Password=Rr;var Vr=class Vr{constructor(e,t,n){ -this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Vr, -"BackendKeyDataMessage");var Fr=Vr;T.BackendKeyDataMessage=Fr;var Kr=class Kr{constructor(e,t,n,i){ +tus"}};a(Hr,"ParameterStatusMessage");var Pr=Hr;T.ParameterStatusMessage=Pr;var Gr=class Gr{constructor(e,t){ +this.length=e,this.salt=t,this.name="authenticationMD5Password"}};a(Gr,"Authenti\ +cationMD5Password");var Fr=Gr;T.AuthenticationMD5Password=Fr;var $r=class $r{constructor(e,t,n){ +this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a($r, +"BackendKeyDataMessage");var Lr=$r;T.BackendKeyDataMessage=Lr;var Vr=class Vr{constructor(e,t,n,i){ this.length=e,this.processId=t,this.channel=n,this.payload=i,this.name="notifica\ -tion"}};a(Kr,"NotificationResponseMessage");var Mr=Kr;T.NotificationResponseMessage= -Mr;var zr=class zr{constructor(e,t){this.length=e,this.status=t,this.name="ready\ -ForQuery"}};a(zr,"ReadyForQueryMessage");var Dr=zr;T.ReadyForQueryMessage=Dr;var Yr=class Yr{constructor(e,t){ -this.length=e,this.text=t,this.name="commandComplete"}};a(Yr,"CommandCompleteMes\ -sage");var kr=Yr;T.CommandCompleteMessage=kr;var Zr=class Zr{constructor(e,t){this. -length=e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(Zr,"Data\ -RowMessage");var Ur=Zr;T.DataRowMessage=Ur;var Jr=class Jr{constructor(e,t){this. -length=e,this.message=t,this.name="notice"}};a(Jr,"NoticeMessage");var Or=Jr;T.NoticeMessage= -Or});var bs=I(xt=>{"use strict";p();Object.defineProperty(xt,"__esModule",{value:!0}); -xt.Writer=void 0;var tn=class tn{constructor(e=256){this.size=e,this.offset=5,this. +tion"}};a(Vr,"NotificationResponseMessage");var Br=Vr;T.NotificationResponseMessage= +Br;var Kr=class Kr{constructor(e,t){this.length=e,this.status=t,this.name="ready\ +ForQuery"}};a(Kr,"ReadyForQueryMessage");var Mr=Kr;T.ReadyForQueryMessage=Mr;var zr=class zr{constructor(e,t){ +this.length=e,this.text=t,this.name="commandComplete"}};a(zr,"CommandCompleteMes\ +sage");var kr=zr;T.CommandCompleteMessage=kr;var Yr=class Yr{constructor(e,t){this. +length=e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(Yr,"Data\ +RowMessage");var Or=Yr;T.DataRowMessage=Or;var Zr=class Zr{constructor(e,t){this. +length=e,this.message=t,this.name="notice"}};a(Zr,"NoticeMessage");var Qr=Zr;T.NoticeMessage= +Qr});var Ss=I(St=>{"use strict";d();Object.defineProperty(St,"__esModule",{value:!0}); +St.Writer=void 0;var en=class en{constructor(e=256){this.size=e,this.offset=5,this. headerPosition=0,this.buffer=y.allocUnsafe(e)}ensure(e){var t=this.buffer.length- this.offset;if(t>1)+e;this.buffer=y.allocUnsafe( i),n.copy(this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]= @@ -1072,59 +1076,59 @@ offset+=t,this}add(e){return this.ensure(e.length),e.copy(this.buffer,this.offse this.offset+=e.length,this}join(e){if(e){this.buffer[this.headerPosition]=e;let t=this. offset-(this.headerPosition+1);this.buffer.writeInt32BE(t,this.headerPosition+1)} return this.buffer.slice(e?0:5,this.offset)}flush(e){var t=this.join(e);return this. -offset=5,this.headerPosition=0,this.buffer=y.allocUnsafe(this.size),t}};a(tn,"Wr\ -iter");var en=tn;xt.Writer=en});var xs=I(vt=>{"use strict";p();Object.defineProperty(vt,"__esModule",{value:!0}); -vt.serialize=void 0;var rn=bs(),M=new rn.Writer,Uu=a(r=>{M.addInt16(3).addInt16( +offset=5,this.headerPosition=0,this.buffer=y.allocUnsafe(this.size),t}};a(en,"Wr\ +iter");var Xr=en;St.Writer=Xr});var vs=I(vt=>{"use strict";d();Object.defineProperty(vt,"__esModule",{value:!0}); +vt.serialize=void 0;var tn=Ss(),M=new tn.Writer,Uu=a(r=>{M.addInt16(3).addInt16( 0);for(let n of Object.keys(r))M.addCString(n).addCString(r[n]);M.addCString("cl\ -ient_encoding").addCString("UTF8");var e=M.addCString("").flush(),t=e.length+4;return new rn. -Writer().addInt32(t).add(e).flush()},"startup"),Ou=a(()=>{let r=y.allocUnsafe(8); +ient_encoding").addCString("UTF8");var e=M.addCString("").flush(),t=e.length+4;return new tn. +Writer().addInt32(t).add(e).flush()},"startup"),qu=a(()=>{let r=y.allocUnsafe(8); return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Nu=a(r=>M. -addCString(r).flush(112),"password"),qu=a(function(r,e){return M.addCString(r).addInt32( -y.byteLength(e)).addString(e),M.flush(112)},"sendSASLInitialResponseMessage"),Qu=a( -function(r){return M.addString(r).flush(112)},"sendSCRAMClientFinalMessage"),ju=a( -r=>M.addCString(r).flush(81),"query"),Ss=[],Wu=a(r=>{let e=r.name||"";e.length>63&& +addCString(r).flush(112),"password"),Wu=a(function(r,e){return M.addCString(r).addInt32( +y.byteLength(e)).addString(e),M.flush(112)},"sendSASLInitialResponseMessage"),ju=a( +function(r){return M.addString(r).flush(112)},"sendSCRAMClientFinalMessage"),Hu=a( +r=>M.addCString(r).flush(81),"query"),xs=[],Gu=a(r=>{let e=r.name||"";e.length>63&& (console.error("Warning! Postgres only supports 63 characters for query names."), console.error("You supplied %s (%s)",e,e.length),console.error("This can cause c\ -onflicts and silent errors executing queries"));let t=r.types||Ss;for(var n=t.length, +onflicts and silent errors executing queries"));let t=r.types||xs;for(var n=t.length, i=M.addCString(e).addCString(r.text).addInt16(n),s=0;s{let e=r.portal||"",t=r.statement|| -"",n=r.binary||!1,i=r.values||Ss,s=i.length;return M.addCString(e).addCString(t), -M.addInt16(s),Hu(i,r.valueMapper),M.addInt16(s),M.add(Oe.flush()),M.addInt16(n?1: -0),M.flush(66)},"bind"),$u=y.from([69,0,0,0,9,0,0,0,0,0]),Vu=a(r=>{if(!r||!r.portal&& -!r.rows)return $u;let e=r.portal||"",t=r.rows||0,n=y.byteLength(e),i=4+n+1+4,s=y. +flush(80)},"parse"),De=new tn.Writer,$u=a(function(r,e){for(let t=0;t{let e=r.portal||"",t=r.statement|| +"",n=r.binary||!1,i=r.values||xs,s=i.length;return M.addCString(e).addCString(t), +M.addInt16(s),$u(i,r.valueMapper),M.addInt16(s),M.add(De.flush()),M.addInt16(n?1: +0),M.flush(66)},"bind"),Ku=y.from([69,0,0,0,9,0,0,0,0,0]),zu=a(r=>{if(!r||!r.portal&& +!r.rows)return Ku;let e=r.portal||"",t=r.rows||0,n=y.byteLength(e),i=4+n+1+4,s=y. allocUnsafe(1+i);return s[0]=69,s.writeInt32BE(i,1),s.write(e,5,"utf-8"),s[n+5]= -0,s.writeUInt32BE(t,s.length-4),s},"execute"),Ku=a((r,e)=>{let t=y.allocUnsafe(16); +0,s.writeUInt32BE(t,s.length-4),s},"execute"),Yu=a((r,e)=>{let t=y.allocUnsafe(16); return t.writeInt32BE(16,0),t.writeInt16BE(1234,4),t.writeInt16BE(5678,6),t.writeInt32BE( -r,8),t.writeInt32BE(e,12),t},"cancel"),nn=a((r,e)=>{let n=4+y.byteLength(e)+1,i=y. +r,8),t.writeInt32BE(e,12),t},"cancel"),rn=a((r,e)=>{let n=4+y.byteLength(e)+1,i=y. allocUnsafe(1+n);return i[0]=r,i.writeInt32BE(n,1),i.write(e,5,"utf-8"),i[n]=0,i}, -"cstringMessage"),zu=M.addCString("P").flush(68),Yu=M.addCString("S").flush(68), -Zu=a(r=>r.name?nn(68,`${r.type}${r.name||""}`):r.type==="P"?zu:Yu,"describe"),Ju=a( -r=>{let e=`${r.type}${r.name||""}`;return nn(67,e)},"close"),Xu=a(r=>M.add(r).flush( -100),"copyData"),ec=a(r=>nn(102,r),"copyFail"),Et=a(r=>y.from([r,0,0,0,4]),"code\ -OnlyBuffer"),tc=Et(72),rc=Et(83),nc=Et(88),ic=Et(99),sc={startup:Uu,password:Nu, -requestSsl:Ou,sendSASLInitialResponseMessage:qu,sendSCRAMClientFinalMessage:Qu,query:ju, -parse:Wu,bind:Gu,execute:Vu,describe:Zu,close:Ju,flush:a(()=>tc,"flush"),sync:a( -()=>rc,"sync"),end:a(()=>nc,"end"),copyData:Xu,copyDone:a(()=>ic,"copyDone"),copyFail:ec, -cancel:Ku};vt.serialize=sc});var Es=I(_t=>{"use strict";p();Object.defineProperty(_t,"__esModule",{value:!0}); -_t.BufferReader=void 0;var oc=y.allocUnsafe(0),on=class on{constructor(e=0){this. -offset=e,this.buffer=oc,this.encoding="utf-8"}setBuffer(e,t){this.offset=e,this. +"cstringMessage"),Zu=M.addCString("P").flush(68),Ju=M.addCString("S").flush(68), +Xu=a(r=>r.name?rn(68,`${r.type}${r.name||""}`):r.type==="P"?Zu:Ju,"describe"),ec=a( +r=>{let e=`${r.type}${r.name||""}`;return rn(67,e)},"close"),tc=a(r=>M.add(r).flush( +100),"copyData"),rc=a(r=>rn(102,r),"copyFail"),xt=a(r=>y.from([r,0,0,0,4]),"code\ +OnlyBuffer"),nc=xt(72),ic=xt(83),sc=xt(88),oc=xt(99),ac={startup:Uu,password:Nu, +requestSsl:qu,sendSASLInitialResponseMessage:Wu,sendSCRAMClientFinalMessage:ju,query:Hu, +parse:Gu,bind:Vu,execute:zu,describe:Xu,close:ec,flush:a(()=>nc,"flush"),sync:a( +()=>ic,"sync"),end:a(()=>sc,"end"),copyData:tc,copyDone:a(()=>oc,"copyDone"),copyFail:rc, +cancel:Yu};vt.serialize=ac});var Es=I(Et=>{"use strict";d();Object.defineProperty(Et,"__esModule",{value:!0}); +Et.BufferReader=void 0;var uc=y.allocUnsafe(0),sn=class sn{constructor(e=0){this. +offset=e,this.buffer=uc,this.encoding="utf-8"}setBuffer(e,t){this.offset=e,this. buffer=t}int16(){let e=this.buffer.readInt16BE(this.offset);return this.offset+= 2,e}byte(){let e=this.buffer[this.offset];return this.offset++,e}int32(){let e=this. buffer.readInt32BE(this.offset);return this.offset+=4,e}string(e){let t=this.buffer. toString(this.encoding,this.offset,this.offset+e);return this.offset+=e,t}cstring(){ let e=this.offset,t=e;for(;this.buffer[t++]!==0;);return this.offset=t,this.buffer. toString(this.encoding,e,t-1)}bytes(e){let t=this.buffer.slice(this.offset,this. -offset+e);return this.offset+=e,t}};a(on,"BufferReader");var sn=on;_t.BufferReader= -sn});var As=I(At=>{"use strict";p();Object.defineProperty(At,"__esModule",{value:!0}); -At.Parser=void 0;var D=Xr(),ac=Es(),an=1,uc=4,vs=an+uc,_s=y.allocUnsafe(0),cn=class cn{constructor(e){ -if(this.buffer=_s,this.bufferLength=0,this.bufferOffset=0,this.reader=new ac.BufferReader, +offset+e);return this.offset+=e,t}};a(sn,"BufferReader");var nn=sn;Et.BufferReader= +nn});var Cs=I(At=>{"use strict";d();Object.defineProperty(At,"__esModule",{value:!0}); +At.Parser=void 0;var k=Jr(),cc=Es(),on=1,lc=4,As=on+lc,_s=y.allocUnsafe(0),un=class un{constructor(e){ +if(this.buffer=_s,this.bufferLength=0,this.bufferOffset=0,this.reader=new cc.BufferReader, e?.mode==="binary")throw new Error("Binary mode not supported yet");this.mode=e?. mode||"text"}parse(e,t){this.mergeBuffer(e);let n=this.bufferOffset+this.bufferLength, -i=this.bufferOffset;for(;i+vs<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( -i+an),u=an+o;if(u+i<=n){let c=this.handlePacket(i+vs,s,o,this.buffer);t(c),i+=u}else +i=this.bufferOffset;for(;i+As<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( +i+on),u=on+o;if(u+i<=n){let c=this.handlePacket(i+As,s,o,this.buffer);t(c),i+=u}else break}i===n?(this.buffer=_s,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength= n-i,this.bufferOffset=i)}mergeBuffer(e){if(this.bufferLength>0){let t=this.bufferLength+ e.byteLength;if(t+this.bufferOffset>this.buffer.byteLength){let i;if(t<=this.buffer. @@ -1133,9 +1137,9 @@ byteLength*2;for(;t>=s;)s*=2;i=y.allocUnsafe(s)}this.buffer.copy(i,0,this.buffer this.bufferOffset+this.bufferLength),this.buffer=i,this.bufferOffset=0}e.copy(this. buffer,this.bufferOffset+this.bufferLength),this.bufferLength=t}else this.buffer= e,this.bufferOffset=0,this.bufferLength=e.byteLength}handlePacket(e,t,n,i){switch(t){case 50: -return D.bindComplete;case 49:return D.parseComplete;case 51:return D.closeComplete;case 110: -return D.noData;case 115:return D.portalSuspended;case 99:return D.copyDone;case 87: -return D.replicationStart;case 73:return D.emptyQuery;case 68:return this.parseDataRowMessage( +return k.bindComplete;case 49:return k.parseComplete;case 51:return k.closeComplete;case 110: +return k.noData;case 115:return k.portalSuspended;case 99:return k.copyDone;case 87: +return k.replicationStart;case 73:return k.emptyQuery;case 68:return this.parseDataRowMessage( e,n,i);case 67:return this.parseCommandCompleteMessage(e,n,i);case 90:return this. parseReadyForQueryMessage(e,n,i);case 65:return this.parseNotificationMessage(e, n,i);case 82:return this.parseAuthenticationResponse(e,n,i);case 83:return this. @@ -1144,54 +1148,54 @@ return this.parseErrorMessage(e,n,i,"error");case 78:return this.parseErrorMessa e,n,i,"notice");case 84:return this.parseRowDescriptionMessage(e,n,i);case 116:return this. parseParameterDescriptionMessage(e,n,i);case 71:return this.parseCopyInMessage(e, n,i);case 72:return this.parseCopyOutMessage(e,n,i);case 100:return this.parseCopyData( -e,n,i);default:return new D.DatabaseError("received invalid response: "+t.toString( +e,n,i);default:return new k.DatabaseError("received invalid response: "+t.toString( 16),n,"error")}}parseReadyForQueryMessage(e,t,n){this.reader.setBuffer(e,n);let i=this. -reader.string(1);return new D.ReadyForQueryMessage(t,i)}parseCommandCompleteMessage(e,t,n){ -this.reader.setBuffer(e,n);let i=this.reader.cstring();return new D.CommandCompleteMessage( -t,i)}parseCopyData(e,t,n){let i=n.slice(e,e+(t-4));return new D.CopyDataMessage( +reader.string(1);return new k.ReadyForQueryMessage(t,i)}parseCommandCompleteMessage(e,t,n){ +this.reader.setBuffer(e,n);let i=this.reader.cstring();return new k.CommandCompleteMessage( +t,i)}parseCopyData(e,t,n){let i=n.slice(e,e+(t-4));return new k.CopyDataMessage( t,i)}parseCopyInMessage(e,t,n){return this.parseCopyMessage(e,t,n,"copyInRespons\ e")}parseCopyOutMessage(e,t,n){return this.parseCopyMessage(e,t,n,"copyOutRespon\ se")}parseCopyMessage(e,t,n,i){this.reader.setBuffer(e,n);let s=this.reader.byte()!== -0,o=this.reader.int16(),u=new D.CopyResponse(t,i,s,o);for(let c=0;c{"use strict";p();Object.defineProperty(be,"__esModule",{value:!0}); -be.DatabaseError=be.serialize=be.parse=void 0;var cc=Xr();Object.defineProperty( -be,"DatabaseError",{enumerable:!0,get:a(function(){return cc.DatabaseError},"get")}); -var hc=xs();Object.defineProperty(be,"serialize",{enumerable:!0,get:a(function(){ -return hc.serialize},"get")});var lc=As();function fc(r,e){let t=new lc.Parser;return r. -on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(fc,"parse");be. -parse=fc});var Cs={};se(Cs,{connect:()=>pc});function pc({socket:r,servername:e}){return r. -startTls(e),r}var Ts=z(()=>{"use strict";p();a(pc,"connect")});var pn=I((of,Bs)=>{"use strict";p();var Is=(St(),O(ws)),dc=ge().EventEmitter,{parse:yc, -serialize:q}=hn(),Ps=q.flush(),mc=q.sync(),gc=q.end(),fn=class fn extends dc{constructor(e){ -super(),e=e||{},this.stream=e.stream||new Is.Socket,this._keepAlive=e.keepAlive, +line=s.L,c.routine=s.R,c}};a(un,"Parser");var an=un;At.Parser=an});var cn=I(Se=>{"use strict";d();Object.defineProperty(Se,"__esModule",{value:!0}); +Se.DatabaseError=Se.serialize=Se.parse=void 0;var hc=Jr();Object.defineProperty( +Se,"DatabaseError",{enumerable:!0,get:a(function(){return hc.DatabaseError},"get")}); +var fc=vs();Object.defineProperty(Se,"serialize",{enumerable:!0,get:a(function(){ +return fc.serialize},"get")});var dc=Cs();function pc(r,e){let t=new dc.Parser;return r. +on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(pc,"parse");Se. +parse=pc});var Ts={};ie(Ts,{connect:()=>yc});function yc({socket:r,servername:e}){return r. +startTls(e),r}var Is=z(()=>{"use strict";d();a(yc,"connect")});var fn=I((uf,Fs)=>{"use strict";d();var Rs=(bt(),U(bs)),mc=we().EventEmitter,{parse:gc, +serialize:N}=cn(),Ps=N.flush(),wc=N.sync(),bc=N.end(),hn=class hn extends mc{constructor(e){ +super(),e=e||{},this.stream=e.stream||new Rs.Socket,this._keepAlive=e.keepAlive, this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis,this.lastBuffer= !1,this.parsedStatements={},this.ssl=e.ssl||!1,this._ending=!1,this._emitMessage= !1;var t=this;this.on("newListener",function(n){n==="message"&&(t._emitMessage=!0)})}connect(e,t){ @@ -1204,36 +1208,36 @@ ssl)return this.attachListeners(this.stream);this.stream.once("data",function(s) var o=s.toString("utf8");switch(o){case"S":break;case"N":return n.stream.end(),n. emit("error",new Error("The server does not support SSL connections"));default:return n. stream.end(),n.emit("error",new Error("There was an error establishing an SSL co\ -nnection"))}var u=(Ts(),O(Cs));let c={socket:n.stream};n.ssl!==!0&&(Object.assign( -c,n.ssl),"key"in n.ssl&&(c.key=n.ssl.key)),Is.isIP(t)===0&&(c.servername=t);try{ -n.stream=u.connect(c)}catch(h){return n.emit("error",h)}n.attachListeners(n.stream), +nnection"))}var u=(Is(),U(Ts));let c={socket:n.stream};n.ssl!==!0&&(Object.assign( +c,n.ssl),"key"in n.ssl&&(c.key=n.ssl.key)),Rs.isIP(t)===0&&(c.servername=t);try{ +n.stream=u.connect(c)}catch(l){return n.emit("error",l)}n.attachListeners(n.stream), n.stream.on("error",i),n.emit("sslconnect")})}attachListeners(e){e.on("end",()=>{ -this.emit("end")}),yc(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& -this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(q.requestSsl())}startup(e){ -this.stream.write(q.startup(e))}cancel(e,t){this._send(q.cancel(e,t))}password(e){ -this._send(q.password(e))}sendSASLInitialResponseMessage(e,t){this._send(q.sendSASLInitialResponseMessage( -e,t))}sendSCRAMClientFinalMessage(e){this._send(q.sendSCRAMClientFinalMessage(e))}_send(e){ -return this.stream.writable?this.stream.write(e):!1}query(e){this._send(q.query( -e))}parse(e){this._send(q.parse(e))}bind(e){this._send(q.bind(e))}execute(e){this. -_send(q.execute(e))}flush(){this.stream.writable&&this.stream.write(Ps)}sync(){this. -_ending=!0,this._send(Ps),this._send(mc)}ref(){this.stream.ref()}unref(){this.stream. +this.emit("end")}),gc(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& +this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(N.requestSsl())}startup(e){ +this.stream.write(N.startup(e))}cancel(e,t){this._send(N.cancel(e,t))}password(e){ +this._send(N.password(e))}sendSASLInitialResponseMessage(e,t){this._send(N.sendSASLInitialResponseMessage( +e,t))}sendSCRAMClientFinalMessage(e){this._send(N.sendSCRAMClientFinalMessage(e))}_send(e){ +return this.stream.writable?this.stream.write(e):!1}query(e){this._send(N.query( +e))}parse(e){this._send(N.parse(e))}bind(e){this._send(N.bind(e))}execute(e){this. +_send(N.execute(e))}flush(){this.stream.writable&&this.stream.write(Ps)}sync(){this. +_ending=!0,this._send(Ps),this._send(wc)}ref(){this.stream.ref()}unref(){this.stream. unref()}end(){if(this._ending=!0,!this._connecting||!this.stream.writable){this. -stream.end();return}return this.stream.write(gc,()=>{this.stream.end()})}close(e){ -this._send(q.close(e))}describe(e){this._send(q.describe(e))}sendCopyFromChunk(e){ -this._send(q.copyData(e))}endCopyFrom(){this._send(q.copyDone())}sendCopyFail(e){ -this._send(q.copyFail(e))}};a(fn,"Connection");var ln=fn;Bs.exports=ln});var Fs=I((hf,Rs)=>{"use strict";p();var wc=ge().EventEmitter,cf=(Ge(),O(He)),bc=tt(), -dn=ji(),Sc=Xi(),xc=wt(),Ec=bt(),Ls=ys(),vc=et(),_c=pn(),yn=class yn extends wc{constructor(e){ -super(),this.connectionParameters=new Ec(e),this.user=this.connectionParameters. +stream.end();return}return this.stream.write(bc,()=>{this.stream.end()})}close(e){ +this._send(N.close(e))}describe(e){this._send(N.describe(e))}sendCopyFromChunk(e){ +this._send(N.copyData(e))}endCopyFrom(){this._send(N.copyDone())}sendCopyFail(e){ +this._send(N.copyFail(e))}};a(hn,"Connection");var ln=hn;Fs.exports=ln});var Ms=I((ff,Bs)=>{"use strict";d();var Sc=we().EventEmitter,hf=(He(),U(je)),xc=et(), +dn=ji(),vc=es(),Ec=gt(),Ac=wt(),Ls=ms(),_c=Xe(),Cc=fn(),pn=class pn extends Sc{constructor(e){ +super(),this.connectionParameters=new Ac(e),this.user=this.connectionParameters. user,this.database=this.connectionParameters.database,this.port=this.connectionParameters. port,this.host=this.connectionParameters.host,Object.defineProperty(this,"passwo\ rd",{configurable:!0,enumerable:!1,writable:!0,value:this.connectionParameters.password}), this.replication=this.connectionParameters.replication;var t=e||{};this._Promise= -t.Promise||S.Promise,this._types=new xc(t.types),this._ending=!1,this._connecting= +t.Promise||b.Promise,this._types=new Ec(t.types),this._ending=!1,this._connecting= !1,this._connected=!1,this._connectionError=!1,this._queryable=!0,this.connection= -t.connection||new _c({stream:t.stream,ssl:this.connectionParameters.ssl,keepAlive:t. +t.connection||new Cc({stream:t.stream,ssl:this.connectionParameters.ssl,keepAlive:t. keepAlive||!1,keepAliveInitialDelayMillis:t.keepAliveInitialDelayMillis||0,encoding:this. connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t. -binary||vc.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters. +binary||_c.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters. ssl||!1,this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}), this._connectionTimeoutMillis=t.connectionTimeoutMillis||0}_errorAllQueries(e){let t=a( n=>{m.nextTick(()=>{n.handleError(e,this.connection)})},"enqueueError");this.activeQuery&& @@ -1271,10 +1275,10 @@ let t=this.connection;typeof this.password=="function"?this._Promise.resolve().t ()=>this.password()).then(n=>{if(n!==void 0){if(typeof n!="string"){t.emit("erro\ r",new TypeError("Password must be a string"));return}this.connectionParameters. password=this.password=n}else this.connectionParameters.password=this.password=null; -e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():Sc(this.connectionParameters, +e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():vc(this.connectionParameters, n=>{n!==void 0&&(this.connectionParameters.password=this.password=n),e()})}_handleAuthCleartextPassword(e){ this._checkPgPass(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){ -this._checkPgPass(()=>{let t=bc.postgresMd5PasswordHash(this.user,this.password, +this._checkPgPass(()=>{let t=xc.postgresMd5PasswordHash(this.user,this.password, e.salt);this.connection.password(t)})}_handleAuthSASL(e){this._checkPgPass(()=>{ this.saslSession=dn.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){ @@ -1321,11 +1325,11 @@ emit("drain"))}query(e,t,n){var i,s,o,u,c;if(e==null)throw new TypeError("Client was passed a null or undefined query");return typeof e.submit=="function"?(o=e. query_timeout||this.connectionParameters.query_timeout,s=i=e,typeof t=="function"&& (i.callback=i.callback||t)):(o=this.connectionParameters.query_timeout,i=new Ls( -e,t,n),i.callback||(s=new this._Promise((h,l)=>{i.callback=(d,b)=>d?l(d):h(b)}))), -o&&(c=i.callback,u=setTimeout(()=>{var h=new Error("Query read timeout");m.nextTick( -()=>{i.handleError(h,this.connection)}),c(h),i.callback=()=>{};var l=this.queryQueue. -indexOf(i);l>-1&&this.queryQueue.splice(l,1),this._pulseQueryQueue()},o),i.callback= -(h,l)=>{clearTimeout(u),c(h,l)}),this.binary&&!i.binary&&(i.binary=!0),i._result&& +e,t,n),i.callback||(s=new this._Promise((l,h)=>{i.callback=(p,S)=>p?h(p):l(S)}))), +o&&(c=i.callback,u=setTimeout(()=>{var l=new Error("Query read timeout");m.nextTick( +()=>{i.handleError(l,this.connection)}),c(l),i.callback=()=>{};var h=this.queryQueue. +indexOf(i);h>-1&&this.queryQueue.splice(h,1),this._pulseQueryQueue()},o),i.callback= +(l,h)=>{clearTimeout(u),c(l,h)}),this.binary&&!i.binary&&(i.binary=!0),i._result&& !i._result._types&&(i._result._types=this._types),this._queryable?this._ending?(m. nextTick(()=>{i.handleError(new Error("Client was closed and is not queryable"), this.connection)}),s):(this.queryQueue.push(i),this._pulseQueryQueue(),s):(m.nextTick( @@ -1334,27 +1338,27 @@ ot queryable"),this.connection)}),s)}ref(){this.connection.ref()}unref(){this.co unref()}end(e){if(this._ending=!0,!this.connection._connecting)if(e)e();else return this. _Promise.resolve();if(this.activeQuery||!this._queryable?this.connection.stream. destroy():this.connection.end(),e)this.connection.once("end",e);else return new this. -_Promise(t=>{this.connection.once("end",t)})}};a(yn,"Client");var Ct=yn;Ct.Query= -Ls;Rs.exports=Ct});var Us=I((pf,ks)=>{"use strict";p();var Ac=ge().EventEmitter,Ms=a(function(){},"\ -NOOP"),Ds=a((r,e)=>{let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]}, -"removeWhere"),wn=class wn{constructor(e,t,n){this.client=e,this.idleListener=t, -this.timeoutId=n}};a(wn,"IdleItem");var mn=wn,bn=class bn{constructor(e){this.callback= -e}};a(bn,"PendingItem");var Ne=bn;function Cc(){throw new Error("Release called \ -on client which has already been released to the pool.")}a(Cc,"throwOnDoubleRele\ -ase");function Tt(r,e){if(e)return{callback:e,result:void 0};let t,n,i=a(function(o,u){ +_Promise(t=>{this.connection.once("end",t)})}};a(pn,"Client");var _t=pn;_t.Query= +Ls;Bs.exports=_t});var Ds=I((yf,Qs)=>{"use strict";d();var Tc=we().EventEmitter,ks=a(function(){},"\ +NOOP"),Os=a((r,e)=>{let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]}, +"removeWhere"),gn=class gn{constructor(e,t,n){this.client=e,this.idleListener=t, +this.timeoutId=n}};a(gn,"IdleItem");var yn=gn,wn=class wn{constructor(e){this.callback= +e}};a(wn,"PendingItem");var Ue=wn;function Ic(){throw new Error("Release called \ +on client which has already been released to the pool.")}a(Ic,"throwOnDoubleRele\ +ase");function Ct(r,e){if(e)return{callback:e,result:void 0};let t,n,i=a(function(o,u){ o?t(o):n(u)},"cb"),s=new r(function(o,u){n=o,t=u}).catch(o=>{throw Error.captureStackTrace( -o),o});return{callback:i,result:s}}a(Tt,"promisify");function Tc(r,e){return a(function t(n){ +o),o});return{callback:i,result:s}}a(Ct,"promisify");function Rc(r,e){return a(function t(n){ n.client=e,e.removeListener("error",t),e.on("error",()=>{r.log("additional clien\ t error after disconnection due to error",n)}),r._remove(e),r.emit("error",n,e)}, -"idleListener")}a(Tc,"makeIdleListener");var Sn=class Sn extends Ac{constructor(e,t){ +"idleListener")}a(Rc,"makeIdleListener");var bn=class bn extends Tc{constructor(e,t){ super(),this.options=Object.assign({},e),e!=null&&"password"in e&&Object.defineProperty( this.options,"password",{configurable:!0,enumerable:!1,writable:!0,value:e.password}), e!=null&&e.ssl&&e.ssl.key&&Object.defineProperty(this.options.ssl,"key",{enumerable:!1}), this.options.max=this.options.max||this.options.poolSize||10,this.options.maxUses= this.options.maxUses||1/0,this.options.allowExitOnIdle=this.options.allowExitOnIdle|| !1,this.options.maxLifetimeSeconds=this.options.maxLifetimeSeconds||0,this.log=this. -options.log||function(){},this.Client=this.options.Client||t||It().Client,this.Promise= -this.options.Promise||S.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this. +options.log||function(){},this.Client=this.options.Client||t||Tt().Client,this.Promise= +this.options.Promise||b.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this. options.idleTimeoutMillis=1e4),this._clients=[],this._idle=[],this._expired=new WeakSet, this._pendingQueue=[],this._endCallback=void 0,this.ending=!1,this.ended=!1}_isFull(){ return this._clients.length>=this.options.max}_pulseQueue(){if(this.log("pulse q\ @@ -1365,34 +1369,34 @@ _pendingQueue.length){this.log("no queued requests");return}if(!this._idle.lengt this._isFull())return;let e=this._pendingQueue.shift();if(this._idle.length){let t=this. _idle.pop();clearTimeout(t.timeoutId);let n=t.client;n.ref&&n.ref();let i=t.idleListener; return this._acquireClient(n,e,i,!1)}if(!this._isFull())return this.newClient(e); -throw new Error("unexpected condition")}_remove(e){let t=Ds(this._idle,n=>n.client=== +throw new Error("unexpected condition")}_remove(e){let t=Os(this._idle,n=>n.client=== e);t!==void 0&&clearTimeout(t.timeoutId),this._clients=this._clients.filter(n=>n!== e),e.end(),this.emit("remove",e)}connect(e){if(this.ending){let i=new Error("Can\ not use a pool after calling end on the pool");return e?e(i):this.Promise.reject( -i)}let t=Tt(this.Promise,e),n=t.result;if(this._isFull()||this._idle.length){if(this. +i)}let t=Ct(this.Promise,e),n=t.result;if(this._isFull()||this._idle.length){if(this. _idle.length&&m.nextTick(()=>this._pulseQueue()),!this.options.connectionTimeoutMillis) -return this._pendingQueue.push(new Ne(t.callback)),n;let i=a((u,c,h)=>{clearTimeout( -o),t.callback(u,c,h)},"queueCallback"),s=new Ne(i),o=setTimeout(()=>{Ds(this._pendingQueue, +return this._pendingQueue.push(new Ue(t.callback)),n;let i=a((u,c,l)=>{clearTimeout( +o),t.callback(u,c,l)},"queueCallback"),s=new Ue(i),o=setTimeout(()=>{Os(this._pendingQueue, u=>u.callback===i),s.timedOut=!0,t.callback(new Error("timeout exceeded when try\ ing to connect"))},this.options.connectionTimeoutMillis);return this._pendingQueue. -push(s),n}return this.newClient(new Ne(t.callback)),n}newClient(e){let t=new this. -Client(this.options);this._clients.push(t);let n=Tc(this,t);this.log("checking c\ +push(s),n}return this.newClient(new Ue(t.callback)),n}newClient(e){let t=new this. +Client(this.options);this._clients.push(t);let n=Rc(this,t);this.log("checking c\ lient timeout");let i,s=!1;this.options.connectionTimeoutMillis&&(i=setTimeout(()=>{ this.log("ending client due to timeout"),s=!0,t.connection?t.connection.stream.destroy(): t.end()},this.options.connectionTimeoutMillis)),this.log("connecting new client"), t.connect(o=>{if(i&&clearTimeout(i),t.on("error",n),o)this.log("client failed to\ connect",o),this._clients=this._clients.filter(u=>u!==t),s&&(o.message="Connect\ ion terminated due to connection timeout"),this._pulseQueue(),e.timedOut||e.callback( -o,void 0,Ms);else{if(this.log("new client connected"),this.options.maxLifetimeSeconds!== +o,void 0,ks);else{if(this.log("new client connected"),this.options.maxLifetimeSeconds!== 0){let u=setTimeout(()=>{this.log("ending client due to expired lifetime"),this. -_expired.add(t),this._idle.findIndex(h=>h.client===t)!==-1&&this._acquireClient( -t,new Ne((h,l,d)=>d()),n,!1)},this.options.maxLifetimeSeconds*1e3);u.unref(),t.once( +_expired.add(t),this._idle.findIndex(l=>l.client===t)!==-1&&this._acquireClient( +t,new Ue((l,h,p)=>p()),n,!1)},this.options.maxLifetimeSeconds*1e3);u.unref(),t.once( "end",()=>clearTimeout(u))}return this._acquireClient(t,e,n,!0)}})}_acquireClient(e,t,n,i){ i&&this.emit("connect",e),this.emit("acquire",e),e.release=this._releaseOnce(e,n), e.removeListener("error",n),t.timedOut?i&&this.options.verify?this.options.verify( e,e.release):e.release():i&&this.options.verify?this.options.verify(e,s=>{if(s)return e. -release(s),t.callback(s,void 0,Ms);t.callback(void 0,e,e.release)}):t.callback(void 0, -e,e.release)}_releaseOnce(e,t){let n=!1;return i=>{n&&Cc(),n=!0,this._release(e, +release(s),t.callback(s,void 0,ks);t.callback(void 0,e,e.release)}):t.callback(void 0, +e,e.release)}_releaseOnce(e,t){let n=!1;return i=>{n&&Ic(),n=!0,this._release(e, t,i)}}_release(e,t,n){if(e.on("error",t),e._poolUseCount=(e._poolUseCount||0)+1, this.emit("release",n,e),n||this.ending||!e._queryable||e._ending||e._poolUseCount>= this.options.maxUses){e._poolUseCount>=this.options.maxUses&&this.log("remove ex\ @@ -1400,21 +1404,21 @@ pended client"),this._remove(e),this._pulseQueue();return}if(this._expired.has(e this.log("remove expired client"),this._expired.delete(e),this._remove(e),this._pulseQueue(); return}let s;this.options.idleTimeoutMillis&&(s=setTimeout(()=>{this.log("remove\ idle client"),this._remove(e)},this.options.idleTimeoutMillis),this.options.allowExitOnIdle&& -s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new mn(e,t,s)), -this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=Tt(this.Promise,e); +s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new yn(e,t,s)), +this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=Ct(this.Promise,e); return x(function(){return s.callback(new Error("Passing a function as the first\ parameter to pool.query is not supported"))}),s.result}typeof t=="function"&&(n= -t,t=void 0);let i=Tt(this.Promise,n);return n=i.callback,this.connect((s,o)=>{if(s) -return n(s);let u=!1,c=a(h=>{u||(u=!0,o.release(h),n(h))},"onError");o.once("err\ -or",c),this.log("dispatching query");try{o.query(e,t,(h,l)=>{if(this.log("query \ -dispatched"),o.removeListener("error",c),!u)return u=!0,o.release(h),h?n(h):n(void 0, -l)})}catch(h){return o.release(h),n(h)}}),i.result}end(e){if(this.log("ending"), +t,t=void 0);let i=Ct(this.Promise,n);return n=i.callback,this.connect((s,o)=>{if(s) +return n(s);let u=!1,c=a(l=>{u||(u=!0,o.release(l),n(l))},"onError");o.once("err\ +or",c),this.log("dispatching query");try{o.query(e,t,(l,h)=>{if(this.log("query \ +dispatched"),o.removeListener("error",c),!u)return u=!0,o.release(l),l?n(l):n(void 0, +h)})}catch(l){return o.release(l),n(l)}}),i.result}end(e){if(this.log("ending"), this.ending){let n=new Error("Called end on pool more than once");return e?e(n): -this.Promise.reject(n)}this.ending=!0;let t=Tt(this.Promise,e);return this._endCallback= +this.Promise.reject(n)}this.ending=!0;let t=Ct(this.Promise,e);return this._endCallback= t.callback,this._pulseQueue(),t.result}get waitingCount(){return this._pendingQueue. length}get idleCount(){return this._idle.length}get expiredCount(){return this._clients. reduce((e,t)=>e+(this._expired.has(t)?1:0),0)}get totalCount(){return this._clients. -length}};a(Sn,"Pool");var gn=Sn;ks.exports=gn});var Os={};se(Os,{default:()=>Ic});var Ic,Ns=z(()=>{"use strict";p();Ic={}});var qs=I((gf,Pc)=>{Pc.exports={name:"pg",version:"8.8.0",description:"PostgreSQL\ +length}};a(bn,"Pool");var mn=bn;Qs.exports=mn});var Us={};ie(Us,{default:()=>Pc});var Pc,qs=z(()=>{"use strict";d();Pc={}});var Ns=I((bf,Fc)=>{Fc.exports={name:"pg",version:"8.8.0",description:"PostgreSQL\ client - pure javascript & libpq with the same API",keywords:["database","libpq", "pg","postgre","postgres","postgresql","rdbms"],homepage:"https://github.com/bri\ anc/node-postgres",repository:{type:"git",url:"git://github.com/brianc/node-post\ @@ -1425,16 +1429,16 @@ pes":"^2.1.0",pgpass:"1.x"},devDependencies:{async:"2.6.4",bluebird:"3.5.2",co:" 4.6.0","pg-copy-streams":"0.3.0"},peerDependencies:{"pg-native":">=3.0.1"},peerDependenciesMeta:{ "pg-native":{optional:!0}},scripts:{test:"make test-all"},files:["lib","SPONSORS\ .md"],license:"MIT",engines:{node:">= 8.0.0"},gitHead:"c99fb2c127ddf8d712500db2c\ -7b9a5491a178655"}});var Ws=I((wf,js)=>{"use strict";p();var Qs=ge().EventEmitter,Bc=(Ge(),O(He)),xn=tt(), -qe=js.exports=function(r,e,t){Qs.call(this),r=xn.normalizeQueryConfig(r,e,t),this. +7b9a5491a178655"}});var Hs=I((Sf,js)=>{"use strict";d();var Ws=we().EventEmitter,Lc=(He(),U(je)),Sn=et(), +qe=js.exports=function(r,e,t){Ws.call(this),r=Sn.normalizeQueryConfig(r,e,t),this. text=r.text,this.values=r.values,this.name=r.name,this.callback=r.callback,this. state="new",this._arrayMode=r.rowMode==="array",this._emitRowEvents=!1,this.on("\ -newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};Bc.inherits( -qe,Qs);var Lc={sqlState:"code",statementPosition:"position",messagePrimary:"mess\ +newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};Lc.inherits( +qe,Ws);var Bc={sqlState:"code",statementPosition:"position",messagePrimary:"mess\ age",context:"where",schemaName:"schema",tableName:"table",columnName:"column",dataTypeName:"\ dataType",constraintName:"constraint",sourceFile:"file",sourceLine:"line",sourceFunction:"\ routine"};qe.prototype.handleError=function(r){var e=this.native.pq.resultErrorFields(); -if(e)for(var t in e){var n=Lc[t]||t;r[n]=e[t]}this.callback?this.callback(r):this. +if(e)for(var t in e){var n=Bc[t]||t;r[n]=e[t]}this.callback?this.callback(r):this. emit("error",r),this.state="error"};qe.prototype.then=function(r,e){return this. _getPromise().then(r,e)};qe.prototype.catch=function(r){return this._getPromise(). catch(r)};qe.prototype._getPromise=function(){return this._promise?this._promise: @@ -1442,28 +1446,28 @@ catch(r)};qe.prototype._getPromise=function(){return this._promise?this._promise e)}.bind(this)),this._promise)};qe.prototype.submit=function(r){this.state="runn\ ing";var e=this;this.native=r.native,r.native.arrayMode=this._arrayMode;var t=a( function(s,o,u){if(r.native.arrayMode=!1,x(function(){e.emit("_done")}),s)return e. -handleError(s);e._emitRowEvents&&(u.length>1?o.forEach((c,h)=>{c.forEach(l=>{e.emit( -"row",l,u[h])})}):o.forEach(function(c){e.emit("row",c,u)})),e.state="end",e.emit( +handleError(s);e._emitRowEvents&&(u.length>1?o.forEach((c,l)=>{c.forEach(h=>{e.emit( +"row",h,u[l])})}):o.forEach(function(c){e.emit("row",c,u)})),e.state="end",e.emit( "end",u),e.callback&&e.callback(null,u)},"after");if(m.domain&&(t=m.domain.bind( t)),this.name){this.name.length>63&&(console.error("Warning! Postgres only suppo\ rts 63 characters for query names."),console.error("You supplied %s (%s)",this.name, this.name.length),console.error("This can cause conflicts and silent errors exec\ -uting queries"));var n=(this.values||[]).map(xn.prepareValue);if(r.namedQueries[this. +uting queries"));var n=(this.values||[]).map(Sn.prepareValue);if(r.namedQueries[this. name]){if(this.text&&r.namedQueries[this.name]!==this.text){let s=new Error(`Pre\ pared statements must be unique - '${this.name}' was used for a different statem\ ent`);return t(s)}return r.native.execute(this.name,n,t)}return r.native.prepare( this.name,this.text,n.length,function(s){return s?t(s):(r.namedQueries[e.name]=e. text,e.native.execute(e.name,n,t))})}else if(this.values){if(!Array.isArray(this. values)){let s=new Error("Query values must be an array");return t(s)}var i=this. -values.map(xn.prepareValue);r.native.query(this.text,i,t)}else r.native.query(this. -text,t)}});var Vs=I((Ef,$s)=>{"use strict";p();var Rc=(Ns(),O(Os)),Fc=wt(),xf=qs(),Hs=ge(). -EventEmitter,Mc=(Ge(),O(He)),Dc=bt(),Gs=Ws(),J=$s.exports=function(r){Hs.call(this), -r=r||{},this._Promise=r.Promise||S.Promise,this._types=new Fc(r.types),this.native= -new Rc({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting= -!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Dc( +values.map(Sn.prepareValue);r.native.query(this.text,i,t)}else r.native.query(this. +text,t)}});var Ks=I((Af,Vs)=>{"use strict";d();var Mc=(qs(),U(Us)),kc=gt(),Ef=Ns(),Gs=we(). +EventEmitter,Oc=(He(),U(je)),Qc=wt(),$s=Hs(),J=Vs.exports=function(r){Gs.call(this), +r=r||{},this._Promise=r.Promise||b.Promise,this._types=new kc(r.types),this.native= +new Mc({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting= +!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Qc( r);this.user=e.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, writable:!0,value:e.password}),this.database=e.database,this.host=e.host,this.port= -e.port,this.namedQueries={}};J.Query=Gs;Mc.inherits(J,Hs);J.prototype._errorAllQueries= +e.port,this.namedQueries={}};J.Query=$s;Oc.inherits(J,Gs);J.prototype._errorAllQueries= function(r){let e=a(t=>{m.nextTick(()=>{t.native=this.native,t.handleError(r)})}, "enqueueError");this._hasActiveQuery()&&(e(this._activeQuery),this._activeQuery= null),this._queryQueue.forEach(e),this._queryQueue.length=0};J.prototype._connect= @@ -1479,11 +1483,11 @@ prototype.connect=function(r){if(r){this._connect(r);return}return new this._Pro i,s,o,u;if(r==null)throw new TypeError("Client was passed a null or undefined qu\ ery");if(typeof r.submit=="function")s=r.query_timeout||this.connectionParameters. query_timeout,i=n=r,typeof e=="function"&&(r.callback=e);else if(s=this.connectionParameters. -query_timeout,n=new Gs(r,e,t),!n.callback){let c,h;i=new this._Promise((l,d)=>{c= -l,h=d}),n.callback=(l,d)=>l?h(l):c(d)}return s&&(u=n.callback,o=setTimeout(()=>{ +query_timeout,n=new $s(r,e,t),!n.callback){let c,l;i=new this._Promise((h,p)=>{c= +h,l=p}),n.callback=(h,p)=>h?l(h):c(p)}return s&&(u=n.callback,o=setTimeout(()=>{ var c=new Error("Query read timeout");m.nextTick(()=>{n.handleError(c,this.connection)}), -u(c),n.callback=()=>{};var h=this._queryQueue.indexOf(n);h>-1&&this._queryQueue. -splice(h,1),this._pulseQueryQueue()},s),n.callback=(c,h)=>{clearTimeout(o),u(c,h)}), +u(c),n.callback=()=>{};var l=this._queryQueue.indexOf(n);l>-1&&this._queryQueue. +splice(l,1),this._pulseQueryQueue()},s),n.callback=(c,l)=>{clearTimeout(o),u(c,l)}), this._queryable?this._ending?(n.native=this.native,m.nextTick(()=>{n.handleError( new Error("Client was closed and is not queryable"))}),i):(this._queryQueue.push( n),this._pulseQueryQueue(),i):(n.native=this.native,m.nextTick(()=>{n.handleError( @@ -1501,73 +1505,73 @@ _activeQuery===r?this.native.cancel(function(){}):this._queryQueue.indexOf(r)!== -1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};J.prototype.ref=function(){}; J.prototype.unref=function(){};J.prototype.setTypeParser=function(r,e,t){return this. _types.setTypeParser(r,e,t)};J.prototype.getTypeParser=function(r,e){return this. -_types.getTypeParser(r,e)}});var En=I((Af,Ks)=>{"use strict";p();Ks.exports=Vs()});var It=I((Tf,nt)=>{"use strict";p();var kc=Fs(),Uc=et(),Oc=pn(),Nc=Us(),{DatabaseError:qc}=hn(), -Qc=a(r=>{var e;return e=class extends Nc{constructor(n){super(n,r)}},a(e,"BoundP\ +_types.getTypeParser(r,e)}});var xn=I((Tf,zs)=>{"use strict";d();zs.exports=Ks()});var Tt=I((Rf,rt)=>{"use strict";d();var Dc=Ms(),Uc=Xe(),qc=fn(),Nc=Ds(),{DatabaseError:Wc}=cn(), +jc=a(r=>{var e;return e=class extends Nc{constructor(n){super(n,r)}},a(e,"BoundP\ ool"),e},"poolFactory"),vn=a(function(r){this.defaults=Uc,this.Client=r,this.Query= -this.Client.Query,this.Pool=Qc(this.Client),this._pools=[],this.Connection=Oc,this. -types=Xe(),this.DatabaseError=qc},"PG");typeof m.env.NODE_PG_FORCE_NATIVE<"u"?nt. -exports=new vn(En()):(nt.exports=new vn(kc),Object.defineProperty(nt.exports,"na\ -tive",{configurable:!0,enumerable:!1,get(){var r=null;try{r=new vn(En())}catch(e){ -if(e.code!=="MODULE_NOT_FOUND")throw e}return Object.defineProperty(nt.exports,"\ -native",{value:r}),r}}))});p();var Bt=Te(It());St();p();St();mr();var Zs=Te(tt()),Js=Te(wt());function jc(r){return r instanceof y?"\\x"+r.toString("hex"):r}a(jc,"encodeBuffe\ -rsAsBytea");var Pt=class Pt extends Error{constructor(t){super(t);_(this,"name", -"NeonDbError");_(this,"severity");_(this,"code");_(this,"detail");_(this,"hint"); -_(this,"position");_(this,"internalPosition");_(this,"internalQuery");_(this,"wh\ -ere");_(this,"schema");_(this,"table");_(this,"column");_(this,"dataType");_(this, -"constraint");_(this,"file");_(this,"line");_(this,"routine");_(this,"sourceErro\ +this.Client.Query,this.Pool=jc(this.Client),this._pools=[],this.Connection=qc,this. +types=Je(),this.DatabaseError=Wc},"PG");typeof m.env.NODE_PG_FORCE_NATIVE<"u"?rt. +exports=new vn(xn()):(rt.exports=new vn(Dc),Object.defineProperty(rt.exports,"na\ +tive",{configurable:!0,enumerable:!1,get(){var r=null;try{r=new vn(xn())}catch(e){ +if(e.code!=="MODULE_NOT_FOUND")throw e}return Object.defineProperty(rt.exports,"\ +native",{value:r}),r}}))});d();var Rt=Te(Tt());bt();d();bt();yr();var Js=Te(et()),Xs=Te(gt());function Hc(r){return r instanceof y?"\\x"+r.toString("hex"):r}a(Hc,"encodeBuffe\ +rsAsBytea");var It=class It extends Error{constructor(t){super(t);A(this,"name", +"NeonDbError");A(this,"severity");A(this,"code");A(this,"detail");A(this,"hint"); +A(this,"position");A(this,"internalPosition");A(this,"internalQuery");A(this,"wh\ +ere");A(this,"schema");A(this,"table");A(this,"column");A(this,"dataType");A(this, +"constraint");A(this,"file");A(this,"line");A(this,"routine");A(this,"sourceErro\ r");"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error. -captureStackTrace(this,Pt)}};a(Pt,"NeonDbError");var pe=Pt,zs="transaction() exp\ -ects an array of queries, or a function returning an array of queries",Wc=["seve\ +captureStackTrace(this,It)}};a(It,"NeonDbError");var de=It,Ys="transaction() exp\ +ects an array of queries, or a function returning an array of queries",Gc=["seve\ rity","code","detail","hint","position","internalPosition","internalQuery","wher\ -e","schema","table","column","dataType","constraint","file","line","routine"];function Xs(r,{ +e","schema","table","column","dataType","constraint","file","line","routine"];function eo(r,{ arrayMode:e,fullResults:t,fetchOptions:n,isolationLevel:i,readOnly:s,deferrable:o, -queryCallback:u,resultCallback:c,authToken:h}={}){if(!r)throw new Error("No data\ +queryCallback:u,resultCallback:c,authToken:l}={}){if(!r)throw new Error("No data\ base connection string was provided to `neon()`. Perhaps an environment variable\ - has not been set?");let l;try{l=yr(r)}catch{throw new Error("Database connectio\ + has not been set?");let h;try{h=pr(r)}catch{throw new Error("Database connectio\ n string provided to `neon()` is not a valid URL. Connection string: "+String(r))} -let{protocol:d,username:b,hostname:C,port:B,pathname:Q}=l;if(d!=="postgres:"&&d!== -"postgresql:"||!b||!C||!Q)throw new Error("Database connection string format for\ - `neon()` should be: postgresql://user:password@host.tld/dbname?option=value");function X(A,...g){ -let P,K;if(typeof A=="string")P=A,K=g[1],g=g[0]??[];else{P="";for(let j=0;jjc((0,Zs.prepareValue)(j)));let k={ -query:P,params:g};return u&&u(k),Hc(de,k,K)}a(X,"resolve"),X.transaction=async(A,g)=>{ -if(typeof A=="function"&&(A=A(X)),!Array.isArray(A))throw new Error(zs);A.forEach( -k=>{if(k[Symbol.toStringTag]!=="NeonQueryPromise")throw new Error(zs)});let P=A. -map(k=>k.parameterizedQuery),K=A.map(k=>k.opts??{});return de(P,K,g)};async function de(A,g,P){ -let{fetchEndpoint:K,fetchFunction:k}=_e,j=Array.isArray(A)?{queries:A}:A,ee=n??{}, -oe=e??!1,R=t??!1,$=i,ce=s,ye=o;P!==void 0&&(P.fetchOptions!==void 0&&(ee={...ee, -...P.fetchOptions}),P.arrayMode!==void 0&&(oe=P.arrayMode),P.fullResults!==void 0&& -(R=P.fullResults),P.isolationLevel!==void 0&&($=P.isolationLevel),P.readOnly!==void 0&& -(ce=P.readOnly),P.deferrable!==void 0&&(ye=P.deferrable)),g!==void 0&&!Array.isArray( -g)&&g.fetchOptions!==void 0&&(ee={...ee,...g.fetchOptions});let Se=h;!Array.isArray( -g)&&g?.authToken!==void 0&&(Se=g.authToken);let je=typeof K=="function"?K(C,B,{jwtAuth:Se!== -void 0}):K,he={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"true","Neon-Ar\ -ray-Mode":"true"},it=await Gc(Se);it&&(he.Authorization=`Bearer ${it}`),Array.isArray( -A)&&($!==void 0&&(he["Neon-Batch-Isolation-Level"]=$),ce!==void 0&&(he["Neon-Bat\ -ch-Read-Only"]=String(ce)),ye!==void 0&&(he["Neon-Batch-Deferrable"]=String(ye))); -let te;try{te=await(k??fetch)(je,{method:"POST",body:JSON.stringify(j),headers:he, -...ee})}catch(W){let H=new pe(`Error connecting to database: ${W.message}`);throw H. -sourceError=W,H}if(te.ok){let W=await te.json();if(Array.isArray(A)){let H=W.results; -if(!Array.isArray(H))throw new pe("Neon internal error: unexpected result format"); -return H.map((Ae,xe)=>{let Lt=g[xe]??{},ro=Lt.arrayMode??oe,no=Lt.fullResults??R; -return Ys(Ae,{arrayMode:ro,fullResults:no,parameterizedQuery:A[xe],resultCallback:c, -types:Lt.types})})}else{let H=g??{},Ae=H.arrayMode??oe,xe=H.fullResults??R;return Ys( -W,{arrayMode:Ae,fullResults:xe,parameterizedQuery:A,resultCallback:c,types:H.types})}}else{ -let{status:W}=te;if(W===400){let H=await te.json(),Ae=new pe(H.message);for(let xe of Wc) -Ae[xe]=H[xe]??void 0;throw Ae}else{let H=await te.text();throw new pe(`Server er\ -ror (HTTP status ${W}): ${H}`)}}}return a(de,"execute"),X}a(Xs,"neon");function Hc(r,e,t){ -return{[Symbol.toStringTag]:"NeonQueryPromise",parameterizedQuery:e,opts:t,then:a( -(n,i)=>r(e,t).then(n,i),"then"),catch:a(n=>r(e,t).catch(n),"catch"),finally:a(n=>r( -e,t).finally(n),"finally")}}a(Hc,"createNeonQueryPromise");function Ys(r,{arrayMode:e, -fullResults:t,parameterizedQuery:n,resultCallback:i,types:s}){let o=new Js.default( -s),u=r.fields.map(l=>l.name),c=r.fields.map(l=>o.getTypeParser(l.dataTypeID)),h=e=== -!0?r.rows.map(l=>l.map((d,b)=>d===null?null:c[b](d))):r.rows.map(l=>Object.fromEntries( -l.map((d,b)=>[u[b],d===null?null:c[b](d)])));return i&&i(n,r,h,{arrayMode:e,fullResults:t}), -t?(r.viaNeonFetch=!0,r.rowAsArray=e,r.rows=h,r._parsers=c,r._types=o,r):h}a(Ys,"\ -processQueryResult");async function Gc(r){if(typeof r=="string")return r;if(typeof r== -"function")try{return await Promise.resolve(r())}catch(e){let t=new pe("Error ge\ -tting auth token.");throw e instanceof Error&&(t=new pe(`Error getting auth toke\ -n: ${e.message}`)),t}}a(Gc,"getAuthToken");var to=Te(bt()),Qe=Te(It());var An=class An extends Bt.Client{constructor(t){super(t);this.config=t}get neonConfig(){ +let{protocol:p,username:S,hostname:_,port:P,pathname:G}=h;if(p!=="postgres:"&&p!== +"postgresql:"||!S||!_||!G)throw new Error("Database connection string format for\ + `neon()` should be: postgresql://user:password@host.tld/dbname?option=value");function X(C,...g){ +let R,W;if(typeof C=="string")R=C,W=g[1],g=g[0]??[];else{R="";for(let j=0;jHc((0,Js.prepareValue)(j)));let Q={ +query:R,params:g};return u&&u(Q),$c(se,Q,W)}a(X,"resolve"),X.transaction=async(C,g)=>{ +if(typeof C=="function"&&(C=C(X)),!Array.isArray(C))throw new Error(Ys);C.forEach( +Q=>{if(Q[Symbol.toStringTag]!=="NeonQueryPromise")throw new Error(Ys)});let R=C. +map(Q=>Q.parameterizedQuery),W=C.map(Q=>Q.opts??{});return se(R,W,g)};async function se(C,g,R){ +let{fetchEndpoint:W,fetchFunction:Q}=_e,j=Array.isArray(C)?{queries:C}:C,ee=n??{}, +oe=e??!1,L=t??!1,$=i,ce=s,pe=o;R!==void 0&&(R.fetchOptions!==void 0&&(ee={...ee, +...R.fetchOptions}),R.arrayMode!==void 0&&(oe=R.arrayMode),R.fullResults!==void 0&& +(L=R.fullResults),R.isolationLevel!==void 0&&($=R.isolationLevel),R.readOnly!==void 0&& +(ce=R.readOnly),R.deferrable!==void 0&&(pe=R.deferrable)),g!==void 0&&!Array.isArray( +g)&&g.fetchOptions!==void 0&&(ee={...ee,...g.fetchOptions});let xe=l;!Array.isArray( +g)&&g?.authToken!==void 0&&(xe=g.authToken);let Ne=typeof W=="function"?W(_,P,{jwtAuth:xe!== +void 0}):W,le={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"true","Neon-Ar\ +ray-Mode":"true"},nt=await Vc(xe);nt&&(le.Authorization=`Bearer ${nt}`),Array.isArray( +C)&&($!==void 0&&(le["Neon-Batch-Isolation-Level"]=$),ce!==void 0&&(le["Neon-Bat\ +ch-Read-Only"]=String(ce)),pe!==void 0&&(le["Neon-Batch-Deferrable"]=String(pe))); +let ye;try{ye=await(Q??fetch)(Ne,{method:"POST",body:JSON.stringify(j),headers:le, +...ee})}catch(K){let O=new de(`Error connecting to database: ${K}`);throw O.sourceError= +K,O}if(ye.ok){let K=await ye.json();if(Array.isArray(C)){let O=K.results;if(!Array. +isArray(O))throw new de("Neon internal error: unexpected result format");return O. +map((me,ve)=>{let Pt=g[ve]??{},no=Pt.arrayMode??oe,io=Pt.fullResults??L;return Zs( +me,{arrayMode:no,fullResults:io,parameterizedQuery:C[ve],resultCallback:c,types:Pt. +types})})}else{let O=g??{},me=O.arrayMode??oe,ve=O.fullResults??L;return Zs(K,{arrayMode:me, +fullResults:ve,parameterizedQuery:C,resultCallback:c,types:O.types})}}else{let{status:K}=ye; +if(K===400){let O=await ye.json(),me=new de(O.message);for(let ve of Gc)me[ve]=O[ve]?? +void 0;throw me}else{let O=await ye.text();throw new de(`Server error (HTTP stat\ +us ${K}): ${O}`)}}}return a(se,"execute"),X}a(eo,"neon");function $c(r,e,t){return{ +[Symbol.toStringTag]:"NeonQueryPromise",parameterizedQuery:e,opts:t,then:a((n,i)=>r( +e,t).then(n,i),"then"),catch:a(n=>r(e,t).catch(n),"catch"),finally:a(n=>r(e,t).finally( +n),"finally")}}a($c,"createNeonQueryPromise");function Zs(r,{arrayMode:e,fullResults:t, +parameterizedQuery:n,resultCallback:i,types:s}){let o=new Xs.default(s),u=r.fields. +map(h=>h.name),c=r.fields.map(h=>o.getTypeParser(h.dataTypeID)),l=e===!0?r.rows. +map(h=>h.map((p,S)=>p===null?null:c[S](p))):r.rows.map(h=>Object.fromEntries(h.map( +(p,S)=>[u[S],p===null?null:c[S](p)])));return i&&i(n,r,l,{arrayMode:e,fullResults:t}), +t?(r.viaNeonFetch=!0,r.rowAsArray=e,r.rows=l,r._parsers=c,r._types=o,r):l}a(Zs,"\ +processQueryResult");async function Vc(r){if(typeof r=="string")return r;if(typeof r== +"function")try{return await Promise.resolve(r())}catch(e){let t=new de("Error ge\ +tting auth token.");throw e instanceof Error&&(t=new de(`Error getting auth toke\ +n: ${e.message}`)),t}}a(Vc,"getAuthToken");var ro=Te(wt()),Cn=Te(Tt());var An=class An extends Rt.Client{constructor(t){super(t);this.config=t}get neonConfig(){ return this.connection.stream}connect(t){let{neonConfig:n}=this;n.forceDisablePgSSL&& (this.ssl=this.connection.ssl=!1),this.ssl&&n.useSecureWebSocket&&console.warn("\ SSL is enabled for both Postgres (e.g. ?sslmode=require in the connection string\ @@ -1581,55 +1585,54 @@ ase host or connection string was set, and key parameters have default values (h ost: localhost, user: ${s}, db: ${s}, password: null). Is an environment variabl\ e missing? Alternatively, if you intended to connect with these parameters, plea\ se set the host to 'localhost' explicitly.`);let o=super.connect(t),u=n.pipelineTLS&& -this.ssl,c=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let h=this. -connection;if(u&&h.on("connect",()=>h.stream.emit("data","S")),c){h.removeAllListeners( -"authenticationCleartextPassword"),h.removeAllListeners("readyForQuery"),h.once( -"readyForQuery",()=>h.on("readyForQuery",this._handleReadyForQuery.bind(this))); -let l=this.ssl?"sslconnect":"connect";h.on(l,()=>{this._handleAuthCleartextPassword(), -this._handleReadyForQuery()})}return o}async _handleAuthSASLContinue(t){let n=this. -saslSession,i=this.password,s=t.data;if(n.message!=="SASLInitialResponse"||typeof i!= -"string"||typeof s!="string")throw new Error("SASL: protocol error");let o=Object. -fromEntries(s.split(",").map(te=>{if(!/^.=/.test(te))throw new Error("SASL: Inva\ -lid attribute pair entry");let W=te[0],H=te.substring(2);return[W,H]})),u=o.r,c=o. -s,h=o.i;if(!u||!/^[!-+--~]+$/.test(u))throw new Error("SASL: SCRAM-SERVER-FIRST-\ -MESSAGE: nonce missing/unprintable");if(!c||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base\ +this.ssl,c=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let l=this. +connection;if(u&&l.on("connect",()=>l.stream.emit("data","S")),c){l.removeAllListeners( +"authenticationCleartextPassword"),l.removeAllListeners("readyForQuery"),l.once( +"readyForQuery",()=>l.on("readyForQuery",this._handleReadyForQuery.bind(this))); +let h=this.ssl?"sslconnect":"connect";l.on(h,()=>{this._handleAuthCleartextPassword(), +this._handleReadyForQuery()})}return o}async _handleAuthSASLContinue(t){if(typeof w> +"u"||w.subtle===void 0||w.subtle.importKey===void 0)throw new Error("Cannot use \ +SASL auth when `crypto.subtle` is not defined");let n=w.subtle,i=this.saslSession, +s=this.password,o=t.data;if(i.message!=="SASLInitialResponse"||typeof s!="string"|| +typeof o!="string")throw new Error("SASL: protocol error");let u=Object.fromEntries( +o.split(",").map(K=>{if(!/^.=/.test(K))throw new Error("SASL: Invalid attribute \ +pair entry");let O=K[0],me=K.substring(2);return[O,me]})),c=u.r,l=u.s,h=u.i;if(!c|| +!/^[!-+--~]+$/.test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce \ +missing/unprintable");if(!l||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(l))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base\ 64");if(!h||!/^[1-9][0-9]*$/.test(h))throw new Error("SASL: SCRAM-SERVER-FIRST-M\ -ESSAGE: missing/invalid iteration count");if(!u.startsWith(n.clientNonce))throw new Error( +ESSAGE: missing/invalid iteration count");if(!c.startsWith(i.clientNonce))throw new Error( "SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce"); -if(u.length===n.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MES\ -SAGE: server nonce is too short");let l=parseInt(h,10),d=y.from(c,"base64"),b=new TextEncoder, -C=b.encode(i),B=await w.subtle.importKey("raw",C,{name:"HMAC",hash:{name:"SHA-25\ -6"}},!1,["sign"]),Q=new Uint8Array(await w.subtle.sign("HMAC",B,y.concat([d,y.from( -[0,0,0,1])]))),X=Q;for(var de=0;deX[W]^Q[W]));let A=X,g=await w.subtle.importKey( -"raw",A,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),P=new Uint8Array(await w. -subtle.sign("HMAC",g,b.encode("Client Key"))),K=await w.subtle.digest("SHA-256", -P),k="n=*,r="+n.clientNonce,j="r="+u+",s="+c+",i="+l,ee="c=biws,r="+u,oe=k+","+j+ -","+ee,R=await w.subtle.importKey("raw",K,{name:"HMAC",hash:{name:"SHA-256"}},!1, -["sign"]);var $=new Uint8Array(await w.subtle.sign("HMAC",R,b.encode(oe))),ce=y. -from(P.map((te,W)=>P[W]^$[W])),ye=ce.toString("base64");let Se=await w.subtle.importKey( -"raw",A,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),je=await w.subtle.sign( -"HMAC",Se,b.encode("Server Key")),he=await w.subtle.importKey("raw",je,{name:"HM\ -AC",hash:{name:"SHA-256"}},!1,["sign"]);var it=y.from(await w.subtle.sign("HMAC", -he,b.encode(oe)));n.message="SASLResponse",n.serverSignature=it.toString("base64"), -n.response=ee+",p="+ye,this.connection.sendSCRAMClientFinalMessage(this.saslSession. -response)}};a(An,"NeonClient");var _n=An;function $c(r,e){if(e)return{callback:e, +if(c.length===i.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MES\ +SAGE: server nonce is too short");let p=parseInt(h,10),S=y.from(l,"base64"),_=new TextEncoder, +P=_.encode(s),G=await n.importKey("raw",P,{name:"HMAC",hash:{name:"SHA-256"}},!1, +["sign"]),X=new Uint8Array(await n.sign("HMAC",G,y.concat([S,y.from([0,0,0,1])]))), +se=X;for(var C=0;Cse[O]^X[O]));let g=se,R=await n.importKey("raw",g,{name:"HMAC",hash:{ +name:"SHA-256"}},!1,["sign"]),W=new Uint8Array(await n.sign("HMAC",R,_.encode("C\ +lient Key"))),Q=await n.digest("SHA-256",W),j="n=*,r="+i.clientNonce,ee="r="+c+"\ +,s="+l+",i="+p,oe="c=biws,r="+c,L=j+","+ee+","+oe,$=await n.importKey("raw",Q,{name:"\ +HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var ce=new Uint8Array(await n.sign("HM\ +AC",$,_.encode(L))),pe=y.from(W.map((K,O)=>W[O]^ce[O])),xe=pe.toString("base64"); +let Ne=await n.importKey("raw",g,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]), +le=await n.sign("HMAC",Ne,_.encode("Server Key")),nt=await n.importKey("raw",le, +{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var ye=y.from(await n.sign("HMA\ +C",nt,_.encode(L)));i.message="SASLResponse",i.serverSignature=ye.toString("base\ +64"),i.response=oe+",p="+xe,this.connection.sendSCRAMClientFinalMessage(this.saslSession. +response)}};a(An,"NeonClient");var En=An;function Kc(r,e){if(e)return{callback:e, result:void 0};let t,n,i=a(function(o,u){o?t(o):n(u)},"cb"),s=new r(function(o,u){ -n=o,t=u});return{callback:i,result:s}}a($c,"promisify");var Cn=class Cn extends Bt.Pool{constructor(){ -super(...arguments);_(this,"Client",_n);_(this,"hasFetchUnsupportedListeners",!1)}on(t,n){ -return t!=="error"&&(this.hasFetchUnsupportedListeners=!0),super.on(t,n)}query(t,n,i){ -if(!_e.poolQueryViaFetch||this.hasFetchUnsupportedListeners||typeof t=="function") -return super.query(t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=$c(this.Promise, -i);i=s.callback;try{let o=new to.default(this.options),u=encodeURIComponent,c=encodeURI, -h=`postgresql://${u(o.user)}:${u(o.password)}@${u(o.host)}/${c(o.database)}`,l=typeof t== -"string"?t:t.text,d=n??t.values??[];Xs(h,{fullResults:!0,arrayMode:t.rowMode==="\ -array"})(l,d,{types:t.types??this.options?.types}).then(C=>i(void 0,C)).catch(C=>i( -C))}catch(o){i(o)}return s.result}};a(Cn,"NeonPool");var eo=Cn;var export_ClientBase=Qe.ClientBase;var export_Connection=Qe.Connection;var export_DatabaseError=Qe.DatabaseError; -var export_Query=Qe.Query;var export_defaults=Qe.defaults;var export_types=Qe.types; -export{_n as Client,export_ClientBase as ClientBase,export_Connection as Connection, -export_DatabaseError as DatabaseError,pe as NeonDbError,eo as Pool,export_Query as Query, -export_defaults as defaults,Xs as neon,_e as neonConfig,export_types as types}; +n=o,t=u});return{callback:i,result:s}}a(Kc,"promisify");var _n=class _n extends Rt.Pool{constructor(){ +super(...arguments);A(this,"Client",En);A(this,"hasFetchUnsupportedListeners",!1); +A(this,"addListener",this.on)}on(t,n){return t!=="error"&&(this.hasFetchUnsupportedListeners= +!0),super.on(t,n)}query(t,n,i){if(!_e.poolQueryViaFetch||this.hasFetchUnsupportedListeners|| +typeof t=="function")return super.query(t,n,i);typeof n=="function"&&(i=n,n=void 0); +let s=Kc(this.Promise,i);i=s.callback;try{let o=new ro.default(this.options),u=encodeURIComponent, +c=encodeURI,l=`postgresql://${u(o.user)}:${u(o.password)}@${u(o.host)}/${c(o.database)}`, +h=typeof t=="string"?t:t.text,p=n??t.values??[];eo(l,{fullResults:!0,arrayMode:t. +rowMode==="array"})(h,p,{types:t.types??this.options?.types}).then(_=>i(void 0,_)). +catch(_=>i(_))}catch(o){i(o)}return s.result}};a(_n,"NeonPool");var to=_n;var qf="mjs";var export_ClientBase=Cn.ClientBase;var export_defaults=Cn.defaults;var export_types=Cn.types; +export{En as Client,export_ClientBase as ClientBase,de as NeonDbError,to as Pool, +qf as _bundleExt,export_defaults as defaults,eo as neon,_e as neonConfig,export_types as types}; /*! Bundled license information: ieee754/index.js: diff --git a/dist/npm/package-lock.json b/dist/npm/package-lock.json index 116b66c..0ba99bc 100644 --- a/dist/npm/package-lock.json +++ b/dist/npm/package-lock.json @@ -8,162 +8,241 @@ "name": "@neondatabase/serverless", "version": "0.10.4", "license": "MIT", - "dependencies": { - "@types/pg": "^8.6.6" + "devDependencies": { + "@types/node": "^22.10.2", + "@types/pg": "^8.11.10" } }, "node_modules/@types/node": { - "version": "18.15.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", - "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==" + "version": "22.10.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.2.tgz", + "integrity": "sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.20.0" + } }, "node_modules/@types/pg": { - "version": "8.6.6", - "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.6.tgz", - "integrity": "sha512-O2xNmXebtwVekJDD+02udOncjVcMZQuTEQEMpKJ0ZRf5E7/9JJX3izhKUcUifBkyKpljyUM6BTgy2trmviKlpw==", + "version": "8.11.10", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.11.10.tgz", + "integrity": "sha512-LczQUW4dbOQzsH2RQ5qoeJ6qJPdrcM/DcMLoqWQkMLMsq83J5lAX3LXjdkWdpscFy67JSOWDnh7Ny/sPFykmkg==", + "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*", "pg-protocol": "*", - "pg-types": "^2.2.0" + "pg-types": "^4.0.1" } }, + "node_modules/obuf": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", + "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", + "dev": true, + "license": "MIT" + }, "node_modules/pg-int8": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "dev": true, + "license": "ISC", "engines": { "node": ">=4.0.0" } }, + "node_modules/pg-numeric": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pg-numeric/-/pg-numeric-1.0.2.tgz", + "integrity": "sha512-BM/Thnrw5jm2kKLE5uJkXqqExRUY/toLHda65XgFTBTFYZyopbKjBe29Ii3RbkvlsMoFwD+tHeGaCjjv0gHlyw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=4" + } + }, "node_modules/pg-protocol": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.0.tgz", - "integrity": "sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==" + "integrity": "sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==", + "dev": true }, "node_modules/pg-types": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", - "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-4.0.2.tgz", + "integrity": "sha512-cRL3JpS3lKMGsKaWndugWQoLOCoP+Cic8oseVcbr0qhPzYD5DWXK+RZ9LY9wxRf7RQia4SCwQlXk0q6FCPrVng==", + "dev": true, + "license": "MIT", "dependencies": { "pg-int8": "1.0.1", - "postgres-array": "~2.0.0", - "postgres-bytea": "~1.0.0", - "postgres-date": "~1.0.4", - "postgres-interval": "^1.1.0" + "pg-numeric": "1.0.2", + "postgres-array": "~3.0.1", + "postgres-bytea": "~3.0.0", + "postgres-date": "~2.1.0", + "postgres-interval": "^3.0.0", + "postgres-range": "^1.1.1" }, "engines": { - "node": ">=4" + "node": ">=10" } }, "node_modules/postgres-array": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", - "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-3.0.2.tgz", + "integrity": "sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=4" + "node": ">=12" } }, "node_modules/postgres-bytea": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", - "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-3.0.0.tgz", + "integrity": "sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "obuf": "~1.1.2" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 6" } }, "node_modules/postgres-date": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", - "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-2.1.0.tgz", + "integrity": "sha512-K7Juri8gtgXVcDfZttFKVmhglp7epKb1K4pgrkLxehjqkrgPhfG6OO8LHLkfaqkbpjNRnra018XwAr1yQFWGcA==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=12" } }, "node_modules/postgres-interval": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", - "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", - "dependencies": { - "xtend": "^4.0.0" - }, + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-3.0.0.tgz", + "integrity": "sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=12" } }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "engines": { - "node": ">=0.4" - } + "node_modules/postgres-range": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/postgres-range/-/postgres-range-1.1.4.tgz", + "integrity": "sha512-i/hbxIE9803Alj/6ytL7UHQxRvZkI9O4Sy+J3HGc4F4oo/2eQAjTSNJ0bfxyse3bH0nuVesCk+3IRLaMtG3H6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", + "dev": true, + "license": "MIT" } }, "dependencies": { "@types/node": { - "version": "18.15.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", - "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==" + "version": "22.10.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.2.tgz", + "integrity": "sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==", + "dev": true, + "requires": { + "undici-types": "~6.20.0" + } }, "@types/pg": { - "version": "8.6.6", - "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.6.tgz", - "integrity": "sha512-O2xNmXebtwVekJDD+02udOncjVcMZQuTEQEMpKJ0ZRf5E7/9JJX3izhKUcUifBkyKpljyUM6BTgy2trmviKlpw==", + "version": "8.11.10", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.11.10.tgz", + "integrity": "sha512-LczQUW4dbOQzsH2RQ5qoeJ6qJPdrcM/DcMLoqWQkMLMsq83J5lAX3LXjdkWdpscFy67JSOWDnh7Ny/sPFykmkg==", + "dev": true, "requires": { "@types/node": "*", "pg-protocol": "*", - "pg-types": "^2.2.0" + "pg-types": "^4.0.1" } }, + "obuf": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", + "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", + "dev": true + }, "pg-int8": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", - "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==" + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "dev": true + }, + "pg-numeric": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pg-numeric/-/pg-numeric-1.0.2.tgz", + "integrity": "sha512-BM/Thnrw5jm2kKLE5uJkXqqExRUY/toLHda65XgFTBTFYZyopbKjBe29Ii3RbkvlsMoFwD+tHeGaCjjv0gHlyw==", + "dev": true }, "pg-protocol": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.0.tgz", - "integrity": "sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==" + "integrity": "sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==", + "dev": true }, "pg-types": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", - "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-4.0.2.tgz", + "integrity": "sha512-cRL3JpS3lKMGsKaWndugWQoLOCoP+Cic8oseVcbr0qhPzYD5DWXK+RZ9LY9wxRf7RQia4SCwQlXk0q6FCPrVng==", + "dev": true, "requires": { "pg-int8": "1.0.1", - "postgres-array": "~2.0.0", - "postgres-bytea": "~1.0.0", - "postgres-date": "~1.0.4", - "postgres-interval": "^1.1.0" + "pg-numeric": "1.0.2", + "postgres-array": "~3.0.1", + "postgres-bytea": "~3.0.0", + "postgres-date": "~2.1.0", + "postgres-interval": "^3.0.0", + "postgres-range": "^1.1.1" } }, "postgres-array": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", - "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==" + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-3.0.2.tgz", + "integrity": "sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog==", + "dev": true }, "postgres-bytea": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", - "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-3.0.0.tgz", + "integrity": "sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw==", + "dev": true, + "requires": { + "obuf": "~1.1.2" + } }, "postgres-date": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", - "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-2.1.0.tgz", + "integrity": "sha512-K7Juri8gtgXVcDfZttFKVmhglp7epKb1K4pgrkLxehjqkrgPhfG6OO8LHLkfaqkbpjNRnra018XwAr1yQFWGcA==", + "dev": true }, "postgres-interval": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", - "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", - "requires": { - "xtend": "^4.0.0" - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-3.0.0.tgz", + "integrity": "sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw==", + "dev": true + }, + "postgres-range": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/postgres-range/-/postgres-range-1.1.4.tgz", + "integrity": "sha512-i/hbxIE9803Alj/6ytL7UHQxRvZkI9O4Sy+J3HGc4F4oo/2eQAjTSNJ0bfxyse3bH0nuVesCk+3IRLaMtG3H6w==", + "dev": true + }, + "undici-types": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", + "dev": true } } } diff --git a/dist/npm/package.json b/dist/npm/package.json index 856deee..268c000 100644 --- a/dist/npm/package.json +++ b/dist/npm/package.json @@ -30,6 +30,7 @@ "https" ], "dependencies": { - "@types/pg": "8.11.6" + "@types/node": "^22.10.2", + "@types/pg": "^8.8.0" } } diff --git a/dist/serverless.mjs b/dist/serverless.mjs index d58ec68..52f0a73 100644 --- a/dist/serverless.mjs +++ b/dist/serverless.mjs @@ -1,304 +1,307 @@ -var Wa=Object.create;var st=Object.defineProperty;var Ga=Object.getOwnPropertyDescriptor;var Va=Object.getOwnPropertyNames;var za=Object.getPrototypeOf,Ja=Object.prototype.hasOwnProperty;var o=(r,e)=>st(r,"name",{value:e,configurable:!0});var le=(r,e)=>()=>(r&&(e=r(r=0)),e);var B=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),pe=(r,e)=>{for(var t in e) -st(r,t,{get:e[t],enumerable:!0})},$n=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e== -"function")for(let i of Va(e))!Ja.call(r,i)&&i!==t&&st(r,i,{get:()=>e[i],enumerable:!(n= -Ga(e,i))||n.enumerable});return r};var Oe=(r,e,t)=>(t=r!=null?Wa(za(r)):{},$n(e||!r||!r.__esModule?st(t,"default",{ -value:r,enumerable:!0}):t,r)),X=r=>$n(st({},"__esModule",{value:!0}),r);var Kn=B(Pt=>{"use strict";p();Pt.byteLength=Za;Pt.toByteArray=eo;Pt.fromByteArray= -no;var Se=[],ye=[],Ya=typeof Uint8Array<"u"?Uint8Array:Array,ur="ABCDEFGHIJKLMNO\ -PQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ne=0,jn=ur.length;Nect(r,"name",{value:e,configurable:!0}),Wn=(r=>typeof require<"u"?require: +typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)( +function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error( +'Dynamic require of "'+r+'" is not supported')});var de=(r,e)=>()=>(r&&(e=r(r=0)),e);var B=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ge=(r,e)=>{for(var t in e) +ct(r,t,{get:e[t],enumerable:!0})},Vn=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e== +"function")for(let i of ea(e))!ra.call(r,i)&&i!==t&&ct(r,i,{get:()=>e[i],enumerable:!(n= +Xo(e,i))||n.enumerable});return r};var je=(r,e,t)=>(t=r!=null?Zo(ta(r)):{},Vn(e||!r||!r.__esModule?ct(t,"default",{ +value:r,enumerable:!0}):t,r)),ne=r=>Vn(ct({},"__esModule",{value:!0}),r);var Jn=B(qt=>{"use strict";y();qt.byteLength=ia;qt.toByteArray=oa;qt.fromByteArray= +ua;var Ae=[],we=[],na=typeof Uint8Array<"u"?Uint8Array:Array,fr="ABCDEFGHIJKLMNO\ +PQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(De=0,Gn=fr.length;De0)throw new Error("Invalid string. Length must be a multip\ -le of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}o(Hn, -"getLens");function Za(r){var e=Hn(r),t=e[0],n=e[1];return(t+n)*3/4-n}o(Za,"byte\ -Length");function Xa(r,e,t){return(e+t)*3/4-t}o(Xa,"_byteLength");function eo(r){ -var e,t=Hn(r),n=t[0],i=t[1],s=new Ya(Xa(r,n,i)),a=0,u=i>0?n-4:n,c;for(c=0;c>16&255,s[a++]=e>>8&255,s[a++]=e&255;return i===2&&(e= -ye[r.charCodeAt(c)]<<2|ye[r.charCodeAt(c+1)]>>4,s[a++]=e&255),i===1&&(e=ye[r.charCodeAt( -c)]<<10|ye[r.charCodeAt(c+1)]<<4|ye[r.charCodeAt(c+2)]>>2,s[a++]=e>>8&255,s[a++]= -e&255),s}o(eo,"toByteArray");function to(r){return Se[r>>18&63]+Se[r>>12&63]+Se[r>> -6&63]+Se[r&63]}o(to,"tripletToBase64");function ro(r,e,t){for(var n,i=[],s=e;su?u:a+s));return n===1?(e=r[t-1],i.push(Se[e>>2]+ -Se[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(Se[e>>10]+Se[e>>4&63]+Se[e<< -2&63]+"=")),i.join("")}o(no,"fromByteArray")});var Wn=B(cr=>{p();cr.read=function(r,e,t,n,i){var s,a,u=i*8-n-1,c=(1<> -1,h=-7,f=t?i-1:0,y=t?-1:1,m=r[e+f];for(f+=y,s=m&(1<<-h)-1,m>>=-h,h+=u;h>0;s=s*256+ -r[e+f],f+=y,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=n;h>0;a=a*256+r[e+f],f+=y,h-=8);if(s=== -0)s=1-l;else{if(s===c)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,n),s=s-l}return(m? --1:1)*a*Math.pow(2,s-n)};cr.write=function(r,e,t,n,i,s){var a,u,c,l=s*8-i-1,h=(1<< -l)-1,f=h>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:s-1,b=n?1:-1,U=e<0|| -e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=h):(a=Math. -floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+f>=1?e+=y/c:e+= -y*Math.pow(2,1-f),e*c>=2&&(a++,c/=2),a+f>=h?(u=0,a=h):a+f>=1?(u=(e*c-1)*Math.pow( -2,i),a=a+f):(u=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;r[t+m]=u&255,m+=b,u/=256, -i-=8);for(a=a<0;r[t+m]=a&255,m+=b,a/=256,l-=8);r[t+m-b]|=U*128}});var ci=B(je=>{"use strict";p();var lr=Kn(),Qe=Wn(),Gn=typeof Symbol=="function"&& -typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;je.Buffer= -d;je.SlowBuffer=co;je.INSPECT_MAX_BYTES=50;var Bt=2147483647;je.kMaxLength=Bt;d. -TYPED_ARRAY_SUPPORT=io();!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console. +le of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}a(zn, +"getLens");function ia(r){var e=zn(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(ia,"byte\ +Length");function sa(r,e,t){return(e+t)*3/4-t}a(sa,"_byteLength");function oa(r){ +var e,t=zn(r),n=t[0],i=t[1],s=new na(sa(r,n,i)),o=0,c=i>0?n-4:n,u;for(u=0;u>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e= +we[r.charCodeAt(u)]<<2|we[r.charCodeAt(u+1)]>>4,s[o++]=e&255),i===1&&(e=we[r.charCodeAt( +u)]<<10|we[r.charCodeAt(u+1)]<<4|we[r.charCodeAt(u+2)]>>2,s[o++]=e>>8&255,s[o++]= +e&255),s}a(oa,"toByteArray");function aa(r){return Ae[r>>18&63]+Ae[r>>12&63]+Ae[r>> +6&63]+Ae[r&63]}a(aa,"tripletToBase64");function ca(r,e,t){for(var n,i=[],s=e;sc?c:o+s));return n===1?(e=r[t-1],i.push(Ae[e>>2]+ +Ae[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(Ae[e>>10]+Ae[e>>4&63]+Ae[e<< +2&63]+"=")),i.join("")}a(ua,"fromByteArray")});var Yn=B(dr=>{y();dr.read=function(r,e,t,n,i){var s,o,c=i*8-n-1,u=(1<> +1,h=-7,f=t?i-1:0,g=t?-1:1,p=r[e+f];for(f+=g,s=p&(1<<-h)-1,p>>=-h,h+=c;h>0;s=s*256+ +r[e+f],f+=g,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=n;h>0;o=o*256+r[e+f],f+=g,h-=8);if(s=== +0)s=1-l;else{if(s===u)return o?NaN:(p?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(p? +-1:1)*o*Math.pow(2,s-n)};dr.write=function(r,e,t,n,i,s){var o,c,u,l=s*8-i-1,h=(1<< +l)-1,f=h>>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:s-1,E=n?1:-1,C=e<0|| +e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,o=h):(o=Math. +floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+f>=1?e+=g/u:e+= +g*Math.pow(2,1-f),e*u>=2&&(o++,u/=2),o+f>=h?(c=0,o=h):o+f>=1?(c=(e*u-1)*Math.pow( +2,i),o=o+f):(c=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;r[t+p]=c&255,p+=E,c/=256, +i-=8);for(o=o<0;r[t+p]=o&255,p+=E,o/=256,l-=8);r[t+p-E]|=C*128}});var pi=B(Ge=>{"use strict";y();var pr=Jn(),We=Yn(),Zn=typeof Symbol=="function"&& +typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ge.Buffer= +d;Ge.SlowBuffer=ya;Ge.INSPECT_MAX_BYTES=50;var kt=2147483647;Ge.kMaxLength=kt;d. +TYPED_ARRAY_SUPPORT=la();!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console. error=="function"&&console.error("This browser lacks typed array (Uint8Array) su\ pport which is required by `buffer` v5.x. Use `buffer` v4.x if you require old b\ -rowser support.");function io(){try{let r=new Uint8Array(1),e={foo:o(function(){ +rowser support.");function la(){try{let r=new Uint8Array(1),e={foo:a(function(){ return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf( -r,e),r.foo()===42}catch{return!1}}o(io,"typedArraySupport");Object.defineProperty( -d.prototype,"parent",{enumerable:!0,get:o(function(){if(d.isBuffer(this))return this. -buffer},"get")});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:o( -function(){if(d.isBuffer(this))return this.byteOffset},"get")});function Ae(r){if(r> -Bt)throw new RangeError('The value "'+r+'" is invalid for option "size"');let e=new Uint8Array( -r);return Object.setPrototypeOf(e,d.prototype),e}o(Ae,"createBuffer");function d(r,e,t){ +r,e),r.foo()===42}catch{return!1}}a(la,"typedArraySupport");Object.defineProperty( +d.prototype,"parent",{enumerable:!0,get:a(function(){if(d.isBuffer(this))return this. +buffer},"get")});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:a( +function(){if(d.isBuffer(this))return this.byteOffset},"get")});function Re(r){if(r> +kt)throw new RangeError('The value "'+r+'" is invalid for option "size"');let e=new Uint8Array( +r);return Object.setPrototypeOf(e,d.prototype),e}a(Re,"createBuffer");function d(r,e,t){ if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" a\ -rgument must be of type string. Received type number');return pr(r)}return Yn(r, -e,t)}o(d,"Buffer");d.poolSize=8192;function Yn(r,e,t){if(typeof r=="string")return ao( -r,e);if(ArrayBuffer.isView(r))return oo(r);if(r==null)throw new TypeError("The f\ +rgument must be of type string. Received type number');return wr(r)}return ri(r, +e,t)}a(d,"Buffer");d.poolSize=8192;function ri(r,e,t){if(typeof r=="string")return fa( +r,e);if(ArrayBuffer.isView(r))return da(r);if(r==null)throw new TypeError("The f\ irst argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-l\ -ike Object. Received type "+typeof r);if(Ee(r,ArrayBuffer)||r&&Ee(r.buffer,ArrayBuffer)|| -typeof SharedArrayBuffer<"u"&&(Ee(r,SharedArrayBuffer)||r&&Ee(r.buffer,SharedArrayBuffer))) -return fr(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument\ +ike Object. Received type "+typeof r);if(ve(r,ArrayBuffer)||r&&ve(r.buffer,ArrayBuffer)|| +typeof SharedArrayBuffer<"u"&&(ve(r,SharedArrayBuffer)||r&&ve(r.buffer,SharedArrayBuffer))) +return mr(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument\ must not be of type number. Received type number');let n=r.valueOf&&r.valueOf(); -if(n!=null&&n!==r)return d.from(n,e,t);let i=uo(r);if(i)return i;if(typeof Symbol< +if(n!=null&&n!==r)return d.from(n,e,t);let i=pa(r);if(i)return i;if(typeof Symbol< "u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return d. from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argumen\ t must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. \ -Received type "+typeof r)}o(Yn,"from");d.from=function(r,e,t){return Yn(r,e,t)}; +Received type "+typeof r)}a(ri,"from");d.from=function(r,e,t){return ri(r,e,t)}; Object.setPrototypeOf(d.prototype,Uint8Array.prototype);Object.setPrototypeOf(d, -Uint8Array);function Zn(r){if(typeof r!="number")throw new TypeError('"size" arg\ +Uint8Array);function ni(r){if(typeof r!="number")throw new TypeError('"size" arg\ ument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is\ - invalid for option "size"')}o(Zn,"assertSize");function so(r,e,t){return Zn(r), -r<=0?Ae(r):e!==void 0?typeof t=="string"?Ae(r).fill(e,t):Ae(r).fill(e):Ae(r)}o(so, -"alloc");d.alloc=function(r,e,t){return so(r,e,t)};function pr(r){return Zn(r),Ae( -r<0?0:yr(r)|0)}o(pr,"allocUnsafe");d.allocUnsafe=function(r){return pr(r)};d.allocUnsafeSlow= -function(r){return pr(r)};function ao(r,e){if((typeof e!="string"||e==="")&&(e="\ -utf8"),!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=Xn(r,e)| -0,n=Ae(t),i=n.write(r,e);return i!==t&&(n=n.slice(0,i)),n}o(ao,"fromString");function hr(r){ -let e=r.length<0?0:yr(r.length)|0,t=Ae(e);for(let n=0;n= -Bt)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ -Bt.toString(16)+" bytes");return r|0}o(yr,"checked");function co(r){return+r!=r&& -(r=0),d.alloc(+r)}o(co,"SlowBuffer");d.isBuffer=o(function(e){return e!=null&&e. -_isBuffer===!0&&e!==d.prototype},"isBuffer");d.compare=o(function(e,t){if(Ee(e,Uint8Array)&& -(e=d.from(e,e.offset,e.byteLength)),Ee(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)), +n,d.prototype),n}a(mr,"fromArrayBuffer");function pa(r){if(d.isBuffer(r)){let e=Sr( +r.length)|0,t=Re(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0) +return typeof r.length!="number"||Er(r.length)?Re(0):yr(r);if(r.type==="Buffer"&& +Array.isArray(r.data))return yr(r.data)}a(pa,"fromObject");function Sr(r){if(r>= +kt)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ +kt.toString(16)+" bytes");return r|0}a(Sr,"checked");function ya(r){return+r!=r&& +(r=0),d.alloc(+r)}a(ya,"SlowBuffer");d.isBuffer=a(function(e){return e!=null&&e. +_isBuffer===!0&&e!==d.prototype},"isBuffer");d.compare=a(function(e,t){if(ve(e,Uint8Array)&& +(e=d.from(e,e.offset,e.byteLength)),ve(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)), !d.isBuffer(e)||!d.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments\ must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,i=t. -length;for(let s=0,a=Math.min(n,i);si.length?(d.isBuffer( -a)||(a=d.from(a)),a.copy(i,s)):Uint8Array.prototype.set.call(i,a,s);else if(d.isBuffer( -a))a.copy(i,s);else throw new TypeError('"list" argument must be an Array of Buf\ -fers');s+=a.length}return i},"concat");function Xn(r,e){if(d.isBuffer(r))return r. -length;if(ArrayBuffer.isView(r)||Ee(r,ArrayBuffer))return r.byteLength;if(typeof r!= +for(n=0;ni.length?(d.isBuffer( +o)||(o=d.from(o)),o.copy(i,s)):Uint8Array.prototype.set.call(i,o,s);else if(d.isBuffer( +o))o.copy(i,s);else throw new TypeError('"list" argument must be an Array of Buf\ +fers');s+=o.length}return i},"concat");function ii(r,e){if(d.isBuffer(r))return r. +length;if(ArrayBuffer.isView(r)||ve(r,ArrayBuffer))return r.byteLength;if(typeof r!= "string")throw new TypeError('The "string" argument must be one of type string, \ Buffer, or ArrayBuffer. Received type '+typeof r);let t=r.length,n=arguments.length> 2&&arguments[2]===!0;if(!n&&t===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"\ -latin1":case"binary":return t;case"utf8":case"utf-8":return dr(r).length;case"uc\ +latin1":case"binary":return t;case"utf8":case"utf-8":return gr(r).length;case"uc\ s2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"\ -base64":return ui(r).length;default:if(i)return n?-1:dr(r).length;e=(""+e).toLowerCase(), -i=!0}}o(Xn,"byteLength");d.byteLength=Xn;function lo(r,e,t){let n=!1;if((e===void 0|| +base64":return di(r).length;default:if(i)return n?-1:gr(r).length;e=(""+e).toLowerCase(), +i=!0}}a(ii,"byteLength");d.byteLength=ii;function ma(r,e,t){let n=!1;if((e===void 0|| e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)|| -(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return bo( -this,e,t);case"utf8":case"utf-8":return ti(this,e,t);case"ascii":return So(this, -e,t);case"latin1":case"binary":return Eo(this,e,t);case"base64":return mo(this,e, -t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xo(this,e,t);default: -if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}o( -lo,"slowToString");d.prototype._isBuffer=!0;function Me(r,e,t){let n=r[e];r[e]=r[t], -r[t]=n}o(Me,"swap");d.prototype.swap16=o(function(){let e=this.length;if(e%2!==0) +(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Ta( +this,e,t);case"utf8":case"utf-8":return oi(this,e,t);case"ascii":return va(this, +e,t);case"latin1":case"binary":return Ca(this,e,t);case"base64":return xa(this,e, +t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ra(this,e,t);default: +if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a( +ma,"slowToString");d.prototype._isBuffer=!0;function Oe(r,e,t){let n=r[e];r[e]=r[t], +r[t]=n}a(Oe,"swap");d.prototype.swap16=a(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;t< -e;t+=2)Me(this,t,t+1);return this},"swap16");d.prototype.swap32=o(function(){let e=this. +e;t+=2)Oe(this,t,t+1);return this},"swap16");d.prototype.swap32=a(function(){let e=this. length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bit\ -s");for(let t=0;tt&&(e+=" ... "),""},"inspect");Gn&&(d.prototype[Gn]=d.prototype.inspect);d.prototype.compare= -o(function(e,t,n,i,s){if(Ee(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d. +e+">"},"inspect");Zn&&(d.prototype[Zn]=d.prototype.inspect);d.prototype.compare= +a(function(e,t,n,i,s){if(ve(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d. isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffe\ r or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e? e.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),t<0||n>e.length||i<0|| s>this.length)throw new RangeError("out of range index");if(i>=s&&t>=n)return 0; if(i>=s)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,s>>>=0,this===e)return 0; -let a=s-i,u=n-t,c=Math.min(a,u),l=this.slice(i,s),h=e.slice(t,n);for(let f=0;f2147483647?t=2147483647: -t<-2147483648&&(t=-2147483648),t=+t,mr(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t), +t<-2147483648&&(t=-2147483648),t=+t,Er(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t), t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e== -"string"&&(e=d.from(e,n)),d.isBuffer(e))return e.length===0?-1:Vn(r,e,t,n,i);if(typeof e== +"string"&&(e=d.from(e,n)),d.isBuffer(e))return e.length===0?-1:Xn(r,e,t,n,i);if(typeof e== "number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array. -prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Vn(r, -[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}o(ei,"bid\ -irectionalIndexOf");function Vn(r,e,t,n,i){let s=1,a=r.length,u=e.length;if(n!== +prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Xn(r, +[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(si,"bid\ +irectionalIndexOf");function Xn(r,e,t,n,i){let s=1,o=r.length,c=e.length;if(n!== void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="\ -utf-16le")){if(r.length<2||e.length<2)return-1;s=2,a/=2,u/=2,t/=2}function c(h,f){ -return s===1?h[f]:h.readUInt16BE(f*s)}o(c,"read");let l;if(i){let h=-1;for(l=t;l< -a;l++)if(c(r,l)===c(e,h===-1?0:l-h)){if(h===-1&&(h=l),l-h+1===u)return h*s}else h!== --1&&(l-=l-h),h=-1}else for(t+u>a&&(t=a-u),l=t;l>=0;l--){let h=!0;for(let f=0;fo&&(t=o-c),l=t;l>=0;l--){let h=!0;for(let f=0;fi&&(n=i)):n=i;let s=e.length;n> -s/2&&(n=s/2);let a;for(a=0;a>>0,isFinite(n)? (n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.wri\ te(string, encoding, offset[, length]) is no longer supported");let s=this.length- t;if((n===void 0||n>s)&&(n=s),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError( -"Attempt to write outside buffer bounds");i||(i="utf8");let a=!1;for(;;)switch(i){case"\ -hex":return ho(this,e,t,n);case"utf8":case"utf-8":return fo(this,e,t,n);case"asc\ -ii":case"latin1":case"binary":return po(this,e,t,n);case"base64":return yo(this, -e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wo(this,e,t,n);default: -if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}},"\ -write");d.prototype.toJSON=o(function(){return{type:"Buffer",data:Array.prototype. -slice.call(this._arr||this,0)}},"toJSON");function mo(r,e,t){return e===0&&t===r. -length?lr.fromByteArray(r):lr.fromByteArray(r.slice(e,t))}o(mo,"base64Slice");function ti(r,e,t){ -t=Math.min(r.length,t);let n=[],i=e;for(;i239?4:s>223? -3:s>191?2:1;if(i+u<=t){let c,l,h,f;switch(u){case 1:s<128&&(a=s);break;case 2:c= -r[i+1],(c&192)===128&&(f=(s&31)<<6|c&63,f>127&&(a=f));break;case 3:c=r[i+1],l=r[i+ -2],(c&192)===128&&(l&192)===128&&(f=(s&15)<<12|(c&63)<<6|l&63,f>2047&&(f<55296|| -f>57343)&&(a=f));break;case 4:c=r[i+1],l=r[i+2],h=r[i+3],(c&192)===128&&(l&192)=== -128&&(h&192)===128&&(f=(s&15)<<18|(c&63)<<12|(l&63)<<6|h&63,f>65535&&f<1114112&& -(a=f))}}a===null?(a=65533,u=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320| -a&1023),n.push(a),i+=u}return go(n)}o(ti,"utf8Slice");var zn=4096;function go(r){ -let e=r.length;if(e<=zn)return String.fromCharCode.apply(String,r);let t="",n=0; -for(;n239?4:s>223? +3:s>191?2:1;if(i+c<=t){let u,l,h,f;switch(c){case 1:s<128&&(o=s);break;case 2:u= +r[i+1],(u&192)===128&&(f=(s&31)<<6|u&63,f>127&&(o=f));break;case 3:u=r[i+1],l=r[i+ +2],(u&192)===128&&(l&192)===128&&(f=(s&15)<<12|(u&63)<<6|l&63,f>2047&&(f<55296|| +f>57343)&&(o=f));break;case 4:u=r[i+1],l=r[i+2],h=r[i+3],(u&192)===128&&(l&192)=== +128&&(h&192)===128&&(f=(s&15)<<18|(u&63)<<12|(l&63)<<6|h&63,f>65535&&f<1114112&& +(o=f))}}o===null?(o=65533,c=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320| +o&1023),n.push(o),i+=c}return Aa(n)}a(oi,"utf8Slice");var ei=4096;function Aa(r){ +let e=r.length;if(e<=ei)return String.fromCharCode.apply(String,r);let t="",n=0; +for(;nn)&&(t=n);let i="";for(let s=e;sn)&&(t=n);let i="";for(let s=e;sn&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),tt)throw new RangeError( -"Trying to access beyond buffer length")}o(ee,"checkOffset");d.prototype.readUintLE= -d.prototype.readUIntLE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||ee(e,t,this.length); -let i=this[e],s=1,a=0;for(;++a>>0,t=t>>>0, -n||ee(e,t,this.length);let i=this[e+--t],s=1;for(;t>0&&(s*=256);)i+=this[e+--t]* -s;return i},"readUIntBE");d.prototype.readUint8=d.prototype.readUInt8=o(function(e,t){ -return e=e>>>0,t||ee(e,1,this.length),this[e]},"readUInt8");d.prototype.readUint16LE= -d.prototype.readUInt16LE=o(function(e,t){return e=e>>>0,t||ee(e,2,this.length),this[e]| +"Trying to access beyond buffer length")}a(ie,"checkOffset");d.prototype.readUintLE= +d.prototype.readUIntLE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||ie(e,t,this.length); +let i=this[e],s=1,o=0;for(;++o>>0,t=t>>>0, +n||ie(e,t,this.length);let i=this[e+--t],s=1;for(;t>0&&(s*=256);)i+=this[e+--t]* +s;return i},"readUIntBE");d.prototype.readUint8=d.prototype.readUInt8=a(function(e,t){ +return e=e>>>0,t||ie(e,1,this.length),this[e]},"readUInt8");d.prototype.readUint16LE= +d.prototype.readUInt16LE=a(function(e,t){return e=e>>>0,t||ie(e,2,this.length),this[e]| this[e+1]<<8},"readUInt16LE");d.prototype.readUint16BE=d.prototype.readUInt16BE= -o(function(e,t){return e=e>>>0,t||ee(e,2,this.length),this[e]<<8|this[e+1]},"rea\ -dUInt16BE");d.prototype.readUint32LE=d.prototype.readUInt32LE=o(function(e,t){return e= -e>>>0,t||ee(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216}, -"readUInt32LE");d.prototype.readUint32BE=d.prototype.readUInt32BE=o(function(e,t){ -return e=e>>>0,t||ee(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<< -8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=_e(o(function(e){e=e>>> -0,$e(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&at(e,this.length- +a(function(e,t){return e=e>>>0,t||ie(e,2,this.length),this[e]<<8|this[e+1]},"rea\ +dUInt16BE");d.prototype.readUint32LE=d.prototype.readUInt32LE=a(function(e,t){return e= +e>>>0,t||ie(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216}, +"readUInt32LE");d.prototype.readUint32BE=d.prototype.readUInt32BE=a(function(e,t){ +return e=e>>>0,t||ie(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<< +8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Le(a(function(e){e=e>>> +0,Ve(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ut(e,this.length- 8);let i=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]* 2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(s)<>>0,$e(e,"offset");let t=this[e], -n=this[e+7];(t===void 0||n===void 0)&&at(e,this.length-8);let i=t*2**24+this[++e]* +Int64LE"));d.prototype.readBigUInt64BE=Le(a(function(e){e=e>>>0,Ve(e,"offset");let t=this[e], +n=this[e+7];(t===void 0||n===void 0)&&ut(e,this.length-8);let i=t*2**24+this[++e]* 2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+ n;return(BigInt(i)<>>0,t=t>>>0,n||ee(e,t,this.length);let i=this[e],s=1,a=0;for(;++a< -t&&(s*=256);)i+=this[e+a]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*t)),i},"readInt\ -LE");d.prototype.readIntBE=o(function(e,t,n){e=e>>>0,t=t>>>0,n||ee(e,t,this.length); -let i=t,s=1,a=this[e+--i];for(;i>0&&(s*=256);)a+=this[e+--i]*s;return s*=128,a>= -s&&(a-=Math.pow(2,8*t)),a},"readIntBE");d.prototype.readInt8=o(function(e,t){return e= -e>>>0,t||ee(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8"); -d.prototype.readInt16LE=o(function(e,t){e=e>>>0,t||ee(e,2,this.length);let n=this[e]| +a(function(e,t,n){e=e>>>0,t=t>>>0,n||ie(e,t,this.length);let i=this[e],s=1,o=0;for(;++o< +t&&(s*=256);)i+=this[e+o]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*t)),i},"readInt\ +LE");d.prototype.readIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||ie(e,t,this.length); +let i=t,s=1,o=this[e+--i];for(;i>0&&(s*=256);)o+=this[e+--i]*s;return s*=128,o>= +s&&(o-=Math.pow(2,8*t)),o},"readIntBE");d.prototype.readInt8=a(function(e,t){return e= +e>>>0,t||ie(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8"); +d.prototype.readInt16LE=a(function(e,t){e=e>>>0,t||ie(e,2,this.length);let n=this[e]| this[e+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");d.prototype.readInt16BE= -o(function(e,t){e=e>>>0,t||ee(e,2,this.length);let n=this[e+1]|this[e]<<8;return n& -32768?n|4294901760:n},"readInt16BE");d.prototype.readInt32LE=o(function(e,t){return e= -e>>>0,t||ee(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"\ -readInt32LE");d.prototype.readInt32BE=o(function(e,t){return e=e>>>0,t||ee(e,4,this. +a(function(e,t){e=e>>>0,t||ie(e,2,this.length);let n=this[e+1]|this[e]<<8;return n& +32768?n|4294901760:n},"readInt16BE");d.prototype.readInt32LE=a(function(e,t){return e= +e>>>0,t||ie(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"\ +readInt32LE");d.prototype.readInt32BE=a(function(e,t){return e=e>>>0,t||ie(e,4,this. length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");d.prototype. -readBigInt64LE=_e(o(function(e){e=e>>>0,$e(e,"offset");let t=this[e],n=this[e+7]; -(t===void 0||n===void 0)&&at(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+ +readBigInt64LE=Le(a(function(e){e=e>>>0,Ve(e,"offset");let t=this[e],n=this[e+7]; +(t===void 0||n===void 0)&&ut(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+ 6]*2**16+(n<<24);return(BigInt(i)<>>0,$e(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&at(e, +2**16+this[++e]*2**24)},"readBigInt64LE"));d.prototype.readBigInt64BE=Le(a(function(e){ +e=e>>>0,Ve(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ut(e, this.length-8);let i=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt( i)<>>0,t||ee(e,4,this. -length),Qe.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE=o(function(e,t){ -return e=e>>>0,t||ee(e,4,this.length),Qe.read(this,e,!1,23,4)},"readFloatBE");d. -prototype.readDoubleLE=o(function(e,t){return e=e>>>0,t||ee(e,8,this.length),Qe. -read(this,e,!0,52,8)},"readDoubleLE");d.prototype.readDoubleBE=o(function(e,t){return e= -e>>>0,t||ee(e,8,this.length),Qe.read(this,e,!1,52,8)},"readDoubleBE");function he(r,e,t,n,i,s){ +igInt64BE"));d.prototype.readFloatLE=a(function(e,t){return e=e>>>0,t||ie(e,4,this. +length),We.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE=a(function(e,t){ +return e=e>>>0,t||ie(e,4,this.length),We.read(this,e,!1,23,4)},"readFloatBE");d. +prototype.readDoubleLE=a(function(e,t){return e=e>>>0,t||ie(e,8,this.length),We. +read(this,e,!0,52,8)},"readDoubleLE");d.prototype.readDoubleBE=a(function(e,t){return e= +e>>>0,t||ie(e,8,this.length),We.read(this,e,!1,52,8)},"readDoubleBE");function pe(r,e,t,n,i,s){ if(!d.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instan\ ce');if(e>i||er.length)throw new RangeError("Index out of range")}o(he,"checkInt");d.prototype. -writeUintLE=d.prototype.writeUIntLE=o(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0, -!i){let u=Math.pow(2,8*n)-1;he(this,e,t,n,u,0)}let s=1,a=0;for(this[t]=e&255;++a< -n&&(s*=256);)this[t+a]=e/s&255;return t+n},"writeUIntLE");d.prototype.writeUintBE= -d.prototype.writeUIntBE=o(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let u=Math. -pow(2,8*n)-1;he(this,e,t,n,u,0)}let s=n-1,a=1;for(this[t+s]=e&255;--s>=0&&(a*=256);) -this[t+s]=e/a&255;return t+n},"writeUIntBE");d.prototype.writeUint8=d.prototype. -writeUInt8=o(function(e,t,n){return e=+e,t=t>>>0,n||he(this,e,t,1,255,0),this[t]= -e&255,t+1},"writeUInt8");d.prototype.writeUint16LE=d.prototype.writeUInt16LE=o(function(e,t,n){ -return e=+e,t=t>>>0,n||he(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2}, -"writeUInt16LE");d.prototype.writeUint16BE=d.prototype.writeUInt16BE=o(function(e,t,n){ -return e=+e,t=t>>>0,n||he(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2}, -"writeUInt16BE");d.prototype.writeUint32LE=d.prototype.writeUInt32LE=o(function(e,t,n){ -return e=+e,t=t>>>0,n||he(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>> +n>r.length)throw new RangeError("Index out of range")}a(pe,"checkInt");d.prototype. +writeUintLE=d.prototype.writeUIntLE=a(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0, +!i){let c=Math.pow(2,8*n)-1;pe(this,e,t,n,c,0)}let s=1,o=0;for(this[t]=e&255;++o< +n&&(s*=256);)this[t+o]=e/s&255;return t+n},"writeUIntLE");d.prototype.writeUintBE= +d.prototype.writeUIntBE=a(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let c=Math. +pow(2,8*n)-1;pe(this,e,t,n,c,0)}let s=n-1,o=1;for(this[t+s]=e&255;--s>=0&&(o*=256);) +this[t+s]=e/o&255;return t+n},"writeUIntBE");d.prototype.writeUint8=d.prototype. +writeUInt8=a(function(e,t,n){return e=+e,t=t>>>0,n||pe(this,e,t,1,255,0),this[t]= +e&255,t+1},"writeUInt8");d.prototype.writeUint16LE=d.prototype.writeUInt16LE=a(function(e,t,n){ +return e=+e,t=t>>>0,n||pe(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2}, +"writeUInt16LE");d.prototype.writeUint16BE=d.prototype.writeUInt16BE=a(function(e,t,n){ +return e=+e,t=t>>>0,n||pe(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2}, +"writeUInt16BE");d.prototype.writeUint32LE=d.prototype.writeUInt32LE=a(function(e,t,n){ +return e=+e,t=t>>>0,n||pe(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},"writeUInt32LE");d.prototype.writeUint32BE= -d.prototype.writeUInt32BE=o(function(e,t,n){return e=+e,t=t>>>0,n||he(this,e,t,4, +d.prototype.writeUInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||pe(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},"writeUInt32BE");function ri(r,e,t,n,i){oi(e,n,i,r,t,7);let s=Number(e&BigInt( -4294967295));r[t++]=s,s=s>>8,r[t++]=s,s=s>>8,r[t++]=s,s=s>>8,r[t++]=s;let a=Number( -e>>BigInt(32)&BigInt(4294967295));return r[t++]=a,a=a>>8,r[t++]=a,a=a>>8,r[t++]= -a,a=a>>8,r[t++]=a,t}o(ri,"wrtBigUInt64LE");function ni(r,e,t,n,i){oi(e,n,i,r,t,7); +4},"writeUInt32BE");function ai(r,e,t,n,i){fi(e,n,i,r,t,7);let s=Number(e&BigInt( +4294967295));r[t++]=s,s=s>>8,r[t++]=s,s=s>>8,r[t++]=s,s=s>>8,r[t++]=s;let o=Number( +e>>BigInt(32)&BigInt(4294967295));return r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]= +o,o=o>>8,r[t++]=o,t}a(ai,"wrtBigUInt64LE");function ci(r,e,t,n,i){fi(e,n,i,r,t,7); let s=Number(e&BigInt(4294967295));r[t+7]=s,s=s>>8,r[t+6]=s,s=s>>8,r[t+5]=s,s=s>> -8,r[t+4]=s;let a=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+3]=a,a=a>>8, -r[t+2]=a,a=a>>8,r[t+1]=a,a=a>>8,r[t]=a,t+8}o(ni,"wrtBigUInt64BE");d.prototype.writeBigUInt64LE= -_e(o(function(e,t=0){return ri(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}, -"writeBigUInt64LE"));d.prototype.writeBigUInt64BE=_e(o(function(e,t=0){return ni( +8,r[t+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+3]=o,o=o>>8, +r[t+2]=o,o=o>>8,r[t+1]=o,o=o>>8,r[t]=o,t+8}a(ci,"wrtBigUInt64BE");d.prototype.writeBigUInt64LE= +Le(a(function(e,t=0){return ai(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}, +"writeBigUInt64LE"));d.prototype.writeBigUInt64BE=Le(a(function(e,t=0){return ci( this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));d.prototype. -writeIntLE=o(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2,8*n-1);he(this, -e,t,n,c-1,-c)}let s=0,a=1,u=0;for(this[t]=e&255;++s>0)-u&255;return t+n},"writeIntLE");d.prototype.writeIntBE= -o(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2,8*n-1);he(this,e,t,n,c- -1,-c)}let s=n-1,a=1,u=0;for(this[t+s]=e&255;--s>=0&&(a*=256);)e<0&&u===0&&this[t+ -s+1]!==0&&(u=1),this[t+s]=(e/a>>0)-u&255;return t+n},"writeIntBE");d.prototype.writeInt8= -o(function(e,t,n){return e=+e,t=t>>>0,n||he(this,e,t,1,127,-128),e<0&&(e=255+e+1), -this[t]=e&255,t+1},"writeInt8");d.prototype.writeInt16LE=o(function(e,t,n){return e= -+e,t=t>>>0,n||he(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},"wr\ -iteInt16LE");d.prototype.writeInt16BE=o(function(e,t,n){return e=+e,t=t>>>0,n||he( +writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let u=Math.pow(2,8*n-1);pe(this, +e,t,n,u-1,-u)}let s=0,o=1,c=0;for(this[t]=e&255;++s>0)-c&255;return t+n},"writeIntLE");d.prototype.writeIntBE= +a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let u=Math.pow(2,8*n-1);pe(this,e,t,n,u- +1,-u)}let s=n-1,o=1,c=0;for(this[t+s]=e&255;--s>=0&&(o*=256);)e<0&&c===0&&this[t+ +s+1]!==0&&(c=1),this[t+s]=(e/o>>0)-c&255;return t+n},"writeIntBE");d.prototype.writeInt8= +a(function(e,t,n){return e=+e,t=t>>>0,n||pe(this,e,t,1,127,-128),e<0&&(e=255+e+1), +this[t]=e&255,t+1},"writeInt8");d.prototype.writeInt16LE=a(function(e,t,n){return e= ++e,t=t>>>0,n||pe(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},"wr\ +iteInt16LE");d.prototype.writeInt16BE=a(function(e,t,n){return e=+e,t=t>>>0,n||pe( this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeInt16BE");d.prototype. -writeInt32LE=o(function(e,t,n){return e=+e,t=t>>>0,n||he(this,e,t,4,2147483647,-2147483648), +writeInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||pe(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},"writeInt32\ -LE");d.prototype.writeInt32BE=o(function(e,t,n){return e=+e,t=t>>>0,n||he(this,e, +LE");d.prototype.writeInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||pe(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},"writeInt32BE");d.prototype.writeBigInt64LE= -_e(o(function(e,t=0){return ri(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x\ -7fffffffffffffff"))},"writeBigInt64LE"));d.prototype.writeBigInt64BE=_e(o(function(e,t=0){ -return ni(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}, -"writeBigInt64BE"));function ii(r,e,t,n,i,s){if(t+n>r.length)throw new RangeError( -"Index out of range");if(t<0)throw new RangeError("Index out of range")}o(ii,"ch\ -eckIEEE754");function si(r,e,t,n,i){return e=+e,t=t>>>0,i||ii(r,e,t,4,34028234663852886e22, --34028234663852886e22),Qe.write(r,e,t,n,23,4),t+4}o(si,"writeFloat");d.prototype. -writeFloatLE=o(function(e,t,n){return si(this,e,t,!0,n)},"writeFloatLE");d.prototype. -writeFloatBE=o(function(e,t,n){return si(this,e,t,!1,n)},"writeFloatBE");function ai(r,e,t,n,i){ -return e=+e,t=t>>>0,i||ii(r,e,t,8,17976931348623157e292,-17976931348623157e292), -Qe.write(r,e,t,n,52,8),t+8}o(ai,"writeDouble");d.prototype.writeDoubleLE=o(function(e,t,n){ -return ai(this,e,t,!0,n)},"writeDoubleLE");d.prototype.writeDoubleBE=o(function(e,t,n){ -return ai(this,e,t,!1,n)},"writeDoubleBE");d.prototype.copy=o(function(e,t,n,i){ +Le(a(function(e,t=0){return ai(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x\ +7fffffffffffffff"))},"writeBigInt64LE"));d.prototype.writeBigInt64BE=Le(a(function(e,t=0){ +return ci(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}, +"writeBigInt64BE"));function ui(r,e,t,n,i,s){if(t+n>r.length)throw new RangeError( +"Index out of range");if(t<0)throw new RangeError("Index out of range")}a(ui,"ch\ +eckIEEE754");function li(r,e,t,n,i){return e=+e,t=t>>>0,i||ui(r,e,t,4,34028234663852886e22, +-34028234663852886e22),We.write(r,e,t,n,23,4),t+4}a(li,"writeFloat");d.prototype. +writeFloatLE=a(function(e,t,n){return li(this,e,t,!0,n)},"writeFloatLE");d.prototype. +writeFloatBE=a(function(e,t,n){return li(this,e,t,!1,n)},"writeFloatBE");function hi(r,e,t,n,i){ +return e=+e,t=t>>>0,i||ui(r,e,t,8,17976931348623157e292,-17976931348623157e292), +We.write(r,e,t,n,52,8),t+8}a(hi,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){ +return hi(this,e,t,!0,n)},"writeDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){ +return hi(this,e,t,!1,n)},"writeDoubleBE");d.prototype.copy=a(function(e,t,n,i){ if(!d.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0), !i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("Index out of ran ge");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this. length),e.length-t>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let s;if(typeof e== -"number")for(s=t;s2**32?i=Jn(String(t)):typeof t=="\ +br("ERR_OUT_OF_RANGE",function(r,e,t){let n=`The value of "${r}" is out of range\ +.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=ti(String(t)):typeof t=="\ bigint"&&(i=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i= -Jn(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);function Jn(r){ +ti(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);function ti(r){ let e="",t=r.length,n=r[0]==="-"?1:0;for(;t>=n+4;t-=3)e=`_${r.slice(t-3,t)}${e}`; -return`${r.slice(0,t)}${e}`}o(Jn,"addNumericalSeparator");function Ao(r,e,t){$e( -e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&at(e,r.length-(t+1))}o(Ao,"checkBo\ -unds");function oi(r,e,t,n,i,s){if(r>t||r -3?e===0||e===BigInt(0)?u=`>= 0${a} and < 2${a} ** ${(s+1)*8}${a}`:u=`>= -(2${a} \ -** ${(s+1)*8-1}${a}) and < 2 ** ${(s+1)*8-1}${a}`:u=`>= ${e}${a} and <= ${t}${a}`, -new ke.ERR_OUT_OF_RANGE("value",u,r)}Ao(n,i,s)}o(oi,"checkIntBI");function $e(r,e){ -if(typeof r!="number")throw new ke.ERR_INVALID_ARG_TYPE(e,"number",r)}o($e,"vali\ -dateNumber");function at(r,e,t){throw Math.floor(r)!==r?($e(r,t),new ke.ERR_OUT_OF_RANGE( -t||"offset","an integer",r)):e<0?new ke.ERR_BUFFER_OUT_OF_BOUNDS:new ke.ERR_OUT_OF_RANGE( -t||"offset",`>= ${t?1:0} and <= ${e}`,r)}o(at,"boundsError");var vo=/[^+/0-9A-Za-z-_]/g; -function Co(r){if(r=r.split("=")[0],r=r.trim().replace(vo,""),r.length<2)return""; -for(;r.length%4!==0;)r=r+"=";return r}o(Co,"base64clean");function dr(r,e){e=e|| -1/0;let t,n=r.length,i=null,s=[];for(let a=0;a55295&& -t<57344){if(!i){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(a+1=== +return`${r.slice(0,t)}${e}`}a(ti,"addNumericalSeparator");function Ua(r,e,t){Ve( +e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&ut(e,r.length-(t+1))}a(Ua,"checkBo\ +unds");function fi(r,e,t,n,i,s){if(r>t||r +3?e===0||e===BigInt(0)?c=`>= 0${o} and < 2${o} ** ${(s+1)*8}${o}`:c=`>= -(2${o} \ +** ${(s+1)*8-1}${o}) and < 2 ** ${(s+1)*8-1}${o}`:c=`>= ${e}${o} and <= ${t}${o}`, +new Ke.ERR_OUT_OF_RANGE("value",c,r)}Ua(n,i,s)}a(fi,"checkIntBI");function Ve(r,e){ +if(typeof r!="number")throw new Ke.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Ve,"vali\ +dateNumber");function ut(r,e,t){throw Math.floor(r)!==r?(Ve(r,t),new Ke.ERR_OUT_OF_RANGE( +t||"offset","an integer",r)):e<0?new Ke.ERR_BUFFER_OUT_OF_BOUNDS:new Ke.ERR_OUT_OF_RANGE( +t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(ut,"boundsError");var Ia=/[^+/0-9A-Za-z-_]/g; +function La(r){if(r=r.split("=")[0],r=r.trim().replace(Ia,""),r.length<2)return""; +for(;r.length%4!==0;)r=r+"=";return r}a(La,"base64clean");function gr(r,e){e=e|| +1/0;let t,n=r.length,i=null,s=[];for(let o=0;o55295&& +t<57344){if(!i){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1=== n){(e-=3)>-1&&s.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&s. push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&& s.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){ if((e-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s. push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push( t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code \ -point")}return s}o(dr,"utf8ToBytes");function _o(r){let e=[];for(let t=0;t>8,i=t%256, -s.push(i),s.push(n);return s}o(To,"utf16leToBytes");function ui(r){return lr.toByteArray( -Co(r))}o(ui,"base64ToBytes");function Rt(r,e,t,n){let i;for(i=0;i=e.length|| -i>=r.length);++i)e[i+t]=r[i];return i}o(Rt,"blitBuffer");function Ee(r,e){return r instanceof +point")}return s}a(gr,"utf8ToBytes");function _a(r){let e=[];for(let t=0;t>8,i=t%256, +s.push(i),s.push(n);return s}a(Pa,"utf16leToBytes");function di(r){return pr.toByteArray( +La(r))}a(di,"base64ToBytes");function Dt(r,e,t,n){let i;for(i=0;i=e.length|| +i>=r.length);++i)e[i+t]=r[i];return i}a(Dt,"blitBuffer");function ve(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name=== -e.name}o(Ee,"isInstance");function mr(r){return r!==r}o(mr,"numberIsNaN");var Lo=function(){ +e.name}a(ve,"isInstance");function Er(r){return r!==r}a(Er,"numberIsNaN");var Ba=function(){ let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){let n=t*16;for(let i=0;i< -16;++i)e[n+i]=r[t]+r[i]}return e}();function _e(r){return typeof BigInt>"u"?Uo:r} -o(_e,"defineBigIntMethod");function Uo(){throw new Error("BigInt not supported")} -o(Uo,"BufferBigIntNotDefined")});var _,T,L,A,w,S,p=le(()=>{"use strict";_=globalThis,T=globalThis.setImmediate??(r=>setTimeout( -r,0)),L=globalThis.clearImmediate??(r=>clearTimeout(r)),A=globalThis.crypto??{}; -A.subtle??={};w=typeof globalThis.Buffer=="function"&&typeof globalThis.Buffer.allocUnsafe== -"function"?globalThis.Buffer:ci().Buffer,S=globalThis.process??{};S.env??={};try{ -S.nextTick(()=>{})}catch{let e=Promise.resolve();S.nextTick=e.then.bind(e)}});var Ue=B((hf,Ur)=>{"use strict";p();var Ge=typeof Reflect=="object"?Reflect:null, -Bi=Ge&&typeof Ge.apply=="function"?Ge.apply:o(function(e,t,n){return Function.prototype. -apply.call(e,t,n)},"ReflectApply"),Ot;Ge&&typeof Ge.ownKeys=="function"?Ot=Ge.ownKeys: -Object.getOwnPropertySymbols?Ot=o(function(e){return Object.getOwnPropertyNames( -e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Ot=o(function(e){return Object. -getOwnPropertyNames(e)},"ReflectOwnKeys");function _u(r){console&&console.warn&& -console.warn(r)}o(_u,"ProcessEmitWarning");var Ni=Number.isNaN||o(function(e){return e!== -e},"NumberIsNaN");function Q(){Q.init.call(this)}o(Q,"EventEmitter");Ur.exports= -Q;Ur.exports.once=Iu;Q.EventEmitter=Q;Q.prototype._events=void 0;Q.prototype._eventsCount= -0;Q.prototype._maxListeners=void 0;var Ri=10;function kt(r){if(typeof r!="functi\ -on")throw new TypeError('The "listener" argument must be of type Function. Recei\ -ved type '+typeof r)}o(kt,"checkListener");Object.defineProperty(Q,"defaultMaxLi\ -steners",{enumerable:!0,get:o(function(){return Ri},"get"),set:o(function(r){if(typeof r!= -"number"||r<0||Ni(r))throw new RangeError('The value of "defaultMaxListeners" is\ - out of range. It must be a non-negative number. Received '+r+".");Ri=r},"set")}); -Q.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this). -_events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners= -this._maxListeners||void 0};Q.prototype.setMaxListeners=o(function(e){if(typeof e!= -"number"||e<0||Ni(e))throw new RangeError('The value of "n" is out of range. It \ -must be a non-negative number. Received '+e+".");return this._maxListeners=e,this}, -"setMaxListeners");function Mi(r){return r._maxListeners===void 0?Q.defaultMaxListeners: -r._maxListeners}o(Mi,"_getMaxListeners");Q.prototype.getMaxListeners=o(function(){ -return Mi(this)},"getMaxListeners");Q.prototype.emit=o(function(e){for(var t=[], -n=1;n -0&&(a=t[0]),a instanceof Error)throw a;var u=new Error("Unhandled error."+(a?" ("+ -a.message+")":""));throw u.context=a,u}var c=s[e];if(c===void 0)return!1;if(typeof c== -"function")Bi(c,this,t);else for(var l=c.length,h=ki(c,l),n=0;n0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Po\ -ssible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners a\ -dded. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExce\ -ededWarning",u.emitter=r,u.type=e,u.count=a.length,_u(u)}return r}o(Di,"_addList\ -ener");Q.prototype.addListener=o(function(e,t){return Di(this,e,t,!1)},"addListe\ -ner");Q.prototype.on=Q.prototype.addListener;Q.prototype.prependListener=o(function(e,t){ -return Di(this,e,t,!0)},"prependListener");function Tu(){if(!this.fired)return this. -target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0? -this.listener.call(this.target):this.listener.apply(this.target,arguments)}o(Tu, -"onceWrapper");function qi(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e, -listener:t},i=Tu.bind(n);return i.listener=t,n.wrapFn=i,i}o(qi,"_onceWrap");Q.prototype. -once=o(function(e,t){return kt(t),this.on(e,qi(this,e,t)),this},"once");Q.prototype. -prependOnceListener=o(function(e,t){return kt(t),this.prependListener(e,qi(this, -e,t)),this},"prependOnceListener");Q.prototype.removeListener=o(function(e,t){var n, -i,s,a,u;if(kt(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this; -if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null): -(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!= -"function"){for(s=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){u=n[a]. -listener,s=a;break}if(s<0)return this;s===0?n.shift():Lu(n,s),n.length===1&&(i[e]= -n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||t)}return this}, -"removeListener");Q.prototype.off=Q.prototype.removeListener;Q.prototype.removeAllListeners= -o(function(e){var t,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener=== -void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount= -0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]), -this;if(arguments.length===0){var s=Object.keys(n),a;for(i=0;i=0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function Fi(r,e,t){ -var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i== -"function"?t?[i.listener||i]:[i]:t?Uu(i):ki(i,i.length)}o(Fi,"_listeners");Q.prototype. -listeners=o(function(e){return Fi(this,e,!0)},"listeners");Q.prototype.rawListeners= -o(function(e){return Fi(this,e,!1)},"rawListeners");Q.listenerCount=function(r,e){ -return typeof r.listenerCount=="function"?r.listenerCount(e):Oi.call(r,e)};Q.prototype. -listenerCount=Oi;function Oi(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t== -"function")return 1;if(t!==void 0)return t.length}return 0}o(Oi,"listenerCount"); -Q.prototype.eventNames=o(function(){return this._eventsCount>0?Ot(this._events): -[]},"eventNames");function ki(r,e){for(var t=new Array(e),n=0;nBu});var Bu,ht=le(()=>{"use strict";p();Bu={}});function ft(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119, -a=2600822924,u=528734635,c=1541459225,l=0,h=0,f=[1116352408,1899447441,3049323471, +16;++i)e[n+i]=r[t]+r[i]}return e}();function Le(r){return typeof BigInt>"u"?Na:r} +a(Le,"defineBigIntMethod");function Na(){throw new Error("BigInt not supported")} +a(Na,"BufferBigIntNotDefined")});var R,U,I,T,w,b,y=de(()=>{"use strict";R=globalThis,U=globalThis.setImmediate??(r=>setTimeout( +r,0)),I=globalThis.clearImmediate??(r=>clearTimeout(r)),T=globalThis.crypto??{}; +T.subtle??={};w=typeof globalThis.Buffer=="function"&&typeof globalThis.Buffer.allocUnsafe== +"function"?globalThis.Buffer:pi().Buffer,b=globalThis.process??{};b.env??={};try{ +b.nextTick(()=>{})}catch{let e=Promise.resolve();b.nextTick=e.then.bind(e)}});function lt(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119, +o=2600822924,c=528734635,u=1541459225,l=0,h=0,f=[1116352408,1899447441,3049323471, 3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278, 1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078, 604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808, @@ -455,116 +377,199 @@ a=2600822924,u=528734635,c=1541459225,l=0,h=0,f=[1116352408,1899447441,304932347 1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800, 3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556, 883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452, -2361852424,2428436474,2756734187,3204031479,3329325298],y=o((E,g)=>E>>>g|E<<32-g, -"rrot"),m=new Uint32Array(64),b=new Uint8Array(64),U=o(()=>{for(let M=0,$=0;M<16;M++, -$+=4)m[M]=b[$]<<24|b[$+1]<<16|b[$+2]<<8|b[$+3];for(let M=16;M<64;M++){let $=y(m[M- -15],7)^y(m[M-15],18)^m[M-15]>>>3,j=y(m[M-2],17)^y(m[M-2],19)^m[M-2]>>>10;m[M]=m[M- -16]+$+m[M-7]+j|0}let E=e,g=t,x=n,N=i,P=s,D=a,q=u,Z=c;for(let M=0;M<64;M++){let $=y( -P,6)^y(P,11)^y(P,25),j=P&D^~P&q,H=Z+$+j+f[M]+m[M]|0,K=y(E,2)^y(E,13)^y(E,22),J=E& -g^E&x^g&x,F=K+J|0;Z=q,q=D,D=P,P=N+H|0,N=x,x=g,g=E,E=H+F|0}e=e+E|0,t=t+g|0,n=n+x| -0,i=i+N|0,s=s+P|0,a=a+D|0,u=u+q|0,c=c+Z|0,h=0},"process"),v=o(E=>{typeof E=="str\ -ing"&&(E=new TextEncoder().encode(E));for(let g=0;g{if(b[h++]=128,h==64&&U(),h+8>64){for(;h<64;) -b[h++]=0;U()}for(;h<58;)b[h++]=0;let E=l*8;b[h++]=E/1099511627776&255,b[h++]=E/4294967296& -255,b[h++]=E>>>24,b[h++]=E>>>16&255,b[h++]=E>>>8&255,b[h++]=E&255,U();let g=new Uint8Array( -32);return g[0]=e>>>24,g[1]=e>>>16&255,g[2]=e>>>8&255,g[3]=e&255,g[4]=t>>>24,g[5]= -t>>>16&255,g[6]=t>>>8&255,g[7]=t&255,g[8]=n>>>24,g[9]=n>>>16&255,g[10]=n>>>8&255, -g[11]=n&255,g[12]=i>>>24,g[13]=i>>>16&255,g[14]=i>>>8&255,g[15]=i&255,g[16]=s>>> -24,g[17]=s>>>16&255,g[18]=s>>>8&255,g[19]=s&255,g[20]=a>>>24,g[21]=a>>>16&255,g[22]= -a>>>8&255,g[23]=a&255,g[24]=u>>>24,g[25]=u>>>16&255,g[26]=u>>>8&255,g[27]=u&255, -g[28]=c>>>24,g[29]=c>>>16&255,g[30]=c>>>8&255,g[31]=c&255,g},"digest");return r=== -void 0?{add:v,digest:C}:(v(r),C())}var $i=le(()=>{"use strict";p();o(ft,"sha256")});var dt,ji=le(()=>{"use strict";p();dt=class r{static{o(this,"Md5")}static hashByteArray(e,t=!1){ +2361852424,2428436474,2756734187,3204031479,3329325298],g=a((S,m)=>S>>>m|S<<32-m, +"rrot"),p=new Uint32Array(64),E=new Uint8Array(64),C=a(()=>{for(let P=0,W=0;P<16;P++, +W+=4)p[P]=E[W]<<24|E[W+1]<<16|E[W+2]<<8|E[W+3];for(let P=16;P<64;P++){let W=g(p[P- +15],7)^g(p[P-15],18)^p[P-15]>>>3,oe=g(p[P-2],17)^g(p[P-2],19)^p[P-2]>>>10;p[P]=p[P- +16]+W+p[P-7]+oe|0}let S=e,m=t,x=n,N=i,_=s,D=o,Y=c,te=u;for(let P=0;P<64;P++){let W=g( +_,6)^g(_,11)^g(_,25),oe=_&D^~_&Y,ee=te+W+oe+f[P]+p[P]|0,j=g(S,2)^g(S,13)^g(S,22), +H=S&m^S&x^m&x,Q=j+H|0;te=Y,Y=D,D=_,_=N+ee|0,N=x,x=m,m=S,S=ee+Q|0}e=e+S|0,t=t+m|0, +n=n+x|0,i=i+N|0,s=s+_|0,o=o+D|0,c=c+Y|0,u=u+te|0,h=0},"process"),v=a(S=>{typeof S== +"string"&&(S=new TextEncoder().encode(S));for(let m=0;m{if(E[h++]=128,h==64&&C(),h+8>64){for(;h< +64;)E[h++]=0;C()}for(;h<58;)E[h++]=0;let S=l*8;E[h++]=S/1099511627776&255,E[h++]= +S/4294967296&255,E[h++]=S>>>24,E[h++]=S>>>16&255,E[h++]=S>>>8&255,E[h++]=S&255,C(); +let m=new Uint8Array(32);return m[0]=e>>>24,m[1]=e>>>16&255,m[2]=e>>>8&255,m[3]= +e&255,m[4]=t>>>24,m[5]=t>>>16&255,m[6]=t>>>8&255,m[7]=t&255,m[8]=n>>>24,m[9]=n>>> +16&255,m[10]=n>>>8&255,m[11]=n&255,m[12]=i>>>24,m[13]=i>>>16&255,m[14]=i>>>8&255, +m[15]=i&255,m[16]=s>>>24,m[17]=s>>>16&255,m[18]=s>>>8&255,m[19]=s&255,m[20]=o>>> +24,m[21]=o>>>16&255,m[22]=o>>>8&255,m[23]=o&255,m[24]=c>>>24,m[25]=c>>>16&255,m[26]= +c>>>8&255,m[27]=c&255,m[28]=u>>>24,m[29]=u>>>16&255,m[30]=u>>>8&255,m[31]=u&255, +m},"digest");return r===void 0?{add:v,digest:A}:(v(r),A())}var yi=de(()=>{"use s\ +trict";y();a(lt,"sha256")});var ht,mi=de(()=>{"use strict";y();ht=class r{static{a(this,"Md5")}static hashByteArray(e,t=!1){ return this.onePassHasher.start().appendByteArray(e).end(t)}static hashStr(e,t=!1){ return this.onePassHasher.start().appendStr(e).end(t)}static hashAsciiStr(e,t=!1){ return this.onePassHasher.start().appendAsciiStr(e).end(t)}static stateIdentity=new Int32Array( [1732584193,-271733879,-1732584194,271733878]);static buffer32Identity=new Int32Array( [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);static hexChars="0123456789abcdef";static hexOut=[];static onePassHasher=new r;static _hex(e){ -let t=r.hexChars,n=r.hexOut,i,s,a,u;for(u=0;u<4;u+=1)for(s=u*8,i=e[u],a=0;a<8;a+= -2)n[s+1+a]=t.charAt(i&15),i>>>=4,n[s+0+a]=t.charAt(i&15),i>>>=4;return n.join("")}static _md5cycle(e,t){ -let n=e[0],i=e[1],s=e[2],a=e[3];n+=(i&s|~i&a)+t[0]-680876936|0,n=(n<<7|n>>>25)+i| -0,a+=(n&i|~n&s)+t[1]-389564586|0,a=(a<<12|a>>>20)+n|0,s+=(a&n|~a&i)+t[2]+606105819| -0,s=(s<<17|s>>>15)+a|0,i+=(s&a|~s&n)+t[3]-1044525330|0,i=(i<<22|i>>>10)+s|0,n+=(i& -s|~i&a)+t[4]-176418897|0,n=(n<<7|n>>>25)+i|0,a+=(n&i|~n&s)+t[5]+1200080426|0,a=(a<< -12|a>>>20)+n|0,s+=(a&n|~a&i)+t[6]-1473231341|0,s=(s<<17|s>>>15)+a|0,i+=(s&a|~s&n)+ -t[7]-45705983|0,i=(i<<22|i>>>10)+s|0,n+=(i&s|~i&a)+t[8]+1770035416|0,n=(n<<7|n>>> -25)+i|0,a+=(n&i|~n&s)+t[9]-1958414417|0,a=(a<<12|a>>>20)+n|0,s+=(a&n|~a&i)+t[10]- -42063|0,s=(s<<17|s>>>15)+a|0,i+=(s&a|~s&n)+t[11]-1990404162|0,i=(i<<22|i>>>10)+s| -0,n+=(i&s|~i&a)+t[12]+1804603682|0,n=(n<<7|n>>>25)+i|0,a+=(n&i|~n&s)+t[13]-40341101| -0,a=(a<<12|a>>>20)+n|0,s+=(a&n|~a&i)+t[14]-1502002290|0,s=(s<<17|s>>>15)+a|0,i+= -(s&a|~s&n)+t[15]+1236535329|0,i=(i<<22|i>>>10)+s|0,n+=(i&a|s&~a)+t[1]-165796510| -0,n=(n<<5|n>>>27)+i|0,a+=(n&s|i&~s)+t[6]-1069501632|0,a=(a<<9|a>>>23)+n|0,s+=(a& -i|n&~i)+t[11]+643717713|0,s=(s<<14|s>>>18)+a|0,i+=(s&n|a&~n)+t[0]-373897302|0,i= -(i<<20|i>>>12)+s|0,n+=(i&a|s&~a)+t[5]-701558691|0,n=(n<<5|n>>>27)+i|0,a+=(n&s|i& -~s)+t[10]+38016083|0,a=(a<<9|a>>>23)+n|0,s+=(a&i|n&~i)+t[15]-660478335|0,s=(s<<14| -s>>>18)+a|0,i+=(s&n|a&~n)+t[4]-405537848|0,i=(i<<20|i>>>12)+s|0,n+=(i&a|s&~a)+t[9]+ -568446438|0,n=(n<<5|n>>>27)+i|0,a+=(n&s|i&~s)+t[14]-1019803690|0,a=(a<<9|a>>>23)+ -n|0,s+=(a&i|n&~i)+t[3]-187363961|0,s=(s<<14|s>>>18)+a|0,i+=(s&n|a&~n)+t[8]+1163531501| -0,i=(i<<20|i>>>12)+s|0,n+=(i&a|s&~a)+t[13]-1444681467|0,n=(n<<5|n>>>27)+i|0,a+=(n& -s|i&~s)+t[2]-51403784|0,a=(a<<9|a>>>23)+n|0,s+=(a&i|n&~i)+t[7]+1735328473|0,s=(s<< -14|s>>>18)+a|0,i+=(s&n|a&~n)+t[12]-1926607734|0,i=(i<<20|i>>>12)+s|0,n+=(i^s^a)+ -t[5]-378558|0,n=(n<<4|n>>>28)+i|0,a+=(n^i^s)+t[8]-2022574463|0,a=(a<<11|a>>>21)+ -n|0,s+=(a^n^i)+t[11]+1839030562|0,s=(s<<16|s>>>16)+a|0,i+=(s^a^n)+t[14]-35309556| -0,i=(i<<23|i>>>9)+s|0,n+=(i^s^a)+t[1]-1530992060|0,n=(n<<4|n>>>28)+i|0,a+=(n^i^s)+ -t[4]+1272893353|0,a=(a<<11|a>>>21)+n|0,s+=(a^n^i)+t[7]-155497632|0,s=(s<<16|s>>> -16)+a|0,i+=(s^a^n)+t[10]-1094730640|0,i=(i<<23|i>>>9)+s|0,n+=(i^s^a)+t[13]+681279174| -0,n=(n<<4|n>>>28)+i|0,a+=(n^i^s)+t[0]-358537222|0,a=(a<<11|a>>>21)+n|0,s+=(a^n^i)+ -t[3]-722521979|0,s=(s<<16|s>>>16)+a|0,i+=(s^a^n)+t[6]+76029189|0,i=(i<<23|i>>>9)+ -s|0,n+=(i^s^a)+t[9]-640364487|0,n=(n<<4|n>>>28)+i|0,a+=(n^i^s)+t[12]-421815835|0, -a=(a<<11|a>>>21)+n|0,s+=(a^n^i)+t[15]+530742520|0,s=(s<<16|s>>>16)+a|0,i+=(s^a^n)+ -t[2]-995338651|0,i=(i<<23|i>>>9)+s|0,n+=(s^(i|~a))+t[0]-198630844|0,n=(n<<6|n>>> -26)+i|0,a+=(i^(n|~s))+t[7]+1126891415|0,a=(a<<10|a>>>22)+n|0,s+=(n^(a|~i))+t[14]- -1416354905|0,s=(s<<15|s>>>17)+a|0,i+=(a^(s|~n))+t[5]-57434055|0,i=(i<<21|i>>>11)+ -s|0,n+=(s^(i|~a))+t[12]+1700485571|0,n=(n<<6|n>>>26)+i|0,a+=(i^(n|~s))+t[3]-1894986606| -0,a=(a<<10|a>>>22)+n|0,s+=(n^(a|~i))+t[10]-1051523|0,s=(s<<15|s>>>17)+a|0,i+=(a^ -(s|~n))+t[1]-2054922799|0,i=(i<<21|i>>>11)+s|0,n+=(s^(i|~a))+t[8]+1873313359|0,n= -(n<<6|n>>>26)+i|0,a+=(i^(n|~s))+t[15]-30611744|0,a=(a<<10|a>>>22)+n|0,s+=(n^(a|~i))+ -t[6]-1560198380|0,s=(s<<15|s>>>17)+a|0,i+=(a^(s|~n))+t[13]+1309151649|0,i=(i<<21| -i>>>11)+s|0,n+=(s^(i|~a))+t[4]-145523070|0,n=(n<<6|n>>>26)+i|0,a+=(i^(n|~s))+t[11]- -1120210379|0,a=(a<<10|a>>>22)+n|0,s+=(n^(a|~i))+t[2]+718787259|0,s=(s<<15|s>>>17)+ -a|0,i+=(a^(s|~n))+t[9]-343485551|0,i=(i<<21|i>>>11)+s|0,e[0]=n+e[0]|0,e[1]=i+e[1]| -0,e[2]=s+e[2]|0,e[3]=a+e[3]|0}_dataLength=0;_bufferLength=0;_state=new Int32Array( +let t=r.hexChars,n=r.hexOut,i,s,o,c;for(c=0;c<4;c+=1)for(s=c*8,i=e[c],o=0;o<8;o+= +2)n[s+1+o]=t.charAt(i&15),i>>>=4,n[s+0+o]=t.charAt(i&15),i>>>=4;return n.join("")}static _md5cycle(e,t){ +let n=e[0],i=e[1],s=e[2],o=e[3];n+=(i&s|~i&o)+t[0]-680876936|0,n=(n<<7|n>>>25)+i| +0,o+=(n&i|~n&s)+t[1]-389564586|0,o=(o<<12|o>>>20)+n|0,s+=(o&n|~o&i)+t[2]+606105819| +0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&n)+t[3]-1044525330|0,i=(i<<22|i>>>10)+s|0,n+=(i& +s|~i&o)+t[4]-176418897|0,n=(n<<7|n>>>25)+i|0,o+=(n&i|~n&s)+t[5]+1200080426|0,o=(o<< +12|o>>>20)+n|0,s+=(o&n|~o&i)+t[6]-1473231341|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&n)+ +t[7]-45705983|0,i=(i<<22|i>>>10)+s|0,n+=(i&s|~i&o)+t[8]+1770035416|0,n=(n<<7|n>>> +25)+i|0,o+=(n&i|~n&s)+t[9]-1958414417|0,o=(o<<12|o>>>20)+n|0,s+=(o&n|~o&i)+t[10]- +42063|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&n)+t[11]-1990404162|0,i=(i<<22|i>>>10)+s| +0,n+=(i&s|~i&o)+t[12]+1804603682|0,n=(n<<7|n>>>25)+i|0,o+=(n&i|~n&s)+t[13]-40341101| +0,o=(o<<12|o>>>20)+n|0,s+=(o&n|~o&i)+t[14]-1502002290|0,s=(s<<17|s>>>15)+o|0,i+= +(s&o|~s&n)+t[15]+1236535329|0,i=(i<<22|i>>>10)+s|0,n+=(i&o|s&~o)+t[1]-165796510| +0,n=(n<<5|n>>>27)+i|0,o+=(n&s|i&~s)+t[6]-1069501632|0,o=(o<<9|o>>>23)+n|0,s+=(o& +i|n&~i)+t[11]+643717713|0,s=(s<<14|s>>>18)+o|0,i+=(s&n|o&~n)+t[0]-373897302|0,i= +(i<<20|i>>>12)+s|0,n+=(i&o|s&~o)+t[5]-701558691|0,n=(n<<5|n>>>27)+i|0,o+=(n&s|i& +~s)+t[10]+38016083|0,o=(o<<9|o>>>23)+n|0,s+=(o&i|n&~i)+t[15]-660478335|0,s=(s<<14| +s>>>18)+o|0,i+=(s&n|o&~n)+t[4]-405537848|0,i=(i<<20|i>>>12)+s|0,n+=(i&o|s&~o)+t[9]+ +568446438|0,n=(n<<5|n>>>27)+i|0,o+=(n&s|i&~s)+t[14]-1019803690|0,o=(o<<9|o>>>23)+ +n|0,s+=(o&i|n&~i)+t[3]-187363961|0,s=(s<<14|s>>>18)+o|0,i+=(s&n|o&~n)+t[8]+1163531501| +0,i=(i<<20|i>>>12)+s|0,n+=(i&o|s&~o)+t[13]-1444681467|0,n=(n<<5|n>>>27)+i|0,o+=(n& +s|i&~s)+t[2]-51403784|0,o=(o<<9|o>>>23)+n|0,s+=(o&i|n&~i)+t[7]+1735328473|0,s=(s<< +14|s>>>18)+o|0,i+=(s&n|o&~n)+t[12]-1926607734|0,i=(i<<20|i>>>12)+s|0,n+=(i^s^o)+ +t[5]-378558|0,n=(n<<4|n>>>28)+i|0,o+=(n^i^s)+t[8]-2022574463|0,o=(o<<11|o>>>21)+ +n|0,s+=(o^n^i)+t[11]+1839030562|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^n)+t[14]-35309556| +0,i=(i<<23|i>>>9)+s|0,n+=(i^s^o)+t[1]-1530992060|0,n=(n<<4|n>>>28)+i|0,o+=(n^i^s)+ +t[4]+1272893353|0,o=(o<<11|o>>>21)+n|0,s+=(o^n^i)+t[7]-155497632|0,s=(s<<16|s>>> +16)+o|0,i+=(s^o^n)+t[10]-1094730640|0,i=(i<<23|i>>>9)+s|0,n+=(i^s^o)+t[13]+681279174| +0,n=(n<<4|n>>>28)+i|0,o+=(n^i^s)+t[0]-358537222|0,o=(o<<11|o>>>21)+n|0,s+=(o^n^i)+ +t[3]-722521979|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^n)+t[6]+76029189|0,i=(i<<23|i>>>9)+ +s|0,n+=(i^s^o)+t[9]-640364487|0,n=(n<<4|n>>>28)+i|0,o+=(n^i^s)+t[12]-421815835|0, +o=(o<<11|o>>>21)+n|0,s+=(o^n^i)+t[15]+530742520|0,s=(s<<16|s>>>16)+o|0,i+=(s^o^n)+ +t[2]-995338651|0,i=(i<<23|i>>>9)+s|0,n+=(s^(i|~o))+t[0]-198630844|0,n=(n<<6|n>>> +26)+i|0,o+=(i^(n|~s))+t[7]+1126891415|0,o=(o<<10|o>>>22)+n|0,s+=(n^(o|~i))+t[14]- +1416354905|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~n))+t[5]-57434055|0,i=(i<<21|i>>>11)+ +s|0,n+=(s^(i|~o))+t[12]+1700485571|0,n=(n<<6|n>>>26)+i|0,o+=(i^(n|~s))+t[3]-1894986606| +0,o=(o<<10|o>>>22)+n|0,s+=(n^(o|~i))+t[10]-1051523|0,s=(s<<15|s>>>17)+o|0,i+=(o^ +(s|~n))+t[1]-2054922799|0,i=(i<<21|i>>>11)+s|0,n+=(s^(i|~o))+t[8]+1873313359|0,n= +(n<<6|n>>>26)+i|0,o+=(i^(n|~s))+t[15]-30611744|0,o=(o<<10|o>>>22)+n|0,s+=(n^(o|~i))+ +t[6]-1560198380|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~n))+t[13]+1309151649|0,i=(i<<21| +i>>>11)+s|0,n+=(s^(i|~o))+t[4]-145523070|0,n=(n<<6|n>>>26)+i|0,o+=(i^(n|~s))+t[11]- +1120210379|0,o=(o<<10|o>>>22)+n|0,s+=(n^(o|~i))+t[2]+718787259|0,s=(s<<15|s>>>17)+ +o|0,i+=(o^(s|~n))+t[9]-343485551|0,i=(i<<21|i>>>11)+s|0,e[0]=n+e[0]|0,e[1]=i+e[1]| +0,e[2]=s+e[2]|0,e[3]=o+e[3]|0}_dataLength=0;_bufferLength=0;_state=new Int32Array( 4);_buffer=new ArrayBuffer(68);_buffer8;_buffer32;constructor(){this._buffer8=new Uint8Array( this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}start(){ return this._dataLength=0,this._bufferLength=0,this._state.set(r.stateIdentity), -this}appendStr(e){let t=this._buffer8,n=this._buffer32,i=this._bufferLength,s,a; -for(a=0;a>>6)+192,t[i++]=s&63|128;else if(s<55296||s>56319)t[i++]=(s>>>12)+224,t[i++]= -s>>>6&63|128,t[i++]=s&63|128;else{if(s=(s-55296)*1024+(e.charCodeAt(++a)-56320)+ +s>>>6&63|128,t[i++]=s&63|128;else{if(s=(s-55296)*1024+(e.charCodeAt(++o)-56320)+ 65536,s>1114111)throw new Error("Unicode standard supports code points up to U+1\ 0FFFF");t[i++]=(s>>>18)+240,t[i++]=s>>>12&63|128,t[i++]=s>>>6&63|128,t[i++]=s&63| 128}i>=64&&(this._dataLength+=64,r._md5cycle(this._state,n),i-=64,n[0]=n[16])}return this. _bufferLength=i,this}appendAsciiStr(e){let t=this._buffer8,n=this._buffer32,i=this. -_bufferLength,s,a=0;for(;;){for(s=Math.min(e.length-a,64-i);s--;)t[i++]=e.charCodeAt( -a++);if(i<64)break;this._dataLength+=64,r._md5cycle(this._state,n),i=0}return this. +_bufferLength,s,o=0;for(;;){for(s=Math.min(e.length-o,64-i);s--;)t[i++]=e.charCodeAt( +o++);if(i<64)break;this._dataLength+=64,r._md5cycle(this._state,n),i=0}return this. _bufferLength=i,this}appendByteArray(e){let t=this._buffer8,n=this._buffer32,i=this. -_bufferLength,s,a=0;for(;;){for(s=Math.min(e.length-a,64-i);s--;)t[i++]=e[a++];if(i< +_bufferLength,s,o=0;for(;;){for(s=Math.min(e.length-o,64-i);s--;)t[i++]=e[o++];if(i< 64)break;this._dataLength+=64,r._md5cycle(this._state,n),i=0}return this._bufferLength= i,this}getState(){let e=this._state;return{buffer:String.fromCharCode.apply(null, Array.from(this._buffer8)),buflen:this._bufferLength,length:this._dataLength,state:[ e[0],e[1],e[2],e[3]]}}setState(e){let t=e.buffer,n=e.state,i=this._state,s;for(this. _dataLength=e.length,this._bufferLength=e.buflen,i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]= n[3],s=0;s>2)+1;this._dataLength+=t;let a=this._dataLength* +n=this._buffer8,i=this._buffer32,s=(t>>2)+1;this._dataLength+=t;let o=this._dataLength* 8;if(n[t]=128,n[t+1]=n[t+2]=n[t+3]=0,i.set(r.buffer32Identity.subarray(s),s),t>55&& -(r._md5cycle(this._state,i),i.set(r.buffer32Identity)),a<=4294967295)i[14]=a;else{ -let u=a.toString(16).match(/(.*?)(.{0,8})$/);if(u===null)return;let c=parseInt(u[2], -16),l=parseInt(u[1],16)||0;i[14]=c,i[15]=l}return r._md5cycle(this._state,i),e?this. -_state:r._hex(this._state)}}});var Ir={};pe(Ir,{createHash:()=>Nu,createHmac:()=>Mu,randomBytes:()=>Ru});function Ru(r){ -return A.getRandomValues(w.alloc(r))}function Nu(r){if(r==="sha256")return{update:o( -function(e){return{digest:o(function(){return w.from(ft(e))},"digest")}},"update")}; -if(r==="md5")return{update:o(function(e){return{digest:o(function(){return typeof e== -"string"?dt.hashStr(e):dt.hashByteArray(e)},"digest")}},"update")};throw new Error( -`Hash type '${r}' not supported`)}function Mu(r,e){if(r!=="sha256")throw new Error( -`Only sha256 is supported (requested: '${r}')`);return{update:o(function(t){return{ -digest:o(function(){typeof e=="string"&&(e=new TextEncoder().encode(e)),typeof t== -"string"&&(t=new TextEncoder().encode(t));let n=e.length;if(n>64)e=ft(e);else if(n< -64){let c=new Uint8Array(64);c.set(e),e=c}let i=new Uint8Array(64),s=new Uint8Array( -64);for(let c=0;c<64;c++)i[c]=54^e[c],s[c]=92^e[c];let a=new Uint8Array(t.length+ -64);a.set(i,0),a.set(t,64);let u=new Uint8Array(96);return u.set(s,0),u.set(ft(a), -64),w.from(ft(u))},"digest")}},"update")}}var Pr=le(()=>{"use strict";p();$i();ji(); -o(Ru,"randomBytes");o(Nu,"createHash");o(Mu,"createHmac")});var Rr=B(Hi=>{"use strict";p();Hi.parse=function(r,e){return new Br(r,e).parse()}; -var Br=class r{static{o(this,"ArrayParser")}constructor(e,t){this.source=e,this. -transform=t||Du,this.position=0,this.entries=[],this.recorded=[],this.dimension= +(r._md5cycle(this._state,i),i.set(r.buffer32Identity)),o<=4294967295)i[14]=o;else{ +let c=o.toString(16).match(/(.*?)(.{0,8})$/);if(c===null)return;let u=parseInt(c[2], +16),l=parseInt(c[1],16)||0;i[14]=u,i[15]=l}return r._md5cycle(this._state,i),e?this. +_state:r._hex(this._state)}}});var ft={};ge(ft,{createHash:()=>qa,createHmac:()=>ka,randomBytes:()=>Fa});function Fa(r){ +return typeof T<"u"&&T.randomBytes!==void 0?(T.webcrypto??T).getRandomValues(w.alloc( +r)):Wn(Ma).randomBytes(r)}function qa(r){if(r==="sha256")return{update:a(function(e){ +return{digest:a(function(){return w.from(lt(e))},"digest")}},"update")};if(r==="\ +md5")return{update:a(function(e){return{digest:a(function(){return typeof e=="st\ +ring"?ht.hashStr(e):ht.hashByteArray(e)},"digest")}},"update")};throw new Error( +`Hash type '${r}' not supported`)}function ka(r,e){if(r!=="sha256")throw new Error( +`Only sha256 is supported (requested: '${r}')`);return{update:a(function(t){return{ +digest:a(function(){typeof e=="string"&&(e=new TextEncoder().encode(e)),typeof t== +"string"&&(t=new TextEncoder().encode(t));let n=e.length;if(n>64)e=lt(e);else if(n< +64){let u=new Uint8Array(64);u.set(e),e=u}let i=new Uint8Array(64),s=new Uint8Array( +64);for(let u=0;u<64;u++)i[u]=54^e[u],s[u]=92^e[u];let o=new Uint8Array(t.length+ +64);o.set(i,0),o.set(t,64);let c=new Uint8Array(96);return c.set(s,0),c.set(lt(o), +64),w.from(lt(c))},"digest")}},"update")}}var Ma,dt=de(()=>{"use strict";y();yi(); +mi();Ma="node:crypto";a(Fa,"randomBytes");a(qa,"createHash");a(ka,"createHmac")});var Ne=B((Jf,Br)=>{"use strict";y();var Ye=typeof Reflect=="object"?Reflect:null, +Di=Ye&&typeof Ye.apply=="function"?Ye.apply:a(function(e,t,n){return Function.prototype. +apply.call(e,t,n)},"ReflectApply"),jt;Ye&&typeof Ye.ownKeys=="function"?jt=Ye.ownKeys: +Object.getOwnPropertySymbols?jt=a(function(e){return Object.getOwnPropertyNames( +e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):jt=a(function(e){return Object. +getOwnPropertyNames(e)},"ReflectOwnKeys");function tu(r){console&&console.warn&& +console.warn(r)}a(tu,"ProcessEmitWarning");var Qi=Number.isNaN||a(function(e){return e!== +e},"NumberIsNaN");function $(){$.init.call(this)}a($,"EventEmitter");Br.exports= +$;Br.exports.once=su;$.EventEmitter=$;$.prototype._events=void 0;$.prototype._eventsCount= +0;$.prototype._maxListeners=void 0;var Oi=10;function Kt(r){if(typeof r!="functi\ +on")throw new TypeError('The "listener" argument must be of type Function. Recei\ +ved type '+typeof r)}a(Kt,"checkListener");Object.defineProperty($,"defaultMaxLi\ +steners",{enumerable:!0,get:a(function(){return Oi},"get"),set:a(function(r){if(typeof r!= +"number"||r<0||Qi(r))throw new RangeError('The value of "defaultMaxListeners" is\ + out of range. It must be a non-negative number. Received '+r+".");Oi=r},"set")}); +$.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this). +_events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners= +this._maxListeners||void 0};$.prototype.setMaxListeners=a(function(e){if(typeof e!= +"number"||e<0||Qi(e))throw new RangeError('The value of "n" is out of range. It \ +must be a non-negative number. Received '+e+".");return this._maxListeners=e,this}, +"setMaxListeners");function Hi(r){return r._maxListeners===void 0?$.defaultMaxListeners: +r._maxListeners}a(Hi,"_getMaxListeners");$.prototype.getMaxListeners=a(function(){ +return Hi(this)},"getMaxListeners");$.prototype.emit=a(function(e){for(var t=[], +n=1;n +0&&(o=t[0]),o instanceof Error)throw o;var c=new Error("Unhandled error."+(o?" ("+ +o.message+")":""));throw c.context=o,c}var u=s[e];if(u===void 0)return!1;if(typeof u== +"function")Di(u,this,t);else for(var l=u.length,h=Vi(u,l),n=0;n0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Po\ +ssible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners a\ +dded. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExce\ +ededWarning",c.emitter=r,c.type=e,c.count=o.length,tu(c)}return r}a($i,"_addList\ +ener");$.prototype.addListener=a(function(e,t){return $i(this,e,t,!1)},"addListe\ +ner");$.prototype.on=$.prototype.addListener;$.prototype.prependListener=a(function(e,t){ +return $i(this,e,t,!0)},"prependListener");function ru(){if(!this.fired)return this. +target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0? +this.listener.call(this.target):this.listener.apply(this.target,arguments)}a(ru, +"onceWrapper");function ji(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e, +listener:t},i=ru.bind(n);return i.listener=t,n.wrapFn=i,i}a(ji,"_onceWrap");$.prototype. +once=a(function(e,t){return Kt(t),this.on(e,ji(this,e,t)),this},"once");$.prototype. +prependOnceListener=a(function(e,t){return Kt(t),this.prependListener(e,ji(this, +e,t)),this},"prependOnceListener");$.prototype.removeListener=a(function(e,t){var n, +i,s,o,c;if(Kt(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this; +if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null): +(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!= +"function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){c=n[o]. +listener,s=o;break}if(s<0)return this;s===0?n.shift():nu(n,s),n.length===1&&(i[e]= +n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,c||t)}return this}, +"removeListener");$.prototype.off=$.prototype.removeListener;$.prototype.removeAllListeners= +a(function(e){var t,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener=== +void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount= +0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]), +this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i=0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function Ki(r,e,t){ +var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i== +"function"?t?[i.listener||i]:[i]:t?iu(i):Vi(i,i.length)}a(Ki,"_listeners");$.prototype. +listeners=a(function(e){return Ki(this,e,!0)},"listeners");$.prototype.rawListeners= +a(function(e){return Ki(this,e,!1)},"rawListeners");$.listenerCount=function(r,e){ +return typeof r.listenerCount=="function"?r.listenerCount(e):Wi.call(r,e)};$.prototype. +listenerCount=Wi;function Wi(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t== +"function")return 1;if(t!==void 0)return t.length}return 0}a(Wi,"listenerCount"); +$.prototype.eventNames=a(function(){return this._eventsCount>0?jt(this._events): +[]},"eventNames");function Vi(r,e){for(var t=new Array(e),n=0;nau});var au,St=de(()=>{"use strict";y();au={}});var Mr=B(zi=>{"use strict";y();zi.parse=function(r,e){return new Nr(r,e).parse()}; +var Nr=class r{static{a(this,"ArrayParser")}constructor(e,t){this.source=e,this. +transform=t||cu,this.position=0,this.entries=[],this.recorded=[],this.dimension= 0}isEof(){return this.position>=this.source.length}nextCharacter(){var e=this.source[this. position++];return e==="\\"?{value:this.source[this.position++],escaped:!0}:{value:e, escaped:!1}}record(e){this.recorded.push(e)}newEntry(e){var t;(this.recorded.length> @@ -577,114 +582,114 @@ this.position-1),this.transform),this.entries.push(n.parse(!0)),this.position+=n position-2);else if(t.value==="}"&&!i){if(this.dimension--,!this.dimension&&(this. newEntry(),e))return this.entries}else t.value==='"'&&!t.escaped?(i&&this.newEntry( !0),i=!i):t.value===","&&!i?this.newEntry():this.record(t.value);if(this.dimension!== -0)throw new Error("array dimension not balanced");return this.entries}};function Du(r){ -return r}o(Du,"identity")});var Nr=B((Lf,Ki)=>{p();var qu=Rr();Ki.exports={create:o(function(r,e){return{parse:o( -function(){return qu.parse(r,e)},"parse")}},"create")}});var Vi=B((Pf,Gi)=>{"use strict";p();var Fu=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, -Ou=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,ku=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,Qu=/^-?infinity$/; -Gi.exports=o(function(e){if(Qu.test(e))return Number(e.replace("i","I"));var t=Fu. -exec(e);if(!t)return $u(e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Wi(i));var s=parseInt( -t[2],10)-1,a=t[3],u=parseInt(t[4],10),c=parseInt(t[5],10),l=parseInt(t[6],10),h=t[7]; -h=h?1e3*parseFloat(h):0;var f,y=ju(e);return y!=null?(f=new Date(Date.UTC(i,s,a, -u,c,l,h)),Mr(i)&&f.setUTCFullYear(i),y!==0&&f.setTime(f.getTime()-y)):(f=new Date( -i,s,a,u,c,l,h),Mr(i)&&f.setFullYear(i)),f},"parseDate");function $u(r){var e=Ou. -exec(r);if(e){var t=parseInt(e[1],10),n=!!e[4];n&&(t=Wi(t));var i=parseInt(e[2], -10)-1,s=e[3],a=new Date(t,i,s);return Mr(t)&&a.setFullYear(t),a}}o($u,"getDate"); -function ju(r){if(r.endsWith("+00"))return 0;var e=ku.exec(r.split(" ")[1]);if(e){ +0)throw new Error("array dimension not balanced");return this.entries}};function cu(r){ +return r}a(cu,"identity")});var Fr=B((nd,Ji)=>{y();var uu=Mr();Ji.exports={create:a(function(r,e){return{parse:a( +function(){return uu.parse(r,e)},"parse")}},"create")}});var Xi=B((od,Zi)=>{"use strict";y();var lu=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, +hu=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,fu=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,du=/^-?infinity$/; +Zi.exports=a(function(e){if(du.test(e))return Number(e.replace("i","I"));var t=lu. +exec(e);if(!t)return pu(e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Yi(i));var s=parseInt( +t[2],10)-1,o=t[3],c=parseInt(t[4],10),u=parseInt(t[5],10),l=parseInt(t[6],10),h=t[7]; +h=h?1e3*parseFloat(h):0;var f,g=yu(e);return g!=null?(f=new Date(Date.UTC(i,s,o, +c,u,l,h)),qr(i)&&f.setUTCFullYear(i),g!==0&&f.setTime(f.getTime()-g)):(f=new Date( +i,s,o,c,u,l,h),qr(i)&&f.setFullYear(i)),f},"parseDate");function pu(r){var e=hu. +exec(r);if(e){var t=parseInt(e[1],10),n=!!e[4];n&&(t=Yi(t));var i=parseInt(e[2], +10)-1,s=e[3],o=new Date(t,i,s);return qr(t)&&o.setFullYear(t),o}}a(pu,"getDate"); +function yu(r){if(r.endsWith("+00"))return 0;var e=fu.exec(r.split(" ")[1]);if(e){ var t=e[1];if(t==="Z")return 0;var n=t==="-"?-1:1,i=parseInt(e[2],10)*3600+parseInt( -e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}o(ju,"timeZoneOffset");function Wi(r){ -return-(r-1)}o(Wi,"bcYearToNegativeYear");function Mr(r){return r>=0&&r<100}o(Mr, -"is0To99")});var Ji=B((Nf,zi)=>{p();zi.exports=Ku;var Hu=Object.prototype.hasOwnProperty;function Ku(r){ -for(var e=1;e{"use strict";p();var Wu=Ji();Zi.exports=Ve;function Ve(r){if(!(this instanceof -Ve))return new Ve(r);Wu(this,ic(r))}o(Ve,"PostgresInterval");var Gu=["seconds","\ -minutes","hours","days","months","years"];Ve.prototype.toPostgres=function(){var r=Gu. +e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(yu,"timeZoneOffset");function Yi(r){ +return-(r-1)}a(Yi,"bcYearToNegativeYear");function qr(r){return r>=0&&r<100}a(qr, +"is0To99")});var ts=B((ud,es)=>{y();es.exports=gu;var mu=Object.prototype.hasOwnProperty;function gu(r){ +for(var e=1;e{"use strict";y();var wu=ts();ns.exports=Ze;function Ze(r){if(!(this instanceof +Ze))return new Ze(r);wu(this,Lu(r))}a(Ze,"PostgresInterval");var Su=["seconds","\ +minutes","hours","days","months","years"];Ze.prototype.toPostgres=function(){var r=Su. filter(this.hasOwnProperty,this);return this.milliseconds&&r.indexOf("seconds")< 0&&r.push("seconds"),r.length===0?"0":r.map(function(e){var t=this[e]||0;return e=== "seconds"&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/, -"")),t+" "+e},this).join(" ")};var Vu={years:"Y",months:"M",days:"D",hours:"H",minutes:"\ -M",seconds:"S"},zu=["years","months","days"],Ju=["hours","minutes","seconds"];Ve. -prototype.toISOString=Ve.prototype.toISO=function(){var r=zu.map(t,this).join(""), -e=Ju.map(t,this).join("");return"P"+r+"T"+e;function t(n){var i=this[n]||0;return n=== +"")),t+" "+e},this).join(" ")};var bu={years:"Y",months:"M",days:"D",hours:"H",minutes:"\ +M",seconds:"S"},Eu=["years","months","days"],xu=["hours","minutes","seconds"];Ze. +prototype.toISOString=Ze.prototype.toISO=function(){var r=Eu.map(t,this).join(""), +e=xu.map(t,this).join("");return"P"+r+"T"+e;function t(n){var i=this[n]||0;return n=== "seconds"&&this.milliseconds&&(i=(i+this.milliseconds/1e3).toFixed(6).replace(/0+$/, -"")),i+Vu[n]}};var Dr="([+-]?\\d+)",Yu=Dr+"\\s+years?",Zu=Dr+"\\s+mons?",Xu=Dr+"\ -\\s+days?",ec="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",tc=new RegExp([ -Yu,Zu,Xu,ec].map(function(r){return"("+r+")?"}).join("\\s*")),Yi={years:2,months:4, -days:6,hours:9,minutes:10,seconds:11,milliseconds:12},rc=["hours","minutes","sec\ -onds","milliseconds"];function nc(r){var e=r+"000000".slice(r.length);return parseInt( -e,10)/1e3}o(nc,"parseMilliseconds");function ic(r){if(!r)return{};var e=tc.exec( -r),t=e[8]==="-";return Object.keys(Yi).reduce(function(n,i){var s=Yi[i],a=e[s];return!a|| -(a=i==="milliseconds"?nc(a):parseInt(a,10),!a)||(t&&~rc.indexOf(i)&&(a*=-1),n[i]= -a),n},{})}o(ic,"parse")});var ts=B((kf,es)=>{"use strict";p();es.exports=o(function(e){if(/^\\x/.test(e))return new w( +"")),i+bu[n]}};var kr="([+-]?\\d+)",Au=kr+"\\s+years?",vu=kr+"\\s+mons?",Cu=kr+"\ +\\s+days?",Tu="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",Ru=new RegExp([ +Au,vu,Cu,Tu].map(function(r){return"("+r+")?"}).join("\\s*")),rs={years:2,months:4, +days:6,hours:9,minutes:10,seconds:11,milliseconds:12},Uu=["hours","minutes","sec\ +onds","milliseconds"];function Iu(r){var e=r+"000000".slice(r.length);return parseInt( +e,10)/1e3}a(Iu,"parseMilliseconds");function Lu(r){if(!r)return{};var e=Ru.exec( +r),t=e[8]==="-";return Object.keys(rs).reduce(function(n,i){var s=rs[i],o=e[s];return!o|| +(o=i==="milliseconds"?Iu(o):parseInt(o,10),!o)||(t&&~Uu.indexOf(i)&&(o*=-1),n[i]= +o),n},{})}a(Lu,"parse")});var os=B((yd,ss)=>{"use strict";y();ss.exports=a(function(e){if(/^\\x/.test(e))return new w( e.substr(2),"hex");for(var t="",n=0;n{p();var pt=Rr(),yt=Nr(),Qt=Vi(),ns=Xi(),is=ts();function $t(r){ -return o(function(t){return t===null?t:r(t)},"nullAllowed")}o($t,"allowNull");function ss(r){ +"\\";n+=Math.floor(i/2)*2}return new w(t,"binary")},"parseBytea")});var ds=B((wd,fs)=>{y();var bt=Mr(),Et=Fr(),Wt=Xi(),cs=is(),us=os();function Vt(r){ +return a(function(t){return t===null?t:r(t)},"nullAllowed")}a(Vt,"allowNull");function ls(r){ return r===null?r:r==="TRUE"||r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"|| -r==="1"}o(ss,"parseBool");function sc(r){return r?pt.parse(r,ss):null}o(sc,"pars\ -eBoolArray");function ac(r){return parseInt(r,10)}o(ac,"parseBaseTenInt");function qr(r){ -return r?pt.parse(r,$t(ac)):null}o(qr,"parseIntegerArray");function oc(r){return r? -pt.parse(r,$t(function(e){return as(e).trim()})):null}o(oc,"parseBigIntegerArray"); -var uc=o(function(r){if(!r)return null;var e=yt.create(r,function(t){return t!== -null&&(t=Qr(t)),t});return e.parse()},"parsePointArray"),Fr=o(function(r){if(!r) -return null;var e=yt.create(r,function(t){return t!==null&&(t=parseFloat(t)),t}); -return e.parse()},"parseFloatArray"),we=o(function(r){if(!r)return null;var e=yt. -create(r);return e.parse()},"parseStringArray"),Or=o(function(r){if(!r)return null; -var e=yt.create(r,function(t){return t!==null&&(t=Qt(t)),t});return e.parse()},"\ -parseDateArray"),cc=o(function(r){if(!r)return null;var e=yt.create(r,function(t){ -return t!==null&&(t=ns(t)),t});return e.parse()},"parseIntervalArray"),lc=o(function(r){ -return r?pt.parse(r,$t(is)):null},"parseByteAArray"),kr=o(function(r){return parseInt( -r,10)},"parseInteger"),as=o(function(r){var e=String(r);return/^\d+$/.test(e)?e: -r},"parseBigInteger"),rs=o(function(r){return r?pt.parse(r,$t(JSON.parse)):null}, -"parseJsonArray"),Qr=o(function(r){return r[0]!=="("?null:(r=r.substring(1,r.length- -1).split(","),{x:parseFloat(r[0]),y:parseFloat(r[1])})},"parsePoint"),hc=o(function(r){ +r==="1"}a(ls,"parseBool");function _u(r){return r?bt.parse(r,ls):null}a(_u,"pars\ +eBoolArray");function Pu(r){return parseInt(r,10)}a(Pu,"parseBaseTenInt");function Dr(r){ +return r?bt.parse(r,Vt(Pu)):null}a(Dr,"parseIntegerArray");function Bu(r){return r? +bt.parse(r,Vt(function(e){return hs(e).trim()})):null}a(Bu,"parseBigIntegerArray"); +var Nu=a(function(r){if(!r)return null;var e=Et.create(r,function(t){return t!== +null&&(t=$r(t)),t});return e.parse()},"parsePointArray"),Or=a(function(r){if(!r) +return null;var e=Et.create(r,function(t){return t!==null&&(t=parseFloat(t)),t}); +return e.parse()},"parseFloatArray"),Se=a(function(r){if(!r)return null;var e=Et. +create(r);return e.parse()},"parseStringArray"),Qr=a(function(r){if(!r)return null; +var e=Et.create(r,function(t){return t!==null&&(t=Wt(t)),t});return e.parse()},"\ +parseDateArray"),Mu=a(function(r){if(!r)return null;var e=Et.create(r,function(t){ +return t!==null&&(t=cs(t)),t});return e.parse()},"parseIntervalArray"),Fu=a(function(r){ +return r?bt.parse(r,Vt(us)):null},"parseByteAArray"),Hr=a(function(r){return parseInt( +r,10)},"parseInteger"),hs=a(function(r){var e=String(r);return/^\d+$/.test(e)?e: +r},"parseBigInteger"),as=a(function(r){return r?bt.parse(r,Vt(JSON.parse)):null}, +"parseJsonArray"),$r=a(function(r){return r[0]!=="("?null:(r=r.substring(1,r.length- +1).split(","),{x:parseFloat(r[0]),y:parseFloat(r[1])})},"parsePoint"),qu=a(function(r){ if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1,i=2;i{"use strict";p();var fe=1e6;function dc(r){var e=r.readInt32BE( -0),t=r.readUInt32BE(4),n="";e<0&&(e=~e+(t===0),t=~t+1>>>0,n="-");var i="",s,a,u, -c,l,h;{if(s=e%fe,e=e/fe>>>0,a=4294967296*s+t,t=a/fe>>>0,u=""+(a-fe*t),t===0&&e=== -0)return n+u+i;for(c="",l=6-u.length,h=0;h>> -0,a=4294967296*s+t,t=a/fe>>>0,u=""+(a-fe*t),t===0&&e===0)return n+u+i;for(c="",l= -6-u.length,h=0;h>>0,a=4294967296*s+t,t=a/ -fe>>>0,u=""+(a-fe*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,h=0;h{p();var pc=ls(),G=o(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(m,b,U){ -return m*Math.pow(2,U)+b};var s=t>>3,a=o(function(m){return n?~m&255:m},"inv"),u=255, -c=8-t%8;e>t%8);var l=0;t%8+e>=8&&(l=i(0,a(r[s])& -u,c));for(var h=e+t>>3,f=s+1;f0&& -(l=i(l,a(r[h])>>8-y,y)),l},"parseBits"),ds=o(function(r,e,t){var n=Math.pow(2,t- -1)-1,i=G(r,1),s=G(r,t,1);if(s===0)return 0;var a=1,u=o(function(l,h,f){l===0&&(l= -1);for(var y=1;y<=f;y++)a/=2,(h&1<0&&(l+=a);return l},"parsePrecisionBits"), -c=G(r,e,t+1,!1,u);return s==Math.pow(2,t+1)-1?c===0?i===0?1/0:-1/0:NaN:(i===0?1: --1)*Math.pow(2,s-n)*c},"parseFloatFromBits"),yc=o(function(r){return G(r,1)==1?-1* -(G(r,15,1,!0)+1):G(r,15,1)},"parseInt16"),hs=o(function(r){return G(r,1)==1?-1*(G( -r,31,1,!0)+1):G(r,31,1)},"parseInt32"),wc=o(function(r){return ds(r,23,8)},"pars\ -eFloat32"),mc=o(function(r){return ds(r,52,11)},"parseFloat64"),gc=o(function(r){ +var s=$r(e);return s.radius=parseFloat(t),s},"parseCircle"),ku=a(function(r){r(20, +hs),r(21,Hr),r(23,Hr),r(26,Hr),r(700,parseFloat),r(701,parseFloat),r(16,ls),r(1082, +Wt),r(1114,Wt),r(1184,Wt),r(600,$r),r(651,Se),r(718,qu),r(1e3,_u),r(1001,Fu),r(1005, +Dr),r(1007,Dr),r(1028,Dr),r(1016,Bu),r(1017,Nu),r(1021,Or),r(1022,Or),r(1231,Or), +r(1014,Se),r(1015,Se),r(1008,Se),r(1009,Se),r(1040,Se),r(1041,Se),r(1115,Qr),r(1182, +Qr),r(1185,Qr),r(1186,cs),r(1187,Mu),r(17,us),r(114,JSON.parse.bind(JSON)),r(3802, +JSON.parse.bind(JSON)),r(199,as),r(3807,as),r(3907,Se),r(2951,Se),r(791,Se),r(1183, +Se),r(1270,Se)},"init");fs.exports={init:ku}});var ys=B((Ed,ps)=>{"use strict";y();var ye=1e6;function Du(r){var e=r.readInt32BE( +0),t=r.readUInt32BE(4),n="";e<0&&(e=~e+(t===0),t=~t+1>>>0,n="-");var i="",s,o,c, +u,l,h;{if(s=e%ye,e=e/ye>>>0,o=4294967296*s+t,t=o/ye>>>0,c=""+(o-ye*t),t===0&&e=== +0)return n+c+i;for(u="",l=6-c.length,h=0;h>> +0,o=4294967296*s+t,t=o/ye>>>0,c=""+(o-ye*t),t===0&&e===0)return n+c+i;for(u="",l= +6-c.length,h=0;h>>0,o=4294967296*s+t,t=o/ +ye>>>0,c=""+(o-ye*t),t===0&&e===0)return n+c+i;for(u="",l=6-c.length,h=0;h{y();var Ou=ys(),G=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(p,E,C){ +return p*Math.pow(2,C)+E};var s=t>>3,o=a(function(p){return n?~p&255:p},"inv"),c=255, +u=8-t%8;e>t%8);var l=0;t%8+e>=8&&(l=i(0,o(r[s])& +c,u));for(var h=e+t>>3,f=s+1;f0&& +(l=i(l,o(r[h])>>8-g,g)),l},"parseBits"),ws=a(function(r,e,t){var n=Math.pow(2,t- +1)-1,i=G(r,1),s=G(r,t,1);if(s===0)return 0;var o=1,c=a(function(l,h,f){l===0&&(l= +1);for(var g=1;g<=f;g++)o/=2,(h&1<0&&(l+=o);return l},"parsePrecisionBits"), +u=G(r,e,t+1,!1,c);return s==Math.pow(2,t+1)-1?u===0?i===0?1/0:-1/0:NaN:(i===0?1: +-1)*Math.pow(2,s-n)*u},"parseFloatFromBits"),Qu=a(function(r){return G(r,1)==1?-1* +(G(r,15,1,!0)+1):G(r,15,1)},"parseInt16"),ms=a(function(r){return G(r,1)==1?-1*(G( +r,31,1,!0)+1):G(r,31,1)},"parseInt32"),Hu=a(function(r){return ws(r,23,8)},"pars\ +eFloat32"),$u=a(function(r){return ws(r,52,11)},"parseFloat64"),ju=a(function(r){ var e=G(r,16,32);if(e==49152)return NaN;for(var t=Math.pow(1e4,G(r,16,16)),n=0,i=[], -s=G(r,16),a=0;a>3,(i+=h<<3)>>3), -f;console.log("ERROR: ElementType not implemented: "+l)},"parseElement"),c=o(function(l,h){ -var f=[],y;if(l.length>1){var m=l.shift();for(y=0;y0},"parseBool"),bc=o(function(r){r(20,pc),r(21,yc),r(23,hs),r(26, -hs),r(1700,gc),r(700,wc),r(701,mc),r(16,Ec),r(1114,fs.bind(null,!1)),r(1184,fs.bind( -null,!0)),r(1e3,wt),r(1007,wt),r(1016,wt),r(1008,wt),r(1009,wt),r(25,Sc)},"init"); -ps.exports={init:bc}});var ms=B((Zf,ws)=>{p();ws.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23, +f;console.log("ERROR: ElementType not implemented: "+l)},"parseElement"),u=a(function(l,h){ +var f=[],g;if(l.length>1){var p=l.shift();for(g=0;g0},"parseBool"),Vu=a(function(r){r(20,Ou),r(21,Qu),r(23,ms),r(26, +ms),r(1700,ju),r(700,Hu),r(701,$u),r(16,Wu),r(1114,gs.bind(null,!1)),r(1184,gs.bind( +null,!0)),r(1e3,xt),r(1007,xt),r(1016,xt),r(1008,xt),r(1009,xt),r(25,Ku)},"init"); +Ss.exports={init:Vu}});var xs=B((Rd,Es)=>{y();Es.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23, REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194, SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703, TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033, @@ -692,226 +697,227 @@ BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INT TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203, REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220, PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642, -REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}});var St=B(gt=>{p();var xc=us(),Ac=ys(),vc=Nr(),Cc=ms();gt.getTypeParser=_c;gt.setTypeParser= -Tc;gt.arrayParser=vc;gt.builtins=Cc;var mt={text:{},binary:{}};function gs(r){return String( -r)}o(gs,"noParse");function _c(r,e){return e=e||"text",mt[e]&&mt[e][r]||gs}o(_c, -"getTypeParser");function Tc(r,e,t){typeof e=="function"&&(t=e,e="text"),mt[e][r]= -t}o(Tc,"setTypeParser");xc.init(function(r,e){mt.text[r]=e});Ac.init(function(r,e){ -mt.binary[r]=e})});var Et=B((nd,$r)=>{"use strict";p();$r.exports={host:"localhost",user:S.platform=== -"win32"?S.env.USERNAME:S.env.USER,database:void 0,password:null,connectionString:void 0, +REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}});var Ct=B(vt=>{y();var Gu=ds(),zu=bs(),Ju=Fr(),Yu=xs();vt.getTypeParser=Zu;vt.setTypeParser= +Xu;vt.arrayParser=Ju;vt.builtins=Yu;var At={text:{},binary:{}};function As(r){return String( +r)}a(As,"noParse");function Zu(r,e){return e=e||"text",At[e]&&At[e][r]||As}a(Zu, +"getTypeParser");function Xu(r,e,t){typeof e=="function"&&(t=e,e="text"),At[e][r]= +t}a(Xu,"setTypeParser");Gu.init(function(r,e){At.text[r]=e});zu.init(function(r,e){ +At.binary[r]=e})});var Tt=B((Pd,jr)=>{"use strict";y();jr.exports={host:"localhost",user:b.platform=== +"win32"?b.env.USERNAME:b.env.USER,database:void 0,password:null,connectionString:void 0, port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4,client_encoding:"",ssl:!1, application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1, statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1, -connect_timeout:0,keepalives:1,keepalives_idle:0};var ze=St(),Lc=ze.getTypeParser( -20,"text"),Uc=ze.getTypeParser(1016,"text");$r.exports.__defineSetter__("parseIn\ -t8",function(r){ze.setTypeParser(20,"text",r?ze.getTypeParser(23,"text"):Lc),ze. -setTypeParser(1016,"text",r?ze.getTypeParser(1007,"text"):Uc)})});var bt=B((sd,Es)=>{"use strict";p();var Ic=(Pr(),X(Ir)),Pc=Et();function Bc(r){var e=r. -replace(/\\/g,"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}o(Bc,"escapeElement"); -function Ss(r){for(var e="{",t=0;t0&&(e=e+","),r[t]===null||typeof r[t]> -"u"?e=e+"NULL":Array.isArray(r[t])?e=e+Ss(r[t]):r[t]instanceof w?e+="\\\\x"+r[t]. -toString("hex"):e+=Bc(jt(r[t]));return e=e+"}",e}o(Ss,"arrayString");var jt=o(function(r,e){ -if(r==null)return null;if(r instanceof w)return r;if(ArrayBuffer.isView(r)){var t=w. -from(r.buffer,r.byteOffset,r.byteLength);return t.length===r.byteLength?t:t.slice( -r.byteOffset,r.byteOffset+r.byteLength)}return r instanceof Date?Pc.parseInputDatesAsUTC? -Mc(r):Nc(r):Array.isArray(r)?Ss(r):typeof r=="object"?Rc(r,e):r.toString()},"pre\ -pareValue");function Rc(r,e){if(r&&typeof r.toPostgres=="function"){if(e=e||[],e. -indexOf(r)!==-1)throw new Error('circular reference detected while preparing "'+ -r+'" for query');return e.push(r),jt(r.toPostgres(jt),e)}return JSON.stringify(r)} -o(Rc,"prepareObject");function oe(r,e){for(r=""+r;r.length{"use strict";p();var Hr=(Pr(),X(Ir));function Fc(r){if(r.indexOf( +connect_timeout:0,keepalives:1,keepalives_idle:0};var Xe=Ct(),el=Xe.getTypeParser( +20,"text"),tl=Xe.getTypeParser(1016,"text");jr.exports.__defineSetter__("parseIn\ +t8",function(r){Xe.setTypeParser(20,"text",r?Xe.getTypeParser(23,"text"):el),Xe. +setTypeParser(1016,"text",r?Xe.getTypeParser(1007,"text"):tl)})});var Rt=B((Nd,Cs)=>{"use strict";y();var rl=(dt(),ne(ft)),nl=Tt();function il(r){ +var e=r.replace(/\\/g,"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(il,"escapeEl\ +ement");function vs(r){for(var e="{",t=0;t0&&(e=e+","),r[t]===null|| +typeof r[t]>"u"?e=e+"NULL":Array.isArray(r[t])?e=e+vs(r[t]):r[t]instanceof w?e+= +"\\\\x"+r[t].toString("hex"):e+=il(Gt(r[t]));return e=e+"}",e}a(vs,"arrayString"); +var Gt=a(function(r,e){if(r==null)return null;if(r instanceof w)return r;if(ArrayBuffer. +isView(r)){var t=w.from(r.buffer,r.byteOffset,r.byteLength);return t.length===r. +byteLength?t:t.slice(r.byteOffset,r.byteOffset+r.byteLength)}return r instanceof +Date?nl.parseInputDatesAsUTC?al(r):ol(r):Array.isArray(r)?vs(r):typeof r=="objec\ +t"?sl(r,e):r.toString()},"prepareValue");function sl(r,e){if(r&&typeof r.toPostgres== +"function"){if(e=e||[],e.indexOf(r)!==-1)throw new Error('circular reference det\ +ected while preparing "'+r+'" for query');return e.push(r),Gt(r.toPostgres(Gt),e)} +return JSON.stringify(r)}a(sl,"prepareObject");function le(r,e){for(r=""+r;r.length< +e;)r="0"+r;return r}a(le,"pad");function ol(r){var e=-r.getTimezoneOffset(),t=r. +getFullYear(),n=t<1;n&&(t=Math.abs(t)+1);var i=le(t,4)+"-"+le(r.getMonth()+1,2)+ +"-"+le(r.getDate(),2)+"T"+le(r.getHours(),2)+":"+le(r.getMinutes(),2)+":"+le(r.getSeconds(), +2)+"."+le(r.getMilliseconds(),3);return e<0?(i+="-",e*=-1):i+="+",i+=le(Math.floor( +e/60),2)+":"+le(e%60,2),n&&(i+=" BC"),i}a(ol,"dateToString");function al(r){var e=r. +getUTCFullYear(),t=e<1;t&&(e=Math.abs(e)+1);var n=le(e,4)+"-"+le(r.getUTCMonth()+ +1,2)+"-"+le(r.getUTCDate(),2)+"T"+le(r.getUTCHours(),2)+":"+le(r.getUTCMinutes(), +2)+":"+le(r.getUTCSeconds(),2)+"."+le(r.getUTCMilliseconds(),3);return n+="+00:0\ +0",t&&(n+=" BC"),n}a(al,"dateToStringUTC");function cl(r,e,t){return r=typeof r== +"string"?{text:r}:r,e&&(typeof e=="function"?r.callback=e:r.values=e),t&&(r.callback= +t),r}a(cl,"normalizeQueryConfig");var Kr=a(function(r){return rl.createHash("md5"). +update(r,"utf-8").digest("hex")},"md5"),ul=a(function(r,e,t){var n=Kr(e+r),i=Kr( +w.concat([w.from(n),t]));return"md5"+i},"postgresMd5PasswordHash");Cs.exports={prepareValue:a( +function(e){return Gt(e)},"prepareValueWrapper"),normalizeQueryConfig:cl,postgresMd5PasswordHash:ul, +md5:Kr}});var Ls=B((qd,Is)=>{"use strict";y();var Wr=(dt(),ne(ft));function ll(r){if(r.indexOf( "SCRAM-SHA-256")===-1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is cur\ -rently supported");let e=Hr.randomBytes(18).toString("base64");return{mechanism:"\ +rently supported");let e=Wr.randomBytes(18).toString("base64");return{mechanism:"\ SCRAM-SHA-256",clientNonce:e,response:"n,,n=*,r="+e,message:"SASLInitialResponse"}} -o(Fc,"startSession");function Oc(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( +a(ll,"startSession");function hl(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( "SASL: Last message was not SASLInitialResponse");if(typeof e!="string")throw new Error( "SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if(typeof t!= "string")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a\ - string");let n=$c(t);if(n.nonce.startsWith(r.clientNonce)){if(n.nonce.length=== + string");let n=pl(t);if(n.nonce.startsWith(r.clientNonce)){if(n.nonce.length=== r.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server n\ once is too short")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serv\ -er nonce does not start with client nonce");var i=w.from(n.salt,"base64"),s=Kc(e, -i,n.iteration),a=Je(s,"Client Key"),u=Hc(a),c="n=*,r="+r.clientNonce,l="r="+n.nonce+ -",s="+n.salt+",i="+n.iteration,h="c=biws,r="+n.nonce,f=c+","+l+","+h,y=Je(u,f),m=As( -a,y),b=m.toString("base64"),U=Je(s,"Server Key"),v=Je(U,f);r.message="SASLRespon\ -se",r.serverSignature=v.toString("base64"),r.response=h+",p="+b}o(Oc,"continueSe\ -ssion");function kc(r,e){if(r.message!=="SASLResponse")throw new Error("SASL: La\ +er nonce does not start with client nonce");var i=w.from(n.salt,"base64"),s=gl(e, +i,n.iteration),o=et(s,"Client Key"),c=ml(o),u="n=*,r="+r.clientNonce,l="r="+n.nonce+ +",s="+n.salt+",i="+n.iteration,h="c=biws,r="+n.nonce,f=u+","+l+","+h,g=et(c,f),p=Us( +o,g),E=p.toString("base64"),C=et(s,"Server Key"),v=et(C,f);r.message="SASLRespon\ +se",r.serverSignature=v.toString("base64"),r.response=h+",p="+E}a(hl,"continueSe\ +ssion");function fl(r,e){if(r.message!=="SASLResponse")throw new Error("SASL: La\ st message was not SASLResponse");if(typeof e!="string")throw new Error("SASL: S\ -CRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=jc( +CRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=yl( e);if(t!==r.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: s\ -erver signature does not match")}o(kc,"finalizeSession");function Qc(r){if(typeof r!= +erver signature does not match")}a(fl,"finalizeSession");function dl(r){if(typeof r!= "string")throw new TypeError("SASL: text must be a string");return r.split("").map( -(e,t)=>r.charCodeAt(t)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}o(Qc,"isPrintableC\ -hars");function bs(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(r)}o(bs,"isBase64");function xs(r){if(typeof r!="string")throw new TypeError( +(e,t)=>r.charCodeAt(t)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}a(dl,"isPrintableC\ +hars");function Ts(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(r)}a(Ts,"isBase64");function Rs(r){if(typeof r!="string")throw new TypeError( "SASL: attribute pairs text must be a string");return new Map(r.split(",").map(e=>{ if(!/^.=/.test(e))throw new Error("SASL: Invalid attribute pair entry");let t=e[0], -n=e.substring(2);return[t,n]}))}o(xs,"parseAttributePairs");function $c(r){let e=xs( -r),t=e.get("r");if(t){if(!Qc(t))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAG\ +n=e.substring(2);return[t,n]}))}a(Rs,"parseAttributePairs");function pl(r){let e=Rs( +r),t=e.get("r");if(t){if(!dl(t))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAG\ E: nonce must only contain printable characters")}else throw new Error("SASL: SC\ -RAM-SERVER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!bs(n))throw new Error( +RAM-SERVER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!Ts(n))throw new Error( "SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64")}else throw new Error("S\ ASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");let i=e.get("i");if(i){if(!/^[1-9][0-9]*$/. test(i))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration cou\ nt")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing"); -let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}o($c,"parseServerFirstMe\ -ssage");function jc(r){let t=xs(r).get("v");if(t){if(!bs(t))throw new Error("SAS\ +let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(pl,"parseServerFirstMe\ +ssage");function yl(r){let t=Rs(r).get("v");if(t){if(!Ts(t))throw new Error("SAS\ L: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64")}else throw new Error( "SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");return{serverSignature:t}} -o(jc,"parseServerFinalMessage");function As(r,e){if(!w.isBuffer(r))throw new TypeError( +a(yl,"parseServerFinalMessage");function Us(r,e){if(!w.isBuffer(r))throw new TypeError( "first argument must be a Buffer");if(!w.isBuffer(e))throw new TypeError("second\ argument must be a Buffer");if(r.length!==e.length)throw new Error("Buffer leng\ ths must match");if(r.length===0)throw new Error("Buffers cannot be empty");return w. -from(r.map((t,n)=>r[n]^e[n]))}o(As,"xorBuffers");function Hc(r){return Hr.createHash( -"sha256").update(r).digest()}o(Hc,"sha256");function Je(r,e){return Hr.createHmac( -"sha256",r).update(e).digest()}o(Je,"hmacSha256");function Kc(r,e,t){for(var n=Je( -r,w.concat([e,w.from([0,0,0,1])])),i=n,s=0;sWc});function Wc(...r){return r.join("/")}var Wr=le(()=>{ -"use strict";p();o(Wc,"join")});var Gr={};pe(Gr,{stat:()=>Gc});function Gc(r,e){e(new Error("No filesystem"))}var Vr=le( -()=>{"use strict";p();o(Gc,"stat")});var zr={};pe(zr,{default:()=>Vc});var Vc,Jr=le(()=>{"use strict";p();Vc={}});var _s={};pe(_s,{StringDecoder:()=>Yr});var Yr,Ts=le(()=>{"use strict";p();Yr=class{static{ -o(this,"StringDecoder")}td;constructor(e){this.td=new TextDecoder(e)}write(e){return this. -td.decode(e,{stream:!0})}end(e){return this.td.decode(e)}}});var Ps=B((gd,Is)=>{"use strict";p();var{Transform:zc}=(Jr(),X(zr)),{StringDecoder:Jc}=(Ts(),X(_s)), -Ie=Symbol("last"),Ht=Symbol("decoder");function Yc(r,e,t){let n;if(this.overflow){ -if(n=this[Ht].write(r).split(this.matcher),n.length===1)return t();n.shift(),this. -overflow=!1}else this[Ie]+=this[Ht].write(r),n=this[Ie].split(this.matcher);this[Ie]= -n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){ -t(new Error("maximum buffer reached"));return}t()}o(Yc,"transform");function Zc(r){ -if(this[Ie]+=this[Ht].end(),this[Ie])try{Us(this,this.mapper(this[Ie]))}catch(e){ -return r(e)}r()}o(Zc,"flush");function Us(r,e){e!==void 0&&r.push(e)}o(Us,"push"); -function Ls(r){return r}o(Ls,"noop");function Xc(r,e,t){switch(r=r||/\r?\n/,e=e|| -Ls,t=t||{},arguments.length){case 1:typeof r=="function"?(e=r,r=/\r?\n/):typeof r== +from(r.map((t,n)=>r[n]^e[n]))}a(Us,"xorBuffers");function ml(r){return Wr.createHash( +"sha256").update(r).digest()}a(ml,"sha256");function et(r,e){return Wr.createHmac( +"sha256",r).update(e).digest()}a(et,"hmacSha256");function gl(r,e,t){for(var n=et( +r,w.concat([e,w.from([0,0,0,1])])),i=n,s=0;swl});function wl(...r){return r.join("/")}var Gr=de(()=>{ +"use strict";y();a(wl,"join")});var zr={};ge(zr,{stat:()=>Sl});function Sl(r,e){e(new Error("No filesystem"))}var Jr=de( +()=>{"use strict";y();a(Sl,"stat")});var Yr={};ge(Yr,{default:()=>bl});var bl,Zr=de(()=>{"use strict";y();bl={}});var _s={};ge(_s,{StringDecoder:()=>Xr});var Xr,Ps=de(()=>{"use strict";y();Xr=class{static{ +a(this,"StringDecoder")}td;constructor(e){this.td=new TextDecoder(e)}write(e){return this. +td.decode(e,{stream:!0})}end(e){return this.td.decode(e)}}});var Fs=B((Vd,Ms)=>{"use strict";y();var{Transform:El}=(Zr(),ne(Yr)),{StringDecoder:xl}=(Ps(),ne(_s)), +Me=Symbol("last"),zt=Symbol("decoder");function Al(r,e,t){let n;if(this.overflow){ +if(n=this[zt].write(r).split(this.matcher),n.length===1)return t();n.shift(),this. +overflow=!1}else this[Me]+=this[zt].write(r),n=this[Me].split(this.matcher);this[Me]= +n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){ +t(new Error("maximum buffer reached"));return}t()}a(Al,"transform");function vl(r){ +if(this[Me]+=this[zt].end(),this[Me])try{Ns(this,this.mapper(this[Me]))}catch(e){ +return r(e)}r()}a(vl,"flush");function Ns(r,e){e!==void 0&&r.push(e)}a(Ns,"push"); +function Bs(r){return r}a(Bs,"noop");function Cl(r,e,t){switch(r=r||/\r?\n/,e=e|| +Bs,t=t||{},arguments.length){case 1:typeof r=="function"?(e=r,r=/\r?\n/):typeof r== "object"&&!(r instanceof RegExp)&&!r[Symbol.split]&&(t=r,r=/\r?\n/);break;case 2: -typeof r=="function"?(t=e,e=r,r=/\r?\n/):typeof e=="object"&&(t=e,e=Ls)}t=Object. -assign({},t),t.autoDestroy=!0,t.transform=Yc,t.flush=Zc,t.readableObjectMode=!0; -let n=new zc(t);return n[Ie]="",n[Ht]=new Jc("utf8"),n.matcher=r,n.mapper=e,n.maxLength= +typeof r=="function"?(t=e,e=r,r=/\r?\n/):typeof e=="object"&&(t=e,e=Bs)}t=Object. +assign({},t),t.autoDestroy=!0,t.transform=Al,t.flush=vl,t.readableObjectMode=!0; +let n=new El(t);return n[Me]="",n[zt]=new xl("utf8"),n.matcher=r,n.mapper=e,n.maxLength= t.maxLength,n.skipOverflow=t.skipOverflow||!1,n.overflow=!1,n._destroy=function(i,s){ -this._writableState.errorEmitted=!1,s(i)},n}o(Xc,"split");Is.exports=Xc});var Ns=B((bd,ve)=>{"use strict";p();var Bs=(Wr(),X(Kr)),el=(Jr(),X(zr)).Stream,tl=Ps(), -Rs=(ht(),X(lt)),rl=5432,Kt=S.platform==="win32",xt=S.stderr,nl=56,il=7,sl=61440, -al=32768;function ol(r){return(r&sl)==al}o(ol,"isRegFile");var Ye=["host","port", -"database","user","password"],Zr=Ye.length,ul=Ye[Zr-1];function Xr(){var r=xt instanceof -el&&xt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` -`);xt.write(Rs.format.apply(Rs,e))}}o(Xr,"warn");Object.defineProperty(ve.exports, -"isWin",{get:o(function(){return Kt},"get"),set:o(function(r){Kt=r},"set")});ve. -exports.warnTo=function(r){var e=xt;return xt=r,e};ve.exports.getFileName=function(r){ -var e=r||S.env,t=e.PGPASSFILE||(Kt?Bs.join(e.APPDATA||"./","postgresql","pgpass.\ -conf"):Bs.join(e.HOME||"./",".pgpass"));return t};ve.exports.usePgPass=function(r,e){ -return Object.prototype.hasOwnProperty.call(S.env,"PGPASSWORD")?!1:Kt?!0:(e=e||"\ -",ol(r.mode)?r.mode&(nl|il)?(Xr('WARNING: password file "%s" has group or \ -world access; permissions should be u=rw (0600) or less',e),!1):!0:(Xr('WARNING:\ - password file "%s" is not a plain file',e),!1))};var cl=ve.exports.match=function(r,e){ -return Ye.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||rl)===Number( -e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};ve.exports.getPassword=function(r,e,t){ -var n,i=e.pipe(tl());function s(c){var l=ll(c);l&&hl(l)&&cl(r,l)&&(n=l[ul],i.end())} -o(s,"onLine");var a=o(function(){e.destroy(),t(n)},"onEnd"),u=o(function(c){e.destroy(), -Xr("WARNING: error on reading file: %s",c),t(void 0)},"onErr");e.on("error",u),i. -on("data",s).on("end",a).on("error",u)};var ll=ve.exports.parseLine=function(r){ -if(r.length<11||r.match(/^\s+#/))return null;for(var e="",t="",n=0,i=0,s=0,a={}, -u=!1,c=o(function(h,f,y){var m=r.substring(f,y);Object.hasOwnProperty.call(S.env, -"PGPASS_NO_DEESCAPE")||(m=m.replace(/\\([:\\])/g,"$1")),a[Ye[h]]=m},"addToObj"), -l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return a=Object.keys(a).length=== -Zr?a:null,a},hl=ve.exports.isValidEntry=function(r){for(var e={0:function(a){return a. -length>0},1:function(a){return a==="*"?!0:(a=Number(a),isFinite(a)&&a>0&&a<9007199254740992&& -Math.floor(a)===a)},2:function(a){return a.length>0},3:function(a){return a.length> -0},4:function(a){return a.length>0}},t=0;t{"use strict";p();var vd=(Wr(),X(Kr)),Ms=(Vr(),X(Gr)),Wt=Ns(); -en.exports=function(r,e){var t=Wt.getFileName();Ms.stat(t,function(n,i){if(n||!Wt. -usePgPass(i,t))return e(void 0);var s=Ms.createReadStream(t);Wt.getPassword(r,s, -e)})};en.exports.warnTo=Wt.warnTo});var Vt=B((Td,qs)=>{"use strict";p();var fl=St();function Gt(r){this._types=r||fl, -this.text={},this.binary={}}o(Gt,"TypeOverrides");Gt.prototype.getOverrides=function(r){ +this._writableState.errorEmitted=!1,s(i)},n}a(Cl,"split");Ms.exports=Cl});var Ds=B((Jd,Ue)=>{"use strict";y();var qs=(Gr(),ne(Vr)),Tl=(Zr(),ne(Yr)).Stream, +Rl=Fs(),ks=(St(),ne(wt)),Ul=5432,Jt=b.platform==="win32",Ut=b.stderr,Il=56,Ll=7, +_l=61440,Pl=32768;function Bl(r){return(r&_l)==Pl}a(Bl,"isRegFile");var tt=["hos\ +t","port","database","user","password"],en=tt.length,Nl=tt[en-1];function tn(){var r=Ut instanceof +Tl&&Ut.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` +`);Ut.write(ks.format.apply(ks,e))}}a(tn,"warn");Object.defineProperty(Ue.exports, +"isWin",{get:a(function(){return Jt},"get"),set:a(function(r){Jt=r},"set")});Ue. +exports.warnTo=function(r){var e=Ut;return Ut=r,e};Ue.exports.getFileName=function(r){ +var e=r||b.env,t=e.PGPASSFILE||(Jt?qs.join(e.APPDATA||"./","postgresql","pgpass.\ +conf"):qs.join(e.HOME||"./",".pgpass"));return t};Ue.exports.usePgPass=function(r,e){ +return Object.prototype.hasOwnProperty.call(b.env,"PGPASSWORD")?!1:Jt?!0:(e=e||"\ +",Bl(r.mode)?r.mode&(Il|Ll)?(tn('WARNING: password file "%s" has group or \ +world access; permissions should be u=rw (0600) or less',e),!1):!0:(tn('WARNING:\ + password file "%s" is not a plain file',e),!1))};var Ml=Ue.exports.match=function(r,e){ +return tt.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||Ul)===Number( +e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};Ue.exports.getPassword=function(r,e,t){ +var n,i=e.pipe(Rl());function s(u){var l=Fl(u);l&&ql(l)&&Ml(r,l)&&(n=l[Nl],i.end())} +a(s,"onLine");var o=a(function(){e.destroy(),t(n)},"onEnd"),c=a(function(u){e.destroy(), +tn("WARNING: error on reading file: %s",u),t(void 0)},"onErr");e.on("error",c),i. +on("data",s).on("end",o).on("error",c)};var Fl=Ue.exports.parseLine=function(r){ +if(r.length<11||r.match(/^\s+#/))return null;for(var e="",t="",n=0,i=0,s=0,o={}, +c=!1,u=a(function(h,f,g){var p=r.substring(f,g);Object.hasOwnProperty.call(b.env, +"PGPASS_NO_DEESCAPE")||(p=p.replace(/\\([:\\])/g,"$1")),o[tt[h]]=p},"addToObj"), +l=0;l=0&&e==":"&&t!=="\\"&&(u(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o).length=== +en?o:null,o},ql=Ue.exports.isValidEntry=function(r){for(var e={0:function(o){return o. +length>0},1:function(o){return o==="*"?!0:(o=Number(o),isFinite(o)&&o>0&&o<9007199254740992&& +Math.floor(o)===o)},2:function(o){return o.length>0},3:function(o){return o.length> +0},4:function(o){return o.length>0}},t=0;t{"use strict";y();var Xd=(Gr(),ne(Vr)),Os=(Jr(),ne(zr)),Yt=Ds(); +rn.exports=function(r,e){var t=Yt.getFileName();Os.stat(t,function(n,i){if(n||!Yt. +usePgPass(i,t))return e(void 0);var s=Os.createReadStream(t);Yt.getPassword(r,s, +e)})};rn.exports.warnTo=Yt.warnTo});var Xt=B((rp,Hs)=>{"use strict";y();var kl=Ct();function Zt(r){this._types=r||kl, +this.text={},this.binary={}}a(Zt,"TypeOverrides");Zt.prototype.getOverrides=function(r){ switch(r){case"text":return this.text;case"binary":return this.binary;default:return{}}}; -Gt.prototype.setTypeParser=function(r,e,t){typeof e=="function"&&(t=e,e="text"), -this.getOverrides(e)[r]=t};Gt.prototype.getTypeParser=function(r,e){return e=e|| -"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};qs.exports=Gt});var Fs={};pe(Fs,{default:()=>dl});var dl,Os=le(()=>{"use strict";p();dl={}});var ks={};pe(ks,{parse:()=>tn});function tn(r,e=!1){let{protocol:t}=new URL(r),n="\ -http:"+r.substring(t.length),{username:i,password:s,host:a,hostname:u,port:c,pathname:l, -search:h,searchParams:f,hash:y}=new URL(n);s=decodeURIComponent(s),i=decodeURIComponent( -i),l=decodeURIComponent(l);let m=i+":"+s,b=e?Object.fromEntries(f.entries()):h;return{ -href:r,protocol:t,auth:m,username:i,password:s,host:a,hostname:u,port:c,pathname:l, -search:h,query:b,hash:y}}var rn=le(()=>{"use strict";p();o(tn,"parse")});var $s=B((Rd,Qs)=>{"use strict";p();var pl=(rn(),X(ks)),nn=(Vr(),X(Gr));function sn(r){ -if(r.charAt(0)==="/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=pl. +Zt.prototype.setTypeParser=function(r,e,t){typeof e=="function"&&(t=e,e="text"), +this.getOverrides(e)[r]=t};Zt.prototype.getTypeParser=function(r,e){return e=e|| +"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};Hs.exports=Zt});var $s={};ge($s,{default:()=>Dl});var Dl,js=de(()=>{"use strict";y();Dl={}});var Ks={};ge(Ks,{parse:()=>nn});function nn(r,e=!1){let{protocol:t}=new URL(r),n="\ +http:"+r.substring(t.length),{username:i,password:s,host:o,hostname:c,port:u,pathname:l, +search:h,searchParams:f,hash:g}=new URL(n);s=decodeURIComponent(s),i=decodeURIComponent( +i),l=decodeURIComponent(l);let p=i+":"+s,E=e?Object.fromEntries(f.entries()):h;return{ +href:r,protocol:t,auth:p,username:i,password:s,host:o,hostname:c,port:u,pathname:l, +search:h,query:E,hash:g}}var sn=de(()=>{"use strict";y();a(nn,"parse")});var Vs=B((cp,Ws)=>{"use strict";y();var Ol=(sn(),ne(Ks)),on=(Jr(),ne(zr));function an(r){ +if(r.charAt(0)==="/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Ol. parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(r)?encodeURI(r).replace(/\%25(\d\d)/g, "%$1"):r,!0),t=e.query;for(var n in t)Array.isArray(t[n])&&(t[n]=t[n][t[n].length- 1]);var i=(e.auth||":").split(":");if(t.user=i[0],t.password=i.splice(1).join(":"), t.port=e.port,e.protocol=="socket:")return t.host=decodeURI(e.pathname),t.database= e.query.db,t.client_encoding=e.query.encoding,t;t.host||(t.host=e.hostname);var s=e. -pathname;if(!t.host&&s&&/^%2f/i.test(s)){var a=s.split("/");t.host=decodeURIComponent( -a[0]),s=a.splice(1).join("/")}switch(s&&s.charAt(0)==="/"&&(s=s.slice(1)||null), +pathname;if(!t.host&&s&&/^%2f/i.test(s)){var o=s.split("/");t.host=decodeURIComponent( +o[0]),s=o.splice(1).join("/")}switch(s&&s.charAt(0)==="/"&&(s=s.slice(1)||null), t.database=s&&decodeURI(s),(t.ssl==="true"||t.ssl==="1")&&(t.ssl=!0),t.ssl==="0"&& (t.ssl=!1),(t.sslcert||t.sslkey||t.sslrootcert||t.sslmode)&&(t.ssl={}),t.sslcert&& -(t.ssl.cert=nn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=nn.readFileSync( -t.sslkey).toString()),t.sslrootcert&&(t.ssl.ca=nn.readFileSync(t.sslrootcert).toString()), +(t.ssl.cert=on.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=on.readFileSync( +t.sslkey).toString()),t.sslrootcert&&(t.ssl.ca=on.readFileSync(t.sslrootcert).toString()), t.sslmode){case"disable":{t.ssl=!1;break}case"prefer":case"require":case"verify-\ ca":case"verify-full":break;case"no-verify":{t.ssl.rejectUnauthorized=!1;break}} -return t}o(sn,"parse");Qs.exports=sn;sn.parse=sn});var zt=B((Dd,Ks)=>{"use strict";p();var yl=(Os(),X(Fs)),Hs=Et(),js=$s().parse,ue=o( -function(r,e,t){return t===void 0?t=S.env["PG"+r.toUpperCase()]:t===!1||(t=S.env[t]), -e[r]||t||Hs[r]},"val"),wl=o(function(){switch(S.env.PGSSLMODE){case"disable":return!1;case"\ +return t}a(an,"parse");Ws.exports=an;an.parse=an});var er=B((hp,Js)=>{"use strict";y();var Ql=(js(),ne($s)),zs=Tt(),Gs=Vs().parse,he=a( +function(r,e,t){return t===void 0?t=b.env["PG"+r.toUpperCase()]:t===!1||(t=b.env[t]), +e[r]||t||zs[r]},"val"),Hl=a(function(){switch(b.env.PGSSLMODE){case"disable":return!1;case"\ prefer":case"require":case"verify-ca":case"verify-full":return!0;case"no-verify": -return{rejectUnauthorized:!1}}return Hs.ssl},"readSSLConfigFromEnvironment"),Ze=o( +return{rejectUnauthorized:!1}}return zs.ssl},"readSSLConfigFromEnvironment"),rt=a( function(r){return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quo\ -teParamValue"),me=o(function(r,e,t){var n=e[t];n!=null&&r.push(t+"="+Ze(n))},"ad\ -d"),an=class{static{o(this,"ConnectionParameters")}constructor(e){e=typeof e=="s\ -tring"?js(e):e||{},e.connectionString&&(e=Object.assign({},e,js(e.connectionString))), -this.user=ue("user",e),this.database=ue("database",e),this.database===void 0&&(this. -database=this.user),this.port=parseInt(ue("port",e),10),this.host=ue("host",e),Object. -defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:ue( -"password",e)}),this.binary=ue("binary",e),this.options=ue("options",e),this.ssl= -typeof e.ssl>"u"?wl():e.ssl,typeof this.ssl=="string"&&this.ssl==="true"&&(this. +teParamValue"),be=a(function(r,e,t){var n=e[t];n!=null&&r.push(t+"="+rt(n))},"ad\ +d"),cn=class{static{a(this,"ConnectionParameters")}constructor(e){e=typeof e=="s\ +tring"?Gs(e):e||{},e.connectionString&&(e=Object.assign({},e,Gs(e.connectionString))), +this.user=he("user",e),this.database=he("database",e),this.database===void 0&&(this. +database=this.user),this.port=parseInt(he("port",e),10),this.host=he("host",e),Object. +defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:he( +"password",e)}),this.binary=he("binary",e),this.options=he("options",e),this.ssl= +typeof e.ssl>"u"?Hl():e.ssl,typeof this.ssl=="string"&&this.ssl==="true"&&(this. ssl=!0),this.ssl==="no-verify"&&(this.ssl={rejectUnauthorized:!1}),this.ssl&&this. ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this.client_encoding= -ue("client_encoding",e),this.replication=ue("replication",e),this.isDomainSocket= -!(this.host||"").indexOf("/"),this.application_name=ue("application_name",e,"PGA\ -PPNAME"),this.fallback_application_name=ue("fallback_application_name",e,!1),this. -statement_timeout=ue("statement_timeout",e,!1),this.lock_timeout=ue("lock_timeou\ -t",e,!1),this.idle_in_transaction_session_timeout=ue("idle_in_transaction_sessio\ -n_timeout",e,!1),this.query_timeout=ue("query_timeout",e,!1),e.connectionTimeoutMillis=== -void 0?this.connect_timeout=S.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math. +he("client_encoding",e),this.replication=he("replication",e),this.isDomainSocket= +!(this.host||"").indexOf("/"),this.application_name=he("application_name",e,"PGA\ +PPNAME"),this.fallback_application_name=he("fallback_application_name",e,!1),this. +statement_timeout=he("statement_timeout",e,!1),this.lock_timeout=he("lock_timeou\ +t",e,!1),this.idle_in_transaction_session_timeout=he("idle_in_transaction_sessio\ +n_timeout",e,!1),this.query_timeout=he("query_timeout",e,!1),e.connectionTimeoutMillis=== +void 0?this.connect_timeout=b.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math. floor(e.connectionTimeoutMillis/1e3),e.keepAlive===!1?this.keepalives=0:e.keepAlive=== !0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis=="number"&&(this.keepalives_idle= Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){var t=[]; -me(t,this,"user"),me(t,this,"password"),me(t,this,"port"),me(t,this,"application\ -_name"),me(t,this,"fallback_application_name"),me(t,this,"connect_timeout"),me(t, +be(t,this,"user"),be(t,this,"password"),be(t,this,"port"),be(t,this,"application\ +_name"),be(t,this,"fallback_application_name"),be(t,this,"connect_timeout"),be(t, this,"options");var n=typeof this.ssl=="object"?this.ssl:this.ssl?{sslmode:this. -ssl}:{};if(me(t,n,"sslmode"),me(t,n,"sslca"),me(t,n,"sslkey"),me(t,n,"sslcert"), -me(t,n,"sslrootcert"),this.database&&t.push("dbname="+Ze(this.database)),this.replication&& -t.push("replication="+Ze(this.replication)),this.host&&t.push("host="+Ze(this.host)), +ssl}:{};if(be(t,n,"sslmode"),be(t,n,"sslca"),be(t,n,"sslkey"),be(t,n,"sslcert"), +be(t,n,"sslrootcert"),this.database&&t.push("dbname="+rt(this.database)),this.replication&& +t.push("replication="+rt(this.replication)),this.host&&t.push("host="+rt(this.host)), this.isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("cli\ -ent_encoding="+Ze(this.client_encoding)),yl.lookup(this.host,function(i,s){return i? -e(i,null):(t.push("hostaddr="+Ze(s)),e(null,t.join(" ")))})}};Ks.exports=an});var Vs=B((Od,Gs)=>{"use strict";p();var ml=St(),Ws=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/, -on=class{static{o(this,"Result")}constructor(e,t){this.command=null,this.rowCount= +ent_encoding="+rt(this.client_encoding)),Ql.lookup(this.host,function(i,s){return i? +e(i,null):(t.push("hostaddr="+rt(s)),e(null,t.join(" ")))})}};Js.exports=cn});var Xs=B((pp,Zs)=>{"use strict";y();var $l=Ct(),Ys=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/, +un=class{static{a(this,"Result")}constructor(e,t){this.command=null,this.rowCount= null,this.oid=null,this.rows=[],this.fields=[],this._parsers=void 0,this._types= t,this.RowCtor=null,this.rowAsArray=e==="array",this.rowAsArray&&(this.parseRow= -this._parseRowAsArray)}addCommandComplete(e){var t;e.text?t=Ws.exec(e.text):t=Ws. +this._parseRowAsArray)}addCommandComplete(e){var t;e.text?t=Ys.exec(e.text):t=Ys. exec(e.command),t&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2],10),this.rowCount= parseInt(t[3],10)):t[2]&&(this.rowCount=parseInt(t[2],10)))}_parseRowAsArray(e){ for(var t=new Array(e.length),n=0,i=e.length;n{"use strict";p();var{EventEmitter:gl}=Ue(),zs=Vs(),Js=bt(),un=class extends gl{static{ -o(this,"Query")}constructor(e,t,n){super(),e=Js.normalizeQueryConfig(e,t,n),this. +this._types.getTypeParser(n.dataTypeID,n.format||"text"):this._parsers[t]=$l.getTypeParser( +n.dataTypeID,n.format||"text")}}};Zs.exports=un});var no=B((gp,ro)=>{"use strict";y();var{EventEmitter:jl}=Ne(),eo=Xs(),to=Rt(),ln=class extends jl{static{ +a(this,"Query")}constructor(e,t,n){super(),e=to.normalizeQueryConfig(e,t,n),this. text=e.text,this.values=e.values,this.rows=e.rows,this.types=e.types,this.name=e. name,this.binary=e.binary,this.portal=e.portal||"",this.callback=e.callback,this. -_rowMode=e.rowMode,S.domain&&e.callback&&(this.callback=S.domain.bind(e.callback)), -this._result=new zs(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement= +_rowMode=e.rowMode,b.domain&&e.callback&&(this.callback=b.domain.bind(e.callback)), +this._result=new eo(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement= !1,this._canceledDueToError=!1,this._promise=null}requiresPreparation(){return this. name||this.rows?!0:!this.text||!this.values?!1:this.values.length>0}_checkForMultirow(){ this._result.command&&(Array.isArray(this._results)||(this._results=[this._result]), -this._result=new zs(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){ +this._result=new eo(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){ this._checkForMultirow(),this._result.addFields(e.fields),this._accumulateRows=this. callback||!this.listeners("row").length}handleDataRow(e){let t;if(!this._canceledDueToError){ try{t=this._result.parseRow(e.fields)}catch(n){this._canceledDueToError=n;return} @@ -921,7 +927,7 @@ this.rows&&e.sync()}handleError(e,t){if(this._canceledDueToError&&(e=this._cance this._canceledDueToError=!1),this.callback)return this.callback(e);this.emit("er\ ror",e)}handleReadyForQuery(e){if(this._canceledDueToError)return this.handleError( this._canceledDueToError,e);if(this.callback)try{this.callback(null,this._results)}catch(t){ -S.nextTick(()=>{throw t})}this.emit("end",this._results)}submit(e){if(typeof this. +b.nextTick(()=>{throw t})}this.emit("end",this._results)}submit(e){if(typeof this. text!="string"&&typeof this.name!="string")return new Error("A query must have e\ ither text or a name. Supplying neither is unsupported.");let t=e.parsedStatements[this. name];return this.text&&t&&this.text!==t?new Error(`Prepared statements must be \ @@ -932,14 +938,14 @@ name]}handlePortalSuspended(e){this._getRows(e,this.rows)}_getRows(e,t){e.execut {portal:this.portal,rows:t}),t?e.flush():e.sync()}prepare(e){this.isPreparedStatement= !0,this.hasBeenParsed(e)||e.parse({text:this.text,name:this.name,types:this.types}); try{e.bind({portal:this.portal,statement:this.name,values:this.values,binary:this. -binary,valueMapper:Js.prepareValue})}catch(t){this.handleError(t,e);return}e.describe( +binary,valueMapper:to.prepareValue})}catch(t){this.handleError(t,e);return}e.describe( {type:"P",name:this.portal||""}),this._getRows(e,this.rows)}handleCopyInResponse(e){ -e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};Ys.exports=un});var ta={};pe(ta,{Socket:()=>ge,isIP:()=>Sl});function Sl(r){return 0}var ea,Xs,ge, -Jt=le(()=>{"use strict";p();ea=Oe(Ue(),1);o(Sl,"isIP");Xs=/^[^.]+\./,ge=class r extends ea.EventEmitter{static{ -o(this,"Socket")}static defaults={poolQueryViaFetch:!1,fetchEndpoint:o((e,t,n)=>{ -let i;return n?.jwtAuth?i=e.replace(Xs,"apiauth."):i=e.replace(Xs,"api."),"https\ +e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};ro.exports=ln});var oo={};ge(oo,{Socket:()=>Ee,isIP:()=>Kl});function Kl(r){return 0}var so,io,Ee, +tr=de(()=>{"use strict";y();so=je(Ne(),1);a(Kl,"isIP");io=/^[^.]+\./,Ee=class r extends so.EventEmitter{static{ +a(this,"Socket")}static defaults={poolQueryViaFetch:!1,fetchEndpoint:a((e,t,n)=>{ +let i;return n?.jwtAuth?i=e.replace(io,"apiauth."):i=e.replace(io,"api."),"https\ ://"+i+"/sql"},"fetchEndpoint"),fetchConnectionCache:!0,fetchFunction:void 0,webSocketConstructor:void 0, -wsProxy:o(e=>e+"/v2","wsProxy"),useSecureWebSocket:!0,forceDisablePgSSL:!0,coalesceWrites:!0, +wsProxy:a(e=>e+"/v2","wsProxy"),useSecureWebSocket:!0,forceDisablePgSSL:!0,coalesceWrites:!0, pipelineConnect:"password",subtls:void 0,rootCerts:"",pipelineTLS:!1,disableSNI:!1};static opts={};opts={};static get poolQueryViaFetch(){ return r.opts.poolQueryViaFetch??r.defaults.poolQueryViaFetch}static set poolQueryViaFetch(e){ r.opts.poolQueryViaFetch=e}static get fetchEndpoint(){return r.opts.fetchEndpoint?? @@ -979,79 +985,79 @@ ed. Please see https://github.com/neondatabase/serverless/blob/main/CONFIG.md#ws proxy-string--host-string-port-number--string--string");return typeof n=="functi\ on"?n(e,t):`${n}?address=${e}:${t}`}connecting=!1;pending=!0;writable=!0;encrypted=!1;authorized=!1;destroyed=!1;ws=null;writeBuffer;tlsState=0;tlsRead;tlsWrite;setNoDelay(){ return this}setKeepAlive(){return this}ref(){return this}unref(){return this}connect(e,t,n){ -this.connecting=!0,n&&this.once("connect",n);let i=o(()=>{this.connecting=!1,this. -pending=!1,this.emit("connect"),this.emit("ready")},"handleWebSocketOpen"),s=o((u,c=!1)=>{ -u.binaryType="arraybuffer",u.addEventListener("error",l=>{this.emit("error",l),this. -emit("close")}),u.addEventListener("message",l=>{if(this.tlsState===0){let h=w.from( -l.data);this.emit("data",h)}}),u.addEventListener("close",()=>{this.emit("close")}), -c?i():u.addEventListener("open",i)},"configureWebSocket"),a;try{a=this.wsProxyAddrForHost( -t,typeof e=="string"?parseInt(e,10):e)}catch(u){this.emit("error",u),this.emit("\ -close");return}try{let c=(this.useSecureWebSocket?"wss:":"ws:")+"//"+a;if(this.webSocketConstructor!== -void 0)this.ws=new this.webSocketConstructor(c),s(this.ws);else try{this.ws=new WebSocket( -c),s(this.ws)}catch{this.ws=new __unstable_WebSocket(c),s(this.ws)}}catch(u){let l=(this. -useSecureWebSocket?"https:":"http:")+"//"+a;fetch(l,{headers:{Upgrade:"websocket"}}). -then(h=>{if(this.ws=h.webSocket,this.ws==null)throw u;this.ws.accept(),s(this.ws, +this.connecting=!0,n&&this.once("connect",n);let i=a(()=>{this.connecting=!1,this. +pending=!1,this.emit("connect"),this.emit("ready")},"handleWebSocketOpen"),s=a((c,u=!1)=>{ +c.binaryType="arraybuffer",c.addEventListener("error",l=>{this.emit("error",l),this. +emit("close")}),c.addEventListener("message",l=>{if(this.tlsState===0){let h=w.from( +l.data);this.emit("data",h)}}),c.addEventListener("close",()=>{this.emit("close")}), +u?i():c.addEventListener("open",i)},"configureWebSocket"),o;try{o=this.wsProxyAddrForHost( +t,typeof e=="string"?parseInt(e,10):e)}catch(c){this.emit("error",c),this.emit("\ +close");return}try{let u=(this.useSecureWebSocket?"wss:":"ws:")+"//"+o;if(this.webSocketConstructor!== +void 0)this.ws=new this.webSocketConstructor(u),s(this.ws);else try{this.ws=new WebSocket( +u),s(this.ws)}catch{this.ws=new __unstable_WebSocket(u),s(this.ws)}}catch(c){let l=(this. +useSecureWebSocket?"https:":"http:")+"//"+o;fetch(l,{headers:{Upgrade:"websocket"}}). +then(h=>{if(this.ws=h.webSocket,this.ws==null)throw c;this.ws.accept(),s(this.ws, !0)}).catch(h=>{this.emit("error",new Error(`All attempts to open a WebSocket to\ connect to the database failed. Please refer to https://github.com/neondatabase\ /serverless/blob/main/CONFIG.md#websocketconstructor-typeof-websocket--undefined\ -. Details: ${h.message}`)),this.emit("close")})}}async startTls(e){if(this.subtls=== -void 0)throw new Error("For Postgres SSL connections, you must set `neonConfig.s\ -ubtls` to the subtls library. See https://github.com/neondatabase/serverless/blo\ -b/main/CONFIG.md for more information.");this.tlsState=1;let t=this.subtls.TrustedCert. -fromPEM(this.rootCerts),n=new this.subtls.WebSocketReadQueue(this.ws),i=n.read.bind( -n),s=this.rawWrite.bind(this),[a,u]=await this.subtls.startTls(e,t,i,s,{useSNI:!this. -disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0});this.tlsRead= -a,this.tlsWrite=u,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit( -"secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){for(;;){let e=await this. -tlsRead();if(e===void 0)break;{let t=w.from(e);this.emit("data",t)}}}rawWrite(e){ -if(!this.coalesceWrites){this.ws.send(e);return}if(this.writeBuffer===void 0)this. -writeBuffer=e,setTimeout(()=>{this.ws.send(this.writeBuffer),this.writeBuffer=void 0}, -0);else{let t=new Uint8Array(this.writeBuffer.length+e.length);t.set(this.writeBuffer), -t.set(e,this.writeBuffer.length),this.writeBuffer=t}}write(e,t="utf8",n=i=>{}){return e. -length===0?(n(),!0):(typeof e=="string"&&(e=w.from(e,t)),this.tlsState===0?(this. -rawWrite(e),n()):this.tlsState===1?this.once("secureConnection",()=>{this.write( -e,t,n)}):(this.tlsWrite(e),n()),!0)}end(e=w.alloc(0),t="utf8",n=()=>{}){return this. -write(e,t,()=>{this.ws.close(),n()}),this}destroy(){return this.destroyed=!0,this. -end()}}});var An=B(I=>{"use strict";p();Object.defineProperty(I,"__esModule",{value:!0});I. -NoticeMessage=I.DataRowMessage=I.CommandCompleteMessage=I.ReadyForQueryMessage=I. -NotificationResponseMessage=I.BackendKeyDataMessage=I.AuthenticationMD5Password= -I.ParameterStatusMessage=I.ParameterDescriptionMessage=I.RowDescriptionMessage=I. -Field=I.CopyResponse=I.CopyDataMessage=I.DatabaseError=I.copyDone=I.emptyQuery=I. -replicationStart=I.portalSuspended=I.noData=I.closeComplete=I.bindComplete=I.parseComplete= -void 0;I.parseComplete={name:"parseComplete",length:5};I.bindComplete={name:"bin\ -dComplete",length:5};I.closeComplete={name:"closeComplete",length:5};I.noData={name:"\ -noData",length:5};I.portalSuspended={name:"portalSuspended",length:5};I.replicationStart= -{name:"replicationStart",length:4};I.emptyQuery={name:"emptyQuery",length:4};I.copyDone= -{name:"copyDone",length:4};var cn=class extends Error{static{o(this,"DatabaseErr\ -or")}constructor(e,t,n){super(e),this.length=t,this.name=n}};I.DatabaseError=cn; -var ln=class{static{o(this,"CopyDataMessage")}constructor(e,t){this.length=e,this. -chunk=t,this.name="copyData"}};I.CopyDataMessage=ln;var hn=class{static{o(this,"\ +. Details: ${h}`)),this.emit("close")})}}async startTls(e){if(this.subtls===void 0) +throw new Error("For Postgres SSL connections, you must set `neonConfig.subtls` \ +to the subtls library. See https://github.com/neondatabase/serverless/blob/main/\ +CONFIG.md for more information.");this.tlsState=1;let t=this.subtls.TrustedCert. +databaseFromPEM(this.rootCerts),n=new this.subtls.WebSocketReadQueue(this.ws),i=n. +read.bind(n),s=this.rawWrite.bind(this),[o,c]=await this.subtls.startTls(e,t,i,s, +{useSNI:!this.disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0}); +this.tlsRead=o,this.tlsWrite=c,this.tlsState=2,this.encrypted=!0,this.authorized= +!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){for(;;){ +let e=await this.tlsRead();if(e===void 0)break;{let t=w.from(e);this.emit("data", +t)}}}rawWrite(e){if(!this.coalesceWrites){this.ws.send(e);return}if(this.writeBuffer=== +void 0)this.writeBuffer=e,setTimeout(()=>{this.ws.send(this.writeBuffer),this.writeBuffer= +void 0},0);else{let t=new Uint8Array(this.writeBuffer.length+e.length);t.set(this. +writeBuffer),t.set(e,this.writeBuffer.length),this.writeBuffer=t}}write(e,t="utf\ +8",n=i=>{}){return e.length===0?(n(),!0):(typeof e=="string"&&(e=w.from(e,t)),this. +tlsState===0?(this.rawWrite(e),n()):this.tlsState===1?this.once("secureConnectio\ +n",()=>{this.write(e,t,n)}):(this.tlsWrite(e),n()),!0)}end(e=w.alloc(0),t="utf8",n=()=>{}){ +return this.write(e,t,()=>{this.ws.close(),n()}),this}destroy(){return this.destroyed= +!0,this.end()}}});var Cn=B(L=>{"use strict";y();Object.defineProperty(L,"__esModule",{value:!0});L. +NoticeMessage=L.DataRowMessage=L.CommandCompleteMessage=L.ReadyForQueryMessage=L. +NotificationResponseMessage=L.BackendKeyDataMessage=L.AuthenticationMD5Password= +L.ParameterStatusMessage=L.ParameterDescriptionMessage=L.RowDescriptionMessage=L. +Field=L.CopyResponse=L.CopyDataMessage=L.DatabaseError=L.copyDone=L.emptyQuery=L. +replicationStart=L.portalSuspended=L.noData=L.closeComplete=L.bindComplete=L.parseComplete= +void 0;L.parseComplete={name:"parseComplete",length:5};L.bindComplete={name:"bin\ +dComplete",length:5};L.closeComplete={name:"closeComplete",length:5};L.noData={name:"\ +noData",length:5};L.portalSuspended={name:"portalSuspended",length:5};L.replicationStart= +{name:"replicationStart",length:4};L.emptyQuery={name:"emptyQuery",length:4};L.copyDone= +{name:"copyDone",length:4};var hn=class extends Error{static{a(this,"DatabaseErr\ +or")}constructor(e,t,n){super(e),this.length=t,this.name=n}};L.DatabaseError=hn; +var fn=class{static{a(this,"CopyDataMessage")}constructor(e,t){this.length=e,this. +chunk=t,this.name="copyData"}};L.CopyDataMessage=fn;var dn=class{static{a(this,"\ CopyResponse")}constructor(e,t,n,i){this.length=e,this.name=t,this.binary=n,this. -columnTypes=new Array(i)}};I.CopyResponse=hn;var fn=class{static{o(this,"Field")}constructor(e,t,n,i,s,a,u){ +columnTypes=new Array(i)}};L.CopyResponse=dn;var pn=class{static{a(this,"Field")}constructor(e,t,n,i,s,o,c){ this.name=e,this.tableID=t,this.columnID=n,this.dataTypeID=i,this.dataTypeSize=s, -this.dataTypeModifier=a,this.format=u}};I.Field=fn;var dn=class{static{o(this,"R\ +this.dataTypeModifier=o,this.format=c}};L.Field=pn;var yn=class{static{a(this,"R\ owDescriptionMessage")}constructor(e,t){this.length=e,this.fieldCount=t,this.name= -"rowDescription",this.fields=new Array(this.fieldCount)}};I.RowDescriptionMessage= -dn;var pn=class{static{o(this,"ParameterDescriptionMessage")}constructor(e,t){this. +"rowDescription",this.fields=new Array(this.fieldCount)}};L.RowDescriptionMessage= +yn;var mn=class{static{a(this,"ParameterDescriptionMessage")}constructor(e,t){this. length=e,this.parameterCount=t,this.name="parameterDescription",this.dataTypeIDs= -new Array(this.parameterCount)}};I.ParameterDescriptionMessage=pn;var yn=class{static{ -o(this,"ParameterStatusMessage")}constructor(e,t,n){this.length=e,this.parameterName= -t,this.parameterValue=n,this.name="parameterStatus"}};I.ParameterStatusMessage=yn; -var wn=class{static{o(this,"AuthenticationMD5Password")}constructor(e,t){this.length= -e,this.salt=t,this.name="authenticationMD5Password"}};I.AuthenticationMD5Password= -wn;var mn=class{static{o(this,"BackendKeyDataMessage")}constructor(e,t,n){this.length= -e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};I.BackendKeyDataMessage= -mn;var gn=class{static{o(this,"NotificationResponseMessage")}constructor(e,t,n,i){ +new Array(this.parameterCount)}};L.ParameterDescriptionMessage=mn;var gn=class{static{ +a(this,"ParameterStatusMessage")}constructor(e,t,n){this.length=e,this.parameterName= +t,this.parameterValue=n,this.name="parameterStatus"}};L.ParameterStatusMessage=gn; +var wn=class{static{a(this,"AuthenticationMD5Password")}constructor(e,t){this.length= +e,this.salt=t,this.name="authenticationMD5Password"}};L.AuthenticationMD5Password= +wn;var Sn=class{static{a(this,"BackendKeyDataMessage")}constructor(e,t,n){this.length= +e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};L.BackendKeyDataMessage= +Sn;var bn=class{static{a(this,"NotificationResponseMessage")}constructor(e,t,n,i){ this.length=e,this.processId=t,this.channel=n,this.payload=i,this.name="notifica\ -tion"}};I.NotificationResponseMessage=gn;var Sn=class{static{o(this,"ReadyForQue\ +tion"}};L.NotificationResponseMessage=bn;var En=class{static{a(this,"ReadyForQue\ ryMessage")}constructor(e,t){this.length=e,this.status=t,this.name="readyForQuer\ -y"}};I.ReadyForQueryMessage=Sn;var En=class{static{o(this,"CommandCompleteMessag\ -e")}constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};I.CommandCompleteMessage= -En;var bn=class{static{o(this,"DataRowMessage")}constructor(e,t){this.length=e,this. -fields=t,this.name="dataRow",this.fieldCount=t.length}};I.DataRowMessage=bn;var xn=class{static{ -o(this,"NoticeMessage")}constructor(e,t){this.length=e,this.message=t,this.name= -"notice"}};I.NoticeMessage=xn});var ra=B(Yt=>{"use strict";p();Object.defineProperty(Yt,"__esModule",{value:!0}); -Yt.Writer=void 0;var vn=class{static{o(this,"Writer")}constructor(e=256){this.size= +y"}};L.ReadyForQueryMessage=En;var xn=class{static{a(this,"CommandCompleteMessag\ +e")}constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};L.CommandCompleteMessage= +xn;var An=class{static{a(this,"DataRowMessage")}constructor(e,t){this.length=e,this. +fields=t,this.name="dataRow",this.fieldCount=t.length}};L.DataRowMessage=An;var vn=class{static{ +a(this,"NoticeMessage")}constructor(e,t){this.length=e,this.message=t,this.name= +"notice"}};L.NoticeMessage=vn});var ao=B(rr=>{"use strict";y();Object.defineProperty(rr,"__esModule",{value:!0}); +rr.Writer=void 0;var Tn=class{static{a(this,"Writer")}constructor(e=256){this.size= e,this.offset=5,this.headerPosition=0,this.buffer=w.allocUnsafe(e)}ensure(e){var t=this. buffer.length-this.offset;if(t>1)+e;this. buffer=w.allocUnsafe(i),n.copy(this.buffer)}}addInt32(e){return this.ensure(4),this. @@ -1066,58 +1072,58 @@ e.copy(this.buffer,this.offset),this.offset+=e.length,this}join(e){if(e){this.bu headerPosition]=e;let t=this.offset-(this.headerPosition+1);this.buffer.writeInt32BE( t,this.headerPosition+1)}return this.buffer.slice(e?0:5,this.offset)}flush(e){var t=this. join(e);return this.offset=5,this.headerPosition=0,this.buffer=w.allocUnsafe(this. -size),t}};Yt.Writer=vn});var ia=B(Xt=>{"use strict";p();Object.defineProperty(Xt,"__esModule",{value:!0}); -Xt.serialize=void 0;var Cn=ra(),V=new Cn.Writer,El=o(r=>{V.addInt16(3).addInt16( -0);for(let n of Object.keys(r))V.addCString(n).addCString(r[n]);V.addCString("cl\ -ient_encoding").addCString("UTF8");var e=V.addCString("").flush(),t=e.length+4;return new Cn. -Writer().addInt32(t).add(e).flush()},"startup"),bl=o(()=>{let r=w.allocUnsafe(8); -return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),xl=o(r=>V. -addCString(r).flush(112),"password"),Al=o(function(r,e){return V.addCString(r).addInt32( -w.byteLength(e)).addString(e),V.flush(112)},"sendSASLInitialResponseMessage"),vl=o( -function(r){return V.addString(r).flush(112)},"sendSCRAMClientFinalMessage"),Cl=o( -r=>V.addCString(r).flush(81),"query"),na=[],_l=o(r=>{let e=r.name||"";e.length>63&& +size),t}};rr.Writer=Tn});var uo=B(ir=>{"use strict";y();Object.defineProperty(ir,"__esModule",{value:!0}); +ir.serialize=void 0;var Rn=ao(),z=new Rn.Writer,Wl=a(r=>{z.addInt16(3).addInt16( +0);for(let n of Object.keys(r))z.addCString(n).addCString(r[n]);z.addCString("cl\ +ient_encoding").addCString("UTF8");var e=z.addCString("").flush(),t=e.length+4;return new Rn. +Writer().addInt32(t).add(e).flush()},"startup"),Vl=a(()=>{let r=w.allocUnsafe(8); +return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Gl=a(r=>z. +addCString(r).flush(112),"password"),zl=a(function(r,e){return z.addCString(r).addInt32( +w.byteLength(e)).addString(e),z.flush(112)},"sendSASLInitialResponseMessage"),Jl=a( +function(r){return z.addString(r).flush(112)},"sendSCRAMClientFinalMessage"),Yl=a( +r=>z.addCString(r).flush(81),"query"),co=[],Zl=a(r=>{let e=r.name||"";e.length>63&& (console.error("Warning! Postgres only supports 63 characters for query names."), console.error("You supplied %s (%s)",e,e.length),console.error("This can cause c\ -onflicts and silent errors executing queries"));let t=r.types||na;for(var n=t.length, -i=V.addCString(e).addCString(r.text).addInt16(n),s=0;s{let e=r.portal||"",t=r.statement|| -"",n=r.binary||!1,i=r.values||na,s=i.length;return V.addCString(e).addCString(t), -V.addInt16(s),Tl(i,r.valueMapper),V.addInt16(s),V.add(Xe.flush()),V.addInt16(n?1: -0),V.flush(66)},"bind"),Ul=w.from([69,0,0,0,9,0,0,0,0,0]),Il=o(r=>{if(!r||!r.portal&& -!r.rows)return Ul;let e=r.portal||"",t=r.rows||0,n=w.byteLength(e),i=4+n+1+4,s=w. +onflicts and silent errors executing queries"));let t=r.types||co;for(var n=t.length, +i=z.addCString(e).addCString(r.text).addInt16(n),s=0;s{let e=r.portal||"",t=r.statement|| +"",n=r.binary||!1,i=r.values||co,s=i.length;return z.addCString(e).addCString(t), +z.addInt16(s),Xl(i,r.valueMapper),z.addInt16(s),z.add(nt.flush()),z.addInt16(n?1: +0),z.flush(66)},"bind"),th=w.from([69,0,0,0,9,0,0,0,0,0]),rh=a(r=>{if(!r||!r.portal&& +!r.rows)return th;let e=r.portal||"",t=r.rows||0,n=w.byteLength(e),i=4+n+1+4,s=w. allocUnsafe(1+i);return s[0]=69,s.writeInt32BE(i,1),s.write(e,5,"utf-8"),s[n+5]= -0,s.writeUInt32BE(t,s.length-4),s},"execute"),Pl=o((r,e)=>{let t=w.allocUnsafe(16); +0,s.writeUInt32BE(t,s.length-4),s},"execute"),nh=a((r,e)=>{let t=w.allocUnsafe(16); return t.writeInt32BE(16,0),t.writeInt16BE(1234,4),t.writeInt16BE(5678,6),t.writeInt32BE( -r,8),t.writeInt32BE(e,12),t},"cancel"),_n=o((r,e)=>{let n=4+w.byteLength(e)+1,i=w. +r,8),t.writeInt32BE(e,12),t},"cancel"),Un=a((r,e)=>{let n=4+w.byteLength(e)+1,i=w. allocUnsafe(1+n);return i[0]=r,i.writeInt32BE(n,1),i.write(e,5,"utf-8"),i[n]=0,i}, -"cstringMessage"),Bl=V.addCString("P").flush(68),Rl=V.addCString("S").flush(68), -Nl=o(r=>r.name?_n(68,`${r.type}${r.name||""}`):r.type==="P"?Bl:Rl,"describe"),Ml=o( -r=>{let e=`${r.type}${r.name||""}`;return _n(67,e)},"close"),Dl=o(r=>V.add(r).flush( -100),"copyData"),ql=o(r=>_n(102,r),"copyFail"),Zt=o(r=>w.from([r,0,0,0,4]),"code\ -OnlyBuffer"),Fl=Zt(72),Ol=Zt(83),kl=Zt(88),Ql=Zt(99),$l={startup:El,password:xl, -requestSsl:bl,sendSASLInitialResponseMessage:Al,sendSCRAMClientFinalMessage:vl,query:Cl, -parse:_l,bind:Ll,execute:Il,describe:Nl,close:Ml,flush:o(()=>Fl,"flush"),sync:o( -()=>Ol,"sync"),end:o(()=>kl,"end"),copyData:Dl,copyDone:o(()=>Ql,"copyDone"),copyFail:ql, -cancel:Pl};Xt.serialize=$l});var sa=B(er=>{"use strict";p();Object.defineProperty(er,"__esModule",{value:!0}); -er.BufferReader=void 0;var jl=w.allocUnsafe(0),Tn=class{static{o(this,"BufferRea\ -der")}constructor(e=0){this.offset=e,this.buffer=jl,this.encoding="utf-8"}setBuffer(e,t){ +"cstringMessage"),ih=z.addCString("P").flush(68),sh=z.addCString("S").flush(68), +oh=a(r=>r.name?Un(68,`${r.type}${r.name||""}`):r.type==="P"?ih:sh,"describe"),ah=a( +r=>{let e=`${r.type}${r.name||""}`;return Un(67,e)},"close"),ch=a(r=>z.add(r).flush( +100),"copyData"),uh=a(r=>Un(102,r),"copyFail"),nr=a(r=>w.from([r,0,0,0,4]),"code\ +OnlyBuffer"),lh=nr(72),hh=nr(83),fh=nr(88),dh=nr(99),ph={startup:Wl,password:Gl, +requestSsl:Vl,sendSASLInitialResponseMessage:zl,sendSCRAMClientFinalMessage:Jl,query:Yl, +parse:Zl,bind:eh,execute:rh,describe:oh,close:ah,flush:a(()=>lh,"flush"),sync:a( +()=>hh,"sync"),end:a(()=>fh,"end"),copyData:ch,copyDone:a(()=>dh,"copyDone"),copyFail:uh, +cancel:nh};ir.serialize=ph});var lo=B(sr=>{"use strict";y();Object.defineProperty(sr,"__esModule",{value:!0}); +sr.BufferReader=void 0;var yh=w.allocUnsafe(0),In=class{static{a(this,"BufferRea\ +der")}constructor(e=0){this.offset=e,this.buffer=yh,this.encoding="utf-8"}setBuffer(e,t){ this.offset=e,this.buffer=t}int16(){let e=this.buffer.readInt16BE(this.offset);return this. offset+=2,e}byte(){let e=this.buffer[this.offset];return this.offset++,e}int32(){ let e=this.buffer.readInt32BE(this.offset);return this.offset+=4,e}string(e){let t=this. buffer.toString(this.encoding,this.offset,this.offset+e);return this.offset+=e,t}cstring(){ let e=this.offset,t=e;for(;this.buffer[t++]!==0;);return this.offset=t,this.buffer. toString(this.encoding,e,t-1)}bytes(e){let t=this.buffer.slice(this.offset,this. -offset+e);return this.offset+=e,t}};er.BufferReader=Tn});var ua=B(tr=>{"use strict";p();Object.defineProperty(tr,"__esModule",{value:!0}); -tr.Parser=void 0;var z=An(),Hl=sa(),Ln=1,Kl=4,aa=Ln+Kl,oa=w.allocUnsafe(0),Un=class{static{ -o(this,"Parser")}constructor(e){if(this.buffer=oa,this.bufferLength=0,this.bufferOffset= -0,this.reader=new Hl.BufferReader,e?.mode==="binary")throw new Error("Binary mod\ +offset+e);return this.offset+=e,t}};sr.BufferReader=In});var po=B(or=>{"use strict";y();Object.defineProperty(or,"__esModule",{value:!0}); +or.Parser=void 0;var J=Cn(),mh=lo(),Ln=1,gh=4,ho=Ln+gh,fo=w.allocUnsafe(0),_n=class{static{ +a(this,"Parser")}constructor(e){if(this.buffer=fo,this.bufferLength=0,this.bufferOffset= +0,this.reader=new mh.BufferReader,e?.mode==="binary")throw new Error("Binary mod\ e not supported yet");this.mode=e?.mode||"text"}parse(e,t){this.mergeBuffer(e);let n=this. -bufferOffset+this.bufferLength,i=this.bufferOffset;for(;i+aa<=n;){let s=this.buffer[i], -a=this.buffer.readUInt32BE(i+Ln),u=Ln+a;if(u+i<=n){let c=this.handlePacket(i+aa, -s,a,this.buffer);t(c),i+=u}else break}i===n?(this.buffer=oa,this.bufferLength=0, +bufferOffset+this.bufferLength,i=this.bufferOffset;for(;i+ho<=n;){let s=this.buffer[i], +o=this.buffer.readUInt32BE(i+Ln),c=Ln+o;if(c+i<=n){let u=this.handlePacket(i+ho, +s,o,this.buffer);t(u),i+=c}else break}i===n?(this.buffer=fo,this.bufferLength=0, this.bufferOffset=0):(this.bufferLength=n-i,this.bufferOffset=i)}mergeBuffer(e){ if(this.bufferLength>0){let t=this.bufferLength+e.byteLength;if(t+this.bufferOffset> this.buffer.byteLength){let i;if(t<=this.buffer.byteLength&&this.bufferOffset>=this. @@ -1125,9 +1131,9 @@ bufferLength)i=this.buffer;else{let s=this.buffer.byteLength*2;for(;t>=s;)s*=2;i w.allocUnsafe(s)}this.buffer.copy(i,0,this.bufferOffset,this.bufferOffset+this.bufferLength), this.buffer=i,this.bufferOffset=0}e.copy(this.buffer,this.bufferOffset+this.bufferLength), this.bufferLength=t}else this.buffer=e,this.bufferOffset=0,this.bufferLength=e.byteLength}handlePacket(e,t,n,i){ -switch(t){case 50:return z.bindComplete;case 49:return z.parseComplete;case 51:return z. -closeComplete;case 110:return z.noData;case 115:return z.portalSuspended;case 99: -return z.copyDone;case 87:return z.replicationStart;case 73:return z.emptyQuery;case 68: +switch(t){case 50:return J.bindComplete;case 49:return J.parseComplete;case 51:return J. +closeComplete;case 110:return J.noData;case 115:return J.portalSuspended;case 99: +return J.copyDone;case 87:return J.replicationStart;case 73:return J.emptyQuery;case 68: return this.parseDataRowMessage(e,n,i);case 67:return this.parseCommandCompleteMessage( e,n,i);case 90:return this.parseReadyForQueryMessage(e,n,i);case 65:return this. parseNotificationMessage(e,n,i);case 82:return this.parseAuthenticationResponse( @@ -1136,106 +1142,106 @@ parseBackendKeyData(e,n,i);case 69:return this.parseErrorMessage(e,n,i,"error"); return this.parseErrorMessage(e,n,i,"notice");case 84:return this.parseRowDescriptionMessage( e,n,i);case 116:return this.parseParameterDescriptionMessage(e,n,i);case 71:return this. parseCopyInMessage(e,n,i);case 72:return this.parseCopyOutMessage(e,n,i);case 100: -return this.parseCopyData(e,n,i);default:return new z.DatabaseError("received in\ +return this.parseCopyData(e,n,i);default:return new J.DatabaseError("received in\ valid response: "+t.toString(16),n,"error")}}parseReadyForQueryMessage(e,t,n){this. -reader.setBuffer(e,n);let i=this.reader.string(1);return new z.ReadyForQueryMessage( +reader.setBuffer(e,n);let i=this.reader.string(1);return new J.ReadyForQueryMessage( t,i)}parseCommandCompleteMessage(e,t,n){this.reader.setBuffer(e,n);let i=this.reader. -cstring();return new z.CommandCompleteMessage(t,i)}parseCopyData(e,t,n){let i=n. -slice(e,e+(t-4));return new z.CopyDataMessage(t,i)}parseCopyInMessage(e,t,n){return this. +cstring();return new J.CommandCompleteMessage(t,i)}parseCopyData(e,t,n){let i=n. +slice(e,e+(t-4));return new J.CopyDataMessage(t,i)}parseCopyInMessage(e,t,n){return this. parseCopyMessage(e,t,n,"copyInResponse")}parseCopyOutMessage(e,t,n){return this. parseCopyMessage(e,t,n,"copyOutResponse")}parseCopyMessage(e,t,n,i){this.reader. -setBuffer(e,n);let s=this.reader.byte()!==0,a=this.reader.int16(),u=new z.CopyResponse( -t,i,s,a);for(let c=0;c{"use strict";p();Object.defineProperty(Pe,"__esModule",{value:!0}); -Pe.DatabaseError=Pe.serialize=Pe.parse=void 0;var Wl=An();Object.defineProperty( -Pe,"DatabaseError",{enumerable:!0,get:o(function(){return Wl.DatabaseError},"get")}); -var Gl=ia();Object.defineProperty(Pe,"serialize",{enumerable:!0,get:o(function(){ -return Gl.serialize},"get")});var Vl=ua();function zl(r,e){let t=new Vl.Parser;return r. -on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}o(zl,"parse");Pe. -parse=zl});var ca={};pe(ca,{connect:()=>Jl});function Jl({socket:r,servername:e}){return r. -startTls(e),r}var la=le(()=>{"use strict";p();o(Jl,"connect")});var Bn=B((dp,da)=>{"use strict";p();var ha=(Jt(),X(ta)),Yl=Ue().EventEmitter,{parse:Zl, -serialize:te}=In(),fa=te.flush(),Xl=te.sync(),eh=te.end(),Pn=class extends Yl{static{ -o(this,"Connection")}constructor(e){super(),e=e||{},this.stream=e.stream||new ha. +e,n);let s={},o=this.reader.string(1);for(;o!=="\0";)s[o]=this.reader.cstring(), +o=this.reader.string(1);let c=s.M,u=i==="notice"?new J.NoticeMessage(t,c):new J. +DatabaseError(c,t,i);return u.severity=s.S,u.code=s.C,u.detail=s.D,u.hint=s.H,u. +position=s.P,u.internalPosition=s.p,u.internalQuery=s.q,u.where=s.W,u.schema=s.s, +u.table=s.t,u.column=s.c,u.dataType=s.d,u.constraint=s.n,u.file=s.F,u.line=s.L,u. +routine=s.R,u}};or.Parser=_n});var Pn=B(Fe=>{"use strict";y();Object.defineProperty(Fe,"__esModule",{value:!0}); +Fe.DatabaseError=Fe.serialize=Fe.parse=void 0;var wh=Cn();Object.defineProperty( +Fe,"DatabaseError",{enumerable:!0,get:a(function(){return wh.DatabaseError},"get")}); +var Sh=uo();Object.defineProperty(Fe,"serialize",{enumerable:!0,get:a(function(){ +return Sh.serialize},"get")});var bh=po();function Eh(r,e){let t=new bh.Parser;return r. +on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(Eh,"parse");Fe. +parse=Eh});var yo={};ge(yo,{connect:()=>xh});function xh({socket:r,servername:e}){return r. +startTls(e),r}var mo=de(()=>{"use strict";y();a(xh,"connect")});var Nn=B((Hp,So)=>{"use strict";y();var go=(tr(),ne(oo)),Ah=Ne().EventEmitter,{parse:vh, +serialize:se}=Pn(),wo=se.flush(),Ch=se.sync(),Th=se.end(),Bn=class extends Ah{static{ +a(this,"Connection")}constructor(e){super(),e=e||{},this.stream=e.stream||new go. Socket,this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis, this.lastBuffer=!1,this.parsedStatements={},this.ssl=e.ssl||!1,this._ending=!1,this. _emitMessage=!1;var t=this;this.on("newListener",function(n){n==="message"&&(t._emitMessage= !0)})}connect(e,t){var n=this;this._connecting=!0,this.stream.setNoDelay(!0),this. stream.connect(e,t),this.stream.once("connect",function(){n._keepAlive&&n.stream. -setKeepAlive(!0,n._keepAliveInitialDelayMillis),n.emit("connect")});let i=o(function(s){ +setKeepAlive(!0,n._keepAliveInitialDelayMillis),n.emit("connect")});let i=a(function(s){ n._ending&&(s.code==="ECONNRESET"||s.code==="EPIPE")||n.emit("error",s)},"report\ StreamError");if(this.stream.on("error",i),this.stream.on("close",function(){n.emit( "end")}),!this.ssl)return this.attachListeners(this.stream);this.stream.once("da\ -ta",function(s){var a=s.toString("utf8");switch(a){case"S":break;case"N":return n. +ta",function(s){var o=s.toString("utf8");switch(o){case"S":break;case"N":return n. stream.end(),n.emit("error",new Error("The server does not support SSL connectio\ ns"));default:return n.stream.end(),n.emit("error",new Error("There was an error\ - establishing an SSL connection"))}var u=(la(),X(ca));let c={socket:n.stream};n. -ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key=n.ssl.key)),ha.isIP(t)=== -0&&(c.servername=t);try{n.stream=u.connect(c)}catch(l){return n.emit("error",l)} + establishing an SSL connection"))}var c=(mo(),ne(yo));let u={socket:n.stream};n. +ssl!==!0&&(Object.assign(u,n.ssl),"key"in n.ssl&&(u.key=n.ssl.key)),go.isIP(t)=== +0&&(u.servername=t);try{n.stream=c.connect(u)}catch(l){return n.emit("error",l)} n.attachListeners(n.stream),n.stream.on("error",i),n.emit("sslconnect")})}attachListeners(e){ -e.on("end",()=>{this.emit("end")}),Zl(e,t=>{var n=t.name==="error"?"errorMessage": +e.on("end",()=>{this.emit("end")}),vh(e,t=>{var n=t.name==="error"?"errorMessage": t.name;this._emitMessage&&this.emit("message",t),this.emit(n,t)})}requestSsl(){this. -stream.write(te.requestSsl())}startup(e){this.stream.write(te.startup(e))}cancel(e,t){ -this._send(te.cancel(e,t))}password(e){this._send(te.password(e))}sendSASLInitialResponseMessage(e,t){ -this._send(te.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){ -this._send(te.sendSCRAMClientFinalMessage(e))}_send(e){return this.stream.writable? -this.stream.write(e):!1}query(e){this._send(te.query(e))}parse(e){this._send(te. -parse(e))}bind(e){this._send(te.bind(e))}execute(e){this._send(te.execute(e))}flush(){ -this.stream.writable&&this.stream.write(fa)}sync(){this._ending=!0,this._send(fa), -this._send(Xl)}ref(){this.stream.ref()}unref(){this.stream.unref()}end(){if(this. +stream.write(se.requestSsl())}startup(e){this.stream.write(se.startup(e))}cancel(e,t){ +this._send(se.cancel(e,t))}password(e){this._send(se.password(e))}sendSASLInitialResponseMessage(e,t){ +this._send(se.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){ +this._send(se.sendSCRAMClientFinalMessage(e))}_send(e){return this.stream.writable? +this.stream.write(e):!1}query(e){this._send(se.query(e))}parse(e){this._send(se. +parse(e))}bind(e){this._send(se.bind(e))}execute(e){this._send(se.execute(e))}flush(){ +this.stream.writable&&this.stream.write(wo)}sync(){this._ending=!0,this._send(wo), +this._send(Ch)}ref(){this.stream.ref()}unref(){this.stream.unref()}end(){if(this. _ending=!0,!this._connecting||!this.stream.writable){this.stream.end();return}return this. -stream.write(eh,()=>{this.stream.end()})}close(e){this._send(te.close(e))}describe(e){ -this._send(te.describe(e))}sendCopyFromChunk(e){this._send(te.copyData(e))}endCopyFrom(){ -this._send(te.copyDone())}sendCopyFail(e){this._send(te.copyFail(e))}};da.exports= -Pn});var wa=B((mp,ya)=>{"use strict";p();var th=Ue().EventEmitter,wp=(ht(),X(lt)),rh=bt(), -Rn=Cs(),nh=Ds(),ih=Vt(),sh=zt(),pa=Zs(),ah=Et(),oh=Bn(),rr=class extends th{static{ -o(this,"Client")}constructor(e){super(),this.connectionParameters=new sh(e),this. +stream.write(Th,()=>{this.stream.end()})}close(e){this._send(se.close(e))}describe(e){ +this._send(se.describe(e))}sendCopyFromChunk(e){this._send(se.copyData(e))}endCopyFrom(){ +this._send(se.copyDone())}sendCopyFail(e){this._send(se.copyFail(e))}};So.exports= +Bn});var xo=B((Wp,Eo)=>{"use strict";y();var Rh=Ne().EventEmitter,Kp=(St(),ne(wt)),Uh=Rt(), +Mn=Ls(),Ih=Qs(),Lh=Xt(),_h=er(),bo=no(),Ph=Tt(),Bh=Nn(),ar=class extends Rh{static{ +a(this,"Client")}constructor(e){super(),this.connectionParameters=new _h(e),this. user=this.connectionParameters.user,this.database=this.connectionParameters.database, this.port=this.connectionParameters.port,this.host=this.connectionParameters.host, Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0, value:this.connectionParameters.password}),this.replication=this.connectionParameters. -replication;var t=e||{};this._Promise=t.Promise||_.Promise,this._types=new ih(t. +replication;var t=e||{};this._Promise=t.Promise||R.Promise,this._types=new Lh(t. types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= -!1,this._queryable=!0,this.connection=t.connection||new oh({stream:t.stream,ssl:this. +!1,this._queryable=!0,this.connection=t.connection||new Bh({stream:t.stream,ssl:this. connectionParameters.ssl,keepAlive:t.keepAlive||!1,keepAliveInitialDelayMillis:t. keepAliveInitialDelayMillis||0,encoding:this.connectionParameters.client_encoding|| -"utf8"}),this.queryQueue=[],this.binary=t.binary||ah.binary,this.processID=null, +"utf8"}),this.queryQueue=[],this.binary=t.binary||Ph.binary,this.processID=null, this.secretKey=null,this.ssl=this.connectionParameters.ssl||!1,this.ssl&&this.ssl. key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this._connectionTimeoutMillis= -t.connectionTimeoutMillis||0}_errorAllQueries(e){let t=o(n=>{S.nextTick(()=>{n.handleError( +t.connectionTimeoutMillis||0}_errorAllQueries(e){let t=a(n=>{b.nextTick(()=>{n.handleError( e,this.connection)})},"enqueueError");this.activeQuery&&(t(this.activeQuery),this. activeQuery=null),this.queryQueue.forEach(t),this.queryQueue.length=0}_connect(e){ var t=this,n=this.connection;if(this._connectionCallback=e,this._connecting||this. _connected){let i=new Error("Client has already been connected. You cannot reuse\ - a client.");S.nextTick(()=>{e(i)});return}this._connecting=!0,this.connectionTimeoutHandle, + a client.");b.nextTick(()=>{e(i)});return}this._connecting=!0,this.connectionTimeoutHandle, this._connectionTimeoutMillis>0&&(this.connectionTimeoutHandle=setTimeout(()=>{n. _ending=!0,n.stream.destroy(new Error("timeout expired"))},this._connectionTimeoutMillis)), this.host&&this.host.indexOf("/")===0?n.connect(this.host+"/.s.PGSQL."+this.port): @@ -1245,7 +1251,7 @@ this._attachListeners(n),n.once("end",()=>{let i=this._ending?new Error("Connect ion terminated"):new Error("Connection terminated unexpectedly");clearTimeout(this. connectionTimeoutHandle),this._errorAllQueries(i),this._ending||(this._connecting&& !this._connectionError?this._connectionCallback?this._connectionCallback(i):this. -_handleErrorEvent(i):this._connectionError||this._handleErrorEvent(i)),S.nextTick( +_handleErrorEvent(i):this._connectionError||this._handleErrorEvent(i)),b.nextTick( ()=>{this.emit("end")})})}connect(e){if(e){this._connect(e);return}return new this. _Promise((t,n)=>{this._connect(i=>{i?n(i):t()})})}_attachListeners(e){e.on("auth\ enticationCleartextPassword",this._handleAuthCleartextPassword.bind(this)),e.on( @@ -1266,15 +1272,15 @@ connection;typeof this.password=="function"?this._Promise.resolve().then(()=>thi password()).then(n=>{if(n!==void 0){if(typeof n!="string"){t.emit("error",new TypeError( "Password must be a string"));return}this.connectionParameters.password=this.password= n}else this.connectionParameters.password=this.password=null;e()}).catch(n=>{t.emit( -"error",n)}):this.password!==null?e():nh(this.connectionParameters,n=>{n!==void 0&& +"error",n)}):this.password!==null?e():Ih(this.connectionParameters,n=>{n!==void 0&& (this.connectionParameters.password=this.password=n),e()})}_handleAuthCleartextPassword(e){ this._checkPgPass(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){ -this._checkPgPass(()=>{let t=rh.postgresMd5PasswordHash(this.user,this.password, +this._checkPgPass(()=>{let t=Uh.postgresMd5PasswordHash(this.user,this.password, e.salt);this.connection.password(t)})}_handleAuthSASL(e){this._checkPgPass(()=>{ -this.saslSession=Rn.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( +this.saslSession=Mn.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){ -Rn.continueSession(this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage( -this.saslSession.response)}_handleAuthSASLFinal(e){Rn.finalizeSession(this.saslSession, +Mn.continueSession(this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage( +this.saslSession.response)}_handleAuthSASLFinal(e){Mn.finalizeSession(this.saslSession, e.data),this.saslSession=null}_handleBackendKeyData(e){this.processID=e.processID, this.secretKey=e.secretKey}_handleReadyForQuery(e){this._connecting&&(this._connecting= !1,this._connected=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback&& @@ -1310,37 +1316,37 @@ return this._types.getTypeParser(e,t)}escapeIdentifier(e){return'"'+e.replace(/" "'"?n+=s+s:s==="\\"?(n+=s+s,t=!0):n+=s}return n+="'",t===!0&&(n=" E"+n),n}_pulseQueryQueue(){ if(this.readyForQuery===!0)if(this.activeQuery=this.queryQueue.shift(),this.activeQuery){ this.readyForQuery=!1,this.hasExecuted=!0;let e=this.activeQuery.submit(this.connection); -e&&S.nextTick(()=>{this.activeQuery.handleError(e,this.connection),this.readyForQuery= +e&&b.nextTick(()=>{this.activeQuery.handleError(e,this.connection),this.readyForQuery= !0,this._pulseQueryQueue()})}else this.hasExecuted&&(this.activeQuery=null,this. -emit("drain"))}query(e,t,n){var i,s,a,u,c;if(e==null)throw new TypeError("Client\ - was passed a null or undefined query");return typeof e.submit=="function"?(a=e. +emit("drain"))}query(e,t,n){var i,s,o,c,u;if(e==null)throw new TypeError("Client\ + was passed a null or undefined query");return typeof e.submit=="function"?(o=e. query_timeout||this.connectionParameters.query_timeout,s=i=e,typeof t=="function"&& -(i.callback=i.callback||t)):(a=this.connectionParameters.query_timeout,i=new pa( -e,t,n),i.callback||(s=new this._Promise((l,h)=>{i.callback=(f,y)=>f?h(f):l(y)}))), -a&&(c=i.callback,u=setTimeout(()=>{var l=new Error("Query read timeout");S.nextTick( -()=>{i.handleError(l,this.connection)}),c(l),i.callback=()=>{};var h=this.queryQueue. -indexOf(i);h>-1&&this.queryQueue.splice(h,1),this._pulseQueryQueue()},a),i.callback= -(l,h)=>{clearTimeout(u),c(l,h)}),this.binary&&!i.binary&&(i.binary=!0),i._result&& -!i._result._types&&(i._result._types=this._types),this._queryable?this._ending?(S. +(i.callback=i.callback||t)):(o=this.connectionParameters.query_timeout,i=new bo( +e,t,n),i.callback||(s=new this._Promise((l,h)=>{i.callback=(f,g)=>f?h(f):l(g)}))), +o&&(u=i.callback,c=setTimeout(()=>{var l=new Error("Query read timeout");b.nextTick( +()=>{i.handleError(l,this.connection)}),u(l),i.callback=()=>{};var h=this.queryQueue. +indexOf(i);h>-1&&this.queryQueue.splice(h,1),this._pulseQueryQueue()},o),i.callback= +(l,h)=>{clearTimeout(c),u(l,h)}),this.binary&&!i.binary&&(i.binary=!0),i._result&& +!i._result._types&&(i._result._types=this._types),this._queryable?this._ending?(b. nextTick(()=>{i.handleError(new Error("Client was closed and is not queryable"), -this.connection)}),s):(this.queryQueue.push(i),this._pulseQueryQueue(),s):(S.nextTick( +this.connection)}),s):(this.queryQueue.push(i),this._pulseQueryQueue(),s):(b.nextTick( ()=>{i.handleError(new Error("Client has encountered a connection error and is n\ ot queryable"),this.connection)}),s)}ref(){this.connection.ref()}unref(){this.connection. unref()}end(e){if(this._ending=!0,!this.connection._connecting)if(e)e();else return this. _Promise.resolve();if(this.activeQuery||!this._queryable?this.connection.stream. destroy():this.connection.end(),e)this.connection.once("end",e);else return new this. -_Promise(t=>{this.connection.once("end",t)})}};rr.Query=pa;ya.exports=rr});var Ea=B((Ep,Sa)=>{"use strict";p();var uh=Ue().EventEmitter,ma=o(function(){},"\ -NOOP"),ga=o((r,e)=>{let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]}, -"removeWhere"),Nn=class{static{o(this,"IdleItem")}constructor(e,t,n){this.client= -e,this.idleListener=t,this.timeoutId=n}},et=class{static{o(this,"PendingItem")}constructor(e){ -this.callback=e}};function ch(){throw new Error("Release called on client which \ -has already been released to the pool.")}o(ch,"throwOnDoubleRelease");function nr(r,e){ -if(e)return{callback:e,result:void 0};let t,n,i=o(function(a,u){a?t(a):n(u)},"cb"), -s=new r(function(a,u){n=a,t=u}).catch(a=>{throw Error.captureStackTrace(a),a});return{ -callback:i,result:s}}o(nr,"promisify");function lh(r,e){return o(function t(n){n. +_Promise(t=>{this.connection.once("end",t)})}};ar.Query=bo;Eo.exports=ar});var To=B((zp,Co)=>{"use strict";y();var Nh=Ne().EventEmitter,Ao=a(function(){},"\ +NOOP"),vo=a((r,e)=>{let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]}, +"removeWhere"),Fn=class{static{a(this,"IdleItem")}constructor(e,t,n){this.client= +e,this.idleListener=t,this.timeoutId=n}},it=class{static{a(this,"PendingItem")}constructor(e){ +this.callback=e}};function Mh(){throw new Error("Release called on client which \ +has already been released to the pool.")}a(Mh,"throwOnDoubleRelease");function cr(r,e){ +if(e)return{callback:e,result:void 0};let t,n,i=a(function(o,c){o?t(o):n(c)},"cb"), +s=new r(function(o,c){n=o,t=c}).catch(o=>{throw Error.captureStackTrace(o),o});return{ +callback:i,result:s}}a(cr,"promisify");function Fh(r,e){return a(function t(n){n. client=e,e.removeListener("error",t),e.on("error",()=>{r.log("additional client \ error after disconnection due to error",n)}),r._remove(e),r.emit("error",n,e)},"\ -idleListener")}o(lh,"makeIdleListener");var Mn=class extends uh{static{o(this,"P\ +idleListener")}a(Fh,"makeIdleListener");var qn=class extends Nh{static{a(this,"P\ ool")}constructor(e,t){super(),this.options=Object.assign({},e),e!=null&&"passwo\ rd"in e&&Object.defineProperty(this.options,"password",{configurable:!0,enumerable:!1, writable:!0,value:e.password}),e!=null&&e.ssl&&e.ssl.key&&Object.defineProperty( @@ -1348,7 +1354,7 @@ this.options.ssl,"key",{enumerable:!1}),this.options.max=this.options.max||this. options.poolSize||10,this.options.maxUses=this.options.maxUses||1/0,this.options. allowExitOnIdle=this.options.allowExitOnIdle||!1,this.options.maxLifetimeSeconds= this.options.maxLifetimeSeconds||0,this.log=this.options.log||function(){},this. -Client=this.options.Client||t||ir().Client,this.Promise=this.options.Promise||_. +Client=this.options.Client||t||ur().Client,this.Promise=this.options.Promise||R. Promise,typeof this.options.idleTimeoutMillis>"u"&&(this.options.idleTimeoutMillis= 1e4),this._clients=[],this._idle=[],this._expired=new WeakSet,this._pendingQueue= [],this._endCallback=void 0,this.ending=!1,this.ended=!1}_isFull(){return this._clients. @@ -1360,34 +1366,34 @@ this.log("no queued requests");return}if(!this._idle.length&&this._isFull())retu let e=this._pendingQueue.shift();if(this._idle.length){let t=this._idle.pop();clearTimeout( t.timeoutId);let n=t.client;n.ref&&n.ref();let i=t.idleListener;return this._acquireClient( n,e,i,!1)}if(!this._isFull())return this.newClient(e);throw new Error("unexpecte\ -d condition")}_remove(e){let t=ga(this._idle,n=>n.client===e);t!==void 0&&clearTimeout( +d condition")}_remove(e){let t=vo(this._idle,n=>n.client===e);t!==void 0&&clearTimeout( t.timeoutId),this._clients=this._clients.filter(n=>n!==e),e.end(),this.emit("rem\ ove",e)}connect(e){if(this.ending){let i=new Error("Cannot use a pool after call\ -ing end on the pool");return e?e(i):this.Promise.reject(i)}let t=nr(this.Promise, -e),n=t.result;if(this._isFull()||this._idle.length){if(this._idle.length&&S.nextTick( +ing end on the pool");return e?e(i):this.Promise.reject(i)}let t=cr(this.Promise, +e),n=t.result;if(this._isFull()||this._idle.length){if(this._idle.length&&b.nextTick( ()=>this._pulseQueue()),!this.options.connectionTimeoutMillis)return this._pendingQueue. -push(new et(t.callback)),n;let i=o((u,c,l)=>{clearTimeout(a),t.callback(u,c,l)}, -"queueCallback"),s=new et(i),a=setTimeout(()=>{ga(this._pendingQueue,u=>u.callback=== +push(new it(t.callback)),n;let i=a((c,u,l)=>{clearTimeout(o),t.callback(c,u,l)}, +"queueCallback"),s=new it(i),o=setTimeout(()=>{vo(this._pendingQueue,c=>c.callback=== i),s.timedOut=!0,t.callback(new Error("timeout exceeded when trying to connect"))}, this.options.connectionTimeoutMillis);return this._pendingQueue.push(s),n}return this. -newClient(new et(t.callback)),n}newClient(e){let t=new this.Client(this.options); -this._clients.push(t);let n=lh(this,t);this.log("checking client timeout");let i, +newClient(new it(t.callback)),n}newClient(e){let t=new this.Client(this.options); +this._clients.push(t);let n=Fh(this,t);this.log("checking client timeout");let i, s=!1;this.options.connectionTimeoutMillis&&(i=setTimeout(()=>{this.log("ending c\ lient due to timeout"),s=!0,t.connection?t.connection.stream.destroy():t.end()}, this.options.connectionTimeoutMillis)),this.log("connecting new client"),t.connect( -a=>{if(i&&clearTimeout(i),t.on("error",n),a)this.log("client failed to connect", -a),this._clients=this._clients.filter(u=>u!==t),s&&(a.message="Connection termin\ -ated due to connection timeout"),this._pulseQueue(),e.timedOut||e.callback(a,void 0, -ma);else{if(this.log("new client connected"),this.options.maxLifetimeSeconds!==0){ -let u=setTimeout(()=>{this.log("ending client due to expired lifetime"),this._expired. -add(t),this._idle.findIndex(l=>l.client===t)!==-1&&this._acquireClient(t,new et( -(l,h,f)=>f()),n,!1)},this.options.maxLifetimeSeconds*1e3);u.unref(),t.once("end", -()=>clearTimeout(u))}return this._acquireClient(t,e,n,!0)}})}_acquireClient(e,t,n,i){ +o=>{if(i&&clearTimeout(i),t.on("error",n),o)this.log("client failed to connect", +o),this._clients=this._clients.filter(c=>c!==t),s&&(o.message="Connection termin\ +ated due to connection timeout"),this._pulseQueue(),e.timedOut||e.callback(o,void 0, +Ao);else{if(this.log("new client connected"),this.options.maxLifetimeSeconds!==0){ +let c=setTimeout(()=>{this.log("ending client due to expired lifetime"),this._expired. +add(t),this._idle.findIndex(l=>l.client===t)!==-1&&this._acquireClient(t,new it( +(l,h,f)=>f()),n,!1)},this.options.maxLifetimeSeconds*1e3);c.unref(),t.once("end", +()=>clearTimeout(c))}return this._acquireClient(t,e,n,!0)}})}_acquireClient(e,t,n,i){ i&&this.emit("connect",e),this.emit("acquire",e),e.release=this._releaseOnce(e,n), e.removeListener("error",n),t.timedOut?i&&this.options.verify?this.options.verify( e,e.release):e.release():i&&this.options.verify?this.options.verify(e,s=>{if(s)return e. -release(s),t.callback(s,void 0,ma);t.callback(void 0,e,e.release)}):t.callback(void 0, -e,e.release)}_releaseOnce(e,t){let n=!1;return i=>{n&&ch(),n=!0,this._release(e, +release(s),t.callback(s,void 0,Ao);t.callback(void 0,e,e.release)}):t.callback(void 0, +e,e.release)}_releaseOnce(e,t){let n=!1;return i=>{n&&Mh(),n=!0,this._release(e, t,i)}}_release(e,t,n){if(e.on("error",t),e._poolUseCount=(e._poolUseCount||0)+1, this.emit("release",n,e),n||this.ending||!e._queryable||e._ending||e._poolUseCount>= this.options.maxUses){e._poolUseCount>=this.options.maxUses&&this.log("remove ex\ @@ -1395,21 +1401,21 @@ pended client"),this._remove(e),this._pulseQueue();return}if(this._expired.has(e this.log("remove expired client"),this._expired.delete(e),this._remove(e),this._pulseQueue(); return}let s;this.options.idleTimeoutMillis&&(s=setTimeout(()=>{this.log("remove\ idle client"),this._remove(e)},this.options.idleTimeoutMillis),this.options.allowExitOnIdle&& -s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new Nn(e,t,s)), -this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=nr(this.Promise,e); -return T(function(){return s.callback(new Error("Passing a function as the first\ +s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new Fn(e,t,s)), +this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=cr(this.Promise,e); +return U(function(){return s.callback(new Error("Passing a function as the first\ parameter to pool.query is not supported"))}),s.result}typeof t=="function"&&(n= -t,t=void 0);let i=nr(this.Promise,n);return n=i.callback,this.connect((s,a)=>{if(s) -return n(s);let u=!1,c=o(l=>{u||(u=!0,a.release(l),n(l))},"onError");a.once("err\ -or",c),this.log("dispatching query");try{a.query(e,t,(l,h)=>{if(this.log("query \ -dispatched"),a.removeListener("error",c),!u)return u=!0,a.release(l),l?n(l):n(void 0, -h)})}catch(l){return a.release(l),n(l)}}),i.result}end(e){if(this.log("ending"), +t,t=void 0);let i=cr(this.Promise,n);return n=i.callback,this.connect((s,o)=>{if(s) +return n(s);let c=!1,u=a(l=>{c||(c=!0,o.release(l),n(l))},"onError");o.once("err\ +or",u),this.log("dispatching query");try{o.query(e,t,(l,h)=>{if(this.log("query \ +dispatched"),o.removeListener("error",u),!c)return c=!0,o.release(l),l?n(l):n(void 0, +h)})}catch(l){return o.release(l),n(l)}}),i.result}end(e){if(this.log("ending"), this.ending){let n=new Error("Called end on pool more than once");return e?e(n): -this.Promise.reject(n)}this.ending=!0;let t=nr(this.Promise,e);return this._endCallback= +this.Promise.reject(n)}this.ending=!0;let t=cr(this.Promise,e);return this._endCallback= t.callback,this._pulseQueue(),t.result}get waitingCount(){return this._pendingQueue. length}get idleCount(){return this._idle.length}get expiredCount(){return this._clients. reduce((e,t)=>e+(this._expired.has(t)?1:0),0)}get totalCount(){return this._clients. -length}};Sa.exports=Mn});var ba={};pe(ba,{default:()=>hh});var hh,xa=le(()=>{"use strict";p();hh={}});var Aa=B((vp,fh)=>{fh.exports={name:"pg",version:"8.8.0",description:"PostgreSQL\ +length}};Co.exports=qn});var Ro={};ge(Ro,{default:()=>qh});var qh,Uo=de(()=>{"use strict";y();qh={}});var Io=B((Xp,kh)=>{kh.exports={name:"pg",version:"8.8.0",description:"PostgreSQL\ client - pure javascript & libpq with the same API",keywords:["database","libpq", "pg","postgre","postgres","postgresql","rdbms"],homepage:"https://github.com/bri\ anc/node-postgres",repository:{type:"git",url:"git://github.com/brianc/node-post\ @@ -1420,111 +1426,122 @@ pes":"^2.1.0",pgpass:"1.x"},devDependencies:{async:"2.6.4",bluebird:"3.5.2",co:" 4.6.0","pg-copy-streams":"0.3.0"},peerDependencies:{"pg-native":">=3.0.1"},peerDependenciesMeta:{ "pg-native":{optional:!0}},scripts:{test:"make test-all"},files:["lib","SPONSORS\ .md"],license:"MIT",engines:{node:">= 8.0.0"},gitHead:"c99fb2c127ddf8d712500db2c\ -7b9a5491a178655"}});var _a=B((Cp,Ca)=>{"use strict";p();var va=Ue().EventEmitter,dh=(ht(),X(lt)),Dn=bt(), -tt=Ca.exports=function(r,e,t){va.call(this),r=Dn.normalizeQueryConfig(r,e,t),this. +7b9a5491a178655"}});var Po=B((ey,_o)=>{"use strict";y();var Lo=Ne().EventEmitter,Dh=(St(),ne(wt)),kn=Rt(), +st=_o.exports=function(r,e,t){Lo.call(this),r=kn.normalizeQueryConfig(r,e,t),this. text=r.text,this.values=r.values,this.name=r.name,this.callback=r.callback,this. state="new",this._arrayMode=r.rowMode==="array",this._emitRowEvents=!1,this.on("\ -newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};dh.inherits( -tt,va);var ph={sqlState:"code",statementPosition:"position",messagePrimary:"mess\ +newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};Dh.inherits( +st,Lo);var Oh={sqlState:"code",statementPosition:"position",messagePrimary:"mess\ age",context:"where",schemaName:"schema",tableName:"table",columnName:"column",dataTypeName:"\ dataType",constraintName:"constraint",sourceFile:"file",sourceLine:"line",sourceFunction:"\ -routine"};tt.prototype.handleError=function(r){var e=this.native.pq.resultErrorFields(); -if(e)for(var t in e){var n=ph[t]||t;r[n]=e[t]}this.callback?this.callback(r):this. -emit("error",r),this.state="error"};tt.prototype.then=function(r,e){return this. -_getPromise().then(r,e)};tt.prototype.catch=function(r){return this._getPromise(). -catch(r)};tt.prototype._getPromise=function(){return this._promise?this._promise: +routine"};st.prototype.handleError=function(r){var e=this.native.pq.resultErrorFields(); +if(e)for(var t in e){var n=Oh[t]||t;r[n]=e[t]}this.callback?this.callback(r):this. +emit("error",r),this.state="error"};st.prototype.then=function(r,e){return this. +_getPromise().then(r,e)};st.prototype.catch=function(r){return this._getPromise(). +catch(r)};st.prototype._getPromise=function(){return this._promise?this._promise: (this._promise=new Promise(function(r,e){this._once("end",r),this._once("error", -e)}.bind(this)),this._promise)};tt.prototype.submit=function(r){this.state="runn\ -ing";var e=this;this.native=r.native,r.native.arrayMode=this._arrayMode;var t=o( -function(s,a,u){if(r.native.arrayMode=!1,T(function(){e.emit("_done")}),s)return e. -handleError(s);e._emitRowEvents&&(u.length>1?a.forEach((c,l)=>{c.forEach(h=>{e.emit( -"row",h,u[l])})}):a.forEach(function(c){e.emit("row",c,u)})),e.state="end",e.emit( -"end",u),e.callback&&e.callback(null,u)},"after");if(S.domain&&(t=S.domain.bind( +e)}.bind(this)),this._promise)};st.prototype.submit=function(r){this.state="runn\ +ing";var e=this;this.native=r.native,r.native.arrayMode=this._arrayMode;var t=a( +function(s,o,c){if(r.native.arrayMode=!1,U(function(){e.emit("_done")}),s)return e. +handleError(s);e._emitRowEvents&&(c.length>1?o.forEach((u,l)=>{u.forEach(h=>{e.emit( +"row",h,c[l])})}):o.forEach(function(u){e.emit("row",u,c)})),e.state="end",e.emit( +"end",c),e.callback&&e.callback(null,c)},"after");if(b.domain&&(t=b.domain.bind( t)),this.name){this.name.length>63&&(console.error("Warning! Postgres only suppo\ rts 63 characters for query names."),console.error("You supplied %s (%s)",this.name, this.name.length),console.error("This can cause conflicts and silent errors exec\ -uting queries"));var n=(this.values||[]).map(Dn.prepareValue);if(r.namedQueries[this. +uting queries"));var n=(this.values||[]).map(kn.prepareValue);if(r.namedQueries[this. name]){if(this.text&&r.namedQueries[this.name]!==this.text){let s=new Error(`Pre\ pared statements must be unique - '${this.name}' was used for a different statem\ ent`);return t(s)}return r.native.execute(this.name,n,t)}return r.native.prepare( this.name,this.text,n.length,function(s){return s?t(s):(r.namedQueries[e.name]=e. text,e.native.execute(e.name,n,t))})}else if(this.values){if(!Array.isArray(this. values)){let s=new Error("Query values must be an array");return t(s)}var i=this. -values.map(Dn.prepareValue);r.native.query(this.text,i,t)}else r.native.query(this. -text,t)}});var Ia=B((Up,Ua)=>{"use strict";p();var yh=(xa(),X(ba)),wh=Vt(),Lp=Aa(),Ta=Ue(). -EventEmitter,mh=(ht(),X(lt)),gh=zt(),La=_a(),de=Ua.exports=function(r){Ta.call(this), -r=r||{},this._Promise=r.Promise||_.Promise,this._types=new wh(r.types),this.native= -new yh({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting= -!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new gh( +values.map(kn.prepareValue);r.native.query(this.text,i,t)}else r.native.query(this. +text,t)}});var Fo=B((iy,Mo)=>{"use strict";y();var Qh=(Uo(),ne(Ro)),Hh=Xt(),ny=Io(),Bo=Ne(). +EventEmitter,$h=(St(),ne(wt)),jh=er(),No=Po(),me=Mo.exports=function(r){Bo.call( +this),r=r||{},this._Promise=r.Promise||R.Promise,this._types=new Hh(r.types),this. +native=new Qh({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting= +!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new jh( r);this.user=e.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, writable:!0,value:e.password}),this.database=e.database,this.host=e.host,this.port= -e.port,this.namedQueries={}};de.Query=La;mh.inherits(de,Ta);de.prototype._errorAllQueries= -function(r){let e=o(t=>{S.nextTick(()=>{t.native=this.native,t.handleError(r)})}, +e.port,this.namedQueries={}};me.Query=No;$h.inherits(me,Bo);me.prototype._errorAllQueries= +function(r){let e=a(t=>{b.nextTick(()=>{t.native=this.native,t.handleError(r)})}, "enqueueError");this._hasActiveQuery()&&(e(this._activeQuery),this._activeQuery= -null),this._queryQueue.forEach(e),this._queryQueue.length=0};de.prototype._connect= -function(r){var e=this;if(this._connecting){S.nextTick(()=>r(new Error("Client h\ +null),this._queryQueue.forEach(e),this._queryQueue.length=0};me.prototype._connect= +function(r){var e=this;if(this._connecting){b.nextTick(()=>r(new Error("Client h\ as already been connected. You cannot reuse a client.")));return}this._connecting= !0,this.connectionParameters.getLibpqConnectionString(function(t,n){if(t)return r( t);e.native.connect(n,function(i){if(i)return e.native.end(),r(i);e._connected=!0, e.native.on("error",function(s){e._queryable=!1,e._errorAllQueries(s),e.emit("er\ ror",s)}),e.native.on("notification",function(s){e.emit("notification",{channel:s. -relname,payload:s.extra})}),e.emit("connect"),e._pulseQueryQueue(!0),r()})})};de. +relname,payload:s.extra})}),e.emit("connect"),e._pulseQueryQueue(!0),r()})})};me. prototype.connect=function(r){if(r){this._connect(r);return}return new this._Promise( -(e,t)=>{this._connect(n=>{n?t(n):e()})})};de.prototype.query=function(r,e,t){var n, -i,s,a,u;if(r==null)throw new TypeError("Client was passed a null or undefined qu\ +(e,t)=>{this._connect(n=>{n?t(n):e()})})};me.prototype.query=function(r,e,t){var n, +i,s,o,c;if(r==null)throw new TypeError("Client was passed a null or undefined qu\ ery");if(typeof r.submit=="function")s=r.query_timeout||this.connectionParameters. query_timeout,i=n=r,typeof e=="function"&&(r.callback=e);else if(s=this.connectionParameters. -query_timeout,n=new La(r,e,t),!n.callback){let c,l;i=new this._Promise((h,f)=>{c= -h,l=f}),n.callback=(h,f)=>h?l(h):c(f)}return s&&(u=n.callback,a=setTimeout(()=>{ -var c=new Error("Query read timeout");S.nextTick(()=>{n.handleError(c,this.connection)}), -u(c),n.callback=()=>{};var l=this._queryQueue.indexOf(n);l>-1&&this._queryQueue. -splice(l,1),this._pulseQueryQueue()},s),n.callback=(c,l)=>{clearTimeout(a),u(c,l)}), -this._queryable?this._ending?(n.native=this.native,S.nextTick(()=>{n.handleError( +query_timeout,n=new No(r,e,t),!n.callback){let u,l;i=new this._Promise((h,f)=>{u= +h,l=f}),n.callback=(h,f)=>h?l(h):u(f)}return s&&(c=n.callback,o=setTimeout(()=>{ +var u=new Error("Query read timeout");b.nextTick(()=>{n.handleError(u,this.connection)}), +c(u),n.callback=()=>{};var l=this._queryQueue.indexOf(n);l>-1&&this._queryQueue. +splice(l,1),this._pulseQueryQueue()},s),n.callback=(u,l)=>{clearTimeout(o),c(u,l)}), +this._queryable?this._ending?(n.native=this.native,b.nextTick(()=>{n.handleError( new Error("Client was closed and is not queryable"))}),i):(this._queryQueue.push( -n),this._pulseQueryQueue(),i):(n.native=this.native,S.nextTick(()=>{n.handleError( +n),this._pulseQueryQueue(),i):(n.native=this.native,b.nextTick(()=>{n.handleError( new Error("Client has encountered a connection error and is not queryable"))}),i)}; -de.prototype.end=function(r){var e=this;this._ending=!0,this._connected||this.once( +me.prototype.end=function(r){var e=this;this._ending=!0,this._connected||this.once( "connect",this.end.bind(this,r));var t;return r||(t=new this._Promise(function(n,i){ -r=o(s=>s?i(s):n(),"cb")})),this.native.end(function(){e._errorAllQueries(new Error( -"Connection terminated")),S.nextTick(()=>{e.emit("end"),r&&r()})}),t};de.prototype. +r=a(s=>s?i(s):n(),"cb")})),this.native.end(function(){e._errorAllQueries(new Error( +"Connection terminated")),b.nextTick(()=>{e.emit("end"),r&&r()})}),t};me.prototype. _hasActiveQuery=function(){return this._activeQuery&&this._activeQuery.state!=="\ -error"&&this._activeQuery.state!=="end"};de.prototype._pulseQueryQueue=function(r){ +error"&&this._activeQuery.state!=="end"};me.prototype._pulseQueryQueue=function(r){ if(this._connected&&!this._hasActiveQuery()){var e=this._queryQueue.shift();if(!e){ r||this.emit("drain");return}this._activeQuery=e,e.submit(this);var t=this;e.once( -"_done",function(){t._pulseQueryQueue()})}};de.prototype.cancel=function(r){this. +"_done",function(){t._pulseQueryQueue()})}};me.prototype.cancel=function(r){this. _activeQuery===r?this.native.cancel(function(){}):this._queryQueue.indexOf(r)!== --1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};de.prototype.ref=function(){}; -de.prototype.unref=function(){};de.prototype.setTypeParser=function(r,e,t){return this. -_types.setTypeParser(r,e,t)};de.prototype.getTypeParser=function(r,e){return this. -_types.getTypeParser(r,e)}});var qn=B((Bp,Pa)=>{"use strict";p();Pa.exports=Ia()});var ir=B((Mp,At)=>{"use strict";p();var Sh=wa(),Eh=Et(),bh=Bn(),xh=Ea(),{DatabaseError:Ah}=In(), -vh=o(r=>class extends xh{static{o(this,"BoundPool")}constructor(t){super(t,r)}}, -"poolFactory"),Fn=o(function(r){this.defaults=Eh,this.Client=r,this.Query=this.Client. -Query,this.Pool=vh(this.Client),this._pools=[],this.Connection=bh,this.types=St(), -this.DatabaseError=Ah},"PG");typeof S.env.NODE_PG_FORCE_NATIVE<"u"?At.exports=new Fn( -qn()):(At.exports=new Fn(Sh),Object.defineProperty(At.exports,"native",{configurable:!0, -enumerable:!1,get(){var r=null;try{r=new Fn(qn())}catch(e){if(e.code!=="MODULE_N\ -OT_FOUND")throw e}return Object.defineProperty(At.exports,"native",{value:r}),r}}))});p();var Tr={};pe(Tr,{SocketReadQueue:()=>eu,TrustedCert:()=>gi,WebSocketReadQueue:()=>Xo, -startTls:()=>Zo});p();function se(...r){if(r.length===1&&r[0]instanceof Uint8Array)return r[0];let e=r. -reduce((i,s)=>i+s.length,0),t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+= -i.length;return t}o(se,"p");function ut(r,e){let t=r.length;if(t!==e.length)return!1; -for(let n=0;n{"use strict";y();qo.exports=Fo()});var ur=B((ly,It)=>{"use strict";y();var Kh=xo(),Wh=Tt(),Vh=Nn(),Gh=To(),{DatabaseError:zh}=Pn(), +Jh=a(r=>class extends Gh{static{a(this,"BoundPool")}constructor(t){super(t,r)}}, +"poolFactory"),On=a(function(r){this.defaults=Wh,this.Client=r,this.Query=this.Client. +Query,this.Pool=Jh(this.Client),this._pools=[],this.Connection=Vh,this.types=Ct(), +this.DatabaseError=zh},"PG");typeof b.env.NODE_PG_FORCE_NATIVE<"u"?It.exports=new On( +Dn()):(It.exports=new On(Kh),Object.defineProperty(It.exports,"native",{configurable:!0, +enumerable:!1,get(){var r=null;try{r=new On(Dn())}catch(e){if(e.code!=="MODULE_N\ +OT_FOUND")throw e}return Object.defineProperty(It.exports,"native",{value:r}),r}}))});y();var _r={};ge(_r,{SocketReadQueue:()=>wc,TrustedCert:()=>mt,WebSocketReadQueue:()=>gc, +base64Decode:()=>Ci,hexFromU8:()=>Z,stableStringify:()=>Sc,startTls:()=>mc,u8FromHex:()=>Pe}); +y();var Da=Object.defineProperty,Oa=a((r,e,t)=>e in r?Da(r,e,{enumerable:!0,configurable:!0, +writable:!0,value:t}):r[e]=t,"__defNormalProp"),K=a((r,e,t)=>Oa(r,typeof e!="sym\ +bol"?e+"":e,t),"__publicField");function ce(...r){if(r.length===1&&r[0]instanceof +Uint8Array)return r[0];let e=r.reduce((i,s)=>i+s.length,0),t=new Uint8Array(e),n=0; +for(let i of r)t.set(i,n),n+=i.length;return t}a(ce,"concat");function Ht(r,e){let t=r. +length;if(t!==e.length)return!1;for(let n=0;nthis.data.length){let t=this.data;this.data=new Uint8Array( +this.length*2+e),this.data.set(t)}this.data.set(r,this.length),this.length+=r.length}getData(){ +return this.data.subarray(0,this.length)}},Cr="\xB7\xB7 ",gi=new TextEncoder,Ha=new TextDecoder, +Ce=class{static{a(this,"Bytes")}constructor(r){K(this,"offset"),K(this,"dataView"), +K(this,"data"),K(this,"comments"),K(this,"indents"),K(this,"indent"),this.offset= +0,this.data=typeof r=="number"?new Uint8Array(r):r,this.dataView=new DataView(this. +data.buffer,this.data.byteOffset,this.data.byteLength),this.comments={},this.indents= +{},this.indent=0}extend(r){let e=typeof r=="number"?new Uint8Array(r):r;this.data= +ce(this.data,e),this.dataView=new DataView(this.data.buffer,this.data.byteOffset, +this.data.byteLength)}remaining(){return this.data.length-this.offset}subarray(r){ return this.data.subarray(this.offset,this.offset+=r)}skip(r,e){return this.offset+= r,e&&this.comment(e),this}comment(r,e=this.offset){throw new Error("No comments \ -should be emitted outside of chatty mode")}readBytes(r){return this.data.slice(this. -offset,this.offset+=r)}readUTF8String(r){let e=this.subarray(r);return Io.decode( +should be emitted outside of chatty mode")}lengthComment(r,e,t=!1){return r===1? +`${r} byte${e?` of ${e}`:""} ${t?"starts here":"follows"}`:`${r===0?"no":r} byte\ +s${e?` of ${e}`:""} ${t?"start here":"follow"}`}readBytes(r){return this.data.slice( +this.offset,this.offset+=r)}readUTF8String(r){let e=this.subarray(r);return Ha.decode( e)}readUTF8StringNullTerminated(){let r=this.offset;for(;this.data[r]!==0;)r++;let e=this. readUTF8String(r-this.offset);return this.expectUint8(0,"end of string"),e}readUint8(r){ let e=this.dataView.getUint8(this.offset);return this.offset+=1,e}readUint16(r){ let e=this.dataView.getUint16(this.offset);return this.offset+=2,e}readUint24(r){ let e=this.readUint8(),t=this.readUint16();return(e<<16)+t}readUint32(r){let e=this. dataView.getUint32(this.offset);return this.offset+=4,e}expectBytes(r,e){let t=this. -readBytes(r.length);if(!ut(t,r))throw new Error("Unexpected bytes")}expectUint8(r,e){ +readBytes(r.length);if(!Ht(t,r))throw new Error("Unexpected bytes")}expectUint8(r,e){ let t=this.readUint8();if(t!==r)throw new Error(`Expected ${r}, got ${t}`)}expectUint16(r,e){ let t=this.readUint16();if(t!==r)throw new Error(`Expected ${r}, got ${t}`)}expectUint24(r,e){ let t=this.readUint24();if(t!==r)throw new Error(`Expected ${r}, got ${t}`)}expectUint32(r,e){ @@ -1541,8 +1558,8 @@ e-1)}expectLengthUint16Incl(r){let e=this.readUint16();return this.expectLength( e-2)}expectLengthUint24Incl(r){let e=this.readUint24();return this.expectLength( e-3)}expectLengthUint32Incl(r){let e=this.readUint32();return this.expectLength( e-4)}writeBytes(r){return this.data.set(r,this.offset),this.offset+=r.length,this}writeUTF8String(r){ -let e=li.encode(r);return this.writeBytes(e),this}writeUTF8StringNullTerminated(r){ -let e=li.encode(r);return this.writeBytes(e),this.writeUint8(0),this}writeUint8(r,e){ +let e=gi.encode(r);return this.writeBytes(e),this}writeUTF8StringNullTerminated(r){ +let e=gi.encode(r);return this.writeBytes(e),this.writeUint8(0),this}writeUint8(r,e){ return this.dataView.setUint8(this.offset,r),this.offset+=1,this}writeUint16(r,e){ return this.dataView.setUint16(this.offset,r),this.offset+=2,this}writeUint24(r,e){ return this.writeUint8((r&16711680)>>16),this.writeUint16(r&65535,e),this}writeUint32(r,e){ @@ -1559,216 +1576,252 @@ return this._writeLengthGeneric(3,!1,r)}writeLengthUint32(r){return this._writeL return this._writeLengthGeneric(2,!0,r)}writeLengthUint24Incl(r){return this._writeLengthGeneric( 3,!0,r)}writeLengthUint32Incl(r){return this._writeLengthGeneric(4,!0,r)}array(){ return this.data.subarray(0,this.offset)}commentedString(r=!1){let e=this.indents[0]!== -void 0?br.repeat(this.indents[0]):"",t=this.indents[0]??0,n=r?this.data.length:this. +void 0?Cr.repeat(this.indents[0]):"",t=this.indents[0]??0,n=r?this.data.length:this. offset;for(let i=0;it. -toString(16).padStart(2,"0")).join(e)}o(Te,"K");function Bo(r,e){let t,n,[i]=r.expectLength( -r.remaining());r.expectUint8(2,0);let[s]=r.expectLengthUint24(0);r.expectUint16( -771,0);let a=r.readBytes(32);if(ut(a,[207,33,173,116,229,154,97,17,190,29,140,2, -30,101,184,145,194,162,17,22,122,187,140,94,7,158,9,226,200,168,51,156]))throw new Error( -"Unexpected HelloRetryRequest");r.expectUint8(e.length,0),r.expectBytes(e,0),r.expectUint16( -4865,0),r.expectUint8(0,0);let[u,c]=r.expectLengthUint16(0);for(;c()>0;){let l=r. -readUint16(0),[h]=r.expectLengthUint16(0);if(l===43)r.expectUint16(772,0),n=!0;else if(l=== -51)r.expectUint16(23,0),r.expectUint16(65),t=r.readBytes(65);else throw new Error( -`Unexpected extension 0x${Te([l])}`);h()}if(u(),s(),i(),n!==!0)throw new Error("\ -No TLS version provided");if(t===void 0)throw new Error("No key provided");return t} -o(Bo,"Ut");var jh=new RegExp(` .+|^(${br})+`,"gm"),ot=16384,Ro=ot+1+255;async function xr(r,e,t=ot){ -let n=await r(5);if(n===void 0)return;if(n.length<5)throw new Error("TLS record \ -header truncated");let i=new be(n),s=i.readUint8();if(s<20||s>24)throw new Error( -`Illegal TLS record type 0x${s.toString(16)}`);if(e!==void 0&&s!==e)throw new Error( -`Unexpected TLS record type 0x${s.toString(16).padStart(2,"0")} (expected 0x${e. -toString(16).padStart(2,"0")})`);i.expectUint16(771,"TLS record version 1.2 (mid\ -dlebox compatibility)");let a=i.readUint16(0);if(a>t)throw new Error(`Record too\ - long: ${a} bytes`);let u=await r(a);if(u===void 0||u.length>3,s=Math.ceil(t/i),a=new Uint8Array(s*i),u=await O.importKey("raw",r,{name:"\ -HMAC",hash:{name:`SHA-${n}`}},!1,["sign"]),c=new Uint8Array(0);for(let l=0;l>8,n&255],[fi.length+s.length],fi,s,[t.length], -t);return Mo(r,a,n,i)}o(ae,"S");async function Do(r,e,t,n,i){let s=n>>>3,a=new Uint8Array( -s),u=await O.importKey("raw",r,{name:"ECDH",namedCurve:"P-256"},!1,[]),c=await O. -deriveBits({name:"ECDH",public:u},e,256),l=new Uint8Array(c),h=await O.digest("S\ -HA-256",t),f=new Uint8Array(h),y=await vr(new Uint8Array(1),a,n),m=await O.digest( -`SHA-${n}`,new Uint8Array(0)),b=new Uint8Array(m),U=await ae(y,"derived",b,s,n), -v=await vr(U,l,n),C=await ae(v,"c hs traffic",f,s,n),E=await ae(v,"s hs traffic", -f,s,n),g=await ae(C,"key",new Uint8Array(0),i,n),x=await ae(E,"key",new Uint8Array( -0),i,n),N=await ae(C,"iv",new Uint8Array(0),12,n),P=await ae(E,"iv",new Uint8Array( -0),12,n);return{serverHandshakeKey:x,serverHandshakeIV:P,clientHandshakeKey:g,clientHandshakeIV:N, -handshakeSecret:v,clientSecret:C,serverSecret:E}}o(Do,"Kt");async function qo(r,e,t,n){ -let i=t>>>3,s=new Uint8Array(i),a=await O.digest(`SHA-${t}`,new Uint8Array(0)),u=new Uint8Array( -a),c=await ae(r,"derived",u,i,t),l=await vr(c,s,t),h=await ae(l,"c ap traffic",e, -i,t),f=await ae(l,"s ap traffic",e,i,t),y=await ae(h,"key",new Uint8Array(0),n,t), -m=await ae(f,"key",new Uint8Array(0),n,t),b=await ae(h,"iv",new Uint8Array(0),12, -t),U=await ae(f,"iv",new Uint8Array(0),12,t);return{serverApplicationKey:m,serverApplicationIV:U, -clientApplicationKey:y,clientApplicationIV:b}}o(qo,"Tt");var Nt=class{static{o(this, -"Z")}constructor(r,e,t){this.mode=r,this.key=e,this.initialIv=t}recordsProcessed=0n;priorPromise=Promise. -resolve(new Uint8Array);async process(r,e,t){let n=this.processUnsequenced(r,e,t); -return this.priorPromise=this.priorPromise.then(()=>n)}async processUnsequenced(r,e,t){ +${Cr.repeat(t)}`)}return e}},$a=typeof T<"u"?Promise.resolve(T):Promise.resolve().then(()=>(dt(),ft)). +then(r=>r.webcrypto);async function Ai(...r){return(await $a).getRandomValues(...r)} +a(Ai,"getRandomValues");async function ja(r,e,t,n=!0){let i=new Ce(1024);i.writeUint8( +22,0),i.writeUint16(769,0);let s=i.writeLengthUint16("TLS record");i.writeUint8( +1,0);let o=i.writeLengthUint24();i.writeUint16(771,0),await Ai(i.subarray(32));let c=i. +writeLengthUint8(0);i.writeBytes(t),c();let u=i.writeLengthUint16(0);i.writeUint16( +4865,0),u();let l=i.writeLengthUint8(0);i.writeUint8(0,0),l();let h=i.writeLengthUint16( +0);if(n){i.writeUint16(0,0);let _=i.writeLengthUint16(0),D=i.writeLengthUint16(0); +i.writeUint8(0,0);let Y=i.writeLengthUint16(0);i.writeUTF8String(r),Y(),D(),_()} +i.writeUint16(11,0);let f=i.writeLengthUint16(0),g=i.writeLengthUint8(0);i.writeUint8( +0,0),g(),f(),i.writeUint16(10,0);let p=i.writeLengthUint16(0),E=i.writeLengthUint16( +0);i.writeUint16(23,0),E(),p(),i.writeUint16(13,0);let C=i.writeLengthUint16(0), +v=i.writeLengthUint16(0);i.writeUint16(1027,0),i.writeUint16(2052,0),v(),C(),i.writeUint16( +43,0);let A=i.writeLengthUint16(0),S=i.writeLengthUint8(0);i.writeUint16(772,0), +S(),A(),i.writeUint16(51,0);let m=i.writeLengthUint16(0),x=i.writeLengthUint16(0); +i.writeUint16(23,0);let N=i.writeLengthUint16(0);return i.writeBytes(e),N(),x(), +m(),h(),o(),s(),i}a(ja,"makeClientHello");function Pe(r){return new Uint8Array(Array. +from(r.matchAll(/[0-9a-f]/g)).map(e=>parseInt(e[0],16)))}a(Pe,"u8FromHex");function Z(r,e=""){ +return[...r].map(t=>t.toString(16).padStart(2,"0")).join(e)}a(Z,"hexFromU8");function Ka(r,e){ +let t,n,[i]=r.expectLength(r.remaining());r.expectUint8(2,0);let[s]=r.expectLengthUint24( +0);r.expectUint16(771,0);let o=r.readBytes(32);if(Ht(o,[207,33,173,116,229,154,97, +17,190,29,140,2,30,101,184,145,194,162,17,22,122,187,140,94,7,158,9,226,200,168, +51,156]))throw new Error("Unexpected HelloRetryRequest");r.expectUint8(e.length, +0),r.expectBytes(e,0),r.expectUint16(4865,0),r.expectUint8(0,0);let[c,u]=r.expectLengthUint16( +0);for(;u()>0;){let l=r.readUint16(0),[h]=r.expectLengthUint16(0);if(l===43)r.expectUint16( +772,0),n=!0;else if(l===51){r.expectUint16(23,0);let[f,g]=r.expectLengthUint16("\ +key share"),p=g();if(p!==65)throw new Error(`Expected 65 bytes of key share, but\ + got ${p}`);t=r.readBytes(p),f()}else throw new Error(`Unexpected extension 0x${Z( +[l])}`);h()}if(c(),s(),i(),n!==!0)throw new Error("No TLS version provided");if(t=== +void 0)throw new Error("No key provided");return t}a(Ka,"parseServerHello");var Uf=new RegExp( +` .+|^(${Cr})+`,"gm");var pt=16384,Wa=pt+1+255;async function Tr(r,e,t=pt){let i=await r(5);if(i===void 0) +return;if(i.length<5)throw new Error("TLS record header truncated");let s=new Ce( +i),o=s.readUint8();if(o<20||o>24)throw new Error(`Illegal TLS record type 0x${o. +toString(16)}`);if(e!==void 0&&o!==e)throw new Error(`Unexpected TLS record type\ + 0x${o.toString(16).padStart(2,"0")} (expected 0x${e.toString(16).padStart(2,"0")}\ +)`);s.expectUint16(771,"TLS record version 1.2 (middlebox compatibility)");let c=s. +readUint16();if(c>t)throw new Error(`Record too long: ${c} bytes`);let u=await r( +c);if(u===void 0||u.length(dt(),ft)). +then(r=>r.webcrypto.subtle);function za(r,e){return Ga.then(t=>t[r](...e))}a(za, +"subtleCryptoMethod");var O=new Proxy({},{get(r,e,t){return(...n)=>za(e,n)}}),vi=new TextEncoder; +async function Ur(r,e,t){let n=await O.importKey("raw",r,{name:"HMAC",hash:{name:`\ +SHA-${t}`}},!1,["sign"]);var i=new Uint8Array(await O.sign("HMAC",n,e));return i} +a(Ur,"hkdfExtract");async function Ja(r,e,t,n){let i=n>>3,s=Math.ceil(t/i),o=new Uint8Array( +s*i),c=await O.importKey("raw",r,{name:"HMAC",hash:{name:`SHA-${n}`}},!1,["sign"]), +u=new Uint8Array(0);for(let l=0;l>8,n&255],[Si.length+s.length],Si,s,[t.length],t);return Ja(r,o, +n,i)}a(ue,"hkdfExpandLabel");async function Ya(r,e,t,n,i){let s=n>>>3,o=new Uint8Array( +s),c=await O.importKey("raw",r,{name:"ECDH",namedCurve:"P-256"},!1,[]),u=await O. +deriveBits({name:"ECDH",public:c},e,256),l=new Uint8Array(u),h=await O.digest("S\ +HA-256",t),f=new Uint8Array(h),g=await Ur(new Uint8Array(1),o,n),p=await O.digest( +`SHA-${n}`,new Uint8Array(0)),E=new Uint8Array(p),C=await ue(g,"derived",E,s,n), +v=await Ur(C,l,n),A=await ue(v,"c hs traffic",f,s,n),S=await ue(v,"s hs traffic", +f,s,n),m=await ue(A,"key",new Uint8Array(0),i,n),x=await ue(S,"key",new Uint8Array( +0),i,n),N=await ue(A,"iv",new Uint8Array(0),12,n),_=await ue(S,"iv",new Uint8Array( +0),12,n);return{serverHandshakeKey:x,serverHandshakeIV:_,clientHandshakeKey:m,clientHandshakeIV:N, +handshakeSecret:v,clientSecret:A,serverSecret:S}}a(Ya,"getHandshakeKeys");async function Za(r,e,t,n){ +let i=t>>>3,s=new Uint8Array(i),o=await O.digest(`SHA-${t}`,new Uint8Array(0)),c=new Uint8Array( +o),u=await ue(r,"derived",c,i,t),l=await Ur(u,s,t),h=await ue(l,"c ap traffic",e, +i,t),f=await ue(l,"s ap traffic",e,i,t),g=await ue(h,"key",new Uint8Array(0),n,t), +p=await ue(f,"key",new Uint8Array(0),n,t),E=await ue(h,"iv",new Uint8Array(0),12, +t),C=await ue(f,"iv",new Uint8Array(0),12,t);return{serverApplicationKey:p,serverApplicationIV:C, +clientApplicationKey:g,clientApplicationIV:E}}a(Za,"getApplicationKeys");var Ot=class{static{ +a(this,"Crypter")}constructor(r,e,t){this.mode=r,this.key=e,this.initialIv=t,K(this, +"recordsProcessed",0n),K(this,"priorPromise",Promise.resolve(new Uint8Array))}async process(r,e,t){ +return this.sequence(this.processUnsequenced(r,e,t))}async sequence(r){let e=this. +priorPromise.then(()=>r);return this.priorPromise=e,e}async processUnsequenced(r,e,t){ let n=this.recordsProcessed;this.recordsProcessed+=1n;let i=this.initialIv.slice(), -s=BigInt(i.length),a=s-1n;for(let h=0n;h>(h<<3n);if(f===0n)break; -i[Number(a-h)]^=Number(f&0xffn)}let u=e<<3,c={name:"AES-GCM",iv:i,tagLength:u,additionalData:t}, -l=await O[this.mode](c,this.key,r);return new Uint8Array(l)}};function Mt(r){return r> -64&&r<91?r-65:r>96&&r<123?r-71:r>47&&r<58?r+4:r===43?62:r===47?63:r===61?64:void 0} -o(Mt,"yt");function Fo(r){let e=r.length,t=0,n=0,i=64,s=64,a=64,u=64,c=new Uint8Array( -e*.75);for(;t>4,c[n++]=(s&15)<<4|a>>2,c[n++]=(a&3)<< -6|u;let l=s===64?0:a===64?2:u===64?1:0;return c.subarray(0,n-l)}o(Fo,"Dt");var Dt=class extends be{static{ -o(this,"M")}readASN1Length(r){let e=this.readUint8();if(e<128)return e;let t=e&127, -n=0;if(t===1)return this.readUint8(n);if(t===2)return this.readUint16(n);if(t=== +s=BigInt(i.length),o=s-1n;for(let f=0n;f>(f<<3n);if(g===0n)break; +i[Number(o-f)]^=Number(g&0xffn)}let c=e<<3,u={name:"AES-GCM",iv:i,tagLength:c,additionalData:t}, +l=await O[this.mode](u,this.key,r);return new Uint8Array(l)}};function Xa(r){throw new Error( +`Invalid base 64 character: ${String.fromCharCode(r)}`)}a(Xa,"base64Error");function ec(r){ +return r>64&&r<91?r-65:r>96&&r<123?r-71:r>47&&r<58?r+4:r===43?62:r===47?63:r===61? +64:Xa(r)}a(ec,"stdCharCodes");function Ci(r,e=ec,t=!0){let n=r.length;t&&(r+="=". +repeat(n%4));let i=0,s=0,o=64,c=64,u=64,l=64,h=new Uint8Array(n*.75);for(;i>4,h[s++]=(c&15)<<4|u>>2,h[s++]=(u&3)<<6|l;let f=c===64?0:u=== +64?2:l===64?1:0;return h.subarray(0,s-f)}a(Ci,"base64Decode");var yt=class extends Ce{static{ +a(this,"ASN1Bytes")}readASN1Length(r){let e=this.readUint8();if(e<128)return e;let t=e& +127,n=0;if(t===1)return this.readUint8(n);if(t===2)return this.readUint16(n);if(t=== 3)return this.readUint24(n);if(t===4)return this.readUint32(n);throw new Error(`\ ASN.1 length fields are only supported up to 4 bytes (this one is ${t} bytes)`)}expectASN1Length(r){ -let e=this.readASN1Length(r);return this.expectLength(e)}readASN1OID(){let[r,e]=this. -expectASN1Length(0),t=this.readUint8(),n=`${Math.floor(t/40)}.${t%40}`;for(;e()> -0;){let i=0;for(;;){let s=this.readUint8();if(i<<=7,i+=s&127,s<128)break}n+=`.${i}`} -return r(),n}readASN1Boolean(){let[r,e]=this.expectASN1Length(0),t=e();if(t!==1) -throw new Error(`Boolean has weird length: ${t}`);let n=this.readUint8(),i;if(n=== -255)i=!0;else if(n===0)i=!1;else throw new Error(`Boolean has weird value: 0x${Te( -[n])}`);return r(),i}readASN1UTCTime(){let[r,e]=this.expectASN1Length(0),t=this. -readUTF8String(e()).match(/^(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)Z$/);if(!t)throw new Error( -"Unrecognised ASN.1 UTC time format");let[,n,i,s,a,u,c]=t,l=parseInt(n,10),h=l+(l>= -50?1900:2e3),f=new Date(`${h}-${i}-${s}T${a}:${u}:${c}Z`);return r(),f}readASN1BitString(){ +let e=this.readASN1Length(r);return this.expectLength(e)}readASN1OID(r){let[e,t]=this. +expectASN1Length(0),n=this.readUint8(),i=`${Math.floor(n/40)}.${n%40}`;for(;t()> +0;){let s=0;for(;;){let o=this.readUint8();if(s<<=7,s+=o&127,o<128)break}i+=`.${s}`} +return e(),i}readASN1Boolean(r){let[e,t]=this.expectASN1Length(0),n=t();if(n!==1) +throw new Error(`Boolean has weird length: ${n}`);let i=this.readUint8(),s;if(i=== +255)s=!0;else if(i===0)s=!1;else throw new Error(`Boolean has weird value: 0x${Z( +[i])}`);return e(),s}readASN1UTCTime(){let[r,e]=this.expectASN1Length(0),n=this. +readUTF8String(e()).match(/^(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)Z$/);if(!n)throw new Error( +"Unrecognised ASN.1 UTC time format");let[,i,s,o,c,u,l]=n,h=parseInt(i,10),f=h+(h>= +50?1900:2e3),g=new Date(`${f}-${s}-${o}T${c}:${u}:${l}Z`);return r(),g}readASN1GeneralizedTime(){ +let[r,e]=this.expectASN1Length(0),n=this.readUTF8String(e()).match(/^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?([0-9]{2})?([.][0-9]+)?(Z)?([-+][0-9]+)?$/); +if(!n)throw new Error("Unrecognised ASN.1 generalized time format");let[,i,s,o,c, +u,l,h,f,g]=n;if(l===void 0&&h!==void 0)throw new Error("Invalid ASN.1 generalize\ +d time format (fraction without seconds)");if(f!==void 0&&g!==void 0)throw new Error( +"Invalid ASN.1 generalized time format (Z and timezone)");let p=new Date(`${i}-${s}\ +-${o}T${c}:${u??"00"}:${l??"00"}${h??""}${g??"Z"}`);return r(),p}readASN1BitString(){ let[r,e]=this.expectASN1Length(0),t=this.readUint8(0),n=e(),i=this.readBytes(n); -if(t>7)throw new Error(`Invalid right pad value: ${t}`);if(t>0){let s=8-t;for(let a=n- -1;a>0;a--)i[a]=255&i[a-1]<>>t;i[0]=i[0]>>>t}return r(),i}};function di(r,e=(n,i)=>i,t){ -return JSON.stringify(r,(n,i)=>e(n,typeof i!="object"||i===null||Array.isArray(i)? -i:Object.fromEntries(Object.entries(i).sort(([s],[a])=>sa?1:0))),t)}o(di, -"mt");var gr=1,qt=2,ie=48,Oo=49,Ke=6,ko=19,Qo=12,pi=23,Sr=5,De=4,Er=3,$o=163,He=128, -jo={"2.5.4.6":"C","2.5.4.10":"O","2.5.4.11":"OU","2.5.4.3":"CN","2.5.4.7":"L","2\ -.5.4.8":"ST","2.5.4.12":"T","2.5.4.42":"GN","2.5.4.43":"I","2.5.4.4":"SN","1.2.8\ -40.113549.1.9.1":"E-mail"};function Ho(r){let{length:e}=r;if(e>4)throw new Error( -`Bit string length ${e} would overflow JS bit operators`);let t=0,n=0;for(let i=r. -length-1;i>=0;i--)t|=r[i]<0;){r.expectUint8(Oo, -0);let[s]=r.expectASN1Length(0);r.expectUint8(ie,0);let[a]=r.expectASN1Length(0); -r.expectUint8(Ke,0);let u=r.readASN1OID(),c=jo[u]??u,l=r.readUint8();if(l!==ko&& -l!==Qo)throw new Error(`Unexpected item type in certificate ${e}: 0x${Te([l])}`); -let[h,f]=r.expectASN1Length(0),y=r.readUTF8String(f());if(h(),a(),s(),t[c]!==void 0) -throw new Error(`Duplicate OID ${c} in certificate ${e}`);t[c]=y}return n(),t}o( -yi,"Ct");function Ko(r,e=0){let t=[],[n,i]=r.expectASN1Length(0);for(;i()>0;){let s=r. -readUint8(0),[a,u]=r.expectASN1Length(0),c;s===(e|2)?c=r.readUTF8String(u()):c=r. -readBytes(u()),t.push({name:c,type:s}),a()}return n(),t}o(Ko,"Bt");function Wo(r){ -let e={"1.2.840.113549.1.1.1":{name:"RSAES-PKCS1-v1_5"},"1.2.840.113549.1.1.5":{ -name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}},"1.2.840.113549.1.1.11":{name:"RSA\ -SSA-PKCS1-v1_5",hash:{name:"SHA-256"}},"1.2.840.113549.1.1.12":{name:"RSASSA-PKC\ -S1-v1_5",hash:{name:"SHA-384"}},"1.2.840.113549.1.1.13":{name:"RSASSA-PKCS1-v1_5", -hash:{name:"SHA-512"}},"1.2.840.113549.1.1.10":{name:"RSA-PSS"},"1.2.840.113549.\ -1.1.7":{name:"RSA-OAEP"},"1.2.840.10045.2.1":{name:"ECDSA",hash:{name:"SHA-1"}}, -"1.2.840.10045.4.1":{name:"ECDSA",hash:{name:"SHA-1"}},"1.2.840.10045.4.3.2":{name:"\ -ECDSA",hash:{name:"SHA-256"}},"1.2.840.10045.4.3.3":{name:"ECDSA",hash:{name:"SH\ -A-384"}},"1.2.840.10045.4.3.4":{name:"ECDSA",hash:{name:"SHA-512"}},"1.3.133.16.\ -840.63.0.2":{name:"ECDH",kdf:"SHA-1"},"1.3.132.1.11.1":{name:"ECDH",kdf:"SHA-256"}, -"1.3.132.1.11.2":{name:"ECDH",kdf:"SHA-384"},"1.3.132.1.11.3":{name:"ECDH",kdf:"\ -SHA-512"},"2.16.840.1.101.3.4.1.2":{name:"AES-CBC",length:128},"2.16.840.1.101.3\ -.4.1.22":{name:"AES-CBC",length:192},"2.16.840.1.101.3.4.1.42":{name:"AES-CBC",length:256}, -"2.16.840.1.101.3.4.1.6":{name:"AES-GCM",length:128},"2.16.840.1.101.3.4.1.26":{ -name:"AES-GCM",length:192},"2.16.840.1.101.3.4.1.46":{name:"AES-GCM",length:256}, -"2.16.840.1.101.3.4.1.4":{name:"AES-CFB",length:128},"2.16.840.1.101.3.4.1.24":{ -name:"AES-CFB",length:192},"2.16.840.1.101.3.4.1.44":{name:"AES-CFB",length:256}, -"2.16.840.1.101.3.4.1.5":{name:"AES-KW",length:128},"2.16.840.1.101.3.4.1.25":{name:"\ -AES-KW",length:192},"2.16.840.1.101.3.4.1.45":{name:"AES-KW",length:256},"1.2.84\ -0.113549.2.7":{name:"HMAC",hash:{name:"SHA-1"}},"1.2.840.113549.2.9":{name:"HMAC", -hash:{name:"SHA-256"}},"1.2.840.113549.2.10":{name:"HMAC",hash:{name:"SHA-384"}}, -"1.2.840.113549.2.11":{name:"HMAC",hash:{name:"SHA-512"}},"1.2.840.113549.1.9.16\ -.3.5":{name:"DH"},"1.3.14.3.2.26":{name:"SHA-1"},"2.16.840.1.101.3.4.2.1":{name:"\ -SHA-256"},"2.16.840.1.101.3.4.2.2":{name:"SHA-384"},"2.16.840.1.101.3.4.2.3":{name:"\ -SHA-512"},"1.2.840.113549.1.5.12":{name:"PBKDF2"},"1.2.840.10045.3.1.7":{name:"P\ --256"},"1.3.132.0.34":{name:"P-384"},"1.3.132.0.35":{name:"P-521"}}[r];if(e===void 0) -throw new Error(`Unsupported algorithm identifier: ${r}`);return e}o(Wo,"Ft");function mi(r,e=[]){ -return Object.values(r).forEach(t=>{typeof t=="string"?e=[...e,t]:e=mi(t,e)}),e} -o(mi,"Ot");function Go(r){return mi(r).join(" / ")}o(Go,"Pt");var Vo=["digitalSi\ -gnature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","k\ -eyCertSign","cRLSign","encipherOnly","decipherOnly"],_r=class Cr{static{o(this,"\ -r")}serialNumber;algorithm;issuer;validityPeriod;subject;publicKey;signature;keyUsage;subjectAltNames;extKeyUsage;authorityKeyIdentifier;subjectKeyIdentifier;basicConstraints;signedData;static distinguishedNamesAreEqual(e,t){ -return di(e)===di(t)}static readableDN(e){return Object.entries(e).map(t=>t.join( -"=")).join(", ")}constructor(e){let t=e instanceof Dt?e:new Dt(e);t.expectUint8( -ie,0);let[n]=t.expectASN1Length(0),i=t.offset;t.expectUint8(ie,0);let[s]=t.expectASN1Length( -0);t.expectBytes([160,3,2,1,2],0),t.expectUint8(qt,0);let[a,u]=t.expectASN1Length( -0);this.serialNumber=t.subarray(u()),a(),t.expectUint8(ie,0);let[c,l]=t.expectASN1Length( -0);t.expectUint8(Ke,0),this.algorithm=t.readASN1OID(),l()>0&&(t.expectUint8(Sr,0), -t.expectUint8(0,0)),c(),this.issuer=yi(t,"issuer"),t.expectUint8(ie,0);let[h]=t. -expectASN1Length(0);t.expectUint8(pi,0);let f=t.readASN1UTCTime();t.expectUint8( -pi,0);let y=t.readASN1UTCTime();this.validityPeriod={notBefore:f,notAfter:y},h(), -this.subject=yi(t,"subject");let m=t.offset;t.expectUint8(ie,0);let[b]=t.expectASN1Length( -0);t.expectUint8(ie,0);let[U,v]=t.expectASN1Length(0),C=[];for(;v()>0;){let Z=t. -readUint8();if(Z===Ke){let M=t.readASN1OID();C.push(M)}else Z===Sr&&t.expectUint8( -0,0)}U(),t.expectUint8(Er,0);let E=t.readASN1BitString();this.publicKey={identifiers:C, -data:E,all:t.data.subarray(m,t.offset)},b(),t.expectUint8($o,0);let[g]=t.expectASN1Length(); -t.expectUint8(ie,0);let[x,N]=t.expectASN1Length(0);for(;N()>0;){t.expectUint8(ie, -0);let[Z,M]=t.expectASN1Length();t.expectUint8(Ke,0);let $=t.readASN1OID();if($=== -"2.5.29.17"){t.expectUint8(De,0);let[j]=t.expectASN1Length(0);t.expectUint8(ie,0); -let H=Ko(t,He);this.subjectAltNames=H.filter(K=>K.type===(2|He)).map(K=>K.name), -j()}else if($==="2.5.29.15"){t.expectUint8(gr,0);let j=t.readASN1Boolean();t.expectUint8( -De,0);let[H]=t.expectASN1Length(0);t.expectUint8(Er,0);let K=t.readASN1BitString(), -J=Ho(K),F=new Set(Vo.filter((Y,W)=>J&1<0;){t.expectUint8(Ke, -0);let J=t.readASN1OID();J==="1.3.6.1.5.5.7.3.1"&&(this.extKeyUsage.serverTls=!0), -J==="1.3.6.1.5.5.7.3.2"&&(this.extKeyUsage.clientTls=!0)}H(),j()}else if($==="2.\ -5.29.35"){t.expectUint8(De,0);let[j]=t.expectASN1Length(0);t.expectUint8(ie,0);let[ -H,K]=t.expectASN1Length(0);for(;K()>0;){let J=t.readUint8();if(J===(He|0)){let[F, -Y]=t.expectASN1Length(0);this.authorityKeyIdentifier=t.readBytes(Y()),F()}else if(J=== -(He|1)){let[F,Y]=t.expectASN1Length(0);t.skip(Y(),0),F()}else if(J===(He|2)){let[ -F,Y]=t.expectASN1Length(0);t.skip(Y(),0),F()}else if(J===(He|33)){let[F,Y]=t.expectASN1Length( -0);t.skip(Y(),0),F()}else throw new Error(`Unexpected data type ${J} in authorit\ -yKeyIdentifier certificate extension`)}H(),j()}else if($==="2.5.29.14"){t.expectUint8( -De,0);let[j]=t.expectASN1Length(0);t.expectUint8(De,0);let[H,K]=t.expectASN1Length( -0);this.subjectKeyIdentifier=t.readBytes(K()),H(),j()}else if($==="2.5.29.19"){let j, -H=t.readUint8();if(H===gr&&(j=t.readASN1Boolean(),H=t.readUint8()),H!==De)throw new Error( -"Unexpected type in certificate basic constraints");let[K]=t.expectASN1Length(0); -t.expectUint8(ie,0);let[J,F]=t.expectASN1Length(),Y;F()>0&&(t.expectUint8(gr,0), -Y=t.readASN1Boolean());let W;if(F()>0){t.expectUint8(qt,0);let R=t.readASN1Length( -0);if(W=R===1?t.readUint8():R===2?t.readUint16():R===3?t.readUint24():void 0,W=== +if(t>7)throw new Error(`Invalid right pad value: ${t}`);if(t>0){let s=8-t;for(let o=n- +1;o>0;o--)i[o]=255&i[o-1]<>>t;i[0]=i[0]>>>t}return r(),i}},xr=1,Qt=2,ae=48, +tc=49,Je=6,rc=19,nc=20,ic=12,sc=22,bi=23,Ei=24,Ar=5,_e=4,vr=3,oc=163,ze=128,ac={ +"2.5.4.6":"C","2.5.4.10":"O","2.5.4.11":"OU","2.5.4.3":"CN","2.5.4.7":"L","2.5.4\ +.8":"ST","2.5.4.12":"T","2.5.4.42":"GN","2.5.4.43":"I","2.5.4.4":"SN","1.2.840.1\ +13549.1.9.1":"MAIL","2.5.4.5":"SERIALNUMBER"};function cc(r){let{length:e}=r;if(e> +4)throw new Error(`Bit string length ${e} would overflow JS bit operators`);let t=0, +n=0;for(let i=r.length-1;i>=0;i--)t|=r[i]<0;){r.expectUint8(tc,0);let[s]=r.expectASN1Length(0);r.expectUint8(ae,0); +let[o]=r.expectASN1Length(0);r.expectUint8(Je,0);let c=r.readASN1OID(),u=ac[c]?? +c,l=r.readUint8();if(l!==rc){if(l!==ic){if(l!==sc){if(l!==nc)throw new Error(`Un\ +expected item type in certificate ${e}: 0x${Z([l])}`)}}}let[h,f]=r.expectASN1Length( +0),g=r.readUTF8String(f());h(),o(),s();let p=t[u];p===void 0?t[u]=g:typeof p=="s\ +tring"?t[u]=[p,g]:p.push(g)}return n(),t}a(xi,"readSeqOfSetOfSeq");function uc(r,e=0){ +let t=[],[n,i]=r.expectASN1Length(0);for(;i()>0;){let s=r.readUint8(0),[o,c]=r.expectASN1Length( +0),u;s===(e|2)?u=r.readUTF8String(c()):u=r.readBytes(c()),t.push({name:u,type:s}), +o()}return n(),t}a(uc,"readNamesSeq");function lc(r){let e={"1.2.840.113549.1.1.\ +1":{name:"RSAES-PKCS1-v1_5"},"1.2.840.113549.1.1.5":{name:"RSASSA-PKCS1-v1_5",hash:{ +name:"SHA-1"}},"1.2.840.113549.1.1.11":{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA\ +-256"}},"1.2.840.113549.1.1.12":{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}}, +"1.2.840.113549.1.1.13":{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}},"1.2.84\ +0.113549.1.1.10":{name:"RSA-PSS"},"1.2.840.113549.1.1.7":{name:"RSA-OAEP"},"1.2.\ +840.10045.2.1":{name:"ECDSA",hash:{name:"SHA-1"}},"1.2.840.10045.4.1":{name:"ECD\ +SA",hash:{name:"SHA-1"}},"1.2.840.10045.4.3.2":{name:"ECDSA",hash:{name:"SHA-256"}}, +"1.2.840.10045.4.3.3":{name:"ECDSA",hash:{name:"SHA-384"}},"1.2.840.10045.4.3.4":{ +name:"ECDSA",hash:{name:"SHA-512"}},"1.3.133.16.840.63.0.2":{name:"ECDH",kdf:"SH\ +A-1"},"1.3.132.1.11.1":{name:"ECDH",kdf:"SHA-256"},"1.3.132.1.11.2":{name:"ECDH", +kdf:"SHA-384"},"1.3.132.1.11.3":{name:"ECDH",kdf:"SHA-512"},"2.16.840.1.101.3.4.\ +1.2":{name:"AES-CBC",length:128},"2.16.840.1.101.3.4.1.22":{name:"AES-CBC",length:192}, +"2.16.840.1.101.3.4.1.42":{name:"AES-CBC",length:256},"2.16.840.1.101.3.4.1.6":{ +name:"AES-GCM",length:128},"2.16.840.1.101.3.4.1.26":{name:"AES-GCM",length:192}, +"2.16.840.1.101.3.4.1.46":{name:"AES-GCM",length:256},"2.16.840.1.101.3.4.1.4":{ +name:"AES-CFB",length:128},"2.16.840.1.101.3.4.1.24":{name:"AES-CFB",length:192}, +"2.16.840.1.101.3.4.1.44":{name:"AES-CFB",length:256},"2.16.840.1.101.3.4.1.5":{ +name:"AES-KW",length:128},"2.16.840.1.101.3.4.1.25":{name:"AES-KW",length:192},"\ +2.16.840.1.101.3.4.1.45":{name:"AES-KW",length:256},"1.2.840.113549.2.7":{name:"\ +HMAC",hash:{name:"SHA-1"}},"1.2.840.113549.2.9":{name:"HMAC",hash:{name:"SHA-256"}}, +"1.2.840.113549.2.10":{name:"HMAC",hash:{name:"SHA-384"}},"1.2.840.113549.2.11":{ +name:"HMAC",hash:{name:"SHA-512"}},"1.2.840.113549.1.9.16.3.5":{name:"DH"},"1.3.\ +14.3.2.26":{name:"SHA-1"},"2.16.840.1.101.3.4.2.1":{name:"SHA-256"},"2.16.840.1.\ +101.3.4.2.2":{name:"SHA-384"},"2.16.840.1.101.3.4.2.3":{name:"SHA-512"},"1.2.840\ +.113549.1.5.12":{name:"PBKDF2"},"1.2.840.10045.3.1.7":{name:"P-256"},"1.3.132.0.\ +34":{name:"P-384"},"1.3.132.0.35":{name:"P-521"}}[r];if(e===void 0)throw new Error( +`Unsupported algorithm identifier: ${r}`);return e}a(lc,"algorithmWithOID");function Ti(r,e=[]){ +return Object.values(r).forEach(t=>{typeof t=="string"?e=[...e,t]:e=Ti(t,e)}),e} +a(Ti,"_descriptionForAlgorithm");function hc(r){return Ti(r).join(" / ")}a(hc,"d\ +escriptionForAlgorithm");var fc=["digitalSignature","nonRepudiation","keyEnciphe\ +rment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly", +"decipherOnly"],Ir=class Lr{static{a(this,"_Cert")}constructor(e){if(K(this,"ser\ +ialNumber"),K(this,"algorithm"),K(this,"issuer"),K(this,"validityPeriod"),K(this, +"subject"),K(this,"publicKey"),K(this,"signature"),K(this,"keyUsage"),K(this,"su\ +bjectAltNames"),K(this,"extKeyUsage"),K(this,"authorityKeyIdentifier"),K(this,"s\ +ubjectKeyIdentifier"),K(this,"basicConstraints"),K(this,"signedData"),e instanceof +yt||e instanceof Uint8Array){let t=e instanceof yt?e:new yt(e);t.expectUint8(ae, +0);let[n]=t.expectASN1Length(0),i=t.offset;t.expectUint8(ae,0);let[s]=t.expectASN1Length( +0);t.expectBytes([160,3,2,1,2],0),t.expectUint8(Qt,0);let[o,c]=t.expectASN1Length( +0);this.serialNumber=t.subarray(c()),o(),t.expectUint8(ae,0);let[u,l]=t.expectASN1Length( +0);t.expectUint8(Je,0),this.algorithm=t.readASN1OID(),l()>0&&(t.expectUint8(Ar,0), +t.expectUint8(0,0)),u(),this.issuer=xi(t,"issuer");let h,f;t.expectUint8(ae,0);let[ +g]=t.expectASN1Length(0),p=t.readUint8();if(p===bi)h=t.readASN1UTCTime();else if(p=== +Ei)h=t.readASN1GeneralizedTime();else throw new Error(`Unexpected validity start\ + type 0x${Z([p])}`);let E=t.readUint8();if(E===bi)f=t.readASN1UTCTime();else if(E=== +Ei)f=t.readASN1GeneralizedTime();else throw new Error(`Unexpected validity end t\ +ype 0x${Z([E])}`);this.validityPeriod={notBefore:h,notAfter:f},g(),this.subject= +xi(t,"subject");let C=t.offset;t.expectUint8(ae,0);let[v]=t.expectASN1Length(0); +t.expectUint8(ae,0);let[A,S]=t.expectASN1Length(0),m=[];for(;S()>0;){let W=t.readUint8(); +if(W===Je){let oe=t.readASN1OID();m.push(oe)}else W===Ar&&t.expectUint8(0,0)}A(), +t.expectUint8(vr,0);let x=t.readASN1BitString();this.publicKey={identifiers:m,data:x, +all:t.data.subarray(C,t.offset)},v(),t.expectUint8(oc,0);let[N]=t.expectASN1Length(); +t.expectUint8(ae,0);let[_,D]=t.expectASN1Length(0);for(;D()>0;){t.expectUint8(ae, +0);let[W,oe]=t.expectASN1Length();t.expectUint8(Je,0);let ee=t.readASN1OID();if(ee=== +"2.5.29.17"){t.expectUint8(_e,0);let[j]=t.expectASN1Length(0);t.expectUint8(ae,0); +let H=uc(t,ze);this.subjectAltNames=H.filter(Q=>Q.type===(2|ze)).map(Q=>Q.name), +j()}else if(ee==="2.5.29.15"){let j,H=t.readUint8();if(H===xr&&(j=t.readASN1Boolean( +0),H=t.readUint8()),H!==_e)throw new Error(`Expected 0x${Z([_e])}, got 0x${Z([H])}`); +let[Q]=t.expectASN1Length(0);t.expectUint8(vr,0);let V=t.readASN1BitString(),k=cc( +V),q=new Set(fc.filter((M,F)=>k&1<0;){t.expectUint8(Je, +0);let V=t.readASN1OID();V==="1.3.6.1.5.5.7.3.1"&&(this.extKeyUsage.serverTls=!0), +V==="1.3.6.1.5.5.7.3.2"&&(this.extKeyUsage.clientTls=!0)}H(),j()}else if(ee==="2\ +.5.29.35"){t.expectUint8(_e,0);let[j]=t.expectASN1Length(0);t.expectUint8(ae,0); +let[H,Q]=t.expectASN1Length(0);for(;Q()>0;){let V=t.readUint8();if(V===(ze|0)){let[ +k,q]=t.expectASN1Length(0);this.authorityKeyIdentifier=t.readBytes(q()),k()}else if(V=== +(ze|1)){let[k,q]=t.expectASN1Length(0);t.skip(q(),0),k()}else if(V===(ze|2)){let[ +k,q]=t.expectASN1Length(0);t.skip(q(),0),k()}else if(V===(ze|33)){let[k,q]=t.expectASN1Length( +0);t.skip(q(),0),k()}else throw new Error(`Unexpected data type ${V} in authorit\ +yKeyIdentifier certificate extension`)}H(),j()}else if(ee==="2.5.29.14"){t.expectUint8( +_e,0);let[j]=t.expectASN1Length(0);t.expectUint8(_e,0);let[H,Q]=t.expectASN1Length( +0);this.subjectKeyIdentifier=t.readBytes(Q()),H(),j()}else if(ee==="2.5.29.19"){ +let j,H=t.readUint8();if(H===xr&&(j=t.readASN1Boolean(0),H=t.readUint8()),H!==_e) +throw new Error("Unexpected type in certificate basic constraints");let[Q]=t.expectASN1Length( +0);t.expectUint8(ae,0);let[V,k]=t.expectASN1Length(),q;k()>0&&(t.expectUint8(xr, +0),q=t.readASN1Boolean(0));let M;if(k()>0){t.expectUint8(Qt,0);let F=t.readASN1Length( +0);if(M=F===1?t.readUint8():F===2?t.readUint16():F===3?t.readUint24():void 0,M=== void 0)throw new Error("Too many bytes in max path length in certificate basicCo\ -nstraints")}J(),K(),this.basicConstraints={critical:j,ca:Y,pathLength:W}}else t. -skip(M(),0);Z()}x(),g(),s(),this.signedData=t.data.subarray(i,t.offset),t.expectUint8( -ie,0);let[P,D]=t.expectASN1Length(0);t.expectUint8(Ke,0);let q=t.readASN1OID();if(D()> -0&&(t.expectUint8(Sr,0),t.expectUint8(0,0)),P(),q!==this.algorithm)throw new Error( -`Certificate specifies different signature algorithms inside (${this.algorithm})\ - and out (${q})`);t.expectUint8(Er,0),this.signature=t.readASN1BitString(),n()}static fromPEM(e){ -let t="[A-Z0-9 ]+",n=new RegExp(`-{5}BEGIN ${t}-{5}([a-zA-Z0-9=+\\/\\n\\r]+)-{5}END\ - ${t}-{5}`,"g"),i=[],s=null;for(;s=n.exec(e);){let a=s[1].replace(/[\r\n]/g,""), -u=Fo(a),c=new this(u);i.push(c)}return i}subjectAltNameMatchingHost(e){let t=/[.][^.]+[.][^.]+$/; -return(this.subjectAltNames??[]).find(n=>{let i=n,s=e;if(t.test(e)&&t.test(i)&&i. -startsWith("*.")&&(i=i.slice(1),s=s.slice(s.indexOf("."))),i===s)return!0})}isValidAtMoment(e=new Date){ +nstraints")}V(),Q(),this.basicConstraints={critical:j,ca:q,pathLength:M}}else t. +skip(oe(),0);W()}_(),N(),s(),this.signedData=t.data.subarray(i,t.offset),t.expectUint8( +ae,0);let[Y,te]=t.expectASN1Length(0);t.expectUint8(Je,0);let P=t.readASN1OID(0); +if(te()>0&&(t.expectUint8(Ar,0),t.expectUint8(0,0)),Y(),P!==this.algorithm)throw new Error( +`Certificate specifies different signature algorithms inside(${this.algorithm}) \ +and out(${P})`);t.expectUint8(vr,0),this.signature=t.readASN1BitString(),n()}else +this.serialNumber=Pe(e.serialNumber),this.algorithm=e.algorithm,this.issuer=e.issuer, +this.validityPeriod={notBefore:new Date(e.validityPeriod.notBefore),notAfter:new Date( +e.validityPeriod.notAfter)},this.subject=e.subject,this.publicKey={identifiers:e. +publicKey.identifiers,data:Pe(e.publicKey.data),all:Pe(e.publicKey.all)},this.signature= +Pe(e.signature),this.keyUsage={critical:e.keyUsage.critical,usages:new Set(e.keyUsage. +usages)},this.subjectAltNames=e.subjectAltNames,this.extKeyUsage=e.extKeyUsage,e. +authorityKeyIdentifier&&(this.authorityKeyIdentifier=Pe(e.authorityKeyIdentifier)), +e.subjectKeyIdentifier&&(this.subjectKeyIdentifier=Pe(e.subjectKeyIdentifier)),this. +basicConstraints=e.basicConstraints,this.signedData=Pe(e.signedData)}static distinguishedNamesAreEqual(e,t){ +return this.stringFromDistinguishedName(e)===this.stringFromDistinguishedName(t)}static stringFromDistinguishedName(e){ +return Object.entries(e).map(([t,n])=>typeof n=="string"?`${t}=${n.trim().replace( +/[\\,]/g,"\\$&")}`:n.map(i=>`${t}=${i.trim().replace(/[\\,]/g,"\\$&")}`).join(",\ + ")).join(", ")}subjectAltNameMatchingHost(e){let t=/[.][^.]+[.][^.]+$/;return(this. +subjectAltNames??[]).find(n=>{let i=n,s=e;if(t.test(e)&&t.test(i)&&i.startsWith( +"*.")&&(i=i.slice(1),s=s.slice(s.indexOf("."))),i===s)return!0})}isValidAtMoment(e=new Date){ return e>=this.validityPeriod.notBefore&&e<=this.validityPeriod.notAfter}description(){ -return"subject: "+Cr.readableDN(this.subject)+(this.subjectAltNames?` +return"subject: "+Lr.stringFromDistinguishedName(this.subject)+(this.subjectAltNames? +` subject alt names: `+this.subjectAltNames.join(", "):"")+(this.subjectKeyIdentifier? ` -subject key id: ${Te(this.subjectKeyIdentifier," ")}`:"")+` -issuer: `+Cr.readableDN(this.issuer)+(this.authorityKeyIdentifier?` -authority key id: ${Te(this.authorityKeyIdentifier," ")}`:"")+` +subject key id: ${Z(this.subjectKeyIdentifier," ")}`:"")+` +issuer: `+Lr.stringFromDistinguishedName(this.issuer)+(this.authorityKeyIdentifier? +` +authority key id: ${Z(this.authorityKeyIdentifier," ")}`:"")+` validity: `+this.validityPeriod.notBefore.toISOString()+" \u2013 "+this.validityPeriod. notAfter.toISOString()+` (${this.isValidAtMoment()?"currently valid":"not valid"}\ )`+(this.keyUsage?` @@ -1779,125 +1832,140 @@ nt \u2014\xA0${this.extKeyUsage.clientTls}`:"")+(this.basicConstraints?` basic constraints (${this.basicConstraints.critical?"critical":"non-critical"}):\ CA \u2014\xA0${this.basicConstraints.ca}, path length \u2014 ${this.basicConstraints. pathLength}`:"")+` -signature algorithm: `+Go(Wo(this.algorithm))}toJSON(){return{serialNumber:[...this. -serialNumber],algorithm:this.algorithm,issuer:this.issuer,validityPeriod:{notBefore:this. +signature algorithm: `+hc(lc(this.algorithm))}toJSON(){return{serialNumber:Z(this. +serialNumber),algorithm:this.algorithm,issuer:this.issuer,validityPeriod:{notBefore:this. validityPeriod.notBefore.toISOString(),notAfter:this.validityPeriod.notAfter.toISOString()}, -subject:this.subject,publicKey:{identifiers:this.publicKey.identifiers,data:[...this. -publicKey.data],all:[...this.publicKey.all]},signature:[...this.signature],keyUsage:{ +subject:this.subject,publicKey:{identifiers:this.publicKey.identifiers,data:Z(this. +publicKey.data),all:Z(this.publicKey.all)},signature:Z(this.signature),keyUsage:{ critical:this.keyUsage?.critical,usages:[...this.keyUsage?.usages??[]]},subjectAltNames:this. subjectAltNames,extKeyUsage:this.extKeyUsage,authorityKeyIdentifier:this.authorityKeyIdentifier&& -[...this.authorityKeyIdentifier],subjectKeyIdentifier:this.subjectKeyIdentifier&& -[...this.subjectKeyIdentifier],basicConstraints:this.basicConstraints,signedData:[ -...this.signedData]}}},gi=class extends _r{static{o(this,"st")}};async function Si(r,e,t,n,i){ -r.expectUint8(ie,0);let[s]=r.expectASN1Length(0);r.expectUint8(qt,0);let[a,u]=r. -expectASN1Length(0),c=r.readBytes(u());a(),r.expectUint8(qt,0);let[l,h]=r.expectASN1Length( -0),f=r.readBytes(h());l(),s();let y=o((v,C)=>v.length>C?v.subarray(v.length-C):v. -lengthnew this(t))}},mt=class extends Ir{static{ +a(this,"TrustedCert")}static databaseFromPEM(r){let e=this.uint8ArraysFromPEM(r), +t=[0],n={},i=new Qa;for(let o of e){let c=new this(o),u=t.length-1;c.subjectKeyIdentifier&& +(n[Z(c.subjectKeyIdentifier)]=u),n[this.stringFromDistinguishedName(c.subject)]= +u,i.append(o),t[t.length]=t[u]+o.length}let s=i.getData();return{index:{offsets:t, +subjects:n},data:s}}static findInDatabase(r,e){let{index:{subjects:t,offsets:n}, +data:i}=e,s=typeof r=="string"?r:Ir.stringFromDistinguishedName(r),o=t[s];if(o=== +void 0)return;let c=n[o],u=n[o+1],l=i.subarray(c,u);return new this(l)}};async function Ri(r,e,t,n,i){ +r.expectUint8(ae,0);let[s]=r.expectASN1Length(0);r.expectUint8(Qt,0);let[o,c]=r. +expectASN1Length(0),u=r.readBytes(c());o(),r.expectUint8(Qt,0);let[l,h]=r.expectASN1Length( +0),f=r.readBytes(h());l(),s();let g=a((A,S)=>A.length>S?A.subarray(A.length-S):A. +length_r.distinguishedNamesAreEqual(b.subject,l.issuer)):f=t.find(b=>b.subjectKeyIdentifier!== -void 0&&ut(b.subjectKeyIdentifier,h)),f===void 0&&(f=e[u+1]),f===void 0)throw new Error( -"Ran out of certificates before reaching trusted root");let y=f instanceof gi;if(f. +"End-user certificate has no TLS server extKeyUsage");let u=!1;for(let l=0,h=e.length;l< +h;l++){let f=e[l],g=f.authorityKeyIdentifier,p;if(g===void 0?p=mt.findInDatabase( +f.issuer,t):p=mt.findInDatabase(Z(g),t),p===void 0&&(p=e[l+1]),p===void 0)throw new Error( +"Ran out of certificates before reaching trusted root");let E=p instanceof mt;if(p. isValidAtMoment()!==!0)throw new Error("Signing certificate is not valid now");if(i&& -f.keyUsage?.usages.has("digitalSignature")!==!0)throw new Error("Signing certifi\ -cate keyUsage does not include digital signatures");if(f.basicConstraints?.ca!== +p.keyUsage?.usages.has("digitalSignature")!==!0)throw new Error("Signing certifi\ +cate keyUsage does not include digital signatures");if(p.basicConstraints?.ca!== !0)throw new Error("Signing certificate basicConstraints do not indicate a CA ce\ -rtificate");let{pathLength:m}=f.basicConstraints;if(m!==void 0&&m0;){let R=u. -readUint16(0);if(R===0)u.expectUint16(0,0);else if(R===10){let[k,ne]=u.expectLengthUint16( -"groups data");u.skip(ne(),0),k()}else throw new Error(`Unsupported server encry\ -pted extension type 0x${Te([R]).padStart(4,"0")}`)}l(),c(),u.remaining()===0&&u. -extend(await e());let f=!1,y=u.readUint8();if(y===13){f=!0;let[R]=u.expectLengthUint24( -"certificate request data");u.expectUint8(0,0);let[k,ne]=u.expectLengthUint16("c\ -ertificate request extensions");u.skip(ne(),0),k(),R(),u.remaining()===0&&u.extend( -await e()),y=u.readUint8()}if(y!==11)throw new Error(`Unexpected handshake messa\ -ge type 0x${Te([y])}`);let[m]=u.expectLengthUint24(0);u.expectUint8(0,0);let[b,U]=u. -expectLengthUint24(0),v=[];for(;U()>0;){let[R]=u.expectLengthUint24(0),k=new _r( -u);v.push(k),R();let[ne,ce]=u.expectLengthUint16(),Fe=u.subarray(ce());ne()}if(b(), -m(),v.length===0)throw new Error("No certificates supplied");let C=v[0],E=u.data. -subarray(0,u.offset),g=se(n,E),x=await O.digest("SHA-256",g),N=new Uint8Array(x), -P=se(Jo.encode(" ".repeat(64)+"TLS 1.3, server CertificateVerify"),[0],N);u.remaining()=== -0&&u.extend(await e()),u.expectUint8(15,0);let[D]=u.expectLengthUint24(0),q=u.readUint16(); -if(q===1027){let[R]=u.expectLengthUint16();await Si(u,C.publicKey.all,P,"P-256", -"SHA-256"),R()}else if(q===2052){let[R,k]=u.expectLengthUint16(),ne=u.subarray(k()); -R();let ce=await O.importKey("spki",C.publicKey.all,{name:"RSA-PSS",hash:"SHA-25\ -6"},!1,["verify"]);if(await O.verify({name:"RSA-PSS",saltLength:32},ce,ne,P)!==!0) -throw new Error("RSA-PSS-RSAE-SHA256 certificate verify failed")}else throw new Error( -`Unsupported certificate verify signature type 0x${Te([q]).padStart(4,"0")}`);D(); -let Z=u.data.subarray(0,u.offset),M=se(n,Z),$=await ae(t,"finished",new Uint8Array( -0),32,256),j=await O.digest("SHA-256",M),H=await O.importKey("raw",$,{name:"HMAC", -hash:{name:"SHA-256"}},!1,["sign"]),K=await O.sign("HMAC",H,j),J=new Uint8Array( -K);u.remaining()===0&&u.extend(await e()),u.expectUint8(20,0);let[F,Y]=u.expectLengthUint24( -0),W=u.readBytes(Y());if(F(),u.remaining()!==0)throw new Error("Unexpected extra\ - bytes in server handshake");if(ut(W,J)!==!0)throw new Error("Invalid server ver\ -ify hash");if(!await zo(r,v,i,s,a))throw new Error("Validated certificate chain \ -did not end in a trusted root");return[u.data,f]}o(Yo,"Vt");async function Zo(r,e,t,n,{ -useSNI:i,requireServerTlsExtKeyUsage:s,requireDigitalSigKeyUsage:a,writePreData:u, -expectPreData:c,commentPreData:l}={}){i??=!0,s??=!0,a??=!0;let h=await O.generateKey( -{name:"ECDH",namedCurve:"P-256"},!0,["deriveKey","deriveBits"]),f=await O.exportKey( -"raw",h.publicKey),y=new Uint8Array(32);A.getRandomValues(y);let m=Po(r,f,y,i).array(), -b=u?se(u,m):m;if(n(b),c){let re=await t(c.length);if(!re||!ut(re,c))throw new Error( -"Pre data did not match expectation")}let U=await xr(t,22);if(U===void 0)throw new Error( -"Connection closed while awaiting server hello");let v=new be(U.content),C=Bo(v, -y),E=await xr(t,20);if(E===void 0)throw new Error("Connection closed awaiting se\ -rver cipher change");let g=new be(E.content),[x]=g.expectLength(1);g.expectUint8( -1,0),x();let N=m.subarray(5),P=U.content,D=se(N,P),q=await Do(C,h.privateKey,D,256, -16),Z=await O.importKey("raw",q.serverHandshakeKey,{name:"AES-GCM"},!1,["decrypt"]), -M=new Nt("decrypt",Z,q.serverHandshakeIV),$=await O.importKey("raw",q.clientHandshakeKey, -{name:"AES-GCM"},!1,["encrypt"]),j=new Nt("encrypt",$,q.clientHandshakeIV),H=o(async()=>{ -let re=await Ar(t,M,22);if(re===void 0)throw new Error("Premature end of encrypt\ -ed server handshake");return re},"C"),[K,J]=await Yo(r,H,q.serverSecret,D,e,s,a), -F=new be(6);F.writeUint8(20,0),F.writeUint16(771,0);let Y=F.writeLengthUint16(); -F.writeUint8(1,0),Y();let W=F.array(),R=new Uint8Array(0);if(J){let re=new be(8); -re.writeUint8(11,0);let it=re.writeLengthUint24("client certificate data");re.writeUint8( -0,0),re.writeUint24(0,0),it(),R=re.array()}let k=se(D,K,R),ne=await O.digest("SH\ -A-256",k),ce=new Uint8Array(ne),Fe=await ae(q.clientSecret,"finished",new Uint8Array( -0),32,256),ar=await O.importKey("raw",Fe,{name:"HMAC",hash:{name:"SHA-256"}},!1, -["sign"]),or=await O.sign("HMAC",ar,ce),Fa=new Uint8Array(or),Lt=new be(36);Lt.writeUint8( -20,0);let Oa=Lt.writeLengthUint24(0);Lt.writeBytes(Fa),Oa();let ka=Lt.array(),On=await hi( -se(R,ka),j,22),kn=ce;if(R.length>0){let re=k.subarray(0,k.length-R.length),it=await O. -digest("SHA-256",re);kn=new Uint8Array(it)}let Ut=await qo(q.handshakeSecret,kn, -256,16),Qa=await O.importKey("raw",Ut.clientApplicationKey,{name:"AES-GCM"},!0,[ -"encrypt"]),$a=new Nt("encrypt",Qa,Ut.clientApplicationIV),ja=await O.importKey( -"raw",Ut.serverApplicationKey,{name:"AES-GCM"},!0,["decrypt"]),Ha=new Nt("decryp\ -t",ja,Ut.serverApplicationIV),It=!1;return[()=>{if(!It){let re=se(W,...On);n(re), -It=!0}return Ar(t,Ha)},async re=>{let it=It;It=!0;let Qn=await hi(re,$a,23),Ka=it? -se(...Qn):se(W,...On,...Qn);n(Ka)}]}o(Zo,"he");var Ei=class{static{o(this,"xt")}queue;outstandingRequest;constructor(){ -this.queue=[]}enqueue(r){this.queue.push(r),this.dequeue()}dequeue(){if(this.outstandingRequest=== +pported signing algorithm");if(E){u=!0;break}}return u}a(dc,"verifyCerts");var pc=new TextEncoder; +async function yc(r,e,t,n,i,s=!0,o=!0){let c=new yt(await e());c.expectUint8(8,0); +let[u]=c.expectLengthUint24(),[l,h]=c.expectLengthUint16(0);for(;h()>0;){let F=c. +readUint16(0);if(F===0)c.expectUint16(0,0);else if(F===10){let[X]=c.expectLengthUint16( +0),[fe,xe]=c.expectLengthUint16(0);for(;xe()>0;){let $e=c.readUint16()}fe(),X()}else +throw new Error(`Unsupported server encrypted extension type 0x${Z([F]).padStart( +4,"0")}`)}l(),u(),c.remaining()===0&&c.extend(await e());let f=!1,g=c.readUint8(); +if(g===13){f=!0;let[F]=c.expectLengthUint24("certificate request data");c.expectUint8( +0,0);let[X,fe]=c.expectLengthUint16("certificate request extensions");c.skip(fe(), +0),X(),F(),c.remaining()===0&&c.extend(await e()),g=c.readUint8()}if(g!==11)throw new Error( +`Unexpected handshake message type 0x${Z([g])}`);let[p]=c.expectLengthUint24(0); +c.expectUint8(0,0);let[E,C]=c.expectLengthUint24(0),v=[];for(;C()>0;){let[F]=c.expectLengthUint24( +0),X=new Ir(c);v.push(X),F();let[fe,xe]=c.expectLengthUint16("certificate extens\ +ions");c.skip(xe()),fe()}if(E(),p(),v.length===0)throw new Error("No certificate\ +s supplied");let A=v[0],S=c.data.subarray(0,c.offset),m=ce(n,S),x=await O.digest( +"SHA-256",m),N=new Uint8Array(x),_=ce(pc.encode(" ".repeat(64)+"TLS 1.3, server \ +CertificateVerify"),[0],N);c.remaining()===0&&c.extend(await e()),c.expectUint8( +15,0);let[D]=c.expectLengthUint24(0),Y=c.readUint16();if(Y===1027){let[F]=c.expectLengthUint16(); +await Ri(c,A.publicKey.all,_,"P-256","SHA-256"),F()}else if(Y===2052){let[F,X]=c. +expectLengthUint16(),fe=c.subarray(X());F();let xe=await O.importKey("spki",A.publicKey. +all,{name:"RSA-PSS",hash:"SHA-256"},!1,["verify"]);if(await O.verify({name:"RSA-\ +PSS",saltLength:32},xe,fe,_)!==!0)throw new Error("RSA-PSS-RSAE-SHA256 certifica\ +te verify failed")}else throw new Error(`Unsupported certificate verify signatur\ +e type 0x${Z([Y]).padStart(4,"0")}`);D();let te=c.data.subarray(0,c.offset),P=ce( +n,te),W=await ue(t,"finished",new Uint8Array(0),32,256),oe=await O.digest("SHA-2\ +56",P),ee=await O.importKey("raw",W,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sig\ +n"]),j=await O.sign("HMAC",ee,oe),H=new Uint8Array(j);c.remaining()===0&&c.extend( +await e()),c.expectUint8(20,0);let[Q,V]=c.expectLengthUint24(0),k=c.readBytes(V()); +if(Q(),c.remaining()!==0)throw new Error("Unexpected extra bytes in server hands\ +hake");if(Ht(k,H)!==!0)throw new Error("Invalid server verify hash");if(!await dc( +r,v,i,s,o))throw new Error("Validated certificate chain did not end in a trusted\ + root");return[c.data,f]}a(yc,"readEncryptedHandshake");async function mc(r,e,t,n,{ +useSNI:i,requireServerTlsExtKeyUsage:s,requireDigitalSigKeyUsage:o,writePreData:c, +expectPreData:u,commentPreData:l}={}){i??(i=!0),s??(s=!0),o??(o=!0),typeof e=="s\ +tring"&&(e=mt.databaseFromPEM(e));let h=await O.generateKey({name:"ECDH",namedCurve:"\ +P-256"},!0,["deriveKey","deriveBits"]),f=await O.exportKey("raw",h.publicKey),g=new Uint8Array( +f),p=new Uint8Array(32);await Ai(p);let C=(await ja(r,g,p,i)).array(),v=c?ce(c,C): +C;if(n(v),u){let re=await t(u.length);if(!re||!Ht(re,u))throw new Error("Pre dat\ +a did not match expectation")}let A=await Tr(t,22);if(A===void 0)throw new Error( +"Connection closed while awaiting server hello");let S=new Ce(A.content),m=Ka(S, +p),x=await Tr(t,20);if(x===void 0)throw new Error("Connection closed awaiting se\ +rver cipher change");let N=new Ce(x.content),[_]=N.expectLength(1);N.expectUint8( +1,0),_();let D=C.subarray(5),Y=A.content,te=ce(D,Y),P=await Ya(m,h.privateKey,te, +256,16),W=await O.importKey("raw",P.serverHandshakeKey,{name:"AES-GCM"},!1,["dec\ +rypt"]),oe=new Ot("decrypt",W,P.serverHandshakeIV),ee=await O.importKey("raw",P. +clientHandshakeKey,{name:"AES-GCM"},!1,["encrypt"]),j=new Ot("encrypt",ee,P.clientHandshakeIV), +H=a(async()=>{let re=await Rr(t,oe,22);if(re===void 0)throw new Error("Premature\ + end of encrypted server handshake");return re},"readHandshakeRecord"),[Q,V]=await yc( +r,H,P.serverSecret,te,e,s,o),k=new Ce(6);k.writeUint8(20,0),k.writeUint16(771,0); +let q=k.writeLengthUint16();k.writeUint8(1,0),q();let M=k.array(),F=new Uint8Array( +0);if(V){let re=new Ce(8);re.writeUint8(11,0);let at=re.writeLengthUint24("clien\ +t certificate data");re.writeUint8(0,0),re.writeUint24(0,0),at(),F=re.array()}let X=ce( +te,Q,F),fe=await O.digest("SHA-256",X),xe=new Uint8Array(fe),$e=await ue(P.clientSecret, +"finished",new Uint8Array(0),32,256),hr=await O.importKey("raw",$e,{name:"HMAC", +hash:{name:"SHA-256"}},!1,["sign"]),Hn=await O.sign("HMAC",hr,xe),jo=new Uint8Array( +Hn),Nt=new Ce(36);Nt.writeUint8(20,0);let Ko=Nt.writeLengthUint24(0);Nt.writeBytes( +jo),Ko();let Wo=Nt.array(),$n=await wi(ce(F,Wo),j,22),jn=xe;if(F.length>0){let re=X. +subarray(0,X.length-F.length),at=await O.digest("SHA-256",re);jn=new Uint8Array( +at)}let Mt=await Za(P.handshakeSecret,jn,256,16),Vo=await O.importKey("raw",Mt.clientApplicationKey, +{name:"AES-GCM"},!0,["encrypt"]),Go=new Ot("encrypt",Vo,Mt.clientApplicationIV), +zo=await O.importKey("raw",Mt.serverApplicationKey,{name:"AES-GCM"},!0,["decrypt"]), +Jo=new Ot("decrypt",zo,Mt.serverApplicationIV),Ft=!1;return[a(()=>{if(!Ft){let re=ce( +M,...$n);n(re),Ft=!0}return Rr(t,Jo)},"read"),a(async re=>{let at=Ft;Ft=!0;let Kn=await wi( +re,Go,23),Yo=at?ce(...Kn):ce(M,...$n,...Kn);n(Yo)},"write")]}a(mc,"startTls");var Ui=class{static{ +a(this,"ReadQueue")}constructor(){K(this,"queue"),K(this,"outstandingRequest"),this. +queue=[]}enqueue(r){this.queue.push(r),this.dequeue()}dequeue(){if(this.outstandingRequest=== void 0)return;let{resolve:r,bytes:e}=this.outstandingRequest,t=this.bytesInQueue(); if(te)return this.queue[0]=n.subarray(e),r(n.subarray(0,e)); -{let s=new Uint8Array(e),a=e,u=0;for(;a>0;){let c=this.queue[0],l=c.length;l<=a? -(this.queue.shift(),s.set(c,u),u+=l,a-=l):(this.queue[0]=c.subarray(a),s.set(c.subarray( -0,a),u),a-=a,u+=a)}return r(s)}}bytesInQueue(){return this.queue.reduce((r,e)=>r+ +{let s=new Uint8Array(e),o=e,c=0;for(;o>0;){let u=this.queue[0],l=u.length;l<=o? +(this.queue.shift(),s.set(u,c),c+=l,o-=l):(this.queue[0]=u.subarray(o),s.set(u.subarray( +0,o),c),o-=o,c+=o)}return r(s)}}bytesInQueue(){return this.queue.reduce((r,e)=>r+ e.length,0)}async read(r){if(this.outstandingRequest!==void 0)throw new Error("C\ an\u2019t read while already awaiting read");return new Promise(e=>{this.outstandingRequest= -{resolve:e,bytes:r},this.dequeue()})}},Xo=class extends Ei{static{o(this,"vt")}constructor(r){ -super(),this.socket=r,r.addEventListener("message",e=>this.enqueue(new Uint8Array( -e.data))),r.addEventListener("close",()=>this.dequeue())}socketIsNotClosed(){let{ -socket:r}=this,{readyState:e}=r;return e<=1}},eu=class extends Ei{static{o(this, -"Lt")}constructor(r){super(),this.socket=r,r.on("data",e=>this.enqueue(new Uint8Array( -e))),r.on("close",()=>this.dequeue())}socketIsNotClosed(){let{socket:r}=this,{readyState:e}=r; -return e==="opening"||e==="open"}};var bi=`-----BEGIN CERTIFICATE----- +{resolve:e,bytes:r},this.dequeue()})}},gc=class extends Ui{static{a(this,"WebSoc\ +ketReadQueue")}constructor(r){super(),this.socket=r,r.addEventListener("message", +e=>this.enqueue(new Uint8Array(e.data))),r.addEventListener("close",()=>this.dequeue())}socketIsNotClosed(){ +let{socket:r}=this,{readyState:e}=r;return e<=1}},wc=class extends Ui{static{a(this, +"SocketReadQueue")}constructor(r){super(),this.socket=r,r.on("data",e=>this.enqueue( +new Uint8Array(e))),r.on("close",()=>this.dequeue())}socketIsNotClosed(){let{socket:r}=this, +{readyState:e}=r;return e==="opening"||e==="open"}};function Sc(r,e=(n,i)=>i,t){ +return JSON.stringify(r,a((i,s)=>e(i,typeof s!="object"||s===null||Array.isArray( +s)?s:Object.fromEntries(Object.entries(s).sort(([o],[c])=>oc?1:0))),"det\ +erministicReplacer"),t)}a(Sc,"stableStringify");var Ii=`-----BEGIN CERTIFICATE----- MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4 @@ -1928,127 +1996,136 @@ oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc= -----END CERTIFICATE----- -`;p();var ru=Object.getOwnPropertyNames,nu=Object.getOwnPropertySymbols,iu=Object.prototype. -hasOwnProperty;function xi(r,e){return o(function(n,i,s){return r(n,i,s)&&e(n,i, -s)},"isEqual")}o(xi,"combineComparators");function Ft(r){return o(function(t,n,i){ +`;y();var Ec=Object.getOwnPropertyNames,xc=Object.getOwnPropertySymbols,Ac=Object.prototype. +hasOwnProperty;function Li(r,e){return a(function(n,i,s){return r(n,i,s)&&e(n,i, +s)},"isEqual")}a(Li,"combineComparators");function $t(r){return a(function(t,n,i){ if(!t||!n||typeof t!="object"||typeof n!="object")return r(t,n,i);var s=i.cache, -a=s.get(t),u=s.get(n);if(a&&u)return a===n&&u===t;s.set(t,n),s.set(n,t);var c=r( -t,n,i);return s.delete(t),s.delete(n),c},"isCircular")}o(Ft,"createIsCircular"); -function Ai(r){return ru(r).concat(nu(r))}o(Ai,"getStrictProperties");var Ii=Object. -hasOwn||function(r,e){return iu.call(r,e)};function We(r,e){return r||e?r===e:r=== -e||r!==r&&e!==e}o(We,"sameValueZeroEqual");var Pi="_owner",vi=Object.getOwnPropertyDescriptor, -Ci=Object.keys;function su(r,e,t){var n=r.length;if(e.length!==n)return!1;for(;n-- > -0;)if(!t.equals(r[n],e[n],n,n,r,e,t))return!1;return!0}o(su,"areArraysEqual");function au(r,e){ -return We(r.getTime(),e.getTime())}o(au,"areDatesEqual");function _i(r,e,t){if(r. -size!==e.size)return!1;for(var n={},i=r.entries(),s=0,a,u;(a=i.next())&&!a.done;){ -for(var c=e.entries(),l=!1,h=0;(u=c.next())&&!u.done;){var f=a.value,y=f[0],m=f[1], -b=u.value,U=b[0],v=b[1];!l&&!n[h]&&(l=t.equals(y,U,s,h,r,e,t)&&t.equals(m,v,y,U, -r,e,t))&&(n[h]=!0),h++}if(!l)return!1;s++}return!0}o(_i,"areMapsEqual");function ou(r,e,t){ -var n=Ci(r),i=n.length;if(Ci(e).length!==i)return!1;for(var s;i-- >0;)if(s=n[i], -s===Pi&&(r.$$typeof||e.$$typeof)&&r.$$typeof!==e.$$typeof||!Ii(e,s)||!t.equals(r[s], -e[s],s,s,r,e,t))return!1;return!0}o(ou,"areObjectsEqual");function ct(r,e,t){var n=Ai( -r),i=n.length;if(Ai(e).length!==i)return!1;for(var s,a,u;i-- >0;)if(s=n[i],s===Pi&& -(r.$$typeof||e.$$typeof)&&r.$$typeof!==e.$$typeof||!Ii(e,s)||!t.equals(r[s],e[s], -s,s,r,e,t)||(a=vi(r,s),u=vi(e,s),(a||u)&&(!a||!u||a.configurable!==u.configurable|| -a.enumerable!==u.enumerable||a.writable!==u.writable)))return!1;return!0}o(ct,"a\ -reObjectsEqualStrict");function uu(r,e){return We(r.valueOf(),e.valueOf())}o(uu, -"arePrimitiveWrappersEqual");function cu(r,e){return r.source===e.source&&r.flags=== -e.flags}o(cu,"areRegExpsEqual");function Ti(r,e,t){if(r.size!==e.size)return!1;for(var n={}, -i=r.values(),s,a;(s=i.next())&&!s.done;){for(var u=e.values(),c=!1,l=0;(a=u.next())&& -!a.done;)!c&&!n[l]&&(c=t.equals(s.value,a.value,s.value,a.value,r,e,t))&&(n[l]=!0), -l++;if(!c)return!1}return!0}o(Ti,"areSetsEqual");function lu(r,e){var t=r.length; -if(e.length!==t)return!1;for(;t-- >0;)if(r[t]!==e[t])return!1;return!0}o(lu,"are\ -TypedArraysEqual");var hu="[object Arguments]",fu="[object Boolean]",du="[object\ - Date]",pu="[object Map]",yu="[object Number]",wu="[object Object]",mu="[object \ -RegExp]",gu="[object Set]",Su="[object String]",Eu=Array.isArray,Li=typeof ArrayBuffer== -"function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Ui=Object.assign,bu=Object. -prototype.toString.call.bind(Object.prototype.toString);function xu(r){var e=r.areArraysEqual, -t=r.areDatesEqual,n=r.areMapsEqual,i=r.areObjectsEqual,s=r.arePrimitiveWrappersEqual, -a=r.areRegExpsEqual,u=r.areSetsEqual,c=r.areTypedArraysEqual;return o(function(h,f,y){ -if(h===f)return!0;if(h==null||f==null||typeof h!="object"||typeof f!="object")return h!== -h&&f!==f;var m=h.constructor;if(m!==f.constructor)return!1;if(m===Object)return i( -h,f,y);if(Eu(h))return e(h,f,y);if(Li!=null&&Li(h))return c(h,f,y);if(m===Date)return t( -h,f,y);if(m===RegExp)return a(h,f,y);if(m===Map)return n(h,f,y);if(m===Set)return u( -h,f,y);var b=bu(h);return b===du?t(h,f,y):b===mu?a(h,f,y):b===pu?n(h,f,y):b===gu? -u(h,f,y):b===wu?typeof h.then!="function"&&typeof f.then!="function"&&i(h,f,y):b=== -hu?i(h,f,y):b===fu||b===yu||b===Su?s(h,f,y):!1},"comparator")}o(xu,"createEquali\ -tyComparator");function Au(r){var e=r.circular,t=r.createCustomConfig,n=r.strict, -i={areArraysEqual:n?ct:su,areDatesEqual:au,areMapsEqual:n?xi(_i,ct):_i,areObjectsEqual:n? -ct:ou,arePrimitiveWrappersEqual:uu,areRegExpsEqual:cu,areSetsEqual:n?xi(Ti,ct):Ti, -areTypedArraysEqual:n?ct:lu};if(t&&(i=Ui({},i,t(i))),e){var s=Ft(i.areArraysEqual), -a=Ft(i.areMapsEqual),u=Ft(i.areObjectsEqual),c=Ft(i.areSetsEqual);i=Ui({},i,{areArraysEqual:s, -areMapsEqual:a,areObjectsEqual:u,areSetsEqual:c})}return i}o(Au,"createEqualityC\ -omparatorConfig");function vu(r){return function(e,t,n,i,s,a,u){return r(e,t,u)}} -o(vu,"createInternalEqualityComparator");function Cu(r){var e=r.circular,t=r.comparator, -n=r.createState,i=r.equals,s=r.strict;if(n)return o(function(c,l){var h=n(),f=h. -cache,y=f===void 0?e?new WeakMap:void 0:f,m=h.meta;return t(c,l,{cache:y,equals:i, -meta:m,strict:s})},"isEqual");if(e)return o(function(c,l){return t(c,l,{cache:new WeakMap, -equals:i,meta:void 0,strict:s})},"isEqual");var a={cache:void 0,equals:i,meta:void 0, -strict:s};return o(function(c,l){return t(c,l,a)},"isEqual")}o(Cu,"createIsEqual"); -var Lr=Le(),ef=Le({strict:!0}),tf=Le({circular:!0}),rf=Le({circular:!0,strict:!0}), -nf=Le({createInternalComparator:o(function(){return We},"createInternalComparato\ -r")}),sf=Le({strict:!0,createInternalComparator:o(function(){return We},"createI\ -nternalComparator")}),af=Le({circular:!0,createInternalComparator:o(function(){return We}, -"createInternalComparator")}),of=Le({circular:!0,createInternalComparator:o(function(){ -return We},"createInternalComparator"),strict:!0});function Le(r){r===void 0&&(r= -{});var e=r.circular,t=e===void 0?!1:e,n=r.createInternalComparator,i=r.createState, -s=r.strict,a=s===void 0?!1:s,u=Au(r),c=xu(u),l=n?n(c):vu(c);return Cu({circular:t, -comparator:c,createState:i,equals:l,strict:a})}o(Le,"createCustomEqual");p();var sr=Oe(ir());Jt();p();Jt();rn();var Na=Oe(bt()),Ma=Oe(Vt());function Ch(r){return r instanceof w?"\\x"+r.toString("hex"):r}o(Ch,"encodeBuffe\ -rsAsBytea");var Ce=class r extends Error{static{o(this,"NeonDbError")}name="Neon\ +o=s.get(t),c=s.get(n);if(o&&c)return o===n&&c===t;s.set(t,n),s.set(n,t);var u=r( +t,n,i);return s.delete(t),s.delete(n),u},"isCircular")}a($t,"createIsCircular"); +function _i(r){return Ec(r).concat(xc(r))}a(_i,"getStrictProperties");var vc=Object. +hasOwn||function(r,e){return Ac.call(r,e)};function Qe(r,e){return r===e||!r&&!e&& +r!==r&&e!==e}a(Qe,"sameValueZeroEqual");var Cc="__v",Tc="__o",Rc="_owner",Pi=Object. +getOwnPropertyDescriptor,Bi=Object.keys;function Uc(r,e,t){var n=r.length;if(e.length!== +n)return!1;for(;n-- >0;)if(!t.equals(r[n],e[n],n,n,r,e,t))return!1;return!0}a(Uc, +"areArraysEqual");function Ic(r,e){return Qe(r.getTime(),e.getTime())}a(Ic,"areD\ +atesEqual");function Lc(r,e){return r.name===e.name&&r.message===e.message&&r.cause=== +e.cause&&r.stack===e.stack}a(Lc,"areErrorsEqual");function _c(r,e){return r===e} +a(_c,"areFunctionsEqual");function Ni(r,e,t){var n=r.size;if(n!==e.size)return!1; +if(!n)return!0;for(var i=new Array(n),s=r.entries(),o,c,u=0;(o=s.next())&&!o.done;){ +for(var l=e.entries(),h=!1,f=0;(c=l.next())&&!c.done;){if(i[f]){f++;continue}var g=o. +value,p=c.value;if(t.equals(g[0],p[0],u,f,r,e,t)&&t.equals(g[1],p[1],g[0],p[0],r, +e,t)){h=i[f]=!0;break}f++}if(!h)return!1;u++}return!0}a(Ni,"areMapsEqual");var Pc=Qe; +function Bc(r,e,t){var n=Bi(r),i=n.length;if(Bi(e).length!==i)return!1;for(;i-- > +0;)if(!ki(r,e,t,n[i]))return!1;return!0}a(Bc,"areObjectsEqual");function gt(r,e,t){ +var n=_i(r),i=n.length;if(_i(e).length!==i)return!1;for(var s,o,c;i-- >0;)if(s=n[i], +!ki(r,e,t,s)||(o=Pi(r,s),c=Pi(e,s),(o||c)&&(!o||!c||o.configurable!==c.configurable|| +o.enumerable!==c.enumerable||o.writable!==c.writable)))return!1;return!0}a(gt,"a\ +reObjectsEqualStrict");function Nc(r,e){return Qe(r.valueOf(),e.valueOf())}a(Nc, +"arePrimitiveWrappersEqual");function Mc(r,e){return r.source===e.source&&r.flags=== +e.flags}a(Mc,"areRegExpsEqual");function Mi(r,e,t){var n=r.size;if(n!==e.size)return!1; +if(!n)return!0;for(var i=new Array(n),s=r.values(),o,c;(o=s.next())&&!o.done;){for(var u=e. +values(),l=!1,h=0;(c=u.next())&&!c.done;){if(!i[h]&&t.equals(o.value,c.value,o.value, +c.value,r,e,t)){l=i[h]=!0;break}h++}if(!l)return!1}return!0}a(Mi,"areSetsEqual"); +function Fc(r,e){var t=r.length;if(e.length!==t)return!1;for(;t-- >0;)if(r[t]!== +e[t])return!1;return!0}a(Fc,"areTypedArraysEqual");function qc(r,e){return r.hostname=== +e.hostname&&r.pathname===e.pathname&&r.protocol===e.protocol&&r.port===e.port&&r. +hash===e.hash&&r.username===e.username&&r.password===e.password}a(qc,"areUrlsEqu\ +al");function ki(r,e,t,n){return(n===Rc||n===Tc||n===Cc)&&(r.$$typeof||e.$$typeof)? +!0:vc(e,n)&&t.equals(r[n],e[n],n,n,r,e,t)}a(ki,"isPropertyEqual");var kc="[objec\ +t Arguments]",Dc="[object Boolean]",Oc="[object Date]",Qc="[object Error]",Hc="[\ +object Map]",$c="[object Number]",jc="[object Object]",Kc="[object RegExp]",Wc="\ +[object Set]",Vc="[object String]",Gc="[object URL]",zc=Array.isArray,Fi=typeof ArrayBuffer== +"function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,qi=Object.assign,Jc=Object. +prototype.toString.call.bind(Object.prototype.toString);function Yc(r){var e=r.areArraysEqual, +t=r.areDatesEqual,n=r.areErrorsEqual,i=r.areFunctionsEqual,s=r.areMapsEqual,o=r. +areNumbersEqual,c=r.areObjectsEqual,u=r.arePrimitiveWrappersEqual,l=r.areRegExpsEqual, +h=r.areSetsEqual,f=r.areTypedArraysEqual,g=r.areUrlsEqual;return a(function(E,C,v){ +if(E===C)return!0;if(E==null||C==null)return!1;var A=typeof E;if(A!==typeof C)return!1; +if(A!=="object")return A==="number"?o(E,C,v):A==="function"?i(E,C,v):!1;var S=E. +constructor;if(S!==C.constructor)return!1;if(S===Object)return c(E,C,v);if(zc(E)) +return e(E,C,v);if(Fi!=null&&Fi(E))return f(E,C,v);if(S===Date)return t(E,C,v);if(S=== +RegExp)return l(E,C,v);if(S===Map)return s(E,C,v);if(S===Set)return h(E,C,v);var m=Jc( +E);return m===Oc?t(E,C,v):m===Kc?l(E,C,v):m===Hc?s(E,C,v):m===Wc?h(E,C,v):m===jc? +typeof E.then!="function"&&typeof C.then!="function"&&c(E,C,v):m===Gc?g(E,C,v):m=== +Qc?n(E,C,v):m===kc?c(E,C,v):m===Dc||m===$c||m===Vc?u(E,C,v):!1},"comparator")}a( +Yc,"createEqualityComparator");function Zc(r){var e=r.circular,t=r.createCustomConfig, +n=r.strict,i={areArraysEqual:n?gt:Uc,areDatesEqual:Ic,areErrorsEqual:Lc,areFunctionsEqual:_c, +areMapsEqual:n?Li(Ni,gt):Ni,areNumbersEqual:Pc,areObjectsEqual:n?gt:Bc,arePrimitiveWrappersEqual:Nc, +areRegExpsEqual:Mc,areSetsEqual:n?Li(Mi,gt):Mi,areTypedArraysEqual:n?gt:Fc,areUrlsEqual:qc}; +if(t&&(i=qi({},i,t(i))),e){var s=$t(i.areArraysEqual),o=$t(i.areMapsEqual),c=$t( +i.areObjectsEqual),u=$t(i.areSetsEqual);i=qi({},i,{areArraysEqual:s,areMapsEqual:o, +areObjectsEqual:c,areSetsEqual:u})}return i}a(Zc,"createEqualityComparatorConfig"); +function Xc(r){return function(e,t,n,i,s,o,c){return r(e,t,c)}}a(Xc,"createInter\ +nalEqualityComparator");function eu(r){var e=r.circular,t=r.comparator,n=r.createState, +i=r.equals,s=r.strict;if(n)return a(function(u,l){var h=n(),f=h.cache,g=f===void 0? +e?new WeakMap:void 0:f,p=h.meta;return t(u,l,{cache:g,equals:i,meta:p,strict:s})}, +"isEqual");if(e)return a(function(u,l){return t(u,l,{cache:new WeakMap,equals:i, +meta:void 0,strict:s})},"isEqual");var o={cache:void 0,equals:i,meta:void 0,strict:s}; +return a(function(u,l){return t(u,l,o)},"isEqual")}a(eu,"createIsEqual");var Pr=Be(), +Of=Be({strict:!0}),Qf=Be({circular:!0}),Hf=Be({circular:!0,strict:!0}),$f=Be({createInternalComparator:a( +function(){return Qe},"createInternalComparator")}),jf=Be({strict:!0,createInternalComparator:a( +function(){return Qe},"createInternalComparator")}),Kf=Be({circular:!0,createInternalComparator:a( +function(){return Qe},"createInternalComparator")}),Wf=Be({circular:!0,createInternalComparator:a( +function(){return Qe},"createInternalComparator"),strict:!0});function Be(r){r=== +void 0&&(r={});var e=r.circular,t=e===void 0?!1:e,n=r.createInternalComparator,i=r. +createState,s=r.strict,o=s===void 0?!1:s,c=Zc(r),u=Yc(c),l=n?n(u):Xc(u);return eu( +{circular:t,comparator:u,createState:i,equals:l,strict:o})}a(Be,"createCustomEqu\ +al");y();var lr=je(ur());tr();y();tr();sn();var Oo=je(Rt()),Qo=je(Xt());function Yh(r){return r instanceof w?"\\x"+r.toString("hex"):r}a(Yh,"encodeBuffe\ +rsAsBytea");var Ie=class r extends Error{static{a(this,"NeonDbError")}name="Neon\ DbError";severity;code;detail;hint;position;internalPosition;internalQuery;where;schema;table;column;dataType;constraint;file;line;routine;sourceError;constructor(e){ super(e),"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&& -Error.captureStackTrace(this,r)}},Ba="transaction() expects an array of queries,\ - or a function returning an array of queries",_h=["severity","code","detail","hi\ +Error.captureStackTrace(this,r)}},ko="transaction() expects an array of queries,\ + or a function returning an array of queries",Zh=["severity","code","detail","hi\ nt","position","internalPosition","internalQuery","where","schema","table","colu\ -mn","dataType","constraint","file","line","routine"];function xe(r,{arrayMode:e, -fullResults:t,fetchOptions:n,isolationLevel:i,readOnly:s,deferrable:a,queryCallback:u, -resultCallback:c,authToken:l}={}){if(!r)throw new Error("No database connection \ +mn","dataType","constraint","file","line","routine"];function Te(r,{arrayMode:e, +fullResults:t,fetchOptions:n,isolationLevel:i,readOnly:s,deferrable:o,queryCallback:c, +resultCallback:u,authToken:l}={}){if(!r)throw new Error("No database connection \ string was provided to `neon()`. Perhaps an environment variable has not been se\ -t?");let h;try{h=tn(r)}catch{throw new Error("Database connection string provide\ +t?");let h;try{h=nn(r)}catch{throw new Error("Database connection string provide\ d to `neon()` is not a valid URL. Connection string: "+String(r))}let{protocol:f, -username:y,hostname:m,port:b,pathname:U}=h;if(f!=="postgres:"&&f!=="postgresql:"|| -!y||!m||!U)throw new Error("Database connection string format for `neon()` shoul\ -d be: postgresql://user:password@host.tld/dbname?option=value");function v(E,...g){ -let x,N;if(typeof E=="string")x=E,N=g[1],g=g[0]??[];else{x="";for(let D=0;DCh((0,Na.prepareValue)(D)));let P={ -query:x,params:g};return u&&u(P),Th(C,P,N)}o(v,"resolve"),v.transaction=async(E,g)=>{ -if(typeof E=="function"&&(E=E(v)),!Array.isArray(E))throw new Error(Ba);E.forEach( -P=>{if(P[Symbol.toStringTag]!=="NeonQueryPromise")throw new Error(Ba)});let x=E. -map(P=>P.parameterizedQuery),N=E.map(P=>P.opts??{});return C(x,N,g)};async function C(E,g,x){ -let{fetchEndpoint:N,fetchFunction:P}=ge,D=Array.isArray(E)?{queries:E}:E,q=n??{}, -Z=e??!1,M=t??!1,$=i,j=s,H=a;x!==void 0&&(x.fetchOptions!==void 0&&(q={...q,...x. -fetchOptions}),x.arrayMode!==void 0&&(Z=x.arrayMode),x.fullResults!==void 0&&(M= -x.fullResults),x.isolationLevel!==void 0&&($=x.isolationLevel),x.readOnly!==void 0&& -(j=x.readOnly),x.deferrable!==void 0&&(H=x.deferrable)),g!==void 0&&!Array.isArray( -g)&&g.fetchOptions!==void 0&&(q={...q,...g.fetchOptions});let K=l;!Array.isArray( -g)&&g?.authToken!==void 0&&(K=g.authToken);let J=typeof N=="function"?N(m,b,{jwtAuth:K!== -void 0}):N,F={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"true","Neon-Arr\ -ay-Mode":"true"},Y=await Lh(K);Y&&(F.Authorization=`Bearer ${Y}`),Array.isArray( -E)&&($!==void 0&&(F["Neon-Batch-Isolation-Level"]=$),j!==void 0&&(F["Neon-Batch-\ -Read-Only"]=String(j)),H!==void 0&&(F["Neon-Batch-Deferrable"]=String(H)));let W; -try{W=await(P??fetch)(J,{method:"POST",body:JSON.stringify(D),headers:F,...q})}catch(R){ -let k=new Ce(`Error connecting to database: ${R.message}`);throw k.sourceError=R, -k}if(W.ok){let R=await W.json();if(Array.isArray(E)){let k=R.results;if(!Array.isArray( -k))throw new Ce("Neon internal error: unexpected result format");return k.map((ne,ce)=>{ -let Fe=g[ce]??{},ar=Fe.arrayMode??Z,or=Fe.fullResults??M;return Ra(ne,{arrayMode:ar, -fullResults:or,parameterizedQuery:E[ce],resultCallback:c,types:Fe.types})})}else{ -let k=g??{},ne=k.arrayMode??Z,ce=k.fullResults??M;return Ra(R,{arrayMode:ne,fullResults:ce, -parameterizedQuery:E,resultCallback:c,types:k.types})}}else{let{status:R}=W;if(R=== -400){let k=await W.json(),ne=new Ce(k.message);for(let ce of _h)ne[ce]=k[ce]??void 0; -throw ne}else{let k=await W.text();throw new Ce(`Server error (HTTP status ${R})\ -: ${k}`)}}}return o(C,"execute"),v}o(xe,"neon");function Th(r,e,t){return{[Symbol. -toStringTag]:"NeonQueryPromise",parameterizedQuery:e,opts:t,then:o((n,i)=>r(e,t). -then(n,i),"then"),catch:o(n=>r(e,t).catch(n),"catch"),finally:o(n=>r(e,t).finally( -n),"finally")}}o(Th,"createNeonQueryPromise");function Ra(r,{arrayMode:e,fullResults:t, -parameterizedQuery:n,resultCallback:i,types:s}){let a=new Ma.default(s),u=r.fields. -map(h=>h.name),c=r.fields.map(h=>a.getTypeParser(h.dataTypeID)),l=e===!0?r.rows. -map(h=>h.map((f,y)=>f===null?null:c[y](f))):r.rows.map(h=>Object.fromEntries(h.map( -(f,y)=>[u[y],f===null?null:c[y](f)])));return i&&i(n,r,l,{arrayMode:e,fullResults:t}), -t?(r.viaNeonFetch=!0,r.rowAsArray=e,r.rows=l,r._parsers=c,r._types=a,r):l}o(Ra,"\ -processQueryResult");async function Lh(r){if(typeof r=="string")return r;if(typeof r== -"function")try{return await Promise.resolve(r())}catch(e){let t=new Ce("Error ge\ -tting auth token.");throw e instanceof Error&&(t=new Ce(`Error getting auth toke\ -n: ${e.message}`)),t}}o(Lh,"getAuthToken");var Da=Oe(zt()),rt=Oe(ir());var Be=class extends sr.Client{constructor(t){super(t);this.config=t}static{o(this, +username:g,hostname:p,port:E,pathname:C}=h;if(f!=="postgres:"&&f!=="postgresql:"|| +!g||!p||!C)throw new Error("Database connection string format for `neon()` shoul\ +d be: postgresql://user:password@host.tld/dbname?option=value");function v(S,...m){ +let x,N;if(typeof S=="string")x=S,N=m[1],m=m[0]??[];else{x="";for(let D=0;DYh((0,Oo.prepareValue)(D)));let _={ +query:x,params:m};return c&&c(_),Xh(A,_,N)}a(v,"resolve"),v.transaction=async(S,m)=>{ +if(typeof S=="function"&&(S=S(v)),!Array.isArray(S))throw new Error(ko);S.forEach( +_=>{if(_[Symbol.toStringTag]!=="NeonQueryPromise")throw new Error(ko)});let x=S. +map(_=>_.parameterizedQuery),N=S.map(_=>_.opts??{});return A(x,N,m)};async function A(S,m,x){ +let{fetchEndpoint:N,fetchFunction:_}=Ee,D=Array.isArray(S)?{queries:S}:S,Y=n??{}, +te=e??!1,P=t??!1,W=i,oe=s,ee=o;x!==void 0&&(x.fetchOptions!==void 0&&(Y={...Y,...x. +fetchOptions}),x.arrayMode!==void 0&&(te=x.arrayMode),x.fullResults!==void 0&&(P= +x.fullResults),x.isolationLevel!==void 0&&(W=x.isolationLevel),x.readOnly!==void 0&& +(oe=x.readOnly),x.deferrable!==void 0&&(ee=x.deferrable)),m!==void 0&&!Array.isArray( +m)&&m.fetchOptions!==void 0&&(Y={...Y,...m.fetchOptions});let j=l;!Array.isArray( +m)&&m?.authToken!==void 0&&(j=m.authToken);let H=typeof N=="function"?N(p,E,{jwtAuth:j!== +void 0}):N,Q={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"true","Neon-Arr\ +ay-Mode":"true"},V=await ef(j);V&&(Q.Authorization=`Bearer ${V}`),Array.isArray( +S)&&(W!==void 0&&(Q["Neon-Batch-Isolation-Level"]=W),oe!==void 0&&(Q["Neon-Batch\ +-Read-Only"]=String(oe)),ee!==void 0&&(Q["Neon-Batch-Deferrable"]=String(ee)));let k; +try{k=await(_??fetch)(H,{method:"POST",body:JSON.stringify(D),headers:Q,...Y})}catch(q){ +let M=new Ie(`Error connecting to database: ${q}`);throw M.sourceError=q,M}if(k. +ok){let q=await k.json();if(Array.isArray(S)){let M=q.results;if(!Array.isArray( +M))throw new Ie("Neon internal error: unexpected result format");return M.map((F,X)=>{ +let fe=m[X]??{},xe=fe.arrayMode??te,$e=fe.fullResults??P;return Do(F,{arrayMode:xe, +fullResults:$e,parameterizedQuery:S[X],resultCallback:u,types:fe.types})})}else{ +let M=m??{},F=M.arrayMode??te,X=M.fullResults??P;return Do(q,{arrayMode:F,fullResults:X, +parameterizedQuery:S,resultCallback:u,types:M.types})}}else{let{status:q}=k;if(q=== +400){let M=await k.json(),F=new Ie(M.message);for(let X of Zh)F[X]=M[X]??void 0; +throw F}else{let M=await k.text();throw new Ie(`Server error (HTTP status ${q}):\ + ${M}`)}}}return a(A,"execute"),v}a(Te,"neon");function Xh(r,e,t){return{[Symbol. +toStringTag]:"NeonQueryPromise",parameterizedQuery:e,opts:t,then:a((n,i)=>r(e,t). +then(n,i),"then"),catch:a(n=>r(e,t).catch(n),"catch"),finally:a(n=>r(e,t).finally( +n),"finally")}}a(Xh,"createNeonQueryPromise");function Do(r,{arrayMode:e,fullResults:t, +parameterizedQuery:n,resultCallback:i,types:s}){let o=new Qo.default(s),c=r.fields. +map(h=>h.name),u=r.fields.map(h=>o.getTypeParser(h.dataTypeID)),l=e===!0?r.rows. +map(h=>h.map((f,g)=>f===null?null:u[g](f))):r.rows.map(h=>Object.fromEntries(h.map( +(f,g)=>[c[g],f===null?null:u[g](f)])));return i&&i(n,r,l,{arrayMode:e,fullResults:t}), +t?(r.viaNeonFetch=!0,r.rowAsArray=e,r.rows=l,r._parsers=u,r._types=o,r):l}a(Do,"\ +processQueryResult");async function ef(r){if(typeof r=="string")return r;if(typeof r== +"function")try{return await Promise.resolve(r())}catch(e){let t=new Ie("Error ge\ +tting auth token.");throw e instanceof Error&&(t=new Ie(`Error getting auth toke\ +n: ${e.message}`)),t}}a(ef,"getAuthToken");var Ho=je(er()),Qn=je(ur());var qe=class extends lr.Client{constructor(t){super(t);this.config=t}static{a(this, "NeonClient")}get neonConfig(){return this.connection.stream}connect(t){let{neonConfig:n}=this; n.forceDisablePgSSL&&(this.ssl=this.connection.ssl=!1),this.ssl&&n.useSecureWebSocket&& console.warn("SSL is enabled for both Postgres (e.g. ?sslmode=require in the con\ @@ -2056,183 +2133,184 @@ nection string + forceDisablePgSSL = false) and the WebSocket tunnel (useSecureW ebSocket = true). Double encryption will increase latency and CPU usage. It may \ be appropriate to disable SSL in the Postgres connection parameters or set force\ DisablePgSSL = true.");let i=this.config?.host!==void 0||this.config?.connectionString!== -void 0||S.env.PGHOST!==void 0,s=S.env.USER??S.env.USERNAME;if(!i&&this.host==="l\ +void 0||b.env.PGHOST!==void 0,s=b.env.USER??b.env.USERNAME;if(!i&&this.host==="l\ ocalhost"&&this.user===s&&this.database===s&&this.password===null)throw new Error( `No database host or connection string was set, and key parameters have default \ values (host: localhost, user: ${s}, db: ${s}, password: null). Is an environmen\ t variable missing? Alternatively, if you intended to connect with these paramet\ -ers, please set the host to 'localhost' explicitly.`);let a=super.connect(t),u=n. -pipelineTLS&&this.ssl,c=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect) -return a;let l=this.connection;if(u&&l.on("connect",()=>l.stream.emit("data","S")), -c){l.removeAllListeners("authenticationCleartextPassword"),l.removeAllListeners( +ers, please set the host to 'localhost' explicitly.`);let o=super.connect(t),c=n. +pipelineTLS&&this.ssl,u=n.pipelineConnect==="password";if(!c&&!n.pipelineConnect) +return o;let l=this.connection;if(c&&l.on("connect",()=>l.stream.emit("data","S")), +u){l.removeAllListeners("authenticationCleartextPassword"),l.removeAllListeners( "readyForQuery"),l.once("readyForQuery",()=>l.on("readyForQuery",this._handleReadyForQuery. bind(this)));let h=this.ssl?"sslconnect":"connect";l.on(h,()=>{this._handleAuthCleartextPassword(), -this._handleReadyForQuery()})}return a}async _handleAuthSASLContinue(t){let n=this. -saslSession,i=this.password,s=t.data;if(n.message!=="SASLInitialResponse"||typeof i!= -"string"||typeof s!="string")throw new Error("SASL: protocol error");let a=Object. -fromEntries(s.split(",").map(W=>{if(!/^.=/.test(W))throw new Error("SASL: Invali\ -d attribute pair entry");let R=W[0],k=W.substring(2);return[R,k]})),u=a.r,c=a.s, -l=a.i;if(!u||!/^[!-+--~]+$/.test(u))throw new Error("SASL: SCRAM-SERVER-FIRST-ME\ -SSAGE: nonce missing/unprintable");if(!c||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base\ -64");if(!l||!/^[1-9][0-9]*$/.test(l))throw new Error("SASL: SCRAM-SERVER-FIRST-M\ -ESSAGE: missing/invalid iteration count");if(!u.startsWith(n.clientNonce))throw new Error( +this._handleReadyForQuery()})}return o}async _handleAuthSASLContinue(t){if(typeof T> +"u"||T.subtle===void 0||T.subtle.importKey===void 0)throw new Error("Cannot use \ +SASL auth when `crypto.subtle` is not defined");let n=T.subtle,i=this.saslSession, +s=this.password,o=t.data;if(i.message!=="SASLInitialResponse"||typeof s!="string"|| +typeof o!="string")throw new Error("SASL: protocol error");let c=Object.fromEntries( +o.split(",").map(q=>{if(!/^.=/.test(q))throw new Error("SASL: Invalid attribute \ +pair entry");let M=q[0],F=q.substring(2);return[M,F]})),u=c.r,l=c.s,h=c.i;if(!u|| +!/^[!-+--~]+$/.test(u))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce \ +missing/unprintable");if(!l||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(l))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base\ +64");if(!h||!/^[1-9][0-9]*$/.test(h))throw new Error("SASL: SCRAM-SERVER-FIRST-M\ +ESSAGE: missing/invalid iteration count");if(!u.startsWith(i.clientNonce))throw new Error( "SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce"); -if(u.length===n.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MES\ -SAGE: server nonce is too short");let h=parseInt(l,10),f=w.from(c,"base64"),y=new TextEncoder, -m=y.encode(i),b=await A.subtle.importKey("raw",m,{name:"HMAC",hash:{name:"SHA-25\ -6"}},!1,["sign"]),U=new Uint8Array(await A.subtle.sign("HMAC",b,w.concat([f,w.from( -[0,0,0,1])]))),v=U;for(var C=0;Cv[R]^U[R]));let E=v,g=await A.subtle.importKey( -"raw",E,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),x=new Uint8Array(await A. -subtle.sign("HMAC",g,y.encode("Client Key"))),N=await A.subtle.digest("SHA-256", -x),P="n=*,r="+n.clientNonce,D="r="+u+",s="+c+",i="+h,q="c=biws,r="+u,Z=P+","+D+"\ -,"+q,M=await A.subtle.importKey("raw",N,{name:"HMAC",hash:{name:"SHA-256"}},!1,[ -"sign"]);var $=new Uint8Array(await A.subtle.sign("HMAC",M,y.encode(Z))),j=w.from( -x.map((W,R)=>x[R]^$[R])),H=j.toString("base64");let K=await A.subtle.importKey("\ -raw",E,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),J=await A.subtle.sign("H\ -MAC",K,y.encode("Server Key")),F=await A.subtle.importKey("raw",J,{name:"HMAC",hash:{ -name:"SHA-256"}},!1,["sign"]);var Y=w.from(await A.subtle.sign("HMAC",F,y.encode( -Z)));n.message="SASLResponse",n.serverSignature=Y.toString("base64"),n.response= -q+",p="+H,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; -function Uh(r,e){if(e)return{callback:e,result:void 0};let t,n,i=o(function(a,u){ -a?t(a):n(u)},"cb"),s=new r(function(a,u){n=a,t=u});return{callback:i,result:s}}o( -Uh,"promisify");var qe=class extends sr.Pool{static{o(this,"NeonPool")}Client=Be;hasFetchUnsupportedListeners=!1;on(e,t){ -return e!=="error"&&(this.hasFetchUnsupportedListeners=!0),super.on(e,t)}query(e,t,n){ -if(!ge.poolQueryViaFetch||this.hasFetchUnsupportedListeners||typeof e=="function") -return super.query(e,t,n);typeof t=="function"&&(n=t,t=void 0);let i=Uh(this.Promise, -n);n=i.callback;try{let s=new Da.default(this.options),a=encodeURIComponent,u=encodeURI, -c=`postgresql://${a(s.user)}:${a(s.password)}@${a(s.host)}/${u(s.database)}`,l=typeof e== -"string"?e:e.text,h=t??e.values??[];xe(c,{fullResults:!0,arrayMode:e.rowMode==="\ -array"})(l,h,{types:e.types??this.options?.types}).then(y=>n(void 0,y)).catch(y=>n( -y))}catch(s){n(s)}return i.result}};p();async function Ih(r){let e=Date.now(),t=await r();return[Date.now()-e,t]}o(Ih,"t\ -imed");async function nt(r,e,t=(n,i)=>{}){let n=[];for(let s=0;ss+a,0),n]}o(nt,"timedRepeat\ -s");async function vt(r,e){let{sql:t,test:n}=e,{rows:i}=await(typeof r=="functio\ +if(u.length===i.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MES\ +SAGE: server nonce is too short");let f=parseInt(h,10),g=w.from(l,"base64"),p=new TextEncoder, +E=p.encode(s),C=await n.importKey("raw",E,{name:"HMAC",hash:{name:"SHA-256"}},!1, +["sign"]),v=new Uint8Array(await n.sign("HMAC",C,w.concat([g,w.from([0,0,0,1])]))), +A=v;for(var S=0;SA[M]^v[M]));let m=A,x=await n.importKey("raw",m,{name:"HMAC",hash:{name:"\ +SHA-256"}},!1,["sign"]),N=new Uint8Array(await n.sign("HMAC",x,p.encode("Client \ +Key"))),_=await n.digest("SHA-256",N),D="n=*,r="+i.clientNonce,Y="r="+u+",s="+l+ +",i="+f,te="c=biws,r="+u,P=D+","+Y+","+te,W=await n.importKey("raw",_,{name:"HMA\ +C",hash:{name:"SHA-256"}},!1,["sign"]);var oe=new Uint8Array(await n.sign("HMAC", +W,p.encode(P))),ee=w.from(N.map((q,M)=>N[M]^oe[M])),j=ee.toString("base64");let H=await n. +importKey("raw",m,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Q=await n.sign( +"HMAC",H,p.encode("Server Key")),V=await n.importKey("raw",Q,{name:"HMAC",hash:{ +name:"SHA-256"}},!1,["sign"]);var k=w.from(await n.sign("HMAC",V,p.encode(P)));i. +message="SASLResponse",i.serverSignature=k.toString("base64"),i.response=te+",p="+ +j,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}};function tf(r,e){ +if(e)return{callback:e,result:void 0};let t,n,i=a(function(o,c){o?t(o):n(c)},"cb"), +s=new r(function(o,c){n=o,t=c});return{callback:i,result:s}}a(tf,"promisify");var He=class extends lr.Pool{static{ +a(this,"NeonPool")}Client=qe;hasFetchUnsupportedListeners=!1;on(e,t){return e!== +"error"&&(this.hasFetchUnsupportedListeners=!0),super.on(e,t)}addListener=this.on;query(e,t,n){ +if(!Ee.poolQueryViaFetch||this.hasFetchUnsupportedListeners||typeof e=="function") +return super.query(e,t,n);typeof t=="function"&&(n=t,t=void 0);let i=tf(this.Promise, +n);n=i.callback;try{let s=new Ho.default(this.options),o=encodeURIComponent,c=encodeURI, +u=`postgresql://${o(s.user)}:${o(s.password)}@${o(s.host)}/${c(s.database)}`,l=typeof e== +"string"?e:e.text,h=t??e.values??[];Te(u,{fullResults:!0,arrayMode:e.rowMode==="\ +array"})(l,h,{types:e.types??this.options?.types}).then(g=>n(void 0,g)).catch(g=>n( +g))}catch(s){n(s)}return i.result}};var Ey=BUNDLE_EXT;y();async function rf(r){let e=Date.now(),t=await r();return[Date.now()-e,t]}a(rf,"t\ +imed");async function ot(r,e,t=(n,i)=>{}){let n=[];for(let s=0;ss+o,0),n]}a(ot,"timedRepeat\ +s");async function Lt(r,e){let{sql:t,test:n}=e,{rows:i}=await(typeof r=="functio\ n"?r(t):r.query(t));if(!n(i))throw new Error(`Result fails test Query: ${t} -Result: ${JSON.stringify(i)}`);return i}o(vt,"runQuery");async function Ct(r,e,t,n){ -await e.connect();let i=await nt(r,()=>vt(e,n));return t.waitUntil(e.end()),i}o( -Ct,"clientRunQuery");async function _t(r,e,t,n){let i=new qe({connectionString:e}), -s=await nt(r,()=>vt(i,n));return t.waitUntil(i.end()),s}o(_t,"poolRunQuery");async function qa(r,e,t,n){ -let i=xe(e,{fullResults:!0});return await nt(r,()=>vt(i,n))}o(qa,"httpRunQuery");p();var Tt=[{sql:"SELECT * FROM employees LIMIT 10",test:o(r=>r.length>1&&typeof r[0]. -first_name=="string","test")},{sql:"SELECT now()",test:o(r=>/^2\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d.\d+Z$/. -test(r[0].now.toISOString()),"test")}];async function c0(r,e,t){let n=[];for(let i of Tt){let[,[[,s]]]=await _t(1,e.NEON_DB_URL, -t,i);n.push(s)}for(let i of Tt){let[,[[,s]]]=await qa(1,e.NEON_DB_URL,t,i);n.push( +Result: ${JSON.stringify(i)}`);return i}a(Lt,"runQuery");async function _t(r,e,t,n){ +await e.connect();let i=await ot(r,()=>Lt(e,n));return t.waitUntil(e.end()),i}a( +_t,"clientRunQuery");async function Pt(r,e,t,n){let i=new He({connectionString:e}), +s=await ot(r,()=>Lt(i,n));return t.waitUntil(i.end()),s}a(Pt,"poolRunQuery");async function $o(r,e,t,n){ +let i=Te(e,{fullResults:!0});return await ot(r,()=>Lt(i,n))}a($o,"httpRunQuery");y();var Bt=[{sql:"SELECT * FROM employees LIMIT 10",test:a(r=>r.length>1&&typeof r[0]. +first_name=="string","test")},{sql:"SELECT now()",test:a(r=>/^2\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d.\d+Z$/. +test(r[0].now.toISOString()),"test")}];async function Qy(r,e,t){let n=[];for(let i of Bt){let[,[[,s]]]=await Pt(1,e.NEON_DB_URL, +t,i);n.push(s)}for(let i of Bt){let[,[[,s]]]=await $o(1,e.NEON_DB_URL,t,i);n.push( s)}return new Response(JSON.stringify(n,null,2),{headers:{"Content-Type":"applic\ -ation/json"}})}o(c0,"cf");var Re={waitUntil(r){},passThroughOnException(){}};async function Ph(r,e=(...t)=>{}){ -let t=xe(r.NEON_DB_URL),[[n],[i]]=await t.transaction([t`SELECT ${1}::int AS "batchInt"`, +ation/json"}})}a(Qy,"cf");var ke={waitUntil(r){},passThroughOnException(){}};async function nf(r,e=(...t)=>{}){ +let t=Te(r.NEON_DB_URL),[[n],[i]]=await t.transaction([t`SELECT ${1}::int AS "batchInt"`, t`SELECT ${"hello"} AS "batchStr"`]);if(e("batch results:",JSON.stringify(n),JSON. stringify(i),` `),n.batchInt!==1||i.batchStr!=="hello")throw new Error("Batch query problem");let[ -[s],[a]]=await t.transaction(x=>[x`SELECT ${1}::int AS "batchInt"`,x`SELECT ${"h\ -ello"} AS "batchStr"`]);if(e("batch results:",JSON.stringify(s),JSON.stringify(a), +[s],[o]]=await t.transaction(x=>[x`SELECT ${1}::int AS "batchInt"`,x`SELECT ${"h\ +ello"} AS "batchStr"`]);if(e("batch results:",JSON.stringify(s),JSON.stringify(o), ` -`),s.batchInt!==1||a.batchStr!=="hello")throw new Error("Batch query problem");let u=await t. -transaction(x=>[]);e("empty txn result:",JSON.stringify(u),` -`);let[[[c]],[[l]]]=await t.transaction(x=>[x`SELECT ${1}::int AS "batchInt"`,x`SELECT ${"\ +`),s.batchInt!==1||o.batchStr!=="hello")throw new Error("Batch query problem");let c=await t. +transaction(x=>[]);e("empty txn result:",JSON.stringify(c),` +`);let[[[u]],[[l]]]=await t.transaction(x=>[x`SELECT ${1}::int AS "batchInt"`,x`SELECT ${"\ hello"} AS "batchStr"`],{arrayMode:!0,isolationLevel:"Serializable",readOnly:!0}); -if(e("array mode (via transaction options) batch results:",JSON.stringify(c),JSON. +if(e("array mode (via transaction options) batch results:",JSON.stringify(u),JSON. stringify(l),` -`),c!==1||l!=="hello")throw new Error("Batch query problem");let h=xe(r.NEON_DB_URL, -{arrayMode:!0,isolationLevel:"RepeatableRead"}),[[[f]],[[y]]]=await h.transaction( +`),u!==1||l!=="hello")throw new Error("Batch query problem");let h=Te(r.NEON_DB_URL, +{arrayMode:!0,isolationLevel:"RepeatableRead"}),[[[f]],[[g]]]=await h.transaction( x=>[x`SELECT ${1}::int AS "batchInt"`,x`SELECT ${"hello"} AS "batchStr"`]);if(e( "array mode (via neon options) batch results:",JSON.stringify(f),JSON.stringify( -y),` -`),f!==1||y!=="hello")throw new Error("Batch query problem");let m=xe(r.NEON_DB_URL, -{arrayMode:!0}),[[b],[U]]=await m.transaction(x=>[x`SELECT ${1}::int AS "batchInt"`, +g),` +`),f!==1||g!=="hello")throw new Error("Batch query problem");let p=Te(r.NEON_DB_URL, +{arrayMode:!0}),[[E],[C]]=await p.transaction(x=>[x`SELECT ${1}::int AS "batchInt"`, x`SELECT ${"hello"} AS "batchStr"`],{arrayMode:!1});if(e("ordinary (via overridd\ -en options) batch results:",JSON.stringify(b),JSON.stringify(U),` -`),b.batchInt!==1||U.batchStr!=="hello")throw new Error("Batch query problem");let[ -[v],[C]]=await t.transaction(x=>[x`SELECT ${1}::int AS "batchInt"`,x('SELECT $1 \ +en options) batch results:",JSON.stringify(E),JSON.stringify(C),` +`),E.batchInt!==1||C.batchStr!=="hello")throw new Error("Batch query problem");let[ +[v],[A]]=await t.transaction(x=>[x`SELECT ${1}::int AS "batchInt"`,x('SELECT $1 \ AS "batchStr"',["hello"],{arrayMode:!0})]);if(e("query options on individual bat\ -ch queries:",JSON.stringify(v),JSON.stringify(C),` -`),v.batchInt!==1||C[0]!=="hello")throw new Error("Batch query problem");let E;try{ +ch queries:",JSON.stringify(v),JSON.stringify(A),` +`),v.batchInt!==1||A[0]!=="hello")throw new Error("Batch query problem");let S;try{ await t.transaction(x=>[x`SELECT ${1}::int AS "batchInt"`,`SELECT 'hello' AS "ba\ -tchStr"`])}catch(x){E=x}if(E===void 0)throw new Error("Error should have been ra\ +tchStr"`])}catch(x){S=x}if(S===void 0)throw new Error("Error should have been ra\ ised for string passed to `transaction()`");e("successfully caught invalid query\ - passed to `transaction()`\n");let g;try{let x=r.NEON_DB_URL.replace(/@/,"x@");await xe( + passed to `transaction()`\n");let m;try{let x=r.NEON_DB_URL.replace(/@/,"x@");await Te( x).transaction(N=>[N`SELECT 'never' AS this_should_be_seen_precisely`])}catch(x){ -g=x}if(g===void 0)throw new Error("Error should have been raised for bad passwor\ -d");e("successfully caught invalid password passed to `neon()`\n")}o(Ph,"batchQu\ -eryTest");async function l0(r,e,t=(...n)=>{}){let n=[1,3],i=9;t(`Warm-up ... +m=x}if(m===void 0)throw new Error("Error should have been raised for bad passwor\ +d");e("successfully caught invalid password passed to `neon()`\n")}a(nf,"batchQu\ +eryTest");async function Hy(r,e,t=(...n)=>{}){let n=[1,3],i=9;t(`Warm-up ... -`),await _t(1,r.NEON_DB_URL,Re,Tt[0]);let s=0;t(` +`),await Pt(1,r.NEON_DB_URL,ke,Bt[0]);let s=0;t(` ===== SQL-over-HTTP tests ===== -`);let a=new Set(["command","rowCount","rows","fields"]),u=await new qe({connectionString:r. -NEON_DB_URL}),c=xe(r.NEON_DB_URL,{resultCallback:o(async(m,b,U,v)=>{let C=await u. -query({text:m.query,values:m.params,...v.arrayMode?{rowMode:"array"}:{}}),E=b.command=== -C.command,g=b.rowCount===C.rowCount,x=Lr(b.fields.map(D=>D.dataTypeID),C.fields. -map(D=>D.dataTypeID)),N=Lr(U,C.rows);t(E&&g&&N&&x?"\u2713":"X",JSON.stringify(m), +`);let o=new Set(["command","rowCount","rows","fields"]),c=await new He({connectionString:r. +NEON_DB_URL}),u=Te(r.NEON_DB_URL,{resultCallback:a(async(p,E,C,v)=>{let A=await c. +query({text:p.query,values:p.params,...v.arrayMode?{rowMode:"array"}:{}}),S=E.command=== +A.command,m=E.rowCount===A.rowCount,x=Pr(E.fields.map(D=>D.dataTypeID),A.fields. +map(D=>D.dataTypeID)),N=Pr(C,A.rows);t(S&&m&&N&&x?"\u2713":"X",JSON.stringify(p), ` - -> us:`,JSON.stringify(U),` - -> pg:`,JSON.stringify(C.rows),` -`)},"resultCallback")}),l=new Date;await c`SELECT ${1} AS int_uncast`,await c`SELECT ${1}::int AS int`, -await c`SELECT ${1}::int8 AS int8num`,await c`SELECT ${1}::decimal AS decimalnum`, -await c`SELECT ${"[1,4)"}::int4range AS int4range`,await c`SELECT ${"hello"} AS str`, -await c`SELECT ${["a","b","c"]} AS arrstr_uncast`,await c`SELECT ${[[2],[4]]}::int[][] AS arrnumnested`, -await c`SELECT ${l}::timestamptz AS timestamptznow`,await c`SELECT ${"16:17:18+0\ -1:00"}::timetz AS timetz`,await c`SELECT ${"17:18:19"}::time AS time`,await c`SELECT ${l}::date AS datenow`, -await c`SELECT ${{x:"y"}} AS obj_uncast`,await c`SELECT ${"11:22:33:44:55:66"}::macaddr AS macaddr`, -await c`SELECT ${"\\xDEADBEEF"}::bytea AS bytea`,await c`SELECT ${"(2, 3)"}::point AS point`, -await c`SELECT ${"<(2, 3), 1>"}::circle AS circle`,await c`SELECT ${"10.10.10.0/\ -24"}::cidr AS cidr`,await c`SELECT ${!0} AS bool_uncast`,await c`SELECT ${"hello"} || ' ' || ${"\ -world"} AS greeting`,await c`SELECT ${[1,2,3]}::int[] AS arrnum`,await c`SELECT ${[ -"a","b","c"]}::text[] AS arrstr`,await c`SELECT ${{x:"y"}}::jsonb AS jsonb_obj`, -await c`SELECT ${{x:"y"}}::json AS json_obj`,await c`SELECT ${["11:22:33:44:55:6\ -6"]}::macaddr[] AS arrmacaddr`,await c`SELECT ${["10.10.10.0/24"]}::cidr[] AS arrcidr`, -await c`SELECT ${!0}::boolean AS bool`,await c`SELECT ${[l]}::timestamptz[] AS arrtstz`, -await c`SELECT ${["(2, 3)"]}::point[] AS arrpoint`,await c`SELECT ${["<(2, 3), 1\ ->"]}::circle[] AS arrcircle`,await c`SELECT ${["\\xDEADBEEF","\\xDEADBEEF"]}::bytea[] AS arrbytea`, -await c`SELECT null AS null`,await c`SELECT ${null} AS null`,await c`SELECT ${"N\ -ULL"} AS null_str`,await c`SELECT ${[1,2,3]} AS arrnum_uncast`,await c`SELECT ${[ -[2],[4]]} AS arrnumnested_uncast`,await c`SELECT ${l} AS timenow_uncast`,await c`SELECT ${l}::timestamp AS timestampnow`, -await c("SELECT $1::timestamp AS timestampnow",[l]),await c("SELECT $1 || ' ' ||\ - $2 AS greeting",["hello","world"]),await c("SELECT 123 AS num"),await c("SELECT\ - 123 AS num",[],{arrayMode:!0,fullResults:!0});function h(m,b,U=3){return async function(v,...C){ -let E="";for(let g=0;gx.abort("fetch timed out"),b);try{let{ -signal:P}=x;return await m(E,C,{fetchOptions:{signal:P}})}catch(P){if(!(P.sourceError&& -P.sourceError instanceof DOMException&&P.sourceError.name==="AbortError")||g>=U) -throw P}finally{clearTimeout(N)}}}}o(h,"sqlWithRetries"),await h(c,5e3)`SELECT ${"\ -did this time out?"} AS str`,await Ph(r,t),ge.fetchFunction=(m,b)=>(console.log( -"custom fetch:",m,b),fetch(m,b)),await c`SELECT ${"customFetch"} AS str`;let y="\ -SELECT 123::int[] WHERE x";try{await c(y)}catch(m){console.log("Fields of this e\ + -> us:`,JSON.stringify(C),` + -> pg:`,JSON.stringify(A.rows),` +`)},"resultCallback")}),l=new Date;await u`SELECT ${1} AS int_uncast`,await u`SELECT ${1}::int AS int`, +await u`SELECT ${1}::int8 AS int8num`,await u`SELECT ${1}::decimal AS decimalnum`, +await u`SELECT ${"[1,4)"}::int4range AS int4range`,await u`SELECT ${"hello"} AS str`, +await u`SELECT ${["a","b","c"]} AS arrstr_uncast`,await u`SELECT ${[[2],[4]]}::int[][] AS arrnumnested`, +await u`SELECT ${l}::timestamptz AS timestamptznow`,await u`SELECT ${"16:17:18+0\ +1:00"}::timetz AS timetz`,await u`SELECT ${"17:18:19"}::time AS time`,await u`SELECT ${l}::date AS datenow`, +await u`SELECT ${{x:"y"}} AS obj_uncast`,await u`SELECT ${"11:22:33:44:55:66"}::macaddr AS macaddr`, +await u`SELECT ${"\\xDEADBEEF"}::bytea AS bytea`,await u`SELECT ${"(2, 3)"}::point AS point`, +await u`SELECT ${"<(2, 3), 1>"}::circle AS circle`,await u`SELECT ${"10.10.10.0/\ +24"}::cidr AS cidr`,await u`SELECT ${!0} AS bool_uncast`,await u`SELECT ${"hello"} || ' ' || ${"\ +world"} AS greeting`,await u`SELECT ${[1,2,3]}::int[] AS arrnum`,await u`SELECT ${[ +"a","b","c"]}::text[] AS arrstr`,await u`SELECT ${{x:"y"}}::jsonb AS jsonb_obj`, +await u`SELECT ${{x:"y"}}::json AS json_obj`,await u`SELECT ${["11:22:33:44:55:6\ +6"]}::macaddr[] AS arrmacaddr`,await u`SELECT ${["10.10.10.0/24"]}::cidr[] AS arrcidr`, +await u`SELECT ${!0}::boolean AS bool`,await u`SELECT ${[l]}::timestamptz[] AS arrtstz`, +await u`SELECT ${["(2, 3)"]}::point[] AS arrpoint`,await u`SELECT ${["<(2, 3), 1\ +>"]}::circle[] AS arrcircle`,await u`SELECT ${["\\xDEADBEEF","\\xDEADBEEF"]}::bytea[] AS arrbytea`, +await u`SELECT null AS null`,await u`SELECT ${null} AS null`,await u`SELECT ${"N\ +ULL"} AS null_str`,await u`SELECT ${[1,2,3]} AS arrnum_uncast`,await u`SELECT ${[ +[2],[4]]} AS arrnumnested_uncast`,await u`SELECT ${l} AS timenow_uncast`,await u`SELECT ${l}::timestamp AS timestampnow`, +await u("SELECT $1::timestamp AS timestampnow",[l]),await u("SELECT $1 || ' ' ||\ + $2 AS greeting",["hello","world"]),await u("SELECT 123 AS num"),await u("SELECT\ + 123 AS num",[],{arrayMode:!0,fullResults:!0});function h(p,E,C=3){return async function(v,...A){ +let S="";for(let m=0;mx.abort("fetch timed out"),E);try{let{ +signal:_}=x;return await p(S,A,{fetchOptions:{signal:_}})}catch(_){if(!(_.sourceError&& +_.sourceError instanceof DOMException&&_.sourceError.name==="AbortError")||m>=C) +throw _}finally{clearTimeout(N)}}}}a(h,"sqlWithRetries"),await h(u,5e3)`SELECT ${"\ +did this time out?"} AS str`,await nf(r,t),Ee.fetchFunction=(p,E)=>(console.log( +"custom fetch:",p,E),fetch(p,E)),await u`SELECT ${"customFetch"} AS str`;let g="\ +SELECT 123::int[] WHERE x";try{await u(g)}catch(p){console.log("Fields of this e\ xpected error should match the following error, except for having no `length` fi\ -eld"),console.log(m)}try{await _t(1,r.NEON_DB_URL,Re,{sql:y,test:o(()=>!0,"test")})}catch(m){ +eld"),console.log(p)}try{await Pt(1,r.NEON_DB_URL,ke,{sql:g,test:a(()=>!0,"test")})}catch(p){ console.log("Fields of this expected error should match the previous error, exce\ -pt for having an additional `length` field"),console.log(m)}await new Promise(m=>setTimeout( -m,1e3)),u.end(),t(` +pt for having an additional `length` field"),console.log(p)}await new Promise(p=>setTimeout( +p,1e3)),c.end(),t(` ===== Pool/Client tests ===== -`);for(let m of Tt){t(` ------ ${m.sql} ----- +`);for(let p of Bt){t(` +----- ${p.sql} ----- -`);async function b(v,C){let E=String.fromCharCode(s+(s>25?23:65));t(`${E} -`);try{await fetch(`http://localhost:443/${E}`)}catch{}t('Liv\ -e: ');let[,g]=await nt(i,()=>C(v),x=>t(`${x.toFixed()}\ +`);async function E(v,A){let S=String.fromCharCode(s+(s>25?23:65));t(`${S} +`);try{await fetch(`http://localhost:443/${S}`)}catch{}t('Liv\ +e: ');let[,m]=await ot(i,()=>A(v),x=>t(`${x.toFixed()}\ ms `));t(` -Sorted: `),g.map(([x])=>x).sort((x,N)=>x-N).forEach((x,N)=>{t(N===(i-1)/2?`x).sort((x,N)=>x-N).forEach((x,N)=>{t(N===(i-1)/2?`${x.toFixed()}ms `:`${x.toFixed()}ms `)}),t(` -`),s+=1}o(b,"section");async function U(v,C){t(`----- ${v} ----- +`),s+=1}a(E,"section");async function C(v,A){t(`----- ${v} ----- -`);for(let E of n)t(`${E} quer${E===1?"y":"ies"} \u2013 `),await b(E,C)}o(U,"sec\ -tions"),await U("Neon/wss, no pipelining",async v=>{let C=new Be(r.NEON_DB_URL); -C.neonConfig.pipelineConnect=!1,await Ct(v,C,Re,m)}),await U("Neon/wss, pipeline\ -d connect (default)",async v=>{let C=new Be(r.NEON_DB_URL);await Ct(v,C,Re,m)}), -await U("Neon/wss, pipelined connect, no coalescing",async v=>{let C=new Be(r.NEON_DB_URL); -C.neonConfig.coalesceWrites=!1,await Ct(v,C,Re,m)}),await U("Neon/wss, pipelined\ - connect using Pool.query",async v=>{await _t(v,r.NEON_DB_URL,Re,m)}),await U("N\ -eon/wss, pipelined connect using Pool.connect",async v=>{let C=new qe({connectionString:r. -NEON_DB_URL}),E=await C.connect();await nt(v,()=>vt(E,m)),E.release(),Re.waitUntil( -C.end())}),e&&(ge.subtls=Tr,ge.rootCerts=bi,await U("pg/subtls, pipelined connec\ -t",async v=>{let C=new Be(r.NEON_DB_URL);C.neonConfig.wsProxy=(E,g)=>`subtls-wsp\ -roxy.jawj.workers.dev/?address=${E}:${g}`,C.neonConfig.forceDisablePgSSL=C.neonConfig. -useSecureWebSocket=!1,C.neonConfig.pipelineTLS=!1,C.neonConfig.pipelineConnect=!1; -try{await Ct(v,C,Re,m)}catch(E){console.error(` -*** ${E.message}`)}}))}}o(l0,"latencies");export{Ph as batchQueryTest,c0 as cf,l0 as latencies,ge as neonConfig}; +`);for(let S of n)t(`${S} quer${S===1?"y":"ies"} \u2013 `),await E(S,A)}a(C,"sec\ +tions"),await C("Neon/wss, no pipelining",async v=>{let A=new qe(r.NEON_DB_URL); +A.neonConfig.pipelineConnect=!1,await _t(v,A,ke,p)}),await C("Neon/wss, pipeline\ +d connect (default)",async v=>{let A=new qe(r.NEON_DB_URL);await _t(v,A,ke,p)}), +await C("Neon/wss, pipelined connect, no coalescing",async v=>{let A=new qe(r.NEON_DB_URL); +A.neonConfig.coalesceWrites=!1,await _t(v,A,ke,p)}),await C("Neon/wss, pipelined\ + connect using Pool.query",async v=>{await Pt(v,r.NEON_DB_URL,ke,p)}),await C("N\ +eon/wss, pipelined connect using Pool.connect",async v=>{let A=new He({connectionString:r. +NEON_DB_URL}),S=await A.connect();await ot(v,()=>Lt(S,p)),S.release(),ke.waitUntil( +A.end())}),e&&(Ee.subtls=_r,Ee.rootCerts=Ii,await C("pg/subtls, pipelined connec\ +t",async v=>{let A=new qe(r.NEON_DB_URL);A.neonConfig.wsProxy=(S,m)=>`subtls-wsp\ +roxy.jawj.workers.dev/?address=${S}:${m}`,A.neonConfig.forceDisablePgSSL=A.neonConfig. +useSecureWebSocket=!1,A.neonConfig.pipelineTLS=!1,A.neonConfig.pipelineConnect=!1; +try{await _t(v,A,ke,p)}catch(S){console.error(` +*** ${S.message}`)}}))}}a(Hy,"latencies");export{nf as batchQueryTest,Qy as cf,Hy as latencies,Ee as neonConfig}; /*! Bundled license information: ieee754/index.js: diff --git a/export.sh b/export.sh index 5be7b08..b162f98 100755 --- a/export.sh +++ b/export.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +if [ -n "$NO_EXPORT" ]; then exit; fi + if [ "$1" = "debug" ]; then DEBUG_ARG="--define:debug=true" MINIFY_ARG="" @@ -9,48 +11,61 @@ else fi -# CJS code: index.js +# == CJS code: index.js == npx esbuild export/index.ts \ --format=cjs \ --bundle \ --keep-names \ --inject:shims/shims.js \ + --define:BUNDLE_EXT=\"js\" \ --target=es2020 \ --outfile=dist/npm/index.js \ $DEBUG_ARG $MINIFY_ARG -# ESM code: index.mjs +# == ESM code: index.mjs == npx esbuild export/index.ts \ --format=esm \ --bundle \ --keep-names \ --inject:shims/shims.js \ + --define:BUNDLE_EXT=\"mjs\" \ --target=es2020 \ --outfile=dist/npm/index.mjs \ $DEBUG_ARG $MINIFY_ARG -# CJS TS types: index.d.ts -# updated manually +# == types == + +npx tsc +# remove global declarations from types +sed -i.orig -r \ + -e "/^declare global [{]$/,/^[}]$/d" \ + dist/dts/shims/net/index.d.ts -# ESM TS types: index.d.mts +# bundle types into one file +npx @microsoft/api-extractor run --local -echo " -// DON'T EDIT THIS FILE -// It's a simple automatic copy of index.d.ts -" > dist/npm/index.d.mts -cat dist/npm/index.d.ts >> dist/npm/index.d.mts +# remove empty export and private fields +sed -i.orig -r \ + -e '/^ *private [^ ]+;$/d' \ + -e '/^export [{] *[}]$/d' \ + dist/dts/_extracted.d.ts +# copy to .d.ts (for CJS) and .d.mts (for ESM) +cp dist/dts/_extracted.d.ts dist/npm/index.d.ts +cp dist/npm/index.d.ts dist/npm/index.d.mts -# static assets + +# == static assets == cp LICENSE README.md CHANGELOG.md CONFIG.md DEPLOY.md DEVELOP.md dist/npm/ -# Prepare jsr package + +# == JSR package == cp dist/npm/index.d.ts dist/jsr/ echo "/// @@ -59,8 +74,8 @@ cat dist/npm/index.mjs >> dist/jsr/index.js cp LICENSE README.md dist/jsr/ -# Note: --keep-names adds about 10KB to the bundle size, but it gives us error -# messages and stack traces with no short, cryptic variable names +# Note: --keep-names for esbuild adds about 10KB to the bundle size, but it +# gives us error messages + stack traces with no short, cryptic variable names # WITHOUT (see `xe`, `pe`): diff --git a/export/httpQuery.ts b/export/httpQuery.ts index 2464439..88554f4 100644 --- a/export/httpQuery.ts +++ b/export/httpQuery.ts @@ -1,6 +1,7 @@ import { types as defaultTypes } from '.'; import { Socket } from '../shims/net'; import { parse } from '../shims/url'; +import type { FieldDef, types as PgTypes } from 'pg'; // @ts-ignore -- this isn't officially exported by pg import { prepareValue } from 'pg/lib/utils'; @@ -17,7 +18,7 @@ function encodeBuffersAsBytea(value: unknown): unknown { } export class NeonDbError extends Error { - name = 'NeonDbError' as const; + override name = 'NeonDbError' as const; severity: string | undefined; code: string | undefined; @@ -50,32 +51,82 @@ export class NeonDbError extends Error { } } -interface ParameterizedQuery { +export type QueryRows = ArrayMode extends true + ? any[][] + : Record[]; + +export interface FullQueryResults { + fields: FieldDef[]; + command: string; + rowCount: number; + rows: QueryRows; + rowAsArray: ArrayMode; +} + +export interface ParameterizedQuery { query: string; params: any[]; } -interface HTTPQueryOptions { - arrayMode?: boolean; // default false - fullResults?: boolean; // default false +export interface HTTPQueryOptions< + ArrayMode extends boolean, + FullResults extends boolean, +> { + /** + * When `arrayMode` is `false`, which is the default, result rows are + * returned as objects whose keys represent column names, such as + * `{ id: 1 }`). + * + * When `arrayMode` is `true`, rows are returned as arrays (and keys are not + * provided), e.g. `[1]`. + */ + arrayMode?: ArrayMode; + + /** + * When `fullResults` is `false`, which is the default, only result rows are + * returned, e.g. `[{ id: 1 }]`). + * + * When `fullResults` is `true`, a result object is returned that matches + * what's returned by node-postgres. This has a `rows` property, which is an + * array of result rows, plus `fields`, which provides column names and + * types, `command` and `rowCount`. + */ + fullResults?: FullResults; // default false + + /** + * Any options in `fetchOptions` are merged in to the options passed to + * `fetch`. In case of conflict with what would otherwise be passed, these + * options take precedence. + */ fetchOptions?: Record; - types?: typeof defaultTypes; - // these callback options are not currently exported: + /** + * JWT auth token to be passed as the Bearer token in the Authorization header. + * Can be string, or a function (sync or async) returning a string. + * + * Default: `undefined` + */ + authToken?: string | (() => Promise | string); + + /** + * Custom type parsers. See https://github.com/brianc/node-pg-types. + */ + types?: typeof PgTypes; + queryCallback?: (query: ParameterizedQuery) => void; + resultCallback?: ( query: ParameterizedQuery, result: any, rows: any, opts: any, ) => void; - - // JWT auth token to be passed as the Bearer token in the Authorization - // header - authToken?: string | (() => Promise | string); } -interface HTTPTransactionOptions extends HTTPQueryOptions { +export interface HTTPTransactionOptions< + ArrayMode extends boolean, + FullResults extends boolean, +> extends HTTPQueryOptions { // note that ReadUncommitted is really ReadCommitted in Postgres: https://www.postgresql.org/docs/current/transaction-iso.html isolationLevel?: | 'ReadUncommitted' @@ -86,21 +137,26 @@ interface HTTPTransactionOptions extends HTTPQueryOptions { deferrable?: boolean; } -interface NeonQueryPromise extends Promise { +export interface NeonQueryPromise< + ArrayMode extends boolean, + FullResults extends boolean, + T = any, +> extends Promise { parameterizedQuery: ParameterizedQuery; - opts?: HTTPQueryOptions; + opts?: HTTPQueryOptions; } -interface ProcessQueryResultOptions { +export interface ProcessQueryResultOptions { arrayMode: boolean; fullResults: boolean; parameterizedQuery: ParameterizedQuery; - resultCallback: HTTPQueryOptions['resultCallback']; + resultCallback: HTTPQueryOptions['resultCallback']; types?: typeof defaultTypes; } const txnArgErrMsg = 'transaction() expects an array of queries, or a function returning an array of queries'; + const errorFields = [ 'severity', 'code', @@ -121,7 +177,7 @@ const errorFields = [ ] as const; /* -Most config options can be set in 3 places: +Note: most config options can be set in 3 places: * in a call to `neon`, * in a call to `transaction`, @@ -138,7 +194,185 @@ That is: * `neon` options override defaults. */ -export function neon( +export interface NeonQueryFunctionInTransaction< + ArrayMode extends boolean, + FullResults extends boolean, +> { + // this is a simplified form of NeonQueryFunction (below): + // * `opts` cannot be passed + // * no `transaction()` method is available + + // tagged-template function usage + ( + strings: TemplateStringsArray, + ...params: any[] + ): NeonQueryPromise< + ArrayMode, + FullResults, + FullResults extends true + ? FullQueryResults + : QueryRows + >; + + // ordinary function usage (*no* options overrides) + ( + string: string, + params?: any[], + ): NeonQueryPromise< + ArrayMode, + FullResults, + FullResults extends true + ? FullQueryResults + : QueryRows + >; +} + +export interface NeonQueryInTransaction { + // this is a simplified form of query, which has only a `parameterizedQuery` (no `opts` and not a `Promise`) + parameterizedQuery: ParameterizedQuery; +} + +export interface NeonQueryFunction< + ArrayMode extends boolean, + FullResults extends boolean, +> { + // tagged-template function usage + ( + strings: TemplateStringsArray, + ...params: any[] + ): NeonQueryPromise< + ArrayMode, + FullResults, + FullResults extends true + ? FullQueryResults + : QueryRows + >; + + // ordinary function usage, with options overrides + < + ArrayModeOverride extends boolean = ArrayMode, + FullResultsOverride extends boolean = FullResults, + >( + string: string, + params?: any[], + opts?: HTTPQueryOptions, + ): NeonQueryPromise< + ArrayModeOverride, + FullResultsOverride, + FullResultsOverride extends true + ? FullQueryResults + : QueryRows + >; + + /** + * The `transaction()` function allows multiple queries to be submitted (over + * HTTP) as a single, non-interactive Postgres transaction. + * + * For example: + * ``` + * import { neon } from "@neondatabase/serverless"; + * const sql = neon("postgres://user:pass@host/db"); + * + * const results = await sql.transaction([ + * sql`SELECT 1 AS num`, + * sql`SELECT 'a' AS str`, + * ]); + * // -> [[{ num: 1 }], [{ str: "a" }]] + * + * // or equivalently: + * const results = await sql.transaction(txn => [ + * txn`SELECT 1 AS num`, + * txn`SELECT 'a' AS str`, + * ]); + * // -> [[{ num: 1 }], [{ str: "a" }]] + * ``` + * @param queriesOrFn - Either an array of queries, or a (non-`async`) function + * that receives a query function and returns an array of queries. + * @param opts - The same options that may be set on individual queries in a + * non-transaction setting -- that is, `arrayMode` `fullResults` and + * `fetchOptions` -- plus the transaction options `isolationLevel`, + * `readOnly` and `deferrable`. Note that none of these options can be set on + * individual queries within a transaction. + * @returns An array of results. The structure of each result object depends + * on the `arrayMode` and `fullResults` options. + */ + transaction: < + ArrayModeOverride extends boolean = ArrayMode, + FullResultsOverride extends boolean = FullResults, + >( + queriesOrFn: + | NeonQueryPromise[] // not ArrayModeOverride or FullResultsOverride: clamp these values to the current ones + | (( + sql: NeonQueryFunctionInTransaction< + ArrayModeOverride, + FullResultsOverride + >, + ) => NeonQueryInTransaction[]), + opts?: HTTPTransactionOptions, + ) => Promise< + FullResultsOverride extends true + ? FullQueryResults[] + : QueryRows[] + >; +} + +/** + * This function returns an async tagged-template function that runs a single + * SQL query (no session or transactions) with low latency over https. Support + * for multiple queries (as a non-interactive transaction) is provided by + * the `transaction` property of the query function. + * + * By default, the query function returns database rows directly. Types should + * match those returned by this driver (i.e. Pool or Client) over WebSockets. + * + * The returned function can also be called directly (i.e. not as a template + * function). In that case, pass it a query string with embedded `$1`, `$2` + * (etc.), followed by an array of query parameters, followed (optionally) by + * any of the same options you can pass to this function. + * + * Some examples: + * ``` + * import { neon } from "@neondatabase/serverless"; + * const h = "hello", w = "world"; + * + * // example 1: default options, tagged-template usage + * const sql = neon("postgres://user:pass@host/db"); + * const rows = await sql`SELECT ${h} || ' ' || ${w} AS greeting`; + * // -> [ { greeting: "hello world" } ] + * + * // example 2: `arrayMode` and `fullResults` options, ordinary function usage + * const options = { arrayMode: true, fullResults: true }; + * const sql = neon("postgres://user:pass@host/db", options); + * const rows = await sql("SELECT $1 || ' ' || $2 AS greeting", [h, w]); + * // -> { + * // command: "SELECT", + * // fields: [ { name: "greeting", dataTypeID: 25 } ], + * // rowAsArray: true, + * // rowCount: 1, + * // rows: [ [ "hello world" ] ] + * // } + * + * // example 3: `fetchOptions` option, ordinary function usage + * const sql = neon("postgres://user:pass@host/db"); + * const rows = await sql( + * "SELECT $1 || ' ' || $2 AS greeting", [h, w], + * { fetchOptions: { priority: "high" } } + * ); + * // -> [ { greeting: "hello world" } ] + * ``` + * + * @param connectionString - this has the format `postgres://user:pass@host/db` + * @param options - pass `arrayMode: true` to receive results as an array of + * arrays, instead of the default array of objects; pass `fullResults: true` + * to receive a complete result object similar to one returned by node-postgres + * (with properties `rows`, `fields`, `command`, `rowCount`, `rowAsArray`); + * pass as `fetchOptions` an object which will be merged into the options + * passed to `fetch`. + */ +export function neon< + ArrayMode extends boolean = false, + FullResults extends boolean = false, +>( connectionString: string, { arrayMode: neonOptArrayMode, @@ -150,8 +384,8 @@ export function neon( queryCallback, resultCallback, authToken, - }: HTTPTransactionOptions = {}, -) { + }: HTTPTransactionOptions = {}, +): NeonQueryFunction { // check the connection string if (!connectionString) @@ -182,12 +416,9 @@ export function neon( } // resolve query, params and opts - function resolve( - strings: TemplateStringsArray | string, - ...params: any[] - ): NeonQueryPromise { + function resolve(strings: TemplateStringsArray | string, ...params: any[]) { let query; - let queryOpts: HTTPQueryOptions | undefined; + let queryOpts: HTTPQueryOptions | undefined; if (typeof strings === 'string') { // ordinary (non tagged-template) usage @@ -215,8 +446,15 @@ export function neon( } resolve.transaction = async ( - queries: NeonQueryPromise[] | ((sql: typeof resolve) => NeonQueryPromise[]), - txnOpts?: HTTPTransactionOptions, + queries: + | NeonQueryPromise[] + | (( + sql: ( + strings: TemplateStringsArray | string, + ...params: any[] + ) => NeonQueryPromise, + ) => NeonQueryPromise[]), + txnOpts?: HTTPTransactionOptions, ) => { if (typeof queries === 'function') queries = queries(resolve); @@ -227,17 +465,22 @@ export function neon( }); const parameterizedQueries = queries.map( - (query) => (query as NeonQueryPromise).parameterizedQuery, + (query) => + (query as NeonQueryPromise).parameterizedQuery, + ); + const opts = queries.map( + (query) => (query as NeonQueryPromise).opts ?? {}, ); - const opts = queries.map((query) => (query as NeonQueryPromise).opts ?? {}); return execute(parameterizedQueries, opts, txnOpts); }; // execute query async function execute( parameterizedQuery: ParameterizedQuery | ParameterizedQuery[], - allSqlOpts?: HTTPQueryOptions | HTTPQueryOptions[], - txnOpts?: HTTPTransactionOptions, + allSqlOpts?: + | HTTPQueryOptions + | HTTPQueryOptions[], + txnOpts?: HTTPTransactionOptions, ) { const { fetchEndpoint, fetchFunction } = Socket; @@ -333,7 +576,7 @@ export function neon( }); } catch (err: any) { const connectErr = new NeonDbError( - `Error connecting to database: ${err.message}`, + `Error connecting to database: ${err}`, ); connectErr.sourceError = err; throw connectErr; @@ -350,7 +593,8 @@ export function neon( 'Neon internal error: unexpected result format', ); return resultArray.map((result, i) => { - let sqlOpts = (allSqlOpts as HTTPQueryOptions[])[i] ?? {}; + let sqlOpts = + (allSqlOpts as HTTPQueryOptions[])[i] ?? {}; let arrayMode = sqlOpts.arrayMode ?? resolvedArrayMode; let fullResults = sqlOpts.fullResults ?? resolvedFullResults; return processQueryResult(result, { @@ -363,7 +607,8 @@ export function neon( }); } else { // single query - let sqlOpts = (allSqlOpts as HTTPQueryOptions) ?? {}; + let sqlOpts = + (allSqlOpts as HTTPQueryOptions) ?? {}; let arrayMode = sqlOpts.arrayMode ?? resolvedArrayMode; let fullResults = sqlOpts.fullResults ?? resolvedFullResults; return processQueryResult(rawResults, { @@ -389,24 +634,30 @@ export function neon( } } - return resolve; + return resolve as any; } -function createNeonQueryPromise( - execute: (pq: ParameterizedQuery, hqo?: HTTPQueryOptions) => Promise, +function createNeonQueryPromise< + ArrayMode extends boolean, + FullResults extends boolean, +>( + execute: ( + pq: ParameterizedQuery, + hqo?: HTTPQueryOptions, + ) => Promise, parameterizedQuery: ParameterizedQuery, - opts?: HTTPQueryOptions, + opts?: HTTPQueryOptions, ) { return { [Symbol.toStringTag]: 'NeonQueryPromise', parameterizedQuery, opts, - then: (resolve, reject) => + then: (resolve: any, reject: any) => execute(parameterizedQuery, opts).then(resolve, reject), - catch: (reject) => execute(parameterizedQuery, opts).catch(reject), - finally: (finallyFn) => + catch: (reject: any) => execute(parameterizedQuery, opts).catch(reject), + finally: (finallyFn: any) => execute(parameterizedQuery, opts).finally(finallyFn), - } as NeonQueryPromise; + } as NeonQueryPromise; } function processQueryResult( @@ -462,7 +713,9 @@ function processQueryResult( return rows; } -async function getAuthToken(authToken: HTTPQueryOptions['authToken']) { +async function getAuthToken( + authToken: HTTPQueryOptions['authToken'], +) { if (typeof authToken === 'string') { return authToken; } diff --git a/export/index.ts b/export/index.ts index ea9ea98..fe3e9c8 100644 --- a/export/index.ts +++ b/export/index.ts @@ -1,7 +1,33 @@ +/* +We export the pg library mostly unchanged, but we do make a few tweaks. + +(1) Connecting and querying can require a lot of network round-trips. We +add a pipelining option for the connection (startup + auth + first query), +but this works with cleartext password auth only. We can also pipeline TLS +startup, but currently this works only with Neon hosts (not vanilla pg or +pgbouncer). + +(2) SCRAM auth is deliberately CPU-intensive, and this is not appropriate +for a serverless environment. In case it is still used, however, we replace +the standard (synchronous) pg implementation with one that uses SubtleCrypto +for repeated SHA-256 digests. This saves some time and CPU. + +(3) We now (experimentally) redirect Pool.query over a fetch request if the +circumstances are right. +*/ + import { Client, Connection, Pool } from 'pg'; import { Socket } from '../shims/net'; import { neon, NeonDbError } from './httpQuery'; -import type { NeonConfigGlobalAndClient } from './neonConfig'; +import type { + QueryResultRow, + Submittable, + QueryArrayConfig, + QueryConfigValues, + QueryConfig, + QueryArrayResult, + QueryResult, +} from 'pg'; // @ts-ignore -- this isn't officially exported by pg import ConnectionParameters from '../node_modules/pg/lib/connection-parameters'; @@ -13,24 +39,6 @@ interface ConnectionParameters { database: string; } -/** - * We export the pg library mostly unchanged, but we do make a few tweaks. - * - * (1) Connecting and querying can require a lot of network round-trips. We - * add a pipelining option for the connection (startup + auth + first query), - * but this works with cleartext password auth only. We can also pipeline TLS - * startup, but currently this works only with Neon hosts (not vanilla pg or - * pgbouncer). - * - * (2) SCRAM auth is deliberately CPU-intensive, and this is not appropriate - * for a serverless environment. In case it is still used, however, we replace - * the standard (synchronous) pg implementation with one that uses SubtleCrypto - * for repeated SHA-256 digests. This saves some time and CPU. - * - * (3) We now (experimentally) redirect Pool.query over a fetch request if the - * circumstances are right. - */ - declare interface NeonClient { // these types suppress type errors in this file, but do not carry over to // the npm package @@ -47,18 +55,22 @@ declare interface NeonClient { saslSession: any; } +/** + * The node-postgres `Client` object re-exported with minor modifications. + * https://node-postgres.com/apis/client + */ class NeonClient extends Client { - get neonConfig(): NeonConfigGlobalAndClient { - return this.connection.stream; + get neonConfig() { + return this.connection.stream as Socket; } constructor(public config: any) { super(config); } - connect(): Promise; - connect(callback: (err?: Error) => void): void; - connect(callback?: (err?: Error) => void) { + override connect(): Promise; + override connect(callback: (err?: Error) => void): void; + override connect(callback?: (err?: Error) => void) { const { neonConfig } = this; // disable TLS if requested @@ -132,6 +144,17 @@ class NeonClient extends Client { } async _handleAuthSASLContinue(msg: any) { + if ( + typeof crypto === 'undefined' || + crypto.subtle === undefined || + crypto.subtle.importKey === undefined + ) { + throw new Error( + 'Cannot use SASL auth when `crypto.subtle` is not defined', + ); + } + + const cs = crypto.subtle; const session = this.saslSession; const password = this.password; const serverData = msg.data; @@ -187,7 +210,7 @@ class NeonClient extends Client { const saltBytes = Buffer.from(salt, 'base64'); const enc = new TextEncoder(); const passwordBytes = enc.encode(password); - const iterHmacKey = await crypto.subtle.importKey( + const iterHmacKey = await cs.importKey( 'raw', passwordBytes, { name: 'HMAC', hash: { name: 'SHA-256' } }, @@ -195,7 +218,7 @@ class NeonClient extends Client { ['sign'], ); let ui1 = new Uint8Array( - await crypto.subtle.sign( + await cs.sign( 'HMAC', iterHmacKey, Buffer.concat([saltBytes, Buffer.from([0, 0, 0, 1])]), @@ -203,12 +226,12 @@ class NeonClient extends Client { ); let ui = ui1; for (var i = 0; i < iterations - 1; i++) { - ui1 = new Uint8Array(await crypto.subtle.sign('HMAC', iterHmacKey, ui1)); + ui1 = new Uint8Array(await cs.sign('HMAC', iterHmacKey, ui1)); ui = Buffer.from(ui.map((_, i) => ui[i] ^ ui1[i])); } const saltedPassword = ui; - const ckHmacKey = await crypto.subtle.importKey( + const ckHmacKey = await cs.importKey( 'raw', saltedPassword, { name: 'HMAC', hash: { name: 'SHA-256' } }, @@ -216,9 +239,9 @@ class NeonClient extends Client { ['sign'], ); const clientKey = new Uint8Array( - await crypto.subtle.sign('HMAC', ckHmacKey, enc.encode('Client Key')), + await cs.sign('HMAC', ckHmacKey, enc.encode('Client Key')), ); - const storedKey = await crypto.subtle.digest('SHA-256', clientKey); + const storedKey = await cs.digest('SHA-256', clientKey); const clientFirstMessageBare = 'n=*,r=' + session.clientNonce; const serverFirstMessage = 'r=' + nonce + ',s=' + salt + ',i=' + iterations; @@ -230,7 +253,7 @@ class NeonClient extends Client { ',' + clientFinalMessageWithoutProof; - const csHmacKey = await crypto.subtle.importKey( + const csHmacKey = await cs.importKey( 'raw', storedKey, { name: 'HMAC', hash: { name: 'SHA-256' } }, @@ -238,26 +261,26 @@ class NeonClient extends Client { ['sign'], ); var clientSignature = new Uint8Array( - await crypto.subtle.sign('HMAC', csHmacKey, enc.encode(authMessage)), + await cs.sign('HMAC', csHmacKey, enc.encode(authMessage)), ); var clientProofBytes = Buffer.from( clientKey.map((_, i) => clientKey[i] ^ clientSignature[i]), ); var clientProof = clientProofBytes.toString('base64'); - const skHmacKey = await crypto.subtle.importKey( + const skHmacKey = await cs.importKey( 'raw', saltedPassword, { name: 'HMAC', hash: { name: 'SHA-256' } }, false, ['sign'], ); - const serverKey = await crypto.subtle.sign( + const serverKey = await cs.sign( 'HMAC', skHmacKey, enc.encode('Server Key'), ); - const ssbHmacKey = await crypto.subtle.importKey( + const ssbHmacKey = await cs.importKey( 'raw', serverKey, { name: 'HMAC', hash: { name: 'SHA-256' } }, @@ -265,7 +288,7 @@ class NeonClient extends Client { ['sign'], ); var serverSignatureBytes = Buffer.from( - await crypto.subtle.sign('HMAC', ssbHmacKey, enc.encode(authMessage)), + await cs.sign('HMAC', ssbHmacKey, enc.encode(authMessage)), ); session.message = 'SASLResponse'; @@ -290,11 +313,15 @@ function promisify(Promise: any, callback: any) { return { callback: cb, result: result }; } +/** + * The node-postgres `Pool` object re-exported with minor modifications. + * https://node-postgres.com/apis/pool + */ class NeonPool extends Pool { Client = NeonClient; hasFetchUnsupportedListeners = false; - on( + override on( event: 'error' | 'connect' | 'acquire' | 'release' | 'remove', listener: any, ) { @@ -302,8 +329,35 @@ class NeonPool extends Pool { return super.on(event as any, listener); } - // @ts-ignore -- is it even possible to make TS happy with these overloaded function types? - query(config?: any, values?: any, cb?: any) { + override addListener = this.on; + + override query(queryStream: T): T; + // tslint:disable:no-unnecessary-generics + override query( + queryConfig: QueryArrayConfig, + values?: QueryConfigValues, + ): Promise>; + override query( + queryConfig: QueryConfig, + ): Promise>; + override query( + queryTextOrConfig: string | QueryConfig, + values?: QueryConfigValues, + ): Promise>; + override query( + queryConfig: QueryArrayConfig, + callback: (err: Error, result: QueryArrayResult) => void, + ): void; + override query( + queryTextOrConfig: string | QueryConfig, + callback: (err: Error, result: QueryResult) => void, + ): void; + override query( + queryText: string, + values: QueryConfigValues, + callback: (err: Error, result: QueryResult) => void, + ): void; + override query(config?: any, values?: any, cb?: any) { if ( !Socket.poolQueryViaFetch || this.hasFetchUnsupportedListeners || @@ -325,8 +379,8 @@ class NeonPool extends Pool { try { const cp = new ConnectionParameters(this.options) as ConnectionParameters; - const euc = encodeURIComponent, - eu = encodeURI; + const euc = encodeURIComponent; + const eu = encodeURI; const connectionString = `postgresql://${euc(cp.user)}:${euc(cp.password)}@${euc(cp.host)}/${eu(cp.database)}`; const queryText = typeof config === 'string' ? config : config.text; @@ -350,6 +404,34 @@ class NeonPool extends Pool { } } +export { defaults, types, ClientBase } from 'pg'; +export type { + BindConfig, + ClientConfig, + Connection, + ConnectionConfig, + CustomTypesConfig, + Defaults, + Events, + ExecuteConfig, + FieldDef, + MessageConfig, + Notification, + PoolConfig, + Query, + QueryArrayConfig, + QueryArrayResult, + QueryConfig, + QueryParse, + QueryResult, + QueryResultBase, + QueryResultRow, + ResultBuilder, + Submittable, +} from 'pg'; + +export * from './httpQuery'; + export { Socket as neonConfig, NeonPool as Pool, @@ -358,11 +440,16 @@ export { NeonDbError, }; -export { - Connection, - DatabaseError, - Query, - ClientBase, - defaults, - types, -} from 'pg'; +export type { + SocketDefaults, + FetchEndpointOptions, + WebSocketConstructor, + WebSocketLike, + subtls, +} from '../shims/net'; + +// for debugging purposes, this gets defined by esbuild, so users can track +// whether they've imported .js (CJS) or .mjs (ESM) or (uh-oh) both +// @ts-ignore +const _bundleExt: 'js' | 'mjs' = BUNDLE_EXT; +export { _bundleExt }; diff --git a/export/neonConfig.ts b/export/neonConfig.ts deleted file mode 100644 index 9dc40cc..0000000 --- a/export/neonConfig.ts +++ /dev/null @@ -1,149 +0,0 @@ -export interface NeonConfigGlobalOnly { - /** - * Set `fetchEndpoint` to set the server endpoint to be sent queries via http - * fetch. May be useful in local development (e.g. to set a port that's not - * the default 443). - * - * Provide either the full endpoint URL, or a function that takes the - * database host address and port and returns the full endpoint URL - * (including protocol). - * - * Default: `host => 'https://' + host + '/sql'` - * - */ - fetchEndpoint: string | ((host: string, port: number | string) => string); - - /** - * **Experimentally**, when `poolQueryViaFetch` is `true`, and no listeners - * for the `"connect"`, `"acquire"`, `"release"` or `"remove"` events are set - * on the `Pool`, queries via `Pool.query()` will be sent by low-latency HTTP - * fetch request. - * - * Default: `false`. - */ - poolQueryViaFetch: boolean; - - /** - * **Experimentally**, when `fetchConnectionCache` is `true`, queries carried - * via HTTP fetch make use of a connection cache on the server. - * - * Default: `false`. - */ - fetchConnectionCache: boolean; - - /** - * The `fetchFunction` option allows you to supply an alternative function - * for making http requests. The function must accept the same arguments as - * native `fetch`. - * - * Default: `undefined`. - */ - fetchFunction: any; -} - -export interface NeonConfigGlobalAndClient { - /** - * If no global `WebSocket` object is available, set `webSocketConstructor` - * to the constructor for a custom WebSocket implementation, such as those - * provided by `ws` or `undici`. - */ - webSocketConstructor: any; - - /** - * Set `wsProxy` to use your own WebSocket proxy server. - * - * Provide either the proxy server’s domain name, or a function that takes - * the database host and port and returns the proxy server address (without - * protocol). - * - * Example: `(host, port) => "myproxy.example.net?address=" + host + ":" + port` - * - * Default: `host => host + '/v2'` - */ - wsProxy: - | string - | ((host: string, port: number | string) => string) - | undefined; - - /** - * Use a secure (`wss:`) connection to the WebSocket proxy. - * - * Default: `true`. - */ - useSecureWebSocket: boolean; - - /** - * Disable TLS encryption in the Postgres protocol (as set via e.g. - * `?sslmode=require` in the connection string). Connection remains secure - * if `useSecureWebSocket` is `true`. - * - * Default: `true` - */ - forceDisablePgSSL: boolean; - - /** - * Pipelines the startup message, cleartext password message and first query - * when set to `"password"`. This works only for cleartext password auth. - * - * Default: `"password"`. - */ - pipelineConnect: 'password' | false; - - /** - * If `forceDisablePgSSL` is `false` and the Postgres connection parameters - * specify TLS, you must supply the subtls TLS library to this option: - * - * ``` - * import { neonConfig } from '@neondatabase/serverless'; - * import * as subtls from 'subtls'; - * neonConfig.subtls = subtls; - * ``` - * - * Default: `undefined`. - */ - subtls: any; - - /** - * Pipeline the pg SSL request and TLS handshake when `forceDisablePgSSL` is - * `false` and the Postgres connection parameters specify TLS. Currently - * compatible only with Neon hosts. - * - * Default: `false`. - */ - pipelineTLS: boolean; - - /** - * Set `rootCerts` to a string comprising one or more PEM files. These are - * the trusted root certificates for a TLS connection to Postgres when - * `forceDisablePgSSL` is `false` and the Postgres connection parameters - * specify TLS. - * - * Default: `""`. - */ - rootCerts: string; - - /** - * Batch multiple network writes per run-loop into a single outgoing - * WebSocket message. - * - * Default: `true`. - */ - coalesceWrites: boolean; - - /** - * When `disableSNI` is `true`, `forceDisablePgSSL` is `false` and the - * Postgres connection parameters specify TLS, we send no SNI data in the - * Postgres TLS handshake. - * - * On Neon, disabling SNI and including the Neon project name in the password - * avoids CPU-intensive SCRAM authentication, but this is only relevant for - * earlier iterations of Neon's WebSocket support. - * - * Default: `false`. - */ - disableSNI: boolean; -} - -export interface NeonConfig - extends NeonConfigGlobalOnly, - NeonConfigGlobalAndClient {} diff --git a/package-lock.json b/package-lock.json index 6a191e6..5f46e31 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,25 +25,116 @@ "stream": "file:shims/stream", "string_decoder": "file:shims/string_decoder", "tls": "file:shims/tls", - "undici": "^6.0.1", + "undici": "^7.1.0", "url": "file:shims/url", "util": "file:shims/util", "ws": "^8.12.1" }, "devDependencies": { - "@cloudflare/workers-types": "^4.20230115.0", + "@cloudflare/workers-types": "^4.20241230.0", + "@edge-runtime/vm": "^5.0.0", + "@microsoft/api-extractor": "^7.48.1", + "@neondatabase/serverless": "file:dist/npm", + "@prisma/adapter-neon": "^6.2.1", + "@prisma/client": "^6.2.1", "@types/events": "^3.0.0", "@types/pg": "^8.6.5", "@types/ws": "^8.5.4", + "@vercel/edge": "^1.2.1", + "@vercel/sdk": "^1.2.2", + "@vitest/browser": "^2.1.8", "dotenv": "^16.0.3", + "drizzle-orm": "^0.38.3", "esbuild": "^0.24.0", "fast-equals": "^5.0.1", - "subtls": "^0.3.0", + "node-fetch": "^3.3.2", + "playwright": "^1.49.1", + "prisma": "^6.2.1", + "subtls": "^0.4.6", "typescript": "^5.0.4", - "vitest": "^2.1.6", + "vitest": "^2.1.8", "wrangler": "^3.0.1" } }, + "dist/npm": { + "name": "@neondatabase/serverless", + "version": "0.10.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "^22.10.2", + "@types/pg": "^8.8.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz", + "integrity": "sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bundled-es-modules/cookie": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@bundled-es-modules/cookie/-/cookie-2.0.1.tgz", + "integrity": "sha512-8o+5fRPLNbjbdGRRmJj3h6Hh1AQJf2dk3qQ/5ZFb+PXkRNiSoMGGUKlsgLfrxneb72axVJyIYji64E2+nNfYyw==", + "dev": true, + "license": "ISC", + "dependencies": { + "cookie": "^0.7.2" + } + }, + "node_modules/@bundled-es-modules/statuses": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@bundled-es-modules/statuses/-/statuses-1.0.1.tgz", + "integrity": "sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg==", + "dev": true, + "license": "ISC", + "dependencies": { + "statuses": "^2.0.1" + } + }, + "node_modules/@bundled-es-modules/tough-cookie": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@bundled-es-modules/tough-cookie/-/tough-cookie-0.1.6.tgz", + "integrity": "sha512-dvMHbL464C0zI+Yqxbz6kZ5TOEp7GLW+pry/RWndAR8MJQAXZ2rPmIs8tziTZjeIyhSNZgZbCePtfSbdWqStJw==", + "dev": true, + "license": "ISC", + "dependencies": { + "@types/tough-cookie": "^4.0.5", + "tough-cookie": "^4.1.4" + } + }, "node_modules/@cloudflare/kv-asset-handler": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.3.4.tgz", @@ -58,9 +149,9 @@ } }, "node_modules/@cloudflare/workerd-darwin-64": { - "version": "1.20241106.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20241106.1.tgz", - "integrity": "sha512-zxvaToi1m0qzAScrxFt7UvFVqU8DxrCO2CinM1yQkv5no7pA1HolpIrwZ0xOhR3ny64Is2s/J6BrRjpO5dM9Zw==", + "version": "1.20241230.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20241230.0.tgz", + "integrity": "sha512-BZHLg4bbhNQoaY1Uan81O3FV/zcmWueC55juhnaI7NAobiQth9RppadPNpxNAmS9fK2mR5z8xrwMQSQrHmztyQ==", "cpu": [ "x64" ], @@ -75,9 +166,9 @@ } }, "node_modules/@cloudflare/workerd-darwin-arm64": { - "version": "1.20241106.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20241106.1.tgz", - "integrity": "sha512-j3dg/42D/bPgfNP3cRUBxF+4waCKO/5YKwXNj+lnVOwHxDu+ne5pFw9TIkKYcWTcwn0ZUkbNZNM5rhJqRn4xbg==", + "version": "1.20241230.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20241230.0.tgz", + "integrity": "sha512-lllxycj7EzYoJ0VOJh8M3palUgoonVrILnzGrgsworgWlIpgjfXGS7b41tEGCw6AxSxL9prmTIGtfSPUvn/rjg==", "cpu": [ "arm64" ], @@ -92,9 +183,9 @@ } }, "node_modules/@cloudflare/workerd-linux-64": { - "version": "1.20241106.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20241106.1.tgz", - "integrity": "sha512-Ih+Ye8E1DMBXcKrJktGfGztFqHKaX1CeByqshmTbODnWKHt6O65ax3oTecUwyC0+abuyraOpAtdhHNpFMhUkmw==", + "version": "1.20241230.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20241230.0.tgz", + "integrity": "sha512-Y3mHcW0KghOmWdNZyHYpEOG4Ba/ga8tht5vj1a+WXfagEjMO8Y98XhZUlCaYa9yB7Wh5jVcK5LM2jlO/BLgqpA==", "cpu": [ "x64" ], @@ -109,9 +200,9 @@ } }, "node_modules/@cloudflare/workerd-linux-arm64": { - "version": "1.20241106.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20241106.1.tgz", - "integrity": "sha512-mdQFPk4+14Yywn7n1xIzI+6olWM8Ybz10R7H3h+rk0XulMumCWUCy1CzIDauOx6GyIcSgKIibYMssVHZR30ObA==", + "version": "1.20241230.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20241230.0.tgz", + "integrity": "sha512-IAjhsWPlHzhhkJ6I49sDG6XfMnhPvv0szKGXxTWQK/IWMrbGdHm4RSfNKBSoLQm67jGMIzbmcrX9UIkms27Y1g==", "cpu": [ "arm64" ], @@ -126,9 +217,9 @@ } }, "node_modules/@cloudflare/workerd-windows-64": { - "version": "1.20241106.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20241106.1.tgz", - "integrity": "sha512-4rtcss31E/Rb/PeFocZfr+B9i1MdrkhsTBWizh8siNR4KMmkslU2xs2wPaH1z8+ErxkOsHrKRa5EPLh5rIiFeg==", + "version": "1.20241230.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20241230.0.tgz", + "integrity": "sha512-y5SPIk9iOb2gz+yWtHxoeMnjPnkYQswiCJ480oHC6zexnJLlKTpcmBCjDH1nWCT4pQi8F25gaH8thgElf4NvXQ==", "cpu": [ "x64" ], @@ -142,24 +233,10 @@ "node": ">=16" } }, - "node_modules/@cloudflare/workers-shared": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workers-shared/-/workers-shared-0.8.0.tgz", - "integrity": "sha512-1OvFkNtslaMZAJsaocTmbACApgmWv55uLpNj50Pn2MGcxdAjpqykXJFQw5tKc+lGV9TDZh9oO3Rsk17IEQDzIg==", - "dev": true, - "license": "MIT OR Apache-2.0", - "dependencies": { - "mime": "^3.0.0", - "zod": "^3.22.3" - }, - "engines": { - "node": ">=16.7.0" - } - }, "node_modules/@cloudflare/workers-types": { - "version": "4.20241112.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20241112.0.tgz", - "integrity": "sha512-Q4p9bAWZrX14bSCKY9to19xl0KMU7nsO5sJ2cTVspHoypsjPUMeQCsjHjmsO2C4Myo8/LPeDvmqFmkyNAPPYZw==", + "version": "4.20241230.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20241230.0.tgz", + "integrity": "sha512-dtLD4jY35Lb750cCVyO1i/eIfdZJg2Z0i+B1RYX6BVeRPlgaHx/H18ImKAkYmy0g09Ow8R2jZy3hIxMgXun0WQ==", "dev": true, "license": "MIT OR Apache-2.0" }, @@ -176,6 +253,29 @@ "node": ">=12" } }, + "node_modules/@edge-runtime/primitives": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@edge-runtime/primitives/-/primitives-6.0.0.tgz", + "integrity": "sha512-FqoxaBT+prPBHBwE1WXS1ocnu/VLTQyZ6NMUBAdbP7N2hsFTTxMC/jMu2D/8GAlMQfxeuppcPuCUk/HO3fpIvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@edge-runtime/vm": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@edge-runtime/vm/-/vm-5.0.0.tgz", + "integrity": "sha512-NKBGBSIKUG584qrS1tyxVpX/AKJKQw5HgjYEnPLC0QsTw79JrGn+qUr8CXFb955Iy7GUdiiUv1rJ6JBGvaKb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@edge-runtime/primitives": "6.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@esbuild-plugins/node-globals-polyfill": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@esbuild-plugins/node-globals-polyfill/-/node-globals-polyfill-0.2.3.tgz", @@ -200,23 +300,10 @@ "esbuild": "*" } }, - "node_modules/@esbuild-plugins/node-modules-polyfill/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz", - "integrity": "sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.2.tgz", + "integrity": "sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==", "cpu": [ "ppc64" ], @@ -231,9 +318,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.0.tgz", - "integrity": "sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.2.tgz", + "integrity": "sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==", "cpu": [ "arm" ], @@ -248,9 +335,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.0.tgz", - "integrity": "sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.2.tgz", + "integrity": "sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==", "cpu": [ "arm64" ], @@ -265,9 +352,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.0.tgz", - "integrity": "sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.2.tgz", + "integrity": "sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==", "cpu": [ "x64" ], @@ -282,9 +369,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz", - "integrity": "sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.2.tgz", + "integrity": "sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==", "cpu": [ "arm64" ], @@ -299,9 +386,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.0.tgz", - "integrity": "sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.2.tgz", + "integrity": "sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==", "cpu": [ "x64" ], @@ -316,9 +403,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.0.tgz", - "integrity": "sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.2.tgz", + "integrity": "sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==", "cpu": [ "arm64" ], @@ -333,9 +420,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.0.tgz", - "integrity": "sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.2.tgz", + "integrity": "sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==", "cpu": [ "x64" ], @@ -350,9 +437,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.0.tgz", - "integrity": "sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.2.tgz", + "integrity": "sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==", "cpu": [ "arm" ], @@ -367,9 +454,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.0.tgz", - "integrity": "sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.2.tgz", + "integrity": "sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==", "cpu": [ "arm64" ], @@ -384,9 +471,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.0.tgz", - "integrity": "sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.2.tgz", + "integrity": "sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==", "cpu": [ "ia32" ], @@ -401,9 +488,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.0.tgz", - "integrity": "sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.2.tgz", + "integrity": "sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==", "cpu": [ "loong64" ], @@ -418,9 +505,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.0.tgz", - "integrity": "sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.2.tgz", + "integrity": "sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==", "cpu": [ "mips64el" ], @@ -435,9 +522,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.0.tgz", - "integrity": "sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.2.tgz", + "integrity": "sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==", "cpu": [ "ppc64" ], @@ -452,9 +539,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.0.tgz", - "integrity": "sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.2.tgz", + "integrity": "sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==", "cpu": [ "riscv64" ], @@ -469,9 +556,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.0.tgz", - "integrity": "sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.2.tgz", + "integrity": "sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==", "cpu": [ "s390x" ], @@ -486,9 +573,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.0.tgz", - "integrity": "sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.2.tgz", + "integrity": "sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==", "cpu": [ "x64" ], @@ -502,10 +589,27 @@ "node": ">=18" } }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.24.2.tgz", + "integrity": "sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.0.tgz", - "integrity": "sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.2.tgz", + "integrity": "sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==", "cpu": [ "x64" ], @@ -520,9 +624,9 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.0.tgz", - "integrity": "sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.2.tgz", + "integrity": "sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==", "cpu": [ "arm64" ], @@ -537,9 +641,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.0.tgz", - "integrity": "sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.2.tgz", + "integrity": "sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==", "cpu": [ "x64" ], @@ -554,9 +658,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.0.tgz", - "integrity": "sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.2.tgz", + "integrity": "sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==", "cpu": [ "x64" ], @@ -571,9 +675,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.0.tgz", - "integrity": "sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.2.tgz", + "integrity": "sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==", "cpu": [ "arm64" ], @@ -588,9 +692,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.0.tgz", - "integrity": "sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.2.tgz", + "integrity": "sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==", "cpu": [ "ia32" ], @@ -605,9 +709,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz", - "integrity": "sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.2.tgz", + "integrity": "sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==", "cpu": [ "x64" ], @@ -631,6 +735,67 @@ "node": ">=14" } }, + "node_modules/@inquirer/confirm": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.1.1.tgz", + "integrity": "sha512-vVLSbGci+IKQvDOtzpPTCOiEJCNidHcAq9JYVoWTW0svb5FiwSLotkM+JXNXejfjnzVYV9n0DTBythl9+XgTxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^10.1.2", + "@inquirer/type": "^3.0.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, + "node_modules/@inquirer/core": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.1.2.tgz", + "integrity": "sha512-bHd96F3ezHg1mf/J0Rb4CV8ndCN0v28kUlrHqP7+ECm1C/A+paB7Xh2lbMk6x+kweQC+rZOxM/YeKikzxco8bQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/figures": "^1.0.9", + "@inquirer/type": "^3.0.2", + "ansi-escapes": "^4.3.2", + "cli-width": "^4.1.0", + "mute-stream": "^2.0.0", + "signal-exit": "^4.1.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^6.2.0", + "yoctocolors-cjs": "^2.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/figures": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.9.tgz", + "integrity": "sha512-BXvGj0ehzrngHTPTDqUoDT3NXL8U0RxUk2zJm2A66RhCEIWdtU1v6GuUqNAgArW4PQ9CinqIWyHdQgdwOj06zQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@inquirer/type": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.2.tgz", + "integrity": "sha512-ZhQ4TvhwHZF+lGhQ2O/rsjo80XoZR5/5qhOY3t6FJuX5XBg5Be8YzYTvaUGJnc12AUGI2nr4QSUE4PhKSigx7g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + } + }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", @@ -659,10 +824,214 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@microsoft/api-extractor": { + "version": "7.49.0", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.49.0.tgz", + "integrity": "sha512-X5b462k0/yl8qWdGx3siq5vyI8fTDU9fRnwqTMlGHqFhLxpASmLWA2EU6nft+ZG8cQM2HRZlr4HSo62UqiAnug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@microsoft/api-extractor-model": "7.30.1", + "@microsoft/tsdoc": "~0.15.1", + "@microsoft/tsdoc-config": "~0.17.1", + "@rushstack/node-core-library": "5.10.1", + "@rushstack/rig-package": "0.5.3", + "@rushstack/terminal": "0.14.4", + "@rushstack/ts-command-line": "4.23.2", + "lodash": "~4.17.15", + "minimatch": "~3.0.3", + "resolve": "~1.22.1", + "semver": "~7.5.4", + "source-map": "~0.6.1", + "typescript": "5.7.2" + }, + "bin": { + "api-extractor": "bin/api-extractor" + } + }, + "node_modules/@microsoft/api-extractor-model": { + "version": "7.30.1", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.30.1.tgz", + "integrity": "sha512-CTS2PlASJHxVY8hqHORVb1HdECWOEMcMnM6/kDkPr0RZapAFSIHhg9D4jxuE8g+OWYHtPc10LCpmde5pylTRlA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@microsoft/tsdoc": "~0.15.1", + "@microsoft/tsdoc-config": "~0.17.1", + "@rushstack/node-core-library": "5.10.1" + } + }, + "node_modules/@microsoft/tsdoc": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.15.1.tgz", + "integrity": "sha512-4aErSrCR/On/e5G2hDP0wjooqDdauzEbIq8hIkIe5pXV0rtWJZvdCEKL0ykZxex+IxIwBp0eGeV48hQN07dXtw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@microsoft/tsdoc-config": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.17.1.tgz", + "integrity": "sha512-UtjIFe0C6oYgTnad4q1QP4qXwLhe6tIpNTRStJ2RZEPIkqQPREAwE5spzVxsdn9UaEMUqhh0AqSx3X4nWAKXWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@microsoft/tsdoc": "0.15.1", + "ajv": "~8.12.0", + "jju": "~1.4.0", + "resolve": "~1.22.2" + } + }, + "node_modules/@mswjs/interceptors": { + "version": "0.37.5", + "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.37.5.tgz", + "integrity": "sha512-AAwRb5vXFcY4L+FvZ7LZusDuZ0vEe0Zm8ohn1FM6/X7A3bj4mqmkAcGRWuvC2JwSygNwHAAmMnAI73vPHeqsHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@open-draft/deferred-promise": "^2.2.0", + "@open-draft/logger": "^0.3.0", + "@open-draft/until": "^2.0.0", + "is-node-process": "^1.2.0", + "outvariant": "^1.4.3", + "strict-event-emitter": "^0.5.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@neondatabase/serverless": { + "resolved": "dist/npm", + "link": true + }, + "node_modules/@open-draft/deferred-promise": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@open-draft/deferred-promise/-/deferred-promise-2.2.0.tgz", + "integrity": "sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@open-draft/logger": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@open-draft/logger/-/logger-0.3.0.tgz", + "integrity": "sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-node-process": "^1.2.0", + "outvariant": "^1.4.0" + } + }, + "node_modules/@open-draft/until": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@open-draft/until/-/until-2.1.0.tgz", + "integrity": "sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@polka/url": { + "version": "1.0.0-next.28", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.28.tgz", + "integrity": "sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@prisma/adapter-neon": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@prisma/adapter-neon/-/adapter-neon-6.2.1.tgz", + "integrity": "sha512-xpgxQB9f1Mcvoqukqwl765Iew/8uahFnSmdz3D/LcjE+AQqlNRT0HJlIC2u1z2Se/VzayansY9hImYs6jSf/ew==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/driver-adapter-utils": "6.2.1", + "postgres-array": "3.0.2" + }, + "peerDependencies": { + "@neondatabase/serverless": "^0.6.0 || ^0.7.0 || ^0.8.0 || ^0.9.0 || ^0.10.0" + } + }, + "node_modules/@prisma/client": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.2.1.tgz", + "integrity": "sha512-msKY2iRLISN8t5X0Tj7hU0UWet1u0KuxSPHWuf3IRkB4J95mCvGpyQBfQ6ufcmvKNOMQSq90O2iUmJEN2e5fiA==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "peerDependencies": { + "prisma": "*" + }, + "peerDependenciesMeta": { + "prisma": { + "optional": true + } + } + }, + "node_modules/@prisma/debug": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.2.1.tgz", + "integrity": "sha512-0KItvt39CmQxWkEw6oW+RQMD6RZ43SJWgEUnzxN8VC9ixMysa7MzZCZf22LCK5DSooiLNf8vM3LHZm/I/Ni7bQ==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/@prisma/driver-adapter-utils": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@prisma/driver-adapter-utils/-/driver-adapter-utils-6.2.1.tgz", + "integrity": "sha512-Bx0z0jHekcokfckg2R0y9HO4F0LMrvTs8xgSoNpbnA5wtc83VwsaLrQFlZ7AKupAGIUpd+9X+MmNQQ0ES/7Vhw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "6.2.1" + } + }, + "node_modules/@prisma/engines": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.2.1.tgz", + "integrity": "sha512-lTBNLJBCxVT9iP5I7Mn6GlwqAxTpS5qMERrhebkUhtXpGVkBNd/jHnNJBZQW4kGDCKaQg/r2vlJYkzOHnAb7ZQ==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "6.2.1", + "@prisma/engines-version": "6.2.0-14.4123509d24aa4dede1e864b46351bf2790323b69", + "@prisma/fetch-engine": "6.2.1", + "@prisma/get-platform": "6.2.1" + } + }, + "node_modules/@prisma/engines-version": { + "version": "6.2.0-14.4123509d24aa4dede1e864b46351bf2790323b69", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.2.0-14.4123509d24aa4dede1e864b46351bf2790323b69.tgz", + "integrity": "sha512-7tw1qs/9GWSX6qbZs4He09TOTg1ff3gYsB3ubaVNN0Pp1zLm9NC5C5MZShtkz7TyQjx7blhpknB7HwEhlG+PrQ==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/@prisma/fetch-engine": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.2.1.tgz", + "integrity": "sha512-OO7O9d6Mrx2F9i+Gu1LW+DGXXyUFkP7OE5aj9iBfA/2jjDXEJjqa9X0ZmM9NZNo8Uo7ql6zKm6yjDcbAcRrw1A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "6.2.1", + "@prisma/engines-version": "6.2.0-14.4123509d24aa4dede1e864b46351bf2790323b69", + "@prisma/get-platform": "6.2.1" + } + }, + "node_modules/@prisma/get-platform": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.2.1.tgz", + "integrity": "sha512-zp53yvroPl5m5/gXYLz7tGCNG33bhG+JYCm74ohxOq1pPnrL47VQYFfF3RbTZ7TzGWCrR3EtoiYMywUBw7UK6Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "6.2.1" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.27.4.tgz", - "integrity": "sha512-2Y3JT6f5MrQkICUyRVCw4oa0sutfAsgaSsb0Lmmy1Wi2y7X5vT9Euqw4gOsCyy0YfKURBg35nhUKZS4mDcfULw==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.30.1.tgz", + "integrity": "sha512-pSWY+EVt3rJ9fQ3IqlrEUtXh3cGqGtPDH1FQlNZehO2yYxCHEX1SPsz1M//NXwYfbTlcKr9WObLnJX9FsS9K1Q==", "cpu": [ "arm" ], @@ -674,9 +1043,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.27.4.tgz", - "integrity": "sha512-wzKRQXISyi9UdCVRqEd0H4cMpzvHYt1f/C3CoIjES6cG++RHKhrBj2+29nPF0IB5kpy9MS71vs07fvrNGAl/iA==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.30.1.tgz", + "integrity": "sha512-/NA2qXxE3D/BRjOJM8wQblmArQq1YoBVJjrjoTSBS09jgUisq7bqxNHJ8kjCHeV21W/9WDGwJEWSN0KQ2mtD/w==", "cpu": [ "arm64" ], @@ -688,9 +1057,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.27.4.tgz", - "integrity": "sha512-PlNiRQapift4LNS8DPUHuDX/IdXiLjf8mc5vdEmUR0fF/pyy2qWwzdLjB+iZquGr8LuN4LnUoSEvKRwjSVYz3Q==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.30.1.tgz", + "integrity": "sha512-r7FQIXD7gB0WJ5mokTUgUWPl0eYIH0wnxqeSAhuIwvnnpjdVB8cRRClyKLQr7lgzjctkbp5KmswWszlwYln03Q==", "cpu": [ "arm64" ], @@ -702,9 +1071,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.27.4.tgz", - "integrity": "sha512-o9bH2dbdgBDJaXWJCDTNDYa171ACUdzpxSZt+u/AAeQ20Nk5x+IhA+zsGmrQtpkLiumRJEYef68gcpn2ooXhSQ==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.30.1.tgz", + "integrity": "sha512-x78BavIwSH6sqfP2xeI1hd1GpHL8J4W2BXcVM/5KYKoAD3nNsfitQhvWSw+TFtQTLZ9OmlF+FEInEHyubut2OA==", "cpu": [ "x64" ], @@ -716,9 +1085,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.27.4.tgz", - "integrity": "sha512-NBI2/i2hT9Q+HySSHTBh52da7isru4aAAo6qC3I7QFVsuhxi2gM8t/EI9EVcILiHLj1vfi+VGGPaLOUENn7pmw==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.30.1.tgz", + "integrity": "sha512-HYTlUAjbO1z8ywxsDFWADfTRfTIIy/oUlfIDmlHYmjUP2QRDTzBuWXc9O4CXM+bo9qfiCclmHk1x4ogBjOUpUQ==", "cpu": [ "arm64" ], @@ -730,9 +1099,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.27.4.tgz", - "integrity": "sha512-wYcC5ycW2zvqtDYrE7deary2P2UFmSh85PUpAx+dwTCO9uw3sgzD6Gv9n5X4vLaQKsrfTSZZ7Z7uynQozPVvWA==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.30.1.tgz", + "integrity": "sha512-1MEdGqogQLccphhX5myCJqeGNYTNcmTyaic9S7CG3JhwuIByJ7J05vGbZxsizQthP1xpVx7kd3o31eOogfEirw==", "cpu": [ "x64" ], @@ -744,9 +1113,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.27.4.tgz", - "integrity": "sha512-9OwUnK/xKw6DyRlgx8UizeqRFOfi9mf5TYCw1uolDaJSbUmBxP85DE6T4ouCMoN6pXw8ZoTeZCSEfSaYo+/s1w==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.30.1.tgz", + "integrity": "sha512-PaMRNBSqCx7K3Wc9QZkFx5+CX27WFpAMxJNiYGAXfmMIKC7jstlr32UhTgK6T07OtqR+wYlWm9IxzennjnvdJg==", "cpu": [ "arm" ], @@ -758,9 +1127,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.27.4.tgz", - "integrity": "sha512-Vgdo4fpuphS9V24WOV+KwkCVJ72u7idTgQaBoLRD0UxBAWTF9GWurJO9YD9yh00BzbkhpeXtm6na+MvJU7Z73A==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.30.1.tgz", + "integrity": "sha512-B8Rcyj9AV7ZlEFqvB5BubG5iO6ANDsRKlhIxySXcF1axXYUyqwBok+XZPgIYGBgs7LDXfWfifxhw0Ik57T0Yug==", "cpu": [ "arm" ], @@ -772,9 +1141,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.27.4.tgz", - "integrity": "sha512-pleyNgyd1kkBkw2kOqlBx+0atfIIkkExOTiifoODo6qKDSpnc6WzUY5RhHdmTdIJXBdSnh6JknnYTtmQyobrVg==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.30.1.tgz", + "integrity": "sha512-hqVyueGxAj3cBKrAI4aFHLV+h0Lv5VgWZs9CUGqr1z0fZtlADVV1YPOij6AhcK5An33EXaxnDLmJdQikcn5NEw==", "cpu": [ "arm64" ], @@ -786,9 +1155,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.27.4.tgz", - "integrity": "sha512-caluiUXvUuVyCHr5DxL8ohaaFFzPGmgmMvwmqAITMpV/Q+tPoaHZ/PWa3t8B2WyoRcIIuu1hkaW5KkeTDNSnMA==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.30.1.tgz", + "integrity": "sha512-i4Ab2vnvS1AE1PyOIGp2kXni69gU2DAUVt6FSXeIqUCPIR3ZlheMW3oP2JkukDfu3PsexYRbOiJrY+yVNSk9oA==", "cpu": [ "arm64" ], @@ -799,10 +1168,24 @@ "linux" ] }, + "node_modules/@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.30.1.tgz", + "integrity": "sha512-fARcF5g296snX0oLGkVxPmysetwUk2zmHcca+e9ObOovBR++9ZPOhqFUM61UUZ2EYpXVPN1redgqVoBB34nTpQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.27.4.tgz", - "integrity": "sha512-FScrpHrO60hARyHh7s1zHE97u0KlT/RECzCKAdmI+LEoC1eDh/RDji9JgFqyO+wPDb86Oa/sXkily1+oi4FzJQ==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.30.1.tgz", + "integrity": "sha512-GLrZraoO3wVT4uFXh67ElpwQY0DIygxdv0BNW9Hkm3X34wu+BkqrDrkcsIapAY+N2ATEbvak0XQ9gxZtCIA5Rw==", "cpu": [ "ppc64" ], @@ -814,9 +1197,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.27.4.tgz", - "integrity": "sha512-qyyprhyGb7+RBfMPeww9FlHwKkCXdKHeGgSqmIXw9VSUtvyFZ6WZRtnxgbuz76FK7LyoN8t/eINRbPUcvXB5fw==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.30.1.tgz", + "integrity": "sha512-0WKLaAUUHKBtll0wvOmh6yh3S0wSU9+yas923JIChfxOaaBarmb/lBKPF0w/+jTVozFnOXJeRGZ8NvOxvk/jcw==", "cpu": [ "riscv64" ], @@ -828,9 +1211,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.27.4.tgz", - "integrity": "sha512-PFz+y2kb6tbh7m3A7nA9++eInGcDVZUACulf/KzDtovvdTizHpZaJty7Gp0lFwSQcrnebHOqxF1MaKZd7psVRg==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.30.1.tgz", + "integrity": "sha512-GWFs97Ruxo5Bt+cvVTQkOJ6TIx0xJDD/bMAOXWJg8TCSTEK8RnFeOeiFTxKniTc4vMIaWvCplMAFBt9miGxgkA==", "cpu": [ "s390x" ], @@ -842,9 +1225,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.27.4.tgz", - "integrity": "sha512-Ni8mMtfo+o/G7DVtweXXV/Ol2TFf63KYjTtoZ5f078AUgJTmaIJnj4JFU7TK/9SVWTaSJGxPi5zMDgK4w+Ez7Q==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.30.1.tgz", + "integrity": "sha512-UtgGb7QGgXDIO+tqqJ5oZRGHsDLO8SlpE4MhqpY9Llpzi5rJMvrK6ZGhsRCST2abZdBqIBeXW6WPD5fGK5SDwg==", "cpu": [ "x64" ], @@ -856,9 +1239,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.27.4.tgz", - "integrity": "sha512-5AeeAF1PB9TUzD+3cROzFTnAJAcVUGLuR8ng0E0WXGkYhp6RD6L+6szYVX+64Rs0r72019KHZS1ka1q+zU/wUw==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.30.1.tgz", + "integrity": "sha512-V9U8Ey2UqmQsBT+xTOeMzPzwDzyXmnAoO4edZhL7INkwQcaW1Ckv3WJX3qrrp/VHaDkEWIBWhRwP47r8cdrOow==", "cpu": [ "x64" ], @@ -870,9 +1253,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.27.4.tgz", - "integrity": "sha512-yOpVsA4K5qVwu2CaS3hHxluWIK5HQTjNV4tWjQXluMiiiu4pJj4BN98CvxohNCpcjMeTXk/ZMJBRbgRg8HBB6A==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.30.1.tgz", + "integrity": "sha512-WabtHWiPaFF47W3PkHnjbmWawnX/aE57K47ZDT1BXTS5GgrBUEpvOzq0FI0V/UYzQJgdb8XlhVNH8/fwV8xDjw==", "cpu": [ "arm64" ], @@ -884,9 +1267,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.27.4.tgz", - "integrity": "sha512-KtwEJOaHAVJlxV92rNYiG9JQwQAdhBlrjNRp7P9L8Cb4Rer3in+0A+IPhJC9y68WAi9H0sX4AiG2NTsVlmqJeQ==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.30.1.tgz", + "integrity": "sha512-pxHAU+Zv39hLUTdQQHUVHf4P+0C47y/ZloorHpzs2SXMRqeAWmGghzAhfOlzFHHwjvgokdFAhC4V+6kC1lRRfw==", "cpu": [ "ia32" ], @@ -898,9 +1281,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.27.4.tgz", - "integrity": "sha512-3j4jx1TppORdTAoBJRd+/wJRGCPC0ETWkXOecJ6PPZLj6SptXkrXcNqdj0oclbKML6FkQltdz7bBA3rUSirZug==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.30.1.tgz", + "integrity": "sha512-D6qjsXGcvhTjv0kI4fU8tUuBDF/Ueee4SVX79VfNDXZa64TfCW1Slkb6Z7O1p7vflqZjcmOVdZlqf8gvJxc6og==", "cpu": [ "x64" ], @@ -911,32 +1294,172 @@ "win32" ] }, - "node_modules/@types/estree": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", - "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/events": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.3.tgz", - "integrity": "sha512-trOc4AAUThEz9hapPtSd7wf5tiQKvTtu5b371UxXdTuqzIh0ArcRspRP0i0Viu+LXstIQ1z96t1nsPxT9ol01g==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/node": { - "version": "22.10.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.0.tgz", - "integrity": "sha512-XC70cRZVElFHfIUB40FgZOBbgJYFKKMa5nb9lxcwYstFG/Mi+/Y0bGS+rs6Dmhmkpq4pnNiLiuZAbc02YCOnmA==", + "node_modules/@rushstack/node-core-library": { + "version": "5.10.1", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.10.1.tgz", + "integrity": "sha512-BSb/KcyBHmUQwINrgtzo6jiH0HlGFmrUy33vO6unmceuVKTEyL2q+P0fQq2oB5hvXVWOEUhxB2QvlkZluvUEmg==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~6.20.0" + "ajv": "~8.13.0", + "ajv-draft-04": "~1.0.0", + "ajv-formats": "~3.0.1", + "fs-extra": "~7.0.1", + "import-lazy": "~4.0.0", + "jju": "~1.4.0", + "resolve": "~1.22.1", + "semver": "~7.5.4" + }, + "peerDependencies": { + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } } }, - "node_modules/@types/node-forge": { - "version": "1.3.11", + "node_modules/@rushstack/node-core-library/node_modules/ajv": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", + "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.4.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@rushstack/rig-package": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.5.3.tgz", + "integrity": "sha512-olzSSjYrvCNxUFZowevC3uz8gvKr3WTpHQ7BkpjtRpA3wK+T0ybep/SRUMfr195gBzJm5gaXw0ZMgjIyHqJUow==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve": "~1.22.1", + "strip-json-comments": "~3.1.1" + } + }, + "node_modules/@rushstack/terminal": { + "version": "0.14.4", + "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.14.4.tgz", + "integrity": "sha512-NxACqERW0PHq8Rpq1V6v5iTHEwkRGxenjEW+VWqRYQ8T9puUzgmGHmEZUaUEDHAe9Qyvp0/Ew04sAiQw9XjhJg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rushstack/node-core-library": "5.10.1", + "supports-color": "~8.1.1" + }, + "peerDependencies": { + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@rushstack/ts-command-line": { + "version": "4.23.2", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.23.2.tgz", + "integrity": "sha512-JJ7XZX5K3ThBBva38aomgsPv1L7FV6XmSOcR6HtM7HDFZJkepqT65imw26h9ggGqMjsY0R9jcl30tzKcVj9aOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rushstack/terminal": "0.14.4", + "@types/argparse": "1.0.38", + "argparse": "~1.0.9", + "string-argv": "~0.3.1" + } + }, + "node_modules/@testing-library/dom": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.0.tgz", + "integrity": "sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/runtime": "^7.12.5", + "@types/aria-query": "^5.0.1", + "aria-query": "5.3.0", + "chalk": "^4.1.0", + "dom-accessibility-api": "^0.5.9", + "lz-string": "^1.5.0", + "pretty-format": "^27.0.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@testing-library/user-event": { + "version": "14.5.2", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.5.2.tgz", + "integrity": "sha512-YAh82Wh4TIrxYLmfGcixwD18oIjyC1pFQC2Y01F2lzV2HTMiYrI0nze0FD0ocB//CKS/7jIUgae+adPqxK5yCQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12", + "npm": ">=6" + }, + "peerDependencies": { + "@testing-library/dom": ">=7.21.4" + } + }, + "node_modules/@types/argparse": { + "version": "1.0.38", + "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", + "integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/aria-query": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", + "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/events": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.3.tgz", + "integrity": "sha512-trOc4AAUThEz9hapPtSd7wf5tiQKvTtu5b371UxXdTuqzIh0ArcRspRP0i0Viu+LXstIQ1z96t1nsPxT9ol01g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.10.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.5.tgz", + "integrity": "sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.20.0" + } + }, + "node_modules/@types/node-forge": { + "version": "1.3.11", "resolved": "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.11.tgz", "integrity": "sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==", "dev": true, @@ -957,6 +1480,20 @@ "pg-types": "^4.0.1" } }, + "node_modules/@types/statuses": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@types/statuses/-/statuses-2.0.5.tgz", + "integrity": "sha512-jmIUGWrAiwu3dZpxntxieC+1n/5c3mjrImkmOSQ2NC5uP6cYO4aAZDdSmRcI5C1oiTmqlZGHC+/NmJrKogbP5A==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/ws": { "version": "8.5.13", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.13.tgz", @@ -967,15 +1504,68 @@ "@types/node": "*" } }, + "node_modules/@vercel/edge": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@vercel/edge/-/edge-1.2.1.tgz", + "integrity": "sha512-1++yncEyIAi68D3UEOlytYb1IUcIulMWdoSzX2h9LuSeeyR7JtaIgR8DcTQ6+DmYOQn+5MCh6LY+UmK6QBByNA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/@vercel/sdk": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@vercel/sdk/-/sdk-1.2.2.tgz", + "integrity": "sha512-G7t8cFYgL/TrnZ3u/bvL3mZraZBjEAgaM6dv4BwHLC0+TomnsWwMTR2fR2odk5L8bR+FvnWO+jYif6r6zJx5Ng==", + "dev": true, + "peerDependencies": { + "zod": ">= 3" + } + }, + "node_modules/@vitest/browser": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/browser/-/browser-2.1.8.tgz", + "integrity": "sha512-OWVvEJThRgxlNMYNVLEK/9qVkpRcLvyuKLngIV3Hob01P56NjPHprVBYn+rx4xAJudbM9yrCrywPIEuA3Xyo8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@testing-library/dom": "^10.4.0", + "@testing-library/user-event": "^14.5.2", + "@vitest/mocker": "2.1.8", + "@vitest/utils": "2.1.8", + "magic-string": "^0.30.12", + "msw": "^2.6.4", + "sirv": "^3.0.0", + "tinyrainbow": "^1.2.0", + "ws": "^8.18.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "playwright": "*", + "vitest": "2.1.8", + "webdriverio": "*" + }, + "peerDependenciesMeta": { + "playwright": { + "optional": true + }, + "safaridriver": { + "optional": true + }, + "webdriverio": { + "optional": true + } + } + }, "node_modules/@vitest/expect": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.6.tgz", - "integrity": "sha512-9M1UR9CAmrhJOMoSwVnPh2rELPKhYo0m/CSgqw9PyStpxtkwhmdM6XYlXGKeYyERY1N6EIuzkQ7e3Lm1WKCoUg==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.8.tgz", + "integrity": "sha512-8ytZ/fFHq2g4PJVAtDX57mayemKgDR6X3Oa2Foro+EygiOJHUXhCqBAAKQYYajZpFoIfvBCF1j6R6IYRSIUFuw==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "2.1.6", - "@vitest/utils": "2.1.6", + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", "chai": "^5.1.2", "tinyrainbow": "^1.2.0" }, @@ -984,13 +1574,13 @@ } }, "node_modules/@vitest/mocker": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.6.tgz", - "integrity": "sha512-MHZp2Z+Q/A3am5oD4WSH04f9B0T7UvwEb+v5W0kCYMhtXGYbdyl2NUk1wdSMqGthmhpiThPDp/hEoVwu16+u1A==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.8.tgz", + "integrity": "sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "2.1.6", + "@vitest/spy": "2.1.8", "estree-walker": "^3.0.3", "magic-string": "^0.30.12" }, @@ -999,7 +1589,7 @@ }, "peerDependencies": { "msw": "^2.4.9", - "vite": "^5.0.0 || ^6.0.0" + "vite": "^5.0.0" }, "peerDependenciesMeta": { "msw": { @@ -1010,30 +1600,10 @@ } } }, - "node_modules/@vitest/mocker/node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.0" - } - }, - "node_modules/@vitest/mocker/node_modules/magic-string": { - "version": "0.30.14", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.14.tgz", - "integrity": "sha512-5c99P1WKTed11ZC0HMJOj6CDIue6F8ySu+bJL+85q1zBEIY8IklrJ1eiKC2NDRh3Ct3FcvmJPyQHb9erXMTJNw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0" - } - }, "node_modules/@vitest/pretty-format": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.6.tgz", - "integrity": "sha512-exZyLcEnHgDMKc54TtHca4McV4sKT+NKAe9ix/yhd/qkYb/TP8HTyXRFDijV19qKqTZM0hPL4753zU/U8L/gAA==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.8.tgz", + "integrity": "sha512-9HiSZ9zpqNLKlbIDRWOnAWqgcA7xu+8YxXSekhr0Ykab7PAYFkhkwoqVArPOtJhPmYeE2YHgKZlj3CP36z2AJQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1044,13 +1614,13 @@ } }, "node_modules/@vitest/runner": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.6.tgz", - "integrity": "sha512-SjkRGSFyrA82m5nz7To4CkRSEVWn/rwQISHoia/DB8c6IHIhaE/UNAo+7UfeaeJRE979XceGl00LNkIz09RFsA==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.8.tgz", + "integrity": "sha512-17ub8vQstRnRlIU5k50bG+QOMLHRhYPAna5tw8tYbj+jzjcspnwnwtPtiOlkuKC4+ixDPTuLZiqiWWQ2PSXHVg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "2.1.6", + "@vitest/utils": "2.1.8", "pathe": "^1.1.2" }, "funding": { @@ -1058,13 +1628,13 @@ } }, "node_modules/@vitest/snapshot": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.6.tgz", - "integrity": "sha512-5JTWHw8iS9l3v4/VSuthCndw1lN/hpPB+mlgn1BUhFbobeIUj1J1V/Bj2t2ovGEmkXLTckFjQddsxS5T6LuVWw==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.8.tgz", + "integrity": "sha512-20T7xRFbmnkfcmgVEz+z3AU/3b0cEzZOt/zmnvZEctg64/QZbSDJEVm9fLnnlSi74KibmRsO9/Qabi+t0vCRPg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.1.6", + "@vitest/pretty-format": "2.1.8", "magic-string": "^0.30.12", "pathe": "^1.1.2" }, @@ -1072,20 +1642,10 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/snapshot/node_modules/magic-string": { - "version": "0.30.14", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.14.tgz", - "integrity": "sha512-5c99P1WKTed11ZC0HMJOj6CDIue6F8ySu+bJL+85q1zBEIY8IklrJ1eiKC2NDRh3Ct3FcvmJPyQHb9erXMTJNw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0" - } - }, "node_modules/@vitest/spy": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.6.tgz", - "integrity": "sha512-oTFObV8bd4SDdRka5O+mSh5w9irgx5IetrD5i+OsUUsk/shsBoHifwCzy45SAORzAhtNiprUVaK3hSCCzZh1jQ==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.8.tgz", + "integrity": "sha512-5swjf2q95gXeYPevtW0BLk6H8+bPlMb4Vw/9Em4hFxDcaOxS+e0LOX4yqNxoHzMR2akEB2xfpnWUzkZokmgWDg==", "dev": true, "license": "MIT", "dependencies": { @@ -1096,13 +1656,13 @@ } }, "node_modules/@vitest/utils": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.6.tgz", - "integrity": "sha512-ixNkFy3k4vokOUTU2blIUvOgKq/N2PW8vKIjZZYsGJCMX69MRa9J2sKqX5hY/k5O5Gty3YJChepkqZ3KM9LyIQ==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.8.tgz", + "integrity": "sha512-dwSoui6djdwbfFmIgbIjX2ZhIoG7Ex/+xpxyiEgIGzjliY8xGkcpITKTlp6B4MgtGkF2ilvm97cPM96XZaAgcA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.1.6", + "@vitest/pretty-format": "2.1.8", "loupe": "^3.1.2", "tinyrainbow": "^1.2.0" }, @@ -1171,6 +1731,39 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ajv-draft-04": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz", + "integrity": "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "ajv": "^8.5.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, "node_modules/ansi-align": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", @@ -1180,15 +1773,6 @@ "string-width": "^4.1.0" } }, - "node_modules/ansi-align/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/ansi-align/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -1209,40 +1793,57 @@ "node": ">=8" } }, - "node_modules/ansi-align/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, "license": "MIT", "dependencies": { - "ansi-regex": "^5.0.1" + "type-fest": "^0.21.3" }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "license": "MIT", + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { - "node": ">=12" + "node": ">=10" }, "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" } }, "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "license": "MIT", "dependencies": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/arch": { @@ -1271,14 +1872,34 @@ "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", "license": "MIT" }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/aria-query": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "dequal": "^2.0.3" + } + }, "node_modules/array-buffer-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", - "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.5", - "is-array-buffer": "^3.0.4" + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" }, "engines": { "node": ">= 0.4" @@ -1288,19 +1909,18 @@ } }, "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", - "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.1", - "call-bind": "^1.0.5", + "call-bind": "^1.0.8", "define-properties": "^1.2.1", - "es-abstract": "^1.22.3", - "es-errors": "^1.2.1", - "get-intrinsic": "^1.2.3", - "is-array-buffer": "^3.0.4", - "is-shared-array-buffer": "^1.0.2" + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" }, "engines": { "node": ">= 0.4" @@ -1403,25 +2023,93 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/boxen/node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "node_modules/boxen/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "license": "MIT", "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" + "node": ">=12" }, "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/boxen/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/boxen/node_modules/chalk": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz", + "integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==", + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/boxen/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/boxen/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/boxen/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -1478,16 +2166,44 @@ } }, "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", "license": "MIT", "dependencies": { + "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" @@ -1520,9 +2236,9 @@ } }, "node_modules/capnp-ts/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -1562,50 +2278,6 @@ } }, "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/chalk-template": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/chalk-template/-/chalk-template-0.4.0.tgz", - "integrity": "sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==", - "license": "MIT", - "dependencies": { - "chalk": "^4.1.2" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/chalk-template?sponsor=1" - } - }, - "node_modules/chalk-template/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/chalk-template/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", @@ -1621,34 +2293,22 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/chalk-template/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/chalk-template": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/chalk-template/-/chalk-template-0.4.0.tgz", + "integrity": "sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==", "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "chalk": "^4.1.2" }, "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/chalk-template/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "license": "MIT" - }, - "node_modules/chalk-template/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "license": "MIT", - "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/chalk-template?sponsor=1" } }, - "node_modules/chalk-template/node_modules/supports-color": { + "node_modules/chalk/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", @@ -1671,9 +2331,9 @@ } }, "node_modules/chokidar": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.1.tgz", - "integrity": "sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", "dev": true, "license": "MIT", "dependencies": { @@ -1698,6 +2358,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cli-width": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", + "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 12" + } + }, "node_modules/clipboardy": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-3.0.0.tgz", @@ -1715,19 +2385,77 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "license": "MIT", "dependencies": { - "color-name": "1.1.3" + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "license": "MIT" }, "node_modules/compressible": { @@ -1766,6 +2494,13 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "license": "MIT" }, + "node_modules/confbox": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", + "dev": true, + "license": "MIT" + }, "node_modules/content-disposition": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", @@ -1801,6 +2536,15 @@ "node": ">=4.8" } }, + "node_modules/cross-spawn/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, "node_modules/crypto": { "resolved": "shims/crypto", "link": true @@ -1813,14 +2557,14 @@ "license": "MIT" }, "node_modules/data-view-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", - "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.6", + "call-bound": "^1.0.3", "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" + "is-data-view": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -1830,29 +2574,29 @@ } }, "node_modules/data-view-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", - "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bound": "^1.0.3", "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" + "is-data-view": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/inspect-js" } }, "node_modules/data-view-byte-offset": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", - "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.6", + "call-bound": "^1.0.2", "es-errors": "^1.3.0", "is-data-view": "^1.0.1" }, @@ -1943,14 +2687,31 @@ "dev": true, "license": "MIT" }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/dns": { "resolved": "shims/dns", "link": true }, + "node_modules/dom-accessibility-api": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", + "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", + "dev": true, + "license": "MIT" + }, "node_modules/dotenv": { - "version": "16.4.5", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", - "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", + "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", "dev": true, "license": "BSD-2-Clause", "engines": { @@ -1960,9 +2721,149 @@ "url": "https://dotenvx.com" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "node_modules/drizzle-orm": { + "version": "0.38.3", + "resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.38.3.tgz", + "integrity": "sha512-w41Y+PquMpSff/QDRGdItG0/aWca+/J3Sda9PPGkTxBtjWQvgU1jxlFBXdjog5tYvTu58uvi3PwR1NuCx0KeZg==", + "dev": true, + "license": "Apache-2.0", + "peerDependencies": { + "@aws-sdk/client-rds-data": ">=3", + "@cloudflare/workers-types": ">=4", + "@electric-sql/pglite": ">=0.2.0", + "@libsql/client": ">=0.10.0", + "@libsql/client-wasm": ">=0.10.0", + "@neondatabase/serverless": ">=0.10.0", + "@op-engineering/op-sqlite": ">=2", + "@opentelemetry/api": "^1.4.1", + "@planetscale/database": ">=1", + "@prisma/client": "*", + "@tidbcloud/serverless": "*", + "@types/better-sqlite3": "*", + "@types/pg": "*", + "@types/react": ">=18", + "@types/sql.js": "*", + "@vercel/postgres": ">=0.8.0", + "@xata.io/client": "*", + "better-sqlite3": ">=7", + "bun-types": "*", + "expo-sqlite": ">=14.0.0", + "knex": "*", + "kysely": "*", + "mysql2": ">=2", + "pg": ">=8", + "postgres": ">=3", + "react": ">=18", + "sql.js": ">=1", + "sqlite3": ">=5" + }, + "peerDependenciesMeta": { + "@aws-sdk/client-rds-data": { + "optional": true + }, + "@cloudflare/workers-types": { + "optional": true + }, + "@electric-sql/pglite": { + "optional": true + }, + "@libsql/client": { + "optional": true + }, + "@libsql/client-wasm": { + "optional": true + }, + "@neondatabase/serverless": { + "optional": true + }, + "@op-engineering/op-sqlite": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@planetscale/database": { + "optional": true + }, + "@prisma/client": { + "optional": true + }, + "@tidbcloud/serverless": { + "optional": true + }, + "@types/better-sqlite3": { + "optional": true + }, + "@types/pg": { + "optional": true + }, + "@types/react": { + "optional": true + }, + "@types/sql.js": { + "optional": true + }, + "@vercel/postgres": { + "optional": true + }, + "@xata.io/client": { + "optional": true + }, + "better-sqlite3": { + "optional": true + }, + "bun-types": { + "optional": true + }, + "expo-sqlite": { + "optional": true + }, + "knex": { + "optional": true + }, + "kysely": { + "optional": true + }, + "mysql2": { + "optional": true + }, + "pg": { + "optional": true + }, + "postgres": { + "optional": true + }, + "prisma": { + "optional": true + }, + "react": { + "optional": true + }, + "sql.js": { + "optional": true + }, + "sqlite3": { + "optional": true + } + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "license": "MIT" }, @@ -1982,57 +2883,62 @@ } }, "node_modules/es-abstract": { - "version": "1.23.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.5.tgz", - "integrity": "sha512-vlmniQ0WNPwXqA0BnmwV3Ng7HxiGlh6r5U6JcTMNx8OilcAGqVJBHJcPjqOMaczU9fRuRK5Px2BdVyPRnKMMVQ==", + "version": "1.23.9", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.9.tgz", + "integrity": "sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA==", "license": "MIT", "dependencies": { - "array-buffer-byte-length": "^1.0.1", - "arraybuffer.prototype.slice": "^1.0.3", + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "data-view-buffer": "^1.0.1", - "data-view-byte-length": "^1.0.1", - "data-view-byte-offset": "^1.0.0", - "es-define-property": "^1.0.0", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0", - "es-set-tostringtag": "^2.0.3", - "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.6", - "get-intrinsic": "^1.2.4", - "get-symbol-description": "^1.0.2", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.0", + "get-symbol-description": "^1.1.0", "globalthis": "^1.0.4", - "gopd": "^1.0.1", + "gopd": "^1.2.0", "has-property-descriptors": "^1.0.2", - "has-proto": "^1.0.3", - "has-symbols": "^1.0.3", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", "hasown": "^2.0.2", - "internal-slot": "^1.0.7", - "is-array-buffer": "^3.0.4", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", "is-callable": "^1.2.7", - "is-data-view": "^1.0.1", - "is-negative-zero": "^2.0.3", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.3", - "is-string": "^1.0.7", - "is-typed-array": "^1.1.13", - "is-weakref": "^1.0.2", + "is-data-view": "^1.0.2", + "is-regex": "^1.2.1", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.0", + "math-intrinsics": "^1.1.0", "object-inspect": "^1.13.3", "object-keys": "^1.1.1", - "object.assign": "^4.1.5", + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", "regexp.prototype.flags": "^1.5.3", - "safe-array-concat": "^1.1.2", - "safe-regex-test": "^1.0.3", - "string.prototype.trim": "^1.2.9", - "string.prototype.trimend": "^1.0.8", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", "string.prototype.trimstart": "^1.0.8", - "typed-array-buffer": "^1.0.2", - "typed-array-byte-length": "^1.0.1", - "typed-array-byte-offset": "^1.0.2", - "typed-array-length": "^1.0.6", - "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.15" + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.18" }, "engines": { "node": ">= 0.4" @@ -2042,13 +2948,10 @@ } }, "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.2.4" - }, "engines": { "node": ">= 0.4" } @@ -2063,9 +2966,9 @@ } }, "node_modules/es-module-lexer": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", - "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.6.0.tgz", + "integrity": "sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==", "dev": true, "license": "MIT" }, @@ -2082,28 +2985,29 @@ } }, "node_modules/es-set-tostringtag": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", - "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", "license": "MIT", "dependencies": { - "get-intrinsic": "^1.2.4", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", "has-tostringtag": "^1.0.2", - "hasown": "^2.0.1" + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" } }, "node_modules/es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", "license": "MIT", "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" }, "engines": { "node": ">= 0.4" @@ -2113,9 +3017,9 @@ } }, "node_modules/esbuild": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz", - "integrity": "sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==", + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.2.tgz", + "integrity": "sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -2126,47 +3030,65 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.24.0", - "@esbuild/android-arm": "0.24.0", - "@esbuild/android-arm64": "0.24.0", - "@esbuild/android-x64": "0.24.0", - "@esbuild/darwin-arm64": "0.24.0", - "@esbuild/darwin-x64": "0.24.0", - "@esbuild/freebsd-arm64": "0.24.0", - "@esbuild/freebsd-x64": "0.24.0", - "@esbuild/linux-arm": "0.24.0", - "@esbuild/linux-arm64": "0.24.0", - "@esbuild/linux-ia32": "0.24.0", - "@esbuild/linux-loong64": "0.24.0", - "@esbuild/linux-mips64el": "0.24.0", - "@esbuild/linux-ppc64": "0.24.0", - "@esbuild/linux-riscv64": "0.24.0", - "@esbuild/linux-s390x": "0.24.0", - "@esbuild/linux-x64": "0.24.0", - "@esbuild/netbsd-x64": "0.24.0", - "@esbuild/openbsd-arm64": "0.24.0", - "@esbuild/openbsd-x64": "0.24.0", - "@esbuild/sunos-x64": "0.24.0", - "@esbuild/win32-arm64": "0.24.0", - "@esbuild/win32-ia32": "0.24.0", - "@esbuild/win32-x64": "0.24.0" + "@esbuild/aix-ppc64": "0.24.2", + "@esbuild/android-arm": "0.24.2", + "@esbuild/android-arm64": "0.24.2", + "@esbuild/android-x64": "0.24.2", + "@esbuild/darwin-arm64": "0.24.2", + "@esbuild/darwin-x64": "0.24.2", + "@esbuild/freebsd-arm64": "0.24.2", + "@esbuild/freebsd-x64": "0.24.2", + "@esbuild/linux-arm": "0.24.2", + "@esbuild/linux-arm64": "0.24.2", + "@esbuild/linux-ia32": "0.24.2", + "@esbuild/linux-loong64": "0.24.2", + "@esbuild/linux-mips64el": "0.24.2", + "@esbuild/linux-ppc64": "0.24.2", + "@esbuild/linux-riscv64": "0.24.2", + "@esbuild/linux-s390x": "0.24.2", + "@esbuild/linux-x64": "0.24.2", + "@esbuild/netbsd-arm64": "0.24.2", + "@esbuild/netbsd-x64": "0.24.2", + "@esbuild/openbsd-arm64": "0.24.2", + "@esbuild/openbsd-x64": "0.24.2", + "@esbuild/sunos-x64": "0.24.2", + "@esbuild/win32-arm64": "0.24.2", + "@esbuild/win32-ia32": "0.24.2", + "@esbuild/win32-x64": "0.24.2" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" } }, "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, "license": "MIT", "engines": { - "node": ">=0.8.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/estree-walker": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", - "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } }, "node_modules/events": { "version": "3.3.0", @@ -2244,6 +3166,12 @@ "node": ">=8" } }, + "node_modules/execa/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC" + }, "node_modules/execa/node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -2289,15 +3217,39 @@ "license": "MIT" }, "node_modules/fast-equals": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.0.1.tgz", - "integrity": "sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.2.2.tgz", + "integrity": "sha512-V7/RktU11J3I36Nwq2JnZEM7tNm17eBJz+u25qdxBZeCKiX6BkVSZQjwWIr+IobgnZy+ag73tTZgZi7tr0LrBw==", "dev": true, "license": "MIT", "engines": { "node": ">=6.0.0" } }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -2307,14 +3259,42 @@ "is-callable": "^1.1.3" } }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, "node_modules/fs": { "resolved": "shims/fs", "link": true }, + "node_modules/fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -2336,15 +3316,17 @@ } }, "node_modules/function.prototype.name": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", - "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "functions-have-names": "^1.2.3" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" }, "engines": { "node": ">= 0.4" @@ -2362,17 +3344,32 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", + "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", "license": "MIT", "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "get-proto": "^1.0.0", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -2381,6 +3378,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-source": { "version": "2.0.12", "resolved": "https://registry.npmjs.org/get-source/-/get-source-2.0.12.tgz", @@ -2405,14 +3415,14 @@ } }, "node_modules/get-symbol-description": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", - "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.5", + "call-bound": "^1.0.3", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4" + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" @@ -2445,12 +3455,12 @@ } }, "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.1.3" + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2462,22 +3472,35 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "license": "ISC" }, + "node_modules/graphql": { + "version": "16.10.0", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.10.0.tgz", + "integrity": "sha512-AjqGKbDGUFRKIRCP9tCKiIGHyriz2oHEbPIbEtcSLSs4YjReZOIPQQWek4+6hjw62H9QShXHyaGivGiYVLeYFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" + } + }, "node_modules/has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", + "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", "license": "MIT", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "license": "MIT", "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/has-property-descriptors": { @@ -2493,10 +3516,13 @@ } }, "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -2505,9 +3531,9 @@ } }, "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -2543,6 +3569,13 @@ "node": ">= 0.4" } }, + "node_modules/headers-polyfill": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-4.0.3.tgz", + "integrity": "sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ==", + "dev": true, + "license": "MIT" + }, "node_modules/hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", @@ -2578,6 +3611,16 @@ ], "license": "BSD-3-Clause" }, + "node_modules/import-lazy": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", + "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/ini": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", @@ -2585,27 +3628,28 @@ "license": "ISC" }, "node_modules/internal-slot": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", - "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", "license": "MIT", "dependencies": { "es-errors": "^1.3.0", - "hasown": "^2.0.0", - "side-channel": "^1.0.4" + "hasown": "^2.0.2", + "side-channel": "^1.1.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/is-array-buffer": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", - "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" @@ -2621,12 +3665,15 @@ "license": "MIT" }, "node_modules/is-async-function": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz", - "integrity": "sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.0.tgz", + "integrity": "sha512-GExz9MtyhlZyXYLxzlJRj5WUCE661zhDa1Yna52CN57AJsymh+DvXXjyveSioqSRdxvUrdKdvqB1b5cVKsNpWQ==", "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -2636,25 +3683,28 @@ } }, "node_modules/is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", "license": "MIT", "dependencies": { - "has-bigints": "^1.0.1" + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.1.tgz", + "integrity": "sha512-l9qO6eFlUETHtuihLcYOaLKByJ1f+N4kthcU9YjHy3N+B3hWv0y/2Nd0mu/7lTFnRQHTrSdXF50HQ3bl5fEnng==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -2676,9 +3726,9 @@ } }, "node_modules/is-core-module": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", - "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", "license": "MIT", "dependencies": { "hasown": "^2.0.2" @@ -2691,11 +3741,13 @@ } }, "node_modules/is-data-view": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", - "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", "license": "MIT", "dependencies": { + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", "is-typed-array": "^1.1.13" }, "engines": { @@ -2706,12 +3758,13 @@ } }, "node_modules/is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -2736,12 +3789,12 @@ } }, "node_modules/is-finalizationregistry": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.0.tgz", - "integrity": "sha512-qfMdqbAQEwBw78ZyReKnlA8ezmPdb9BemzIIip/JkjaZUhitfXDkkr+3QTboW0JrSXT1QWyYShpvnNHGZ4c4yA==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.7" + "call-bound": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -2760,12 +3813,15 @@ } }, "node_modules/is-generator-function": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", - "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", + "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -2786,25 +3842,21 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-negative-zero": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", - "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } + "node_modules/is-node-process": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-node-process/-/is-node-process-1.2.0.tgz", + "integrity": "sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==", + "dev": true, + "license": "MIT" }, "node_modules/is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -2826,13 +3878,15 @@ } }, "node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -2854,12 +3908,12 @@ } }, "node_modules/is-shared-array-buffer": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", - "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.7" + "call-bound": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -2881,12 +3935,13 @@ } }, "node_modules/is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -2896,12 +3951,14 @@ } }, "node_modules/is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", "license": "MIT", "dependencies": { - "has-symbols": "^1.0.2" + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -2911,12 +3968,12 @@ } }, "node_modules/is-typed-array": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", - "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", "license": "MIT", "dependencies": { - "which-typed-array": "^1.1.14" + "which-typed-array": "^1.1.16" }, "engines": { "node": ">= 0.4" @@ -2938,25 +3995,28 @@ } }, "node_modules/is-weakref": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", - "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.0.tgz", + "integrity": "sha512-SXM8Nwyys6nT5WP6pltOwKytLV7FqQ4UiibxVmW+EIosHcmCqkkjViTb5SNssDlkCiEYRP1/pdWUKVvZBmsR2Q==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2" + "call-bound": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-weakset": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.3.tgz", - "integrity": "sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", - "get-intrinsic": "^1.2.4" + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" @@ -2996,6 +4056,20 @@ "dev": true, "license": "MIT" }, + "node_modules/jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, "node_modules/json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -3008,6 +4082,16 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "license": "MIT" }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "license": "MIT", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, "node_modules/load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", @@ -3023,6 +4107,13 @@ "node": ">=4" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "license": "MIT" + }, "node_modules/loupe": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", @@ -3030,14 +4121,46 @@ "dev": true, "license": "MIT" }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/lz-string": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", + "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", + "dev": true, + "license": "MIT", + "bin": { + "lz-string": "bin/bin.js" + } + }, "node_modules/magic-string": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", - "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", "dev": true, "license": "MIT", "dependencies": { - "sourcemap-codec": "^1.4.8" + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" } }, "node_modules/memorystream": { @@ -3107,9 +4230,9 @@ } }, "node_modules/miniflare": { - "version": "3.20241106.1", - "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20241106.1.tgz", - "integrity": "sha512-dM3RBlJE8rUFxnqlPCaFCq0E7qQqEQvKbYX7W/APGCK+rLcyLmEBzC4GQR/niXdNM/oV6gdg9AA50ghnn2ALuw==", + "version": "3.20241230.0", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20241230.0.tgz", + "integrity": "sha512-ZtWNoNAIj5Q0Vb3B4SPEKr7DDmVG8a0Stsp/AuRkYXoJniA5hsbKjFNIGhTXGMIHVP5bvDrKJWt/POIDGfpiKg==", "dev": true, "license": "MIT", "dependencies": { @@ -3121,7 +4244,7 @@ "glob-to-regexp": "^0.4.1", "stoppable": "^1.1.0", "undici": "^5.28.4", - "workerd": "1.20241106.1", + "workerd": "1.20241230.0", "ws": "^8.18.0", "youch": "^3.2.2", "zod": "^3.22.3" @@ -3147,9 +4270,9 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", + "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==", "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -3167,12 +4290,80 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/mlly": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.3.tgz", + "integrity": "sha512-xUsx5n/mN0uQf4V548PKQ+YShA4/IW0KI1dZhrNrPCLG+xizETbHTkOa1f8/xut9JRPp8kQuMnz0oqwkTiLo/A==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.14.0", + "pathe": "^1.1.2", + "pkg-types": "^1.2.1", + "ufo": "^1.5.4" + } + }, + "node_modules/mrmime": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", + "integrity": "sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "license": "MIT" }, + "node_modules/msw": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/msw/-/msw-2.7.0.tgz", + "integrity": "sha512-BIodwZ19RWfCbYTxWTUfTXc+sg4OwjCAgxU1ZsgmggX/7S3LdUifsbUPJs61j0rWb19CZRGY5if77duhc0uXzw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@bundled-es-modules/cookie": "^2.0.1", + "@bundled-es-modules/statuses": "^1.0.1", + "@bundled-es-modules/tough-cookie": "^0.1.6", + "@inquirer/confirm": "^5.0.0", + "@mswjs/interceptors": "^0.37.0", + "@open-draft/deferred-promise": "^2.2.0", + "@open-draft/until": "^2.1.0", + "@types/cookie": "^0.6.0", + "@types/statuses": "^2.0.4", + "graphql": "^16.8.1", + "headers-polyfill": "^4.0.2", + "is-node-process": "^1.2.0", + "outvariant": "^1.4.3", + "path-to-regexp": "^6.3.0", + "picocolors": "^1.1.1", + "strict-event-emitter": "^0.5.1", + "type-fest": "^4.26.1", + "yargs": "^17.7.2" + }, + "bin": { + "msw": "cli/index.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/mswjs" + }, + "peerDependencies": { + "typescript": ">= 4.8.x" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/mustache": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", @@ -3183,6 +4374,16 @@ "mustache": "bin/mustache" } }, + "node_modules/mute-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-2.0.0.tgz", + "integrity": "sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, "node_modules/nanoid": { "version": "3.3.8", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", @@ -3221,6 +4422,55 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "license": "MIT" }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/node-fetch/node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, "node_modules/node-forge": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", @@ -3243,6 +4493,15 @@ "validate-npm-package-license": "^3.0.1" } }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, "node_modules/npm-run-all": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", @@ -3268,6 +4527,77 @@ "node": ">= 4" } }, + "node_modules/npm-run-all/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/npm-run-all/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" + }, + "node_modules/npm-run-all/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/npm-run-all/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -3311,14 +4641,16 @@ } }, "node_modules/object.assign": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", - "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.5", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", "define-properties": "^1.2.1", - "has-symbols": "^1.0.3", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", "object-keys": "^1.1.1" }, "engines": { @@ -3366,6 +4698,30 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/outvariant": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/outvariant/-/outvariant-1.4.3.tgz", + "integrity": "sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==", + "dev": true, + "license": "MIT" + }, + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/packet-reader": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", @@ -3411,9 +4767,10 @@ "license": "MIT" }, "node_modules/path-to-regexp": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.3.0.tgz", - "integrity": "sha512-qyCH421YQPS2WFDxDjftfc1ZR5WKQzVzqsp4n9M2kQhVOo/ByahFoUNJfl58kOcEGfQ//7weFTDhm+ss8Ecxgw==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", + "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", + "dev": true, "license": "MIT" }, "node_modules/path-type": { @@ -3626,16 +4983,60 @@ "node": ">=4" } }, - "node_modules/possible-typed-array-names": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", - "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "node_modules/pkg-types": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.0.tgz", + "integrity": "sha512-kS7yWjVFCkIw9hqdJBoMxDdzEngmkr5FXeWZZfQ6GoYacjVnsW6l2CcYW/0ThD0vF4LPJgVYnrg4d0uuhwYQbg==", + "dev": true, "license": "MIT", - "engines": { - "node": ">= 0.4" + "dependencies": { + "confbox": "^0.1.8", + "mlly": "^1.7.3", + "pathe": "^1.1.2" } }, - "node_modules/postcss": { + "node_modules/playwright": { + "version": "1.49.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.49.1.tgz", + "integrity": "sha512-VYL8zLoNTBxVOrJBbDuRgDWa3i+mfQgDTrL8Ah9QXZ7ax4Dsj0MSq5bYgytRnDVVe+njoKnfsYkH3HzqVj5UZA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.49.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.49.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.49.1.tgz", + "integrity": "sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/postcss": { "version": "8.4.49", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", @@ -3715,9 +5116,9 @@ "license": "MIT" }, "node_modules/prettier": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.1.tgz", - "integrity": "sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", + "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" @@ -3729,6 +5130,34 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/pretty-format": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/printable-characters": { "version": "1.0.42", "resolved": "https://registry.npmjs.org/printable-characters/-/printable-characters-1.0.42.tgz", @@ -3736,6 +5165,54 @@ "dev": true, "license": "Unlicense" }, + "node_modules/prisma": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-6.2.1.tgz", + "integrity": "sha512-hhyM0H13pQleQ+br4CkzGizS5I0oInoeTw3JfLw1BRZduBSQxPILlJLwi+46wZzj9Je7ndyQEMGw/n5cN2fknA==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/engines": "6.2.1" + }, + "bin": { + "prisma": "build/index.js" + }, + "engines": { + "node": ">=18.18" + }, + "optionalDependencies": { + "fsevents": "2.3.3" + } + }, + "node_modules/prisma/node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/psl": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.15.0.tgz", + "integrity": "sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "funding": { + "url": "https://github.com/sponsors/lupomontero" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -3745,6 +5222,13 @@ "node": ">=6" } }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true, + "license": "MIT" + }, "node_modules/range-parser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", @@ -3769,6 +5253,34 @@ "rc": "cli.js" } }, + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react": { + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.0.0.tgz", + "integrity": "sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true, + "license": "MIT" + }, "node_modules/read-pkg": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", @@ -3798,18 +5310,19 @@ } }, "node_modules/reflect.getprototypeof": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.7.tgz", - "integrity": "sha512-bMvFGIUKlc/eSfXNX+aZ+EL95/EgZzuwA0OBPTbZZDEJw/0AkentjMuM1oiRfwHrshqk4RzdgiTg5CcDalXN5g==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", "define-properties": "^1.2.1", - "es-abstract": "^1.23.5", + "es-abstract": "^1.23.9", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "which-builtin-type": "^1.1.4" + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" }, "engines": { "node": ">= 0.4" @@ -3818,15 +5331,24 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "dev": true, + "license": "MIT" + }, "node_modules/regexp.prototype.flags": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz", - "integrity": "sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", "set-function-name": "^2.0.2" }, "engines": { @@ -3858,6 +5380,16 @@ "node": ">=0.10.0" } }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", @@ -3867,37 +5399,37 @@ "node": ">=0.10.0" } }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true, + "license": "MIT" + }, "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", "license": "MIT", "dependencies": { - "is-core-module": "^2.13.0", + "is-core-module": "^2.16.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve.exports": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", - "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - } - }, "node_modules/rollup": { - "version": "4.27.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.27.4.tgz", - "integrity": "sha512-RLKxqHEMjh/RGLsDxAEsaLO3mWgyoU6x9w6n1ikAzet4B3gI2/3yP6PWY2p9QzRTh6MfEIXB3MwsOY0Iv3vNrw==", + "version": "4.30.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.30.1.tgz", + "integrity": "sha512-mlJ4glW020fPuLi7DkM/lN97mYEZGWeqBnrljzN0gs7GLctqX3lNWxKQ7Gl712UAX+6fog/L3jh4gb7R6aVi3w==", "dev": true, "license": "MIT", "dependencies": { @@ -3911,24 +5443,25 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.27.4", - "@rollup/rollup-android-arm64": "4.27.4", - "@rollup/rollup-darwin-arm64": "4.27.4", - "@rollup/rollup-darwin-x64": "4.27.4", - "@rollup/rollup-freebsd-arm64": "4.27.4", - "@rollup/rollup-freebsd-x64": "4.27.4", - "@rollup/rollup-linux-arm-gnueabihf": "4.27.4", - "@rollup/rollup-linux-arm-musleabihf": "4.27.4", - "@rollup/rollup-linux-arm64-gnu": "4.27.4", - "@rollup/rollup-linux-arm64-musl": "4.27.4", - "@rollup/rollup-linux-powerpc64le-gnu": "4.27.4", - "@rollup/rollup-linux-riscv64-gnu": "4.27.4", - "@rollup/rollup-linux-s390x-gnu": "4.27.4", - "@rollup/rollup-linux-x64-gnu": "4.27.4", - "@rollup/rollup-linux-x64-musl": "4.27.4", - "@rollup/rollup-win32-arm64-msvc": "4.27.4", - "@rollup/rollup-win32-ia32-msvc": "4.27.4", - "@rollup/rollup-win32-x64-msvc": "4.27.4", + "@rollup/rollup-android-arm-eabi": "4.30.1", + "@rollup/rollup-android-arm64": "4.30.1", + "@rollup/rollup-darwin-arm64": "4.30.1", + "@rollup/rollup-darwin-x64": "4.30.1", + "@rollup/rollup-freebsd-arm64": "4.30.1", + "@rollup/rollup-freebsd-x64": "4.30.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.30.1", + "@rollup/rollup-linux-arm-musleabihf": "4.30.1", + "@rollup/rollup-linux-arm64-gnu": "4.30.1", + "@rollup/rollup-linux-arm64-musl": "4.30.1", + "@rollup/rollup-linux-loongarch64-gnu": "4.30.1", + "@rollup/rollup-linux-powerpc64le-gnu": "4.30.1", + "@rollup/rollup-linux-riscv64-gnu": "4.30.1", + "@rollup/rollup-linux-s390x-gnu": "4.30.1", + "@rollup/rollup-linux-x64-gnu": "4.30.1", + "@rollup/rollup-linux-x64-musl": "4.30.1", + "@rollup/rollup-win32-arm64-msvc": "4.30.1", + "@rollup/rollup-win32-ia32-msvc": "4.30.1", + "@rollup/rollup-win32-x64-msvc": "4.30.1", "fsevents": "~2.3.2" } }, @@ -3945,6 +5478,23 @@ "rollup-pluginutils": "^2.8.1" } }, + "node_modules/rollup-plugin-inject/node_modules/estree-walker": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/rollup-plugin-inject/node_modules/magic-string": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", + "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "sourcemap-codec": "^1.4.8" + } + }, "node_modules/rollup-plugin-node-polyfills": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/rollup-plugin-node-polyfills/-/rollup-plugin-node-polyfills-0.2.1.tgz", @@ -3965,15 +5515,23 @@ "estree-walker": "^0.6.1" } }, + "node_modules/rollup-pluginutils/node_modules/estree-walker": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", + "dev": true, + "license": "MIT" + }, "node_modules/safe-array-concat": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", - "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", - "get-intrinsic": "^1.2.4", - "has-symbols": "^1.0.3", + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", "isarray": "^2.0.5" }, "engines": { @@ -3989,15 +5547,31 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "license": "MIT" }, + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safe-regex-test": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", - "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.6", + "call-bound": "^1.0.2", "es-errors": "^1.3.0", - "is-regex": "^1.1.4" + "is-regex": "^1.2.1" }, "engines": { "node": ">= 0.4" @@ -4021,12 +5595,19 @@ } }, "node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, "bin": { - "semver": "bin/semver" + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, "node_modules/serve": { @@ -4090,6 +5671,24 @@ "node": ">= 0.6" } }, + "node_modules/serve-handler/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/serve-handler/node_modules/path-to-regexp": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.3.0.tgz", + "integrity": "sha512-qyCH421YQPS2WFDxDjftfc1ZR5WKQzVzqsp4n9M2kQhVOo/ByahFoUNJfl58kOcEGfQ//7weFTDhm+ss8Ecxgw==", + "license": "MIT" + }, "node_modules/serve/node_modules/chalk": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", @@ -4134,6 +5733,20 @@ "node": ">= 0.4" } }, + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -4156,24 +5769,81 @@ } }, "node_modules/shell-quote": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", - "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.2.tgz", + "integrity": "sha512-AzqKpGKjrj7EM6rKVQEPpB288oCfnrEIuyoT9cyF4nmGa7V8Zk6f7RRqYisX8X9m+Q7bd632aZW4ky7EhbQztA==", "license": "MIT", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -4190,10 +5860,32 @@ "license": "ISC" }, "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "license": "ISC" + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sirv": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.0.tgz", + "integrity": "sha512-BPwJGUeDaDCHihkORDchNyyTvWFhcusy1XMmhEVTQTwGeybFbp8YEmB+njbPnth1FibULBSBVwCQni25XlCUDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" + }, + "engines": { + "node": ">=18" + } }, "node_modules/source-map": { "version": "0.6.1", @@ -4264,6 +5956,13 @@ "node": ">= 10.x" } }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true, + "license": "BSD-3-Clause" + }, "node_modules/stackback": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", @@ -4282,6 +5981,16 @@ "get-source": "^2.0.12" } }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/std-env": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.8.0.tgz", @@ -4304,10 +6013,27 @@ "resolved": "shims/stream", "link": true }, + "node_modules/strict-event-emitter": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.5.1.tgz", + "integrity": "sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==", + "dev": true, + "license": "MIT" + }, "node_modules/string_decoder": { "resolved": "shims/string_decoder", "link": true }, + "node_modules/string-argv": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6.19" + } + }, "node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -4325,6 +6051,33 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/string.prototype.padend": { "version": "3.1.6", "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.6.tgz", @@ -4344,15 +6097,18 @@ } }, "node_modules/string.prototype.trim": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", - "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", "define-properties": "^1.2.1", - "es-abstract": "^1.23.0", - "es-object-atoms": "^1.0.0" + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -4362,15 +6118,19 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", - "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -4393,18 +6153,15 @@ } }, "node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "license": "MIT", "dependencies": { - "ansi-regex": "^6.0.1" + "ansi-regex": "^5.0.1" }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "node": ">=8" } }, "node_modules/strip-bom": { @@ -4426,51 +6183,42 @@ } }, "node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/subtls": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/subtls/-/subtls-0.3.1.tgz", - "integrity": "sha512-/HWVyVoJEKCvvLOAt3ak2kEYI5+8eLPojXrUDtYvIEIzxdAqwtYd2epVPyFqIoFV+Q+xtbcoDVubQgUFUxHxfg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "^18.16.3" - } - }, - "node_modules/subtls/node_modules/@types/node": { - "version": "18.19.66", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.66.tgz", - "integrity": "sha512-14HmtUdGxFUalGRfLLn9Gc1oNWvWh5zNbsyOLo5JV6WARSeN1QcEBKRnZm9QqNfrutgsl/hY4eJW63aZ44aBCg==", + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/subtls/-/subtls-0.4.6.tgz", + "integrity": "sha512-oRMIeTfQeoujHVKRPG14UedKakMPxiyOnWNEwMrEsd5tVOFNv1SuTYnGhJ/RmfGylq7ooxG24ceHMJ5VLYLydQ==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~5.26.4" + "@types/node": "^22.10.2" } }, - "node_modules/subtls/node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true, - "license": "MIT" - }, "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, "license": "MIT", "dependencies": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, "node_modules/supports-preserve-symlinks-flag": { @@ -4493,9 +6241,9 @@ "license": "MIT" }, "node_modules/tinyexec": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.1.tgz", - "integrity": "sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ==", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", "dev": true, "license": "MIT" }, @@ -4533,6 +6281,42 @@ "resolved": "shims/tls", "link": true }, + "node_modules/totalist": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/tough-cookie": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", + "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tough-cookie/node_modules/universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -4541,42 +6325,43 @@ "license": "0BSD" }, "node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "version": "4.31.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.31.0.tgz", + "integrity": "sha512-yCxltHW07Nkhv/1F6wWBr8kz+5BGMfP+RbRSYFnegVb0qV/UMT0G0ElBloPVerqn4M2ZV80Ir1FtCcYv1cT6vQ==", + "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { - "node": ">=12.20" + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/typed-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", - "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bound": "^1.0.3", "es-errors": "^1.3.0", - "is-typed-array": "^1.1.13" + "is-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4" } }, "node_modules/typed-array-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", - "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13" + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4" @@ -4586,18 +6371,18 @@ } }, "node_modules/typed-array-byte-offset": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.3.tgz", - "integrity": "sha512-GsvTyUHTriq6o/bHcTd0vM7OQ9JEdlvluu9YISaA7+KzDzPaIzEeDFNkTfhdE3MYcNhNi0vq/LlegYgIs5yPAw==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13", - "reflect.getprototypeof": "^1.0.6" + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" }, "engines": { "node": ">= 0.4" @@ -4648,27 +6433,30 @@ "license": "MIT" }, "node_modules/unbox-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", - "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", + "call-bound": "^1.0.3", "has-bigints": "^1.0.2", - "has-symbols": "^1.0.3", - "which-boxed-primitive": "^1.0.2" + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/undici": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.0.tgz", - "integrity": "sha512-BUgJXc752Kou3oOIuU1i+yZZypyZRqNPW0vqoMPl8VaoalSfeR0D8/t4iAS3yirs79SSMTxTag+ZC86uswv+Cw==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.2.0.tgz", + "integrity": "sha512-klt+0S55GBViA9nsq48/NSCo4YX5mjydjypxD7UmHh/brMu8h/Mhd/F7qAeoH2NOO8SDTk6kjnTFc4WpzmfYpQ==", "license": "MIT", "engines": { - "node": ">=18.17" + "node": ">=20.18.1" } }, "node_modules/undici-types": { @@ -4680,18 +6468,29 @@ }, "node_modules/unenv": { "name": "unenv-nightly", - "version": "2.0.0-20241111-080453-894aa31", - "resolved": "https://registry.npmjs.org/unenv-nightly/-/unenv-nightly-2.0.0-20241111-080453-894aa31.tgz", - "integrity": "sha512-0W39QQOQ9VE8kVVUpGwEG+pZcsCXk5wqNG6rDPE6Gr+fiA69LR0qERM61hW5KCOkC1/ArCFrfCGjwHyyv/bI0Q==", + "version": "2.0.0-20241218-183400-5d6aec3", + "resolved": "https://registry.npmjs.org/unenv-nightly/-/unenv-nightly-2.0.0-20241218-183400-5d6aec3.tgz", + "integrity": "sha512-7Xpi29CJRbOV1/IrC03DawMJ0hloklDLq/cigSe+J2jkcC+iDres2Cy0r4ltj5f0x7DqsaGaB4/dLuCPPFZnZA==", "dev": true, "license": "MIT", "dependencies": { "defu": "^6.1.4", + "mlly": "^1.7.3", "ohash": "^1.1.4", "pathe": "^1.1.2", "ufo": "^1.5.4" } }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/update-check": { "version": "1.5.4", "resolved": "https://registry.npmjs.org/update-check/-/update-check-1.5.4.tgz", @@ -4715,6 +6514,17 @@ "resolved": "shims/url", "link": true }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "node_modules/util": { "resolved": "shims/util", "link": true @@ -4729,149 +6539,582 @@ "spdx-expression-parse": "^3.0.0" } }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vite": { + "version": "5.4.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", + "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.8.tgz", + "integrity": "sha512-uPAwSr57kYjAUux+8E2j0q0Fxpn8M9VoyfGiRI8Kfktz9NcYMCenwY5RnZxnF1WTu3TGiYipirIzacLL3VVGFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.7", + "es-module-lexer": "^1.5.4", + "pathe": "^1.1.2", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vite-node/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/vite-node/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite/node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, "license": "MIT", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">= 0.8" + "node": ">=12" } }, - "node_modules/vite": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.0.tgz", - "integrity": "sha512-Q2+5yQV79EdnpbNxjD3/QHVMCBaQ3Kpd4/uL51UGuh38bIIM+s4o3FqyCzRvTRwFb+cWIUeZvaWwS9y2LD2qeQ==", + "node_modules/vite/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], "dev": true, "license": "MIT", - "dependencies": { - "esbuild": "^0.24.0", - "postcss": "^8.4.49", - "rollup": "^4.23.0" - }, - "bin": { - "vite": "bin/vite.js" - }, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": "^18.0.0 || ^20.0.0 || >=22.0.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", - "jiti": ">=1.21.0", - "less": "*", - "lightningcss": "^1.21.0", - "sass": "*", - "sass-embedded": "*", - "stylus": "*", - "sugarss": "*", - "terser": "^5.16.0", - "tsx": "^4.8.1", - "yaml": "^2.4.2" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "jiti": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "sass-embedded": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } + "node": ">=12" } }, - "node_modules/vite-node": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.6.tgz", - "integrity": "sha512-DBfJY0n9JUwnyLxPSSUmEePT21j8JZp/sR9n+/gBwQU6DcQOioPdb8/pibWfXForbirSagZCilseYIwaL3f95A==", + "node_modules/vite/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", - "dependencies": { - "cac": "^6.7.14", - "debug": "^4.3.7", - "es-module-lexer": "^1.5.4", - "pathe": "^1.1.2", - "vite": "^5.0.0 || ^6.0.0" - }, - "bin": { - "vite-node": "vite-node.mjs" - }, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": "^18.0.0 || ^20.0.0 || >=22.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" + "node": ">=12" } }, - "node_modules/vite-node/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "node_modules/vite/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "dev": true, + "hasInstallScript": true, "license": "MIT", - "dependencies": { - "ms": "^2.1.3" + "bin": { + "esbuild": "bin/esbuild" }, "engines": { - "node": ">=6.0" + "node": ">=12" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/vite-node/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/vite/node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, - "license": "MIT" + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } }, "node_modules/vitest": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.6.tgz", - "integrity": "sha512-isUCkvPL30J4c5O5hgONeFRsDmlw6kzFEdLQHLezmDdKQHy8Ke/B/dgdTMEgU0vm+iZ0TjW8GuK83DiahBoKWQ==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.8.tgz", + "integrity": "sha512-1vBKTZskHw/aosXqQUlVWWlGUxSJR8YtiyZDJAFeW2kPAeX6S3Sool0mjspO+kXLuxVWlEDDowBAeqeAQefqLQ==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/expect": "2.1.6", - "@vitest/mocker": "2.1.6", - "@vitest/pretty-format": "^2.1.6", - "@vitest/runner": "2.1.6", - "@vitest/snapshot": "2.1.6", - "@vitest/spy": "2.1.6", - "@vitest/utils": "2.1.6", + "@vitest/expect": "2.1.8", + "@vitest/mocker": "2.1.8", + "@vitest/pretty-format": "^2.1.8", + "@vitest/runner": "2.1.8", + "@vitest/snapshot": "2.1.8", + "@vitest/spy": "2.1.8", + "@vitest/utils": "2.1.8", "chai": "^5.1.2", "debug": "^4.3.7", "expect-type": "^1.1.0", @@ -4882,24 +7125,24 @@ "tinyexec": "^0.3.1", "tinypool": "^1.0.1", "tinyrainbow": "^1.2.0", - "vite": "^5.0.0 || ^6.0.0", - "vite-node": "2.1.6", + "vite": "^5.0.0", + "vite-node": "2.1.8", "why-is-node-running": "^2.3.0" }, "bin": { "vitest": "vitest.mjs" }, "engines": { - "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + "node": "^18.0.0 || >=20.0.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { "@edge-runtime/vm": "*", - "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", - "@vitest/browser": "2.1.6", - "@vitest/ui": "2.1.6", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "2.1.8", + "@vitest/ui": "2.1.8", "happy-dom": "*", "jsdom": "*" }, @@ -4925,9 +7168,9 @@ } }, "node_modules/vitest/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -4942,16 +7185,6 @@ } } }, - "node_modules/vitest/node_modules/magic-string": { - "version": "0.30.14", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.14.tgz", - "integrity": "sha512-5c99P1WKTed11ZC0HMJOj6CDIue6F8ySu+bJL+85q1zBEIY8IklrJ1eiKC2NDRh3Ct3FcvmJPyQHb9erXMTJNw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0" - } - }, "node_modules/vitest/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -4959,6 +7192,16 @@ "dev": true, "license": "MIT" }, + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, "node_modules/which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -4972,40 +7215,43 @@ } }, "node_modules/which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", "license": "MIT", "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/which-builtin-type": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.0.tgz", - "integrity": "sha512-I+qLGQ/vucCby4tf5HsLmGueEla4ZhwTBSqaooS+Y0BuxN4Cp+okmGuV+8mXZ84KDI9BA+oklo+RzKg0ONdSUA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bound": "^1.0.2", "function.prototype.name": "^1.1.6", "has-tostringtag": "^1.0.2", "is-async-function": "^2.0.0", - "is-date-object": "^1.0.5", + "is-date-object": "^1.1.0", "is-finalizationregistry": "^1.1.0", "is-generator-function": "^1.0.10", - "is-regex": "^1.1.4", + "is-regex": "^1.2.1", "is-weakref": "^1.0.2", "isarray": "^2.0.5", - "which-boxed-primitive": "^1.0.2", + "which-boxed-primitive": "^1.1.0", "which-collection": "^1.0.2", - "which-typed-array": "^1.1.15" + "which-typed-array": "^1.1.16" }, "engines": { "node": ">= 0.4" @@ -5033,15 +7279,16 @@ } }, "node_modules/which-typed-array": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", - "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "version": "1.1.18", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.18.tgz", + "integrity": "sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==", "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", "for-each": "^0.3.3", - "gopd": "^1.0.1", + "gopd": "^1.2.0", "has-tostringtag": "^1.0.2" }, "engines": { @@ -5084,9 +7331,9 @@ } }, "node_modules/workerd": { - "version": "1.20241106.1", - "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20241106.1.tgz", - "integrity": "sha512-1GdKl0kDw8rrirr/ThcK66Kbl4/jd4h8uHx5g7YHBrnenY5SX1UPuop2cnCzYUxlg55kPjzIqqYslz1muRFgFw==", + "version": "1.20241230.0", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20241230.0.tgz", + "integrity": "sha512-EgixXP0JGXGq6J9lz17TKIZtfNDUvJNG+cl9paPMfZuYWT920fFpBx+K04YmnbQRLnglsivF1GT9pxh1yrlWhg==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", @@ -5097,22 +7344,21 @@ "node": ">=16" }, "optionalDependencies": { - "@cloudflare/workerd-darwin-64": "1.20241106.1", - "@cloudflare/workerd-darwin-arm64": "1.20241106.1", - "@cloudflare/workerd-linux-64": "1.20241106.1", - "@cloudflare/workerd-linux-arm64": "1.20241106.1", - "@cloudflare/workerd-windows-64": "1.20241106.1" + "@cloudflare/workerd-darwin-64": "1.20241230.0", + "@cloudflare/workerd-darwin-arm64": "1.20241230.0", + "@cloudflare/workerd-linux-64": "1.20241230.0", + "@cloudflare/workerd-linux-arm64": "1.20241230.0", + "@cloudflare/workerd-windows-64": "1.20241230.0" } }, "node_modules/wrangler": { - "version": "3.90.0", - "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.90.0.tgz", - "integrity": "sha512-E/6E9ORAl987+3kP8wDiE3L1lj9r4vQ32/dl5toIxIkSMssmPRQVdxqwgMxbxJrytbFNo8Eo6swgjd4y4nUaLg==", + "version": "3.100.0", + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.100.0.tgz", + "integrity": "sha512-+nsZK374Xnp2BEQQuB/18pnObgsOey0AHVlg75pAdwNaKAmB2aa0/E5rFb7i89DiiwFYoZMz3cARY1UKcm/WQQ==", "dev": true, "license": "MIT OR Apache-2.0", "dependencies": { "@cloudflare/kv-asset-handler": "0.3.4", - "@cloudflare/workers-shared": "0.8.0", "@esbuild-plugins/node-globals-polyfill": "^0.2.3", "@esbuild-plugins/node-modules-polyfill": "^0.2.2", "blake3-wasm": "^2.1.5", @@ -5120,15 +7366,14 @@ "date-fns": "^4.1.0", "esbuild": "0.17.19", "itty-time": "^1.0.6", - "miniflare": "3.20241106.1", + "miniflare": "3.20241230.0", "nanoid": "^3.3.3", "path-to-regexp": "^6.3.0", "resolve": "^1.22.8", - "resolve.exports": "^2.0.2", "selfsigned": "^2.0.1", "source-map": "^0.6.1", - "unenv": "npm:unenv-nightly@2.0.0-20241111-080453-894aa31", - "workerd": "1.20241106.1", + "unenv": "npm:unenv-nightly@2.0.0-20241218-183400-5d6aec3", + "workerd": "1.20241230.0", "xxhash-wasm": "^1.0.1" }, "bin": { @@ -5142,7 +7387,7 @@ "fsevents": "~2.3.2" }, "peerDependencies": { - "@cloudflare/workers-types": "^4.20241106.0" + "@cloudflare/workers-types": "^4.20241230.0" }, "peerDependenciesMeta": { "@cloudflare/workers-types": { @@ -5562,40 +7807,41 @@ "@esbuild/win32-x64": "0.17.19" } }, - "node_modules/wrangler/node_modules/path-to-regexp": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", - "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", - "dev": true, - "license": "MIT" - }, "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + "node": ">=8" } }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "node_modules/wrap-ansi/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "license": "MIT", - "engines": { - "node": ">=12" + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "engines": { + "node": ">=8" } }, "node_modules/ws": { @@ -5635,6 +7881,87 @@ "dev": true, "license": "MIT" }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yoctocolors-cjs": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz", + "integrity": "sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/youch": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/youch/-/youch-3.3.4.tgz", @@ -5648,9 +7975,9 @@ } }, "node_modules/zod": { - "version": "3.23.8", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", - "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "version": "3.24.1", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.1.tgz", + "integrity": "sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==", "dev": true, "license": "MIT", "funding": { diff --git a/package.json b/package.json index e30d2be..8e15078 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "stream": "file:shims/stream", "string_decoder": "file:shims/string_decoder", "tls": "file:shims/tls", - "undici": "^6.0.1", + "undici": "^7.1.0", "url": "file:shims/url", "util": "file:shims/util", "ws": "^8.12.1" @@ -32,7 +32,6 @@ }, "scripts": { "check": "tsc --noEmit", - "export": "npm run check && ./export.sh", "build": "./build.sh", "buildDebug": "./build.sh debug", "watch": "./build.sh watch", @@ -43,24 +42,45 @@ "launch": "DOTENV_CONFIG_PATH=.dev.vars node -r dotenv/config --no-warnings dist/node/index.mjs", "node": "npm run build && npm run launch", "nodeDebug": "npm run buildDebug && npm run launch", - "bun": "npm run build && DOTENV_CONFIG_PATH=.dev.vars bun -r dotenv/config dist/node/index.mjs", "cfDev": "npm run build && wrangler dev", "cfDeploy": "npm run build && wrangler deploy", "format": "prettier -c .", "format:fix": "prettier -w .", - "test": "vitest run" + "export": "./export.sh", + "test": "npm run export && export NO_EXPORT=1 && npm run test:node && npm run test:packages && npm run test:edge && npm run test:cloudflare && npm run test:vercel && npm run test:browser", + "test:node": "npm run export && vitest run --dir=tests/cli --environment=node --no-file-parallelism --typecheck", + "test:packages": "npm run export && vitest run --dir=tests/packages --environment=node --no-file-parallelism", + "test:edge": "npm run export && vitest run --dir=tests/cli --environment=edge-runtime --no-file-parallelism", + "test:cloudflare": "npm run export && vitest run --dir=tests/cloudflare --no-file-parallelism", + "test:vercel": "npm run export && vitest run --dir=tests/vercel --no-file-parallelism", + "test:browser": "npm run export && playwright install --with-deps firefox && vitest run --dir=tests/browser --browser --config=tests/browser/vite.config.mts --no-file-parallelism" }, "devDependencies": { - "@cloudflare/workers-types": "^4.20230115.0", + "@cloudflare/workers-types": "^4.20241230.0", + "@edge-runtime/vm": "^5.0.0", + "@microsoft/api-extractor": "^7.48.1", + "@neondatabase/serverless": "file:dist/npm", + "@prisma/adapter-neon": "^6.2.1", + "@prisma/client": "^6.2.1", "@types/events": "^3.0.0", "@types/pg": "^8.6.5", "@types/ws": "^8.5.4", + "@vercel/edge": "^1.2.1", + "@vercel/sdk": "^1.2.2", + "@vitest/browser": "^2.1.8", "dotenv": "^16.0.3", + "drizzle-orm": "^0.38.3", "esbuild": "^0.24.0", "fast-equals": "^5.0.1", - "subtls": "^0.3.0", + "node-fetch": "^3.3.2", + "playwright": "^1.49.1", + "prisma": "^6.2.1", + "subtls": "^0.4.6", "typescript": "^5.0.4", - "vitest": "^2.1.6", + "vitest": "^2.1.8", "wrangler": "^3.0.1" + }, + "prisma": { + "schema": "tests/packages/prisma/schema.prisma" } } diff --git a/shims/crypto/index.ts b/shims/crypto/index.ts index b60862a..1478aa5 100644 --- a/shims/crypto/index.ts +++ b/shims/crypto/index.ts @@ -1,8 +1,23 @@ import { sha256 } from './sha256'; import { Md5 } from './md5'; +// try to escape the attention of over-zealous bundlers +const cryptoLib = `node${String.fromCharCode(58)}crypto`; + export function randomBytes(length: number) { - return crypto.getRandomValues(Buffer.alloc(length)); + // three possibilities: + // (1) old Node, no crypto object + // (2) newer Node, crypto object + // (3) browsers, crypto object of type WebCrypto + if ( + typeof crypto !== 'undefined' && + (crypto as any).randomBytes !== undefined + ) { + const webcrypto = (crypto as any).webcrypto ?? crypto; + return webcrypto.getRandomValues(Buffer.alloc(length)); + } else { + return require(cryptoLib).randomBytes(length); + } } // hash/hmac notes: @@ -58,8 +73,8 @@ export function createHmac(type: 'sha256', key: string | Buffer | Uint8Array) { const innerKey = new Uint8Array(64); const outerKey = new Uint8Array(64); for (let i = 0; i < 64; i++) { - innerKey[i] = 0x36 ^ key[i]; - outerKey[i] = 0x5c ^ key[i]; + innerKey[i] = 0x36 ^ (key[i] as number); // cast should be unnecessary but dts-bundle-generator appears to need it + outerKey[i] = 0x5c ^ (key[i] as number); // ditto } const msg = new Uint8Array(data.length + 64); diff --git a/shims/crypto/md5.ts b/shims/crypto/md5.ts index 1c41f7e..39dd54e 100644 --- a/shims/crypto/md5.ts +++ b/shims/crypto/md5.ts @@ -1,5 +1,4 @@ /* - TypeScript Md5 ============== @@ -48,7 +47,6 @@ THE SOFTWARE. 0. You just DO WHAT YOU WANT TO. - */ interface HasherState { diff --git a/shims/net/index.ts b/shims/net/index.ts index 2136263..0eaeabf 100644 --- a/shims/net/index.ts +++ b/shims/net/index.ts @@ -8,13 +8,28 @@ import { EventEmitter } from 'events'; import type * as subtls from 'subtls'; +export type { subtls }; declare global { const debug: boolean; // e.g. --define:debug=false in esbuild command - interface WebSocket { - binaryType: 'arraybuffer' | 'blob'; // oddly not included in Cloudflare types - accept: () => void; - } +} + +export interface WebSocketLike { + // we define our own WebSocket type because different implementations have + // different signatures and we want to be compatible with any of them + readonly readyState: number; + binaryType: string; + close(code?: number, reason?: string): void; + send(data: any): void; + addEventListener( + type: 'open' | 'message' | 'close' | 'error', + listener: (this: WebSocketLike, ev: any) => any, + options?: any, + ): void; +} + +export interface WebSocketConstructor { + new (...args: any[]): WebSocketLike; } enum TlsState { @@ -52,7 +67,7 @@ export function isIP(input: string) { return 0; } -interface FetchEndpointOptions { +export interface FetchEndpointOptions { jwtAuth?: boolean; } @@ -69,7 +84,7 @@ export interface SocketDefaults { fetchConnectionCache: boolean; fetchFunction: any; // these options relate to the WebSocket transport - webSocketConstructor: typeof WebSocket | undefined; + webSocketConstructor: WebSocketConstructor | undefined; wsProxy: string | ((host: string, port: number | string) => string); useSecureWebSocket: boolean; forceDisablePgSSL: boolean; @@ -125,6 +140,14 @@ export class Socket extends EventEmitter { static opts: Partial = {}; private opts: Partial> = {}; + /** + * **Experimentally**, when `poolQueryViaFetch` is `true`, and no listeners + * for the `"connect"`, `"acquire"`, `"release"` or `"remove"` events are set + * on the `Pool`, queries via `Pool.query()` will be sent by low-latency HTTP + * fetch request. + * + * Default: `false`. + */ static get poolQueryViaFetch() { return Socket.opts.poolQueryViaFetch ?? Socket.defaults.poolQueryViaFetch; } @@ -132,6 +155,17 @@ export class Socket extends EventEmitter { Socket.opts.poolQueryViaFetch = newValue; } + /** + * Set `fetchEndpoint` to set the server endpoint to be sent queries via http + * fetch. May be useful in local development (e.g. to set a port that's not + * the default 443). + * + * Provide either the full endpoint URL, or a function that takes the + * database host address, port and options, and returns the full endpoint URL + * (including protocol). + * + * Default: custom logic to connect to Neon endpoints. + */ static get fetchEndpoint() { return Socket.opts.fetchEndpoint ?? Socket.defaults.fetchEndpoint; } @@ -139,6 +173,14 @@ export class Socket extends EventEmitter { Socket.opts.fetchEndpoint = newValue; } + /** + * **DEPRECATED**. Previously, only when `fetchConnectionCache` was `true` + * did queries carried via HTTP fetch make use of a connection pool/cache + * on the server. All queries now use the connection pool/cache: this setting + * is ignored. + * + * Default: `true`. + */ static get fetchConnectionCache() { return true; } @@ -150,6 +192,13 @@ export class Socket extends EventEmitter { ); } + /** + * The `fetchFunction` option allows you to supply an alternative function + * for making http requests. The function must accept the same arguments as + * native `fetch`. + * + * Default: `undefined`. + */ static get fetchFunction() { return Socket.opts.fetchFunction ?? Socket.defaults.fetchFunction; } @@ -157,6 +206,14 @@ export class Socket extends EventEmitter { Socket.opts.fetchFunction = newValue; } + /** + * Only if no global `WebSocket` object is available, such as in older + * versions of Node, set `webSocketConstructor` to the constructor for a + * custom WebSocket implementation, such as those provided by `ws` or + * `undici`. + * + * Default: `undefined`. + */ static get webSocketConstructor() { return ( Socket.opts.webSocketConstructor ?? Socket.defaults.webSocketConstructor @@ -174,6 +231,17 @@ export class Socket extends EventEmitter { this.opts.webSocketConstructor = newValue; } + /** + * Set `wsProxy` to use your own WebSocket proxy server. + * + * Provide either the proxy server’s domain name, or a function that takes + * the database host and port and returns the proxy server address (without + * protocol). + * + * Example: `(host, port) => "myproxy.example.net?address=" + host + ":" + port` + * + * Default: `host => host + '/v2'` + */ static get wsProxy() { return Socket.opts.wsProxy ?? Socket.defaults.wsProxy; } @@ -187,6 +255,12 @@ export class Socket extends EventEmitter { this.opts.wsProxy = newValue; } + /** + * Batch multiple network writes per run-loop into a single outgoing + * WebSocket message. + * + * Default: `true`. + */ static get coalesceWrites() { return Socket.opts.coalesceWrites ?? Socket.defaults.coalesceWrites; } @@ -200,6 +274,11 @@ export class Socket extends EventEmitter { this.opts.coalesceWrites = newValue; } + /** + * Use a secure (`wss:`) connection to the WebSocket proxy. + * + * Default: `true`. + */ static get useSecureWebSocket() { return Socket.opts.useSecureWebSocket ?? Socket.defaults.useSecureWebSocket; } @@ -215,6 +294,13 @@ export class Socket extends EventEmitter { this.opts.useSecureWebSocket = newValue; } + /** + * Disable TLS encryption in the Postgres protocol (as set via e.g. + * `?sslmode=require` in the connection string). Connection remains secure + * as long as `useSecureWebSocket` is `true`, which is the default. + * + * Default: `true` + */ static get forceDisablePgSSL() { return Socket.opts.forceDisablePgSSL ?? Socket.defaults.forceDisablePgSSL; } @@ -228,6 +314,17 @@ export class Socket extends EventEmitter { this.opts.forceDisablePgSSL = newValue; } + /** + * When using subtls with `forceDisablePgSSL = false` and Postgres connection + * parameters that specify TLS, setting `disableSNI = true` means that no SNI + * data in included in the Postgres TLS handshake. + * + * On Neon, disabling SNI and including the Neon project name in the password + * avoids CPU-intensive SCRAM authentication, but this is only relevant for + * earlier iterations of Neon's WebSocket support. + * + * Default: `false`. + */ static get disableSNI() { return Socket.opts.disableSNI ?? Socket.defaults.disableSNI; } @@ -241,6 +338,12 @@ export class Socket extends EventEmitter { this.opts.disableSNI = newValue; } + /** + * Pipelines the startup message, cleartext password message and first query + * when set to `"password"`. This works only for cleartext password auth. + * + * Default: `"password"`. + */ static get pipelineConnect() { return Socket.opts.pipelineConnect ?? Socket.defaults.pipelineConnect; } @@ -254,6 +357,18 @@ export class Socket extends EventEmitter { this.opts.pipelineConnect = newValue; } + /** + * If `forceDisablePgSSL` is `false` and the Postgres connection parameters + * specify TLS, you must supply the subtls TLS library to this option: + * + * ``` + * import { neonConfig } from '@neondatabase/serverless'; + * import * as subtls from 'subtls'; + * neonConfig.subtls = subtls; + * ``` + * + * Default: `undefined`. + */ static get subtls() { return Socket.opts.subtls ?? Socket.defaults.subtls; } @@ -267,6 +382,13 @@ export class Socket extends EventEmitter { this.opts.subtls = newValue; } + /** + * Pipeline the pg SSL request and TLS handshake when `forceDisablePgSSL` is + * `false` and the Postgres connection parameters specify TLS. Currently + * compatible only with Neon hosts. + * + * Default: `false`. + */ static get pipelineTLS() { return Socket.opts.pipelineTLS ?? Socket.defaults.pipelineTLS; } @@ -280,6 +402,14 @@ export class Socket extends EventEmitter { this.opts.pipelineTLS = newValue; } + /** + * Set `rootCerts` to a string comprising one or more PEM files. These are + * the trusted root certificates for a TLS connection to Postgres when + * `forceDisablePgSSL` is `false` and the Postgres connection parameters + * specify TLS. + * + * Default: `""`. + */ static get rootCerts() { return Socket.opts.rootCerts ?? Socket.defaults.rootCerts; } @@ -312,7 +442,7 @@ export class Socket extends EventEmitter { authorized = false; destroyed = false; - private ws: WebSocket | null = null; + private ws: WebSocketLike | null = null; private writeBuffer: Uint8Array | undefined; // used only if coalesceWrites === true private tlsState = TlsState.None; private tlsRead: undefined | (() => Promise); @@ -347,7 +477,7 @@ export class Socket extends EventEmitter { this.emit('ready'); }; - const configureWebSocket = (ws: WebSocket, immediateOpen = false) => { + const configureWebSocket = (ws: WebSocketLike, immediateOpen = false) => { ws.binaryType = 'arraybuffer'; ws.addEventListener('error', (err) => { @@ -398,12 +528,12 @@ export class Socket extends EventEmitter { } else { try { // second, try a common-or-garden WebSocket, e.g. in a web browser - this.ws = new WebSocket(wsAddrFull); - configureWebSocket(this.ws); + this.ws = new WebSocket(wsAddrFull) as any; + configureWebSocket(this.ws!); } catch (err) { debug && log('new WebSocket() failed'); - // @ts-ignore -- third, how about a Vercel Edge Functions __unstable_WebSocket (as at early 2023)?Í + // @ts-ignore -- unknown Vercel-specific object this.ws = new __unstable_WebSocket(wsAddrFull); configureWebSocket(this.ws!); } @@ -417,11 +547,12 @@ export class Socket extends EventEmitter { fetch(fetchAddrFull, { headers: { Upgrade: 'websocket' } }) .then((resp) => { - // @ts-ignore webSocket is defined in the Cloudflare types, but there are conflicts + // @ts-ignore -- unknown Cloudflare-specific property this.ws = resp.webSocket; if (this.ws == null) throw err; // deliberate loose equality - this.ws.accept(); + // @ts-ignore -- unknown Cloudflare-specific method + this.ws.accept!(); configureWebSocket(this.ws, true); debug && log('Cloudflare WebSocket opened'); }) @@ -430,7 +561,7 @@ export class Socket extends EventEmitter { this.emit( 'error', new Error( - `All attempts to open a WebSocket to connect to the database failed. Please refer to https://github.com/neondatabase/serverless/blob/main/CONFIG.md#websocketconstructor-typeof-websocket--undefined. Details: ${err.message}`, + `All attempts to open a WebSocket to connect to the database failed. Please refer to https://github.com/neondatabase/serverless/blob/main/CONFIG.md#websocketconstructor-typeof-websocket--undefined. Details: ${err}`, ), ); this.emit('close'); @@ -447,8 +578,8 @@ export class Socket extends EventEmitter { this.tlsState = TlsState.Handshake; - const rootCerts = this.subtls.TrustedCert.fromPEM(this.rootCerts); - const readQueue = new this.subtls.WebSocketReadQueue(this.ws!); + const rootCerts = this.subtls.TrustedCert.databaseFromPEM(this.rootCerts); + const readQueue = new this.subtls.WebSocketReadQueue(this.ws! as any); const networkRead = readQueue.read.bind(readQueue); const networkWrite = this.rawWrite.bind(this); @@ -472,7 +603,7 @@ export class Socket extends EventEmitter { this.authorized = true; this.emit('secureConnection', this); - this.tlsReadLoop(); + this.tlsReadLoop(); // deliberately NOT awaited } async tlsReadLoop() { diff --git a/shims/pg-native/index.js b/shims/pg-native/index.ts similarity index 100% rename from shims/pg-native/index.js rename to shims/pg-native/index.ts diff --git a/shims/string_decoder/index.ts b/shims/string_decoder/index.ts index fcea224..0eb5b55 100644 --- a/shims/string_decoder/index.ts +++ b/shims/string_decoder/index.ts @@ -1,5 +1,9 @@ +declare global { + class TextDecoderClass extends TextDecoder {} +} + export class StringDecoder { - td: TextDecoder; + td: TextDecoderClass; constructor(encoding: ConstructorParameters[0]) { this.td = new TextDecoder(encoding); diff --git a/shims/tls/index.ts b/shims/tls/index.ts index 55d3a01..04bbb14 100644 --- a/shims/tls/index.ts +++ b/shims/tls/index.ts @@ -2,7 +2,7 @@ export function connect({ socket, servername, }: { - socket: any; + socket: { startTls: (servername: string) => void }; servername: string; }) { socket.startTls(servername); diff --git a/src/index.ts b/src/index.ts index af9d7c4..0b0c4f3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,7 +2,7 @@ This file contains various checks that the driver is working. Different elements can be run using: - * `npm run node`, `npm run bun`, or `npm run browser` + * `npm run node` or `npm run browser` * `npm run cfDev` or `npm run cfDeploy` In the long run these checks should be turned into a formal test suits. @@ -14,7 +14,7 @@ import * as subtls from 'subtls'; import isrgRootX1 from './isrgrootx1.pem'; import { deepEqual } from 'fast-equals'; -import { Client, Pool, neon, neonConfig } from '../export'; +import { Client, NeonQueryFunction, Pool, neon, neonConfig } from '../export'; import { timedRepeats, runQuery, @@ -24,8 +24,6 @@ import { } from './util'; import { queries } from './queries'; -import type { ExecutionContext } from '@cloudflare/workers-types'; - export { neonConfig } from '../export'; export interface Env { @@ -38,7 +36,7 @@ export interface Env { export async function cf( request: Request, env: Env, - ctx: ExecutionContext, + ctx: any, ): Promise { let results: any[] = []; @@ -143,6 +141,7 @@ export async function batchQueryTest(env: Env, log = (...s: any[]) => {}) { // option setting on individual queries within a batch: should be honoured (despite types not supporting it) const [[r9], [r10]] = await sql.transaction((txn) => [ txn`SELECT ${1}::int AS "batchInt"`, + // @ts-expect-error txn('SELECT $1 AS "batchStr"', ['hello'], { arrayMode: true }), ]); log( @@ -195,7 +194,7 @@ export async function latencies( const connectRepeats = 9; log('Warm-up ...\n\n'); - await poolRunQuery(1, env.NEON_DB_URL, ctx, queries[0]); + await poolRunQuery(1, env.NEON_DB_URL, ctx as any, queries[0]); let counter = 0; @@ -295,7 +294,7 @@ export async function latencies( // timeout function sqlWithRetries( - sql: ReturnType, + sql: NeonQueryFunction, timeoutMs: number, attempts = 3, ) { @@ -355,7 +354,7 @@ export async function latencies( console.log(err); } try { - await poolRunQuery(1, env.NEON_DB_URL, ctx, { + await poolRunQuery(1, env.NEON_DB_URL, ctx as any, { sql: errstatement, test: () => true, }); @@ -422,24 +421,24 @@ export async function latencies( await sections('Neon/wss, no pipelining', async (n) => { const client = new Client(env.NEON_DB_URL); client.neonConfig.pipelineConnect = false; - await clientRunQuery(n, client, ctx, query); + await clientRunQuery(n, client, ctx as any, query); }); await sections('Neon/wss, pipelined connect (default)', async (n) => { const client = new Client(env.NEON_DB_URL); - await clientRunQuery(n, client, ctx, query); + await clientRunQuery(n, client, ctx as any, query); }); await sections('Neon/wss, pipelined connect, no coalescing', async (n) => { const client = new Client(env.NEON_DB_URL); client.neonConfig.coalesceWrites = false; - await clientRunQuery(n, client, ctx, query); + await clientRunQuery(n, client, ctx as any, query); }); await sections( 'Neon/wss, pipelined connect using Pool.query', async (n) => { - await poolRunQuery(n, env.NEON_DB_URL, ctx, query); + await poolRunQuery(n, env.NEON_DB_URL, ctx as any, query); }, ); @@ -467,7 +466,7 @@ export async function latencies( client.neonConfig.pipelineTLS = false; // only works with patched pg client.neonConfig.pipelineConnect = false; // only works with password auth, which we aren't offered this way try { - await clientRunQuery(n, client, ctx, query); + await clientRunQuery(n, client, ctx as any, query); } catch (err: any) { console.error(`\n*** ${err.message}`); } diff --git a/src/util.ts b/src/util.ts index 9ab6f11..f082d71 100644 --- a/src/util.ts +++ b/src/util.ts @@ -30,9 +30,9 @@ export async function runQuery( query: Query, ) { const { sql, test } = query; - const { rows } = await (typeof queryable === 'function' + const { rows } = (await (typeof queryable === 'function' ? queryable(sql) - : queryable.query(sql)); + : queryable.query(sql))) as any; if (!test(rows)) throw new Error( `Result fails test\nQuery: ${sql}\nResult: ${JSON.stringify(rows)}`, @@ -71,7 +71,7 @@ export async function httpRunQuery( query: Query, ) { const sql = neon(dbUrl, { fullResults: true }); - const tPlusResults = await timedRepeats(n, () => runQuery(sql, query)); + const tPlusResults = await timedRepeats(n, () => runQuery(sql as any, query)); return tPlusResults; } diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000..ec8b914 --- /dev/null +++ b/tests/README.md @@ -0,0 +1,59 @@ +# Testing notes + +- We _must_ test using the esbuild-bundled driver -- the code that's packaged up for npm -- because various shims are inserted only via this process. Importing the driver from `../export` would not test most of the code that it is intended to test. + +- The reason the serverless driver exists is to enable connecting (and connecting speedily) from a variety of platforms. We therefore test on a variety of platforms. The `cli`, `browser`, `cloudflare` and `vercel` subfolders contains these tests. + +## Platforms + +### `cli` + +For convenience, the most extensive tests are run via CLI. + +In CI we run these tests: + +1. On current Node LTS (Node has native fetch from 18 onwards and native WebSocket from 22 onwards) +2. On Node 16 (using node-fetch and ws) +3. On current Node LTS using vitest's `edge-runtime` environment + +Currently we do not test on Bun, as it is [not supported by vitest](https://github.com/oven-sh/bun/issues/4145), nor on Deno, [for the same reason](https://github.com/denoland/deno/issues/23882). + +### `packages` + +These brief tests make use of the driver from within drizzle-orm and Prisma. In CI, we run them on Node LTS only. + +They rely on a `file:` alias in `package.json`, from `@neondatabase/serverless` to the bundled driver. + +### `cloudflare` + +We run basic local tests on Cloudflare Workers using the `wrangler` tool's `unstable_dev` feature. + +These tests ensure that the package can be run and a query can be executed via (a) a `Client` created and connected manually, which uses WebSockets, (b) a `Pool`, which also uses WebSockets, and (c) the `neon` function, which uses https fetch. + +Note that it will usually be better to use ordinary [node-postgres](https://node-postgres.com/) with Cloudflare's [Hyperdrive](https://developers.cloudflare.com/hyperdrive/). + +### `vercel` + +We run the same basic tests in Vercel Functions, and these are actually deployed to and run on Vercel. + +Both the `nodejs` and `edge` runtimes are tested. + +### `browser` + +We run similar tests in a headless browser, using vitest's support for [playwright](https://playwright.dev/). + +We use Firefox as the browser, on the basis that this is a wholly independent JS engine to the test platforms above (which are all V8-based). + +## Extensions + +Possible future extensions to testing: + +- Test more scenarios! + +- Run the CLI tests on Bun and/or Deno + +- Run the browser tests on Chrome/Chromium + +- Run tests on AWS Lambda + +- Run tests with libraries such as Next.js, including on Cloudflare/Vercel diff --git a/tests/browser/browser.test.ts b/tests/browser/browser.test.ts new file mode 100644 index 0000000..979cec3 --- /dev/null +++ b/tests/browser/browser.test.ts @@ -0,0 +1,37 @@ +import { expect, test, assertType } from 'vitest'; +import { server } from '@vitest/browser/context'; +import { neon, Pool, Client, type QueryResult } from '../../dist/npm'; + +const DATABASE_URL = server.config.env.VITE_NEON_DB_URL!; + +test('log version', () => { + if (typeof navigator !== 'undefined') { + console.log(`UA: ${navigator.userAgent}`); + } +}); + +test('http query', async () => { + const sql = neon(DATABASE_URL); + const str = 'fetch'; + const fetchResult = await sql`SELECT ${str} AS str`; + assertType[]>(fetchResult); + expect(fetchResult).toStrictEqual([{ str: 'fetch' }]); +}); + +test('pool.query() over WebSockets', async () => { + const wsPool = new Pool({ connectionString: DATABASE_URL }); + const wsResult = await wsPool.query('SELECT $1::int AS one', [1]); + assertType>(wsResult); + expect(wsResult.rows).toStrictEqual([{ one: 1 }]); + expect((wsResult as any).viaNeonFetch).toBeUndefined(); +}); + +test('client.query()', async () => { + const client = new Client(DATABASE_URL); + await client.connect(); + const wsResult = await client.query('SELECT $1::int AS one', [1]); + assertType>(wsResult); + await client.end(); + expect(wsResult.rows).toStrictEqual([{ one: 1 }]); + expect((wsResult as any).viaNeonFetch).toBeUndefined(); +}); diff --git a/tests/browser/vite.config.mts b/tests/browser/vite.config.mts new file mode 100644 index 0000000..c1925a4 --- /dev/null +++ b/tests/browser/vite.config.mts @@ -0,0 +1,17 @@ +import { defineConfig } from 'vite'; + +export default defineConfig({ + test: { + browser: { + name: 'firefox', + provider: 'playwright', + headless: true, + screenshotFailures: false, + }, + }, + server: { + fs: { + strict: false, // allows us to read .env.test + }, + }, +}); diff --git a/tests/cli/general.test.ts b/tests/cli/general.test.ts new file mode 100644 index 0000000..778f47b --- /dev/null +++ b/tests/cli/general.test.ts @@ -0,0 +1,7 @@ +import { test } from 'vitest'; + +test('log version', () => { + if (typeof process !== 'undefined' && process.versions) { + console.log(`Node v${process.versions.node}`); + } +}); diff --git a/tests/cli/http.test.ts b/tests/cli/http.test.ts new file mode 100644 index 0000000..92fc66a --- /dev/null +++ b/tests/cli/http.test.ts @@ -0,0 +1,261 @@ +import { expect, test, vi, beforeAll, assertType } from 'vitest'; +import nodeFetch from 'node-fetch'; +import { neon, neonConfig, Pool, type FullQueryResults } from '../../dist/npm'; +import { sampleQueries } from './sampleQueries'; +import { polyfill } from './polyfill'; + +const DATABASE_URL = process.env.VITE_NEON_DB_URL!; +const sql = neon(DATABASE_URL); +const sqlFull = neon(DATABASE_URL, { fullResults: true }); +const pool = new Pool({ connectionString: DATABASE_URL }); + +beforeAll(polyfill); + +test( + 'http query results match WebSocket query results', + { timeout: 30000 }, + async () => { + const client = await pool.connect(); + + for (const queryPromise of sampleQueries(sqlFull)) { + const { query, params } = queryPromise.parameterizedQuery; + const [httpResult, wsResult] = await Promise.all([ + queryPromise, + client.query(query, params), + ]); + + // account for known/accepted differences: + // * http results are plain Objects, not Result instances + // * http results lack `oid` and `RowCtor` fields (which are both usually `null`) + // * http result `fields` array contains plain Objects, not Field instances + // * http results have `"viaNeonFetch": true` + + const httpResultProcessed = { ...httpResult, oid: null, RowCtor: null }; + const wsResultProcessed = { + ...wsResult, + fields: wsResult.fields.map((f) => ({ ...f })), + viaNeonFetch: true, + }; + + expect(httpResultProcessed).toStrictEqual(wsResultProcessed); + } + + client.release(); + }, +); + +interface FieldDef { + name: string; + tableID: number; + columnID: number; + dataTypeID: number; + dataTypeSize: number; + dataTypeModifier: number; + format: string; +} + +test('options to `neon()` and options on queries', async () => { + const sql__ = neon(DATABASE_URL); + const sqlff = neon(DATABASE_URL, { arrayMode: false, fullResults: false }); + const sqlft = neon(DATABASE_URL, { arrayMode: false, fullResults: true }); + const sqltf = neon(DATABASE_URL, { arrayMode: true, fullResults: false }); + const sqltt = neon(DATABASE_URL, { arrayMode: true, fullResults: true }); + const sqlt_ = neon(DATABASE_URL, { arrayMode: true }); + const sql_t = neon(DATABASE_URL, { fullResults: true }); + + // check defaults + assertType(sql__); + assertType(sql_t); + assertType(sqlt_); + + // check results + const ff = await sqlff`SELECT 'xyz' AS str`; // arrayMode false, fullResults false + assertType[]>(ff); // on `Record`, see https://stackoverflow.com/a/77626605 + expect(ff[0].str).toBe('xyz'); + + const ft = await sqlft`SELECT 'xyz' AS str`; // arrayMode false, fullResults true + assertType>(ft); + assertType[]>(ft.rows); + assertType(ft.fields); + assertType(ft.command); + assertType(ft.rowCount); + assertType(ft.rowAsArray); + expect(ft.rows[0].str).toBe('xyz'); + expect(ft.fields[0].name).toBe('str'); + expect(ft.fields[0].dataTypeID).toBe(25 /* text OID */); + expect(ft.command).toBe('SELECT'); + expect(ft.rowCount).toBe(1); + expect(ft.rowAsArray).toBe(false); + + const tf = await sqltf`SELECT 'xyz' AS str`; // arrayMode true, fullResults false + assertType(tf); + expect(tf[0][0]).toBe('xyz'); + + const tt = await sqltt`SELECT 'xyz' AS str`; // arrayMode true, fullResults true + assertType>(tt); + assertType(tt.rows); + assertType(tt.fields); + assertType(tt.command); + assertType(tt.rowCount); + assertType(tt.rowAsArray); + expect(tt.rows[0][0]).toBe('xyz'); + expect(tt.fields[0].name).toBe('str'); + expect(tt.fields[0].dataTypeID).toBe(25 /* text OID */); + expect(tt.command).toBe('SELECT'); + expect(tt.rowCount).toBe(1); + expect(tt.rowAsArray).toBe(true); + + // check per-query option overrides + const fftt = await sqlff("SELECT 'xyz' AS str", [], { + arrayMode: true, + fullResults: true, + }); + assertType>(fftt); + assertType(fftt.rows); + assertType(fftt.fields); + assertType(fftt.command); + assertType(fftt.rowCount); + assertType(fftt.rowAsArray); + expect(fftt.rows[0][0]).toBe('xyz'); + expect(fftt.fields[0].name).toBe('str'); + expect(fftt.fields[0].dataTypeID).toBe(25 /* text OID */); + expect(fftt.command).toBe('SELECT'); + expect(fftt.rowCount).toBe(1); + expect(fftt.rowAsArray).toBe(true); + + const ttff = await sqltt("SELECT 'xyz' AS str", [], { + arrayMode: false, + fullResults: false, + }); + assertType[]>(ttff); + expect(ttff[0].str).toBe('xyz'); +}); + +test('custom fetch', async () => { + const prevFetchFunction = neonConfig.fetchFunction; // might be polyfilled + try { + const fn = vi.fn((url, options) => nodeFetch(url, options)); + neonConfig.fetchFunction = fn; + await expect(sql`SELECT ${'customFetch'} AS str`).resolves.toStrictEqual([ + { str: 'customFetch' }, + ]); + expect(fn).toHaveBeenCalledOnce(); + } finally { + neonConfig.fetchFunction = prevFetchFunction; + } +}); + +test('errors match WebSocket query errors', async () => { + const q = 'SELECT 123 WHERE x'; + + await Promise.all([ + expect(sql(q)).rejects.toThrowError('column "x" does not exist'), + expect(pool.query(q)).rejects.toThrowError('column "x" does not exist'), + ]); + + // now compare all other properties (`code`, `routine`, `severity`, etc.) + const [httpErr, wsErr] = (await Promise.all([ + new Promise((resolve) => sql(q).catch((e: Error) => resolve(e))), + new Promise((resolve) => pool.query(q).catch((e: Error) => resolve(e))), + ])) as [any, any]; + + // account for known/accepted differences + httpErr.length = wsErr.length; // http errors don't have a `length` property + httpErr.name = wsErr.name; // http errors are named 'NeonDbError' rather than plain 'error' + wsErr.sourceError = undefined; // this property is unique to http errors + + // convert the errors into ordinary Objects, because vitest compares Errors only by message + expect({ ...httpErr }).toStrictEqual({ ...wsErr }); +}); + +test('http queries with too few or too many parameters', async () => { + await expect(sql('SELECT $1', [])).rejects.toThrowError( + 'bind message supplies 0 parameters', + ); + + await expect(sql('SELECT $1', [1, 2])).rejects.toThrowError( + 'bind message supplies 2 parameters', + ); +}); + +test('timeout aborting an http query', { timeout: 5000 }, async () => { + // note: in Node pre-17.3, you'd do this instead: + + // const abortController = new AbortController(); + // setTimeout(() => abortController.abort(new Error('fetch timed out')), 250); + // const { signal } = abortController; + + const signal = AbortSignal.timeout(250); + + await expect( + sql('SELECT pg_sleep(2)', [], { fetchOptions: { signal } }), + ).rejects.toThrow('aborted'); +}); + +test('timeout not aborting an http query', { timeout: 5000 }, async () => { + // note: in Node pre-17.3, you'd do this instead: + + // const abortController = new AbortController(); + // const timeout = setTimeout(() => abortController.abort(new Error('fetch timed out')), 2500); + // const { signal } = abortController; + + const signal = AbortSignal.timeout(2500); + + await expect( + sql('SELECT pg_sleep(.25)', [], { fetchOptions: { signal } }), + ).resolves.toStrictEqual([{ pg_sleep: '' }]); +}); + +test('database URL with wrong user to `neon()`', async () => { + const urlWithBadHost = DATABASE_URL.replace('//', '//x'); + const sqlBad = neon(urlWithBadHost); + await expect(sqlBad`SELECT ${1}::int AS one`).rejects.toThrowError( + 'password authentication failed', + ); +}); + +test('database URL with wrong password to `neon()`', async () => { + const urlWithBadPassword = DATABASE_URL.replace('@', 'x@'); + const sqlBad = neon(urlWithBadPassword); + await expect(sqlBad`SELECT ${1}::int AS one`).rejects.toThrowError( + 'password authentication failed', + ); +}); + +test('database URL with wrong project to `neon()`', async () => { + const urlWithBadHost = DATABASE_URL.replace('@', '@x'); + const sqlBad = neon(urlWithBadHost); + await expect(sqlBad`SELECT ${1}::int AS one`).rejects.toThrowError( + 'password authentication failed', + ); +}); + +test( + 'database URL with wrong host to `neon()`', + { timeout: 10000 }, + async () => { + const urlWithBadHost = DATABASE_URL.replace('.neon.tech', '.neon.techh'); + const sqlBad = neon(urlWithBadHost); + await expect(sqlBad`SELECT ${1}::int AS one`).rejects.toThrowError( + /fetch failed|ENOTFOUND/, // accounts for both native fetch and node-fetch error messages + ); + }, +); + +test('undefined database URL', async () => { + expect(() => neon(undefined as unknown as string)).toThrowError( + 'No database connection string was provided', + ); +}); + +test('empty database URL to `neon()`', async () => { + expect(() => neon('')).toThrowError( + 'No database connection string was provided', + ); +}); + +test('wrong-scheme database URL to `neon()`', async () => { + expect(() => neon(DATABASE_URL.replace(/^/, 'x'))).toThrowError( + 'Database connection string format for `neon()` should be', + ); +}); diff --git a/tests/cli/httpAuthorize.test.ts b/tests/cli/httpAuthorize.test.ts new file mode 100644 index 0000000..ddcc469 --- /dev/null +++ b/tests/cli/httpAuthorize.test.ts @@ -0,0 +1,44 @@ +import { expect, test, beforeAll } from 'vitest'; +import { neon } from '../../dist/npm'; +import { polyfill } from './polyfill'; + +const DATABASE_URL = process.env.VITE_NEON_DB_URL!; +const CLERK_USER = process.env.VITE_CLERK_USER!; +const CLERK_SECRET_KEY = process.env.VITE_CLERK_SECRET_KEY!; + +beforeAll(polyfill); + +async function clerkAPI(method: 'POST' | 'GET', endpoint: string, body?: any) { + if (typeof fetch !== 'function') { + const nodeFetch = await import('node-fetch'); + (globalThis as any).fetch = nodeFetch.default; + } + + const response = await fetch(`https://api.clerk.com/v1/${endpoint}`, { + method, + headers: { + Authorization: `Bearer ${CLERK_SECRET_KEY}`, + 'Content-Type': 'application/json', + }, + body: body && JSON.stringify(body), + }); + + return response.json(); +} + +test('connection with Neon Authorize', async () => { + const userEndpoint = `users?email_address[]=${CLERK_USER}`; + const [{ id: user_id }] = await clerkAPI('GET', userEndpoint); + const { id: session_id } = await clerkAPI('POST', 'sessions', { user_id }); + const { jwt } = await clerkAPI('POST', `sessions/${session_id}/tokens`); + + const sql = neon(DATABASE_URL); + await sql`CREATE EXTENSION IF NOT EXISTS pg_session_jwt`; + + const authSql = neon(DATABASE_URL.replace(/[^/]+@/, 'authenticated@'), { + authToken: jwt, + }); + const [{ user_id: queried_user_id }] = await authSql`SELECT auth.user_id()`; + + expect(queried_user_id).toBe(user_id); +}); diff --git a/tests/cli/httpTransaction.test.ts b/tests/cli/httpTransaction.test.ts new file mode 100644 index 0000000..2233512 --- /dev/null +++ b/tests/cli/httpTransaction.test.ts @@ -0,0 +1,128 @@ +import { assertType, beforeAll, expect, test } from 'vitest'; +import { polyfill } from './polyfill'; +import { neon } from '../../dist/npm'; + +const DATABASE_URL = process.env.VITE_NEON_DB_URL!; +const sql = neon(DATABASE_URL); + +beforeAll(polyfill); + +test('basic batch query with array of sql', async () => { + const [[a], [b]] = await sql.transaction([ + sql`SELECT ${1}::int AS "batchInt"`, + sql`SELECT ${'hello'} AS "batchStr"`, + ]); + expect(a.batchInt).toBe(1); + expect(b.batchStr).toBe('hello'); +}); + +test('basic batch query with function', async () => { + const [[a], [b]] = await sql.transaction((txn) => [ + txn`SELECT ${2}::int AS "batchInt"`, + txn`SELECT ${'goodbye'} AS "batchStr"`, + ]); + expect(a.batchInt).toBe(2); + expect(b.batchStr).toBe('goodbye'); +}); + +test('empty batch query with function', async () => { + const emptyResult = await sql.transaction(() => []); + expect(emptyResult).toHaveLength(0); +}); + +test('empty batch query with array', async () => { + const emptyResult = await sql.transaction([]); + expect(emptyResult).toHaveLength(0); +}); + +test('option setting on `transaction()`', async () => { + const [a, b] = await sql.transaction( + (txn) => [ + txn`SELECT ${1}::int AS "batchInt"`, + txn`SELECT ${'hello'} AS "batchStr"`, + ], + { arrayMode: true, isolationLevel: 'Serializable', readOnly: true }, // arrayMode changes result format below + ); + assertType(a); + assertType(b); + expect(a[0][0]).toBe(1); + expect(b[0][0]).toBe('hello'); +}); + +test('option setting on `neon()`', async () => { + const sqlArr = neon(DATABASE_URL, { + arrayMode: true, // arrayMode changes result format below + isolationLevel: 'RepeatableRead', + }); + const [a, b] = await sqlArr.transaction((txn) => [ + txn`SELECT ${1}::int AS "batchInt"`, + txn`SELECT ${'hello'} AS "batchStr"`, + ]); + assertType(a); + assertType(b); + expect(a[0][0]).toBe(1); + expect(b[0][0]).toBe('hello'); +}); + +test('option setting on `transaction()` overrides option setting on `neon()` (a)', async () => { + const sqlArr = neon(DATABASE_URL, { arrayMode: true }); + const [a, b] = await sqlArr.transaction( + (txn) => [ + txn`SELECT ${1}::int AS "batchInt"`, + txn`SELECT ${'hello'} AS "batchStr"`, + ], + { arrayMode: false }, + ); + assertType[]>(a); + assertType[]>(b); + expect(a[0].batchInt).toBe(1); + expect(b[0].batchStr).toBe('hello'); +}); + +test('option setting on `transaction()` overrides option setting on `neon()` (b)', async () => { + const [a, b] = await sql.transaction( + (txn) => [ + txn`SELECT ${1}::int AS "batchInt"`, + txn`SELECT ${'hello'} AS "batchStr"`, + ], + { fullResults: true }, + ); + assertType[]>(a.rows); + assertType[]>(b.rows); + expect(a.rows[0].batchInt).toBe(1); + expect(b.rows[0].batchStr).toBe('hello'); +}); + +test('option setting on individual queries within a batch (unsupported by types)', async () => { + const [[a], [b]] = await sql.transaction((txn) => [ + txn`SELECT ${1}::int AS "batchInt"`, + // @ts-expect-error this works but is unsupported by the TS types + txn('SELECT $1 AS "batchStr"', ['hello'], { arrayMode: true }), + ]); + expect(a.batchInt).toBe(1); + expect(b[0]).toBe('hello'); +}); + +test('invalid queries passed to `transaction()` in function', async () => { + await expect( + // @ts-expect-error + sql.transaction((txn) => [ + txn`SELECT ${1}::int AS "batchInt"`, + `SELECT ${'hello'} AS "batchStr"`, // <- oops, this is a bare string + ]), + ).rejects.toThrowError( + 'transaction() expects an array of queries, or a function returning an array of queries', + ); +}); + +test('invalid queries passed to `transaction()` in array', async () => { + await expect( + sql.transaction([ + sql`SELECT ${1}::int AS "batchInt"`, + // @ts-expect-error + `SELECT ${'hello'} AS "batchStr"`, // <- oops, this is a bare string + ]), + ).rejects.toThrowError( + 'transaction() expects an array of queries, or a function returning an array of queries', + ); +}); diff --git a/tests/cli/polyfill.ts b/tests/cli/polyfill.ts new file mode 100644 index 0000000..cec1394 --- /dev/null +++ b/tests/cli/polyfill.ts @@ -0,0 +1,14 @@ +import { neonConfig } from '../../dist/npm'; + +export async function polyfill() { + if (typeof fetch !== 'function') { + console.info('Importing node-fetch for neonConfig.fetchFunction'); + const fetch = await import('node-fetch'); + neonConfig.fetchFunction = fetch.default; + } + if (typeof WebSocket !== 'function') { + console.info('Importing ws for neonConfig.webSocketConstructor'); + const { WebSocket } = await import('ws'); + neonConfig.webSocketConstructor = WebSocket; + } +} diff --git a/tests/cli/sampleQueries.ts b/tests/cli/sampleQueries.ts new file mode 100644 index 0000000..ddda30e --- /dev/null +++ b/tests/cli/sampleQueries.ts @@ -0,0 +1,60 @@ +import type { NeonQueryFunction } from '../../dist/npm'; + +const now = new Date(); +export const sampleQueries = (sql: NeonQueryFunction) => [ + // tagged-template + sql`SELECT ${1} AS int_uncast`, + sql`SELECT ${-1}::int AS int`, + sql`SELECT ${1}::int8 AS int8num`, + sql`SELECT ${-1}::decimal AS decimalnum`, + sql`SELECT ${2n} AS bigint`, + sql`SELECT ${9007199254740993n} AS bigint`, // > MAX_SAFE_INTEGER + sql`SELECT ${Math.PI} AS pi`, + sql`SELECT ${Math.PI}::real AS pi`, + sql`SELECT ${Math.PI}::double precision AS pi`, + sql`SELECT ${'[1,4)'}::int4range AS int4range`, + sql`SELECT ${'hello'} AS str`, + sql`SELECT ${['a', 'b', 'c']} AS arrstr_uncast`, + sql`SELECT ${[[2], [4]]}::int[][] AS arrnumnested`, + sql`SELECT ${now}::timestamptz AS timestamptznow`, + sql`SELECT ${'16:17:18+01:00'}::timetz AS timetz`, + sql`SELECT ${'17:18:19'}::time AS time`, + sql`SELECT ${now}::date AS datenow`, + sql`SELECT ${{ x: 'y' }} AS obj_uncast`, + sql`SELECT ${'11:22:33:44:55:66'}::macaddr AS macaddr`, + sql`SELECT ${'\\xDEADBEEF'}::bytea AS bytea`, + sql`SELECT ${'(2, 3)'}::point AS point`, + sql`SELECT ${'<(2, 3), 1>'}::circle AS circle`, + sql`SELECT ${'10.10.10.0/24'}::cidr AS cidr`, + sql`SELECT ${true} AS bool_uncast`, + sql`SELECT ${'hello'} || ' ' || ${'world'} AS greeting`, + sql`SELECT ${[1, 2, 3]}::int[] AS arrnum`, + sql`SELECT ${['a', 'b', 'c']}::text[] AS arrstr`, + sql`SELECT ${{ x: 'y' }}::jsonb AS jsonb_obj`, + sql`SELECT ${{ x: 'y' }}::json AS json_obj`, + sql`SELECT ${{ x: 'y' }} AS json_obj_uncast`, + sql`SELECT ${['11:22:33:44:55:66']}::macaddr[] AS arrmacaddr`, + sql`SELECT ${['10.10.10.0/24']}::cidr[] AS arrcidr`, + sql`SELECT ${true}::boolean AS bool`, + sql`SELECT ${[now]}::timestamptz[] AS arrtstz`, + sql`SELECT ${['(2, 3)']}::point[] AS arrpoint`, + sql`SELECT ${['<(2, 3), 1>']}::circle[] AS arrcircle`, + sql`SELECT ${['\\xDEADBEEF', '\\xDEADBEEF']}::bytea[] AS arrbytea`, + sql`SELECT null AS null`, + sql`SELECT ${null} AS null`, + sql`SELECT ${'NULL'} AS null_str`, + sql`SELECT ${[1, 2, 3]} AS arrnum_uncast`, + sql`SELECT ${[[2], [4]]} AS arrnumnested_uncast`, + sql`SELECT ${now} AS timenow_uncast`, + sql`SELECT ${now}::timestamp AS timestampnow`, + sql`SELECT ${new Uint8Array([65, 66, 67])} AS bytea`, + sql`SELECT ${new Uint8Array(65536).fill(128)} AS bytea`, + sql`SELECT ${Buffer.from([65, 66, 67])} AS bytea`, + sql`SELECT ${1} AS one, ${sql("'raw'")} AS raw, ${'x'} AS x, ${now} AS date`, // multiple types plus raw SQL + + // non-tagged-template + sql('SELECT $1::timestamp AS timestampnow', [now]), + sql("SELECT $1 || ' ' || $2 AS greeting", ['hello', 'world']), + sql('SELECT 123 AS num'), + sql('SELECT 123 AS num', []), +]; diff --git a/tests/cli/subtlsCert.ts b/tests/cli/subtlsCert.ts new file mode 100644 index 0000000..c272e81 --- /dev/null +++ b/tests/cli/subtlsCert.ts @@ -0,0 +1,31 @@ +export const ISRGX1Cert = `-----BEGIN CERTIFICATE----- +MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw +TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh +cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4 +WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu +ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY +MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygc +h77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+ +0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6U +A5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sW +T8KOEUt+zwvo/7V3LvSye0rgTBIlDHCNAymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyH +B5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ4Q7e2RCOFvu396j3x+UC +B5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6awBdpUKD9jf1b0SHzUv +KBds0pjBqAlkd25HN7rOrFleaJ1/ctaJxQZBKT5ZPt0m9STJEadao0xAH0ahmbWn +OlFuhjuefXKnEgV4We0+UXgVCwOPjdAvBbI+e0ocS3MFEvzG6uBQE3xDk3SzynTn +jh8BCNAw1FtxNrQHusEwMFxIt4I7mKZ9YIqioymCzLq9gwQbooMDQaHWBfEbwrbw +qHyGO0aoSCqI3Haadr8faqU9GY/rOPNk3sgrDQoo//fb4hVC1CLQJ13hef4Y53CI +rU7m2Ys6xt0nUW7/vGT1M0NPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR5tFnme7bl5AFzgAiIyBpY9umbbjANBgkq +hkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZL +ubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ +3BebYhtF8GaV0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KK +NFtY2PwByVS5uCbMiogziUwthDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5 +ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7Ur +TkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdC +jNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVc +oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq +4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA +mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d +emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc= +-----END CERTIFICATE-----`; diff --git a/tests/cli/ws.test.ts b/tests/cli/ws.test.ts new file mode 100644 index 0000000..504ee46 --- /dev/null +++ b/tests/cli/ws.test.ts @@ -0,0 +1,175 @@ +import { expect, test, describe, beforeAll, vi, assertType } from 'vitest'; +import { Pool as PgPool, type QueryResult } from 'pg'; +import * as subtls from 'subtls'; +import { sampleQueries } from './sampleQueries'; +import { polyfill } from './polyfill'; +import { ISRGX1Cert } from './subtlsCert'; +import { + neon, + neonConfig, + Pool as WsPool, + Client as WsClient, +} from '../../dist/npm'; + +function recursiveTransform(x: any, transform: (x: any) => any) { + if (Array.isArray(x)) { + return x.map((item) => recursiveTransform(item, transform)); + } else if (x !== null && typeof x === 'object') { + return Object.fromEntries( + Object.entries(x).map(([k, v]) => [k, recursiveTransform(v, transform)]), + ); + } else { + return transform(x); + } +} + +function functionsToPlaceholders(x: any) { + return recursiveTransform(x, (x) => + typeof x === 'function' ? `__fn_arity_${x.length}__` : x, + ); +} + +const DB_DIRECT_URL = process.env.VITE_NEON_DB_URL!; +const DB_POOLER_URL = process.env.VITE_NEON_DB_POOLER_URL!; + +const pgPool = new PgPool({ connectionString: DB_DIRECT_URL }); + +beforeAll(polyfill); + +describe.each([ + { + DB_URL: DB_DIRECT_URL, + wsPool: new WsPool({ connectionString: DB_DIRECT_URL }), + }, + { + DB_URL: DB_POOLER_URL, + wsPool: new WsPool({ connectionString: DB_POOLER_URL }), + }, +])('WebSocket connections and queries', ({ DB_URL, wsPool }) => { + test( + 'WebSockets query results match pg/TCP query results, using pool.connect()', + { timeout: 30000 }, + async () => { + const wsClient = await wsPool.connect(); + const pgClient = await pgPool.connect(); + const sql = neon('postgresql://dummy:dummy@dummy.dummy/dummy'); // the URL is not actually used + + for (const queryPromise of sampleQueries(sql)) { + const { query, params } = queryPromise.parameterizedQuery; + const [wsResult, pgResult] = await Promise.all([ + wsClient.query(query, params), + pgClient.query(query, params), + ]); + + // unprocessed results don't strictly match because functions are minified by ws driver + expect(functionsToPlaceholders(wsResult)).toStrictEqual( + functionsToPlaceholders(pgResult), + ); + } + + wsClient.release(); + pgClient.release(); + }, + ); + + test('pool.query() over WebSockets', async () => { + const wsResult = await wsPool.query('SELECT $1::int AS one', [1]); + assertType>(wsResult); + expect(wsResult.rows).toStrictEqual([{ one: 1 }]); + expect((wsResult as any).viaNeonFetch).toBeUndefined(); + }); + + test('pool.query() with poolQueryViaFetch', async () => { + try { + neonConfig.poolQueryViaFetch = true; + const wsResult = await wsPool.query('SELECT $1::int AS one', [1]); + assertType>(wsResult); + expect(wsResult.rows).toStrictEqual([{ one: 1 }]); + expect((wsResult as any).viaNeonFetch).toBe(true); + } finally { + neonConfig.poolQueryViaFetch = false; + } + }); + + test('pool.query() with poolQueryViaFetch but also a listener that prevents fetch', async () => { + neonConfig.poolQueryViaFetch = true; + + // use a new Pool because we know it will have to connect a new client + const customPool = new WsPool({ connectionString: DB_URL }); + + try { + const fn = vi.fn(); + const connectListener = () => { + customPool.removeListener('connect', connectListener); + fn(); + }; + customPool.addListener('connect', connectListener); + + const wsResult = await customPool.query('SELECT $1::int AS one', [1]); + assertType>(wsResult); + expect(wsResult.rows).toStrictEqual([{ one: 1 }]); + expect(wsResult).not.toHaveProperty('viaNeonFetch'); + expect(fn).toHaveBeenCalledOnce(); + } finally { + neonConfig.poolQueryViaFetch = false; + customPool.end(); + } + }); + + test('client.query()', async () => { + const client = new WsClient(DB_URL); + await client.connect(); + const wsResult = await client.query('SELECT $1::int AS one', [1]); + assertType>(wsResult); + await client.end(); + expect(wsResult.rows).toStrictEqual([{ one: 1 }]); + expect((wsResult as any).viaNeonFetch).toBeUndefined(); + }); + + test('client.query() with pipelined connect (yes, no) x coalesced writes (yes, no)', async () => { + const { pipelineConnect, coalesceWrites } = neonConfig; + try { + for (const pc of ['password', false] as const) { + for (const cw of [true, false]) { + neonConfig.pipelineConnect = pc; + neonConfig.coalesceWrites = cw; + + const client = new WsClient(DB_URL); + await client.connect(); + const wsResult = await wsPool.query('SELECT $1::int AS one', [1]); + assertType>(wsResult); + await client.end(); + + expect(wsResult.rows).toStrictEqual([{ one: 1 }]); + expect((wsResult as any).viaNeonFetch).toBeUndefined(); + } + } + } finally { + neonConfig.pipelineConnect = pipelineConnect; + neonConfig.coalesceWrites = coalesceWrites; + } + }); + + if ( + typeof process !== 'undefined' && + process.versions !== undefined && + parseInt(process.versions.node) >= 19 + ) { + // subtls test requires SCRAM auth, which requires `crytpo.subtle`, available from Node 19 onwards + test('client.query() with custom WebSocket proxy and subtls', async () => { + const client = new WsClient(DB_URL); + client.neonConfig.wsProxy = process.env.VITE_WSPROXY!; + client.neonConfig.forceDisablePgSSL = false; + client.neonConfig.pipelineConnect = false; + client.neonConfig.subtls = subtls; + client.neonConfig.rootCerts = ISRGX1Cert; + + await client.connect(); + const wsResult = await wsPool.query('SELECT $1::int AS one', [1]); + assertType>(wsResult); + await client.end(); + expect(wsResult.rows).toStrictEqual([{ one: 1 }]); + expect((wsResult as any).viaNeonFetch).toBeUndefined(); + }); + } +}); diff --git a/tests/cloudflare/worker.test.ts b/tests/cloudflare/worker.test.ts new file mode 100644 index 0000000..803fc19 --- /dev/null +++ b/tests/cloudflare/worker.test.ts @@ -0,0 +1,34 @@ +import { expect, test, beforeAll, afterAll } from 'vitest'; +import { unstable_dev, type Unstable_DevWorker } from 'wrangler'; + +let worker: Unstable_DevWorker; + +beforeAll(async () => { + worker = await unstable_dev('tests/cloudflare/worker.ts', { + experimental: { disableExperimentalWarning: true }, + }); +}); + +afterAll(async () => { + await worker.stop(); +}); + +test('Cloudflare Worker should respond with queried values', async () => { + // only wrangler.toml can be used to provide env vars (https://github.com/cloudflare/workers-sdk/issues/2898) + // -- so we pass them in via the request URL instead + const env = Object.fromEntries( + Object.entries(process.env).filter(([k, v]) => k.startsWith('VITE_')), + ); + const envJSON = JSON.stringify(env); + const envJSONEncoded = encodeURIComponent(envJSON); + + const resp = await worker.fetch('http://dummy.host/' + envJSONEncoded); + const json = await resp.json(); + + expect(json).toStrictEqual({ + clientRows: [{ clientstr: 'client' }], + poolRows: [{ poolstr: 'pool' }], + poolClientRows: [{ poolclientstr: 'poolclient' }], + fetchRows: [{ fetchstr: 'fetch' }], + }); +}); diff --git a/tests/cloudflare/worker.ts b/tests/cloudflare/worker.ts new file mode 100644 index 0000000..62f0a89 --- /dev/null +++ b/tests/cloudflare/worker.ts @@ -0,0 +1,48 @@ +import { Client, Pool, neon } from '../../dist/npm'; +import type { ExecutionContext } from '@cloudflare/workers-types'; + +export default { + async fetch(request: Request, emptyEnv: any, ctx: ExecutionContext) { + // only wrangler.toml can be used to provide env vars (https://github.com/cloudflare/workers-sdk/issues/2898) + // -- so we pass them in via the request URL instead + const envJSON = decodeURIComponent(new URL(request.url).pathname.slice(1)); + const env = JSON.parse(envJSON); + + const DATABASE_URL = env.VITE_NEON_DB_URL; + let q: string; + + // test WebSockets (Client.prototype.query) + q = "SELECT 'client' AS clientstr"; + const client = new Client(DATABASE_URL); + await client.connect(); + const { rows: clientRows } = await client.query(q); + ctx.waitUntil(client.end()); + + // test WebSockets (Pool.prototype.query) + q = "SELECT 'pool' AS poolstr"; + const pool = new Pool({ connectionString: DATABASE_URL }); + const { rows: poolRows } = await pool.query(q); + + // test WebSockets (Pool.prototype.connect) + q = "SELECT 'poolclient' AS poolclientstr"; + const poolClient = await pool.connect(); + const { rows: poolClientRows } = await poolClient.query(q); + poolClient.release(); + ctx.waitUntil(pool.end()); + + // test http fetch + q = "SELECT 'fetch' AS fetchstr"; + const sql = neon(DATABASE_URL, { fullResults: true }); + const { rows: fetchRows } = await sql(q); + + // respond + const responseData = { clientRows, poolRows, poolClientRows, fetchRows }; + const responseJson = JSON.stringify(responseData, null, 2); + return new Response(responseJson, { + headers: { + 'Content-Type': 'application/json', + 'Access-Control-Allow-Origin': '*', + }, + }); + }, +}; diff --git a/tests/packages/drizzle/http.test.ts b/tests/packages/drizzle/http.test.ts new file mode 100644 index 0000000..3599ae6 --- /dev/null +++ b/tests/packages/drizzle/http.test.ts @@ -0,0 +1,19 @@ +import { expect, test } from 'vitest'; +import { neon } from '../../../dist/npm'; +import { drizzle } from 'drizzle-orm/neon-http'; +import { sql } from 'drizzle-orm'; + +// note that these tests rely on this line in package.json's "devDependencies": +// "@neondatabase/serverless": "file:dist/npm" + +const DATABASE_URL = process.env.VITE_NEON_DB_URL!; + +test('basic query using drizzle-orm with https fetch', async () => { + const db = drizzle({ client: neon(DATABASE_URL) }); + + const result = await db + .select({ x: sql`generate_series` }) + .from(sql`generate_series(1, 3)`); + + expect(result).toStrictEqual([{ x: 1 }, { x: 2 }, { x: 3 }]); +}); diff --git a/tests/packages/drizzle/ws.test.ts b/tests/packages/drizzle/ws.test.ts new file mode 100644 index 0000000..249ea16 --- /dev/null +++ b/tests/packages/drizzle/ws.test.ts @@ -0,0 +1,20 @@ +import { expect, test } from 'vitest'; +import { Pool } from '../../../dist/npm'; +import { drizzle } from 'drizzle-orm/neon-serverless'; +import { sql } from 'drizzle-orm'; + +// note that these tests rely on this line in package.json's "devDependencies": +// "@neondatabase/serverless": "file:dist/npm" + +const DATABASE_URL = process.env.VITE_NEON_DB_URL!; + +test('basic query using drizzle-orm with WebSockets', async () => { + const client = new Pool({ connectionString: DATABASE_URL }); + const db = drizzle(client); + + const result = await db + .select({ x: sql`generate_series` }) + .from(sql`generate_series(1, 3)`); + + expect(result).toStrictEqual([{ x: 1 }, { x: 2 }, { x: 3 }]); +}); diff --git a/tests/packages/prisma/http.test.ts b/tests/packages/prisma/http.test.ts new file mode 100644 index 0000000..f32136f --- /dev/null +++ b/tests/packages/prisma/http.test.ts @@ -0,0 +1,19 @@ +import { expect, test } from 'vitest'; +import { neon } from '@neondatabase/serverless'; // see package.json: this points to 'file:../../../dist/npm' +import { PrismaNeonHTTP } from '@prisma/adapter-neon'; +import { PrismaClient } from '@prisma/client'; + +const DATABASE_URL = process.env.VITE_NEON_DB_URL!; + +test('basic query using Prisma with http', async () => { + const sql = neon(DATABASE_URL); + const adapter = new PrismaNeonHTTP(sql); + const prisma = new PrismaClient({ adapter }); + const tzName = 'Europe/London'; + const result = await prisma.pg_timezone_names.findFirst({ + where: { name: tzName }, + }); + expect(result!.name).toBe(tzName); + expect(result!.abbrev).toBeTypeOf('string'); + expect(result!.is_dst).toBeTypeOf('boolean'); +}); diff --git a/tests/packages/prisma/schema.prisma b/tests/packages/prisma/schema.prisma new file mode 100644 index 0000000..26c4338 --- /dev/null +++ b/tests/packages/prisma/schema.prisma @@ -0,0 +1,17 @@ +datasource db { + url = env("VITE_NEON_DB_URL") + provider = "postgresql" + schemas = ["pg_catalog"] +} + +generator client { + provider = "prisma-client-js" + previewFeatures = ["driverAdapters", "views", "multiSchema"] +} + +view pg_timezone_names { + @@schema("pg_catalog") + name String @unique + abbrev String + is_dst Boolean +} diff --git a/tests/packages/prisma/ws.test.ts b/tests/packages/prisma/ws.test.ts new file mode 100644 index 0000000..402f025 --- /dev/null +++ b/tests/packages/prisma/ws.test.ts @@ -0,0 +1,33 @@ +import { expect, test } from 'vitest'; +import { Pool } from '@neondatabase/serverless'; // see package.json: this points to 'file:../../../dist/npm' +import { PrismaNeon } from '@prisma/adapter-neon'; +import { PrismaClient } from '@prisma/client'; + +const DATABASE_URL = process.env.VITE_NEON_DB_URL!; + +test('basic query using Prisma with WebSockets', async () => { + const pool = new Pool({ connectionString: DATABASE_URL }); + + // note: we bypass the PrismaNeon constructor and recreate the work it does + // manually, because the `instanceof` check it performs throws an error (is + // it running in a different context, perhaps?) + + // not: + // const adapter = new PrismaNeon(pool); + + // instead: + const adapter = Object.create(PrismaNeon.prototype); + adapter.adapterName = '@prisma/adapter-neon'; + adapter.provider = 'postgres'; + adapter.client = pool; + adapter.isRunning = true; + + const prisma = new PrismaClient({ adapter }); + const tzName = 'Europe/London'; + const result = await prisma.pg_timezone_names.findFirst({ + where: { name: tzName }, + }); + expect(result!.name).toBe(tzName); + expect(result!.abbrev).toBeTypeOf('string'); + expect(result!.is_dst).toBeTypeOf('boolean'); +}); diff --git a/tests/test.test.ts b/tests/test.test.ts deleted file mode 100644 index 44ed59e..0000000 --- a/tests/test.test.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { expect, test } from 'vitest'; - -test('adds 1 + 2 to equal 3', () => { - expect(1 + 2).toBe(3); -}); diff --git a/tests/vercel/function.mjs b/tests/vercel/function.mjs new file mode 100644 index 0000000..771cfbc --- /dev/null +++ b/tests/vercel/function.mjs @@ -0,0 +1,56 @@ +// at deployment we copy this from index.mjs in the npm package +import { Client, Pool, neon } from '../../neondatabase-serverless.mjs'; + +// note: we use this file for both Edge and Node runtimes +// - for both, we append a definition for the variable `moment` +// - for Edge, we also append/export the appropriate `config` variable + +export default async (req, rc) => { + // rc is response for nodejs, context for edge + + const DATABASE_URL = process.env.DATABASE_URL; // note: destructuring may not work as expected here + let q; + + // test WebSockets (Client.prototype.query) + q = "SELECT 'client' AS clientstr"; + const client = new Client(DATABASE_URL); + await client.connect(); + const { rows: clientRows } = await client.query(q); + await client.end(); // await is OK here, but waitUntil(...) is quicker for real use-cases + + // test WebSockets (Pool.prototype.query) + q = "SELECT 'pool' AS poolstr"; + const pool = new Pool({ connectionString: DATABASE_URL }); + const { rows: poolRows } = await pool.query(q); + + // test WebSockets (Pool.prototype.connect) + q = "SELECT 'poolclient' AS poolclientstr"; + const poolClient = await pool.connect(); + const { rows: poolClientRows } = await poolClient.query(q); + poolClient.release(); + await pool.end(); + + // test http fetch + q = "SELECT 'fetch' AS fetchstr"; + const sql = neon(DATABASE_URL, { fullResults: true }); + const { rows: fetchRows } = await sql(q); + + // respond + const responseData = { + clientRows, + poolRows, + poolClientRows, + fetchRows, + moment, + }; + + if (rc.json) { + // nodejs runtime + rc.json(responseData); + } else { + // edge runtime + return new Response(JSON.stringify(responseData), { + headers: { 'Content-Type': 'application/json' }, + }); + } +}; diff --git a/tests/vercel/vercel.test.ts b/tests/vercel/vercel.test.ts new file mode 100644 index 0000000..4c43816 --- /dev/null +++ b/tests/vercel/vercel.test.ts @@ -0,0 +1,123 @@ +import { expect, test, beforeAll, afterAll } from 'vitest'; +import fs from 'fs/promises'; +import { Vercel } from '@vercel/sdk'; + +const projectName = 'neon-serverless-tests-project'; +const vercel = new Vercel({ + bearerToken: process.env.VITE_VERCEL_TOKEN, +}); + +test( + 'Vercel functions (Edge and Node) should respond with queried values', + { timeout: 90000 }, // 90-sec timeout since deploying to Vercel can take time + async () => { + // create project + try { + await vercel.projects.createProject({ + requestBody: { name: projectName }, + }); + } catch (e) { + // http status 409 Conflict just means we created the project before, which is fine + if (e.statusCode !== 409) throw e; + } + + // update project to remove signed-in requirement for production deploy links + await vercel.projects.updateProject({ + idOrName: projectName, + requestBody: { + ssoProtection: { deploymentType: 'preview' }, // i.e. NOT production + }, + }); + + // set environment variable(s) + await vercel.projects.createProjectEnv({ + idOrName: projectName, + upsert: 'true', + requestBody: [ + { + key: 'DATABASE_URL', + value: process.env.VITE_NEON_DB_POOLER_URL!, + type: 'encrypted', + target: ['production'], + }, + ], + }); + + // deploy + const utf8 = { encoding: 'utf-8' } as const; + const moment = Date.now(); // used for double-checking we're fetching from this new deployment + + const packageSrc = await fs.readFile('dist/npm/index.mjs', utf8); + const fnRawSrc = await fs.readFile('tests/vercel/function.mjs', utf8); + const fnSrc = fnRawSrc + `\nconst moment = ${moment};`; + + const edgeSrc = fnSrc + "\nexport const config = { runtime: 'edge' };"; + const nodeSrc = fnSrc; // specifying `runtime: "nodejs"` causes an error + + const createDeploymentResponse = await vercel.deployments.createDeployment({ + requestBody: { + project: projectName, + target: 'production', + name: 'neon-serverless-tests-deployment', + projectSettings: { + rootDirectory: 'public', + sourceFilesOutsideRootDirectory: true, + }, + files: [ + { + file: 'public/api/edge.mjs', + data: edgeSrc, + ...utf8, + }, + { + file: 'public/api/node.mjs', + data: nodeSrc, + ...utf8, + }, + { + file: 'neondatabase-serverless.mjs', + data: packageSrc, + ...utf8, + }, + ], + }, + }); + + const deploymentId = createDeploymentResponse.id; + + // await deployment + let status, host; + do { + await new Promise((resolve) => setTimeout(resolve, 2000)); // wait 2 seconds between checks + const statusResponse = await vercel.deployments.getDeployment({ + idOrUrl: deploymentId, + }); + status = statusResponse.status; + host = statusResponse.url; + } while ( + status === 'QUEUED' || + status === 'BUILDING' || + status === 'INITIALIZING' + ); + + if (status !== 'READY') { + throw new Error(`Unexpected deployment status: ${status}`); + } + + console.log(`Vercel deployment: ${host}`); + + // fetches + for (const runtime of ['edge', 'node']) { + const url = `https://${host}/api/${runtime}`; + const fetchResponse = await fetch(url); + const fetchJson = await fetchResponse.json(); + expect(fetchJson).toStrictEqual({ + clientRows: [{ clientstr: 'client' }], + poolRows: [{ poolstr: 'pool' }], + poolClientRows: [{ poolclientstr: 'poolclient' }], + fetchRows: [{ fetchstr: 'fetch' }], + moment, // a definition for this variable is appended on deploy + }); + } + }, +); diff --git a/tsconfig.json b/tsconfig.json index 979442e..d7bd8d8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,18 +7,18 @@ "module": "ES2022" /* Specify what module code is generated. */, "moduleResolution": "Node" /* Specify how TypeScript looks up a file from a given module specifier. */, "esModuleInterop": true, - "types": [ - "@cloudflare/workers-types" - ] /* Specify type package names to be included without being referenced in a source file. */, "resolveJsonModule": true /* Enable importing .json files */, "allowJs": true /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */, "checkJs": false /* Enable error reporting in type-checked JavaScript files. */, - "noEmit": true /* Disable emitting files from a compilation. */, + "declaration": true, + "emitDeclarationOnly": true, + "declarationDir": "dist/dts", "isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */, "allowSyntheticDefaultImports": true /* Allow 'import x from y' when a module doesn't have a default export. */, "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, "strict": true /* Enable all strict type-checking options. */, - "skipLibCheck": true /* Skip type checking all .d.ts files. */ + "noImplicitOverride": true, + "skipLibCheck": false /* Skip type checking all .d.ts files. */ }, - "exclude": ["dist"] + "files": ["export/index.ts"] } diff --git a/wrangler.toml b/wrangler.toml deleted file mode 100644 index 1db698b..0000000 --- a/wrangler.toml +++ /dev/null @@ -1,13 +0,0 @@ -name = "pgshims" -main = "dist/cfworker/index.js" -compatibility_date = "2022-10-19" -node_compat = false - -[build] -watch_dir = "src" -command = "./build.sh" - -[vars] -# DATABASE_URL -# Run `wrangler secret put DATABASE_URL` and enter the connection string when prompted. -# And/or for local dev, create `.dev.vars` containing `DATABASE_URL=postgres://mysecretconnstr`.