From e05cf2b0fe5ab63c877b69cd367a5d465104b215 Mon Sep 17 00:00:00 2001 From: team-github-bot <141112016+team-github-bot@users.noreply.github.com> Date: Fri, 27 Feb 2026 13:54:29 +1000 Subject: [PATCH 1/2] chore(main): release 4.1.0 --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d4be485..7274f46b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [4.1.0](https://github.com/OctopusDeploy/create-release-action/compare/v4.0.0...v4.1.0) (2026-02-27) + + +### Features + +* Add workflow to check for conventional commit format PR title ([#611](https://github.com/OctopusDeploy/create-release-action/issues/611)) ([2d92dba](https://github.com/OctopusDeploy/create-release-action/commit/2d92dba1227edd614174384772a1a5593a22831f)) + ## [4.0.0](https://github.com/OctopusDeploy/create-release-action/compare/v3.3.0...v4.0.0) (2025-12-09) diff --git a/package-lock.json b/package-lock.json index 21ea56f7..9ca72f8c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "create-release-action", - "version": "4.0.0", + "version": "4.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "create-release-action", - "version": "4.0.0", + "version": "4.1.0", "license": "Apache-2.0", "dependencies": { "@actions/core": "1.11.1", diff --git a/package.json b/package.json index 22a2ccdf..d544054e 100644 --- a/package.json +++ b/package.json @@ -89,5 +89,5 @@ "test:unit": "jest --ci --reporters=default --reporters=jest-junit --testPathPattern=__tests__/unit", "test:integration": "jest --ci --reporters=default --reporters=jest-junit --testPathPattern=__tests__/integration" }, - "version": "4.0.0" + "version": "4.1.0" } From 354627ac45381c0c9547db3a01e76da98c74e11d Mon Sep 17 00:00:00 2001 From: team-github-bot Date: Fri, 27 Feb 2026 03:55:01 +0000 Subject: [PATCH 2/2] chore: build dist and update README --- dist/index.js | 951 ++++++++++++++++++++++++++++---------------------- 1 file changed, 538 insertions(+), 413 deletions(-) diff --git a/dist/index.js b/dist/index.js index 1e51aad4..000de2d0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -18181,6 +18181,8 @@ class Minimatch { if (!options) options = {} this.options = options + this.maxGlobstarRecursion = options.maxGlobstarRecursion !== undefined + ? options.maxGlobstarRecursion : 200 this.set = [] this.pattern = pattern this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || @@ -18268,114 +18270,172 @@ class Minimatch { // out of pattern, then that's fine, as long as all // the parts match. matchOne (file, pattern, partial) { - var options = this.options + if (pattern.indexOf(GLOBSTAR) !== -1) { + return this._matchGlobstar(file, pattern, partial, 0, 0) + } + return this._matchOne(file, pattern, partial, 0, 0) + } - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) + _matchGlobstar (file, pattern, partial, fileIndex, patternIndex) { + // find first globstar from patternIndex + let firstgs = -1 + for (let i = patternIndex; i < pattern.length; i++) { + if (pattern[i] === GLOBSTAR) { firstgs = i; break } + } - this.debug('matchOne', file.length, pattern.length) + // find last globstar + let lastgs = -1 + for (let i = pattern.length - 1; i >= 0; i--) { + if (pattern[i] === GLOBSTAR) { lastgs = i; break } + } - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] + const head = pattern.slice(patternIndex, firstgs) + const body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs) + const tail = partial ? [] : pattern.slice(lastgs + 1) - this.debug(pattern, p, f) + // check the head + if (head.length) { + const fileHead = file.slice(fileIndex, fileIndex + head.length) + if (!this._matchOne(fileHead, head, partial, 0, 0)) { + return false + } + fileIndex += head.length + } - // should be impossible. - // some invalid regexp stuff in the set. - /* istanbul ignore if */ - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true + // check the tail + let fileTailMatch = 0 + if (tail.length) { + if (tail.length + fileIndex > file.length) return false + + const tailStart = file.length - tail.length + if (this._matchOne(file, tail, partial, tailStart, 0)) { + fileTailMatch = tail.length + } else { + // affordance for stuff like a/**/* matching a/b/ + if (file[file.length - 1] !== '' || + fileIndex + tail.length === file.length) { + return false + } + if (!this._matchOne(file, tail, partial, tailStart - 1, 0)) { + return false + } + fileTailMatch = tail.length + 1 + } + } + + // if body is empty (single ** between head and tail) + if (!body.length) { + let sawSome = !!fileTailMatch + for (let i = fileIndex; i < file.length - fileTailMatch; i++) { + const f = String(file[i]) + sawSome = true + if (f === '.' || f === '..' || + (!this.options.dot && f.charAt(0) === '.')) { + return false } + } + return partial || sawSome + } - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] + // split body into segments at each GLOBSTAR + const bodySegments = [[[], 0]] + let currentBody = bodySegments[0] + let nonGsParts = 0 + const nonGsPartsSums = [0] + for (const b of body) { + if (b === GLOBSTAR) { + nonGsPartsSums.push(nonGsParts) + currentBody = [[], 0] + bodySegments.push(currentBody) + } else { + currentBody[0].push(b) + nonGsParts++ + } + } - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + let idx = bodySegments.length - 1 + const fileLength = file.length - fileTailMatch + for (const b of bodySegments) { + b[1] = fileLength - (nonGsPartsSums[idx--] + b[0].length) + } - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } + return !!this._matchGlobStarBodySections( + file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch + ) + } - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } + // return false for "nope, not matching" + // return null for "not matching, cannot keep trying" + _matchGlobStarBodySections ( + file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail + ) { + const bs = bodySegments[bodyIndex] + if (!bs) { + // just make sure there are no bad dots + for (let i = fileIndex; i < file.length; i++) { + sawTail = true + const f = file[i] + if (f === '.' || f === '..' || + (!this.options.dot && f.charAt(0) === '.')) { + return false } + } + return sawTail + } - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - /* istanbul ignore if */ - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true + const [body, after] = bs + while (fileIndex <= after) { + const m = this._matchOne( + file.slice(0, fileIndex + body.length), + body, + partial, + fileIndex, + 0 + ) + // if limit exceeded, no match. intentional false negative, + // acceptable break in correctness for security. + if (m && globStarDepth < this.maxGlobstarRecursion) { + const sub = this._matchGlobStarBodySections( + file, bodySegments, + fileIndex + body.length, bodyIndex + 1, + partial, globStarDepth + 1, sawTail + ) + if (sub !== false) { + return sub } + } + const f = file[fileIndex] + if (f === '.' || f === '..' || + (!this.options.dot && f.charAt(0) === '.')) { return false } + fileIndex++ + } + return partial || null + } + + _matchOne (file, pattern, partial, fileIndex, patternIndex) { + let fi, pi, fl, pl + for ( + fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++ + ) { + this.debug('matchOne loop') + const p = pattern[pi] + const f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + /* istanbul ignore if */ + if (p === false || p === GLOBSTAR) return false // something other than ** // non-magic patterns just have to match exactly // patterns with magic have been turned into regexps. - var hit + let hit if (typeof p === 'string') { hit = f === p this.debug('string match', p, f, hit) @@ -18387,17 +18447,6 @@ class Minimatch { if (!hit) return false } - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - // now either we fell off the end of the pattern, or we're done. if (fi === fl && pi === pl) { // ran out of pattern and filename at the same time. @@ -18546,6 +18595,9 @@ class Minimatch { continue } + // coalesce consecutive non-globstar * characters + if (c === '*' && stateChar === '*') continue + // if we already have a stateChar, then it means // that there was something like ** or +? in there. // Handle the stateChar, then proceed with this one. @@ -68888,7 +68940,7 @@ module.exports = parseParams /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -/*! Axios v1.13.2 Copyright (c) 2025 Matt Zabriskie and contributors */ +/*! Axios v1.13.5 Copyright (c) 2026 Matt Zabriskie and contributors */ const FormData$1 = __nccwpck_require__(6454); @@ -68933,30 +68985,30 @@ function bind(fn, thisArg) { // utils is a library of generic helper functions non-specific to axios -const {toString} = Object.prototype; -const {getPrototypeOf} = Object; -const {iterator, toStringTag} = Symbol; +const { toString } = Object.prototype; +const { getPrototypeOf } = Object; +const { iterator, toStringTag } = Symbol; -const kindOf = (cache => thing => { - const str = toString.call(thing); - return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +const kindOf = ((cache) => (thing) => { + const str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); })(Object.create(null)); const kindOfTest = (type) => { type = type.toLowerCase(); - return (thing) => kindOf(thing) === type + return (thing) => kindOf(thing) === type; }; -const typeOfTest = type => thing => typeof thing === type; +const typeOfTest = (type) => (thing) => typeof thing === type; /** - * Determine if a value is an Array + * Determine if a value is a non-null object * * @param {Object} val The value to test * * @returns {boolean} True if value is an Array, otherwise false */ -const {isArray} = Array; +const { isArray } = Array; /** * Determine if a value is undefined @@ -68965,7 +69017,7 @@ const {isArray} = Array; * * @returns {boolean} True if the value is undefined, otherwise false */ -const isUndefined = typeOfTest('undefined'); +const isUndefined = typeOfTest("undefined"); /** * Determine if a value is a Buffer @@ -68975,8 +69027,14 @@ const isUndefined = typeOfTest('undefined'); * @returns {boolean} True if value is a Buffer, otherwise false */ function isBuffer(val) { - return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) - && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val); + return ( + val !== null && + !isUndefined(val) && + val.constructor !== null && + !isUndefined(val.constructor) && + isFunction$1(val.constructor.isBuffer) && + val.constructor.isBuffer(val) + ); } /** @@ -68986,8 +69044,7 @@ function isBuffer(val) { * * @returns {boolean} True if value is an ArrayBuffer, otherwise false */ -const isArrayBuffer = kindOfTest('ArrayBuffer'); - +const isArrayBuffer = kindOfTest("ArrayBuffer"); /** * Determine if a value is a view on an ArrayBuffer @@ -68998,10 +69055,10 @@ const isArrayBuffer = kindOfTest('ArrayBuffer'); */ function isArrayBufferView(val) { let result; - if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { result = ArrayBuffer.isView(val); } else { - result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + result = val && val.buffer && isArrayBuffer(val.buffer); } return result; } @@ -69013,7 +69070,7 @@ function isArrayBufferView(val) { * * @returns {boolean} True if value is a String, otherwise false */ -const isString = typeOfTest('string'); +const isString = typeOfTest("string"); /** * Determine if a value is a Function @@ -69021,7 +69078,7 @@ const isString = typeOfTest('string'); * @param {*} val The value to test * @returns {boolean} True if value is a Function, otherwise false */ -const isFunction$1 = typeOfTest('function'); +const isFunction$1 = typeOfTest("function"); /** * Determine if a value is a Number @@ -69030,7 +69087,7 @@ const isFunction$1 = typeOfTest('function'); * * @returns {boolean} True if value is a Number, otherwise false */ -const isNumber = typeOfTest('number'); +const isNumber = typeOfTest("number"); /** * Determine if a value is an Object @@ -69039,7 +69096,7 @@ const isNumber = typeOfTest('number'); * * @returns {boolean} True if value is an Object, otherwise false */ -const isObject = (thing) => thing !== null && typeof thing === 'object'; +const isObject = (thing) => thing !== null && typeof thing === "object"; /** * Determine if a value is a Boolean @@ -69047,7 +69104,7 @@ const isObject = (thing) => thing !== null && typeof thing === 'object'; * @param {*} thing The value to test * @returns {boolean} True if value is a Boolean, otherwise false */ -const isBoolean = thing => thing === true || thing === false; +const isBoolean = (thing) => thing === true || thing === false; /** * Determine if a value is a plain Object @@ -69057,12 +69114,18 @@ const isBoolean = thing => thing === true || thing === false; * @returns {boolean} True if value is a plain Object, otherwise false */ const isPlainObject = (val) => { - if (kindOf(val) !== 'object') { + if (kindOf(val) !== "object") { return false; } const prototype = getPrototypeOf(val); - return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val); + return ( + (prototype === null || + prototype === Object.prototype || + Object.getPrototypeOf(prototype) === null) && + !(toStringTag in val) && + !(iterator in val) + ); }; /** @@ -69079,7 +69142,10 @@ const isEmptyObject = (val) => { } try { - return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; + return ( + Object.keys(val).length === 0 && + Object.getPrototypeOf(val) === Object.prototype + ); } catch (e) { // Fallback for any other objects that might cause RangeError with Object.keys() return false; @@ -69093,7 +69159,7 @@ const isEmptyObject = (val) => { * * @returns {boolean} True if value is a Date, otherwise false */ -const isDate = kindOfTest('Date'); +const isDate = kindOfTest("Date"); /** * Determine if a value is a File @@ -69102,7 +69168,7 @@ const isDate = kindOfTest('Date'); * * @returns {boolean} True if value is a File, otherwise false */ -const isFile = kindOfTest('File'); +const isFile = kindOfTest("File"); /** * Determine if a value is a Blob @@ -69111,7 +69177,7 @@ const isFile = kindOfTest('File'); * * @returns {boolean} True if value is a Blob, otherwise false */ -const isBlob = kindOfTest('Blob'); +const isBlob = kindOfTest("Blob"); /** * Determine if a value is a FileList @@ -69120,7 +69186,7 @@ const isBlob = kindOfTest('Blob'); * * @returns {boolean} True if value is a File, otherwise false */ -const isFileList = kindOfTest('FileList'); +const isFileList = kindOfTest("FileList"); /** * Determine if a value is a Stream @@ -69140,15 +69206,16 @@ const isStream = (val) => isObject(val) && isFunction$1(val.pipe); */ const isFormData = (thing) => { let kind; - return thing && ( - (typeof FormData === 'function' && thing instanceof FormData) || ( - isFunction$1(thing.append) && ( - (kind = kindOf(thing)) === 'formdata' || - // detect form-data instance - (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]') - ) - ) - ) + return ( + thing && + ((typeof FormData === "function" && thing instanceof FormData) || + (isFunction$1(thing.append) && + ((kind = kindOf(thing)) === "formdata" || + // detect form-data instance + (kind === "object" && + isFunction$1(thing.toString) && + thing.toString() === "[object FormData]")))) + ); }; /** @@ -69158,9 +69225,14 @@ const isFormData = (thing) => { * * @returns {boolean} True if value is a URLSearchParams object, otherwise false */ -const isURLSearchParams = kindOfTest('URLSearchParams'); +const isURLSearchParams = kindOfTest("URLSearchParams"); -const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest); +const [isReadableStream, isRequest, isResponse, isHeaders] = [ + "ReadableStream", + "Request", + "Response", + "Headers", +].map(kindOfTest); /** * Trim excess whitespace off the beginning and end of a string @@ -69169,8 +69241,8 @@ const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', * * @returns {String} The String freed of excess whitespace */ -const trim = (str) => str.trim ? - str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); +const trim = (str) => + str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); /** * Iterate over an Array or an Object invoking a function for each item. @@ -69181,15 +69253,16 @@ const trim = (str) => str.trim ? * If 'obj' is an Object callback will be called passing * the value, key, and complete object for each property. * - * @param {Object|Array} obj The object to iterate + * @param {Object|Array} obj The object to iterate * @param {Function} fn The callback to invoke for each item * - * @param {Boolean} [allOwnKeys = false] + * @param {Object} [options] + * @param {Boolean} [options.allOwnKeys = false] * @returns {any} */ -function forEach(obj, fn, {allOwnKeys = false} = {}) { +function forEach(obj, fn, { allOwnKeys = false } = {}) { // Don't bother if no value provided - if (obj === null || typeof obj === 'undefined') { + if (obj === null || typeof obj === "undefined") { return; } @@ -69197,7 +69270,7 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) { let l; // Force an array if not already something iterable - if (typeof obj !== 'object') { + if (typeof obj !== "object") { /*eslint no-param-reassign:0*/ obj = [obj]; } @@ -69214,7 +69287,9 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) { } // Iterate over object keys - const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const keys = allOwnKeys + ? Object.getOwnPropertyNames(obj) + : Object.keys(obj); const len = keys.length; let key; @@ -69226,7 +69301,7 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) { } function findKey(obj, key) { - if (isBuffer(obj)){ + if (isBuffer(obj)) { return null; } @@ -69246,10 +69321,15 @@ function findKey(obj, key) { const _global = (() => { /*eslint no-undef:0*/ if (typeof globalThis !== "undefined") return globalThis; - return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global) + return typeof self !== "undefined" + ? self + : typeof window !== "undefined" + ? window + : global; })(); -const isContextDefined = (context) => !isUndefined(context) && context !== _global; +const isContextDefined = (context) => + !isUndefined(context) && context !== _global; /** * Accepts varargs expecting each argument to be an object, then @@ -69261,7 +69341,7 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob * Example: * * ```js - * var result = merge({foo: 123}, {foo: 456}); + * const result = merge({foo: 123}, {foo: 456}); * console.log(result.foo); // outputs 456 * ``` * @@ -69270,10 +69350,15 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob * @returns {Object} Result of all merge properties */ function merge(/* obj1, obj2, obj3, ... */) { - const {caseless, skipUndefined} = isContextDefined(this) && this || {}; + const { caseless, skipUndefined } = (isContextDefined(this) && this) || {}; const result = {}; const assignValue = (val, key) => { - const targetKey = caseless && findKey(result, key) || key; + // Skip dangerous property names to prevent prototype pollution + if (key === "__proto__" || key === "constructor" || key === "prototype") { + return; + } + + const targetKey = (caseless && findKey(result, key)) || key; if (isPlainObject(result[targetKey]) && isPlainObject(val)) { result[targetKey] = merge(result[targetKey], val); } else if (isPlainObject(val)) { @@ -69298,17 +69383,32 @@ function merge(/* obj1, obj2, obj3, ... */) { * @param {Object} b The object to copy properties from * @param {Object} thisArg The object to bind function to * - * @param {Boolean} [allOwnKeys] + * @param {Object} [options] + * @param {Boolean} [options.allOwnKeys] * @returns {Object} The resulting value of object a */ -const extend = (a, b, thisArg, {allOwnKeys}= {}) => { - forEach(b, (val, key) => { - if (thisArg && isFunction$1(val)) { - a[key] = bind(val, thisArg); - } else { - a[key] = val; - } - }, {allOwnKeys}); +const extend = (a, b, thisArg, { allOwnKeys } = {}) => { + forEach( + b, + (val, key) => { + if (thisArg && isFunction$1(val)) { + Object.defineProperty(a, key, { + value: bind(val, thisArg), + writable: true, + enumerable: true, + configurable: true, + }); + } else { + Object.defineProperty(a, key, { + value: val, + writable: true, + enumerable: true, + configurable: true, + }); + } + }, + { allOwnKeys }, + ); return a; }; @@ -69320,7 +69420,7 @@ const extend = (a, b, thisArg, {allOwnKeys}= {}) => { * @returns {string} content value without BOM */ const stripBOM = (content) => { - if (content.charCodeAt(0) === 0xFEFF) { + if (content.charCodeAt(0) === 0xfeff) { content = content.slice(1); } return content; @@ -69336,10 +69436,18 @@ const stripBOM = (content) => { * @returns {void} */ const inherits = (constructor, superConstructor, props, descriptors) => { - constructor.prototype = Object.create(superConstructor.prototype, descriptors); - constructor.prototype.constructor = constructor; - Object.defineProperty(constructor, 'super', { - value: superConstructor.prototype + constructor.prototype = Object.create( + superConstructor.prototype, + descriptors, + ); + Object.defineProperty(constructor.prototype, "constructor", { + value: constructor, + writable: true, + enumerable: false, + configurable: true, + }); + Object.defineProperty(constructor, "super", { + value: superConstructor.prototype, }); props && Object.assign(constructor.prototype, props); }; @@ -69368,13 +69476,20 @@ const toFlatObject = (sourceObj, destObj, filter, propFilter) => { i = props.length; while (i-- > 0) { prop = props[i]; - if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + if ( + (!propFilter || propFilter(prop, sourceObj, destObj)) && + !merged[prop] + ) { destObj[prop] = sourceObj[prop]; merged[prop] = true; } } sourceObj = filter !== false && getPrototypeOf(sourceObj); - } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + } while ( + sourceObj && + (!filter || filter(sourceObj, destObj)) && + sourceObj !== Object.prototype + ); return destObj; }; @@ -69398,7 +69513,6 @@ const endsWith = (str, searchString, position) => { return lastIndex !== -1 && lastIndex === position; }; - /** * Returns new array from array like object or null if failed * @@ -69427,12 +69541,12 @@ const toArray = (thing) => { * @returns {Array} */ // eslint-disable-next-line func-names -const isTypedArray = (TypedArray => { +const isTypedArray = ((TypedArray) => { // eslint-disable-next-line func-names - return thing => { + return (thing) => { return TypedArray && thing instanceof TypedArray; }; -})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); +})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array)); /** * For each entry in the object, call the function with the key and value. @@ -69475,18 +69589,22 @@ const matchAll = (regExp, str) => { }; /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ -const isHTMLForm = kindOfTest('HTMLFormElement'); +const isHTMLForm = kindOfTest("HTMLFormElement"); -const toCamelCase = str => { - return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, - function replacer(m, p1, p2) { +const toCamelCase = (str) => { + return str + .toLowerCase() + .replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) { return p1.toUpperCase() + p2; - } - ); + }); }; /* Creating a function that will check if an object has a property. */ -const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); +const hasOwnProperty = ( + ({ hasOwnProperty }) => + (obj, prop) => + hasOwnProperty.call(obj, prop) +)(Object.prototype); /** * Determine if a value is a RegExp object @@ -69495,7 +69613,7 @@ const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call * * @returns {boolean} True if value is a RegExp object, otherwise false */ -const isRegExp = kindOfTest('RegExp'); +const isRegExp = kindOfTest("RegExp"); const reduceDescriptors = (obj, reducer) => { const descriptors = Object.getOwnPropertyDescriptors(obj); @@ -69519,7 +69637,10 @@ const reduceDescriptors = (obj, reducer) => { const freezeMethods = (obj) => { reduceDescriptors(obj, (descriptor, name) => { // skip restricted props in strict mode - if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { + if ( + isFunction$1(obj) && + ["arguments", "caller", "callee"].indexOf(name) !== -1 + ) { return false; } @@ -69529,14 +69650,14 @@ const freezeMethods = (obj) => { descriptor.enumerable = false; - if ('writable' in descriptor) { + if ("writable" in descriptor) { descriptor.writable = false; return; } if (!descriptor.set) { descriptor.set = () => { - throw Error('Can not rewrite read-only method \'' + name + '\''); + throw Error("Can not rewrite read-only method '" + name + "'"); }; } }); @@ -69546,12 +69667,14 @@ const toObjectSet = (arrayOrString, delimiter) => { const obj = {}; const define = (arr) => { - arr.forEach(value => { + arr.forEach((value) => { obj[value] = true; }); }; - isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + isArray(arrayOrString) + ? define(arrayOrString) + : define(String(arrayOrString).split(delimiter)); return obj; }; @@ -69559,11 +69682,11 @@ const toObjectSet = (arrayOrString, delimiter) => { const noop = () => {}; const toFiniteNumber = (value, defaultValue) => { - return value != null && Number.isFinite(value = +value) ? value : defaultValue; + return value != null && Number.isFinite((value = +value)) + ? value + : defaultValue; }; - - /** * If the thing is a FormData object, return true, otherwise return false. * @@ -69572,14 +69695,18 @@ const toFiniteNumber = (value, defaultValue) => { * @returns {boolean} */ function isSpecCompliantForm(thing) { - return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]); + return !!( + thing && + isFunction$1(thing.append) && + thing[toStringTag] === "FormData" && + thing[iterator] + ); } const toJSONObject = (obj) => { const stack = new Array(10); const visit = (source, i) => { - if (isObject(source)) { if (stack.indexOf(source) >= 0) { return; @@ -69590,7 +69717,7 @@ const toJSONObject = (obj) => { return source; } - if(!('toJSON' in source)) { + if (!("toJSON" in source)) { stack[i] = source; const target = isArray(source) ? [] : {}; @@ -69611,10 +69738,13 @@ const toJSONObject = (obj) => { return visit(obj, 0); }; -const isAsyncFn = kindOfTest('AsyncFunction'); +const isAsyncFn = kindOfTest("AsyncFunction"); const isThenable = (thing) => - thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch); + thing && + (isObject(thing) || isFunction$1(thing)) && + isFunction$1(thing.then) && + isFunction$1(thing.catch); // original code // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34 @@ -69624,32 +69754,35 @@ const _setImmediate = ((setImmediateSupported, postMessageSupported) => { return setImmediate; } - return postMessageSupported ? ((token, callbacks) => { - _global.addEventListener("message", ({source, data}) => { - if (source === _global && data === token) { - callbacks.length && callbacks.shift()(); - } - }, false); + return postMessageSupported + ? ((token, callbacks) => { + _global.addEventListener( + "message", + ({ source, data }) => { + if (source === _global && data === token) { + callbacks.length && callbacks.shift()(); + } + }, + false, + ); - return (cb) => { - callbacks.push(cb); - _global.postMessage(token, "*"); - } - })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); -})( - typeof setImmediate === 'function', - isFunction$1(_global.postMessage) -); + return (cb) => { + callbacks.push(cb); + _global.postMessage(token, "*"); + }; + })(`axios@${Math.random()}`, []) + : (cb) => setTimeout(cb); +})(typeof setImmediate === "function", isFunction$1(_global.postMessage)); -const asap = typeof queueMicrotask !== 'undefined' ? - queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate); +const asap = + typeof queueMicrotask !== "undefined" + ? queueMicrotask.bind(_global) + : (typeof process !== "undefined" && process.nextTick) || _setImmediate; // ********************* - const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]); - const utils$1 = { isArray, isArrayBuffer, @@ -69707,113 +69840,78 @@ const utils$1 = { isThenable, setImmediate: _setImmediate, asap, - isIterable + isIterable, }; -/** - * Create an Error with the specified message, config, error code, request and response. - * - * @param {string} message The error message. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [config] The config. - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * - * @returns {Error} The created error. - */ -function AxiosError(message, code, config, request, response) { - Error.call(this); +class AxiosError extends Error { + static from(error, code, config, request, response, customProps) { + const axiosError = new AxiosError(error.message, code || error.code, config, request, response); + axiosError.cause = error; + axiosError.name = error.name; + customProps && Object.assign(axiosError, customProps); + return axiosError; + } - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } else { - this.stack = (new Error()).stack; - } + /** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ + constructor(message, code, config, request, response) { + super(message); + this.name = 'AxiosError'; + this.isAxiosError = true; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + if (response) { + this.response = response; + this.status = response.status; + } + } - this.message = message; - this.name = 'AxiosError'; - code && (this.code = code); - config && (this.config = config); - request && (this.request = request); - if (response) { - this.response = response; - this.status = response.status ? response.status : null; - } + toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: utils$1.toJSONObject(this.config), + code: this.code, + status: this.status, + }; + } } -utils$1.inherits(AxiosError, Error, { - toJSON: function toJSON() { - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: utils$1.toJSONObject(this.config), - code: this.code, - status: this.status - }; - } -}); +// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated. +AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE'; +AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION'; +AxiosError.ECONNABORTED = 'ECONNABORTED'; +AxiosError.ETIMEDOUT = 'ETIMEDOUT'; +AxiosError.ERR_NETWORK = 'ERR_NETWORK'; +AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS'; +AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED'; +AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE'; +AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST'; +AxiosError.ERR_CANCELED = 'ERR_CANCELED'; +AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT'; +AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL'; -const prototype$1 = AxiosError.prototype; -const descriptors = {}; - -[ - 'ERR_BAD_OPTION_VALUE', - 'ERR_BAD_OPTION', - 'ECONNABORTED', - 'ETIMEDOUT', - 'ERR_NETWORK', - 'ERR_FR_TOO_MANY_REDIRECTS', - 'ERR_DEPRECATED', - 'ERR_BAD_RESPONSE', - 'ERR_BAD_REQUEST', - 'ERR_CANCELED', - 'ERR_NOT_SUPPORT', - 'ERR_INVALID_URL' -// eslint-disable-next-line func-names -].forEach(code => { - descriptors[code] = {value: code}; -}); - -Object.defineProperties(AxiosError, descriptors); -Object.defineProperty(prototype$1, 'isAxiosError', {value: true}); - -// eslint-disable-next-line func-names -AxiosError.from = (error, code, config, request, response, customProps) => { - const axiosError = Object.create(prototype$1); - - utils$1.toFlatObject(error, axiosError, function filter(obj) { - return obj !== Error.prototype; - }, prop => { - return prop !== 'isAxiosError'; - }); - - const msg = error && error.message ? error.message : 'Error'; - - // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED) - const errCode = code == null && error ? error.code : code; - AxiosError.call(axiosError, msg, errCode, config, request, response); - - // Chain the original error on the standard field; non-enumerable to avoid JSON noise - if (error && axiosError.cause == null) { - Object.defineProperty(axiosError, 'cause', { value: error, configurable: true }); - } - - axiosError.name = (error && error.name) || 'Error'; - - customProps && Object.assign(axiosError, customProps); - - return axiosError; -}; +const AxiosError$1 = AxiosError; /** * Determines if the given thing is a array or js object. @@ -69935,7 +70033,7 @@ function toFormData(obj, formData, options) { } if (!useBlob && utils$1.isBlob(value)) { - throw new AxiosError('Blob is not supported. Use a Buffer instead.'); + throw new AxiosError$1('Blob is not supported. Use a Buffer instead.'); } if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { @@ -70109,29 +70207,26 @@ function encode(val) { * @returns {string} The formatted url */ function buildURL(url, params, options) { - /*eslint no-param-reassign:0*/ if (!params) { return url; } - + const _encode = options && options.encode || encode; - if (utils$1.isFunction(options)) { - options = { - serialize: options - }; - } + const _options = utils$1.isFunction(options) ? { + serialize: options + } : options; - const serializeFn = options && options.serialize; + const serializeFn = _options && _options.serialize; let serializedParams; if (serializeFn) { - serializedParams = serializeFn(params, options); + serializedParams = serializeFn(params, _options); } else { serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : - new AxiosURLSearchParams(params, options).toString(_encode); + new AxiosURLSearchParams(params, _options).toString(_encode); } if (serializedParams) { @@ -70156,6 +70251,7 @@ class InterceptorManager { * * @param {Function} fulfilled The function to handle `then` for a `Promise` * @param {Function} rejected The function to handle `reject` for a `Promise` + * @param {Object} options The options for the interceptor, synchronous and runWhen * * @return {Number} An ID used to remove interceptor later */ @@ -70217,7 +70313,8 @@ const InterceptorManager$1 = InterceptorManager; const transitionalDefaults = { silentJSONParsing: true, forcedJSONParsing: true, - clarifyTimeoutError: false + clarifyTimeoutError: false, + legacyInterceptorReqResOrdering: true }; const URLSearchParams = url__default["default"].URLSearchParams; @@ -70526,7 +70623,7 @@ const defaults = { } catch (e) { if (strictJSONParsing) { if (e.name === 'SyntaxError') { - throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); + throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response); } throw e; } @@ -70960,24 +71057,24 @@ function isCancel(value) { return !!(value && value.__CANCEL__); } -/** - * A `CanceledError` is an object that is thrown when an operation is canceled. - * - * @param {string=} message The message. - * @param {Object=} config The config. - * @param {Object=} request The request. - * - * @returns {CanceledError} The created error. - */ -function CanceledError(message, config, request) { - // eslint-disable-next-line no-eq-null,eqeqeq - AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request); - this.name = 'CanceledError'; +class CanceledError extends AxiosError$1 { + /** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ + constructor(message, config, request) { + super(message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request); + this.name = 'CanceledError'; + this.__CANCEL__ = true; + } } -utils$1.inherits(CanceledError, AxiosError, { - __CANCEL__: true -}); +const CanceledError$1 = CanceledError; /** * Resolve or reject a Promise based on response status. @@ -70993,9 +71090,9 @@ function settle(resolve, reject, response) { if (!response.status || !validateStatus || validateStatus(response.status)) { resolve(response); } else { - reject(new AxiosError( + reject(new AxiosError$1( 'Request failed with status code ' + response.status, - [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response @@ -71014,6 +71111,10 @@ function isAbsoluteURL(url) { // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed // by any combination of letters, digits, plus, period, or hyphen. + if (typeof url !== 'string') { + return false; + } + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); } @@ -71049,7 +71150,7 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { return requestedURL; } -const VERSION = "1.13.2"; +const VERSION = "1.13.5"; function parseProtocol(url) { const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); @@ -71082,7 +71183,7 @@ function fromDataURI(uri, asBlob, options) { const match = DATA_URL_PATTERN.exec(uri); if (!match) { - throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL); + throw new AxiosError$1('Invalid URL', AxiosError$1.ERR_INVALID_URL); } const mime = match[1]; @@ -71092,7 +71193,7 @@ function fromDataURI(uri, asBlob, options) { if (asBlob) { if (!_Blob) { - throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT); + throw new AxiosError$1('Blob is not supported', AxiosError$1.ERR_NOT_SUPPORT); } return new _Blob([buffer], {type: mime}); @@ -71101,7 +71202,7 @@ function fromDataURI(uri, asBlob, options) { return buffer; } - throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT); + throw new AxiosError$1('Unsupported protocol ' + protocol, AxiosError$1.ERR_NOT_SUPPORT); } const kInternals = Symbol('internals'); @@ -71783,12 +71884,16 @@ function setProxy(options, configProxy, location) { if (proxy.auth) { // Support proxy auth object form - if (proxy.auth.username || proxy.auth.password) { + const validProxyAuth = Boolean(proxy.auth.username || proxy.auth.password); + + if (validProxyAuth) { proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || ''); + } else if (typeof proxy.auth === 'object') { + throw new AxiosError$1('Invalid proxy authorization', AxiosError$1.ERR_BAD_OPTION, { proxy }); } - const base64 = Buffer - .from(proxy.auth, 'utf8') - .toString('base64'); + + const base64 = Buffer.from(proxy.auth, 'utf8').toString('base64'); + options.headers['Proxy-Authorization'] = 'Basic ' + base64; } @@ -71854,7 +71959,8 @@ const buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(ad const http2Transport = { request(options, cb) { - const authority = options.protocol + '//' + options.hostname + ':' + (options.port || 80); + const authority = options.protocol + '//' + options.hostname + ':' + (options.port ||(options.protocol === 'https:' ? 443 : 80)); + const {http2Options, headers} = options; @@ -71941,7 +72047,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { function abort(reason) { try { - abortEmitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason); + abortEmitter.emit('abort', !reason || reason.type ? new CanceledError$1(null, config, req) : reason); } catch(err) { console.warn('emit error', err); } @@ -72006,9 +72112,9 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { const estimated = estimateDataURLDecodedBytes(dataUrl); if (estimated > config.maxContentLength) { - return reject(new AxiosError( + return reject(new AxiosError$1( 'maxContentLength size of ' + config.maxContentLength + ' exceeded', - AxiosError.ERR_BAD_RESPONSE, + AxiosError$1.ERR_BAD_RESPONSE, config )); } @@ -72030,7 +72136,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { Blob: config.env && config.env.Blob }); } catch (err) { - throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config); + throw AxiosError$1.from(err, AxiosError$1.ERR_BAD_REQUEST, config); } if (responseType === 'text') { @@ -72053,9 +72159,9 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { } if (supportedProtocols.indexOf(protocol) === -1) { - return reject(new AxiosError( + return reject(new AxiosError$1( 'Unsupported protocol ' + protocol, - AxiosError.ERR_BAD_REQUEST, + AxiosError$1.ERR_BAD_REQUEST, config )); } @@ -72105,9 +72211,9 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { } else if (utils$1.isString(data)) { data = Buffer.from(data, 'utf-8'); } else { - return reject(new AxiosError( + return reject(new AxiosError$1( 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', - AxiosError.ERR_BAD_REQUEST, + AxiosError$1.ERR_BAD_REQUEST, config )); } @@ -72116,9 +72222,9 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { headers.setContentLength(data.length, false); if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { - return reject(new AxiosError( + return reject(new AxiosError$1( 'Request body larger than maxBodyLength limit', - AxiosError.ERR_BAD_REQUEST, + AxiosError$1.ERR_BAD_REQUEST, config )); } @@ -72340,8 +72446,8 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { // stream.destroy() emit aborted event before calling reject() on Node.js v16 rejected = true; responseStream.destroy(); - abort(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', - AxiosError.ERR_BAD_RESPONSE, config, lastRequest)); + abort(new AxiosError$1('maxContentLength size of ' + config.maxContentLength + ' exceeded', + AxiosError$1.ERR_BAD_RESPONSE, config, lastRequest)); } }); @@ -72350,9 +72456,9 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { return; } - const err = new AxiosError( + const err = new AxiosError$1( 'stream has been aborted', - AxiosError.ERR_BAD_RESPONSE, + AxiosError$1.ERR_BAD_RESPONSE, config, lastRequest ); @@ -72362,7 +72468,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { responseStream.on('error', function handleStreamError(err) { if (req.destroyed) return; - reject(AxiosError.from(err, null, config, lastRequest)); + reject(AxiosError$1.from(err, null, config, lastRequest)); }); responseStream.on('end', function handleStreamEnd() { @@ -72376,7 +72482,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { } response.data = responseData; } catch (err) { - return reject(AxiosError.from(err, null, config, response.request, response)); + return reject(AxiosError$1.from(err, null, config, response.request, response)); } settle(resolve, reject, response); }); @@ -72400,9 +72506,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { // Handle errors req.on('error', function handleRequestError(err) { - // @todo remove - // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return; - reject(AxiosError.from(err, null, config, req)); + reject(AxiosError$1.from(err, null, config, req)); }); // set tcp keep alive to prevent drop connection by peer @@ -72417,9 +72521,9 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { const timeout = parseInt(config.timeout, 10); if (Number.isNaN(timeout)) { - abort(new AxiosError( + abort(new AxiosError$1( 'error trying to parse `config.timeout` to int', - AxiosError.ERR_BAD_OPTION_VALUE, + AxiosError$1.ERR_BAD_OPTION_VALUE, config, req )); @@ -72439,9 +72543,9 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { if (config.timeoutErrorMessage) { timeoutErrorMessage = config.timeoutErrorMessage; } - abort(new AxiosError( + abort(new AxiosError$1( timeoutErrorMessage, - transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED, config, req )); @@ -72468,7 +72572,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { data.on('close', () => { if (!ended && !errored) { - abort(new CanceledError('Request stream has been aborted', config, req)); + abort(new CanceledError$1('Request stream has been aborted', config, req)); } }); @@ -72543,7 +72647,8 @@ const cookies = platform.hasStandardBrowserEnv ? remove() {} }; -const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing; +const headersToObject = (thing) => + thing instanceof AxiosHeaders$1 ? { ...thing } : thing; /** * Config-specific merge-function which creates a new config-object @@ -72561,7 +72666,7 @@ function mergeConfig(config1, config2) { function getMergedValue(target, source, prop, caseless) { if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { - return utils$1.merge.call({caseless}, target, source); + return utils$1.merge.call({ caseless }, target, source); } else if (utils$1.isPlainObject(source)) { return utils$1.merge({}, source); } else if (utils$1.isArray(source)) { @@ -72570,7 +72675,6 @@ function mergeConfig(config1, config2) { return source; } - // eslint-disable-next-line consistent-return function mergeDeepProperties(a, b, prop, caseless) { if (!utils$1.isUndefined(b)) { return getMergedValue(a, b, prop, caseless); @@ -72633,14 +72737,27 @@ function mergeConfig(config1, config2) { socketPath: defaultToConfig2, responseEncoding: defaultToConfig2, validateStatus: mergeDirectKeys, - headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) + headers: (a, b, prop) => + mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true), }; - utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) { - const merge = mergeMap[prop] || mergeDeepProperties; - const configValue = merge(config1[prop], config2[prop], prop); - (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); - }); + utils$1.forEach( + Object.keys({ ...config1, ...config2 }), + function computeConfigValue(prop) { + if ( + prop === "__proto__" || + prop === "constructor" || + prop === "prototype" + ) + return; + const merge = utils$1.hasOwnProp(mergeMap, prop) + ? mergeMap[prop] + : mergeDeepProperties; + const configValue = merge(config1[prop], config2[prop], prop); + (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || + (config[prop] = configValue); + }, + ); return config; } @@ -72785,7 +72902,7 @@ const xhrAdapter = isXHRAdapterSupported && function (config) { return; } - reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); + reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request)); // Clean up request request = null; @@ -72797,7 +72914,7 @@ const xhrAdapter = isXHRAdapterSupported && function (config) { // (message may be empty; when present, surface it) // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event const msg = event && event.message ? event.message : 'Network Error'; - const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request); + const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request); // attach the underlying event for consumers who want details err.event = event || null; reject(err); @@ -72811,9 +72928,9 @@ const xhrAdapter = isXHRAdapterSupported && function (config) { if (_config.timeoutErrorMessage) { timeoutErrorMessage = _config.timeoutErrorMessage; } - reject(new AxiosError( + reject(new AxiosError$1( timeoutErrorMessage, - transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED, config, request)); @@ -72863,7 +72980,7 @@ const xhrAdapter = isXHRAdapterSupported && function (config) { if (!request) { return; } - reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); + reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel); request.abort(); request = null; }; @@ -72877,7 +72994,7 @@ const xhrAdapter = isXHRAdapterSupported && function (config) { const protocol = parseProtocol(_config.url); if (protocol && platform.protocols.indexOf(protocol) === -1) { - reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); + reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config)); return; } @@ -72900,13 +73017,13 @@ const composeSignals = (signals, timeout) => { aborted = true; unsubscribe(); const err = reason instanceof Error ? reason : this.reason; - controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err)); + controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err)); } }; let timer = timeout && setTimeout(() => { timer = null; - onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT)); + onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT)); }, timeout); const unsubscribe = () => { @@ -73092,7 +73209,7 @@ const factory = (env) => { return method.call(res); } - throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config); + throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config); }); }); })()); @@ -73258,14 +73375,14 @@ const factory = (env) => { if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) { throw Object.assign( - new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request), + new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request, err && err.response), { cause: err.cause || err } ) } - throw AxiosError.from(err, err && err.code, config, request); + throw AxiosError$1.from(err, err && err.code, config, request, err && err.response); } } }; @@ -73370,7 +73487,7 @@ function getAdapter(adapters, config) { adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; if (adapter === undefined) { - throw new AxiosError(`Unknown adapter '${id}'`); + throw new AxiosError$1(`Unknown adapter '${id}'`); } } @@ -73391,7 +73508,7 @@ function getAdapter(adapters, config) { (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : 'as no adapter specified'; - throw new AxiosError( + throw new AxiosError$1( `There is no suitable adapter to dispatch the request ` + s, 'ERR_NOT_SUPPORT' ); @@ -73430,7 +73547,7 @@ function throwIfCancellationRequested(config) { } if (config.signal && config.signal.aborted) { - throw new CanceledError(null, config); + throw new CanceledError$1(null, config); } } @@ -73518,9 +73635,9 @@ validators$1.transitional = function transitional(validator, version, message) { // eslint-disable-next-line func-names return (value, opt, opts) => { if (validator === false) { - throw new AxiosError( + throw new AxiosError$1( formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), - AxiosError.ERR_DEPRECATED + AxiosError$1.ERR_DEPRECATED ); } @@ -73559,7 +73676,7 @@ validators$1.spelling = function spelling(correctSpelling) { function assertOptions(options, schema, allowUnknown) { if (typeof options !== 'object') { - throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); + throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE); } const keys = Object.keys(options); let i = keys.length; @@ -73570,12 +73687,12 @@ function assertOptions(options, schema, allowUnknown) { const value = options[opt]; const result = value === undefined || validator(value, opt, options); if (result !== true) { - throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); + throw new AxiosError$1('option ' + opt + ' must be ' + result, AxiosError$1.ERR_BAD_OPTION_VALUE); } continue; } if (allowUnknown !== true) { - throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); + throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION); } } } @@ -73656,7 +73773,8 @@ class Axios { validator.assertOptions(transitional, { silentJSONParsing: validators.transitional(validators.boolean), forcedJSONParsing: validators.transitional(validators.boolean), - clarifyTimeoutError: validators.transitional(validators.boolean) + clarifyTimeoutError: validators.transitional(validators.boolean), + legacyInterceptorReqResOrdering: validators.transitional(validators.boolean) }, false); } @@ -73713,7 +73831,14 @@ class Axios { synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; - requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + const transitional = config.transitional || transitionalDefaults; + const legacyInterceptorReqResOrdering = transitional && transitional.legacyInterceptorReqResOrdering; + + if (legacyInterceptorReqResOrdering) { + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + } else { + requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + } }); const responseInterceptorChain = []; @@ -73868,7 +73993,7 @@ class CancelToken { return; } - token.reason = new CanceledError(message, config, request); + token.reason = new CanceledError$1(message, config, request); resolvePromise(token.reason); }); } @@ -73952,7 +74077,7 @@ const CancelToken$1 = CancelToken; * * ```js * function f(x, y, z) {} - * var args = [1, 2, 3]; + * const args = [1, 2, 3]; * f.apply(null, args); * ``` * @@ -74093,14 +74218,14 @@ const axios = createInstance(defaults$1); axios.Axios = Axios$1; // Expose Cancel & CancelToken -axios.CanceledError = CanceledError; +axios.CanceledError = CanceledError$1; axios.CancelToken = CancelToken$1; axios.isCancel = isCancel; axios.VERSION = VERSION; axios.toFormData = toFormData; // Expose AxiosError class -axios.AxiosError = AxiosError; +axios.AxiosError = AxiosError$1; // alias for CanceledError for backward compatibility axios.Cancel = axios.CanceledError;