From 5e83ccf689000bf635d77af2cdbad36ca1397375 Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Thu, 12 Nov 2026 15:20:49 +0100 Subject: [PATCH] chore(deps): roll up Dependabot dependency updates (#1130) ## Summary - Reproduce the remaining dependency changes from nine open Dependabot PRs against current main, without reverting unrelated changes from older PR branches. - Update actions/setup-node to 7.1.0 (#1127), release-drafter to 7.10.0 (#1126), and CodeQL init/analyze/autobuild to 4.38.2 (#1116, #1115, #1114). - Update @types/node to 26.6.2 (#1108), undici to 8.11.0 (#1107), Biome to 2.5.14 (#1106), and Jest to 30.5.2 (#1105). - Align the Biome schema and regenerate affected action bundles. ## Excluded - #1029 (TypeScript 7.0.2): all 16 test suites fail before executing tests because ts-jest 29.4.11 expects the TypeScript compiler API and declares a >=4.3 <7 peer range. Excluded with operator approval; TypeScript remains at 6.0.3. - None of the ten open Dependabot PRs were already no-ops against main. ## Validation - npm ci --ignore-scripts - npm run all: passed (16 suites, 179 tests; no Biome fixes) - actionlint: passed - uvx zizmor --offline .github/workflows: no findings - npm audit signatures: 353 verified registry signatures, 38 verified attestations - Workflow all-tests-passed dependency check: passed - git diff --check: passed npm installation reports 30 audit vulnerabilities, matching the baseline count; unrelated audit fixes are outside this rollup. Refs: pi-session 01a1d01c-e089-7536-b5be-fed125cdaa18 --- .github/workflows/codeql-analysis.yml | 6 +- .github/workflows/release-drafter.yml | 2 +- .github/workflows/test.yml | 2 +- .github/workflows/update-known-checksums.yml | 2 +- biome.json | 2 +- dist/setup/index.cjs | 2154 ++++++++++++------ dist/update-known-checksums/index.cjs | 2154 ++++++++++++------ package-lock.json | 1881 ++++++++------- package.json | 8 +- 9 files changed, 3824 insertions(+), 2387 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 4fbde9c..ad39a4d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -47,7 +47,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1 + uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 with: languages: ${{ matrix.language }} source-root: src @@ -59,7 +59,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1 + uses: github/codeql-action/autobuild@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -73,4 +73,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1 + uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index b5d4503..32ad8ee 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -19,7 +19,7 @@ jobs: pull-requests: read steps: - name: 🚀 Run Release Drafter - uses: release-drafter/release-drafter@72967cdc98ddd3160f1fc3dff619de365e137dd0 # v7.9.0 + uses: release-drafter/release-drafter@978bb0b30c5ee8cdd332ced253758157150d43f0 # v7.10.0 with: commitish: ${{ github.sha }} env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 806b616..3091182 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,7 +28,7 @@ jobs: uses: eifinger/actionlint-action@1fc89649be682d16ec5cf65ea16e269eb88d3982 # v1.10.2 - name: Run zizmor uses: zizmorcore/zizmor-action@cc914d7f3750a2d13d75c7f184a1060aa0e9d482 # v0.6.4 - - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version-file: .nvmrc cache: npm diff --git a/.github/workflows/update-known-checksums.yml b/.github/workflows/update-known-checksums.yml index 1ed3b04..b9725ad 100644 --- a/.github/workflows/update-known-checksums.yml +++ b/.github/workflows/update-known-checksums.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: true - - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version-file: .nvmrc cache: npm diff --git a/biome.json b/biome.json index 1084c52..c199ca0 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.5.11/schema.json", + "$schema": "https://biomejs.dev/schemas/2.5.14/schema.json", "assist": { "actions": { "source": { diff --git a/dist/setup/index.cjs b/dist/setup/index.cjs index 0ab68a9..324d57e 100644 --- a/dist/setup/index.cjs +++ b/dist/setup/index.cjs @@ -28930,6 +28930,8 @@ var require_symbols6 = __commonJS({ kDestroy: /* @__PURE__ */ Symbol("destroy"), kDispatch: /* @__PURE__ */ Symbol("dispatch"), kUrl: /* @__PURE__ */ Symbol("url"), + kRequestOrigin: /* @__PURE__ */ Symbol("request origin"), + kOriginless: /* @__PURE__ */ Symbol("originless"), kWriting: /* @__PURE__ */ Symbol("writing"), kResuming: /* @__PURE__ */ Symbol("resuming"), kQueue: /* @__PURE__ */ Symbol("queue"), @@ -30264,37 +30266,6 @@ var require_util9 = __commonJS({ bytesRead: socket.bytesRead }; } - function ReadableStreamFrom(iterable) { - let iterator; - return new ReadableStream( - { - start() { - iterator = iterable[Symbol.asyncIterator](); - }, - pull(controller) { - return iterator.next().then(({ done, value }) => { - if (done) { - return queueMicrotask(() => { - controller.close(); - controller.byobRequest?.respond(0); - }); - } else { - const buf = Buffer.isBuffer(value) ? value : Buffer.from(value); - if (buf.byteLength) { - return controller.enqueue(new Uint8Array(buf)); - } else { - return this.pull(controller); - } - } - }); - }, - cancel() { - return iterator.return(); - }, - type: "bytes" - } - ); - } function isFormDataLike(object) { return object && typeof object === "object" && typeof object.append === "function" && typeof object.delete === "function" && typeof object.get === "function" && typeof object.getAll === "function" && typeof object.has === "function" && typeof object.set === "function" && object[Symbol.toStringTag] === "FormData"; } @@ -30755,7 +30726,6 @@ var require_util9 = __commonJS({ destroy: destroy2, bodyLength, deepClone, - ReadableStreamFrom, isBuffer, assertRequestHandler, getSocketInfo, @@ -31324,15 +31294,32 @@ var require_request3 = __commonJS({ return false; } } - onRequestUpgrade(statusCode, headers, socket) { + /** + * @param {number} statusCode + * @param {Buffer[]|string[]|import('../../types/header.d.ts').IncomingHttpHeaders} headers + * @param {import('node:stream').Duplex} socket + * @param {string} [statusText] + */ + onRequestUpgrade(statusCode, headers, socket, statusText = "") { + this.onFinally(); assert4(!this.aborted); assert4(!this.completed); + if (channels.headers.hasSubscribers) { + channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }); + } const controller = this[kController]; if (controller) { controller.rawHeaders = headers; } const parsedHeaders = Array.isArray(headers) ? parseHeaders(headers) : headers; - return this[kHandler].onRequestUpgrade?.(controller, statusCode, parsedHeaders, socket); + const result = this[kHandler].onRequestUpgrade?.(controller, statusCode, parsedHeaders, socket); + if (!this.aborted) { + this.completed = true; + if (channels.trailers.hasSubscribers) { + channels.trailers.publish({ request: this, trailers: [] }); + } + } + return result; } onResponseEnd(trailers) { this.onFinally(); @@ -31476,6 +31463,7 @@ var require_dispatcher2 = __commonJS({ "node_modules/undici/lib/dispatcher/dispatcher.js"(exports2, module2) { "use strict"; var EventEmitter4 = require("node:events"); + var { kOriginless, kUrl } = require_symbols6(); var Dispatcher = class extends EventEmitter4 { dispatch() { throw new Error("not implemented"); @@ -31488,6 +31476,7 @@ var require_dispatcher2 = __commonJS({ } compose(...args) { const interceptors = Array.isArray(args[0]) ? args[0] : args; + const interceptorOrigin = this[kOriginless] === true ? null : this[kUrl]?.origin; let dispatch = this.dispatch.bind(this); for (const interceptor of interceptors) { if (interceptor == null) { @@ -31496,11 +31485,19 @@ var require_dispatcher2 = __commonJS({ if (typeof interceptor !== "function") { throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`); } - dispatch = interceptor(dispatch); + dispatch = interceptor(dispatch, interceptorOrigin); if (dispatch == null || typeof dispatch !== "function" || dispatch.length !== 2) { throw new TypeError("invalid interceptor"); } } + const originalDispatch = dispatch; + const self2 = this; + dispatch = function(opts, handler) { + if (opts && typeof opts === "object" && !opts.origin && self2[kUrl]) { + opts = Object.assign({}, opts, { origin: self2[kUrl].origin }); + } + return originalDispatch(opts, handler); + }; return new Proxy(this, { get: (target, key) => key === "dispatch" ? dispatch : target[key] }); @@ -31514,6 +31511,7 @@ var require_dispatcher2 = __commonJS({ var require_dispatcher_base2 = __commonJS({ "node_modules/undici/lib/dispatcher/dispatcher-base.js"(exports2, module2) { "use strict"; + var buffer3 = require("node:buffer"); var Dispatcher = require_dispatcher2(); var { ClientDestroyedError, @@ -31524,6 +31522,7 @@ var require_dispatcher_base2 = __commonJS({ var kOnDestroyed = /* @__PURE__ */ Symbol("onDestroyed"); var kOnClosed = /* @__PURE__ */ Symbol("onClosed"); var kWebSocketOptions = /* @__PURE__ */ Symbol("webSocketOptions"); + var kEventSourceOptions = /* @__PURE__ */ Symbol("eventSourceOptions"); var DispatcherBase = class extends Dispatcher { /** @type {boolean} */ [kDestroyed] = false; @@ -31539,9 +31538,10 @@ var require_dispatcher_base2 = __commonJS({ constructor(opts) { super(); this[kWebSocketOptions] = opts?.webSocket ?? {}; + this[kEventSourceOptions] = opts?.eventSource ?? {}; } /** - * @returns {import('../../types/dispatcher').WebSocketOptions} + * @returns {import('../../types/client').Client.WebSocketOptions} */ get webSocketOptions() { return { @@ -31550,6 +31550,14 @@ var require_dispatcher_base2 = __commonJS({ // 128 MB default }; } + /** + * @returns {import('../../types/client').Client.EventSourceOptions} + */ + get eventSourceOptions() { + return { + maxEventSize: this[kEventSourceOptions].maxEventSize ?? buffer3.kStringMaxLength + }; + } /** @returns {boolean} */ get destroyed() { return this[kDestroyed]; @@ -32839,6 +32847,10 @@ var require_infra = __commonJS({ assert4(!invalidIsomorphicEncodeValueRegex.test(input)); return input; } + var nonASCIIRegex = /[^\x00-\x7F]/; + function asciiLowercase(str) { + return nonASCIIRegex.test(str) ? str.replace(/[A-Z]+/g, (upper) => upper.toLowerCase()) : str.toLowerCase(); + } function parseJSONFromBytes(bytes) { return JSON.parse(utf8DecodeBytes(bytes)); } @@ -32852,7 +32864,7 @@ var require_infra = __commonJS({ while (lead < str.length && predicate(str.charCodeAt(lead))) lead++; } if (trailing) { - while (trail > 0 && predicate(str.charCodeAt(trail))) trail--; + while (trail >= lead && predicate(str.charCodeAt(trail))) trail--; } return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1); } @@ -32865,6 +32877,7 @@ var require_infra = __commonJS({ return result; } module2.exports = { + asciiLowercase, collectASequenceOfCodePoints, collectASequenceOfCodePointsFast, forgivingBase64, @@ -32884,9 +32897,9 @@ var require_data_url2 = __commonJS({ "node_modules/undici/lib/web/fetch/data-url.js"(exports2, module2) { "use strict"; var assert4 = require("node:assert"); - var { forgivingBase64, collectASequenceOfCodePoints, collectASequenceOfCodePointsFast, isomorphicDecode, removeASCIIWhitespace, removeChars } = require_infra(); + var { asciiLowercase, forgivingBase64, collectASequenceOfCodePoints, collectASequenceOfCodePointsFast, isomorphicDecode, removeASCIIWhitespace, removeChars } = require_infra(); var encoder = new TextEncoder(); - var HTTP_TOKEN_CODEPOINTS = /^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u; + var HTTP_TOKEN_CODEPOINTS = /^[-!#$%&'*+.^_`|~A-Za-z0-9]+$/u; var HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/u; var HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u; function dataURLProcessor(dataURL) { @@ -32907,7 +32920,7 @@ var require_data_url2 = __commonJS({ position.position++; const encodedBody = input.slice(mimeTypeLength + 1); let body2 = stringPercentDecode(encodedBody); - if (/;(?:\u0020*)base64$/ui.test(mimeType)) { + if (/;\u0020*[Bb][Aa][Ss][Ee]64$/u.test(mimeType)) { const stringBody = isomorphicDecode(body2); body2 = forgivingBase64(stringBody); if (body2 === "failure") { @@ -32994,8 +33007,8 @@ var require_data_url2 = __commonJS({ if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) { return "failure"; } - const typeLowercase = type.toLowerCase(); - const subtypeLowercase = subtype.toLowerCase(); + const typeLowercase = asciiLowercase(type); + const subtypeLowercase = asciiLowercase(subtype); const mimeType = { type: typeLowercase, subtype: subtypeLowercase, @@ -33017,7 +33030,7 @@ var require_data_url2 = __commonJS({ input, position ); - parameterName = parameterName.toLowerCase(); + parameterName = asciiLowercase(parameterName); if (position.position < input.length) { if (input[position.position] === ";") { continue; @@ -33197,23 +33210,13 @@ var require_webidl2 = __commonJS({ message: `"${context3.value}" is an invalid ${context3.type}.` }); }; - webidl.brandCheck = function(V, I) { - if (!FunctionPrototypeSymbolHasInstance(I, V)) { + webidl.brandCheck = function(V, is) { + if (!is(V)) { const err = new TypeError("Illegal invocation"); err.code = "ERR_INVALID_THIS"; throw err; } }; - webidl.brandCheckMultiple = function(List) { - const prototypes = List.map((c) => webidl.util.MakeTypeAssertion(c)); - return (V) => { - if (prototypes.every((typeCheck) => !typeCheck(V))) { - const err = new TypeError("Illegal invocation"); - err.code = "ERR_INVALID_THIS"; - throw err; - } - }; - }; webidl.argumentLengthCheck = function({ length }, min, ctx) { if (length < min) { throw webidl.errors.exception({ @@ -33769,7 +33772,7 @@ var require_util10 = __commonJS({ var { getGlobalOrigin } = require_global3(); var { collectAnHTTPQuotedString, parseMIMEType } = require_data_url2(); var { performance: performance2 } = require("node:perf_hooks"); - var { ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util9(); + var { isValidHTTPToken, normalizedMethodRecordsBase } = require_util9(); var assert4 = require("node:assert"); var { isUint8Array } = require("node:util/types"); var { webidl } = require_webidl2(); @@ -33866,6 +33869,9 @@ var require_util10 = __commonJS({ return "success"; } function appendFetchMetadata(httpRequest) { + if (!isURLPotentiallyTrustworthy(requestCurrentURL(httpRequest))) { + return; + } let header = null; header = httpRequest.mode; httpRequest.headersList.set("sec-fetch-mode", header, true); @@ -34162,7 +34168,7 @@ var require_util10 = __commonJS({ return new FastIterableIterator(target, kind); }; } - function iteratorMixin(name, object, kInternalIterator, keyIndex = 0, valueIndex = 1) { + function iteratorMixin(name, object, kInternalIterator, keyIndex = 0, valueIndex = 1, brandCheck) { const makeIterator = createIterator(name, kInternalIterator, keyIndex, valueIndex); const properties = { keys: { @@ -34170,7 +34176,7 @@ var require_util10 = __commonJS({ enumerable: true, configurable: true, value: function keys() { - webidl.brandCheck(this, object); + webidl.brandCheck(this, brandCheck); return makeIterator(this, "key"); } }, @@ -34179,7 +34185,7 @@ var require_util10 = __commonJS({ enumerable: true, configurable: true, value: function values() { - webidl.brandCheck(this, object); + webidl.brandCheck(this, brandCheck); return makeIterator(this, "value"); } }, @@ -34188,7 +34194,7 @@ var require_util10 = __commonJS({ enumerable: true, configurable: true, value: function entries() { - webidl.brandCheck(this, object); + webidl.brandCheck(this, brandCheck); return makeIterator(this, "key+value"); } }, @@ -34197,7 +34203,7 @@ var require_util10 = __commonJS({ enumerable: true, configurable: true, value: function forEach(callbackfn, thisArg = globalThis) { - webidl.brandCheck(this, object); + webidl.brandCheck(this, brandCheck); webidl.argumentLengthCheck(arguments, 1, `${name}.forEach`); if (typeof callbackfn !== "function") { throw new TypeError( @@ -34478,7 +34484,6 @@ var require_util10 = __commonJS({ isAborted, isCancelled, isValidEncodedURL, - ReadableStreamFrom, tryUpgradeRequestToAPotentiallyTrustworthyURL, clampAndCoarsenConnectionTimingInfo, coarsenedSharedCurrentTime, @@ -34611,7 +34616,10 @@ var require_formdata2 = __commonJS({ var nodeUtil = require("node:util"); var { runtimeFeatures } = require_runtime_features(); var random = runtimeFeatures.has("crypto") ? require("node:crypto").randomInt : (max) => Math.floor(Math.random() * max); - var FormData2 = class _FormData { + var getFormDataState; + var setFormDataState; + var getFormDataBoundary; + var FormData2 = class { #state = []; #boundary = null; constructor(form = void 0) { @@ -34625,7 +34633,7 @@ var require_formdata2 = __commonJS({ } } append(name, value, filename = void 0) { - webidl.brandCheck(this, _FormData); + webidl.brandCheck(this, webidl.is.FormData); const prefix2 = "FormData.append"; webidl.argumentLengthCheck(arguments, 2, prefix2); name = webidl.converters.USVString(name); @@ -34641,14 +34649,14 @@ var require_formdata2 = __commonJS({ this.#state.push(entry); } delete(name) { - webidl.brandCheck(this, _FormData); + webidl.brandCheck(this, webidl.is.FormData); const prefix2 = "FormData.delete"; webidl.argumentLengthCheck(arguments, 1, prefix2); name = webidl.converters.USVString(name); this.#state = this.#state.filter((entry) => entry.name !== name); } get(name) { - webidl.brandCheck(this, _FormData); + webidl.brandCheck(this, webidl.is.FormData); const prefix2 = "FormData.get"; webidl.argumentLengthCheck(arguments, 1, prefix2); name = webidl.converters.USVString(name); @@ -34659,21 +34667,21 @@ var require_formdata2 = __commonJS({ return this.#state[idx].value; } getAll(name) { - webidl.brandCheck(this, _FormData); + webidl.brandCheck(this, webidl.is.FormData); const prefix2 = "FormData.getAll"; webidl.argumentLengthCheck(arguments, 1, prefix2); name = webidl.converters.USVString(name); return this.#state.filter((entry) => entry.name === name).map((entry) => entry.value); } has(name) { - webidl.brandCheck(this, _FormData); + webidl.brandCheck(this, webidl.is.FormData); const prefix2 = "FormData.has"; webidl.argumentLengthCheck(arguments, 1, prefix2); name = webidl.converters.USVString(name); return this.#state.findIndex((entry) => entry.name === name) !== -1; } set(name, value, filename = void 0) { - webidl.brandCheck(this, _FormData); + webidl.brandCheck(this, webidl.is.FormData); const prefix2 = "FormData.set"; webidl.argumentLengthCheck(arguments, 2, prefix2); name = webidl.converters.USVString(name); @@ -34715,34 +34723,20 @@ var require_formdata2 = __commonJS({ const output = nodeUtil.formatWithOptions(options, state3); return `FormData ${output.slice(output.indexOf("]") + 2)}`; } - /** - * @param {FormData} formData - */ - static getFormDataState(formData) { - return formData.#state; - } - /** - * @param {FormData} formData - * @param {any[]} newState - */ - static setFormDataState(formData, newState) { - formData.#state = newState; - } - /** - * @param {FormData} formData - * @returns {string | null} - */ - static getFormDataBoundary(formData) { - const boundary = formData.#boundary; - if (boundary != null) return boundary; - return formData.#boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`; + static { + getFormDataState = (formData) => formData.#state; + setFormDataState = (formData, newState) => { + formData.#state = newState; + }; + getFormDataBoundary = (formData) => { + return formData.#boundary ??= `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`; + }; + webidl.is.FormData = (arg) => { + return arg != null && typeof arg === "object" && #state in arg; + }; } }; - var { getFormDataState, setFormDataState, getFormDataBoundary } = FormData2; - Reflect.deleteProperty(FormData2, "getFormDataState"); - Reflect.deleteProperty(FormData2, "setFormDataState"); - Reflect.deleteProperty(FormData2, "getFormDataBoundary"); - iteratorMixin("FormData", FormData2, getFormDataState, "name", "value"); + iteratorMixin("FormData", FormData2, getFormDataState, "name", "value", webidl.is.FormData); Object.defineProperties(FormData2.prototype, { append: kEnumerableProperty, delete: kEnumerableProperty, @@ -34771,7 +34765,6 @@ var require_formdata2 = __commonJS({ } return { name, value }; } - webidl.is.FormData = webidl.util.MakeTypeAssertion(FormData2); module2.exports = { FormData: FormData2, makeEntry, setFormDataState, getFormDataBoundary }; } }); @@ -35112,7 +35105,6 @@ var require_body2 = __commonJS({ "use strict"; var util7 = require_util9(); var { - ReadableStreamFrom, readableStreamClose, fullyReadBody, extractMimeType @@ -35232,7 +35224,14 @@ Content-Type: ${value.type || "application/octet-stream"}\r "Response body object should not be disturbed or locked" ); } - stream4 = webidl.is.ReadableStream(object) ? object : ReadableStreamFrom(object); + stream4 = webidl.is.ReadableStream(object) ? object : ReadableStream.from(object).pipeThrough(new TransformStream({ + transform(chunk, controller2) { + const bytes = isUint8Array(chunk) ? chunk : Buffer.from(chunk); + if (bytes.byteLength) { + controller2.enqueue(bytes); + } + } + })); } if (typeof source === "string" || isUint8Array(source)) { action5 = () => { @@ -35277,7 +35276,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r source: body2.source }; } - function bodyMixinMethods(instance, getInternalState) { + function bodyMixinMethods(brandCheck, getInternalState) { const methods = { blob() { return consumeBody(this, (bytes) => { @@ -35288,18 +35287,18 @@ Content-Type: ${value.type || "application/octet-stream"}\r mimeType = serializeAMimeType(mimeType); } return new Blob([bytes], { type: mimeType }); - }, instance, getInternalState); + }, brandCheck, getInternalState); }, arrayBuffer() { return consumeBody(this, (bytes) => { return new Uint8Array(bytes).buffer; - }, instance, getInternalState); + }, brandCheck, getInternalState); }, text() { - return consumeBody(this, utf8DecodeBytes, instance, getInternalState); + return consumeBody(this, utf8DecodeBytes, brandCheck, getInternalState); }, json() { - return consumeBody(this, parseJSONFromBytes, instance, getInternalState); + return consumeBody(this, parseJSONFromBytes, brandCheck, getInternalState); }, formData() { return consumeBody(this, (value) => { @@ -35325,12 +35324,12 @@ Content-Type: ${value.type || "application/octet-stream"}\r throw new TypeError( 'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".' ); - }, instance, getInternalState); + }, brandCheck, getInternalState); }, bytes() { return consumeBody(this, (bytes) => { return new Uint8Array(bytes); - }, instance, getInternalState); + }, brandCheck, getInternalState); }, textStream() { const this_ = getInternalState(this); @@ -35358,12 +35357,12 @@ Content-Type: ${value.type || "application/octet-stream"}\r }; return methods; } - function mixinBody(prototype, getInternalState) { - Object.assign(prototype.prototype, bodyMixinMethods(prototype, getInternalState)); + function mixinBody(prototype, getInternalState, brandCheck) { + Object.assign(prototype.prototype, bodyMixinMethods(brandCheck, getInternalState)); } - function consumeBody(object, convertBytesToJSValue, instance, getInternalState) { + function consumeBody(object, convertBytesToJSValue, brandCheck, getInternalState) { try { - webidl.brandCheck(object, instance); + webidl.brandCheck(object, brandCheck); } catch (e) { return Promise.reject(e); } @@ -35477,7 +35476,13 @@ var require_client_h12 = __commonJS({ function lazyllhttp() { const llhttpWasmData = process.env.JEST_WORKER_ID ? require_llhttp_wasm2() : void 0; let mod; - let useWasmSIMD = process.arch !== "ppc64"; + let useWasmSIMD = true; + if (process.arch === "ppc64") { + const [major2, minor2] = process.versions.node.split(".").map((n) => parseInt(n, 10)); + if (major2 < 24 || major2 === 24 && minor2 < 12) { + useWasmSIMD = false; + } + } if (process.env.UNDICI_NO_WASM_SIMD === "1") { useWasmSIMD = false; } else if (process.env.UNDICI_NO_WASM_SIMD === "0") { @@ -35852,7 +35857,7 @@ var require_client_h12 = __commonJS({ * @param {Buffer} head */ onUpgrade(head) { - const { upgrade, client, socket, headers, statusCode } = this; + const { upgrade, client, socket, headers, statusCode, statusText } = this; assert4(upgrade); assert4(client[kSocket] === socket); assert4(!socket.destroyed); @@ -35877,8 +35882,9 @@ var require_client_h12 = __commonJS({ client[kQueue][client[kRunningIdx]++] = null; client.emit("disconnect", client[kUrl], [client], new InformationalError("upgrade")); try { - request.onRequestUpgrade(statusCode, headers, socket); + request.onRequestUpgrade(statusCode, headers, socket, statusText); } catch (err) { + util7.errorRequest(client, request, err); util7.destroy(socket, err); } client[kResume](); @@ -36209,21 +36215,20 @@ var require_client_h12 = __commonJS({ } function clearIdleSocketValidation(socket) { if (socket[kIdleSocketValidationTimeout]) { - clearTimeout(socket[kIdleSocketValidationTimeout]); + clearImmediate(socket[kIdleSocketValidationTimeout]); socket[kIdleSocketValidationTimeout] = null; } socket[kIdleSocketValidation] = 0; } function scheduleIdleSocketValidation(client, socket) { socket[kIdleSocketValidation] = 1; - socket[kIdleSocketValidationTimeout] = setTimeout(() => { + socket[kIdleSocketValidationTimeout] = setImmediate(() => { socket[kIdleSocketValidationTimeout] = null; socket[kIdleSocketValidation] = 2; if (client[kSocket] === socket && !socket.destroyed) { client[kResume](); } - }, 0); - socket[kIdleSocketValidationTimeout].unref?.(); + }); } function resumeH1(client) { const socket = client[kSocket]; @@ -36725,12 +36730,14 @@ var require_client_h22 = __commonJS({ var util7 = require_util9(); var { RequestContentLengthMismatchError, + ResponseContentLengthMismatchError, RequestAbortedError, SocketError, InformationalError, InvalidArgumentError, HeadersTimeoutError, - BodyTimeoutError + BodyTimeoutError, + ResponseExceededMaxSizeError } = require_errors2(); var { kUrl, @@ -36759,7 +36766,8 @@ var require_client_h22 = __commonJS({ kRemoteSettings, kHTTP2Stream, kHTTP2SessionState, - kHTTP2Options + kHTTP2Options, + kMaxResponseSize } = require_symbols6(); var { channels } = require_diagnostics2(); var kOpenStreams = /* @__PURE__ */ Symbol("open streams"); @@ -36872,6 +36880,10 @@ var require_client_h22 = __commonJS({ const { body: body2 } = request; return body2 == null || util7.isBuffer(body2) || util7.isBlobLike(body2); } + function hasResponseStarted(request) { + const state3 = request[kRequestStream]?.[kRequestStreamState]; + return state3?.responseReceived === true; + } function registerGoAwayRefusal(request) { const attempts = (request[kGoAwayReplayAttempts] ?? 0) + 1; request[kGoAwayReplayAttempts] = attempts; @@ -37028,7 +37040,7 @@ var require_client_h22 = __commonJS({ const socket = client[kSocket]; const session = client[kHTTP2Session]; if (socket?.destroyed === false) { - if (client[kSize] === 0 || client[kMaxConcurrentStreams] === 0) { + if (session[kOpenStreams] === 0 && client[kSize] === 0) { unrefH2Session(session); } else { refH2Session(session); @@ -37185,8 +37197,9 @@ var require_client_h22 = __commonJS({ for (let i = pendingIdx; i < previousPendingIdx; i++) { const request = client[kQueue][i]; if (request != null) { + const responseStarted = hasResponseStarted(request); streamsToClose.push(detachRequestStreamForClose(request)); - if (canReplayRequest(request) && registerGoAwayRefusal(request)) { + if (!responseStarted && canReplayRequest(request) && registerGoAwayRefusal(request)) { retriableRequests.push(request); } else { util7.errorRequest(client, request, err); @@ -37278,9 +37291,10 @@ var require_client_h22 = __commonJS({ } function closeStreamSession(stream4) { const session = stream4[kHTTP2Session]; + const client = session[kClient]; stream4[kHTTP2Session] = null; session[kOpenStreams] -= 1; - if (session[kOpenStreams] === 0) { + if (session[kOpenStreams] === 0 && (client[kSize] === 0 || session[kReceivedGoAway])) { unrefH2Session(session); setHttp2IdleTimeout(session); } @@ -37395,8 +37409,13 @@ var require_client_h22 = __commonJS({ state3.responseReceived = true; const statusCode = headers[HTTP2_HEADER_STATUS]; delete headers[HTTP2_HEADER_STATUS]; - request.onRequestUpgrade(statusCode, headers, stream4); - if (request.aborted || request.completed) { + try { + request.onRequestUpgrade(statusCode, headers, stream4); + } catch (err) { + state3.abort(err); + return; + } + if (request.aborted) { return; } removeUpgradeStreamListeners(stream4); @@ -37463,13 +37482,16 @@ var require_client_h22 = __commonJS({ const state3 = { abort: null, body: request.body, + bytesRead: 0, client, contentLength: null, expectsPayload: false, + maxResponseSize: client[kMaxResponseSize], request, headersTimeout, bodyTimeout, requestFinalized: false, + responseContentLength: null, responseReceived: false, bodySent: false, pendingEnd: false, @@ -37604,6 +37626,7 @@ var require_client_h22 = __commonJS({ stream4.once("continue", writeBodyH2); } stream4.on("response", onResponse); + stream4.on("headers", onInterimResponse); stream4.on("end", onEnd); stream4.on("error", onError); stream4.on("frameError", onFrameError); @@ -37621,6 +37644,7 @@ var require_client_h22 = __commonJS({ stream4.off("error", noop); stream4.off("continue", writeBodyH2); stream4.off("response", onResponse); + stream4.off("headers", onInterimResponse); stream4.off("end", onEnd); stream4.off("error", onError); stream4.off("frameError", onFrameError); @@ -37647,6 +37671,29 @@ var require_client_h22 = __commonJS({ } } function onData(chunk) { + const stream4 = this; + const state3 = stream4[kRequestStreamState]; + if (state3 == null) { + return; + } + const { request, maxResponseSize, responseContentLength } = state3; + if (request.aborted || request.completed) { + return; + } + if (responseContentLength != null && state3.bytesRead + chunk.length > responseContentLength) { + state3.abort(new ResponseContentLengthMismatchError()); + return; + } + if (maxResponseSize > -1 && state3.bytesRead + chunk.length > maxResponseSize) { + state3.abort(new ResponseExceededMaxSizeError()); + return; + } + state3.bytesRead += chunk.length; + if (request.onResponseData(chunk) === false) { + stream4.pause(); + } + } + function onInterimResponse(headers) { const stream4 = this; const state3 = stream4[kRequestStreamState]; if (state3 == null) { @@ -37656,9 +37703,9 @@ var require_client_h22 = __commonJS({ if (request.aborted || request.completed) { return; } - if (request.onResponseData(chunk) === false) { - stream4.pause(); - } + const statusCode = headers[HTTP2_HEADER_STATUS]; + delete headers[HTTP2_HEADER_STATUS]; + request.onResponseStart(Number(statusCode), headers, noop, ""); } function onResponse(headers) { const stream4 = this; @@ -37672,10 +37719,14 @@ var require_client_h22 = __commonJS({ stream4.removeListener("continue", writeBodyH2); stream4.end(); } - const statusCode = headers[HTTP2_HEADER_STATUS]; + const statusCode = Number(headers[HTTP2_HEADER_STATUS]); delete headers[HTTP2_HEADER_STATUS]; request.onResponseStarted(); state3.responseReceived = true; + if (request.method !== "HEAD" && statusCode !== 304) { + const contentLength2 = headers[HTTP2_HEADER_CONTENT_LENGTH]; + state3.responseContentLength = contentLength2 == null ? null : Number(contentLength2); + } if (state3.headersTimeout || state3.bodyTimeout) { stream4.setTimeout(state3.bodyTimeout); } @@ -37683,7 +37734,7 @@ var require_client_h22 = __commonJS({ releaseRequestStream(stream4); return; } - if (request.onResponseStart(Number(statusCode), headers, stream4.resume.bind(stream4), "") === false) { + if (request.onResponseStart(statusCode, headers, stream4.resume.bind(stream4), "") === false) { stream4.pause(); } stream4.on("data", onData); @@ -37698,6 +37749,10 @@ var require_client_h22 = __commonJS({ stream4.off("end", onEnd); if (state3.responseReceived) { if (!request.aborted && !request.completed) { + if (state3.responseContentLength != null && state3.bytesRead !== state3.responseContentLength) { + state3.abort(new ResponseContentLengthMismatchError()); + return; + } state3.pendingEnd = true; completeRequestStream.call(stream4); } @@ -37726,6 +37781,9 @@ var require_client_h22 = __commonJS({ return; } stream4.off("error", onError); + if (state3.responseContentLength != null && state3.bytesRead !== state3.responseContentLength) { + err = new ResponseContentLengthMismatchError(); + } if (typeof stream4.rstCode === "number" && stream4.rstCode !== NGHTTP2_NO_ERROR) { err.http2ErrorCode = stream4.rstCode; } @@ -38079,7 +38137,8 @@ var require_client2 = __commonJS({ connectionWindowSize, pingInterval, webSocket, - h2Options + h2Options, + eventSource } = {}) { if (keepAlive !== void 0) { throw new InvalidArgumentError("unsupported keepAlive, use pipelining=0 instead"); @@ -38150,7 +38209,7 @@ var require_client2 = __commonJS({ if (h2Options.settings?.initialWindowSize != null && (!Number.isInteger(h2Options.settings.initialWindowSize) || h2Options.settings.initialWindowSize < 1)) { throw new InvalidArgumentError("h2Options.settings.initialWindowSize must be a positive integer, greater than 0"); } - if (h2Options.maxConcurrentStreams != null && (!Number.isInteger(h2Options.connectionWindowSize) || h2Options.maxConcurrentStreams < 1)) { + if (h2Options.maxConcurrentStreams != null && (!Number.isInteger(h2Options.maxConcurrentStreams) || h2Options.maxConcurrentStreams < 1)) { throw new InvalidArgumentError("h2Options.maxConcurrentStreams must be a positive integer, greater than 0"); } if (h2Options.connectionWindowSize != null && (!Number.isInteger(h2Options.connectionWindowSize) || h2Options.connectionWindowSize < 1)) { @@ -38182,7 +38241,7 @@ var require_client2 = __commonJS({ } } } - super({ webSocket }); + super({ webSocket, eventSource }); if (typeof connect2 !== "function") { connect2 = buildConnector({ ...tls, @@ -38631,6 +38690,9 @@ var require_pool_base2 = __commonJS({ var kOnConnect = /* @__PURE__ */ Symbol("onConnect"); var kOnDisconnect = /* @__PURE__ */ Symbol("onDisconnect"); var kOnConnectionError = /* @__PURE__ */ Symbol("onConnectionError"); + var kOnClientBusy = /* @__PURE__ */ Symbol("on client busy"); + var kOnClientDrain = /* @__PURE__ */ Symbol("on client drain"); + var kDrainQueue = /* @__PURE__ */ Symbol("drain queue"); var kGetDispatcher = /* @__PURE__ */ Symbol("get dispatcher"); var kHasDispatcher = /* @__PURE__ */ Symbol("has dispatcher"); var kAddClient = /* @__PURE__ */ Symbol("add client"); @@ -38641,8 +38703,12 @@ var require_pool_base2 = __commonJS({ [kClients] = []; [kNeedDrain] = false; [kOnDrain](client, origin, targets) { + if (client.closed || client.destroyed) { + return; + } const queue = this[kQueue]; let needDrain = false; + this[kOnClientDrain](client); while (!needDrain) { const item = queue.shift(); if (!item) { @@ -38652,6 +38718,9 @@ var require_pool_base2 = __commonJS({ needDrain = !client.dispatch(item.opts, item.handler); } client[kNeedDrain] = needDrain; + if (needDrain) { + this[kOnClientBusy](client); + } if (!needDrain && this[kNeedDrain]) { this[kNeedDrain] = false; this.emit("drain", origin, [this, ...targets]); @@ -38667,6 +38736,45 @@ var require_pool_base2 = __commonJS({ return Promise.all(closeAll).then(this[kClosedResolve]); } } + [kOnClientBusy]() { + } + [kOnClientDrain]() { + } + [kDrainQueue](origin, targets) { + const queue = this[kQueue]; + let hasDispatcher = true; + while (!queue.isEmpty()) { + const dispatcher = this[kGetDispatcher](); + if (!dispatcher) { + hasDispatcher = false; + break; + } + const item = queue.shift(); + this[kQueued]--; + if (!dispatcher.dispatch(item.opts, item.handler)) { + dispatcher[kNeedDrain] = true; + this[kOnClientBusy](dispatcher); + hasDispatcher = this[kHasDispatcher](); + if (!hasDispatcher) { + break; + } + } + } + if (hasDispatcher && this[kNeedDrain]) { + this[kNeedDrain] = false; + this.emit("drain", origin, [this, ...targets]); + } + if (this[kClosedResolve] && queue.isEmpty()) { + const closeAll = []; + for (let i = 0; i < this[kClients].length; i++) { + const client = this[kClients][i]; + if (!client.destroyed) { + closeAll.push(client.close()); + } + } + return Promise.all(closeAll).then(this[kClosedResolve]); + } + } [kOnConnect] = (origin, targets) => { this.emit("connect", origin, [this, ...targets]); }; @@ -38755,6 +38863,7 @@ var require_pool_base2 = __commonJS({ this[kQueued]++; } else if (!dispatcher.dispatch(opts, handler)) { dispatcher[kNeedDrain] = true; + this[kOnClientBusy](dispatcher); this[kNeedDrain] = !this[kHasDispatcher](); } return !this[kNeedDrain]; @@ -38773,7 +38882,7 @@ var require_pool_base2 = __commonJS({ this[kClients].push(client); if (this[kNeedDrain]) { queueMicrotask(() => { - if (this[kNeedDrain]) { + if (this[kNeedDrain] && !client[kNeedDrain]) { this[kOnDrain](client, client[kUrl], [client, this]); } }); @@ -38796,6 +38905,9 @@ var require_pool_base2 = __commonJS({ kNeedDrain, kAddClient, kRemoveClient, + kDrainQueue, + kOnClientBusy, + kOnClientDrain, kGetDispatcher, kHasDispatcher }; @@ -38811,6 +38923,9 @@ var require_pool2 = __commonJS({ kClients, kNeedDrain, kAddClient, + kDrainQueue, + kOnClientBusy, + kOnClientDrain, kGetDispatcher, kHasDispatcher, kRemoveClient @@ -38820,14 +38935,27 @@ var require_pool2 = __commonJS({ InvalidArgumentError } = require_errors2(); var util7 = require_util9(); - var { kUrl } = require_symbols6(); + var { kConnecting, kHTTPContext, kUrl } = require_symbols6(); var buildConnector = require_connect2(); var kOptions = /* @__PURE__ */ Symbol("options"); var kConnections = /* @__PURE__ */ Symbol("connections"); var kFactory = /* @__PURE__ */ Symbol("factory"); + var kProtocol = /* @__PURE__ */ Symbol("protocol"); + var kProtocolProbe = /* @__PURE__ */ Symbol("protocol probe"); function defaultFactory(origin, opts) { return new Client(origin, opts); } + function shouldCreateProtocolProbe(pool, dispatcher) { + return dispatcher instanceof Client && pool[kProtocol] !== "h1" && (pool[kOptions].useH2c === true || pool[kUrl].protocol === "https:" && pool[kOptions].allowH2 !== false); + } + function createClient(pool) { + const dispatcher = pool[kFactory](pool[kUrl], pool[kOptions]); + if (shouldCreateProtocolProbe(pool, dispatcher)) { + pool[kProtocolProbe] = dispatcher; + } + pool[kAddClient](dispatcher); + return dispatcher; + } var Pool = class extends PoolBase { constructor(origin, { connections, @@ -38870,22 +38998,58 @@ var require_pool2 = __commonJS({ this[kUrl] = util7.parseOrigin(origin); this[kOptions] = { ...util7.deepClone(options), connect, allowH2, useH2c, clientTtl, socketPath }; this[kFactory] = factory; + this[kProtocol] = null; + this[kProtocolProbe] = null; this.on("connect", (origin2, targets) => { if (clientTtl != null && clientTtl > 0) { for (const target of targets) { Object.assign(target, { ttl: Date.now() }); } } + const client = targets[targets.length - 1]; + if (client instanceof Client) { + this[kProtocol] = client[kHTTPContext]?.version; + } + if (client === this[kProtocolProbe]) { + if (this[kProtocol] !== "h2") { + this[kProtocolProbe] = null; + this[kDrainQueue](origin2, targets.slice(1)); + } + } }); - this.on("connectionError", (origin2, targets, error2) => { + this.on("disconnect", (origin2, targets) => { + if (targets.includes(this[kProtocolProbe])) { + this[kProtocolProbe] = null; + this[kDrainQueue](origin2, targets.slice(1)); + } + }); + this.on("connectionError", (origin2, targets) => { + let resumeQueued = false; for (const target of targets) { + if (target === this[kProtocolProbe]) { + this[kProtocolProbe] = null; + resumeQueued = true; + } const idx = this[kClients].indexOf(target); if (idx !== -1) { this[kClients].splice(idx, 1); } } + if (resumeQueued) { + this[kDrainQueue](origin2, targets.slice(1)); + } }); } + [kOnClientBusy](client) { + if (this[kProtocolProbe] === null && client[kConnecting] && shouldCreateProtocolProbe(this, client)) { + this[kProtocolProbe] = client; + } + } + [kOnClientDrain](client) { + if (client === this[kProtocolProbe]) { + this[kProtocolProbe] = null; + } + } [kGetDispatcher]() { const clientTtlOption = this[kOptions].clientTtl; for (let i = 0; i < this[kClients].length; i++) { @@ -38897,10 +39061,11 @@ var require_pool2 = __commonJS({ return client; } } + if (this[kProtocolProbe] !== null) { + return; + } if (!this[kConnections] || this[kClients].length < this[kConnections]) { - const dispatcher = this[kFactory](this[kUrl], this[kOptions]); - this[kAddClient](dispatcher); - return dispatcher; + return createClient(this); } } [kHasDispatcher]() { @@ -38914,9 +39079,11 @@ var require_pool2 = __commonJS({ return true; } } + if (this[kProtocolProbe] !== null) { + return false; + } if (!this[kConnections] || this[kClients].length < this[kConnections]) { - const dispatcher = this[kFactory](this[kUrl], this[kOptions]); - this[kAddClient](dispatcher); + createClient(this); return true; } return false; @@ -38943,7 +39110,7 @@ var require_balanced_pool2 = __commonJS({ kGetDispatcher } = require_pool_base2(); var Pool = require_pool2(); - var { kUrl } = require_symbols6(); + var { kOriginless, kUrl } = require_symbols6(); var util7 = require_util9(); var kFactory = /* @__PURE__ */ Symbol("factory"); var kOptions = /* @__PURE__ */ Symbol("options"); @@ -38966,12 +39133,15 @@ var require_balanced_pool2 = __commonJS({ return new Pool(origin, opts); } var BalancedPool = class extends PoolBase { - constructor(upstreams = [], { factory = defaultFactory, ...opts } = {}) { + constructor(upstreams = [], { factory = defaultFactory, connect, tls, ...opts } = {}) { if (typeof factory !== "function") { throw new InvalidArgumentError("factory must be a function."); } - super(); - this[kOptions] = { ...util7.deepClone(opts) }; + super(opts); + this[kOriginless] = true; + if (connect && typeof connect !== "function") connect = { ...connect }; + if (tls && typeof tls !== "function") tls = { ...tls }; + this[kOptions] = { ...util7.deepClone(opts), connect, tls }; this[kIndex] = -1; this[kCurrentWeight] = 0; this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100; @@ -39133,7 +39303,7 @@ var require_round_robin_pool = __commonJS({ ...connect }); } - super(); + super(options); this[kConnections] = connections || null; this[kUrl] = util7.parseOrigin(origin); this[kOptions] = { ...util7.deepClone(options), connect, allowH2, clientTtl, socketPath }; @@ -39213,7 +39383,7 @@ var require_agent2 = __commonJS({ "node_modules/undici/lib/dispatcher/agent.js"(exports2, module2) { "use strict"; var { InvalidArgumentError, MaxOriginsReachedError } = require_errors2(); - var { kBusy, kClients, kConnected, kRunning, kClose, kDestroy, kDispatch, kUrl } = require_symbols6(); + var { kBusy, kClients, kConnected, kRunning, kPending, kClose, kDestroy, kDispatch, kUrl } = require_symbols6(); var DispatcherBase = require_dispatcher_base2(); var Pool = require_pool2(); var Client = require_client2(); @@ -39286,7 +39456,7 @@ var require_agent2 = __commonJS({ if (this[kClients].get(key) !== dispatcher) { return; } - if (dispatcher[kConnected] > 0 || dispatcher[kBusy]) { + if (dispatcher[kConnected] > 0 || dispatcher[kBusy] || dispatcher[kPending] > 0) { return; } this[kClients].delete(key); @@ -39353,6 +39523,7 @@ var require_dispatcher1_wrapper = __commonJS({ var Dispatcher = require_dispatcher2(); var { InvalidArgumentError } = require_errors2(); var { toRawHeaders } = require_util9(); + var { kOriginless, kUrl } = require_symbols6(); var LegacyHandlerWrapper = class { #handler; constructor(handler) { @@ -39404,6 +39575,8 @@ var require_dispatcher1_wrapper = __commonJS({ throw new InvalidArgumentError("Argument dispatcher must implement dispatch"); } this.#dispatcher = dispatcher; + this[kUrl] = dispatcher[kUrl]; + this[kOriginless] = dispatcher[kOriginless]; } static wrapHandler(handler) { if (!handler || typeof handler !== "object") { @@ -39415,7 +39588,7 @@ var require_dispatcher1_wrapper = __commonJS({ return new LegacyHandlerWrapper(handler); } dispatch(opts, handler) { - if (opts.allowH2 !== false) { + if (opts.upgrade && opts.allowH2 !== false) { opts = { ...opts, allowH2: false }; } return this.#dispatcher.dispatch(opts, _Dispatcher1Wrapper.wrapHandler(handler)); @@ -39932,24 +40105,33 @@ var require_socks5_proxy_agent = __commonJS({ var { URL: URL3 } = require("node:url"); var tls; var DispatcherBase = require_dispatcher_base2(); - var { InvalidArgumentError } = require_errors2(); + var { ConnectTimeoutError, InvalidArgumentError } = require_errors2(); var { Socks5Client, STATES } = require_socks5_client(); var { kBusy, kConnected, kDispatch, kClose, kDestroy } = require_symbols6(); var Pool = require_pool2(); var buildConnector = require_connect2(); + var { setupConnectTimeout } = require_util9(); var { debuglog } = require("node:util"); var debug3 = debuglog("undici:socks5-proxy"); + var DEFAULT_SOCKS5_CONNECT_TIMEOUT = 5e3; var kProxyUrl = /* @__PURE__ */ Symbol("proxy url"); var kProxyHeaders = /* @__PURE__ */ Symbol("proxy headers"); var kProxyAuth = /* @__PURE__ */ Symbol("proxy auth"); var kProxyProtocol = /* @__PURE__ */ Symbol("proxy protocol"); var kPools = /* @__PURE__ */ Symbol("pools"); var kConnector = /* @__PURE__ */ Symbol("connector"); + var kConnectTimeout = /* @__PURE__ */ Symbol("connect timeout"); var kRequestTls = /* @__PURE__ */ Symbol("request tls settings"); + var kRequestTlsTimeout = /* @__PURE__ */ Symbol("request tls timeout"); + function createConnectTimeoutError(hostname, port, timeout) { + return new ConnectTimeoutError( + `Connect Timeout Error (attempted address: ${hostname}:${port}, timeout: ${timeout}ms)` + ); + } var experimentalWarningEmitted = false; var Socks5ProxyAgent = class extends DispatcherBase { constructor(proxyUrl, options = {}) { - super(); + super(options); if (!experimentalWarningEmitted) { process.emitWarning( "SOCKS5 proxy support is experimental and subject to change", @@ -39967,13 +40149,29 @@ var require_socks5_proxy_agent = __commonJS({ this[kProxyUrl] = url2; this[kProxyHeaders] = options.headers || {}; this[kProxyProtocol] = options.proxyTls ? "https:" : "http:"; - this[kRequestTls] = options.requestTls; + const connectTimeout = options.connectTimeout ?? DEFAULT_SOCKS5_CONNECT_TIMEOUT; + if (!Number.isFinite(connectTimeout) || connectTimeout < 0) { + throw new InvalidArgumentError("invalid connectTimeout"); + } + this[kConnectTimeout] = connectTimeout; + const { timeout, ...requestTls } = options.requestTls || {}; + const requestTlsTimeout = timeout ?? connectTimeout; + if (!Number.isFinite(requestTlsTimeout) || requestTlsTimeout < 0) { + throw new InvalidArgumentError("invalid requestTls.timeout"); + } + this[kRequestTls] = requestTls; + this[kRequestTlsTimeout] = requestTlsTimeout; this[kProxyAuth] = { username: options.username || (url2.username ? decodeURIComponent(url2.username) : null), password: options.password || (url2.password ? decodeURIComponent(url2.password) : null) }; + const proxyTlsTimeout = options.proxyTls?.timeout ?? connectTimeout; + if (!Number.isFinite(proxyTlsTimeout) || proxyTlsTimeout < 0) { + throw new InvalidArgumentError("invalid proxyTls.timeout"); + } this[kConnector] = options.connect || buildConnector({ ...options.proxyTls, + timeout: proxyTlsTimeout, servername: options.proxyTls?.servername || url2.hostname }); this[kPools] = /* @__PURE__ */ new Map(); @@ -40006,17 +40204,24 @@ var require_socks5_proxy_agent = __commonJS({ }); await socks5Client.handshake(); const authenticationReady = Promise.withResolvers(); - const authenticationTimeout = setTimeout(() => { - authenticationReady.reject(new Error("SOCKS5 authentication timeout")); - }, 5e3); - const onAuthenticated = () => { + const authenticationTimeout = this[kConnectTimeout] === 0 ? null : setTimeout(() => { + cleanupAuthenticationListeners(); + socks5Client.destroy(); + authenticationReady.reject( + createConnectTimeoutError(proxyHost, proxyPort, this[kConnectTimeout]) + ); + }, this[kConnectTimeout]); + const cleanupAuthenticationListeners = () => { clearTimeout(authenticationTimeout); + socks5Client.removeListener("authenticated", onAuthenticated); socks5Client.removeListener("error", onAuthenticationError); + }; + const onAuthenticated = () => { + cleanupAuthenticationListeners(); authenticationReady.resolve(); }; const onAuthenticationError = (err) => { - clearTimeout(authenticationTimeout); - socks5Client.removeListener("authenticated", onAuthenticated); + cleanupAuthenticationListeners(); authenticationReady.reject(err); }; if (socks5Client.state === STATES.AUTHENTICATED) { @@ -40029,18 +40234,25 @@ var require_socks5_proxy_agent = __commonJS({ await authenticationReady.promise; await socks5Client.connect(targetHost, targetPort); const connectionReady = Promise.withResolvers(); - const connectionTimeout = setTimeout(() => { - connectionReady.reject(new Error("SOCKS5 connection timeout")); - }, 5e3); + const connectionTimeout = this[kConnectTimeout] === 0 ? null : setTimeout(() => { + cleanupConnectionListeners(); + socks5Client.destroy(); + connectionReady.reject( + createConnectTimeoutError(targetHost, targetPort, this[kConnectTimeout]) + ); + }, this[kConnectTimeout]); + const cleanupConnectionListeners = () => { + clearTimeout(connectionTimeout); + socks5Client.removeListener("connected", onConnected); + socks5Client.removeListener("error", onConnectionError); + }; const onConnected = (info3) => { debug3("SOCKS5 tunnel established to", targetHost, targetPort, "via", info3); - clearTimeout(connectionTimeout); - socks5Client.removeListener("error", onConnectionError); + cleanupConnectionListeners(); connectionReady.resolve(); }; const onConnectionError = (err) => { - clearTimeout(connectionTimeout); - socks5Client.removeListener("connected", onConnected); + cleanupConnectionListeners(); connectionReady.reject(err); }; socks5Client.once("connected", onConnected); @@ -40080,8 +40292,26 @@ var require_socks5_proxy_agent = __commonJS({ servername: this[kRequestTls]?.servername || targetHost }); const tlsReady = Promise.withResolvers(); - finalSocket.once("secureConnect", tlsReady.resolve); - finalSocket.once("error", tlsReady.reject); + const cleanupTlsListeners = () => { + queueMicrotask(clearTlsTimeout); + finalSocket.removeListener("secureConnect", onSecureConnect); + finalSocket.removeListener("error", onTlsError); + }; + const onSecureConnect = () => { + cleanupTlsListeners(); + tlsReady.resolve(); + }; + const onTlsError = (err) => { + cleanupTlsListeners(); + tlsReady.reject(err); + }; + const clearTlsTimeout = setupConnectTimeout(new WeakRef(finalSocket), { + timeout: this[kRequestTlsTimeout], + hostname: targetHost, + port: targetPort + }); + finalSocket.once("secureConnect", onSecureConnect); + finalSocket.once("error", onTlsError); await tlsReady.promise; } callback(null, finalSocket); @@ -40152,6 +40382,7 @@ var require_proxy_agent2 = __commonJS({ var Client = require_client2(); var { channels } = require_diagnostics2(); var Socks5ProxyAgent = require_socks5_proxy_agent(); + var { hasSafeIterator } = require_util9(); var kAgent = /* @__PURE__ */ Symbol("proxy agent"); var kClient = /* @__PURE__ */ Symbol("proxy client"); var kProxyHeaders = /* @__PURE__ */ Symbol("proxy headers"); @@ -40238,7 +40469,7 @@ var require_proxy_agent2 = __commonJS({ throw new InvalidArgumentError("Proxy opts.clientFactory must be a function."); } const { proxyTunnel, connectTimeout } = opts; - super(); + super(opts); const url2 = this.#getUrl(opts); const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url2; this[kProxy] = { uri: href, protocol }; @@ -40271,6 +40502,7 @@ var require_proxy_agent2 = __commonJS({ factory: agentFactory, username: opts.username || username, password: opts.password || password, + connectTimeout, proxyTls: opts.proxyTls, requestTls: opts.requestTls }); @@ -40412,6 +40644,25 @@ var require_proxy_agent2 = __commonJS({ } return headersPair; } + if (headers && typeof headers === "object" && hasSafeIterator(headers)) { + const headersPair = {}; + for (const [key, value] of headers) { + if (!Object.hasOwn(headersPair, key)) { + headersPair[key] = value; + continue; + } + const previous = headersPair[key]; + const values = []; + if (previous !== void 0) { + values.push(...Array.isArray(previous) ? previous : [previous]); + } + if (value !== void 0) { + values.push(...Array.isArray(value) ? value : [value]); + } + headersPair[key] = values.length > 1 ? values : values[0]; + } + return headersPair; + } return headers; } function throwIfProxyAuthIsSent(headers) { @@ -40448,7 +40699,7 @@ var require_env_http_proxy_agent2 = __commonJS({ #noProxyEntries = null; #opts = null; constructor(opts = {}) { - super(); + super(opts); this.#opts = opts; const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts; this[kNoProxyAgent] = new Agent3(agentOpts); @@ -40488,6 +40739,9 @@ var require_env_http_proxy_agent2 = __commonJS({ #getProxyAgentForUrl(url2) { let { protocol, host: hostname, port } = url2; hostname = hostname.replace(/:\d*$/, "").replace(/^\[(.+)\]$/, "$1").toLowerCase(); + if (hostname.length > 1 && hostname.charCodeAt(hostname.length - 1) === 46) { + hostname = hostname.slice(0, -1); + } port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0; if (!this.#shouldProxy(hostname, port)) { return this[kNoProxyAgent]; @@ -40504,15 +40758,18 @@ var require_env_http_proxy_agent2 = __commonJS({ if (this.#noProxyEntries.length === 0) { return true; } - if (this.#noProxyValue === "*") { - return false; - } for (let i = 0; i < this.#noProxyEntries.length; i++) { const entry = this.#noProxyEntries[i]; + if (entry.hostname === "*") { + if (entry.port && entry.port !== port) { + continue; + } + return false; + } if (entry.port && entry.port !== port) { continue; } - if (hostname === entry.hostname) { + if (!entry.wildcard && hostname === entry.hostname) { return false; } if (hostname.slice(-(entry.hostname.length + 1)) === `.${entry.hostname}`) { @@ -40542,10 +40799,12 @@ var require_env_http_proxy_agent2 = __commonJS({ hostname = parsed ? parsed[1] : unbracketed; port = parsed ? Number.parseInt(parsed[2], 10) : 0; } + const wildcard = entry.charCodeAt(0) === 42; noProxyEntries.push({ - // strip leading dot or asterisk with dot - hostname: hostname.replace(/^\*?\./, "").toLowerCase(), - port + // strip leading dot or asterisk with dot, and any trailing dot + hostname: hostname.replace(/^\*?\./, "").replace(/^(.+)\.$/, "$1").toLowerCase(), + port, + wildcard }); } this.#noProxyValue = noProxyValue; @@ -40571,7 +40830,7 @@ var require_retry_handler2 = __commonJS({ "use strict"; var assert4 = require("node:assert"); var { kRetryHandlerDefaultRetry } = require_symbols6(); - var { RequestRetryError } = require_errors2(); + var { RequestRetryError, RequestAbortedError } = require_errors2(); var { isDisturbed, parseRangeHeader, @@ -40599,32 +40858,57 @@ var require_retry_handler2 = __commonJS({ } } var RetryController = class { - constructor() { - this.target = null; + #onAbort; + #paused = false; + #target = null; + constructor(onAbort) { + this.#onAbort = onAbort; + } + set target(target) { + this.#target = target; + if (this.#paused) { + target?.pause(); + } + } + get target() { + return this.#target; } pause() { - this.target?.pause(); + this.#paused = true; + this.#target?.pause(); } resume() { - this.target?.resume(); + this.#paused = false; + this.#target?.resume(); } abort(reason) { - this.target?.abort(reason); + this.#target?.abort(reason); + this.#onAbort(reason); } get paused() { - return this.target?.paused ?? false; + return this.#paused || (this.#target?.paused ?? false); } get aborted() { - return this.target?.aborted ?? false; + return this.#target?.aborted ?? false; } get reason() { - return this.target?.reason ?? null; + return this.#target?.reason ?? null; } get rawHeaders() { - return this.target?.rawHeaders ?? null; + return this.#target?.rawHeaders ?? null; + } + set rawHeaders(value) { + if (this.#target) { + this.#target.rawHeaders = value; + } } get rawTrailers() { - return this.target?.rawTrailers ?? null; + return this.#target?.rawTrailers ?? null; + } + set rawTrailers(value) { + if (this.#target) { + this.#target.rawTrailers = value; + } } }; var RetryHandler = class _RetryHandler { @@ -40683,13 +40967,24 @@ var require_retry_handler2 = __commonJS({ this.etag = null; this.statusCode = null; this.headers = null; - this.controllerProxy = new RetryController(); + this.controllerProxy = new RetryController((reason) => this.#onAbort(reason)); + this.retryPending = false; + this.retryTimer = null; + this.pendingResponseData = null; + this.pendingResponseTrailers = null; + this.pendingResponseEnded = false; + this.aborted = false; } onResponseStartWithRetry(controller, statusCode, headers, statusMessage, err) { if (this.retryOpts.throwOnError) { if (this.retryOpts.statusCodes.includes(statusCode) === false) { - this.headersSent = true; - this.handler.onResponseStart?.(this.controllerProxy, statusCode, headers, statusMessage); + if (this.headersSent) { + this.handler.onResponseError?.(this.controllerProxy, err); + } else { + this.headersSent = true; + this.checkpointResponseEnd(headers); + this.handler.onResponseStart?.(this.controllerProxy, statusCode, headers, statusMessage); + } } else { this.error = err; } @@ -40697,28 +40992,71 @@ var require_retry_handler2 = __commonJS({ } if (isDisturbed(this.opts.body)) { this.headersSent = true; + this.checkpointResponseEnd(headers); this.handler.onResponseStart?.(this.controllerProxy, statusCode, headers, statusMessage); return; } function shouldRetry(passedErr) { + if (this.aborted) { + return; + } + this.retryPending = false; + this.retryTimer = null; + const pendingData = this.pendingResponseData; + const pendingTrailers = this.pendingResponseTrailers; + const pendingEnd = this.pendingResponseEnded; + this.pendingResponseData = null; + this.pendingResponseTrailers = null; + this.pendingResponseEnded = false; if (passedErr) { - this.headersSent = true; - this.handler.onResponseStart?.(this.controllerProxy, statusCode, headers, statusMessage); + if (this.headersSent) { + this.handler.onResponseError?.(this.controllerProxy, passedErr); + } else { + this.headersSent = true; + this.checkpointResponseEnd(headers); + this.handler.onResponseStart?.(this.controllerProxy, statusCode, headers, statusMessage); + controller.resume(); + if (pendingEnd) { + for (const chunk of pendingData) { + this.onResponseData(controller, chunk); + } + this.onResponseEnd(controller, pendingTrailers); + } + return; + } controller.resume(); return; } this.error = err; controller.resume(); + if (pendingEnd) { + this.onResponseEnd(controller, pendingTrailers); + } } controller.pause(); - this.retryOpts.retry( + this.retryPending = true; + this.pendingResponseData = []; + this.pendingResponseTrailers = null; + this.pendingResponseEnded = false; + this.retryTimer = this.retryOpts.retry( err, { state: { counter: this.retryCount }, opts: { retryOptions: this.retryOpts, ...this.opts } }, shouldRetry.bind(this) - ); + ) ?? null; + } + checkpointResponseEnd(headers) { + if (this.end == null && this.opts.method !== "HEAD") { + const contentLength2 = headers["content-length"]; + this.end = contentLength2 != null ? Number(contentLength2) - 1 : null; + assert4( + this.end == null || Number.isFinite(this.end), + "invalid content-length" + ); + this.resume = this.end != null; + } } onRequestStart(controller, context3) { this.controllerProxy.target = controller; @@ -40726,6 +41064,12 @@ var require_retry_handler2 = __commonJS({ this.handler.onRequestStart?.(this.controllerProxy, context3); } } + onBodySent(chunk) { + this.handler.onBodySent?.(chunk); + } + onRequestSent() { + this.handler.onRequestSent?.(); + } onRequestUpgrade(_controller, statusCode, headers, socket) { this.handler.onRequestUpgrade?.(this.controllerProxy, statusCode, headers, socket); } @@ -40739,7 +41083,8 @@ var require_retry_handler2 = __commonJS({ timeoutFactor, statusCodes, errorCodes, - methods + methods, + retryAfter } = retryOptions; const { counter } = state3; if (code && code !== "UND_ERR_REQ_RETRY" && !errorCodes.includes(code)) { @@ -40758,13 +41103,13 @@ var require_retry_handler2 = __commonJS({ cb(err); return; } - let retryAfterHeader = headers?.["retry-after"]; + let retryAfterHeader = retryAfter === false ? void 0 : headers?.["retry-after"]; if (retryAfterHeader) { retryAfterHeader = Number(retryAfterHeader); retryAfterHeader = Number.isNaN(retryAfterHeader) ? calculateRetryAfterHeader(headers["retry-after"]) : retryAfterHeader * 1e3; } const retryTimeout = retryAfterHeader === 0 ? 0 : retryAfterHeader > 0 ? Math.min(retryAfterHeader, maxTimeout) : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout); - setTimeout(() => cb(null), retryTimeout); + return setTimeout(() => cb(null), retryTimeout); } onResponseStart(controller, statusCode, headers, statusMessage) { if (statusCode < 200) { @@ -40775,16 +41120,6 @@ var require_retry_handler2 = __commonJS({ this.retryCount += 1; this.statusCode = statusCode; this.headers = headers; - if (statusCode >= 300) { - const err = new RequestRetryError("Request failed", statusCode, { - headers, - data: { - count: this.retryCount - } - }); - this.onResponseStartWithRetry(controller, statusCode, headers, statusMessage, err); - return; - } if (this.headersSent) { if (statusCode !== 206 && (this.start > 0 || statusCode !== 200)) { throw new RequestRetryError("server does not support the range header and the payload was partially consumed", statusCode, { @@ -40807,8 +41142,22 @@ var require_retry_handler2 = __commonJS({ } validatePartialResponseContentLength(headers, contentRange, statusCode, this.retryCount); const { start, size, end = size ? size - 1 : null } = contentRange; - assert4(this.start === start, "content-range mismatch"); - assert4(this.end == null || this.end === end, "content-range mismatch"); + if (this.start !== start || this.end != null && this.end !== end) { + throw new RequestRetryError("Content-Range mismatch", statusCode, { + headers, + data: { count: this.retryCount } + }); + } + return; + } + if (statusCode >= 300) { + const err = new RequestRetryError("Request failed", statusCode, { + headers, + data: { + count: this.retryCount + } + }); + this.onResponseStartWithRetry(controller, statusCode, headers, statusMessage, err); return; } if (this.end == null) { @@ -40863,6 +41212,10 @@ var require_retry_handler2 = __commonJS({ } } onResponseData(_controller, chunk) { + if (this.pendingResponseData !== null) { + this.pendingResponseData.push(chunk); + return; + } if (this.error) { return; } @@ -40870,6 +41223,11 @@ var require_retry_handler2 = __commonJS({ this.handler.onResponseData?.(this.controllerProxy, chunk); } onResponseEnd(_controller, trailers) { + if (this.pendingResponseData !== null) { + this.pendingResponseTrailers = trailers; + this.pendingResponseEnded = true; + return; + } if (this.error && this.retryOpts.throwOnError) { throw this.error; } @@ -40909,11 +41267,19 @@ var require_retry_handler2 = __commonJS({ } } onResponseError(controller, err) { - if (controller?.aborted || isDisturbed(this.opts.body)) { + if (this.aborted) { + return; + } + if (controller?.aborted || isDisturbed(this.opts.body) || this.headersSent && !this.resume) { this.handler.onResponseError?.(this.controllerProxy, err); return; } function shouldRetry(returnedErr) { + if (this.aborted) { + return; + } + this.retryPending = false; + this.retryTimer = null; if (!returnedErr) { this.retry(); return; @@ -40925,14 +41291,28 @@ var require_retry_handler2 = __commonJS({ } else { this.retryCount += 1; } - this.retryOpts.retry( + this.retryPending = true; + this.retryTimer = this.retryOpts.retry( err, { state: { counter: this.retryCount }, opts: { retryOptions: this.retryOpts, ...this.opts } }, shouldRetry.bind(this) - ); + ) ?? null; + } + #onAbort(reason) { + if (!this.retryPending) { + return; + } + this.aborted = true; + this.retryPending = false; + clearTimeout(this.retryTimer); + this.retryTimer = null; + this.pendingResponseData = null; + this.pendingResponseTrailers = null; + this.pendingResponseEnded = false; + this.handler.onResponseError?.(this.controllerProxy, reason ?? new RequestAbortedError()); } }; module2.exports = RetryHandler; @@ -40945,6 +41325,7 @@ var require_retry_agent2 = __commonJS({ "use strict"; var Dispatcher = require_dispatcher2(); var RetryHandler = require_retry_handler2(); + var { kOriginless, kUrl } = require_symbols6(); var RetryAgent = class extends Dispatcher { #agent = null; #options = null; @@ -40952,6 +41333,8 @@ var require_retry_agent2 = __commonJS({ super(options); this.#agent = agent; this.#options = options; + this[kUrl] = agent[kUrl]; + this[kOriginless] = agent[kOriginless]; } dispatch(opts, handler) { const retry2 = new RetryHandler({ @@ -41026,7 +41409,6 @@ var require_readable2 = __commonJS({ var { Readable: Readable6 } = require("node:stream"); var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError: AbortError3 } = require_errors2(); var util7 = require_util9(); - var { ReadableStreamFrom } = require_util9(); var kConsume = /* @__PURE__ */ Symbol("kConsume"); var kReading = /* @__PURE__ */ Symbol("kReading"); var kBody = /* @__PURE__ */ Symbol("kBody"); @@ -41213,7 +41595,7 @@ var require_readable2 = __commonJS({ */ get body() { if (!this[kBody]) { - this[kBody] = ReadableStreamFrom(this); + this[kBody] = ReadableStream.from(this); if (this[kConsume]) { this[kBody].getReader(); assert4(this[kBody].locked); @@ -42623,8 +43005,7 @@ var require_mock_utils2 = __commonJS({ handler.onResponseError(null, new InvalidArgumentError("reply options callback must return an object")); return; } - mockDispatch2.data = { ...responseDefaults, ...resolvedData }; - dispatchMockReply(mockDispatches, mockDispatch2, key, opts, handler); + dispatchMockReply(mockDispatches, mockDispatch2, key, opts, handler, { ...responseDefaults, ...resolvedData }); }, (error2) => { handler.onResponseError(null, error2); @@ -42635,12 +43016,13 @@ var require_mock_utils2 = __commonJS({ if (callbackResult == null || typeof callbackResult !== "object") { throw new InvalidArgumentError("reply options callback must return an object"); } - mockDispatch2.data = { ...responseDefaults, ...callbackResult }; + return dispatchMockReply(mockDispatches, mockDispatch2, key, opts, handler, { ...responseDefaults, ...callbackResult }); } return dispatchMockReply(mockDispatches, mockDispatch2, key, opts, handler); } - function dispatchMockReply(mockDispatches, mockDispatch2, key, opts, handler) { - const { data: response, delay: delay4 } = mockDispatch2; + function dispatchMockReply(mockDispatches, mockDispatch2, key, opts, handler, resolvedResponse) { + const { data: responseData, delay: delay4 } = mockDispatch2; + const response = resolvedResponse ?? responseData; if (response.error !== null) { deleteMockDispatch(mockDispatches, key); handler.onResponseError(null, response.error); @@ -42714,8 +43096,7 @@ var require_mock_utils2 = __commonJS({ handler.onResponseError(null, new InvalidArgumentError("reply options callback must return an object")); return; } - mockDispatch2.data = { ...responseDefaults, ...resolvedData }; - handleReply(dispatches, mockDispatch2.data); + handleReply(dispatches, { ...responseDefaults, ...resolvedData }); }, (err) => { handler.onResponseError(null, err); @@ -42726,8 +43107,7 @@ var require_mock_utils2 = __commonJS({ if (callbackResult == null || typeof callbackResult !== "object") { throw new InvalidArgumentError("reply options callback must return an object"); } - mockDispatch2.data = { ...responseDefaults, ...callbackResult }; - handleReply(dispatches, mockDispatch2.data); + handleReply(dispatches, { ...responseDefaults, ...callbackResult }); return; } if (typeof delay4 === "number" && delay4 > 0) { @@ -42752,13 +43132,13 @@ var require_mock_utils2 = __commonJS({ if (aborted) { return; } - const responseData = getResponseData(body2); + const responseData2 = getResponseData(body2); const responseHeaders = generateKeyValues(headers ?? {}); const responseTrailers = generateKeyValues(trailers ?? {}); controller.rawHeaders = responseHeaders; controller.rawTrailers = responseTrailers; handler.onResponseStart?.(controller, statusCode, parseHeaders(responseHeaders), getStatusText(statusCode)); - handler.onResponseData?.(controller, Buffer.from(responseData)); + handler.onResponseData?.(controller, Buffer.from(responseData2)); handler.onResponseEnd?.(controller, parseHeaders(responseTrailers)); deleteMockDispatch(mockDispatches2, key); } @@ -43521,10 +43901,18 @@ var require_mock_agent2 = __commonJS({ } dispatch(opts, handler) { opts.origin = normalizeOrigin(opts.origin); - this.get(opts.origin); + const mockDispatcher = this.get(opts.origin); this[kMockAgentAddCallHistoryLog](opts); const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters]; const dispatchOpts = { ...opts }; + if (dispatchOpts.allowH2 === false) { + const http1OnlyKey = `${dispatchOpts.origin}#http1-only`; + if (!this[kClients].has(http1OnlyKey)) { + const http1OnlyDispatcher = this[kFactory](dispatchOpts.origin); + http1OnlyDispatcher[kDispatches] = mockDispatcher[kDispatches]; + this[kMockAgentSet](http1OnlyKey, http1OnlyDispatcher); + } + } if (acceptNonStandardSearchParameters && dispatchOpts.path) { const [path18, searchParams] = dispatchOpts.path.split("?"); const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters); @@ -44538,7 +44926,11 @@ var require_decorator_handler2 = __commonJS({ /** * @deprecated */ - onBodySent() { + onBodySent(...args) { + return this.#handler.onBodySent?.(...args); + } + onRequestSent(...args) { + return this.#handler.onRequestSent?.(...args); } }; } @@ -44551,6 +44943,7 @@ var require_redirect_handler2 = __commonJS({ var util7 = require_util9(); var assert4 = require("node:assert"); var { InvalidArgumentError } = require_errors2(); + var { kRequestOrigin } = require_symbols6(); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; var noop = () => { }; @@ -44583,10 +44976,20 @@ var require_redirect_handler2 = __commonJS({ onRequestStart(controller, context3) { this.handler.onRequestStart?.(controller, { ...context3, history: this.history }); } + onBodySent(chunk) { + this.handler.onBodySent?.(chunk); + } + onRequestSent() { + this.handler.onRequestSent?.(); + } onRequestUpgrade(controller, statusCode, headers, socket) { this.handler.onRequestUpgrade?.(controller, statusCode, headers, socket); } onResponseStart(controller, statusCode, headers, statusMessage) { + if (statusCode < 200) { + this.handler.onResponseStart?.(controller, statusCode, headers, statusMessage); + return; + } if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) { throw new Error("max redirects"); } @@ -44607,14 +45010,16 @@ var require_redirect_handler2 = __commonJS({ this.opts.body = null; } this.location = this.history.length >= this.maxRedirections || util7.isDisturbed(this.opts.body) || redirectableStatusCodes.indexOf(statusCode) === -1 ? null : headers.location; - if (this.opts.origin) { - this.history.push(new URL(this.opts.path, this.opts.origin)); + const requestOrigin = this.opts[kRequestOrigin] === void 0 ? this.opts.origin : this.opts[kRequestOrigin]; + if (requestOrigin) { + this.history.push(new URL(this.opts.path, requestOrigin)); } if (!this.location) { this.handler.onResponseStart?.(controller, statusCode, headers, statusMessage); return; } - const { origin, pathname, search } = util7.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); + const baseUrl = requestOrigin ? new URL(this.opts.path, requestOrigin) : void 0; + const { origin, pathname, search } = util7.parseURL(new URL(this.location, baseUrl)); const path18 = search ? `${pathname}${search}` : pathname; const redirectUrlString = `${origin}${path18}`; for (const historyUrl of this.history) { @@ -44622,9 +45027,10 @@ var require_redirect_handler2 = __commonJS({ throw new InvalidArgumentError(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`); } } - this.opts.headers = cleanRequestHeaders(this.opts.headers, removeContentHeaders, this.opts.origin !== origin, this.stripHeadersOnRedirect, this.stripHeadersOnCrossOriginRedirect); + this.opts.headers = cleanRequestHeaders(this.opts.headers, removeContentHeaders, requestOrigin !== origin, this.stripHeadersOnRedirect, this.stripHeadersOnCrossOriginRedirect); this.opts.path = path18; this.opts.origin = origin; + this.opts[kRequestOrigin] = origin; this.opts.query = null; } onResponseData(controller, chunk) { @@ -44838,7 +45244,6 @@ var require_dump2 = __commonJS({ #maxSize = 1024 * 1024; #dumped = false; #size = 0; - #controller = null; aborted = false; reason = false; constructor({ maxSize: maxSize2, signal }, handler) { @@ -44854,7 +45259,6 @@ var require_dump2 = __commonJS({ } onRequestStart(controller, context3) { controller.abort = this.#abort.bind(this); - this.#controller = controller; return super.onRequestStart(controller, context3); } onResponseStart(controller, statusCode, headers, statusMessage) { @@ -44870,33 +45274,26 @@ var require_dump2 = __commonJS({ return super.onResponseStart(controller, statusCode, headers, statusMessage); } onResponseError(controller, err) { - if (this.#dumped) { - return; - } - err = this.#controller?.reason ?? err; - super.onResponseError(controller, err); + super.onResponseError(controller, this.aborted === true ? this.reason : err); } onResponseData(controller, chunk) { this.#size = this.#size + chunk.length; - if (this.#size >= this.#maxSize) { + if (this.#size > this.#maxSize) { + throw new RequestAbortedError( + `Response size (${this.#size}) larger than maxSize (${this.#maxSize})` + ); + } + if (this.#size === this.#maxSize) { this.#dumped = true; - if (this.aborted === true) { - super.onResponseError(controller, this.reason); - } else { - super.onResponseEnd(controller, {}); - } } return true; } onResponseEnd(controller, trailers) { - if (this.#dumped) { - return; - } - if (this.#controller.aborted === true) { + if (this.aborted === true) { super.onResponseError(controller, this.reason); return; } - super.onResponseEnd(controller, trailers); + super.onResponseEnd(controller, this.#dumped ? {} : trailers); } }; function createDumpInterceptor({ maxSize: defaultMaxSize } = { @@ -44922,6 +45319,7 @@ var require_dns2 = __commonJS({ var { lookup } = require("node:dns"); var DecoratorHandler = require_decorator_handler2(); var { InvalidArgumentError, InformationalError } = require_errors2(); + var { kRequestOrigin } = require_symbols6(); var maxInt = Math.pow(2, 31) - 1; function hasSafeIterator(headers) { const prototype = Object.getPrototypeOf(headers); @@ -45261,6 +45659,7 @@ var require_dns2 = __commonJS({ const dispatchOpts = { ...this.#opts, origin: `${this.#origin.protocol}//${ip.family === 6 ? `[${ip.address}]` : ip.address}${port}`, + [kRequestOrigin]: this.#opts[kRequestOrigin] === void 0 ? this.#origin : this.#opts[kRequestOrigin], headers: withHostHeader(this.#origin.host, this.#opts.headers) }; this.#dispatch(dispatchOpts, this); @@ -45339,6 +45738,7 @@ var require_dns2 = __commonJS({ servername: origin.hostname, // For SNI on TLS origin: newOrigin.origin, + [kRequestOrigin]: origDispatchOpts[kRequestOrigin] === void 0 ? origin : origDispatchOpts[kRequestOrigin], headers: withHostHeader(origin.host, origDispatchOpts.headers) }; dispatch( @@ -45367,6 +45767,7 @@ var require_cache2 = __commonJS({ isValidHTTPToken } = require_util9(); var { serializePathWithQuery } = require_util9(); + var { kRequestOrigin } = require_symbols6(); var MAX_DELTA_SECONDS = 2147483647; var RESTRICTIVE_DIRECTIVE_NAMES = ["no-store", "private", "no-cache"]; var kInvalidCacheControlDirectives = /* @__PURE__ */ Symbol("invalid cache-control directives"); @@ -45478,14 +45879,39 @@ var require_cache2 = __commonJS({ return tokenOnlyKey; } } - function makeCacheKey(opts) { - const origin = opts.origin ? opts.origin.toString() : ""; + function getRequestOrigin(opts) { + const origin = opts[kRequestOrigin] === void 0 ? opts.origin : opts[kRequestOrigin]; + return typeof origin === "string" || origin instanceof URL ? origin : null; + } + function getInterceptorOrigin(opts, interceptorOrigin) { + const requestOrigin = getRequestOrigin(opts); + if (interceptorOrigin === void 0) { + return requestOrigin; + } + if (interceptorOrigin === null) { + return null; + } + if (requestOrigin) { + try { + if (new URL(requestOrigin).origin !== interceptorOrigin) { + return null; + } + } catch { + return interceptorOrigin; + } + } + return interceptorOrigin; + } + function makeCacheKey(opts, origin = getRequestOrigin(opts)) { + if (!origin) { + throw new Error("opts.origin is undefined"); + } let fullPath = opts.path || "/"; if (opts.query && !pathHasQueryOrFragment(fullPath)) { fullPath = serializePathWithQuery(fullPath, opts.query); } return { - origin, + origin: origin.toString(), method: opts.method, path: fullPath, headers: opts.headers @@ -45860,6 +46286,8 @@ var require_cache2 = __commonJS({ return JSON.stringify([cacheKey.origin, cacheKey.method, cacheKey.path, headers]); } module2.exports = { + getInterceptorOrigin, + getRequestOrigin, makeCacheKey, normalizeHeaders, assertCacheKey, @@ -46526,6 +46954,12 @@ var require_cache_handler = __commonJS({ this.#writeStream = void 0; this.#handler.onRequestStart?.(controller, context3); } + onBodySent(chunk) { + this.#handler.onBodySent?.(chunk); + } + onRequestSent() { + this.#handler.onRequestSent?.(); + } onRequestUpgrade(controller, statusCode, headers, socket) { this.#handler.onRequestUpgrade?.(controller, statusCode, headers, socket); } @@ -46548,6 +46982,11 @@ var require_cache_handler = __commonJS({ return downstreamOnHeaders(); } const cacheControlHeader = resHeaders["cache-control"]; + const cacheControlDirectives = cacheControlHeader ? parseCacheControlHeader(cacheControlHeader) : {}; + if (revalidationResponseDisallowsCachedReuse(this.#cacheType, resHeaders, cacheControlDirectives)) { + deleteCachedValue(this.#store, this.#cacheKey); + return downstreamOnHeaders(); + } const heuristicallyCacheable = resHeaders["last-modified"] && arrayIncludes(HEURISTICALLY_CACHEABLE_STATUS_CODES, statusCode); if (!cacheControlHeader && !resHeaders["expires"] && !heuristicallyCacheable && !this.#cacheByDefault) { if (statusCode === 304 && resHeaders.vary && isInvalidOrWildcardVaryHeader(resHeaders.vary)) { @@ -46555,8 +46994,7 @@ var require_cache_handler = __commonJS({ } return downstreamOnHeaders(); } - const cacheControlDirectives = cacheControlHeader ? parseCacheControlHeader(cacheControlHeader) : {}; - if (!canCacheResponse(this.#cacheType, statusCode, resHeaders, cacheControlDirectives, this.#cacheKey.headers)) { + if (!canCacheResponse(this.#cacheType, this.#cacheKey.method, statusCode, resHeaders, cacheControlDirectives, this.#cacheKey.headers)) { if (statusCode === 304 && (cacheControlHeader || revalidationResponseDisallowsCachedReuse(this.#cacheType, resHeaders, cacheControlDirectives))) { deleteCachedValue(this.#store, this.#cacheKey); } @@ -46721,9 +47159,12 @@ var require_cache_handler = __commonJS({ } } function revalidationResponseDisallowsCachedReuse(cacheType, resHeaders, cacheControlDirectives) { - return cacheControlDirectives["no-store"] === true || cacheType === "shared" && cacheControlDirectives.private === true || (resHeaders.vary ? isInvalidOrWildcardVaryHeader(resHeaders.vary) : false); + return cacheControlDirectives["no-store"] === true || cacheType === "shared" && (cacheControlDirectives.private === true || Object.hasOwn(resHeaders, "set-cookie")) || (resHeaders.vary ? isInvalidOrWildcardVaryHeader(resHeaders.vary) : false); } - function canCacheResponse(cacheType, statusCode, resHeaders, cacheControlDirectives, reqHeaders) { + function canCacheResponse(cacheType, method, statusCode, resHeaders, cacheControlDirectives, reqHeaders) { + if (!arrayIncludes(util7.safeHTTPMethods, method)) { + return false; + } if (statusCode < 200 || arrayIncludes(NOT_UNDERSTOOD_STATUS_CODES, statusCode)) { return false; } @@ -46734,7 +47175,7 @@ var require_cache_handler = __commonJS({ if (cacheControlDirectives["no-store"]) { return false; } - if (cacheType === "shared" && cacheControlDirectives.private === true) { + if (cacheType === "shared" && (cacheControlDirectives.private === true || Object.hasOwn(resHeaders, "set-cookie"))) { return false; } if (resHeaders.vary && hasVaryStar(resHeaders.vary)) { @@ -46969,7 +47410,7 @@ var require_memory_cache_store = __commonJS({ return this.#size >= this.#maxSize || this.#count >= this.#maxCount; } /** - * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} req + * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} key * @returns {import('../../types/cache-interceptor.d.ts').default.GetResult | undefined} */ get(key) { @@ -47042,7 +47483,7 @@ var require_memory_cache_store = __commonJS({ store.#hasEmittedMaxSizeEvent = true; } for (const [key2, entries2] of store.#entries) { - for (const entry2 of entries2.splice(0, entries2.length / 2)) { + for (const entry2 of entries2.splice(0, Math.ceil(entries2.length / 2))) { store.#size -= entry2.size; store.#count -= 1; } @@ -47219,7 +47660,16 @@ var require_cache3 = __commonJS({ var CacheHandler = require_cache_handler(); var MemoryCacheStore = require_memory_cache_store(); var CacheRevalidationHandler = require_cache_revalidation_handler(); - var { assertCacheStore, assertCacheMethods, makeCacheKey, normalizeHeaders, parseCacheControlHeader, isInvalidOrWildcardVaryHeader } = require_cache2(); + var { + assertCacheStore, + assertCacheMethods, + getInterceptorOrigin, + makeCacheKey, + normalizeHeaders, + parseCacheControlHeader, + isInvalidOrWildcardVaryHeader, + parseVaryHeader + } = require_cache2(); var { AbortError: AbortError3 } = require_errors2(); var { parseHttpDate } = require_date(); function assertCacheOrigins(origins, name) { @@ -47285,7 +47735,7 @@ var require_cache3 = __commonJS({ result.cacheControlDirectives?.["s-maxage"] !== void 0); } function revalidationResponseDisallowsCachedReuse(cacheType, headers) { - if (headers.vary && isInvalidOrWildcardVaryHeader(headers.vary)) { + if (headers.vary && isInvalidOrWildcardVaryHeader(headers.vary) || cacheType === "shared" && Object.hasOwn(headers, "set-cookie")) { return true; } const cacheControl = headers["cache-control"]; @@ -47298,6 +47748,17 @@ var require_cache3 = __commonJS({ function revalidationResponseUpdatesCacheControl(headers) { return headers["cache-control"] !== void 0; } + function revalidationResponseAddsVary(result, varyDirectives) { + if (!varyDirectives) { + return false; + } + for (const key in varyDirectives) { + if (result.vary == null || !Object.hasOwn(result.vary, key)) { + return true; + } + } + return false; + } function deleteCachedValue(store, cacheKey) { try { store.delete(cacheKey)?.catch?.(nop); @@ -47393,6 +47854,7 @@ var require_cache3 = __commonJS({ const stream4 = util7.isStream(result.body) ? result.body : Readable6.from(result.body ?? []); assert4(!stream4.destroyed, "stream should not be destroyed"); assert4(!stream4.readableDidRead, "stream should not be readableDidRead"); + let aborted = false; const controller = { rawHeaders: [], rawTrailers: [], @@ -47406,12 +47868,13 @@ var require_cache3 = __commonJS({ return stream4.isPaused(); }, get aborted() { - return stream4.destroyed; + return aborted; }, get reason() { return stream4.errored; }, abort(reason) { + aborted = true; stream4.destroy(reason ?? new AbortError3()); } }; @@ -47450,6 +47913,13 @@ var require_cache3 = __commonJS({ if (!result) { return handleUncachedResponse(dispatch, globalOpts, cacheKey, handler, opts, reqCacheControl); } + if (globalOpts.type === "shared" && Object.hasOwn(result.headers, "set-cookie")) { + if (util7.isStream(result.body)) { + result.body.on("error", nop).destroy(); + } + deleteCachedValue(globalOpts.store, cacheKey); + return handleUncachedResponse(dispatch, globalOpts, cacheKey, handler, opts, reqCacheControl); + } const now = Date.now(); if (now > result.deleteAt) { return dispatch(opts, new CacheHandler(globalOpts, cacheKey, handler)); @@ -47516,6 +47986,12 @@ var require_cache3 = __commonJS({ } if (revalidationResponseUpdatesCacheControl(headers2)) { deleteCachedValue(globalOpts.store, cacheKey); + } else if (revalidationResponseAddsVary(result, headers2.vary ? parseVaryHeader(headers2.vary, opts.headers) : void 0)) { + if (util7.isStream(result.body)) { + result.body.on("error", nop).destroy(); + } + deleteCachedValue(globalOpts.store, cacheKey); + return dispatch(opts, new CacheHandler(globalOpts, cacheKey, handler)); } } sendCachedValue(handler, opts, result, age, context3, stale); @@ -47566,25 +48042,23 @@ var require_cache3 = __commonJS({ safeMethodsToNotCache.push(method); } } - return (dispatch) => { + return (dispatch, interceptorOrigin) => { return (opts2, handler) => { - if (arrayIncludes(safeMethodsToNotCache, opts2.method)) { + const requestOrigin = getInterceptorOrigin(opts2, interceptorOrigin); + if (!requestOrigin || arrayIncludes(safeMethodsToNotCache, opts2.method)) { return dispatch(opts2, handler); } if (origins !== void 0) { - if (!opts2.origin) { - return dispatch(opts2, handler); - } - const requestOrigin = opts2.origin.toString().toLowerCase(); + const normalizedRequestOrigin = requestOrigin.toString().toLowerCase(); let isAllowed = false; for (let i = 0; i < origins.length; i++) { const allowed = origins[i]; if (typeof allowed === "string") { - if (allowed.toLowerCase() === requestOrigin) { + if (allowed.toLowerCase() === normalizedRequestOrigin) { isAllowed = true; break; } - } else if (allowed.test(requestOrigin)) { + } else if (allowed.test(normalizedRequestOrigin)) { isAllowed = true; break; } @@ -47601,7 +48075,10 @@ var require_cache3 = __commonJS({ if (reqCacheControl?.["no-store"]) { return dispatch(opts2, handler); } - const cacheKey = makeCacheKey(opts2); + const cacheKey = makeCacheKey(opts2, requestOrigin); + if (!arrayIncludes(util7.safeHTTPMethods, opts2.method)) { + return dispatch(opts2, new CacheHandler(globalOpts, cacheKey, handler)); + } const result = store.get(cacheKey); if (result && typeof result.then === "function") { return result.then((result2) => handleResult( @@ -47635,9 +48112,66 @@ var require_decompress = __commonJS({ "node_modules/undici/lib/interceptor/decompress.js"(exports2, module2) { "use strict"; var { createInflate, createGunzip, createBrotliDecompress, createZstdDecompress } = require("node:zlib"); - var { pipeline: pipeline4 } = require("node:stream"); + var { pipeline: pipeline4, Transform: TransformStream2 } = require("node:stream"); + var { InvalidArgumentError, ResponseExceededMaxSizeError } = require_errors2(); var DecoratorHandler = require_decorator_handler2(); + var DecompressController = class { + #onPause; + #onResume; + #onAbort; + #paused = false; + constructor(onPause, onResume, onAbort) { + this.#onPause = onPause; + this.#onResume = onResume; + this.#onAbort = onAbort; + this.target = null; + } + pause() { + if (this.#paused) { + return; + } + this.#paused = true; + this.#onPause(); + } + resume() { + if (!this.#paused) { + return; + } + this.#paused = false; + this.#onResume(); + } + abort(reason) { + this.target?.abort(reason); + this.#onAbort(reason); + } + get paused() { + return this.#paused; + } + get aborted() { + return this.target?.aborted ?? false; + } + get reason() { + return this.target?.reason ?? null; + } + get rawHeaders() { + return this.target?.rawHeaders ?? null; + } + set rawHeaders(value) { + if (this.target) { + this.target.rawHeaders = value; + } + } + get rawTrailers() { + return this.target?.rawTrailers ?? null; + } + set rawTrailers(value) { + if (this.target) { + this.target.rawTrailers = value; + } + } + }; var supportedEncodings = { + __proto__: null, gzip: createGunzip, "x-gzip": createGunzip, br: createBrotliDecompress, @@ -47650,6 +48184,23 @@ var require_decompress = __commonJS({ /** @type {const} */ [204, 304] ); + var defaultMaxSize = 0; + function createMaxSizeLimiter(maxSize2) { + let size = 0; + return new TransformStream2({ + transform(chunk, _encoding, callback) { + const decompressedSize = size + chunk.length; + if (decompressedSize > maxSize2) { + callback(new ResponseExceededMaxSizeError( + `Decompressed response size (${decompressedSize}) exceeded maxSize (${maxSize2})` + )); + return; + } + size = decompressedSize; + callback(null, chunk); + } + }); + } var warningEmitted = ( /** @type {boolean} */ false @@ -47663,10 +48214,122 @@ var require_decompress = __commonJS({ #skipStatusCodes; /** @type {boolean} */ #skipErrorResponses; - constructor(handler, { skipStatusCodes = defaultSkipStatusCodes, skipErrorResponses = true } = {}) { + /** @type {number} */ + #maxSize; + /** @type {number} */ + #decompressedSize = 0; + /** @type {boolean} */ + #terminated = false; + /** @type {boolean} */ + #inputEnded = false; + /** @type {boolean} */ + #inputBackpressured = false; + /** @type {boolean} */ + #upstreamPaused = false; + /** @type {boolean} */ + #draining = false; + /** @type {boolean} */ + #drainRequested = false; + /** @type {boolean} */ + #completionPending = false; + /** @type {DecompressorStream | undefined} */ + #finalDecompressor; + /** @type {DecompressController} */ + #controller; + constructor(handler, { skipStatusCodes = defaultSkipStatusCodes, skipErrorResponses = true, maxSize: maxSize2 = defaultMaxSize } = {}) { + if (!Number.isSafeInteger(maxSize2) || maxSize2 < 0) { + throw new InvalidArgumentError("maxSize must be a non-negative integer"); + } super(handler); this.#skipStatusCodes = skipStatusCodes; this.#skipErrorResponses = skipErrorResponses; + this.#maxSize = maxSize2; + this.#controller = new DecompressController( + () => this.#onDownstreamPause(), + () => this.#onDownstreamResume(), + (reason) => { + if (this.#inputEnded && !this.#terminated) { + this.onResponseError(this.#controller, reason); + } + } + ); + } + #onDownstreamPause() { + this.#pauseUpstream(); + } + #onDownstreamResume() { + const drainWasDeferred = this.#draining; + this.#drainOutput(); + if (!drainWasDeferred) { + this.#resumeUpstreamIfNeeded(); + this.#finishIfReady(); + } + } + #pauseUpstream() { + if (!this.#upstreamPaused && !this.#terminated) { + this.#upstreamPaused = true; + this.#controller.target?.pause(); + } + } + #resumeUpstreamIfNeeded() { + if (this.#upstreamPaused && !this.#controller.paused && !this.#inputBackpressured) { + this.#upstreamPaused = false; + if (!this.#inputEnded) { + this.#controller.target?.resume(); + } + } + } + #drainOutput() { + if (this.#terminated || this.#controller.paused || !this.#finalDecompressor) { + return; + } + if (this.#draining) { + this.#drainRequested = true; + return; + } + this.#draining = true; + try { + do { + this.#drainRequested = false; + let chunk; + while (!this.#terminated && !this.#controller.paused && (chunk = this.#finalDecompressor.read()) !== null) { + if (this.#maxSize > 0) { + const decompressedSize = this.#decompressedSize + chunk.length; + if (decompressedSize > this.#maxSize) { + this.#fail(new ResponseExceededMaxSizeError( + `Decompressed response size (${decompressedSize}) exceeded maxSize (${this.#maxSize})` + )); + return; + } + this.#decompressedSize = decompressedSize; + } + const result = super.onResponseData(this.#controller, chunk); + if (result === false && !this.#controller.paused) { + this.#controller.pause(); + } + } + } while (this.#drainRequested && !this.#terminated && !this.#controller.paused); + } finally { + this.#draining = false; + } + this.#resumeUpstreamIfNeeded(); + this.#finishIfReady(); + } + #finishIfReady() { + if (this.#terminated || !this.#completionPending || this.#controller.paused || this.#draining) { + return; + } + this.#terminated = true; + this.#cleanupDecompressors(); + super.onResponseEnd(this.#controller, this.#trailers); + } + #onDecompressionEnd() { + if (this.#terminated) { + return; + } + this.#completionPending = true; + this.#drainOutput(); + this.#finishIfReady(); } /** * Determines if decompression should be skipped based on encoding and status code @@ -47684,7 +48347,7 @@ var require_decompress = __commonJS({ * Creates a chain of decompressors for multiple content encodings * * @param {string} encodings - Comma-separated list of content encodings - * @returns {Array} - Array of decompressor streams + * @returns {Array} - Array of decompressor and limiting streams * @throws {Error} - If the number of content-encodings exceeds the maximum allowed */ #createDecompressionChain(encodings) { @@ -47703,54 +48366,81 @@ var require_decompress = __commonJS({ } decompressors.push(supportedEncodings[encoding]()); } - return decompressors; + if (decompressors.length < 2) { + return decompressors; + } + const streams = []; + for (let i = 0; i < decompressors.length; i++) { + streams.push(decompressors[i]); + if (i < decompressors.length - 1 && this.#maxSize > 0) { + streams.push(createMaxSizeLimiter(this.#maxSize)); + } + } + return streams; } /** - * Sets up event handlers for a decompressor stream using readable events - * @param {DecompressorStream} decompressor - The decompressor stream - * @param {Controller} controller - The controller to coordinate with + * Stops decompression and reports an error. + * @param {Error} error - The decompression error * @returns {void} */ - #setupDecompressorEvents(decompressor, controller) { - decompressor.on("readable", () => { - let chunk; - while ((chunk = decompressor.read()) !== null) { - const result = super.onResponseData(controller, chunk); - if (result === false) { - break; - } - } - }); - decompressor.on("error", (error2) => { - super.onResponseError(controller, error2); - }); + #fail(error2) { + if (this.#terminated) { + return; + } + if (this.#inputEnded) { + this.onResponseError(this.#controller, error2); + } else { + this.#controller.abort(error2); + } + } + /** + * Sets up event handlers for the final decompressor stream. + * @param {DecompressorStream} decompressor - The decompressor stream + * @returns {void} + */ + #setupDecompressorEvents(decompressor) { + this.#finalDecompressor = decompressor; + decompressor.on("readable", () => this.#drainOutput()); + decompressor.on("error", (error2) => this.#fail(error2)); } /** * Sets up event handling for a single decompressor - * @param {Controller} controller - The controller to handle events * @returns {void} */ - #setupSingleDecompressor(controller) { + #setupSingleDecompressor() { const decompressor = this.#decompressors[0]; - this.#setupDecompressorEvents(decompressor, controller); - decompressor.on("end", () => { - super.onResponseEnd(controller, this.#trailers); - }); + this.#setupDecompressorEvents(decompressor); + decompressor.on("end", () => this.#onDecompressionEnd()); } /** * Sets up event handling for multiple chained decompressors using pipeline - * @param {Controller} controller - The controller to handle events * @returns {void} */ - #setupMultipleDecompressors(controller) { + #setupMultipleDecompressors() { const lastDecompressor = this.#decompressors[this.#decompressors.length - 1]; - this.#setupDecompressorEvents(lastDecompressor, controller); + this.#setupDecompressorEvents(lastDecompressor); pipeline4(this.#decompressors, (err) => { - if (err) { - super.onResponseError(controller, err); + if (this.#terminated) { return; } - super.onResponseEnd(controller, this.#trailers); + if (err) { + this.#fail(err); + return; + } + this.#onDecompressionEnd(); + }); + } + #setupInputBackpressure() { + const decompressor = this.#decompressors[0]; + decompressor.on("drain", () => { + if (this.#terminated) { + return; + } + this.#inputBackpressured = false; + if (!this.#controller.paused) { + this.#drainOutput(); + this.#resumeUpstreamIfNeeded(); + } }); } /** @@ -47759,6 +48449,14 @@ var require_decompress = __commonJS({ */ #cleanupDecompressors() { this.#decompressors.length = 0; + this.#finalDecompressor = void 0; + } + onRequestStart(controller, context3) { + this.#controller.target = controller; + return super.onRequestStart(this.#controller, context3); + } + onRequestUpgrade(controller, statusCode, headers, socket) { + return super.onRequestUpgrade(this.#controller, statusCode, headers, socket); } /** * @param {Controller} controller @@ -47768,19 +48466,20 @@ var require_decompress = __commonJS({ * @returns {void} */ onResponseStart(controller, statusCode, headers, statusMessage) { - const contentEncoding = headers["content-encoding"]; + const rawContentEncoding = headers["content-encoding"]; + const contentEncoding = Array.isArray(rawContentEncoding) ? rawContentEncoding.join(",") : rawContentEncoding; if (this.#shouldSkipDecompression(contentEncoding, statusCode)) { - return super.onResponseStart(controller, statusCode, headers, statusMessage); + return super.onResponseStart(this.#controller, statusCode, headers, statusMessage); } const decompressors = this.#createDecompressionChain(contentEncoding.toLowerCase()); if (decompressors.length === 0) { this.#cleanupDecompressors(); - return super.onResponseStart(controller, statusCode, headers, statusMessage); + return super.onResponseStart(this.#controller, statusCode, headers, statusMessage); } this.#decompressors = decompressors; const { "content-encoding": _, "content-length": __, ...newHeaders } = headers; - if (controller?.rawHeaders) { - const rawHeaders = controller.rawHeaders; + if (this.#controller.rawHeaders) { + const rawHeaders = this.#controller.rawHeaders; if (Array.isArray(rawHeaders)) { const filteredHeaders = []; for (let i = 0; i < rawHeaders.length; i += 2) { @@ -47792,7 +48491,7 @@ var require_decompress = __commonJS({ } filteredHeaders.push(rawHeaders[i], rawHeaders[i + 1]); } - controller.rawHeaders = filteredHeaders; + rawHeaders.splice(0, rawHeaders.length, ...filteredHeaders); } else if (typeof rawHeaders === "object") { for (const name of Object.keys(rawHeaders)) { const lowerName = name.toLowerCase(); @@ -47802,12 +48501,13 @@ var require_decompress = __commonJS({ } } } + this.#setupInputBackpressure(); if (this.#decompressors.length === 1) { - this.#setupSingleDecompressor(controller); + this.#setupSingleDecompressor(); } else { - this.#setupMultipleDecompressors(controller); + this.#setupMultipleDecompressors(); } - return super.onResponseStart(controller, statusCode, newHeaders, statusMessage); + return super.onResponseStart(this.#controller, statusCode, newHeaders, statusMessage); } /** * @param {Controller} controller @@ -47816,10 +48516,13 @@ var require_decompress = __commonJS({ */ onResponseData(controller, chunk) { if (this.#decompressors.length > 0) { - this.#decompressors[0].write(chunk); + if (!this.#decompressors[0].write(chunk)) { + this.#inputBackpressured = true; + this.#pauseUpstream(); + } return; } - super.onResponseData(controller, chunk); + return super.onResponseData(this.#controller, chunk); } /** * @param {Controller} controller @@ -47828,12 +48531,12 @@ var require_decompress = __commonJS({ */ onResponseEnd(controller, trailers) { if (this.#decompressors.length > 0) { + this.#inputEnded = true; this.#trailers = trailers; this.#decompressors[0].end(); - this.#cleanupDecompressors(); return; } - super.onResponseEnd(controller, trailers); + return super.onResponseEnd(this.#controller, trailers); } /** * @param {Controller} controller @@ -47841,13 +48544,15 @@ var require_decompress = __commonJS({ * @returns {void} */ onResponseError(controller, err) { - if (this.#decompressors.length > 0) { - for (const decompressor of this.#decompressors) { - decompressor.destroy(err); - } - this.#cleanupDecompressors(); + if (this.#terminated) { + return; } - super.onResponseError(controller, err); + this.#terminated = true; + for (const decompressor of this.#decompressors) { + decompressor.destroy(); + } + this.#cleanupDecompressors(); + super.onResponseError(this.#controller, err); } }; function createDecompressInterceptor(options = {}) { @@ -48063,8 +48768,9 @@ var require_deduplication_handler = __commonJS({ if (this.#aborted || this.#completed) { return; } - this.#completed = true; + this.#cleanup(); this.#primaryHandler.onResponseEnd?.(controller, trailers); + this.#completed = true; for (const waitingHandler of this.#waitingHandlers) { if (waitingHandler.done || waitingHandler.controller.aborted) { waitingHandler.done = true; @@ -48075,18 +48781,18 @@ var require_deduplication_handler = __commonJS({ waitingHandler.done = true; continue; } - if (waitingHandler.controller.paused && waitingHandler.bufferedChunks.length > 0) { + if (waitingHandler.controller.paused) { waitingHandler.pendingTrailers = trailers; continue; } try { waitingHandler.handler.onResponseEnd?.(waitingHandler.controller, trailers); - } catch { + } catch (err) { + this.#errorWaitingHandler(waitingHandler, err); } waitingHandler.done = true; } this.#pruneDoneWaitingHandlers(); - this.#onComplete?.(); } /** * @param {import('../../types/dispatcher.d.ts').default.DispatchController} controller @@ -48098,12 +48804,17 @@ var require_deduplication_handler = __commonJS({ } this.#aborted = true; this.#completed = true; + this.#cleanup(); this.#primaryHandler.onResponseError?.(controller, err); for (const waitingHandler of this.#waitingHandlers) { this.#errorWaitingHandler(waitingHandler, err); } this.#waitingHandlers = []; - this.#onComplete?.(); + } + #cleanup() { + const onComplete = this.#onComplete; + this.#onComplete = null; + onComplete?.(); } /** * @param {DispatchHandler} handler @@ -48133,7 +48844,8 @@ var require_deduplication_handler = __commonJS({ if (this.#completed && waitingHandler.pendingTrailers && waitingHandler.bufferedChunks.length === 0 && !state3.paused && !state3.aborted) { try { waitingHandler.handler.onResponseEnd?.(waitingHandler.controller, waitingHandler.pendingTrailers); - } catch { + } catch (err) { + this.#errorWaitingHandler(waitingHandler, err); } waitingHandler.pendingTrailers = null; waitingHandler.done = true; @@ -48155,12 +48867,19 @@ var require_deduplication_handler = __commonJS({ return state3.reason; }, abort: (reason) => { + if (state3.aborted) { + return; + } state3.aborted = true; state3.reason = reason ?? null; waitingHandler.done = true; waitingHandler.pendingTrailers = null; waitingHandler.bufferedChunks = []; waitingHandler.bufferedBytes = 0; + try { + handler.onResponseError?.(waitingHandler.controller, state3.reason ?? new RequestAbortedError()); + } catch { + } } }; return waitingHandler; @@ -48181,7 +48900,7 @@ var require_deduplication_handler = __commonJS({ waitingHandler.bufferedBytes += bufferedChunk.length; if (waitingHandler.bufferedBytes > this.#maxBufferSize) { const err = new RequestAbortedError(`Deduplicated waiting handler exceeded maxBufferSize (${this.#maxBufferSize} bytes) while paused`); - this.#errorWaitingHandler(waitingHandler, err); + waitingHandler.controller.abort(err); } } /** @@ -48218,7 +48937,6 @@ var require_deduplication_handler = __commonJS({ waitingHandler.bufferedChunks = []; waitingHandler.bufferedBytes = 0; try { - waitingHandler.controller.abort(err); waitingHandler.handler.onResponseError?.(waitingHandler.controller, err); } catch { } @@ -48238,7 +48956,7 @@ var require_deduplicate = __commonJS({ var diagnosticsChannel = require("node:diagnostics_channel"); var util7 = require_util9(); var DeduplicationHandler = require_deduplication_handler(); - var { normalizeHeaders, makeCacheKey, makeDeduplicationKey } = require_cache2(); + var { getInterceptorOrigin, normalizeHeaders, makeCacheKey, makeDeduplicationKey } = require_cache2(); var pendingRequestsChannel = diagnosticsChannel.channel("undici:request:pending-requests"); module2.exports = (opts = {}) => { const { @@ -48270,9 +48988,10 @@ var require_deduplicate = __commonJS({ const skipHeaderNamesSet = new Set(skipHeaderNames.map((name) => name.toLowerCase())); const excludeHeaderNamesSet = new Set(excludeHeaderNames.map((name) => name.toLowerCase())); const pendingRequests = /* @__PURE__ */ new Map(); - return (dispatch) => { + return (dispatch, interceptorOrigin) => { return (opts2, handler) => { - if (opts2.upgrade || methods.includes(opts2.method) === false) { + const requestOrigin = getInterceptorOrigin(opts2, interceptorOrigin); + if (!requestOrigin || opts2.upgrade || methods.includes(opts2.method) === false) { return dispatch(opts2, handler); } opts2 = { @@ -48286,7 +49005,7 @@ var require_deduplicate = __commonJS({ } } } - const cacheKey = makeCacheKey(opts2); + const cacheKey = makeCacheKey(opts2, requestOrigin); const dedupeKey = makeDeduplicationKey(cacheKey, excludeHeaderNamesSet); const pendingHandler = pendingRequests.get(dedupeKey); if (pendingHandler) { @@ -48947,7 +49666,11 @@ var require_headers2 = __commonJS({ } } }; - var Headers2 = class _Headers { + var getHeadersGuard; + var setHeadersGuard; + var getHeadersList; + var setHeadersList; + var Headers2 = class { #guard; /** * @type {HeadersList} @@ -48971,7 +49694,7 @@ var require_headers2 = __commonJS({ } // https://fetch.spec.whatwg.org/#dom-headers-append append(name, value) { - webidl.brandCheck(this, _Headers); + webidl.brandCheck(this, webidl.is.Headers); webidl.argumentLengthCheck(arguments, 2, "Headers.append"); const prefix2 = "Headers.append"; name = webidl.converters.ByteString(name, prefix2, "name"); @@ -48980,7 +49703,7 @@ var require_headers2 = __commonJS({ } // https://fetch.spec.whatwg.org/#dom-headers-delete delete(name) { - webidl.brandCheck(this, _Headers); + webidl.brandCheck(this, webidl.is.Headers); webidl.argumentLengthCheck(arguments, 1, "Headers.delete"); const prefix2 = "Headers.delete"; name = webidl.converters.ByteString(name, prefix2, "name"); @@ -49001,7 +49724,7 @@ var require_headers2 = __commonJS({ } // https://fetch.spec.whatwg.org/#dom-headers-get get(name) { - webidl.brandCheck(this, _Headers); + webidl.brandCheck(this, webidl.is.Headers); webidl.argumentLengthCheck(arguments, 1, "Headers.get"); const prefix2 = "Headers.get"; name = webidl.converters.ByteString(name, prefix2, "name"); @@ -49016,7 +49739,7 @@ var require_headers2 = __commonJS({ } // https://fetch.spec.whatwg.org/#dom-headers-has has(name) { - webidl.brandCheck(this, _Headers); + webidl.brandCheck(this, webidl.is.Headers); webidl.argumentLengthCheck(arguments, 1, "Headers.has"); const prefix2 = "Headers.has"; name = webidl.converters.ByteString(name, prefix2, "name"); @@ -49031,7 +49754,7 @@ var require_headers2 = __commonJS({ } // https://fetch.spec.whatwg.org/#dom-headers-set set(name, value) { - webidl.brandCheck(this, _Headers); + webidl.brandCheck(this, webidl.is.Headers); webidl.argumentLengthCheck(arguments, 2, "Headers.set"); const prefix2 = "Headers.set"; name = webidl.converters.ByteString(name, prefix2, "name"); @@ -49057,7 +49780,7 @@ var require_headers2 = __commonJS({ } // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie getSetCookie() { - webidl.brandCheck(this, _Headers); + webidl.brandCheck(this, webidl.is.Headers); const list = this.#headersList.cookies; if (list) { return [...list]; @@ -49068,32 +49791,21 @@ var require_headers2 = __commonJS({ options.depth ??= depth; return `Headers ${util7.formatWithOptions(options, this.#headersList.entries)}`; } - static getHeadersGuard(o) { - return o.#guard; - } - static setHeadersGuard(o, guard) { - o.#guard = guard; - } - /** - * @param {Headers} o - */ - static getHeadersList(o) { - return o.#headersList; - } - /** - * @param {Headers} target - * @param {HeadersList} list - */ - static setHeadersList(target, list) { - target.#headersList = list; + static { + getHeadersGuard = (headers) => headers.#guard; + setHeadersGuard = (headers, guard) => { + headers.#guard = guard; + }; + getHeadersList = (headers) => headers.#headersList; + setHeadersList = (target, list) => { + target.#headersList = list; + }; + webidl.is.Headers = (arg) => { + return arg != null && typeof arg === "object" && #guard in arg; + }; } }; - var { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers2; - Reflect.deleteProperty(Headers2, "getHeadersGuard"); - Reflect.deleteProperty(Headers2, "setHeadersGuard"); - Reflect.deleteProperty(Headers2, "getHeadersList"); - Reflect.deleteProperty(Headers2, "setHeadersList"); - iteratorMixin("Headers", Headers2, headersListSortAndCombine, 0, 1); + iteratorMixin("Headers", Headers2, headersListSortAndCombine, 0, 1, webidl.is.Headers); Object.defineProperties(Headers2.prototype, { append: kEnumerableProperty, delete: kEnumerableProperty, @@ -49169,7 +49881,11 @@ var require_response2 = __commonJS({ var assert4 = require("node:assert"); var { isomorphicEncode, serializeJavascriptValueToJSONString } = require_infra(); var textEncoder = new TextEncoder("utf-8"); - var Response = class _Response { + var getResponseHeaders2; + var setResponseHeaders; + var getResponseState; + var setResponseState; + var Response = class { /** @type {Headers} */ #headers; #state; @@ -49233,12 +49949,12 @@ var require_response2 = __commonJS({ } // Returns response’s type, e.g., "cors". get type() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); return this.#state.type; } // Returns response’s URL, if it has one; otherwise the empty string. get url() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); const urlList = this.#state.urlList; const url2 = urlList[urlList.length - 1] ?? null; if (url2 === null) { @@ -49248,40 +49964,40 @@ var require_response2 = __commonJS({ } // Returns whether response was obtained through a redirect. get redirected() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); return this.#state.urlList.length > 1; } // Returns response’s status. get status() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); return this.#state.status; } // Returns whether response’s status is an ok status. get ok() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); return this.#state.status >= 200 && this.#state.status <= 299; } // Returns response’s status message. get statusText() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); return this.#state.statusText; } // Returns response’s headers as Headers. get headers() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); return this.#headers; } get body() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); return this.#state.body ? this.#state.body.stream : null; } get bodyUsed() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); return !!this.#state.body && util7.isDisturbed(this.#state.body.stream); } // Returns a clone of response. clone() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); if (bodyUnusable(this.#state)) { throw webidl.errors.exception({ header: "Response.clone", @@ -49312,39 +50028,25 @@ var require_response2 = __commonJS({ }; return `Response ${nodeUtil.formatWithOptions(options, properties)}`; } - /** - * @param {Response} response - */ - static getResponseHeaders(response) { - return response.#headers; - } - /** - * @param {Response} response - * @param {Headers} newHeaders - */ - static setResponseHeaders(response, newHeaders) { - response.#headers = newHeaders; - } - /** - * @param {Response} response - */ - static getResponseState(response) { - return response.#state; - } - /** - * @param {Response} response - * @param {any} newState - */ - static setResponseState(response, newState) { - response.#state = newState; + static { + getResponseHeaders2 = (response) => { + return response.#headers; + }; + setResponseHeaders = (response, newHeaders) => { + response.#headers = newHeaders; + }; + getResponseState = (response) => { + return response.#state; + }; + setResponseState = (response, newState) => { + response.#state = newState; + }; + webidl.is.Response = (arg) => { + return arg != null && typeof arg === "object" && #state in arg; + }; } }; - var { getResponseHeaders: getResponseHeaders2, setResponseHeaders, getResponseState, setResponseState } = Response; - Reflect.deleteProperty(Response, "getResponseHeaders"); - Reflect.deleteProperty(Response, "setResponseHeaders"); - Reflect.deleteProperty(Response, "getResponseState"); - Reflect.deleteProperty(Response, "setResponseState"); - mixinBody(Response, getResponseState); + mixinBody(Response, getResponseState, webidl.is.Response); Object.defineProperties(Response.prototype, { type: kEnumerableProperty, url: kEnumerableProperty, @@ -49548,7 +50250,6 @@ var require_response2 = __commonJS({ converter: webidl.converters.HeadersInit } ]); - webidl.is.Response = webidl.util.MakeTypeAssertion(Response); module2.exports = { isNetworkError, makeNetworkError, @@ -49628,7 +50329,14 @@ var require_request4 = __commonJS({ } } var patchMethodWarning = false; - var Request = class _Request { + var setRequestSignal; + var getRequestDispatcher; + var setRequestDispatcher; + var setRequestHeaders; + var getRequestState; + var setRequestState; + var removeRequestAbortListener; + var Request = class { /** @type {AbortSignal} */ #signal; /** @type {import('../../dispatcher/dispatcher')} */ @@ -49918,25 +50626,25 @@ var require_request4 = __commonJS({ } // Returns request’s HTTP method, which is "GET" by default. get method() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.method; } // Returns the URL of request as a string. get url() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return URLSerializer(this.#state.url); } // Returns a Headers object consisting of the headers associated with request. // Note that headers added in the network layer by the user agent will not // be accounted for in this object, e.g., the "Host" header. get headers() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#headers; } // Returns the kind of resource requested by request, e.g., "document" // or "script". get destination() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.destination; } // Returns the referrer of request. Its value can be a same-origin URL if @@ -49945,7 +50653,7 @@ var require_request4 = __commonJS({ // during fetching to determine the value of the `Referer` header of the // request being made. get referrer() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); if (this.#state.referrer === "no-referrer") { return ""; } @@ -49958,28 +50666,28 @@ var require_request4 = __commonJS({ // This is used during fetching to compute the value of the request’s // referrer. get referrerPolicy() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.referrerPolicy; } // Returns the mode associated with request, which is a string indicating // whether the request will use CORS, or will be restricted to same-origin // URLs. get mode() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.mode; } // Returns the credentials mode associated with request, // which is a string indicating whether credentials will be sent with the // request always, never, or only when sent to a same-origin URL. get credentials() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.credentials; } // Returns the cache mode associated with request, // which is a string indicating how the request will // interact with the browser’s cache when fetching. get cache() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.cache; } // Returns the redirect mode associated with request, @@ -49987,56 +50695,56 @@ var require_request4 = __commonJS({ // request will be handled during fetching. A request // will follow redirects by default. get redirect() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.redirect; } // Returns request’s subresource integrity metadata, which is a // cryptographic hash of the resource being fetched. Its value // consists of multiple hashes separated by whitespace. [SRI] get integrity() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.integrity; } // Returns a boolean indicating whether or not request can outlive the // global in which it was created. get keepalive() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.keepalive; } // Returns a boolean indicating whether or not request is for a reload // navigation. get isReloadNavigation() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.reloadNavigation; } // Returns a boolean indicating whether or not request is for a history // navigation (a.k.a. back-forward navigation). get isHistoryNavigation() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.historyNavigation; } // Returns the signal associated with request, which is an AbortSignal // object indicating whether or not request has been aborted, and its // abort event handler. get signal() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#signal; } get body() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.body ? this.#state.body.stream : null; } get bodyUsed() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return !!this.#state.body && util7.isDisturbed(this.#state.body.stream); } get duplex() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return "half"; } // Returns a clone of request. clone() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); if (bodyUnusable(this.#state)) { throw new TypeError("unusable"); } @@ -50083,65 +50791,34 @@ var require_request4 = __commonJS({ }; return `Request ${nodeUtil.formatWithOptions(options, properties)}`; } - /** - * @param {Request} request - * @param {AbortSignal} newSignal - */ - static setRequestSignal(request, newSignal) { - request.#signal = newSignal; - return request; - } - /** - * @param {Request} request - */ - static getRequestDispatcher(request) { - return request.#dispatcher; - } - /** - * @param {Request} request - * @param {import('../../dispatcher/dispatcher')} newDispatcher - */ - static setRequestDispatcher(request, newDispatcher) { - request.#dispatcher = newDispatcher; - } - /** - * @param {Request} request - * @param {Headers} newHeaders - */ - static setRequestHeaders(request, newHeaders) { - request.#headers = newHeaders; - } - /** - * @param {Request} request - */ - static getRequestState(request) { - return request.#state; - } - /** - * @param {Request} request - * @param {any} newState - */ - static setRequestState(request, newState) { - request.#state = newState; - } - /** - * Removes the `abort` listener that makes this request's signal follow the - * signal passed to its constructor, if any. Idempotent. - * @param {Request} request - */ - static removeRequestAbortListener(request) { - request.#abortCleanup?.(); + static { + setRequestSignal = (request, newSignal) => { + request.#signal = newSignal; + }; + getRequestDispatcher = (request) => { + return request.#dispatcher; + }; + setRequestDispatcher = (request, newDispatcher) => { + request.#dispatcher = newDispatcher; + }; + setRequestHeaders = (request, newHeaders) => { + request.#headers = newHeaders; + }; + getRequestState = (request) => { + return request.#state; + }; + setRequestState = (request, newState) => { + request.#state = newState; + }; + removeRequestAbortListener = (request) => { + request.#abortCleanup?.(); + }; + webidl.is.Request = (arg) => { + return arg != null && typeof arg === "object" && #state in arg; + }; } }; - var { setRequestSignal, getRequestDispatcher, setRequestDispatcher, setRequestHeaders, getRequestState, setRequestState, removeRequestAbortListener } = Request; - Reflect.deleteProperty(Request, "setRequestSignal"); - Reflect.deleteProperty(Request, "getRequestDispatcher"); - Reflect.deleteProperty(Request, "setRequestDispatcher"); - Reflect.deleteProperty(Request, "setRequestHeaders"); - Reflect.deleteProperty(Request, "getRequestState"); - Reflect.deleteProperty(Request, "setRequestState"); - Reflect.deleteProperty(Request, "removeRequestAbortListener"); - mixinBody(Request, getRequestState); + mixinBody(Request, getRequestState, webidl.is.Request); function makeRequest(init) { return { method: init.method ?? "GET", @@ -50156,7 +50833,7 @@ var require_request4 = __commonJS({ serviceWorkers: init.serviceWorkers ?? "all", initiator: init.initiator ?? "", destination: init.destination ?? "", - priority: init.priority ?? null, + priority: init.priority ?? "auto", origin: init.origin ?? "client", policyContainer: init.policyContainer ?? "client", referrer: init.referrer ?? "client", @@ -50231,7 +50908,6 @@ var require_request4 = __commonJS({ configurable: true } }); - webidl.is.Request = webidl.util.MakeTypeAssertion(Request); webidl.converters.RequestInfo = function(V) { if (typeof V === "string") { return webidl.converters.USVString(V); @@ -50325,8 +51001,7 @@ var require_request4 = __commonJS({ { key: "priority", converter: webidl.converters.DOMString, - allowedValues: ["high", "low", "auto"], - defaultValue: () => "auto" + allowedValues: ["high", "low", "auto"] } ]); module2.exports = { @@ -50541,6 +51216,7 @@ var require_fetch2 = __commonJS({ var EE = require("node:events"); var { Readable: Readable6, pipeline: pipeline4, finished, isErrored, isReadable } = require("node:stream"); var { addAbortListener, bufferToLowerCasedHeaderName } = require_util9(); + var { SocketError } = require_errors2(); var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url2(); var { getGlobalDispatcher } = require_global4(); var { webidl } = require_webidl2(); @@ -50998,11 +51674,11 @@ var require_fetch2 = __commonJS({ } function fetchFinale(fetchParams, response) { let timingInfo = fetchParams.timingInfo; + if (fetchParams.request.destination === "document") { + fetchParams.controller.fullTimingInfo = timingInfo; + } const processResponseEndOfBody = () => { const unsafeEndTime = Date.now(); - if (fetchParams.request.destination === "document") { - fetchParams.controller.fullTimingInfo = timingInfo; - } fetchParams.controller.reportTimingSteps = () => { if (!urlIsHttpHttpsScheme(fetchParams.request.url)) { return; @@ -51051,6 +51727,15 @@ var require_fetch2 = __commonJS({ processResponseEndOfBody(); }); } + if (fetchParams.processResponseConsumeBody != null) { + const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes); + const processBodyError = () => fetchParams.processResponseConsumeBody(response, "failure"); + if (internalResponse.body == null) { + queueMicrotask(() => processBody(null)); + } else { + fullyReadBody(internalResponse.body, processBody, processBodyError); + } + } } async function httpFetch(fetchParams) { const request = fetchParams.request; @@ -51601,6 +52286,9 @@ var require_fetch2 = __commonJS({ }, onRequestUpgrade(controller, status, headers, socket) { if (socket.session != null && status !== 200 || socket.session == null && status !== 101) { + if (socket.session != null) { + controller.abort(new SocketError("bad upgrade", null)); + } return false; } const rawHeaders = controller?.rawHeaders ?? []; @@ -51671,7 +52359,7 @@ var require_cache4 = __commonJS({ var { Request, fromInnerRequest, getRequestState } = require_request4(); var { fetching } = require_fetch2(); var { urlIsHttpHttpsScheme, readAllBytes } = require_util10(); - var Cache = class _Cache { + var Cache = class { /** * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list * @type {requestResponseList} @@ -51685,7 +52373,7 @@ var require_cache4 = __commonJS({ this.#relevantRequestResponseList = arguments[1]; } async match(request, options = {}) { - webidl.brandCheck(this, _Cache); + webidl.brandCheck(this, webidl.is.Cache); const prefix2 = "Cache.match"; webidl.argumentLengthCheck(arguments, 1, prefix2); request = webidl.converters.RequestInfo(request); @@ -51697,14 +52385,14 @@ var require_cache4 = __commonJS({ return p[0]; } async matchAll(request = void 0, options = {}) { - webidl.brandCheck(this, _Cache); + webidl.brandCheck(this, webidl.is.Cache); const prefix2 = "Cache.matchAll"; if (request !== void 0) request = webidl.converters.RequestInfo(request); options = webidl.converters.CacheQueryOptions(options, prefix2, "options"); return this.#internalMatchAll(request, options); } async add(request) { - webidl.brandCheck(this, _Cache); + webidl.brandCheck(this, webidl.is.Cache); const prefix2 = "Cache.add"; webidl.argumentLengthCheck(arguments, 1, prefix2); request = webidl.converters.RequestInfo(request); @@ -51713,7 +52401,7 @@ var require_cache4 = __commonJS({ return await responseArrayPromise; } async addAll(requests) { - webidl.brandCheck(this, _Cache); + webidl.brandCheck(this, webidl.is.Cache); const prefix2 = "Cache.addAll"; webidl.argumentLengthCheck(arguments, 1, prefix2); const responsePromises = []; @@ -51775,7 +52463,10 @@ var require_cache4 = __commonJS({ } } }, - processResponseEndOfBody(response) { + // Possible spec bug. If the body is never read, `processResponseEndOfBody` (which is attached to a TransformStream's flush hook) + // never runs, so this would hang. This hook, on the other hand, always reads the body. + // https://github.com/nodejs/undici/issues/5615 + processResponseConsumeBody(response) { if (response.aborted) { responsePromise.reject(new DOMException("aborted", "AbortError")); return; @@ -51818,7 +52509,7 @@ var require_cache4 = __commonJS({ return cacheJobPromise.promise; } async put(request, response) { - webidl.brandCheck(this, _Cache); + webidl.brandCheck(this, webidl.is.Cache); const prefix2 = "Cache.put"; webidl.argumentLengthCheck(arguments, 2, prefix2); request = webidl.converters.RequestInfo(request); @@ -51899,7 +52590,7 @@ var require_cache4 = __commonJS({ return cacheJobPromise.promise; } async delete(request, options = {}) { - webidl.brandCheck(this, _Cache); + webidl.brandCheck(this, webidl.is.Cache); const prefix2 = "Cache.delete"; webidl.argumentLengthCheck(arguments, 1, prefix2); request = webidl.converters.RequestInfo(request); @@ -51945,7 +52636,7 @@ var require_cache4 = __commonJS({ * @returns {Promise} */ async keys(request = void 0, options = {}) { - webidl.brandCheck(this, _Cache); + webidl.brandCheck(this, webidl.is.Cache); const prefix2 = "Cache.keys"; if (request !== void 0) request = webidl.converters.RequestInfo(request); options = webidl.converters.CacheQueryOptions(options, prefix2, "options"); @@ -52154,6 +52845,11 @@ var require_cache4 = __commonJS({ } return Object.freeze(responseList); } + static { + webidl.is.Cache = (arg) => { + return arg != null && typeof arg === "object" && #relevantRequestResponseList in arg; + }; + } }; Object.defineProperties(Cache.prototype, { [Symbol.toStringTag]: { @@ -52214,7 +52910,7 @@ var require_cachestorage2 = __commonJS({ var { webidl } = require_webidl2(); var { kEnumerableProperty } = require_util9(); var { kConstruct } = require_symbols6(); - var CacheStorage = class _CacheStorage { + var CacheStorage = class { /** * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map * @type {Map} */ async has(cacheName) { - webidl.brandCheck(this, _CacheStorage); + webidl.brandCheck(this, webidl.is.CacheStorage); const prefix2 = "CacheStorage.has"; webidl.argumentLengthCheck(arguments, 1, prefix2); cacheName = webidl.converters.DOMString(cacheName, prefix2, "cacheName"); @@ -52265,7 +52961,7 @@ var require_cachestorage2 = __commonJS({ * @returns {Promise} */ async open(cacheName) { - webidl.brandCheck(this, _CacheStorage); + webidl.brandCheck(this, webidl.is.CacheStorage); const prefix2 = "CacheStorage.open"; webidl.argumentLengthCheck(arguments, 1, prefix2); cacheName = webidl.converters.DOMString(cacheName, prefix2, "cacheName"); @@ -52283,7 +52979,7 @@ var require_cachestorage2 = __commonJS({ * @returns {Promise} */ async delete(cacheName) { - webidl.brandCheck(this, _CacheStorage); + webidl.brandCheck(this, webidl.is.CacheStorage); const prefix2 = "CacheStorage.delete"; webidl.argumentLengthCheck(arguments, 1, prefix2); cacheName = webidl.converters.DOMString(cacheName, prefix2, "cacheName"); @@ -52294,10 +52990,15 @@ var require_cachestorage2 = __commonJS({ * @returns {Promise} */ async keys() { - webidl.brandCheck(this, _CacheStorage); + webidl.brandCheck(this, webidl.is.CacheStorage); const keys = this.#caches.keys(); return [...keys]; } + static { + webidl.is.CacheStorage = (arg) => { + return arg != null && typeof arg === "object" && #caches in arg; + }; + } }; Object.defineProperties(CacheStorage.prototype, { [Symbol.toStringTag]: { @@ -52507,7 +53208,7 @@ var require_util12 = __commonJS({ validateCookiePath(cookie.path); out.push(`Path=${cookie.path}`); } - if (cookie.expires && cookie.expires.toString() !== "Invalid Date") { + if (cookie.expires != null && cookie.expires.toString() !== "Invalid Date") { out.push(`Expires=${toIMFDate(cookie.expires)}`); } if (cookie.sameSite) { @@ -52583,90 +53284,93 @@ var require_parse4 = __commonJS({ }; } function parseUnparsedAttributes(unparsedAttributes, cookieAttributeList = {}) { - if (unparsedAttributes.length === 0) { - return cookieAttributeList; - } - assert4(unparsedAttributes[0] === ";"); - unparsedAttributes = unparsedAttributes.slice(1); - let cookieAv = ""; - if (unparsedAttributes.includes(";")) { - cookieAv = collectASequenceOfCodePointsFast( - ";", - unparsedAttributes, - { position: 0 } - ); - unparsedAttributes = unparsedAttributes.slice(cookieAv.length); - } else { - cookieAv = unparsedAttributes; - unparsedAttributes = ""; - } - let attributeName = ""; - let attributeValue = ""; - if (cookieAv.includes("=")) { - const position = { position: 0 }; - attributeName = collectASequenceOfCodePointsFast( - "=", - cookieAv, - position - ); - attributeValue = cookieAv.slice(position.position + 1); - } else { - attributeName = cookieAv; - } - attributeName = attributeName.trim(); - attributeValue = attributeValue.trim(); - if (attributeValue.length > maxAttributeValueSize) { - return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); - } - const attributeNameLowercase = attributeName.toLowerCase(); - if (attributeNameLowercase === "expires") { - const expiryTime = new Date(attributeValue); - if (!Number.isNaN(expiryTime.getTime())) { - cookieAttributeList.expires = expiryTime; + while (true) { + if (unparsedAttributes.length === 0) { + return cookieAttributeList; } - } else if (attributeNameLowercase === "max-age") { - const charCode = attributeValue.charCodeAt(0); - if ((charCode < 48 || charCode > 57) && attributeValue[0] !== "-") { - return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); - } - if (!/^\d+$/.test(attributeValue)) { - return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); - } - const deltaSeconds = Number(attributeValue); - cookieAttributeList.maxAge = deltaSeconds; - } else if (attributeNameLowercase === "domain") { - let cookieDomain = attributeValue; - if (cookieDomain[0] === ".") { - cookieDomain = cookieDomain.slice(1); - } - cookieDomain = cookieDomain.toLowerCase(); - cookieAttributeList.domain = cookieDomain; - } else if (attributeNameLowercase === "path") { - let cookiePath = ""; - if (attributeValue.length === 0 || attributeValue[0] !== "/") { - cookiePath = "/"; + assert4(unparsedAttributes[0] === ";"); + unparsedAttributes = unparsedAttributes.slice(1); + let cookieAv = ""; + if (unparsedAttributes.includes(";")) { + cookieAv = collectASequenceOfCodePointsFast( + ";", + unparsedAttributes, + { position: 0 } + ); + unparsedAttributes = unparsedAttributes.slice(cookieAv.length); } else { - cookiePath = attributeValue; + cookieAv = unparsedAttributes; + unparsedAttributes = ""; } - cookieAttributeList.path = cookiePath; - } else if (attributeNameLowercase === "secure") { - cookieAttributeList.secure = true; - } else if (attributeNameLowercase === "httponly") { - cookieAttributeList.httpOnly = true; - } else if (attributeNameLowercase === "samesite") { - const attributeValueLowercase = attributeValue.toLowerCase(); - if (attributeValueLowercase === "none") { - cookieAttributeList.sameSite = "None"; - } else if (attributeValueLowercase === "strict") { - cookieAttributeList.sameSite = "Strict"; - } else if (attributeValueLowercase === "lax") { - cookieAttributeList.sameSite = "Lax"; + let attributeName = ""; + let attributeValue = ""; + if (cookieAv.includes("=")) { + const position = { position: 0 }; + attributeName = collectASequenceOfCodePointsFast( + "=", + cookieAv, + position + ); + attributeValue = cookieAv.slice(position.position + 1); + } else { + attributeName = cookieAv; + } + attributeName = attributeName.trim(); + attributeValue = attributeValue.trim(); + if (attributeValue.length > maxAttributeValueSize) { + continue; + } + const attributeNameLowercase = attributeName.toLowerCase(); + if (attributeNameLowercase === "expires") { + const expiryTime = new Date(attributeValue); + if (!Number.isNaN(expiryTime.getTime())) { + cookieAttributeList.expires = expiryTime; + } + } else if (attributeNameLowercase === "max-age") { + const charCode = attributeValue.charCodeAt(0); + const startsWithDigit = charCode >= 48 && charCode <= 57; + const startsWithSignedDigit = attributeValue[0] === "-" && attributeValue.length > 1; + if (!startsWithDigit && !startsWithSignedDigit) { + continue; + } + if (/[^\d]/.test(attributeValue.slice(1))) { + continue; + } + const deltaSeconds = Number(attributeValue); + cookieAttributeList.maxAge = deltaSeconds; + } else if (attributeNameLowercase === "domain") { + let cookieDomain = attributeValue; + if (cookieDomain[0] === ".") { + cookieDomain = cookieDomain.slice(1); + } + cookieDomain = cookieDomain.toLowerCase(); + cookieAttributeList.domain = cookieDomain; + } else if (attributeNameLowercase === "path") { + let cookiePath = ""; + if (attributeValue.length === 0 || attributeValue[0] !== "/") { + cookiePath = "/"; + } else { + cookiePath = attributeValue; + } + cookieAttributeList.path = cookiePath; + } else if (attributeNameLowercase === "secure") { + cookieAttributeList.secure = true; + } else if (attributeNameLowercase === "httponly") { + cookieAttributeList.httpOnly = true; + } else if (attributeNameLowercase === "samesite") { + const attributeValueLowercase = attributeValue.toLowerCase(); + if (attributeValueLowercase === "none") { + cookieAttributeList.sameSite = "None"; + } else if (attributeValueLowercase === "strict") { + cookieAttributeList.sameSite = "Strict"; + } else if (attributeValueLowercase === "lax") { + cookieAttributeList.sameSite = "Lax"; + } + } else { + cookieAttributeList.unparsed ??= []; + cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`); } - } else { - cookieAttributeList.unparsed ??= []; - cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`); } - return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); } module2.exports = { parseSetCookie, @@ -52682,13 +53386,21 @@ var require_cookies2 = __commonJS({ var { parseSetCookie } = require_parse4(); var { stringify: stringify3 } = require_util12(); var { webidl } = require_webidl2(); - var { Headers: Headers2 } = require_headers2(); - var brandChecks = webidl.brandCheckMultiple([Headers2, globalThis.Headers].filter(Boolean)); + var globalHeadersBrandCheck = (arg) => webidl.brandCheck(arg, webidl.util.MakeTypeAssertion(globalThis.Headers)); + var undiciHeadersBrandCheck = (arg) => webidl.brandCheck(arg, webidl.is.Headers); + function brandCheckHeaders(arg) { + try { + undiciHeadersBrandCheck(arg); + return; + } catch { + } + globalHeadersBrandCheck(arg); + } function getCookies(headers) { webidl.argumentLengthCheck(arguments, 1, "getCookies"); - brandChecks(headers); + brandCheckHeaders(headers); const cookie = headers.get("cookie"); - const out = {}; + const out = { __proto__: null }; if (!cookie) { return out; } @@ -52699,7 +53411,7 @@ var require_cookies2 = __commonJS({ return out; } function deleteCookie(headers, name, attributes) { - brandChecks(headers); + brandCheckHeaders(headers); const prefix2 = "deleteCookie"; webidl.argumentLengthCheck(arguments, 2, prefix2); name = webidl.converters.DOMString(name, prefix2, "name"); @@ -52713,7 +53425,7 @@ var require_cookies2 = __commonJS({ } function getSetCookies(headers) { webidl.argumentLengthCheck(arguments, 1, "getSetCookies"); - brandChecks(headers); + brandCheckHeaders(headers); const cookies = headers.getSetCookie(); if (!cookies) { return []; @@ -52726,7 +53438,7 @@ var require_cookies2 = __commonJS({ } function setCookie(headers, cookie) { webidl.argumentLengthCheck(arguments, 2, "setCookie"); - brandChecks(headers); + brandCheckHeaders(headers); cookie = webidl.converters.Cookie(cookie); const str = stringify3(cookie); if (str) { @@ -52817,6 +53529,7 @@ var require_events2 = __commonJS({ var { webidl } = require_webidl2(); var { kEnumerableProperty } = require_util9(); var { kConstruct } = require_symbols6(); + var createFastMessageEvent; var MessageEvent = class _MessageEvent extends Event { #eventInit; constructor(type, eventInitDict = {}) { @@ -52834,30 +53547,30 @@ var require_events2 = __commonJS({ webidl.util.markAsUncloneable(this); } get data() { - webidl.brandCheck(this, _MessageEvent); + webidl.brandCheck(this, webidl.is.MessageEvent); return this.#eventInit.data; } get origin() { - webidl.brandCheck(this, _MessageEvent); + webidl.brandCheck(this, webidl.is.MessageEvent); return this.#eventInit.origin; } get lastEventId() { - webidl.brandCheck(this, _MessageEvent); + webidl.brandCheck(this, webidl.is.MessageEvent); return this.#eventInit.lastEventId; } get source() { - webidl.brandCheck(this, _MessageEvent); + webidl.brandCheck(this, webidl.is.MessageEvent); return this.#eventInit.source; } get ports() { - webidl.brandCheck(this, _MessageEvent); + webidl.brandCheck(this, webidl.is.MessageEvent); if (!Object.isFrozen(this.#eventInit.ports)) { Object.freeze(this.#eventInit.ports); } return this.#eventInit.ports; } initMessageEvent(type, bubbles = false, cancelable = false, data = null, origin = "", lastEventId = "", source = null, ports = []) { - webidl.brandCheck(this, _MessageEvent); + webidl.brandCheck(this, webidl.is.MessageEvent); webidl.argumentLengthCheck(arguments, 1, "MessageEvent.initMessageEvent"); return new _MessageEvent(type, { bubbles, @@ -52869,20 +53582,23 @@ var require_events2 = __commonJS({ ports }); } - static createFastMessageEvent(type, init) { - const messageEvent = new _MessageEvent(kConstruct, type, init); - messageEvent.#eventInit = init; - messageEvent.#eventInit.data ??= null; - messageEvent.#eventInit.origin ??= ""; - messageEvent.#eventInit.lastEventId ??= ""; - messageEvent.#eventInit.source ??= null; - messageEvent.#eventInit.ports ??= []; - return messageEvent; + static { + createFastMessageEvent = (type, init) => { + const messageEvent = new _MessageEvent(kConstruct, type, init); + messageEvent.#eventInit = init; + messageEvent.#eventInit.data ??= null; + messageEvent.#eventInit.origin ??= ""; + messageEvent.#eventInit.lastEventId ??= ""; + messageEvent.#eventInit.source ??= null; + messageEvent.#eventInit.ports ??= []; + return messageEvent; + }; + webidl.is.MessageEvent = (arg) => { + return arg != null && typeof arg === "object" && #eventInit in arg; + }; } }; - var { createFastMessageEvent } = MessageEvent; - delete MessageEvent.createFastMessageEvent; - var CloseEvent = class _CloseEvent extends Event { + var CloseEvent = class extends Event { #eventInit; constructor(type, eventInitDict = {}) { const prefix2 = "CloseEvent constructor"; @@ -52894,19 +53610,24 @@ var require_events2 = __commonJS({ webidl.util.markAsUncloneable(this); } get wasClean() { - webidl.brandCheck(this, _CloseEvent); + webidl.brandCheck(this, webidl.is.CloseEvent); return this.#eventInit.wasClean; } get code() { - webidl.brandCheck(this, _CloseEvent); + webidl.brandCheck(this, webidl.is.CloseEvent); return this.#eventInit.code; } get reason() { - webidl.brandCheck(this, _CloseEvent); + webidl.brandCheck(this, webidl.is.CloseEvent); return this.#eventInit.reason; } + static { + webidl.is.CloseEvent = (arg) => { + return arg != null && typeof arg === "object" && #eventInit in arg; + }; + } }; - var ErrorEvent = class _ErrorEvent extends Event { + var ErrorEvent = class extends Event { #eventInit; constructor(type, eventInitDict) { const prefix2 = "ErrorEvent constructor"; @@ -52918,25 +53639,30 @@ var require_events2 = __commonJS({ this.#eventInit = eventInitDict; } get message() { - webidl.brandCheck(this, _ErrorEvent); + webidl.brandCheck(this, webidl.is.ErrorEvent); return this.#eventInit.message; } get filename() { - webidl.brandCheck(this, _ErrorEvent); + webidl.brandCheck(this, webidl.is.ErrorEvent); return this.#eventInit.filename; } get lineno() { - webidl.brandCheck(this, _ErrorEvent); + webidl.brandCheck(this, webidl.is.ErrorEvent); return this.#eventInit.lineno; } get colno() { - webidl.brandCheck(this, _ErrorEvent); + webidl.brandCheck(this, webidl.is.ErrorEvent); return this.#eventInit.colno; } get error() { - webidl.brandCheck(this, _ErrorEvent); + webidl.brandCheck(this, webidl.is.ErrorEvent); return this.#eventInit.error; } + static { + webidl.is.ErrorEvent = (arg) => { + return arg != null && typeof arg === "object" && #eventInit in arg; + }; + } }; Object.defineProperties(MessageEvent.prototype, { [Symbol.toStringTag]: { @@ -53501,7 +54227,7 @@ var require_connection2 = __commonJS({ const secProtocol = response.headersList.get("Sec-WebSocket-Protocol"); if (secProtocol !== null) { const requestProtocols = getDecodeSplit("sec-websocket-protocol", request.headersList); - if (!requestProtocols.includes(secProtocol)) { + if (requestProtocols === null || !requestProtocols.includes(secProtocol)) { failWebsocketConnection(handler, 1002, "Protocol was not set in the opening handshake."); return; } @@ -53619,6 +54345,7 @@ var require_permessage_deflate2 = __commonJS({ if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) { callback(new MessageSizeExceededError()); this.#inflate.removeAllListeners(); + this.#inflate.destroy(); this.#inflate = null; return; } @@ -53921,6 +54648,7 @@ var require_receiver2 = __commonJS({ } consumeFragments() { const fragments = this.#fragments; + this.#info.compressed = false; if (fragments.length === 1) { this.#fragmentsBytes = 0; return fragments.shift(); @@ -54124,6 +54852,7 @@ var require_websocket2 = __commonJS({ var { channels } = require_diagnostics2(); var kRef = /* @__PURE__ */ Symbol.for("nodejs.ref"); var kUnref = /* @__PURE__ */ Symbol.for("nodejs.unref"); + var ping; function getSocketAddress(socket) { if (typeof socket?.address === "function") { return socket.address(); @@ -54226,13 +54955,13 @@ var require_websocket2 = __commonJS({ this.#handler.readyState = _WebSocket.CONNECTING; this.#binaryType = "blob"; } + // TODO: remove this [kRef]() { - webidl.brandCheck(this, _WebSocket); this.#refed = true; this.#handler.socket?.ref?.(); } + // TODO: remove this [kUnref]() { - webidl.brandCheck(this, _WebSocket); this.#refed = false; this.#handler.socket?.unref?.(); } @@ -54242,7 +54971,7 @@ var require_websocket2 = __commonJS({ * @param {string|undefined} reason */ close(code = void 0, reason = void 0) { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); const prefix2 = "WebSocket.close"; if (code !== void 0) { code = webidl.converters["unsigned short"](code, prefix2, "code", webidl.attributes.Clamp); @@ -54259,7 +54988,7 @@ var require_websocket2 = __commonJS({ * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data */ send(data) { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); const prefix2 = "WebSocket.send"; webidl.argumentLengthCheck(arguments, 1, prefix2); data = webidl.converters.WebSocketSendData(data, prefix2, "data"); @@ -54293,31 +55022,31 @@ var require_websocket2 = __commonJS({ } } get readyState() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return this.#handler.readyState; } get bufferedAmount() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return this.#bufferedAmount; } get url() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return URLSerializer(this.#url); } get extensions() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return this.#extensions; } get protocol() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return this.#protocol; } get onopen() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return this.#events.open; } set onopen(fn) { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); if (this.#events.open) { this.removeEventListener("open", this.#events.open); } @@ -54330,11 +55059,11 @@ var require_websocket2 = __commonJS({ } } get onerror() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return this.#events.error; } set onerror(fn) { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); if (this.#events.error) { this.removeEventListener("error", this.#events.error); } @@ -54347,11 +55076,11 @@ var require_websocket2 = __commonJS({ } } get onclose() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return this.#events.close; } set onclose(fn) { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); if (this.#events.close) { this.removeEventListener("close", this.#events.close); } @@ -54364,11 +55093,11 @@ var require_websocket2 = __commonJS({ } } get onmessage() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return this.#events.message; } set onmessage(fn) { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); if (this.#events.message) { this.removeEventListener("message", this.#events.message); } @@ -54381,11 +55110,11 @@ var require_websocket2 = __commonJS({ } } get binaryType() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return this.#binaryType; } set binaryType(type) { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); if (type !== "blob" && type !== "arraybuffer") { this.#binaryType = "blob"; } else { @@ -54495,27 +55224,26 @@ var require_websocket2 = __commonJS({ }); } } - /** - * @param {WebSocket} ws - * @param {Buffer|undefined} buffer - */ - static ping(ws, buffer3) { - if (Buffer.isBuffer(buffer3)) { - if (buffer3.length > 125) { - throw new TypeError("A PING frame cannot have a body larger than 125 bytes."); + static { + ping = (ws, buffer3) => { + if (Buffer.isBuffer(buffer3)) { + if (buffer3.length > 125) { + throw new TypeError("A PING frame cannot have a body larger than 125 bytes."); + } + } else if (buffer3 !== void 0) { + throw new TypeError("Expected buffer payload"); } - } else if (buffer3 !== void 0) { - throw new TypeError("Expected buffer payload"); - } - const readyState = ws.#handler.readyState; - if (isEstablished(readyState) && !isClosing(readyState) && !isClosed(readyState)) { - const frame = new WebsocketFrameSend(buffer3); - ws.#handler.socket.write(frame.createFrame(opcodes.PING)); - } + const readyState = ws.#handler.readyState; + if (isEstablished(readyState) && !isClosing(readyState) && !isClosed(readyState)) { + const frame = new WebsocketFrameSend(buffer3); + ws.#handler.socket.write(frame.createFrame(opcodes.PING)); + } + }; + webidl.is.WebSocket = (arg) => { + return arg != null && typeof arg === "object" && #handler in arg; + }; } }; - var { ping } = WebSocket; - Reflect.deleteProperty(WebSocket, "ping"); WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING; WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN; WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING; @@ -54624,6 +55352,7 @@ var require_websocketerror = __commonJS({ } }); } + var createUnvalidatedWebSocketError; var WebSocketError = class _WebSocketError extends createInheritableDOMException() { #closeCode; #reason; @@ -54650,20 +55379,18 @@ var require_websocketerror = __commonJS({ get reason() { return this.#reason; } - /** - * @param {string} message - * @param {number|null} code - * @param {string} reason - */ - static createUnvalidatedWebSocketError(message, code, reason) { - const error2 = new _WebSocketError(message, kConstruct); - error2.#closeCode = code; - error2.#reason = reason; - return error2; + static { + createUnvalidatedWebSocketError = (message, code, reason) => { + const error2 = new _WebSocketError(message, kConstruct); + error2.#closeCode = code; + error2.#reason = reason; + return error2; + }; + webidl.is.WebSocketError = (arg) => { + return arg != null && typeof arg === "object" && #reason in arg; + }; } }; - var { createUnvalidatedWebSocketError } = WebSocketError; - delete WebSocketError.createUnvalidatedWebSocketError; Object.defineProperties(WebSocketError.prototype, { closeCode: kEnumerableProperty, reason: kEnumerableProperty, @@ -54674,7 +55401,6 @@ var require_websocketerror = __commonJS({ configurable: true } }); - webidl.is.WebSocketError = webidl.util.MakeTypeAssertion(WebSocketError); module2.exports = { WebSocketError, createUnvalidatedWebSocketError }; } }); @@ -54711,9 +55437,9 @@ var require_websocketstream = __commonJS({ #readableStream; /** @type {ReadableStreamDefaultController} */ #readableStreamController; - // Each WebSocketStream object has an associated writable stream , which is a WritableStream . - /** @type {WritableStream} */ - #writableStream; + // Retain the controller so the writable stream can be errored while locked. + /** @type {WritableStreamDefaultController} */ + #writableStreamController; // Each WebSocketStream object has an associated boolean handshake aborted , which is initially false. #handshakeAborted = false; /** @type {import('../websocket').Handler} */ @@ -54868,12 +55594,14 @@ var require_websocketstream = __commonJS({ cancel: (reason) => this.#cancel(reason) }); const writable = new WritableStream({ + start: (controller) => { + this.#writableStreamController = controller; + }, write: (chunk) => this.#write(chunk), close: () => closeWebSocketConnection(this.#handler, null, null), abort: (reason) => this.#closeUsingReason(reason) }); this.#readableStream = readable; - this.#writableStream = writable; this.#openedPromise.resolve({ extensions, protocol, @@ -54917,9 +55645,7 @@ var require_websocketstream = __commonJS({ const reason = result?.reason == null ? "" : utf8DecodeBytes(Buffer.from(result.reason)); if (wasClean) { readableStreamClose(this.#readableStreamController); - if (!this.#writableStream.locked) { - this.#writableStream.abort(new DOMException("A closed WebSocketStream cannot be written to", "InvalidStateError")); - } + this.#writableStreamController.error(new DOMException("A closed WebSocketStream cannot be written to", "InvalidStateError")); this.#closedPromise.resolve({ closeCode: code, reason @@ -54927,7 +55653,7 @@ var require_websocketstream = __commonJS({ } else { const error2 = createUnvalidatedWebSocketError("unclean close", code, reason); this.#readableStreamController?.error(error2); - this.#writableStream?.abort(error2); + this.#writableStreamController?.error(error2); this.#closedPromise.reject(error2); } } @@ -55034,6 +55760,7 @@ var require_util14 = __commonJS({ var require_eventsource_stream2 = __commonJS({ "node_modules/undici/lib/web/eventsource/eventsource-stream.js"(exports2, module2) { "use strict"; + var buffer3 = require("node:buffer"); var { Transform: Transform2 } = require("node:stream"); var { isASCIINumber, isValidLastEventId } = require_util14(); var BOM = [239, 187, 191]; @@ -55041,24 +55768,25 @@ var require_eventsource_stream2 = __commonJS({ var CR = 13; var COLON = 58; var SPACE = 32; + var defaultMaxEventSize = buffer3.kStringMaxLength; var DATA = Buffer.from("data"); var EVENT = Buffer.from("event"); var ID2 = Buffer.from("id"); var RETRY = Buffer.from("retry"); - function isASCIINumberBytes(buffer3, start) { - if (start >= buffer3.length) { + function isASCIINumberBytes(buffer4, start) { + if (start >= buffer4.length) { return false; } - for (let i = start; i < buffer3.length; i++) { - if (buffer3[i] < 48 || buffer3[i] > 57) { + for (let i = start; i < buffer4.length; i++) { + if (buffer4[i] < 48 || buffer4[i] > 57) { return false; } } return true; } - function isValidLastEventIdBytes(buffer3, start) { - for (let i = start; i < buffer3.length; i++) { - if (buffer3[i] === 0) { + function isValidLastEventIdBytes(buffer4, start) { + for (let i = start; i < buffer4.length; i++) { + if (buffer4[i] === 0) { return false; } } @@ -55075,6 +55803,11 @@ var require_eventsource_stream2 = __commonJS({ } return true; } + function createMaxEventSizeExceededError() { + const error2 = new Error("EventSource message size exceeded"); + error2.aborted = false; + return error2; + } var EventSourceStream = class extends Transform2 { /** * @type {eventSourceSettings} @@ -55101,6 +55834,8 @@ var require_eventsource_stream2 = __commonJS({ pos = 0; lineChunkIndex = 0; linePos = 0; + eventDataSize = 0; + maxEventSize; event = { data: void 0, event: void 0, @@ -55110,6 +55845,7 @@ var require_eventsource_stream2 = __commonJS({ /** * @param {object} options * @param {boolean} [options.readableObjectMode] + * @param {number} [options.maxEventSize] * @param {eventSourceSettings} [options.eventSourceSettings] * @param {(chunk: any, encoding?: BufferEncoding | undefined) => boolean} [options.push] */ @@ -55117,6 +55853,7 @@ var require_eventsource_stream2 = __commonJS({ options.readableObjectMode = true; super(options); this.state = options.eventSourceSettings || {}; + this.maxEventSize = options.maxEventSize ?? defaultMaxEventSize; if (options.push) { this.push = options.push; } @@ -55168,7 +55905,12 @@ var require_eventsource_stream2 = __commonJS({ if (byte === CR) { this.crlfCheck = true; } - this.parseLine(this.readLine(), this.event); + try { + this.parseLine(this.readLine(), this.event); + } catch (error2) { + callback(error2); + return; + } this.consumeCurrentByte(); this.eventEndCheck = true; continue; @@ -55199,6 +55941,11 @@ var require_eventsource_stream2 = __commonJS({ } } if (isFieldName(line, fieldLength, DATA)) { + const valueBytes = line.length - valueStart; + const eventDataSize = this.eventDataSize + (event.data === void 0 ? 0 : 1) + valueBytes; + if (this.maxEventSize > 0 && eventDataSize > this.maxEventSize) { + throw createMaxEventSizeExceededError(); + } const value = line.toString("utf8", valueStart); if (event.data === void 0) { event.data = value; @@ -55206,6 +55953,7 @@ var require_eventsource_stream2 = __commonJS({ event.data += ` ${value}`; } + this.eventDataSize = eventDataSize; return; } if (isFieldName(line, fieldLength, RETRY)) { @@ -55253,6 +56001,7 @@ ${value}`; this.event.event = void 0; this.event.id = void 0; this.event.retry = void 0; + this.eventDataSize = 0; } hasPendingEvent() { return this.event.data !== void 0 || this.event.event !== void 0 || this.event.id !== void 0 || this.event.retry !== void 0; @@ -55382,9 +56131,12 @@ var require_eventsource2 = __commonJS({ var { parseMIMEType } = require_data_url2(); var { createFastMessageEvent } = require_events2(); var { isNetworkError } = require_response2(); - var { kEnumerableProperty } = require_util9(); + var { isValidHeaderValue, kEnumerableProperty } = require_util9(); var { environmentSettingsObject } = require_util10(); var { createPotentialCORSRequest } = require_util14(); + var { getGlobalDispatcher } = require_global4(); + var { isomorphicDecode } = require_infra(); + var textEncoder = new TextEncoder(); var experimentalWarned = false; var defaultReconnectionTime = 3e3; var CONNECTING = 0; @@ -55392,7 +56144,7 @@ var require_eventsource2 = __commonJS({ var CLOSED = 2; var ANONYMOUS = "anonymous"; var USE_CREDENTIALS = "use-credentials"; - var EventSource = class _EventSource extends EventTarget { + var EventSource = class extends EventTarget { #events = { open: null, error: null, @@ -55464,6 +56216,7 @@ var require_eventsource2 = __commonJS({ * @readonly */ get readyState() { + webidl.brandCheck(this, webidl.is.EventSource); return this.#readyState; } /** @@ -55472,6 +56225,7 @@ var require_eventsource2 = __commonJS({ * @returns {string} */ get url() { + webidl.brandCheck(this, webidl.is.EventSource); return this.#url; } /** @@ -55479,6 +56233,7 @@ var require_eventsource2 = __commonJS({ * instantiated with CORS credentials set (true), or not (false, the default). */ get withCredentials() { + webidl.brandCheck(this, webidl.is.EventSource); return this.#withCredentials; } #connect() { @@ -55518,6 +56273,7 @@ var require_eventsource2 = __commonJS({ this.#state.origin = response.urlList[response.urlList.length - 1].origin; const eventSourceStream = new EventSourceStream({ eventSourceSettings: this.#state, + maxEventSize: this.#dispatcher.eventSourceOptions?.maxEventSize, push: (event) => { this.dispatchEvent(createFastMessageEvent( event.type, @@ -55548,8 +56304,12 @@ var require_eventsource2 = __commonJS({ this.dispatchEvent(new Event("error")); setTimeout(() => { if (this.#readyState !== CONNECTING) return; + this.#request.headersList.delete("last-event-id", true); if (this.#state.lastEventId.length) { - this.#request.headersList.set("last-event-id", this.#state.lastEventId, true); + const lastEventId = isomorphicDecode(textEncoder.encode(this.#state.lastEventId)); + if (isValidHeaderValue(lastEventId)) { + this.#request.headersList.set("last-event-id", lastEventId, true); + } } this.#connect(); }, this.#state.reconnectionTime)?.unref(); @@ -55559,16 +56319,18 @@ var require_eventsource2 = __commonJS({ * CLOSED. */ close() { - webidl.brandCheck(this, _EventSource); + webidl.brandCheck(this, webidl.is.EventSource); if (this.#readyState === CLOSED) return; this.#readyState = CLOSED; this.#controller.abort(); this.#request = null; } get onopen() { + webidl.brandCheck(this, webidl.is.EventSource); return this.#events.open; } set onopen(fn) { + webidl.brandCheck(this, webidl.is.EventSource); if (this.#events.open) { this.removeEventListener("open", this.#events.open); } @@ -55581,9 +56343,11 @@ var require_eventsource2 = __commonJS({ } } get onmessage() { + webidl.brandCheck(this, webidl.is.EventSource); return this.#events.message; } set onmessage(fn) { + webidl.brandCheck(this, webidl.is.EventSource); if (this.#events.message) { this.removeEventListener("message", this.#events.message); } @@ -55596,9 +56360,11 @@ var require_eventsource2 = __commonJS({ } } get onerror() { + webidl.brandCheck(this, webidl.is.EventSource); return this.#events.error; } set onerror(fn) { + webidl.brandCheck(this, webidl.is.EventSource); if (this.#events.error) { this.removeEventListener("error", this.#events.error); } @@ -55610,6 +56376,11 @@ var require_eventsource2 = __commonJS({ this.#events.error = null; } } + static { + webidl.is.EventSource = (arg) => { + return arg != null && typeof arg === "object" && #events in arg; + }; + } }; var constantsPropertyDescriptors = { CONNECTING: { @@ -55654,7 +56425,8 @@ var require_eventsource2 = __commonJS({ { key: "dispatcher", // undici only - converter: webidl.converters.any + converter: webidl.converters.any, + defaultValue: () => getGlobalDispatcher() }, { key: "node", diff --git a/dist/update-known-checksums/index.cjs b/dist/update-known-checksums/index.cjs index 87ed673..7e8e47b 100644 --- a/dist/update-known-checksums/index.cjs +++ b/dist/update-known-checksums/index.cjs @@ -19752,6 +19752,8 @@ var require_symbols6 = __commonJS({ kDestroy: /* @__PURE__ */ Symbol("destroy"), kDispatch: /* @__PURE__ */ Symbol("dispatch"), kUrl: /* @__PURE__ */ Symbol("url"), + kRequestOrigin: /* @__PURE__ */ Symbol("request origin"), + kOriginless: /* @__PURE__ */ Symbol("originless"), kWriting: /* @__PURE__ */ Symbol("writing"), kResuming: /* @__PURE__ */ Symbol("resuming"), kQueue: /* @__PURE__ */ Symbol("queue"), @@ -21086,37 +21088,6 @@ var require_util9 = __commonJS({ bytesRead: socket.bytesRead }; } - function ReadableStreamFrom(iterable) { - let iterator; - return new ReadableStream( - { - start() { - iterator = iterable[Symbol.asyncIterator](); - }, - pull(controller) { - return iterator.next().then(({ done, value }) => { - if (done) { - return queueMicrotask(() => { - controller.close(); - controller.byobRequest?.respond(0); - }); - } else { - const buf = Buffer.isBuffer(value) ? value : Buffer.from(value); - if (buf.byteLength) { - return controller.enqueue(new Uint8Array(buf)); - } else { - return this.pull(controller); - } - } - }); - }, - cancel() { - return iterator.return(); - }, - type: "bytes" - } - ); - } function isFormDataLike(object) { return object && typeof object === "object" && typeof object.append === "function" && typeof object.delete === "function" && typeof object.get === "function" && typeof object.getAll === "function" && typeof object.has === "function" && typeof object.set === "function" && object[Symbol.toStringTag] === "FormData"; } @@ -21577,7 +21548,6 @@ var require_util9 = __commonJS({ destroy, bodyLength, deepClone, - ReadableStreamFrom, isBuffer, assertRequestHandler, getSocketInfo, @@ -22146,15 +22116,32 @@ var require_request3 = __commonJS({ return false; } } - onRequestUpgrade(statusCode, headers, socket) { + /** + * @param {number} statusCode + * @param {Buffer[]|string[]|import('../../types/header.d.ts').IncomingHttpHeaders} headers + * @param {import('node:stream').Duplex} socket + * @param {string} [statusText] + */ + onRequestUpgrade(statusCode, headers, socket, statusText = "") { + this.onFinally(); assert(!this.aborted); assert(!this.completed); + if (channels.headers.hasSubscribers) { + channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }); + } const controller = this[kController]; if (controller) { controller.rawHeaders = headers; } const parsedHeaders = Array.isArray(headers) ? parseHeaders(headers) : headers; - return this[kHandler].onRequestUpgrade?.(controller, statusCode, parsedHeaders, socket); + const result = this[kHandler].onRequestUpgrade?.(controller, statusCode, parsedHeaders, socket); + if (!this.aborted) { + this.completed = true; + if (channels.trailers.hasSubscribers) { + channels.trailers.publish({ request: this, trailers: [] }); + } + } + return result; } onResponseEnd(trailers) { this.onFinally(); @@ -22298,6 +22285,7 @@ var require_dispatcher2 = __commonJS({ "node_modules/undici/lib/dispatcher/dispatcher.js"(exports2, module2) { "use strict"; var EventEmitter = require("node:events"); + var { kOriginless, kUrl } = require_symbols6(); var Dispatcher = class extends EventEmitter { dispatch() { throw new Error("not implemented"); @@ -22310,6 +22298,7 @@ var require_dispatcher2 = __commonJS({ } compose(...args) { const interceptors = Array.isArray(args[0]) ? args[0] : args; + const interceptorOrigin = this[kOriginless] === true ? null : this[kUrl]?.origin; let dispatch = this.dispatch.bind(this); for (const interceptor of interceptors) { if (interceptor == null) { @@ -22318,11 +22307,19 @@ var require_dispatcher2 = __commonJS({ if (typeof interceptor !== "function") { throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`); } - dispatch = interceptor(dispatch); + dispatch = interceptor(dispatch, interceptorOrigin); if (dispatch == null || typeof dispatch !== "function" || dispatch.length !== 2) { throw new TypeError("invalid interceptor"); } } + const originalDispatch = dispatch; + const self = this; + dispatch = function(opts, handler) { + if (opts && typeof opts === "object" && !opts.origin && self[kUrl]) { + opts = Object.assign({}, opts, { origin: self[kUrl].origin }); + } + return originalDispatch(opts, handler); + }; return new Proxy(this, { get: (target, key) => key === "dispatch" ? dispatch : target[key] }); @@ -22336,6 +22333,7 @@ var require_dispatcher2 = __commonJS({ var require_dispatcher_base2 = __commonJS({ "node_modules/undici/lib/dispatcher/dispatcher-base.js"(exports2, module2) { "use strict"; + var buffer = require("node:buffer"); var Dispatcher = require_dispatcher2(); var { ClientDestroyedError, @@ -22346,6 +22344,7 @@ var require_dispatcher_base2 = __commonJS({ var kOnDestroyed = /* @__PURE__ */ Symbol("onDestroyed"); var kOnClosed = /* @__PURE__ */ Symbol("onClosed"); var kWebSocketOptions = /* @__PURE__ */ Symbol("webSocketOptions"); + var kEventSourceOptions = /* @__PURE__ */ Symbol("eventSourceOptions"); var DispatcherBase = class extends Dispatcher { /** @type {boolean} */ [kDestroyed] = false; @@ -22361,9 +22360,10 @@ var require_dispatcher_base2 = __commonJS({ constructor(opts) { super(); this[kWebSocketOptions] = opts?.webSocket ?? {}; + this[kEventSourceOptions] = opts?.eventSource ?? {}; } /** - * @returns {import('../../types/dispatcher').WebSocketOptions} + * @returns {import('../../types/client').Client.WebSocketOptions} */ get webSocketOptions() { return { @@ -22372,6 +22372,14 @@ var require_dispatcher_base2 = __commonJS({ // 128 MB default }; } + /** + * @returns {import('../../types/client').Client.EventSourceOptions} + */ + get eventSourceOptions() { + return { + maxEventSize: this[kEventSourceOptions].maxEventSize ?? buffer.kStringMaxLength + }; + } /** @returns {boolean} */ get destroyed() { return this[kDestroyed]; @@ -23661,6 +23669,10 @@ var require_infra = __commonJS({ assert(!invalidIsomorphicEncodeValueRegex.test(input)); return input; } + var nonASCIIRegex = /[^\x00-\x7F]/; + function asciiLowercase(str) { + return nonASCIIRegex.test(str) ? str.replace(/[A-Z]+/g, (upper) => upper.toLowerCase()) : str.toLowerCase(); + } function parseJSONFromBytes(bytes) { return JSON.parse(utf8DecodeBytes(bytes)); } @@ -23674,7 +23686,7 @@ var require_infra = __commonJS({ while (lead < str.length && predicate(str.charCodeAt(lead))) lead++; } if (trailing) { - while (trail > 0 && predicate(str.charCodeAt(trail))) trail--; + while (trail >= lead && predicate(str.charCodeAt(trail))) trail--; } return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1); } @@ -23687,6 +23699,7 @@ var require_infra = __commonJS({ return result; } module2.exports = { + asciiLowercase, collectASequenceOfCodePoints, collectASequenceOfCodePointsFast, forgivingBase64, @@ -23706,9 +23719,9 @@ var require_data_url2 = __commonJS({ "node_modules/undici/lib/web/fetch/data-url.js"(exports2, module2) { "use strict"; var assert = require("node:assert"); - var { forgivingBase64, collectASequenceOfCodePoints, collectASequenceOfCodePointsFast, isomorphicDecode, removeASCIIWhitespace, removeChars } = require_infra(); + var { asciiLowercase, forgivingBase64, collectASequenceOfCodePoints, collectASequenceOfCodePointsFast, isomorphicDecode, removeASCIIWhitespace, removeChars } = require_infra(); var encoder = new TextEncoder(); - var HTTP_TOKEN_CODEPOINTS = /^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u; + var HTTP_TOKEN_CODEPOINTS = /^[-!#$%&'*+.^_`|~A-Za-z0-9]+$/u; var HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/u; var HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u; function dataURLProcessor(dataURL) { @@ -23729,7 +23742,7 @@ var require_data_url2 = __commonJS({ position.position++; const encodedBody = input.slice(mimeTypeLength + 1); let body = stringPercentDecode(encodedBody); - if (/;(?:\u0020*)base64$/ui.test(mimeType)) { + if (/;\u0020*[Bb][Aa][Ss][Ee]64$/u.test(mimeType)) { const stringBody = isomorphicDecode(body); body = forgivingBase64(stringBody); if (body === "failure") { @@ -23816,8 +23829,8 @@ var require_data_url2 = __commonJS({ if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) { return "failure"; } - const typeLowercase = type.toLowerCase(); - const subtypeLowercase = subtype.toLowerCase(); + const typeLowercase = asciiLowercase(type); + const subtypeLowercase = asciiLowercase(subtype); const mimeType = { type: typeLowercase, subtype: subtypeLowercase, @@ -23839,7 +23852,7 @@ var require_data_url2 = __commonJS({ input, position ); - parameterName = parameterName.toLowerCase(); + parameterName = asciiLowercase(parameterName); if (position.position < input.length) { if (input[position.position] === ";") { continue; @@ -24019,23 +24032,13 @@ var require_webidl2 = __commonJS({ message: `"${context.value}" is an invalid ${context.type}.` }); }; - webidl.brandCheck = function(V, I) { - if (!FunctionPrototypeSymbolHasInstance(I, V)) { + webidl.brandCheck = function(V, is) { + if (!is(V)) { const err = new TypeError("Illegal invocation"); err.code = "ERR_INVALID_THIS"; throw err; } }; - webidl.brandCheckMultiple = function(List) { - const prototypes = List.map((c) => webidl.util.MakeTypeAssertion(c)); - return (V) => { - if (prototypes.every((typeCheck) => !typeCheck(V))) { - const err = new TypeError("Illegal invocation"); - err.code = "ERR_INVALID_THIS"; - throw err; - } - }; - }; webidl.argumentLengthCheck = function({ length }, min, ctx) { if (length < min) { throw webidl.errors.exception({ @@ -24591,7 +24594,7 @@ var require_util10 = __commonJS({ var { getGlobalOrigin } = require_global3(); var { collectAnHTTPQuotedString, parseMIMEType } = require_data_url2(); var { performance: performance2 } = require("node:perf_hooks"); - var { ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util9(); + var { isValidHTTPToken, normalizedMethodRecordsBase } = require_util9(); var assert = require("node:assert"); var { isUint8Array } = require("node:util/types"); var { webidl } = require_webidl2(); @@ -24688,6 +24691,9 @@ var require_util10 = __commonJS({ return "success"; } function appendFetchMetadata(httpRequest) { + if (!isURLPotentiallyTrustworthy(requestCurrentURL(httpRequest))) { + return; + } let header = null; header = httpRequest.mode; httpRequest.headersList.set("sec-fetch-mode", header, true); @@ -24984,7 +24990,7 @@ var require_util10 = __commonJS({ return new FastIterableIterator(target, kind); }; } - function iteratorMixin(name, object, kInternalIterator, keyIndex = 0, valueIndex = 1) { + function iteratorMixin(name, object, kInternalIterator, keyIndex = 0, valueIndex = 1, brandCheck) { const makeIterator = createIterator(name, kInternalIterator, keyIndex, valueIndex); const properties = { keys: { @@ -24992,7 +24998,7 @@ var require_util10 = __commonJS({ enumerable: true, configurable: true, value: function keys() { - webidl.brandCheck(this, object); + webidl.brandCheck(this, brandCheck); return makeIterator(this, "key"); } }, @@ -25001,7 +25007,7 @@ var require_util10 = __commonJS({ enumerable: true, configurable: true, value: function values() { - webidl.brandCheck(this, object); + webidl.brandCheck(this, brandCheck); return makeIterator(this, "value"); } }, @@ -25010,7 +25016,7 @@ var require_util10 = __commonJS({ enumerable: true, configurable: true, value: function entries() { - webidl.brandCheck(this, object); + webidl.brandCheck(this, brandCheck); return makeIterator(this, "key+value"); } }, @@ -25019,7 +25025,7 @@ var require_util10 = __commonJS({ enumerable: true, configurable: true, value: function forEach(callbackfn, thisArg = globalThis) { - webidl.brandCheck(this, object); + webidl.brandCheck(this, brandCheck); webidl.argumentLengthCheck(arguments, 1, `${name}.forEach`); if (typeof callbackfn !== "function") { throw new TypeError( @@ -25300,7 +25306,6 @@ var require_util10 = __commonJS({ isAborted, isCancelled, isValidEncodedURL, - ReadableStreamFrom, tryUpgradeRequestToAPotentiallyTrustworthyURL, clampAndCoarsenConnectionTimingInfo, coarsenedSharedCurrentTime, @@ -25433,7 +25438,10 @@ var require_formdata2 = __commonJS({ var nodeUtil = require("node:util"); var { runtimeFeatures } = require_runtime_features(); var random = runtimeFeatures.has("crypto") ? require("node:crypto").randomInt : (max) => Math.floor(Math.random() * max); - var FormData = class _FormData { + var getFormDataState; + var setFormDataState; + var getFormDataBoundary; + var FormData = class { #state = []; #boundary = null; constructor(form = void 0) { @@ -25447,7 +25455,7 @@ var require_formdata2 = __commonJS({ } } append(name, value, filename = void 0) { - webidl.brandCheck(this, _FormData); + webidl.brandCheck(this, webidl.is.FormData); const prefix = "FormData.append"; webidl.argumentLengthCheck(arguments, 2, prefix); name = webidl.converters.USVString(name); @@ -25463,14 +25471,14 @@ var require_formdata2 = __commonJS({ this.#state.push(entry); } delete(name) { - webidl.brandCheck(this, _FormData); + webidl.brandCheck(this, webidl.is.FormData); const prefix = "FormData.delete"; webidl.argumentLengthCheck(arguments, 1, prefix); name = webidl.converters.USVString(name); this.#state = this.#state.filter((entry) => entry.name !== name); } get(name) { - webidl.brandCheck(this, _FormData); + webidl.brandCheck(this, webidl.is.FormData); const prefix = "FormData.get"; webidl.argumentLengthCheck(arguments, 1, prefix); name = webidl.converters.USVString(name); @@ -25481,21 +25489,21 @@ var require_formdata2 = __commonJS({ return this.#state[idx].value; } getAll(name) { - webidl.brandCheck(this, _FormData); + webidl.brandCheck(this, webidl.is.FormData); const prefix = "FormData.getAll"; webidl.argumentLengthCheck(arguments, 1, prefix); name = webidl.converters.USVString(name); return this.#state.filter((entry) => entry.name === name).map((entry) => entry.value); } has(name) { - webidl.brandCheck(this, _FormData); + webidl.brandCheck(this, webidl.is.FormData); const prefix = "FormData.has"; webidl.argumentLengthCheck(arguments, 1, prefix); name = webidl.converters.USVString(name); return this.#state.findIndex((entry) => entry.name === name) !== -1; } set(name, value, filename = void 0) { - webidl.brandCheck(this, _FormData); + webidl.brandCheck(this, webidl.is.FormData); const prefix = "FormData.set"; webidl.argumentLengthCheck(arguments, 2, prefix); name = webidl.converters.USVString(name); @@ -25537,34 +25545,20 @@ var require_formdata2 = __commonJS({ const output = nodeUtil.formatWithOptions(options, state); return `FormData ${output.slice(output.indexOf("]") + 2)}`; } - /** - * @param {FormData} formData - */ - static getFormDataState(formData) { - return formData.#state; - } - /** - * @param {FormData} formData - * @param {any[]} newState - */ - static setFormDataState(formData, newState) { - formData.#state = newState; - } - /** - * @param {FormData} formData - * @returns {string | null} - */ - static getFormDataBoundary(formData) { - const boundary = formData.#boundary; - if (boundary != null) return boundary; - return formData.#boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`; + static { + getFormDataState = (formData) => formData.#state; + setFormDataState = (formData, newState) => { + formData.#state = newState; + }; + getFormDataBoundary = (formData) => { + return formData.#boundary ??= `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`; + }; + webidl.is.FormData = (arg) => { + return arg != null && typeof arg === "object" && #state in arg; + }; } }; - var { getFormDataState, setFormDataState, getFormDataBoundary } = FormData; - Reflect.deleteProperty(FormData, "getFormDataState"); - Reflect.deleteProperty(FormData, "setFormDataState"); - Reflect.deleteProperty(FormData, "getFormDataBoundary"); - iteratorMixin("FormData", FormData, getFormDataState, "name", "value"); + iteratorMixin("FormData", FormData, getFormDataState, "name", "value", webidl.is.FormData); Object.defineProperties(FormData.prototype, { append: kEnumerableProperty, delete: kEnumerableProperty, @@ -25593,7 +25587,6 @@ var require_formdata2 = __commonJS({ } return { name, value }; } - webidl.is.FormData = webidl.util.MakeTypeAssertion(FormData); module2.exports = { FormData, makeEntry, setFormDataState, getFormDataBoundary }; } }); @@ -25934,7 +25927,6 @@ var require_body2 = __commonJS({ "use strict"; var util = require_util9(); var { - ReadableStreamFrom, readableStreamClose, fullyReadBody, extractMimeType @@ -26054,7 +26046,14 @@ Content-Type: ${value.type || "application/octet-stream"}\r "Response body object should not be disturbed or locked" ); } - stream = webidl.is.ReadableStream(object) ? object : ReadableStreamFrom(object); + stream = webidl.is.ReadableStream(object) ? object : ReadableStream.from(object).pipeThrough(new TransformStream({ + transform(chunk, controller2) { + const bytes = isUint8Array(chunk) ? chunk : Buffer.from(chunk); + if (bytes.byteLength) { + controller2.enqueue(bytes); + } + } + })); } if (typeof source === "string" || isUint8Array(source)) { action = () => { @@ -26099,7 +26098,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r source: body.source }; } - function bodyMixinMethods(instance, getInternalState) { + function bodyMixinMethods(brandCheck, getInternalState) { const methods = { blob() { return consumeBody(this, (bytes) => { @@ -26110,18 +26109,18 @@ Content-Type: ${value.type || "application/octet-stream"}\r mimeType = serializeAMimeType(mimeType); } return new Blob([bytes], { type: mimeType }); - }, instance, getInternalState); + }, brandCheck, getInternalState); }, arrayBuffer() { return consumeBody(this, (bytes) => { return new Uint8Array(bytes).buffer; - }, instance, getInternalState); + }, brandCheck, getInternalState); }, text() { - return consumeBody(this, utf8DecodeBytes, instance, getInternalState); + return consumeBody(this, utf8DecodeBytes, brandCheck, getInternalState); }, json() { - return consumeBody(this, parseJSONFromBytes, instance, getInternalState); + return consumeBody(this, parseJSONFromBytes, brandCheck, getInternalState); }, formData() { return consumeBody(this, (value) => { @@ -26147,12 +26146,12 @@ Content-Type: ${value.type || "application/octet-stream"}\r throw new TypeError( 'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".' ); - }, instance, getInternalState); + }, brandCheck, getInternalState); }, bytes() { return consumeBody(this, (bytes) => { return new Uint8Array(bytes); - }, instance, getInternalState); + }, brandCheck, getInternalState); }, textStream() { const this_ = getInternalState(this); @@ -26180,12 +26179,12 @@ Content-Type: ${value.type || "application/octet-stream"}\r }; return methods; } - function mixinBody(prototype, getInternalState) { - Object.assign(prototype.prototype, bodyMixinMethods(prototype, getInternalState)); + function mixinBody(prototype, getInternalState, brandCheck) { + Object.assign(prototype.prototype, bodyMixinMethods(brandCheck, getInternalState)); } - function consumeBody(object, convertBytesToJSValue, instance, getInternalState) { + function consumeBody(object, convertBytesToJSValue, brandCheck, getInternalState) { try { - webidl.brandCheck(object, instance); + webidl.brandCheck(object, brandCheck); } catch (e) { return Promise.reject(e); } @@ -26299,7 +26298,13 @@ var require_client_h12 = __commonJS({ function lazyllhttp() { const llhttpWasmData = process.env.JEST_WORKER_ID ? require_llhttp_wasm2() : void 0; let mod; - let useWasmSIMD = process.arch !== "ppc64"; + let useWasmSIMD = true; + if (process.arch === "ppc64") { + const [major, minor] = process.versions.node.split(".").map((n) => parseInt(n, 10)); + if (major < 24 || major === 24 && minor < 12) { + useWasmSIMD = false; + } + } if (process.env.UNDICI_NO_WASM_SIMD === "1") { useWasmSIMD = false; } else if (process.env.UNDICI_NO_WASM_SIMD === "0") { @@ -26674,7 +26679,7 @@ var require_client_h12 = __commonJS({ * @param {Buffer} head */ onUpgrade(head) { - const { upgrade, client, socket, headers, statusCode } = this; + const { upgrade, client, socket, headers, statusCode, statusText } = this; assert(upgrade); assert(client[kSocket] === socket); assert(!socket.destroyed); @@ -26699,8 +26704,9 @@ var require_client_h12 = __commonJS({ client[kQueue][client[kRunningIdx]++] = null; client.emit("disconnect", client[kUrl], [client], new InformationalError("upgrade")); try { - request.onRequestUpgrade(statusCode, headers, socket); + request.onRequestUpgrade(statusCode, headers, socket, statusText); } catch (err) { + util.errorRequest(client, request, err); util.destroy(socket, err); } client[kResume](); @@ -27031,21 +27037,20 @@ var require_client_h12 = __commonJS({ } function clearIdleSocketValidation(socket) { if (socket[kIdleSocketValidationTimeout]) { - clearTimeout(socket[kIdleSocketValidationTimeout]); + clearImmediate(socket[kIdleSocketValidationTimeout]); socket[kIdleSocketValidationTimeout] = null; } socket[kIdleSocketValidation] = 0; } function scheduleIdleSocketValidation(client, socket) { socket[kIdleSocketValidation] = 1; - socket[kIdleSocketValidationTimeout] = setTimeout(() => { + socket[kIdleSocketValidationTimeout] = setImmediate(() => { socket[kIdleSocketValidationTimeout] = null; socket[kIdleSocketValidation] = 2; if (client[kSocket] === socket && !socket.destroyed) { client[kResume](); } - }, 0); - socket[kIdleSocketValidationTimeout].unref?.(); + }); } function resumeH1(client) { const socket = client[kSocket]; @@ -27547,12 +27552,14 @@ var require_client_h22 = __commonJS({ var util = require_util9(); var { RequestContentLengthMismatchError, + ResponseContentLengthMismatchError, RequestAbortedError, SocketError, InformationalError, InvalidArgumentError, HeadersTimeoutError, - BodyTimeoutError + BodyTimeoutError, + ResponseExceededMaxSizeError } = require_errors2(); var { kUrl, @@ -27581,7 +27588,8 @@ var require_client_h22 = __commonJS({ kRemoteSettings, kHTTP2Stream, kHTTP2SessionState, - kHTTP2Options + kHTTP2Options, + kMaxResponseSize } = require_symbols6(); var { channels } = require_diagnostics2(); var kOpenStreams = /* @__PURE__ */ Symbol("open streams"); @@ -27694,6 +27702,10 @@ var require_client_h22 = __commonJS({ const { body } = request; return body == null || util.isBuffer(body) || util.isBlobLike(body); } + function hasResponseStarted(request) { + const state = request[kRequestStream]?.[kRequestStreamState]; + return state?.responseReceived === true; + } function registerGoAwayRefusal(request) { const attempts = (request[kGoAwayReplayAttempts] ?? 0) + 1; request[kGoAwayReplayAttempts] = attempts; @@ -27850,7 +27862,7 @@ var require_client_h22 = __commonJS({ const socket = client[kSocket]; const session = client[kHTTP2Session]; if (socket?.destroyed === false) { - if (client[kSize] === 0 || client[kMaxConcurrentStreams] === 0) { + if (session[kOpenStreams] === 0 && client[kSize] === 0) { unrefH2Session(session); } else { refH2Session(session); @@ -28007,8 +28019,9 @@ var require_client_h22 = __commonJS({ for (let i = pendingIdx; i < previousPendingIdx; i++) { const request = client[kQueue][i]; if (request != null) { + const responseStarted = hasResponseStarted(request); streamsToClose.push(detachRequestStreamForClose(request)); - if (canReplayRequest(request) && registerGoAwayRefusal(request)) { + if (!responseStarted && canReplayRequest(request) && registerGoAwayRefusal(request)) { retriableRequests.push(request); } else { util.errorRequest(client, request, err); @@ -28100,9 +28113,10 @@ var require_client_h22 = __commonJS({ } function closeStreamSession(stream) { const session = stream[kHTTP2Session]; + const client = session[kClient]; stream[kHTTP2Session] = null; session[kOpenStreams] -= 1; - if (session[kOpenStreams] === 0) { + if (session[kOpenStreams] === 0 && (client[kSize] === 0 || session[kReceivedGoAway])) { unrefH2Session(session); setHttp2IdleTimeout(session); } @@ -28217,8 +28231,13 @@ var require_client_h22 = __commonJS({ state.responseReceived = true; const statusCode = headers[HTTP2_HEADER_STATUS]; delete headers[HTTP2_HEADER_STATUS]; - request.onRequestUpgrade(statusCode, headers, stream); - if (request.aborted || request.completed) { + try { + request.onRequestUpgrade(statusCode, headers, stream); + } catch (err) { + state.abort(err); + return; + } + if (request.aborted) { return; } removeUpgradeStreamListeners(stream); @@ -28285,13 +28304,16 @@ var require_client_h22 = __commonJS({ const state = { abort: null, body: request.body, + bytesRead: 0, client, contentLength: null, expectsPayload: false, + maxResponseSize: client[kMaxResponseSize], request, headersTimeout, bodyTimeout, requestFinalized: false, + responseContentLength: null, responseReceived: false, bodySent: false, pendingEnd: false, @@ -28426,6 +28448,7 @@ var require_client_h22 = __commonJS({ stream.once("continue", writeBodyH2); } stream.on("response", onResponse); + stream.on("headers", onInterimResponse); stream.on("end", onEnd); stream.on("error", onError); stream.on("frameError", onFrameError); @@ -28443,6 +28466,7 @@ var require_client_h22 = __commonJS({ stream.off("error", noop); stream.off("continue", writeBodyH2); stream.off("response", onResponse); + stream.off("headers", onInterimResponse); stream.off("end", onEnd); stream.off("error", onError); stream.off("frameError", onFrameError); @@ -28469,6 +28493,29 @@ var require_client_h22 = __commonJS({ } } function onData(chunk) { + const stream = this; + const state = stream[kRequestStreamState]; + if (state == null) { + return; + } + const { request, maxResponseSize, responseContentLength } = state; + if (request.aborted || request.completed) { + return; + } + if (responseContentLength != null && state.bytesRead + chunk.length > responseContentLength) { + state.abort(new ResponseContentLengthMismatchError()); + return; + } + if (maxResponseSize > -1 && state.bytesRead + chunk.length > maxResponseSize) { + state.abort(new ResponseExceededMaxSizeError()); + return; + } + state.bytesRead += chunk.length; + if (request.onResponseData(chunk) === false) { + stream.pause(); + } + } + function onInterimResponse(headers) { const stream = this; const state = stream[kRequestStreamState]; if (state == null) { @@ -28478,9 +28525,9 @@ var require_client_h22 = __commonJS({ if (request.aborted || request.completed) { return; } - if (request.onResponseData(chunk) === false) { - stream.pause(); - } + const statusCode = headers[HTTP2_HEADER_STATUS]; + delete headers[HTTP2_HEADER_STATUS]; + request.onResponseStart(Number(statusCode), headers, noop, ""); } function onResponse(headers) { const stream = this; @@ -28494,10 +28541,14 @@ var require_client_h22 = __commonJS({ stream.removeListener("continue", writeBodyH2); stream.end(); } - const statusCode = headers[HTTP2_HEADER_STATUS]; + const statusCode = Number(headers[HTTP2_HEADER_STATUS]); delete headers[HTTP2_HEADER_STATUS]; request.onResponseStarted(); state.responseReceived = true; + if (request.method !== "HEAD" && statusCode !== 304) { + const contentLength = headers[HTTP2_HEADER_CONTENT_LENGTH]; + state.responseContentLength = contentLength == null ? null : Number(contentLength); + } if (state.headersTimeout || state.bodyTimeout) { stream.setTimeout(state.bodyTimeout); } @@ -28505,7 +28556,7 @@ var require_client_h22 = __commonJS({ releaseRequestStream(stream); return; } - if (request.onResponseStart(Number(statusCode), headers, stream.resume.bind(stream), "") === false) { + if (request.onResponseStart(statusCode, headers, stream.resume.bind(stream), "") === false) { stream.pause(); } stream.on("data", onData); @@ -28520,6 +28571,10 @@ var require_client_h22 = __commonJS({ stream.off("end", onEnd); if (state.responseReceived) { if (!request.aborted && !request.completed) { + if (state.responseContentLength != null && state.bytesRead !== state.responseContentLength) { + state.abort(new ResponseContentLengthMismatchError()); + return; + } state.pendingEnd = true; completeRequestStream.call(stream); } @@ -28548,6 +28603,9 @@ var require_client_h22 = __commonJS({ return; } stream.off("error", onError); + if (state.responseContentLength != null && state.bytesRead !== state.responseContentLength) { + err = new ResponseContentLengthMismatchError(); + } if (typeof stream.rstCode === "number" && stream.rstCode !== NGHTTP2_NO_ERROR) { err.http2ErrorCode = stream.rstCode; } @@ -28901,7 +28959,8 @@ var require_client2 = __commonJS({ connectionWindowSize, pingInterval, webSocket, - h2Options + h2Options, + eventSource } = {}) { if (keepAlive !== void 0) { throw new InvalidArgumentError("unsupported keepAlive, use pipelining=0 instead"); @@ -28972,7 +29031,7 @@ var require_client2 = __commonJS({ if (h2Options.settings?.initialWindowSize != null && (!Number.isInteger(h2Options.settings.initialWindowSize) || h2Options.settings.initialWindowSize < 1)) { throw new InvalidArgumentError("h2Options.settings.initialWindowSize must be a positive integer, greater than 0"); } - if (h2Options.maxConcurrentStreams != null && (!Number.isInteger(h2Options.connectionWindowSize) || h2Options.maxConcurrentStreams < 1)) { + if (h2Options.maxConcurrentStreams != null && (!Number.isInteger(h2Options.maxConcurrentStreams) || h2Options.maxConcurrentStreams < 1)) { throw new InvalidArgumentError("h2Options.maxConcurrentStreams must be a positive integer, greater than 0"); } if (h2Options.connectionWindowSize != null && (!Number.isInteger(h2Options.connectionWindowSize) || h2Options.connectionWindowSize < 1)) { @@ -29004,7 +29063,7 @@ var require_client2 = __commonJS({ } } } - super({ webSocket }); + super({ webSocket, eventSource }); if (typeof connect2 !== "function") { connect2 = buildConnector({ ...tls, @@ -29453,6 +29512,9 @@ var require_pool_base2 = __commonJS({ var kOnConnect = /* @__PURE__ */ Symbol("onConnect"); var kOnDisconnect = /* @__PURE__ */ Symbol("onDisconnect"); var kOnConnectionError = /* @__PURE__ */ Symbol("onConnectionError"); + var kOnClientBusy = /* @__PURE__ */ Symbol("on client busy"); + var kOnClientDrain = /* @__PURE__ */ Symbol("on client drain"); + var kDrainQueue = /* @__PURE__ */ Symbol("drain queue"); var kGetDispatcher = /* @__PURE__ */ Symbol("get dispatcher"); var kHasDispatcher = /* @__PURE__ */ Symbol("has dispatcher"); var kAddClient = /* @__PURE__ */ Symbol("add client"); @@ -29463,8 +29525,12 @@ var require_pool_base2 = __commonJS({ [kClients] = []; [kNeedDrain] = false; [kOnDrain](client, origin, targets) { + if (client.closed || client.destroyed) { + return; + } const queue = this[kQueue]; let needDrain = false; + this[kOnClientDrain](client); while (!needDrain) { const item = queue.shift(); if (!item) { @@ -29474,6 +29540,9 @@ var require_pool_base2 = __commonJS({ needDrain = !client.dispatch(item.opts, item.handler); } client[kNeedDrain] = needDrain; + if (needDrain) { + this[kOnClientBusy](client); + } if (!needDrain && this[kNeedDrain]) { this[kNeedDrain] = false; this.emit("drain", origin, [this, ...targets]); @@ -29489,6 +29558,45 @@ var require_pool_base2 = __commonJS({ return Promise.all(closeAll).then(this[kClosedResolve]); } } + [kOnClientBusy]() { + } + [kOnClientDrain]() { + } + [kDrainQueue](origin, targets) { + const queue = this[kQueue]; + let hasDispatcher = true; + while (!queue.isEmpty()) { + const dispatcher = this[kGetDispatcher](); + if (!dispatcher) { + hasDispatcher = false; + break; + } + const item = queue.shift(); + this[kQueued]--; + if (!dispatcher.dispatch(item.opts, item.handler)) { + dispatcher[kNeedDrain] = true; + this[kOnClientBusy](dispatcher); + hasDispatcher = this[kHasDispatcher](); + if (!hasDispatcher) { + break; + } + } + } + if (hasDispatcher && this[kNeedDrain]) { + this[kNeedDrain] = false; + this.emit("drain", origin, [this, ...targets]); + } + if (this[kClosedResolve] && queue.isEmpty()) { + const closeAll = []; + for (let i = 0; i < this[kClients].length; i++) { + const client = this[kClients][i]; + if (!client.destroyed) { + closeAll.push(client.close()); + } + } + return Promise.all(closeAll).then(this[kClosedResolve]); + } + } [kOnConnect] = (origin, targets) => { this.emit("connect", origin, [this, ...targets]); }; @@ -29577,6 +29685,7 @@ var require_pool_base2 = __commonJS({ this[kQueued]++; } else if (!dispatcher.dispatch(opts, handler)) { dispatcher[kNeedDrain] = true; + this[kOnClientBusy](dispatcher); this[kNeedDrain] = !this[kHasDispatcher](); } return !this[kNeedDrain]; @@ -29595,7 +29704,7 @@ var require_pool_base2 = __commonJS({ this[kClients].push(client); if (this[kNeedDrain]) { queueMicrotask(() => { - if (this[kNeedDrain]) { + if (this[kNeedDrain] && !client[kNeedDrain]) { this[kOnDrain](client, client[kUrl], [client, this]); } }); @@ -29618,6 +29727,9 @@ var require_pool_base2 = __commonJS({ kNeedDrain, kAddClient, kRemoveClient, + kDrainQueue, + kOnClientBusy, + kOnClientDrain, kGetDispatcher, kHasDispatcher }; @@ -29633,6 +29745,9 @@ var require_pool2 = __commonJS({ kClients, kNeedDrain, kAddClient, + kDrainQueue, + kOnClientBusy, + kOnClientDrain, kGetDispatcher, kHasDispatcher, kRemoveClient @@ -29642,14 +29757,27 @@ var require_pool2 = __commonJS({ InvalidArgumentError } = require_errors2(); var util = require_util9(); - var { kUrl } = require_symbols6(); + var { kConnecting, kHTTPContext, kUrl } = require_symbols6(); var buildConnector = require_connect2(); var kOptions = /* @__PURE__ */ Symbol("options"); var kConnections = /* @__PURE__ */ Symbol("connections"); var kFactory = /* @__PURE__ */ Symbol("factory"); + var kProtocol = /* @__PURE__ */ Symbol("protocol"); + var kProtocolProbe = /* @__PURE__ */ Symbol("protocol probe"); function defaultFactory(origin, opts) { return new Client(origin, opts); } + function shouldCreateProtocolProbe(pool, dispatcher) { + return dispatcher instanceof Client && pool[kProtocol] !== "h1" && (pool[kOptions].useH2c === true || pool[kUrl].protocol === "https:" && pool[kOptions].allowH2 !== false); + } + function createClient(pool) { + const dispatcher = pool[kFactory](pool[kUrl], pool[kOptions]); + if (shouldCreateProtocolProbe(pool, dispatcher)) { + pool[kProtocolProbe] = dispatcher; + } + pool[kAddClient](dispatcher); + return dispatcher; + } var Pool = class extends PoolBase { constructor(origin, { connections, @@ -29692,22 +29820,58 @@ var require_pool2 = __commonJS({ this[kUrl] = util.parseOrigin(origin); this[kOptions] = { ...util.deepClone(options), connect, allowH2, useH2c, clientTtl, socketPath }; this[kFactory] = factory; + this[kProtocol] = null; + this[kProtocolProbe] = null; this.on("connect", (origin2, targets) => { if (clientTtl != null && clientTtl > 0) { for (const target of targets) { Object.assign(target, { ttl: Date.now() }); } } + const client = targets[targets.length - 1]; + if (client instanceof Client) { + this[kProtocol] = client[kHTTPContext]?.version; + } + if (client === this[kProtocolProbe]) { + if (this[kProtocol] !== "h2") { + this[kProtocolProbe] = null; + this[kDrainQueue](origin2, targets.slice(1)); + } + } }); - this.on("connectionError", (origin2, targets, error2) => { + this.on("disconnect", (origin2, targets) => { + if (targets.includes(this[kProtocolProbe])) { + this[kProtocolProbe] = null; + this[kDrainQueue](origin2, targets.slice(1)); + } + }); + this.on("connectionError", (origin2, targets) => { + let resumeQueued = false; for (const target of targets) { + if (target === this[kProtocolProbe]) { + this[kProtocolProbe] = null; + resumeQueued = true; + } const idx = this[kClients].indexOf(target); if (idx !== -1) { this[kClients].splice(idx, 1); } } + if (resumeQueued) { + this[kDrainQueue](origin2, targets.slice(1)); + } }); } + [kOnClientBusy](client) { + if (this[kProtocolProbe] === null && client[kConnecting] && shouldCreateProtocolProbe(this, client)) { + this[kProtocolProbe] = client; + } + } + [kOnClientDrain](client) { + if (client === this[kProtocolProbe]) { + this[kProtocolProbe] = null; + } + } [kGetDispatcher]() { const clientTtlOption = this[kOptions].clientTtl; for (let i = 0; i < this[kClients].length; i++) { @@ -29719,10 +29883,11 @@ var require_pool2 = __commonJS({ return client; } } + if (this[kProtocolProbe] !== null) { + return; + } if (!this[kConnections] || this[kClients].length < this[kConnections]) { - const dispatcher = this[kFactory](this[kUrl], this[kOptions]); - this[kAddClient](dispatcher); - return dispatcher; + return createClient(this); } } [kHasDispatcher]() { @@ -29736,9 +29901,11 @@ var require_pool2 = __commonJS({ return true; } } + if (this[kProtocolProbe] !== null) { + return false; + } if (!this[kConnections] || this[kClients].length < this[kConnections]) { - const dispatcher = this[kFactory](this[kUrl], this[kOptions]); - this[kAddClient](dispatcher); + createClient(this); return true; } return false; @@ -29765,7 +29932,7 @@ var require_balanced_pool2 = __commonJS({ kGetDispatcher } = require_pool_base2(); var Pool = require_pool2(); - var { kUrl } = require_symbols6(); + var { kOriginless, kUrl } = require_symbols6(); var util = require_util9(); var kFactory = /* @__PURE__ */ Symbol("factory"); var kOptions = /* @__PURE__ */ Symbol("options"); @@ -29788,12 +29955,15 @@ var require_balanced_pool2 = __commonJS({ return new Pool(origin, opts); } var BalancedPool = class extends PoolBase { - constructor(upstreams = [], { factory = defaultFactory, ...opts } = {}) { + constructor(upstreams = [], { factory = defaultFactory, connect, tls, ...opts } = {}) { if (typeof factory !== "function") { throw new InvalidArgumentError("factory must be a function."); } - super(); - this[kOptions] = { ...util.deepClone(opts) }; + super(opts); + this[kOriginless] = true; + if (connect && typeof connect !== "function") connect = { ...connect }; + if (tls && typeof tls !== "function") tls = { ...tls }; + this[kOptions] = { ...util.deepClone(opts), connect, tls }; this[kIndex] = -1; this[kCurrentWeight] = 0; this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100; @@ -29955,7 +30125,7 @@ var require_round_robin_pool = __commonJS({ ...connect }); } - super(); + super(options); this[kConnections] = connections || null; this[kUrl] = util.parseOrigin(origin); this[kOptions] = { ...util.deepClone(options), connect, allowH2, clientTtl, socketPath }; @@ -30035,7 +30205,7 @@ var require_agent2 = __commonJS({ "node_modules/undici/lib/dispatcher/agent.js"(exports2, module2) { "use strict"; var { InvalidArgumentError, MaxOriginsReachedError } = require_errors2(); - var { kBusy, kClients, kConnected, kRunning, kClose, kDestroy, kDispatch, kUrl } = require_symbols6(); + var { kBusy, kClients, kConnected, kRunning, kPending, kClose, kDestroy, kDispatch, kUrl } = require_symbols6(); var DispatcherBase = require_dispatcher_base2(); var Pool = require_pool2(); var Client = require_client2(); @@ -30108,7 +30278,7 @@ var require_agent2 = __commonJS({ if (this[kClients].get(key) !== dispatcher) { return; } - if (dispatcher[kConnected] > 0 || dispatcher[kBusy]) { + if (dispatcher[kConnected] > 0 || dispatcher[kBusy] || dispatcher[kPending] > 0) { return; } this[kClients].delete(key); @@ -30175,6 +30345,7 @@ var require_dispatcher1_wrapper = __commonJS({ var Dispatcher = require_dispatcher2(); var { InvalidArgumentError } = require_errors2(); var { toRawHeaders } = require_util9(); + var { kOriginless, kUrl } = require_symbols6(); var LegacyHandlerWrapper = class { #handler; constructor(handler) { @@ -30226,6 +30397,8 @@ var require_dispatcher1_wrapper = __commonJS({ throw new InvalidArgumentError("Argument dispatcher must implement dispatch"); } this.#dispatcher = dispatcher; + this[kUrl] = dispatcher[kUrl]; + this[kOriginless] = dispatcher[kOriginless]; } static wrapHandler(handler) { if (!handler || typeof handler !== "object") { @@ -30237,7 +30410,7 @@ var require_dispatcher1_wrapper = __commonJS({ return new LegacyHandlerWrapper(handler); } dispatch(opts, handler) { - if (opts.allowH2 !== false) { + if (opts.upgrade && opts.allowH2 !== false) { opts = { ...opts, allowH2: false }; } return this.#dispatcher.dispatch(opts, _Dispatcher1Wrapper.wrapHandler(handler)); @@ -30754,24 +30927,33 @@ var require_socks5_proxy_agent = __commonJS({ var { URL: URL2 } = require("node:url"); var tls; var DispatcherBase = require_dispatcher_base2(); - var { InvalidArgumentError } = require_errors2(); + var { ConnectTimeoutError, InvalidArgumentError } = require_errors2(); var { Socks5Client, STATES } = require_socks5_client(); var { kBusy, kConnected, kDispatch, kClose, kDestroy } = require_symbols6(); var Pool = require_pool2(); var buildConnector = require_connect2(); + var { setupConnectTimeout } = require_util9(); var { debuglog } = require("node:util"); var debug2 = debuglog("undici:socks5-proxy"); + var DEFAULT_SOCKS5_CONNECT_TIMEOUT = 5e3; var kProxyUrl = /* @__PURE__ */ Symbol("proxy url"); var kProxyHeaders = /* @__PURE__ */ Symbol("proxy headers"); var kProxyAuth = /* @__PURE__ */ Symbol("proxy auth"); var kProxyProtocol = /* @__PURE__ */ Symbol("proxy protocol"); var kPools = /* @__PURE__ */ Symbol("pools"); var kConnector = /* @__PURE__ */ Symbol("connector"); + var kConnectTimeout = /* @__PURE__ */ Symbol("connect timeout"); var kRequestTls = /* @__PURE__ */ Symbol("request tls settings"); + var kRequestTlsTimeout = /* @__PURE__ */ Symbol("request tls timeout"); + function createConnectTimeoutError(hostname, port, timeout) { + return new ConnectTimeoutError( + `Connect Timeout Error (attempted address: ${hostname}:${port}, timeout: ${timeout}ms)` + ); + } var experimentalWarningEmitted = false; var Socks5ProxyAgent = class extends DispatcherBase { constructor(proxyUrl, options = {}) { - super(); + super(options); if (!experimentalWarningEmitted) { process.emitWarning( "SOCKS5 proxy support is experimental and subject to change", @@ -30789,13 +30971,29 @@ var require_socks5_proxy_agent = __commonJS({ this[kProxyUrl] = url; this[kProxyHeaders] = options.headers || {}; this[kProxyProtocol] = options.proxyTls ? "https:" : "http:"; - this[kRequestTls] = options.requestTls; + const connectTimeout = options.connectTimeout ?? DEFAULT_SOCKS5_CONNECT_TIMEOUT; + if (!Number.isFinite(connectTimeout) || connectTimeout < 0) { + throw new InvalidArgumentError("invalid connectTimeout"); + } + this[kConnectTimeout] = connectTimeout; + const { timeout, ...requestTls } = options.requestTls || {}; + const requestTlsTimeout = timeout ?? connectTimeout; + if (!Number.isFinite(requestTlsTimeout) || requestTlsTimeout < 0) { + throw new InvalidArgumentError("invalid requestTls.timeout"); + } + this[kRequestTls] = requestTls; + this[kRequestTlsTimeout] = requestTlsTimeout; this[kProxyAuth] = { username: options.username || (url.username ? decodeURIComponent(url.username) : null), password: options.password || (url.password ? decodeURIComponent(url.password) : null) }; + const proxyTlsTimeout = options.proxyTls?.timeout ?? connectTimeout; + if (!Number.isFinite(proxyTlsTimeout) || proxyTlsTimeout < 0) { + throw new InvalidArgumentError("invalid proxyTls.timeout"); + } this[kConnector] = options.connect || buildConnector({ ...options.proxyTls, + timeout: proxyTlsTimeout, servername: options.proxyTls?.servername || url.hostname }); this[kPools] = /* @__PURE__ */ new Map(); @@ -30828,17 +31026,24 @@ var require_socks5_proxy_agent = __commonJS({ }); await socks5Client.handshake(); const authenticationReady = Promise.withResolvers(); - const authenticationTimeout = setTimeout(() => { - authenticationReady.reject(new Error("SOCKS5 authentication timeout")); - }, 5e3); - const onAuthenticated = () => { + const authenticationTimeout = this[kConnectTimeout] === 0 ? null : setTimeout(() => { + cleanupAuthenticationListeners(); + socks5Client.destroy(); + authenticationReady.reject( + createConnectTimeoutError(proxyHost, proxyPort, this[kConnectTimeout]) + ); + }, this[kConnectTimeout]); + const cleanupAuthenticationListeners = () => { clearTimeout(authenticationTimeout); + socks5Client.removeListener("authenticated", onAuthenticated); socks5Client.removeListener("error", onAuthenticationError); + }; + const onAuthenticated = () => { + cleanupAuthenticationListeners(); authenticationReady.resolve(); }; const onAuthenticationError = (err) => { - clearTimeout(authenticationTimeout); - socks5Client.removeListener("authenticated", onAuthenticated); + cleanupAuthenticationListeners(); authenticationReady.reject(err); }; if (socks5Client.state === STATES.AUTHENTICATED) { @@ -30851,18 +31056,25 @@ var require_socks5_proxy_agent = __commonJS({ await authenticationReady.promise; await socks5Client.connect(targetHost, targetPort); const connectionReady = Promise.withResolvers(); - const connectionTimeout = setTimeout(() => { - connectionReady.reject(new Error("SOCKS5 connection timeout")); - }, 5e3); + const connectionTimeout = this[kConnectTimeout] === 0 ? null : setTimeout(() => { + cleanupConnectionListeners(); + socks5Client.destroy(); + connectionReady.reject( + createConnectTimeoutError(targetHost, targetPort, this[kConnectTimeout]) + ); + }, this[kConnectTimeout]); + const cleanupConnectionListeners = () => { + clearTimeout(connectionTimeout); + socks5Client.removeListener("connected", onConnected); + socks5Client.removeListener("error", onConnectionError); + }; const onConnected = (info3) => { debug2("SOCKS5 tunnel established to", targetHost, targetPort, "via", info3); - clearTimeout(connectionTimeout); - socks5Client.removeListener("error", onConnectionError); + cleanupConnectionListeners(); connectionReady.resolve(); }; const onConnectionError = (err) => { - clearTimeout(connectionTimeout); - socks5Client.removeListener("connected", onConnected); + cleanupConnectionListeners(); connectionReady.reject(err); }; socks5Client.once("connected", onConnected); @@ -30902,8 +31114,26 @@ var require_socks5_proxy_agent = __commonJS({ servername: this[kRequestTls]?.servername || targetHost }); const tlsReady = Promise.withResolvers(); - finalSocket.once("secureConnect", tlsReady.resolve); - finalSocket.once("error", tlsReady.reject); + const cleanupTlsListeners = () => { + queueMicrotask(clearTlsTimeout); + finalSocket.removeListener("secureConnect", onSecureConnect); + finalSocket.removeListener("error", onTlsError); + }; + const onSecureConnect = () => { + cleanupTlsListeners(); + tlsReady.resolve(); + }; + const onTlsError = (err) => { + cleanupTlsListeners(); + tlsReady.reject(err); + }; + const clearTlsTimeout = setupConnectTimeout(new WeakRef(finalSocket), { + timeout: this[kRequestTlsTimeout], + hostname: targetHost, + port: targetPort + }); + finalSocket.once("secureConnect", onSecureConnect); + finalSocket.once("error", onTlsError); await tlsReady.promise; } callback(null, finalSocket); @@ -30974,6 +31204,7 @@ var require_proxy_agent2 = __commonJS({ var Client = require_client2(); var { channels } = require_diagnostics2(); var Socks5ProxyAgent = require_socks5_proxy_agent(); + var { hasSafeIterator } = require_util9(); var kAgent = /* @__PURE__ */ Symbol("proxy agent"); var kClient = /* @__PURE__ */ Symbol("proxy client"); var kProxyHeaders = /* @__PURE__ */ Symbol("proxy headers"); @@ -31060,7 +31291,7 @@ var require_proxy_agent2 = __commonJS({ throw new InvalidArgumentError("Proxy opts.clientFactory must be a function."); } const { proxyTunnel, connectTimeout } = opts; - super(); + super(opts); const url = this.#getUrl(opts); const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url; this[kProxy] = { uri: href, protocol }; @@ -31093,6 +31324,7 @@ var require_proxy_agent2 = __commonJS({ factory: agentFactory, username: opts.username || username, password: opts.password || password, + connectTimeout, proxyTls: opts.proxyTls, requestTls: opts.requestTls }); @@ -31234,6 +31466,25 @@ var require_proxy_agent2 = __commonJS({ } return headersPair; } + if (headers && typeof headers === "object" && hasSafeIterator(headers)) { + const headersPair = {}; + for (const [key, value] of headers) { + if (!Object.hasOwn(headersPair, key)) { + headersPair[key] = value; + continue; + } + const previous = headersPair[key]; + const values = []; + if (previous !== void 0) { + values.push(...Array.isArray(previous) ? previous : [previous]); + } + if (value !== void 0) { + values.push(...Array.isArray(value) ? value : [value]); + } + headersPair[key] = values.length > 1 ? values : values[0]; + } + return headersPair; + } return headers; } function throwIfProxyAuthIsSent(headers) { @@ -31270,7 +31521,7 @@ var require_env_http_proxy_agent2 = __commonJS({ #noProxyEntries = null; #opts = null; constructor(opts = {}) { - super(); + super(opts); this.#opts = opts; const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts; this[kNoProxyAgent] = new Agent(agentOpts); @@ -31310,6 +31561,9 @@ var require_env_http_proxy_agent2 = __commonJS({ #getProxyAgentForUrl(url) { let { protocol, host: hostname, port } = url; hostname = hostname.replace(/:\d*$/, "").replace(/^\[(.+)\]$/, "$1").toLowerCase(); + if (hostname.length > 1 && hostname.charCodeAt(hostname.length - 1) === 46) { + hostname = hostname.slice(0, -1); + } port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0; if (!this.#shouldProxy(hostname, port)) { return this[kNoProxyAgent]; @@ -31326,15 +31580,18 @@ var require_env_http_proxy_agent2 = __commonJS({ if (this.#noProxyEntries.length === 0) { return true; } - if (this.#noProxyValue === "*") { - return false; - } for (let i = 0; i < this.#noProxyEntries.length; i++) { const entry = this.#noProxyEntries[i]; + if (entry.hostname === "*") { + if (entry.port && entry.port !== port) { + continue; + } + return false; + } if (entry.port && entry.port !== port) { continue; } - if (hostname === entry.hostname) { + if (!entry.wildcard && hostname === entry.hostname) { return false; } if (hostname.slice(-(entry.hostname.length + 1)) === `.${entry.hostname}`) { @@ -31364,10 +31621,12 @@ var require_env_http_proxy_agent2 = __commonJS({ hostname = parsed ? parsed[1] : unbracketed; port = parsed ? Number.parseInt(parsed[2], 10) : 0; } + const wildcard = entry.charCodeAt(0) === 42; noProxyEntries.push({ - // strip leading dot or asterisk with dot - hostname: hostname.replace(/^\*?\./, "").toLowerCase(), - port + // strip leading dot or asterisk with dot, and any trailing dot + hostname: hostname.replace(/^\*?\./, "").replace(/^(.+)\.$/, "$1").toLowerCase(), + port, + wildcard }); } this.#noProxyValue = noProxyValue; @@ -31393,7 +31652,7 @@ var require_retry_handler2 = __commonJS({ "use strict"; var assert = require("node:assert"); var { kRetryHandlerDefaultRetry } = require_symbols6(); - var { RequestRetryError } = require_errors2(); + var { RequestRetryError, RequestAbortedError } = require_errors2(); var { isDisturbed, parseRangeHeader, @@ -31421,32 +31680,57 @@ var require_retry_handler2 = __commonJS({ } } var RetryController = class { - constructor() { - this.target = null; + #onAbort; + #paused = false; + #target = null; + constructor(onAbort) { + this.#onAbort = onAbort; + } + set target(target) { + this.#target = target; + if (this.#paused) { + target?.pause(); + } + } + get target() { + return this.#target; } pause() { - this.target?.pause(); + this.#paused = true; + this.#target?.pause(); } resume() { - this.target?.resume(); + this.#paused = false; + this.#target?.resume(); } abort(reason) { - this.target?.abort(reason); + this.#target?.abort(reason); + this.#onAbort(reason); } get paused() { - return this.target?.paused ?? false; + return this.#paused || (this.#target?.paused ?? false); } get aborted() { - return this.target?.aborted ?? false; + return this.#target?.aborted ?? false; } get reason() { - return this.target?.reason ?? null; + return this.#target?.reason ?? null; } get rawHeaders() { - return this.target?.rawHeaders ?? null; + return this.#target?.rawHeaders ?? null; + } + set rawHeaders(value) { + if (this.#target) { + this.#target.rawHeaders = value; + } } get rawTrailers() { - return this.target?.rawTrailers ?? null; + return this.#target?.rawTrailers ?? null; + } + set rawTrailers(value) { + if (this.#target) { + this.#target.rawTrailers = value; + } } }; var RetryHandler = class _RetryHandler { @@ -31505,13 +31789,24 @@ var require_retry_handler2 = __commonJS({ this.etag = null; this.statusCode = null; this.headers = null; - this.controllerProxy = new RetryController(); + this.controllerProxy = new RetryController((reason) => this.#onAbort(reason)); + this.retryPending = false; + this.retryTimer = null; + this.pendingResponseData = null; + this.pendingResponseTrailers = null; + this.pendingResponseEnded = false; + this.aborted = false; } onResponseStartWithRetry(controller, statusCode, headers, statusMessage, err) { if (this.retryOpts.throwOnError) { if (this.retryOpts.statusCodes.includes(statusCode) === false) { - this.headersSent = true; - this.handler.onResponseStart?.(this.controllerProxy, statusCode, headers, statusMessage); + if (this.headersSent) { + this.handler.onResponseError?.(this.controllerProxy, err); + } else { + this.headersSent = true; + this.checkpointResponseEnd(headers); + this.handler.onResponseStart?.(this.controllerProxy, statusCode, headers, statusMessage); + } } else { this.error = err; } @@ -31519,28 +31814,71 @@ var require_retry_handler2 = __commonJS({ } if (isDisturbed(this.opts.body)) { this.headersSent = true; + this.checkpointResponseEnd(headers); this.handler.onResponseStart?.(this.controllerProxy, statusCode, headers, statusMessage); return; } function shouldRetry(passedErr) { + if (this.aborted) { + return; + } + this.retryPending = false; + this.retryTimer = null; + const pendingData = this.pendingResponseData; + const pendingTrailers = this.pendingResponseTrailers; + const pendingEnd = this.pendingResponseEnded; + this.pendingResponseData = null; + this.pendingResponseTrailers = null; + this.pendingResponseEnded = false; if (passedErr) { - this.headersSent = true; - this.handler.onResponseStart?.(this.controllerProxy, statusCode, headers, statusMessage); + if (this.headersSent) { + this.handler.onResponseError?.(this.controllerProxy, passedErr); + } else { + this.headersSent = true; + this.checkpointResponseEnd(headers); + this.handler.onResponseStart?.(this.controllerProxy, statusCode, headers, statusMessage); + controller.resume(); + if (pendingEnd) { + for (const chunk of pendingData) { + this.onResponseData(controller, chunk); + } + this.onResponseEnd(controller, pendingTrailers); + } + return; + } controller.resume(); return; } this.error = err; controller.resume(); + if (pendingEnd) { + this.onResponseEnd(controller, pendingTrailers); + } } controller.pause(); - this.retryOpts.retry( + this.retryPending = true; + this.pendingResponseData = []; + this.pendingResponseTrailers = null; + this.pendingResponseEnded = false; + this.retryTimer = this.retryOpts.retry( err, { state: { counter: this.retryCount }, opts: { retryOptions: this.retryOpts, ...this.opts } }, shouldRetry.bind(this) - ); + ) ?? null; + } + checkpointResponseEnd(headers) { + if (this.end == null && this.opts.method !== "HEAD") { + const contentLength = headers["content-length"]; + this.end = contentLength != null ? Number(contentLength) - 1 : null; + assert( + this.end == null || Number.isFinite(this.end), + "invalid content-length" + ); + this.resume = this.end != null; + } } onRequestStart(controller, context) { this.controllerProxy.target = controller; @@ -31548,6 +31886,12 @@ var require_retry_handler2 = __commonJS({ this.handler.onRequestStart?.(this.controllerProxy, context); } } + onBodySent(chunk) { + this.handler.onBodySent?.(chunk); + } + onRequestSent() { + this.handler.onRequestSent?.(); + } onRequestUpgrade(_controller, statusCode, headers, socket) { this.handler.onRequestUpgrade?.(this.controllerProxy, statusCode, headers, socket); } @@ -31561,7 +31905,8 @@ var require_retry_handler2 = __commonJS({ timeoutFactor, statusCodes, errorCodes, - methods + methods, + retryAfter } = retryOptions; const { counter } = state; if (code && code !== "UND_ERR_REQ_RETRY" && !errorCodes.includes(code)) { @@ -31580,13 +31925,13 @@ var require_retry_handler2 = __commonJS({ cb(err); return; } - let retryAfterHeader = headers?.["retry-after"]; + let retryAfterHeader = retryAfter === false ? void 0 : headers?.["retry-after"]; if (retryAfterHeader) { retryAfterHeader = Number(retryAfterHeader); retryAfterHeader = Number.isNaN(retryAfterHeader) ? calculateRetryAfterHeader(headers["retry-after"]) : retryAfterHeader * 1e3; } const retryTimeout = retryAfterHeader === 0 ? 0 : retryAfterHeader > 0 ? Math.min(retryAfterHeader, maxTimeout) : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout); - setTimeout(() => cb(null), retryTimeout); + return setTimeout(() => cb(null), retryTimeout); } onResponseStart(controller, statusCode, headers, statusMessage) { if (statusCode < 200) { @@ -31597,16 +31942,6 @@ var require_retry_handler2 = __commonJS({ this.retryCount += 1; this.statusCode = statusCode; this.headers = headers; - if (statusCode >= 300) { - const err = new RequestRetryError("Request failed", statusCode, { - headers, - data: { - count: this.retryCount - } - }); - this.onResponseStartWithRetry(controller, statusCode, headers, statusMessage, err); - return; - } if (this.headersSent) { if (statusCode !== 206 && (this.start > 0 || statusCode !== 200)) { throw new RequestRetryError("server does not support the range header and the payload was partially consumed", statusCode, { @@ -31629,8 +31964,22 @@ var require_retry_handler2 = __commonJS({ } validatePartialResponseContentLength(headers, contentRange, statusCode, this.retryCount); const { start, size, end = size ? size - 1 : null } = contentRange; - assert(this.start === start, "content-range mismatch"); - assert(this.end == null || this.end === end, "content-range mismatch"); + if (this.start !== start || this.end != null && this.end !== end) { + throw new RequestRetryError("Content-Range mismatch", statusCode, { + headers, + data: { count: this.retryCount } + }); + } + return; + } + if (statusCode >= 300) { + const err = new RequestRetryError("Request failed", statusCode, { + headers, + data: { + count: this.retryCount + } + }); + this.onResponseStartWithRetry(controller, statusCode, headers, statusMessage, err); return; } if (this.end == null) { @@ -31685,6 +32034,10 @@ var require_retry_handler2 = __commonJS({ } } onResponseData(_controller, chunk) { + if (this.pendingResponseData !== null) { + this.pendingResponseData.push(chunk); + return; + } if (this.error) { return; } @@ -31692,6 +32045,11 @@ var require_retry_handler2 = __commonJS({ this.handler.onResponseData?.(this.controllerProxy, chunk); } onResponseEnd(_controller, trailers) { + if (this.pendingResponseData !== null) { + this.pendingResponseTrailers = trailers; + this.pendingResponseEnded = true; + return; + } if (this.error && this.retryOpts.throwOnError) { throw this.error; } @@ -31731,11 +32089,19 @@ var require_retry_handler2 = __commonJS({ } } onResponseError(controller, err) { - if (controller?.aborted || isDisturbed(this.opts.body)) { + if (this.aborted) { + return; + } + if (controller?.aborted || isDisturbed(this.opts.body) || this.headersSent && !this.resume) { this.handler.onResponseError?.(this.controllerProxy, err); return; } function shouldRetry(returnedErr) { + if (this.aborted) { + return; + } + this.retryPending = false; + this.retryTimer = null; if (!returnedErr) { this.retry(); return; @@ -31747,14 +32113,28 @@ var require_retry_handler2 = __commonJS({ } else { this.retryCount += 1; } - this.retryOpts.retry( + this.retryPending = true; + this.retryTimer = this.retryOpts.retry( err, { state: { counter: this.retryCount }, opts: { retryOptions: this.retryOpts, ...this.opts } }, shouldRetry.bind(this) - ); + ) ?? null; + } + #onAbort(reason) { + if (!this.retryPending) { + return; + } + this.aborted = true; + this.retryPending = false; + clearTimeout(this.retryTimer); + this.retryTimer = null; + this.pendingResponseData = null; + this.pendingResponseTrailers = null; + this.pendingResponseEnded = false; + this.handler.onResponseError?.(this.controllerProxy, reason ?? new RequestAbortedError()); } }; module2.exports = RetryHandler; @@ -31767,6 +32147,7 @@ var require_retry_agent2 = __commonJS({ "use strict"; var Dispatcher = require_dispatcher2(); var RetryHandler = require_retry_handler2(); + var { kOriginless, kUrl } = require_symbols6(); var RetryAgent = class extends Dispatcher { #agent = null; #options = null; @@ -31774,6 +32155,8 @@ var require_retry_agent2 = __commonJS({ super(options); this.#agent = agent; this.#options = options; + this[kUrl] = agent[kUrl]; + this[kOriginless] = agent[kOriginless]; } dispatch(opts, handler) { const retry = new RetryHandler({ @@ -31848,7 +32231,6 @@ var require_readable2 = __commonJS({ var { Readable: Readable2 } = require("node:stream"); var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require_errors2(); var util = require_util9(); - var { ReadableStreamFrom } = require_util9(); var kConsume = /* @__PURE__ */ Symbol("kConsume"); var kReading = /* @__PURE__ */ Symbol("kReading"); var kBody = /* @__PURE__ */ Symbol("kBody"); @@ -32035,7 +32417,7 @@ var require_readable2 = __commonJS({ */ get body() { if (!this[kBody]) { - this[kBody] = ReadableStreamFrom(this); + this[kBody] = ReadableStream.from(this); if (this[kConsume]) { this[kBody].getReader(); assert(this[kBody].locked); @@ -33445,8 +33827,7 @@ var require_mock_utils2 = __commonJS({ handler.onResponseError(null, new InvalidArgumentError("reply options callback must return an object")); return; } - mockDispatch2.data = { ...responseDefaults, ...resolvedData }; - dispatchMockReply(mockDispatches, mockDispatch2, key, opts, handler); + dispatchMockReply(mockDispatches, mockDispatch2, key, opts, handler, { ...responseDefaults, ...resolvedData }); }, (error2) => { handler.onResponseError(null, error2); @@ -33457,12 +33838,13 @@ var require_mock_utils2 = __commonJS({ if (callbackResult == null || typeof callbackResult !== "object") { throw new InvalidArgumentError("reply options callback must return an object"); } - mockDispatch2.data = { ...responseDefaults, ...callbackResult }; + return dispatchMockReply(mockDispatches, mockDispatch2, key, opts, handler, { ...responseDefaults, ...callbackResult }); } return dispatchMockReply(mockDispatches, mockDispatch2, key, opts, handler); } - function dispatchMockReply(mockDispatches, mockDispatch2, key, opts, handler) { - const { data: response, delay } = mockDispatch2; + function dispatchMockReply(mockDispatches, mockDispatch2, key, opts, handler, resolvedResponse) { + const { data: responseData, delay } = mockDispatch2; + const response = resolvedResponse ?? responseData; if (response.error !== null) { deleteMockDispatch(mockDispatches, key); handler.onResponseError(null, response.error); @@ -33536,8 +33918,7 @@ var require_mock_utils2 = __commonJS({ handler.onResponseError(null, new InvalidArgumentError("reply options callback must return an object")); return; } - mockDispatch2.data = { ...responseDefaults, ...resolvedData }; - handleReply(dispatches, mockDispatch2.data); + handleReply(dispatches, { ...responseDefaults, ...resolvedData }); }, (err) => { handler.onResponseError(null, err); @@ -33548,8 +33929,7 @@ var require_mock_utils2 = __commonJS({ if (callbackResult == null || typeof callbackResult !== "object") { throw new InvalidArgumentError("reply options callback must return an object"); } - mockDispatch2.data = { ...responseDefaults, ...callbackResult }; - handleReply(dispatches, mockDispatch2.data); + handleReply(dispatches, { ...responseDefaults, ...callbackResult }); return; } if (typeof delay === "number" && delay > 0) { @@ -33574,13 +33954,13 @@ var require_mock_utils2 = __commonJS({ if (aborted) { return; } - const responseData = getResponseData(body); + const responseData2 = getResponseData(body); const responseHeaders = generateKeyValues(headers ?? {}); const responseTrailers = generateKeyValues(trailers ?? {}); controller.rawHeaders = responseHeaders; controller.rawTrailers = responseTrailers; handler.onResponseStart?.(controller, statusCode, parseHeaders(responseHeaders), getStatusText(statusCode)); - handler.onResponseData?.(controller, Buffer.from(responseData)); + handler.onResponseData?.(controller, Buffer.from(responseData2)); handler.onResponseEnd?.(controller, parseHeaders(responseTrailers)); deleteMockDispatch(mockDispatches2, key); } @@ -34343,10 +34723,18 @@ var require_mock_agent2 = __commonJS({ } dispatch(opts, handler) { opts.origin = normalizeOrigin(opts.origin); - this.get(opts.origin); + const mockDispatcher = this.get(opts.origin); this[kMockAgentAddCallHistoryLog](opts); const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters]; const dispatchOpts = { ...opts }; + if (dispatchOpts.allowH2 === false) { + const http1OnlyKey = `${dispatchOpts.origin}#http1-only`; + if (!this[kClients].has(http1OnlyKey)) { + const http1OnlyDispatcher = this[kFactory](dispatchOpts.origin); + http1OnlyDispatcher[kDispatches] = mockDispatcher[kDispatches]; + this[kMockAgentSet](http1OnlyKey, http1OnlyDispatcher); + } + } if (acceptNonStandardSearchParameters && dispatchOpts.path) { const [path, searchParams] = dispatchOpts.path.split("?"); const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters); @@ -35360,7 +35748,11 @@ var require_decorator_handler2 = __commonJS({ /** * @deprecated */ - onBodySent() { + onBodySent(...args) { + return this.#handler.onBodySent?.(...args); + } + onRequestSent(...args) { + return this.#handler.onRequestSent?.(...args); } }; } @@ -35373,6 +35765,7 @@ var require_redirect_handler2 = __commonJS({ var util = require_util9(); var assert = require("node:assert"); var { InvalidArgumentError } = require_errors2(); + var { kRequestOrigin } = require_symbols6(); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; var noop = () => { }; @@ -35405,10 +35798,20 @@ var require_redirect_handler2 = __commonJS({ onRequestStart(controller, context) { this.handler.onRequestStart?.(controller, { ...context, history: this.history }); } + onBodySent(chunk) { + this.handler.onBodySent?.(chunk); + } + onRequestSent() { + this.handler.onRequestSent?.(); + } onRequestUpgrade(controller, statusCode, headers, socket) { this.handler.onRequestUpgrade?.(controller, statusCode, headers, socket); } onResponseStart(controller, statusCode, headers, statusMessage) { + if (statusCode < 200) { + this.handler.onResponseStart?.(controller, statusCode, headers, statusMessage); + return; + } if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) { throw new Error("max redirects"); } @@ -35429,14 +35832,16 @@ var require_redirect_handler2 = __commonJS({ this.opts.body = null; } this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) || redirectableStatusCodes.indexOf(statusCode) === -1 ? null : headers.location; - if (this.opts.origin) { - this.history.push(new URL(this.opts.path, this.opts.origin)); + const requestOrigin = this.opts[kRequestOrigin] === void 0 ? this.opts.origin : this.opts[kRequestOrigin]; + if (requestOrigin) { + this.history.push(new URL(this.opts.path, requestOrigin)); } if (!this.location) { this.handler.onResponseStart?.(controller, statusCode, headers, statusMessage); return; } - const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); + const baseUrl = requestOrigin ? new URL(this.opts.path, requestOrigin) : void 0; + const { origin, pathname, search } = util.parseURL(new URL(this.location, baseUrl)); const path = search ? `${pathname}${search}` : pathname; const redirectUrlString = `${origin}${path}`; for (const historyUrl of this.history) { @@ -35444,9 +35849,10 @@ var require_redirect_handler2 = __commonJS({ throw new InvalidArgumentError(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`); } } - this.opts.headers = cleanRequestHeaders(this.opts.headers, removeContentHeaders, this.opts.origin !== origin, this.stripHeadersOnRedirect, this.stripHeadersOnCrossOriginRedirect); + this.opts.headers = cleanRequestHeaders(this.opts.headers, removeContentHeaders, requestOrigin !== origin, this.stripHeadersOnRedirect, this.stripHeadersOnCrossOriginRedirect); this.opts.path = path; this.opts.origin = origin; + this.opts[kRequestOrigin] = origin; this.opts.query = null; } onResponseData(controller, chunk) { @@ -35660,7 +36066,6 @@ var require_dump2 = __commonJS({ #maxSize = 1024 * 1024; #dumped = false; #size = 0; - #controller = null; aborted = false; reason = false; constructor({ maxSize, signal }, handler) { @@ -35676,7 +36081,6 @@ var require_dump2 = __commonJS({ } onRequestStart(controller, context) { controller.abort = this.#abort.bind(this); - this.#controller = controller; return super.onRequestStart(controller, context); } onResponseStart(controller, statusCode, headers, statusMessage) { @@ -35692,33 +36096,26 @@ var require_dump2 = __commonJS({ return super.onResponseStart(controller, statusCode, headers, statusMessage); } onResponseError(controller, err) { - if (this.#dumped) { - return; - } - err = this.#controller?.reason ?? err; - super.onResponseError(controller, err); + super.onResponseError(controller, this.aborted === true ? this.reason : err); } onResponseData(controller, chunk) { this.#size = this.#size + chunk.length; - if (this.#size >= this.#maxSize) { + if (this.#size > this.#maxSize) { + throw new RequestAbortedError( + `Response size (${this.#size}) larger than maxSize (${this.#maxSize})` + ); + } + if (this.#size === this.#maxSize) { this.#dumped = true; - if (this.aborted === true) { - super.onResponseError(controller, this.reason); - } else { - super.onResponseEnd(controller, {}); - } } return true; } onResponseEnd(controller, trailers) { - if (this.#dumped) { - return; - } - if (this.#controller.aborted === true) { + if (this.aborted === true) { super.onResponseError(controller, this.reason); return; } - super.onResponseEnd(controller, trailers); + super.onResponseEnd(controller, this.#dumped ? {} : trailers); } }; function createDumpInterceptor({ maxSize: defaultMaxSize } = { @@ -35744,6 +36141,7 @@ var require_dns2 = __commonJS({ var { lookup } = require("node:dns"); var DecoratorHandler = require_decorator_handler2(); var { InvalidArgumentError, InformationalError } = require_errors2(); + var { kRequestOrigin } = require_symbols6(); var maxInt = Math.pow(2, 31) - 1; function hasSafeIterator(headers) { const prototype = Object.getPrototypeOf(headers); @@ -36083,6 +36481,7 @@ var require_dns2 = __commonJS({ const dispatchOpts = { ...this.#opts, origin: `${this.#origin.protocol}//${ip.family === 6 ? `[${ip.address}]` : ip.address}${port}`, + [kRequestOrigin]: this.#opts[kRequestOrigin] === void 0 ? this.#origin : this.#opts[kRequestOrigin], headers: withHostHeader(this.#origin.host, this.#opts.headers) }; this.#dispatch(dispatchOpts, this); @@ -36161,6 +36560,7 @@ var require_dns2 = __commonJS({ servername: origin.hostname, // For SNI on TLS origin: newOrigin.origin, + [kRequestOrigin]: origDispatchOpts[kRequestOrigin] === void 0 ? origin : origDispatchOpts[kRequestOrigin], headers: withHostHeader(origin.host, origDispatchOpts.headers) }; dispatch( @@ -36189,6 +36589,7 @@ var require_cache2 = __commonJS({ isValidHTTPToken } = require_util9(); var { serializePathWithQuery } = require_util9(); + var { kRequestOrigin } = require_symbols6(); var MAX_DELTA_SECONDS = 2147483647; var RESTRICTIVE_DIRECTIVE_NAMES = ["no-store", "private", "no-cache"]; var kInvalidCacheControlDirectives = /* @__PURE__ */ Symbol("invalid cache-control directives"); @@ -36300,14 +36701,39 @@ var require_cache2 = __commonJS({ return tokenOnlyKey; } } - function makeCacheKey(opts) { - const origin = opts.origin ? opts.origin.toString() : ""; + function getRequestOrigin(opts) { + const origin = opts[kRequestOrigin] === void 0 ? opts.origin : opts[kRequestOrigin]; + return typeof origin === "string" || origin instanceof URL ? origin : null; + } + function getInterceptorOrigin(opts, interceptorOrigin) { + const requestOrigin = getRequestOrigin(opts); + if (interceptorOrigin === void 0) { + return requestOrigin; + } + if (interceptorOrigin === null) { + return null; + } + if (requestOrigin) { + try { + if (new URL(requestOrigin).origin !== interceptorOrigin) { + return null; + } + } catch { + return interceptorOrigin; + } + } + return interceptorOrigin; + } + function makeCacheKey(opts, origin = getRequestOrigin(opts)) { + if (!origin) { + throw new Error("opts.origin is undefined"); + } let fullPath = opts.path || "/"; if (opts.query && !pathHasQueryOrFragment(fullPath)) { fullPath = serializePathWithQuery(fullPath, opts.query); } return { - origin, + origin: origin.toString(), method: opts.method, path: fullPath, headers: opts.headers @@ -36682,6 +37108,8 @@ var require_cache2 = __commonJS({ return JSON.stringify([cacheKey.origin, cacheKey.method, cacheKey.path, headers]); } module2.exports = { + getInterceptorOrigin, + getRequestOrigin, makeCacheKey, normalizeHeaders, assertCacheKey, @@ -37348,6 +37776,12 @@ var require_cache_handler = __commonJS({ this.#writeStream = void 0; this.#handler.onRequestStart?.(controller, context); } + onBodySent(chunk) { + this.#handler.onBodySent?.(chunk); + } + onRequestSent() { + this.#handler.onRequestSent?.(); + } onRequestUpgrade(controller, statusCode, headers, socket) { this.#handler.onRequestUpgrade?.(controller, statusCode, headers, socket); } @@ -37370,6 +37804,11 @@ var require_cache_handler = __commonJS({ return downstreamOnHeaders(); } const cacheControlHeader = resHeaders["cache-control"]; + const cacheControlDirectives = cacheControlHeader ? parseCacheControlHeader(cacheControlHeader) : {}; + if (revalidationResponseDisallowsCachedReuse(this.#cacheType, resHeaders, cacheControlDirectives)) { + deleteCachedValue(this.#store, this.#cacheKey); + return downstreamOnHeaders(); + } const heuristicallyCacheable = resHeaders["last-modified"] && arrayIncludes(HEURISTICALLY_CACHEABLE_STATUS_CODES, statusCode); if (!cacheControlHeader && !resHeaders["expires"] && !heuristicallyCacheable && !this.#cacheByDefault) { if (statusCode === 304 && resHeaders.vary && isInvalidOrWildcardVaryHeader(resHeaders.vary)) { @@ -37377,8 +37816,7 @@ var require_cache_handler = __commonJS({ } return downstreamOnHeaders(); } - const cacheControlDirectives = cacheControlHeader ? parseCacheControlHeader(cacheControlHeader) : {}; - if (!canCacheResponse(this.#cacheType, statusCode, resHeaders, cacheControlDirectives, this.#cacheKey.headers)) { + if (!canCacheResponse(this.#cacheType, this.#cacheKey.method, statusCode, resHeaders, cacheControlDirectives, this.#cacheKey.headers)) { if (statusCode === 304 && (cacheControlHeader || revalidationResponseDisallowsCachedReuse(this.#cacheType, resHeaders, cacheControlDirectives))) { deleteCachedValue(this.#store, this.#cacheKey); } @@ -37543,9 +37981,12 @@ var require_cache_handler = __commonJS({ } } function revalidationResponseDisallowsCachedReuse(cacheType, resHeaders, cacheControlDirectives) { - return cacheControlDirectives["no-store"] === true || cacheType === "shared" && cacheControlDirectives.private === true || (resHeaders.vary ? isInvalidOrWildcardVaryHeader(resHeaders.vary) : false); + return cacheControlDirectives["no-store"] === true || cacheType === "shared" && (cacheControlDirectives.private === true || Object.hasOwn(resHeaders, "set-cookie")) || (resHeaders.vary ? isInvalidOrWildcardVaryHeader(resHeaders.vary) : false); } - function canCacheResponse(cacheType, statusCode, resHeaders, cacheControlDirectives, reqHeaders) { + function canCacheResponse(cacheType, method, statusCode, resHeaders, cacheControlDirectives, reqHeaders) { + if (!arrayIncludes(util.safeHTTPMethods, method)) { + return false; + } if (statusCode < 200 || arrayIncludes(NOT_UNDERSTOOD_STATUS_CODES, statusCode)) { return false; } @@ -37556,7 +37997,7 @@ var require_cache_handler = __commonJS({ if (cacheControlDirectives["no-store"]) { return false; } - if (cacheType === "shared" && cacheControlDirectives.private === true) { + if (cacheType === "shared" && (cacheControlDirectives.private === true || Object.hasOwn(resHeaders, "set-cookie"))) { return false; } if (resHeaders.vary && hasVaryStar(resHeaders.vary)) { @@ -37791,7 +38232,7 @@ var require_memory_cache_store = __commonJS({ return this.#size >= this.#maxSize || this.#count >= this.#maxCount; } /** - * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} req + * @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} key * @returns {import('../../types/cache-interceptor.d.ts').default.GetResult | undefined} */ get(key) { @@ -37864,7 +38305,7 @@ var require_memory_cache_store = __commonJS({ store.#hasEmittedMaxSizeEvent = true; } for (const [key2, entries2] of store.#entries) { - for (const entry2 of entries2.splice(0, entries2.length / 2)) { + for (const entry2 of entries2.splice(0, Math.ceil(entries2.length / 2))) { store.#size -= entry2.size; store.#count -= 1; } @@ -38041,7 +38482,16 @@ var require_cache3 = __commonJS({ var CacheHandler = require_cache_handler(); var MemoryCacheStore = require_memory_cache_store(); var CacheRevalidationHandler = require_cache_revalidation_handler(); - var { assertCacheStore, assertCacheMethods, makeCacheKey, normalizeHeaders, parseCacheControlHeader, isInvalidOrWildcardVaryHeader } = require_cache2(); + var { + assertCacheStore, + assertCacheMethods, + getInterceptorOrigin, + makeCacheKey, + normalizeHeaders, + parseCacheControlHeader, + isInvalidOrWildcardVaryHeader, + parseVaryHeader + } = require_cache2(); var { AbortError } = require_errors2(); var { parseHttpDate } = require_date(); function assertCacheOrigins(origins, name) { @@ -38107,7 +38557,7 @@ var require_cache3 = __commonJS({ result.cacheControlDirectives?.["s-maxage"] !== void 0); } function revalidationResponseDisallowsCachedReuse(cacheType, headers) { - if (headers.vary && isInvalidOrWildcardVaryHeader(headers.vary)) { + if (headers.vary && isInvalidOrWildcardVaryHeader(headers.vary) || cacheType === "shared" && Object.hasOwn(headers, "set-cookie")) { return true; } const cacheControl = headers["cache-control"]; @@ -38120,6 +38570,17 @@ var require_cache3 = __commonJS({ function revalidationResponseUpdatesCacheControl(headers) { return headers["cache-control"] !== void 0; } + function revalidationResponseAddsVary(result, varyDirectives) { + if (!varyDirectives) { + return false; + } + for (const key in varyDirectives) { + if (result.vary == null || !Object.hasOwn(result.vary, key)) { + return true; + } + } + return false; + } function deleteCachedValue(store, cacheKey) { try { store.delete(cacheKey)?.catch?.(nop); @@ -38215,6 +38676,7 @@ var require_cache3 = __commonJS({ const stream = util.isStream(result.body) ? result.body : Readable2.from(result.body ?? []); assert(!stream.destroyed, "stream should not be destroyed"); assert(!stream.readableDidRead, "stream should not be readableDidRead"); + let aborted = false; const controller = { rawHeaders: [], rawTrailers: [], @@ -38228,12 +38690,13 @@ var require_cache3 = __commonJS({ return stream.isPaused(); }, get aborted() { - return stream.destroyed; + return aborted; }, get reason() { return stream.errored; }, abort(reason) { + aborted = true; stream.destroy(reason ?? new AbortError()); } }; @@ -38272,6 +38735,13 @@ var require_cache3 = __commonJS({ if (!result) { return handleUncachedResponse(dispatch, globalOpts, cacheKey, handler, opts, reqCacheControl); } + if (globalOpts.type === "shared" && Object.hasOwn(result.headers, "set-cookie")) { + if (util.isStream(result.body)) { + result.body.on("error", nop).destroy(); + } + deleteCachedValue(globalOpts.store, cacheKey); + return handleUncachedResponse(dispatch, globalOpts, cacheKey, handler, opts, reqCacheControl); + } const now = Date.now(); if (now > result.deleteAt) { return dispatch(opts, new CacheHandler(globalOpts, cacheKey, handler)); @@ -38338,6 +38808,12 @@ var require_cache3 = __commonJS({ } if (revalidationResponseUpdatesCacheControl(headers2)) { deleteCachedValue(globalOpts.store, cacheKey); + } else if (revalidationResponseAddsVary(result, headers2.vary ? parseVaryHeader(headers2.vary, opts.headers) : void 0)) { + if (util.isStream(result.body)) { + result.body.on("error", nop).destroy(); + } + deleteCachedValue(globalOpts.store, cacheKey); + return dispatch(opts, new CacheHandler(globalOpts, cacheKey, handler)); } } sendCachedValue(handler, opts, result, age, context, stale); @@ -38388,25 +38864,23 @@ var require_cache3 = __commonJS({ safeMethodsToNotCache.push(method); } } - return (dispatch) => { + return (dispatch, interceptorOrigin) => { return (opts2, handler) => { - if (arrayIncludes(safeMethodsToNotCache, opts2.method)) { + const requestOrigin = getInterceptorOrigin(opts2, interceptorOrigin); + if (!requestOrigin || arrayIncludes(safeMethodsToNotCache, opts2.method)) { return dispatch(opts2, handler); } if (origins !== void 0) { - if (!opts2.origin) { - return dispatch(opts2, handler); - } - const requestOrigin = opts2.origin.toString().toLowerCase(); + const normalizedRequestOrigin = requestOrigin.toString().toLowerCase(); let isAllowed = false; for (let i = 0; i < origins.length; i++) { const allowed = origins[i]; if (typeof allowed === "string") { - if (allowed.toLowerCase() === requestOrigin) { + if (allowed.toLowerCase() === normalizedRequestOrigin) { isAllowed = true; break; } - } else if (allowed.test(requestOrigin)) { + } else if (allowed.test(normalizedRequestOrigin)) { isAllowed = true; break; } @@ -38423,7 +38897,10 @@ var require_cache3 = __commonJS({ if (reqCacheControl?.["no-store"]) { return dispatch(opts2, handler); } - const cacheKey = makeCacheKey(opts2); + const cacheKey = makeCacheKey(opts2, requestOrigin); + if (!arrayIncludes(util.safeHTTPMethods, opts2.method)) { + return dispatch(opts2, new CacheHandler(globalOpts, cacheKey, handler)); + } const result = store.get(cacheKey); if (result && typeof result.then === "function") { return result.then((result2) => handleResult( @@ -38457,9 +38934,66 @@ var require_decompress = __commonJS({ "node_modules/undici/lib/interceptor/decompress.js"(exports2, module2) { "use strict"; var { createInflate, createGunzip, createBrotliDecompress, createZstdDecompress } = require("node:zlib"); - var { pipeline } = require("node:stream"); + var { pipeline, Transform: TransformStream2 } = require("node:stream"); + var { InvalidArgumentError, ResponseExceededMaxSizeError } = require_errors2(); var DecoratorHandler = require_decorator_handler2(); + var DecompressController = class { + #onPause; + #onResume; + #onAbort; + #paused = false; + constructor(onPause, onResume, onAbort) { + this.#onPause = onPause; + this.#onResume = onResume; + this.#onAbort = onAbort; + this.target = null; + } + pause() { + if (this.#paused) { + return; + } + this.#paused = true; + this.#onPause(); + } + resume() { + if (!this.#paused) { + return; + } + this.#paused = false; + this.#onResume(); + } + abort(reason) { + this.target?.abort(reason); + this.#onAbort(reason); + } + get paused() { + return this.#paused; + } + get aborted() { + return this.target?.aborted ?? false; + } + get reason() { + return this.target?.reason ?? null; + } + get rawHeaders() { + return this.target?.rawHeaders ?? null; + } + set rawHeaders(value) { + if (this.target) { + this.target.rawHeaders = value; + } + } + get rawTrailers() { + return this.target?.rawTrailers ?? null; + } + set rawTrailers(value) { + if (this.target) { + this.target.rawTrailers = value; + } + } + }; var supportedEncodings = { + __proto__: null, gzip: createGunzip, "x-gzip": createGunzip, br: createBrotliDecompress, @@ -38472,6 +39006,23 @@ var require_decompress = __commonJS({ /** @type {const} */ [204, 304] ); + var defaultMaxSize = 0; + function createMaxSizeLimiter(maxSize) { + let size = 0; + return new TransformStream2({ + transform(chunk, _encoding, callback) { + const decompressedSize = size + chunk.length; + if (decompressedSize > maxSize) { + callback(new ResponseExceededMaxSizeError( + `Decompressed response size (${decompressedSize}) exceeded maxSize (${maxSize})` + )); + return; + } + size = decompressedSize; + callback(null, chunk); + } + }); + } var warningEmitted = ( /** @type {boolean} */ false @@ -38485,10 +39036,122 @@ var require_decompress = __commonJS({ #skipStatusCodes; /** @type {boolean} */ #skipErrorResponses; - constructor(handler, { skipStatusCodes = defaultSkipStatusCodes, skipErrorResponses = true } = {}) { + /** @type {number} */ + #maxSize; + /** @type {number} */ + #decompressedSize = 0; + /** @type {boolean} */ + #terminated = false; + /** @type {boolean} */ + #inputEnded = false; + /** @type {boolean} */ + #inputBackpressured = false; + /** @type {boolean} */ + #upstreamPaused = false; + /** @type {boolean} */ + #draining = false; + /** @type {boolean} */ + #drainRequested = false; + /** @type {boolean} */ + #completionPending = false; + /** @type {DecompressorStream | undefined} */ + #finalDecompressor; + /** @type {DecompressController} */ + #controller; + constructor(handler, { skipStatusCodes = defaultSkipStatusCodes, skipErrorResponses = true, maxSize = defaultMaxSize } = {}) { + if (!Number.isSafeInteger(maxSize) || maxSize < 0) { + throw new InvalidArgumentError("maxSize must be a non-negative integer"); + } super(handler); this.#skipStatusCodes = skipStatusCodes; this.#skipErrorResponses = skipErrorResponses; + this.#maxSize = maxSize; + this.#controller = new DecompressController( + () => this.#onDownstreamPause(), + () => this.#onDownstreamResume(), + (reason) => { + if (this.#inputEnded && !this.#terminated) { + this.onResponseError(this.#controller, reason); + } + } + ); + } + #onDownstreamPause() { + this.#pauseUpstream(); + } + #onDownstreamResume() { + const drainWasDeferred = this.#draining; + this.#drainOutput(); + if (!drainWasDeferred) { + this.#resumeUpstreamIfNeeded(); + this.#finishIfReady(); + } + } + #pauseUpstream() { + if (!this.#upstreamPaused && !this.#terminated) { + this.#upstreamPaused = true; + this.#controller.target?.pause(); + } + } + #resumeUpstreamIfNeeded() { + if (this.#upstreamPaused && !this.#controller.paused && !this.#inputBackpressured) { + this.#upstreamPaused = false; + if (!this.#inputEnded) { + this.#controller.target?.resume(); + } + } + } + #drainOutput() { + if (this.#terminated || this.#controller.paused || !this.#finalDecompressor) { + return; + } + if (this.#draining) { + this.#drainRequested = true; + return; + } + this.#draining = true; + try { + do { + this.#drainRequested = false; + let chunk; + while (!this.#terminated && !this.#controller.paused && (chunk = this.#finalDecompressor.read()) !== null) { + if (this.#maxSize > 0) { + const decompressedSize = this.#decompressedSize + chunk.length; + if (decompressedSize > this.#maxSize) { + this.#fail(new ResponseExceededMaxSizeError( + `Decompressed response size (${decompressedSize}) exceeded maxSize (${this.#maxSize})` + )); + return; + } + this.#decompressedSize = decompressedSize; + } + const result = super.onResponseData(this.#controller, chunk); + if (result === false && !this.#controller.paused) { + this.#controller.pause(); + } + } + } while (this.#drainRequested && !this.#terminated && !this.#controller.paused); + } finally { + this.#draining = false; + } + this.#resumeUpstreamIfNeeded(); + this.#finishIfReady(); + } + #finishIfReady() { + if (this.#terminated || !this.#completionPending || this.#controller.paused || this.#draining) { + return; + } + this.#terminated = true; + this.#cleanupDecompressors(); + super.onResponseEnd(this.#controller, this.#trailers); + } + #onDecompressionEnd() { + if (this.#terminated) { + return; + } + this.#completionPending = true; + this.#drainOutput(); + this.#finishIfReady(); } /** * Determines if decompression should be skipped based on encoding and status code @@ -38506,7 +39169,7 @@ var require_decompress = __commonJS({ * Creates a chain of decompressors for multiple content encodings * * @param {string} encodings - Comma-separated list of content encodings - * @returns {Array} - Array of decompressor streams + * @returns {Array} - Array of decompressor and limiting streams * @throws {Error} - If the number of content-encodings exceeds the maximum allowed */ #createDecompressionChain(encodings) { @@ -38525,54 +39188,81 @@ var require_decompress = __commonJS({ } decompressors.push(supportedEncodings[encoding]()); } - return decompressors; + if (decompressors.length < 2) { + return decompressors; + } + const streams = []; + for (let i = 0; i < decompressors.length; i++) { + streams.push(decompressors[i]); + if (i < decompressors.length - 1 && this.#maxSize > 0) { + streams.push(createMaxSizeLimiter(this.#maxSize)); + } + } + return streams; } /** - * Sets up event handlers for a decompressor stream using readable events - * @param {DecompressorStream} decompressor - The decompressor stream - * @param {Controller} controller - The controller to coordinate with + * Stops decompression and reports an error. + * @param {Error} error - The decompression error * @returns {void} */ - #setupDecompressorEvents(decompressor, controller) { - decompressor.on("readable", () => { - let chunk; - while ((chunk = decompressor.read()) !== null) { - const result = super.onResponseData(controller, chunk); - if (result === false) { - break; - } - } - }); - decompressor.on("error", (error2) => { - super.onResponseError(controller, error2); - }); + #fail(error2) { + if (this.#terminated) { + return; + } + if (this.#inputEnded) { + this.onResponseError(this.#controller, error2); + } else { + this.#controller.abort(error2); + } + } + /** + * Sets up event handlers for the final decompressor stream. + * @param {DecompressorStream} decompressor - The decompressor stream + * @returns {void} + */ + #setupDecompressorEvents(decompressor) { + this.#finalDecompressor = decompressor; + decompressor.on("readable", () => this.#drainOutput()); + decompressor.on("error", (error2) => this.#fail(error2)); } /** * Sets up event handling for a single decompressor - * @param {Controller} controller - The controller to handle events * @returns {void} */ - #setupSingleDecompressor(controller) { + #setupSingleDecompressor() { const decompressor = this.#decompressors[0]; - this.#setupDecompressorEvents(decompressor, controller); - decompressor.on("end", () => { - super.onResponseEnd(controller, this.#trailers); - }); + this.#setupDecompressorEvents(decompressor); + decompressor.on("end", () => this.#onDecompressionEnd()); } /** * Sets up event handling for multiple chained decompressors using pipeline - * @param {Controller} controller - The controller to handle events * @returns {void} */ - #setupMultipleDecompressors(controller) { + #setupMultipleDecompressors() { const lastDecompressor = this.#decompressors[this.#decompressors.length - 1]; - this.#setupDecompressorEvents(lastDecompressor, controller); + this.#setupDecompressorEvents(lastDecompressor); pipeline(this.#decompressors, (err) => { - if (err) { - super.onResponseError(controller, err); + if (this.#terminated) { return; } - super.onResponseEnd(controller, this.#trailers); + if (err) { + this.#fail(err); + return; + } + this.#onDecompressionEnd(); + }); + } + #setupInputBackpressure() { + const decompressor = this.#decompressors[0]; + decompressor.on("drain", () => { + if (this.#terminated) { + return; + } + this.#inputBackpressured = false; + if (!this.#controller.paused) { + this.#drainOutput(); + this.#resumeUpstreamIfNeeded(); + } }); } /** @@ -38581,6 +39271,14 @@ var require_decompress = __commonJS({ */ #cleanupDecompressors() { this.#decompressors.length = 0; + this.#finalDecompressor = void 0; + } + onRequestStart(controller, context) { + this.#controller.target = controller; + return super.onRequestStart(this.#controller, context); + } + onRequestUpgrade(controller, statusCode, headers, socket) { + return super.onRequestUpgrade(this.#controller, statusCode, headers, socket); } /** * @param {Controller} controller @@ -38590,19 +39288,20 @@ var require_decompress = __commonJS({ * @returns {void} */ onResponseStart(controller, statusCode, headers, statusMessage) { - const contentEncoding = headers["content-encoding"]; + const rawContentEncoding = headers["content-encoding"]; + const contentEncoding = Array.isArray(rawContentEncoding) ? rawContentEncoding.join(",") : rawContentEncoding; if (this.#shouldSkipDecompression(contentEncoding, statusCode)) { - return super.onResponseStart(controller, statusCode, headers, statusMessage); + return super.onResponseStart(this.#controller, statusCode, headers, statusMessage); } const decompressors = this.#createDecompressionChain(contentEncoding.toLowerCase()); if (decompressors.length === 0) { this.#cleanupDecompressors(); - return super.onResponseStart(controller, statusCode, headers, statusMessage); + return super.onResponseStart(this.#controller, statusCode, headers, statusMessage); } this.#decompressors = decompressors; const { "content-encoding": _, "content-length": __, ...newHeaders } = headers; - if (controller?.rawHeaders) { - const rawHeaders = controller.rawHeaders; + if (this.#controller.rawHeaders) { + const rawHeaders = this.#controller.rawHeaders; if (Array.isArray(rawHeaders)) { const filteredHeaders = []; for (let i = 0; i < rawHeaders.length; i += 2) { @@ -38614,7 +39313,7 @@ var require_decompress = __commonJS({ } filteredHeaders.push(rawHeaders[i], rawHeaders[i + 1]); } - controller.rawHeaders = filteredHeaders; + rawHeaders.splice(0, rawHeaders.length, ...filteredHeaders); } else if (typeof rawHeaders === "object") { for (const name of Object.keys(rawHeaders)) { const lowerName = name.toLowerCase(); @@ -38624,12 +39323,13 @@ var require_decompress = __commonJS({ } } } + this.#setupInputBackpressure(); if (this.#decompressors.length === 1) { - this.#setupSingleDecompressor(controller); + this.#setupSingleDecompressor(); } else { - this.#setupMultipleDecompressors(controller); + this.#setupMultipleDecompressors(); } - return super.onResponseStart(controller, statusCode, newHeaders, statusMessage); + return super.onResponseStart(this.#controller, statusCode, newHeaders, statusMessage); } /** * @param {Controller} controller @@ -38638,10 +39338,13 @@ var require_decompress = __commonJS({ */ onResponseData(controller, chunk) { if (this.#decompressors.length > 0) { - this.#decompressors[0].write(chunk); + if (!this.#decompressors[0].write(chunk)) { + this.#inputBackpressured = true; + this.#pauseUpstream(); + } return; } - super.onResponseData(controller, chunk); + return super.onResponseData(this.#controller, chunk); } /** * @param {Controller} controller @@ -38650,12 +39353,12 @@ var require_decompress = __commonJS({ */ onResponseEnd(controller, trailers) { if (this.#decompressors.length > 0) { + this.#inputEnded = true; this.#trailers = trailers; this.#decompressors[0].end(); - this.#cleanupDecompressors(); return; } - super.onResponseEnd(controller, trailers); + return super.onResponseEnd(this.#controller, trailers); } /** * @param {Controller} controller @@ -38663,13 +39366,15 @@ var require_decompress = __commonJS({ * @returns {void} */ onResponseError(controller, err) { - if (this.#decompressors.length > 0) { - for (const decompressor of this.#decompressors) { - decompressor.destroy(err); - } - this.#cleanupDecompressors(); + if (this.#terminated) { + return; } - super.onResponseError(controller, err); + this.#terminated = true; + for (const decompressor of this.#decompressors) { + decompressor.destroy(); + } + this.#cleanupDecompressors(); + super.onResponseError(this.#controller, err); } }; function createDecompressInterceptor(options = {}) { @@ -38885,8 +39590,9 @@ var require_deduplication_handler = __commonJS({ if (this.#aborted || this.#completed) { return; } - this.#completed = true; + this.#cleanup(); this.#primaryHandler.onResponseEnd?.(controller, trailers); + this.#completed = true; for (const waitingHandler of this.#waitingHandlers) { if (waitingHandler.done || waitingHandler.controller.aborted) { waitingHandler.done = true; @@ -38897,18 +39603,18 @@ var require_deduplication_handler = __commonJS({ waitingHandler.done = true; continue; } - if (waitingHandler.controller.paused && waitingHandler.bufferedChunks.length > 0) { + if (waitingHandler.controller.paused) { waitingHandler.pendingTrailers = trailers; continue; } try { waitingHandler.handler.onResponseEnd?.(waitingHandler.controller, trailers); - } catch { + } catch (err) { + this.#errorWaitingHandler(waitingHandler, err); } waitingHandler.done = true; } this.#pruneDoneWaitingHandlers(); - this.#onComplete?.(); } /** * @param {import('../../types/dispatcher.d.ts').default.DispatchController} controller @@ -38920,12 +39626,17 @@ var require_deduplication_handler = __commonJS({ } this.#aborted = true; this.#completed = true; + this.#cleanup(); this.#primaryHandler.onResponseError?.(controller, err); for (const waitingHandler of this.#waitingHandlers) { this.#errorWaitingHandler(waitingHandler, err); } this.#waitingHandlers = []; - this.#onComplete?.(); + } + #cleanup() { + const onComplete = this.#onComplete; + this.#onComplete = null; + onComplete?.(); } /** * @param {DispatchHandler} handler @@ -38955,7 +39666,8 @@ var require_deduplication_handler = __commonJS({ if (this.#completed && waitingHandler.pendingTrailers && waitingHandler.bufferedChunks.length === 0 && !state.paused && !state.aborted) { try { waitingHandler.handler.onResponseEnd?.(waitingHandler.controller, waitingHandler.pendingTrailers); - } catch { + } catch (err) { + this.#errorWaitingHandler(waitingHandler, err); } waitingHandler.pendingTrailers = null; waitingHandler.done = true; @@ -38977,12 +39689,19 @@ var require_deduplication_handler = __commonJS({ return state.reason; }, abort: (reason) => { + if (state.aborted) { + return; + } state.aborted = true; state.reason = reason ?? null; waitingHandler.done = true; waitingHandler.pendingTrailers = null; waitingHandler.bufferedChunks = []; waitingHandler.bufferedBytes = 0; + try { + handler.onResponseError?.(waitingHandler.controller, state.reason ?? new RequestAbortedError()); + } catch { + } } }; return waitingHandler; @@ -39003,7 +39722,7 @@ var require_deduplication_handler = __commonJS({ waitingHandler.bufferedBytes += bufferedChunk.length; if (waitingHandler.bufferedBytes > this.#maxBufferSize) { const err = new RequestAbortedError(`Deduplicated waiting handler exceeded maxBufferSize (${this.#maxBufferSize} bytes) while paused`); - this.#errorWaitingHandler(waitingHandler, err); + waitingHandler.controller.abort(err); } } /** @@ -39040,7 +39759,6 @@ var require_deduplication_handler = __commonJS({ waitingHandler.bufferedChunks = []; waitingHandler.bufferedBytes = 0; try { - waitingHandler.controller.abort(err); waitingHandler.handler.onResponseError?.(waitingHandler.controller, err); } catch { } @@ -39060,7 +39778,7 @@ var require_deduplicate = __commonJS({ var diagnosticsChannel = require("node:diagnostics_channel"); var util = require_util9(); var DeduplicationHandler = require_deduplication_handler(); - var { normalizeHeaders, makeCacheKey, makeDeduplicationKey } = require_cache2(); + var { getInterceptorOrigin, normalizeHeaders, makeCacheKey, makeDeduplicationKey } = require_cache2(); var pendingRequestsChannel = diagnosticsChannel.channel("undici:request:pending-requests"); module2.exports = (opts = {}) => { const { @@ -39092,9 +39810,10 @@ var require_deduplicate = __commonJS({ const skipHeaderNamesSet = new Set(skipHeaderNames.map((name) => name.toLowerCase())); const excludeHeaderNamesSet = new Set(excludeHeaderNames.map((name) => name.toLowerCase())); const pendingRequests = /* @__PURE__ */ new Map(); - return (dispatch) => { + return (dispatch, interceptorOrigin) => { return (opts2, handler) => { - if (opts2.upgrade || methods.includes(opts2.method) === false) { + const requestOrigin = getInterceptorOrigin(opts2, interceptorOrigin); + if (!requestOrigin || opts2.upgrade || methods.includes(opts2.method) === false) { return dispatch(opts2, handler); } opts2 = { @@ -39108,7 +39827,7 @@ var require_deduplicate = __commonJS({ } } } - const cacheKey = makeCacheKey(opts2); + const cacheKey = makeCacheKey(opts2, requestOrigin); const dedupeKey = makeDeduplicationKey(cacheKey, excludeHeaderNamesSet); const pendingHandler = pendingRequests.get(dedupeKey); if (pendingHandler) { @@ -39769,7 +40488,11 @@ var require_headers2 = __commonJS({ } } }; - var Headers2 = class _Headers { + var getHeadersGuard; + var setHeadersGuard; + var getHeadersList; + var setHeadersList; + var Headers2 = class { #guard; /** * @type {HeadersList} @@ -39793,7 +40516,7 @@ var require_headers2 = __commonJS({ } // https://fetch.spec.whatwg.org/#dom-headers-append append(name, value) { - webidl.brandCheck(this, _Headers); + webidl.brandCheck(this, webidl.is.Headers); webidl.argumentLengthCheck(arguments, 2, "Headers.append"); const prefix = "Headers.append"; name = webidl.converters.ByteString(name, prefix, "name"); @@ -39802,7 +40525,7 @@ var require_headers2 = __commonJS({ } // https://fetch.spec.whatwg.org/#dom-headers-delete delete(name) { - webidl.brandCheck(this, _Headers); + webidl.brandCheck(this, webidl.is.Headers); webidl.argumentLengthCheck(arguments, 1, "Headers.delete"); const prefix = "Headers.delete"; name = webidl.converters.ByteString(name, prefix, "name"); @@ -39823,7 +40546,7 @@ var require_headers2 = __commonJS({ } // https://fetch.spec.whatwg.org/#dom-headers-get get(name) { - webidl.brandCheck(this, _Headers); + webidl.brandCheck(this, webidl.is.Headers); webidl.argumentLengthCheck(arguments, 1, "Headers.get"); const prefix = "Headers.get"; name = webidl.converters.ByteString(name, prefix, "name"); @@ -39838,7 +40561,7 @@ var require_headers2 = __commonJS({ } // https://fetch.spec.whatwg.org/#dom-headers-has has(name) { - webidl.brandCheck(this, _Headers); + webidl.brandCheck(this, webidl.is.Headers); webidl.argumentLengthCheck(arguments, 1, "Headers.has"); const prefix = "Headers.has"; name = webidl.converters.ByteString(name, prefix, "name"); @@ -39853,7 +40576,7 @@ var require_headers2 = __commonJS({ } // https://fetch.spec.whatwg.org/#dom-headers-set set(name, value) { - webidl.brandCheck(this, _Headers); + webidl.brandCheck(this, webidl.is.Headers); webidl.argumentLengthCheck(arguments, 2, "Headers.set"); const prefix = "Headers.set"; name = webidl.converters.ByteString(name, prefix, "name"); @@ -39879,7 +40602,7 @@ var require_headers2 = __commonJS({ } // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie getSetCookie() { - webidl.brandCheck(this, _Headers); + webidl.brandCheck(this, webidl.is.Headers); const list = this.#headersList.cookies; if (list) { return [...list]; @@ -39890,32 +40613,21 @@ var require_headers2 = __commonJS({ options.depth ??= depth; return `Headers ${util.formatWithOptions(options, this.#headersList.entries)}`; } - static getHeadersGuard(o) { - return o.#guard; - } - static setHeadersGuard(o, guard) { - o.#guard = guard; - } - /** - * @param {Headers} o - */ - static getHeadersList(o) { - return o.#headersList; - } - /** - * @param {Headers} target - * @param {HeadersList} list - */ - static setHeadersList(target, list) { - target.#headersList = list; + static { + getHeadersGuard = (headers) => headers.#guard; + setHeadersGuard = (headers, guard) => { + headers.#guard = guard; + }; + getHeadersList = (headers) => headers.#headersList; + setHeadersList = (target, list) => { + target.#headersList = list; + }; + webidl.is.Headers = (arg) => { + return arg != null && typeof arg === "object" && #guard in arg; + }; } }; - var { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers2; - Reflect.deleteProperty(Headers2, "getHeadersGuard"); - Reflect.deleteProperty(Headers2, "setHeadersGuard"); - Reflect.deleteProperty(Headers2, "getHeadersList"); - Reflect.deleteProperty(Headers2, "setHeadersList"); - iteratorMixin("Headers", Headers2, headersListSortAndCombine, 0, 1); + iteratorMixin("Headers", Headers2, headersListSortAndCombine, 0, 1, webidl.is.Headers); Object.defineProperties(Headers2.prototype, { append: kEnumerableProperty, delete: kEnumerableProperty, @@ -39991,7 +40703,11 @@ var require_response2 = __commonJS({ var assert = require("node:assert"); var { isomorphicEncode, serializeJavascriptValueToJSONString } = require_infra(); var textEncoder = new TextEncoder("utf-8"); - var Response = class _Response { + var getResponseHeaders; + var setResponseHeaders; + var getResponseState; + var setResponseState; + var Response = class { /** @type {Headers} */ #headers; #state; @@ -40055,12 +40771,12 @@ var require_response2 = __commonJS({ } // Returns response’s type, e.g., "cors". get type() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); return this.#state.type; } // Returns response’s URL, if it has one; otherwise the empty string. get url() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); const urlList = this.#state.urlList; const url = urlList[urlList.length - 1] ?? null; if (url === null) { @@ -40070,40 +40786,40 @@ var require_response2 = __commonJS({ } // Returns whether response was obtained through a redirect. get redirected() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); return this.#state.urlList.length > 1; } // Returns response’s status. get status() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); return this.#state.status; } // Returns whether response’s status is an ok status. get ok() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); return this.#state.status >= 200 && this.#state.status <= 299; } // Returns response’s status message. get statusText() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); return this.#state.statusText; } // Returns response’s headers as Headers. get headers() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); return this.#headers; } get body() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); return this.#state.body ? this.#state.body.stream : null; } get bodyUsed() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); return !!this.#state.body && util.isDisturbed(this.#state.body.stream); } // Returns a clone of response. clone() { - webidl.brandCheck(this, _Response); + webidl.brandCheck(this, webidl.is.Response); if (bodyUnusable(this.#state)) { throw webidl.errors.exception({ header: "Response.clone", @@ -40134,39 +40850,25 @@ var require_response2 = __commonJS({ }; return `Response ${nodeUtil.formatWithOptions(options, properties)}`; } - /** - * @param {Response} response - */ - static getResponseHeaders(response) { - return response.#headers; - } - /** - * @param {Response} response - * @param {Headers} newHeaders - */ - static setResponseHeaders(response, newHeaders) { - response.#headers = newHeaders; - } - /** - * @param {Response} response - */ - static getResponseState(response) { - return response.#state; - } - /** - * @param {Response} response - * @param {any} newState - */ - static setResponseState(response, newState) { - response.#state = newState; + static { + getResponseHeaders = (response) => { + return response.#headers; + }; + setResponseHeaders = (response, newHeaders) => { + response.#headers = newHeaders; + }; + getResponseState = (response) => { + return response.#state; + }; + setResponseState = (response, newState) => { + response.#state = newState; + }; + webidl.is.Response = (arg) => { + return arg != null && typeof arg === "object" && #state in arg; + }; } }; - var { getResponseHeaders, setResponseHeaders, getResponseState, setResponseState } = Response; - Reflect.deleteProperty(Response, "getResponseHeaders"); - Reflect.deleteProperty(Response, "setResponseHeaders"); - Reflect.deleteProperty(Response, "getResponseState"); - Reflect.deleteProperty(Response, "setResponseState"); - mixinBody(Response, getResponseState); + mixinBody(Response, getResponseState, webidl.is.Response); Object.defineProperties(Response.prototype, { type: kEnumerableProperty, url: kEnumerableProperty, @@ -40370,7 +41072,6 @@ var require_response2 = __commonJS({ converter: webidl.converters.HeadersInit } ]); - webidl.is.Response = webidl.util.MakeTypeAssertion(Response); module2.exports = { isNetworkError, makeNetworkError, @@ -40450,7 +41151,14 @@ var require_request4 = __commonJS({ } } var patchMethodWarning = false; - var Request = class _Request { + var setRequestSignal; + var getRequestDispatcher; + var setRequestDispatcher; + var setRequestHeaders; + var getRequestState; + var setRequestState; + var removeRequestAbortListener; + var Request = class { /** @type {AbortSignal} */ #signal; /** @type {import('../../dispatcher/dispatcher')} */ @@ -40740,25 +41448,25 @@ var require_request4 = __commonJS({ } // Returns request’s HTTP method, which is "GET" by default. get method() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.method; } // Returns the URL of request as a string. get url() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return URLSerializer(this.#state.url); } // Returns a Headers object consisting of the headers associated with request. // Note that headers added in the network layer by the user agent will not // be accounted for in this object, e.g., the "Host" header. get headers() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#headers; } // Returns the kind of resource requested by request, e.g., "document" // or "script". get destination() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.destination; } // Returns the referrer of request. Its value can be a same-origin URL if @@ -40767,7 +41475,7 @@ var require_request4 = __commonJS({ // during fetching to determine the value of the `Referer` header of the // request being made. get referrer() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); if (this.#state.referrer === "no-referrer") { return ""; } @@ -40780,28 +41488,28 @@ var require_request4 = __commonJS({ // This is used during fetching to compute the value of the request’s // referrer. get referrerPolicy() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.referrerPolicy; } // Returns the mode associated with request, which is a string indicating // whether the request will use CORS, or will be restricted to same-origin // URLs. get mode() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.mode; } // Returns the credentials mode associated with request, // which is a string indicating whether credentials will be sent with the // request always, never, or only when sent to a same-origin URL. get credentials() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.credentials; } // Returns the cache mode associated with request, // which is a string indicating how the request will // interact with the browser’s cache when fetching. get cache() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.cache; } // Returns the redirect mode associated with request, @@ -40809,56 +41517,56 @@ var require_request4 = __commonJS({ // request will be handled during fetching. A request // will follow redirects by default. get redirect() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.redirect; } // Returns request’s subresource integrity metadata, which is a // cryptographic hash of the resource being fetched. Its value // consists of multiple hashes separated by whitespace. [SRI] get integrity() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.integrity; } // Returns a boolean indicating whether or not request can outlive the // global in which it was created. get keepalive() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.keepalive; } // Returns a boolean indicating whether or not request is for a reload // navigation. get isReloadNavigation() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.reloadNavigation; } // Returns a boolean indicating whether or not request is for a history // navigation (a.k.a. back-forward navigation). get isHistoryNavigation() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.historyNavigation; } // Returns the signal associated with request, which is an AbortSignal // object indicating whether or not request has been aborted, and its // abort event handler. get signal() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#signal; } get body() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return this.#state.body ? this.#state.body.stream : null; } get bodyUsed() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return !!this.#state.body && util.isDisturbed(this.#state.body.stream); } get duplex() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); return "half"; } // Returns a clone of request. clone() { - webidl.brandCheck(this, _Request); + webidl.brandCheck(this, webidl.is.Request); if (bodyUnusable(this.#state)) { throw new TypeError("unusable"); } @@ -40905,65 +41613,34 @@ var require_request4 = __commonJS({ }; return `Request ${nodeUtil.formatWithOptions(options, properties)}`; } - /** - * @param {Request} request - * @param {AbortSignal} newSignal - */ - static setRequestSignal(request, newSignal) { - request.#signal = newSignal; - return request; - } - /** - * @param {Request} request - */ - static getRequestDispatcher(request) { - return request.#dispatcher; - } - /** - * @param {Request} request - * @param {import('../../dispatcher/dispatcher')} newDispatcher - */ - static setRequestDispatcher(request, newDispatcher) { - request.#dispatcher = newDispatcher; - } - /** - * @param {Request} request - * @param {Headers} newHeaders - */ - static setRequestHeaders(request, newHeaders) { - request.#headers = newHeaders; - } - /** - * @param {Request} request - */ - static getRequestState(request) { - return request.#state; - } - /** - * @param {Request} request - * @param {any} newState - */ - static setRequestState(request, newState) { - request.#state = newState; - } - /** - * Removes the `abort` listener that makes this request's signal follow the - * signal passed to its constructor, if any. Idempotent. - * @param {Request} request - */ - static removeRequestAbortListener(request) { - request.#abortCleanup?.(); + static { + setRequestSignal = (request, newSignal) => { + request.#signal = newSignal; + }; + getRequestDispatcher = (request) => { + return request.#dispatcher; + }; + setRequestDispatcher = (request, newDispatcher) => { + request.#dispatcher = newDispatcher; + }; + setRequestHeaders = (request, newHeaders) => { + request.#headers = newHeaders; + }; + getRequestState = (request) => { + return request.#state; + }; + setRequestState = (request, newState) => { + request.#state = newState; + }; + removeRequestAbortListener = (request) => { + request.#abortCleanup?.(); + }; + webidl.is.Request = (arg) => { + return arg != null && typeof arg === "object" && #state in arg; + }; } }; - var { setRequestSignal, getRequestDispatcher, setRequestDispatcher, setRequestHeaders, getRequestState, setRequestState, removeRequestAbortListener } = Request; - Reflect.deleteProperty(Request, "setRequestSignal"); - Reflect.deleteProperty(Request, "getRequestDispatcher"); - Reflect.deleteProperty(Request, "setRequestDispatcher"); - Reflect.deleteProperty(Request, "setRequestHeaders"); - Reflect.deleteProperty(Request, "getRequestState"); - Reflect.deleteProperty(Request, "setRequestState"); - Reflect.deleteProperty(Request, "removeRequestAbortListener"); - mixinBody(Request, getRequestState); + mixinBody(Request, getRequestState, webidl.is.Request); function makeRequest(init) { return { method: init.method ?? "GET", @@ -40978,7 +41655,7 @@ var require_request4 = __commonJS({ serviceWorkers: init.serviceWorkers ?? "all", initiator: init.initiator ?? "", destination: init.destination ?? "", - priority: init.priority ?? null, + priority: init.priority ?? "auto", origin: init.origin ?? "client", policyContainer: init.policyContainer ?? "client", referrer: init.referrer ?? "client", @@ -41053,7 +41730,6 @@ var require_request4 = __commonJS({ configurable: true } }); - webidl.is.Request = webidl.util.MakeTypeAssertion(Request); webidl.converters.RequestInfo = function(V) { if (typeof V === "string") { return webidl.converters.USVString(V); @@ -41147,8 +41823,7 @@ var require_request4 = __commonJS({ { key: "priority", converter: webidl.converters.DOMString, - allowedValues: ["high", "low", "auto"], - defaultValue: () => "auto" + allowedValues: ["high", "low", "auto"] } ]); module2.exports = { @@ -41363,6 +42038,7 @@ var require_fetch2 = __commonJS({ var EE = require("node:events"); var { Readable: Readable2, pipeline, finished, isErrored, isReadable } = require("node:stream"); var { addAbortListener, bufferToLowerCasedHeaderName } = require_util9(); + var { SocketError } = require_errors2(); var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url2(); var { getGlobalDispatcher } = require_global4(); var { webidl } = require_webidl2(); @@ -41820,11 +42496,11 @@ var require_fetch2 = __commonJS({ } function fetchFinale(fetchParams, response) { let timingInfo = fetchParams.timingInfo; + if (fetchParams.request.destination === "document") { + fetchParams.controller.fullTimingInfo = timingInfo; + } const processResponseEndOfBody = () => { const unsafeEndTime = Date.now(); - if (fetchParams.request.destination === "document") { - fetchParams.controller.fullTimingInfo = timingInfo; - } fetchParams.controller.reportTimingSteps = () => { if (!urlIsHttpHttpsScheme(fetchParams.request.url)) { return; @@ -41873,6 +42549,15 @@ var require_fetch2 = __commonJS({ processResponseEndOfBody(); }); } + if (fetchParams.processResponseConsumeBody != null) { + const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes); + const processBodyError = () => fetchParams.processResponseConsumeBody(response, "failure"); + if (internalResponse.body == null) { + queueMicrotask(() => processBody(null)); + } else { + fullyReadBody(internalResponse.body, processBody, processBodyError); + } + } } async function httpFetch(fetchParams) { const request = fetchParams.request; @@ -42423,6 +43108,9 @@ var require_fetch2 = __commonJS({ }, onRequestUpgrade(controller, status, headers, socket) { if (socket.session != null && status !== 200 || socket.session == null && status !== 101) { + if (socket.session != null) { + controller.abort(new SocketError("bad upgrade", null)); + } return false; } const rawHeaders = controller?.rawHeaders ?? []; @@ -42493,7 +43181,7 @@ var require_cache4 = __commonJS({ var { Request, fromInnerRequest, getRequestState } = require_request4(); var { fetching } = require_fetch2(); var { urlIsHttpHttpsScheme, readAllBytes } = require_util10(); - var Cache = class _Cache { + var Cache = class { /** * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list * @type {requestResponseList} @@ -42507,7 +43195,7 @@ var require_cache4 = __commonJS({ this.#relevantRequestResponseList = arguments[1]; } async match(request, options = {}) { - webidl.brandCheck(this, _Cache); + webidl.brandCheck(this, webidl.is.Cache); const prefix = "Cache.match"; webidl.argumentLengthCheck(arguments, 1, prefix); request = webidl.converters.RequestInfo(request); @@ -42519,14 +43207,14 @@ var require_cache4 = __commonJS({ return p[0]; } async matchAll(request = void 0, options = {}) { - webidl.brandCheck(this, _Cache); + webidl.brandCheck(this, webidl.is.Cache); const prefix = "Cache.matchAll"; if (request !== void 0) request = webidl.converters.RequestInfo(request); options = webidl.converters.CacheQueryOptions(options, prefix, "options"); return this.#internalMatchAll(request, options); } async add(request) { - webidl.brandCheck(this, _Cache); + webidl.brandCheck(this, webidl.is.Cache); const prefix = "Cache.add"; webidl.argumentLengthCheck(arguments, 1, prefix); request = webidl.converters.RequestInfo(request); @@ -42535,7 +43223,7 @@ var require_cache4 = __commonJS({ return await responseArrayPromise; } async addAll(requests) { - webidl.brandCheck(this, _Cache); + webidl.brandCheck(this, webidl.is.Cache); const prefix = "Cache.addAll"; webidl.argumentLengthCheck(arguments, 1, prefix); const responsePromises = []; @@ -42597,7 +43285,10 @@ var require_cache4 = __commonJS({ } } }, - processResponseEndOfBody(response) { + // Possible spec bug. If the body is never read, `processResponseEndOfBody` (which is attached to a TransformStream's flush hook) + // never runs, so this would hang. This hook, on the other hand, always reads the body. + // https://github.com/nodejs/undici/issues/5615 + processResponseConsumeBody(response) { if (response.aborted) { responsePromise.reject(new DOMException("aborted", "AbortError")); return; @@ -42640,7 +43331,7 @@ var require_cache4 = __commonJS({ return cacheJobPromise.promise; } async put(request, response) { - webidl.brandCheck(this, _Cache); + webidl.brandCheck(this, webidl.is.Cache); const prefix = "Cache.put"; webidl.argumentLengthCheck(arguments, 2, prefix); request = webidl.converters.RequestInfo(request); @@ -42721,7 +43412,7 @@ var require_cache4 = __commonJS({ return cacheJobPromise.promise; } async delete(request, options = {}) { - webidl.brandCheck(this, _Cache); + webidl.brandCheck(this, webidl.is.Cache); const prefix = "Cache.delete"; webidl.argumentLengthCheck(arguments, 1, prefix); request = webidl.converters.RequestInfo(request); @@ -42767,7 +43458,7 @@ var require_cache4 = __commonJS({ * @returns {Promise} */ async keys(request = void 0, options = {}) { - webidl.brandCheck(this, _Cache); + webidl.brandCheck(this, webidl.is.Cache); const prefix = "Cache.keys"; if (request !== void 0) request = webidl.converters.RequestInfo(request); options = webidl.converters.CacheQueryOptions(options, prefix, "options"); @@ -42976,6 +43667,11 @@ var require_cache4 = __commonJS({ } return Object.freeze(responseList); } + static { + webidl.is.Cache = (arg) => { + return arg != null && typeof arg === "object" && #relevantRequestResponseList in arg; + }; + } }; Object.defineProperties(Cache.prototype, { [Symbol.toStringTag]: { @@ -43036,7 +43732,7 @@ var require_cachestorage2 = __commonJS({ var { webidl } = require_webidl2(); var { kEnumerableProperty } = require_util9(); var { kConstruct } = require_symbols6(); - var CacheStorage = class _CacheStorage { + var CacheStorage = class { /** * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map * @type {Map} */ async has(cacheName) { - webidl.brandCheck(this, _CacheStorage); + webidl.brandCheck(this, webidl.is.CacheStorage); const prefix = "CacheStorage.has"; webidl.argumentLengthCheck(arguments, 1, prefix); cacheName = webidl.converters.DOMString(cacheName, prefix, "cacheName"); @@ -43087,7 +43783,7 @@ var require_cachestorage2 = __commonJS({ * @returns {Promise} */ async open(cacheName) { - webidl.brandCheck(this, _CacheStorage); + webidl.brandCheck(this, webidl.is.CacheStorage); const prefix = "CacheStorage.open"; webidl.argumentLengthCheck(arguments, 1, prefix); cacheName = webidl.converters.DOMString(cacheName, prefix, "cacheName"); @@ -43105,7 +43801,7 @@ var require_cachestorage2 = __commonJS({ * @returns {Promise} */ async delete(cacheName) { - webidl.brandCheck(this, _CacheStorage); + webidl.brandCheck(this, webidl.is.CacheStorage); const prefix = "CacheStorage.delete"; webidl.argumentLengthCheck(arguments, 1, prefix); cacheName = webidl.converters.DOMString(cacheName, prefix, "cacheName"); @@ -43116,10 +43812,15 @@ var require_cachestorage2 = __commonJS({ * @returns {Promise} */ async keys() { - webidl.brandCheck(this, _CacheStorage); + webidl.brandCheck(this, webidl.is.CacheStorage); const keys = this.#caches.keys(); return [...keys]; } + static { + webidl.is.CacheStorage = (arg) => { + return arg != null && typeof arg === "object" && #caches in arg; + }; + } }; Object.defineProperties(CacheStorage.prototype, { [Symbol.toStringTag]: { @@ -43329,7 +44030,7 @@ var require_util12 = __commonJS({ validateCookiePath(cookie.path); out.push(`Path=${cookie.path}`); } - if (cookie.expires && cookie.expires.toString() !== "Invalid Date") { + if (cookie.expires != null && cookie.expires.toString() !== "Invalid Date") { out.push(`Expires=${toIMFDate(cookie.expires)}`); } if (cookie.sameSite) { @@ -43405,90 +44106,93 @@ var require_parse2 = __commonJS({ }; } function parseUnparsedAttributes(unparsedAttributes, cookieAttributeList = {}) { - if (unparsedAttributes.length === 0) { - return cookieAttributeList; - } - assert(unparsedAttributes[0] === ";"); - unparsedAttributes = unparsedAttributes.slice(1); - let cookieAv = ""; - if (unparsedAttributes.includes(";")) { - cookieAv = collectASequenceOfCodePointsFast( - ";", - unparsedAttributes, - { position: 0 } - ); - unparsedAttributes = unparsedAttributes.slice(cookieAv.length); - } else { - cookieAv = unparsedAttributes; - unparsedAttributes = ""; - } - let attributeName = ""; - let attributeValue = ""; - if (cookieAv.includes("=")) { - const position = { position: 0 }; - attributeName = collectASequenceOfCodePointsFast( - "=", - cookieAv, - position - ); - attributeValue = cookieAv.slice(position.position + 1); - } else { - attributeName = cookieAv; - } - attributeName = attributeName.trim(); - attributeValue = attributeValue.trim(); - if (attributeValue.length > maxAttributeValueSize) { - return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); - } - const attributeNameLowercase = attributeName.toLowerCase(); - if (attributeNameLowercase === "expires") { - const expiryTime = new Date(attributeValue); - if (!Number.isNaN(expiryTime.getTime())) { - cookieAttributeList.expires = expiryTime; + while (true) { + if (unparsedAttributes.length === 0) { + return cookieAttributeList; } - } else if (attributeNameLowercase === "max-age") { - const charCode = attributeValue.charCodeAt(0); - if ((charCode < 48 || charCode > 57) && attributeValue[0] !== "-") { - return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); - } - if (!/^\d+$/.test(attributeValue)) { - return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); - } - const deltaSeconds = Number(attributeValue); - cookieAttributeList.maxAge = deltaSeconds; - } else if (attributeNameLowercase === "domain") { - let cookieDomain = attributeValue; - if (cookieDomain[0] === ".") { - cookieDomain = cookieDomain.slice(1); - } - cookieDomain = cookieDomain.toLowerCase(); - cookieAttributeList.domain = cookieDomain; - } else if (attributeNameLowercase === "path") { - let cookiePath = ""; - if (attributeValue.length === 0 || attributeValue[0] !== "/") { - cookiePath = "/"; + assert(unparsedAttributes[0] === ";"); + unparsedAttributes = unparsedAttributes.slice(1); + let cookieAv = ""; + if (unparsedAttributes.includes(";")) { + cookieAv = collectASequenceOfCodePointsFast( + ";", + unparsedAttributes, + { position: 0 } + ); + unparsedAttributes = unparsedAttributes.slice(cookieAv.length); } else { - cookiePath = attributeValue; + cookieAv = unparsedAttributes; + unparsedAttributes = ""; } - cookieAttributeList.path = cookiePath; - } else if (attributeNameLowercase === "secure") { - cookieAttributeList.secure = true; - } else if (attributeNameLowercase === "httponly") { - cookieAttributeList.httpOnly = true; - } else if (attributeNameLowercase === "samesite") { - const attributeValueLowercase = attributeValue.toLowerCase(); - if (attributeValueLowercase === "none") { - cookieAttributeList.sameSite = "None"; - } else if (attributeValueLowercase === "strict") { - cookieAttributeList.sameSite = "Strict"; - } else if (attributeValueLowercase === "lax") { - cookieAttributeList.sameSite = "Lax"; + let attributeName = ""; + let attributeValue = ""; + if (cookieAv.includes("=")) { + const position = { position: 0 }; + attributeName = collectASequenceOfCodePointsFast( + "=", + cookieAv, + position + ); + attributeValue = cookieAv.slice(position.position + 1); + } else { + attributeName = cookieAv; + } + attributeName = attributeName.trim(); + attributeValue = attributeValue.trim(); + if (attributeValue.length > maxAttributeValueSize) { + continue; + } + const attributeNameLowercase = attributeName.toLowerCase(); + if (attributeNameLowercase === "expires") { + const expiryTime = new Date(attributeValue); + if (!Number.isNaN(expiryTime.getTime())) { + cookieAttributeList.expires = expiryTime; + } + } else if (attributeNameLowercase === "max-age") { + const charCode = attributeValue.charCodeAt(0); + const startsWithDigit = charCode >= 48 && charCode <= 57; + const startsWithSignedDigit = attributeValue[0] === "-" && attributeValue.length > 1; + if (!startsWithDigit && !startsWithSignedDigit) { + continue; + } + if (/[^\d]/.test(attributeValue.slice(1))) { + continue; + } + const deltaSeconds = Number(attributeValue); + cookieAttributeList.maxAge = deltaSeconds; + } else if (attributeNameLowercase === "domain") { + let cookieDomain = attributeValue; + if (cookieDomain[0] === ".") { + cookieDomain = cookieDomain.slice(1); + } + cookieDomain = cookieDomain.toLowerCase(); + cookieAttributeList.domain = cookieDomain; + } else if (attributeNameLowercase === "path") { + let cookiePath = ""; + if (attributeValue.length === 0 || attributeValue[0] !== "/") { + cookiePath = "/"; + } else { + cookiePath = attributeValue; + } + cookieAttributeList.path = cookiePath; + } else if (attributeNameLowercase === "secure") { + cookieAttributeList.secure = true; + } else if (attributeNameLowercase === "httponly") { + cookieAttributeList.httpOnly = true; + } else if (attributeNameLowercase === "samesite") { + const attributeValueLowercase = attributeValue.toLowerCase(); + if (attributeValueLowercase === "none") { + cookieAttributeList.sameSite = "None"; + } else if (attributeValueLowercase === "strict") { + cookieAttributeList.sameSite = "Strict"; + } else if (attributeValueLowercase === "lax") { + cookieAttributeList.sameSite = "Lax"; + } + } else { + cookieAttributeList.unparsed ??= []; + cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`); } - } else { - cookieAttributeList.unparsed ??= []; - cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`); } - return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); } module2.exports = { parseSetCookie, @@ -43504,13 +44208,21 @@ var require_cookies2 = __commonJS({ var { parseSetCookie } = require_parse2(); var { stringify } = require_util12(); var { webidl } = require_webidl2(); - var { Headers: Headers2 } = require_headers2(); - var brandChecks = webidl.brandCheckMultiple([Headers2, globalThis.Headers].filter(Boolean)); + var globalHeadersBrandCheck = (arg) => webidl.brandCheck(arg, webidl.util.MakeTypeAssertion(globalThis.Headers)); + var undiciHeadersBrandCheck = (arg) => webidl.brandCheck(arg, webidl.is.Headers); + function brandCheckHeaders(arg) { + try { + undiciHeadersBrandCheck(arg); + return; + } catch { + } + globalHeadersBrandCheck(arg); + } function getCookies(headers) { webidl.argumentLengthCheck(arguments, 1, "getCookies"); - brandChecks(headers); + brandCheckHeaders(headers); const cookie = headers.get("cookie"); - const out = {}; + const out = { __proto__: null }; if (!cookie) { return out; } @@ -43521,7 +44233,7 @@ var require_cookies2 = __commonJS({ return out; } function deleteCookie(headers, name, attributes) { - brandChecks(headers); + brandCheckHeaders(headers); const prefix = "deleteCookie"; webidl.argumentLengthCheck(arguments, 2, prefix); name = webidl.converters.DOMString(name, prefix, "name"); @@ -43535,7 +44247,7 @@ var require_cookies2 = __commonJS({ } function getSetCookies(headers) { webidl.argumentLengthCheck(arguments, 1, "getSetCookies"); - brandChecks(headers); + brandCheckHeaders(headers); const cookies = headers.getSetCookie(); if (!cookies) { return []; @@ -43548,7 +44260,7 @@ var require_cookies2 = __commonJS({ } function setCookie(headers, cookie) { webidl.argumentLengthCheck(arguments, 2, "setCookie"); - brandChecks(headers); + brandCheckHeaders(headers); cookie = webidl.converters.Cookie(cookie); const str = stringify(cookie); if (str) { @@ -43639,6 +44351,7 @@ var require_events2 = __commonJS({ var { webidl } = require_webidl2(); var { kEnumerableProperty } = require_util9(); var { kConstruct } = require_symbols6(); + var createFastMessageEvent; var MessageEvent = class _MessageEvent extends Event { #eventInit; constructor(type, eventInitDict = {}) { @@ -43656,30 +44369,30 @@ var require_events2 = __commonJS({ webidl.util.markAsUncloneable(this); } get data() { - webidl.brandCheck(this, _MessageEvent); + webidl.brandCheck(this, webidl.is.MessageEvent); return this.#eventInit.data; } get origin() { - webidl.brandCheck(this, _MessageEvent); + webidl.brandCheck(this, webidl.is.MessageEvent); return this.#eventInit.origin; } get lastEventId() { - webidl.brandCheck(this, _MessageEvent); + webidl.brandCheck(this, webidl.is.MessageEvent); return this.#eventInit.lastEventId; } get source() { - webidl.brandCheck(this, _MessageEvent); + webidl.brandCheck(this, webidl.is.MessageEvent); return this.#eventInit.source; } get ports() { - webidl.brandCheck(this, _MessageEvent); + webidl.brandCheck(this, webidl.is.MessageEvent); if (!Object.isFrozen(this.#eventInit.ports)) { Object.freeze(this.#eventInit.ports); } return this.#eventInit.ports; } initMessageEvent(type, bubbles = false, cancelable = false, data = null, origin = "", lastEventId = "", source = null, ports = []) { - webidl.brandCheck(this, _MessageEvent); + webidl.brandCheck(this, webidl.is.MessageEvent); webidl.argumentLengthCheck(arguments, 1, "MessageEvent.initMessageEvent"); return new _MessageEvent(type, { bubbles, @@ -43691,20 +44404,23 @@ var require_events2 = __commonJS({ ports }); } - static createFastMessageEvent(type, init) { - const messageEvent = new _MessageEvent(kConstruct, type, init); - messageEvent.#eventInit = init; - messageEvent.#eventInit.data ??= null; - messageEvent.#eventInit.origin ??= ""; - messageEvent.#eventInit.lastEventId ??= ""; - messageEvent.#eventInit.source ??= null; - messageEvent.#eventInit.ports ??= []; - return messageEvent; + static { + createFastMessageEvent = (type, init) => { + const messageEvent = new _MessageEvent(kConstruct, type, init); + messageEvent.#eventInit = init; + messageEvent.#eventInit.data ??= null; + messageEvent.#eventInit.origin ??= ""; + messageEvent.#eventInit.lastEventId ??= ""; + messageEvent.#eventInit.source ??= null; + messageEvent.#eventInit.ports ??= []; + return messageEvent; + }; + webidl.is.MessageEvent = (arg) => { + return arg != null && typeof arg === "object" && #eventInit in arg; + }; } }; - var { createFastMessageEvent } = MessageEvent; - delete MessageEvent.createFastMessageEvent; - var CloseEvent = class _CloseEvent extends Event { + var CloseEvent = class extends Event { #eventInit; constructor(type, eventInitDict = {}) { const prefix = "CloseEvent constructor"; @@ -43716,19 +44432,24 @@ var require_events2 = __commonJS({ webidl.util.markAsUncloneable(this); } get wasClean() { - webidl.brandCheck(this, _CloseEvent); + webidl.brandCheck(this, webidl.is.CloseEvent); return this.#eventInit.wasClean; } get code() { - webidl.brandCheck(this, _CloseEvent); + webidl.brandCheck(this, webidl.is.CloseEvent); return this.#eventInit.code; } get reason() { - webidl.brandCheck(this, _CloseEvent); + webidl.brandCheck(this, webidl.is.CloseEvent); return this.#eventInit.reason; } + static { + webidl.is.CloseEvent = (arg) => { + return arg != null && typeof arg === "object" && #eventInit in arg; + }; + } }; - var ErrorEvent = class _ErrorEvent extends Event { + var ErrorEvent = class extends Event { #eventInit; constructor(type, eventInitDict) { const prefix = "ErrorEvent constructor"; @@ -43740,25 +44461,30 @@ var require_events2 = __commonJS({ this.#eventInit = eventInitDict; } get message() { - webidl.brandCheck(this, _ErrorEvent); + webidl.brandCheck(this, webidl.is.ErrorEvent); return this.#eventInit.message; } get filename() { - webidl.brandCheck(this, _ErrorEvent); + webidl.brandCheck(this, webidl.is.ErrorEvent); return this.#eventInit.filename; } get lineno() { - webidl.brandCheck(this, _ErrorEvent); + webidl.brandCheck(this, webidl.is.ErrorEvent); return this.#eventInit.lineno; } get colno() { - webidl.brandCheck(this, _ErrorEvent); + webidl.brandCheck(this, webidl.is.ErrorEvent); return this.#eventInit.colno; } get error() { - webidl.brandCheck(this, _ErrorEvent); + webidl.brandCheck(this, webidl.is.ErrorEvent); return this.#eventInit.error; } + static { + webidl.is.ErrorEvent = (arg) => { + return arg != null && typeof arg === "object" && #eventInit in arg; + }; + } }; Object.defineProperties(MessageEvent.prototype, { [Symbol.toStringTag]: { @@ -44323,7 +45049,7 @@ var require_connection2 = __commonJS({ const secProtocol = response.headersList.get("Sec-WebSocket-Protocol"); if (secProtocol !== null) { const requestProtocols = getDecodeSplit("sec-websocket-protocol", request.headersList); - if (!requestProtocols.includes(secProtocol)) { + if (requestProtocols === null || !requestProtocols.includes(secProtocol)) { failWebsocketConnection(handler, 1002, "Protocol was not set in the opening handshake."); return; } @@ -44441,6 +45167,7 @@ var require_permessage_deflate2 = __commonJS({ if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) { callback(new MessageSizeExceededError()); this.#inflate.removeAllListeners(); + this.#inflate.destroy(); this.#inflate = null; return; } @@ -44743,6 +45470,7 @@ var require_receiver2 = __commonJS({ } consumeFragments() { const fragments = this.#fragments; + this.#info.compressed = false; if (fragments.length === 1) { this.#fragmentsBytes = 0; return fragments.shift(); @@ -44946,6 +45674,7 @@ var require_websocket2 = __commonJS({ var { channels } = require_diagnostics2(); var kRef = /* @__PURE__ */ Symbol.for("nodejs.ref"); var kUnref = /* @__PURE__ */ Symbol.for("nodejs.unref"); + var ping; function getSocketAddress(socket) { if (typeof socket?.address === "function") { return socket.address(); @@ -45048,13 +45777,13 @@ var require_websocket2 = __commonJS({ this.#handler.readyState = _WebSocket.CONNECTING; this.#binaryType = "blob"; } + // TODO: remove this [kRef]() { - webidl.brandCheck(this, _WebSocket); this.#refed = true; this.#handler.socket?.ref?.(); } + // TODO: remove this [kUnref]() { - webidl.brandCheck(this, _WebSocket); this.#refed = false; this.#handler.socket?.unref?.(); } @@ -45064,7 +45793,7 @@ var require_websocket2 = __commonJS({ * @param {string|undefined} reason */ close(code = void 0, reason = void 0) { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); const prefix = "WebSocket.close"; if (code !== void 0) { code = webidl.converters["unsigned short"](code, prefix, "code", webidl.attributes.Clamp); @@ -45081,7 +45810,7 @@ var require_websocket2 = __commonJS({ * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data */ send(data) { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); const prefix = "WebSocket.send"; webidl.argumentLengthCheck(arguments, 1, prefix); data = webidl.converters.WebSocketSendData(data, prefix, "data"); @@ -45115,31 +45844,31 @@ var require_websocket2 = __commonJS({ } } get readyState() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return this.#handler.readyState; } get bufferedAmount() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return this.#bufferedAmount; } get url() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return URLSerializer(this.#url); } get extensions() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return this.#extensions; } get protocol() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return this.#protocol; } get onopen() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return this.#events.open; } set onopen(fn) { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); if (this.#events.open) { this.removeEventListener("open", this.#events.open); } @@ -45152,11 +45881,11 @@ var require_websocket2 = __commonJS({ } } get onerror() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return this.#events.error; } set onerror(fn) { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); if (this.#events.error) { this.removeEventListener("error", this.#events.error); } @@ -45169,11 +45898,11 @@ var require_websocket2 = __commonJS({ } } get onclose() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return this.#events.close; } set onclose(fn) { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); if (this.#events.close) { this.removeEventListener("close", this.#events.close); } @@ -45186,11 +45915,11 @@ var require_websocket2 = __commonJS({ } } get onmessage() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return this.#events.message; } set onmessage(fn) { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); if (this.#events.message) { this.removeEventListener("message", this.#events.message); } @@ -45203,11 +45932,11 @@ var require_websocket2 = __commonJS({ } } get binaryType() { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); return this.#binaryType; } set binaryType(type) { - webidl.brandCheck(this, _WebSocket); + webidl.brandCheck(this, webidl.is.WebSocket); if (type !== "blob" && type !== "arraybuffer") { this.#binaryType = "blob"; } else { @@ -45317,27 +46046,26 @@ var require_websocket2 = __commonJS({ }); } } - /** - * @param {WebSocket} ws - * @param {Buffer|undefined} buffer - */ - static ping(ws, buffer) { - if (Buffer.isBuffer(buffer)) { - if (buffer.length > 125) { - throw new TypeError("A PING frame cannot have a body larger than 125 bytes."); + static { + ping = (ws, buffer) => { + if (Buffer.isBuffer(buffer)) { + if (buffer.length > 125) { + throw new TypeError("A PING frame cannot have a body larger than 125 bytes."); + } + } else if (buffer !== void 0) { + throw new TypeError("Expected buffer payload"); } - } else if (buffer !== void 0) { - throw new TypeError("Expected buffer payload"); - } - const readyState = ws.#handler.readyState; - if (isEstablished(readyState) && !isClosing(readyState) && !isClosed(readyState)) { - const frame = new WebsocketFrameSend(buffer); - ws.#handler.socket.write(frame.createFrame(opcodes.PING)); - } + const readyState = ws.#handler.readyState; + if (isEstablished(readyState) && !isClosing(readyState) && !isClosed(readyState)) { + const frame = new WebsocketFrameSend(buffer); + ws.#handler.socket.write(frame.createFrame(opcodes.PING)); + } + }; + webidl.is.WebSocket = (arg) => { + return arg != null && typeof arg === "object" && #handler in arg; + }; } }; - var { ping } = WebSocket; - Reflect.deleteProperty(WebSocket, "ping"); WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING; WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN; WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING; @@ -45446,6 +46174,7 @@ var require_websocketerror = __commonJS({ } }); } + var createUnvalidatedWebSocketError; var WebSocketError = class _WebSocketError extends createInheritableDOMException() { #closeCode; #reason; @@ -45472,20 +46201,18 @@ var require_websocketerror = __commonJS({ get reason() { return this.#reason; } - /** - * @param {string} message - * @param {number|null} code - * @param {string} reason - */ - static createUnvalidatedWebSocketError(message, code, reason) { - const error2 = new _WebSocketError(message, kConstruct); - error2.#closeCode = code; - error2.#reason = reason; - return error2; + static { + createUnvalidatedWebSocketError = (message, code, reason) => { + const error2 = new _WebSocketError(message, kConstruct); + error2.#closeCode = code; + error2.#reason = reason; + return error2; + }; + webidl.is.WebSocketError = (arg) => { + return arg != null && typeof arg === "object" && #reason in arg; + }; } }; - var { createUnvalidatedWebSocketError } = WebSocketError; - delete WebSocketError.createUnvalidatedWebSocketError; Object.defineProperties(WebSocketError.prototype, { closeCode: kEnumerableProperty, reason: kEnumerableProperty, @@ -45496,7 +46223,6 @@ var require_websocketerror = __commonJS({ configurable: true } }); - webidl.is.WebSocketError = webidl.util.MakeTypeAssertion(WebSocketError); module2.exports = { WebSocketError, createUnvalidatedWebSocketError }; } }); @@ -45533,9 +46259,9 @@ var require_websocketstream = __commonJS({ #readableStream; /** @type {ReadableStreamDefaultController} */ #readableStreamController; - // Each WebSocketStream object has an associated writable stream , which is a WritableStream . - /** @type {WritableStream} */ - #writableStream; + // Retain the controller so the writable stream can be errored while locked. + /** @type {WritableStreamDefaultController} */ + #writableStreamController; // Each WebSocketStream object has an associated boolean handshake aborted , which is initially false. #handshakeAborted = false; /** @type {import('../websocket').Handler} */ @@ -45690,12 +46416,14 @@ var require_websocketstream = __commonJS({ cancel: (reason) => this.#cancel(reason) }); const writable = new WritableStream({ + start: (controller) => { + this.#writableStreamController = controller; + }, write: (chunk) => this.#write(chunk), close: () => closeWebSocketConnection(this.#handler, null, null), abort: (reason) => this.#closeUsingReason(reason) }); this.#readableStream = readable; - this.#writableStream = writable; this.#openedPromise.resolve({ extensions, protocol, @@ -45739,9 +46467,7 @@ var require_websocketstream = __commonJS({ const reason = result?.reason == null ? "" : utf8DecodeBytes(Buffer.from(result.reason)); if (wasClean) { readableStreamClose(this.#readableStreamController); - if (!this.#writableStream.locked) { - this.#writableStream.abort(new DOMException("A closed WebSocketStream cannot be written to", "InvalidStateError")); - } + this.#writableStreamController.error(new DOMException("A closed WebSocketStream cannot be written to", "InvalidStateError")); this.#closedPromise.resolve({ closeCode: code, reason @@ -45749,7 +46475,7 @@ var require_websocketstream = __commonJS({ } else { const error2 = createUnvalidatedWebSocketError("unclean close", code, reason); this.#readableStreamController?.error(error2); - this.#writableStream?.abort(error2); + this.#writableStreamController?.error(error2); this.#closedPromise.reject(error2); } } @@ -45856,6 +46582,7 @@ var require_util14 = __commonJS({ var require_eventsource_stream2 = __commonJS({ "node_modules/undici/lib/web/eventsource/eventsource-stream.js"(exports2, module2) { "use strict"; + var buffer = require("node:buffer"); var { Transform } = require("node:stream"); var { isASCIINumber, isValidLastEventId } = require_util14(); var BOM = [239, 187, 191]; @@ -45863,24 +46590,25 @@ var require_eventsource_stream2 = __commonJS({ var CR = 13; var COLON = 58; var SPACE = 32; + var defaultMaxEventSize = buffer.kStringMaxLength; var DATA = Buffer.from("data"); var EVENT = Buffer.from("event"); var ID = Buffer.from("id"); var RETRY = Buffer.from("retry"); - function isASCIINumberBytes(buffer, start) { - if (start >= buffer.length) { + function isASCIINumberBytes(buffer2, start) { + if (start >= buffer2.length) { return false; } - for (let i = start; i < buffer.length; i++) { - if (buffer[i] < 48 || buffer[i] > 57) { + for (let i = start; i < buffer2.length; i++) { + if (buffer2[i] < 48 || buffer2[i] > 57) { return false; } } return true; } - function isValidLastEventIdBytes(buffer, start) { - for (let i = start; i < buffer.length; i++) { - if (buffer[i] === 0) { + function isValidLastEventIdBytes(buffer2, start) { + for (let i = start; i < buffer2.length; i++) { + if (buffer2[i] === 0) { return false; } } @@ -45897,6 +46625,11 @@ var require_eventsource_stream2 = __commonJS({ } return true; } + function createMaxEventSizeExceededError() { + const error2 = new Error("EventSource message size exceeded"); + error2.aborted = false; + return error2; + } var EventSourceStream = class extends Transform { /** * @type {eventSourceSettings} @@ -45923,6 +46656,8 @@ var require_eventsource_stream2 = __commonJS({ pos = 0; lineChunkIndex = 0; linePos = 0; + eventDataSize = 0; + maxEventSize; event = { data: void 0, event: void 0, @@ -45932,6 +46667,7 @@ var require_eventsource_stream2 = __commonJS({ /** * @param {object} options * @param {boolean} [options.readableObjectMode] + * @param {number} [options.maxEventSize] * @param {eventSourceSettings} [options.eventSourceSettings] * @param {(chunk: any, encoding?: BufferEncoding | undefined) => boolean} [options.push] */ @@ -45939,6 +46675,7 @@ var require_eventsource_stream2 = __commonJS({ options.readableObjectMode = true; super(options); this.state = options.eventSourceSettings || {}; + this.maxEventSize = options.maxEventSize ?? defaultMaxEventSize; if (options.push) { this.push = options.push; } @@ -45990,7 +46727,12 @@ var require_eventsource_stream2 = __commonJS({ if (byte === CR) { this.crlfCheck = true; } - this.parseLine(this.readLine(), this.event); + try { + this.parseLine(this.readLine(), this.event); + } catch (error2) { + callback(error2); + return; + } this.consumeCurrentByte(); this.eventEndCheck = true; continue; @@ -46021,6 +46763,11 @@ var require_eventsource_stream2 = __commonJS({ } } if (isFieldName(line, fieldLength, DATA)) { + const valueBytes = line.length - valueStart; + const eventDataSize = this.eventDataSize + (event.data === void 0 ? 0 : 1) + valueBytes; + if (this.maxEventSize > 0 && eventDataSize > this.maxEventSize) { + throw createMaxEventSizeExceededError(); + } const value = line.toString("utf8", valueStart); if (event.data === void 0) { event.data = value; @@ -46028,6 +46775,7 @@ var require_eventsource_stream2 = __commonJS({ event.data += ` ${value}`; } + this.eventDataSize = eventDataSize; return; } if (isFieldName(line, fieldLength, RETRY)) { @@ -46075,6 +46823,7 @@ ${value}`; this.event.event = void 0; this.event.id = void 0; this.event.retry = void 0; + this.eventDataSize = 0; } hasPendingEvent() { return this.event.data !== void 0 || this.event.event !== void 0 || this.event.id !== void 0 || this.event.retry !== void 0; @@ -46204,9 +46953,12 @@ var require_eventsource2 = __commonJS({ var { parseMIMEType } = require_data_url2(); var { createFastMessageEvent } = require_events2(); var { isNetworkError } = require_response2(); - var { kEnumerableProperty } = require_util9(); + var { isValidHeaderValue, kEnumerableProperty } = require_util9(); var { environmentSettingsObject } = require_util10(); var { createPotentialCORSRequest } = require_util14(); + var { getGlobalDispatcher } = require_global4(); + var { isomorphicDecode } = require_infra(); + var textEncoder = new TextEncoder(); var experimentalWarned = false; var defaultReconnectionTime = 3e3; var CONNECTING = 0; @@ -46214,7 +46966,7 @@ var require_eventsource2 = __commonJS({ var CLOSED = 2; var ANONYMOUS = "anonymous"; var USE_CREDENTIALS = "use-credentials"; - var EventSource = class _EventSource extends EventTarget { + var EventSource = class extends EventTarget { #events = { open: null, error: null, @@ -46286,6 +47038,7 @@ var require_eventsource2 = __commonJS({ * @readonly */ get readyState() { + webidl.brandCheck(this, webidl.is.EventSource); return this.#readyState; } /** @@ -46294,6 +47047,7 @@ var require_eventsource2 = __commonJS({ * @returns {string} */ get url() { + webidl.brandCheck(this, webidl.is.EventSource); return this.#url; } /** @@ -46301,6 +47055,7 @@ var require_eventsource2 = __commonJS({ * instantiated with CORS credentials set (true), or not (false, the default). */ get withCredentials() { + webidl.brandCheck(this, webidl.is.EventSource); return this.#withCredentials; } #connect() { @@ -46340,6 +47095,7 @@ var require_eventsource2 = __commonJS({ this.#state.origin = response.urlList[response.urlList.length - 1].origin; const eventSourceStream = new EventSourceStream({ eventSourceSettings: this.#state, + maxEventSize: this.#dispatcher.eventSourceOptions?.maxEventSize, push: (event) => { this.dispatchEvent(createFastMessageEvent( event.type, @@ -46370,8 +47126,12 @@ var require_eventsource2 = __commonJS({ this.dispatchEvent(new Event("error")); setTimeout(() => { if (this.#readyState !== CONNECTING) return; + this.#request.headersList.delete("last-event-id", true); if (this.#state.lastEventId.length) { - this.#request.headersList.set("last-event-id", this.#state.lastEventId, true); + const lastEventId = isomorphicDecode(textEncoder.encode(this.#state.lastEventId)); + if (isValidHeaderValue(lastEventId)) { + this.#request.headersList.set("last-event-id", lastEventId, true); + } } this.#connect(); }, this.#state.reconnectionTime)?.unref(); @@ -46381,16 +47141,18 @@ var require_eventsource2 = __commonJS({ * CLOSED. */ close() { - webidl.brandCheck(this, _EventSource); + webidl.brandCheck(this, webidl.is.EventSource); if (this.#readyState === CLOSED) return; this.#readyState = CLOSED; this.#controller.abort(); this.#request = null; } get onopen() { + webidl.brandCheck(this, webidl.is.EventSource); return this.#events.open; } set onopen(fn) { + webidl.brandCheck(this, webidl.is.EventSource); if (this.#events.open) { this.removeEventListener("open", this.#events.open); } @@ -46403,9 +47165,11 @@ var require_eventsource2 = __commonJS({ } } get onmessage() { + webidl.brandCheck(this, webidl.is.EventSource); return this.#events.message; } set onmessage(fn) { + webidl.brandCheck(this, webidl.is.EventSource); if (this.#events.message) { this.removeEventListener("message", this.#events.message); } @@ -46418,9 +47182,11 @@ var require_eventsource2 = __commonJS({ } } get onerror() { + webidl.brandCheck(this, webidl.is.EventSource); return this.#events.error; } set onerror(fn) { + webidl.brandCheck(this, webidl.is.EventSource); if (this.#events.error) { this.removeEventListener("error", this.#events.error); } @@ -46432,6 +47198,11 @@ var require_eventsource2 = __commonJS({ this.#events.error = null; } } + static { + webidl.is.EventSource = (arg) => { + return arg != null && typeof arg === "object" && #events in arg; + }; + } }; var constantsPropertyDescriptors = { CONNECTING: { @@ -46476,7 +47247,8 @@ var require_eventsource2 = __commonJS({ { key: "dispatcher", // undici only - converter: webidl.converters.any + converter: webidl.converters.any, + defaultValue: () => getGlobalDispatcher() }, { key: "node", diff --git a/package-lock.json b/package-lock.json index 852d979..15db0be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,16 +17,16 @@ "@actions/tool-cache": "^4.0.0", "@renovatebot/pep440": "^5.0.0", "smol-toml": "^1.8.0", - "undici": "^8.10.0" + "undici": "^8.11.0" }, "devDependencies": { - "@biomejs/biome": "^2.5.11", + "@biomejs/biome": "^2.5.14", "@types/js-yaml": "^4.0.9", - "@types/node": "^26.4.0", + "@types/node": "^26.6.2", "@types/semver": "^7.8.0", "@vercel/ncc": "^0.45.0", "esbuild": "^0.28.2", - "jest": "^30.5.0", + "jest": "^30.5.2", "js-yaml": "^5.4.1", "ts-jest": "^29.4.11", "typescript": "^6.0.3" @@ -912,9 +912,9 @@ "license": "MIT" }, "node_modules/@biomejs/biome": { - "version": "2.5.11", - "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.5.11.tgz", - "integrity": "sha512-Tj0dnkLPdW0ASjHfj2D/ZkkvPU2wrFmnE1jWTD2xzV1ycapV1DutbYXk4NDnR3rYTi1ZCbNFD4G2gRMEY65WaA==", + "version": "2.5.14", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.5.14.tgz", + "integrity": "sha512-0FabLIjd4M/dm8VFI86RMaLLdgepzbdfiAL2R8cr7V81OYYrP1w7Z73KfAwPK5h9SrEBXTzNG2y+mBwPo9xRnw==", "dev": true, "license": "MIT OR Apache-2.0", "bin": { @@ -928,20 +928,20 @@ "url": "https://opencollective.com/biome" }, "optionalDependencies": { - "@biomejs/cli-darwin-arm64": "2.5.11", - "@biomejs/cli-darwin-x64": "2.5.11", - "@biomejs/cli-linux-arm64": "2.5.11", - "@biomejs/cli-linux-arm64-musl": "2.5.11", - "@biomejs/cli-linux-x64": "2.5.11", - "@biomejs/cli-linux-x64-musl": "2.5.11", - "@biomejs/cli-win32-arm64": "2.5.11", - "@biomejs/cli-win32-x64": "2.5.11" + "@biomejs/cli-darwin-arm64": "2.5.14", + "@biomejs/cli-darwin-x64": "2.5.14", + "@biomejs/cli-linux-arm64": "2.5.14", + "@biomejs/cli-linux-arm64-musl": "2.5.14", + "@biomejs/cli-linux-x64": "2.5.14", + "@biomejs/cli-linux-x64-musl": "2.5.14", + "@biomejs/cli-win32-arm64": "2.5.14", + "@biomejs/cli-win32-x64": "2.5.14" } }, "node_modules/@biomejs/cli-darwin-arm64": { - "version": "2.5.11", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.5.11.tgz", - "integrity": "sha512-6SGZxoKbXvUjMn1t6A98HqWISPnGNbYs0R/Rt2JarmXBSev+lva4QxUMWEBX9lX1Wo1XTJ78uk5xVDtG58SRZg==", + "version": "2.5.14", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.5.14.tgz", + "integrity": "sha512-UnzaXO65L4tsZimFITFP2M121GyhDcWFrT3pL5ZJ5U4XcS/0L5VHYytVohdCf/gnDUFHgl2I9xnt5bV/J1kxHQ==", "cpu": [ "arm64" ], @@ -956,9 +956,9 @@ } }, "node_modules/@biomejs/cli-darwin-x64": { - "version": "2.5.11", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.5.11.tgz", - "integrity": "sha512-nYkXY7tLBEgnGbYapDKAyKzgt44ZEyG+AKalvTXtCWKYgepI9dw327q+cVgedxm+Udi1ZzHKUyZrIusHi/KQbw==", + "version": "2.5.14", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.5.14.tgz", + "integrity": "sha512-kiy8qA16K93J7uvFfWi4LgjqDpnRKyePAna6A0Y4jxyUga35SYpIZ2cNWlhy0lsfgqRenCpfymnJWEZ6mgpRgA==", "cpu": [ "x64" ], @@ -973,13 +973,16 @@ } }, "node_modules/@biomejs/cli-linux-arm64": { - "version": "2.5.11", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.5.11.tgz", - "integrity": "sha512-3PVLSTD9RR73rvVPt5G3T1gc+ycggWEGfTD7RvzzbtcDPD27NxgxBbAFfpm7DXJKW6VLHWE1lLMGvFt2Qxjcow==", + "version": "2.5.14", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.5.14.tgz", + "integrity": "sha512-vO/9BaU1n30CiFNLx49gMTMtbCAAqlo/EqFoG0BU3deQInTbJrmXSmTQ9e3FoDZIKQnvSLDVNL4lx1ci7y1T1Q==", "cpu": [ "arm64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT OR Apache-2.0", "optional": true, "os": [ @@ -990,13 +993,16 @@ } }, "node_modules/@biomejs/cli-linux-arm64-musl": { - "version": "2.5.11", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.5.11.tgz", - "integrity": "sha512-qhyZUMyCbWYFV2bAwRNVvfMVZ+hv7WYl6mossGrxC+uiQQXhvsuWWU8zz6jYX0mChZd9MgQZbm4vozTmG/5iGw==", + "version": "2.5.14", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.5.14.tgz", + "integrity": "sha512-SJ9PrZkBnnH9dHJDnxk34vKs0GB2dbsioaft6/hPhWJ7AHpwYH83Isnhj0FSRpFkGgpVfJ1lds23ApB2czUDLQ==", "cpu": [ "arm64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT OR Apache-2.0", "optional": true, "os": [ @@ -1007,13 +1013,16 @@ } }, "node_modules/@biomejs/cli-linux-x64": { - "version": "2.5.11", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.5.11.tgz", - "integrity": "sha512-JOytptlsgM33B2MMFUg8iBrb4IKpbD5JnJrSeYiaFEeAj4vuXx0iQSQZ4qK7sqyMtfjZxxPdNdMZZVL4y/mFyA==", + "version": "2.5.14", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.5.14.tgz", + "integrity": "sha512-VHZRa7CCQBUWKxNwUvHJeuW03WFRgN5NWO//SDGOitc9QIeNyfA42V9zlKm+x82xFSG9Bzi5fi+hbhm9anO8yA==", "cpu": [ "x64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT OR Apache-2.0", "optional": true, "os": [ @@ -1024,13 +1033,16 @@ } }, "node_modules/@biomejs/cli-linux-x64-musl": { - "version": "2.5.11", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.5.11.tgz", - "integrity": "sha512-oRRlrchG5EfrEL/EmtT1qUjSNHk3/5LGeZhQqADBBAJF1b1ET6964xEKe7aGlGARzDfza8H/seEsFJl7S6Ql9w==", + "version": "2.5.14", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.5.14.tgz", + "integrity": "sha512-2kI5PrMgW5dcEZYrstLPmUmCwkUwZY39rP4BN93Vxbwcs2O57LDQOktUZZYPvvspN5i0mhGr3TJtF5sU26NUWg==", "cpu": [ "x64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT OR Apache-2.0", "optional": true, "os": [ @@ -1041,9 +1053,9 @@ } }, "node_modules/@biomejs/cli-win32-arm64": { - "version": "2.5.11", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.5.11.tgz", - "integrity": "sha512-e49E6K9hzH/ohJNx8Y26mY8HaV4I4ZViIeoqhKsmoXLKHhQnMeBAVqCgsGf2Wa3lXlS7RkporDXMHHWkzvZzFw==", + "version": "2.5.14", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.5.14.tgz", + "integrity": "sha512-pHgAFffmZtaYoxavEsWEYNvcA7NwOIjLyqw2HXyLbt16xYryX0L4fMV2u0G9ag6LNYPIoqWaWqzUcnc6rLGGXg==", "cpu": [ "arm64" ], @@ -1058,9 +1070,9 @@ } }, "node_modules/@biomejs/cli-win32-x64": { - "version": "2.5.11", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.5.11.tgz", - "integrity": "sha512-QSQr/KjOgXA7OzXJUWS+oguKyAZ3Q0l/lnlDGbu397eKo83atuWUjBPJrsqbKNF6CARGw8XXJLGzpHC8Ryhd4Q==", + "version": "2.5.14", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.5.14.tgz", + "integrity": "sha512-oJWmBhoHsnhUKIke+0gXDX0mltJrWHA1UyHsrTlXwX0TL64ilVZAo+TYZm97baecV0esBdpzy3k96q+09JaZUQ==", "cpu": [ "x64" ], @@ -1074,40 +1086,6 @@ "node": ">=14.21.3" } }, - "node_modules/@emnapi/core": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz", - "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/wasi-threads": "1.2.1", - "tslib": "^2.4.0" - } - }, - "node_modules/@emnapi/runtime": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", - "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@emnapi/wasi-threads": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", - "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, "node_modules/@esbuild/aix-ppc64": { "version": "0.28.2", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", @@ -1704,17 +1682,17 @@ } }, "node_modules/@jest/console": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-30.5.0.tgz", - "integrity": "sha512-BI1DpOedrJqbrYVi9yNhDWGjqphR/+gsM4STmg2+VaeXm7851hvpBDyKOZGMXATTrGEnFuEseQvLCtrrRmG0GQ==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-30.5.2.tgz", + "integrity": "sha512-e8sQC4pCMHPBrPX7Hk8TJr+DM5dkUnImSTNag8SEWFAFAF6xIz4AJvCKapnrdHnZxep4bxw4PhG+ZbimYBMyKw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "30.5.0", + "@jest/types": "30.5.1", "@types/node": "*", "chalk": "^4.1.2", - "jest-message-util": "30.5.0", - "jest-util": "30.5.0", + "jest-message-util": "30.5.1", + "jest-util": "30.5.1", "slash": "^3.0.0" }, "engines": { @@ -1722,18 +1700,18 @@ } }, "node_modules/@jest/core": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-30.5.0.tgz", - "integrity": "sha512-DLjRME+NY//j+UDTSfWnjoP0srrdR3DrJRy7yFZktGIwzpN2iVy2vMo0jziZ5c2Ij7bOwlJRXKVWtxZusazOJg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-30.5.2.tgz", + "integrity": "sha512-/jqvFWoJF7LV1a6AUpYMbMm+2yIYsHJfR474H0SCzr9k8tnO/jl9wRg6zSG6lxgf6EozNlCG4amFzWsbZSvvZA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/console": "30.5.0", + "@jest/console": "30.5.2", "@jest/pattern": "30.5.0", - "@jest/reporters": "30.5.0", - "@jest/test-result": "30.5.0", - "@jest/transform": "30.5.0", - "@jest/types": "30.5.0", + "@jest/reporters": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/transform": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", "ansi-escapes": "^4.3.2", "chalk": "^4.1.2", @@ -1741,20 +1719,20 @@ "exit-x": "^0.2.2", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.11", - "jest-changed-files": "30.5.0", - "jest-config": "30.5.0", - "jest-haste-map": "30.5.0", - "jest-message-util": "30.5.0", + "jest-changed-files": "30.5.1", + "jest-config": "30.5.2", + "jest-haste-map": "30.5.1", + "jest-message-util": "30.5.1", "jest-regex-util": "30.5.0", - "jest-resolve": "30.5.0", - "jest-resolve-dependencies": "30.5.0", - "jest-runner": "30.5.0", - "jest-runtime": "30.5.0", - "jest-snapshot": "30.5.0", - "jest-util": "30.5.0", - "jest-validate": "30.5.0", - "jest-watcher": "30.5.0", - "pretty-format": "30.5.0", + "jest-resolve": "30.5.1", + "jest-resolve-dependencies": "30.5.2", + "jest-runner": "30.5.2", + "jest-runtime": "30.5.2", + "jest-snapshot": "30.5.2", + "jest-util": "30.5.1", + "jest-validate": "30.5.1", + "jest-watcher": "30.5.2", + "pretty-format": "30.5.1", "slash": "^3.0.0" }, "engines": { @@ -1780,39 +1758,39 @@ } }, "node_modules/@jest/environment": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.5.0.tgz", - "integrity": "sha512-HUaqexIauIh69IQ4NTuPDEUCB8g8T4TOPSIzQOS18mwI/KEHKQk1j013K2o6ra031szZE2t5jGmVx3xbzdjgKA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.5.2.tgz", + "integrity": "sha512-nwFPOUMbmsjNNRCpnJpB9HbSZu4C07wDDds++5j+j1MezzPLxMPDdbdUVjr2o4RULDOValnDd70taPFI1EtxAg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/fake-timers": "30.5.0", - "@jest/types": "30.5.0", + "@jest/fake-timers": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", - "jest-mock": "30.5.0" + "jest-mock": "30.5.2" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/expect": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-30.5.0.tgz", - "integrity": "sha512-jEmgmgJEobJ3zEhDOGp1VAJ6JkoVelpS8uZ1ae1Ul/5lP78UKJKmmU0lciJwd6JdnqOXHaaS/QCKwbf1dHI9MA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-30.5.2.tgz", + "integrity": "sha512-2E+1Pg6jJxbRjLNLpciC71iri/3qsKJL222/aXJEFwC0VdUSvfS+JZQQLEVjUYYc8t8pQu2MGE3cF2+bNTYRsg==", "dev": true, "license": "MIT", "dependencies": { - "expect": "30.5.0", - "jest-snapshot": "30.5.0" + "expect": "30.5.2", + "jest-snapshot": "30.5.2" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/expect-utils": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.5.0.tgz", - "integrity": "sha512-5j0ztPxSy3McUJihjkDdCyCfjvT2hxykFTWsgEBZKB8qsw9ALdCiGTpTRH5gnf/d+qI4SflYUJ0dWNbzjQCWbA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.5.2.tgz", + "integrity": "sha512-d/HOLSrJUlBIl6n3LzOa7cjW3xdePm5H5gQw2lixZ/0h157l9sw3mLblzFqnPcTbhDzhRQdBOX3A3KcG73nm5Q==", "dev": true, "license": "MIT", "dependencies": { @@ -1823,18 +1801,18 @@ } }, "node_modules/@jest/fake-timers": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.5.0.tgz", - "integrity": "sha512-sg8xIbYwe5GdB/vT3/0qrDIpO7Ov9mazHi++M95uynmDKEZ70G1r169AWct73H07VrTZhrz1SJEfLtjYv8tE3A==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.5.2.tgz", + "integrity": "sha512-GKk0h0tKT5SpDPxDhPg3r9mm5s8/YCBzVNMOGdRiQXwUiMsjU10mVPlMaQstH6/cu50vOb8N9oQUMETHuwwxKw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "30.5.0", + "@jest/types": "30.5.1", "@sinonjs/fake-timers": "^15.4.0", "@types/node": "*", - "jest-message-util": "30.5.0", - "jest-mock": "30.5.0", - "jest-util": "30.5.0" + "jest-message-util": "30.5.1", + "jest-mock": "30.5.2", + "jest-util": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" @@ -1851,16 +1829,16 @@ } }, "node_modules/@jest/globals": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-30.5.0.tgz", - "integrity": "sha512-h7eJx534czwL8lQMYB0hwLT4/HquO8EX/RtYL7RNUHyUyWWVciYjoudN4Ns5JmNvn2/jh0Vm9UstZjEzJJ5EsQ==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-30.5.2.tgz", + "integrity": "sha512-62zfS+dL+M5aTNHXCNLyqD+j4oqxTIzDYrZbpqMP8Yn+gvlAGyzC6BSPNb1ZmFOakV1RtFYX/O3FCQXSWmQdgg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "30.5.0", - "@jest/expect": "30.5.0", - "@jest/types": "30.5.0", - "jest-mock": "30.5.0" + "@jest/environment": "30.5.2", + "@jest/expect": "30.5.2", + "@jest/types": "30.5.1", + "jest-mock": "30.5.2" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" @@ -1890,24 +1868,24 @@ }, "node_modules/@jest/react-is-19": { "name": "react-is", - "version": "19.3.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.3.0.tgz", - "integrity": "sha512-UpMYezM4v5/18F28aC66AEsjXIgE02kyEMH6yLdgLXu/UTfa1Ntwck/nNLrbqJsEXW7gPb0coNO9FQse9WTovA==", + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.3.1.tgz", + "integrity": "sha512-RRieF6IyxQBkcK6pP8xOHprLTPW6QjRkbGdImtqNme+/hYVwCZkLQLdlZGOhUqXwkS9IEynaGvPJtv6XB/cz0Q==", "dev": true, "license": "MIT" }, "node_modules/@jest/reporters": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-30.5.0.tgz", - "integrity": "sha512-FEAuusWm+PUOn9ydjaHhpOpyPmS6IbGE04HaKTuUI4zd8eqYZiXiNLoCsdCog/l2XnNj53E9pFy64UltcvfJKg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-30.5.2.tgz", + "integrity": "sha512-ev6E9iG73twQcfAfoTnviuYkr3yOrYbzAtMFCimv2fxHXPIp9PBt2u1wNMt0aYWgl8FPwIcS8oqRJg6alnht4Q==", "dev": true, "license": "MIT", "dependencies": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "30.5.0", - "@jest/test-result": "30.5.0", - "@jest/transform": "30.5.0", - "@jest/types": "30.5.0", + "@jest/console": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/transform": "30.5.2", + "@jest/types": "30.5.1", "@jridgewell/trace-mapping": "^0.3.31", "@types/node": "*", "chalk": "^4.1.2", @@ -1920,9 +1898,9 @@ "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^5.0.0", "istanbul-reports": "^3.1.3", - "jest-message-util": "30.5.0", - "jest-util": "30.5.0", - "jest-worker": "30.5.0", + "jest-message-util": "30.5.1", + "jest-util": "30.5.1", + "jest-worker": "30.5.1", "slash": "^3.0.0", "string-length": "^4.0.2", "v8-to-istanbul": "^9.0.1" @@ -1953,13 +1931,13 @@ } }, "node_modules/@jest/snapshot-utils": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/snapshot-utils/-/snapshot-utils-30.5.0.tgz", - "integrity": "sha512-iWQtIsi2dRsO2oWzVceOeynuRJiYTW8gsDVp5wFQ02ipHluQsNgBpasWSHiawVxukIlsGLdCtCSbIEK7fPtpvQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/@jest/snapshot-utils/-/snapshot-utils-30.5.1.tgz", + "integrity": "sha512-V3wnxNtiVmw5PPVg433Cn3VdXnsOeu/ofLw3KC04Bn2y1wIlU5kozXQn48rhrgj/02LrCVtntTEF1yBha0XSUw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "30.5.0", + "@jest/types": "30.5.1", "chalk": "^4.1.2", "graceful-fs": "^4.2.11", "natural-compare": "^1.4.0" @@ -1969,9 +1947,9 @@ } }, "node_modules/@jest/source-map": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-30.5.0.tgz", - "integrity": "sha512-xWpTJP9D0bDFGbPGT8XuWSwwha/iHADyyKzUnMx4UbdgnHugxrDaQFO4RZ8x4ZsFzRP6pNii8uvlgKCDxCIuDg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-30.5.2.tgz", + "integrity": "sha512-c5CehvkbfHX6yyNg7bMn2ylqlp9AHXuZ/3hPH/Lh5bxD/vefd/lV9HBjMqXef9yQNqkdwyZvkLSVSwB38hy8Qw==", "dev": true, "license": "MIT", "dependencies": { @@ -1985,14 +1963,14 @@ } }, "node_modules/@jest/test-result": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-30.5.0.tgz", - "integrity": "sha512-9IlPqUzUMkVDmoDqSSrVVLroVotgN3hTUPWPwq24XWXhh1Zpg915RXZ5pgRJ/7j4YE/kng5nqjSn4p3S68SZJA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-30.5.2.tgz", + "integrity": "sha512-eO6YU5rsLfs60ne694e0IAmRgeBnoA8mu0nlxXDbl/1j5km0o2vO9/VbbUIKIH+WRKKEI+ELgwraRGn2Lhep8g==", "dev": true, "license": "MIT", "dependencies": { - "@jest/console": "30.5.0", - "@jest/types": "30.5.0", + "@jest/console": "30.5.2", + "@jest/types": "30.5.1", "@types/istanbul-lib-coverage": "^2.0.6", "collect-v8-coverage": "^1.0.2" }, @@ -2001,15 +1979,15 @@ } }, "node_modules/@jest/test-sequencer": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-30.5.0.tgz", - "integrity": "sha512-TXlvSDIVv482b83hD8A8WtxDJEmGF47f60W6jRXOQL0Isfs3hKtk4rZIm9R/jLzAibg8+c56y+Q00BQs8R7Xcg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-30.5.2.tgz", + "integrity": "sha512-bmij8jZyYAC47ExT2GeP7PcrlwSNS+Bp3KeRuBH88gpcxqDv6fljN8PemS4J/lLZ79xb6mpaennQTTq0zUAVVg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/test-result": "30.5.0", + "@jest/test-result": "30.5.2", "graceful-fs": "^4.2.11", - "jest-haste-map": "30.5.0", + "jest-haste-map": "30.5.1", "slash": "^3.0.0" }, "engines": { @@ -2017,23 +1995,23 @@ } }, "node_modules/@jest/transform": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-30.5.0.tgz", - "integrity": "sha512-n1cYhoByyULEIXi64wbT4Lq91qeT1E6bwpM//sprFXhw955qaiHTdAmy1c1rNFGB6fCf1J+nxDUSf3RGwgZP5A==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-30.5.2.tgz", + "integrity": "sha512-LBGwmaE886C41jDZ65eqR1YbXM7642MK3ZhTowZd5+xDlrDLuf4ePuDdDmVSvcr8NTVJ3MqxLkMbUCzuigUaoQ==", "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.27.4", - "@jest/types": "30.5.0", + "@jest/types": "30.5.1", "@jridgewell/trace-mapping": "^0.3.31", "babel-plugin-istanbul": "^8.0.0", "chalk": "^4.1.2", "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.11", - "jest-haste-map": "30.5.0", + "jest-haste-map": "30.5.1", "jest-regex-util": "30.5.0", - "jest-util": "30.5.0", + "jest-util": "30.5.1", "pirates": "^4.0.7", "slash": "^3.0.0", "write-file-atomic": "^5.0.1" @@ -2043,9 +2021,9 @@ } }, "node_modules/@jest/types": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.5.0.tgz", - "integrity": "sha512-s1N+79S4Yp9ZgklCauZXi+YPJdCdtStNYQT32stuD6EeQaIBGHoUfyj2P0YWy8RmuQfaJboO+ulxEvEheR/POQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.5.1.tgz", + "integrity": "sha512-LvVYn83nnXPl+Rg98nvcFgjx6nRMTArhSn6RAX/w3ELn54S8A42TYZvsCMdGUqTM8S0wyXbtlQdU6Hi6dykj9g==", "dev": true, "license": "MIT", "dependencies": { @@ -2110,28 +2088,6 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@napi-rs/wasm-runtime": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.5.tgz", - "integrity": "sha512-HshSvXzmBxNzqejd3k/KemgQ3hdREUYFRRrgxOZ+gPljDIsO2SDZrVZMd4Z/HsxudQbE62OVyVFE8z9BCurfjA==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@tybys/wasm-util": "^0.10.3" - }, - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=23.5.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - }, - "peerDependencies": { - "@emnapi/core": "^1.7.1 || ^2.0.0-alpha.4", - "@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.4" - } - }, "node_modules/@parcel/watcher": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.6.0.tgz", @@ -2508,17 +2464,6 @@ "@sinonjs/commons": "^3.0.1" } }, - "node_modules/@tybys/wasm-util": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.4.tgz", - "integrity": "sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -2599,13 +2544,13 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "26.4.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.4.0.tgz", - "integrity": "sha512-faiGnoIrLH/V8cibOMEAZ8pMw6oXqSukl29ra4mN8GdaB2ZewzeaLj+INpV5N+Z1eKWzY+IzaIZH2EIR6YZRNQ==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.2.tgz", + "integrity": "sha512-X1P21scMv4zGKLYqjdGjaKa7COa0RKVYYZZN/NfvLQ1JegxFhdhpZG/Lyn8AXx6CDUavKAd11v6BvfpkDByK8g==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~8.3.0" + "undici-types": "~8.9.0" } }, "node_modules/@types/semver": { @@ -2661,9 +2606,9 @@ "license": "ISC" }, "node_modules/@unrs/resolver-binding-android-arm-eabi": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.12.2.tgz", - "integrity": "sha512-g5T90pqg1bo/7mytQx6F4iBNC0Wsh9cu+z9veDbFjc7HjpesJFWD7QMS0NGStXM075+7dJPPVvBbpZlnrdpi/w==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.13.0.tgz", + "integrity": "sha512-60E5mvmIiW+i1E/HYeSX4iE4A8s9NJSGYPu7UM0DJght1c2tTkWwuyDyAwzsEXhKM/XbbndfnTiXdfrf27d2hw==", "cpu": [ "arm" ], @@ -2675,9 +2620,9 @@ ] }, "node_modules/@unrs/resolver-binding-android-arm64": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm64/-/resolver-binding-android-arm64-1.12.2.tgz", - "integrity": "sha512-YGCRZv/9GLhwmz6mYDeTsm/92BAyR28l6c2ReweVW5pWgfsitWLY8upvfRlGdoyD8HjeTHSYJWyZGD4KJA/nFQ==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm64/-/resolver-binding-android-arm64-1.13.0.tgz", + "integrity": "sha512-qlh/JR3Tuy1cJ7xtf5pR4ykvLiK6os7X7EL2+zXZbrVc/s+yB8DoFdQrCAW9/a2TOxPVbR7QVNpkPWh7UWIsEQ==", "cpu": [ "arm64" ], @@ -2689,9 +2634,9 @@ ] }, "node_modules/@unrs/resolver-binding-darwin-arm64": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.12.2.tgz", - "integrity": "sha512-u9DiNT1auQMO20A9SyTuG3wUgQWB9Z7KjAg0uFuCDR1FsAY8A0CG2S6JpHS1xwm/w1G08bjXZDcyOCjv1WAm2w==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.13.0.tgz", + "integrity": "sha512-yynnnnJXUC99WeD1GfvuXPKsKNfvgzGYC2eRayFnUfsHVROjqrbFOkFQLZiSx1H8+PLy5BzU8vqyPyLqbRfeBQ==", "cpu": [ "arm64" ], @@ -2703,9 +2648,9 @@ ] }, "node_modules/@unrs/resolver-binding-darwin-x64": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.12.2.tgz", - "integrity": "sha512-f7rPLi/T1HVKZu/u6t87lroib16n8vrSzcyxI7lg4BGO9UF26KhQL44sd9eOUgrTYhvRXtWOIZT5PejdPyJfUA==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.13.0.tgz", + "integrity": "sha512-t8PXE0Ip9tmGyhRlfVsnEbzGM5iSvJIeNIXciUACjzpg0mmPs13fGv2x7W8sBa0S8zbIiohxKXS9fL/LXW/ERQ==", "cpu": [ "x64" ], @@ -2717,9 +2662,9 @@ ] }, "node_modules/@unrs/resolver-binding-freebsd-x64": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.12.2.tgz", - "integrity": "sha512-BpcOjWCJub6nRZUS2zA20pmLvjtqAtGejETaIyRLiZiQf++cbrjltLA5NN/xaXfqeOBOSlMFbemIl5/S5tljmg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.13.0.tgz", + "integrity": "sha512-qdtl9GDWDoDx6rhzF4RU5SJutV3lcLOiTiyqD6nBxYfEO6lAgLNukfrA+HJ2u2OiyWvV8JW5iEWD3LoONw7lYA==", "cpu": [ "x64" ], @@ -2731,9 +2676,9 @@ ] }, "node_modules/@unrs/resolver-binding-linux-arm-gnueabihf": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.12.2.tgz", - "integrity": "sha512-vZTDvdSISZjJx66OzJqtsOhzifbqRjbmI1Mnu49fQDwog5GtDI4QidRiEAYbZCRj9C8YZEW+3ZjqsyS9GR4k2A==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.13.0.tgz", + "integrity": "sha512-VrMUVwdrScTarsh4B6aUhTtziUavSlglo4Hi8XZ6CpAe4+j3nquY+XoP+tYkiSBDsXZ8386ne4pv4YYYBNi02w==", "cpu": [ "arm" ], @@ -2745,9 +2690,9 @@ ] }, "node_modules/@unrs/resolver-binding-linux-arm-musleabihf": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.12.2.tgz", - "integrity": "sha512-BiPI+IrIlwcW4nLLMM21+B1dFPzd55yAVgVGrdgDjNef+ch03GdxrcyaIz8X9SsQirh/kCQ7mviyWlMxdh2D7g==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.13.0.tgz", + "integrity": "sha512-zSbTVwaxiTC+zYJ9xVNTC6c+BYO/kOV/odcTI3bHuFFXa+XmjLoUkb/8UxsZeU5YF4K000m17wrXoTblNWuzOg==", "cpu": [ "arm" ], @@ -2759,13 +2704,16 @@ ] }, "node_modules/@unrs/resolver-binding-linux-arm64-gnu": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.12.2.tgz", - "integrity": "sha512-zJc0H99FEPoFfSrNpa91HYfxzfAJCr502oxNK1cfdC9hlaFI43RT+JFCann9JUgZmLzzntChHyn13Sgn9ljHNg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.13.0.tgz", + "integrity": "sha512-Z/Rax87moZHsuvJ8awdfP+zrMlsCt3d7mggUPIiPe32KpeagimyzJWnZSMQoV67an9uVQghyh92Pc0VprITnYA==", "cpu": [ "arm64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2773,13 +2721,16 @@ ] }, "node_modules/@unrs/resolver-binding-linux-arm64-musl": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.12.2.tgz", - "integrity": "sha512-KQ3Lki6l+Pz1k/eBipN41ES+YUK30beLGb9YqcB1O542cyLCNE6GaxrfcY3T6EezmGGk84wb5XyO9loTM9tkcA==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.13.0.tgz", + "integrity": "sha512-oUzXz8hNvFLNEAag8lBKJe1euiV2dmGHAR+eQ5fNpsZO0F1K7IMRb4J6pqYsd7uLMRQNPiu5A1WKUJHbFLWbbw==", "cpu": [ "arm64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -2787,13 +2738,16 @@ ] }, "node_modules/@unrs/resolver-binding-linux-loong64-gnu": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-loong64-gnu/-/resolver-binding-linux-loong64-gnu-1.12.2.tgz", - "integrity": "sha512-3SJGEh1DborhG6pyxvhPzCT4bbSIVihsvgJc13P1bHG7KLdNDaF9T3gsTwFc7Jw/5Y5/iWOjkEx7Zy0NvCGX3Q==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-loong64-gnu/-/resolver-binding-linux-loong64-gnu-1.13.0.tgz", + "integrity": "sha512-BxhGYvZBg0YrvNOeSEGR3eNklwXYy0mUJk7oeGJvZoQMKM68zYvbbf52+fQI3Le4X0fW276FTKIoTwjpMob80A==", "cpu": [ "loong64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2801,13 +2755,16 @@ ] }, "node_modules/@unrs/resolver-binding-linux-loong64-musl": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-loong64-musl/-/resolver-binding-linux-loong64-musl-1.12.2.tgz", - "integrity": "sha512-jiuG/Obbel7uw1PwHNFfrkiKhLAF6mnyZ6aWlOAVN9WqKm8v0OFGnciJIHu8+CMvXLQ8AD51LPzAoUfT21D5Ew==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-loong64-musl/-/resolver-binding-linux-loong64-musl-1.13.0.tgz", + "integrity": "sha512-nZcIuup9Ar3gAlqoZfX/KW6x83TMI11tLpCjldZG5M1KeY8qNUPNJJ71+sPvG8HMBpoh+ix1pAm5gkMFvcSAcQ==", "cpu": [ "loong64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -2815,13 +2772,16 @@ ] }, "node_modules/@unrs/resolver-binding-linux-ppc64-gnu": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.12.2.tgz", - "integrity": "sha512-q7xRvVpmcfeL+LlZg8Pbbo6QaTZwDU5BaGZbwfhkEsXJn3Was8xYfE0RBH266xZt0rM6B7i8xAYIvjthuUIWHg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.13.0.tgz", + "integrity": "sha512-AG6AgdDrkRNjAPwD/cftFJGgZUWCiJX+E8vpYCDEnwFHLTHZ7ppBiU6/vyPPwrfjcPUPQCDbbxE/eZUXsx49jQ==", "cpu": [ "ppc64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2829,13 +2789,16 @@ ] }, "node_modules/@unrs/resolver-binding-linux-riscv64-gnu": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.12.2.tgz", - "integrity": "sha512-0CVdx6lcnT3Q9inOH8tsMIOJ6ImndllMjqJHg8RLVdB7Vq4SfkEXl9mCSsVNuNA4MCYycRicCUxPCabVHJRr6A==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.13.0.tgz", + "integrity": "sha512-6vOqYGcAmzpRWpUURWutzvpf1qJ6eOu5cfYObdtPJnzZ0+Kw4cw+ZkZJqIYEh8fPuTBwSYDL/FwlUhma1G/JVQ==", "cpu": [ "riscv64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2843,13 +2806,16 @@ ] }, "node_modules/@unrs/resolver-binding-linux-riscv64-musl": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.12.2.tgz", - "integrity": "sha512-iOwlRo9vnp6R6ohHQS11n0NnfdXx/omhkocmIfaPRpQhKZ+3BDMkkdRVh53qjkFkpPddf+FETA28NwGN7l5l+w==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.13.0.tgz", + "integrity": "sha512-4HeIn0S2KVUowK0A+EweXrDvZ8CKHEfTtif0kx9vt3ORNsqcXNFFIFnHE0tizma3/Gt5OGrU2ovYNuj+D/bN4g==", "cpu": [ "riscv64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -2857,13 +2823,16 @@ ] }, "node_modules/@unrs/resolver-binding-linux-s390x-gnu": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.12.2.tgz", - "integrity": "sha512-HYJtLfXq94q8iZNFT1lknx258wlkkWhZeUXJRqzKBBUJ00CvZ+N33zgbCqimLjsyw5Va6uUxhVa12mI+kaveEw==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.13.0.tgz", + "integrity": "sha512-JfkvqY7NZbxyhexLE+g6Z8Hsx4utHOGaVazAVghPiBn8Upw2iERZPpKYnW1FBVU4WStv/BiIsoK/Muke0E7asA==", "cpu": [ "s390x" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2871,13 +2840,16 @@ ] }, "node_modules/@unrs/resolver-binding-linux-x64-gnu": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.12.2.tgz", - "integrity": "sha512-mPsUhunKKDih5O96Y6enDQyHc1SqBPlY1E/SfMWDM3EdJ95Z9CArPeCVwCCqbP45ljvivdEk8Fxn+SIb1rDAJQ==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.13.0.tgz", + "integrity": "sha512-iwjLeVdZo/8v5OKAeRIC+4VQV045t1EPZr5B/AVLgUQ04IdtNthWzg6not2cNjZgH2gHpSf4fOXMmN83aLO1FA==", "cpu": [ "x64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2885,13 +2857,16 @@ ] }, "node_modules/@unrs/resolver-binding-linux-x64-musl": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.12.2.tgz", - "integrity": "sha512-azrt6+5ydLd8Vt210AAFis/lZevSfPw93EJRIJG+xPu4WCJ8K0kppCTpMyLPcKT7H15M4Jnt2tMp5bOvCkRC6A==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.13.0.tgz", + "integrity": "sha512-TOh1fqOjyq1OPoht3BDLd7Y+HeMJRwd5g2VNmCQclknEbjp4py5GFRmT4L/rOybF5Af8q0LT9zHs2WGkwlqtrw==", "cpu": [ "x64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -2899,9 +2874,9 @@ ] }, "node_modules/@unrs/resolver-binding-openharmony-arm64": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-openharmony-arm64/-/resolver-binding-openharmony-arm64-1.12.2.tgz", - "integrity": "sha512-YZ9hP4O0X9PQb8eO980qmLNGH4zT3I9+SZTdt0Pr0YyuGQhYKoOZkV02VzrzyOZJ5xIJ3UFIenKkUkGg8GjgWQ==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-openharmony-arm64/-/resolver-binding-openharmony-arm64-1.13.0.tgz", + "integrity": "sha512-3T2MNtF2dd1yjaXCVqrsi+/3VZeksEzU1hygPzqqkBLVVjn+2iJzXEkxxCKIVFrWnpmEbazeHJp/ruYD0RUVWA==", "cpu": [ "arm64" ], @@ -2912,29 +2887,10 @@ "openharmony" ] }, - "node_modules/@unrs/resolver-binding-wasm32-wasi": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.12.2.tgz", - "integrity": "sha512-tYFDIkMxSflfEc/h92ZWNsZlHSwgimbNHSO3PL2JWQHfCuC2q316jMyYU9TIWZsFK2bQwyK5VAdYgn8ygPj69A==", - "cpu": [ - "wasm32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/core": "1.10.0", - "@emnapi/runtime": "1.10.0", - "@napi-rs/wasm-runtime": "^1.1.4" - }, - "engines": { - "node": ">=14.0.0" - } - }, "node_modules/@unrs/resolver-binding-win32-arm64-msvc": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.12.2.tgz", - "integrity": "sha512-qzNyg3xL0VPQmCaUh+N5jSitce6k+uCBfMDesWRnlULOZaqUkaJ0ybdT+UqlAWJoQjuqfIU/0Ptx9bteN4D82g==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.13.0.tgz", + "integrity": "sha512-hKWfSLiN3L4cIxg0jrpyP/66AXLTcyD37jmSn//rGdOUYGlizYxTEFdJ+GZbp2NnaML3YS/A73nCysze8FaJdg==", "cpu": [ "arm64" ], @@ -2946,9 +2902,9 @@ ] }, "node_modules/@unrs/resolver-binding-win32-ia32-msvc": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.12.2.tgz", - "integrity": "sha512-WD9sY00OfpHVGfsnHZoA8jVT+esS/Bg8z8jzxp5BnDCjjwsuKsPQrzswwpFy4J1AUJbXPRfkpcX0mXrzeXW79g==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.13.0.tgz", + "integrity": "sha512-N4gDKkDoiyIQEcn3vTqe2ksRxUAtBvQ8c5TiT+WonSa6FHgCAY5+RggnZ134hXJoRj57JEjv4/m+i/pAKHWrTQ==", "cpu": [ "ia32" ], @@ -2960,9 +2916,9 @@ ] }, "node_modules/@unrs/resolver-binding-win32-x64-msvc": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.12.2.tgz", - "integrity": "sha512-nAB74NfSNKknqQ1RrYj6uz8FcXEomu/MATJZxh/x+BArzN2U3JbOYC0APYzUIGhVY3m5hRxA8VPNdPBoG8txlA==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.13.0.tgz", + "integrity": "sha512-DpLMlAqlrk4zBVK3DiDjwKD0oq7pZNy+8BiIBRuByqb6dm5jsdoLMhIiyh/xR7+WejaW/1Ui+XgbgMNa4+zWJg==", "cpu": [ "x64" ], @@ -3066,13 +3022,13 @@ "dev": true }, "node_modules/babel-jest": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.5.0.tgz", - "integrity": "sha512-PrhPHlKC+MsLnuNzgIH/y1dkz1f6cSfKWaQeaG8WxLMuG44dYWQ8E9uRrsBbAGCU/3+BEFYPN4d6G3Zc5Y+waA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.5.2.tgz", + "integrity": "sha512-ES8WeJ2fNWPEDunyAtUfJ12nHyaWUloCHdkfK2oW5uSoQSUmjNKdWiGaXJITJwvFEWoD/evHEg/QoCXAvLaQqQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/transform": "30.5.0", + "@jest/transform": "30.5.2", "@types/babel__core": "^7.20.5", "babel-plugin-istanbul": "^8.0.0", "babel-preset-jest": "30.5.0", @@ -3639,18 +3595,18 @@ } }, "node_modules/expect": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-30.5.0.tgz", - "integrity": "sha512-8fiMWcEjPU7B9nErC4FtFcCzf2tC6I75Qf7m8wzBAWC2taZmcno3yAFEjIQL34SwoGZNgPf63UDiJLyh4SMPaw==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-30.5.2.tgz", + "integrity": "sha512-0LNuMvs8/5mRYhnCR4k+lGV7fqPMs6Bnksda4S3zsCUmdxBpAn4zU4NNzXdq1pMKe/H4W5t/zVIDSJ/H3e0vDA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/expect-utils": "30.5.0", + "@jest/expect-utils": "30.5.2", "@jest/get-type": "30.5.0", - "jest-matcher-utils": "30.5.0", - "jest-message-util": "30.5.0", - "jest-mock": "30.5.0", - "jest-util": "30.5.0" + "jest-matcher-utils": "30.5.2", + "jest-message-util": "30.5.1", + "jest-mock": "30.5.2", + "jest-util": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" @@ -4116,16 +4072,16 @@ } }, "node_modules/jest": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-30.5.0.tgz", - "integrity": "sha512-HeFeOUEKh5gjnp1rjuSCse8Dhj0Y3KA8lsZ3azr4Wnq1nCxwMBu35MDc9mp8iblZxmeAz6wV4P241tyUB7J2Ew==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest/-/jest-30.5.2.tgz", + "integrity": "sha512-3gnpdBIza8ijCl3iMV9ChE3hSt1+46865qqod863gQtJr1DixOkAU5DoGbi3u+XlRcw++BhZQMu/y4xBdHBvSQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/core": "30.5.0", - "@jest/types": "30.5.0", + "@jest/core": "30.5.2", + "@jest/types": "30.5.1", "import-local": "^3.2.0", - "jest-cli": "30.5.0" + "jest-cli": "30.5.2" }, "bin": { "jest": "bin/jest.js" @@ -4143,14 +4099,14 @@ } }, "node_modules/jest-changed-files": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-30.5.0.tgz", - "integrity": "sha512-dq1x8JiEnHkJDxxOrF6UJDivBRAQMwAa5tzr+VX3um0SfyMFseUPQUbe51wLwggfoa5h/EmOtSpdJxxkzSlNRQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-30.5.1.tgz", + "integrity": "sha512-0+bvMM/ENhDI29Z8q1r4HxiDIi4G5tnBmSw4esfPQoj9q8Nik7KIyuxHkTVnnniJQf05SxpGaKDQ+4h28ynGPg==", "dev": true, "license": "MIT", "dependencies": { "execa": "^5.1.1", - "jest-util": "30.5.0", + "jest-util": "30.5.1", "p-limit": "^3.1.0" }, "engines": { @@ -4158,29 +4114,29 @@ } }, "node_modules/jest-circus": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-30.5.0.tgz", - "integrity": "sha512-T3v7uM4wwCu+RQicjsAWCgoL3CiyuX3THSKwv2uMb9N2bMUgb+HfwDWEUma85vOGbvQNQ/YfoCXF1OCZot0ZEw==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-30.5.2.tgz", + "integrity": "sha512-vffFgjs5JSJ9q4ds1vNW3klKYPJfYfIY61LT/zaZgvTeASJOWZUt8LBfHgIcV4rwxlPBLl/ePBGccHEclS4PlQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "30.5.0", - "@jest/expect": "30.5.0", - "@jest/test-result": "30.5.0", - "@jest/types": "30.5.0", + "@jest/environment": "30.5.2", + "@jest/expect": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", "chalk": "^4.1.2", "co": "^4.6.0", "dedent": "^1.6.0", "is-generator-fn": "^2.1.0", - "jest-each": "30.5.0", - "jest-matcher-utils": "30.5.0", - "jest-message-util": "30.5.0", - "jest-runtime": "30.5.0", - "jest-snapshot": "30.5.0", - "jest-util": "30.5.0", + "jest-each": "30.5.2", + "jest-matcher-utils": "30.5.2", + "jest-message-util": "30.5.1", + "jest-runtime": "30.5.2", + "jest-snapshot": "30.5.2", + "jest-util": "30.5.1", "p-limit": "^3.1.0", - "pretty-format": "30.5.0", + "pretty-format": "30.5.1", "pure-rand": "^7.0.0", "slash": "^3.0.0", "stack-utils": "^2.0.6" @@ -4190,21 +4146,21 @@ } }, "node_modules/jest-cli": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-30.5.0.tgz", - "integrity": "sha512-QHZMiy32x2K+NzJ1AuuoCAVc1Y5co0VXib3R7kD9MWcWFflzsD1eJN0wR+mkNlM+ts7C+Bjz0oOoFE5IiHylCg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-30.5.2.tgz", + "integrity": "sha512-YYYxUUVjFgPvgEleKNKMaYGIFgR3l3832Cl0kRL/oCiDZ03v7wImUtquHl2OOBCCNgprjZgBN5bczS/JklPBDg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/core": "30.5.0", - "@jest/test-result": "30.5.0", - "@jest/types": "30.5.0", + "@jest/core": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/types": "30.5.1", "chalk": "^4.1.2", "exit-x": "^0.2.2", "import-local": "^3.2.0", - "jest-config": "30.5.0", - "jest-util": "30.5.0", - "jest-validate": "30.5.0", + "jest-config": "30.5.2", + "jest-util": "30.5.1", + "jest-validate": "30.5.1", "yargs": "^17.7.2" }, "bin": { @@ -4223,33 +4179,33 @@ } }, "node_modules/jest-config": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-30.5.0.tgz", - "integrity": "sha512-gYQl2FqYgiVpyuB7DutBIbJRWaq5VcHdzOXJJ51HNa8J5JrsZehIlzNFW0/9s5uvvcbzM5/LTUizYSbsFErv+w==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-30.5.2.tgz", + "integrity": "sha512-U6221OZekabePvGcGPf4raIBKMvYQWFHvhobDJRojOYaFMj2HaGytAdknjDhYc6JTz2fdHW9+6k0wWUDaNeOFQ==", "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.27.4", "@jest/get-type": "30.5.0", "@jest/pattern": "30.5.0", - "@jest/test-sequencer": "30.5.0", - "@jest/types": "30.5.0", - "babel-jest": "30.5.0", + "@jest/test-sequencer": "30.5.2", + "@jest/types": "30.5.1", + "babel-jest": "30.5.2", "chalk": "^4.1.2", "ci-info": "^4.2.0", "deepmerge": "^4.3.1", "glob": "^13.0.6", "graceful-fs": "^4.2.11", - "jest-circus": "30.5.0", + "jest-circus": "30.5.2", "jest-docblock": "30.5.0", - "jest-environment-node": "30.5.0", + "jest-environment-node": "30.5.2", "jest-regex-util": "30.5.0", - "jest-resolve": "30.5.0", - "jest-runner": "30.5.0", - "jest-util": "30.5.0", - "jest-validate": "30.5.0", + "jest-resolve": "30.5.1", + "jest-runner": "30.5.2", + "jest-util": "30.5.1", + "jest-validate": "30.5.1", "parse-json": "^5.2.0", - "pretty-format": "30.5.0", + "pretty-format": "30.5.1", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" }, @@ -4274,16 +4230,16 @@ } }, "node_modules/jest-diff": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.5.0.tgz", - "integrity": "sha512-QjCfDMwdPFvLxTQmS4/Dswx3PUCiqmSXVLGljMC3SU7YG1qHVoR6b86IH/O2G9k9OMyKXz2vS2Q60VnAozNDwA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.5.2.tgz", + "integrity": "sha512-rBtHnI6BWTiWj3lM7fOLVfChx7R9B0u9VV3PRHawKs79x6ZjW1QoSrKenaigNGWlvhtoi2BqvDbABDie+Os3xQ==", "dev": true, "license": "MIT", "dependencies": { "@jest/diff-sequences": "30.5.0", "@jest/get-type": "30.5.0", "chalk": "^4.1.2", - "pretty-format": "30.5.0" + "pretty-format": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" @@ -4303,49 +4259,50 @@ } }, "node_modules/jest-each": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-30.5.0.tgz", - "integrity": "sha512-NiMFNhRygJEFqYNt8pnkxppUF6CR486GEpt9rSU6lPBf7KeccaOL0zbjxG8fgJgD//6e7zYdssnlt6j+1kI31A==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-30.5.2.tgz", + "integrity": "sha512-GRrW+7fmmgmkvyfEBqc1QFdWnF1Ex5yG6Y6AWL4TTxnkWlKIT98dsKh3P3UuWm6v4XsQwVE6DEzXIPMzWJ3ZbA==", "dev": true, "license": "MIT", "dependencies": { "@jest/get-type": "30.5.0", - "@jest/types": "30.5.0", + "@jest/types": "30.5.1", "chalk": "^4.1.2", - "jest-util": "30.5.0", - "pretty-format": "30.5.0" + "jest-regex-util": "30.5.0", + "jest-util": "30.5.1", + "pretty-format": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-environment-node": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-30.5.0.tgz", - "integrity": "sha512-bTc79ywKLz0ogbT3JIYuEhgWV4Ffd/cJe06co4v8CyRtlmju8x5gokMlGFR8ARWhmk5SnbDRxmf50XWnlZVhDg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-30.5.2.tgz", + "integrity": "sha512-Ciz4KgTGIbojxSKpuFImgWJj5EyqfE8xMq9NxWmOXnQywHHS03H9Mv+vaCB29J5pr3JBrY27WbRV18rBdjh8Dg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "30.5.0", - "@jest/fake-timers": "30.5.0", - "@jest/types": "30.5.0", + "@jest/environment": "30.5.2", + "@jest/fake-timers": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", - "jest-mock": "30.5.0", - "jest-util": "30.5.0", - "jest-validate": "30.5.0" + "jest-mock": "30.5.2", + "jest-util": "30.5.1", + "jest-validate": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-haste-map": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-30.5.0.tgz", - "integrity": "sha512-0FStogBslBVOEqTOJr4oXMtFitmrWp9WscG6Gbns88i0YAuMXijCT2G5VMfg/HCR4QAnL+OF2C2ednag+HlDuA==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-30.5.1.tgz", + "integrity": "sha512-VIFgt67jW480YDxKfEv9IYQKrFpYt7bOCMn3VsnjK7AK9qo7p6acpnA1DHwsVOULE3dTaYew/6JaTD/d0VDHoQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "30.5.0", + "@jest/types": "30.5.1", "@parcel/watcher": "^2.6.0", "@types/node": "*", "anymatch": "^3.1.3", @@ -4353,8 +4310,8 @@ "fdir": "^6.5.0", "graceful-fs": "^4.2.11", "jest-regex-util": "30.5.0", - "jest-util": "30.5.0", - "jest-worker": "30.5.0", + "jest-util": "30.5.1", + "jest-worker": "30.5.1", "picomatch": "^4.0.3" }, "engines": { @@ -4393,50 +4350,50 @@ } }, "node_modules/jest-leak-detector": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-30.5.0.tgz", - "integrity": "sha512-Mq11ceAkNR250Iv45RoOwuG9fb4kYbJ02qoyL7A0nCI8FV5+aG/THmcEUx5uR2dNSa4KOtz+xBKrJ8cZPhPpuQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-30.5.1.tgz", + "integrity": "sha512-gt4GT2aWgEoCNTcBe4rqS74xTIUJxi+UD9SNSu9aOk5LmTEd6fS5KSTmAKAfitCCktQHNN+upUuL6EkBfFbMDQ==", "dev": true, "license": "MIT", "dependencies": { "@jest/get-type": "30.5.0", - "pretty-format": "30.5.0" + "pretty-format": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-matcher-utils": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.5.0.tgz", - "integrity": "sha512-EfaYMC9f9ds7fahB/LYFTgd1Z2RS9Vpm2e46gazij0onkpoQG7Daq+MLm8/gQVqWwRVjL/RNDggbFx9MsrJEmQ==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.5.2.tgz", + "integrity": "sha512-lFkB365PTIHOhPzwrb9T6gvlDnPpOZ7/c3ewOKKB7bzztqjVrtlyRL2MkyfJXpyY2u2SKw001JKrTx14fBUFcQ==", "dev": true, "license": "MIT", "dependencies": { "@jest/get-type": "30.5.0", "chalk": "^4.1.2", - "jest-diff": "30.5.0", - "pretty-format": "30.5.0" + "jest-diff": "30.5.2", + "pretty-format": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-message-util": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.5.0.tgz", - "integrity": "sha512-dBYMhplGfspKaCnVk9TUy1cZnknWubpuPNEputjz0YJk1G/92R45rn45BvbPMPMtC5LVcIdxJGPOaOSQTiuzJw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.5.1.tgz", + "integrity": "sha512-UdQlLdd9wL/Ys7xRErckqwD6wPlSZYueosSWuHc1r2ztGLwlgPvtSJq2+BPEgaEY13WLvfFbmhTj8pba0Sd1jg==", "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.27.1", - "@jest/types": "30.5.0", + "@jest/types": "30.5.1", "@types/stack-utils": "^2.0.3", "chalk": "^4.1.2", "graceful-fs": "^4.2.11", - "jest-util": "30.5.0", + "jest-util": "30.5.1", "picomatch": "^4.0.3", - "pretty-format": "30.5.0", + "pretty-format": "30.5.1", "slash": "^3.0.0", "stack-utils": "^2.0.6" }, @@ -4458,16 +4415,16 @@ } }, "node_modules/jest-mock": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.5.0.tgz", - "integrity": "sha512-bP5MHZpkYrV7xpV+yvhl36DPcXoEmTR57Un5EACcdVpMY7mpkDefCBq+V4mhcjE/3rwUajT6OTrcJTN7EwN1BA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.5.2.tgz", + "integrity": "sha512-KTHb37Fhj8xY8qPFvTFaFJHcdsumQp+ExsUlgoX232Agmc706gagBs53+CYvulV7MVQo9AgXOUxsqzzVBoJlrA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/expect-utils": "30.5.0", - "@jest/types": "30.5.0", + "@jest/expect-utils": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", - "jest-util": "30.5.0" + "jest-util": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" @@ -4484,17 +4441,17 @@ } }, "node_modules/jest-resolve": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-30.5.0.tgz", - "integrity": "sha512-NFvQWJ4G7e2kN5712iG+12Xr325NRFGAIhovrwLfgq5Oqd4bFHITw4CzcFkZGp1GTCqemC4v1l8/yZzedKZkjw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-30.5.1.tgz", + "integrity": "sha512-wprhLejRtwN6h8ZgaqC0eYjGJ1uMdGPT/+b3eFncbG4NWuuP9QL+vWwRinu9waw7hkOLcpMJGVJAMgBwsPssMQ==", "dev": true, "license": "MIT", "dependencies": { "chalk": "^4.1.2", "graceful-fs": "^4.2.11", - "jest-haste-map": "30.5.0", - "jest-util": "30.5.0", - "jest-validate": "30.5.0", + "jest-haste-map": "30.5.1", + "jest-util": "30.5.1", + "jest-validate": "30.5.1", "slash": "^3.0.0", "unrs-resolver": "^1.12.1" }, @@ -4503,47 +4460,47 @@ } }, "node_modules/jest-resolve-dependencies": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-30.5.0.tgz", - "integrity": "sha512-TnSBAp3wGOnqXBmLT3OXtJkugw6Vj2KU0IPde2EJmbGns/QMoNlkauJ7jZ8KYaxONSpx0o4pUvi+u1Q/LSk3Pg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-30.5.2.tgz", + "integrity": "sha512-GMI0DP5enX9Z2qW2zFy1bOkrCfWAOPRJQ7qHt0pdfrxBPsgWxglMPrRSK2TX/wRWYxcPRSLFg3Z88qPOzHx7FQ==", "dev": true, "license": "MIT", "dependencies": { "jest-regex-util": "30.5.0", - "jest-snapshot": "30.5.0" + "jest-snapshot": "30.5.2" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-runner": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-30.5.0.tgz", - "integrity": "sha512-Q6Yt+1LvXvEstvru6sQLT7OQYC77VNl6dK0KEvBkeOHgThmXDqNp3Ox9TglDWFHU85pemqTNdKwxfnmO3vgrdA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-30.5.2.tgz", + "integrity": "sha512-/B6px7hiiNhVSRwuv9AGn0nawYvwsHeQZ3ItTd5Gp2diFd0EOKaWVeWqcbw3L88vx1GfpCKjQkxWItZCTl11Rw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/console": "30.5.0", - "@jest/environment": "30.5.0", - "@jest/source-map": "30.5.0", - "@jest/test-result": "30.5.0", - "@jest/transform": "30.5.0", - "@jest/types": "30.5.0", + "@jest/console": "30.5.2", + "@jest/environment": "30.5.2", + "@jest/source-map": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/transform": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", "chalk": "^4.1.2", "emittery": "^0.13.1", "exit-x": "^0.2.2", "graceful-fs": "^4.2.11", "jest-docblock": "30.5.0", - "jest-environment-node": "30.5.0", - "jest-haste-map": "30.5.0", - "jest-leak-detector": "30.5.0", - "jest-message-util": "30.5.0", - "jest-resolve": "30.5.0", - "jest-runtime": "30.5.0", - "jest-util": "30.5.0", - "jest-watcher": "30.5.0", - "jest-worker": "30.5.0", + "jest-environment-node": "30.5.2", + "jest-haste-map": "30.5.1", + "jest-leak-detector": "30.5.1", + "jest-message-util": "30.5.1", + "jest-resolve": "30.5.1", + "jest-runtime": "30.5.2", + "jest-util": "30.5.1", + "jest-watcher": "30.5.2", + "jest-worker": "30.5.1", "p-limit": "^3.1.0" }, "engines": { @@ -4551,19 +4508,19 @@ } }, "node_modules/jest-runtime": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-30.5.0.tgz", - "integrity": "sha512-VTRz0sRIw2EISeHigx1O+CMuwoG4+RKJjF8dp8okzFaDNQEcv5Mw0h5QW8VJXgb2CRF4gZIjSEBb2jdzXPagFQ==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-30.5.2.tgz", + "integrity": "sha512-0paUAHBlheai10A3XSy9Xh+YBG0IROy+/qzcDPzQ/nbbXrznQzeWy5qniICWK6d3W3scaRQCVAbXdcK0ibBq4w==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "30.5.0", - "@jest/fake-timers": "30.5.0", - "@jest/globals": "30.5.0", - "@jest/source-map": "30.5.0", - "@jest/test-result": "30.5.0", - "@jest/transform": "30.5.0", - "@jest/types": "30.5.0", + "@jest/environment": "30.5.2", + "@jest/fake-timers": "30.5.2", + "@jest/globals": "30.5.2", + "@jest/source-map": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/transform": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", "chalk": "^4.1.2", "cjs-module-lexer": "^2.2.0", @@ -4571,13 +4528,13 @@ "es-module-lexer": "^2.1.0", "glob": "^13.0.6", "graceful-fs": "^4.2.11", - "jest-haste-map": "30.5.0", - "jest-message-util": "30.5.0", - "jest-mock": "30.5.0", + "jest-haste-map": "30.5.1", + "jest-message-util": "30.5.1", + "jest-mock": "30.5.2", "jest-regex-util": "30.5.0", - "jest-resolve": "30.5.0", - "jest-snapshot": "30.5.0", - "jest-util": "30.5.0", + "jest-resolve": "30.5.1", + "jest-snapshot": "30.5.2", + "jest-util": "30.5.1", "slash": "^3.0.0", "strip-bom": "^4.0.0" }, @@ -4586,9 +4543,9 @@ } }, "node_modules/jest-snapshot": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-30.5.0.tgz", - "integrity": "sha512-pZWETdcqmKve9MDTE/AX6RaeAbRhzKhhAXGozAW8Pg2FfOSdUrQ/7D+VdwE3fLQsqjpITXJVQvYVZoMEzrUl0Q==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-30.5.2.tgz", + "integrity": "sha512-jKIdes25AnAH73dOCi2qE6J6vHJ6L2vyBS11M89kT50DVJcLTf2AOjvcc+2vVaN8lUbY5v2R83aqXo3Ro9fqYA==", "dev": true, "license": "MIT", "dependencies": { @@ -4597,20 +4554,20 @@ "@babel/plugin-syntax-jsx": "^7.27.1", "@babel/plugin-syntax-typescript": "^7.27.1", "@babel/types": "^7.27.3", - "@jest/expect-utils": "30.5.0", + "@jest/expect-utils": "30.5.2", "@jest/get-type": "30.5.0", - "@jest/snapshot-utils": "30.5.0", - "@jest/transform": "30.5.0", - "@jest/types": "30.5.0", + "@jest/snapshot-utils": "30.5.1", + "@jest/transform": "30.5.2", + "@jest/types": "30.5.1", "babel-preset-current-node-syntax": "^1.2.0", "chalk": "^4.1.2", - "expect": "30.5.0", + "expect": "30.5.2", "graceful-fs": "^4.2.11", - "jest-diff": "30.5.0", - "jest-matcher-utils": "30.5.0", - "jest-message-util": "30.5.0", - "jest-util": "30.5.0", - "pretty-format": "30.5.0", + "jest-diff": "30.5.2", + "jest-matcher-utils": "30.5.2", + "jest-message-util": "30.5.1", + "jest-util": "30.5.1", + "pretty-format": "30.5.1", "semver": "^7.7.2", "synckit": "^0.11.8" }, @@ -4619,9 +4576,9 @@ } }, "node_modules/jest-snapshot/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "dev": true, "license": "ISC", "bin": { @@ -4632,13 +4589,13 @@ } }, "node_modules/jest-util": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.5.0.tgz", - "integrity": "sha512-lzU4aGUWaS+2X/B0CmgheDasfnsVlRfZh/rNQxB9b9s8cSYUq5BcqdQA95ld+KqJXBUVVt1sqnMQ2T3OxIalmg==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.5.1.tgz", + "integrity": "sha512-yKuxmNy2rSbTXw+3SIPanJo+nV4/BS1p26v44IYBFMsswSQySfMMcPHErnOncda7i9HEz0q605rIhSTBVgrZTg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "30.5.0", + "@jest/types": "30.5.1", "@types/node": "*", "chalk": "^4.1.2", "ci-info": "^4.2.0", @@ -4663,18 +4620,18 @@ } }, "node_modules/jest-validate": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-30.5.0.tgz", - "integrity": "sha512-N/hsPYKgBSzBeVZ2RHCs3yvBbTZNPX7Be8q33zhyo/yeFneBL1swzly31LYU4LJ3zJM9e8TxSM8IYLo2SDJZYQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-30.5.1.tgz", + "integrity": "sha512-i/buJ56wTpxihE93hQYNMfdOThS87+HGvLZzZJmU4xggPcdTYQq051iwALLCHp3q+SkCGH+EFejQZz5EbBSkkg==", "dev": true, "license": "MIT", "dependencies": { "@jest/get-type": "30.5.0", - "@jest/types": "30.5.0", + "@jest/types": "30.5.1", "camelcase": "^6.3.0", "chalk": "^4.1.2", "leven": "^3.1.0", - "pretty-format": "30.5.0" + "pretty-format": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" @@ -4694,19 +4651,19 @@ } }, "node_modules/jest-watcher": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-30.5.0.tgz", - "integrity": "sha512-ujjnEoL4Uu+Swu3WRwYenWMB9JMEiD2T3OypnveMJ64S/1r/5G8eC4OQ1wEOgYWQqMi+mT+buzccflCHr/XJ9Q==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-30.5.2.tgz", + "integrity": "sha512-rqRgg4R11GA9m1UsEZwQeixHsgZReCn6TOHAHtIH33yXrIvoX0OGPA20Yzzjkz7X40fZvcRSxEpQppYPcWzmcQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/test-result": "30.5.0", - "@jest/types": "30.5.0", + "@jest/test-result": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", "ansi-escapes": "^4.3.2", "chalk": "^4.1.2", "emittery": "^0.13.1", - "jest-util": "30.5.0", + "jest-util": "30.5.1", "string-length": "^4.0.2" }, "engines": { @@ -4714,15 +4671,15 @@ } }, "node_modules/jest-worker": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-30.5.0.tgz", - "integrity": "sha512-7kFk/607EoynNHLJa20daivkElM+c9PrCLduYy6AlMkYrXbh5TmVtW1BLXE05Y8baAFsJHMoC3xs2QRRTotwLw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-30.5.1.tgz", + "integrity": "sha512-Cbxh5v7AoLuFRmFJSM4/aHdQ68rjXvUWr716EE0Dh3I7T+T/3FgFKhOERGXHcU2Meftq9+9zxPM3TSNyI9D+HA==", "dev": true, "license": "MIT", "dependencies": { "@types/node": "*", "@ungap/structured-clone": "^1.3.0", - "jest-util": "30.5.0", + "jest-util": "30.5.1", "merge-stream": "^2.0.0", "supports-color": "^8.1.1" }, @@ -4871,9 +4828,9 @@ } }, "node_modules/make-dir/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "dev": true, "license": "ISC", "bin": { @@ -4942,12 +4899,13 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/napi-postinstall": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.4.tgz", - "integrity": "sha512-PHI5f1O0EP5xJ9gQmFGMS6IZcrVvTjpXjz7Na41gTE7eE2hK11lg04CECCYEEjdc17EV4DO+fkGEtt7TpTaTiQ==", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.8.tgz", + "integrity": "sha512-dHbDC5V1g/EI8OLEtL4Iuwbu0fgzmyykxenn2KnlsX9XdhTXL3gWnfbbP+ab+oUcgV6CFpb8QGyQt/ZXA0UXig==", "dev": true, "license": "MIT", "bin": { + "napi-patch": "lib/patch.js", "napi-postinstall": "lib/cli.js" }, "engines": { @@ -5215,9 +5173,9 @@ } }, "node_modules/pretty-format": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.5.0.tgz", - "integrity": "sha512-mzNzBErpHwM0zpmWS7ExOv62yhQhvd546nUuFqVR0dmnJB59tfrw9sjDF0DJknwsr59OXP0buwJ7PaKguczHSg==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.5.1.tgz", + "integrity": "sha512-byhRAPguVKMQIj4kjJwJ5lAskVhfuiSdiYl/aLTWpgkGEmic2jYhJh1yE9ih8Ox44Xg9ccCT11/S6QrzSJuNrg==", "dev": true, "license": "MIT", "dependencies": { @@ -5800,57 +5758,55 @@ } }, "node_modules/undici": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-8.10.0.tgz", - "integrity": "sha512-HvltHd7avK13QIw/oLe4qoOLyoVSoafqJ2jYOrtMRBkbYT31eiBQ8O0ehRKZiEZCMEyLFQNIADpgCWC5fALvYQ==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-8.11.0.tgz", + "integrity": "sha512-AdzuGcAkzhbha3GgCSoUBx2P0quwym6qdFNCQz/fDGZc8w9XJ741wHUbt2kTmfPz+ZIOMkySFkiY7RXmiDDC8w==", "license": "MIT", "engines": { "node": ">=22.19.0" } }, "node_modules/undici-types": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", - "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz", + "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==", "dev": true, "license": "MIT" }, "node_modules/unrs-resolver": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.12.2.tgz", - "integrity": "sha512-dmlRxBJJayXjqTwC+JtF1HhJmgf3ftQ3YejFcZrf4+KKtJv0qDsK1pjqaaVjG7wJ5NJ6UVP1OqRMQ71Z4C3rxQ==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.13.0.tgz", + "integrity": "sha512-mcPQo9Vm6kXd84d/WqMiYBi2CcA57QHBX/ev5PoUEb8b2oQzUvJ6xYsfseQblnCncgnVmCZGWiFwK7KkS5JZJA==", "dev": true, - "hasInstallScript": true, "license": "MIT", "dependencies": { - "napi-postinstall": "^0.3.4" + "napi-postinstall": "^0.3.7" }, "funding": { "url": "https://opencollective.com/unrs-resolver" }, "optionalDependencies": { - "@unrs/resolver-binding-android-arm-eabi": "1.12.2", - "@unrs/resolver-binding-android-arm64": "1.12.2", - "@unrs/resolver-binding-darwin-arm64": "1.12.2", - "@unrs/resolver-binding-darwin-x64": "1.12.2", - "@unrs/resolver-binding-freebsd-x64": "1.12.2", - "@unrs/resolver-binding-linux-arm-gnueabihf": "1.12.2", - "@unrs/resolver-binding-linux-arm-musleabihf": "1.12.2", - "@unrs/resolver-binding-linux-arm64-gnu": "1.12.2", - "@unrs/resolver-binding-linux-arm64-musl": "1.12.2", - "@unrs/resolver-binding-linux-loong64-gnu": "1.12.2", - "@unrs/resolver-binding-linux-loong64-musl": "1.12.2", - "@unrs/resolver-binding-linux-ppc64-gnu": "1.12.2", - "@unrs/resolver-binding-linux-riscv64-gnu": "1.12.2", - "@unrs/resolver-binding-linux-riscv64-musl": "1.12.2", - "@unrs/resolver-binding-linux-s390x-gnu": "1.12.2", - "@unrs/resolver-binding-linux-x64-gnu": "1.12.2", - "@unrs/resolver-binding-linux-x64-musl": "1.12.2", - "@unrs/resolver-binding-openharmony-arm64": "1.12.2", - "@unrs/resolver-binding-wasm32-wasi": "1.12.2", - "@unrs/resolver-binding-win32-arm64-msvc": "1.12.2", - "@unrs/resolver-binding-win32-ia32-msvc": "1.12.2", - "@unrs/resolver-binding-win32-x64-msvc": "1.12.2" + "@unrs/resolver-binding-android-arm-eabi": "1.13.0", + "@unrs/resolver-binding-android-arm64": "1.13.0", + "@unrs/resolver-binding-darwin-arm64": "1.13.0", + "@unrs/resolver-binding-darwin-x64": "1.13.0", + "@unrs/resolver-binding-freebsd-x64": "1.13.0", + "@unrs/resolver-binding-linux-arm-gnueabihf": "1.13.0", + "@unrs/resolver-binding-linux-arm-musleabihf": "1.13.0", + "@unrs/resolver-binding-linux-arm64-gnu": "1.13.0", + "@unrs/resolver-binding-linux-arm64-musl": "1.13.0", + "@unrs/resolver-binding-linux-loong64-gnu": "1.13.0", + "@unrs/resolver-binding-linux-loong64-musl": "1.13.0", + "@unrs/resolver-binding-linux-ppc64-gnu": "1.13.0", + "@unrs/resolver-binding-linux-riscv64-gnu": "1.13.0", + "@unrs/resolver-binding-linux-riscv64-musl": "1.13.0", + "@unrs/resolver-binding-linux-s390x-gnu": "1.13.0", + "@unrs/resolver-binding-linux-x64-gnu": "1.13.0", + "@unrs/resolver-binding-linux-x64-musl": "1.13.0", + "@unrs/resolver-binding-openharmony-arm64": "1.13.0", + "@unrs/resolver-binding-win32-arm64-msvc": "1.13.0", + "@unrs/resolver-binding-win32-ia32-msvc": "1.13.0", + "@unrs/resolver-binding-win32-x64-msvc": "1.13.0" } }, "node_modules/update-browserslist-db": { @@ -6654,108 +6610,77 @@ "dev": true }, "@biomejs/biome": { - "version": "2.5.11", - "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.5.11.tgz", - "integrity": "sha512-Tj0dnkLPdW0ASjHfj2D/ZkkvPU2wrFmnE1jWTD2xzV1ycapV1DutbYXk4NDnR3rYTi1ZCbNFD4G2gRMEY65WaA==", + "version": "2.5.14", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.5.14.tgz", + "integrity": "sha512-0FabLIjd4M/dm8VFI86RMaLLdgepzbdfiAL2R8cr7V81OYYrP1w7Z73KfAwPK5h9SrEBXTzNG2y+mBwPo9xRnw==", "dev": true, "requires": { - "@biomejs/cli-darwin-arm64": "2.5.11", - "@biomejs/cli-darwin-x64": "2.5.11", - "@biomejs/cli-linux-arm64": "2.5.11", - "@biomejs/cli-linux-arm64-musl": "2.5.11", - "@biomejs/cli-linux-x64": "2.5.11", - "@biomejs/cli-linux-x64-musl": "2.5.11", - "@biomejs/cli-win32-arm64": "2.5.11", - "@biomejs/cli-win32-x64": "2.5.11" + "@biomejs/cli-darwin-arm64": "2.5.14", + "@biomejs/cli-darwin-x64": "2.5.14", + "@biomejs/cli-linux-arm64": "2.5.14", + "@biomejs/cli-linux-arm64-musl": "2.5.14", + "@biomejs/cli-linux-x64": "2.5.14", + "@biomejs/cli-linux-x64-musl": "2.5.14", + "@biomejs/cli-win32-arm64": "2.5.14", + "@biomejs/cli-win32-x64": "2.5.14" } }, "@biomejs/cli-darwin-arm64": { - "version": "2.5.11", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.5.11.tgz", - "integrity": "sha512-6SGZxoKbXvUjMn1t6A98HqWISPnGNbYs0R/Rt2JarmXBSev+lva4QxUMWEBX9lX1Wo1XTJ78uk5xVDtG58SRZg==", + "version": "2.5.14", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.5.14.tgz", + "integrity": "sha512-UnzaXO65L4tsZimFITFP2M121GyhDcWFrT3pL5ZJ5U4XcS/0L5VHYytVohdCf/gnDUFHgl2I9xnt5bV/J1kxHQ==", "dev": true, "optional": true }, "@biomejs/cli-darwin-x64": { - "version": "2.5.11", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.5.11.tgz", - "integrity": "sha512-nYkXY7tLBEgnGbYapDKAyKzgt44ZEyG+AKalvTXtCWKYgepI9dw327q+cVgedxm+Udi1ZzHKUyZrIusHi/KQbw==", + "version": "2.5.14", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.5.14.tgz", + "integrity": "sha512-kiy8qA16K93J7uvFfWi4LgjqDpnRKyePAna6A0Y4jxyUga35SYpIZ2cNWlhy0lsfgqRenCpfymnJWEZ6mgpRgA==", "dev": true, "optional": true }, "@biomejs/cli-linux-arm64": { - "version": "2.5.11", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.5.11.tgz", - "integrity": "sha512-3PVLSTD9RR73rvVPt5G3T1gc+ycggWEGfTD7RvzzbtcDPD27NxgxBbAFfpm7DXJKW6VLHWE1lLMGvFt2Qxjcow==", + "version": "2.5.14", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.5.14.tgz", + "integrity": "sha512-vO/9BaU1n30CiFNLx49gMTMtbCAAqlo/EqFoG0BU3deQInTbJrmXSmTQ9e3FoDZIKQnvSLDVNL4lx1ci7y1T1Q==", "dev": true, "optional": true }, "@biomejs/cli-linux-arm64-musl": { - "version": "2.5.11", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.5.11.tgz", - "integrity": "sha512-qhyZUMyCbWYFV2bAwRNVvfMVZ+hv7WYl6mossGrxC+uiQQXhvsuWWU8zz6jYX0mChZd9MgQZbm4vozTmG/5iGw==", + "version": "2.5.14", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.5.14.tgz", + "integrity": "sha512-SJ9PrZkBnnH9dHJDnxk34vKs0GB2dbsioaft6/hPhWJ7AHpwYH83Isnhj0FSRpFkGgpVfJ1lds23ApB2czUDLQ==", "dev": true, "optional": true }, "@biomejs/cli-linux-x64": { - "version": "2.5.11", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.5.11.tgz", - "integrity": "sha512-JOytptlsgM33B2MMFUg8iBrb4IKpbD5JnJrSeYiaFEeAj4vuXx0iQSQZ4qK7sqyMtfjZxxPdNdMZZVL4y/mFyA==", + "version": "2.5.14", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.5.14.tgz", + "integrity": "sha512-VHZRa7CCQBUWKxNwUvHJeuW03WFRgN5NWO//SDGOitc9QIeNyfA42V9zlKm+x82xFSG9Bzi5fi+hbhm9anO8yA==", "dev": true, "optional": true }, "@biomejs/cli-linux-x64-musl": { - "version": "2.5.11", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.5.11.tgz", - "integrity": "sha512-oRRlrchG5EfrEL/EmtT1qUjSNHk3/5LGeZhQqADBBAJF1b1ET6964xEKe7aGlGARzDfza8H/seEsFJl7S6Ql9w==", + "version": "2.5.14", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.5.14.tgz", + "integrity": "sha512-2kI5PrMgW5dcEZYrstLPmUmCwkUwZY39rP4BN93Vxbwcs2O57LDQOktUZZYPvvspN5i0mhGr3TJtF5sU26NUWg==", "dev": true, "optional": true }, "@biomejs/cli-win32-arm64": { - "version": "2.5.11", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.5.11.tgz", - "integrity": "sha512-e49E6K9hzH/ohJNx8Y26mY8HaV4I4ZViIeoqhKsmoXLKHhQnMeBAVqCgsGf2Wa3lXlS7RkporDXMHHWkzvZzFw==", + "version": "2.5.14", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.5.14.tgz", + "integrity": "sha512-pHgAFffmZtaYoxavEsWEYNvcA7NwOIjLyqw2HXyLbt16xYryX0L4fMV2u0G9ag6LNYPIoqWaWqzUcnc6rLGGXg==", "dev": true, "optional": true }, "@biomejs/cli-win32-x64": { - "version": "2.5.11", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.5.11.tgz", - "integrity": "sha512-QSQr/KjOgXA7OzXJUWS+oguKyAZ3Q0l/lnlDGbu397eKo83atuWUjBPJrsqbKNF6CARGw8XXJLGzpHC8Ryhd4Q==", + "version": "2.5.14", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.5.14.tgz", + "integrity": "sha512-oJWmBhoHsnhUKIke+0gXDX0mltJrWHA1UyHsrTlXwX0TL64ilVZAo+TYZm97baecV0esBdpzy3k96q+09JaZUQ==", "dev": true, "optional": true }, - "@emnapi/core": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz", - "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==", - "dev": true, - "optional": true, - "requires": { - "@emnapi/wasi-threads": "1.2.1", - "tslib": "^2.4.0" - } - }, - "@emnapi/runtime": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", - "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==", - "dev": true, - "optional": true, - "requires": { - "tslib": "^2.4.0" - } - }, - "@emnapi/wasi-threads": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", - "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", - "dev": true, - "optional": true, - "requires": { - "tslib": "^2.4.0" - } - }, "@esbuild/aix-ppc64": { "version": "0.28.2", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", @@ -7044,31 +6969,31 @@ "dev": true }, "@jest/console": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-30.5.0.tgz", - "integrity": "sha512-BI1DpOedrJqbrYVi9yNhDWGjqphR/+gsM4STmg2+VaeXm7851hvpBDyKOZGMXATTrGEnFuEseQvLCtrrRmG0GQ==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-30.5.2.tgz", + "integrity": "sha512-e8sQC4pCMHPBrPX7Hk8TJr+DM5dkUnImSTNag8SEWFAFAF6xIz4AJvCKapnrdHnZxep4bxw4PhG+ZbimYBMyKw==", "dev": true, "requires": { - "@jest/types": "30.5.0", + "@jest/types": "30.5.1", "@types/node": "*", "chalk": "^4.1.2", - "jest-message-util": "30.5.0", - "jest-util": "30.5.0", + "jest-message-util": "30.5.1", + "jest-util": "30.5.1", "slash": "^3.0.0" } }, "@jest/core": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-30.5.0.tgz", - "integrity": "sha512-DLjRME+NY//j+UDTSfWnjoP0srrdR3DrJRy7yFZktGIwzpN2iVy2vMo0jziZ5c2Ij7bOwlJRXKVWtxZusazOJg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-30.5.2.tgz", + "integrity": "sha512-/jqvFWoJF7LV1a6AUpYMbMm+2yIYsHJfR474H0SCzr9k8tnO/jl9wRg6zSG6lxgf6EozNlCG4amFzWsbZSvvZA==", "dev": true, "requires": { - "@jest/console": "30.5.0", + "@jest/console": "30.5.2", "@jest/pattern": "30.5.0", - "@jest/reporters": "30.5.0", - "@jest/test-result": "30.5.0", - "@jest/transform": "30.5.0", - "@jest/types": "30.5.0", + "@jest/reporters": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/transform": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", "ansi-escapes": "^4.3.2", "chalk": "^4.1.2", @@ -7076,20 +7001,20 @@ "exit-x": "^0.2.2", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.11", - "jest-changed-files": "30.5.0", - "jest-config": "30.5.0", - "jest-haste-map": "30.5.0", - "jest-message-util": "30.5.0", + "jest-changed-files": "30.5.1", + "jest-config": "30.5.2", + "jest-haste-map": "30.5.1", + "jest-message-util": "30.5.1", "jest-regex-util": "30.5.0", - "jest-resolve": "30.5.0", - "jest-resolve-dependencies": "30.5.0", - "jest-runner": "30.5.0", - "jest-runtime": "30.5.0", - "jest-snapshot": "30.5.0", - "jest-util": "30.5.0", - "jest-validate": "30.5.0", - "jest-watcher": "30.5.0", - "pretty-format": "30.5.0", + "jest-resolve": "30.5.1", + "jest-resolve-dependencies": "30.5.2", + "jest-runner": "30.5.2", + "jest-runtime": "30.5.2", + "jest-snapshot": "30.5.2", + "jest-util": "30.5.1", + "jest-validate": "30.5.1", + "jest-watcher": "30.5.2", + "pretty-format": "30.5.1", "slash": "^3.0.0" } }, @@ -7100,48 +7025,48 @@ "dev": true }, "@jest/environment": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.5.0.tgz", - "integrity": "sha512-HUaqexIauIh69IQ4NTuPDEUCB8g8T4TOPSIzQOS18mwI/KEHKQk1j013K2o6ra031szZE2t5jGmVx3xbzdjgKA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.5.2.tgz", + "integrity": "sha512-nwFPOUMbmsjNNRCpnJpB9HbSZu4C07wDDds++5j+j1MezzPLxMPDdbdUVjr2o4RULDOValnDd70taPFI1EtxAg==", "dev": true, "requires": { - "@jest/fake-timers": "30.5.0", - "@jest/types": "30.5.0", + "@jest/fake-timers": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", - "jest-mock": "30.5.0" + "jest-mock": "30.5.2" } }, "@jest/expect": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-30.5.0.tgz", - "integrity": "sha512-jEmgmgJEobJ3zEhDOGp1VAJ6JkoVelpS8uZ1ae1Ul/5lP78UKJKmmU0lciJwd6JdnqOXHaaS/QCKwbf1dHI9MA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-30.5.2.tgz", + "integrity": "sha512-2E+1Pg6jJxbRjLNLpciC71iri/3qsKJL222/aXJEFwC0VdUSvfS+JZQQLEVjUYYc8t8pQu2MGE3cF2+bNTYRsg==", "dev": true, "requires": { - "expect": "30.5.0", - "jest-snapshot": "30.5.0" + "expect": "30.5.2", + "jest-snapshot": "30.5.2" } }, "@jest/expect-utils": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.5.0.tgz", - "integrity": "sha512-5j0ztPxSy3McUJihjkDdCyCfjvT2hxykFTWsgEBZKB8qsw9ALdCiGTpTRH5gnf/d+qI4SflYUJ0dWNbzjQCWbA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.5.2.tgz", + "integrity": "sha512-d/HOLSrJUlBIl6n3LzOa7cjW3xdePm5H5gQw2lixZ/0h157l9sw3mLblzFqnPcTbhDzhRQdBOX3A3KcG73nm5Q==", "dev": true, "requires": { "@jest/get-type": "30.5.0" } }, "@jest/fake-timers": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.5.0.tgz", - "integrity": "sha512-sg8xIbYwe5GdB/vT3/0qrDIpO7Ov9mazHi++M95uynmDKEZ70G1r169AWct73H07VrTZhrz1SJEfLtjYv8tE3A==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.5.2.tgz", + "integrity": "sha512-GKk0h0tKT5SpDPxDhPg3r9mm5s8/YCBzVNMOGdRiQXwUiMsjU10mVPlMaQstH6/cu50vOb8N9oQUMETHuwwxKw==", "dev": true, "requires": { - "@jest/types": "30.5.0", + "@jest/types": "30.5.1", "@sinonjs/fake-timers": "^15.4.0", "@types/node": "*", - "jest-message-util": "30.5.0", - "jest-mock": "30.5.0", - "jest-util": "30.5.0" + "jest-message-util": "30.5.1", + "jest-mock": "30.5.2", + "jest-util": "30.5.1" } }, "@jest/get-type": { @@ -7151,15 +7076,15 @@ "dev": true }, "@jest/globals": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-30.5.0.tgz", - "integrity": "sha512-h7eJx534czwL8lQMYB0hwLT4/HquO8EX/RtYL7RNUHyUyWWVciYjoudN4Ns5JmNvn2/jh0Vm9UstZjEzJJ5EsQ==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-30.5.2.tgz", + "integrity": "sha512-62zfS+dL+M5aTNHXCNLyqD+j4oqxTIzDYrZbpqMP8Yn+gvlAGyzC6BSPNb1ZmFOakV1RtFYX/O3FCQXSWmQdgg==", "dev": true, "requires": { - "@jest/environment": "30.5.0", - "@jest/expect": "30.5.0", - "@jest/types": "30.5.0", - "jest-mock": "30.5.0" + "@jest/environment": "30.5.2", + "@jest/expect": "30.5.2", + "@jest/types": "30.5.1", + "jest-mock": "30.5.2" } }, "@jest/pattern": { @@ -7179,22 +7104,22 @@ "dev": true }, "@jest/react-is-19": { - "version": "npm:react-is@19.3.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.3.0.tgz", - "integrity": "sha512-UpMYezM4v5/18F28aC66AEsjXIgE02kyEMH6yLdgLXu/UTfa1Ntwck/nNLrbqJsEXW7gPb0coNO9FQse9WTovA==", + "version": "npm:react-is@19.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.3.1.tgz", + "integrity": "sha512-RRieF6IyxQBkcK6pP8xOHprLTPW6QjRkbGdImtqNme+/hYVwCZkLQLdlZGOhUqXwkS9IEynaGvPJtv6XB/cz0Q==", "dev": true }, "@jest/reporters": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-30.5.0.tgz", - "integrity": "sha512-FEAuusWm+PUOn9ydjaHhpOpyPmS6IbGE04HaKTuUI4zd8eqYZiXiNLoCsdCog/l2XnNj53E9pFy64UltcvfJKg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-30.5.2.tgz", + "integrity": "sha512-ev6E9iG73twQcfAfoTnviuYkr3yOrYbzAtMFCimv2fxHXPIp9PBt2u1wNMt0aYWgl8FPwIcS8oqRJg6alnht4Q==", "dev": true, "requires": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "30.5.0", - "@jest/test-result": "30.5.0", - "@jest/transform": "30.5.0", - "@jest/types": "30.5.0", + "@jest/console": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/transform": "30.5.2", + "@jest/types": "30.5.1", "@jridgewell/trace-mapping": "^0.3.31", "@types/node": "*", "chalk": "^4.1.2", @@ -7207,9 +7132,9 @@ "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^5.0.0", "istanbul-reports": "^3.1.3", - "jest-message-util": "30.5.0", - "jest-util": "30.5.0", - "jest-worker": "30.5.0", + "jest-message-util": "30.5.1", + "jest-util": "30.5.1", + "jest-worker": "30.5.1", "slash": "^3.0.0", "string-length": "^4.0.2", "v8-to-istanbul": "^9.0.1" @@ -7225,21 +7150,21 @@ } }, "@jest/snapshot-utils": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/snapshot-utils/-/snapshot-utils-30.5.0.tgz", - "integrity": "sha512-iWQtIsi2dRsO2oWzVceOeynuRJiYTW8gsDVp5wFQ02ipHluQsNgBpasWSHiawVxukIlsGLdCtCSbIEK7fPtpvQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/@jest/snapshot-utils/-/snapshot-utils-30.5.1.tgz", + "integrity": "sha512-V3wnxNtiVmw5PPVg433Cn3VdXnsOeu/ofLw3KC04Bn2y1wIlU5kozXQn48rhrgj/02LrCVtntTEF1yBha0XSUw==", "dev": true, "requires": { - "@jest/types": "30.5.0", + "@jest/types": "30.5.1", "chalk": "^4.1.2", "graceful-fs": "^4.2.11", "natural-compare": "^1.4.0" } }, "@jest/source-map": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-30.5.0.tgz", - "integrity": "sha512-xWpTJP9D0bDFGbPGT8XuWSwwha/iHADyyKzUnMx4UbdgnHugxrDaQFO4RZ8x4ZsFzRP6pNii8uvlgKCDxCIuDg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-30.5.2.tgz", + "integrity": "sha512-c5CehvkbfHX6yyNg7bMn2ylqlp9AHXuZ/3hPH/Lh5bxD/vefd/lV9HBjMqXef9yQNqkdwyZvkLSVSwB38hy8Qw==", "dev": true, "requires": { "@jridgewell/trace-mapping": "^0.3.31", @@ -7249,55 +7174,55 @@ } }, "@jest/test-result": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-30.5.0.tgz", - "integrity": "sha512-9IlPqUzUMkVDmoDqSSrVVLroVotgN3hTUPWPwq24XWXhh1Zpg915RXZ5pgRJ/7j4YE/kng5nqjSn4p3S68SZJA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-30.5.2.tgz", + "integrity": "sha512-eO6YU5rsLfs60ne694e0IAmRgeBnoA8mu0nlxXDbl/1j5km0o2vO9/VbbUIKIH+WRKKEI+ELgwraRGn2Lhep8g==", "dev": true, "requires": { - "@jest/console": "30.5.0", - "@jest/types": "30.5.0", + "@jest/console": "30.5.2", + "@jest/types": "30.5.1", "@types/istanbul-lib-coverage": "^2.0.6", "collect-v8-coverage": "^1.0.2" } }, "@jest/test-sequencer": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-30.5.0.tgz", - "integrity": "sha512-TXlvSDIVv482b83hD8A8WtxDJEmGF47f60W6jRXOQL0Isfs3hKtk4rZIm9R/jLzAibg8+c56y+Q00BQs8R7Xcg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-30.5.2.tgz", + "integrity": "sha512-bmij8jZyYAC47ExT2GeP7PcrlwSNS+Bp3KeRuBH88gpcxqDv6fljN8PemS4J/lLZ79xb6mpaennQTTq0zUAVVg==", "dev": true, "requires": { - "@jest/test-result": "30.5.0", + "@jest/test-result": "30.5.2", "graceful-fs": "^4.2.11", - "jest-haste-map": "30.5.0", + "jest-haste-map": "30.5.1", "slash": "^3.0.0" } }, "@jest/transform": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-30.5.0.tgz", - "integrity": "sha512-n1cYhoByyULEIXi64wbT4Lq91qeT1E6bwpM//sprFXhw955qaiHTdAmy1c1rNFGB6fCf1J+nxDUSf3RGwgZP5A==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-30.5.2.tgz", + "integrity": "sha512-LBGwmaE886C41jDZ65eqR1YbXM7642MK3ZhTowZd5+xDlrDLuf4ePuDdDmVSvcr8NTVJ3MqxLkMbUCzuigUaoQ==", "dev": true, "requires": { "@babel/core": "^7.27.4", - "@jest/types": "30.5.0", + "@jest/types": "30.5.1", "@jridgewell/trace-mapping": "^0.3.31", "babel-plugin-istanbul": "^8.0.0", "chalk": "^4.1.2", "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.11", - "jest-haste-map": "30.5.0", + "jest-haste-map": "30.5.1", "jest-regex-util": "30.5.0", - "jest-util": "30.5.0", + "jest-util": "30.5.1", "pirates": "^4.0.7", "slash": "^3.0.0", "write-file-atomic": "^5.0.1" } }, "@jest/types": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.5.0.tgz", - "integrity": "sha512-s1N+79S4Yp9ZgklCauZXi+YPJdCdtStNYQT32stuD6EeQaIBGHoUfyj2P0YWy8RmuQfaJboO+ulxEvEheR/POQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.5.1.tgz", + "integrity": "sha512-LvVYn83nnXPl+Rg98nvcFgjx6nRMTArhSn6RAX/w3ELn54S8A42TYZvsCMdGUqTM8S0wyXbtlQdU6Hi6dykj9g==", "dev": true, "requires": { "@jest/pattern": "30.5.0", @@ -7347,16 +7272,6 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "@napi-rs/wasm-runtime": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.5.tgz", - "integrity": "sha512-HshSvXzmBxNzqejd3k/KemgQ3hdREUYFRRrgxOZ+gPljDIsO2SDZrVZMd4Z/HsxudQbE62OVyVFE8z9BCurfjA==", - "dev": true, - "optional": true, - "requires": { - "@tybys/wasm-util": "^0.10.3" - } - }, "@parcel/watcher": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.6.0.tgz", @@ -7528,16 +7443,6 @@ "@sinonjs/commons": "^3.0.1" } }, - "@tybys/wasm-util": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.4.tgz", - "integrity": "sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==", - "dev": true, - "optional": true, - "requires": { - "tslib": "^2.4.0" - } - }, "@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -7610,12 +7515,12 @@ "dev": true }, "@types/node": { - "version": "26.4.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.4.0.tgz", - "integrity": "sha512-faiGnoIrLH/V8cibOMEAZ8pMw6oXqSukl29ra4mN8GdaB2ZewzeaLj+INpV5N+Z1eKWzY+IzaIZH2EIR6YZRNQ==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.2.tgz", + "integrity": "sha512-X1P21scMv4zGKLYqjdGjaKa7COa0RKVYYZZN/NfvLQ1JegxFhdhpZG/Lyn8AXx6CDUavKAd11v6BvfpkDByK8g==", "dev": true, "requires": { - "undici-types": "~8.3.0" + "undici-types": "~8.9.0" } }, "@types/semver": { @@ -7662,161 +7567,149 @@ "dev": true }, "@unrs/resolver-binding-android-arm-eabi": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.12.2.tgz", - "integrity": "sha512-g5T90pqg1bo/7mytQx6F4iBNC0Wsh9cu+z9veDbFjc7HjpesJFWD7QMS0NGStXM075+7dJPPVvBbpZlnrdpi/w==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.13.0.tgz", + "integrity": "sha512-60E5mvmIiW+i1E/HYeSX4iE4A8s9NJSGYPu7UM0DJght1c2tTkWwuyDyAwzsEXhKM/XbbndfnTiXdfrf27d2hw==", "dev": true, "optional": true }, "@unrs/resolver-binding-android-arm64": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm64/-/resolver-binding-android-arm64-1.12.2.tgz", - "integrity": "sha512-YGCRZv/9GLhwmz6mYDeTsm/92BAyR28l6c2ReweVW5pWgfsitWLY8upvfRlGdoyD8HjeTHSYJWyZGD4KJA/nFQ==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm64/-/resolver-binding-android-arm64-1.13.0.tgz", + "integrity": "sha512-qlh/JR3Tuy1cJ7xtf5pR4ykvLiK6os7X7EL2+zXZbrVc/s+yB8DoFdQrCAW9/a2TOxPVbR7QVNpkPWh7UWIsEQ==", "dev": true, "optional": true }, "@unrs/resolver-binding-darwin-arm64": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.12.2.tgz", - "integrity": "sha512-u9DiNT1auQMO20A9SyTuG3wUgQWB9Z7KjAg0uFuCDR1FsAY8A0CG2S6JpHS1xwm/w1G08bjXZDcyOCjv1WAm2w==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.13.0.tgz", + "integrity": "sha512-yynnnnJXUC99WeD1GfvuXPKsKNfvgzGYC2eRayFnUfsHVROjqrbFOkFQLZiSx1H8+PLy5BzU8vqyPyLqbRfeBQ==", "dev": true, "optional": true }, "@unrs/resolver-binding-darwin-x64": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.12.2.tgz", - "integrity": "sha512-f7rPLi/T1HVKZu/u6t87lroib16n8vrSzcyxI7lg4BGO9UF26KhQL44sd9eOUgrTYhvRXtWOIZT5PejdPyJfUA==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.13.0.tgz", + "integrity": "sha512-t8PXE0Ip9tmGyhRlfVsnEbzGM5iSvJIeNIXciUACjzpg0mmPs13fGv2x7W8sBa0S8zbIiohxKXS9fL/LXW/ERQ==", "dev": true, "optional": true }, "@unrs/resolver-binding-freebsd-x64": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.12.2.tgz", - "integrity": "sha512-BpcOjWCJub6nRZUS2zA20pmLvjtqAtGejETaIyRLiZiQf++cbrjltLA5NN/xaXfqeOBOSlMFbemIl5/S5tljmg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.13.0.tgz", + "integrity": "sha512-qdtl9GDWDoDx6rhzF4RU5SJutV3lcLOiTiyqD6nBxYfEO6lAgLNukfrA+HJ2u2OiyWvV8JW5iEWD3LoONw7lYA==", "dev": true, "optional": true }, "@unrs/resolver-binding-linux-arm-gnueabihf": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.12.2.tgz", - "integrity": "sha512-vZTDvdSISZjJx66OzJqtsOhzifbqRjbmI1Mnu49fQDwog5GtDI4QidRiEAYbZCRj9C8YZEW+3ZjqsyS9GR4k2A==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.13.0.tgz", + "integrity": "sha512-VrMUVwdrScTarsh4B6aUhTtziUavSlglo4Hi8XZ6CpAe4+j3nquY+XoP+tYkiSBDsXZ8386ne4pv4YYYBNi02w==", "dev": true, "optional": true }, "@unrs/resolver-binding-linux-arm-musleabihf": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.12.2.tgz", - "integrity": "sha512-BiPI+IrIlwcW4nLLMM21+B1dFPzd55yAVgVGrdgDjNef+ch03GdxrcyaIz8X9SsQirh/kCQ7mviyWlMxdh2D7g==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.13.0.tgz", + "integrity": "sha512-zSbTVwaxiTC+zYJ9xVNTC6c+BYO/kOV/odcTI3bHuFFXa+XmjLoUkb/8UxsZeU5YF4K000m17wrXoTblNWuzOg==", "dev": true, "optional": true }, "@unrs/resolver-binding-linux-arm64-gnu": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.12.2.tgz", - "integrity": "sha512-zJc0H99FEPoFfSrNpa91HYfxzfAJCr502oxNK1cfdC9hlaFI43RT+JFCann9JUgZmLzzntChHyn13Sgn9ljHNg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.13.0.tgz", + "integrity": "sha512-Z/Rax87moZHsuvJ8awdfP+zrMlsCt3d7mggUPIiPe32KpeagimyzJWnZSMQoV67an9uVQghyh92Pc0VprITnYA==", "dev": true, "optional": true }, "@unrs/resolver-binding-linux-arm64-musl": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.12.2.tgz", - "integrity": "sha512-KQ3Lki6l+Pz1k/eBipN41ES+YUK30beLGb9YqcB1O542cyLCNE6GaxrfcY3T6EezmGGk84wb5XyO9loTM9tkcA==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.13.0.tgz", + "integrity": "sha512-oUzXz8hNvFLNEAag8lBKJe1euiV2dmGHAR+eQ5fNpsZO0F1K7IMRb4J6pqYsd7uLMRQNPiu5A1WKUJHbFLWbbw==", "dev": true, "optional": true }, "@unrs/resolver-binding-linux-loong64-gnu": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-loong64-gnu/-/resolver-binding-linux-loong64-gnu-1.12.2.tgz", - "integrity": "sha512-3SJGEh1DborhG6pyxvhPzCT4bbSIVihsvgJc13P1bHG7KLdNDaF9T3gsTwFc7Jw/5Y5/iWOjkEx7Zy0NvCGX3Q==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-loong64-gnu/-/resolver-binding-linux-loong64-gnu-1.13.0.tgz", + "integrity": "sha512-BxhGYvZBg0YrvNOeSEGR3eNklwXYy0mUJk7oeGJvZoQMKM68zYvbbf52+fQI3Le4X0fW276FTKIoTwjpMob80A==", "dev": true, "optional": true }, "@unrs/resolver-binding-linux-loong64-musl": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-loong64-musl/-/resolver-binding-linux-loong64-musl-1.12.2.tgz", - "integrity": "sha512-jiuG/Obbel7uw1PwHNFfrkiKhLAF6mnyZ6aWlOAVN9WqKm8v0OFGnciJIHu8+CMvXLQ8AD51LPzAoUfT21D5Ew==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-loong64-musl/-/resolver-binding-linux-loong64-musl-1.13.0.tgz", + "integrity": "sha512-nZcIuup9Ar3gAlqoZfX/KW6x83TMI11tLpCjldZG5M1KeY8qNUPNJJ71+sPvG8HMBpoh+ix1pAm5gkMFvcSAcQ==", "dev": true, "optional": true }, "@unrs/resolver-binding-linux-ppc64-gnu": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.12.2.tgz", - "integrity": "sha512-q7xRvVpmcfeL+LlZg8Pbbo6QaTZwDU5BaGZbwfhkEsXJn3Was8xYfE0RBH266xZt0rM6B7i8xAYIvjthuUIWHg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.13.0.tgz", + "integrity": "sha512-AG6AgdDrkRNjAPwD/cftFJGgZUWCiJX+E8vpYCDEnwFHLTHZ7ppBiU6/vyPPwrfjcPUPQCDbbxE/eZUXsx49jQ==", "dev": true, "optional": true }, "@unrs/resolver-binding-linux-riscv64-gnu": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.12.2.tgz", - "integrity": "sha512-0CVdx6lcnT3Q9inOH8tsMIOJ6ImndllMjqJHg8RLVdB7Vq4SfkEXl9mCSsVNuNA4MCYycRicCUxPCabVHJRr6A==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.13.0.tgz", + "integrity": "sha512-6vOqYGcAmzpRWpUURWutzvpf1qJ6eOu5cfYObdtPJnzZ0+Kw4cw+ZkZJqIYEh8fPuTBwSYDL/FwlUhma1G/JVQ==", "dev": true, "optional": true }, "@unrs/resolver-binding-linux-riscv64-musl": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.12.2.tgz", - "integrity": "sha512-iOwlRo9vnp6R6ohHQS11n0NnfdXx/omhkocmIfaPRpQhKZ+3BDMkkdRVh53qjkFkpPddf+FETA28NwGN7l5l+w==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.13.0.tgz", + "integrity": "sha512-4HeIn0S2KVUowK0A+EweXrDvZ8CKHEfTtif0kx9vt3ORNsqcXNFFIFnHE0tizma3/Gt5OGrU2ovYNuj+D/bN4g==", "dev": true, "optional": true }, "@unrs/resolver-binding-linux-s390x-gnu": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.12.2.tgz", - "integrity": "sha512-HYJtLfXq94q8iZNFT1lknx258wlkkWhZeUXJRqzKBBUJ00CvZ+N33zgbCqimLjsyw5Va6uUxhVa12mI+kaveEw==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.13.0.tgz", + "integrity": "sha512-JfkvqY7NZbxyhexLE+g6Z8Hsx4utHOGaVazAVghPiBn8Upw2iERZPpKYnW1FBVU4WStv/BiIsoK/Muke0E7asA==", "dev": true, "optional": true }, "@unrs/resolver-binding-linux-x64-gnu": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.12.2.tgz", - "integrity": "sha512-mPsUhunKKDih5O96Y6enDQyHc1SqBPlY1E/SfMWDM3EdJ95Z9CArPeCVwCCqbP45ljvivdEk8Fxn+SIb1rDAJQ==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.13.0.tgz", + "integrity": "sha512-iwjLeVdZo/8v5OKAeRIC+4VQV045t1EPZr5B/AVLgUQ04IdtNthWzg6not2cNjZgH2gHpSf4fOXMmN83aLO1FA==", "dev": true, "optional": true }, "@unrs/resolver-binding-linux-x64-musl": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.12.2.tgz", - "integrity": "sha512-azrt6+5ydLd8Vt210AAFis/lZevSfPw93EJRIJG+xPu4WCJ8K0kppCTpMyLPcKT7H15M4Jnt2tMp5bOvCkRC6A==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.13.0.tgz", + "integrity": "sha512-TOh1fqOjyq1OPoht3BDLd7Y+HeMJRwd5g2VNmCQclknEbjp4py5GFRmT4L/rOybF5Af8q0LT9zHs2WGkwlqtrw==", "dev": true, "optional": true }, "@unrs/resolver-binding-openharmony-arm64": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-openharmony-arm64/-/resolver-binding-openharmony-arm64-1.12.2.tgz", - "integrity": "sha512-YZ9hP4O0X9PQb8eO980qmLNGH4zT3I9+SZTdt0Pr0YyuGQhYKoOZkV02VzrzyOZJ5xIJ3UFIenKkUkGg8GjgWQ==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-openharmony-arm64/-/resolver-binding-openharmony-arm64-1.13.0.tgz", + "integrity": "sha512-3T2MNtF2dd1yjaXCVqrsi+/3VZeksEzU1hygPzqqkBLVVjn+2iJzXEkxxCKIVFrWnpmEbazeHJp/ruYD0RUVWA==", "dev": true, "optional": true }, - "@unrs/resolver-binding-wasm32-wasi": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.12.2.tgz", - "integrity": "sha512-tYFDIkMxSflfEc/h92ZWNsZlHSwgimbNHSO3PL2JWQHfCuC2q316jMyYU9TIWZsFK2bQwyK5VAdYgn8ygPj69A==", - "dev": true, - "optional": true, - "requires": { - "@emnapi/core": "1.10.0", - "@emnapi/runtime": "1.10.0", - "@napi-rs/wasm-runtime": "^1.1.4" - } - }, "@unrs/resolver-binding-win32-arm64-msvc": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.12.2.tgz", - "integrity": "sha512-qzNyg3xL0VPQmCaUh+N5jSitce6k+uCBfMDesWRnlULOZaqUkaJ0ybdT+UqlAWJoQjuqfIU/0Ptx9bteN4D82g==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.13.0.tgz", + "integrity": "sha512-hKWfSLiN3L4cIxg0jrpyP/66AXLTcyD37jmSn//rGdOUYGlizYxTEFdJ+GZbp2NnaML3YS/A73nCysze8FaJdg==", "dev": true, "optional": true }, "@unrs/resolver-binding-win32-ia32-msvc": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.12.2.tgz", - "integrity": "sha512-WD9sY00OfpHVGfsnHZoA8jVT+esS/Bg8z8jzxp5BnDCjjwsuKsPQrzswwpFy4J1AUJbXPRfkpcX0mXrzeXW79g==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.13.0.tgz", + "integrity": "sha512-N4gDKkDoiyIQEcn3vTqe2ksRxUAtBvQ8c5TiT+WonSa6FHgCAY5+RggnZ134hXJoRj57JEjv4/m+i/pAKHWrTQ==", "dev": true, "optional": true }, "@unrs/resolver-binding-win32-x64-msvc": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.12.2.tgz", - "integrity": "sha512-nAB74NfSNKknqQ1RrYj6uz8FcXEomu/MATJZxh/x+BArzN2U3JbOYC0APYzUIGhVY3m5hRxA8VPNdPBoG8txlA==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.13.0.tgz", + "integrity": "sha512-DpLMlAqlrk4zBVK3DiDjwKD0oq7pZNy+8BiIBRuByqb6dm5jsdoLMhIiyh/xR7+WejaW/1Ui+XgbgMNa4+zWJg==", "dev": true, "optional": true }, @@ -7880,12 +7773,12 @@ "dev": true }, "babel-jest": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.5.0.tgz", - "integrity": "sha512-PrhPHlKC+MsLnuNzgIH/y1dkz1f6cSfKWaQeaG8WxLMuG44dYWQ8E9uRrsBbAGCU/3+BEFYPN4d6G3Zc5Y+waA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.5.2.tgz", + "integrity": "sha512-ES8WeJ2fNWPEDunyAtUfJ12nHyaWUloCHdkfK2oW5uSoQSUmjNKdWiGaXJITJwvFEWoD/evHEg/QoCXAvLaQqQ==", "dev": true, "requires": { - "@jest/transform": "30.5.0", + "@jest/transform": "30.5.2", "@types/babel__core": "^7.20.5", "babel-plugin-istanbul": "^8.0.0", "babel-preset-jest": "30.5.0", @@ -8260,17 +8153,17 @@ "dev": true }, "expect": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-30.5.0.tgz", - "integrity": "sha512-8fiMWcEjPU7B9nErC4FtFcCzf2tC6I75Qf7m8wzBAWC2taZmcno3yAFEjIQL34SwoGZNgPf63UDiJLyh4SMPaw==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-30.5.2.tgz", + "integrity": "sha512-0LNuMvs8/5mRYhnCR4k+lGV7fqPMs6Bnksda4S3zsCUmdxBpAn4zU4NNzXdq1pMKe/H4W5t/zVIDSJ/H3e0vDA==", "dev": true, "requires": { - "@jest/expect-utils": "30.5.0", + "@jest/expect-utils": "30.5.2", "@jest/get-type": "30.5.0", - "jest-matcher-utils": "30.5.0", - "jest-message-util": "30.5.0", - "jest-mock": "30.5.0", - "jest-util": "30.5.0" + "jest-matcher-utils": "30.5.2", + "jest-message-util": "30.5.1", + "jest-mock": "30.5.2", + "jest-util": "30.5.1" } }, "fast-json-stable-stringify": { @@ -8573,115 +8466,115 @@ } }, "jest": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-30.5.0.tgz", - "integrity": "sha512-HeFeOUEKh5gjnp1rjuSCse8Dhj0Y3KA8lsZ3azr4Wnq1nCxwMBu35MDc9mp8iblZxmeAz6wV4P241tyUB7J2Ew==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest/-/jest-30.5.2.tgz", + "integrity": "sha512-3gnpdBIza8ijCl3iMV9ChE3hSt1+46865qqod863gQtJr1DixOkAU5DoGbi3u+XlRcw++BhZQMu/y4xBdHBvSQ==", "dev": true, "requires": { - "@jest/core": "30.5.0", - "@jest/types": "30.5.0", + "@jest/core": "30.5.2", + "@jest/types": "30.5.1", "import-local": "^3.2.0", - "jest-cli": "30.5.0" + "jest-cli": "30.5.2" } }, "jest-changed-files": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-30.5.0.tgz", - "integrity": "sha512-dq1x8JiEnHkJDxxOrF6UJDivBRAQMwAa5tzr+VX3um0SfyMFseUPQUbe51wLwggfoa5h/EmOtSpdJxxkzSlNRQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-30.5.1.tgz", + "integrity": "sha512-0+bvMM/ENhDI29Z8q1r4HxiDIi4G5tnBmSw4esfPQoj9q8Nik7KIyuxHkTVnnniJQf05SxpGaKDQ+4h28ynGPg==", "dev": true, "requires": { "execa": "^5.1.1", - "jest-util": "30.5.0", + "jest-util": "30.5.1", "p-limit": "^3.1.0" } }, "jest-circus": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-30.5.0.tgz", - "integrity": "sha512-T3v7uM4wwCu+RQicjsAWCgoL3CiyuX3THSKwv2uMb9N2bMUgb+HfwDWEUma85vOGbvQNQ/YfoCXF1OCZot0ZEw==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-30.5.2.tgz", + "integrity": "sha512-vffFgjs5JSJ9q4ds1vNW3klKYPJfYfIY61LT/zaZgvTeASJOWZUt8LBfHgIcV4rwxlPBLl/ePBGccHEclS4PlQ==", "dev": true, "requires": { - "@jest/environment": "30.5.0", - "@jest/expect": "30.5.0", - "@jest/test-result": "30.5.0", - "@jest/types": "30.5.0", + "@jest/environment": "30.5.2", + "@jest/expect": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", "chalk": "^4.1.2", "co": "^4.6.0", "dedent": "^1.6.0", "is-generator-fn": "^2.1.0", - "jest-each": "30.5.0", - "jest-matcher-utils": "30.5.0", - "jest-message-util": "30.5.0", - "jest-runtime": "30.5.0", - "jest-snapshot": "30.5.0", - "jest-util": "30.5.0", + "jest-each": "30.5.2", + "jest-matcher-utils": "30.5.2", + "jest-message-util": "30.5.1", + "jest-runtime": "30.5.2", + "jest-snapshot": "30.5.2", + "jest-util": "30.5.1", "p-limit": "^3.1.0", - "pretty-format": "30.5.0", + "pretty-format": "30.5.1", "pure-rand": "^7.0.0", "slash": "^3.0.0", "stack-utils": "^2.0.6" } }, "jest-cli": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-30.5.0.tgz", - "integrity": "sha512-QHZMiy32x2K+NzJ1AuuoCAVc1Y5co0VXib3R7kD9MWcWFflzsD1eJN0wR+mkNlM+ts7C+Bjz0oOoFE5IiHylCg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-30.5.2.tgz", + "integrity": "sha512-YYYxUUVjFgPvgEleKNKMaYGIFgR3l3832Cl0kRL/oCiDZ03v7wImUtquHl2OOBCCNgprjZgBN5bczS/JklPBDg==", "dev": true, "requires": { - "@jest/core": "30.5.0", - "@jest/test-result": "30.5.0", - "@jest/types": "30.5.0", + "@jest/core": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/types": "30.5.1", "chalk": "^4.1.2", "exit-x": "^0.2.2", "import-local": "^3.2.0", - "jest-config": "30.5.0", - "jest-util": "30.5.0", - "jest-validate": "30.5.0", + "jest-config": "30.5.2", + "jest-util": "30.5.1", + "jest-validate": "30.5.1", "yargs": "^17.7.2" } }, "jest-config": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-30.5.0.tgz", - "integrity": "sha512-gYQl2FqYgiVpyuB7DutBIbJRWaq5VcHdzOXJJ51HNa8J5JrsZehIlzNFW0/9s5uvvcbzM5/LTUizYSbsFErv+w==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-30.5.2.tgz", + "integrity": "sha512-U6221OZekabePvGcGPf4raIBKMvYQWFHvhobDJRojOYaFMj2HaGytAdknjDhYc6JTz2fdHW9+6k0wWUDaNeOFQ==", "dev": true, "requires": { "@babel/core": "^7.27.4", "@jest/get-type": "30.5.0", "@jest/pattern": "30.5.0", - "@jest/test-sequencer": "30.5.0", - "@jest/types": "30.5.0", - "babel-jest": "30.5.0", + "@jest/test-sequencer": "30.5.2", + "@jest/types": "30.5.1", + "babel-jest": "30.5.2", "chalk": "^4.1.2", "ci-info": "^4.2.0", "deepmerge": "^4.3.1", "glob": "^13.0.6", "graceful-fs": "^4.2.11", - "jest-circus": "30.5.0", + "jest-circus": "30.5.2", "jest-docblock": "30.5.0", - "jest-environment-node": "30.5.0", + "jest-environment-node": "30.5.2", "jest-regex-util": "30.5.0", - "jest-resolve": "30.5.0", - "jest-runner": "30.5.0", - "jest-util": "30.5.0", - "jest-validate": "30.5.0", + "jest-resolve": "30.5.1", + "jest-runner": "30.5.2", + "jest-util": "30.5.1", + "jest-validate": "30.5.1", "parse-json": "^5.2.0", - "pretty-format": "30.5.0", + "pretty-format": "30.5.1", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" } }, "jest-diff": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.5.0.tgz", - "integrity": "sha512-QjCfDMwdPFvLxTQmS4/Dswx3PUCiqmSXVLGljMC3SU7YG1qHVoR6b86IH/O2G9k9OMyKXz2vS2Q60VnAozNDwA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.5.2.tgz", + "integrity": "sha512-rBtHnI6BWTiWj3lM7fOLVfChx7R9B0u9VV3PRHawKs79x6ZjW1QoSrKenaigNGWlvhtoi2BqvDbABDie+Os3xQ==", "dev": true, "requires": { "@jest/diff-sequences": "30.5.0", "@jest/get-type": "30.5.0", "chalk": "^4.1.2", - "pretty-format": "30.5.0" + "pretty-format": "30.5.1" } }, "jest-docblock": { @@ -8694,40 +8587,41 @@ } }, "jest-each": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-30.5.0.tgz", - "integrity": "sha512-NiMFNhRygJEFqYNt8pnkxppUF6CR486GEpt9rSU6lPBf7KeccaOL0zbjxG8fgJgD//6e7zYdssnlt6j+1kI31A==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-30.5.2.tgz", + "integrity": "sha512-GRrW+7fmmgmkvyfEBqc1QFdWnF1Ex5yG6Y6AWL4TTxnkWlKIT98dsKh3P3UuWm6v4XsQwVE6DEzXIPMzWJ3ZbA==", "dev": true, "requires": { "@jest/get-type": "30.5.0", - "@jest/types": "30.5.0", + "@jest/types": "30.5.1", "chalk": "^4.1.2", - "jest-util": "30.5.0", - "pretty-format": "30.5.0" + "jest-regex-util": "30.5.0", + "jest-util": "30.5.1", + "pretty-format": "30.5.1" } }, "jest-environment-node": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-30.5.0.tgz", - "integrity": "sha512-bTc79ywKLz0ogbT3JIYuEhgWV4Ffd/cJe06co4v8CyRtlmju8x5gokMlGFR8ARWhmk5SnbDRxmf50XWnlZVhDg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-30.5.2.tgz", + "integrity": "sha512-Ciz4KgTGIbojxSKpuFImgWJj5EyqfE8xMq9NxWmOXnQywHHS03H9Mv+vaCB29J5pr3JBrY27WbRV18rBdjh8Dg==", "dev": true, "requires": { - "@jest/environment": "30.5.0", - "@jest/fake-timers": "30.5.0", - "@jest/types": "30.5.0", + "@jest/environment": "30.5.2", + "@jest/fake-timers": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", - "jest-mock": "30.5.0", - "jest-util": "30.5.0", - "jest-validate": "30.5.0" + "jest-mock": "30.5.2", + "jest-util": "30.5.1", + "jest-validate": "30.5.1" } }, "jest-haste-map": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-30.5.0.tgz", - "integrity": "sha512-0FStogBslBVOEqTOJr4oXMtFitmrWp9WscG6Gbns88i0YAuMXijCT2G5VMfg/HCR4QAnL+OF2C2ednag+HlDuA==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-30.5.1.tgz", + "integrity": "sha512-VIFgt67jW480YDxKfEv9IYQKrFpYt7bOCMn3VsnjK7AK9qo7p6acpnA1DHwsVOULE3dTaYew/6JaTD/d0VDHoQ==", "dev": true, "requires": { - "@jest/types": "30.5.0", + "@jest/types": "30.5.1", "@parcel/watcher": "^2.6.0", "@types/node": "*", "anymatch": "^3.1.3", @@ -8735,8 +8629,8 @@ "fdir": "^6.5.0", "graceful-fs": "^4.2.11", "jest-regex-util": "30.5.0", - "jest-util": "30.5.0", - "jest-worker": "30.5.0", + "jest-util": "30.5.1", + "jest-worker": "30.5.1", "picomatch": "^4.0.3" }, "dependencies": { @@ -8756,41 +8650,41 @@ } }, "jest-leak-detector": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-30.5.0.tgz", - "integrity": "sha512-Mq11ceAkNR250Iv45RoOwuG9fb4kYbJ02qoyL7A0nCI8FV5+aG/THmcEUx5uR2dNSa4KOtz+xBKrJ8cZPhPpuQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-30.5.1.tgz", + "integrity": "sha512-gt4GT2aWgEoCNTcBe4rqS74xTIUJxi+UD9SNSu9aOk5LmTEd6fS5KSTmAKAfitCCktQHNN+upUuL6EkBfFbMDQ==", "dev": true, "requires": { "@jest/get-type": "30.5.0", - "pretty-format": "30.5.0" + "pretty-format": "30.5.1" } }, "jest-matcher-utils": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.5.0.tgz", - "integrity": "sha512-EfaYMC9f9ds7fahB/LYFTgd1Z2RS9Vpm2e46gazij0onkpoQG7Daq+MLm8/gQVqWwRVjL/RNDggbFx9MsrJEmQ==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.5.2.tgz", + "integrity": "sha512-lFkB365PTIHOhPzwrb9T6gvlDnPpOZ7/c3ewOKKB7bzztqjVrtlyRL2MkyfJXpyY2u2SKw001JKrTx14fBUFcQ==", "dev": true, "requires": { "@jest/get-type": "30.5.0", "chalk": "^4.1.2", - "jest-diff": "30.5.0", - "pretty-format": "30.5.0" + "jest-diff": "30.5.2", + "pretty-format": "30.5.1" } }, "jest-message-util": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.5.0.tgz", - "integrity": "sha512-dBYMhplGfspKaCnVk9TUy1cZnknWubpuPNEputjz0YJk1G/92R45rn45BvbPMPMtC5LVcIdxJGPOaOSQTiuzJw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.5.1.tgz", + "integrity": "sha512-UdQlLdd9wL/Ys7xRErckqwD6wPlSZYueosSWuHc1r2ztGLwlgPvtSJq2+BPEgaEY13WLvfFbmhTj8pba0Sd1jg==", "dev": true, "requires": { "@babel/code-frame": "^7.27.1", - "@jest/types": "30.5.0", + "@jest/types": "30.5.1", "@types/stack-utils": "^2.0.3", "chalk": "^4.1.2", "graceful-fs": "^4.2.11", - "jest-util": "30.5.0", + "jest-util": "30.5.1", "picomatch": "^4.0.3", - "pretty-format": "30.5.0", + "pretty-format": "30.5.1", "slash": "^3.0.0", "stack-utils": "^2.0.6" }, @@ -8804,15 +8698,15 @@ } }, "jest-mock": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.5.0.tgz", - "integrity": "sha512-bP5MHZpkYrV7xpV+yvhl36DPcXoEmTR57Un5EACcdVpMY7mpkDefCBq+V4mhcjE/3rwUajT6OTrcJTN7EwN1BA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.5.2.tgz", + "integrity": "sha512-KTHb37Fhj8xY8qPFvTFaFJHcdsumQp+ExsUlgoX232Agmc706gagBs53+CYvulV7MVQo9AgXOUxsqzzVBoJlrA==", "dev": true, "requires": { - "@jest/expect-utils": "30.5.0", - "@jest/types": "30.5.0", + "@jest/expect-utils": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", - "jest-util": "30.5.0" + "jest-util": "30.5.1" } }, "jest-regex-util": { @@ -8822,73 +8716,73 @@ "dev": true }, "jest-resolve": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-30.5.0.tgz", - "integrity": "sha512-NFvQWJ4G7e2kN5712iG+12Xr325NRFGAIhovrwLfgq5Oqd4bFHITw4CzcFkZGp1GTCqemC4v1l8/yZzedKZkjw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-30.5.1.tgz", + "integrity": "sha512-wprhLejRtwN6h8ZgaqC0eYjGJ1uMdGPT/+b3eFncbG4NWuuP9QL+vWwRinu9waw7hkOLcpMJGVJAMgBwsPssMQ==", "dev": true, "requires": { "chalk": "^4.1.2", "graceful-fs": "^4.2.11", - "jest-haste-map": "30.5.0", - "jest-util": "30.5.0", - "jest-validate": "30.5.0", + "jest-haste-map": "30.5.1", + "jest-util": "30.5.1", + "jest-validate": "30.5.1", "slash": "^3.0.0", "unrs-resolver": "^1.12.1" } }, "jest-resolve-dependencies": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-30.5.0.tgz", - "integrity": "sha512-TnSBAp3wGOnqXBmLT3OXtJkugw6Vj2KU0IPde2EJmbGns/QMoNlkauJ7jZ8KYaxONSpx0o4pUvi+u1Q/LSk3Pg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-30.5.2.tgz", + "integrity": "sha512-GMI0DP5enX9Z2qW2zFy1bOkrCfWAOPRJQ7qHt0pdfrxBPsgWxglMPrRSK2TX/wRWYxcPRSLFg3Z88qPOzHx7FQ==", "dev": true, "requires": { "jest-regex-util": "30.5.0", - "jest-snapshot": "30.5.0" + "jest-snapshot": "30.5.2" } }, "jest-runner": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-30.5.0.tgz", - "integrity": "sha512-Q6Yt+1LvXvEstvru6sQLT7OQYC77VNl6dK0KEvBkeOHgThmXDqNp3Ox9TglDWFHU85pemqTNdKwxfnmO3vgrdA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-30.5.2.tgz", + "integrity": "sha512-/B6px7hiiNhVSRwuv9AGn0nawYvwsHeQZ3ItTd5Gp2diFd0EOKaWVeWqcbw3L88vx1GfpCKjQkxWItZCTl11Rw==", "dev": true, "requires": { - "@jest/console": "30.5.0", - "@jest/environment": "30.5.0", - "@jest/source-map": "30.5.0", - "@jest/test-result": "30.5.0", - "@jest/transform": "30.5.0", - "@jest/types": "30.5.0", + "@jest/console": "30.5.2", + "@jest/environment": "30.5.2", + "@jest/source-map": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/transform": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", "chalk": "^4.1.2", "emittery": "^0.13.1", "exit-x": "^0.2.2", "graceful-fs": "^4.2.11", "jest-docblock": "30.5.0", - "jest-environment-node": "30.5.0", - "jest-haste-map": "30.5.0", - "jest-leak-detector": "30.5.0", - "jest-message-util": "30.5.0", - "jest-resolve": "30.5.0", - "jest-runtime": "30.5.0", - "jest-util": "30.5.0", - "jest-watcher": "30.5.0", - "jest-worker": "30.5.0", + "jest-environment-node": "30.5.2", + "jest-haste-map": "30.5.1", + "jest-leak-detector": "30.5.1", + "jest-message-util": "30.5.1", + "jest-resolve": "30.5.1", + "jest-runtime": "30.5.2", + "jest-util": "30.5.1", + "jest-watcher": "30.5.2", + "jest-worker": "30.5.1", "p-limit": "^3.1.0" } }, "jest-runtime": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-30.5.0.tgz", - "integrity": "sha512-VTRz0sRIw2EISeHigx1O+CMuwoG4+RKJjF8dp8okzFaDNQEcv5Mw0h5QW8VJXgb2CRF4gZIjSEBb2jdzXPagFQ==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-30.5.2.tgz", + "integrity": "sha512-0paUAHBlheai10A3XSy9Xh+YBG0IROy+/qzcDPzQ/nbbXrznQzeWy5qniICWK6d3W3scaRQCVAbXdcK0ibBq4w==", "dev": true, "requires": { - "@jest/environment": "30.5.0", - "@jest/fake-timers": "30.5.0", - "@jest/globals": "30.5.0", - "@jest/source-map": "30.5.0", - "@jest/test-result": "30.5.0", - "@jest/transform": "30.5.0", - "@jest/types": "30.5.0", + "@jest/environment": "30.5.2", + "@jest/fake-timers": "30.5.2", + "@jest/globals": "30.5.2", + "@jest/source-map": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/transform": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", "chalk": "^4.1.2", "cjs-module-lexer": "^2.2.0", @@ -8896,21 +8790,21 @@ "es-module-lexer": "^2.1.0", "glob": "^13.0.6", "graceful-fs": "^4.2.11", - "jest-haste-map": "30.5.0", - "jest-message-util": "30.5.0", - "jest-mock": "30.5.0", + "jest-haste-map": "30.5.1", + "jest-message-util": "30.5.1", + "jest-mock": "30.5.2", "jest-regex-util": "30.5.0", - "jest-resolve": "30.5.0", - "jest-snapshot": "30.5.0", - "jest-util": "30.5.0", + "jest-resolve": "30.5.1", + "jest-snapshot": "30.5.2", + "jest-util": "30.5.1", "slash": "^3.0.0", "strip-bom": "^4.0.0" } }, "jest-snapshot": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-30.5.0.tgz", - "integrity": "sha512-pZWETdcqmKve9MDTE/AX6RaeAbRhzKhhAXGozAW8Pg2FfOSdUrQ/7D+VdwE3fLQsqjpITXJVQvYVZoMEzrUl0Q==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-30.5.2.tgz", + "integrity": "sha512-jKIdes25AnAH73dOCi2qE6J6vHJ6L2vyBS11M89kT50DVJcLTf2AOjvcc+2vVaN8lUbY5v2R83aqXo3Ro9fqYA==", "dev": true, "requires": { "@babel/core": "^7.27.4", @@ -8918,39 +8812,39 @@ "@babel/plugin-syntax-jsx": "^7.27.1", "@babel/plugin-syntax-typescript": "^7.27.1", "@babel/types": "^7.27.3", - "@jest/expect-utils": "30.5.0", + "@jest/expect-utils": "30.5.2", "@jest/get-type": "30.5.0", - "@jest/snapshot-utils": "30.5.0", - "@jest/transform": "30.5.0", - "@jest/types": "30.5.0", + "@jest/snapshot-utils": "30.5.1", + "@jest/transform": "30.5.2", + "@jest/types": "30.5.1", "babel-preset-current-node-syntax": "^1.2.0", "chalk": "^4.1.2", - "expect": "30.5.0", + "expect": "30.5.2", "graceful-fs": "^4.2.11", - "jest-diff": "30.5.0", - "jest-matcher-utils": "30.5.0", - "jest-message-util": "30.5.0", - "jest-util": "30.5.0", - "pretty-format": "30.5.0", + "jest-diff": "30.5.2", + "jest-matcher-utils": "30.5.2", + "jest-message-util": "30.5.1", + "jest-util": "30.5.1", + "pretty-format": "30.5.1", "semver": "^7.7.2", "synckit": "^0.11.8" }, "dependencies": { "semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "dev": true } } }, "jest-util": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.5.0.tgz", - "integrity": "sha512-lzU4aGUWaS+2X/B0CmgheDasfnsVlRfZh/rNQxB9b9s8cSYUq5BcqdQA95ld+KqJXBUVVt1sqnMQ2T3OxIalmg==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.5.1.tgz", + "integrity": "sha512-yKuxmNy2rSbTXw+3SIPanJo+nV4/BS1p26v44IYBFMsswSQySfMMcPHErnOncda7i9HEz0q605rIhSTBVgrZTg==", "dev": true, "requires": { - "@jest/types": "30.5.0", + "@jest/types": "30.5.1", "@types/node": "*", "chalk": "^4.1.2", "ci-info": "^4.2.0", @@ -8967,17 +8861,17 @@ } }, "jest-validate": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-30.5.0.tgz", - "integrity": "sha512-N/hsPYKgBSzBeVZ2RHCs3yvBbTZNPX7Be8q33zhyo/yeFneBL1swzly31LYU4LJ3zJM9e8TxSM8IYLo2SDJZYQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-30.5.1.tgz", + "integrity": "sha512-i/buJ56wTpxihE93hQYNMfdOThS87+HGvLZzZJmU4xggPcdTYQq051iwALLCHp3q+SkCGH+EFejQZz5EbBSkkg==", "dev": true, "requires": { "@jest/get-type": "30.5.0", - "@jest/types": "30.5.0", + "@jest/types": "30.5.1", "camelcase": "^6.3.0", "chalk": "^4.1.2", "leven": "^3.1.0", - "pretty-format": "30.5.0" + "pretty-format": "30.5.1" }, "dependencies": { "camelcase": { @@ -8989,30 +8883,30 @@ } }, "jest-watcher": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-30.5.0.tgz", - "integrity": "sha512-ujjnEoL4Uu+Swu3WRwYenWMB9JMEiD2T3OypnveMJ64S/1r/5G8eC4OQ1wEOgYWQqMi+mT+buzccflCHr/XJ9Q==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-30.5.2.tgz", + "integrity": "sha512-rqRgg4R11GA9m1UsEZwQeixHsgZReCn6TOHAHtIH33yXrIvoX0OGPA20Yzzjkz7X40fZvcRSxEpQppYPcWzmcQ==", "dev": true, "requires": { - "@jest/test-result": "30.5.0", - "@jest/types": "30.5.0", + "@jest/test-result": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", "ansi-escapes": "^4.3.2", "chalk": "^4.1.2", "emittery": "^0.13.1", - "jest-util": "30.5.0", + "jest-util": "30.5.1", "string-length": "^4.0.2" } }, "jest-worker": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-30.5.0.tgz", - "integrity": "sha512-7kFk/607EoynNHLJa20daivkElM+c9PrCLduYy6AlMkYrXbh5TmVtW1BLXE05Y8baAFsJHMoC3xs2QRRTotwLw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-30.5.1.tgz", + "integrity": "sha512-Cbxh5v7AoLuFRmFJSM4/aHdQ68rjXvUWr716EE0Dh3I7T+T/3FgFKhOERGXHcU2Meftq9+9zxPM3TSNyI9D+HA==", "dev": true, "requires": { "@types/node": "*", "@ungap/structured-clone": "^1.3.0", - "jest-util": "30.5.0", + "jest-util": "30.5.1", "merge-stream": "^2.0.0", "supports-color": "^8.1.1" }, @@ -9107,9 +9001,9 @@ }, "dependencies": { "semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "dev": true } } @@ -9158,9 +9052,9 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "napi-postinstall": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.4.tgz", - "integrity": "sha512-PHI5f1O0EP5xJ9gQmFGMS6IZcrVvTjpXjz7Na41gTE7eE2hK11lg04CECCYEEjdc17EV4DO+fkGEtt7TpTaTiQ==", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.8.tgz", + "integrity": "sha512-dHbDC5V1g/EI8OLEtL4Iuwbu0fgzmyykxenn2KnlsX9XdhTXL3gWnfbbP+ab+oUcgV6CFpb8QGyQt/ZXA0UXig==", "dev": true }, "natural-compare": { @@ -9333,9 +9227,9 @@ } }, "pretty-format": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.5.0.tgz", - "integrity": "sha512-mzNzBErpHwM0zpmWS7ExOv62yhQhvd546nUuFqVR0dmnJB59tfrw9sjDF0DJknwsr59OXP0buwJ7PaKguczHSg==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.5.1.tgz", + "integrity": "sha512-byhRAPguVKMQIj4kjJwJ5lAskVhfuiSdiYl/aLTWpgkGEmic2jYhJh1yE9ih8Ox44Xg9ccCT11/S6QrzSJuNrg==", "dev": true, "requires": { "@jest/react-is-18": "npm:react-is@^18.3.1", @@ -9683,45 +9577,44 @@ "optional": true }, "undici": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-8.10.0.tgz", - "integrity": "sha512-HvltHd7avK13QIw/oLe4qoOLyoVSoafqJ2jYOrtMRBkbYT31eiBQ8O0ehRKZiEZCMEyLFQNIADpgCWC5fALvYQ==" + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-8.11.0.tgz", + "integrity": "sha512-AdzuGcAkzhbha3GgCSoUBx2P0quwym6qdFNCQz/fDGZc8w9XJ741wHUbt2kTmfPz+ZIOMkySFkiY7RXmiDDC8w==" }, "undici-types": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", - "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz", + "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==", "dev": true }, "unrs-resolver": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.12.2.tgz", - "integrity": "sha512-dmlRxBJJayXjqTwC+JtF1HhJmgf3ftQ3YejFcZrf4+KKtJv0qDsK1pjqaaVjG7wJ5NJ6UVP1OqRMQ71Z4C3rxQ==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.13.0.tgz", + "integrity": "sha512-mcPQo9Vm6kXd84d/WqMiYBi2CcA57QHBX/ev5PoUEb8b2oQzUvJ6xYsfseQblnCncgnVmCZGWiFwK7KkS5JZJA==", "dev": true, "requires": { - "@unrs/resolver-binding-android-arm-eabi": "1.12.2", - "@unrs/resolver-binding-android-arm64": "1.12.2", - "@unrs/resolver-binding-darwin-arm64": "1.12.2", - "@unrs/resolver-binding-darwin-x64": "1.12.2", - "@unrs/resolver-binding-freebsd-x64": "1.12.2", - "@unrs/resolver-binding-linux-arm-gnueabihf": "1.12.2", - "@unrs/resolver-binding-linux-arm-musleabihf": "1.12.2", - "@unrs/resolver-binding-linux-arm64-gnu": "1.12.2", - "@unrs/resolver-binding-linux-arm64-musl": "1.12.2", - "@unrs/resolver-binding-linux-loong64-gnu": "1.12.2", - "@unrs/resolver-binding-linux-loong64-musl": "1.12.2", - "@unrs/resolver-binding-linux-ppc64-gnu": "1.12.2", - "@unrs/resolver-binding-linux-riscv64-gnu": "1.12.2", - "@unrs/resolver-binding-linux-riscv64-musl": "1.12.2", - "@unrs/resolver-binding-linux-s390x-gnu": "1.12.2", - "@unrs/resolver-binding-linux-x64-gnu": "1.12.2", - "@unrs/resolver-binding-linux-x64-musl": "1.12.2", - "@unrs/resolver-binding-openharmony-arm64": "1.12.2", - "@unrs/resolver-binding-wasm32-wasi": "1.12.2", - "@unrs/resolver-binding-win32-arm64-msvc": "1.12.2", - "@unrs/resolver-binding-win32-ia32-msvc": "1.12.2", - "@unrs/resolver-binding-win32-x64-msvc": "1.12.2", - "napi-postinstall": "^0.3.4" + "@unrs/resolver-binding-android-arm-eabi": "1.13.0", + "@unrs/resolver-binding-android-arm64": "1.13.0", + "@unrs/resolver-binding-darwin-arm64": "1.13.0", + "@unrs/resolver-binding-darwin-x64": "1.13.0", + "@unrs/resolver-binding-freebsd-x64": "1.13.0", + "@unrs/resolver-binding-linux-arm-gnueabihf": "1.13.0", + "@unrs/resolver-binding-linux-arm-musleabihf": "1.13.0", + "@unrs/resolver-binding-linux-arm64-gnu": "1.13.0", + "@unrs/resolver-binding-linux-arm64-musl": "1.13.0", + "@unrs/resolver-binding-linux-loong64-gnu": "1.13.0", + "@unrs/resolver-binding-linux-loong64-musl": "1.13.0", + "@unrs/resolver-binding-linux-ppc64-gnu": "1.13.0", + "@unrs/resolver-binding-linux-riscv64-gnu": "1.13.0", + "@unrs/resolver-binding-linux-riscv64-musl": "1.13.0", + "@unrs/resolver-binding-linux-s390x-gnu": "1.13.0", + "@unrs/resolver-binding-linux-x64-gnu": "1.13.0", + "@unrs/resolver-binding-linux-x64-musl": "1.13.0", + "@unrs/resolver-binding-openharmony-arm64": "1.13.0", + "@unrs/resolver-binding-win32-arm64-msvc": "1.13.0", + "@unrs/resolver-binding-win32-ia32-msvc": "1.13.0", + "@unrs/resolver-binding-win32-x64-msvc": "1.13.0", + "napi-postinstall": "^0.3.7" } }, "update-browserslist-db": { diff --git a/package.json b/package.json index 846b58e..10b84f5 100644 --- a/package.json +++ b/package.json @@ -46,16 +46,16 @@ "@actions/tool-cache": "^4.0.0", "@renovatebot/pep440": "^5.0.0", "smol-toml": "^1.8.0", - "undici": "^8.10.0" + "undici": "^8.11.0" }, "devDependencies": { - "@biomejs/biome": "^2.5.11", + "@biomejs/biome": "^2.5.14", "@types/js-yaml": "^4.0.9", - "@types/node": "^26.4.0", + "@types/node": "^26.6.2", "@types/semver": "^7.8.0", "@vercel/ncc": "^0.45.0", "esbuild": "^0.28.2", - "jest": "^30.5.0", + "jest": "^30.5.2", "js-yaml": "^5.4.1", "ts-jest": "^29.4.11", "typescript": "^6.0.3"