@verdocs/web-sdk 6.9.12 → 6.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/verdocs-adopt-signature-dialog_7.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-adopt-signature-dialog_7.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-auth.cjs.entry.js +3 -0
- package/dist/cjs/verdocs-auth.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js +422 -115
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-download-dialog_4.cjs.entry.js +6 -5
- package/dist/cjs/verdocs-download-dialog_4.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-preview_6.cjs.entry.js +3 -0
- package/dist/cjs/verdocs-preview_6.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +79 -20
- package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
- package/dist/collection/components/dialogs/verdocs-download-dialog/verdocs-download-dialog.js +6 -5
- package/dist/collection/components/dialogs/verdocs-download-dialog/verdocs-download-dialog.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +3 -0
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +3 -0
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +79 -20
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +1 -1
- package/dist/collection/components/embeds/verdocs-view/verdocs-view.js.map +1 -1
- package/dist/components/{p-Ce29XBfJ.js → p-CBKrl6B7.js} +2 -2
- package/dist/components/{p-Ce29XBfJ.js.map → p-CBKrl6B7.js.map} +1 -1
- package/dist/components/p-CPYFXW2q.js +3 -0
- package/dist/components/p-CPYFXW2q.js.map +1 -0
- package/dist/components/{p-Bpe5Awxh.js → p-CnoHN1S8.js} +2 -2
- package/dist/components/p-CnoHN1S8.js.map +1 -0
- package/dist/components/{p-BVhOFpVZ.js → p-DfaM_cug.js} +2 -2
- package/dist/components/p-DfaM_cug.js.map +1 -0
- package/dist/components/verdocs-auth.js +1 -1
- package/dist/components/verdocs-auth.js.map +1 -1
- package/dist/components/verdocs-build.js +1 -1
- package/dist/components/verdocs-contact-picker.js +1 -1
- package/dist/components/verdocs-download-dialog.js +1 -1
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-sign.js +1 -1
- package/dist/components/verdocs-sign.js.map +1 -1
- package/dist/components/verdocs-view.js +1 -1
- package/dist/esm/verdocs-adopt-signature-dialog_7.entry.js +1 -1
- package/dist/esm/verdocs-adopt-signature-dialog_7.entry.js.map +1 -1
- package/dist/esm/verdocs-auth.entry.js +3 -0
- package/dist/esm/verdocs-auth.entry.js.map +1 -1
- package/dist/esm/verdocs-contact-picker.entry.js +422 -115
- package/dist/esm/verdocs-contact-picker.entry.js.map +1 -1
- package/dist/esm/verdocs-download-dialog_4.entry.js +6 -5
- package/dist/esm/verdocs-download-dialog_4.entry.js.map +1 -1
- package/dist/esm/verdocs-preview_6.entry.js +3 -0
- package/dist/esm/verdocs-preview_6.entry.js.map +1 -1
- package/dist/esm/verdocs-sign.entry.js +80 -21
- package/dist/esm/verdocs-sign.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-adopt-signature-dialog_7.entry.js +1 -1
- package/dist/esm-es5/verdocs-adopt-signature-dialog_7.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-contact-picker.entry.js +2 -2
- package/dist/esm-es5/verdocs-contact-picker.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-download-dialog_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-download-dialog_4.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-preview_6.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_6.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
- package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +5 -0
- package/dist/verdocs-web-sdk/p-11c3e5bb.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-11c3e5bb.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-16d655d4.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-16d655d4.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-1ce27c81.system.entry.js +4 -0
- package/dist/verdocs-web-sdk/p-1ce27c81.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-2d72560a.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-2d72560a.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-33cfc977.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-33cfc977.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-43ee0267.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-43ee0267.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-4e84a5b6.entry.js +3 -0
- package/dist/verdocs-web-sdk/p-4e84a5b6.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-BdZ5Ghsa.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-9756028f.entry.js → p-d0e8419b.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-d0e8419b.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-64034b55.system.entry.js → p-d60cfa3e.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-64034b55.system.entry.js.map → p-d60cfa3e.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-e608d2bc.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-e608d2bc.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-6abf8f8f.entry.js → p-e95723ac.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-6abf8f8f.entry.js.map → p-e95723ac.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-f85f8560.system.entry.js → p-edab1fed.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-edab1fed.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/components/p-BVhOFpVZ.js.map +0 -1
- package/dist/components/p-Bpe5Awxh.js.map +0 -1
- package/dist/components/p-DeQsR41s.js +0 -3
- package/dist/components/p-DeQsR41s.js.map +0 -1
- package/dist/verdocs-web-sdk/p-0240a6e1.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-0240a6e1.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-12676649.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-12676649.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-1a6869c9.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-1a6869c9.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-3a542ed0.system.entry.js +0 -4
- package/dist/verdocs-web-sdk/p-3a542ed0.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-3f5ad836.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-3f5ad836.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-9756028f.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-9c6cca6e.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-9c6cca6e.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-ae4290c6.entry.js +0 -3
- package/dist/verdocs-web-sdk/p-ae4290c6.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-c89d74b2.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-c89d74b2.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-f85f8560.system.entry.js.map +0 -1
|
@@ -6,7 +6,7 @@ import { f as convertToE164 } from './utils-D9l-GFdv.js';
|
|
|
6
6
|
import './index-BglCURB-.js';
|
|
7
7
|
import './Types-CIxfEdV7.js';
|
|
8
8
|
|
|
9
|
-
/*! Axios v1.
|
|
9
|
+
/*! Axios v1.18.1 Copyright (c) 2026 Matt Zabriskie and contributors */
|
|
10
10
|
|
|
11
11
|
var axios_1;
|
|
12
12
|
var hasRequiredAxios;
|
|
@@ -34,6 +34,57 @@ function requireAxios () {
|
|
|
34
34
|
const { getPrototypeOf } = Object;
|
|
35
35
|
const { iterator, toStringTag } = Symbol;
|
|
36
36
|
|
|
37
|
+
/* Creating a function that will check if an object has a property. */
|
|
38
|
+
const hasOwnProperty = (
|
|
39
|
+
({ hasOwnProperty }) =>
|
|
40
|
+
(obj, prop) =>
|
|
41
|
+
hasOwnProperty.call(obj, prop)
|
|
42
|
+
)(Object.prototype);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Walk the prototype chain (excluding the shared Object.prototype) looking for
|
|
46
|
+
* an own `prop`. This distinguishes genuine own/inherited members — including
|
|
47
|
+
* class accessors and template prototypes — from members injected via
|
|
48
|
+
* Object.prototype pollution (e.g. `Object.prototype.username = '...'`), which
|
|
49
|
+
* live on Object.prototype itself and are therefore never matched.
|
|
50
|
+
*
|
|
51
|
+
* @param {*} thing The value whose chain to inspect
|
|
52
|
+
* @param {string|symbol} prop The property key to look for
|
|
53
|
+
*
|
|
54
|
+
* @returns {boolean} True when `prop` is owned below Object.prototype
|
|
55
|
+
*/
|
|
56
|
+
const hasOwnInPrototypeChain = (thing, prop) => {
|
|
57
|
+
let obj = thing;
|
|
58
|
+
const seen = [];
|
|
59
|
+
|
|
60
|
+
while (obj != null && obj !== Object.prototype) {
|
|
61
|
+
if (seen.indexOf(obj) !== -1) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
seen.push(obj);
|
|
65
|
+
|
|
66
|
+
if (hasOwnProperty(obj, prop)) {
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
obj = getPrototypeOf(obj);
|
|
70
|
+
}
|
|
71
|
+
return false;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Read `obj[prop]` only when it is safe from Object.prototype pollution. Own
|
|
76
|
+
* properties and members inherited from a non-Object.prototype source (a class
|
|
77
|
+
* instance or template object) are honored; a value reachable only through a
|
|
78
|
+
* polluted Object.prototype is ignored and `undefined` is returned.
|
|
79
|
+
*
|
|
80
|
+
* @param {*} obj The source object
|
|
81
|
+
* @param {string|symbol} prop The property key to read
|
|
82
|
+
*
|
|
83
|
+
* @returns {*} The resolved value, or undefined when unsafe/absent
|
|
84
|
+
*/
|
|
85
|
+
const getSafeProp = (obj, prop) =>
|
|
86
|
+
obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined;
|
|
87
|
+
|
|
37
88
|
const kindOf = ((cache) => (thing) => {
|
|
38
89
|
const str = toString.call(thing);
|
|
39
90
|
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
@@ -159,7 +210,7 @@ function requireAxios () {
|
|
|
159
210
|
* @returns {boolean} True if value is a plain Object, otherwise false
|
|
160
211
|
*/
|
|
161
212
|
const isPlainObject = (val) => {
|
|
162
|
-
if (
|
|
213
|
+
if (!isObject(val)) {
|
|
163
214
|
return false;
|
|
164
215
|
}
|
|
165
216
|
|
|
@@ -167,9 +218,12 @@ function requireAxios () {
|
|
|
167
218
|
return (
|
|
168
219
|
(prototype === null ||
|
|
169
220
|
prototype === Object.prototype ||
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
221
|
+
getPrototypeOf(prototype) === null) &&
|
|
222
|
+
// Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or
|
|
223
|
+
// Symbol.iterator as evidence the value is a tagged/iterable type rather
|
|
224
|
+
// than a plain object, while ignoring keys injected onto Object.prototype.
|
|
225
|
+
!hasOwnInPrototypeChain(val, toStringTag) &&
|
|
226
|
+
!hasOwnInPrototypeChain(val, iterator)
|
|
173
227
|
);
|
|
174
228
|
};
|
|
175
229
|
|
|
@@ -696,13 +750,6 @@ function requireAxios () {
|
|
|
696
750
|
});
|
|
697
751
|
};
|
|
698
752
|
|
|
699
|
-
/* Creating a function that will check if an object has a property. */
|
|
700
|
-
const hasOwnProperty = (
|
|
701
|
-
({ hasOwnProperty }) =>
|
|
702
|
-
(obj, prop) =>
|
|
703
|
-
hasOwnProperty.call(obj, prop)
|
|
704
|
-
)(Object.prototype);
|
|
705
|
-
|
|
706
753
|
const { propertyIsEnumerable } = Object.prototype;
|
|
707
754
|
|
|
708
755
|
/**
|
|
@@ -916,6 +963,20 @@ function requireAxios () {
|
|
|
916
963
|
|
|
917
964
|
const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
|
|
918
965
|
|
|
966
|
+
/**
|
|
967
|
+
* Determine if a value is iterable via an iterator that is NOT sourced solely
|
|
968
|
+
* from a polluted Object.prototype. Use this instead of `isIterable` whenever
|
|
969
|
+
* the iterable comes from untrusted input (e.g. user-supplied header sources),
|
|
970
|
+
* so `Object.prototype[Symbol.iterator] = ...` cannot turn an ordinary object
|
|
971
|
+
* into an attacker-controlled entries iterator.
|
|
972
|
+
*
|
|
973
|
+
* @param {*} thing The value to test
|
|
974
|
+
*
|
|
975
|
+
* @returns {boolean} True if value has a non-polluted iterator
|
|
976
|
+
*/
|
|
977
|
+
const isSafeIterable = (thing) =>
|
|
978
|
+
thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing);
|
|
979
|
+
|
|
919
980
|
var utils$1 = {
|
|
920
981
|
isArray,
|
|
921
982
|
isArrayBuffer,
|
|
@@ -960,6 +1021,8 @@ function requireAxios () {
|
|
|
960
1021
|
isHTMLForm,
|
|
961
1022
|
hasOwnProperty,
|
|
962
1023
|
hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
|
|
1024
|
+
hasOwnInPrototypeChain,
|
|
1025
|
+
getSafeProp,
|
|
963
1026
|
reduceDescriptors,
|
|
964
1027
|
freezeMethods,
|
|
965
1028
|
toObjectSet,
|
|
@@ -976,6 +1039,7 @@ function requireAxios () {
|
|
|
976
1039
|
setImmediate: _setImmediate,
|
|
977
1040
|
asap,
|
|
978
1041
|
isIterable,
|
|
1042
|
+
isSafeIterable,
|
|
979
1043
|
};
|
|
980
1044
|
|
|
981
1045
|
// RawAxiosHeaders whose duplicates are ignored by node
|
|
@@ -1208,8 +1272,8 @@ function requireAxios () {
|
|
|
1208
1272
|
setHeaders(header, valueOrRewrite);
|
|
1209
1273
|
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
1210
1274
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
1211
|
-
} else if (utils$1.isObject(header) && utils$1.
|
|
1212
|
-
let obj =
|
|
1275
|
+
} else if (utils$1.isObject(header) && utils$1.isSafeIterable(header)) {
|
|
1276
|
+
let obj = Object.create(null),
|
|
1213
1277
|
dest,
|
|
1214
1278
|
key;
|
|
1215
1279
|
for (const entry of header) {
|
|
@@ -1217,11 +1281,14 @@ function requireAxios () {
|
|
|
1217
1281
|
throw new TypeError('Object iterator must return a key-value pair');
|
|
1218
1282
|
}
|
|
1219
1283
|
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
: entry[1];
|
|
1284
|
+
key = entry[0];
|
|
1285
|
+
|
|
1286
|
+
if (utils$1.hasOwnProp(obj, key)) {
|
|
1287
|
+
dest = obj[key];
|
|
1288
|
+
obj[key] = utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]];
|
|
1289
|
+
} else {
|
|
1290
|
+
obj[key] = entry[1];
|
|
1291
|
+
}
|
|
1225
1292
|
}
|
|
1226
1293
|
|
|
1227
1294
|
setHeaders(obj, valueOrRewrite);
|
|
@@ -1514,7 +1581,19 @@ function requireAxios () {
|
|
|
1514
1581
|
class AxiosError extends Error {
|
|
1515
1582
|
static from(error, code, config, request, response, customProps) {
|
|
1516
1583
|
const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
|
1517
|
-
|
|
1584
|
+
// Match native `Error` `cause` semantics: non-enumerable. The wrapped
|
|
1585
|
+
// error often carries circular internals (sockets, requests, agents), so
|
|
1586
|
+
// an enumerable `cause` makes structured loggers (pino/winston) and any
|
|
1587
|
+
// own-property walk throw "Converting circular structure to JSON".
|
|
1588
|
+
// Regression from #6982; see #7205. `__proto__: null` mirrors the
|
|
1589
|
+
// `message` descriptor below (prototype-pollution-safe descriptor).
|
|
1590
|
+
Object.defineProperty(axiosError, 'cause', {
|
|
1591
|
+
__proto__: null,
|
|
1592
|
+
value: error,
|
|
1593
|
+
writable: true,
|
|
1594
|
+
enumerable: false,
|
|
1595
|
+
configurable: true,
|
|
1596
|
+
});
|
|
1518
1597
|
axiosError.name = error.name;
|
|
1519
1598
|
|
|
1520
1599
|
// Preserve status from the original error if not already set from response
|
|
@@ -1615,6 +1694,10 @@ function requireAxios () {
|
|
|
1615
1694
|
// eslint-disable-next-line strict
|
|
1616
1695
|
var httpAdapter = null;
|
|
1617
1696
|
|
|
1697
|
+
// Default nesting limit shared with the inverse transform (formDataToJSON) so
|
|
1698
|
+
// the FormData <-> JSON round-trip stays symmetric.
|
|
1699
|
+
const DEFAULT_FORM_DATA_MAX_DEPTH = 100;
|
|
1700
|
+
|
|
1618
1701
|
/**
|
|
1619
1702
|
* Determines if the given thing is a array or js object.
|
|
1620
1703
|
*
|
|
@@ -1725,8 +1808,9 @@ function requireAxios () {
|
|
|
1725
1808
|
const dots = options.dots;
|
|
1726
1809
|
const indexes = options.indexes;
|
|
1727
1810
|
const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
|
|
1728
|
-
const maxDepth = options.maxDepth === undefined ?
|
|
1811
|
+
const maxDepth = options.maxDepth === undefined ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth;
|
|
1729
1812
|
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
1813
|
+
const stack = [];
|
|
1730
1814
|
|
|
1731
1815
|
if (!utils$1.isFunction(visitor)) {
|
|
1732
1816
|
throw new TypeError('visitor must be a function');
|
|
@@ -1748,12 +1832,50 @@ function requireAxios () {
|
|
|
1748
1832
|
}
|
|
1749
1833
|
|
|
1750
1834
|
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
|
1751
|
-
|
|
1835
|
+
if (useBlob && typeof _Blob === 'function') {
|
|
1836
|
+
return new _Blob([value]);
|
|
1837
|
+
}
|
|
1838
|
+
if (typeof Buffer !== 'undefined') {
|
|
1839
|
+
return Buffer.from(value);
|
|
1840
|
+
}
|
|
1841
|
+
throw new AxiosError('Blob is not supported. Use a Buffer instead.', AxiosError.ERR_NOT_SUPPORT);
|
|
1752
1842
|
}
|
|
1753
1843
|
|
|
1754
1844
|
return value;
|
|
1755
1845
|
}
|
|
1756
1846
|
|
|
1847
|
+
function throwIfMaxDepthExceeded(depth) {
|
|
1848
|
+
if (depth > maxDepth) {
|
|
1849
|
+
throw new AxiosError(
|
|
1850
|
+
'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
|
|
1851
|
+
AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
1852
|
+
);
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
function stringifyWithDepthLimit(value, depth) {
|
|
1857
|
+
if (maxDepth === Infinity) {
|
|
1858
|
+
return JSON.stringify(value);
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
const ancestors = [];
|
|
1862
|
+
|
|
1863
|
+
return JSON.stringify(value, function limitDepth(_key, currentValue) {
|
|
1864
|
+
if (!utils$1.isObject(currentValue)) {
|
|
1865
|
+
return currentValue;
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
while (ancestors.length && ancestors[ancestors.length - 1] !== this) {
|
|
1869
|
+
ancestors.pop();
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
ancestors.push(currentValue);
|
|
1873
|
+
throwIfMaxDepthExceeded(depth + ancestors.length - 1);
|
|
1874
|
+
|
|
1875
|
+
return currentValue;
|
|
1876
|
+
});
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1757
1879
|
/**
|
|
1758
1880
|
* Default visitor.
|
|
1759
1881
|
*
|
|
@@ -1777,7 +1899,7 @@ function requireAxios () {
|
|
|
1777
1899
|
// eslint-disable-next-line no-param-reassign
|
|
1778
1900
|
key = metaTokens ? key : key.slice(0, -2);
|
|
1779
1901
|
// eslint-disable-next-line no-param-reassign
|
|
1780
|
-
value =
|
|
1902
|
+
value = stringifyWithDepthLimit(value, 1);
|
|
1781
1903
|
} else if (
|
|
1782
1904
|
(utils$1.isArray(value) && isFlatArray(value)) ||
|
|
1783
1905
|
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
|
|
@@ -1810,8 +1932,6 @@ function requireAxios () {
|
|
|
1810
1932
|
return false;
|
|
1811
1933
|
}
|
|
1812
1934
|
|
|
1813
|
-
const stack = [];
|
|
1814
|
-
|
|
1815
1935
|
const exposedHelpers = Object.assign(predicates, {
|
|
1816
1936
|
defaultVisitor,
|
|
1817
1937
|
convertValue,
|
|
@@ -1821,12 +1941,7 @@ function requireAxios () {
|
|
|
1821
1941
|
function build(value, path, depth = 0) {
|
|
1822
1942
|
if (utils$1.isUndefined(value)) return;
|
|
1823
1943
|
|
|
1824
|
-
|
|
1825
|
-
throw new AxiosError(
|
|
1826
|
-
'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
|
|
1827
|
-
AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
1828
|
-
);
|
|
1829
|
-
}
|
|
1944
|
+
throwIfMaxDepthExceeded(depth);
|
|
1830
1945
|
|
|
1831
1946
|
if (stack.indexOf(value) !== -1) {
|
|
1832
1947
|
throw new Error('Circular reference detected in ' + path.join('.'));
|
|
@@ -1900,9 +2015,7 @@ function requireAxios () {
|
|
|
1900
2015
|
|
|
1901
2016
|
prototype.toString = function toString(encoder) {
|
|
1902
2017
|
const _encode = encoder
|
|
1903
|
-
?
|
|
1904
|
-
return encoder.call(this, value, encode$1);
|
|
1905
|
-
}
|
|
2018
|
+
? (value) => encoder.call(this, value, encode$1)
|
|
1906
2019
|
: encode$1;
|
|
1907
2020
|
|
|
1908
2021
|
return this._pairs
|
|
@@ -1941,8 +2054,7 @@ function requireAxios () {
|
|
|
1941
2054
|
if (!params) {
|
|
1942
2055
|
return url;
|
|
1943
2056
|
}
|
|
1944
|
-
|
|
1945
|
-
const _encode = (options && options.encode) || encode;
|
|
2057
|
+
url = url || '';
|
|
1946
2058
|
|
|
1947
2059
|
const _options = utils$1.isFunction(options)
|
|
1948
2060
|
? {
|
|
@@ -1950,7 +2062,11 @@ function requireAxios () {
|
|
|
1950
2062
|
}
|
|
1951
2063
|
: options;
|
|
1952
2064
|
|
|
1953
|
-
|
|
2065
|
+
// Read serializer options pollution-safely: own properties and methods on a
|
|
2066
|
+
// class/template prototype are honored, but values injected onto a polluted
|
|
2067
|
+
// Object.prototype are ignored.
|
|
2068
|
+
const _encode = utils$1.getSafeProp(_options, 'encode') || encode;
|
|
2069
|
+
const serializeFn = utils$1.getSafeProp(_options, 'serialize');
|
|
1954
2070
|
|
|
1955
2071
|
let serializedParams;
|
|
1956
2072
|
|
|
@@ -2047,6 +2163,7 @@ function requireAxios () {
|
|
|
2047
2163
|
clarifyTimeoutError: false,
|
|
2048
2164
|
legacyInterceptorReqResOrdering: true,
|
|
2049
2165
|
advertiseZstdAcceptEncoding: false,
|
|
2166
|
+
validateStatusUndefinedResolves: true,
|
|
2050
2167
|
};
|
|
2051
2168
|
|
|
2052
2169
|
var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
|
|
@@ -2138,6 +2255,17 @@ function requireAxios () {
|
|
|
2138
2255
|
});
|
|
2139
2256
|
}
|
|
2140
2257
|
|
|
2258
|
+
const MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH;
|
|
2259
|
+
|
|
2260
|
+
function throwIfDepthExceeded(index) {
|
|
2261
|
+
if (index > MAX_DEPTH) {
|
|
2262
|
+
throw new AxiosError(
|
|
2263
|
+
'FormData field is too deeply nested (' + index + ' levels). Max depth: ' + MAX_DEPTH,
|
|
2264
|
+
AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
2265
|
+
);
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2141
2269
|
/**
|
|
2142
2270
|
* It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
|
|
2143
2271
|
*
|
|
@@ -2150,9 +2278,16 @@ function requireAxios () {
|
|
|
2150
2278
|
// foo.x.y.z
|
|
2151
2279
|
// foo-x-y-z
|
|
2152
2280
|
// foo x y z
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2281
|
+
const path = [];
|
|
2282
|
+
const pattern = /\w+|\[(\w*)]/g;
|
|
2283
|
+
let match;
|
|
2284
|
+
|
|
2285
|
+
while ((match = pattern.exec(name)) !== null) {
|
|
2286
|
+
throwIfDepthExceeded(path.length);
|
|
2287
|
+
path.push(match[0] === '[]' ? '' : match[1] || match[0]);
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
return path;
|
|
2156
2291
|
}
|
|
2157
2292
|
|
|
2158
2293
|
/**
|
|
@@ -2184,6 +2319,8 @@ function requireAxios () {
|
|
|
2184
2319
|
*/
|
|
2185
2320
|
function formDataToJSON(formData) {
|
|
2186
2321
|
function buildPath(path, value, target, index) {
|
|
2322
|
+
throwIfDepthExceeded(index);
|
|
2323
|
+
|
|
2187
2324
|
let name = path[index++];
|
|
2188
2325
|
|
|
2189
2326
|
if (name === '__proto__') return true;
|
|
@@ -2669,7 +2806,11 @@ function requireAxios () {
|
|
|
2669
2806
|
const cookie = cookies[i].replace(/^\s+/, '');
|
|
2670
2807
|
const eq = cookie.indexOf('=');
|
|
2671
2808
|
if (eq !== -1 && cookie.slice(0, eq) === name) {
|
|
2672
|
-
|
|
2809
|
+
try {
|
|
2810
|
+
return decodeURIComponent(cookie.slice(eq + 1));
|
|
2811
|
+
} catch (e) {
|
|
2812
|
+
return cookie.slice(eq + 1);
|
|
2813
|
+
}
|
|
2673
2814
|
}
|
|
2674
2815
|
}
|
|
2675
2816
|
return null;
|
|
@@ -2720,6 +2861,31 @@ function requireAxios () {
|
|
|
2720
2861
|
: baseURL;
|
|
2721
2862
|
}
|
|
2722
2863
|
|
|
2864
|
+
const malformedHttpProtocol = /^https?:(?!\/\/)/i;
|
|
2865
|
+
const httpProtocolControlCharacters = /[\t\n\r]/g;
|
|
2866
|
+
|
|
2867
|
+
function stripLeadingC0ControlOrSpace(url) {
|
|
2868
|
+
let i = 0;
|
|
2869
|
+
while (i < url.length && url.charCodeAt(i) <= 0x20) {
|
|
2870
|
+
i++;
|
|
2871
|
+
}
|
|
2872
|
+
return url.slice(i);
|
|
2873
|
+
}
|
|
2874
|
+
|
|
2875
|
+
function normalizeURLForProtocolCheck(url) {
|
|
2876
|
+
return stripLeadingC0ControlOrSpace(url).replace(httpProtocolControlCharacters, '');
|
|
2877
|
+
}
|
|
2878
|
+
|
|
2879
|
+
function assertValidHttpProtocolURL(url, config) {
|
|
2880
|
+
if (typeof url === 'string' && malformedHttpProtocol.test(normalizeURLForProtocolCheck(url))) {
|
|
2881
|
+
throw new AxiosError(
|
|
2882
|
+
'Invalid URL: missing "//" after protocol',
|
|
2883
|
+
AxiosError.ERR_INVALID_URL,
|
|
2884
|
+
config
|
|
2885
|
+
);
|
|
2886
|
+
}
|
|
2887
|
+
}
|
|
2888
|
+
|
|
2723
2889
|
/**
|
|
2724
2890
|
* Creates a new URL by combining the baseURL with the requestedURL,
|
|
2725
2891
|
* only when the requestedURL is not already an absolute URL.
|
|
@@ -2730,9 +2896,11 @@ function requireAxios () {
|
|
|
2730
2896
|
*
|
|
2731
2897
|
* @returns {string} The combined full path
|
|
2732
2898
|
*/
|
|
2733
|
-
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
2899
|
+
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {
|
|
2900
|
+
assertValidHttpProtocolURL(requestedURL, config);
|
|
2734
2901
|
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
2735
2902
|
if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
|
|
2903
|
+
assertValidHttpProtocolURL(baseURL, config);
|
|
2736
2904
|
return combineURLs(baseURL, requestedURL);
|
|
2737
2905
|
}
|
|
2738
2906
|
return requestedURL;
|
|
@@ -2751,6 +2919,7 @@ function requireAxios () {
|
|
|
2751
2919
|
*/
|
|
2752
2920
|
function mergeConfig(config1, config2) {
|
|
2753
2921
|
// eslint-disable-next-line no-param-reassign
|
|
2922
|
+
config1 = config1 || {};
|
|
2754
2923
|
config2 = config2 || {};
|
|
2755
2924
|
|
|
2756
2925
|
// Use a null-prototype object so that downstream reads such as `config.auth`
|
|
@@ -2803,6 +2972,28 @@ function requireAxios () {
|
|
|
2803
2972
|
}
|
|
2804
2973
|
}
|
|
2805
2974
|
|
|
2975
|
+
function getMergedTransitionalOption(prop) {
|
|
2976
|
+
const transitional2 = utils$1.hasOwnProp(config2, 'transitional') ? config2.transitional : undefined;
|
|
2977
|
+
|
|
2978
|
+
if (!utils$1.isUndefined(transitional2)) {
|
|
2979
|
+
if (utils$1.isPlainObject(transitional2)) {
|
|
2980
|
+
if (utils$1.hasOwnProp(transitional2, prop)) {
|
|
2981
|
+
return transitional2[prop];
|
|
2982
|
+
}
|
|
2983
|
+
} else {
|
|
2984
|
+
return undefined;
|
|
2985
|
+
}
|
|
2986
|
+
}
|
|
2987
|
+
|
|
2988
|
+
const transitional1 = utils$1.hasOwnProp(config1, 'transitional') ? config1.transitional : undefined;
|
|
2989
|
+
|
|
2990
|
+
if (utils$1.isPlainObject(transitional1) && utils$1.hasOwnProp(transitional1, prop)) {
|
|
2991
|
+
return transitional1[prop];
|
|
2992
|
+
}
|
|
2993
|
+
|
|
2994
|
+
return undefined;
|
|
2995
|
+
}
|
|
2996
|
+
|
|
2806
2997
|
// eslint-disable-next-line consistent-return
|
|
2807
2998
|
function mergeDirectKeys(a, b, prop) {
|
|
2808
2999
|
if (utils$1.hasOwnProp(config2, prop)) {
|
|
@@ -2855,6 +3046,18 @@ function requireAxios () {
|
|
|
2855
3046
|
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
2856
3047
|
});
|
|
2857
3048
|
|
|
3049
|
+
if (
|
|
3050
|
+
utils$1.hasOwnProp(config2, 'validateStatus') &&
|
|
3051
|
+
utils$1.isUndefined(config2.validateStatus) &&
|
|
3052
|
+
getMergedTransitionalOption('validateStatusUndefinedResolves') === false
|
|
3053
|
+
) {
|
|
3054
|
+
if (utils$1.hasOwnProp(config1, 'validateStatus')) {
|
|
3055
|
+
config.validateStatus = getMergedValue(undefined, config1.validateStatus);
|
|
3056
|
+
} else {
|
|
3057
|
+
delete config.validateStatus;
|
|
3058
|
+
}
|
|
3059
|
+
}
|
|
3060
|
+
|
|
2858
3061
|
return config;
|
|
2859
3062
|
}
|
|
2860
3063
|
|
|
@@ -2866,7 +3069,7 @@ function requireAxios () {
|
|
|
2866
3069
|
return;
|
|
2867
3070
|
}
|
|
2868
3071
|
|
|
2869
|
-
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
3072
|
+
Object.entries(formHeaders || {}).forEach(([key, val]) => {
|
|
2870
3073
|
if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
|
|
2871
3074
|
headers.set(key, val);
|
|
2872
3075
|
}
|
|
@@ -2906,18 +3109,24 @@ function requireAxios () {
|
|
|
2906
3109
|
newConfig.headers = headers = AxiosHeaders.from(headers);
|
|
2907
3110
|
|
|
2908
3111
|
newConfig.url = buildURL(
|
|
2909
|
-
buildFullPath(baseURL, url, allowAbsoluteUrls),
|
|
3112
|
+
buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig),
|
|
2910
3113
|
own('params'),
|
|
2911
3114
|
own('paramsSerializer')
|
|
2912
3115
|
);
|
|
2913
3116
|
|
|
2914
3117
|
// HTTP basic authentication
|
|
2915
3118
|
if (auth) {
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
3119
|
+
const username = utils$1.getSafeProp(auth, 'username') || '';
|
|
3120
|
+
const password = utils$1.getSafeProp(auth, 'password') || '';
|
|
3121
|
+
|
|
3122
|
+
try {
|
|
3123
|
+
headers.set(
|
|
3124
|
+
'Authorization',
|
|
3125
|
+
'Basic ' + btoa(username + ':' + (password ? encodeUTF8$1(password) : ''))
|
|
3126
|
+
);
|
|
3127
|
+
} catch (e) {
|
|
3128
|
+
throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config);
|
|
3129
|
+
}
|
|
2921
3130
|
}
|
|
2922
3131
|
|
|
2923
3132
|
if (utils$1.isFormData(data)) {
|
|
@@ -3168,6 +3377,7 @@ function requireAxios () {
|
|
|
3168
3377
|
config
|
|
3169
3378
|
)
|
|
3170
3379
|
);
|
|
3380
|
+
done();
|
|
3171
3381
|
return;
|
|
3172
3382
|
}
|
|
3173
3383
|
|
|
@@ -3219,7 +3429,7 @@ function requireAxios () {
|
|
|
3219
3429
|
signals = null;
|
|
3220
3430
|
};
|
|
3221
3431
|
|
|
3222
|
-
signals.forEach((signal) => signal.addEventListener('abort', onabort));
|
|
3432
|
+
signals.forEach((signal) => signal.addEventListener('abort', onabort, { once: true }));
|
|
3223
3433
|
|
|
3224
3434
|
const { signal } = controller;
|
|
3225
3435
|
|
|
@@ -3322,11 +3532,19 @@ function requireAxios () {
|
|
|
3322
3532
|
* Estimate decoded byte length of a data:// URL *without* allocating large buffers.
|
|
3323
3533
|
* - For base64: compute exact decoded size using length and padding;
|
|
3324
3534
|
* handle %XX at the character-count level (no string allocation).
|
|
3325
|
-
* - For non-base64:
|
|
3535
|
+
* - For non-base64: compute the exact percent-decoded UTF-8 byte length.
|
|
3326
3536
|
*
|
|
3327
3537
|
* @param {string} url
|
|
3328
3538
|
* @returns {number}
|
|
3329
3539
|
*/
|
|
3540
|
+
const isHexDigit = (charCode) =>
|
|
3541
|
+
(charCode >= 48 && charCode <= 57) ||
|
|
3542
|
+
(charCode >= 65 && charCode <= 70) ||
|
|
3543
|
+
(charCode >= 97 && charCode <= 102);
|
|
3544
|
+
|
|
3545
|
+
const isPercentEncodedByte = (str, i, len) =>
|
|
3546
|
+
i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));
|
|
3547
|
+
|
|
3330
3548
|
function estimateDataURLDecodedBytes(url) {
|
|
3331
3549
|
if (!url || typeof url !== 'string') return 0;
|
|
3332
3550
|
if (!url.startsWith('data:')) return 0;
|
|
@@ -3346,9 +3564,7 @@ function requireAxios () {
|
|
|
3346
3564
|
if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {
|
|
3347
3565
|
const a = body.charCodeAt(i + 1);
|
|
3348
3566
|
const b = body.charCodeAt(i + 2);
|
|
3349
|
-
const isHex =
|
|
3350
|
-
((a >= 48 && a <= 57) || (a >= 65 && a <= 70) || (a >= 97 && a <= 102)) &&
|
|
3351
|
-
((b >= 48 && b <= 57) || (b >= 65 && b <= 70) || (b >= 97 && b <= 102));
|
|
3567
|
+
const isHex = isHexDigit(a) && isHexDigit(b);
|
|
3352
3568
|
|
|
3353
3569
|
if (isHex) {
|
|
3354
3570
|
effectiveLen -= 2;
|
|
@@ -3389,18 +3605,17 @@ function requireAxios () {
|
|
|
3389
3605
|
return bytes > 0 ? bytes : 0;
|
|
3390
3606
|
}
|
|
3391
3607
|
|
|
3392
|
-
if (typeof Buffer !== 'undefined' && typeof Buffer.byteLength === 'function') {
|
|
3393
|
-
return Buffer.byteLength(body, 'utf8');
|
|
3394
|
-
}
|
|
3395
|
-
|
|
3396
3608
|
// Compute UTF-8 byte length directly from UTF-16 code units without allocating
|
|
3397
3609
|
// a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies).
|
|
3398
|
-
//
|
|
3399
|
-
//
|
|
3610
|
+
// Valid %XX triplets count as one decoded byte; this matches the bytes that
|
|
3611
|
+
// decodeURIComponent(body) would produce before Buffer re-encodes the string.
|
|
3400
3612
|
let bytes = 0;
|
|
3401
3613
|
for (let i = 0, len = body.length; i < len; i++) {
|
|
3402
3614
|
const c = body.charCodeAt(i);
|
|
3403
|
-
if (c
|
|
3615
|
+
if (c === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) {
|
|
3616
|
+
bytes += 1;
|
|
3617
|
+
i += 2;
|
|
3618
|
+
} else if (c < 0x80) {
|
|
3404
3619
|
bytes += 1;
|
|
3405
3620
|
} else if (c < 0x800) {
|
|
3406
3621
|
bytes += 2;
|
|
@@ -3419,7 +3634,7 @@ function requireAxios () {
|
|
|
3419
3634
|
return bytes;
|
|
3420
3635
|
}
|
|
3421
3636
|
|
|
3422
|
-
const VERSION = "1.
|
|
3637
|
+
const VERSION = "1.18.1";
|
|
3423
3638
|
|
|
3424
3639
|
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
3425
3640
|
|
|
@@ -3640,14 +3855,28 @@ function requireAxios () {
|
|
|
3640
3855
|
|
|
3641
3856
|
let requestContentLength;
|
|
3642
3857
|
|
|
3858
|
+
// AxiosError we raise while the request body is being streamed. Captured
|
|
3859
|
+
// by identity so the catch block can surface it directly, regardless of
|
|
3860
|
+
// how the runtime wraps the resulting fetch rejection (undici exposes it
|
|
3861
|
+
// as `err.cause`; some browsers drop the original error entirely).
|
|
3862
|
+
let pendingBodyError = null;
|
|
3863
|
+
|
|
3864
|
+
const maxBodyLengthError = () =>
|
|
3865
|
+
new AxiosError(
|
|
3866
|
+
'Request body larger than maxBodyLength limit',
|
|
3867
|
+
AxiosError.ERR_BAD_REQUEST,
|
|
3868
|
+
config,
|
|
3869
|
+
request
|
|
3870
|
+
);
|
|
3871
|
+
|
|
3643
3872
|
try {
|
|
3644
3873
|
// HTTP basic authentication
|
|
3645
3874
|
let auth = undefined;
|
|
3646
3875
|
const configAuth = own('auth');
|
|
3647
3876
|
|
|
3648
3877
|
if (configAuth) {
|
|
3649
|
-
const username = configAuth
|
|
3650
|
-
const password = configAuth
|
|
3878
|
+
const username = utils$1.getSafeProp(configAuth, 'username') || '';
|
|
3879
|
+
const password = utils$1.getSafeProp(configAuth, 'password') || '';
|
|
3651
3880
|
auth = {
|
|
3652
3881
|
username,
|
|
3653
3882
|
password
|
|
@@ -3696,53 +3925,96 @@ function requireAxios () {
|
|
|
3696
3925
|
}
|
|
3697
3926
|
}
|
|
3698
3927
|
|
|
3699
|
-
// Enforce maxBodyLength against
|
|
3700
|
-
//
|
|
3701
|
-
//
|
|
3702
|
-
//
|
|
3928
|
+
// Enforce maxBodyLength against known-size bodies before dispatch using
|
|
3929
|
+
// the body's *actual* size — never a caller-declared Content-Length,
|
|
3930
|
+
// which could under-report to slip an oversized body past the check.
|
|
3931
|
+
// Unknown-size streams return undefined here and are counted per-chunk
|
|
3932
|
+
// below as fetch consumes them.
|
|
3703
3933
|
if (hasMaxBodyLength && method !== 'get' && method !== 'head') {
|
|
3704
|
-
const outboundLength = await
|
|
3705
|
-
if (
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
throw new AxiosError(
|
|
3711
|
-
'Request body larger than maxBodyLength limit',
|
|
3712
|
-
AxiosError.ERR_BAD_REQUEST,
|
|
3713
|
-
config,
|
|
3714
|
-
request
|
|
3715
|
-
);
|
|
3934
|
+
const outboundLength = await getBodyLength(data);
|
|
3935
|
+
if (typeof outboundLength === 'number' && isFinite(outboundLength)) {
|
|
3936
|
+
requestContentLength = outboundLength;
|
|
3937
|
+
if (outboundLength > maxBodyLength) {
|
|
3938
|
+
throw maxBodyLengthError();
|
|
3939
|
+
}
|
|
3716
3940
|
}
|
|
3717
3941
|
}
|
|
3718
3942
|
|
|
3943
|
+
// A streamed body under maxBodyLength must be counted as fetch consumes
|
|
3944
|
+
// it; its size is never trusted from a caller-declared Content-Length.
|
|
3945
|
+
const mustEnforceStreamBody =
|
|
3946
|
+
hasMaxBodyLength && (utils$1.isReadableStream(data) || utils$1.isStream(data));
|
|
3947
|
+
|
|
3948
|
+
const trackRequestStream = (stream, onProgress, flush) =>
|
|
3949
|
+
trackStream(
|
|
3950
|
+
stream,
|
|
3951
|
+
DEFAULT_CHUNK_SIZE,
|
|
3952
|
+
(loadedBytes) => {
|
|
3953
|
+
if (hasMaxBodyLength && loadedBytes > maxBodyLength) {
|
|
3954
|
+
throw (pendingBodyError = maxBodyLengthError());
|
|
3955
|
+
}
|
|
3956
|
+
onProgress && onProgress(loadedBytes);
|
|
3957
|
+
},
|
|
3958
|
+
flush
|
|
3959
|
+
);
|
|
3960
|
+
|
|
3719
3961
|
if (
|
|
3720
|
-
onUploadProgress &&
|
|
3721
3962
|
supportsRequestStream &&
|
|
3722
3963
|
method !== 'get' &&
|
|
3723
3964
|
method !== 'head' &&
|
|
3724
|
-
(
|
|
3965
|
+
(onUploadProgress || mustEnforceStreamBody)
|
|
3725
3966
|
) {
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3967
|
+
requestContentLength =
|
|
3968
|
+
requestContentLength == null ? await resolveBodyLength(headers, data) : requestContentLength;
|
|
3969
|
+
|
|
3970
|
+
// A declared length of 0 is only trusted to skip the wrap when we are
|
|
3971
|
+
// not enforcing a stream limit (which must not rely on that header).
|
|
3972
|
+
if (requestContentLength !== 0 || mustEnforceStreamBody) {
|
|
3973
|
+
let _request = new Request(url, {
|
|
3974
|
+
method: 'POST',
|
|
3975
|
+
body: data,
|
|
3976
|
+
duplex: 'half',
|
|
3977
|
+
});
|
|
3731
3978
|
|
|
3732
|
-
|
|
3979
|
+
let contentTypeHeader;
|
|
3733
3980
|
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3981
|
+
if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
|
|
3982
|
+
headers.setContentType(contentTypeHeader);
|
|
3983
|
+
}
|
|
3737
3984
|
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3985
|
+
if (_request.body) {
|
|
3986
|
+
const [onProgress, flush] =
|
|
3987
|
+
(onUploadProgress &&
|
|
3988
|
+
progressEventDecorator(
|
|
3989
|
+
requestContentLength,
|
|
3990
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
3991
|
+
)) ||
|
|
3992
|
+
[];
|
|
3743
3993
|
|
|
3744
|
-
|
|
3994
|
+
data = trackRequestStream(_request.body, onProgress, flush);
|
|
3995
|
+
}
|
|
3745
3996
|
}
|
|
3997
|
+
} else if (
|
|
3998
|
+
mustEnforceStreamBody &&
|
|
3999
|
+
!isRequestSupported &&
|
|
4000
|
+
isReadableStreamSupported &&
|
|
4001
|
+
method !== 'get' &&
|
|
4002
|
+
method !== 'head'
|
|
4003
|
+
) {
|
|
4004
|
+
data = trackRequestStream(data);
|
|
4005
|
+
} else if (
|
|
4006
|
+
mustEnforceStreamBody &&
|
|
4007
|
+
isRequestSupported &&
|
|
4008
|
+
!supportsRequestStream &&
|
|
4009
|
+
method !== 'get' &&
|
|
4010
|
+
method !== 'head'
|
|
4011
|
+
) {
|
|
4012
|
+
throw new AxiosError(
|
|
4013
|
+
'Stream request bodies are not supported by the current fetch implementation',
|
|
4014
|
+
AxiosError.ERR_NOT_SUPPORT,
|
|
4015
|
+
config,
|
|
4016
|
+
request
|
|
4017
|
+
);
|
|
3746
4018
|
}
|
|
3747
4019
|
|
|
3748
4020
|
if (!utils$1.isString(withCredentials)) {
|
|
@@ -3785,10 +4057,12 @@ function requireAxios () {
|
|
|
3785
4057
|
? _fetch(request, fetchOptions)
|
|
3786
4058
|
: _fetch(url, resolvedOptions));
|
|
3787
4059
|
|
|
4060
|
+
const responseHeaders = AxiosHeaders.from(response.headers);
|
|
4061
|
+
|
|
3788
4062
|
// Cheap pre-check: if the server honestly declares a content-length that
|
|
3789
4063
|
// already exceeds the cap, reject before we start streaming.
|
|
3790
4064
|
if (hasMaxContentLength) {
|
|
3791
|
-
const declaredLength = utils$1.toFiniteNumber(
|
|
4065
|
+
const declaredLength = utils$1.toFiniteNumber(responseHeaders.getContentLength());
|
|
3792
4066
|
if (declaredLength != null && declaredLength > maxContentLength) {
|
|
3793
4067
|
throw new AxiosError(
|
|
3794
4068
|
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
|
@@ -3813,7 +4087,7 @@ function requireAxios () {
|
|
|
3813
4087
|
options[prop] = response[prop];
|
|
3814
4088
|
});
|
|
3815
4089
|
|
|
3816
|
-
const responseContentLength = utils$1.toFiniteNumber(
|
|
4090
|
+
const responseContentLength = utils$1.toFiniteNumber(responseHeaders.getContentLength());
|
|
3817
4091
|
|
|
3818
4092
|
const [onProgress, flush] =
|
|
3819
4093
|
(onDownloadProgress &&
|
|
@@ -3904,23 +4178,55 @@ function requireAxios () {
|
|
|
3904
4178
|
const canceledError = composedSignal.reason;
|
|
3905
4179
|
canceledError.config = config;
|
|
3906
4180
|
request && (canceledError.request = request);
|
|
3907
|
-
err !== canceledError
|
|
4181
|
+
if (err !== canceledError) {
|
|
4182
|
+
// Non-enumerable to match native Error `cause` semantics so loggers
|
|
4183
|
+
// don't recurse into circular fetch internals (see #7205).
|
|
4184
|
+
Object.defineProperty(canceledError, 'cause', {
|
|
4185
|
+
__proto__: null,
|
|
4186
|
+
value: err,
|
|
4187
|
+
writable: true,
|
|
4188
|
+
enumerable: false,
|
|
4189
|
+
configurable: true,
|
|
4190
|
+
});
|
|
4191
|
+
}
|
|
3908
4192
|
throw canceledError;
|
|
3909
4193
|
}
|
|
3910
4194
|
|
|
4195
|
+
// Surface a maxBodyLength violation we raised while the request body was
|
|
4196
|
+
// being streamed. Matching by identity (rather than reading
|
|
4197
|
+
// `err.cause.isAxiosError`) keeps the error deterministic across runtimes
|
|
4198
|
+
// and avoids both prototype-pollution reads and mis-attributing a foreign
|
|
4199
|
+
// AxiosError that merely happened to land in `err.cause`.
|
|
4200
|
+
if (pendingBodyError) {
|
|
4201
|
+
request && !pendingBodyError.request && (pendingBodyError.request = request);
|
|
4202
|
+
throw pendingBodyError;
|
|
4203
|
+
}
|
|
4204
|
+
|
|
4205
|
+
// Re-throw AxiosErrors we raised synchronously (data: URL / content-length
|
|
4206
|
+
// pre-checks, response size enforcement) without re-wrapping them.
|
|
4207
|
+
if (err instanceof AxiosError) {
|
|
4208
|
+
request && !err.request && (err.request = request);
|
|
4209
|
+
throw err;
|
|
4210
|
+
}
|
|
4211
|
+
|
|
3911
4212
|
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
err && err.response
|
|
3919
|
-
),
|
|
3920
|
-
{
|
|
3921
|
-
cause: err.cause || err,
|
|
3922
|
-
}
|
|
4213
|
+
const networkError = new AxiosError(
|
|
4214
|
+
'Network Error',
|
|
4215
|
+
AxiosError.ERR_NETWORK,
|
|
4216
|
+
config,
|
|
4217
|
+
request,
|
|
4218
|
+
err && err.response
|
|
3923
4219
|
);
|
|
4220
|
+
// Non-enumerable to match native Error `cause` semantics so loggers
|
|
4221
|
+
// don't recurse into circular fetch internals (see #7205).
|
|
4222
|
+
Object.defineProperty(networkError, 'cause', {
|
|
4223
|
+
__proto__: null,
|
|
4224
|
+
value: err.cause || err,
|
|
4225
|
+
writable: true,
|
|
4226
|
+
enumerable: false,
|
|
4227
|
+
configurable: true,
|
|
4228
|
+
});
|
|
4229
|
+
throw networkError;
|
|
3924
4230
|
}
|
|
3925
4231
|
|
|
3926
4232
|
throw AxiosError.from(err, err && err.code, config, request, err && err.response);
|
|
@@ -4058,7 +4364,7 @@ function requireAxios () {
|
|
|
4058
4364
|
|
|
4059
4365
|
throw new AxiosError(
|
|
4060
4366
|
`There is no suitable adapter to dispatch the request ` + s,
|
|
4061
|
-
|
|
4367
|
+
AxiosError.ERR_NOT_SUPPORT
|
|
4062
4368
|
);
|
|
4063
4369
|
}
|
|
4064
4370
|
|
|
@@ -4239,7 +4545,7 @@ function requireAxios () {
|
|
|
4239
4545
|
*/
|
|
4240
4546
|
|
|
4241
4547
|
function assertOptions(options, schema, allowUnknown) {
|
|
4242
|
-
if (typeof options !== 'object') {
|
|
4548
|
+
if (typeof options !== 'object' || options === null) {
|
|
4243
4549
|
throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
|
|
4244
4550
|
}
|
|
4245
4551
|
const keys = Object.keys(options);
|
|
@@ -4363,6 +4669,7 @@ function requireAxios () {
|
|
|
4363
4669
|
clarifyTimeoutError: validators.transitional(validators.boolean),
|
|
4364
4670
|
legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),
|
|
4365
4671
|
advertiseZstdAcceptEncoding: validators.transitional(validators.boolean),
|
|
4672
|
+
validateStatusUndefinedResolves: validators.transitional(validators.boolean),
|
|
4366
4673
|
},
|
|
4367
4674
|
false
|
|
4368
4675
|
);
|
|
@@ -4492,7 +4799,7 @@ function requireAxios () {
|
|
|
4492
4799
|
|
|
4493
4800
|
getUri(config) {
|
|
4494
4801
|
config = mergeConfig(this.defaults, config);
|
|
4495
|
-
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
|
4802
|
+
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config);
|
|
4496
4803
|
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
4497
4804
|
}
|
|
4498
4805
|
}
|
|
@@ -4505,7 +4812,7 @@ function requireAxios () {
|
|
|
4505
4812
|
mergeConfig(config || {}, {
|
|
4506
4813
|
method,
|
|
4507
4814
|
url,
|
|
4508
|
-
data: (config
|
|
4815
|
+
data: config && utils$1.hasOwnProp(config, 'data') ? config.data : undefined,
|
|
4509
4816
|
})
|
|
4510
4817
|
);
|
|
4511
4818
|
};
|