From c6b5c4f458d46cdc1b02cd8528482c8ea02eea2a Mon Sep 17 00:00:00 2001 From: Renovate Date: Fri, 2 Oct 2026 00:38:55 +0000 Subject: [PATCH] chore(deps): pin dependencies --- .github/workflows/codeql-analysis.yml | 8 +- .../conventional-commit-pr-title.yml | 2 +- .github/workflows/dist.yml | 4 +- .github/workflows/release-please.yml | 6 +- .github/workflows/test.yml | 6 +- .github/workflows/update-dependencies.yml | 2 +- dist/index.js | 1081 +++++++++++++---- package.json | 2 +- 8 files changed, 883 insertions(+), 228 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ccf05854..22872aff 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -40,11 +40,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v6.1.0 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v4 + uses: github/codeql-action/init@v4.38.2 with: config-file: ./.github/codeql/codeql-config-${{ matrix.language }}.yml languages: ${{ matrix.language }} @@ -52,7 +52,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@v4 + uses: github/codeql-action/autobuild@v4.38.2 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -66,4 +66,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v4 + uses: github/codeql-action/analyze@v4.38.2 diff --git a/.github/workflows/conventional-commit-pr-title.yml b/.github/workflows/conventional-commit-pr-title.yml index 1bd683f9..cf0b994c 100644 --- a/.github/workflows/conventional-commit-pr-title.yml +++ b/.github/workflows/conventional-commit-pr-title.yml @@ -14,6 +14,6 @@ jobs: permissions: pull-requests: read steps: - - uses: amannn/action-semantic-pull-request@v6 + - uses: amannn/action-semantic-pull-request@v6.1.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index ea7f0658..d8a182a3 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -9,12 +9,12 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v6.1.0 with: token: ${{ secrets.DEVEX_BOT_TOKEN }} - name: Setup node 24 - uses: actions/setup-node@v6 + uses: actions/setup-node@v6.5.0 with: node-version: 24.11.1 diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 76c562a8..25c0a2c5 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -9,14 +9,14 @@ jobs: release-please-release: runs-on: ubuntu-latest steps: - - uses: google-github-actions/release-please-action@v3 + - uses: google-github-actions/release-please-action@v3.7.13 id: release with: package-name: ${{env.ACTION_NAME}} release-type: node token: ${{ github.token }} command: github-release - - uses: actions/checkout@v3 + - uses: actions/checkout@v3.7.0 - name: Tag major and minor versions if: ${{ steps.release.outputs.release_created }} run: | @@ -36,7 +36,7 @@ jobs: - release-please-release steps: - id: release-pr - uses: google-github-actions/release-please-action@v3 + uses: google-github-actions/release-please-action@v3.7.13 with: token: ${{ secrets.DEVEX_BOT_TOKEN }} release-type: node diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 59227cdd..6e0cd763 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,10 +44,10 @@ jobs: statuses: write checks: write steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v6.1.0 - name: Setup node 24 - uses: actions/setup-node@v6 + uses: actions/setup-node@v6.5.0 with: node-version: 24.11.1 @@ -62,7 +62,7 @@ jobs: run: npm run all - name: Test Report - uses: dorny/test-reporter@v1 + uses: dorny/test-reporter@v1.9.1 if: success() || failure() with: name: JEST Tests diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml index 8550feeb..90ef8824 100644 --- a/.github/workflows/update-dependencies.yml +++ b/.github/workflows/update-dependencies.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v3.7.0 - name: Self-hosted Renovate uses: renovatebot/github-action@f9c81dddc9b589e4e6ae0326d1e36f6bc415d230 # v39.2.4 diff --git a/dist/index.js b/dist/index.js index e90ac596..018833e4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -23288,7 +23288,7 @@ var require_commonjs2 = __commonJS({ "node_modules/brace-expansion/dist/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.EXPANSION_MAX_LENGTH = exports2.EXPANSION_MAX = void 0; + exports2.EXPANSION_MAX_REWRITES = exports2.EXPANSION_MAX_DEPTH = exports2.EXPANSION_MAX_LENGTH = exports2.EXPANSION_MAX = void 0; exports2.expand = expand; var balanced_match_1 = require_commonjs(); var escSlash = "\0SLASH" + Math.random() + "\0"; @@ -23308,6 +23308,8 @@ var require_commonjs2 = __commonJS({ var periodPattern = /\\\./g; exports2.EXPANSION_MAX = 1e5; exports2.EXPANSION_MAX_LENGTH = 4e6; + exports2.EXPANSION_MAX_DEPTH = 1e3; + exports2.EXPANSION_MAX_REWRITES = 1e3; function numeric(str) { return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0); } @@ -23317,36 +23319,44 @@ var require_commonjs2 = __commonJS({ function unescapeBraces(str) { return str.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, "."); } - function parseCommaParts(str) { - if (!str) { - return [""]; + function pushAll(target, items) { + for (let i = 0; i < items.length; i++) { + target.push(items[i]); } + } + function parseCommaParts(str) { const parts = []; - const m = (0, balanced_match_1.balanced)("{", "}", str); - if (!m) { - return str.split(","); - } - const { pre, body, post } = m; - const p = pre.split(","); - p[p.length - 1] += "{" + body + "}"; - const postParts = parseCommaParts(post); - if (post.length) { - ; - p[p.length - 1] += postParts.shift(); - p.push.apply(p, postParts); - } - parts.push.apply(parts, p); - return parts; + let carry = ""; + for (; ; ) { + const m = (0, balanced_match_1.balanced)("{", "}", str); + if (!m) { + const tail = str.split(","); + tail[0] = carry + tail[0]; + pushAll(parts, tail); + return parts; + } + const { pre, body, post } = m; + const p = pre.split(","); + p[0] = carry + p[0]; + p[p.length - 1] += "{" + body + "}"; + if (!post.length) { + pushAll(parts, p); + return parts; + } + carry = p.pop(); + pushAll(parts, p); + str = post; + } } function expand(str, options = {}) { if (!str) { return []; } - const { max = exports2.EXPANSION_MAX, maxLength = exports2.EXPANSION_MAX_LENGTH } = options; + const { max = exports2.EXPANSION_MAX, maxLength = exports2.EXPANSION_MAX_LENGTH, maxDepth = exports2.EXPANSION_MAX_DEPTH, maxRewrites = exports2.EXPANSION_MAX_REWRITES } = options; if (str.slice(0, 2) === "{}") { str = "\\{\\}" + str.slice(2); } - return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces); + return expand_(escapeBraces(str), max, maxLength, maxDepth, 0, maxRewrites, true).map(unescapeBraces); } function embrace(str) { return "{" + str + "}"; @@ -23424,8 +23434,12 @@ var require_commonjs2 = __commonJS({ } return N; } - function expand_(str, max, maxLength, isTop) { + function expand_(str, max, maxLength, maxDepth, depth, maxRewrites, isTop) { + if (depth > maxDepth) { + return [str]; + } let acc = [""]; + let rewrites = 0; let dropEmpties = false; let firstGroup = true; for (; ; ) { @@ -23447,7 +23461,8 @@ var require_commonjs2 = __commonJS({ const isSequence = isNumericSequence || isAlphaSequence; const isOptions = m.body.indexOf(",") >= 0; if (!isSequence && !isOptions) { - if (m.post.match(/,(?!,).*\}/)) { + if (rewrites < maxRewrites && m.post.match(/,(?!,).*\}/)) { + rewrites++; str = m.pre + "{" + m.body + escClose + m.post; isTop = true; continue; @@ -23464,7 +23479,7 @@ var require_commonjs2 = __commonJS({ } else { let n = parseCommaParts(m.body); if (n.length === 1 && n[0] !== void 0) { - n = expand_(n[0], max, maxLength, false).map(embrace); + n = expand_(n[0], max, maxLength, maxDepth, depth + 1, maxRewrites, false).map(embrace); if (n.length === 1) { acc = combine(acc, pre + n[0], [""], max, maxLength, dropEmpties && !m.post.length); if (!m.post.length) @@ -23482,7 +23497,7 @@ var require_commonjs2 = __commonJS({ values = []; let valuesLength = 0; outer: for (let j = 0; j < n.length; j++) { - const expanded = expand_(n[j], max, maxLength, false); + const expanded = expand_(n[j], max, maxLength, maxDepth, depth + 1, maxRewrites, false); for (let k = 0; k < expanded.length; k++) { const v = expanded[k]; if (dropsEmpties && !v) @@ -53694,22 +53709,82 @@ var require_axios = __commonJS({ var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype); + var isUnsafeObjectKey = (prop) => typeof prop === "string" && (prop === "__proto__" || prop === "constructor" || prop === "prototype"); + var isPrototypeBoundary = (obj, prototype2, source) => obj === Object.prototype || !source && prototype2 === null; + var isSafeAndFullyMutable = (obj) => { + if (!Object.isExtensible(obj)) { + return false; + } + const props = Object.getOwnPropertyNames(obj); + if (Object.getOwnPropertySymbols) { + props.push(...Object.getOwnPropertySymbols(obj)); + } + return props.every((prop) => { + if (isUnsafeObjectKey(prop)) { + return false; + } + const descriptor = Object.getOwnPropertyDescriptor(obj, prop); + return !!descriptor && descriptor.configurable && descriptor.writable === true; + }); + }; var hasOwnInPrototypeChain = (thing, prop) => { let obj = thing; const seen = []; - while (obj != null && obj !== Object.prototype) { + while (obj != null) { if (seen.indexOf(obj) !== -1) { return false; } seen.push(obj); + const prototype2 = getPrototypeOf(obj); + if (isPrototypeBoundary(obj, prototype2, obj === thing)) { + return false; + } if (hasOwnProperty(obj, prop)) { return true; } - obj = getPrototypeOf(obj); + obj = prototype2; } return false; }; var getSafeProp = (obj, prop) => obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : void 0; + var toSafeFlatObject = (thing) => { + if (thing == null || typeof thing !== "object" && typeof thing !== "function") { + return thing; + } + const sourcePrototype = getPrototypeOf(thing); + if (sourcePrototype === null && isSafeAndFullyMutable(thing)) { + return thing; + } + const result = /* @__PURE__ */ Object.create(null); + const merged = /* @__PURE__ */ Object.create(null); + const seen = []; + let current = thing; + while (current != null) { + if (seen.indexOf(current) !== -1) { + break; + } + seen.push(current); + const prototype2 = current === thing ? sourcePrototype : getPrototypeOf(current); + if (isPrototypeBoundary(current, prototype2, current === thing)) { + break; + } + const props = Object.getOwnPropertyNames(current); + if (Object.getOwnPropertySymbols) { + props.push(...Object.getOwnPropertySymbols(current)); + } + for (const prop of props) { + if (isUnsafeObjectKey(prop)) { + continue; + } + if (!hasOwnProperty(merged, prop)) { + result[prop] = thing[prop]; + merged[prop] = true; + } + } + current = prototype2; + } + return result; + }; var kindOf = /* @__PURE__ */ ((cache) => (thing) => { const str = toString.call(thing); return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); @@ -53746,9 +53821,9 @@ var require_axios = __commonJS({ return false; } const prototype2 = getPrototypeOf(val); - return (prototype2 === null || prototype2 === Object.prototype || getPrototypeOf(prototype2) === null) && // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or - // Symbol.iterator as evidence the value is a tagged/iterable type rather - // than a plain object, while ignoring keys injected onto Object.prototype. + return (prototype2 === null || prototype2 === Object.prototype || getPrototypeOf(prototype2) === null) && // Treat safe own/inherited Symbol.toStringTag or Symbol.iterator members as + // evidence the value is tagged/iterable, while ignoring members reachable + // only through shared or terminal prototype boundaries. !hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator); }; var isEmptyObject = (val) => { @@ -53769,6 +53844,7 @@ var require_axios = __commonJS({ var isReactNative = (formData) => formData && typeof formData.getParts !== "undefined"; var isBlob = kindOfTest("Blob"); var isFileList = kindOfTest("FileList"); + var isSet = kindOfTest("Set"); var isStream = (val) => isObject(val) && isFunction$1(val.pipe); function getGlobal() { if (typeof globalThis !== "undefined") return globalThis; @@ -54066,11 +54142,20 @@ var require_axios = __commonJS({ } if (!("toJSON" in source)) { visited.add(source); - const target = isArray(source) ? [] : {}; - forEach(source, (value, key) => { - const reducedValue = visit(value); - !isUndefined(reducedValue) && (target[key] = reducedValue); - }); + let target; + if (isSet(source)) { + target = []; + for (const value of source) { + const reducedValue = visit(value); + !isUndefined(reducedValue) && target.push(reducedValue); + } + } else { + target = isArray(source) ? [] : {}; + forEach(source, (value, key) => { + const reducedValue = visit(value); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + } visited.delete(source); return target; } @@ -54150,6 +54235,7 @@ var require_axios = __commonJS({ // an alias to avoid ESLint no-prototype-builtins detection hasOwnInPrototypeChain, getSafeProp, + toSafeFlatObject, reduceDescriptors, freezeMethods, toObjectSet, @@ -54178,17 +54264,18 @@ var require_axios = __commonJS({ i = line.indexOf(":"); key = line.substring(0, i).trim().toLowerCase(); val = line.substring(i + 1).trim(); - if (!key || parsed[key] && ignoreDuplicateOf[key]) { + const hasKey = utils$1.hasOwnProp(parsed, key); + if (!key || hasKey && utils$1.hasOwnProp(ignoreDuplicateOf, key)) { return; } if (key === "set-cookie") { - if (parsed[key]) { + if (hasKey) { parsed[key].push(val); } else { parsed[key] = [val]; } } else { - parsed[key] = parsed[key] ? parsed[key] + ", " + val : val; + parsed[key] = hasKey ? parsed[key] + ", " + val : val; } }); return parsed; @@ -54229,7 +54316,7 @@ var require_axios = __commonJS({ }); return byteStringHeaders; } - var $internals = Symbol("internals"); + var $internals$1 = Symbol("internals"); function normalizeHeader(header) { return header && String(header).trim().toLowerCase(); } @@ -54248,6 +54335,90 @@ var require_axios = __commonJS({ } return tokens; } + var parameterNameRE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; + function trimOWS(value) { + let start = 0; + let end = value.length; + while (start < end) { + const code = value.charCodeAt(start); + if (code !== 9 && code !== 32) { + break; + } + start += 1; + } + while (end > start) { + const code = value.charCodeAt(end - 1); + if (code !== 9 && code !== 32) { + break; + } + end -= 1; + } + return start === 0 && end === value.length ? value : value.slice(start, end); + } + function decodeQuotedString(value) { + const last = value.length - 1; + if (last < 1 || value.charCodeAt(0) !== 34 || value.charCodeAt(last) !== 34) { + return value; + } + let decoded = ""; + for (let i = 1; i < last; i++) { + const code = value.charCodeAt(i); + if (code === 34) { + return value; + } + if (code === 92) { + i += 1; + if (i >= last) { + return value; + } + } + decoded += value[i]; + } + return decoded; + } + function parseParameters(value) { + const parameters = /* @__PURE__ */ Object.create(null); + const str = String(value); + let start = 0; + let quoted = false; + let escaped = false; + function parseParameter(end) { + const part = trimOWS(str.slice(start, end)); + const equals = part.indexOf("="); + if (equals < 1) { + return; + } + const name = trimOWS(part.slice(0, equals)); + if (!parameterNameRE.test(name)) { + return; + } + const normalizedName = name.toLowerCase(); + if (normalizedName === "__proto__" || normalizedName === "constructor" || normalizedName === "prototype") { + return; + } + const parameterValue = trimOWS(part.slice(equals + 1)); + parameters[normalizedName] = decodeQuotedString(parameterValue); + } + for (let i = 0; i < str.length; i++) { + const code = str.charCodeAt(i); + if (quoted) { + if (escaped) { + escaped = false; + } else if (code === 92) { + escaped = true; + } else if (code === 34) { + quoted = false; + } + } else if (code === 34) { + quoted = true; + } else if (code === 44 || code === 59) { + parseParameter(i); + start = i + 1; + } + } + parseParameter(str.length); + return parameters; + } var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { if (utils$1.isFunction(filter)) { @@ -54423,7 +54594,8 @@ var require_axios = __commonJS({ return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n"); } getSetCookie() { - return this.get("set-cookie") || []; + const value = this.get("set-cookie"); + return utils$1.isArray(value) ? value : value == null || value === false ? [] : [value]; } get [Symbol.toStringTag]() { return "AxiosHeaders"; @@ -54431,13 +54603,16 @@ var require_axios = __commonJS({ static from(thing) { return thing instanceof this ? thing : new this(thing); } + static parseParameters(value) { + return parseParameters(value); + } static concat(first, ...targets) { const computed = new this(first); targets.forEach((target) => computed.set(target)); return computed; } static accessor(header) { - const internals = this[$internals] = this[$internals] = { + const internals = this[$internals$1] = this[$internals$1] = { accessors: {} }; const accessors = internals.accessors; @@ -54518,9 +54693,30 @@ var require_axios = __commonJS({ }; return visit(config); } + function stringifySafely$1(value) { + try { + return String(value); + } catch (err) { + return ""; + } + } + function aggregateErrorMessage(error2) { + const message = error2.errors.map((entry) => { + try { + return entry && entry.message ? stringifySafely$1(entry.message) : stringifySafely$1(entry); + } catch (err) { + return ""; + } + }).filter(Boolean).join("; "); + return message || error2.name || "AggregateError"; + } var AxiosError = class _AxiosError extends Error { static from(error2, code, config, request, response, customProps) { - const axiosError = new _AxiosError(error2.message, code || error2.code, config, request, response); + let message = error2.message; + if (!message && utils$1.isArray(error2.errors) && error2.errors.length) { + message = aggregateErrorMessage(error2); + } + const axiosError = new _AxiosError(message, code || error2.code, config, request, response); Object.defineProperty(axiosError, "cause", { __proto__: null, value: error2, @@ -54604,6 +54800,14 @@ var require_axios = __commonJS({ AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT"; AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL"; AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED"; + var PlatformBuffer = { + isBufferAvailable() { + return typeof Buffer !== "undefined"; + }, + from(value) { + return Buffer.from(value); + } + }; var DEFAULT_FORM_DATA_MAX_DEPTH = 100; function isVisitable(thing) { return utils$1.isPlainObject(thing) || utils$1.isArray(thing); @@ -54629,19 +54833,16 @@ var require_axios = __commonJS({ throw new TypeError("target must be an object"); } formData = formData || new (FormData$1 || FormData)(); - options = utils$1.toFlatObject(options, { - metaTokens: true, - dots: false, - indexes: false - }, false, function defined(option, source) { - return !utils$1.isUndefined(source[option]); - }); - const metaTokens = options.metaTokens; - const visitor = options.visitor || defaultVisitor; - const dots = options.dots; - const indexes = options.indexes; - const _Blob = options.Blob || typeof Blob !== "undefined" && Blob; - const maxDepth = options.maxDepth === void 0 ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth; + const option = (name, fallback) => { + const value = utils$1.getSafeProp(options, name); + return utils$1.isUndefined(value) ? fallback : value; + }; + const metaTokens = option("metaTokens", true); + const visitor = option("visitor") || defaultVisitor; + const dots = option("dots", false); + const indexes = option("indexes", false); + const _Blob = option("Blob") || typeof Blob !== "undefined" && Blob; + const maxDepth = option("maxDepth", DEFAULT_FORM_DATA_MAX_DEPTH); const useBlob = _Blob && utils$1.isSpecCompliantForm(formData); const stack = []; if (!utils$1.isFunction(visitor)) { @@ -54662,8 +54863,8 @@ var require_axios = __commonJS({ if (useBlob && typeof _Blob === "function") { return new _Blob([value]); } - if (typeof Buffer !== "undefined") { - return Buffer.from(value); + if (PlatformBuffer && PlatformBuffer.isBufferAvailable()) { + return PlatformBuffer.from(value); } throw new AxiosError("Blob is not supported. Use a Buffer instead.", AxiosError.ERR_NOT_SUPPORT); } @@ -54800,9 +55001,47 @@ var require_axios = __commonJS({ } return url2; } + var $internals = Symbol("internals"); + function countHandlers(handlers) { + return handlers ? handlers.length : 0; + } + function trimHandlers(handlers) { + if (!handlers) { + return; + } + while (handlers.length && handlers[handlers.length - 1] === null) { + handlers.pop(); + } + } + function syncHandlerEntries(manager, internals) { + const handlers = manager.handlers; + const length = countHandlers(handlers); + if (handlers !== internals.handlersRef) { + internals.handlersRef = handlers; + internals.handlerEntries.clear(); + } else if (length !== internals.handlersLength) { + if (!length) { + internals.handlerEntries.clear(); + } else { + internals.handlerEntries.forEach(function removeStaleEntry(entry, id) { + if (handlers[entry.index] !== entry.handler) { + internals.handlerEntries.delete(id); + } + }); + } + } + internals.handlersLength = length; + } var InterceptorManager = class { constructor() { this.handlers = []; + this[$internals] = { + handlersRef: this.handlers, + handlersLength: this.handlers.length, + handlerEntries: /* @__PURE__ */ new Map(), + iterationDepth: 0, + nextId: 0 + }; } /** * Add a new interceptor to the stack @@ -54814,13 +55053,25 @@ var require_axios = __commonJS({ * @return {Number} An ID used to remove interceptor later */ use(fulfilled, rejected, options) { - this.handlers.push({ + const handler = { fulfilled, rejected, synchronous: options ? options.synchronous : false, runWhen: options ? options.runWhen : null + }; + const internals = this[$internals]; + if (this.handlers == null) { + this.handlers = []; + } + syncHandlerEntries(this, internals); + const id = internals.nextId++; + this.handlers.push(handler); + internals.handlerEntries.set(id, { + handler, + index: this.handlers.length - 1 }); - return this.handlers.length - 1; + internals.handlersLength = this.handlers.length; + return id; } /** * Remove an interceptor from the stack @@ -54830,8 +55081,19 @@ var require_axios = __commonJS({ * @returns {void} */ eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; + const internals = this[$internals]; + syncHandlerEntries(this, internals); + const entry = internals.handlerEntries.get(id); + if (entry) { + internals.handlerEntries.delete(id); + if (this.handlers[entry.index] !== entry.handler) { + return; + } + this.handlers[entry.index] = null; + if (!internals.iterationDepth) { + trimHandlers(this.handlers); + internals.handlersLength = this.handlers.length; + } } } /** @@ -54842,6 +55104,7 @@ var require_axios = __commonJS({ clear() { if (this.handlers) { this.handlers = []; + syncHandlerEntries(this, this[$internals]); } } /** @@ -54855,11 +55118,22 @@ var require_axios = __commonJS({ * @returns {void} */ forEach(fn) { - utils$1.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); + const internals = this[$internals]; + syncHandlerEntries(this, internals); + internals.iterationDepth++; + try { + utils$1.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } finally { + if (!--internals.iterationDepth) { + syncHandlerEntries(this, internals); + trimHandlers(this.handlers); + internals.handlersLength = countHandlers(this.handlers); } - }); + } } }; var transitionalDefaults = { @@ -54941,7 +55215,7 @@ var require_axios = __commonJS({ } function parsePropPath(name) { const path2 = []; - const pattern = /\w+|\[(\w*)]/g; + const pattern = /[^.[\]]+|\[([^.[\]]*)]/g; let match; while ((match = pattern.exec(name)) !== null) { throwIfDepthExceeded(path2.length); @@ -54995,6 +55269,7 @@ var require_axios = __commonJS({ } return null; } + var methodList = Object.freeze(["get", "delete", "head", "options", "post", "put", "patch", "purge", "link", "unlink", "query"]); var own = (obj, key) => obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : void 0; function stringifySafely(rawValue, parser, encoder) { if (utils$1.isString(rawValue)) { @@ -55100,7 +55375,7 @@ var require_axios = __commonJS({ } } }; - utils$1.forEach(["delete", "get", "head", "post", "put", "patch", "query"], (method) => { + utils$1.forEach(methodList, (method) => { defaults.headers[method] = {}; }); function transformData(fns, response) { @@ -55148,23 +55423,51 @@ var require_axios = __commonJS({ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2); } function combineURLs(baseURL, relativeURL) { - return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; + if (!relativeURL) { + return baseURL; + } + let end = baseURL.length; + while (end > 0 && baseURL.charCodeAt(end - 1) === 47) { + end--; + } + return baseURL.slice(0, end) + "/" + relativeURL.replace(/^\/+/, ""); + } + var urlParserControlCharacters = /[\t\n\r]/g; + function normalizeURLForProtocolCheck(url2) { + if (typeof url2 !== "string") { + return url2; + } + let start = 0; + while (start < url2.length && url2.charCodeAt(start) <= 32) { + start++; + } + return url2.slice(start).replace(urlParserControlCharacters, ""); } var malformedHttpProtocol = /^https?:(?!\/\/)/i; - var httpProtocolControlCharacters = /[\t\n\r]/g; - function stripLeadingC0ControlOrSpace(url2) { - let i = 0; - while (i < url2.length && url2.charCodeAt(i) <= 32) { - i++; + function redactFragment(fragment) { + if (!fragment) { + return fragment; } - return url2.slice(i); + return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, (match, separator, parameterName = "") => { + return `${separator}${parameterName}${REDACTED}`; + }); } - function normalizeURLForProtocolCheck(url2) { - return stripLeadingC0ControlOrSpace(url2).replace(httpProtocolControlCharacters, ""); + function redactSensitiveURLParts(url2) { + const redactedURL = url2.replace(/^(https?:\/{0,2})[^/?#]*@/i, `$1${REDACTED}@`); + const fragmentIndex = redactedURL.indexOf("#"); + const urlWithoutFragment = fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex); + const redactedURLWithoutFragment = urlWithoutFragment.replace(/([?&][^=&#]*=)[^&#]*/g, `$1${REDACTED}`); + if (fragmentIndex === -1) { + return redactedURLWithoutFragment; + } + return `${redactedURLWithoutFragment}#${redactFragment(redactedURL.slice(fragmentIndex + 1))}`; } function assertValidHttpProtocolURL(url2, config) { - if (typeof url2 === "string" && malformedHttpProtocol.test(normalizeURLForProtocolCheck(url2))) { - throw new AxiosError('Invalid URL: missing "//" after protocol', AxiosError.ERR_INVALID_URL, config); + if (typeof url2 === "string") { + const normalizedURL = normalizeURLForProtocolCheck(url2); + if (malformedHttpProtocol.test(normalizedURL)) { + throw new AxiosError(`Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing "//" after protocol`, AxiosError.ERR_INVALID_URL, config); + } } } function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) { @@ -55241,12 +55544,12 @@ var require_axios = __commonJS({ function getEnv(key) { return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || ""; } - var VERSION = "1.18.1"; + var VERSION = "1.20.0"; function parseProtocol(url2) { const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url2); return match && match[1] || ""; } - var DATA_URL_PATTERN = /^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/; + var DATA_URL_PATTERN = /^([^,;/]+\/[^,;/]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/; function fromDataURI(uri, asBlob, options) { const _Blob = options && options.Blob || platform2.classes.Blob; const protocol = parseProtocol(uri); @@ -55282,6 +55585,18 @@ var require_axios = __commonJS({ } throw new AxiosError("Unsupported protocol " + protocol, AxiosError.ERR_NOT_SUPPORT); } + var FORM_DATA_CONTENT_HEADERS = ["content-type", "content-length"]; + function setFormDataHeaders(headers, formHeaders, policy) { + if (policy !== "content-only") { + headers.set(formHeaders); + return; + } + Object.entries(formHeaders || {}).forEach(([key, val]) => { + if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) { + headers.set(key, val); + } + }); + } var kInternals = Symbol("internals"); var AxiosTransformStream = class extends stream.Transform { constructor(options) { @@ -55511,7 +55826,7 @@ var require_axios = __commonJS({ this.sessions = /* @__PURE__ */ Object.create(null); } getSession(authority, options) { - options = Object.assign({ + options = Object.assign(/* @__PURE__ */ Object.create(null), { sessionTimeout: 1e3 }, options); let authoritySessions = this.sessions[authority]; @@ -55576,6 +55891,7 @@ var require_axios = __commonJS({ }; } session.once("close", removeSession); + session.once("error", removeSession); let entry = [session, options]; authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry]; return session; @@ -55594,12 +55910,73 @@ var require_axios = __commonJS({ } : fn; }; var LOOPBACK_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "0.0.0.0"]); + var trimTrailingDots = (value) => { + let end = value.length; + while (end && value.charCodeAt(end - 1) === 46) { + end--; + } + return end === value.length ? value : value.slice(0, end); + }; var isIPv4Loopback = (host) => { const parts = host.split("."); if (parts.length !== 4) return false; if (parts[0] !== "127") return false; return parts.every((p) => /^\d+$/.test(p) && Number(p) >= 0 && Number(p) <= 255); }; + var parseIPv4Octet = (text) => { + if (/^0[xX][0-9a-fA-F]+$/.test(text)) { + const n = parseInt(text.slice(2), 16); + return Number.isFinite(n) ? n : null; + } + if (text.length > 1 && /^0[0-7]+$/.test(text)) { + const n = parseInt(text, 8); + return Number.isFinite(n) ? n : null; + } + if (text.length > 1 && /^0[0-9]+$/.test(text)) { + return null; + } + if (/^[0-9]+$/.test(text)) { + const n = parseInt(text, 10); + return Number.isFinite(n) ? n : null; + } + return null; + }; + var normalizeIPAddress = (host) => { + if (typeof host !== "string" || !host || host.indexOf(":") !== -1) { + return host; + } + let h = host; + if (h.charAt(0) === "[" && h.charAt(h.length - 1) === "]") { + h = h.slice(1, -1); + } + h = trimTrailingDots(h); + if (!/^[0-9.xXa-fA-F]+$/.test(h)) return host; + const parts = h.split("."); + if (parts.some((p) => p === "")) return host; + if (parts.length === 4) { + const octets = parts.map(parseIPv4Octet); + if (octets.some((n) => n === null || n < 0 || n > 255)) return host; + return octets.join("."); + } + if (parts.length > 4) { + return host; + } + if (parts.length === 1) return host; + const literalOctets = parts.slice(0, -1); + const tail = parts[parts.length - 1]; + const tailSlots = 4 - literalOctets.length; + const tailValue = parseIPv4Octet(tail); + if (tailValue === null) return host; + const maxTail = (1 << 8 * tailSlots) - 1; + if (tailValue < 0 || tailValue > maxTail) return host; + const tailOctets = new Array(tailSlots).fill(0); + for (let i = tailSlots - 1, v = tailValue; i >= 0; i--, v >>= 8) { + tailOctets[i] = v & 255; + } + const literal = literalOctets.map(parseIPv4Octet); + if (literal.some((n) => n === null || n < 0 || n > 255)) return host; + return [...literal, ...tailOctets].join("."); + }; var isIPv6ZeroGroup = (group) => /^0{1,4}$/.test(group); var isIPv6Unspecified = (host) => { if (host === "::") return true; @@ -55684,6 +56061,40 @@ var require_axios = __commonJS({ } return host; }; + var IPV4_OCTET_RE = /^(?:0|[1-9]\d{0,2})$/; + var ipv4ToBytes = (host) => { + const parts = host.split("."); + return parts.length === 4 && parts.every((part) => IPV4_OCTET_RE.test(part) && Number(part) <= 255) ? parts.map(Number) : null; + }; + var IPV6_GROUP_RE = /^[0-9a-f]{1,4}$/i; + var ipv6ToBytes = (host) => { + const halves = host.split("::"); + if (halves.length > 2) { + return null; + } + const groups = halves[0] ? halves[0].split(":") : []; + if (halves.length === 2) { + const rear = halves[1] ? halves[1].split(":") : []; + const missing = 8 - groups.length - rear.length; + if (missing < 1) { + return null; + } + groups.push(...new Array(missing).fill("0"), ...rear); + } + if (groups.length !== 8 || groups.some((group) => !IPV6_GROUP_RE.test(group))) { + return null; + } + return groups.flatMap((group) => { + const value = Number.parseInt(group, 16); + return [value >> 8 & 255, value & 255]; + }); + }; + var ipToBytes = (host) => { + if (typeof host !== "string" || !host) { + return null; + } + return host.indexOf(":") !== -1 ? ipv6ToBytes(host) : ipv4ToBytes(host); + }; var normalizeNoProxyHost = (hostname) => { if (!hostname) { return hostname; @@ -55691,7 +56102,98 @@ var require_axios = __commonJS({ if (hostname.charAt(0) === "[" && hostname.charAt(hostname.length - 1) === "]") { hostname = hostname.slice(1, -1); } - return unmapIPv4MappedIPv6(hostname.replace(/\.+$/, "")); + const trimmed = trimTrailingDots(hostname); + const ipv4 = normalizeIPAddress(trimmed); + if (ipv4 !== trimmed) { + return ipv4; + } + return unmapIPv4MappedIPv6(trimmed); + }; + var normalizeCidrBase = (input) => { + let base = input; + const startsBracket = base.charAt(0) === "["; + const endsBracket = base.charAt(base.length - 1) === "]"; + const hasBracket = base.includes("[") || base.includes("]"); + if (startsBracket || endsBracket) { + if (!startsBracket || !endsBracket) { + return null; + } + base = base.slice(1, -1); + if (base.indexOf(":") === -1 || base.includes("[") || base.includes("]")) { + return null; + } + } else if (hasBracket) { + return null; + } + if (!base || base.charAt(base.length - 1) === ".") { + return null; + } + const wasIPv6 = base.indexOf(":") !== -1; + if (wasIPv6) { + try { + base = new URL(`http://[${base}]/`).hostname.slice(1, -1); + } catch (_err) { + return null; + } + } else { + base = normalizeIPAddress(base); + if (!ipv4ToBytes(base)) { + return null; + } + } + return { + normalized: unmapIPv4MappedIPv6(base), + wasIPv6 + }; + }; + var CIDR_ENTRY_RE = /^(.+)\/(0|[1-9]\d{0,2})$/; + var parseCidrEntry = (entry) => { + if (entry.indexOf("/") === -1) { + return void 0; + } + const match = CIDR_ENTRY_RE.exec(entry); + if (!match) { + return null; + } + let prefix = Number(match[2]); + const parsedBase = normalizeCidrBase(match[1]); + if (!parsedBase) { + return null; + } + const { + normalized, + wasIPv6 + } = parsedBase; + if (wasIPv6 && normalized.indexOf(":") === -1) { + if (prefix < 96) { + return null; + } + prefix -= 96; + } + const bytes = ipToBytes(normalized); + if (!bytes || prefix > bytes.length * 8) { + return null; + } + return { + bytes, + prefix + }; + }; + var isInSubnet = (addressBytes, networkBytes, prefix) => { + const fullBytes = prefix >> 3; + for (let i = 0; i < fullBytes; i++) { + if (addressBytes[i] !== networkBytes[i]) { + return false; + } + } + const remainingBits = prefix & 7; + if (remainingBits) { + const mask = 255 << 8 - remainingBits & 255; + if ((addressBytes[fullBytes] & mask) !== (networkBytes[fullBytes] & mask)) { + return false; + } + } + return true; }; function shouldBypassProxy(location2) { let parsed; @@ -55709,10 +56211,18 @@ var require_axios = __commonJS({ } const port = Number.parseInt(parsed.port, 10) || DEFAULT_PORTS[parsed.protocol.split(":", 1)[0]] || 0; const hostname = normalizeNoProxyHost(parsed.hostname.toLowerCase()); + const hostnameBytes = ipToBytes(hostname); return noProxy.split(/[\s,]+/).some((entry) => { if (!entry) { return false; } + if (entry === "*") { + return true; + } + const cidr = parseCidrEntry(entry); + if (cidr !== void 0) { + return cidr !== null && !!hostnameBytes && hostnameBytes.length === cidr.bytes.length && isInSubnet(hostnameBytes, cidr.bytes, cidr.prefix); + } let [entryHost, entryPort] = parseNoProxyEntry(entry); entryHost = normalizeNoProxyHost(entryHost); if (!entryHost) { @@ -55793,18 +56303,19 @@ var require_axios = __commonJS({ } }; const flush = () => lastArgs && invoke(lastArgs); - return [throttled, flush]; + const flushWith = (...args) => invoke(args); + return [throttled, flush, flushWith]; } var progressEventReducer = (listener, isDownloadStream, freq = 3) => { let bytesNotified = 0; const _speedometer = speedometer(50, 250); return throttle((e) => { - if (!e || typeof e.loaded !== "number") { + if (!e || !utils$1.isNumber(e.loaded)) { return; } const rawLoaded = e.loaded; const total = e.lengthComputable ? e.total : void 0; - const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded; + const loaded = Math.max(0, total != null ? Math.min(rawLoaded, total) : rawLoaded); const progressBytes = Math.max(0, loaded - bytesNotified); const rate = _speedometer(progressBytes); bytesNotified = Math.max(bytesNotified, loaded); @@ -55830,10 +56341,64 @@ var require_axios = __commonJS({ loaded }), throttled[1]]; }; - var asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args)); + var asyncDecorator = (fn, scheduler = utils$1.asap) => (...args) => scheduler(() => fn(...args)); var isHexDigit = (charCode) => charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102; var isPercentEncodedByte = (str, i, len) => i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2)); - function estimateDataURLDecodedBytes(url2) { + var hexValue = (charCode) => charCode <= 57 ? charCode - 48 : (charCode & 223) - 55; + var isBase64Char = (charCode) => charCode >= 65 && charCode <= 90 || // A-Z + charCode >= 97 && charCode <= 122 || // a-z + charCode >= 48 && charCode <= 57 || // 0-9 + charCode === 43 || // + + charCode === 47 || // / + charCode === 45 || // - (base64url) + charCode === 95; + var isBase64Whitespace = (charCode) => charCode === 9 || charCode === 10 || charCode === 12 || charCode === 13 || charCode === 32; + var base64Bytes = (significant) => { + const groups = Math.floor(significant / 4); + const remainder = significant % 4; + return groups * 3 + (remainder === 2 ? 1 : remainder === 3 ? 2 : 0); + }; + var estimateBase64BufferAllocation = (body) => { + const len = body.length; + let padding = 0; + if (len > 0 && body.charCodeAt(len - 1) === 61) { + padding++; + if (len > 1 && body.charCodeAt(len - 2) === 61) { + padding++; + } + } + return Math.floor((len - padding) * 3 / 4); + }; + var estimatePercentDecodedBase64Bytes = (body) => { + const len = body.length; + let significant = 0; + let padding = 0; + let invalid = false; + for (let i = 0; i < len; i++) { + let code = body.charCodeAt(i); + if (code === 37 && isPercentEncodedByte(body, i, len)) { + code = hexValue(body.charCodeAt(i + 1)) * 16 + hexValue(body.charCodeAt(i + 2)); + i += 2; + } + if (isBase64Whitespace(code)) { + continue; + } + if (code === 61) { + padding++; + continue; + } + if (!isBase64Char(code) || padding > 0) { + invalid = true; + continue; + } + significant++; + } + if (invalid || padding > 2 || padding > 0 && (significant + padding) % 4 !== 0 || significant % 4 === 1) { + return estimateBase64BufferAllocation(body); + } + return base64Bytes(significant); + }; + var estimateDataURLBytes = (url2, estimateBase64) => { if (!url2 || typeof url2 !== "string") return 0; if (!url2.startsWith("data:")) return 0; const comma = url2.indexOf(","); @@ -55842,43 +56407,7 @@ var require_axios = __commonJS({ const body = url2.slice(comma + 1); const isBase64 = /;base64/i.test(meta); if (isBase64) { - let effectiveLen = body.length; - const len = body.length; - for (let i = 0; i < len; i++) { - if (body.charCodeAt(i) === 37 && i + 2 < len) { - const a = body.charCodeAt(i + 1); - const b = body.charCodeAt(i + 2); - const isHex = isHexDigit(a) && isHexDigit(b); - if (isHex) { - effectiveLen -= 2; - i += 2; - } - } - } - let pad = 0; - let idx = len - 1; - const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && // '%' - body.charCodeAt(j - 1) === 51 && // '3' - (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); - if (idx >= 0) { - if (body.charCodeAt(idx) === 61) { - pad++; - idx--; - } else if (tailIsPct3D(idx)) { - pad++; - idx -= 3; - } - } - if (pad === 1 && idx >= 0) { - if (body.charCodeAt(idx) === 61) { - pad++; - } else if (tailIsPct3D(idx)) { - pad++; - } - } - const groups = Math.floor(effectiveLen / 4); - const bytes2 = groups * 3 - (pad || 0); - return bytes2 > 0 ? bytes2 : 0; + return estimateBase64(body); } let bytes = 0; for (let i = 0, len = body.length; i < len; i++) { @@ -55903,6 +56432,13 @@ var require_axios = __commonJS({ } } return bytes; + }; + function estimateDataURLDecodedBytes(url2) { + const fragmentIndex = typeof url2 === "string" ? url2.indexOf("#") : -1; + return estimateDataURLBytes(fragmentIndex === -1 ? url2 : url2.slice(0, fragmentIndex), estimatePercentDecodedBase64Bytes); + } + function estimateDataURLBufferAllocation(url2) { + return estimateDataURLBytes(url2, estimateBase64BufferAllocation); } var zlibOptions = { flush: zlib.constants.Z_SYNC_FLUSH, @@ -55920,25 +56456,20 @@ var require_axios = __commonJS({ var isZstdSupported = utils$1.isFunction(zlib.createZstdDecompress); var ACCEPT_ENCODING = "gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""); var ACCEPT_ENCODING_WITH_ZSTD = ACCEPT_ENCODING + (isZstdSupported ? ", zstd" : ""); + var scheduleProgress = typeof process !== "undefined" && process.nextTick ? process.nextTick.bind(process) : utils$1.asap; var { http: httpFollow, https: httpsFollow } = followRedirects; var isHttps = /https:?/; - var FORM_DATA_CONTENT_HEADERS$1 = ["content-type", "content-length"]; - function setFormDataHeaders$1(headers, formHeaders, policy) { - if (policy !== "content-only") { - headers.set(formHeaders); - return; - } - Object.entries(formHeaders).forEach(([key, val]) => { - if (FORM_DATA_CONTENT_HEADERS$1.includes(key.toLowerCase())) { - headers.set(key, val); - } - }); - } var kAxiosSocketListener = Symbol("axios.http.socketListener"); var kAxiosCurrentReq = Symbol("axios.http.currentReq"); + function handleSocketError(err) { + const current = this[kAxiosCurrentReq]; + if (current && !current.destroyed) { + current.destroy(err); + } + } var kAxiosInstalledTunnel = Symbol("axios.http.installedTunnel"); var tunnelingAgentCache = /* @__PURE__ */ new Map(); var tunnelingAgentCacheUser = /* @__PURE__ */ new WeakMap(); @@ -56047,10 +56578,10 @@ var require_axios = __commonJS({ return false; } } - function setProxy(options, configProxy, location2, isRedirect, configHttpsAgent, configHttpAgent) { + function setProxy(options, configProxy, location2, isRedirect, configHttpsAgent, configHttpAgent, allowEnvProxy = true) { let proxy = configProxy; const proxyEnvAgent = getProxyEnvAgent(options, configHttpAgent, configHttpsAgent); - if (!proxy && proxy !== false && !isNodeEnvProxyEnabled(proxyEnvAgent)) { + if (!proxy && proxy !== false && allowEnvProxy && !isNodeEnvProxyEnabled(proxyEnvAgent)) { const proxyUrl = getProxyForUrl(location2); if (proxyUrl) { if (!shouldBypassProxy(location2)) { @@ -56141,8 +56672,9 @@ var require_axios = __commonJS({ } } options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) { - setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent, configHttpAgent); + setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent, configHttpAgent, allowEnvProxy); }; + return Boolean(proxy || configProxy !== false && allowEnvProxy && isNodeEnvProxyEnabled(proxyEnvAgent)); } var isHttpAdapterSupported = typeof process !== "undefined" && utils$1.kindOf(process) === "process"; var wrapAsync = (asyncExecutor) => { @@ -56170,7 +56702,7 @@ var require_axios = __commonJS({ family }) => { if (!utils$1.isString(address)) { - throw TypeError("address must be a string"); + throw new AxiosError("address must be a string", AxiosError.ERR_BAD_OPTION_VALUE); } return { address, @@ -56181,6 +56713,30 @@ var require_axios = __commonJS({ address, family }); + var normalizedLookupCache = /* @__PURE__ */ new WeakMap(); + var normalizeLookup = (lookup) => { + let normalized = normalizedLookupCache.get(lookup); + if (normalized) { + return normalized; + } + const callbackLookup = callbackify(lookup, (value) => utils$1.isArray(value) ? value : [value]); + normalized = (hostname, opt, cb) => { + callbackLookup(hostname, opt, (err, arg0, arg1) => { + if (err) { + return cb(err); + } + let addresses; + try { + addresses = utils$1.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)]; + } catch (error2) { + return cb(error2); + } + opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family); + }); + }; + normalizedLookupCache.set(lookup, normalized); + return normalized; + }; var http2Transport = { request(options, cb) { const authority = options.protocol + "//" + options.hostname + ":" + (options.port || (options.protocol === "https:" ? 443 : 80)); @@ -56225,6 +56781,7 @@ var require_axios = __commonJS({ let family = own2("family"); let httpVersion = own2("httpVersion"); if (httpVersion === void 0) httpVersion = 1; + const rawHttpVersion = httpVersion; let http2Options = own2("http2Options"); const httpAgent = own2("httpAgent"); const httpsAgent = own2("httpsAgent"); @@ -56241,25 +56798,20 @@ var require_axios = __commonJS({ let rejected = false; let req; let connectPhaseTimer; - httpVersion = +httpVersion; + try { + httpVersion = +httpVersion; + } catch (err) { + throw new AxiosError("Invalid protocol version: value is not a number", AxiosError.ERR_BAD_OPTION_VALUE, config); + } if (Number.isNaN(httpVersion)) { - throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`); + throw new AxiosError(`Invalid protocol version: '${rawHttpVersion}' is not a number`, AxiosError.ERR_BAD_OPTION_VALUE, config); } if (httpVersion !== 1 && httpVersion !== 2) { - throw TypeError(`Unsupported protocol version '${httpVersion}'`); + throw new AxiosError(`Unsupported protocol version '${httpVersion}'`, AxiosError.ERR_BAD_OPTION_VALUE, config); } const isHttp2 = httpVersion === 2; if (lookup) { - const _lookup = callbackify(lookup, (value) => utils$1.isArray(value) ? value : [value]); - lookup = (hostname, opt, cb) => { - _lookup(hostname, opt, (err, arg0, arg1) => { - if (err) { - return cb(err); - } - const addresses = utils$1.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)]; - opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family); - }); - }; + lookup = normalizeLookup(lookup); } const abortEmitter = new events.EventEmitter(); function abort(reason) { @@ -56327,7 +56879,7 @@ var require_axios = __commonJS({ if (protocol === "data:") { if (maxContentLength > -1) { const dataUrl = String(own2("url") || fullPath || ""); - const estimated = estimateDataURLDecodedBytes(dataUrl); + const estimated = estimateDataURLBufferAllocation(dataUrl); if (estimated > maxContentLength) { return reject(new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config)); } @@ -56385,7 +56937,7 @@ var require_axios = __commonJS({ boundary: userBoundary && userBoundary[1] || void 0 }); } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders) && data.getHeaders !== Object.prototype.getHeaders) { - setFormDataHeaders$1(headers, data.getHeaders(), own2("formDataHeaderPolicy")); + setFormDataHeaders(headers, data.getHeaders(), own2("formDataHeaderPolicy")); if (!headers.hasContentLength()) { try { const knownLength = await util.promisify(data.getLength).call(data); @@ -56427,7 +56979,7 @@ var require_axios = __commonJS({ data = stream.pipeline([data, new AxiosTransformStream({ maxRate: utils$1.toFiniteNumber(maxUploadRate) })], utils$1.noop); - onUploadProgress && data.on("progress", flushOnFinish(data, progressEventDecorator(contentLength, progressEventReducer(asyncDecorator(onUploadProgress), false, 3)))); + onUploadProgress && data.on("progress", flushOnFinish(data, progressEventDecorator(contentLength, progressEventReducer(asyncDecorator(onUploadProgress, scheduleProgress), false, 3)))); } let auth = void 0; const configAuth = own2("auth"); @@ -56452,6 +57004,11 @@ var require_axios = __commonJS({ })); } headers.set("Accept-Encoding", utils$1.hasOwnProp(transitional, "advertiseZstdAcceptEncoding") && transitional.advertiseZstdAcceptEncoding === true ? ACCEPT_ENCODING_WITH_ZSTD : ACCEPT_ENCODING, false); + if (isHttp2 && lookup) { + http2Options = Object.assign(/* @__PURE__ */ Object.create(null), http2Options, { + lookup + }); + } const options = Object.assign(/* @__PURE__ */ Object.create(null), { path: path$1, method, @@ -56465,9 +57022,11 @@ var require_axios = __commonJS({ family, beforeRedirect: dispatchBeforeRedirect, beforeRedirects: /* @__PURE__ */ Object.create(null), - http2Options + http2Options, + createConnection: void 0 }); !utils$1.isUndefined(lookup) && (options.lookup = lookup); + let proxyApplied = false; if (socketPath) { if (typeof socketPath !== "string") { return reject(new AxiosError("socketPath must be a string", AxiosError.ERR_BAD_OPTION_VALUE, config)); @@ -56485,7 +57044,18 @@ var require_axios = __commonJS({ } else { options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname; options.port = parsed.port; - setProxy(options, configProxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path, false, httpsAgent, httpAgent); + proxyApplied = setProxy( + options, + configProxy, + protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path, + false, + httpsAgent, + httpAgent, + // The HTTP/2 transport connects independently of HTTP/1 agents, so it + // cannot apply either axios-resolved or agent-local environment proxies. + // Explicit proxy config is still processed and rejected below. + !isHttp2 + ); } let transport; let isNativeTransport = false; @@ -56495,6 +57065,9 @@ var require_axios = __commonJS({ options.agent = isHttpsRequest ? httpsAgent : httpAgent; } if (isHttp2) { + if (proxyApplied) { + return reject(new AxiosError("HTTP/2 requests with a proxy are not supported", AxiosError.ERR_NOT_SUPPORT, config)); + } transport = http2Transport; } else { const configTransport = own2("transport"); @@ -56564,7 +57137,7 @@ var require_axios = __commonJS({ const transformStream = new AxiosTransformStream({ maxRate: utils$1.toFiniteNumber(maxDownloadRate) }); - onDownloadProgress && transformStream.on("progress", flushOnFinish(transformStream, progressEventDecorator(responseLength, progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)))); + onDownloadProgress && transformStream.on("progress", flushOnFinish(transformStream, progressEventDecorator(responseLength, progressEventReducer(asyncDecorator(onDownloadProgress, scheduleProgress), true, 3)))); streams.push(transformStream); } let responseStream = res; @@ -56692,12 +57265,7 @@ var require_axios = __commonJS({ socket.setKeepAlive(true, 1e3 * 60); } if (!socket[kAxiosSocketListener]) { - socket.on("error", function handleSocketError(err) { - const current = socket[kAxiosCurrentReq]; - if (current && !current.destroyed) { - current.destroy(err); - } - }); + socket.on("error", handleSocketError); socket[kAxiosSocketListener] = true; } socket[kAxiosCurrentReq] = req; @@ -56830,6 +57398,12 @@ var require_axios = __commonJS({ var headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing; + var ownEnumerableKeys = (thing) => { + if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) { + return Object.keys(thing).concat(Object.getOwnPropertySymbols(thing).filter((symbol) => Object.getOwnPropertyDescriptor(thing, symbol).enumerable)); + } + return Object.keys(thing); + }; function mergeConfig(config1, config2) { config1 = config1 || {}; config2 = config2 || {}; @@ -56907,7 +57481,7 @@ var require_axios = __commonJS({ transformResponse: defaultToConfig2, paramsSerializer: defaultToConfig2, timeout: defaultToConfig2, - timeoutMessage: defaultToConfig2, + timeoutErrorMessage: defaultToConfig2, withCredentials: defaultToConfig2, withXSRFToken: defaultToConfig2, adapter: defaultToConfig2, @@ -56930,7 +57504,7 @@ var require_axios = __commonJS({ validateStatus: mergeDirectKeys, headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) }; - utils$1.forEach(Object.keys({ + utils$1.forEach(ownEnumerableKeys({ ...config1, ...config2 }), function computeConfigValue(prop) { @@ -56950,18 +57524,6 @@ var require_axios = __commonJS({ } return config; } - var FORM_DATA_CONTENT_HEADERS = ["content-type", "content-length"]; - function setFormDataHeaders(headers, formHeaders, policy) { - if (policy !== "content-only") { - headers.set(formHeaders); - return; - } - Object.entries(formHeaders || {}).forEach(([key, val]) => { - if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) { - headers.set(key, val); - } - }); - } var encodeUTF8$1 = (str) => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16))); function resolveConfig(config) { const newConfig = mergeConfig({}, config); @@ -56987,10 +57549,11 @@ var require_axios = __commonJS({ } } if (utils$1.isFormData(data)) { + const getHeaders = utils$1.getSafeProp(data, "getHeaders"); if (platform2.hasStandardBrowserEnv || platform2.hasStandardBrowserWebWorkerEnv || utils$1.isReactNative(data)) { headers.setContentType(void 0); - } else if (utils$1.isFunction(data.getHeaders)) { - setFormDataHeaders(headers, data.getHeaders(), own2("formDataHeaderPolicy")); + } else if (utils$1.isFunction(getHeaders)) { + setFormDataHeaders(headers, getHeaders.call(data), own2("formDataHeaderPolicy")); } } if (platform2.hasStandardBrowserEnv) { @@ -57020,7 +57583,7 @@ var require_axios = __commonJS({ } = _config; let onCanceled; let uploadThrottled, downloadThrottled; - let flushUpload, flushDownload; + let flushUpload, flushDownload, flushDownloadWithEvent; function done() { flushUpload && flushUpload(); flushDownload && flushDownload(); @@ -57030,7 +57593,27 @@ var require_axios = __commonJS({ let request = new XMLHttpRequest(); request.open(_config.method.toUpperCase(), _config.url, true); request.timeout = _config.timeout; - function onloadend() { + function onloadend(event) { + if (!request) { + return; + } + if (request.status === 0 && (parseProtocol(normalizeURLForProtocolCheck(_config.url)) || parseProtocol(platform2.origin)) !== "file" && !(request.responseURL && request.responseURL.startsWith("file:"))) { + reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config, request)); + done(); + request = null; + return; + } + try { + if (event) { + flushDownloadWithEvent && flushDownloadWithEvent(event); + } else { + flushDownload && flushDownload(); + } + } catch (err) { + setTimeout(() => { + throw err; + }); + } if (!request) { return; } @@ -57105,7 +57688,7 @@ var require_axios = __commonJS({ request.responseType = _config.responseType; } if (onDownloadProgress) { - [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); + [downloadThrottled, flushDownload, flushDownloadWithEvent] = progressEventReducer(onDownloadProgress, true); request.addEventListener("progress", downloadThrottled); } if (onUploadProgress && request.upload) { @@ -57167,9 +57750,18 @@ var require_axios = __commonJS({ }); signals = null; }; - signals.forEach((signal2) => signal2.addEventListener("abort", onabort, { - once: true - })); + signals.forEach((signal2) => { + if (aborted) { + return; + } + if (signal2.aborted) { + onabort.call(signal2); + return; + } + signal2.addEventListener("abort", onabort, { + once: true + }); + }); const { signal } = controller; @@ -57258,6 +57850,17 @@ var require_axios = __commonJS({ }); }; var DEFAULT_CHUNK_SIZE = 64 * 1024; + var DEFAULT_REQUEST_OPTIONS = { + cache: "default", + redirect: "follow", + referrer: "about:client", + referrerPolicy: "", + mode: "cors", + integrity: "", + keepalive: false, + priority: "auto", + window: null + }; var { isFunction } = utils$1; @@ -57386,7 +57989,8 @@ var require_axios = __commonJS({ withCredentials = "same-origin", fetchOptions, maxContentLength, - maxBodyLength + maxBodyLength, + maxRedirects } = resolveConfig(config); const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1; const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1; @@ -57487,17 +58091,44 @@ var require_axios = __commonJS({ } } headers.set("User-Agent", "axios/" + VERSION, false); - const resolvedOptions = { - ...fetchOptions, + const safeFetchOptions = fetchOptions == null ? fetchOptions : Object.assign(/* @__PURE__ */ Object.create(null), fetchOptions); + if (safeFetchOptions) { + delete safeFetchOptions.body; + delete safeFetchOptions.headers; + delete safeFetchOptions.method; + delete safeFetchOptions.signal; + delete safeFetchOptions.duplex; + delete safeFetchOptions.credentials; + } + const resolvedOptions = Object.assign(/* @__PURE__ */ Object.create(null), safeFetchOptions, { signal: composedSignal, method: method.toUpperCase(), headers: toByteStringHeaderObject(headers.normalize()), body: data, duplex: "half", credentials: isCredentialsSupported ? withCredentials : void 0 - }; + }); + if (isRequestSupported) { + utils$1.forEach(DEFAULT_REQUEST_OPTIONS, (value, key) => { + if (resolvedOptions[key] === void 0) { + resolvedOptions[key] = value; + } + }); + if (resolvedOptions.signal === void 0) { + resolvedOptions.signal = null; + } + if (resolvedOptions.body === void 0) { + resolvedOptions.body = null; + } + } + if (maxRedirects === 0) { + resolvedOptions.redirect = "manual"; + if (safeFetchOptions) { + safeFetchOptions.redirect = "manual"; + } + } request = isRequestSupported && new Request(url2, resolvedOptions); - let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url2, resolvedOptions)); + let response = await (isRequestSupported ? _fetch(request, safeFetchOptions) : _fetch(url2, resolvedOptions)); const responseHeaders = AxiosHeaders.from(response.headers); if (hasMaxContentLength) { const declaredLength = utils$1.toFiniteNumber(responseHeaders.getContentLength()); @@ -57689,9 +58320,10 @@ var require_axios = __commonJS({ throw new CanceledError(null, config); } } - function dispatchRequest(config) { + function dispatchRequest(_config) { + const config = utils$1.toSafeFlatObject(_config); throwIfCancellationRequested(config); - config.headers = AxiosHeaders.from(config.headers); + config.headers = AxiosHeaders.from(utils$1.getSafeProp(config, "headers")); config.data = transformData.call(config, config.transformRequest); if (["post", "put", "patch"].indexOf(config.method) !== -1) { config.headers.setContentType("application/x-www-form-urlencoded", false); @@ -57799,16 +58431,15 @@ var require_axios = __commonJS({ return await this._request(configOrUrl, config); } catch (err) { if (err instanceof Error) { - let dummy = {}; - Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error(); - const stack = (() => { - if (!dummy.stack) { - return ""; - } - const firstNewlineIndex = dummy.stack.indexOf("\n"); - return firstNewlineIndex === -1 ? "" : dummy.stack.slice(firstNewlineIndex + 1); - })(); try { + let dummy = {}; + Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error(); + const dummyStack = dummy.stack; + let stack = ""; + if (typeof dummyStack === "string") { + const firstNewlineIndex = dummyStack.indexOf("\n"); + stack = firstNewlineIndex === -1 ? "" : dummyStack.slice(firstNewlineIndex + 1); + } if (!err.stack) { err.stack = stack; } else if (stack) { @@ -57870,9 +58501,9 @@ var require_axios = __commonJS({ baseUrl: validators.spelling("baseURL"), withXsrfToken: validators.spelling("withXSRFToken") }, true); - config.method = (config.method || this.defaults.method || "get").toLowerCase(); + config.method = (utils$1.getSafeProp(config, "method") || utils$1.getSafeProp(this.defaults, "method") || "get").toLowerCase(); let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]); - headers && utils$1.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], (method) => { + headers && utils$1.forEach(methodList.concat("common"), (method) => { delete headers[method]; }); config.headers = AxiosHeaders.concat(contextHeaders, headers); @@ -57915,16 +58546,29 @@ var require_axios = __commonJS({ const onFulfilled = requestInterceptorChain[i++]; const onRejected = requestInterceptorChain[i++]; try { - newConfig = onFulfilled(newConfig); + newConfig = onFulfilled ? onFulfilled(newConfig) : newConfig; } catch (error2) { - onRejected.call(this, error2); + if (!onRejected) { + promise = Promise.reject(error2); + break; + } + try { + const rejectedResult = onRejected.call(this, error2); + if (utils$1.isThenable(rejectedResult)) { + promise = Promise.resolve(rejectedResult).then(() => dispatchRequest.call(this, newConfig)); + } + } catch (rejectedError) { + promise = Promise.reject(rejectedError); + } break; } } - try { - promise = dispatchRequest.call(this, newConfig); - } catch (error2) { - return Promise.reject(error2); + if (!promise) { + try { + promise = dispatchRequest.call(this, newConfig); + } catch (error2) { + promise = Promise.reject(error2); + } } i = 0; len = responseInterceptorChain.length; @@ -58106,14 +58750,22 @@ var require_axios = __commonJS({ Gone: 410, LengthRequired: 411, PreconditionFailed: 412, + /** + * @deprecated Use `ContentTooLarge` instead. + */ PayloadTooLarge: 413, + ContentTooLarge: 413, UriTooLong: 414, UnsupportedMediaType: 415, RangeNotSatisfiable: 416, ExpectationFailed: 417, ImATeapot: 418, MisdirectedRequest: 421, + /** + * @deprecated Use `UnprocessableContent` instead. + */ UnprocessableEntity: 422, + UnprocessableContent: 422, Locked: 423, FailedDependency: 424, TooEarly: 425, @@ -58133,6 +58785,7 @@ var require_axios = __commonJS({ LoopDetected: 508, NotExtended: 510, NetworkAuthenticationRequired: 511, + WebServerReturnsAnUnknownError: 520, WebServerIsDown: 521, ConnectionTimedOut: 522, OriginIsUnreachable: 523, @@ -58141,7 +58794,9 @@ var require_axios = __commonJS({ InvalidSslCertificate: 526 }; Object.entries(HttpStatusCode).forEach(([key, value]) => { - HttpStatusCode[value] = key; + if (HttpStatusCode[value] === void 0) { + HttpStatusCode[value] = key; + } }); function createInstance(defaultConfig) { const context = new Axios(defaultConfig); @@ -60159,5 +60814,5 @@ urijs/src/URITemplate.js: *) axios/dist/node/axios.cjs: - (*! Axios v1.18.1 Copyright (c) 2026 Matt Zabriskie and contributors *) + (*! Axios v1.20.0 Copyright (c) 2026 Matt Zabriskie and contributors *) */ diff --git a/package.json b/package.json index 93ae76b8..ac8fda1e 100644 --- a/package.json +++ b/package.json @@ -100,6 +100,6 @@ }, "version": "4.2.3", "overrides": { - "brace-expansion": "^5.0.12" + "brace-expansion": "5.0.12" } }