mirror of
https://github.com/hashicorp/setup-terraform.git
synced 2025-12-16 16:42:35 +00:00
Bump axios from 1.8.2 to 1.12.1 (#506)
Some checks failed
Continuous Integration / Check dist/ directory (push) Has been cancelled
Continuous Integration / Test (push) Has been cancelled
setup-terraform tests / Terraform Versions Constraints (push) Has been cancelled
setup-terraform tests / Terraform Versions (push) Has been cancelled
setup-terraform tests / Terraform Versions No Wrapper (push) Has been cancelled
setup-terraform tests / Terraform Versions Constraints No Wrapper (push) Has been cancelled
setup-terraform tests / HCP Terraform Credentials (push) Has been cancelled
setup-terraform tests / Terraform Enterprise Credentials (push) Has been cancelled
setup-terraform tests / Terraform Arguments (push) Has been cancelled
setup-terraform tests / Terraform No Credentials (push) Has been cancelled
setup-terraform tests / Terraform Arguments No Wrapper (push) Has been cancelled
setup-terraform tests / Terraform Run Local (push) Has been cancelled
setup-terraform tests / Terraform Run Local No Wrapper (push) Has been cancelled
setup-terraform tests / Terraform STDOUT (push) Has been cancelled
setup-terraform tests / Terraform STDOUT No Wrapper (push) Has been cancelled
setup-terraform tests / Terraform Delayed Apply (push) Has been cancelled
Some checks failed
Continuous Integration / Check dist/ directory (push) Has been cancelled
Continuous Integration / Test (push) Has been cancelled
setup-terraform tests / Terraform Versions Constraints (push) Has been cancelled
setup-terraform tests / Terraform Versions (push) Has been cancelled
setup-terraform tests / Terraform Versions No Wrapper (push) Has been cancelled
setup-terraform tests / Terraform Versions Constraints No Wrapper (push) Has been cancelled
setup-terraform tests / HCP Terraform Credentials (push) Has been cancelled
setup-terraform tests / Terraform Enterprise Credentials (push) Has been cancelled
setup-terraform tests / Terraform Arguments (push) Has been cancelled
setup-terraform tests / Terraform No Credentials (push) Has been cancelled
setup-terraform tests / Terraform Arguments No Wrapper (push) Has been cancelled
setup-terraform tests / Terraform Run Local (push) Has been cancelled
setup-terraform tests / Terraform Run Local No Wrapper (push) Has been cancelled
setup-terraform tests / Terraform STDOUT (push) Has been cancelled
setup-terraform tests / Terraform STDOUT No Wrapper (push) Has been cancelled
setup-terraform tests / Terraform Delayed Apply (push) Has been cancelled
* Bump axios from 1.8.2 to 1.12.1 Bumps [axios](https://github.com/axios/axios) from 1.8.2 to 1.12.1. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](https://github.com/axios/axios/compare/v1.8.2...v1.12.1) --- updated-dependencies: - dependency-name: axios dependency-version: 1.12.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore: run build to update dist/index.js --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ansgar Mertens <ansgar@hashicorp.com>
This commit is contained in:
parent
2ee5124c44
commit
fe38bfbb36
2 changed files with 476 additions and 252 deletions
391
dist/index.js
vendored
391
dist/index.js
vendored
|
|
@ -44985,7 +44985,7 @@ module.exports = require("zlib");
|
||||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
/*! Axios v1.8.2 Copyright (c) 2025 Matt Zabriskie and contributors */
|
/*! Axios v1.12.1 Copyright (c) 2025 Matt Zabriskie and contributors */
|
||||||
|
|
||||||
|
|
||||||
const FormData$1 = __nccwpck_require__(6454);
|
const FormData$1 = __nccwpck_require__(6454);
|
||||||
|
|
@ -45023,6 +45023,7 @@ function bind(fn, thisArg) {
|
||||||
|
|
||||||
const {toString} = Object.prototype;
|
const {toString} = Object.prototype;
|
||||||
const {getPrototypeOf} = Object;
|
const {getPrototypeOf} = Object;
|
||||||
|
const {iterator, toStringTag} = Symbol;
|
||||||
|
|
||||||
const kindOf = (cache => thing => {
|
const kindOf = (cache => thing => {
|
||||||
const str = toString.call(thing);
|
const str = toString.call(thing);
|
||||||
|
|
@ -45063,7 +45064,7 @@ const isUndefined = typeOfTest('undefined');
|
||||||
*/
|
*/
|
||||||
function isBuffer(val) {
|
function isBuffer(val) {
|
||||||
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
|
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
|
||||||
&& isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
&& isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -45108,7 +45109,7 @@ const isString = typeOfTest('string');
|
||||||
* @param {*} val The value to test
|
* @param {*} val The value to test
|
||||||
* @returns {boolean} True if value is a Function, otherwise false
|
* @returns {boolean} True if value is a Function, otherwise false
|
||||||
*/
|
*/
|
||||||
const isFunction = typeOfTest('function');
|
const isFunction$1 = typeOfTest('function');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if a value is a Number
|
* Determine if a value is a Number
|
||||||
|
|
@ -45149,7 +45150,28 @@ const isPlainObject = (val) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const prototype = getPrototypeOf(val);
|
const prototype = getPrototypeOf(val);
|
||||||
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
|
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine if a value is an empty object (safely handles Buffers)
|
||||||
|
*
|
||||||
|
* @param {*} val The value to test
|
||||||
|
*
|
||||||
|
* @returns {boolean} True if value is an empty object, otherwise false
|
||||||
|
*/
|
||||||
|
const isEmptyObject = (val) => {
|
||||||
|
// Early return for non-objects or Buffers to prevent RangeError
|
||||||
|
if (!isObject(val) || isBuffer(val)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
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;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -45195,7 +45217,7 @@ const isFileList = kindOfTest('FileList');
|
||||||
*
|
*
|
||||||
* @returns {boolean} True if value is a Stream, otherwise false
|
* @returns {boolean} True if value is a Stream, otherwise false
|
||||||
*/
|
*/
|
||||||
const isStream = (val) => isObject(val) && isFunction(val.pipe);
|
const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if a value is a FormData
|
* Determine if a value is a FormData
|
||||||
|
|
@ -45208,10 +45230,10 @@ const isFormData = (thing) => {
|
||||||
let kind;
|
let kind;
|
||||||
return thing && (
|
return thing && (
|
||||||
(typeof FormData === 'function' && thing instanceof FormData) || (
|
(typeof FormData === 'function' && thing instanceof FormData) || (
|
||||||
isFunction(thing.append) && (
|
isFunction$1(thing.append) && (
|
||||||
(kind = kindOf(thing)) === 'formdata' ||
|
(kind = kindOf(thing)) === 'formdata' ||
|
||||||
// detect form-data instance
|
// detect form-data instance
|
||||||
(kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
|
(kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -45274,6 +45296,11 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
||||||
fn.call(null, obj[i], i, obj);
|
fn.call(null, obj[i], i, obj);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// Buffer check
|
||||||
|
if (isBuffer(obj)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Iterate over object keys
|
// 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;
|
const len = keys.length;
|
||||||
|
|
@ -45287,6 +45314,10 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function findKey(obj, key) {
|
function findKey(obj, key) {
|
||||||
|
if (isBuffer(obj)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
key = key.toLowerCase();
|
key = key.toLowerCase();
|
||||||
const keys = Object.keys(obj);
|
const keys = Object.keys(obj);
|
||||||
let i = keys.length;
|
let i = keys.length;
|
||||||
|
|
@ -45327,7 +45358,7 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
|
||||||
* @returns {Object} Result of all merge properties
|
* @returns {Object} Result of all merge properties
|
||||||
*/
|
*/
|
||||||
function merge(/* obj1, obj2, obj3, ... */) {
|
function merge(/* obj1, obj2, obj3, ... */) {
|
||||||
const {caseless} = isContextDefined(this) && this || {};
|
const {caseless, skipUndefined} = isContextDefined(this) && this || {};
|
||||||
const result = {};
|
const result = {};
|
||||||
const assignValue = (val, key) => {
|
const assignValue = (val, key) => {
|
||||||
const targetKey = caseless && findKey(result, key) || key;
|
const targetKey = caseless && findKey(result, key) || key;
|
||||||
|
|
@ -45338,8 +45369,10 @@ function merge(/* obj1, obj2, obj3, ... */) {
|
||||||
} else if (isArray(val)) {
|
} else if (isArray(val)) {
|
||||||
result[targetKey] = val.slice();
|
result[targetKey] = val.slice();
|
||||||
} else {
|
} else {
|
||||||
|
if (!skipUndefined || !isUndefined(val)) {
|
||||||
result[targetKey] = val;
|
result[targetKey] = val;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
for (let i = 0, l = arguments.length; i < l; i++) {
|
for (let i = 0, l = arguments.length; i < l; i++) {
|
||||||
|
|
@ -45360,7 +45393,7 @@ function merge(/* obj1, obj2, obj3, ... */) {
|
||||||
*/
|
*/
|
||||||
const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
|
const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
|
||||||
forEach(b, (val, key) => {
|
forEach(b, (val, key) => {
|
||||||
if (thisArg && isFunction(val)) {
|
if (thisArg && isFunction$1(val)) {
|
||||||
a[key] = bind(val, thisArg);
|
a[key] = bind(val, thisArg);
|
||||||
} else {
|
} else {
|
||||||
a[key] = val;
|
a[key] = val;
|
||||||
|
|
@ -45500,13 +45533,13 @@ const isTypedArray = (TypedArray => {
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
const forEachEntry = (obj, fn) => {
|
const forEachEntry = (obj, fn) => {
|
||||||
const generator = obj && obj[Symbol.iterator];
|
const generator = obj && obj[iterator];
|
||||||
|
|
||||||
const iterator = generator.call(obj);
|
const _iterator = generator.call(obj);
|
||||||
|
|
||||||
let result;
|
let result;
|
||||||
|
|
||||||
while ((result = iterator.next()) && !result.done) {
|
while ((result = _iterator.next()) && !result.done) {
|
||||||
const pair = result.value;
|
const pair = result.value;
|
||||||
fn.call(obj, pair[0], pair[1]);
|
fn.call(obj, pair[0], pair[1]);
|
||||||
}
|
}
|
||||||
|
|
@ -45576,13 +45609,13 @@ const reduceDescriptors = (obj, reducer) => {
|
||||||
const freezeMethods = (obj) => {
|
const freezeMethods = (obj) => {
|
||||||
reduceDescriptors(obj, (descriptor, name) => {
|
reduceDescriptors(obj, (descriptor, name) => {
|
||||||
// skip restricted props in strict mode
|
// skip restricted props in strict mode
|
||||||
if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
|
if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const value = obj[name];
|
const value = obj[name];
|
||||||
|
|
||||||
if (!isFunction(value)) return;
|
if (!isFunction$1(value)) return;
|
||||||
|
|
||||||
descriptor.enumerable = false;
|
descriptor.enumerable = false;
|
||||||
|
|
||||||
|
|
@ -45619,6 +45652,8 @@ 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.
|
* If the thing is a FormData object, return true, otherwise return false.
|
||||||
*
|
*
|
||||||
|
|
@ -45627,7 +45662,7 @@ const toFiniteNumber = (value, defaultValue) => {
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
function isSpecCompliantForm(thing) {
|
function isSpecCompliantForm(thing) {
|
||||||
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
|
return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const toJSONObject = (obj) => {
|
const toJSONObject = (obj) => {
|
||||||
|
|
@ -45640,6 +45675,11 @@ const toJSONObject = (obj) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Buffer check
|
||||||
|
if (isBuffer(source)) {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
if(!('toJSON' in source)) {
|
if(!('toJSON' in source)) {
|
||||||
stack[i] = source;
|
stack[i] = source;
|
||||||
const target = isArray(source) ? [] : {};
|
const target = isArray(source) ? [] : {};
|
||||||
|
|
@ -45664,7 +45704,7 @@ const toJSONObject = (obj) => {
|
||||||
const isAsyncFn = kindOfTest('AsyncFunction');
|
const isAsyncFn = kindOfTest('AsyncFunction');
|
||||||
|
|
||||||
const isThenable = (thing) =>
|
const isThenable = (thing) =>
|
||||||
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
|
||||||
|
|
||||||
// original code
|
// original code
|
||||||
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
||||||
|
|
@ -45688,7 +45728,7 @@ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
||||||
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
||||||
})(
|
})(
|
||||||
typeof setImmediate === 'function',
|
typeof setImmediate === 'function',
|
||||||
isFunction(_global.postMessage)
|
isFunction$1(_global.postMessage)
|
||||||
);
|
);
|
||||||
|
|
||||||
const asap = typeof queueMicrotask !== 'undefined' ?
|
const asap = typeof queueMicrotask !== 'undefined' ?
|
||||||
|
|
@ -45696,6 +45736,10 @@ const asap = typeof queueMicrotask !== 'undefined' ?
|
||||||
|
|
||||||
// *********************
|
// *********************
|
||||||
|
|
||||||
|
|
||||||
|
const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
|
||||||
|
|
||||||
|
|
||||||
const utils$1 = {
|
const utils$1 = {
|
||||||
isArray,
|
isArray,
|
||||||
isArrayBuffer,
|
isArrayBuffer,
|
||||||
|
|
@ -45707,6 +45751,7 @@ const utils$1 = {
|
||||||
isBoolean,
|
isBoolean,
|
||||||
isObject,
|
isObject,
|
||||||
isPlainObject,
|
isPlainObject,
|
||||||
|
isEmptyObject,
|
||||||
isReadableStream,
|
isReadableStream,
|
||||||
isRequest,
|
isRequest,
|
||||||
isResponse,
|
isResponse,
|
||||||
|
|
@ -45716,7 +45761,7 @@ const utils$1 = {
|
||||||
isFile,
|
isFile,
|
||||||
isBlob,
|
isBlob,
|
||||||
isRegExp,
|
isRegExp,
|
||||||
isFunction,
|
isFunction: isFunction$1,
|
||||||
isStream,
|
isStream,
|
||||||
isURLSearchParams,
|
isURLSearchParams,
|
||||||
isTypedArray,
|
isTypedArray,
|
||||||
|
|
@ -45751,7 +45796,8 @@ const utils$1 = {
|
||||||
isAsyncFn,
|
isAsyncFn,
|
||||||
isThenable,
|
isThenable,
|
||||||
setImmediate: _setImmediate,
|
setImmediate: _setImmediate,
|
||||||
asap
|
asap,
|
||||||
|
isIterable
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -45841,11 +45887,18 @@ AxiosError.from = (error, code, config, request, response, customProps) => {
|
||||||
return prop !== 'isAxiosError';
|
return prop !== 'isAxiosError';
|
||||||
});
|
});
|
||||||
|
|
||||||
AxiosError.call(axiosError, error.message, code, config, request, response);
|
const msg = error && error.message ? error.message : 'Error';
|
||||||
|
|
||||||
axiosError.cause = 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);
|
||||||
|
|
||||||
axiosError.name = error.name;
|
// 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);
|
customProps && Object.assign(axiosError, customProps);
|
||||||
|
|
||||||
|
|
@ -45967,6 +46020,10 @@ function toFormData(obj, formData, options) {
|
||||||
return value.toISOString();
|
return value.toISOString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (utils$1.isBoolean(value)) {
|
||||||
|
return value.toString();
|
||||||
|
}
|
||||||
|
|
||||||
if (!useBlob && utils$1.isBlob(value)) {
|
if (!useBlob && utils$1.isBlob(value)) {
|
||||||
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
|
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
|
||||||
}
|
}
|
||||||
|
|
@ -46129,9 +46186,7 @@ function encode(val) {
|
||||||
replace(/%3A/gi, ':').
|
replace(/%3A/gi, ':').
|
||||||
replace(/%24/g, '$').
|
replace(/%24/g, '$').
|
||||||
replace(/%2C/gi, ',').
|
replace(/%2C/gi, ',').
|
||||||
replace(/%20/g, '+').
|
replace(/%20/g, '+');
|
||||||
replace(/%5B/gi, '[').
|
|
||||||
replace(/%5D/gi, ']');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -46351,7 +46406,7 @@ const platform = {
|
||||||
};
|
};
|
||||||
|
|
||||||
function toURLEncodedForm(data, options) {
|
function toURLEncodedForm(data, options) {
|
||||||
return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
|
return toFormData(data, new platform.classes.URLSearchParams(), {
|
||||||
visitor: function(value, key, path, helpers) {
|
visitor: function(value, key, path, helpers) {
|
||||||
if (platform.isNode && utils$1.isBuffer(value)) {
|
if (platform.isNode && utils$1.isBuffer(value)) {
|
||||||
this.append(key, value.toString('base64'));
|
this.append(key, value.toString('base64'));
|
||||||
|
|
@ -46359,8 +46414,9 @@ function toURLEncodedForm(data, options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return helpers.defaultVisitor.apply(this, arguments);
|
return helpers.defaultVisitor.apply(this, arguments);
|
||||||
}
|
},
|
||||||
}, options));
|
...options
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -46556,7 +46612,7 @@ const defaults = {
|
||||||
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return JSON.parse(data);
|
return JSON.parse(data, this.parseReviver);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (strictJSONParsing) {
|
if (strictJSONParsing) {
|
||||||
if (e.name === 'SyntaxError') {
|
if (e.name === 'SyntaxError') {
|
||||||
|
|
@ -46754,10 +46810,18 @@ class AxiosHeaders {
|
||||||
setHeaders(header, valueOrRewrite);
|
setHeaders(header, valueOrRewrite);
|
||||||
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
||||||
setHeaders(parseHeaders(header), valueOrRewrite);
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
||||||
} else if (utils$1.isHeaders(header)) {
|
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
||||||
for (const [key, value] of header.entries()) {
|
let obj = {}, dest, key;
|
||||||
setHeader(value, key, rewrite);
|
for (const entry of header) {
|
||||||
|
if (!utils$1.isArray(entry)) {
|
||||||
|
throw TypeError('Object iterator must return a key-value pair');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
obj[key = entry[0]] = (dest = obj[key]) ?
|
||||||
|
(utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
setHeaders(obj, valueOrRewrite);
|
||||||
} else {
|
} else {
|
||||||
header != null && setHeader(valueOrRewrite, header, rewrite);
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
||||||
}
|
}
|
||||||
|
|
@ -46899,6 +46963,10 @@ class AxiosHeaders {
|
||||||
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
|
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getSetCookie() {
|
||||||
|
return this.get("set-cookie") || [];
|
||||||
|
}
|
||||||
|
|
||||||
get [Symbol.toStringTag]() {
|
get [Symbol.toStringTag]() {
|
||||||
return 'AxiosHeaders';
|
return 'AxiosHeaders';
|
||||||
}
|
}
|
||||||
|
|
@ -47065,13 +47133,13 @@ function combineURLs(baseURL, relativeURL) {
|
||||||
*/
|
*/
|
||||||
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
||||||
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
||||||
if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
|
if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
|
||||||
return combineURLs(baseURL, requestedURL);
|
return combineURLs(baseURL, requestedURL);
|
||||||
}
|
}
|
||||||
return requestedURL;
|
return requestedURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
const VERSION = "1.8.2";
|
const VERSION = "1.12.1";
|
||||||
|
|
||||||
function parseProtocol(url) {
|
function parseProtocol(url) {
|
||||||
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
||||||
|
|
@ -47353,7 +47421,7 @@ const formDataToStream = (form, headersHandler, options) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
|
const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
|
||||||
const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF);
|
const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF);
|
||||||
let contentLength = footerBytes.byteLength;
|
let contentLength = footerBytes.byteLength;
|
||||||
|
|
||||||
const parts = Array.from(form.entries()).map(([name, value]) => {
|
const parts = Array.from(form.entries()).map(([name, value]) => {
|
||||||
|
|
@ -47499,7 +47567,7 @@ function throttle(fn, freq) {
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
timer = null;
|
timer = null;
|
||||||
}
|
}
|
||||||
fn.apply(null, args);
|
fn(...args);
|
||||||
};
|
};
|
||||||
|
|
||||||
const throttled = (...args) => {
|
const throttled = (...args) => {
|
||||||
|
|
@ -47564,6 +47632,80 @@ const progressEventDecorator = (total, throttled) => {
|
||||||
|
|
||||||
const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
|
const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Estimate decoded byte length of a data:// URL *without* allocating large buffers.
|
||||||
|
* - For base64: compute exact decoded size using length and padding;
|
||||||
|
* handle %XX at the character-count level (no string allocation).
|
||||||
|
* - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound.
|
||||||
|
*
|
||||||
|
* @param {string} url
|
||||||
|
* @returns {number}
|
||||||
|
*/
|
||||||
|
function estimateDataURLDecodedBytes(url) {
|
||||||
|
if (!url || typeof url !== 'string') return 0;
|
||||||
|
if (!url.startsWith('data:')) return 0;
|
||||||
|
|
||||||
|
const comma = url.indexOf(',');
|
||||||
|
if (comma < 0) return 0;
|
||||||
|
|
||||||
|
const meta = url.slice(5, comma);
|
||||||
|
const body = url.slice(comma + 1);
|
||||||
|
const isBase64 = /;base64/i.test(meta);
|
||||||
|
|
||||||
|
if (isBase64) {
|
||||||
|
let effectiveLen = body.length;
|
||||||
|
const len = body.length; // cache 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 =
|
||||||
|
((a >= 48 && a <= 57) || (a >= 65 && a <= 70) || (a >= 97 && a <= 102)) &&
|
||||||
|
((b >= 48 && b <= 57) || (b >= 65 && b <= 70) || (b >= 97 && b <= 102));
|
||||||
|
|
||||||
|
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); // 'D' or 'd'
|
||||||
|
|
||||||
|
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 bytes = groups * 3 - (pad || 0);
|
||||||
|
return bytes > 0 ? bytes : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Buffer.byteLength(body, 'utf8');
|
||||||
|
}
|
||||||
|
|
||||||
const zlibOptions = {
|
const zlibOptions = {
|
||||||
flush: zlib__default["default"].constants.Z_SYNC_FLUSH,
|
flush: zlib__default["default"].constants.Z_SYNC_FLUSH,
|
||||||
finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH
|
finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH
|
||||||
|
|
@ -47584,6 +47726,7 @@ const supportedProtocols = platform.protocols.map(protocol => {
|
||||||
return protocol + ':';
|
return protocol + ':';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const flushOnFinish = (stream, [throttled, flush]) => {
|
const flushOnFinish = (stream, [throttled, flush]) => {
|
||||||
stream
|
stream
|
||||||
.on('end', flush)
|
.on('end', flush)
|
||||||
|
|
@ -47592,6 +47735,7 @@ const flushOnFinish = (stream, [throttled, flush]) => {
|
||||||
return throttled;
|
return throttled;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the proxy or config beforeRedirects functions are defined, call them with the options
|
* If the proxy or config beforeRedirects functions are defined, call them with the options
|
||||||
* object.
|
* object.
|
||||||
|
|
@ -47771,6 +47915,21 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
||||||
const protocol = parsed.protocol || supportedProtocols[0];
|
const protocol = parsed.protocol || supportedProtocols[0];
|
||||||
|
|
||||||
if (protocol === 'data:') {
|
if (protocol === 'data:') {
|
||||||
|
// Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set.
|
||||||
|
if (config.maxContentLength > -1) {
|
||||||
|
// Use the exact string passed to fromDataURI (config.url); fall back to fullPath if needed.
|
||||||
|
const dataUrl = String(config.url || fullPath || '');
|
||||||
|
const estimated = estimateDataURLDecodedBytes(dataUrl);
|
||||||
|
|
||||||
|
if (estimated > config.maxContentLength) {
|
||||||
|
return reject(new AxiosError(
|
||||||
|
'maxContentLength size of ' + config.maxContentLength + ' exceeded',
|
||||||
|
AxiosError.ERR_BAD_RESPONSE,
|
||||||
|
config
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let convertedData;
|
let convertedData;
|
||||||
|
|
||||||
if (method !== 'GET') {
|
if (method !== 'GET') {
|
||||||
|
|
@ -48373,7 +48532,7 @@ function mergeConfig(config1, config2) {
|
||||||
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(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
|
||||||
const merge = mergeMap[prop] || mergeDeepProperties;
|
const merge = mergeMap[prop] || mergeDeepProperties;
|
||||||
const configValue = merge(config1[prop], config2[prop], prop);
|
const configValue = merge(config1[prop], config2[prop], prop);
|
||||||
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
||||||
|
|
@ -48389,7 +48548,7 @@ const resolveConfig = (config) => {
|
||||||
|
|
||||||
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
||||||
|
|
||||||
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
|
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
|
||||||
|
|
||||||
// HTTP basic authentication
|
// HTTP basic authentication
|
||||||
if (auth) {
|
if (auth) {
|
||||||
|
|
@ -48398,15 +48557,19 @@ const resolveConfig = (config) => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
let contentType;
|
|
||||||
|
|
||||||
if (utils$1.isFormData(data)) {
|
if (utils$1.isFormData(data)) {
|
||||||
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
||||||
headers.setContentType(undefined); // Let the browser set it
|
headers.setContentType(undefined); // browser handles it
|
||||||
} else if ((contentType = headers.getContentType()) !== false) {
|
} else if (utils$1.isFunction(data.getHeaders)) {
|
||||||
// fix semicolon duplication issue for ReactNative FormData implementation
|
// Node.js FormData (like form-data package)
|
||||||
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
|
const formHeaders = data.getHeaders();
|
||||||
headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
// Only set safe headers to avoid overwriting security headers
|
||||||
|
const allowedHeaders = ['content-type', 'content-length'];
|
||||||
|
Object.entries(formHeaders).forEach(([key, val]) => {
|
||||||
|
if (allowedHeaders.includes(key.toLowerCase())) {
|
||||||
|
headers.set(key, val);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -48525,12 +48688,15 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle low level network errors
|
// Handle low level network errors
|
||||||
request.onerror = function handleError() {
|
request.onerror = function handleError(event) {
|
||||||
// Real errors are hidden from us by the browser
|
// Browsers deliver a ProgressEvent in XHR onerror
|
||||||
// onerror should only fire if it's a network error
|
// (message may be empty; when present, surface it)
|
||||||
reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));
|
// See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
|
||||||
|
const msg = event && event.message ? event.message : 'Network Error';
|
||||||
// Clean up request
|
const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);
|
||||||
|
// attach the underlying event for consumers who want details
|
||||||
|
err.event = event || null;
|
||||||
|
reject(err);
|
||||||
request = null;
|
request = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -48749,14 +48915,18 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';
|
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
||||||
const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';
|
|
||||||
|
const {isFunction} = utils$1;
|
||||||
|
|
||||||
|
const globalFetchAPI = (({fetch, Request, Response}) => ({
|
||||||
|
fetch, Request, Response
|
||||||
|
}))(utils$1.global);
|
||||||
|
|
||||||
|
const {
|
||||||
|
ReadableStream: ReadableStream$1, TextEncoder: TextEncoder$1
|
||||||
|
} = utils$1.global;
|
||||||
|
|
||||||
// used only inside the fetch adapter
|
|
||||||
const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
|
|
||||||
((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
|
|
||||||
async (str) => new Uint8Array(await new Response(str).arrayBuffer())
|
|
||||||
);
|
|
||||||
|
|
||||||
const test = (fn, ...args) => {
|
const test = (fn, ...args) => {
|
||||||
try {
|
try {
|
||||||
|
|
@ -48766,11 +48936,28 @@ const test = (fn, ...args) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const supportsRequestStream = isReadableStreamSupported && test(() => {
|
const factory = (env) => {
|
||||||
|
const {fetch, Request, Response} = Object.assign({}, globalFetchAPI, env);
|
||||||
|
const isFetchSupported = isFunction(fetch);
|
||||||
|
const isRequestSupported = isFunction(Request);
|
||||||
|
const isResponseSupported = isFunction(Response);
|
||||||
|
|
||||||
|
if (!isFetchSupported) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
|
||||||
|
|
||||||
|
const encodeText = isFetchSupported && (typeof TextEncoder$1 === 'function' ?
|
||||||
|
((encoder) => (str) => encoder.encode(str))(new TextEncoder$1()) :
|
||||||
|
async (str) => new Uint8Array(await new Request(str).arrayBuffer())
|
||||||
|
);
|
||||||
|
|
||||||
|
const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
|
||||||
let duplexAccessed = false;
|
let duplexAccessed = false;
|
||||||
|
|
||||||
const hasContentType = new Request(platform.origin, {
|
const hasContentType = new Request(platform.origin, {
|
||||||
body: new ReadableStream(),
|
body: new ReadableStream$1(),
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
get duplex() {
|
get duplex() {
|
||||||
duplexAccessed = true;
|
duplexAccessed = true;
|
||||||
|
|
@ -48781,24 +48968,26 @@ const supportsRequestStream = isReadableStreamSupported && test(() => {
|
||||||
return duplexAccessed && !hasContentType;
|
return duplexAccessed && !hasContentType;
|
||||||
});
|
});
|
||||||
|
|
||||||
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&
|
||||||
|
|
||||||
const supportsResponseStream = isReadableStreamSupported &&
|
|
||||||
test(() => utils$1.isReadableStream(new Response('').body));
|
test(() => utils$1.isReadableStream(new Response('').body));
|
||||||
|
|
||||||
|
|
||||||
const resolvers = {
|
const resolvers = {
|
||||||
stream: supportsResponseStream && ((res) => res.body)
|
stream: supportsResponseStream && ((res) => res.body)
|
||||||
};
|
};
|
||||||
|
|
||||||
isFetchSupported && (((res) => {
|
isFetchSupported && ((() => {
|
||||||
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
||||||
!resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :
|
!resolvers[type] && (resolvers[type] = (res, config) => {
|
||||||
(_, config) => {
|
let method = res && res[type];
|
||||||
|
|
||||||
|
if (method) {
|
||||||
|
return method.call(res);
|
||||||
|
}
|
||||||
|
|
||||||
throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
|
throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})(new Response));
|
})());
|
||||||
|
|
||||||
const getBodyLength = async (body) => {
|
const getBodyLength = async (body) => {
|
||||||
if (body == null) {
|
if (body == null) {
|
||||||
|
|
@ -48836,7 +49025,7 @@ const resolveBodyLength = async (headers, body) => {
|
||||||
return length == null ? getBodyLength(body) : length;
|
return length == null ? getBodyLength(body) : length;
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchAdapter = isFetchSupported && (async (config) => {
|
return async (config) => {
|
||||||
let {
|
let {
|
||||||
url,
|
url,
|
||||||
method,
|
method,
|
||||||
|
|
@ -48856,7 +49045,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
||||||
|
|
||||||
let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
||||||
|
|
||||||
let request;
|
let request = null;
|
||||||
|
|
||||||
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
||||||
composedSignal.unsubscribe();
|
composedSignal.unsubscribe();
|
||||||
|
|
@ -48897,8 +49086,9 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
||||||
|
|
||||||
// Cloudflare Workers throws when credentials are defined
|
// Cloudflare Workers throws when credentials are defined
|
||||||
// see https://github.com/cloudflare/workerd/issues/902
|
// see https://github.com/cloudflare/workerd/issues/902
|
||||||
const isCredentialsSupported = "credentials" in Request.prototype;
|
const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
|
||||||
request = new Request(url, {
|
|
||||||
|
const resolvedOptions = {
|
||||||
...fetchOptions,
|
...fetchOptions,
|
||||||
signal: composedSignal,
|
signal: composedSignal,
|
||||||
method: method.toUpperCase(),
|
method: method.toUpperCase(),
|
||||||
|
|
@ -48906,9 +49096,11 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
||||||
body: data,
|
body: data,
|
||||||
duplex: "half",
|
duplex: "half",
|
||||||
credentials: isCredentialsSupported ? withCredentials : undefined
|
credentials: isCredentialsSupported ? withCredentials : undefined
|
||||||
});
|
};
|
||||||
|
|
||||||
let response = await fetch(request);
|
request = isRequestSupported && new Request(url, resolvedOptions);
|
||||||
|
|
||||||
|
let response = await (isRequestSupported ? fetch(request, fetchOptions) : fetch(url, resolvedOptions));
|
||||||
|
|
||||||
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
||||||
|
|
||||||
|
|
@ -48954,7 +49146,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
unsubscribe && unsubscribe();
|
unsubscribe && unsubscribe();
|
||||||
|
|
||||||
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
|
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
||||||
throw Object.assign(
|
throw Object.assign(
|
||||||
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
|
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
|
||||||
{
|
{
|
||||||
|
|
@ -48965,12 +49157,45 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
||||||
|
|
||||||
throw AxiosError.from(err, err && err.code, config, request);
|
throw AxiosError.from(err, err && err.code, config, request);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const seedCache = new Map();
|
||||||
|
|
||||||
|
const getFetch = (config) => {
|
||||||
|
let env = utils$1.merge.call({
|
||||||
|
skipUndefined: true
|
||||||
|
}, globalFetchAPI, config ? config.env : null);
|
||||||
|
|
||||||
|
const {fetch, Request, Response} = env;
|
||||||
|
|
||||||
|
const seeds = [
|
||||||
|
Request, Response, fetch
|
||||||
|
];
|
||||||
|
|
||||||
|
let len = seeds.length, i = len,
|
||||||
|
seed, target, map = seedCache;
|
||||||
|
|
||||||
|
while (i--) {
|
||||||
|
seed = seeds[i];
|
||||||
|
target = map.get(seed);
|
||||||
|
|
||||||
|
target === undefined && map.set(seed, target = (i ? new Map() : factory(env)));
|
||||||
|
|
||||||
|
map = target;
|
||||||
|
}
|
||||||
|
|
||||||
|
return target;
|
||||||
|
};
|
||||||
|
|
||||||
|
getFetch();
|
||||||
|
|
||||||
const knownAdapters = {
|
const knownAdapters = {
|
||||||
http: httpAdapter,
|
http: httpAdapter,
|
||||||
xhr: xhrAdapter,
|
xhr: xhrAdapter,
|
||||||
fetch: fetchAdapter
|
fetch: {
|
||||||
|
get: getFetch,
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
utils$1.forEach(knownAdapters, (fn, value) => {
|
utils$1.forEach(knownAdapters, (fn, value) => {
|
||||||
|
|
@ -48989,7 +49214,7 @@ const renderReason = (reason) => `- ${reason}`;
|
||||||
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
||||||
|
|
||||||
const adapters = {
|
const adapters = {
|
||||||
getAdapter: (adapters) => {
|
getAdapter: (adapters, config) => {
|
||||||
adapters = utils$1.isArray(adapters) ? adapters : [adapters];
|
adapters = utils$1.isArray(adapters) ? adapters : [adapters];
|
||||||
|
|
||||||
const {length} = adapters;
|
const {length} = adapters;
|
||||||
|
|
@ -49012,7 +49237,7 @@ const adapters = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (adapter) {
|
if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -49080,7 +49305,7 @@ function dispatchRequest(config) {
|
||||||
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
|
const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config);
|
||||||
|
|
||||||
return adapter(config).then(function onAdapterResolution(response) {
|
return adapter(config).then(function onAdapterResolution(response) {
|
||||||
throwIfCancellationRequested(config);
|
throwIfCancellationRequested(config);
|
||||||
|
|
@ -49220,7 +49445,7 @@ const validators = validator.validators;
|
||||||
*/
|
*/
|
||||||
class Axios {
|
class Axios {
|
||||||
constructor(instanceConfig) {
|
constructor(instanceConfig) {
|
||||||
this.defaults = instanceConfig;
|
this.defaults = instanceConfig || {};
|
||||||
this.interceptors = {
|
this.interceptors = {
|
||||||
request: new InterceptorManager$1(),
|
request: new InterceptorManager$1(),
|
||||||
response: new InterceptorManager$1()
|
response: new InterceptorManager$1()
|
||||||
|
|
@ -49351,8 +49576,8 @@ class Axios {
|
||||||
|
|
||||||
if (!synchronousRequestInterceptors) {
|
if (!synchronousRequestInterceptors) {
|
||||||
const chain = [dispatchRequest.bind(this), undefined];
|
const chain = [dispatchRequest.bind(this), undefined];
|
||||||
chain.unshift.apply(chain, requestInterceptorChain);
|
chain.unshift(...requestInterceptorChain);
|
||||||
chain.push.apply(chain, responseInterceptorChain);
|
chain.push(...responseInterceptorChain);
|
||||||
len = chain.length;
|
len = chain.length;
|
||||||
|
|
||||||
promise = Promise.resolve(config);
|
promise = Promise.resolve(config);
|
||||||
|
|
|
||||||
17
package-lock.json
generated
17
package-lock.json
generated
|
|
@ -2244,13 +2244,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/axios": {
|
"node_modules/axios": {
|
||||||
"version": "1.8.2",
|
"version": "1.12.1",
|
||||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.8.2.tgz",
|
"resolved": "https://registry.npmjs.org/axios/-/axios-1.12.1.tgz",
|
||||||
"integrity": "sha512-ls4GYBm5aig9vWx8AWDSGLpnpDQRtWAfrjU+EuytuODrFBkqesN2RkOQCBzrA1RQNHw1SmRMSDDDSwzNAYQ6Rg==",
|
"integrity": "sha512-Kn4kbSXpkFHCGE6rBFNwIv0GQs4AvDT80jlveJDKFxjbTYMUeB4QtsdPCv6H8Cm19Je7IU6VFtRl2zWZI0rudQ==",
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"follow-redirects": "^1.15.6",
|
"follow-redirects": "^1.15.6",
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.4",
|
||||||
"proxy-from-env": "^1.1.0"
|
"proxy-from-env": "^1.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -9104,12 +9103,12 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"axios": {
|
"axios": {
|
||||||
"version": "1.8.2",
|
"version": "1.12.1",
|
||||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.8.2.tgz",
|
"resolved": "https://registry.npmjs.org/axios/-/axios-1.12.1.tgz",
|
||||||
"integrity": "sha512-ls4GYBm5aig9vWx8AWDSGLpnpDQRtWAfrjU+EuytuODrFBkqesN2RkOQCBzrA1RQNHw1SmRMSDDDSwzNAYQ6Rg==",
|
"integrity": "sha512-Kn4kbSXpkFHCGE6rBFNwIv0GQs4AvDT80jlveJDKFxjbTYMUeB4QtsdPCv6H8Cm19Je7IU6VFtRl2zWZI0rudQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"follow-redirects": "^1.15.6",
|
"follow-redirects": "^1.15.6",
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.4",
|
||||||
"proxy-from-env": "^1.1.0"
|
"proxy-from-env": "^1.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue