diff --git a/README.md b/README.md index 17f1a74..c5920ea 100644 --- a/README.md +++ b/README.md @@ -92,8 +92,8 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed # Whether to restore the cache if found restore-cache: "true" - # Whether to save the cache after the run - save-cache: "true" + # Whether to save the cache after the run: true, false, or auto (disabled for merge_group events) + save-cache: "auto" # Suffix for the cache key cache-suffix: "" @@ -159,7 +159,7 @@ python 3.13 ``` ```yaml -- uses: step-security/setup-uv@v9 +- uses: step-security/setup-uv@v10 with: version-file: ".tool-versions" ``` diff --git a/__tests__/utils/inputs.test.ts b/__tests__/utils/inputs.test.ts index aad3495..f93a41b 100644 --- a/__tests__/utils/inputs.test.ts +++ b/__tests__/utils/inputs.test.ts @@ -206,6 +206,51 @@ describe("loadInputs", () => { expect(inputs.enableCache).toBe(true); }); + it("restores but does not save cache automatically for merge groups", () => { + mockInputs["working-directory"] = "/workspace"; + mockInputs["enable-cache"] = "auto"; + mockInputs["restore-cache"] = "true"; + mockInputs["save-cache"] = "auto"; + process.env.RUNNER_ENVIRONMENT = "github-hosted"; + process.env.RUNNER_TEMP = "/runner-temp"; + process.env.GITHUB_EVENT_NAME = "merge_group"; + + const inputs = loadInputs(); + + expect(inputs.enableCache).toBe(true); + expect(inputs.restoreCache).toBe(true); + expect(inputs.saveCache).toBe(false); + expect(mockInfo).toHaveBeenCalledWith( + "Cache saving is disabled for the merge_group event", + ); + }); + + it.each([ + ["true", true], + ["false", false], + ])("honors save-cache %s for merge groups", (saveCacheInput, expected) => { + mockInputs["working-directory"] = "/workspace"; + mockInputs["save-cache"] = saveCacheInput; + process.env.GITHUB_EVENT_NAME = "merge_group"; + + const inputs = loadInputs(); + + expect(inputs.saveCache).toBe(expected); + expect(mockInfo).not.toHaveBeenCalledWith( + "Cache saving is disabled for the merge_group event", + ); + }); + + it("automatically saves cache for other events", () => { + mockInputs["working-directory"] = "/workspace"; + mockInputs["save-cache"] = "auto"; + process.env.GITHUB_EVENT_NAME = "push"; + + const inputs = loadInputs(); + + expect(inputs.saveCache).toBe(true); + }); + it("uses cache-dir from pyproject.toml when present", () => { mockInputs["working-directory"] = createTempProject({ "pyproject.toml": `[project] diff --git a/action-types.yml b/action-types.yml index 0be5368..a2b4ac3 100644 --- a/action-types.yml +++ b/action-types.yml @@ -33,7 +33,11 @@ inputs: restore-cache: type: boolean save-cache: - type: boolean + type: enum + allowed-values: + - "true" + - "false" + - auto cache-suffix: type: string cache-local-path: diff --git a/action.yml b/action.yml index 2619fae..e00ee60 100644 --- a/action.yml +++ b/action.yml @@ -51,8 +51,8 @@ inputs: description: "Whether to restore the cache if found." default: "true" save-cache: - description: "Whether to save the cache after the run." - default: "true" + description: "Whether to save the cache after the run. 'auto' disables saving for merge_group events." + default: "auto" cache-suffix: description: "Suffix for the cache key" required: false diff --git a/biome.json b/biome.json index 6f3e42a..bc935fc 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.5.8/schema.json", + "$schema": "https://biomejs.dev/schemas/2.5.9/schema.json", "assist": { "actions": { "source": { diff --git a/dist/save-cache/index.cjs b/dist/save-cache/index.cjs index f1b1e57..4126e4d 100644 --- a/dist/save-cache/index.cjs +++ b/dist/save-cache/index.cjs @@ -77390,105 +77390,13 @@ function isPath(version3) { // src/utils/config-file.ts var import_node_fs3 = __toESM(require("node:fs"), 1); -// node_modules/smol-toml/dist/date.js -var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i; -var TomlDate = class _TomlDate extends Date { - #hasDate = false; - #hasTime = false; - #offset = null; - constructor(date) { - let hasDate = true; - let hasTime = true; - let offset = "Z"; - if (typeof date === "string") { - let match4 = date.match(DATE_TIME_RE); - if (match4) { - if (!match4[1]) { - hasDate = false; - date = `0000-01-01T${date}`; - } - hasTime = !!match4[2]; - hasTime && date[10] === " " && (date = date.replace(" ", "T")); - if (match4[2] && +match4[2] > 23) { - date = ""; - } else { - offset = match4[3] || null; - date = date.toUpperCase(); - if (!offset && hasTime) - date += "Z"; - } - } else { - date = ""; - } - } - super(date); - if (!isNaN(this.getTime())) { - this.#hasDate = hasDate; - this.#hasTime = hasTime; - this.#offset = offset; - } - } - isDateTime() { - return this.#hasDate && this.#hasTime; - } - isLocal() { - return !this.#hasDate || !this.#hasTime || !this.#offset; - } - isDate() { - return this.#hasDate && !this.#hasTime; - } - isTime() { - return this.#hasTime && !this.#hasDate; - } - isValid() { - return this.#hasDate || this.#hasTime; - } - toISOString() { - let iso = super.toISOString(); - if (this.isDate()) - return iso.slice(0, 10); - if (this.isTime()) - return iso.slice(11, 23); - if (this.#offset === null) - return iso.slice(0, -1); - if (this.#offset === "Z") - return iso; - let offset = +this.#offset.slice(1, 3) * 60 + +this.#offset.slice(4, 6); - offset = this.#offset[0] === "-" ? offset : -offset; - let offsetDate = new Date(this.getTime() - offset * 6e4); - return offsetDate.toISOString().slice(0, -1) + this.#offset; - } - static wrapAsOffsetDateTime(jsDate, offset = "Z") { - let date = new _TomlDate(jsDate); - date.#offset = offset; - return date; - } - static wrapAsLocalDateTime(jsDate) { - let date = new _TomlDate(jsDate); - date.#offset = null; - return date; - } - static wrapAsLocalDate(jsDate) { - let date = new _TomlDate(jsDate); - date.#hasTime = false; - date.#offset = null; - return date; - } - static wrapAsLocalTime(jsDate) { - let date = new _TomlDate(jsDate); - date.#hasDate = false; - date.#offset = null; - return date; - } -}; - // node_modules/smol-toml/dist/error.js function getLineColFromPtr(string, ptr) { - let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g); + let lines = string.slice(0, ptr).split(/\r?\n/); return [lines.length, lines.pop().length + 1]; } function makeCodeBlock(string, line, column) { - let lines = string.split(/\r\n|\n|\r/g); + let lines = string.split(/\r?\n/); let codeblock = ""; let numberLen = (Math.log10(line + 1) | 0) + 1; for (let i = line - 1; i <= line + 1; i++) { @@ -77506,7 +77414,7 @@ function makeCodeBlock(string, line, column) { } return codeblock; } -var TomlError = class extends Error { +var TomlError = class _TomlError extends Error { line; column; codeblock; @@ -77520,59 +77428,59 @@ ${codeblock}`, options); this.column = column; this.codeblock = codeblock; } + /** @internal */ + static x(message, ctx, ptr) { + throw new _TomlError(message, { toml: ctx.s, ptr: ptr ?? ctx.p }); + } }; // node_modules/smol-toml/dist/primitive.js -var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/; -var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/; -var LEADING_ZERO = /^[+-]?0[0-9_]/; -function parseString(str, ptr) { - let c = str[ptr++]; +function parseString(ctx) { + let startPtr = ctx.p; + let c = ctx.s.charCodeAt(ctx.p++); let first = c; - let isLiteral = c === "'"; - let isMultiline = c === str[ptr] && c === str[ptr + 1]; + let isLiteral = c === 39; + let isMultiline = c === ctx.s.charCodeAt(ctx.p) && c === ctx.s.charCodeAt(ctx.p + 1); if (isMultiline) { - if (str[ptr += 2] === "\n") - ptr++; - else if (str[ptr] === "\r" && str[ptr + 1] === "\n") - ptr += 2; + if ((c = ctx.s.charCodeAt(ctx.p += 2)) === 10) + ctx.p++; + else if (c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) + ctx.p += 2; } let parsed = ""; - let sliceStart = ptr; + let sliceStart = ctx.p; let state3 = 0; - for (let i = ptr; i < str.length; i++) { - c = str[i]; - if (isMultiline && (c === "\n" || c === "\r" && str[i + 1] === "\n")) { + for (; ctx.p < ctx.s.length; ctx.p++) { + c = ctx.s.charCodeAt(ctx.p); + if (isMultiline && (c === 10 || c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)) { state3 = state3 && 3; - } else if (c < " " && c !== " " || c === "\x7F") { - throw new TomlError("control characters are not allowed in strings", { - toml: str, - ptr: i - }); - } else if ((!state3 || state3 === 3) && c === first && (!isMultiline || str[i + 1] === first && str[i + 2] === first)) { + } else if (c < 32 && c !== 9 || c === 127) { + TomlError.x("control characters are not allowed in strings", ctx); + } else if ((!state3 || state3 === 3) && c === first && (!isMultiline || ctx.s.charCodeAt(ctx.p + 1) === first && ctx.s.charCodeAt(ctx.p + 2) === first)) { if (isMultiline) { - if (str[i + 3] === first) - i++; - if (str[i + 3] === first) - i++; + if (ctx.s.charCodeAt(ctx.p + 3) === first) + ctx.p++; + if (ctx.s.charCodeAt(ctx.p + 3) === first) + ctx.p++; } - return [ - // If we're in a newline escape still, then there's nothing to add. - // Also try to avoid concat if there's nothing to add to parsed, or nothing has been added to parsed. - state3 ? parsed : parsed + str.slice(sliceStart, i), - i + (isMultiline ? 3 : 1) - ]; + if (!state3) { + let s = ctx.s.slice(sliceStart, ctx.p); + parsed = parsed ? parsed + s : s; + } + ctx.p += isMultiline ? 3 : 1; + return parsed; } else if (!state3) { - if (!isLiteral && c === "\\") { - parsed += str.slice(sliceStart, sliceStart = i); + if (!isLiteral && c === 92) { + parsed += ctx.s.slice(sliceStart, sliceStart = ctx.p); state3 = 1; } } else if (state3 === 1) { - if (c === "x" || c === "u" || c === "U") { + if (c === 120 || c === 117 || c === 85) { + let errPtr = ctx.p++ - 1; let value = 0; - let len = c === "x" ? 2 : c === "u" ? 4 : 8; - for (let j = 0; j < len; j++, i++) { - let hex = str.charCodeAt(i + 1); + let len = c === 120 ? 2 : c === 117 ? 4 : 8; + for (let j = 0; j < len; j++, ctx.p++) { + let hex = ctx.s.charCodeAt(ctx.p); let digit = ( /* 0-9 */ hex >= 48 && hex <= 57 ? hex - 48 : ( @@ -77584,371 +77492,517 @@ function parseString(str, ptr) { ) ); if (digit < 0) - throw new TomlError("invalid non-hex character in unicode escape", { toml: str, ptr: i + 1 }); + TomlError.x("invalid non-hex character in unicode escape", ctx); value = value << 4 | digit; } if (value < 0 || value > 1114111 || value >= 55296 && value <= 57343) { - throw new TomlError("invalid unicode escape", { toml: str, ptr: i }); + TomlError.x("invalid unicode escape", ctx, errPtr); } parsed += String.fromCodePoint(value); - sliceStart = i + 1; + sliceStart = ctx.p--; state3 = 0; - } else if (c === " " || c === " ") { + } else if (isMultiline && (c === 32 || c === 9)) { state3 = 2; } else { - if (c === "b") + if (c === 98) parsed += "\b"; - else if (c === "t") + else if (c === 116) parsed += " "; - else if (c === "n") + else if (c === 110) parsed += "\n"; - else if (c === "f") + else if (c === 102) parsed += "\f"; - else if (c === "r") + else if (c === 114) parsed += "\r"; - else if (c === "e") + else if (c === 101) parsed += "\x1B"; - else if (c === '"') + else if (c === 34) parsed += '"'; - else if (c === "\\") + else if (c === 92) parsed += "\\"; else - throw new TomlError("unrecognized escape sequence", { toml: str, ptr: i }); - sliceStart = i + 1; + TomlError.x("unrecognised escape sequence", ctx); + sliceStart = ctx.p + 1; state3 = 0; } - } else if (c !== " " && c !== " ") { - if (state3 === 2) { - throw new TomlError("invalid escape: only line-ending whitespace may be escaped", { - toml: str, - ptr: sliceStart - }); - } - state3 = !isLiteral && c === "\\" ? 1 : 0; - sliceStart = i; + } else if (c !== 32 && c !== 9) { + if (state3 === 2) + TomlError.x("invalid escape: only line-ending whitespace may be escaped", ctx, sliceStart); + state3 = !isLiteral && c === 92 ? 1 : 0; + sliceStart = ctx.p; } } - throw new TomlError("unfinished string", { toml: str, ptr }); + TomlError.x("unfinished string", ctx, startPtr); } -function parseValue2(value, toml, ptr, integersAsBigInt) { - if (value === "true") - return true; - if (value === "false") - return false; - if (value === "-inf") - return -Infinity; - if (value === "inf" || value === "+inf") - return Infinity; - if (value === "nan" || value === "+nan" || value === "-nan") - return NaN; - if (value === "-0") - return integersAsBigInt ? 0n : 0; - let isInt = INT_REGEX.test(value); - if (isInt || FLOAT_REGEX.test(value)) { - if (LEADING_ZERO.test(value)) { - throw new TomlError("leading zeroes are not allowed", { - toml, - ptr - }); - } - value = value.replace(/_/g, ""); - let numeric2 = +value; - if (isNaN(numeric2)) { - throw new TomlError("invalid number", { - toml, - ptr - }); - } - if (isInt) { - if ((isInt = !Number.isSafeInteger(numeric2)) && !integersAsBigInt) { - throw new TomlError("integer value cannot be represented losslessly", { - toml, - ptr - }); + +// node_modules/smol-toml/dist/date.js +var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z|[-+]\d{2}:\d{2})?$/i; +var TomlDate = class _TomlDate extends Date { + #hasDate = false; + #hasTime = false; + #offset = null; + constructor(date, fasttype, unsafeDelim) { + let hasDate = true; + let hasTime = true; + let offset = "Z"; + let c; + if (typeof date === "string") { + if (fasttype) + prep: { + if (fasttype < 3) { + if (+date.slice(11, 13) > 23) { + date = ""; + break prep; + } + if (fasttype === 2) { + offset = null; + date += "Z"; + } else if ((c = date.charCodeAt(date.length - 1)) !== 90 && c !== 122) { + offset = date.slice(date.length - 6); + } + if (unsafeDelim) + date = date.slice(0, 10) + "T" + date.slice(11); + } else if (fasttype === 4) { + date = +date.slice(0, 2) > 23 ? "" : `0000-01-01T${date}Z`; + } + hasDate = fasttype !== 4; + hasTime = fasttype !== 3; + } + else { + let match4 = date.match(DATE_TIME_RE); + if (match4) { + if (!match4[1]) { + hasDate = false; + date = `0000-01-01T${date}`; + } + hasTime = !!match4[2]; + hasTime && date[10] === " " && (date = date.replace(" ", "T")); + if (match4[2] && +match4[2] > 23) { + date = ""; + } else { + offset = match4[3] || null; + if (!offset && hasTime) + date += "Z"; + } + } else { + date = ""; + } } - if (isInt || integersAsBigInt === true) - numeric2 = BigInt(value); } - return numeric2; + super(date); + if (!isNaN(this.getTime())) { + this.#hasDate = hasDate; + this.#hasTime = hasTime; + this.#offset = offset; + } } - const date = new TomlDate(value); - if (!date.isValid()) { - throw new TomlError("invalid value", { - toml, - ptr - }); + isDateTime() { + return this.#hasDate && this.#hasTime; } - return date; -} - -// node_modules/smol-toml/dist/util.js -function indexOfNewline(str, start = 0, end = str.length) { - let idx = str.indexOf("\n", start); - if (str[idx - 1] === "\r") - idx--; - return idx <= end ? idx : -1; -} -function skipComment(str, ptr) { - for (let i = ptr; i < str.length; i++) { - let c = str[i]; - if (c === "\n") - return i; - if (c === "\r" && str[i + 1] === "\n") - return i + 1; - if (c < " " && c !== " " || c === "\x7F") { - throw new TomlError("control characters are not allowed in comments", { - toml: str, - ptr - }); - } + isLocal() { + return !this.#hasDate || !this.#hasTime || !this.#offset; } - return str.length; -} -function skipVoid(str, ptr, banNewLines, banComments) { - let c; - while (1) { - while ((c = str[ptr]) === " " || c === " " || !banNewLines && (c === "\n" || c === "\r" && str[ptr + 1] === "\n")) - ptr++; - if (banComments || c !== "#") - break; - ptr = skipComment(str, ptr); + isDate() { + return this.#hasDate && !this.#hasTime; } - return ptr; -} -function skipUntil(str, ptr, sep9, end, banNewLines = false) { - if (!end) { - ptr = indexOfNewline(str, ptr); - return ptr < 0 ? str.length : ptr; + isTime() { + return this.#hasTime && !this.#hasDate; } - for (let i = ptr; i < str.length; i++) { - let c = str[i]; - if (c === "#") { - i = indexOfNewline(str, i); - if (i < 0) - break; - } else if (c === sep9) { - return i + 1; - } else if (c === end || banNewLines && (c === "\n" || c === "\r" && str[i + 1] === "\n")) { - return i; - } + isValid() { + return this.#hasDate || this.#hasTime; } - throw new TomlError("cannot find end of structure", { - toml: str, - ptr - }); -} + toISOString() { + let iso = super.toISOString(); + if (this.isDate()) + return iso.slice(0, 10); + if (this.isTime()) + return iso.slice(11, 23); + if (this.#offset === null) + return iso.slice(0, -1); + if (this.#offset === "Z" || this.#offset === "z") + return iso; + let offset = +this.#offset.slice(1, 3) * 60 + +this.#offset.slice(4, 6); + offset = this.#offset[0] === "-" ? offset : -offset; + let offsetDate = new Date(this.getTime() - offset * 6e4); + return offsetDate.toISOString().slice(0, -1) + this.#offset; + } + static wrapAsOffsetDateTime(jsDate, offset = "Z") { + let date = new _TomlDate(jsDate); + date.#offset = offset; + return date; + } + static wrapAsLocalDateTime(jsDate) { + let date = new _TomlDate(jsDate); + date.#offset = null; + return date; + } + static wrapAsLocalDate(jsDate) { + let date = new _TomlDate(jsDate); + date.#hasTime = false; + date.#offset = null; + return date; + } + static wrapAsLocalTime(jsDate) { + let date = new _TomlDate(jsDate); + date.#hasDate = false; + date.#offset = null; + return date; + } +}; // node_modules/smol-toml/dist/extract.js -function sliceAndTrimEndOf(str, startPtr, endPtr) { - let value = str.slice(startPtr, endPtr); - let commentIdx = value.indexOf("#"); - if (commentIdx > -1) { - skipComment(str, commentIdx); - value = value.slice(0, commentIdx); - } - return [value.trimEnd(), commentIdx]; -} -function extractValue(str, ptr, end, depth, integersAsBigInt) { - if (depth === 0) { - throw new TomlError("document contains excessively nested structures. aborting.", { - toml: str, - ptr - }); +function isDigit(char, base = 10) { + return base === 16 ? char > 47 && char < 58 || char > 64 && char < 71 || char > 96 && char < 103 : char > 47 && char < 48 + base; +} +function isEndOfValue(char, delim) { + return char === 32 || char === 9 || char === 10 || char === 13 || // Structure end or next value delimiter + delim && (char === delim || char === 44) || // Comment + char === 35; +} +function extractValue(ctx, end) { + let errPtr = ctx.p; + let c = ctx.s.charCodeAt(ctx.p); + if (c === 91 || c === 123) { + ctx.d-- || TomlError.x("document contains excessively nested structures. aborting.", ctx); + let value = c === 91 ? parseArray(ctx) : parseInlineTable(ctx); + ctx.d++; + return value; } - let c = str[ptr]; - if (c === "[" || c === "{") { - let [value, endPtr2] = c === "[" ? parseArray(str, ptr, depth, integersAsBigInt) : parseInlineTable(str, ptr, depth, integersAsBigInt); - if (end) { - endPtr2 = skipVoid(str, endPtr2); - if (str[endPtr2] === ",") - endPtr2++; - else if (str[endPtr2] !== end) { - throw new TomlError("expected comma or end of structure", { - toml: str, - ptr: endPtr2 - }); + if (c === 34 || c === 39) { + return parseString(ctx); + } + if (c === 116) { + if (ctx.s.charCodeAt(++ctx.p) !== 114 || ctx.s.charCodeAt(++ctx.p) !== 117 || ctx.s.charCodeAt(++ctx.p) !== 101) + TomlError.x("invalid value", ctx, errPtr); + return ctx.p++, true; + } + if (c === 102) { + if (ctx.s.charCodeAt(++ctx.p) !== 97 || ctx.s.charCodeAt(++ctx.p) !== 108 || ctx.s.charCodeAt(++ctx.p) !== 115 || ctx.s.charCodeAt(++ctx.p) !== 101) + TomlError.x("invalid value", ctx, errPtr); + return ctx.p++, false; + } + if (c === 43 || c === 45) { + return parseNumber(ctx, ctx.p, ctx.s.charCodeAt(++ctx.p), 44 - c, end); + } + if (ctx.s.charCodeAt(ctx.p + 4) === 45 && ctx.s.charCodeAt(ctx.p + 7) === 45) { + return parseDate(ctx, c, end); + } + if (ctx.s.charCodeAt(ctx.p + 2) === 58) { + return parseTime(ctx, c, end); + } + return parseNumber(ctx, ctx.p, c, 0, end); +} +function parseNumber(ctx, startPtr, startChr, sign, endChr) { + let c = startChr; + let state3 = 0; + let hasUnderscores = false; + if (c === 105) { + if (ctx.s.charCodeAt(++ctx.p) !== 110 || ctx.s.charCodeAt(++ctx.p) !== 102) + TomlError.x("invalid value", ctx, startPtr); + return ctx.p++, (sign || 1) / 0; + } + if (c === 110) { + if (ctx.s.charCodeAt(++ctx.p) !== 97 || ctx.s.charCodeAt(++ctx.p) !== 110) + TomlError.x("invalid value", ctx, startPtr); + return ctx.p++, NaN; + } + if (c === 48) { + if (++ctx.p >= ctx.s.length || isEndOfValue(c = ctx.s.charCodeAt(ctx.p), endChr)) + return ctx.bi === true ? 0n : 0; + if (!sign) { + if (c === 120) + return parseIntegerBaseN(ctx, startPtr, 16, endChr); + else if (c === 98) + return parseIntegerBaseN(ctx, startPtr, 2, endChr); + else if (c === 111) + return parseIntegerBaseN(ctx, startPtr, 8, endChr); + } + if (c === 46) + state3 = 2; + else if (c === 101 || c === 69) + state3 = 4; + else + TomlError.x("illegal leading zero", ctx, startPtr); + } else if (!isDigit(c)) + TomlError.x("invalid value", ctx, startPtr); + while (++ctx.p < ctx.s.length && (c = ctx.s.charCodeAt(ctx.p), !isEndOfValue(c, endChr))) { + if (!state3) + state3 = 1; + if (c === 95) { + if (!(state3 & 1)) + TomlError.x("illegal underscore", ctx); + state3 += 11; + hasUnderscores = true; + } else if (state3 === 1 && c === 46) + state3 = 2; + else if ((state3 === 1 || state3 === 3) && (c === 101 || c === 69)) + state3 = 4; + else if (state3 === 4 && (c === 43 || c === 45)) { + } else if (!isDigit(c)) + TomlError.x(`illegal character in numeric literal`, ctx); + else if (state3 > 9) + state3 -= 11; + else if (!(state3 & 1)) + state3++; + } + if (!state3) { + let val = (startChr - 48) * (sign || 1); + return ctx.bi === true ? BigInt(val) : val; + } + if (!(state3 & 1)) + TomlError.x("unfinished numeric value", ctx, startPtr); + let str = ctx.s.slice(startPtr, ctx.p); + if (hasUnderscores) + str = str.replaceAll("_", ""); + return state3 > 1 ? parseFloat(str) : parseInteger(ctx, str, 10, startPtr); +} +function parseIntegerBaseN(ctx, startPtr, base, endChr) { + let c, underscore = 1; + while (++ctx.p < ctx.s.length && (c = ctx.s.charCodeAt(ctx.p), !isEndOfValue(c, endChr))) { + if (c === 95) { + if (underscore & 1) + TomlError.x("illegal underscore", ctx); + underscore = 3; + } else if (!isDigit(c, base)) + TomlError.x(`illegal character in numeric literal`, ctx); + else if (underscore & 1) + underscore--; + } + if (underscore & 1) + TomlError.x("unfinished numeric value", ctx); + let str = ctx.s.slice(startPtr + 2, ctx.p); + if (underscore) + str = str.replaceAll("_", ""); + return parseInteger(ctx, str, base, startPtr); +} +function parseInteger(ctx, str, base, startPtr) { + if (ctx.bi !== true) + int: { + let val = parseInt(str, base); + if (!Number.isSafeInteger(val)) { + if (ctx.bi) + break int; + TomlError.x("integer value cannot be represented losslessly", ctx, startPtr); } + return val; } - return [value, endPtr2]; + return base === 10 ? BigInt(str) : BigInt((base === 2 ? "0b" : base === 8 ? "0o" : "0x") + str); +} +function parseDate(ctx, c, endChr) { + let startPtr = ctx.p++, unsafeSeparator; + if (!isDigit(c) || !isDigit(ctx.s.charCodeAt(ctx.p++)) || !isDigit(ctx.s.charCodeAt(ctx.p++)) || !isDigit(ctx.s.charCodeAt(ctx.p++))) { + return parseNumber(ctx, ctx.p = startPtr, c, 0, endChr); + } + ctx.p += 5; + if (!isDigit(ctx.s.charCodeAt(ctx.p++))) + TomlError.x("invalid date-time: date part is malformed", ctx, startPtr); + if (ctx.p >= ctx.s.length || ((c = ctx.s.charCodeAt(ctx.p)) !== 32 || (unsafeSeparator = true, !isDigit(ctx.s.charCodeAt(ctx.p + 1)))) && c !== 84 && c !== 116) { + let t2 = ctx.s.slice(startPtr, ctx.p); + return readDate(ctx, t2, 3, false, startPtr); + } + if (ctx.s.charCodeAt(ctx.p += 3) !== 58) + TomlError.x("invalid date-time: time part is malformed", ctx, startPtr); + if (ctx.s.charCodeAt(ctx.p += 3) === 58) + ctx.p += 3; + if (ctx.s.charCodeAt(ctx.p) === 46) + while (isDigit(ctx.s.charCodeAt(++ctx.p))) + ; + if (c = ctx.s.charCodeAt(ctx.p)) { + if (c === 90 || c === 122) { + let t2 = ctx.s.slice(startPtr, ++ctx.p); + return readDate(ctx, t2, 1, unsafeSeparator, startPtr, "[+00:00]"); + } + if (c === 43 || c === 45) { + let t2 = ctx.s.slice(startPtr, ctx.p += 6); + return readDate(ctx, t2, 1, unsafeSeparator, startPtr, !ctx.ld && "[" + ctx.s.slice(ctx.p - 6, ctx.p) + "]"); + } + } + let t = ctx.s.slice(startPtr, ctx.p); + return readDate(ctx, t, 2, unsafeSeparator, startPtr); +} +function parseTime(ctx, c, endChr) { + let start = ctx.p; + if (!isDigit(c) || !isDigit(ctx.s.charCodeAt(++ctx.p))) { + return parseNumber(ctx, --ctx.p, c, 0, endChr); + } + if (ctx.s.charCodeAt(ctx.p += 4) === 58) + ctx.p += 3; + if (ctx.s.charCodeAt(ctx.p) === 46) + while (isDigit(ctx.s.charCodeAt(++ctx.p))) + ; + let t = ctx.s.slice(start, ctx.p); + return readDate(ctx, t, 4, false, start); +} +function readDate(ctx, str, type, unsafeDelim, errPtr, temporalSuffix) { + if (ctx.ld) { + let date = new TomlDate(str, type, unsafeDelim); + if (!date.isValid()) + TomlError.x("invalid date", ctx, errPtr); + return date; } - if (c === '"' || c === "'") { - let [parsed, endPtr2] = parseString(str, ptr); - if (end) { - endPtr2 = skipVoid(str, endPtr2); - if (str[endPtr2] && str[endPtr2] !== "," && str[endPtr2] !== end && str[endPtr2] !== "\n" && str[endPtr2] !== "\r") { - throw new TomlError("unexpected character encountered", { - toml: str, - ptr: endPtr2 - }); - } - if (str[endPtr2] === ",") - endPtr2++; + try { + if (temporalSuffix) + str += temporalSuffix; + switch (type) { + case 1: + return Temporal.ZonedDateTime.from(str); + case 2: + return Temporal.PlainDateTime.from(str); + case 3: + return Temporal.PlainDate.from(str); + case 4: + return Temporal.PlainTime.from(str); } - return [parsed, endPtr2]; + } catch (e) { + TomlError.x(e instanceof Error ? e.message : "" + e, ctx, errPtr); } - let endPtr = skipUntil(str, ptr, ",", end); - let slice = sliceAndTrimEndOf(str, ptr, endPtr - (str[endPtr - 1] === "," ? 1 : 0)); - if (!slice[0]) { - throw new TomlError("incomplete key-value declaration: no value specified", { - toml: str, - ptr - }); +} + +// node_modules/smol-toml/dist/util.js +function skipComment(ctx) { + for (; ctx.p < ctx.s.length; ctx.p++) { + let c = ctx.s.charCodeAt(ctx.p); + if (c === 10) + break; + if (c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) { + ctx.p++; + break; + } + if (c < 32 && c !== 9 || c === 127) { + TomlError.x("control characters are not allowed in comments", ctx); + } } - if (end && slice[1] > -1) { - endPtr = skipVoid(str, ptr + slice[1]); - if (str[endPtr] === ",") - endPtr++; +} +function skipVoid(ctx, banNewLines, banComments) { + let c; + while (ctx.p < ctx.s.length) { + while (ctx.p < ctx.s.length && ((c = ctx.s.charCodeAt(ctx.p)) === 32 || c === 9 || !banNewLines && (c === 10 || c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10))) + ctx.p++; + if (banComments || c !== 35) + break; + skipComment(ctx); } - return [ - parseValue2(slice[0], str, ptr, integersAsBigInt), - endPtr - ]; } // node_modules/smol-toml/dist/struct.js -var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/; -function parseKey(str, ptr, end = "=") { - let dot = ptr - 1; +function parseKey(ctx, end = 61) { + let startPtr; + let state3 = 0; let parsed = []; - let endPtr = str.indexOf(end, ptr); - if (endPtr < 0) { - throw new TomlError("incomplete key-value: cannot find end of key", { - toml: str, - ptr - }); - } + let sliceStart; + let c = ctx.s.charCodeAt(startPtr = ctx.p); do { - let c = str[ptr = ++dot]; - if (c !== " " && c !== " ") { - if (c === '"' || c === "'") { - if (c === str[ptr + 1] && c === str[ptr + 2]) { - throw new TomlError("multiline strings are not allowed in keys", { - toml: str, - ptr - }); - } - let [part, eos] = parseString(str, ptr); - dot = str.indexOf(".", eos); - let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot); - let newLine = indexOfNewline(strEnd); - if (newLine > -1) { - throw new TomlError("newlines are not allowed in keys", { - toml: str, - ptr: ptr + dot + newLine - }); - } - if (strEnd.trimStart()) { - throw new TomlError("found extra tokens after the string part", { - toml: str, - ptr: eos - }); - } - if (endPtr < eos) { - endPtr = str.indexOf(end, eos); - if (endPtr < 0) { - throw new TomlError("incomplete key-value: cannot find end of key", { - toml: str, - ptr - }); - } - } - parsed.push(part); - } else { - dot = str.indexOf(".", ptr); - let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot); - if (!KEY_PART_RE.test(part)) { - throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", { - toml: str, - ptr - }); - } - parsed.push(part.trimEnd()); + if (c === end) { + if (!state3) + TomlError.x("unexpected end of key", ctx); + if (state3 === 1) + parsed.push(ctx.s.slice(sliceStart, ctx.p)); + return ctx.p++, parsed; + } else if (c === 46) { + if (!state3) + TomlError.x("illegal empty bare key", ctx); + if (state3 === 1) + parsed.push(ctx.s.slice(sliceStart, ctx.p)); + state3 = 0; + } else if (!state3 && (c === 34 || c === 39)) { + if (c === ctx.s.charCodeAt(ctx.p + 1) && c === ctx.s.charCodeAt(ctx.p + 2)) + TomlError.x("illegal quoted key: multiline strings are not allowed", ctx); + parsed.push(parseString(ctx)); + state3 = 2; + ctx.p--; + } else if (c === 32 || c === 9) { + if (state3 === 1) { + parsed.push(ctx.s.slice(sliceStart, ctx.p)); + state3 = 2; } + } else if (state3 === 2 || c < 48 && c !== 45 || c > 57 && c < 65 || c > 90 && c < 97 && c !== 95 || c > 122) { + TomlError.x("illegal character in key", ctx); + } else if (!state3) { + state3 = 1; + sliceStart = ctx.p; } - } while (dot + 1 && dot < endPtr); - return [parsed, skipVoid(str, endPtr + 1, true, true)]; + } while (c = ctx.s.charCodeAt(++ctx.p)); + TomlError.x("incomplete key-value: cannot find end of key", ctx, startPtr); } -function parseInlineTable(str, ptr, depth, integersAsBigInt) { - let res = {}; +function parseInlineTable(ctx) { + let startPtr = ctx.p++; + let res = /* @__PURE__ */ Object.create(null); let seen = /* @__PURE__ */ new Set(); let c; - ptr++; - while ((c = str[ptr++]) !== "}" && c) { - if (c === ",") { - throw new TomlError("expected value, found comma", { - toml: str, - ptr: ptr - 1 - }); - } else if (c === "#") - ptr = skipComment(str, ptr); - else if (c !== " " && c !== " " && c !== "\n" && c !== "\r") { - let k; - let t = res; - let hasOwn = false; - let [key, keyEndPtr] = parseKey(str, ptr - 1); - for (let i = 0; i < key.length; i++) { - if (i) - t = hasOwn ? t[k] : t[k] = {}; - k = key[i]; - if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== "object" || seen.has(t[k]))) { - throw new TomlError("trying to redefine an already defined value", { - toml: str, - ptr - }); - } - if (!hasOwn && k === "__proto__") { - Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true }); - } + while (ctx.p < ctx.s.length) { + skipVoid(ctx); + if ((c = ctx.s.charCodeAt(ctx.p)) === 125) { + ctx.p++; + return res; + } + let k; + let t = res; + let hasOwn = false; + let errPtr = ctx.p; + let key = parseKey(ctx); + for (let i = 0; i < key.length; i++) { + if (i) + t = hasOwn ? t[k] : t[k] = /* @__PURE__ */ Object.create(null); + k = key[i]; + if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== "object" || seen.has(t[k]))) { + TomlError.x("trying to redefine an already defined value", ctx, errPtr); + } + let unsafe = k === "__proto__"; + if (ctx.uk && (unsafe || k === "constructor")) { + t = ctx.uk !== 1 && TomlError.x("document contains an unsafe property", ctx, errPtr); + break; } - if (hasOwn) { - throw new TomlError("trying to redefine an already defined value", { - toml: str, - ptr - }); + if (!hasOwn && unsafe) { + Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true }); } - let [value, valueEndPtr] = extractValue(str, keyEndPtr, "}", depth - 1, integersAsBigInt); + } + if (hasOwn) { + TomlError.x("trying to redefine an already defined value", ctx, errPtr); + } + skipVoid(ctx, true, true); + let value = extractValue( + ctx, + 125 + /* } */ + ); + if (t && typeof (t[k] = value) === "object") seen.add(value); - t[k] = value; - ptr = valueEndPtr; + skipVoid(ctx); + if ((c = ctx.s.charCodeAt(ctx.p++)) === 125) { + return res; } + if (c !== 44) + TomlError.x("expected comma or end of structure", ctx, ctx.p - 1); } - if (!c) { - throw new TomlError("unfinished table encountered", { - toml: str, - ptr - }); - } - return [res, ptr]; + TomlError.x("unfinished table", ctx, startPtr); } -function parseArray(str, ptr, depth, integersAsBigInt) { +function parseArray(ctx) { + let startPtr = ctx.p++; let res = []; let c; - ptr++; - while ((c = str[ptr++]) !== "]" && c) { - if (c === ",") { - throw new TomlError("expected value, found comma", { - toml: str, - ptr: ptr - 1 - }); - } else if (c === "#") - ptr = skipComment(str, ptr); - else if (c !== " " && c !== " " && c !== "\n" && c !== "\r") { - let e = extractValue(str, ptr - 1, "]", depth - 1, integersAsBigInt); - res.push(e[0]); - ptr = e[1]; - } - } - if (!c) { - throw new TomlError("unfinished array encountered", { - toml: str, - ptr - }); + while (ctx.p < ctx.s.length) { + skipVoid(ctx); + if ((c = ctx.s.charCodeAt(ctx.p)) === 93) { + ctx.p++; + return res; + } + res.push(extractValue( + ctx, + 93 + /* ] */ + )); + skipVoid(ctx); + if ((c = ctx.s.charCodeAt(ctx.p++)) === 93) { + return res; + } + if (c !== 44) + TomlError.x("expected comma or end of structure", ctx, ctx.p - 1); } - return [res, ptr]; + TomlError.x("unfinished array", ctx, startPtr); } // node_modules/smol-toml/dist/parse.js -function peekTable(key, table, meta, type) { +function peekTable(ctx, key, table, meta, type) { let t = table; let m = meta; let k; @@ -77956,7 +78010,7 @@ function peekTable(key, table, meta, type) { let state3; for (let i = 0; i < key.length; i++) { if (i) { - t = hasOwn ? t[k] : t[k] = {}; + t = hasOwn ? t[k] : t[k] = /* @__PURE__ */ Object.create(null); m = (state3 = m[k]).c; if (type === 0 && (state3.t === 1 || state3.t === 2)) { return null; @@ -77972,7 +78026,10 @@ function peekTable(key, table, meta, type) { return null; } if (!hasOwn) { - if (k === "__proto__") { + let unsafe = k === "__proto__"; + if (ctx.uk && (unsafe || k === "constructor")) + return false; + if (unsafe) { Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true }); Object.defineProperty(m, k, { enumerable: true, configurable: true, writable: true }); } @@ -77980,7 +78037,7 @@ function peekTable(key, table, meta, type) { t: i < key.length - 1 && type === 2 ? 3 : type, d: false, i: 0, - c: {} + c: /* @__PURE__ */ Object.create(null) }; } } @@ -77993,85 +78050,103 @@ function peekTable(key, table, meta, type) { state3.d = true; t[k] = []; } - t[k].push(t = {}); - state3.c[state3.i++] = state3 = { t: 1, d: false, i: 0, c: {} }; + t[k].push(t = /* @__PURE__ */ Object.create(null)); + state3.c[state3.i++] = state3 = { t: 1, d: false, i: 0, c: /* @__PURE__ */ Object.create(null) }; } if (state3.d) { return null; } state3.d = true; if (type === 1) { - t = hasOwn ? t[k] : t[k] = {}; + t = hasOwn ? t[k] : t[k] = /* @__PURE__ */ Object.create(null); } else if (type === 0 && hasOwn) { return null; } return [k, t, state3.c]; } -function parse3(toml, { maxDepth = 1e3, integersAsBigInt } = {}) { - let res = {}; - let meta = {}; +function validateTablePeek(ctx, peek, ptr) { + if (peek === null || ctx.uk === 2) + TomlError.x(peek === null ? "trying to redefine an already defined table or value" : "document contains an unsafe property", ctx, ptr); +} +function parse3(toml, options = {}) { + let ctx = { + s: toml, + p: 0, + d: options.maxDepth ?? 1e3, + bi: options.integersAsBigInt ?? false, + ld: options.useLegacyDate ?? true, + uk: options.unsafeKeyBehaviour === "throw" ? 2 : options.unsafeKeyBehaviour === "drop" ? 1 : 0 + }; + let res = /* @__PURE__ */ Object.create(null); + let meta = /* @__PURE__ */ Object.create(null); + let tmp; + let skipping = false; let tbl = res; let m = meta; - for (let ptr = skipVoid(toml, 0); ptr < toml.length; ) { - if (toml[ptr] === "[") { - let isTableArray = toml[++ptr] === "["; - let k = parseKey(toml, ptr += +isTableArray, "]"); + if (toml.charCodeAt(0) === 65279) + ctx.p++; + skipVoid(ctx); + while (ctx.p < toml.length) { + if (toml.charCodeAt(ctx.p) === 91) { + let isTableArray = toml.charCodeAt(++ctx.p) === 91; + tmp = ctx.p += +isTableArray; + skipping = false; + let k = parseKey( + ctx, + 93 + /* ] */ + ); if (isTableArray) { - if (toml[k[1] - 1] !== "]") { - throw new TomlError("expected end of table declaration", { - toml, - ptr: k[1] - 1 - }); + if (toml.charCodeAt(ctx.p) !== 93) { + TomlError.x("expected end of table array declaration", ctx); } - k[1]++; + ctx.p++; } let p = peekTable( - k[0], + ctx, + k, res, meta, isTableArray ? 2 : 1 /* Type.EXPLICIT */ ); if (!p) { - throw new TomlError("trying to redefine an already defined table or value", { - toml, - ptr - }); + validateTablePeek(ctx, p, tmp); + skipping = true; + } else { + m = p[2]; + tbl = p[1]; } - m = p[2]; - tbl = p[1]; - ptr = k[1]; } else { - let k = parseKey(toml, ptr); + tmp = ctx.p; + let k = parseKey(ctx); let p = peekTable( - k[0], + ctx, + k, tbl, m, 0 /* Type.DOTTED */ ); - if (!p) { - throw new TomlError("trying to redefine an already defined table or value", { - toml, - ptr - }); - } - let v = extractValue(toml, k[1], void 0, maxDepth, integersAsBigInt); - p[1][p[0]] = v[0]; - ptr = v[1]; + if (!p && !skipping) + validateTablePeek(ctx, p, tmp); + skipVoid(ctx, true, true); + let v = extractValue(ctx, void 0); + if (p && !skipping) + p[1][p[0]] = v; } - ptr = skipVoid(toml, ptr, true); - if (toml[ptr] && toml[ptr] !== "\n" && toml[ptr] !== "\r") { - throw new TomlError("each key-value declaration must be followed by an end-of-line", { - toml, - ptr - }); + skipVoid(ctx, true); + if (ctx.p < toml.length && (tmp = toml.charCodeAt(ctx.p)) !== 10 && (tmp !== 13 || toml.charCodeAt(ctx.p + 1) !== 10)) { + TomlError.x("each key-value declaration must be followed by an end-of-line", ctx); } - ptr = skipVoid(toml, ptr); + skipVoid(ctx); } return res; } +// node_modules/smol-toml/dist/stringify.js +var HAS_WELLFORMED = !!"".isWellFormed; + // src/utils/config-file.ts function getConfigValueFromTomlFile(filePath, key) { if (!import_node_fs3.default.existsSync(filePath) || !filePath.endsWith(".toml")) { @@ -78104,7 +78179,7 @@ function loadInputs() { const checksum = getInput("checksum"); const enableCache = getEnableCache(); const restoreCache2 = getInput("restore-cache") === "true"; - const saveCache4 = getInput("save-cache") === "true"; + const saveCache4 = getSaveCache(); const cacheSuffix = getInput("cache-suffix") || ""; const cacheLocalPath = getCacheLocalPath( workingDirectory, @@ -78214,6 +78289,17 @@ function getEnableCache() { } return enableCacheInput === "true"; } +function getSaveCache() { + const saveCacheInput = getInput("save-cache"); + if (saveCacheInput === "auto") { + if (process.env.GITHUB_EVENT_NAME === "merge_group") { + info2("Cache saving is disabled for the merge_group event"); + return false; + } + return true; + } + return saveCacheInput === "true"; +} function getToolBinDir(workingDirectory) { const toolBinDirInput = getInput("tool-bin-dir"); if (toolBinDirInput !== "") { @@ -78393,22 +78479,82 @@ var { toString: toString3 } = Object.prototype; var { getPrototypeOf } = Object; var { iterator, toStringTag } = Symbol; 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 = toString3.call(thing); return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); @@ -78443,9 +78589,9 @@ var isPlainObject = (val) => { 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) => { @@ -78466,6 +78612,7 @@ var isReactNativeBlob = (value) => { var isReactNative2 = (formData) => formData && typeof formData.getParts !== "undefined"; var isBlob2 = kindOfTest("Blob"); var isFileList = kindOfTest("FileList"); +var isSet = kindOfTest("Set"); var isStream = (val) => isObject2(val) && isFunction(val.pipe); function getGlobal() { if (typeof globalThis !== "undefined") return globalThis; @@ -78761,11 +78908,20 @@ var toJSONObject = (obj) => { } 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; } @@ -78846,6 +79002,7 @@ var utils_default = { // an alias to avoid ESLint no-prototype-builtins detection hasOwnInPrototypeChain, getSafeProp, + toSafeFlatObject, reduceDescriptors, freezeMethods, toObjectSet, @@ -78894,17 +79051,18 @@ var parseHeaders_default = (rawHeaders) => { 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_default.hasOwnProp(parsed, key); + if (!key || hasKey && utils_default.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; @@ -78968,6 +79126,90 @@ function parseTokens(str) { } 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(context3, value, header, filter4, isHeaderNameFilter) { if (utils_default.isFunction(filter4)) { @@ -79143,7 +79385,8 @@ var AxiosHeaders = class { 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_default.isArray(value) ? value : value == null || value === false ? [] : [value]; } get [Symbol.toStringTag]() { return "AxiosHeaders"; @@ -79151,6 +79394,9 @@ var AxiosHeaders = class { 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)); @@ -79246,9 +79492,30 @@ function redactConfig(config, redactKeys) { }; return visit(config); } +function stringifySafely(value) { + try { + return String(value); + } catch (err) { + return ""; + } +} +function aggregateErrorMessage(error2) { + const message = error2.errors.map((entry) => { + try { + return entry && entry.message ? stringifySafely(entry.message) : stringifySafely(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_default.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, @@ -79338,6 +79605,16 @@ var AxiosError_default = AxiosError; var import_form_data = __toESM(require_form_data(), 1); var FormData_default = import_form_data.default; +// node_modules/axios/lib/platform/node/classes/Buffer.js +var Buffer_default = { + isBufferAvailable() { + return typeof Buffer !== "undefined"; + }, + from(value) { + return Buffer.from(value); + } +}; + // node_modules/axios/lib/helpers/toFormData.js var DEFAULT_FORM_DATA_MAX_DEPTH = 100; function isVisitable(thing) { @@ -79364,24 +79641,16 @@ function toFormData(obj, formData, options) { throw new TypeError("target must be an object"); } formData = formData || new (FormData_default || FormData)(); - options = utils_default.toFlatObject( - options, - { - metaTokens: true, - dots: false, - indexes: false - }, - false, - function defined(option, source) { - return !utils_default.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_default.getSafeProp(options, name); + return utils_default.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_default.isSpecCompliantForm(formData); const stack = []; if (!utils_default.isFunction(visitor)) { @@ -79402,10 +79671,13 @@ function toFormData(obj, formData, options) { if (useBlob && typeof _Blob === "function") { return new _Blob([value]); } - if (typeof Buffer !== "undefined") { - return Buffer.from(value); + if (Buffer_default && Buffer_default.isBufferAvailable()) { + return Buffer_default.from(value); } - throw new AxiosError_default("Blob is not supported. Use a Buffer instead.", AxiosError_default.ERR_NOT_SUPPORT); + throw new AxiosError_default( + "Blob is not supported. Use a Buffer instead.", + AxiosError_default.ERR_NOT_SUPPORT + ); } return value; } @@ -79551,9 +79823,47 @@ function buildURL(url3, params, options) { } // node_modules/axios/lib/core/InterceptorManager.js +var $internals2 = /* @__PURE__ */ 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[$internals2] = { + handlersRef: this.handlers, + handlersLength: this.handlers.length, + handlerEntries: /* @__PURE__ */ new Map(), + iterationDepth: 0, + nextId: 0 + }; } /** * Add a new interceptor to the stack @@ -79565,13 +79875,25 @@ var InterceptorManager = class { * @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[$internals2]; + 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 @@ -79581,8 +79903,19 @@ var InterceptorManager = class { * @returns {void} */ eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; + const internals = this[$internals2]; + 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; + } } } /** @@ -79593,6 +79926,7 @@ var InterceptorManager = class { clear() { if (this.handlers) { this.handlers = []; + syncHandlerEntries(this, this[$internals2]); } } /** @@ -79606,11 +79940,22 @@ var InterceptorManager = class { * @returns {void} */ forEach(fn) { - utils_default.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); + const internals = this[$internals2]; + syncHandlerEntries(this, internals); + internals.iterationDepth++; + try { + utils_default.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 InterceptorManager_default = InterceptorManager; @@ -79712,7 +80057,7 @@ function throwIfDepthExceeded(index) { } function parsePropPath(name) { const path13 = []; - const pattern = /\w+|\[(\w*)]/g; + const pattern = /[^.[\]]+|\[([^.[\]]*)]/g; let match4; while ((match4 = pattern.exec(name)) !== null) { throwIfDepthExceeded(path13.length); @@ -79768,9 +80113,25 @@ function formDataToJSON(formData) { } var formDataToJSON_default = formDataToJSON; +// node_modules/axios/lib/core/methodList.js +var methodList = Object.freeze([ + "get", + "delete", + "head", + "options", + "post", + "put", + "patch", + "purge", + "link", + "unlink", + "query" +]); +var methodList_default = methodList; + // node_modules/axios/lib/defaults/index.js var own = (obj, key) => obj != null && utils_default.hasOwnProp(obj, key) ? obj[key] : void 0; -function stringifySafely(rawValue, parser, encoder) { +function stringifySafely2(rawValue, parser, encoder) { if (utils_default.isString(rawValue)) { try { (parser || JSON.parse)(rawValue); @@ -79826,7 +80187,7 @@ var defaults2 = { } if (isObjectPayload || hasJSONContentType) { headers.setContentType("application/json", false); - return stringifySafely(data); + return stringifySafely2(data); } return data; } @@ -79880,7 +80241,7 @@ var defaults2 = { } } }; -utils_default.forEach(["delete", "get", "head", "post", "put", "patch", "query"], (method) => { +utils_default.forEach(methodList_default, (method) => { defaults2.headers[method] = {}; }); var defaults_default = defaults2; @@ -79948,29 +80309,62 @@ function isAbsoluteURL(url3) { // node_modules/axios/lib/helpers/combineURLs.js 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(/^\/+/, ""); +} + +// node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +var urlParserControlCharacters = /[\t\n\r]/g; +function normalizeURLForProtocolCheck(url3) { + if (typeof url3 !== "string") { + return url3; + } + let start = 0; + while (start < url3.length && url3.charCodeAt(start) <= 32) { + start++; + } + return url3.slice(start).replace(urlParserControlCharacters, ""); } // node_modules/axios/lib/core/buildFullPath.js var malformedHttpProtocol = /^https?:(?!\/\/)/i; -var httpProtocolControlCharacters = /[\t\n\r]/g; -function stripLeadingC0ControlOrSpace(url3) { - let i = 0; - while (i < url3.length && url3.charCodeAt(i) <= 32) { - i++; +function redactFragment(fragment) { + if (!fragment) { + return fragment; } - return url3.slice(i); + return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, (match4, separator, parameterName = "") => { + return `${separator}${parameterName}${REDACTED}`; + }); } -function normalizeURLForProtocolCheck(url3) { - return stripLeadingC0ControlOrSpace(url3).replace(httpProtocolControlCharacters, ""); +function redactSensitiveURLParts(url3) { + const redactedURL = url3.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(url3, config) { - if (typeof url3 === "string" && malformedHttpProtocol.test(normalizeURLForProtocolCheck(url3))) { - throw new AxiosError_default( - 'Invalid URL: missing "//" after protocol', - AxiosError_default.ERR_INVALID_URL, - config - ); + if (typeof url3 === "string") { + const normalizedURL = normalizeURLForProtocolCheck(url3); + if (malformedHttpProtocol.test(normalizedURL)) { + throw new AxiosError_default( + `Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing "//" after protocol`, + AxiosError_default.ERR_INVALID_URL, + config + ); + } } } function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) { @@ -80055,13 +80449,13 @@ var import_https_proxy_agent2 = __toESM(require_dist4(), 1); var import_http = __toESM(require("http"), 1); var import_https = __toESM(require("https"), 1); var import_http22 = __toESM(require("http2"), 1); -var import_util19 = __toESM(require("util"), 1); +var import_util18 = __toESM(require("util"), 1); var import_path = require("path"); var import_follow_redirects = __toESM(require_follow_redirects(), 1); var import_zlib = __toESM(require("zlib"), 1); // node_modules/axios/lib/env/data.js -var VERSION = "1.18.1"; +var VERSION = "1.20.0"; // node_modules/axios/lib/helpers/parseProtocol.js function parseProtocol(url3) { @@ -80070,7 +80464,7 @@ function parseProtocol(url3) { } // node_modules/axios/lib/helpers/fromDataURI.js -var DATA_URL_PATTERN = /^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/; +var DATA_URL_PATTERN = /^([^,;/]+\/[^,;/]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/; function fromDataURI(uri, asBlob, options) { const _Blob = options && options.Blob || platform_default.classes.Blob; const protocol = parseProtocol(uri); @@ -80108,6 +80502,20 @@ function fromDataURI(uri, asBlob, options) { // node_modules/axios/lib/adapters/http.js var import_stream5 = __toESM(require("stream"), 1); +// node_modules/axios/lib/core/setFormDataHeaders.js +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); + } + }); +} + // node_modules/axios/lib/helpers/AxiosTransformStream.js var import_stream2 = __toESM(require("stream"), 1); var kInternals = /* @__PURE__ */ Symbol("internals"); @@ -80235,7 +80643,7 @@ var AxiosTransformStream_default = AxiosTransformStream; var import_events3 = require("events"); // node_modules/axios/lib/helpers/formDataToStream.js -var import_util17 = __toESM(require("util"), 1); +var import_util16 = __toESM(require("util"), 1); var import_stream3 = require("stream"); // node_modules/axios/lib/helpers/readBlob.js @@ -80255,7 +80663,7 @@ var readBlob_default = readBlob; // node_modules/axios/lib/helpers/formDataToStream.js var BOUNDARY_ALPHABET = platform_default.ALPHABET.ALPHA_DIGIT + "-_"; -var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new import_util17.default.TextEncoder(); +var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new import_util16.default.TextEncoder(); var CRLF = "\r\n"; var CRLF_BYTES = textEncoder.encode(CRLF); var CRLF_BYTES_COUNT = 2; @@ -80362,13 +80770,14 @@ var ZlibHeaderTransformStream_default = ZlibHeaderTransformStream; // node_modules/axios/lib/helpers/Http2Sessions.js var import_http2 = __toESM(require("http2"), 1); -var import_util18 = __toESM(require("util"), 1); +var import_util17 = __toESM(require("util"), 1); var Http2Sessions = class { constructor() { this.sessions = /* @__PURE__ */ Object.create(null); } getSession(authority, options) { options = Object.assign( + /* @__PURE__ */ Object.create(null), { sessionTimeout: 1e3 }, @@ -80379,7 +80788,7 @@ var Http2Sessions = class { let len = authoritySessions.length; for (let i = 0; i < len; i++) { const [sessionHandle, sessionOptions] = authoritySessions[i]; - if (!sessionHandle.destroyed && !sessionHandle.closed && import_util18.default.isDeepStrictEqual(sessionOptions, options)) { + if (!sessionHandle.destroyed && !sessionHandle.closed && import_util17.default.isDeepStrictEqual(sessionOptions, options)) { return sessionHandle; } } @@ -80434,6 +80843,7 @@ var Http2Sessions = class { }; } session.once("close", removeSession); + session.once("error", removeSession); let entry = [session, options]; authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry]; return session; @@ -80458,12 +80868,73 @@ var callbackify_default = callbackify; // node_modules/axios/lib/helpers/shouldBypassProxy.js 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; @@ -80548,6 +81019,40 @@ var unmapIPv4MappedIPv6 = (host) => { } 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; @@ -80555,7 +81060,89 @@ var normalizeNoProxyHost = (hostname) => { 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 match4 = CIDR_ENTRY_RE.exec(entry); + if (!match4) { + return null; + } + let prefix2 = Number(match4[2]); + const parsedBase = normalizeCidrBase(match4[1]); + if (!parsedBase) { + return null; + } + const { normalized, wasIPv6 } = parsedBase; + if (wasIPv6 && normalized.indexOf(":") === -1) { + if (prefix2 < 96) { + return null; + } + prefix2 -= 96; + } + const bytes = ipToBytes(normalized); + if (!bytes || prefix2 > bytes.length * 8) { + return null; + } + return { bytes, prefix: prefix2 }; +}; +var isInSubnet = (addressBytes, networkBytes, prefix2) => { + const fullBytes = prefix2 >> 3; + for (let i = 0; i < fullBytes; i++) { + if (addressBytes[i] !== networkBytes[i]) { + return false; + } + } + const remainingBits = prefix2 & 7; + if (remainingBits) { + const mask = 255 << 8 - remainingBits & 255; + if ((addressBytes[fullBytes] & mask) !== (networkBytes[fullBytes] & mask)) { + return false; + } + } + return true; }; function shouldBypassProxy(location) { let parsed; @@ -80573,10 +81160,18 @@ function shouldBypassProxy(location) { } const port = Number.parseInt(parsed.port, 10) || DEFAULT_PORTS2[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) { @@ -80662,7 +81257,8 @@ function throttle(fn, freq) { } }; const flush = () => lastArgs && invoke(lastArgs); - return [throttled, flush]; + const flushWith = (...args) => invoke(args); + return [throttled, flush, flushWith]; } var throttle_default = throttle; @@ -80671,12 +81267,12 @@ var progressEventReducer = (listener, isDownloadStream, freq = 3) => { let bytesNotified = 0; const _speedometer = speedometer_default(50, 250); return throttle_default((e) => { - if (!e || typeof e.loaded !== "number") { + if (!e || !utils_default.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); @@ -80705,12 +81301,66 @@ var progressEventDecorator = (total, throttled) => { throttled[1] ]; }; -var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args)); +var asyncDecorator = (fn, scheduler = utils_default.asap) => (...args) => scheduler(() => fn(...args)); // node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js 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(url3) { +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 = (body2) => { + const len = body2.length; + let padding = 0; + if (len > 0 && body2.charCodeAt(len - 1) === 61) { + padding++; + if (len > 1 && body2.charCodeAt(len - 2) === 61) { + padding++; + } + } + return Math.floor((len - padding) * 3 / 4); +}; +var estimatePercentDecodedBase64Bytes = (body2) => { + const len = body2.length; + let significant = 0; + let padding = 0; + let invalid = false; + for (let i = 0; i < len; i++) { + let code = body2.charCodeAt(i); + if (code === 37 && isPercentEncodedByte(body2, i, len)) { + code = hexValue(body2.charCodeAt(i + 1)) * 16 + hexValue(body2.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(body2); + } + return base64Bytes(significant); +}; +var estimateDataURLBytes = (url3, estimateBase64) => { if (!url3 || typeof url3 !== "string") return 0; if (!url3.startsWith("data:")) return 0; const comma = url3.indexOf(","); @@ -80719,43 +81369,7 @@ function estimateDataURLDecodedBytes(url3) { const body2 = url3.slice(comma + 1); const isBase64 = /;base64/i.test(meta); if (isBase64) { - let effectiveLen = body2.length; - const len = body2.length; - for (let i = 0; i < len; i++) { - if (body2.charCodeAt(i) === 37 && i + 2 < len) { - const a = body2.charCodeAt(i + 1); - const b = body2.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 && body2.charCodeAt(j - 2) === 37 && // '%' - body2.charCodeAt(j - 1) === 51 && // '3' - (body2.charCodeAt(j) === 68 || body2.charCodeAt(j) === 100); - if (idx >= 0) { - if (body2.charCodeAt(idx) === 61) { - pad++; - idx--; - } else if (tailIsPct3D(idx)) { - pad++; - idx -= 3; - } - } - if (pad === 1 && idx >= 0) { - if (body2.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(body2); } let bytes = 0; for (let i = 0, len = body2.length; i < len; i++) { @@ -80780,6 +81394,16 @@ function estimateDataURLDecodedBytes(url3) { } } return bytes; +}; +function estimateDataURLDecodedBytes(url3) { + const fragmentIndex = typeof url3 === "string" ? url3.indexOf("#") : -1; + return estimateDataURLBytes( + fragmentIndex === -1 ? url3 : url3.slice(0, fragmentIndex), + estimatePercentDecodedBase64Bytes + ); +} +function estimateDataURLBufferAllocation(url3) { + return estimateDataURLBytes(url3, estimateBase64BufferAllocation); } // node_modules/axios/lib/adapters/http.js @@ -80799,22 +81423,17 @@ var isBrotliSupported = utils_default.isFunction(import_zlib.default.createBrotl var isZstdSupported = utils_default.isFunction(import_zlib.default.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_default.asap; var { http: httpFollow, https: httpsFollow } = import_follow_redirects.default; var isHttps = /https:?/; -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 kAxiosSocketListener = /* @__PURE__ */ Symbol("axios.http.socketListener"); var kAxiosCurrentReq = /* @__PURE__ */ Symbol("axios.http.currentReq"); +function handleSocketError(err) { + const current = this[kAxiosCurrentReq]; + if (current && !current.destroyed) { + current.destroy(err); + } +} var kAxiosInstalledTunnel = /* @__PURE__ */ Symbol("axios.http.installedTunnel"); var tunnelingAgentCache = /* @__PURE__ */ new Map(); var tunnelingAgentCacheUser = /* @__PURE__ */ new WeakMap(); @@ -80917,10 +81536,10 @@ function isSameOriginRedirect(redirectOptions, requestDetails) { return false; } } -function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent) { +function setProxy(options, configProxy, location, 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(location); if (proxyUrl) { if (!shouldBypassProxy(location)) { @@ -81017,9 +81636,13 @@ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, redirectOptions.href, true, configHttpsAgent, - configHttpAgent + configHttpAgent, + allowEnvProxy ); }; + return Boolean( + proxy || configProxy !== false && allowEnvProxy && isNodeEnvProxyEnabled(proxyEnvAgent) + ); } var isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process"; var wrapAsync = (asyncExecutor) => { @@ -81044,7 +81667,7 @@ var wrapAsync = (asyncExecutor) => { }; var resolveFamily = ({ address, family }) => { if (!utils_default.isString(address)) { - throw TypeError("address must be a string"); + throw new AxiosError_default("address must be a string", AxiosError_default.ERR_BAD_OPTION_VALUE); } return { address, @@ -81052,6 +81675,30 @@ var resolveFamily = ({ address, family }) => { }; }; var buildAddressEntry = (address, family) => resolveFamily(utils_default.isObject(address) ? address : { address, family }); +var normalizedLookupCache = /* @__PURE__ */ new WeakMap(); +var normalizeLookup = (lookup) => { + let normalized = normalizedLookupCache.get(lookup); + if (normalized) { + return normalized; + } + const callbackLookup = callbackify_default(lookup, (value) => utils_default.isArray(value) ? value : [value]); + normalized = (hostname, opt, cb) => { + callbackLookup(hostname, opt, (err, arg0, arg1) => { + if (err) { + return cb(err); + } + let addresses; + try { + addresses = utils_default.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)); @@ -81088,6 +81735,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { 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"); @@ -81104,25 +81752,32 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { let rejected = false; let req; let connectPhaseTimer; - httpVersion = +httpVersion; + try { + httpVersion = +httpVersion; + } catch (err) { + throw new AxiosError_default( + "Invalid protocol version: value is not a number", + AxiosError_default.ERR_BAD_OPTION_VALUE, + config + ); + } if (Number.isNaN(httpVersion)) { - throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`); + throw new AxiosError_default( + `Invalid protocol version: '${rawHttpVersion}' is not a number`, + AxiosError_default.ERR_BAD_OPTION_VALUE, + config + ); } if (httpVersion !== 1 && httpVersion !== 2) { - throw TypeError(`Unsupported protocol version '${httpVersion}'`); + throw new AxiosError_default( + `Unsupported protocol version '${httpVersion}'`, + AxiosError_default.ERR_BAD_OPTION_VALUE, + config + ); } const isHttp2 = httpVersion === 2; if (lookup) { - const _lookup = callbackify_default(lookup, (value) => utils_default.isArray(value) ? value : [value]); - lookup = (hostname, opt, cb) => { - _lookup(hostname, opt, (err, arg0, arg1) => { - if (err) { - return cb(err); - } - const addresses = utils_default.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 import_events3.EventEmitter(); function abort(reason) { @@ -81196,7 +81851,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { 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_default( @@ -81266,7 +81921,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { setFormDataHeaders(headers, data.getHeaders(), own2("formDataHeaderPolicy")); if (!headers.hasContentLength()) { try { - const knownLength = await import_util19.default.promisify(data.getLength).call(data); + const knownLength = await import_util18.default.promisify(data.getLength).call(data); Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength); } catch (e) { } @@ -81327,7 +81982,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { data, progressEventDecorator( contentLength2, - progressEventReducer(asyncDecorator(onUploadProgress), false, 3) + progressEventReducer(asyncDecorator(onUploadProgress, scheduleProgress), false, 3) ) ) ); @@ -81365,6 +82020,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { utils_default.hasOwnProp(transitional2, "advertiseZstdAcceptEncoding") && transitional2.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: path13, method, @@ -81375,9 +82033,11 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { family, beforeRedirect: dispatchBeforeRedirect, beforeRedirects: /* @__PURE__ */ Object.create(null), - http2Options + http2Options, + createConnection: void 0 }); !utils_default.isUndefined(lookup) && (options.lookup = lookup); + let proxyApplied = false; if (socketPath) { if (typeof socketPath !== "string") { return reject( @@ -81405,13 +82065,17 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { } else { options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname; options.port = parsed.port; - setProxy( + proxyApplied = setProxy( options, configProxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path, false, httpsAgent, - httpAgent + 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; @@ -81422,6 +82086,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { options.agent = isHttpsRequest ? httpsAgent : httpAgent; } if (isHttp2) { + if (proxyApplied) { + return reject( + new AxiosError_default( + "HTTP/2 requests with a proxy are not supported", + AxiosError_default.ERR_NOT_SUPPORT, + config + ) + ); + } transport = http2Transport; } else { const configTransport = own2("transport"); @@ -81509,7 +82182,11 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { transformStream, progressEventDecorator( responseLength, - progressEventReducer(asyncDecorator(onDownloadProgress), true, 3) + progressEventReducer( + asyncDecorator(onDownloadProgress, scheduleProgress), + true, + 3 + ) ) ) ); @@ -81658,12 +82335,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { 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; @@ -81823,6 +82495,16 @@ var cookies_default = platform_default.hasStandardBrowserEnv ? ( // node_modules/axios/lib/core/mergeConfig.js var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...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 || {}; @@ -81898,7 +82580,7 @@ function mergeConfig(config1, config2) { transformResponse: defaultToConfig2, paramsSerializer: defaultToConfig2, timeout: defaultToConfig2, - timeoutMessage: defaultToConfig2, + timeoutErrorMessage: defaultToConfig2, withCredentials: defaultToConfig2, withXSRFToken: defaultToConfig2, adapter: defaultToConfig2, @@ -81921,7 +82603,7 @@ function mergeConfig(config1, config2) { validateStatus: mergeDirectKeys, headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) }; - utils_default.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) { + utils_default.forEach(ownEnumerableKeys({ ...config1, ...config2 }), function computeConfigValue(prop) { if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return; const merge2 = utils_default.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties; const a = utils_default.hasOwnProp(config1, prop) ? config1[prop] : void 0; @@ -81940,18 +82622,6 @@ function mergeConfig(config1, config2) { } // node_modules/axios/lib/helpers/resolveConfig.js -var FORM_DATA_CONTENT_HEADERS2 = ["content-type", "content-length"]; -function setFormDataHeaders2(headers, formHeaders, policy) { - if (policy !== "content-only") { - headers.set(formHeaders); - return; - } - Object.entries(formHeaders || {}).forEach(([key, val]) => { - if (FORM_DATA_CONTENT_HEADERS2.includes(key.toLowerCase())) { - headers.set(key, val); - } - }); -} var encodeUTF8 = (str) => encodeURIComponent(str).replace( /%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)) @@ -81987,10 +82657,11 @@ function resolveConfig(config) { } } if (utils_default.isFormData(data)) { + const getHeaders = utils_default.getSafeProp(data, "getHeaders"); if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv || utils_default.isReactNative(data)) { headers.setContentType(void 0); - } else if (utils_default.isFunction(data.getHeaders)) { - setFormDataHeaders2(headers, data.getHeaders(), own2("formDataHeaderPolicy")); + } else if (utils_default.isFunction(getHeaders)) { + setFormDataHeaders(headers, getHeaders.call(data), own2("formDataHeaderPolicy")); } } if (platform_default.hasStandardBrowserEnv) { @@ -82019,7 +82690,7 @@ var xhr_default = isXHRAdapterSupported && function(config) { let { responseType, onUploadProgress, onDownloadProgress } = _config; let onCanceled; let uploadThrottled, downloadThrottled; - let flushUpload, flushDownload; + let flushUpload, flushDownload, flushDownloadWithEvent; function done() { flushUpload && flushUpload(); flushDownload && flushDownload(); @@ -82029,7 +82700,27 @@ var xhr_default = isXHRAdapterSupported && function(config) { 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(platform_default.origin)) !== "file" && !(request.responseURL && request.responseURL.startsWith("file:"))) { + reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request)); + done(); + request = null; + return; + } + try { + if (event) { + flushDownloadWithEvent && flushDownloadWithEvent(event); + } else { + flushDownload && flushDownload(); + } + } catch (err) { + setTimeout(() => { + throw err; + }); + } if (!request) { return; } @@ -82117,7 +82808,10 @@ var xhr_default = isXHRAdapterSupported && function(config) { 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) { @@ -82189,7 +82883,16 @@ var composeSignals = (signals, timeout) => { }); 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; signal.unsubscribe = () => utils_default.asap(unsubscribe); return signal; @@ -82278,6 +82981,17 @@ var trackStream = (stream4, chunkSize, onProgress, onFinish) => { // node_modules/axios/lib/adapters/fetch.js 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: isFunction2 } = utils_default; var encodeUTF82 = (str) => encodeURIComponent(str).replace( /%([0-9A-F]{2})/gi, @@ -82408,7 +83122,8 @@ var factory = (env) => { withCredentials = "same-origin", fetchOptions, maxContentLength, - maxBodyLength + maxBodyLength, + maxRedirects } = resolveConfig_default(config); const hasMaxContentLength = utils_default.isNumber(maxContentLength) && maxContentLength > -1; const hasMaxBodyLength = utils_default.isNumber(maxBodyLength) && maxBodyLength > -1; @@ -82538,17 +83253,44 @@ var factory = (env) => { } } 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_default.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(url3, resolvedOptions); - let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url3, resolvedOptions)); + let response = await (isRequestSupported ? _fetch(request, safeFetchOptions) : _fetch(url3, resolvedOptions)); const responseHeaders = AxiosHeaders_default.from(response.headers); if (hasMaxContentLength) { const declaredLength = utils_default.toFiniteNumber(responseHeaders.getContentLength()); @@ -82767,9 +83509,10 @@ function throwIfCancellationRequested(config) { throw new CanceledError_default(null, config); } } -function dispatchRequest(config) { +function dispatchRequest(_config) { + const config = utils_default.toSafeFlatObject(_config); throwIfCancellationRequested(config); - config.headers = AxiosHeaders_default.from(config.headers); + config.headers = AxiosHeaders_default.from(utils_default.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); @@ -82899,16 +83642,15 @@ var Axios = class { 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) { @@ -82978,9 +83720,9 @@ var Axios = class { }, true ); - config.method = (config.method || this.defaults.method || "get").toLowerCase(); + config.method = (utils_default.getSafeProp(config, "method") || utils_default.getSafeProp(this.defaults, "method") || "get").toLowerCase(); let contextHeaders = headers && utils_default.merge(headers.common, headers[config.method]); - headers && utils_default.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], (method) => { + headers && utils_default.forEach(methodList_default.concat("common"), (method) => { delete headers[method]; }); config.headers = AxiosHeaders_default.concat(contextHeaders, headers); @@ -83023,16 +83765,31 @@ var Axios = class { 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_default.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; @@ -83228,14 +83985,22 @@ var HttpStatusCode = { 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, @@ -83255,6 +84020,7 @@ var HttpStatusCode = { LoopDetected: 508, NotExtended: 510, NetworkAuthenticationRequired: 511, + WebServerReturnsAnUnknownError: 520, WebServerIsDown: 521, ConnectionTimedOut: 522, OriginIsUnreachable: 523, @@ -83263,7 +84029,9 @@ var HttpStatusCode = { InvalidSslCertificate: 526 }; Object.entries(HttpStatusCode).forEach(([key, value]) => { - HttpStatusCode[value] = key; + if (HttpStatusCode[value] === void 0) { + HttpStatusCode[value] = key; + } }); var HttpStatusCode_default = HttpStatusCode; @@ -83520,11 +84288,11 @@ mime-types/index.js: * MIT Licensed *) -smol-toml/dist/date.js: smol-toml/dist/error.js: smol-toml/dist/primitive.js: -smol-toml/dist/util.js: +smol-toml/dist/date.js: smol-toml/dist/extract.js: +smol-toml/dist/util.js: smol-toml/dist/struct.js: smol-toml/dist/parse.js: smol-toml/dist/stringify.js: diff --git a/dist/setup/index.cjs b/dist/setup/index.cjs index a22f64f..e5108b6 100644 --- a/dist/setup/index.cjs +++ b/dist/setup/index.cjs @@ -45803,7 +45803,7 @@ var require_cache2 = __commonJS({ var MAX_DELTA_SECONDS = 2147483647; var RESTRICTIVE_DIRECTIVE_NAMES = ["no-store", "private", "no-cache"]; var kInvalidCacheControlDirectives = /* @__PURE__ */ Symbol("invalid cache-control directives"); - function trimOWS(value) { + function trimOWS2(value) { return value.replace(/^[\t ]+|[\t ]+$/g, ""); } function arrayIncludes(array, value) { @@ -46055,10 +46055,10 @@ var require_cache2 = __commonJS({ const rawValue = directive.substring(keyValueDelimiter + 1); keyHasTrailingWhitespace = trimOWSEnd(rawKey) !== rawKey; valueHasLeadingWhitespace = trimOWSStart(rawValue) !== rawValue; - key = trimOWS(rawKey); + key = trimOWS2(rawKey); value = trimOWSStart(rawValue); } else { - key = trimOWS(directive); + key = trimOWS2(directive); } const malformedRestrictiveDirectiveName = getMalformedRestrictiveDirectiveName(key); if (malformedRestrictiveDirectiveName !== void 0) { @@ -46123,7 +46123,7 @@ var require_cache2 = __commonJS({ } else { const fieldListParts = [value.substring(1)]; for (let j = i + 1; j < directives.length; j++) { - const nextPart = trimOWS(directives[j].value); + const nextPart = trimOWS2(directives[j].value); const closingQuote2 = findUnescapedQuote(nextPart, 0); lastQuotedPart = j; if (closingQuote2 !== -1) { @@ -46143,7 +46143,7 @@ var require_cache2 = __commonJS({ const headers = fieldList.split(","); let validFieldNames = true; for (let j = 0; j < headers.length; j++) { - headers[j] = trimOWS(headers[j]); + headers[j] = trimOWS2(headers[j]); if (!isValidHTTPToken(headers[j])) { validFieldNames = false; } @@ -46158,7 +46158,7 @@ var require_cache2 = __commonJS({ } } } else { - const fieldName = trimOWS(value); + const fieldName = trimOWS2(value); if (!isValidHTTPToken(fieldName)) { output[key] = true; } else if (output[key] !== true) { @@ -46213,7 +46213,7 @@ var require_cache2 = __commonJS({ function hasVaryStar(varyHeader) { const values = splitVaryHeader(varyHeader); for (let i = 0; i < values.length; i++) { - if (trimOWS(values[i]).indexOf("*") !== -1) { + if (trimOWS2(values[i]).indexOf("*") !== -1) { return true; } } @@ -46229,7 +46229,7 @@ var require_cache2 = __commonJS({ ); const varyingHeaders = splitVaryHeader(varyHeader); for (const header of varyingHeaders) { - const trimmedHeader = trimOWS(header).toLowerCase(); + const trimmedHeader = trimOWS2(header).toLowerCase(); if (trimmedHeader.length === 0) { continue; } @@ -46845,7 +46845,7 @@ var require_cache_handler = __commonJS({ ]; var MAX_RESPONSE_AGE = 2147483647e3; var REVALIDATION_ONLY_RETENTION = 864e5; - function trimOWS(value) { + function trimOWS2(value) { return value.replace(/^[\t ]+|[\t ]+$/g, ""); } function arrayIncludes(array, value) { @@ -46861,7 +46861,7 @@ var require_cache_handler = __commonJS({ for (let i = 0; i < values.length; i++) { const tokens = values[i].split(","); for (let j = 0; j < tokens.length; j++) { - headersToRemove.push(trimOWS(tokens[j]).toLowerCase()); + headersToRemove.push(trimOWS2(tokens[j]).toLowerCase()); } } } @@ -47669,7 +47669,7 @@ var require_cache3 = __commonJS({ } var nop = () => { }; - function trimOWS(value) { + function trimOWS2(value) { return value.replace(/^[\t ]+|[\t ]+$/g, ""); } function arrayIncludes(array, value) { @@ -47693,7 +47693,7 @@ var require_cache3 = __commonJS({ } const directives = value.split(","); for (let j = 0; j < directives.length; j++) { - if (trimOWS(directives[j]).toLowerCase() === "no-cache") { + if (trimOWS2(directives[j]).toLowerCase() === "no-cache") { return true; } } @@ -114047,105 +114047,13 @@ var import_node_fs6 = __toESM(require("node:fs"), 1); // src/utils/config-file.ts var import_node_fs3 = __toESM(require("node:fs"), 1); -// node_modules/smol-toml/dist/date.js -var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i; -var TomlDate = class _TomlDate extends Date { - #hasDate = false; - #hasTime = false; - #offset = null; - constructor(date) { - let hasDate = true; - let hasTime = true; - let offset = "Z"; - if (typeof date === "string") { - let match4 = date.match(DATE_TIME_RE); - if (match4) { - if (!match4[1]) { - hasDate = false; - date = `0000-01-01T${date}`; - } - hasTime = !!match4[2]; - hasTime && date[10] === " " && (date = date.replace(" ", "T")); - if (match4[2] && +match4[2] > 23) { - date = ""; - } else { - offset = match4[3] || null; - date = date.toUpperCase(); - if (!offset && hasTime) - date += "Z"; - } - } else { - date = ""; - } - } - super(date); - if (!isNaN(this.getTime())) { - this.#hasDate = hasDate; - this.#hasTime = hasTime; - this.#offset = offset; - } - } - isDateTime() { - return this.#hasDate && this.#hasTime; - } - isLocal() { - return !this.#hasDate || !this.#hasTime || !this.#offset; - } - isDate() { - return this.#hasDate && !this.#hasTime; - } - isTime() { - return this.#hasTime && !this.#hasDate; - } - isValid() { - return this.#hasDate || this.#hasTime; - } - toISOString() { - let iso = super.toISOString(); - if (this.isDate()) - return iso.slice(0, 10); - if (this.isTime()) - return iso.slice(11, 23); - if (this.#offset === null) - return iso.slice(0, -1); - if (this.#offset === "Z") - return iso; - let offset = +this.#offset.slice(1, 3) * 60 + +this.#offset.slice(4, 6); - offset = this.#offset[0] === "-" ? offset : -offset; - let offsetDate = new Date(this.getTime() - offset * 6e4); - return offsetDate.toISOString().slice(0, -1) + this.#offset; - } - static wrapAsOffsetDateTime(jsDate, offset = "Z") { - let date = new _TomlDate(jsDate); - date.#offset = offset; - return date; - } - static wrapAsLocalDateTime(jsDate) { - let date = new _TomlDate(jsDate); - date.#offset = null; - return date; - } - static wrapAsLocalDate(jsDate) { - let date = new _TomlDate(jsDate); - date.#hasTime = false; - date.#offset = null; - return date; - } - static wrapAsLocalTime(jsDate) { - let date = new _TomlDate(jsDate); - date.#hasDate = false; - date.#offset = null; - return date; - } -}; - // node_modules/smol-toml/dist/error.js function getLineColFromPtr(string, ptr) { - let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g); + let lines = string.slice(0, ptr).split(/\r?\n/); return [lines.length, lines.pop().length + 1]; } function makeCodeBlock(string, line, column) { - let lines = string.split(/\r\n|\n|\r/g); + let lines = string.split(/\r?\n/); let codeblock = ""; let numberLen = (Math.log10(line + 1) | 0) + 1; for (let i = line - 1; i <= line + 1; i++) { @@ -114163,7 +114071,7 @@ function makeCodeBlock(string, line, column) { } return codeblock; } -var TomlError = class extends Error { +var TomlError = class _TomlError extends Error { line; column; codeblock; @@ -114177,59 +114085,59 @@ ${codeblock}`, options); this.column = column; this.codeblock = codeblock; } + /** @internal */ + static x(message, ctx, ptr) { + throw new _TomlError(message, { toml: ctx.s, ptr: ptr ?? ctx.p }); + } }; // node_modules/smol-toml/dist/primitive.js -var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/; -var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/; -var LEADING_ZERO = /^[+-]?0[0-9_]/; -function parseString(str, ptr) { - let c = str[ptr++]; +function parseString(ctx) { + let startPtr = ctx.p; + let c = ctx.s.charCodeAt(ctx.p++); let first = c; - let isLiteral = c === "'"; - let isMultiline = c === str[ptr] && c === str[ptr + 1]; + let isLiteral = c === 39; + let isMultiline = c === ctx.s.charCodeAt(ctx.p) && c === ctx.s.charCodeAt(ctx.p + 1); if (isMultiline) { - if (str[ptr += 2] === "\n") - ptr++; - else if (str[ptr] === "\r" && str[ptr + 1] === "\n") - ptr += 2; + if ((c = ctx.s.charCodeAt(ctx.p += 2)) === 10) + ctx.p++; + else if (c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) + ctx.p += 2; } let parsed = ""; - let sliceStart = ptr; + let sliceStart = ctx.p; let state3 = 0; - for (let i = ptr; i < str.length; i++) { - c = str[i]; - if (isMultiline && (c === "\n" || c === "\r" && str[i + 1] === "\n")) { + for (; ctx.p < ctx.s.length; ctx.p++) { + c = ctx.s.charCodeAt(ctx.p); + if (isMultiline && (c === 10 || c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)) { state3 = state3 && 3; - } else if (c < " " && c !== " " || c === "\x7F") { - throw new TomlError("control characters are not allowed in strings", { - toml: str, - ptr: i - }); - } else if ((!state3 || state3 === 3) && c === first && (!isMultiline || str[i + 1] === first && str[i + 2] === first)) { + } else if (c < 32 && c !== 9 || c === 127) { + TomlError.x("control characters are not allowed in strings", ctx); + } else if ((!state3 || state3 === 3) && c === first && (!isMultiline || ctx.s.charCodeAt(ctx.p + 1) === first && ctx.s.charCodeAt(ctx.p + 2) === first)) { if (isMultiline) { - if (str[i + 3] === first) - i++; - if (str[i + 3] === first) - i++; + if (ctx.s.charCodeAt(ctx.p + 3) === first) + ctx.p++; + if (ctx.s.charCodeAt(ctx.p + 3) === first) + ctx.p++; } - return [ - // If we're in a newline escape still, then there's nothing to add. - // Also try to avoid concat if there's nothing to add to parsed, or nothing has been added to parsed. - state3 ? parsed : parsed + str.slice(sliceStart, i), - i + (isMultiline ? 3 : 1) - ]; + if (!state3) { + let s = ctx.s.slice(sliceStart, ctx.p); + parsed = parsed ? parsed + s : s; + } + ctx.p += isMultiline ? 3 : 1; + return parsed; } else if (!state3) { - if (!isLiteral && c === "\\") { - parsed += str.slice(sliceStart, sliceStart = i); + if (!isLiteral && c === 92) { + parsed += ctx.s.slice(sliceStart, sliceStart = ctx.p); state3 = 1; } } else if (state3 === 1) { - if (c === "x" || c === "u" || c === "U") { + if (c === 120 || c === 117 || c === 85) { + let errPtr = ctx.p++ - 1; let value = 0; - let len = c === "x" ? 2 : c === "u" ? 4 : 8; - for (let j = 0; j < len; j++, i++) { - let hex = str.charCodeAt(i + 1); + let len = c === 120 ? 2 : c === 117 ? 4 : 8; + for (let j = 0; j < len; j++, ctx.p++) { + let hex = ctx.s.charCodeAt(ctx.p); let digit = ( /* 0-9 */ hex >= 48 && hex <= 57 ? hex - 48 : ( @@ -114241,371 +114149,517 @@ function parseString(str, ptr) { ) ); if (digit < 0) - throw new TomlError("invalid non-hex character in unicode escape", { toml: str, ptr: i + 1 }); + TomlError.x("invalid non-hex character in unicode escape", ctx); value = value << 4 | digit; } if (value < 0 || value > 1114111 || value >= 55296 && value <= 57343) { - throw new TomlError("invalid unicode escape", { toml: str, ptr: i }); + TomlError.x("invalid unicode escape", ctx, errPtr); } parsed += String.fromCodePoint(value); - sliceStart = i + 1; + sliceStart = ctx.p--; state3 = 0; - } else if (c === " " || c === " ") { + } else if (isMultiline && (c === 32 || c === 9)) { state3 = 2; } else { - if (c === "b") + if (c === 98) parsed += "\b"; - else if (c === "t") + else if (c === 116) parsed += " "; - else if (c === "n") + else if (c === 110) parsed += "\n"; - else if (c === "f") + else if (c === 102) parsed += "\f"; - else if (c === "r") + else if (c === 114) parsed += "\r"; - else if (c === "e") + else if (c === 101) parsed += "\x1B"; - else if (c === '"') + else if (c === 34) parsed += '"'; - else if (c === "\\") + else if (c === 92) parsed += "\\"; else - throw new TomlError("unrecognized escape sequence", { toml: str, ptr: i }); - sliceStart = i + 1; + TomlError.x("unrecognised escape sequence", ctx); + sliceStart = ctx.p + 1; state3 = 0; } - } else if (c !== " " && c !== " ") { - if (state3 === 2) { - throw new TomlError("invalid escape: only line-ending whitespace may be escaped", { - toml: str, - ptr: sliceStart - }); - } - state3 = !isLiteral && c === "\\" ? 1 : 0; - sliceStart = i; + } else if (c !== 32 && c !== 9) { + if (state3 === 2) + TomlError.x("invalid escape: only line-ending whitespace may be escaped", ctx, sliceStart); + state3 = !isLiteral && c === 92 ? 1 : 0; + sliceStart = ctx.p; } } - throw new TomlError("unfinished string", { toml: str, ptr }); + TomlError.x("unfinished string", ctx, startPtr); } -function parseValue2(value, toml, ptr, integersAsBigInt) { - if (value === "true") - return true; - if (value === "false") - return false; - if (value === "-inf") - return -Infinity; - if (value === "inf" || value === "+inf") - return Infinity; - if (value === "nan" || value === "+nan" || value === "-nan") - return NaN; - if (value === "-0") - return integersAsBigInt ? 0n : 0; - let isInt = INT_REGEX.test(value); - if (isInt || FLOAT_REGEX.test(value)) { - if (LEADING_ZERO.test(value)) { - throw new TomlError("leading zeroes are not allowed", { - toml, - ptr - }); - } - value = value.replace(/_/g, ""); - let numeric2 = +value; - if (isNaN(numeric2)) { - throw new TomlError("invalid number", { - toml, - ptr - }); - } - if (isInt) { - if ((isInt = !Number.isSafeInteger(numeric2)) && !integersAsBigInt) { - throw new TomlError("integer value cannot be represented losslessly", { - toml, - ptr - }); + +// node_modules/smol-toml/dist/date.js +var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z|[-+]\d{2}:\d{2})?$/i; +var TomlDate = class _TomlDate extends Date { + #hasDate = false; + #hasTime = false; + #offset = null; + constructor(date, fasttype, unsafeDelim) { + let hasDate = true; + let hasTime = true; + let offset = "Z"; + let c; + if (typeof date === "string") { + if (fasttype) + prep: { + if (fasttype < 3) { + if (+date.slice(11, 13) > 23) { + date = ""; + break prep; + } + if (fasttype === 2) { + offset = null; + date += "Z"; + } else if ((c = date.charCodeAt(date.length - 1)) !== 90 && c !== 122) { + offset = date.slice(date.length - 6); + } + if (unsafeDelim) + date = date.slice(0, 10) + "T" + date.slice(11); + } else if (fasttype === 4) { + date = +date.slice(0, 2) > 23 ? "" : `0000-01-01T${date}Z`; + } + hasDate = fasttype !== 4; + hasTime = fasttype !== 3; + } + else { + let match4 = date.match(DATE_TIME_RE); + if (match4) { + if (!match4[1]) { + hasDate = false; + date = `0000-01-01T${date}`; + } + hasTime = !!match4[2]; + hasTime && date[10] === " " && (date = date.replace(" ", "T")); + if (match4[2] && +match4[2] > 23) { + date = ""; + } else { + offset = match4[3] || null; + if (!offset && hasTime) + date += "Z"; + } + } else { + date = ""; + } } - if (isInt || integersAsBigInt === true) - numeric2 = BigInt(value); } - return numeric2; + super(date); + if (!isNaN(this.getTime())) { + this.#hasDate = hasDate; + this.#hasTime = hasTime; + this.#offset = offset; + } } - const date = new TomlDate(value); - if (!date.isValid()) { - throw new TomlError("invalid value", { - toml, - ptr - }); + isDateTime() { + return this.#hasDate && this.#hasTime; } - return date; -} - -// node_modules/smol-toml/dist/util.js -function indexOfNewline(str, start = 0, end = str.length) { - let idx = str.indexOf("\n", start); - if (str[idx - 1] === "\r") - idx--; - return idx <= end ? idx : -1; -} -function skipComment(str, ptr) { - for (let i = ptr; i < str.length; i++) { - let c = str[i]; - if (c === "\n") - return i; - if (c === "\r" && str[i + 1] === "\n") - return i + 1; - if (c < " " && c !== " " || c === "\x7F") { - throw new TomlError("control characters are not allowed in comments", { - toml: str, - ptr - }); - } + isLocal() { + return !this.#hasDate || !this.#hasTime || !this.#offset; } - return str.length; -} -function skipVoid(str, ptr, banNewLines, banComments) { - let c; - while (1) { - while ((c = str[ptr]) === " " || c === " " || !banNewLines && (c === "\n" || c === "\r" && str[ptr + 1] === "\n")) - ptr++; - if (banComments || c !== "#") - break; - ptr = skipComment(str, ptr); + isDate() { + return this.#hasDate && !this.#hasTime; } - return ptr; -} -function skipUntil(str, ptr, sep10, end, banNewLines = false) { - if (!end) { - ptr = indexOfNewline(str, ptr); - return ptr < 0 ? str.length : ptr; + isTime() { + return this.#hasTime && !this.#hasDate; } - for (let i = ptr; i < str.length; i++) { - let c = str[i]; - if (c === "#") { - i = indexOfNewline(str, i); - if (i < 0) - break; - } else if (c === sep10) { - return i + 1; - } else if (c === end || banNewLines && (c === "\n" || c === "\r" && str[i + 1] === "\n")) { - return i; - } + isValid() { + return this.#hasDate || this.#hasTime; } - throw new TomlError("cannot find end of structure", { - toml: str, - ptr - }); -} + toISOString() { + let iso = super.toISOString(); + if (this.isDate()) + return iso.slice(0, 10); + if (this.isTime()) + return iso.slice(11, 23); + if (this.#offset === null) + return iso.slice(0, -1); + if (this.#offset === "Z" || this.#offset === "z") + return iso; + let offset = +this.#offset.slice(1, 3) * 60 + +this.#offset.slice(4, 6); + offset = this.#offset[0] === "-" ? offset : -offset; + let offsetDate = new Date(this.getTime() - offset * 6e4); + return offsetDate.toISOString().slice(0, -1) + this.#offset; + } + static wrapAsOffsetDateTime(jsDate, offset = "Z") { + let date = new _TomlDate(jsDate); + date.#offset = offset; + return date; + } + static wrapAsLocalDateTime(jsDate) { + let date = new _TomlDate(jsDate); + date.#offset = null; + return date; + } + static wrapAsLocalDate(jsDate) { + let date = new _TomlDate(jsDate); + date.#hasTime = false; + date.#offset = null; + return date; + } + static wrapAsLocalTime(jsDate) { + let date = new _TomlDate(jsDate); + date.#hasDate = false; + date.#offset = null; + return date; + } +}; // node_modules/smol-toml/dist/extract.js -function sliceAndTrimEndOf(str, startPtr, endPtr) { - let value = str.slice(startPtr, endPtr); - let commentIdx = value.indexOf("#"); - if (commentIdx > -1) { - skipComment(str, commentIdx); - value = value.slice(0, commentIdx); - } - return [value.trimEnd(), commentIdx]; -} -function extractValue(str, ptr, end, depth, integersAsBigInt) { - if (depth === 0) { - throw new TomlError("document contains excessively nested structures. aborting.", { - toml: str, - ptr - }); +function isDigit(char, base = 10) { + return base === 16 ? char > 47 && char < 58 || char > 64 && char < 71 || char > 96 && char < 103 : char > 47 && char < 48 + base; +} +function isEndOfValue(char, delim) { + return char === 32 || char === 9 || char === 10 || char === 13 || // Structure end or next value delimiter + delim && (char === delim || char === 44) || // Comment + char === 35; +} +function extractValue(ctx, end) { + let errPtr = ctx.p; + let c = ctx.s.charCodeAt(ctx.p); + if (c === 91 || c === 123) { + ctx.d-- || TomlError.x("document contains excessively nested structures. aborting.", ctx); + let value = c === 91 ? parseArray(ctx) : parseInlineTable(ctx); + ctx.d++; + return value; } - let c = str[ptr]; - if (c === "[" || c === "{") { - let [value, endPtr2] = c === "[" ? parseArray(str, ptr, depth, integersAsBigInt) : parseInlineTable(str, ptr, depth, integersAsBigInt); - if (end) { - endPtr2 = skipVoid(str, endPtr2); - if (str[endPtr2] === ",") - endPtr2++; - else if (str[endPtr2] !== end) { - throw new TomlError("expected comma or end of structure", { - toml: str, - ptr: endPtr2 - }); + if (c === 34 || c === 39) { + return parseString(ctx); + } + if (c === 116) { + if (ctx.s.charCodeAt(++ctx.p) !== 114 || ctx.s.charCodeAt(++ctx.p) !== 117 || ctx.s.charCodeAt(++ctx.p) !== 101) + TomlError.x("invalid value", ctx, errPtr); + return ctx.p++, true; + } + if (c === 102) { + if (ctx.s.charCodeAt(++ctx.p) !== 97 || ctx.s.charCodeAt(++ctx.p) !== 108 || ctx.s.charCodeAt(++ctx.p) !== 115 || ctx.s.charCodeAt(++ctx.p) !== 101) + TomlError.x("invalid value", ctx, errPtr); + return ctx.p++, false; + } + if (c === 43 || c === 45) { + return parseNumber(ctx, ctx.p, ctx.s.charCodeAt(++ctx.p), 44 - c, end); + } + if (ctx.s.charCodeAt(ctx.p + 4) === 45 && ctx.s.charCodeAt(ctx.p + 7) === 45) { + return parseDate(ctx, c, end); + } + if (ctx.s.charCodeAt(ctx.p + 2) === 58) { + return parseTime(ctx, c, end); + } + return parseNumber(ctx, ctx.p, c, 0, end); +} +function parseNumber(ctx, startPtr, startChr, sign, endChr) { + let c = startChr; + let state3 = 0; + let hasUnderscores = false; + if (c === 105) { + if (ctx.s.charCodeAt(++ctx.p) !== 110 || ctx.s.charCodeAt(++ctx.p) !== 102) + TomlError.x("invalid value", ctx, startPtr); + return ctx.p++, (sign || 1) / 0; + } + if (c === 110) { + if (ctx.s.charCodeAt(++ctx.p) !== 97 || ctx.s.charCodeAt(++ctx.p) !== 110) + TomlError.x("invalid value", ctx, startPtr); + return ctx.p++, NaN; + } + if (c === 48) { + if (++ctx.p >= ctx.s.length || isEndOfValue(c = ctx.s.charCodeAt(ctx.p), endChr)) + return ctx.bi === true ? 0n : 0; + if (!sign) { + if (c === 120) + return parseIntegerBaseN(ctx, startPtr, 16, endChr); + else if (c === 98) + return parseIntegerBaseN(ctx, startPtr, 2, endChr); + else if (c === 111) + return parseIntegerBaseN(ctx, startPtr, 8, endChr); + } + if (c === 46) + state3 = 2; + else if (c === 101 || c === 69) + state3 = 4; + else + TomlError.x("illegal leading zero", ctx, startPtr); + } else if (!isDigit(c)) + TomlError.x("invalid value", ctx, startPtr); + while (++ctx.p < ctx.s.length && (c = ctx.s.charCodeAt(ctx.p), !isEndOfValue(c, endChr))) { + if (!state3) + state3 = 1; + if (c === 95) { + if (!(state3 & 1)) + TomlError.x("illegal underscore", ctx); + state3 += 11; + hasUnderscores = true; + } else if (state3 === 1 && c === 46) + state3 = 2; + else if ((state3 === 1 || state3 === 3) && (c === 101 || c === 69)) + state3 = 4; + else if (state3 === 4 && (c === 43 || c === 45)) { + } else if (!isDigit(c)) + TomlError.x(`illegal character in numeric literal`, ctx); + else if (state3 > 9) + state3 -= 11; + else if (!(state3 & 1)) + state3++; + } + if (!state3) { + let val = (startChr - 48) * (sign || 1); + return ctx.bi === true ? BigInt(val) : val; + } + if (!(state3 & 1)) + TomlError.x("unfinished numeric value", ctx, startPtr); + let str = ctx.s.slice(startPtr, ctx.p); + if (hasUnderscores) + str = str.replaceAll("_", ""); + return state3 > 1 ? parseFloat(str) : parseInteger(ctx, str, 10, startPtr); +} +function parseIntegerBaseN(ctx, startPtr, base, endChr) { + let c, underscore = 1; + while (++ctx.p < ctx.s.length && (c = ctx.s.charCodeAt(ctx.p), !isEndOfValue(c, endChr))) { + if (c === 95) { + if (underscore & 1) + TomlError.x("illegal underscore", ctx); + underscore = 3; + } else if (!isDigit(c, base)) + TomlError.x(`illegal character in numeric literal`, ctx); + else if (underscore & 1) + underscore--; + } + if (underscore & 1) + TomlError.x("unfinished numeric value", ctx); + let str = ctx.s.slice(startPtr + 2, ctx.p); + if (underscore) + str = str.replaceAll("_", ""); + return parseInteger(ctx, str, base, startPtr); +} +function parseInteger(ctx, str, base, startPtr) { + if (ctx.bi !== true) + int: { + let val = parseInt(str, base); + if (!Number.isSafeInteger(val)) { + if (ctx.bi) + break int; + TomlError.x("integer value cannot be represented losslessly", ctx, startPtr); } + return val; } - return [value, endPtr2]; + return base === 10 ? BigInt(str) : BigInt((base === 2 ? "0b" : base === 8 ? "0o" : "0x") + str); +} +function parseDate(ctx, c, endChr) { + let startPtr = ctx.p++, unsafeSeparator; + if (!isDigit(c) || !isDigit(ctx.s.charCodeAt(ctx.p++)) || !isDigit(ctx.s.charCodeAt(ctx.p++)) || !isDigit(ctx.s.charCodeAt(ctx.p++))) { + return parseNumber(ctx, ctx.p = startPtr, c, 0, endChr); + } + ctx.p += 5; + if (!isDigit(ctx.s.charCodeAt(ctx.p++))) + TomlError.x("invalid date-time: date part is malformed", ctx, startPtr); + if (ctx.p >= ctx.s.length || ((c = ctx.s.charCodeAt(ctx.p)) !== 32 || (unsafeSeparator = true, !isDigit(ctx.s.charCodeAt(ctx.p + 1)))) && c !== 84 && c !== 116) { + let t2 = ctx.s.slice(startPtr, ctx.p); + return readDate(ctx, t2, 3, false, startPtr); + } + if (ctx.s.charCodeAt(ctx.p += 3) !== 58) + TomlError.x("invalid date-time: time part is malformed", ctx, startPtr); + if (ctx.s.charCodeAt(ctx.p += 3) === 58) + ctx.p += 3; + if (ctx.s.charCodeAt(ctx.p) === 46) + while (isDigit(ctx.s.charCodeAt(++ctx.p))) + ; + if (c = ctx.s.charCodeAt(ctx.p)) { + if (c === 90 || c === 122) { + let t2 = ctx.s.slice(startPtr, ++ctx.p); + return readDate(ctx, t2, 1, unsafeSeparator, startPtr, "[+00:00]"); + } + if (c === 43 || c === 45) { + let t2 = ctx.s.slice(startPtr, ctx.p += 6); + return readDate(ctx, t2, 1, unsafeSeparator, startPtr, !ctx.ld && "[" + ctx.s.slice(ctx.p - 6, ctx.p) + "]"); + } + } + let t = ctx.s.slice(startPtr, ctx.p); + return readDate(ctx, t, 2, unsafeSeparator, startPtr); +} +function parseTime(ctx, c, endChr) { + let start = ctx.p; + if (!isDigit(c) || !isDigit(ctx.s.charCodeAt(++ctx.p))) { + return parseNumber(ctx, --ctx.p, c, 0, endChr); + } + if (ctx.s.charCodeAt(ctx.p += 4) === 58) + ctx.p += 3; + if (ctx.s.charCodeAt(ctx.p) === 46) + while (isDigit(ctx.s.charCodeAt(++ctx.p))) + ; + let t = ctx.s.slice(start, ctx.p); + return readDate(ctx, t, 4, false, start); +} +function readDate(ctx, str, type, unsafeDelim, errPtr, temporalSuffix) { + if (ctx.ld) { + let date = new TomlDate(str, type, unsafeDelim); + if (!date.isValid()) + TomlError.x("invalid date", ctx, errPtr); + return date; } - if (c === '"' || c === "'") { - let [parsed, endPtr2] = parseString(str, ptr); - if (end) { - endPtr2 = skipVoid(str, endPtr2); - if (str[endPtr2] && str[endPtr2] !== "," && str[endPtr2] !== end && str[endPtr2] !== "\n" && str[endPtr2] !== "\r") { - throw new TomlError("unexpected character encountered", { - toml: str, - ptr: endPtr2 - }); - } - if (str[endPtr2] === ",") - endPtr2++; + try { + if (temporalSuffix) + str += temporalSuffix; + switch (type) { + case 1: + return Temporal.ZonedDateTime.from(str); + case 2: + return Temporal.PlainDateTime.from(str); + case 3: + return Temporal.PlainDate.from(str); + case 4: + return Temporal.PlainTime.from(str); } - return [parsed, endPtr2]; + } catch (e) { + TomlError.x(e instanceof Error ? e.message : "" + e, ctx, errPtr); } - let endPtr = skipUntil(str, ptr, ",", end); - let slice = sliceAndTrimEndOf(str, ptr, endPtr - (str[endPtr - 1] === "," ? 1 : 0)); - if (!slice[0]) { - throw new TomlError("incomplete key-value declaration: no value specified", { - toml: str, - ptr - }); +} + +// node_modules/smol-toml/dist/util.js +function skipComment(ctx) { + for (; ctx.p < ctx.s.length; ctx.p++) { + let c = ctx.s.charCodeAt(ctx.p); + if (c === 10) + break; + if (c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) { + ctx.p++; + break; + } + if (c < 32 && c !== 9 || c === 127) { + TomlError.x("control characters are not allowed in comments", ctx); + } } - if (end && slice[1] > -1) { - endPtr = skipVoid(str, ptr + slice[1]); - if (str[endPtr] === ",") - endPtr++; +} +function skipVoid(ctx, banNewLines, banComments) { + let c; + while (ctx.p < ctx.s.length) { + while (ctx.p < ctx.s.length && ((c = ctx.s.charCodeAt(ctx.p)) === 32 || c === 9 || !banNewLines && (c === 10 || c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10))) + ctx.p++; + if (banComments || c !== 35) + break; + skipComment(ctx); } - return [ - parseValue2(slice[0], str, ptr, integersAsBigInt), - endPtr - ]; } // node_modules/smol-toml/dist/struct.js -var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/; -function parseKey(str, ptr, end = "=") { - let dot = ptr - 1; +function parseKey(ctx, end = 61) { + let startPtr; + let state3 = 0; let parsed = []; - let endPtr = str.indexOf(end, ptr); - if (endPtr < 0) { - throw new TomlError("incomplete key-value: cannot find end of key", { - toml: str, - ptr - }); - } + let sliceStart; + let c = ctx.s.charCodeAt(startPtr = ctx.p); do { - let c = str[ptr = ++dot]; - if (c !== " " && c !== " ") { - if (c === '"' || c === "'") { - if (c === str[ptr + 1] && c === str[ptr + 2]) { - throw new TomlError("multiline strings are not allowed in keys", { - toml: str, - ptr - }); - } - let [part, eos] = parseString(str, ptr); - dot = str.indexOf(".", eos); - let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot); - let newLine = indexOfNewline(strEnd); - if (newLine > -1) { - throw new TomlError("newlines are not allowed in keys", { - toml: str, - ptr: ptr + dot + newLine - }); - } - if (strEnd.trimStart()) { - throw new TomlError("found extra tokens after the string part", { - toml: str, - ptr: eos - }); - } - if (endPtr < eos) { - endPtr = str.indexOf(end, eos); - if (endPtr < 0) { - throw new TomlError("incomplete key-value: cannot find end of key", { - toml: str, - ptr - }); - } - } - parsed.push(part); - } else { - dot = str.indexOf(".", ptr); - let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot); - if (!KEY_PART_RE.test(part)) { - throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", { - toml: str, - ptr - }); - } - parsed.push(part.trimEnd()); + if (c === end) { + if (!state3) + TomlError.x("unexpected end of key", ctx); + if (state3 === 1) + parsed.push(ctx.s.slice(sliceStart, ctx.p)); + return ctx.p++, parsed; + } else if (c === 46) { + if (!state3) + TomlError.x("illegal empty bare key", ctx); + if (state3 === 1) + parsed.push(ctx.s.slice(sliceStart, ctx.p)); + state3 = 0; + } else if (!state3 && (c === 34 || c === 39)) { + if (c === ctx.s.charCodeAt(ctx.p + 1) && c === ctx.s.charCodeAt(ctx.p + 2)) + TomlError.x("illegal quoted key: multiline strings are not allowed", ctx); + parsed.push(parseString(ctx)); + state3 = 2; + ctx.p--; + } else if (c === 32 || c === 9) { + if (state3 === 1) { + parsed.push(ctx.s.slice(sliceStart, ctx.p)); + state3 = 2; } + } else if (state3 === 2 || c < 48 && c !== 45 || c > 57 && c < 65 || c > 90 && c < 97 && c !== 95 || c > 122) { + TomlError.x("illegal character in key", ctx); + } else if (!state3) { + state3 = 1; + sliceStart = ctx.p; } - } while (dot + 1 && dot < endPtr); - return [parsed, skipVoid(str, endPtr + 1, true, true)]; + } while (c = ctx.s.charCodeAt(++ctx.p)); + TomlError.x("incomplete key-value: cannot find end of key", ctx, startPtr); } -function parseInlineTable(str, ptr, depth, integersAsBigInt) { - let res = {}; +function parseInlineTable(ctx) { + let startPtr = ctx.p++; + let res = /* @__PURE__ */ Object.create(null); let seen = /* @__PURE__ */ new Set(); let c; - ptr++; - while ((c = str[ptr++]) !== "}" && c) { - if (c === ",") { - throw new TomlError("expected value, found comma", { - toml: str, - ptr: ptr - 1 - }); - } else if (c === "#") - ptr = skipComment(str, ptr); - else if (c !== " " && c !== " " && c !== "\n" && c !== "\r") { - let k; - let t = res; - let hasOwn = false; - let [key, keyEndPtr] = parseKey(str, ptr - 1); - for (let i = 0; i < key.length; i++) { - if (i) - t = hasOwn ? t[k] : t[k] = {}; - k = key[i]; - if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== "object" || seen.has(t[k]))) { - throw new TomlError("trying to redefine an already defined value", { - toml: str, - ptr - }); - } - if (!hasOwn && k === "__proto__") { - Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true }); - } + while (ctx.p < ctx.s.length) { + skipVoid(ctx); + if ((c = ctx.s.charCodeAt(ctx.p)) === 125) { + ctx.p++; + return res; + } + let k; + let t = res; + let hasOwn = false; + let errPtr = ctx.p; + let key = parseKey(ctx); + for (let i = 0; i < key.length; i++) { + if (i) + t = hasOwn ? t[k] : t[k] = /* @__PURE__ */ Object.create(null); + k = key[i]; + if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== "object" || seen.has(t[k]))) { + TomlError.x("trying to redefine an already defined value", ctx, errPtr); + } + let unsafe = k === "__proto__"; + if (ctx.uk && (unsafe || k === "constructor")) { + t = ctx.uk !== 1 && TomlError.x("document contains an unsafe property", ctx, errPtr); + break; } - if (hasOwn) { - throw new TomlError("trying to redefine an already defined value", { - toml: str, - ptr - }); + if (!hasOwn && unsafe) { + Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true }); } - let [value, valueEndPtr] = extractValue(str, keyEndPtr, "}", depth - 1, integersAsBigInt); + } + if (hasOwn) { + TomlError.x("trying to redefine an already defined value", ctx, errPtr); + } + skipVoid(ctx, true, true); + let value = extractValue( + ctx, + 125 + /* } */ + ); + if (t && typeof (t[k] = value) === "object") seen.add(value); - t[k] = value; - ptr = valueEndPtr; + skipVoid(ctx); + if ((c = ctx.s.charCodeAt(ctx.p++)) === 125) { + return res; } + if (c !== 44) + TomlError.x("expected comma or end of structure", ctx, ctx.p - 1); } - if (!c) { - throw new TomlError("unfinished table encountered", { - toml: str, - ptr - }); - } - return [res, ptr]; + TomlError.x("unfinished table", ctx, startPtr); } -function parseArray(str, ptr, depth, integersAsBigInt) { +function parseArray(ctx) { + let startPtr = ctx.p++; let res = []; let c; - ptr++; - while ((c = str[ptr++]) !== "]" && c) { - if (c === ",") { - throw new TomlError("expected value, found comma", { - toml: str, - ptr: ptr - 1 - }); - } else if (c === "#") - ptr = skipComment(str, ptr); - else if (c !== " " && c !== " " && c !== "\n" && c !== "\r") { - let e = extractValue(str, ptr - 1, "]", depth - 1, integersAsBigInt); - res.push(e[0]); - ptr = e[1]; - } - } - if (!c) { - throw new TomlError("unfinished array encountered", { - toml: str, - ptr - }); + while (ctx.p < ctx.s.length) { + skipVoid(ctx); + if ((c = ctx.s.charCodeAt(ctx.p)) === 93) { + ctx.p++; + return res; + } + res.push(extractValue( + ctx, + 93 + /* ] */ + )); + skipVoid(ctx); + if ((c = ctx.s.charCodeAt(ctx.p++)) === 93) { + return res; + } + if (c !== 44) + TomlError.x("expected comma or end of structure", ctx, ctx.p - 1); } - return [res, ptr]; + TomlError.x("unfinished array", ctx, startPtr); } // node_modules/smol-toml/dist/parse.js -function peekTable(key, table, meta, type) { +function peekTable(ctx, key, table, meta, type) { let t = table; let m = meta; let k; @@ -114613,7 +114667,7 @@ function peekTable(key, table, meta, type) { let state3; for (let i = 0; i < key.length; i++) { if (i) { - t = hasOwn ? t[k] : t[k] = {}; + t = hasOwn ? t[k] : t[k] = /* @__PURE__ */ Object.create(null); m = (state3 = m[k]).c; if (type === 0 && (state3.t === 1 || state3.t === 2)) { return null; @@ -114629,7 +114683,10 @@ function peekTable(key, table, meta, type) { return null; } if (!hasOwn) { - if (k === "__proto__") { + let unsafe = k === "__proto__"; + if (ctx.uk && (unsafe || k === "constructor")) + return false; + if (unsafe) { Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true }); Object.defineProperty(m, k, { enumerable: true, configurable: true, writable: true }); } @@ -114637,7 +114694,7 @@ function peekTable(key, table, meta, type) { t: i < key.length - 1 && type === 2 ? 3 : type, d: false, i: 0, - c: {} + c: /* @__PURE__ */ Object.create(null) }; } } @@ -114650,85 +114707,103 @@ function peekTable(key, table, meta, type) { state3.d = true; t[k] = []; } - t[k].push(t = {}); - state3.c[state3.i++] = state3 = { t: 1, d: false, i: 0, c: {} }; + t[k].push(t = /* @__PURE__ */ Object.create(null)); + state3.c[state3.i++] = state3 = { t: 1, d: false, i: 0, c: /* @__PURE__ */ Object.create(null) }; } if (state3.d) { return null; } state3.d = true; if (type === 1) { - t = hasOwn ? t[k] : t[k] = {}; + t = hasOwn ? t[k] : t[k] = /* @__PURE__ */ Object.create(null); } else if (type === 0 && hasOwn) { return null; } return [k, t, state3.c]; } -function parse4(toml, { maxDepth = 1e3, integersAsBigInt } = {}) { - let res = {}; - let meta = {}; +function validateTablePeek(ctx, peek, ptr) { + if (peek === null || ctx.uk === 2) + TomlError.x(peek === null ? "trying to redefine an already defined table or value" : "document contains an unsafe property", ctx, ptr); +} +function parse4(toml, options = {}) { + let ctx = { + s: toml, + p: 0, + d: options.maxDepth ?? 1e3, + bi: options.integersAsBigInt ?? false, + ld: options.useLegacyDate ?? true, + uk: options.unsafeKeyBehaviour === "throw" ? 2 : options.unsafeKeyBehaviour === "drop" ? 1 : 0 + }; + let res = /* @__PURE__ */ Object.create(null); + let meta = /* @__PURE__ */ Object.create(null); + let tmp; + let skipping = false; let tbl = res; let m = meta; - for (let ptr = skipVoid(toml, 0); ptr < toml.length; ) { - if (toml[ptr] === "[") { - let isTableArray = toml[++ptr] === "["; - let k = parseKey(toml, ptr += +isTableArray, "]"); + if (toml.charCodeAt(0) === 65279) + ctx.p++; + skipVoid(ctx); + while (ctx.p < toml.length) { + if (toml.charCodeAt(ctx.p) === 91) { + let isTableArray = toml.charCodeAt(++ctx.p) === 91; + tmp = ctx.p += +isTableArray; + skipping = false; + let k = parseKey( + ctx, + 93 + /* ] */ + ); if (isTableArray) { - if (toml[k[1] - 1] !== "]") { - throw new TomlError("expected end of table declaration", { - toml, - ptr: k[1] - 1 - }); + if (toml.charCodeAt(ctx.p) !== 93) { + TomlError.x("expected end of table array declaration", ctx); } - k[1]++; + ctx.p++; } let p = peekTable( - k[0], + ctx, + k, res, meta, isTableArray ? 2 : 1 /* Type.EXPLICIT */ ); if (!p) { - throw new TomlError("trying to redefine an already defined table or value", { - toml, - ptr - }); + validateTablePeek(ctx, p, tmp); + skipping = true; + } else { + m = p[2]; + tbl = p[1]; } - m = p[2]; - tbl = p[1]; - ptr = k[1]; } else { - let k = parseKey(toml, ptr); + tmp = ctx.p; + let k = parseKey(ctx); let p = peekTable( - k[0], + ctx, + k, tbl, m, 0 /* Type.DOTTED */ ); - if (!p) { - throw new TomlError("trying to redefine an already defined table or value", { - toml, - ptr - }); - } - let v = extractValue(toml, k[1], void 0, maxDepth, integersAsBigInt); - p[1][p[0]] = v[0]; - ptr = v[1]; + if (!p && !skipping) + validateTablePeek(ctx, p, tmp); + skipVoid(ctx, true, true); + let v = extractValue(ctx, void 0); + if (p && !skipping) + p[1][p[0]] = v; } - ptr = skipVoid(toml, ptr, true); - if (toml[ptr] && toml[ptr] !== "\n" && toml[ptr] !== "\r") { - throw new TomlError("each key-value declaration must be followed by an end-of-line", { - toml, - ptr - }); + skipVoid(ctx, true); + if (ctx.p < toml.length && (tmp = toml.charCodeAt(ctx.p)) !== 10 && (tmp !== 13 || toml.charCodeAt(ctx.p + 1) !== 10)) { + TomlError.x("each key-value declaration must be followed by an end-of-line", ctx); } - ptr = skipVoid(toml, ptr); + skipVoid(ctx); } return res; } +// node_modules/smol-toml/dist/stringify.js +var HAS_WELLFORMED = !!"".isWellFormed; + // src/utils/config-file.ts function getConfigValueFromTomlFile(filePath, key) { if (!import_node_fs3.default.existsSync(filePath) || !filePath.endsWith(".toml")) { @@ -115317,7 +115392,7 @@ function loadInputs() { const checksum = getInput("checksum"); const enableCache = getEnableCache(); const restoreCache3 = getInput("restore-cache") === "true"; - const saveCache2 = getInput("save-cache") === "true"; + const saveCache2 = getSaveCache(); const cacheSuffix = getInput("cache-suffix") || ""; const cacheLocalPath = getCacheLocalPath( workingDirectory, @@ -115427,6 +115502,17 @@ function getEnableCache() { } return enableCacheInput === "true"; } +function getSaveCache() { + const saveCacheInput = getInput("save-cache"); + if (saveCacheInput === "auto") { + if (process.env.GITHUB_EVENT_NAME === "merge_group") { + info2("Cache saving is disabled for the merge_group event"); + return false; + } + return true; + } + return saveCacheInput === "true"; +} function getToolBinDir(workingDirectory) { const toolBinDirInput = getInput("tool-bin-dir"); if (toolBinDirInput !== "") { @@ -115640,22 +115726,82 @@ var { toString: toString3 } = Object.prototype; var { getPrototypeOf } = Object; var { iterator, toStringTag } = Symbol; 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 = toString3.call(thing); return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); @@ -115690,9 +115836,9 @@ var isPlainObject = (val) => { 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) => { @@ -115713,6 +115859,7 @@ var isReactNativeBlob = (value) => { var isReactNative2 = (formData) => formData && typeof formData.getParts !== "undefined"; var isBlob2 = kindOfTest("Blob"); var isFileList = kindOfTest("FileList"); +var isSet = kindOfTest("Set"); var isStream = (val) => isObject2(val) && isFunction(val.pipe); function getGlobal() { if (typeof globalThis !== "undefined") return globalThis; @@ -116008,11 +116155,20 @@ var toJSONObject = (obj) => { } 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; } @@ -116093,6 +116249,7 @@ var utils_default = { // an alias to avoid ESLint no-prototype-builtins detection hasOwnInPrototypeChain, getSafeProp, + toSafeFlatObject, reduceDescriptors, freezeMethods, toObjectSet, @@ -116141,17 +116298,18 @@ var parseHeaders_default = (rawHeaders) => { 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_default.hasOwnProp(parsed, key); + if (!key || hasKey && utils_default.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; @@ -116215,6 +116373,90 @@ function parseTokens(str) { } 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(context3, value, header, filter4, isHeaderNameFilter) { if (utils_default.isFunction(filter4)) { @@ -116390,7 +116632,8 @@ var AxiosHeaders = class { 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_default.isArray(value) ? value : value == null || value === false ? [] : [value]; } get [Symbol.toStringTag]() { return "AxiosHeaders"; @@ -116398,6 +116641,9 @@ var AxiosHeaders = class { 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)); @@ -116493,9 +116739,30 @@ function redactConfig(config, redactKeys) { }; return visit(config); } +function stringifySafely(value) { + try { + return String(value); + } catch (err) { + return ""; + } +} +function aggregateErrorMessage(error2) { + const message = error2.errors.map((entry) => { + try { + return entry && entry.message ? stringifySafely(entry.message) : stringifySafely(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_default.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, @@ -116585,6 +116852,16 @@ var AxiosError_default = AxiosError; var import_form_data = __toESM(require_form_data(), 1); var FormData_default = import_form_data.default; +// node_modules/axios/lib/platform/node/classes/Buffer.js +var Buffer_default = { + isBufferAvailable() { + return typeof Buffer !== "undefined"; + }, + from(value) { + return Buffer.from(value); + } +}; + // node_modules/axios/lib/helpers/toFormData.js var DEFAULT_FORM_DATA_MAX_DEPTH = 100; function isVisitable(thing) { @@ -116611,24 +116888,16 @@ function toFormData(obj, formData, options) { throw new TypeError("target must be an object"); } formData = formData || new (FormData_default || FormData)(); - options = utils_default.toFlatObject( - options, - { - metaTokens: true, - dots: false, - indexes: false - }, - false, - function defined(option, source) { - return !utils_default.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_default.getSafeProp(options, name); + return utils_default.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_default.isSpecCompliantForm(formData); const stack = []; if (!utils_default.isFunction(visitor)) { @@ -116649,10 +116918,13 @@ function toFormData(obj, formData, options) { if (useBlob && typeof _Blob === "function") { return new _Blob([value]); } - if (typeof Buffer !== "undefined") { - return Buffer.from(value); + if (Buffer_default && Buffer_default.isBufferAvailable()) { + return Buffer_default.from(value); } - throw new AxiosError_default("Blob is not supported. Use a Buffer instead.", AxiosError_default.ERR_NOT_SUPPORT); + throw new AxiosError_default( + "Blob is not supported. Use a Buffer instead.", + AxiosError_default.ERR_NOT_SUPPORT + ); } return value; } @@ -116798,9 +117070,47 @@ function buildURL(url3, params, options) { } // node_modules/axios/lib/core/InterceptorManager.js +var $internals2 = /* @__PURE__ */ 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[$internals2] = { + handlersRef: this.handlers, + handlersLength: this.handlers.length, + handlerEntries: /* @__PURE__ */ new Map(), + iterationDepth: 0, + nextId: 0 + }; } /** * Add a new interceptor to the stack @@ -116812,13 +117122,25 @@ var InterceptorManager = class { * @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[$internals2]; + 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 @@ -116828,8 +117150,19 @@ var InterceptorManager = class { * @returns {void} */ eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; + const internals = this[$internals2]; + 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; + } } } /** @@ -116840,6 +117173,7 @@ var InterceptorManager = class { clear() { if (this.handlers) { this.handlers = []; + syncHandlerEntries(this, this[$internals2]); } } /** @@ -116853,11 +117187,22 @@ var InterceptorManager = class { * @returns {void} */ forEach(fn) { - utils_default.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); + const internals = this[$internals2]; + syncHandlerEntries(this, internals); + internals.iterationDepth++; + try { + utils_default.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 InterceptorManager_default = InterceptorManager; @@ -116959,7 +117304,7 @@ function throwIfDepthExceeded(index) { } function parsePropPath(name) { const path18 = []; - const pattern = /\w+|\[(\w*)]/g; + const pattern = /[^.[\]]+|\[([^.[\]]*)]/g; let match4; while ((match4 = pattern.exec(name)) !== null) { throwIfDepthExceeded(path18.length); @@ -117015,9 +117360,25 @@ function formDataToJSON(formData) { } var formDataToJSON_default = formDataToJSON; +// node_modules/axios/lib/core/methodList.js +var methodList = Object.freeze([ + "get", + "delete", + "head", + "options", + "post", + "put", + "patch", + "purge", + "link", + "unlink", + "query" +]); +var methodList_default = methodList; + // node_modules/axios/lib/defaults/index.js var own = (obj, key) => obj != null && utils_default.hasOwnProp(obj, key) ? obj[key] : void 0; -function stringifySafely(rawValue, parser, encoder) { +function stringifySafely2(rawValue, parser, encoder) { if (utils_default.isString(rawValue)) { try { (parser || JSON.parse)(rawValue); @@ -117073,7 +117434,7 @@ var defaults2 = { } if (isObjectPayload || hasJSONContentType) { headers.setContentType("application/json", false); - return stringifySafely(data); + return stringifySafely2(data); } return data; } @@ -117127,7 +117488,7 @@ var defaults2 = { } } }; -utils_default.forEach(["delete", "get", "head", "post", "put", "patch", "query"], (method) => { +utils_default.forEach(methodList_default, (method) => { defaults2.headers[method] = {}; }); var defaults_default = defaults2; @@ -117195,29 +117556,62 @@ function isAbsoluteURL(url3) { // node_modules/axios/lib/helpers/combineURLs.js 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(/^\/+/, ""); +} + +// node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +var urlParserControlCharacters = /[\t\n\r]/g; +function normalizeURLForProtocolCheck(url3) { + if (typeof url3 !== "string") { + return url3; + } + let start = 0; + while (start < url3.length && url3.charCodeAt(start) <= 32) { + start++; + } + return url3.slice(start).replace(urlParserControlCharacters, ""); } // node_modules/axios/lib/core/buildFullPath.js var malformedHttpProtocol = /^https?:(?!\/\/)/i; -var httpProtocolControlCharacters = /[\t\n\r]/g; -function stripLeadingC0ControlOrSpace(url3) { - let i = 0; - while (i < url3.length && url3.charCodeAt(i) <= 32) { - i++; +function redactFragment(fragment) { + if (!fragment) { + return fragment; } - return url3.slice(i); + return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, (match4, separator, parameterName = "") => { + return `${separator}${parameterName}${REDACTED}`; + }); } -function normalizeURLForProtocolCheck(url3) { - return stripLeadingC0ControlOrSpace(url3).replace(httpProtocolControlCharacters, ""); +function redactSensitiveURLParts(url3) { + const redactedURL = url3.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(url3, config) { - if (typeof url3 === "string" && malformedHttpProtocol.test(normalizeURLForProtocolCheck(url3))) { - throw new AxiosError_default( - 'Invalid URL: missing "//" after protocol', - AxiosError_default.ERR_INVALID_URL, - config - ); + if (typeof url3 === "string") { + const normalizedURL = normalizeURLForProtocolCheck(url3); + if (malformedHttpProtocol.test(normalizedURL)) { + throw new AxiosError_default( + `Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing "//" after protocol`, + AxiosError_default.ERR_INVALID_URL, + config + ); + } } } function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) { @@ -117302,13 +117696,13 @@ var import_https_proxy_agent2 = __toESM(require_dist4(), 1); var import_http = __toESM(require("http"), 1); var import_https = __toESM(require("https"), 1); var import_http22 = __toESM(require("http2"), 1); -var import_util19 = __toESM(require("util"), 1); +var import_util18 = __toESM(require("util"), 1); var import_path = require("path"); var import_follow_redirects = __toESM(require_follow_redirects(), 1); var import_zlib = __toESM(require("zlib"), 1); // node_modules/axios/lib/env/data.js -var VERSION = "1.18.1"; +var VERSION = "1.20.0"; // node_modules/axios/lib/helpers/parseProtocol.js function parseProtocol(url3) { @@ -117317,7 +117711,7 @@ function parseProtocol(url3) { } // node_modules/axios/lib/helpers/fromDataURI.js -var DATA_URL_PATTERN = /^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/; +var DATA_URL_PATTERN = /^([^,;/]+\/[^,;/]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/; function fromDataURI(uri, asBlob, options) { const _Blob = options && options.Blob || platform_default.classes.Blob; const protocol = parseProtocol(uri); @@ -117355,6 +117749,20 @@ function fromDataURI(uri, asBlob, options) { // node_modules/axios/lib/adapters/http.js var import_stream5 = __toESM(require("stream"), 1); +// node_modules/axios/lib/core/setFormDataHeaders.js +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); + } + }); +} + // node_modules/axios/lib/helpers/AxiosTransformStream.js var import_stream2 = __toESM(require("stream"), 1); var kInternals = /* @__PURE__ */ Symbol("internals"); @@ -117482,7 +117890,7 @@ var AxiosTransformStream_default = AxiosTransformStream; var import_events3 = require("events"); // node_modules/axios/lib/helpers/formDataToStream.js -var import_util17 = __toESM(require("util"), 1); +var import_util16 = __toESM(require("util"), 1); var import_stream3 = require("stream"); // node_modules/axios/lib/helpers/readBlob.js @@ -117502,7 +117910,7 @@ var readBlob_default = readBlob; // node_modules/axios/lib/helpers/formDataToStream.js var BOUNDARY_ALPHABET = platform_default.ALPHABET.ALPHA_DIGIT + "-_"; -var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new import_util17.default.TextEncoder(); +var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new import_util16.default.TextEncoder(); var CRLF = "\r\n"; var CRLF_BYTES = textEncoder.encode(CRLF); var CRLF_BYTES_COUNT = 2; @@ -117609,13 +118017,14 @@ var ZlibHeaderTransformStream_default = ZlibHeaderTransformStream; // node_modules/axios/lib/helpers/Http2Sessions.js var import_http2 = __toESM(require("http2"), 1); -var import_util18 = __toESM(require("util"), 1); +var import_util17 = __toESM(require("util"), 1); var Http2Sessions = class { constructor() { this.sessions = /* @__PURE__ */ Object.create(null); } getSession(authority, options) { options = Object.assign( + /* @__PURE__ */ Object.create(null), { sessionTimeout: 1e3 }, @@ -117626,7 +118035,7 @@ var Http2Sessions = class { let len = authoritySessions.length; for (let i = 0; i < len; i++) { const [sessionHandle, sessionOptions] = authoritySessions[i]; - if (!sessionHandle.destroyed && !sessionHandle.closed && import_util18.default.isDeepStrictEqual(sessionOptions, options)) { + if (!sessionHandle.destroyed && !sessionHandle.closed && import_util17.default.isDeepStrictEqual(sessionOptions, options)) { return sessionHandle; } } @@ -117681,6 +118090,7 @@ var Http2Sessions = class { }; } session.once("close", removeSession); + session.once("error", removeSession); let entry = [session, options]; authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry]; return session; @@ -117705,12 +118115,73 @@ var callbackify_default = callbackify; // node_modules/axios/lib/helpers/shouldBypassProxy.js 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; @@ -117795,6 +118266,40 @@ var unmapIPv4MappedIPv6 = (host) => { } 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; @@ -117802,7 +118307,89 @@ var normalizeNoProxyHost = (hostname) => { 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 match4 = CIDR_ENTRY_RE.exec(entry); + if (!match4) { + return null; + } + let prefix2 = Number(match4[2]); + const parsedBase = normalizeCidrBase(match4[1]); + if (!parsedBase) { + return null; + } + const { normalized, wasIPv6 } = parsedBase; + if (wasIPv6 && normalized.indexOf(":") === -1) { + if (prefix2 < 96) { + return null; + } + prefix2 -= 96; + } + const bytes = ipToBytes(normalized); + if (!bytes || prefix2 > bytes.length * 8) { + return null; + } + return { bytes, prefix: prefix2 }; +}; +var isInSubnet = (addressBytes, networkBytes, prefix2) => { + const fullBytes = prefix2 >> 3; + for (let i = 0; i < fullBytes; i++) { + if (addressBytes[i] !== networkBytes[i]) { + return false; + } + } + const remainingBits = prefix2 & 7; + if (remainingBits) { + const mask = 255 << 8 - remainingBits & 255; + if ((addressBytes[fullBytes] & mask) !== (networkBytes[fullBytes] & mask)) { + return false; + } + } + return true; }; function shouldBypassProxy(location) { let parsed; @@ -117820,10 +118407,18 @@ function shouldBypassProxy(location) { } const port = Number.parseInt(parsed.port, 10) || DEFAULT_PORTS2[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) { @@ -117909,7 +118504,8 @@ function throttle(fn, freq) { } }; const flush = () => lastArgs && invoke(lastArgs); - return [throttled, flush]; + const flushWith = (...args) => invoke(args); + return [throttled, flush, flushWith]; } var throttle_default = throttle; @@ -117918,12 +118514,12 @@ var progressEventReducer = (listener, isDownloadStream, freq = 3) => { let bytesNotified = 0; const _speedometer = speedometer_default(50, 250); return throttle_default((e) => { - if (!e || typeof e.loaded !== "number") { + if (!e || !utils_default.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); @@ -117952,12 +118548,66 @@ var progressEventDecorator = (total, throttled) => { throttled[1] ]; }; -var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args)); +var asyncDecorator = (fn, scheduler = utils_default.asap) => (...args) => scheduler(() => fn(...args)); // node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js 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(url3) { +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 = (body2) => { + const len = body2.length; + let padding = 0; + if (len > 0 && body2.charCodeAt(len - 1) === 61) { + padding++; + if (len > 1 && body2.charCodeAt(len - 2) === 61) { + padding++; + } + } + return Math.floor((len - padding) * 3 / 4); +}; +var estimatePercentDecodedBase64Bytes = (body2) => { + const len = body2.length; + let significant = 0; + let padding = 0; + let invalid = false; + for (let i = 0; i < len; i++) { + let code = body2.charCodeAt(i); + if (code === 37 && isPercentEncodedByte(body2, i, len)) { + code = hexValue(body2.charCodeAt(i + 1)) * 16 + hexValue(body2.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(body2); + } + return base64Bytes(significant); +}; +var estimateDataURLBytes = (url3, estimateBase64) => { if (!url3 || typeof url3 !== "string") return 0; if (!url3.startsWith("data:")) return 0; const comma = url3.indexOf(","); @@ -117966,43 +118616,7 @@ function estimateDataURLDecodedBytes(url3) { const body2 = url3.slice(comma + 1); const isBase64 = /;base64/i.test(meta); if (isBase64) { - let effectiveLen = body2.length; - const len = body2.length; - for (let i = 0; i < len; i++) { - if (body2.charCodeAt(i) === 37 && i + 2 < len) { - const a = body2.charCodeAt(i + 1); - const b = body2.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 && body2.charCodeAt(j - 2) === 37 && // '%' - body2.charCodeAt(j - 1) === 51 && // '3' - (body2.charCodeAt(j) === 68 || body2.charCodeAt(j) === 100); - if (idx >= 0) { - if (body2.charCodeAt(idx) === 61) { - pad++; - idx--; - } else if (tailIsPct3D(idx)) { - pad++; - idx -= 3; - } - } - if (pad === 1 && idx >= 0) { - if (body2.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(body2); } let bytes = 0; for (let i = 0, len = body2.length; i < len; i++) { @@ -118027,6 +118641,16 @@ function estimateDataURLDecodedBytes(url3) { } } return bytes; +}; +function estimateDataURLDecodedBytes(url3) { + const fragmentIndex = typeof url3 === "string" ? url3.indexOf("#") : -1; + return estimateDataURLBytes( + fragmentIndex === -1 ? url3 : url3.slice(0, fragmentIndex), + estimatePercentDecodedBase64Bytes + ); +} +function estimateDataURLBufferAllocation(url3) { + return estimateDataURLBytes(url3, estimateBase64BufferAllocation); } // node_modules/axios/lib/adapters/http.js @@ -118046,22 +118670,17 @@ var isBrotliSupported = utils_default.isFunction(import_zlib.default.createBrotl var isZstdSupported = utils_default.isFunction(import_zlib.default.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_default.asap; var { http: httpFollow, https: httpsFollow } = import_follow_redirects.default; var isHttps = /https:?/; -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 kAxiosSocketListener = /* @__PURE__ */ Symbol("axios.http.socketListener"); var kAxiosCurrentReq = /* @__PURE__ */ Symbol("axios.http.currentReq"); +function handleSocketError(err) { + const current = this[kAxiosCurrentReq]; + if (current && !current.destroyed) { + current.destroy(err); + } +} var kAxiosInstalledTunnel = /* @__PURE__ */ Symbol("axios.http.installedTunnel"); var tunnelingAgentCache = /* @__PURE__ */ new Map(); var tunnelingAgentCacheUser = /* @__PURE__ */ new WeakMap(); @@ -118164,10 +118783,10 @@ function isSameOriginRedirect(redirectOptions, requestDetails) { return false; } } -function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent) { +function setProxy(options, configProxy, location, 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(location); if (proxyUrl) { if (!shouldBypassProxy(location)) { @@ -118264,9 +118883,13 @@ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, redirectOptions.href, true, configHttpsAgent, - configHttpAgent + configHttpAgent, + allowEnvProxy ); }; + return Boolean( + proxy || configProxy !== false && allowEnvProxy && isNodeEnvProxyEnabled(proxyEnvAgent) + ); } var isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process"; var wrapAsync = (asyncExecutor) => { @@ -118291,7 +118914,7 @@ var wrapAsync = (asyncExecutor) => { }; var resolveFamily = ({ address, family }) => { if (!utils_default.isString(address)) { - throw TypeError("address must be a string"); + throw new AxiosError_default("address must be a string", AxiosError_default.ERR_BAD_OPTION_VALUE); } return { address, @@ -118299,6 +118922,30 @@ var resolveFamily = ({ address, family }) => { }; }; var buildAddressEntry = (address, family) => resolveFamily(utils_default.isObject(address) ? address : { address, family }); +var normalizedLookupCache = /* @__PURE__ */ new WeakMap(); +var normalizeLookup = (lookup) => { + let normalized = normalizedLookupCache.get(lookup); + if (normalized) { + return normalized; + } + const callbackLookup = callbackify_default(lookup, (value) => utils_default.isArray(value) ? value : [value]); + normalized = (hostname, opt, cb) => { + callbackLookup(hostname, opt, (err, arg0, arg1) => { + if (err) { + return cb(err); + } + let addresses; + try { + addresses = utils_default.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)); @@ -118335,6 +118982,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { 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"); @@ -118351,25 +118999,32 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { let rejected = false; let req; let connectPhaseTimer; - httpVersion = +httpVersion; + try { + httpVersion = +httpVersion; + } catch (err) { + throw new AxiosError_default( + "Invalid protocol version: value is not a number", + AxiosError_default.ERR_BAD_OPTION_VALUE, + config + ); + } if (Number.isNaN(httpVersion)) { - throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`); + throw new AxiosError_default( + `Invalid protocol version: '${rawHttpVersion}' is not a number`, + AxiosError_default.ERR_BAD_OPTION_VALUE, + config + ); } if (httpVersion !== 1 && httpVersion !== 2) { - throw TypeError(`Unsupported protocol version '${httpVersion}'`); + throw new AxiosError_default( + `Unsupported protocol version '${httpVersion}'`, + AxiosError_default.ERR_BAD_OPTION_VALUE, + config + ); } const isHttp2 = httpVersion === 2; if (lookup) { - const _lookup = callbackify_default(lookup, (value) => utils_default.isArray(value) ? value : [value]); - lookup = (hostname, opt, cb) => { - _lookup(hostname, opt, (err, arg0, arg1) => { - if (err) { - return cb(err); - } - const addresses = utils_default.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 import_events3.EventEmitter(); function abort(reason) { @@ -118443,7 +119098,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { 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_default( @@ -118513,7 +119168,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { setFormDataHeaders(headers, data.getHeaders(), own2("formDataHeaderPolicy")); if (!headers.hasContentLength()) { try { - const knownLength = await import_util19.default.promisify(data.getLength).call(data); + const knownLength = await import_util18.default.promisify(data.getLength).call(data); Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength); } catch (e) { } @@ -118574,7 +119229,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { data, progressEventDecorator( contentLength2, - progressEventReducer(asyncDecorator(onUploadProgress), false, 3) + progressEventReducer(asyncDecorator(onUploadProgress, scheduleProgress), false, 3) ) ) ); @@ -118612,6 +119267,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { utils_default.hasOwnProp(transitional2, "advertiseZstdAcceptEncoding") && transitional2.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: path18, method, @@ -118622,9 +119280,11 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { family, beforeRedirect: dispatchBeforeRedirect, beforeRedirects: /* @__PURE__ */ Object.create(null), - http2Options + http2Options, + createConnection: void 0 }); !utils_default.isUndefined(lookup) && (options.lookup = lookup); + let proxyApplied = false; if (socketPath) { if (typeof socketPath !== "string") { return reject( @@ -118652,13 +119312,17 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { } else { options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname; options.port = parsed.port; - setProxy( + proxyApplied = setProxy( options, configProxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path, false, httpsAgent, - httpAgent + 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; @@ -118669,6 +119333,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { options.agent = isHttpsRequest ? httpsAgent : httpAgent; } if (isHttp2) { + if (proxyApplied) { + return reject( + new AxiosError_default( + "HTTP/2 requests with a proxy are not supported", + AxiosError_default.ERR_NOT_SUPPORT, + config + ) + ); + } transport = http2Transport; } else { const configTransport = own2("transport"); @@ -118756,7 +119429,11 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { transformStream, progressEventDecorator( responseLength, - progressEventReducer(asyncDecorator(onDownloadProgress), true, 3) + progressEventReducer( + asyncDecorator(onDownloadProgress, scheduleProgress), + true, + 3 + ) ) ) ); @@ -118905,12 +119582,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { 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; @@ -119070,6 +119742,16 @@ var cookies_default = platform_default.hasStandardBrowserEnv ? ( // node_modules/axios/lib/core/mergeConfig.js var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...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 || {}; @@ -119145,7 +119827,7 @@ function mergeConfig(config1, config2) { transformResponse: defaultToConfig2, paramsSerializer: defaultToConfig2, timeout: defaultToConfig2, - timeoutMessage: defaultToConfig2, + timeoutErrorMessage: defaultToConfig2, withCredentials: defaultToConfig2, withXSRFToken: defaultToConfig2, adapter: defaultToConfig2, @@ -119168,7 +119850,7 @@ function mergeConfig(config1, config2) { validateStatus: mergeDirectKeys, headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) }; - utils_default.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) { + utils_default.forEach(ownEnumerableKeys({ ...config1, ...config2 }), function computeConfigValue(prop) { if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return; const merge2 = utils_default.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties; const a = utils_default.hasOwnProp(config1, prop) ? config1[prop] : void 0; @@ -119187,18 +119869,6 @@ function mergeConfig(config1, config2) { } // node_modules/axios/lib/helpers/resolveConfig.js -var FORM_DATA_CONTENT_HEADERS2 = ["content-type", "content-length"]; -function setFormDataHeaders2(headers, formHeaders, policy) { - if (policy !== "content-only") { - headers.set(formHeaders); - return; - } - Object.entries(formHeaders || {}).forEach(([key, val]) => { - if (FORM_DATA_CONTENT_HEADERS2.includes(key.toLowerCase())) { - headers.set(key, val); - } - }); -} var encodeUTF8 = (str) => encodeURIComponent(str).replace( /%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)) @@ -119234,10 +119904,11 @@ function resolveConfig(config) { } } if (utils_default.isFormData(data)) { + const getHeaders = utils_default.getSafeProp(data, "getHeaders"); if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv || utils_default.isReactNative(data)) { headers.setContentType(void 0); - } else if (utils_default.isFunction(data.getHeaders)) { - setFormDataHeaders2(headers, data.getHeaders(), own2("formDataHeaderPolicy")); + } else if (utils_default.isFunction(getHeaders)) { + setFormDataHeaders(headers, getHeaders.call(data), own2("formDataHeaderPolicy")); } } if (platform_default.hasStandardBrowserEnv) { @@ -119266,7 +119937,7 @@ var xhr_default = isXHRAdapterSupported && function(config) { let { responseType, onUploadProgress, onDownloadProgress } = _config; let onCanceled; let uploadThrottled, downloadThrottled; - let flushUpload, flushDownload; + let flushUpload, flushDownload, flushDownloadWithEvent; function done() { flushUpload && flushUpload(); flushDownload && flushDownload(); @@ -119276,7 +119947,27 @@ var xhr_default = isXHRAdapterSupported && function(config) { 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(platform_default.origin)) !== "file" && !(request.responseURL && request.responseURL.startsWith("file:"))) { + reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request)); + done(); + request = null; + return; + } + try { + if (event) { + flushDownloadWithEvent && flushDownloadWithEvent(event); + } else { + flushDownload && flushDownload(); + } + } catch (err) { + setTimeout(() => { + throw err; + }); + } if (!request) { return; } @@ -119364,7 +120055,10 @@ var xhr_default = isXHRAdapterSupported && function(config) { 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) { @@ -119436,7 +120130,16 @@ var composeSignals = (signals, timeout) => { }); 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; signal.unsubscribe = () => utils_default.asap(unsubscribe); return signal; @@ -119525,6 +120228,17 @@ var trackStream = (stream7, chunkSize, onProgress, onFinish) => { // node_modules/axios/lib/adapters/fetch.js 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: isFunction2 } = utils_default; var encodeUTF82 = (str) => encodeURIComponent(str).replace( /%([0-9A-F]{2})/gi, @@ -119655,7 +120369,8 @@ var factory = (env) => { withCredentials = "same-origin", fetchOptions, maxContentLength, - maxBodyLength + maxBodyLength, + maxRedirects } = resolveConfig_default(config); const hasMaxContentLength = utils_default.isNumber(maxContentLength) && maxContentLength > -1; const hasMaxBodyLength = utils_default.isNumber(maxBodyLength) && maxBodyLength > -1; @@ -119785,17 +120500,44 @@ var factory = (env) => { } } 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_default.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(url3, resolvedOptions); - let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url3, resolvedOptions)); + let response = await (isRequestSupported ? _fetch(request, safeFetchOptions) : _fetch(url3, resolvedOptions)); const responseHeaders = AxiosHeaders_default.from(response.headers); if (hasMaxContentLength) { const declaredLength = utils_default.toFiniteNumber(responseHeaders.getContentLength()); @@ -120014,9 +120756,10 @@ function throwIfCancellationRequested(config) { throw new CanceledError_default(null, config); } } -function dispatchRequest(config) { +function dispatchRequest(_config) { + const config = utils_default.toSafeFlatObject(_config); throwIfCancellationRequested(config); - config.headers = AxiosHeaders_default.from(config.headers); + config.headers = AxiosHeaders_default.from(utils_default.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); @@ -120146,16 +120889,15 @@ var Axios = class { 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) { @@ -120225,9 +120967,9 @@ var Axios = class { }, true ); - config.method = (config.method || this.defaults.method || "get").toLowerCase(); + config.method = (utils_default.getSafeProp(config, "method") || utils_default.getSafeProp(this.defaults, "method") || "get").toLowerCase(); let contextHeaders = headers && utils_default.merge(headers.common, headers[config.method]); - headers && utils_default.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], (method) => { + headers && utils_default.forEach(methodList_default.concat("common"), (method) => { delete headers[method]; }); config.headers = AxiosHeaders_default.concat(contextHeaders, headers); @@ -120270,16 +121012,31 @@ var Axios = class { 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_default.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; @@ -120475,14 +121232,22 @@ var HttpStatusCode = { 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, @@ -120502,6 +121267,7 @@ var HttpStatusCode = { LoopDetected: 508, NotExtended: 510, NetworkAuthenticationRequired: 511, + WebServerReturnsAnUnknownError: 520, WebServerIsDown: 521, ConnectionTimedOut: 522, OriginIsUnreachable: 523, @@ -120510,7 +121276,9 @@ var HttpStatusCode = { InvalidSslCertificate: 526 }; Object.entries(HttpStatusCode).forEach(([key, value]) => { - HttpStatusCode[value] = key; + if (HttpStatusCode[value] === void 0) { + HttpStatusCode[value] = key; + } }); var HttpStatusCode_default = HttpStatusCode; @@ -120869,11 +121637,11 @@ mime-types/index.js: * MIT Licensed *) -smol-toml/dist/date.js: smol-toml/dist/error.js: smol-toml/dist/primitive.js: -smol-toml/dist/util.js: +smol-toml/dist/date.js: smol-toml/dist/extract.js: +smol-toml/dist/util.js: smol-toml/dist/struct.js: smol-toml/dist/parse.js: smol-toml/dist/stringify.js: diff --git a/dist/update-known-checksums/index.cjs b/dist/update-known-checksums/index.cjs index 2b8d1f4..750c7be 100644 --- a/dist/update-known-checksums/index.cjs +++ b/dist/update-known-checksums/index.cjs @@ -36436,7 +36436,7 @@ var require_cache2 = __commonJS({ var MAX_DELTA_SECONDS = 2147483647; var RESTRICTIVE_DIRECTIVE_NAMES = ["no-store", "private", "no-cache"]; var kInvalidCacheControlDirectives = /* @__PURE__ */ Symbol("invalid cache-control directives"); - function trimOWS(value) { + function trimOWS2(value) { return value.replace(/^[\t ]+|[\t ]+$/g, ""); } function arrayIncludes(array, value) { @@ -36688,10 +36688,10 @@ var require_cache2 = __commonJS({ const rawValue = directive.substring(keyValueDelimiter + 1); keyHasTrailingWhitespace = trimOWSEnd(rawKey) !== rawKey; valueHasLeadingWhitespace = trimOWSStart(rawValue) !== rawValue; - key = trimOWS(rawKey); + key = trimOWS2(rawKey); value = trimOWSStart(rawValue); } else { - key = trimOWS(directive); + key = trimOWS2(directive); } const malformedRestrictiveDirectiveName = getMalformedRestrictiveDirectiveName(key); if (malformedRestrictiveDirectiveName !== void 0) { @@ -36756,7 +36756,7 @@ var require_cache2 = __commonJS({ } else { const fieldListParts = [value.substring(1)]; for (let j = i + 1; j < directives.length; j++) { - const nextPart = trimOWS(directives[j].value); + const nextPart = trimOWS2(directives[j].value); const closingQuote2 = findUnescapedQuote(nextPart, 0); lastQuotedPart = j; if (closingQuote2 !== -1) { @@ -36776,7 +36776,7 @@ var require_cache2 = __commonJS({ const headers = fieldList.split(","); let validFieldNames = true; for (let j = 0; j < headers.length; j++) { - headers[j] = trimOWS(headers[j]); + headers[j] = trimOWS2(headers[j]); if (!isValidHTTPToken(headers[j])) { validFieldNames = false; } @@ -36791,7 +36791,7 @@ var require_cache2 = __commonJS({ } } } else { - const fieldName = trimOWS(value); + const fieldName = trimOWS2(value); if (!isValidHTTPToken(fieldName)) { output[key] = true; } else if (output[key] !== true) { @@ -36846,7 +36846,7 @@ var require_cache2 = __commonJS({ function hasVaryStar(varyHeader) { const values = splitVaryHeader(varyHeader); for (let i = 0; i < values.length; i++) { - if (trimOWS(values[i]).indexOf("*") !== -1) { + if (trimOWS2(values[i]).indexOf("*") !== -1) { return true; } } @@ -36862,7 +36862,7 @@ var require_cache2 = __commonJS({ ); const varyingHeaders = splitVaryHeader(varyHeader); for (const header of varyingHeaders) { - const trimmedHeader = trimOWS(header).toLowerCase(); + const trimmedHeader = trimOWS2(header).toLowerCase(); if (trimmedHeader.length === 0) { continue; } @@ -37478,7 +37478,7 @@ var require_cache_handler = __commonJS({ ]; var MAX_RESPONSE_AGE = 2147483647e3; var REVALIDATION_ONLY_RETENTION = 864e5; - function trimOWS(value) { + function trimOWS2(value) { return value.replace(/^[\t ]+|[\t ]+$/g, ""); } function arrayIncludes(array, value) { @@ -37494,7 +37494,7 @@ var require_cache_handler = __commonJS({ for (let i = 0; i < values.length; i++) { const tokens = values[i].split(","); for (let j = 0; j < tokens.length; j++) { - headersToRemove.push(trimOWS(tokens[j]).toLowerCase()); + headersToRemove.push(trimOWS2(tokens[j]).toLowerCase()); } } } @@ -38302,7 +38302,7 @@ var require_cache3 = __commonJS({ } var nop = () => { }; - function trimOWS(value) { + function trimOWS2(value) { return value.replace(/^[\t ]+|[\t ]+$/g, ""); } function arrayIncludes(array, value) { @@ -38326,7 +38326,7 @@ var require_cache3 = __commonJS({ } const directives = value.split(","); for (let j = 0; j < directives.length; j++) { - if (trimOWS(directives[j]).toLowerCase() === "no-cache") { + if (trimOWS2(directives[j]).toLowerCase() === "no-cache") { return true; } } @@ -64857,22 +64857,82 @@ var { toString } = Object.prototype; var { getPrototypeOf } = Object; var { iterator, toStringTag } = Symbol; 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()); @@ -64907,9 +64967,9 @@ var isPlainObject = (val) => { 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) => { @@ -64930,6 +64990,7 @@ var isReactNativeBlob = (value) => { 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(val.pipe); function getGlobal() { if (typeof globalThis !== "undefined") return globalThis; @@ -65225,11 +65286,20 @@ var toJSONObject = (obj) => { } 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; } @@ -65310,6 +65380,7 @@ var utils_default = { // an alias to avoid ESLint no-prototype-builtins detection hasOwnInPrototypeChain, getSafeProp, + toSafeFlatObject, reduceDescriptors, freezeMethods, toObjectSet, @@ -65358,17 +65429,18 @@ var parseHeaders_default = (rawHeaders) => { 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_default.hasOwnProp(parsed, key); + if (!key || hasKey && utils_default.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; @@ -65432,6 +65504,90 @@ function parseTokens(str) { } 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, filter2, isHeaderNameFilter) { if (utils_default.isFunction(filter2)) { @@ -65607,7 +65763,8 @@ var AxiosHeaders = class { 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_default.isArray(value) ? value : value == null || value === false ? [] : [value]; } get [Symbol.toStringTag]() { return "AxiosHeaders"; @@ -65615,6 +65772,9 @@ var AxiosHeaders = class { 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)); @@ -65710,9 +65870,30 @@ function redactConfig(config, redactKeys) { }; return visit(config); } +function stringifySafely(value) { + try { + return String(value); + } catch (err) { + return ""; + } +} +function aggregateErrorMessage(error2) { + const message = error2.errors.map((entry) => { + try { + return entry && entry.message ? stringifySafely(entry.message) : stringifySafely(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_default.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, @@ -65802,6 +65983,16 @@ var AxiosError_default = AxiosError; var import_form_data = __toESM(require_form_data(), 1); var FormData_default = import_form_data.default; +// node_modules/axios/lib/platform/node/classes/Buffer.js +var Buffer_default = { + isBufferAvailable() { + return typeof Buffer !== "undefined"; + }, + from(value) { + return Buffer.from(value); + } +}; + // node_modules/axios/lib/helpers/toFormData.js var DEFAULT_FORM_DATA_MAX_DEPTH = 100; function isVisitable(thing) { @@ -65828,24 +66019,16 @@ function toFormData(obj, formData, options) { throw new TypeError("target must be an object"); } formData = formData || new (FormData_default || FormData)(); - options = utils_default.toFlatObject( - options, - { - metaTokens: true, - dots: false, - indexes: false - }, - false, - function defined(option, source) { - return !utils_default.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_default.getSafeProp(options, name); + return utils_default.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_default.isSpecCompliantForm(formData); const stack = []; if (!utils_default.isFunction(visitor)) { @@ -65866,10 +66049,13 @@ function toFormData(obj, formData, options) { if (useBlob && typeof _Blob === "function") { return new _Blob([value]); } - if (typeof Buffer !== "undefined") { - return Buffer.from(value); + if (Buffer_default && Buffer_default.isBufferAvailable()) { + return Buffer_default.from(value); } - throw new AxiosError_default("Blob is not supported. Use a Buffer instead.", AxiosError_default.ERR_NOT_SUPPORT); + throw new AxiosError_default( + "Blob is not supported. Use a Buffer instead.", + AxiosError_default.ERR_NOT_SUPPORT + ); } return value; } @@ -66015,9 +66201,47 @@ function buildURL(url2, params, options) { } // node_modules/axios/lib/core/InterceptorManager.js +var $internals2 = /* @__PURE__ */ 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[$internals2] = { + handlersRef: this.handlers, + handlersLength: this.handlers.length, + handlerEntries: /* @__PURE__ */ new Map(), + iterationDepth: 0, + nextId: 0 + }; } /** * Add a new interceptor to the stack @@ -66029,13 +66253,25 @@ var InterceptorManager = class { * @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[$internals2]; + 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 @@ -66045,8 +66281,19 @@ var InterceptorManager = class { * @returns {void} */ eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; + const internals = this[$internals2]; + 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; + } } } /** @@ -66057,6 +66304,7 @@ var InterceptorManager = class { clear() { if (this.handlers) { this.handlers = []; + syncHandlerEntries(this, this[$internals2]); } } /** @@ -66070,11 +66318,22 @@ var InterceptorManager = class { * @returns {void} */ forEach(fn) { - utils_default.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); + const internals = this[$internals2]; + syncHandlerEntries(this, internals); + internals.iterationDepth++; + try { + utils_default.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 InterceptorManager_default = InterceptorManager; @@ -66176,7 +66435,7 @@ function throwIfDepthExceeded(index) { } function parsePropPath(name) { const path = []; - const pattern = /\w+|\[(\w*)]/g; + const pattern = /[^.[\]]+|\[([^.[\]]*)]/g; let match; while ((match = pattern.exec(name)) !== null) { throwIfDepthExceeded(path.length); @@ -66232,9 +66491,25 @@ function formDataToJSON(formData) { } var formDataToJSON_default = formDataToJSON; +// node_modules/axios/lib/core/methodList.js +var methodList = Object.freeze([ + "get", + "delete", + "head", + "options", + "post", + "put", + "patch", + "purge", + "link", + "unlink", + "query" +]); +var methodList_default = methodList; + // node_modules/axios/lib/defaults/index.js var own = (obj, key) => obj != null && utils_default.hasOwnProp(obj, key) ? obj[key] : void 0; -function stringifySafely(rawValue, parser, encoder) { +function stringifySafely2(rawValue, parser, encoder) { if (utils_default.isString(rawValue)) { try { (parser || JSON.parse)(rawValue); @@ -66290,7 +66565,7 @@ var defaults = { } if (isObjectPayload || hasJSONContentType) { headers.setContentType("application/json", false); - return stringifySafely(data); + return stringifySafely2(data); } return data; } @@ -66344,7 +66619,7 @@ var defaults = { } } }; -utils_default.forEach(["delete", "get", "head", "post", "put", "patch", "query"], (method) => { +utils_default.forEach(methodList_default, (method) => { defaults.headers[method] = {}; }); var defaults_default = defaults; @@ -66412,29 +66687,62 @@ function isAbsoluteURL(url2) { // node_modules/axios/lib/helpers/combineURLs.js 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(/^\/+/, ""); +} + +// node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +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, ""); } // node_modules/axios/lib/core/buildFullPath.js 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_default( - 'Invalid URL: missing "//" after protocol', - AxiosError_default.ERR_INVALID_URL, - config - ); + if (typeof url2 === "string") { + const normalizedURL = normalizeURLForProtocolCheck(url2); + if (malformedHttpProtocol.test(normalizedURL)) { + throw new AxiosError_default( + `Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing "//" after protocol`, + AxiosError_default.ERR_INVALID_URL, + config + ); + } } } function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) { @@ -66525,7 +66833,7 @@ var import_follow_redirects = __toESM(require_follow_redirects(), 1); var import_zlib = __toESM(require("zlib"), 1); // node_modules/axios/lib/env/data.js -var VERSION = "1.18.1"; +var VERSION = "1.20.0"; // node_modules/axios/lib/helpers/parseProtocol.js function parseProtocol(url2) { @@ -66534,7 +66842,7 @@ function parseProtocol(url2) { } // node_modules/axios/lib/helpers/fromDataURI.js -var DATA_URL_PATTERN = /^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/; +var DATA_URL_PATTERN = /^([^,;/]+\/[^,;/]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/; function fromDataURI(uri, asBlob, options) { const _Blob = options && options.Blob || platform_default.classes.Blob; const protocol = parseProtocol(uri); @@ -66572,6 +66880,20 @@ function fromDataURI(uri, asBlob, options) { // node_modules/axios/lib/adapters/http.js var import_stream4 = __toESM(require("stream"), 1); +// node_modules/axios/lib/core/setFormDataHeaders.js +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); + } + }); +} + // node_modules/axios/lib/helpers/AxiosTransformStream.js var import_stream = __toESM(require("stream"), 1); var kInternals = /* @__PURE__ */ Symbol("internals"); @@ -66833,6 +67155,7 @@ var Http2Sessions = class { } getSession(authority, options) { options = Object.assign( + /* @__PURE__ */ Object.create(null), { sessionTimeout: 1e3 }, @@ -66898,6 +67221,7 @@ var Http2Sessions = class { }; } session.once("close", removeSession); + session.once("error", removeSession); let entry = [session, options]; authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry]; return session; @@ -66922,12 +67246,73 @@ var callbackify_default = callbackify; // node_modules/axios/lib/helpers/shouldBypassProxy.js 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; @@ -67012,6 +67397,40 @@ var unmapIPv4MappedIPv6 = (host) => { } 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; @@ -67019,7 +67438,89 @@ var normalizeNoProxyHost = (hostname) => { 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(location) { let parsed; @@ -67037,10 +67538,18 @@ function shouldBypassProxy(location) { } const port = Number.parseInt(parsed.port, 10) || DEFAULT_PORTS2[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) { @@ -67126,7 +67635,8 @@ function throttle(fn, freq) { } }; const flush = () => lastArgs && invoke(lastArgs); - return [throttled, flush]; + const flushWith = (...args) => invoke(args); + return [throttled, flush, flushWith]; } var throttle_default = throttle; @@ -67135,12 +67645,12 @@ var progressEventReducer = (listener, isDownloadStream, freq = 3) => { let bytesNotified = 0; const _speedometer = speedometer_default(50, 250); return throttle_default((e) => { - if (!e || typeof e.loaded !== "number") { + if (!e || !utils_default.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); @@ -67169,12 +67679,66 @@ var progressEventDecorator = (total, throttled) => { throttled[1] ]; }; -var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args)); +var asyncDecorator = (fn, scheduler = utils_default.asap) => (...args) => scheduler(() => fn(...args)); // node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js 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(","); @@ -67183,43 +67747,7 @@ function estimateDataURLDecodedBytes(url2) { 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++) { @@ -67244,6 +67772,16 @@ function estimateDataURLDecodedBytes(url2) { } } 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); } // node_modules/axios/lib/adapters/http.js @@ -67263,22 +67801,17 @@ var isBrotliSupported = utils_default.isFunction(import_zlib.default.createBrotl var isZstdSupported = utils_default.isFunction(import_zlib.default.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_default.asap; var { http: httpFollow, https: httpsFollow } = import_follow_redirects.default; var isHttps = /https:?/; -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 kAxiosSocketListener = /* @__PURE__ */ Symbol("axios.http.socketListener"); var kAxiosCurrentReq = /* @__PURE__ */ Symbol("axios.http.currentReq"); +function handleSocketError(err) { + const current = this[kAxiosCurrentReq]; + if (current && !current.destroyed) { + current.destroy(err); + } +} var kAxiosInstalledTunnel = /* @__PURE__ */ Symbol("axios.http.installedTunnel"); var tunnelingAgentCache = /* @__PURE__ */ new Map(); var tunnelingAgentCacheUser = /* @__PURE__ */ new WeakMap(); @@ -67381,10 +67914,10 @@ function isSameOriginRedirect(redirectOptions, requestDetails) { return false; } } -function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent) { +function setProxy(options, configProxy, location, 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(location); if (proxyUrl) { if (!shouldBypassProxy(location)) { @@ -67481,9 +68014,13 @@ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, redirectOptions.href, true, configHttpsAgent, - configHttpAgent + configHttpAgent, + allowEnvProxy ); }; + return Boolean( + proxy || configProxy !== false && allowEnvProxy && isNodeEnvProxyEnabled(proxyEnvAgent) + ); } var isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process"; var wrapAsync = (asyncExecutor) => { @@ -67508,7 +68045,7 @@ var wrapAsync = (asyncExecutor) => { }; var resolveFamily = ({ address, family }) => { if (!utils_default.isString(address)) { - throw TypeError("address must be a string"); + throw new AxiosError_default("address must be a string", AxiosError_default.ERR_BAD_OPTION_VALUE); } return { address, @@ -67516,6 +68053,30 @@ var resolveFamily = ({ address, family }) => { }; }; var buildAddressEntry = (address, family) => resolveFamily(utils_default.isObject(address) ? address : { address, family }); +var normalizedLookupCache = /* @__PURE__ */ new WeakMap(); +var normalizeLookup = (lookup) => { + let normalized = normalizedLookupCache.get(lookup); + if (normalized) { + return normalized; + } + const callbackLookup = callbackify_default(lookup, (value) => utils_default.isArray(value) ? value : [value]); + normalized = (hostname, opt, cb) => { + callbackLookup(hostname, opt, (err, arg0, arg1) => { + if (err) { + return cb(err); + } + let addresses; + try { + addresses = utils_default.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)); @@ -67552,6 +68113,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { 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"); @@ -67568,25 +68130,32 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { let rejected = false; let req; let connectPhaseTimer; - httpVersion = +httpVersion; + try { + httpVersion = +httpVersion; + } catch (err) { + throw new AxiosError_default( + "Invalid protocol version: value is not a number", + AxiosError_default.ERR_BAD_OPTION_VALUE, + config + ); + } if (Number.isNaN(httpVersion)) { - throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`); + throw new AxiosError_default( + `Invalid protocol version: '${rawHttpVersion}' is not a number`, + AxiosError_default.ERR_BAD_OPTION_VALUE, + config + ); } if (httpVersion !== 1 && httpVersion !== 2) { - throw TypeError(`Unsupported protocol version '${httpVersion}'`); + throw new AxiosError_default( + `Unsupported protocol version '${httpVersion}'`, + AxiosError_default.ERR_BAD_OPTION_VALUE, + config + ); } const isHttp2 = httpVersion === 2; if (lookup) { - const _lookup = callbackify_default(lookup, (value) => utils_default.isArray(value) ? value : [value]); - lookup = (hostname, opt, cb) => { - _lookup(hostname, opt, (err, arg0, arg1) => { - if (err) { - return cb(err); - } - const addresses = utils_default.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 import_events.EventEmitter(); function abort(reason) { @@ -67660,7 +68229,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { 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_default( @@ -67791,7 +68360,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { data, progressEventDecorator( contentLength, - progressEventReducer(asyncDecorator(onUploadProgress), false, 3) + progressEventReducer(asyncDecorator(onUploadProgress, scheduleProgress), false, 3) ) ) ); @@ -67829,6 +68398,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { utils_default.hasOwnProp(transitional2, "advertiseZstdAcceptEncoding") && transitional2.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, method, @@ -67839,9 +68411,11 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { family, beforeRedirect: dispatchBeforeRedirect, beforeRedirects: /* @__PURE__ */ Object.create(null), - http2Options + http2Options, + createConnection: void 0 }); !utils_default.isUndefined(lookup) && (options.lookup = lookup); + let proxyApplied = false; if (socketPath) { if (typeof socketPath !== "string") { return reject( @@ -67869,13 +68443,17 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { } else { options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname; options.port = parsed.port; - setProxy( + proxyApplied = setProxy( options, configProxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path, false, httpsAgent, - httpAgent + 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; @@ -67886,6 +68464,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { options.agent = isHttpsRequest ? httpsAgent : httpAgent; } if (isHttp2) { + if (proxyApplied) { + return reject( + new AxiosError_default( + "HTTP/2 requests with a proxy are not supported", + AxiosError_default.ERR_NOT_SUPPORT, + config + ) + ); + } transport = http2Transport; } else { const configTransport = own2("transport"); @@ -67973,7 +68560,11 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { transformStream, progressEventDecorator( responseLength, - progressEventReducer(asyncDecorator(onDownloadProgress), true, 3) + progressEventReducer( + asyncDecorator(onDownloadProgress, scheduleProgress), + true, + 3 + ) ) ) ); @@ -68122,12 +68713,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) { 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; @@ -68287,6 +68873,16 @@ var cookies_default = platform_default.hasStandardBrowserEnv ? ( // node_modules/axios/lib/core/mergeConfig.js var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...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 || {}; @@ -68362,7 +68958,7 @@ function mergeConfig(config1, config2) { transformResponse: defaultToConfig2, paramsSerializer: defaultToConfig2, timeout: defaultToConfig2, - timeoutMessage: defaultToConfig2, + timeoutErrorMessage: defaultToConfig2, withCredentials: defaultToConfig2, withXSRFToken: defaultToConfig2, adapter: defaultToConfig2, @@ -68385,7 +68981,7 @@ function mergeConfig(config1, config2) { validateStatus: mergeDirectKeys, headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) }; - utils_default.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) { + utils_default.forEach(ownEnumerableKeys({ ...config1, ...config2 }), function computeConfigValue(prop) { if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return; const merge2 = utils_default.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties; const a = utils_default.hasOwnProp(config1, prop) ? config1[prop] : void 0; @@ -68404,18 +69000,6 @@ function mergeConfig(config1, config2) { } // node_modules/axios/lib/helpers/resolveConfig.js -var FORM_DATA_CONTENT_HEADERS2 = ["content-type", "content-length"]; -function setFormDataHeaders2(headers, formHeaders, policy) { - if (policy !== "content-only") { - headers.set(formHeaders); - return; - } - Object.entries(formHeaders || {}).forEach(([key, val]) => { - if (FORM_DATA_CONTENT_HEADERS2.includes(key.toLowerCase())) { - headers.set(key, val); - } - }); -} var encodeUTF8 = (str) => encodeURIComponent(str).replace( /%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)) @@ -68451,10 +69035,11 @@ function resolveConfig(config) { } } if (utils_default.isFormData(data)) { + const getHeaders = utils_default.getSafeProp(data, "getHeaders"); if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv || utils_default.isReactNative(data)) { headers.setContentType(void 0); - } else if (utils_default.isFunction(data.getHeaders)) { - setFormDataHeaders2(headers, data.getHeaders(), own2("formDataHeaderPolicy")); + } else if (utils_default.isFunction(getHeaders)) { + setFormDataHeaders(headers, getHeaders.call(data), own2("formDataHeaderPolicy")); } } if (platform_default.hasStandardBrowserEnv) { @@ -68483,7 +69068,7 @@ var xhr_default = isXHRAdapterSupported && function(config) { let { responseType, onUploadProgress, onDownloadProgress } = _config; let onCanceled; let uploadThrottled, downloadThrottled; - let flushUpload, flushDownload; + let flushUpload, flushDownload, flushDownloadWithEvent; function done() { flushUpload && flushUpload(); flushDownload && flushDownload(); @@ -68493,7 +69078,27 @@ var xhr_default = isXHRAdapterSupported && function(config) { 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(platform_default.origin)) !== "file" && !(request.responseURL && request.responseURL.startsWith("file:"))) { + reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request)); + done(); + request = null; + return; + } + try { + if (event) { + flushDownloadWithEvent && flushDownloadWithEvent(event); + } else { + flushDownload && flushDownload(); + } + } catch (err) { + setTimeout(() => { + throw err; + }); + } if (!request) { return; } @@ -68581,7 +69186,10 @@ var xhr_default = isXHRAdapterSupported && function(config) { 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) { @@ -68653,7 +69261,16 @@ var composeSignals = (signals, timeout) => { }); 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; signal.unsubscribe = () => utils_default.asap(unsubscribe); return signal; @@ -68742,6 +69359,17 @@ var trackStream = (stream4, chunkSize, onProgress, onFinish) => { // node_modules/axios/lib/adapters/fetch.js 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: isFunction2 } = utils_default; var encodeUTF82 = (str) => encodeURIComponent(str).replace( /%([0-9A-F]{2})/gi, @@ -68872,7 +69500,8 @@ var factory = (env) => { withCredentials = "same-origin", fetchOptions, maxContentLength, - maxBodyLength + maxBodyLength, + maxRedirects } = resolveConfig_default(config); const hasMaxContentLength = utils_default.isNumber(maxContentLength) && maxContentLength > -1; const hasMaxBodyLength = utils_default.isNumber(maxBodyLength) && maxBodyLength > -1; @@ -69002,17 +69631,44 @@ var factory = (env) => { } } 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_default.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_default.from(response.headers); if (hasMaxContentLength) { const declaredLength = utils_default.toFiniteNumber(responseHeaders.getContentLength()); @@ -69231,9 +69887,10 @@ function throwIfCancellationRequested(config) { throw new CanceledError_default(null, config); } } -function dispatchRequest(config) { +function dispatchRequest(_config) { + const config = utils_default.toSafeFlatObject(_config); throwIfCancellationRequested(config); - config.headers = AxiosHeaders_default.from(config.headers); + config.headers = AxiosHeaders_default.from(utils_default.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); @@ -69363,16 +70020,15 @@ var Axios = class { 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) { @@ -69442,9 +70098,9 @@ var Axios = class { }, true ); - config.method = (config.method || this.defaults.method || "get").toLowerCase(); + config.method = (utils_default.getSafeProp(config, "method") || utils_default.getSafeProp(this.defaults, "method") || "get").toLowerCase(); let contextHeaders = headers && utils_default.merge(headers.common, headers[config.method]); - headers && utils_default.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], (method) => { + headers && utils_default.forEach(methodList_default.concat("common"), (method) => { delete headers[method]; }); config.headers = AxiosHeaders_default.concat(contextHeaders, headers); @@ -69487,16 +70143,31 @@ var Axios = class { 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_default.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; @@ -69692,14 +70363,22 @@ var HttpStatusCode = { 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, @@ -69719,6 +70398,7 @@ var HttpStatusCode = { LoopDetected: 508, NotExtended: 510, NetworkAuthenticationRequired: 511, + WebServerReturnsAnUnknownError: 520, WebServerIsDown: 521, ConnectionTimedOut: 522, OriginIsUnreachable: 523, @@ -69727,7 +70407,9 @@ var HttpStatusCode = { InvalidSslCertificate: 526 }; Object.entries(HttpStatusCode).forEach(([key, value]) => { - HttpStatusCode[value] = key; + if (HttpStatusCode[value] === void 0) { + HttpStatusCode[value] = key; + } }); var HttpStatusCode_default = HttpStatusCode; diff --git a/docs/advanced-version-configuration.md b/docs/advanced-version-configuration.md index 507fcfc..8af6892 100644 --- a/docs/advanced-version-configuration.md +++ b/docs/advanced-version-configuration.md @@ -19,7 +19,7 @@ When `manifest-file` is set, `latest-known` still selects a version from setup-u ```yaml - name: Install the latest version of uv known to setup-uv - uses: step-security/setup-uv@v9 + uses: step-security/setup-uv@v10 with: version: "latest-known" ``` diff --git a/docs/caching.md b/docs/caching.md index 0b96291..8d7011e 100644 --- a/docs/caching.md +++ b/docs/caching.md @@ -139,9 +139,11 @@ By default, the cache will be restored. ## Save cache -You can also disable saving the cache after the run with the `save-cache` input. +You can control saving the cache after the run with the `save-cache` input. This can be useful to save cache storage when you know you will not use the cache of the run again. -By default, the cache will be saved. +By default, `save-cache: auto` saves the cache except for `merge_group` events, where caches created +for temporary merge queue refs are unlikely to be reused. Cache restoration remains enabled for +these events. Set `save-cache: true` to save the cache for all events. ```yaml - name: Don't save the cache after the run diff --git a/package-lock.json b/package-lock.json index 161d74d..c96cf36 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,19 +16,19 @@ "@actions/io": "^3.0.2", "@actions/tool-cache": "^4.0.0", "@renovatebot/pep440": "^5.0.0", - "axios": "^1.18.1", - "smol-toml": "^1.7.1", + "axios": "^1.20.0", + "smol-toml": "^1.8.0", "undici": "^8.10.0" }, "devDependencies": { - "@biomejs/biome": "^2.5.8", + "@biomejs/biome": "^2.5.9", "@types/js-yaml": "^4.0.9", "@types/node": "^26.2.0", "@types/semver": "^7.8.0", - "@vercel/ncc": "^0.44.1", + "@vercel/ncc": "^0.45.0", "esbuild": "^0.28.2", "jest": "^30.4.2", - "js-yaml": "^5.2.3", + "js-yaml": "^5.3.0", "ts-jest": "^29.4.11", "typescript": "^6.0.3" }, @@ -2600,9 +2600,9 @@ ] }, "node_modules/@vercel/ncc": { - "version": "0.44.1", - "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.44.1.tgz", - "integrity": "sha512-cUjIE5P2YY1n+Kt9rFIazMMpGoPn1Fic04rOmTkElMkiDP5oszGfERMpo2shVkFKDL7rVppdM2pqJKC59shQWQ==", + "version": "0.45.0", + "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.45.0.tgz", + "integrity": "sha512-8zPi1yO2mHpoKTD+e+Bf0ZT3e+sWHSOyGapm9s7b5R0gxJi3CiFTqmeQiMEyu6ejrz2s09M8JkEoUaTWjBJPQQ==", "dev": true, "license": "MIT", "bin": { @@ -2713,13 +2713,13 @@ "license": "MIT" }, "node_modules/axios": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.18.1.tgz", - "integrity": "sha512-3nTvFlvpn9Zu/RkHUqtc7/+al4UpRW5az71ap5zccp6e8RAYEzhMTecX8Dz1wWDYrPpUoB1HAQEGEAEvUr7S9g==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.20.0.tgz", + "integrity": "sha512-r8aOh8j9cGKpgQAqpzrUHnSIc6a59Y3Xf/cv8sy1DrHCkZHzQGEuoq1tARk6qSyDdtQGSDgpb9kFlruzPvrgwg==", "license": "MIT", "dependencies": { "follow-redirects": "^1.16.0", - "form-data": "^4.0.5", + "form-data": "^4.0.6", "https-proxy-agent": "^5.0.1", "proxy-from-env": "^2.1.0" } @@ -4771,9 +4771,9 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.3.tgz", - "integrity": "sha512-n+mUVyUX5bVv7G/G2zyIHOhdxfuU1dY2NOFzTQUWiMUbFss8b57NFlgCCaggU78wSw5KVS9cllzeLyzyR+n5nw==", + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.4.2.tgz", + "integrity": "sha512-m+aqu+LwO1O6sIopafj8HUVl5aawITwZQe/yHpMCKjaWBaA/d07B/QdMb3529REftiU+RMMHL3Vlsw3hON7vWg==", "dev": true, "funding": [ { @@ -5445,9 +5445,9 @@ } }, "node_modules/smol-toml": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.7.1.tgz", - "integrity": "sha512-PPlsspAZ4jbMBu5DMFhfUGDQLu/vrL4SyBROVS37x8ynnVmFIs1VPBz1Co8Xks3TvpIaZXmU85y4DrQ+UyVFoQ==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.9.0.tgz", + "integrity": "sha512-hpd+HLON7HdZXqYchMM/+LaTTbdK0AU3NngIJ4KVyWbY9bfQqdL9cD+4yf6dUoU2Ap4VsU0JkQi6FxAI1B2mXQ==", "license": "BSD-3-Clause", "engines": { "node": ">= 18" diff --git a/package.json b/package.json index d770422..8933425 100644 --- a/package.json +++ b/package.json @@ -45,19 +45,19 @@ "@actions/io": "^3.0.2", "@actions/tool-cache": "^4.0.0", "@renovatebot/pep440": "^5.0.0", - "axios": "^1.18.1", - "smol-toml": "^1.7.1", + "axios": "^1.20.0", + "smol-toml": "^1.8.0", "undici": "^8.10.0" }, "devDependencies": { - "@biomejs/biome": "^2.5.8", + "@biomejs/biome": "^2.5.9", "@types/js-yaml": "^4.0.9", "@types/node": "^26.2.0", "@types/semver": "^7.8.0", - "@vercel/ncc": "^0.44.1", + "@vercel/ncc": "^0.45.0", "esbuild": "^0.28.2", "jest": "^30.4.2", - "js-yaml": "^5.2.3", + "js-yaml": "^5.3.0", "ts-jest": "^29.4.11", "typescript": "^6.0.3" } diff --git a/src/download/checksum/known-checksums.json b/src/download/checksum/known-checksums.json index ed94e69..b0b9dfe 100644 --- a/src/download/checksum/known-checksums.json +++ b/src/download/checksum/known-checksums.json @@ -1,4 +1,94 @@ { + "aarch64-apple-darwin-0.12.17": "85f00cbdc6dd3e97eba4c31b4d014375a9fdfe8f570023b84e5102fc3456896b", + "aarch64-pc-windows-msvc-0.12.17": "3e1aa6849d77f0e00dc865e4afab5c5b32de053e21fe35bf5ad5cec3734ec976", + "aarch64-unknown-linux-gnu-0.12.17": "d636d1b678e9e7f367ecb22b46bd1cabbed234d6bc3b4d96365d2b507f72f86c", + "aarch64-unknown-linux-musl-0.12.17": "a6096da273d548cb9f277d237a01ac7344a39ef0f455c0e148e4dc9737c1596b", + "arm-unknown-linux-musleabihf-0.12.17": "16a98a65ef8545f7c32cf717683aac44248369ffaa41c43e665341489359c654", + "armv7-unknown-linux-gnueabihf-0.12.17": "796e101976e18a0f92d90b6f3efd289f77fbc5afd1aaa6fdedd3c84c209eabab", + "armv7-unknown-linux-musleabihf-0.12.17": "421c5f9c53d49088e705e7a64fea147082a2191178ea1d8c51d9ad758ca899f6", + "i686-pc-windows-msvc-0.12.17": "1d3653cb6eafd1e675e979d7cd8eeac1456202f8927a2216419993077a4c473f", + "i686-unknown-linux-gnu-0.12.17": "3faa79a70e2a1aa6eb3cd78eba02263f3e4b17b6be584a01429968f92ff74966", + "i686-unknown-linux-musl-0.12.17": "fc05220cfa1c6585e0e209877c228393b25a96e17cd43028b06566ac894cd078", + "powerpc64le-unknown-linux-gnu-0.12.17": "eb6dbedaaa622af32cba2388e0d2d47e34c8724d4214a129d614b96f071d8e53", + "riscv64gc-unknown-linux-gnu-0.12.17": "65b807b24357133c49d97ca9394ee7e13ca62822e1095376c809654b35f39cf2", + "riscv64gc-unknown-linux-musl-0.12.17": "87c339a735b578f285b961bebdefe0a671f3652477d1e84dc69cd1a829f45e92", + "s390x-unknown-linux-gnu-0.12.17": "d99f69f47fc5e0975d6e7a5745cf2332317015caffb3bb81e5154cc7b66fa77a", + "x86_64-apple-darwin-0.12.17": "8dcf05a8c809bb3c471d2b614788ba27a6e41298fc8c31ac84b5f4339fd468e5", + "x86_64-pc-windows-msvc-0.12.17": "a252121d5b59398fcb137c6ea448176459a44010f33f67e0072305a637119ca7", + "x86_64-unknown-linux-gnu-0.12.17": "fa82fd8dde8e8eefdecada6aa0889666556cfceb690d06e0c3bca49eb3070a63", + "x86_64-unknown-linux-musl-0.12.17": "6401c4665d8fa2a9893e087c91f585430738e3170f5398a1141483efb4a93310", + "aarch64-apple-darwin-0.12.16": "b6e03fae61704b1aa622f12b792a69483e837b83068e44f4fd34f8a07a8f74a3", + "aarch64-pc-windows-msvc-0.12.16": "9977129f89c4036edfcb200d2484755571e51fa74517f02e478c1d7bcc353b2e", + "aarch64-unknown-linux-gnu-0.12.16": "36d913ee9c647481d64f1a0a0485f85ff2feaee605c341fc22e73398f9212c26", + "aarch64-unknown-linux-musl-0.12.16": "5beba1f35c0922fd086cce850ce919e55bc4e873c4fcda891343526afdb4c5b3", + "arm-unknown-linux-musleabihf-0.12.16": "d91fa9dede60e851e4bb3ae8060300042bc6bf924476fae71898d2c08c46a9cf", + "armv7-unknown-linux-gnueabihf-0.12.16": "fbdfca5d4ace4a5abbf343c0f10a0b68c5eac0201073d2a504e32c57c0873669", + "armv7-unknown-linux-musleabihf-0.12.16": "f5a3b6c7fbd4c7ea66cbd704d821ffed0d20abbfa8a12c2e68d6dd22476d308b", + "i686-pc-windows-msvc-0.12.16": "0d4889cc6c4058f4fbc28f6c50ec09b528ef998547cac5c3425e1a0b8169e847", + "i686-unknown-linux-gnu-0.12.16": "0e8743e653ed124c526a9e86ee6a08fa6eee7618a3f12cc9033c74674bd2047f", + "i686-unknown-linux-musl-0.12.16": "f609686cbe67884eeb57daebd58eb0fef35f930dd92fd2c14e931da7515c7454", + "powerpc64le-unknown-linux-gnu-0.12.16": "312dc82f441debff371fe5fc0068b538787678d6d79edc86f028b011920a2f6a", + "riscv64gc-unknown-linux-gnu-0.12.16": "8b0142eee9d291c602218126e3fc558fe9bc1b7c8f1cc0b03dcd8df9f2f218a1", + "riscv64gc-unknown-linux-musl-0.12.16": "188af30f025c35569b302b84793a4c286f6740902885d054917375edbfd0193c", + "s390x-unknown-linux-gnu-0.12.16": "b90cc954c2cd52b695104e215189a0c8d9e6ceaee753c9be1a871bb8d969e9c3", + "x86_64-apple-darwin-0.12.16": "a42bcc9ce97eb8b364d7f162233a9c6b8c0ee25388e551d362809795127e0c31", + "x86_64-pc-windows-msvc-0.12.16": "f730454bf09019754e5e5abd71a8aa18683cb739cba0d9c720bac2e7c901160f", + "x86_64-unknown-linux-gnu-0.12.16": "8e5c6e5523dffc2dcf615bd995554c84c9feb4e577808a3fb8698a639d3f8d9c", + "x86_64-unknown-linux-musl-0.12.16": "a01206ffbd60f3a7ee30949be1863527986f5307494a064042c69ce7e6d44799", + "aarch64-apple-darwin-0.12.15": "dc304b9ed1b24174572290fba60ac3f6fe63c73a671f0439e62a91375841964d", + "aarch64-pc-windows-msvc-0.12.15": "a37c8e96cb1260488c8510b64c848533a3a82a2fdf9e905de7c2700ceebf6437", + "aarch64-unknown-linux-gnu-0.12.15": "0e9a3499b0587d449c9ff684c0160da607826e4af1cee220bc87f378702d3e08", + "aarch64-unknown-linux-musl-0.12.15": "93b801abb146e6431fb0434346a0162e65d3f0d1cd7360144d04c43488fd7f7d", + "arm-unknown-linux-musleabihf-0.12.15": "9b0204dbd368a7a5f84d3ef015684c3b0e830911641ebf4575f44ad4901c1b3e", + "armv7-unknown-linux-gnueabihf-0.12.15": "a0afe9cfc7dc4acc18e613f68c5b010b849323b3a3d6e9311b29d289dc94f95e", + "armv7-unknown-linux-musleabihf-0.12.15": "a113c782e6f96a56f73aba601cde73ddbe877e0a4179eabeb5b6e86be9bb75d9", + "i686-pc-windows-msvc-0.12.15": "cc8b28f77cf19f7ed88569d6d9163e503ebc94e1b70069889852bcf38839c559", + "i686-unknown-linux-gnu-0.12.15": "6fa19118f01ee547d5b9a3f4af389c5c929a34e0074a4313d3cdb3ce9c97fdcd", + "i686-unknown-linux-musl-0.12.15": "b66d6cf7916addeda13fbb61abe003ecc62f048e3a213d6bd2494ca7e8022989", + "powerpc64le-unknown-linux-gnu-0.12.15": "5f49c97ae7ec25c45513466e00a32cacb148f3824367c7e498c0b53a270bc1e2", + "riscv64gc-unknown-linux-gnu-0.12.15": "4c8f75c5969737b67621957010df5337bb721a8d48fdbb1620f5d35c3f1dd268", + "riscv64gc-unknown-linux-musl-0.12.15": "8c03514f57e517eb87a376deb3d6475045f6ce550956c6082910b4a529d08a47", + "s390x-unknown-linux-gnu-0.12.15": "1f5701cb5eedc5a34d3dd5896ca3bf509b15d382b3448f370df46e0a631889c1", + "x86_64-apple-darwin-0.12.15": "e9ca61775532368fe518ab03e7a354c7ecab8ccb3c7d941c775fcc4a362b801b", + "x86_64-pc-windows-msvc-0.12.15": "477bd99a84e34891f2bd4c9152ddeb74e971accccbc59c0f0301f11f08a32d46", + "x86_64-unknown-linux-gnu-0.12.15": "f97935763c04be3e692460a7aaeaaab8fc3b78fcf8b389da820b38ae7423a638", + "x86_64-unknown-linux-musl-0.12.15": "999c0c3da986953e508985c3932d283d2c62eb167b4f8d81e79f565e34104959", + "aarch64-apple-darwin-0.12.14": "dfed5683c5873d65eff8476eb93526059b81e5646a68305b5c94a26b29990894", + "aarch64-pc-windows-msvc-0.12.14": "46b930bdbb338099c7d9da711b751240eb97876eda6a553a2c28323967232041", + "aarch64-unknown-linux-gnu-0.12.14": "7fb91bd5d10529c60723eaec3caf44726f89280e5aeed78af8fc63fcad004c9b", + "aarch64-unknown-linux-musl-0.12.14": "571b5c73c9bcc294f8087f22613edb7c7ceb191f4dbf8cafd3f2ff15e6147d36", + "arm-unknown-linux-musleabihf-0.12.14": "6e0df0e690d5c29ce65ec6962d8b262a93e9951077f05d78943f858e7d6e9185", + "armv7-unknown-linux-gnueabihf-0.12.14": "c20a18bb275a6fc2599bc321d37e52650a449237c6111da203a1d73b45921b25", + "armv7-unknown-linux-musleabihf-0.12.14": "a128725e1e40226a9309d603cbb4c36e272932092a77f4d0478ef2fb8eacaa05", + "i686-pc-windows-msvc-0.12.14": "ddd9afd789c60a38d82f3021239e22daacc67b9ef0719345ee6f0dcc37ab93ae", + "i686-unknown-linux-gnu-0.12.14": "de65ccdb90dd818248161db761ae3b6713b1b3230a1b55068ad327598b3a14b8", + "i686-unknown-linux-musl-0.12.14": "268538a3b90c90f7d68d31ed781f0f2cb8618188019c8bb09ce0e7876bb54829", + "powerpc64le-unknown-linux-gnu-0.12.14": "6a6c2a91d6240700eb36895c3fb0533bd5e9c696a95e0a55f7a7ae844cbde537", + "riscv64gc-unknown-linux-gnu-0.12.14": "df2c854c77b1d32f75ef08282511b050066b3db9d7abc4dc2c23ea26227c6b74", + "riscv64gc-unknown-linux-musl-0.12.14": "c6d0824ebdf23811dfa659148ae2c224b385d07ae1b4c282e5bf6abe3d603a74", + "s390x-unknown-linux-gnu-0.12.14": "e01aec9706c88f93f90409eab42324571e2b2c9c2938aaa266ad048b37c52c6f", + "x86_64-apple-darwin-0.12.14": "e11a70264ceca38e929ecaeed953c323e517af7b960ebf9722d5918e8c7f0375", + "x86_64-pc-windows-msvc-0.12.14": "02cecb254f37f3396da625680796d3990164a590fb5611d46f719ad83e7b9a89", + "x86_64-unknown-linux-gnu-0.12.14": "18ef5c3888ae59828cb13f38d57e9389b8173ecc719eff163bfafc74b38f5936", + "x86_64-unknown-linux-musl-0.12.14": "df163630683e5a2106d3320e2a448fde8eda5e7b9b47f617c5c332769728e735", + "aarch64-apple-darwin-0.12.13": "7e6ddb9316acc00f2296c82ff4d99977870ee34b2f0ddcae9444d714db9364ed", + "aarch64-pc-windows-msvc-0.12.13": "1efb2654b06e7063d4ac1fc9d49a9bda9a6704d82f035b589a2751a592f14151", + "aarch64-unknown-linux-gnu-0.12.13": "2eaa5d94f5db7b3a1a092156b9420459e42ab0217d917fe74a876309cef9b5e9", + "aarch64-unknown-linux-musl-0.12.13": "f44bc1037a17889fe562fffd2002d4ed108e499fbe68b4f022af244dc7b8244f", + "arm-unknown-linux-musleabihf-0.12.13": "2c7644f891edcf1e74a1b9dde96ea4ba00b41301c936c87e843683656703ada2", + "armv7-unknown-linux-gnueabihf-0.12.13": "19252c4d21fce112817b9e07bef6b2e9c90cef80fe82659533105b37a772d067", + "armv7-unknown-linux-musleabihf-0.12.13": "54e2c10e4e6c18a3efbac645ea02d7e6b768ae2f975275595915a7039e802b75", + "i686-pc-windows-msvc-0.12.13": "4ddcdf859d3bd337a156a2fc567e685e4b3d61e07b4a2dbbed7aeb4325e116ac", + "i686-unknown-linux-gnu-0.12.13": "beb56f6eda61bc69a8acc1bca07929365aa5cd2e912e35c35003a45e266d8a0e", + "i686-unknown-linux-musl-0.12.13": "6c93a9703b6145266240cb2aeb31d3574c21b33570fddf92461707b906eb3a65", + "powerpc64le-unknown-linux-gnu-0.12.13": "cd45ac73fc711e717602a4dc0c9e19d9c6563d15b14515a9a5dd49b00172a8b6", + "riscv64gc-unknown-linux-gnu-0.12.13": "ff1fb4d7e4c1d3a4acc6eff69b2530e846964260469df345e0239059517c0a21", + "riscv64gc-unknown-linux-musl-0.12.13": "b88312b410c1183e33ae9fa7738f35b7cd7396b2aa0e82836d7e88dbf23e5fb5", + "s390x-unknown-linux-gnu-0.12.13": "d41e4784c2187c76970690a9e9a288231f5ec8d2160ad8464be74aa9c06717e8", + "x86_64-apple-darwin-0.12.13": "5e287ef61cb6a9b61b3a83fef124fd143e400468a7dac794230147a810e17119", + "x86_64-pc-windows-msvc-0.12.13": "a86c9dc7bad9b03f388583b7187c05fe9951c2e0d392217e8fd43d97787f6ec2", + "x86_64-unknown-linux-gnu-0.12.13": "745765a3b6e360ad76743599ae5c42e9278c7edf8bbff9fc76d05bf2623a04dd", + "x86_64-unknown-linux-musl-0.12.13": "4e2bfd0c9007b1032a50e539e965fd0a6037d87ad93ae1580d220a92d4c94098", "aarch64-apple-darwin-0.12.12": "46740540b63fdee9a6cb2e19baf3f1f475b850c440a33e63455087a6871263f1", "aarch64-pc-windows-msvc-0.12.12": "36559da51ecee83b2b1d80aa1a0ede2f80e2d9e5761fffcbb9e9366a7f3d022a", "aarch64-unknown-linux-gnu-0.12.12": "fe08db50cc1b56cd1da7801065ed1103d27ed3f9571cd122386cfc7faf1b8df5", diff --git a/src/utils/inputs.ts b/src/utils/inputs.ts index 74a75d8..62ddfc2 100644 --- a/src/utils/inputs.ts +++ b/src/utils/inputs.ts @@ -60,7 +60,7 @@ export function loadInputs(): SetupInputs { const checksum = core.getInput("checksum"); const enableCache = getEnableCache(); const restoreCache = core.getInput("restore-cache") === "true"; - const saveCache = core.getInput("save-cache") === "true"; + const saveCache = getSaveCache(); const cacheSuffix = core.getInput("cache-suffix") || ""; const cacheLocalPath = getCacheLocalPath( workingDirectory, @@ -189,6 +189,18 @@ function getEnableCache(): boolean { return enableCacheInput === "true"; } +function getSaveCache(): boolean { + const saveCacheInput = core.getInput("save-cache"); + if (saveCacheInput === "auto") { + if (process.env.GITHUB_EVENT_NAME === "merge_group") { + log.info("Cache saving is disabled for the merge_group event"); + return false; + } + return true; + } + return saveCacheInput === "true"; +} + function getToolBinDir(workingDirectory: string): string | undefined { const toolBinDirInput = core.getInput("tool-bin-dir"); if (toolBinDirInput !== "") {