@verdocs/web-sdk 6.1.4 → 6.1.5
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-contact-picker.cjs.entry.js +286 -213
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-contact-picker.entry.cjs.js.map +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-sign.entry.cjs.js.map +1 -1
- package/dist/cjs/verdocs-status-indicator.cjs.entry.js +5 -6
- package/dist/cjs/verdocs-status-indicator.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-status-indicator.entry.cjs.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +2 -2
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
- package/dist/components/{p-Dt5I6d_s.js → p-6D0qDyV-.js} +7 -8
- package/dist/components/p-6D0qDyV-.js.map +1 -0
- package/dist/components/{p-CSQjgm9n.js → p-CeTLcymJ.js} +288 -215
- package/dist/components/p-CeTLcymJ.js.map +1 -0
- package/dist/components/{p-CSpoYxdI.js → p-DeoKKq-r.js} +3 -3
- package/dist/components/{p-CSpoYxdI.js.map → p-DeoKKq-r.js.map} +1 -1
- package/dist/components/verdocs-build.js +2 -2
- package/dist/components/verdocs-contact-picker.js +1 -1
- package/dist/components/verdocs-envelopes-list.js +1 -1
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-sign.js.map +1 -1
- package/dist/components/verdocs-status-indicator.js +1 -1
- package/dist/esm/verdocs-contact-picker.entry.js +286 -213
- package/dist/esm/verdocs-contact-picker.entry.js.map +1 -1
- package/dist/esm/verdocs-sign.entry.js.map +1 -1
- package/dist/esm/verdocs-status-indicator.entry.js +5 -6
- package/dist/esm/verdocs-status-indicator.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -1
- package/dist/esm-es5/verdocs-status-indicator.entry.js.map +1 -1
- package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +2 -2
- package/dist/types/components.d.ts +8 -8
- package/dist/verdocs-web-sdk/p-09c1c487.entry.js.map +1 -1
- package/dist/verdocs-web-sdk/p-2514f675.entry.js +3 -0
- package/dist/verdocs-web-sdk/p-2514f675.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-8cf14826.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-8cf14826.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-BR9Rz5QR.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-C5fciylu.system.js.map +1 -1
- package/dist/verdocs-web-sdk/p-PqjR4yYk.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-RlE9Yh59.system.js +1 -1
- package/dist/verdocs-web-sdk/p-f8be4637.system.entry.js +4 -0
- package/dist/verdocs-web-sdk/p-f8be4637.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-f94dd543.system.entry.js.map +1 -1
- package/dist/verdocs-web-sdk/p-ff46c002.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-ff46c002.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/verdocs-contact-picker.entry.esm.js.map +1 -1
- package/dist/verdocs-web-sdk/verdocs-sign.entry.esm.js.map +1 -1
- package/dist/verdocs-web-sdk/verdocs-status-indicator.entry.esm.js.map +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +4 -4
- package/dist/components/p-CSQjgm9n.js.map +0 -1
- package/dist/components/p-Dt5I6d_s.js.map +0 -1
- package/dist/verdocs-web-sdk/p-21da2b89.entry.js +0 -3
- package/dist/verdocs-web-sdk/p-21da2b89.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-751beab0.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-751beab0.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-8835c006.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-8835c006.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-Cts9LOkJ.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-Dp4d4aXG.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-e962f3e2.system.entry.js +0 -4
- package/dist/verdocs-web-sdk/p-e962f3e2.system.entry.js.map +0 -1
|
@@ -8,7 +8,7 @@ var utils = require('./utils-BXqLrKQZ.js');
|
|
|
8
8
|
require('./index-CeUF44L9.js');
|
|
9
9
|
require('./Types-RUyU-svM.js');
|
|
10
10
|
|
|
11
|
-
/*! Axios v1.
|
|
11
|
+
/*! Axios v1.12.2 Copyright (c) 2025 Matt Zabriskie and contributors */
|
|
12
12
|
|
|
13
13
|
var axios_1;
|
|
14
14
|
var hasRequiredAxios;
|
|
@@ -68,7 +68,7 @@ function requireAxios () {
|
|
|
68
68
|
*/
|
|
69
69
|
function isBuffer(val) {
|
|
70
70
|
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
|
|
71
|
-
&& isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
71
|
+
&& isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
/**
|
|
@@ -113,7 +113,7 @@ function requireAxios () {
|
|
|
113
113
|
* @param {*} val The value to test
|
|
114
114
|
* @returns {boolean} True if value is a Function, otherwise false
|
|
115
115
|
*/
|
|
116
|
-
const isFunction = typeOfTest('function');
|
|
116
|
+
const isFunction$1 = typeOfTest('function');
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
119
|
* Determine if a value is a Number
|
|
@@ -169,7 +169,7 @@ function requireAxios () {
|
|
|
169
169
|
if (!isObject(val) || isBuffer(val)) {
|
|
170
170
|
return false;
|
|
171
171
|
}
|
|
172
|
-
|
|
172
|
+
|
|
173
173
|
try {
|
|
174
174
|
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
|
175
175
|
} catch (e) {
|
|
@@ -221,7 +221,7 @@ function requireAxios () {
|
|
|
221
221
|
*
|
|
222
222
|
* @returns {boolean} True if value is a Stream, otherwise false
|
|
223
223
|
*/
|
|
224
|
-
const isStream = (val) => isObject(val) && isFunction(val.pipe);
|
|
224
|
+
const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
|
|
225
225
|
|
|
226
226
|
/**
|
|
227
227
|
* Determine if a value is a FormData
|
|
@@ -234,10 +234,10 @@ function requireAxios () {
|
|
|
234
234
|
let kind;
|
|
235
235
|
return thing && (
|
|
236
236
|
(typeof FormData === 'function' && thing instanceof FormData) || (
|
|
237
|
-
isFunction(thing.append) && (
|
|
237
|
+
isFunction$1(thing.append) && (
|
|
238
238
|
(kind = kindOf(thing)) === 'formdata' ||
|
|
239
239
|
// detect form-data instance
|
|
240
|
-
(kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
|
|
240
|
+
(kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
|
|
241
241
|
)
|
|
242
242
|
)
|
|
243
243
|
)
|
|
@@ -362,7 +362,7 @@ function requireAxios () {
|
|
|
362
362
|
* @returns {Object} Result of all merge properties
|
|
363
363
|
*/
|
|
364
364
|
function merge(/* obj1, obj2, obj3, ... */) {
|
|
365
|
-
const {caseless} = isContextDefined(this) && this || {};
|
|
365
|
+
const {caseless, skipUndefined} = isContextDefined(this) && this || {};
|
|
366
366
|
const result = {};
|
|
367
367
|
const assignValue = (val, key) => {
|
|
368
368
|
const targetKey = caseless && findKey(result, key) || key;
|
|
@@ -372,7 +372,7 @@ function requireAxios () {
|
|
|
372
372
|
result[targetKey] = merge({}, val);
|
|
373
373
|
} else if (isArray(val)) {
|
|
374
374
|
result[targetKey] = val.slice();
|
|
375
|
-
} else {
|
|
375
|
+
} else if (!skipUndefined || !isUndefined(val)) {
|
|
376
376
|
result[targetKey] = val;
|
|
377
377
|
}
|
|
378
378
|
};
|
|
@@ -395,7 +395,7 @@ function requireAxios () {
|
|
|
395
395
|
*/
|
|
396
396
|
const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
|
|
397
397
|
forEach(b, (val, key) => {
|
|
398
|
-
if (thisArg && isFunction(val)) {
|
|
398
|
+
if (thisArg && isFunction$1(val)) {
|
|
399
399
|
a[key] = bind(val, thisArg);
|
|
400
400
|
} else {
|
|
401
401
|
a[key] = val;
|
|
@@ -611,13 +611,13 @@ function requireAxios () {
|
|
|
611
611
|
const freezeMethods = (obj) => {
|
|
612
612
|
reduceDescriptors(obj, (descriptor, name) => {
|
|
613
613
|
// skip restricted props in strict mode
|
|
614
|
-
if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
|
|
614
|
+
if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
|
|
615
615
|
return false;
|
|
616
616
|
}
|
|
617
617
|
|
|
618
618
|
const value = obj[name];
|
|
619
619
|
|
|
620
|
-
if (!isFunction(value)) return;
|
|
620
|
+
if (!isFunction$1(value)) return;
|
|
621
621
|
|
|
622
622
|
descriptor.enumerable = false;
|
|
623
623
|
|
|
@@ -654,6 +654,8 @@ function requireAxios () {
|
|
|
654
654
|
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
655
655
|
};
|
|
656
656
|
|
|
657
|
+
|
|
658
|
+
|
|
657
659
|
/**
|
|
658
660
|
* If the thing is a FormData object, return true, otherwise return false.
|
|
659
661
|
*
|
|
@@ -662,7 +664,7 @@ function requireAxios () {
|
|
|
662
664
|
* @returns {boolean}
|
|
663
665
|
*/
|
|
664
666
|
function isSpecCompliantForm(thing) {
|
|
665
|
-
return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
|
|
667
|
+
return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
|
|
666
668
|
}
|
|
667
669
|
|
|
668
670
|
const toJSONObject = (obj) => {
|
|
@@ -704,7 +706,7 @@ function requireAxios () {
|
|
|
704
706
|
const isAsyncFn = kindOfTest('AsyncFunction');
|
|
705
707
|
|
|
706
708
|
const isThenable = (thing) =>
|
|
707
|
-
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
|
709
|
+
thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
|
|
708
710
|
|
|
709
711
|
// original code
|
|
710
712
|
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
|
@@ -728,7 +730,7 @@ function requireAxios () {
|
|
|
728
730
|
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
729
731
|
})(
|
|
730
732
|
typeof setImmediate === 'function',
|
|
731
|
-
isFunction(_global.postMessage)
|
|
733
|
+
isFunction$1(_global.postMessage)
|
|
732
734
|
);
|
|
733
735
|
|
|
734
736
|
const asap = typeof queueMicrotask !== 'undefined' ?
|
|
@@ -737,7 +739,7 @@ function requireAxios () {
|
|
|
737
739
|
// *********************
|
|
738
740
|
|
|
739
741
|
|
|
740
|
-
const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
|
|
742
|
+
const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
|
|
741
743
|
|
|
742
744
|
|
|
743
745
|
var utils$1 = {
|
|
@@ -761,7 +763,7 @@ function requireAxios () {
|
|
|
761
763
|
isFile,
|
|
762
764
|
isBlob,
|
|
763
765
|
isRegExp,
|
|
764
|
-
isFunction,
|
|
766
|
+
isFunction: isFunction$1,
|
|
765
767
|
isStream,
|
|
766
768
|
isURLSearchParams,
|
|
767
769
|
isTypedArray,
|
|
@@ -887,11 +889,18 @@ function requireAxios () {
|
|
|
887
889
|
return prop !== 'isAxiosError';
|
|
888
890
|
});
|
|
889
891
|
|
|
890
|
-
|
|
892
|
+
const msg = error && error.message ? error.message : 'Error';
|
|
893
|
+
|
|
894
|
+
// Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)
|
|
895
|
+
const errCode = code == null && error ? error.code : code;
|
|
896
|
+
AxiosError.call(axiosError, msg, errCode, config, request, response);
|
|
891
897
|
|
|
892
|
-
|
|
898
|
+
// Chain the original error on the standard field; non-enumerable to avoid JSON noise
|
|
899
|
+
if (error && axiosError.cause == null) {
|
|
900
|
+
Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });
|
|
901
|
+
}
|
|
893
902
|
|
|
894
|
-
axiosError.name = error.name;
|
|
903
|
+
axiosError.name = (error && error.name) || 'Error';
|
|
895
904
|
|
|
896
905
|
customProps && Object.assign(axiosError, customProps);
|
|
897
906
|
|
|
@@ -1182,9 +1191,7 @@ function requireAxios () {
|
|
|
1182
1191
|
replace(/%3A/gi, ':').
|
|
1183
1192
|
replace(/%24/g, '$').
|
|
1184
1193
|
replace(/%2C/gi, ',').
|
|
1185
|
-
replace(/%20/g, '+')
|
|
1186
|
-
replace(/%5B/gi, '[').
|
|
1187
|
-
replace(/%5D/gi, ']');
|
|
1194
|
+
replace(/%20/g, '+');
|
|
1188
1195
|
}
|
|
1189
1196
|
|
|
1190
1197
|
/**
|
|
@@ -1589,7 +1596,7 @@ function requireAxios () {
|
|
|
1589
1596
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
1590
1597
|
|
|
1591
1598
|
try {
|
|
1592
|
-
return JSON.parse(data);
|
|
1599
|
+
return JSON.parse(data, this.parseReviver);
|
|
1593
1600
|
} catch (e) {
|
|
1594
1601
|
if (strictJSONParsing) {
|
|
1595
1602
|
if (e.name === 'SyntaxError') {
|
|
@@ -2414,7 +2421,7 @@ function requireAxios () {
|
|
|
2414
2421
|
var resolveConfig = (config) => {
|
|
2415
2422
|
const newConfig = mergeConfig({}, config);
|
|
2416
2423
|
|
|
2417
|
-
let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
|
|
2424
|
+
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
|
|
2418
2425
|
|
|
2419
2426
|
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
|
2420
2427
|
|
|
@@ -2427,17 +2434,21 @@ function requireAxios () {
|
|
|
2427
2434
|
);
|
|
2428
2435
|
}
|
|
2429
2436
|
|
|
2430
|
-
let contentType;
|
|
2431
|
-
|
|
2432
2437
|
if (utils$1.isFormData(data)) {
|
|
2433
2438
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
2434
|
-
headers.setContentType(undefined); //
|
|
2435
|
-
} else if ((
|
|
2436
|
-
//
|
|
2437
|
-
const
|
|
2438
|
-
headers
|
|
2439
|
+
headers.setContentType(undefined); // browser handles it
|
|
2440
|
+
} else if (utils$1.isFunction(data.getHeaders)) {
|
|
2441
|
+
// Node.js FormData (like form-data package)
|
|
2442
|
+
const formHeaders = data.getHeaders();
|
|
2443
|
+
// Only set safe headers to avoid overwriting security headers
|
|
2444
|
+
const allowedHeaders = ['content-type', 'content-length'];
|
|
2445
|
+
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
2446
|
+
if (allowedHeaders.includes(key.toLowerCase())) {
|
|
2447
|
+
headers.set(key, val);
|
|
2448
|
+
}
|
|
2449
|
+
});
|
|
2439
2450
|
}
|
|
2440
|
-
}
|
|
2451
|
+
}
|
|
2441
2452
|
|
|
2442
2453
|
// Add xsrf header
|
|
2443
2454
|
// This is only done if running in a standard browser environment.
|
|
@@ -2554,15 +2565,18 @@ function requireAxios () {
|
|
|
2554
2565
|
};
|
|
2555
2566
|
|
|
2556
2567
|
// Handle low level network errors
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2568
|
+
request.onerror = function handleError(event) {
|
|
2569
|
+
// Browsers deliver a ProgressEvent in XHR onerror
|
|
2570
|
+
// (message may be empty; when present, surface it)
|
|
2571
|
+
// See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
|
|
2572
|
+
const msg = event && event.message ? event.message : 'Network Error';
|
|
2573
|
+
const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);
|
|
2574
|
+
// attach the underlying event for consumers who want details
|
|
2575
|
+
err.event = event || null;
|
|
2576
|
+
reject(err);
|
|
2577
|
+
request = null;
|
|
2564
2578
|
};
|
|
2565
|
-
|
|
2579
|
+
|
|
2566
2580
|
// Handle timeout
|
|
2567
2581
|
request.ontimeout = function handleTimeout() {
|
|
2568
2582
|
let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
@@ -2778,14 +2792,18 @@ function requireAxios () {
|
|
|
2778
2792
|
})
|
|
2779
2793
|
};
|
|
2780
2794
|
|
|
2781
|
-
const
|
|
2782
|
-
|
|
2795
|
+
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
2796
|
+
|
|
2797
|
+
const {isFunction} = utils$1;
|
|
2798
|
+
|
|
2799
|
+
const globalFetchAPI = (({Request, Response}) => ({
|
|
2800
|
+
Request, Response
|
|
2801
|
+
}))(utils$1.global);
|
|
2802
|
+
|
|
2803
|
+
const {
|
|
2804
|
+
ReadableStream: ReadableStream$1, TextEncoder
|
|
2805
|
+
} = utils$1.global;
|
|
2783
2806
|
|
|
2784
|
-
// used only inside the fetch adapter
|
|
2785
|
-
const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
|
|
2786
|
-
((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
|
|
2787
|
-
async (str) => new Uint8Array(await new Response(str).arrayBuffer())
|
|
2788
|
-
);
|
|
2789
2807
|
|
|
2790
2808
|
const test = (fn, ...args) => {
|
|
2791
2809
|
try {
|
|
@@ -2795,211 +2813,268 @@ function requireAxios () {
|
|
|
2795
2813
|
}
|
|
2796
2814
|
};
|
|
2797
2815
|
|
|
2798
|
-
const
|
|
2799
|
-
|
|
2816
|
+
const factory = (env) => {
|
|
2817
|
+
env = utils$1.merge.call({
|
|
2818
|
+
skipUndefined: true
|
|
2819
|
+
}, globalFetchAPI, env);
|
|
2800
2820
|
|
|
2801
|
-
const
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
duplexAccessed = true;
|
|
2806
|
-
return 'half';
|
|
2807
|
-
},
|
|
2808
|
-
}).headers.has('Content-Type');
|
|
2821
|
+
const {fetch: envFetch, Request, Response} = env;
|
|
2822
|
+
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
|
|
2823
|
+
const isRequestSupported = isFunction(Request);
|
|
2824
|
+
const isResponseSupported = isFunction(Response);
|
|
2809
2825
|
|
|
2810
|
-
|
|
2811
|
-
|
|
2826
|
+
if (!isFetchSupported) {
|
|
2827
|
+
return false;
|
|
2828
|
+
}
|
|
2812
2829
|
|
|
2813
|
-
|
|
2830
|
+
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
|
|
2814
2831
|
|
|
2815
|
-
|
|
2816
|
-
|
|
2832
|
+
const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
|
|
2833
|
+
((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
|
|
2834
|
+
async (str) => new Uint8Array(await new Request(str).arrayBuffer())
|
|
2835
|
+
);
|
|
2817
2836
|
|
|
2837
|
+
const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
|
|
2838
|
+
let duplexAccessed = false;
|
|
2818
2839
|
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2840
|
+
const hasContentType = new Request(platform.origin, {
|
|
2841
|
+
body: new ReadableStream$1(),
|
|
2842
|
+
method: 'POST',
|
|
2843
|
+
get duplex() {
|
|
2844
|
+
duplexAccessed = true;
|
|
2845
|
+
return 'half';
|
|
2846
|
+
},
|
|
2847
|
+
}).headers.has('Content-Type');
|
|
2822
2848
|
|
|
2823
|
-
|
|
2824
|
-
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
|
2825
|
-
!resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :
|
|
2826
|
-
(_, config) => {
|
|
2827
|
-
throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
|
|
2828
|
-
});
|
|
2849
|
+
return duplexAccessed && !hasContentType;
|
|
2829
2850
|
});
|
|
2830
|
-
})(new Response));
|
|
2831
2851
|
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
return 0;
|
|
2835
|
-
}
|
|
2852
|
+
const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&
|
|
2853
|
+
test(() => utils$1.isReadableStream(new Response('').body));
|
|
2836
2854
|
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
}
|
|
2855
|
+
const resolvers = {
|
|
2856
|
+
stream: supportsResponseStream && ((res) => res.body)
|
|
2857
|
+
};
|
|
2840
2858
|
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2859
|
+
isFetchSupported && ((() => {
|
|
2860
|
+
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
|
2861
|
+
!resolvers[type] && (resolvers[type] = (res, config) => {
|
|
2862
|
+
let method = res && res[type];
|
|
2863
|
+
|
|
2864
|
+
if (method) {
|
|
2865
|
+
return method.call(res);
|
|
2866
|
+
}
|
|
2867
|
+
|
|
2868
|
+
throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
|
|
2869
|
+
});
|
|
2845
2870
|
});
|
|
2846
|
-
|
|
2847
|
-
}
|
|
2871
|
+
})());
|
|
2848
2872
|
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2873
|
+
const getBodyLength = async (body) => {
|
|
2874
|
+
if (body == null) {
|
|
2875
|
+
return 0;
|
|
2876
|
+
}
|
|
2852
2877
|
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2878
|
+
if (utils$1.isBlob(body)) {
|
|
2879
|
+
return body.size;
|
|
2880
|
+
}
|
|
2856
2881
|
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2882
|
+
if (utils$1.isSpecCompliantForm(body)) {
|
|
2883
|
+
const _request = new Request(platform.origin, {
|
|
2884
|
+
method: 'POST',
|
|
2885
|
+
body,
|
|
2886
|
+
});
|
|
2887
|
+
return (await _request.arrayBuffer()).byteLength;
|
|
2888
|
+
}
|
|
2861
2889
|
|
|
2862
|
-
|
|
2863
|
-
|
|
2890
|
+
if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
|
|
2891
|
+
return body.byteLength;
|
|
2892
|
+
}
|
|
2864
2893
|
|
|
2865
|
-
|
|
2866
|
-
|
|
2894
|
+
if (utils$1.isURLSearchParams(body)) {
|
|
2895
|
+
body = body + '';
|
|
2896
|
+
}
|
|
2897
|
+
|
|
2898
|
+
if (utils$1.isString(body)) {
|
|
2899
|
+
return (await encodeText(body)).byteLength;
|
|
2900
|
+
}
|
|
2901
|
+
};
|
|
2902
|
+
|
|
2903
|
+
const resolveBodyLength = async (headers, body) => {
|
|
2904
|
+
const length = utils$1.toFiniteNumber(headers.getContentLength());
|
|
2905
|
+
|
|
2906
|
+
return length == null ? getBodyLength(body) : length;
|
|
2907
|
+
};
|
|
2908
|
+
|
|
2909
|
+
return async (config) => {
|
|
2910
|
+
let {
|
|
2911
|
+
url,
|
|
2912
|
+
method,
|
|
2913
|
+
data,
|
|
2914
|
+
signal,
|
|
2915
|
+
cancelToken,
|
|
2916
|
+
timeout,
|
|
2917
|
+
onDownloadProgress,
|
|
2918
|
+
onUploadProgress,
|
|
2919
|
+
responseType,
|
|
2920
|
+
headers,
|
|
2921
|
+
withCredentials = 'same-origin',
|
|
2922
|
+
fetchOptions
|
|
2923
|
+
} = resolveConfig(config);
|
|
2924
|
+
|
|
2925
|
+
let _fetch = envFetch || fetch;
|
|
2926
|
+
|
|
2927
|
+
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
2928
|
+
|
|
2929
|
+
let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
2867
2930
|
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
method,
|
|
2872
|
-
data,
|
|
2873
|
-
signal,
|
|
2874
|
-
cancelToken,
|
|
2875
|
-
timeout,
|
|
2876
|
-
onDownloadProgress,
|
|
2877
|
-
onUploadProgress,
|
|
2878
|
-
responseType,
|
|
2879
|
-
headers,
|
|
2880
|
-
withCredentials = 'same-origin',
|
|
2881
|
-
fetchOptions
|
|
2882
|
-
} = resolveConfig(config);
|
|
2883
|
-
|
|
2884
|
-
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
2885
|
-
|
|
2886
|
-
let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
2887
|
-
|
|
2888
|
-
let request;
|
|
2889
|
-
|
|
2890
|
-
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
2931
|
+
let request = null;
|
|
2932
|
+
|
|
2933
|
+
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
2891
2934
|
composedSignal.unsubscribe();
|
|
2892
|
-
|
|
2935
|
+
});
|
|
2893
2936
|
|
|
2894
|
-
|
|
2937
|
+
let requestContentLength;
|
|
2895
2938
|
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2939
|
+
try {
|
|
2940
|
+
if (
|
|
2941
|
+
onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
|
|
2942
|
+
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
|
2943
|
+
) {
|
|
2944
|
+
let _request = new Request(url, {
|
|
2945
|
+
method: 'POST',
|
|
2946
|
+
body: data,
|
|
2947
|
+
duplex: "half"
|
|
2948
|
+
});
|
|
2906
2949
|
|
|
2907
|
-
|
|
2950
|
+
let contentTypeHeader;
|
|
2908
2951
|
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2952
|
+
if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
|
|
2953
|
+
headers.setContentType(contentTypeHeader);
|
|
2954
|
+
}
|
|
2912
2955
|
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2956
|
+
if (_request.body) {
|
|
2957
|
+
const [onProgress, flush] = progressEventDecorator(
|
|
2958
|
+
requestContentLength,
|
|
2959
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
2960
|
+
);
|
|
2918
2961
|
|
|
2919
|
-
|
|
2962
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
2963
|
+
}
|
|
2920
2964
|
}
|
|
2921
|
-
}
|
|
2922
2965
|
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2966
|
+
if (!utils$1.isString(withCredentials)) {
|
|
2967
|
+
withCredentials = withCredentials ? 'include' : 'omit';
|
|
2968
|
+
}
|
|
2926
2969
|
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
request = new Request(url, {
|
|
2931
|
-
...fetchOptions,
|
|
2932
|
-
signal: composedSignal,
|
|
2933
|
-
method: method.toUpperCase(),
|
|
2934
|
-
headers: headers.normalize().toJSON(),
|
|
2935
|
-
body: data,
|
|
2936
|
-
duplex: "half",
|
|
2937
|
-
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
2938
|
-
});
|
|
2970
|
+
// Cloudflare Workers throws when credentials are defined
|
|
2971
|
+
// see https://github.com/cloudflare/workerd/issues/902
|
|
2972
|
+
const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
|
|
2939
2973
|
|
|
2940
|
-
|
|
2974
|
+
const resolvedOptions = {
|
|
2975
|
+
...fetchOptions,
|
|
2976
|
+
signal: composedSignal,
|
|
2977
|
+
method: method.toUpperCase(),
|
|
2978
|
+
headers: headers.normalize().toJSON(),
|
|
2979
|
+
body: data,
|
|
2980
|
+
duplex: "half",
|
|
2981
|
+
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
2982
|
+
};
|
|
2941
2983
|
|
|
2942
|
-
|
|
2984
|
+
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
2943
2985
|
|
|
2944
|
-
|
|
2945
|
-
const options = {};
|
|
2986
|
+
let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
|
|
2946
2987
|
|
|
2947
|
-
|
|
2948
|
-
options[prop] = response[prop];
|
|
2949
|
-
});
|
|
2988
|
+
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
2950
2989
|
|
|
2951
|
-
|
|
2990
|
+
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
|
2991
|
+
const options = {};
|
|
2952
2992
|
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
) || [];
|
|
2993
|
+
['status', 'statusText', 'headers'].forEach(prop => {
|
|
2994
|
+
options[prop] = response[prop];
|
|
2995
|
+
});
|
|
2957
2996
|
|
|
2958
|
-
|
|
2959
|
-
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
2960
|
-
flush && flush();
|
|
2961
|
-
unsubscribe && unsubscribe();
|
|
2962
|
-
}),
|
|
2963
|
-
options
|
|
2964
|
-
);
|
|
2965
|
-
}
|
|
2997
|
+
const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
|
|
2966
2998
|
|
|
2967
|
-
|
|
2999
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
3000
|
+
responseContentLength,
|
|
3001
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
3002
|
+
) || [];
|
|
2968
3003
|
|
|
2969
|
-
|
|
3004
|
+
response = new Response(
|
|
3005
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
3006
|
+
flush && flush();
|
|
3007
|
+
unsubscribe && unsubscribe();
|
|
3008
|
+
}),
|
|
3009
|
+
options
|
|
3010
|
+
);
|
|
3011
|
+
}
|
|
2970
3012
|
|
|
2971
|
-
|
|
3013
|
+
responseType = responseType || 'text';
|
|
2972
3014
|
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
3015
|
+
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
|
|
3016
|
+
|
|
3017
|
+
!isStreamResponse && unsubscribe && unsubscribe();
|
|
3018
|
+
|
|
3019
|
+
return await new Promise((resolve, reject) => {
|
|
3020
|
+
settle(resolve, reject, {
|
|
3021
|
+
data: responseData,
|
|
3022
|
+
headers: AxiosHeaders$1.from(response.headers),
|
|
3023
|
+
status: response.status,
|
|
3024
|
+
statusText: response.statusText,
|
|
3025
|
+
config,
|
|
3026
|
+
request
|
|
3027
|
+
});
|
|
3028
|
+
})
|
|
3029
|
+
} catch (err) {
|
|
3030
|
+
unsubscribe && unsubscribe();
|
|
3031
|
+
|
|
3032
|
+
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
|
3033
|
+
throw Object.assign(
|
|
3034
|
+
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
|
|
3035
|
+
{
|
|
3036
|
+
cause: err.cause || err
|
|
3037
|
+
}
|
|
3038
|
+
)
|
|
3039
|
+
}
|
|
3040
|
+
|
|
3041
|
+
throw AxiosError.from(err, err && err.code, config, request);
|
|
2993
3042
|
}
|
|
3043
|
+
}
|
|
3044
|
+
};
|
|
3045
|
+
|
|
3046
|
+
const seedCache = new Map();
|
|
3047
|
+
|
|
3048
|
+
const getFetch = (config) => {
|
|
3049
|
+
let env = config ? config.env : {};
|
|
3050
|
+
const {fetch, Request, Response} = env;
|
|
3051
|
+
const seeds = [
|
|
3052
|
+
Request, Response, fetch
|
|
3053
|
+
];
|
|
3054
|
+
|
|
3055
|
+
let len = seeds.length, i = len,
|
|
3056
|
+
seed, target, map = seedCache;
|
|
3057
|
+
|
|
3058
|
+
while (i--) {
|
|
3059
|
+
seed = seeds[i];
|
|
3060
|
+
target = map.get(seed);
|
|
3061
|
+
|
|
3062
|
+
target === undefined && map.set(seed, target = (i ? new Map() : factory(env)));
|
|
2994
3063
|
|
|
2995
|
-
|
|
3064
|
+
map = target;
|
|
2996
3065
|
}
|
|
2997
|
-
|
|
3066
|
+
|
|
3067
|
+
return target;
|
|
3068
|
+
};
|
|
3069
|
+
|
|
3070
|
+
getFetch();
|
|
2998
3071
|
|
|
2999
3072
|
const knownAdapters = {
|
|
3000
3073
|
http: httpAdapter,
|
|
3001
3074
|
xhr: xhrAdapter,
|
|
3002
|
-
fetch:
|
|
3075
|
+
fetch: {
|
|
3076
|
+
get: getFetch,
|
|
3077
|
+
}
|
|
3003
3078
|
};
|
|
3004
3079
|
|
|
3005
3080
|
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
@@ -3018,7 +3093,7 @@ function requireAxios () {
|
|
|
3018
3093
|
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
3019
3094
|
|
|
3020
3095
|
var adapters = {
|
|
3021
|
-
getAdapter: (adapters) => {
|
|
3096
|
+
getAdapter: (adapters, config) => {
|
|
3022
3097
|
adapters = utils$1.isArray(adapters) ? adapters : [adapters];
|
|
3023
3098
|
|
|
3024
3099
|
const {length} = adapters;
|
|
@@ -3041,7 +3116,7 @@ function requireAxios () {
|
|
|
3041
3116
|
}
|
|
3042
3117
|
}
|
|
3043
3118
|
|
|
3044
|
-
if (adapter) {
|
|
3119
|
+
if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
|
3045
3120
|
break;
|
|
3046
3121
|
}
|
|
3047
3122
|
|
|
@@ -3109,7 +3184,7 @@ function requireAxios () {
|
|
|
3109
3184
|
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
|
3110
3185
|
}
|
|
3111
3186
|
|
|
3112
|
-
const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
|
|
3187
|
+
const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config);
|
|
3113
3188
|
|
|
3114
3189
|
return adapter(config).then(function onAdapterResolution(response) {
|
|
3115
3190
|
throwIfCancellationRequested(config);
|
|
@@ -3143,7 +3218,7 @@ function requireAxios () {
|
|
|
3143
3218
|
});
|
|
3144
3219
|
}
|
|
3145
3220
|
|
|
3146
|
-
const VERSION = "1.
|
|
3221
|
+
const VERSION = "1.12.2";
|
|
3147
3222
|
|
|
3148
3223
|
const validators$1 = {};
|
|
3149
3224
|
|
|
@@ -3399,8 +3474,6 @@ function requireAxios () {
|
|
|
3399
3474
|
|
|
3400
3475
|
let newConfig = config;
|
|
3401
3476
|
|
|
3402
|
-
i = 0;
|
|
3403
|
-
|
|
3404
3477
|
while (i < len) {
|
|
3405
3478
|
const onFulfilled = requestInterceptorChain[i++];
|
|
3406
3479
|
const onRejected = requestInterceptorChain[i++];
|