@imtbl/sdk 0.38.0 → 0.39.1-alpha.1
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/blockchain_data.js +1 -1
- package/dist/browser/checkout/sdk.js +6 -6
- package/dist/browser/checkout/widgets.js +61 -58
- package/dist/checkout.d.ts +31 -14
- package/dist/checkout.js +816 -1047
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +12 -12
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +1029 -1233
- package/dist/index.d.ts +31 -14
- package/dist/index.js +1059 -1263
- package/dist/passport.js +235 -208
- package/package.json +2 -2
package/dist/passport.js
CHANGED
|
@@ -2349,7 +2349,7 @@ class MultiRollupApiClients {
|
|
|
2349
2349
|
}
|
|
2350
2350
|
|
|
2351
2351
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2352
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.
|
|
2352
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.39.1-alpha.1' };
|
|
2353
2353
|
const createConfig = ({ basePath, headers, }) => {
|
|
2354
2354
|
if (!basePath.trim()) {
|
|
2355
2355
|
throw Error('basePath can not be empty');
|
|
@@ -2405,7 +2405,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
2405
2405
|
chainID,
|
|
2406
2406
|
coreContractAddress,
|
|
2407
2407
|
registrationContractAddress,
|
|
2408
|
-
sdkVersion: 'ts-immutable-sdk-0.
|
|
2408
|
+
sdkVersion: 'ts-immutable-sdk-0.39.1-alpha.1',
|
|
2409
2409
|
});
|
|
2410
2410
|
/**
|
|
2411
2411
|
* Sets `sdkVersion` at the time of build
|
|
@@ -3452,8 +3452,9 @@ const reduceDescriptors = (obj, reducer) => {
|
|
|
3452
3452
|
const reducedDescriptors = {};
|
|
3453
3453
|
|
|
3454
3454
|
forEach(descriptors, (descriptor, name) => {
|
|
3455
|
-
|
|
3456
|
-
|
|
3455
|
+
let ret;
|
|
3456
|
+
if ((ret = reducer(descriptor, name, obj)) !== false) {
|
|
3457
|
+
reducedDescriptors[name] = ret || descriptor;
|
|
3457
3458
|
}
|
|
3458
3459
|
});
|
|
3459
3460
|
|
|
@@ -3579,7 +3580,7 @@ const isAsyncFn = kindOfTest('AsyncFunction');
|
|
|
3579
3580
|
const isThenable = (thing) =>
|
|
3580
3581
|
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
|
3581
3582
|
|
|
3582
|
-
var utils = {
|
|
3583
|
+
var utils$1 = {
|
|
3583
3584
|
isArray,
|
|
3584
3585
|
isArrayBuffer,
|
|
3585
3586
|
isBuffer,
|
|
@@ -3661,7 +3662,7 @@ function AxiosError(message, code, config, request, response) {
|
|
|
3661
3662
|
response && (this.response = response);
|
|
3662
3663
|
}
|
|
3663
3664
|
|
|
3664
|
-
utils.inherits(AxiosError, Error, {
|
|
3665
|
+
utils$1.inherits(AxiosError, Error, {
|
|
3665
3666
|
toJSON: function toJSON() {
|
|
3666
3667
|
return {
|
|
3667
3668
|
// Standard
|
|
@@ -3676,7 +3677,7 @@ utils.inherits(AxiosError, Error, {
|
|
|
3676
3677
|
columnNumber: this.columnNumber,
|
|
3677
3678
|
stack: this.stack,
|
|
3678
3679
|
// Axios
|
|
3679
|
-
config: utils.toJSONObject(this.config),
|
|
3680
|
+
config: utils$1.toJSONObject(this.config),
|
|
3680
3681
|
code: this.code,
|
|
3681
3682
|
status: this.response && this.response.status ? this.response.status : null
|
|
3682
3683
|
};
|
|
@@ -3711,7 +3712,7 @@ Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
|
|
|
3711
3712
|
AxiosError.from = (error, code, config, request, response, customProps) => {
|
|
3712
3713
|
const axiosError = Object.create(prototype$1);
|
|
3713
3714
|
|
|
3714
|
-
utils.toFlatObject(error, axiosError, function filter(obj) {
|
|
3715
|
+
utils$1.toFlatObject(error, axiosError, function filter(obj) {
|
|
3715
3716
|
return obj !== Error.prototype;
|
|
3716
3717
|
}, prop => {
|
|
3717
3718
|
return prop !== 'isAxiosError';
|
|
@@ -3739,7 +3740,7 @@ var httpAdapter = null;
|
|
|
3739
3740
|
* @returns {boolean}
|
|
3740
3741
|
*/
|
|
3741
3742
|
function isVisitable(thing) {
|
|
3742
|
-
return utils.isPlainObject(thing) || utils.isArray(thing);
|
|
3743
|
+
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
|
3743
3744
|
}
|
|
3744
3745
|
|
|
3745
3746
|
/**
|
|
@@ -3750,7 +3751,7 @@ function isVisitable(thing) {
|
|
|
3750
3751
|
* @returns {string} the key without the brackets.
|
|
3751
3752
|
*/
|
|
3752
3753
|
function removeBrackets(key) {
|
|
3753
|
-
return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
|
|
3754
|
+
return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
|
|
3754
3755
|
}
|
|
3755
3756
|
|
|
3756
3757
|
/**
|
|
@@ -3779,10 +3780,10 @@ function renderKey(path, key, dots) {
|
|
|
3779
3780
|
* @returns {boolean}
|
|
3780
3781
|
*/
|
|
3781
3782
|
function isFlatArray(arr) {
|
|
3782
|
-
return utils.isArray(arr) && !arr.some(isVisitable);
|
|
3783
|
+
return utils$1.isArray(arr) && !arr.some(isVisitable);
|
|
3783
3784
|
}
|
|
3784
3785
|
|
|
3785
|
-
const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
|
|
3786
|
+
const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
|
|
3786
3787
|
return /^is[A-Z]/.test(prop);
|
|
3787
3788
|
});
|
|
3788
3789
|
|
|
@@ -3810,7 +3811,7 @@ const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
|
|
|
3810
3811
|
* @returns
|
|
3811
3812
|
*/
|
|
3812
3813
|
function toFormData(obj, formData, options) {
|
|
3813
|
-
if (!utils.isObject(obj)) {
|
|
3814
|
+
if (!utils$1.isObject(obj)) {
|
|
3814
3815
|
throw new TypeError('target must be an object');
|
|
3815
3816
|
}
|
|
3816
3817
|
|
|
@@ -3818,13 +3819,13 @@ function toFormData(obj, formData, options) {
|
|
|
3818
3819
|
formData = formData || new (FormData)();
|
|
3819
3820
|
|
|
3820
3821
|
// eslint-disable-next-line no-param-reassign
|
|
3821
|
-
options = utils.toFlatObject(options, {
|
|
3822
|
+
options = utils$1.toFlatObject(options, {
|
|
3822
3823
|
metaTokens: true,
|
|
3823
3824
|
dots: false,
|
|
3824
3825
|
indexes: false
|
|
3825
3826
|
}, false, function defined(option, source) {
|
|
3826
3827
|
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
3827
|
-
return !utils.isUndefined(source[option]);
|
|
3828
|
+
return !utils$1.isUndefined(source[option]);
|
|
3828
3829
|
});
|
|
3829
3830
|
|
|
3830
3831
|
const metaTokens = options.metaTokens;
|
|
@@ -3833,24 +3834,24 @@ function toFormData(obj, formData, options) {
|
|
|
3833
3834
|
const dots = options.dots;
|
|
3834
3835
|
const indexes = options.indexes;
|
|
3835
3836
|
const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
|
|
3836
|
-
const useBlob = _Blob && utils.isSpecCompliantForm(formData);
|
|
3837
|
+
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
3837
3838
|
|
|
3838
|
-
if (!utils.isFunction(visitor)) {
|
|
3839
|
+
if (!utils$1.isFunction(visitor)) {
|
|
3839
3840
|
throw new TypeError('visitor must be a function');
|
|
3840
3841
|
}
|
|
3841
3842
|
|
|
3842
3843
|
function convertValue(value) {
|
|
3843
3844
|
if (value === null) return '';
|
|
3844
3845
|
|
|
3845
|
-
if (utils.isDate(value)) {
|
|
3846
|
+
if (utils$1.isDate(value)) {
|
|
3846
3847
|
return value.toISOString();
|
|
3847
3848
|
}
|
|
3848
3849
|
|
|
3849
|
-
if (!useBlob && utils.isBlob(value)) {
|
|
3850
|
+
if (!useBlob && utils$1.isBlob(value)) {
|
|
3850
3851
|
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
|
|
3851
3852
|
}
|
|
3852
3853
|
|
|
3853
|
-
if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
|
|
3854
|
+
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
|
3854
3855
|
return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
|
|
3855
3856
|
}
|
|
3856
3857
|
|
|
@@ -3871,20 +3872,20 @@ function toFormData(obj, formData, options) {
|
|
|
3871
3872
|
let arr = value;
|
|
3872
3873
|
|
|
3873
3874
|
if (value && !path && typeof value === 'object') {
|
|
3874
|
-
if (utils.endsWith(key, '{}')) {
|
|
3875
|
+
if (utils$1.endsWith(key, '{}')) {
|
|
3875
3876
|
// eslint-disable-next-line no-param-reassign
|
|
3876
3877
|
key = metaTokens ? key : key.slice(0, -2);
|
|
3877
3878
|
// eslint-disable-next-line no-param-reassign
|
|
3878
3879
|
value = JSON.stringify(value);
|
|
3879
3880
|
} else if (
|
|
3880
|
-
(utils.isArray(value) && isFlatArray(value)) ||
|
|
3881
|
-
((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))
|
|
3881
|
+
(utils$1.isArray(value) && isFlatArray(value)) ||
|
|
3882
|
+
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
|
|
3882
3883
|
)) {
|
|
3883
3884
|
// eslint-disable-next-line no-param-reassign
|
|
3884
3885
|
key = removeBrackets(key);
|
|
3885
3886
|
|
|
3886
3887
|
arr.forEach(function each(el, index) {
|
|
3887
|
-
!(utils.isUndefined(el) || el === null) && formData.append(
|
|
3888
|
+
!(utils$1.isUndefined(el) || el === null) && formData.append(
|
|
3888
3889
|
// eslint-disable-next-line no-nested-ternary
|
|
3889
3890
|
indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
|
|
3890
3891
|
convertValue(el)
|
|
@@ -3912,7 +3913,7 @@ function toFormData(obj, formData, options) {
|
|
|
3912
3913
|
});
|
|
3913
3914
|
|
|
3914
3915
|
function build(value, path) {
|
|
3915
|
-
if (utils.isUndefined(value)) return;
|
|
3916
|
+
if (utils$1.isUndefined(value)) return;
|
|
3916
3917
|
|
|
3917
3918
|
if (stack.indexOf(value) !== -1) {
|
|
3918
3919
|
throw Error('Circular reference detected in ' + path.join('.'));
|
|
@@ -3920,9 +3921,9 @@ function toFormData(obj, formData, options) {
|
|
|
3920
3921
|
|
|
3921
3922
|
stack.push(value);
|
|
3922
3923
|
|
|
3923
|
-
utils.forEach(value, function each(el, key) {
|
|
3924
|
-
const result = !(utils.isUndefined(el) || el === null) && visitor.call(
|
|
3925
|
-
formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
|
|
3924
|
+
utils$1.forEach(value, function each(el, key) {
|
|
3925
|
+
const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
|
|
3926
|
+
formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
|
|
3926
3927
|
);
|
|
3927
3928
|
|
|
3928
3929
|
if (result === true) {
|
|
@@ -3933,7 +3934,7 @@ function toFormData(obj, formData, options) {
|
|
|
3933
3934
|
stack.pop();
|
|
3934
3935
|
}
|
|
3935
3936
|
|
|
3936
|
-
if (!utils.isObject(obj)) {
|
|
3937
|
+
if (!utils$1.isObject(obj)) {
|
|
3937
3938
|
throw new TypeError('data must be an object');
|
|
3938
3939
|
}
|
|
3939
3940
|
|
|
@@ -4037,7 +4038,7 @@ function buildURL(url, params, options) {
|
|
|
4037
4038
|
if (serializeFn) {
|
|
4038
4039
|
serializedParams = serializeFn(params, options);
|
|
4039
4040
|
} else {
|
|
4040
|
-
serializedParams = utils.isURLSearchParams(params) ?
|
|
4041
|
+
serializedParams = utils$1.isURLSearchParams(params) ?
|
|
4041
4042
|
params.toString() :
|
|
4042
4043
|
new AxiosURLSearchParams(params, options).toString(_encode);
|
|
4043
4044
|
}
|
|
@@ -4112,7 +4113,7 @@ class InterceptorManager {
|
|
|
4112
4113
|
* @returns {void}
|
|
4113
4114
|
*/
|
|
4114
4115
|
forEach(fn) {
|
|
4115
|
-
utils.forEach(this.handlers, function forEachHandler(h) {
|
|
4116
|
+
utils$1.forEach(this.handlers, function forEachHandler(h) {
|
|
4116
4117
|
if (h !== null) {
|
|
4117
4118
|
fn(h);
|
|
4118
4119
|
}
|
|
@@ -4134,6 +4135,18 @@ var FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
|
|
|
4134
4135
|
|
|
4135
4136
|
var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
|
|
4136
4137
|
|
|
4138
|
+
var platform$1 = {
|
|
4139
|
+
isBrowser: true,
|
|
4140
|
+
classes: {
|
|
4141
|
+
URLSearchParams: URLSearchParams$1,
|
|
4142
|
+
FormData: FormData$1,
|
|
4143
|
+
Blob: Blob$1
|
|
4144
|
+
},
|
|
4145
|
+
protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
|
|
4146
|
+
};
|
|
4147
|
+
|
|
4148
|
+
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
4149
|
+
|
|
4137
4150
|
/**
|
|
4138
4151
|
* Determine if we're running in a standard browser environment
|
|
4139
4152
|
*
|
|
@@ -4151,18 +4164,10 @@ var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
|
|
|
4151
4164
|
*
|
|
4152
4165
|
* @returns {boolean}
|
|
4153
4166
|
*/
|
|
4154
|
-
const
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
product === 'NativeScript' ||
|
|
4159
|
-
product === 'NS')
|
|
4160
|
-
) {
|
|
4161
|
-
return false;
|
|
4162
|
-
}
|
|
4163
|
-
|
|
4164
|
-
return typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
4165
|
-
})();
|
|
4167
|
+
const hasStandardBrowserEnv = (
|
|
4168
|
+
(product) => {
|
|
4169
|
+
return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
|
|
4170
|
+
})(typeof navigator !== 'undefined' && navigator.product);
|
|
4166
4171
|
|
|
4167
4172
|
/**
|
|
4168
4173
|
* Determine if we're running in a standard browser webWorker environment
|
|
@@ -4173,7 +4178,7 @@ const isStandardBrowserEnv = (() => {
|
|
|
4173
4178
|
* `typeof window !== 'undefined' && typeof document !== 'undefined'`.
|
|
4174
4179
|
* This leads to a problem when axios post `FormData` in webWorker
|
|
4175
4180
|
*/
|
|
4176
|
-
|
|
4181
|
+
const hasStandardBrowserWebWorkerEnv = (() => {
|
|
4177
4182
|
return (
|
|
4178
4183
|
typeof WorkerGlobalScope !== 'undefined' &&
|
|
4179
4184
|
// eslint-disable-next-line no-undef
|
|
@@ -4182,23 +4187,22 @@ const isStandardBrowserEnv = (() => {
|
|
|
4182
4187
|
);
|
|
4183
4188
|
})();
|
|
4184
4189
|
|
|
4190
|
+
var utils = /*#__PURE__*/Object.freeze({
|
|
4191
|
+
__proto__: null,
|
|
4192
|
+
hasBrowserEnv: hasBrowserEnv,
|
|
4193
|
+
hasStandardBrowserEnv: hasStandardBrowserEnv,
|
|
4194
|
+
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv
|
|
4195
|
+
});
|
|
4185
4196
|
|
|
4186
4197
|
var platform = {
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
URLSearchParams: URLSearchParams$1,
|
|
4190
|
-
FormData: FormData$1,
|
|
4191
|
-
Blob: Blob$1
|
|
4192
|
-
},
|
|
4193
|
-
isStandardBrowserEnv,
|
|
4194
|
-
isStandardBrowserWebWorkerEnv,
|
|
4195
|
-
protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
|
|
4198
|
+
...utils,
|
|
4199
|
+
...platform$1
|
|
4196
4200
|
};
|
|
4197
4201
|
|
|
4198
4202
|
function toURLEncodedForm(data, options) {
|
|
4199
4203
|
return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
|
|
4200
4204
|
visitor: function(value, key, path, helpers) {
|
|
4201
|
-
if (platform.isNode && utils.isBuffer(value)) {
|
|
4205
|
+
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
4202
4206
|
this.append(key, value.toString('base64'));
|
|
4203
4207
|
return false;
|
|
4204
4208
|
}
|
|
@@ -4220,7 +4224,7 @@ function parsePropPath(name) {
|
|
|
4220
4224
|
// foo.x.y.z
|
|
4221
4225
|
// foo-x-y-z
|
|
4222
4226
|
// foo x y z
|
|
4223
|
-
return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
|
|
4227
|
+
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
|
|
4224
4228
|
return match[0] === '[]' ? '' : match[1] || match[0];
|
|
4225
4229
|
});
|
|
4226
4230
|
}
|
|
@@ -4255,12 +4259,15 @@ function arrayToObject(arr) {
|
|
|
4255
4259
|
function formDataToJSON(formData) {
|
|
4256
4260
|
function buildPath(path, value, target, index) {
|
|
4257
4261
|
let name = path[index++];
|
|
4262
|
+
|
|
4263
|
+
if (name === '__proto__') return true;
|
|
4264
|
+
|
|
4258
4265
|
const isNumericKey = Number.isFinite(+name);
|
|
4259
4266
|
const isLast = index >= path.length;
|
|
4260
|
-
name = !name && utils.isArray(target) ? target.length : name;
|
|
4267
|
+
name = !name && utils$1.isArray(target) ? target.length : name;
|
|
4261
4268
|
|
|
4262
4269
|
if (isLast) {
|
|
4263
|
-
if (utils.hasOwnProp(target, name)) {
|
|
4270
|
+
if (utils$1.hasOwnProp(target, name)) {
|
|
4264
4271
|
target[name] = [target[name], value];
|
|
4265
4272
|
} else {
|
|
4266
4273
|
target[name] = value;
|
|
@@ -4269,23 +4276,23 @@ function formDataToJSON(formData) {
|
|
|
4269
4276
|
return !isNumericKey;
|
|
4270
4277
|
}
|
|
4271
4278
|
|
|
4272
|
-
if (!target[name] || !utils.isObject(target[name])) {
|
|
4279
|
+
if (!target[name] || !utils$1.isObject(target[name])) {
|
|
4273
4280
|
target[name] = [];
|
|
4274
4281
|
}
|
|
4275
4282
|
|
|
4276
4283
|
const result = buildPath(path, value, target[name], index);
|
|
4277
4284
|
|
|
4278
|
-
if (result && utils.isArray(target[name])) {
|
|
4285
|
+
if (result && utils$1.isArray(target[name])) {
|
|
4279
4286
|
target[name] = arrayToObject(target[name]);
|
|
4280
4287
|
}
|
|
4281
4288
|
|
|
4282
4289
|
return !isNumericKey;
|
|
4283
4290
|
}
|
|
4284
4291
|
|
|
4285
|
-
if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
|
|
4292
|
+
if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
|
|
4286
4293
|
const obj = {};
|
|
4287
4294
|
|
|
4288
|
-
utils.forEachEntry(formData, (name, value) => {
|
|
4295
|
+
utils$1.forEachEntry(formData, (name, value) => {
|
|
4289
4296
|
buildPath(parsePropPath(name), value, obj, 0);
|
|
4290
4297
|
});
|
|
4291
4298
|
|
|
@@ -4295,10 +4302,6 @@ function formDataToJSON(formData) {
|
|
|
4295
4302
|
return null;
|
|
4296
4303
|
}
|
|
4297
4304
|
|
|
4298
|
-
const DEFAULT_CONTENT_TYPE = {
|
|
4299
|
-
'Content-Type': undefined
|
|
4300
|
-
};
|
|
4301
|
-
|
|
4302
4305
|
/**
|
|
4303
4306
|
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
|
4304
4307
|
* of the input
|
|
@@ -4310,10 +4313,10 @@ const DEFAULT_CONTENT_TYPE = {
|
|
|
4310
4313
|
* @returns {string} A stringified version of the rawValue.
|
|
4311
4314
|
*/
|
|
4312
4315
|
function stringifySafely(rawValue, parser, encoder) {
|
|
4313
|
-
if (utils.isString(rawValue)) {
|
|
4316
|
+
if (utils$1.isString(rawValue)) {
|
|
4314
4317
|
try {
|
|
4315
4318
|
(parser || JSON.parse)(rawValue);
|
|
4316
|
-
return utils.trim(rawValue);
|
|
4319
|
+
return utils$1.trim(rawValue);
|
|
4317
4320
|
} catch (e) {
|
|
4318
4321
|
if (e.name !== 'SyntaxError') {
|
|
4319
4322
|
throw e;
|
|
@@ -4333,13 +4336,13 @@ const defaults = {
|
|
|
4333
4336
|
transformRequest: [function transformRequest(data, headers) {
|
|
4334
4337
|
const contentType = headers.getContentType() || '';
|
|
4335
4338
|
const hasJSONContentType = contentType.indexOf('application/json') > -1;
|
|
4336
|
-
const isObjectPayload = utils.isObject(data);
|
|
4339
|
+
const isObjectPayload = utils$1.isObject(data);
|
|
4337
4340
|
|
|
4338
|
-
if (isObjectPayload && utils.isHTMLForm(data)) {
|
|
4341
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
|
4339
4342
|
data = new FormData(data);
|
|
4340
4343
|
}
|
|
4341
4344
|
|
|
4342
|
-
const isFormData = utils.isFormData(data);
|
|
4345
|
+
const isFormData = utils$1.isFormData(data);
|
|
4343
4346
|
|
|
4344
4347
|
if (isFormData) {
|
|
4345
4348
|
if (!hasJSONContentType) {
|
|
@@ -4348,18 +4351,18 @@ const defaults = {
|
|
|
4348
4351
|
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
4349
4352
|
}
|
|
4350
4353
|
|
|
4351
|
-
if (utils.isArrayBuffer(data) ||
|
|
4352
|
-
utils.isBuffer(data) ||
|
|
4353
|
-
utils.isStream(data) ||
|
|
4354
|
-
utils.isFile(data) ||
|
|
4355
|
-
utils.isBlob(data)
|
|
4354
|
+
if (utils$1.isArrayBuffer(data) ||
|
|
4355
|
+
utils$1.isBuffer(data) ||
|
|
4356
|
+
utils$1.isStream(data) ||
|
|
4357
|
+
utils$1.isFile(data) ||
|
|
4358
|
+
utils$1.isBlob(data)
|
|
4356
4359
|
) {
|
|
4357
4360
|
return data;
|
|
4358
4361
|
}
|
|
4359
|
-
if (utils.isArrayBufferView(data)) {
|
|
4362
|
+
if (utils$1.isArrayBufferView(data)) {
|
|
4360
4363
|
return data.buffer;
|
|
4361
4364
|
}
|
|
4362
|
-
if (utils.isURLSearchParams(data)) {
|
|
4365
|
+
if (utils$1.isURLSearchParams(data)) {
|
|
4363
4366
|
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
|
4364
4367
|
return data.toString();
|
|
4365
4368
|
}
|
|
@@ -4371,7 +4374,7 @@ const defaults = {
|
|
|
4371
4374
|
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
4372
4375
|
}
|
|
4373
4376
|
|
|
4374
|
-
if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
|
|
4377
|
+
if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
|
|
4375
4378
|
const _FormData = this.env && this.env.FormData;
|
|
4376
4379
|
|
|
4377
4380
|
return toFormData(
|
|
@@ -4395,7 +4398,7 @@ const defaults = {
|
|
|
4395
4398
|
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
4396
4399
|
const JSONRequested = this.responseType === 'json';
|
|
4397
4400
|
|
|
4398
|
-
if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
|
4401
|
+
if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
|
4399
4402
|
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
4400
4403
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
4401
4404
|
|
|
@@ -4437,24 +4440,21 @@ const defaults = {
|
|
|
4437
4440
|
|
|
4438
4441
|
headers: {
|
|
4439
4442
|
common: {
|
|
4440
|
-
'Accept': 'application/json, text/plain, */*'
|
|
4443
|
+
'Accept': 'application/json, text/plain, */*',
|
|
4444
|
+
'Content-Type': undefined
|
|
4441
4445
|
}
|
|
4442
4446
|
}
|
|
4443
4447
|
};
|
|
4444
4448
|
|
|
4445
|
-
utils.forEach(['delete', 'get', 'head'],
|
|
4449
|
+
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
|
4446
4450
|
defaults.headers[method] = {};
|
|
4447
4451
|
});
|
|
4448
4452
|
|
|
4449
|
-
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
4450
|
-
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
|
|
4451
|
-
});
|
|
4452
|
-
|
|
4453
4453
|
var defaults$1 = defaults;
|
|
4454
4454
|
|
|
4455
4455
|
// RawAxiosHeaders whose duplicates are ignored by node
|
|
4456
4456
|
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
4457
|
-
const ignoreDuplicateOf = utils.toObjectSet([
|
|
4457
|
+
const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
4458
4458
|
'age', 'authorization', 'content-length', 'content-type', 'etag',
|
|
4459
4459
|
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
|
|
4460
4460
|
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
|
|
@@ -4515,7 +4515,7 @@ function normalizeValue(value) {
|
|
|
4515
4515
|
return value;
|
|
4516
4516
|
}
|
|
4517
4517
|
|
|
4518
|
-
return utils.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
4518
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
4519
4519
|
}
|
|
4520
4520
|
|
|
4521
4521
|
function parseTokens(str) {
|
|
@@ -4533,7 +4533,7 @@ function parseTokens(str) {
|
|
|
4533
4533
|
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
4534
4534
|
|
|
4535
4535
|
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
4536
|
-
if (utils.isFunction(filter)) {
|
|
4536
|
+
if (utils$1.isFunction(filter)) {
|
|
4537
4537
|
return filter.call(this, value, header);
|
|
4538
4538
|
}
|
|
4539
4539
|
|
|
@@ -4541,13 +4541,13 @@ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
|
4541
4541
|
value = header;
|
|
4542
4542
|
}
|
|
4543
4543
|
|
|
4544
|
-
if (!utils.isString(value)) return;
|
|
4544
|
+
if (!utils$1.isString(value)) return;
|
|
4545
4545
|
|
|
4546
|
-
if (utils.isString(filter)) {
|
|
4546
|
+
if (utils$1.isString(filter)) {
|
|
4547
4547
|
return value.indexOf(filter) !== -1;
|
|
4548
4548
|
}
|
|
4549
4549
|
|
|
4550
|
-
if (utils.isRegExp(filter)) {
|
|
4550
|
+
if (utils$1.isRegExp(filter)) {
|
|
4551
4551
|
return filter.test(value);
|
|
4552
4552
|
}
|
|
4553
4553
|
}
|
|
@@ -4560,7 +4560,7 @@ function formatHeader(header) {
|
|
|
4560
4560
|
}
|
|
4561
4561
|
|
|
4562
4562
|
function buildAccessors(obj, header) {
|
|
4563
|
-
const accessorName = utils.toCamelCase(' ' + header);
|
|
4563
|
+
const accessorName = utils$1.toCamelCase(' ' + header);
|
|
4564
4564
|
|
|
4565
4565
|
['get', 'set', 'has'].forEach(methodName => {
|
|
4566
4566
|
Object.defineProperty(obj, methodName + accessorName, {
|
|
@@ -4587,7 +4587,7 @@ class AxiosHeaders {
|
|
|
4587
4587
|
throw new Error('header name must be a non-empty string');
|
|
4588
4588
|
}
|
|
4589
4589
|
|
|
4590
|
-
const key = utils.findKey(self, lHeader);
|
|
4590
|
+
const key = utils$1.findKey(self, lHeader);
|
|
4591
4591
|
|
|
4592
4592
|
if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
|
|
4593
4593
|
self[key || _header] = normalizeValue(_value);
|
|
@@ -4595,11 +4595,11 @@ class AxiosHeaders {
|
|
|
4595
4595
|
}
|
|
4596
4596
|
|
|
4597
4597
|
const setHeaders = (headers, _rewrite) =>
|
|
4598
|
-
utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
4598
|
+
utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
4599
4599
|
|
|
4600
|
-
if (utils.isPlainObject(header) || header instanceof this.constructor) {
|
|
4600
|
+
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
|
4601
4601
|
setHeaders(header, valueOrRewrite);
|
|
4602
|
-
} else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
4602
|
+
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
4603
4603
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
4604
4604
|
} else {
|
|
4605
4605
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
@@ -4612,7 +4612,7 @@ class AxiosHeaders {
|
|
|
4612
4612
|
header = normalizeHeader(header);
|
|
4613
4613
|
|
|
4614
4614
|
if (header) {
|
|
4615
|
-
const key = utils.findKey(this, header);
|
|
4615
|
+
const key = utils$1.findKey(this, header);
|
|
4616
4616
|
|
|
4617
4617
|
if (key) {
|
|
4618
4618
|
const value = this[key];
|
|
@@ -4625,11 +4625,11 @@ class AxiosHeaders {
|
|
|
4625
4625
|
return parseTokens(value);
|
|
4626
4626
|
}
|
|
4627
4627
|
|
|
4628
|
-
if (utils.isFunction(parser)) {
|
|
4628
|
+
if (utils$1.isFunction(parser)) {
|
|
4629
4629
|
return parser.call(this, value, key);
|
|
4630
4630
|
}
|
|
4631
4631
|
|
|
4632
|
-
if (utils.isRegExp(parser)) {
|
|
4632
|
+
if (utils$1.isRegExp(parser)) {
|
|
4633
4633
|
return parser.exec(value);
|
|
4634
4634
|
}
|
|
4635
4635
|
|
|
@@ -4642,7 +4642,7 @@ class AxiosHeaders {
|
|
|
4642
4642
|
header = normalizeHeader(header);
|
|
4643
4643
|
|
|
4644
4644
|
if (header) {
|
|
4645
|
-
const key = utils.findKey(this, header);
|
|
4645
|
+
const key = utils$1.findKey(this, header);
|
|
4646
4646
|
|
|
4647
4647
|
return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
4648
4648
|
}
|
|
@@ -4658,7 +4658,7 @@ class AxiosHeaders {
|
|
|
4658
4658
|
_header = normalizeHeader(_header);
|
|
4659
4659
|
|
|
4660
4660
|
if (_header) {
|
|
4661
|
-
const key = utils.findKey(self, _header);
|
|
4661
|
+
const key = utils$1.findKey(self, _header);
|
|
4662
4662
|
|
|
4663
4663
|
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
|
|
4664
4664
|
delete self[key];
|
|
@@ -4668,7 +4668,7 @@ class AxiosHeaders {
|
|
|
4668
4668
|
}
|
|
4669
4669
|
}
|
|
4670
4670
|
|
|
4671
|
-
if (utils.isArray(header)) {
|
|
4671
|
+
if (utils$1.isArray(header)) {
|
|
4672
4672
|
header.forEach(deleteHeader);
|
|
4673
4673
|
} else {
|
|
4674
4674
|
deleteHeader(header);
|
|
@@ -4697,8 +4697,8 @@ class AxiosHeaders {
|
|
|
4697
4697
|
const self = this;
|
|
4698
4698
|
const headers = {};
|
|
4699
4699
|
|
|
4700
|
-
utils.forEach(this, (value, header) => {
|
|
4701
|
-
const key = utils.findKey(headers, header);
|
|
4700
|
+
utils$1.forEach(this, (value, header) => {
|
|
4701
|
+
const key = utils$1.findKey(headers, header);
|
|
4702
4702
|
|
|
4703
4703
|
if (key) {
|
|
4704
4704
|
self[key] = normalizeValue(value);
|
|
@@ -4727,8 +4727,8 @@ class AxiosHeaders {
|
|
|
4727
4727
|
toJSON(asStrings) {
|
|
4728
4728
|
const obj = Object.create(null);
|
|
4729
4729
|
|
|
4730
|
-
utils.forEach(this, (value, header) => {
|
|
4731
|
-
value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
|
|
4730
|
+
utils$1.forEach(this, (value, header) => {
|
|
4731
|
+
value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
|
|
4732
4732
|
});
|
|
4733
4733
|
|
|
4734
4734
|
return obj;
|
|
@@ -4775,7 +4775,7 @@ class AxiosHeaders {
|
|
|
4775
4775
|
}
|
|
4776
4776
|
}
|
|
4777
4777
|
|
|
4778
|
-
utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
4778
|
+
utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
4779
4779
|
|
|
4780
4780
|
return this;
|
|
4781
4781
|
}
|
|
@@ -4783,8 +4783,18 @@ class AxiosHeaders {
|
|
|
4783
4783
|
|
|
4784
4784
|
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
|
|
4785
4785
|
|
|
4786
|
-
|
|
4787
|
-
utils.
|
|
4786
|
+
// reserved names hotfix
|
|
4787
|
+
utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
|
4788
|
+
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
|
4789
|
+
return {
|
|
4790
|
+
get: () => value,
|
|
4791
|
+
set(headerValue) {
|
|
4792
|
+
this[mapped] = headerValue;
|
|
4793
|
+
}
|
|
4794
|
+
}
|
|
4795
|
+
});
|
|
4796
|
+
|
|
4797
|
+
utils$1.freezeMethods(AxiosHeaders);
|
|
4788
4798
|
|
|
4789
4799
|
var AxiosHeaders$1 = AxiosHeaders;
|
|
4790
4800
|
|
|
@@ -4802,7 +4812,7 @@ function transformData(fns, response) {
|
|
|
4802
4812
|
const headers = AxiosHeaders$1.from(context.headers);
|
|
4803
4813
|
let data = context.data;
|
|
4804
4814
|
|
|
4805
|
-
utils.forEach(fns, function transform(fn) {
|
|
4815
|
+
utils$1.forEach(fns, function transform(fn) {
|
|
4806
4816
|
data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
|
|
4807
4817
|
});
|
|
4808
4818
|
|
|
@@ -4830,7 +4840,7 @@ function CanceledError(message, config, request) {
|
|
|
4830
4840
|
this.name = 'CanceledError';
|
|
4831
4841
|
}
|
|
4832
4842
|
|
|
4833
|
-
utils.inherits(CanceledError, AxiosError, {
|
|
4843
|
+
utils$1.inherits(CanceledError, AxiosError, {
|
|
4834
4844
|
__CANCEL__: true
|
|
4835
4845
|
});
|
|
4836
4846
|
|
|
@@ -4858,53 +4868,44 @@ function settle(resolve, reject, response) {
|
|
|
4858
4868
|
}
|
|
4859
4869
|
}
|
|
4860
4870
|
|
|
4861
|
-
var cookies = platform.
|
|
4871
|
+
var cookies = platform.hasStandardBrowserEnv ?
|
|
4862
4872
|
|
|
4863
|
-
// Standard browser envs support document.cookie
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
const cookie = [];
|
|
4868
|
-
cookie.push(name + '=' + encodeURIComponent(value));
|
|
4873
|
+
// Standard browser envs support document.cookie
|
|
4874
|
+
{
|
|
4875
|
+
write(name, value, expires, path, domain, secure) {
|
|
4876
|
+
const cookie = [name + '=' + encodeURIComponent(value)];
|
|
4869
4877
|
|
|
4870
|
-
|
|
4871
|
-
cookie.push('expires=' + new Date(expires).toGMTString());
|
|
4872
|
-
}
|
|
4878
|
+
utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
|
|
4873
4879
|
|
|
4874
|
-
|
|
4875
|
-
cookie.push('path=' + path);
|
|
4876
|
-
}
|
|
4880
|
+
utils$1.isString(path) && cookie.push('path=' + path);
|
|
4877
4881
|
|
|
4878
|
-
|
|
4879
|
-
cookie.push('domain=' + domain);
|
|
4880
|
-
}
|
|
4882
|
+
utils$1.isString(domain) && cookie.push('domain=' + domain);
|
|
4881
4883
|
|
|
4882
|
-
|
|
4883
|
-
cookie.push('secure');
|
|
4884
|
-
}
|
|
4884
|
+
secure === true && cookie.push('secure');
|
|
4885
4885
|
|
|
4886
|
-
|
|
4887
|
-
|
|
4886
|
+
document.cookie = cookie.join('; ');
|
|
4887
|
+
},
|
|
4888
4888
|
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4889
|
+
read(name) {
|
|
4890
|
+
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
|
4891
|
+
return (match ? decodeURIComponent(match[3]) : null);
|
|
4892
|
+
},
|
|
4893
4893
|
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
})() :
|
|
4894
|
+
remove(name) {
|
|
4895
|
+
this.write(name, '', Date.now() - 86400000);
|
|
4896
|
+
}
|
|
4897
|
+
}
|
|
4899
4898
|
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4899
|
+
:
|
|
4900
|
+
|
|
4901
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
4902
|
+
{
|
|
4903
|
+
write() {},
|
|
4904
|
+
read() {
|
|
4905
|
+
return null;
|
|
4906
|
+
},
|
|
4907
|
+
remove() {}
|
|
4908
|
+
};
|
|
4908
4909
|
|
|
4909
4910
|
/**
|
|
4910
4911
|
* Determines whether the specified URL is absolute
|
|
@@ -4930,7 +4931,7 @@ function isAbsoluteURL(url) {
|
|
|
4930
4931
|
*/
|
|
4931
4932
|
function combineURLs(baseURL, relativeURL) {
|
|
4932
4933
|
return relativeURL
|
|
4933
|
-
? baseURL.replace(
|
|
4934
|
+
? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
|
|
4934
4935
|
: baseURL;
|
|
4935
4936
|
}
|
|
4936
4937
|
|
|
@@ -4951,7 +4952,7 @@ function buildFullPath(baseURL, requestedURL) {
|
|
|
4951
4952
|
return requestedURL;
|
|
4952
4953
|
}
|
|
4953
4954
|
|
|
4954
|
-
var isURLSameOrigin = platform.
|
|
4955
|
+
var isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
|
4955
4956
|
|
|
4956
4957
|
// Standard browser envs have full support of the APIs needed to test
|
|
4957
4958
|
// whether the request URL is of the same origin as current location.
|
|
@@ -4961,7 +4962,7 @@ var isURLSameOrigin = platform.isStandardBrowserEnv ?
|
|
|
4961
4962
|
let originURL;
|
|
4962
4963
|
|
|
4963
4964
|
/**
|
|
4964
|
-
* Parse a URL to discover
|
|
4965
|
+
* Parse a URL to discover its components
|
|
4965
4966
|
*
|
|
4966
4967
|
* @param {String} url The URL to be parsed
|
|
4967
4968
|
* @returns {Object}
|
|
@@ -5001,7 +5002,7 @@ var isURLSameOrigin = platform.isStandardBrowserEnv ?
|
|
|
5001
5002
|
* @returns {boolean} True if URL shares the same origin, otherwise false
|
|
5002
5003
|
*/
|
|
5003
5004
|
return function isURLSameOrigin(requestURL) {
|
|
5004
|
-
const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
|
5005
|
+
const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
|
5005
5006
|
return (parsed.protocol === originURL.protocol &&
|
|
5006
5007
|
parsed.host === originURL.host);
|
|
5007
5008
|
};
|
|
@@ -5106,7 +5107,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
5106
5107
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
5107
5108
|
let requestData = config.data;
|
|
5108
5109
|
const requestHeaders = AxiosHeaders$1.from(config.headers).normalize();
|
|
5109
|
-
|
|
5110
|
+
let {responseType, withXSRFToken} = config;
|
|
5110
5111
|
let onCanceled;
|
|
5111
5112
|
function done() {
|
|
5112
5113
|
if (config.cancelToken) {
|
|
@@ -5118,11 +5119,15 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
5118
5119
|
}
|
|
5119
5120
|
}
|
|
5120
5121
|
|
|
5121
|
-
|
|
5122
|
-
|
|
5122
|
+
let contentType;
|
|
5123
|
+
|
|
5124
|
+
if (utils$1.isFormData(requestData)) {
|
|
5125
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
5123
5126
|
requestHeaders.setContentType(false); // Let the browser set it
|
|
5124
|
-
} else {
|
|
5125
|
-
|
|
5127
|
+
} else if ((contentType = requestHeaders.getContentType()) !== false) {
|
|
5128
|
+
// fix semicolon duplication issue for ReactNative FormData implementation
|
|
5129
|
+
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
|
|
5130
|
+
requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
|
5126
5131
|
}
|
|
5127
5132
|
}
|
|
5128
5133
|
|
|
@@ -5238,13 +5243,16 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
5238
5243
|
// Add xsrf header
|
|
5239
5244
|
// This is only done if running in a standard browser environment.
|
|
5240
5245
|
// Specifically not if we're in a web worker, or react-native.
|
|
5241
|
-
if
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5246
|
+
if(platform.hasStandardBrowserEnv) {
|
|
5247
|
+
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
|
|
5248
|
+
|
|
5249
|
+
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
|
|
5250
|
+
// Add xsrf header
|
|
5251
|
+
const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
|
5245
5252
|
|
|
5246
|
-
|
|
5247
|
-
|
|
5253
|
+
if (xsrfValue) {
|
|
5254
|
+
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
|
5255
|
+
}
|
|
5248
5256
|
}
|
|
5249
5257
|
}
|
|
5250
5258
|
|
|
@@ -5253,13 +5261,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
5253
5261
|
|
|
5254
5262
|
// Add headers to the request
|
|
5255
5263
|
if ('setRequestHeader' in request) {
|
|
5256
|
-
utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
5264
|
+
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
5257
5265
|
request.setRequestHeader(key, val);
|
|
5258
5266
|
});
|
|
5259
5267
|
}
|
|
5260
5268
|
|
|
5261
5269
|
// Add withCredentials to request if needed
|
|
5262
|
-
if (!utils.isUndefined(config.withCredentials)) {
|
|
5270
|
+
if (!utils$1.isUndefined(config.withCredentials)) {
|
|
5263
5271
|
request.withCredentials = !!config.withCredentials;
|
|
5264
5272
|
}
|
|
5265
5273
|
|
|
@@ -5314,8 +5322,8 @@ const knownAdapters = {
|
|
|
5314
5322
|
xhr: xhrAdapter
|
|
5315
5323
|
};
|
|
5316
5324
|
|
|
5317
|
-
utils.forEach(knownAdapters, (fn, value) => {
|
|
5318
|
-
if(fn) {
|
|
5325
|
+
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
5326
|
+
if (fn) {
|
|
5319
5327
|
try {
|
|
5320
5328
|
Object.defineProperty(fn, 'name', {value});
|
|
5321
5329
|
} catch (e) {
|
|
@@ -5325,38 +5333,56 @@ utils.forEach(knownAdapters, (fn, value) => {
|
|
|
5325
5333
|
}
|
|
5326
5334
|
});
|
|
5327
5335
|
|
|
5336
|
+
const renderReason = (reason) => `- ${reason}`;
|
|
5337
|
+
|
|
5338
|
+
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
5339
|
+
|
|
5328
5340
|
var adapters = {
|
|
5329
5341
|
getAdapter: (adapters) => {
|
|
5330
|
-
adapters = utils.isArray(adapters) ? adapters : [adapters];
|
|
5342
|
+
adapters = utils$1.isArray(adapters) ? adapters : [adapters];
|
|
5331
5343
|
|
|
5332
5344
|
const {length} = adapters;
|
|
5333
5345
|
let nameOrAdapter;
|
|
5334
5346
|
let adapter;
|
|
5335
5347
|
|
|
5348
|
+
const rejectedReasons = {};
|
|
5349
|
+
|
|
5336
5350
|
for (let i = 0; i < length; i++) {
|
|
5337
5351
|
nameOrAdapter = adapters[i];
|
|
5338
|
-
|
|
5352
|
+
let id;
|
|
5353
|
+
|
|
5354
|
+
adapter = nameOrAdapter;
|
|
5355
|
+
|
|
5356
|
+
if (!isResolvedHandle(nameOrAdapter)) {
|
|
5357
|
+
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
5358
|
+
|
|
5359
|
+
if (adapter === undefined) {
|
|
5360
|
+
throw new AxiosError(`Unknown adapter '${id}'`);
|
|
5361
|
+
}
|
|
5362
|
+
}
|
|
5363
|
+
|
|
5364
|
+
if (adapter) {
|
|
5339
5365
|
break;
|
|
5340
5366
|
}
|
|
5367
|
+
|
|
5368
|
+
rejectedReasons[id || '#' + i] = adapter;
|
|
5341
5369
|
}
|
|
5342
5370
|
|
|
5343
5371
|
if (!adapter) {
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
'
|
|
5372
|
+
|
|
5373
|
+
const reasons = Object.entries(rejectedReasons)
|
|
5374
|
+
.map(([id, state]) => `adapter ${id} ` +
|
|
5375
|
+
(state === false ? 'is not supported by the environment' : 'is not available in the build')
|
|
5348
5376
|
);
|
|
5349
|
-
}
|
|
5350
5377
|
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
`Unknown adapter '${nameOrAdapter}'`
|
|
5355
|
-
);
|
|
5356
|
-
}
|
|
5378
|
+
let s = length ?
|
|
5379
|
+
(reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
|
|
5380
|
+
'as no adapter specified';
|
|
5357
5381
|
|
|
5358
|
-
|
|
5359
|
-
|
|
5382
|
+
throw new AxiosError(
|
|
5383
|
+
`There is no suitable adapter to dispatch the request ` + s,
|
|
5384
|
+
'ERR_NOT_SUPPORT'
|
|
5385
|
+
);
|
|
5360
5386
|
}
|
|
5361
5387
|
|
|
5362
5388
|
return adapter;
|
|
@@ -5454,11 +5480,11 @@ function mergeConfig(config1, config2) {
|
|
|
5454
5480
|
const config = {};
|
|
5455
5481
|
|
|
5456
5482
|
function getMergedValue(target, source, caseless) {
|
|
5457
|
-
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
|
5458
|
-
return utils.merge.call({caseless}, target, source);
|
|
5459
|
-
} else if (utils.isPlainObject(source)) {
|
|
5460
|
-
return utils.merge({}, source);
|
|
5461
|
-
} else if (utils.isArray(source)) {
|
|
5483
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
5484
|
+
return utils$1.merge.call({caseless}, target, source);
|
|
5485
|
+
} else if (utils$1.isPlainObject(source)) {
|
|
5486
|
+
return utils$1.merge({}, source);
|
|
5487
|
+
} else if (utils$1.isArray(source)) {
|
|
5462
5488
|
return source.slice();
|
|
5463
5489
|
}
|
|
5464
5490
|
return source;
|
|
@@ -5466,25 +5492,25 @@ function mergeConfig(config1, config2) {
|
|
|
5466
5492
|
|
|
5467
5493
|
// eslint-disable-next-line consistent-return
|
|
5468
5494
|
function mergeDeepProperties(a, b, caseless) {
|
|
5469
|
-
if (!utils.isUndefined(b)) {
|
|
5495
|
+
if (!utils$1.isUndefined(b)) {
|
|
5470
5496
|
return getMergedValue(a, b, caseless);
|
|
5471
|
-
} else if (!utils.isUndefined(a)) {
|
|
5497
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
5472
5498
|
return getMergedValue(undefined, a, caseless);
|
|
5473
5499
|
}
|
|
5474
5500
|
}
|
|
5475
5501
|
|
|
5476
5502
|
// eslint-disable-next-line consistent-return
|
|
5477
5503
|
function valueFromConfig2(a, b) {
|
|
5478
|
-
if (!utils.isUndefined(b)) {
|
|
5504
|
+
if (!utils$1.isUndefined(b)) {
|
|
5479
5505
|
return getMergedValue(undefined, b);
|
|
5480
5506
|
}
|
|
5481
5507
|
}
|
|
5482
5508
|
|
|
5483
5509
|
// eslint-disable-next-line consistent-return
|
|
5484
5510
|
function defaultToConfig2(a, b) {
|
|
5485
|
-
if (!utils.isUndefined(b)) {
|
|
5511
|
+
if (!utils$1.isUndefined(b)) {
|
|
5486
5512
|
return getMergedValue(undefined, b);
|
|
5487
|
-
} else if (!utils.isUndefined(a)) {
|
|
5513
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
5488
5514
|
return getMergedValue(undefined, a);
|
|
5489
5515
|
}
|
|
5490
5516
|
}
|
|
@@ -5509,6 +5535,7 @@ function mergeConfig(config1, config2) {
|
|
|
5509
5535
|
timeout: defaultToConfig2,
|
|
5510
5536
|
timeoutMessage: defaultToConfig2,
|
|
5511
5537
|
withCredentials: defaultToConfig2,
|
|
5538
|
+
withXSRFToken: defaultToConfig2,
|
|
5512
5539
|
adapter: defaultToConfig2,
|
|
5513
5540
|
responseType: defaultToConfig2,
|
|
5514
5541
|
xsrfCookieName: defaultToConfig2,
|
|
@@ -5529,16 +5556,16 @@ function mergeConfig(config1, config2) {
|
|
|
5529
5556
|
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
|
5530
5557
|
};
|
|
5531
5558
|
|
|
5532
|
-
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
5559
|
+
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
5533
5560
|
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
5534
5561
|
const configValue = merge(config1[prop], config2[prop], prop);
|
|
5535
|
-
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
5562
|
+
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
5536
5563
|
});
|
|
5537
5564
|
|
|
5538
5565
|
return config;
|
|
5539
5566
|
}
|
|
5540
5567
|
|
|
5541
|
-
const VERSION = "1.
|
|
5568
|
+
const VERSION = "1.6.5";
|
|
5542
5569
|
|
|
5543
5570
|
const validators$1 = {};
|
|
5544
5571
|
|
|
@@ -5676,7 +5703,7 @@ class Axios {
|
|
|
5676
5703
|
}
|
|
5677
5704
|
|
|
5678
5705
|
if (paramsSerializer != null) {
|
|
5679
|
-
if (utils.isFunction(paramsSerializer)) {
|
|
5706
|
+
if (utils$1.isFunction(paramsSerializer)) {
|
|
5680
5707
|
config.paramsSerializer = {
|
|
5681
5708
|
serialize: paramsSerializer
|
|
5682
5709
|
};
|
|
@@ -5691,15 +5718,13 @@ class Axios {
|
|
|
5691
5718
|
// Set config.method
|
|
5692
5719
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
|
5693
5720
|
|
|
5694
|
-
let contextHeaders;
|
|
5695
|
-
|
|
5696
5721
|
// Flatten headers
|
|
5697
|
-
contextHeaders = headers && utils.merge(
|
|
5722
|
+
let contextHeaders = headers && utils$1.merge(
|
|
5698
5723
|
headers.common,
|
|
5699
5724
|
headers[config.method]
|
|
5700
5725
|
);
|
|
5701
5726
|
|
|
5702
|
-
|
|
5727
|
+
headers && utils$1.forEach(
|
|
5703
5728
|
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
|
5704
5729
|
(method) => {
|
|
5705
5730
|
delete headers[method];
|
|
@@ -5786,7 +5811,7 @@ class Axios {
|
|
|
5786
5811
|
}
|
|
5787
5812
|
|
|
5788
5813
|
// Provide aliases for supported request methods
|
|
5789
|
-
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
|
5814
|
+
utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
|
5790
5815
|
/*eslint func-names:0*/
|
|
5791
5816
|
Axios.prototype[method] = function(url, config) {
|
|
5792
5817
|
return this.request(mergeConfig(config || {}, {
|
|
@@ -5797,7 +5822,7 @@ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData
|
|
|
5797
5822
|
};
|
|
5798
5823
|
});
|
|
5799
5824
|
|
|
5800
|
-
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
5825
|
+
utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
5801
5826
|
/*eslint func-names:0*/
|
|
5802
5827
|
|
|
5803
5828
|
function generateHTTPMethod(isForm) {
|
|
@@ -5973,7 +5998,7 @@ function spread(callback) {
|
|
|
5973
5998
|
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
|
5974
5999
|
*/
|
|
5975
6000
|
function isAxiosError(payload) {
|
|
5976
|
-
return utils.isObject(payload) && (payload.isAxiosError === true);
|
|
6001
|
+
return utils$1.isObject(payload) && (payload.isAxiosError === true);
|
|
5977
6002
|
}
|
|
5978
6003
|
|
|
5979
6004
|
const HttpStatusCode = {
|
|
@@ -6060,10 +6085,10 @@ function createInstance(defaultConfig) {
|
|
|
6060
6085
|
const instance = bind(Axios$1.prototype.request, context);
|
|
6061
6086
|
|
|
6062
6087
|
// Copy axios.prototype to instance
|
|
6063
|
-
utils.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
|
|
6088
|
+
utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
|
|
6064
6089
|
|
|
6065
6090
|
// Copy context to instance
|
|
6066
|
-
utils.extend(instance, context, null, {allOwnKeys: true});
|
|
6091
|
+
utils$1.extend(instance, context, null, {allOwnKeys: true});
|
|
6067
6092
|
|
|
6068
6093
|
// Factory for creating new instances
|
|
6069
6094
|
instance.create = function create(instanceConfig) {
|
|
@@ -6107,7 +6132,9 @@ axios.mergeConfig = mergeConfig;
|
|
|
6107
6132
|
|
|
6108
6133
|
axios.AxiosHeaders = AxiosHeaders$1;
|
|
6109
6134
|
|
|
6110
|
-
axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
6135
|
+
axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
6136
|
+
|
|
6137
|
+
axios.getAdapter = adapters.getAdapter;
|
|
6111
6138
|
|
|
6112
6139
|
axios.HttpStatusCode = HttpStatusCode$1;
|
|
6113
6140
|
|
|
@@ -8217,7 +8244,7 @@ class PassportConfiguration {
|
|
|
8217
8244
|
this.magicProviderId = 'fSMzaRQ4O7p4fttl7pCyGVtJS_G70P8SNsLXtPPGHo0=';
|
|
8218
8245
|
this.passportDomain = 'https://passport.immutable.com';
|
|
8219
8246
|
this.imxPublicApiDomain = 'https://api.immutable.com';
|
|
8220
|
-
this.zkEvmRpcUrl = '';
|
|
8247
|
+
this.zkEvmRpcUrl = 'https://rpc.immutable.com';
|
|
8221
8248
|
this.relayerUrl = 'https://api.immutable.com/relayer-mr';
|
|
8222
8249
|
this.multiRollupConfig = multiRollupConfig.getProduction();
|
|
8223
8250
|
break;
|