build(deps): bump axios from 1.8.2 to 1.12.0 (#3357)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dni ⚡ <office@dnilabs.com>
This commit is contained in:
parent
60f50a71a2
commit
183b84c167
4 changed files with 435 additions and 313 deletions
4
lnbits/static/bundle.min.js
vendored
4
lnbits/static/bundle.min.js
vendored
File diff suppressed because one or more lines are too long
388
lnbits/static/vendor/axios.js
vendored
388
lnbits/static/vendor/axios.js
vendored
|
|
@ -1,4 +1,4 @@
|
||||||
/*! Axios v1.8.2 Copyright (c) 2025 Matt Zabriskie and contributors */
|
/*! Axios v1.12.0 Copyright (c) 2025 Matt Zabriskie and contributors */
|
||||||
(function (global, factory) {
|
(function (global, factory) {
|
||||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||||
typeof define === 'function' && define.amd ? define(factory) :
|
typeof define === 'function' && define.amd ? define(factory) :
|
||||||
|
|
@ -585,9 +585,6 @@
|
||||||
function _slicedToArray(arr, i) {
|
function _slicedToArray(arr, i) {
|
||||||
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
||||||
}
|
}
|
||||||
function _toArray(arr) {
|
|
||||||
return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
|
|
||||||
}
|
|
||||||
function _toConsumableArray(arr) {
|
function _toConsumableArray(arr) {
|
||||||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
||||||
}
|
}
|
||||||
|
|
@ -681,6 +678,8 @@
|
||||||
|
|
||||||
var toString = Object.prototype.toString;
|
var toString = Object.prototype.toString;
|
||||||
var getPrototypeOf = Object.getPrototypeOf;
|
var getPrototypeOf = Object.getPrototypeOf;
|
||||||
|
var iterator = Symbol.iterator,
|
||||||
|
toStringTag = Symbol.toStringTag;
|
||||||
var kindOf = function (cache) {
|
var kindOf = function (cache) {
|
||||||
return function (thing) {
|
return function (thing) {
|
||||||
var str = toString.call(thing);
|
var str = toString.call(thing);
|
||||||
|
|
@ -725,7 +724,7 @@
|
||||||
* @returns {boolean} True if value is a Buffer, otherwise false
|
* @returns {boolean} True if value is a Buffer, otherwise false
|
||||||
*/
|
*/
|
||||||
function isBuffer(val) {
|
function isBuffer(val) {
|
||||||
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -769,7 +768,7 @@
|
||||||
* @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
|
||||||
*/
|
*/
|
||||||
var isFunction = typeOfTest('function');
|
var isFunction$1 = typeOfTest('function');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if a value is a Number
|
* Determine if a value is a Number
|
||||||
|
|
@ -813,7 +812,27 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var prototype = getPrototypeOf(val);
|
var 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
|
||||||
|
*/
|
||||||
|
var isEmptyObject = function 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;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -860,7 +879,7 @@
|
||||||
* @returns {boolean} True if value is a Stream, otherwise false
|
* @returns {boolean} True if value is a Stream, otherwise false
|
||||||
*/
|
*/
|
||||||
var isStream = function isStream(val) {
|
var isStream = function isStream(val) {
|
||||||
return isObject(val) && isFunction(val.pipe);
|
return isObject(val) && isFunction$1(val.pipe);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -872,9 +891,9 @@
|
||||||
*/
|
*/
|
||||||
var isFormData = function isFormData(thing) {
|
var isFormData = function isFormData(thing) {
|
||||||
var kind;
|
var kind;
|
||||||
return thing && (typeof FormData === 'function' && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === 'formdata' ||
|
return thing && (typeof FormData === 'function' && thing instanceof FormData || isFunction$1(thing.append) && ((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]'));
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -940,6 +959,11 @@
|
||||||
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
|
||||||
var keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
var keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
||||||
var len = keys.length;
|
var len = keys.length;
|
||||||
|
|
@ -951,6 +975,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function findKey(obj, key) {
|
function findKey(obj, key) {
|
||||||
|
if (isBuffer(obj)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
key = key.toLowerCase();
|
key = key.toLowerCase();
|
||||||
var keys = Object.keys(obj);
|
var keys = Object.keys(obj);
|
||||||
var i = keys.length;
|
var i = keys.length;
|
||||||
|
|
@ -993,7 +1020,8 @@
|
||||||
function merge( /* obj1, obj2, obj3, ... */
|
function merge( /* obj1, obj2, obj3, ... */
|
||||||
) {
|
) {
|
||||||
var _ref2 = isContextDefined(this) && this || {},
|
var _ref2 = isContextDefined(this) && this || {},
|
||||||
caseless = _ref2.caseless;
|
caseless = _ref2.caseless,
|
||||||
|
skipUndefined = _ref2.skipUndefined;
|
||||||
var result = {};
|
var result = {};
|
||||||
var assignValue = function assignValue(val, key) {
|
var assignValue = function assignValue(val, key) {
|
||||||
var targetKey = caseless && findKey(result, key) || key;
|
var targetKey = caseless && findKey(result, key) || key;
|
||||||
|
|
@ -1004,8 +1032,10 @@
|
||||||
} 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 (var i = 0, l = arguments.length; i < l; i++) {
|
for (var i = 0, l = arguments.length; i < l; i++) {
|
||||||
arguments[i] && forEach(arguments[i], assignValue);
|
arguments[i] && forEach(arguments[i], assignValue);
|
||||||
|
|
@ -1027,7 +1057,7 @@
|
||||||
var _ref3 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
|
var _ref3 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
|
||||||
allOwnKeys = _ref3.allOwnKeys;
|
allOwnKeys = _ref3.allOwnKeys;
|
||||||
forEach(b, function (val, key) {
|
forEach(b, function (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;
|
||||||
|
|
@ -1165,10 +1195,10 @@
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
var forEachEntry = function forEachEntry(obj, fn) {
|
var forEachEntry = function forEachEntry(obj, fn) {
|
||||||
var generator = obj && obj[Symbol.iterator];
|
var generator = obj && obj[iterator];
|
||||||
var iterator = generator.call(obj);
|
var _iterator = generator.call(obj);
|
||||||
var result;
|
var result;
|
||||||
while ((result = iterator.next()) && !result.done) {
|
while ((result = _iterator.next()) && !result.done) {
|
||||||
var pair = result.value;
|
var pair = result.value;
|
||||||
fn.call(obj, pair[0], pair[1]);
|
fn.call(obj, pair[0], pair[1]);
|
||||||
}
|
}
|
||||||
|
|
@ -1235,11 +1265,11 @@
|
||||||
var freezeMethods = function freezeMethods(obj) {
|
var freezeMethods = function freezeMethods(obj) {
|
||||||
reduceDescriptors(obj, function (descriptor, name) {
|
reduceDescriptors(obj, function (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;
|
||||||
}
|
}
|
||||||
var value = obj[name];
|
var value = obj[name];
|
||||||
if (!isFunction(value)) return;
|
if (!isFunction$1(value)) return;
|
||||||
descriptor.enumerable = false;
|
descriptor.enumerable = false;
|
||||||
if ('writable' in descriptor) {
|
if ('writable' in descriptor) {
|
||||||
descriptor.writable = false;
|
descriptor.writable = false;
|
||||||
|
|
@ -1275,7 +1305,7 @@
|
||||||
* @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]);
|
||||||
}
|
}
|
||||||
var toJSONObject = function toJSONObject(obj) {
|
var toJSONObject = function toJSONObject(obj) {
|
||||||
var stack = new Array(10);
|
var stack = new Array(10);
|
||||||
|
|
@ -1284,6 +1314,11 @@
|
||||||
if (stack.indexOf(source) >= 0) {
|
if (stack.indexOf(source) >= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Buffer check
|
||||||
|
if (isBuffer(source)) {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
if (!('toJSON' in source)) {
|
if (!('toJSON' in source)) {
|
||||||
stack[i] = source;
|
stack[i] = source;
|
||||||
var target = isArray(source) ? [] : {};
|
var target = isArray(source) ? [] : {};
|
||||||
|
|
@ -1301,7 +1336,7 @@
|
||||||
};
|
};
|
||||||
var isAsyncFn = kindOfTest('AsyncFunction');
|
var isAsyncFn = kindOfTest('AsyncFunction');
|
||||||
var isThenable = function isThenable(thing) {
|
var isThenable = function isThenable(thing) {
|
||||||
return thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing["catch"]);
|
return thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing["catch"]);
|
||||||
};
|
};
|
||||||
|
|
||||||
// original code
|
// original code
|
||||||
|
|
@ -1326,11 +1361,14 @@
|
||||||
}("axios@".concat(Math.random()), []) : function (cb) {
|
}("axios@".concat(Math.random()), []) : function (cb) {
|
||||||
return setTimeout(cb);
|
return setTimeout(cb);
|
||||||
};
|
};
|
||||||
}(typeof setImmediate === 'function', isFunction(_global.postMessage));
|
}(typeof setImmediate === 'function', isFunction$1(_global.postMessage));
|
||||||
var asap = typeof queueMicrotask !== 'undefined' ? queueMicrotask.bind(_global) : typeof process !== 'undefined' && process.nextTick || _setImmediate;
|
var asap = typeof queueMicrotask !== 'undefined' ? queueMicrotask.bind(_global) : typeof process !== 'undefined' && process.nextTick || _setImmediate;
|
||||||
|
|
||||||
// *********************
|
// *********************
|
||||||
|
|
||||||
|
var isIterable = function isIterable(thing) {
|
||||||
|
return thing != null && isFunction$1(thing[iterator]);
|
||||||
|
};
|
||||||
var utils$1 = {
|
var utils$1 = {
|
||||||
isArray: isArray,
|
isArray: isArray,
|
||||||
isArrayBuffer: isArrayBuffer,
|
isArrayBuffer: isArrayBuffer,
|
||||||
|
|
@ -1342,6 +1380,7 @@
|
||||||
isBoolean: isBoolean,
|
isBoolean: isBoolean,
|
||||||
isObject: isObject,
|
isObject: isObject,
|
||||||
isPlainObject: isPlainObject,
|
isPlainObject: isPlainObject,
|
||||||
|
isEmptyObject: isEmptyObject,
|
||||||
isReadableStream: isReadableStream,
|
isReadableStream: isReadableStream,
|
||||||
isRequest: isRequest,
|
isRequest: isRequest,
|
||||||
isResponse: isResponse,
|
isResponse: isResponse,
|
||||||
|
|
@ -1351,7 +1390,7 @@
|
||||||
isFile: isFile,
|
isFile: isFile,
|
||||||
isBlob: isBlob,
|
isBlob: isBlob,
|
||||||
isRegExp: isRegExp,
|
isRegExp: isRegExp,
|
||||||
isFunction: isFunction,
|
isFunction: isFunction$1,
|
||||||
isStream: isStream,
|
isStream: isStream,
|
||||||
isURLSearchParams: isURLSearchParams,
|
isURLSearchParams: isURLSearchParams,
|
||||||
isTypedArray: isTypedArray,
|
isTypedArray: isTypedArray,
|
||||||
|
|
@ -1387,7 +1426,8 @@
|
||||||
isAsyncFn: isAsyncFn,
|
isAsyncFn: isAsyncFn,
|
||||||
isThenable: isThenable,
|
isThenable: isThenable,
|
||||||
setImmediate: _setImmediate,
|
setImmediate: _setImmediate,
|
||||||
asap: asap
|
asap: asap,
|
||||||
|
isIterable: isIterable
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1461,9 +1501,20 @@
|
||||||
}, function (prop) {
|
}, function (prop) {
|
||||||
return prop !== 'isAxiosError';
|
return prop !== 'isAxiosError';
|
||||||
});
|
});
|
||||||
AxiosError.call(axiosError, error.message, code, config, request, response);
|
var msg = error && error.message ? error.message : 'Error';
|
||||||
axiosError.cause = error;
|
|
||||||
axiosError.name = error.name;
|
// Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)
|
||||||
|
var 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);
|
customProps && Object.assign(axiosError, customProps);
|
||||||
return axiosError;
|
return axiosError;
|
||||||
};
|
};
|
||||||
|
|
@ -1580,6 +1631,9 @@
|
||||||
if (utils$1.isDate(value)) {
|
if (utils$1.isDate(value)) {
|
||||||
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.');
|
||||||
}
|
}
|
||||||
|
|
@ -1708,7 +1762,7 @@
|
||||||
* @returns {string} The encoded value.
|
* @returns {string} The encoded value.
|
||||||
*/
|
*/
|
||||||
function encode(val) {
|
function encode(val) {
|
||||||
return encodeURIComponent(val).replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+').replace(/%5B/gi, '[').replace(/%5D/gi, ']');
|
return encodeURIComponent(val).replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1898,7 +1952,7 @@
|
||||||
var platform = _objectSpread2(_objectSpread2({}, utils), platform$1);
|
var platform = _objectSpread2(_objectSpread2({}, utils), platform$1);
|
||||||
|
|
||||||
function toURLEncodedForm(data, options) {
|
function toURLEncodedForm(data, options) {
|
||||||
return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
|
return toFormData(data, new platform.classes.URLSearchParams(), _objectSpread2({
|
||||||
visitor: function visitor(value, key, path, helpers) {
|
visitor: function visitor(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'));
|
||||||
|
|
@ -2063,7 +2117,7 @@
|
||||||
var silentJSONParsing = transitional && transitional.silentJSONParsing;
|
var silentJSONParsing = transitional && transitional.silentJSONParsing;
|
||||||
var strictJSONParsing = !silentJSONParsing && JSONRequested;
|
var 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') {
|
||||||
|
|
@ -2227,21 +2281,26 @@
|
||||||
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)) {
|
||||||
var _iterator = _createForOfIteratorHelper(header.entries()),
|
var obj = {},
|
||||||
|
dest,
|
||||||
|
key;
|
||||||
|
var _iterator = _createForOfIteratorHelper(header),
|
||||||
_step;
|
_step;
|
||||||
try {
|
try {
|
||||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||||
var _step$value = _slicedToArray(_step.value, 2),
|
var entry = _step.value;
|
||||||
key = _step$value[0],
|
if (!utils$1.isArray(entry)) {
|
||||||
value = _step$value[1];
|
throw TypeError('Object iterator must return a key-value pair');
|
||||||
setHeader(value, key, rewrite);
|
}
|
||||||
|
obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [].concat(_toConsumableArray(dest), [entry[1]]) : [dest, entry[1]] : entry[1];
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
_iterator.e(err);
|
_iterator.e(err);
|
||||||
} finally {
|
} finally {
|
||||||
_iterator.f();
|
_iterator.f();
|
||||||
}
|
}
|
||||||
|
setHeaders(obj, valueOrRewrite);
|
||||||
} else {
|
} else {
|
||||||
header != null && setHeader(valueOrRewrite, header, rewrite);
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
||||||
}
|
}
|
||||||
|
|
@ -2372,6 +2431,11 @@
|
||||||
return header + ': ' + value;
|
return header + ': ' + value;
|
||||||
}).join('\n');
|
}).join('\n');
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
key: "getSetCookie",
|
||||||
|
value: function getSetCookie() {
|
||||||
|
return this.get("set-cookie") || [];
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
key: _Symbol$toStringTag,
|
key: _Symbol$toStringTag,
|
||||||
get: function get() {
|
get: function get() {
|
||||||
|
|
@ -2557,7 +2621,7 @@
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
timer = null;
|
timer = null;
|
||||||
}
|
}
|
||||||
fn.apply(null, args);
|
fn.apply(void 0, _toConsumableArray(args));
|
||||||
};
|
};
|
||||||
var throttled = function throttled() {
|
var throttled = function throttled() {
|
||||||
var now = Date.now();
|
var now = Date.now();
|
||||||
|
|
@ -2703,7 +2767,7 @@
|
||||||
*/
|
*/
|
||||||
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
||||||
var isRelativeUrl = !isAbsoluteURL(requestedURL);
|
var 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;
|
||||||
|
|
@ -2805,7 +2869,7 @@
|
||||||
return mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true);
|
return mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
utils$1.forEach(Object.keys(_objectSpread2(_objectSpread2({}, config1), config2)), function computeConfigValue(prop) {
|
||||||
var merge = mergeMap[prop] || mergeDeepProperties;
|
var merge = mergeMap[prop] || mergeDeepProperties;
|
||||||
var configValue = merge(config1[prop], config2[prop], prop);
|
var 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);
|
||||||
|
|
@ -2822,25 +2886,28 @@
|
||||||
headers = newConfig.headers,
|
headers = newConfig.headers,
|
||||||
auth = newConfig.auth;
|
auth = newConfig.auth;
|
||||||
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) {
|
||||||
headers.set('Authorization', 'Basic ' + btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : '')));
|
headers.set('Authorization', 'Basic ' + btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : '')));
|
||||||
}
|
}
|
||||||
var 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)
|
||||||
var _ref = contentType ? contentType.split(';').map(function (token) {
|
var formHeaders = data.getHeaders();
|
||||||
return token.trim();
|
// Only set safe headers to avoid overwriting security headers
|
||||||
}).filter(Boolean) : [],
|
var allowedHeaders = ['content-type', 'content-length'];
|
||||||
_ref2 = _toArray(_ref),
|
Object.entries(formHeaders).forEach(function (_ref) {
|
||||||
type = _ref2[0],
|
var _ref2 = _slicedToArray(_ref, 2),
|
||||||
tokens = _ref2.slice(1);
|
key = _ref2[0],
|
||||||
headers.setContentType([type || 'multipart/form-data'].concat(_toConsumableArray(tokens)).join('; '));
|
val = _ref2[1];
|
||||||
|
if (allowedHeaders.includes(key.toLowerCase())) {
|
||||||
|
headers.set(key, val);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2946,12 +3013,15 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
// 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
|
||||||
|
var msg = event && event.message ? event.message : 'Network Error';
|
||||||
// Clean up request
|
var 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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -3280,35 +3350,21 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';
|
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
||||||
var isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';
|
var isFunction = utils$1.isFunction;
|
||||||
|
var globalFetchAPI = function (_ref) {
|
||||||
// used only inside the fetch adapter
|
var fetch = _ref.fetch,
|
||||||
var encodeText = isFetchSupported && (typeof TextEncoder === 'function' ? function (encoder) {
|
Request = _ref.Request,
|
||||||
return function (str) {
|
Response = _ref.Response;
|
||||||
return encoder.encode(str);
|
return {
|
||||||
|
fetch: fetch,
|
||||||
|
Request: Request,
|
||||||
|
Response: Response
|
||||||
};
|
};
|
||||||
}(new TextEncoder()) : ( /*#__PURE__*/function () {
|
}(utils$1.global);
|
||||||
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(str) {
|
var _utils$global = utils$1.global,
|
||||||
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
ReadableStream$1 = _utils$global.ReadableStream,
|
||||||
while (1) switch (_context.prev = _context.next) {
|
TextEncoder = _utils$global.TextEncoder;
|
||||||
case 0:
|
|
||||||
_context.t0 = Uint8Array;
|
|
||||||
_context.next = 3;
|
|
||||||
return new Response(str).arrayBuffer();
|
|
||||||
case 3:
|
|
||||||
_context.t1 = _context.sent;
|
|
||||||
return _context.abrupt("return", new _context.t0(_context.t1));
|
|
||||||
case 5:
|
|
||||||
case "end":
|
|
||||||
return _context.stop();
|
|
||||||
}
|
|
||||||
}, _callee);
|
|
||||||
}));
|
|
||||||
return function (_x) {
|
|
||||||
return _ref.apply(this, arguments);
|
|
||||||
};
|
|
||||||
}()));
|
|
||||||
var test = function test(fn) {
|
var test = function test(fn) {
|
||||||
try {
|
try {
|
||||||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||||
|
|
@ -3319,10 +3375,47 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var supportsRequestStream = isReadableStreamSupported && test(function () {
|
var factory = function factory(env) {
|
||||||
|
var _Object$assign = Object.assign({}, globalFetchAPI, env),
|
||||||
|
fetch = _Object$assign.fetch,
|
||||||
|
Request = _Object$assign.Request,
|
||||||
|
Response = _Object$assign.Response;
|
||||||
|
var isFetchSupported = isFunction(fetch);
|
||||||
|
var isRequestSupported = isFunction(Request);
|
||||||
|
var isResponseSupported = isFunction(Response);
|
||||||
|
if (!isFetchSupported) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
|
||||||
|
var encodeText = isFetchSupported && (typeof TextEncoder === 'function' ? function (encoder) {
|
||||||
|
return function (str) {
|
||||||
|
return encoder.encode(str);
|
||||||
|
};
|
||||||
|
}(new TextEncoder()) : ( /*#__PURE__*/function () {
|
||||||
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(str) {
|
||||||
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
||||||
|
while (1) switch (_context.prev = _context.next) {
|
||||||
|
case 0:
|
||||||
|
_context.t0 = Uint8Array;
|
||||||
|
_context.next = 3;
|
||||||
|
return new Request(str).arrayBuffer();
|
||||||
|
case 3:
|
||||||
|
_context.t1 = _context.sent;
|
||||||
|
return _context.abrupt("return", new _context.t0(_context.t1));
|
||||||
|
case 5:
|
||||||
|
case "end":
|
||||||
|
return _context.stop();
|
||||||
|
}
|
||||||
|
}, _callee);
|
||||||
|
}));
|
||||||
|
return function (_x) {
|
||||||
|
return _ref2.apply(this, arguments);
|
||||||
|
};
|
||||||
|
}()));
|
||||||
|
var supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(function () {
|
||||||
var duplexAccessed = false;
|
var duplexAccessed = false;
|
||||||
var hasContentType = new Request(platform.origin, {
|
var hasContentType = new Request(platform.origin, {
|
||||||
body: new ReadableStream(),
|
body: new ReadableStream$1(),
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
get duplex() {
|
get duplex() {
|
||||||
duplexAccessed = true;
|
duplexAccessed = true;
|
||||||
|
|
@ -3331,8 +3424,7 @@
|
||||||
}).headers.has('Content-Type');
|
}).headers.has('Content-Type');
|
||||||
return duplexAccessed && !hasContentType;
|
return duplexAccessed && !hasContentType;
|
||||||
});
|
});
|
||||||
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
var supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(function () {
|
||||||
var supportsResponseStream = isReadableStreamSupported && test(function () {
|
|
||||||
return utils$1.isReadableStream(new Response('').body);
|
return utils$1.isReadableStream(new Response('').body);
|
||||||
});
|
});
|
||||||
var resolvers = {
|
var resolvers = {
|
||||||
|
|
@ -3340,17 +3432,19 @@
|
||||||
return res.body;
|
return res.body;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
isFetchSupported && function (res) {
|
isFetchSupported && function () {
|
||||||
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(function (type) {
|
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(function (type) {
|
||||||
!resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? function (res) {
|
!resolvers[type] && (resolvers[type] = function (res, config) {
|
||||||
return res[type]();
|
var method = res && res[type];
|
||||||
} : function (_, config) {
|
if (method) {
|
||||||
|
return method.call(res);
|
||||||
|
}
|
||||||
throw new AxiosError("Response type '".concat(type, "' is not supported"), AxiosError.ERR_NOT_SUPPORT, config);
|
throw new AxiosError("Response type '".concat(type, "' is not supported"), AxiosError.ERR_NOT_SUPPORT, config);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}(new Response());
|
}();
|
||||||
var getBodyLength = /*#__PURE__*/function () {
|
var getBodyLength = /*#__PURE__*/function () {
|
||||||
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(body) {
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(body) {
|
||||||
var _request;
|
var _request;
|
||||||
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
||||||
while (1) switch (_context2.prev = _context2.next) {
|
while (1) switch (_context2.prev = _context2.next) {
|
||||||
|
|
@ -3404,11 +3498,11 @@
|
||||||
}, _callee2);
|
}, _callee2);
|
||||||
}));
|
}));
|
||||||
return function getBodyLength(_x2) {
|
return function getBodyLength(_x2) {
|
||||||
return _ref2.apply(this, arguments);
|
return _ref3.apply(this, arguments);
|
||||||
};
|
};
|
||||||
}();
|
}();
|
||||||
var resolveBodyLength = /*#__PURE__*/function () {
|
var resolveBodyLength = /*#__PURE__*/function () {
|
||||||
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(headers, body) {
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(headers, body) {
|
||||||
var length;
|
var length;
|
||||||
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
||||||
while (1) switch (_context3.prev = _context3.next) {
|
while (1) switch (_context3.prev = _context3.next) {
|
||||||
|
|
@ -3422,35 +3516,36 @@
|
||||||
}, _callee3);
|
}, _callee3);
|
||||||
}));
|
}));
|
||||||
return function resolveBodyLength(_x3, _x4) {
|
return function resolveBodyLength(_x3, _x4) {
|
||||||
return _ref3.apply(this, arguments);
|
return _ref4.apply(this, arguments);
|
||||||
};
|
};
|
||||||
}();
|
}();
|
||||||
var fetchAdapter = isFetchSupported && ( /*#__PURE__*/function () {
|
return /*#__PURE__*/function () {
|
||||||
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(config) {
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(config) {
|
||||||
var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, composedSignal, request, unsubscribe, requestContentLength, _request, contentTypeHeader, _progressEventDecorat, _progressEventDecorat2, onProgress, flush, isCredentialsSupported, response, isStreamResponse, options, responseContentLength, _ref5, _ref6, _onProgress, _flush, responseData;
|
var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, composedSignal, request, unsubscribe, requestContentLength, _request, contentTypeHeader, _progressEventDecorat, _progressEventDecorat2, onProgress, flush, isCredentialsSupported, resolvedOptions, response, isStreamResponse, options, responseContentLength, _ref6, _ref7, _onProgress, _flush, responseData;
|
||||||
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
||||||
while (1) switch (_context4.prev = _context4.next) {
|
while (1) switch (_context4.prev = _context4.next) {
|
||||||
case 0:
|
case 0:
|
||||||
_resolveConfig = resolveConfig(config), url = _resolveConfig.url, method = _resolveConfig.method, data = _resolveConfig.data, signal = _resolveConfig.signal, cancelToken = _resolveConfig.cancelToken, timeout = _resolveConfig.timeout, onDownloadProgress = _resolveConfig.onDownloadProgress, onUploadProgress = _resolveConfig.onUploadProgress, responseType = _resolveConfig.responseType, headers = _resolveConfig.headers, _resolveConfig$withCr = _resolveConfig.withCredentials, withCredentials = _resolveConfig$withCr === void 0 ? 'same-origin' : _resolveConfig$withCr, fetchOptions = _resolveConfig.fetchOptions;
|
_resolveConfig = resolveConfig(config), url = _resolveConfig.url, method = _resolveConfig.method, data = _resolveConfig.data, signal = _resolveConfig.signal, cancelToken = _resolveConfig.cancelToken, timeout = _resolveConfig.timeout, onDownloadProgress = _resolveConfig.onDownloadProgress, onUploadProgress = _resolveConfig.onUploadProgress, responseType = _resolveConfig.responseType, headers = _resolveConfig.headers, _resolveConfig$withCr = _resolveConfig.withCredentials, withCredentials = _resolveConfig$withCr === void 0 ? 'same-origin' : _resolveConfig$withCr, fetchOptions = _resolveConfig.fetchOptions;
|
||||||
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
||||||
composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
||||||
|
request = null;
|
||||||
unsubscribe = composedSignal && composedSignal.unsubscribe && function () {
|
unsubscribe = composedSignal && composedSignal.unsubscribe && function () {
|
||||||
composedSignal.unsubscribe();
|
composedSignal.unsubscribe();
|
||||||
};
|
};
|
||||||
_context4.prev = 4;
|
_context4.prev = 5;
|
||||||
_context4.t0 = onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head';
|
_context4.t0 = onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head';
|
||||||
if (!_context4.t0) {
|
if (!_context4.t0) {
|
||||||
_context4.next = 11;
|
_context4.next = 12;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
_context4.next = 9;
|
_context4.next = 10;
|
||||||
return resolveBodyLength(headers, data);
|
return resolveBodyLength(headers, data);
|
||||||
case 9:
|
case 10:
|
||||||
_context4.t1 = requestContentLength = _context4.sent;
|
_context4.t1 = requestContentLength = _context4.sent;
|
||||||
_context4.t0 = _context4.t1 !== 0;
|
_context4.t0 = _context4.t1 !== 0;
|
||||||
case 11:
|
case 12:
|
||||||
if (!_context4.t0) {
|
if (!_context4.t0) {
|
||||||
_context4.next = 15;
|
_context4.next = 16;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
_request = new Request(url, {
|
_request = new Request(url, {
|
||||||
|
|
@ -3465,25 +3560,26 @@
|
||||||
_progressEventDecorat = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))), _progressEventDecorat2 = _slicedToArray(_progressEventDecorat, 2), onProgress = _progressEventDecorat2[0], flush = _progressEventDecorat2[1];
|
_progressEventDecorat = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))), _progressEventDecorat2 = _slicedToArray(_progressEventDecorat, 2), onProgress = _progressEventDecorat2[0], flush = _progressEventDecorat2[1];
|
||||||
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
||||||
}
|
}
|
||||||
case 15:
|
case 16:
|
||||||
if (!utils$1.isString(withCredentials)) {
|
if (!utils$1.isString(withCredentials)) {
|
||||||
withCredentials = withCredentials ? 'include' : 'omit';
|
withCredentials = withCredentials ? 'include' : 'omit';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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
|
||||||
isCredentialsSupported = "credentials" in Request.prototype;
|
isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
|
||||||
request = new Request(url, _objectSpread2(_objectSpread2({}, fetchOptions), {}, {
|
resolvedOptions = _objectSpread2(_objectSpread2({}, fetchOptions), {}, {
|
||||||
signal: composedSignal,
|
signal: composedSignal,
|
||||||
method: method.toUpperCase(),
|
method: method.toUpperCase(),
|
||||||
headers: headers.normalize().toJSON(),
|
headers: headers.normalize().toJSON(),
|
||||||
body: data,
|
body: data,
|
||||||
duplex: "half",
|
duplex: "half",
|
||||||
credentials: isCredentialsSupported ? withCredentials : undefined
|
credentials: isCredentialsSupported ? withCredentials : undefined
|
||||||
}));
|
});
|
||||||
_context4.next = 20;
|
request = isRequestSupported && new Request(url, resolvedOptions);
|
||||||
return fetch(request);
|
_context4.next = 22;
|
||||||
case 20:
|
return isRequestSupported ? fetch(request, fetchOptions) : fetch(url, resolvedOptions);
|
||||||
|
case 22:
|
||||||
response = _context4.sent;
|
response = _context4.sent;
|
||||||
isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
||||||
if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
|
if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
|
||||||
|
|
@ -3492,19 +3588,19 @@
|
||||||
options[prop] = response[prop];
|
options[prop] = response[prop];
|
||||||
});
|
});
|
||||||
responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
|
responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
|
||||||
_ref5 = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [], _ref6 = _slicedToArray(_ref5, 2), _onProgress = _ref6[0], _flush = _ref6[1];
|
_ref6 = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [], _ref7 = _slicedToArray(_ref6, 2), _onProgress = _ref7[0], _flush = _ref7[1];
|
||||||
response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, _onProgress, function () {
|
response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, _onProgress, function () {
|
||||||
_flush && _flush();
|
_flush && _flush();
|
||||||
unsubscribe && unsubscribe();
|
unsubscribe && unsubscribe();
|
||||||
}), options);
|
}), options);
|
||||||
}
|
}
|
||||||
responseType = responseType || 'text';
|
responseType = responseType || 'text';
|
||||||
_context4.next = 26;
|
_context4.next = 28;
|
||||||
return resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
|
return resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
|
||||||
case 26:
|
case 28:
|
||||||
responseData = _context4.sent;
|
responseData = _context4.sent;
|
||||||
!isStreamResponse && unsubscribe && unsubscribe();
|
!isStreamResponse && unsubscribe && unsubscribe();
|
||||||
_context4.next = 30;
|
_context4.next = 32;
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
settle(resolve, reject, {
|
settle(resolve, reject, {
|
||||||
data: responseData,
|
data: responseData,
|
||||||
|
|
@ -3515,36 +3611,62 @@
|
||||||
request: request
|
request: request
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
case 30:
|
case 32:
|
||||||
return _context4.abrupt("return", _context4.sent);
|
return _context4.abrupt("return", _context4.sent);
|
||||||
case 33:
|
case 35:
|
||||||
_context4.prev = 33;
|
_context4.prev = 35;
|
||||||
_context4.t2 = _context4["catch"](4);
|
_context4.t2 = _context4["catch"](5);
|
||||||
unsubscribe && unsubscribe();
|
unsubscribe && unsubscribe();
|
||||||
if (!(_context4.t2 && _context4.t2.name === 'TypeError' && /fetch/i.test(_context4.t2.message))) {
|
if (!(_context4.t2 && _context4.t2.name === 'TypeError' && /Load failed|fetch/i.test(_context4.t2.message))) {
|
||||||
_context4.next = 38;
|
_context4.next = 40;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
throw Object.assign(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request), {
|
throw Object.assign(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request), {
|
||||||
cause: _context4.t2.cause || _context4.t2
|
cause: _context4.t2.cause || _context4.t2
|
||||||
});
|
});
|
||||||
case 38:
|
case 40:
|
||||||
throw AxiosError.from(_context4.t2, _context4.t2 && _context4.t2.code, config, request);
|
throw AxiosError.from(_context4.t2, _context4.t2 && _context4.t2.code, config, request);
|
||||||
case 39:
|
case 41:
|
||||||
case "end":
|
case "end":
|
||||||
return _context4.stop();
|
return _context4.stop();
|
||||||
}
|
}
|
||||||
}, _callee4, null, [[4, 33]]);
|
}, _callee4, null, [[5, 35]]);
|
||||||
}));
|
}));
|
||||||
return function (_x5) {
|
return function (_x5) {
|
||||||
return _ref4.apply(this, arguments);
|
return _ref5.apply(this, arguments);
|
||||||
};
|
};
|
||||||
}());
|
}();
|
||||||
|
};
|
||||||
|
var seedCache = new Map();
|
||||||
|
var getFetch = function getFetch(config) {
|
||||||
|
var env = utils$1.merge.call({
|
||||||
|
skipUndefined: true
|
||||||
|
}, globalFetchAPI, config ? config.env : null);
|
||||||
|
var fetch = env.fetch,
|
||||||
|
Request = env.Request,
|
||||||
|
Response = env.Response;
|
||||||
|
var seeds = [Request, Response, fetch];
|
||||||
|
var 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();
|
||||||
|
|
||||||
var knownAdapters = {
|
var knownAdapters = {
|
||||||
http: httpAdapter,
|
http: httpAdapter,
|
||||||
xhr: xhrAdapter,
|
xhr: xhrAdapter,
|
||||||
fetch: fetchAdapter
|
fetch: {
|
||||||
|
get: getFetch
|
||||||
|
}
|
||||||
};
|
};
|
||||||
utils$1.forEach(knownAdapters, function (fn, value) {
|
utils$1.forEach(knownAdapters, function (fn, value) {
|
||||||
if (fn) {
|
if (fn) {
|
||||||
|
|
@ -3567,7 +3689,7 @@
|
||||||
return utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
return utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
||||||
};
|
};
|
||||||
var adapters = {
|
var adapters = {
|
||||||
getAdapter: function getAdapter(adapters) {
|
getAdapter: function getAdapter(adapters, config) {
|
||||||
adapters = utils$1.isArray(adapters) ? adapters : [adapters];
|
adapters = utils$1.isArray(adapters) ? adapters : [adapters];
|
||||||
var _adapters = adapters,
|
var _adapters = adapters,
|
||||||
length = _adapters.length;
|
length = _adapters.length;
|
||||||
|
|
@ -3584,7 +3706,7 @@
|
||||||
throw new AxiosError("Unknown adapter '".concat(id, "'"));
|
throw new AxiosError("Unknown adapter '".concat(id, "'"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (adapter) {
|
if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
rejectedReasons[id || '#' + i] = adapter;
|
rejectedReasons[id || '#' + i] = adapter;
|
||||||
|
|
@ -3636,7 +3758,7 @@
|
||||||
if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
|
if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
|
||||||
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
||||||
}
|
}
|
||||||
var adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
|
var 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);
|
||||||
|
|
||||||
|
|
@ -3658,7 +3780,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var VERSION = "1.8.2";
|
var VERSION = "1.12.0";
|
||||||
|
|
||||||
var validators$1 = {};
|
var validators$1 = {};
|
||||||
|
|
||||||
|
|
@ -3754,7 +3876,7 @@
|
||||||
var Axios = /*#__PURE__*/function () {
|
var Axios = /*#__PURE__*/function () {
|
||||||
function Axios(instanceConfig) {
|
function Axios(instanceConfig) {
|
||||||
_classCallCheck(this, Axios);
|
_classCallCheck(this, Axios);
|
||||||
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()
|
||||||
|
|
|
||||||
10
package-lock.json
generated
10
package-lock.json
generated
|
|
@ -6,7 +6,7 @@
|
||||||
"": {
|
"": {
|
||||||
"name": "lnbits",
|
"name": "lnbits",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.8.2",
|
"axios": "^1.12.0",
|
||||||
"chart.js": "^4.4.4",
|
"chart.js": "^4.4.4",
|
||||||
"moment": "^2.30.1",
|
"moment": "^2.30.1",
|
||||||
"nostr-tools": "^2.7.2",
|
"nostr-tools": "^2.7.2",
|
||||||
|
|
@ -402,13 +402,13 @@
|
||||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||||
},
|
},
|
||||||
"node_modules/axios": {
|
"node_modules/axios": {
|
||||||
"version": "1.8.2",
|
"version": "1.12.0",
|
||||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.8.2.tgz",
|
"resolved": "https://registry.npmjs.org/axios/-/axios-1.12.0.tgz",
|
||||||
"integrity": "sha512-ls4GYBm5aig9vWx8AWDSGLpnpDQRtWAfrjU+EuytuODrFBkqesN2RkOQCBzrA1RQNHw1SmRMSDDDSwzNAYQ6Rg==",
|
"integrity": "sha512-oXTDccv8PcfjZmPGlWsPSwtOJCZ/b6W5jAMCNcfwJbCzDckwG0jrYJFaWH1yvivfCXjVzV/SPDEhMB3Q+DSurg==",
|
||||||
"license": "MIT",
|
"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"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
"sass": "^1.78.0"
|
"sass": "^1.78.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.8.2",
|
"axios": "^1.12.0",
|
||||||
"chart.js": "^4.4.4",
|
"chart.js": "^4.4.4",
|
||||||
"moment": "^2.30.1",
|
"moment": "^2.30.1",
|
||||||
"qrcode.vue": "^3.4.1",
|
"qrcode.vue": "^3.4.1",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue