@neurosity/sdk 6.5.9 → 6.5.11
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/browser/neurosity.iife.js +2419 -1009
- package/dist/browser/neurosity.js +180 -148
- package/dist/browser/neurosity.js.map +1 -1
- package/dist/cjs/__tests__/Neurosity.test.d.ts +1 -0
- package/dist/cjs/__tests__/Neurosity.test.js +201 -0
- package/dist/cjs/__tests__/WebBluetoothTransport.test.d.ts +1 -0
- package/dist/cjs/__tests__/WebBluetoothTransport.test.js +201 -0
- package/dist/cjs/__tests__/accelerometer.test.d.ts +1 -0
- package/dist/cjs/__tests__/accelerometer.test.js +158 -0
- package/dist/cjs/__tests__/auth.test.d.ts +1 -0
- package/dist/cjs/__tests__/auth.test.js +239 -0
- package/dist/cjs/__tests__/brainwaves.test.d.ts +1 -0
- package/dist/cjs/__tests__/brainwaves.test.js +291 -0
- package/dist/cjs/__tests__/device.test.d.ts +1 -0
- package/dist/cjs/__tests__/device.test.js +281 -0
- package/dist/cjs/__tests__/haptics.test.d.ts +1 -0
- package/dist/cjs/__tests__/haptics.test.js +162 -0
- package/dist/cjs/__tests__/metrics.test.d.ts +1 -0
- package/dist/cjs/__tests__/metrics.test.js +178 -0
- package/dist/cjs/__tests__/oauth.test.d.ts +1 -0
- package/dist/cjs/__tests__/oauth.test.js +138 -0
- package/dist/cjs/__tests__/settings.test.d.ts +1 -0
- package/dist/cjs/__tests__/settings.test.js +130 -0
- package/dist/cjs/__tests__/setup/webBluetooth.setup.d.ts +11 -0
- package/dist/cjs/__tests__/setup/webBluetooth.setup.js +35 -0
- package/dist/cjs/__tests__/setup.d.ts +0 -0
- package/dist/cjs/__tests__/setup.js +7 -0
- package/dist/cjs/__tests__/streaming.test.d.ts +1 -0
- package/dist/cjs/__tests__/streaming.test.js +259 -0
- package/dist/cjs/__tests__/timesync.test.d.ts +1 -0
- package/dist/cjs/__tests__/timesync.test.js +54 -0
- package/dist/cjs/__tests__/utils.test.d.ts +1 -0
- package/dist/cjs/__tests__/utils.test.js +281 -0
- package/dist/cjs/api/bluetooth/BluetoothClient.d.ts +6 -6
- package/dist/cjs/api/bluetooth/BluetoothTransport.d.ts +1 -1
- package/dist/cjs/api/bluetooth/react-native/ReactNativeTransport.d.ts +4 -4
- package/dist/cjs/api/bluetooth/react-native/types/ReactNativeTypes.d.ts +2 -2
- package/dist/cjs/api/bluetooth/types/index.d.ts +2 -2
- package/dist/cjs/api/bluetooth/utils/decodeJSONChunks.d.ts +1 -1
- package/dist/cjs/api/bluetooth/utils/stitch.d.ts +1 -1
- package/dist/cjs/api/bluetooth/utils/textCodec.d.ts +1 -1
- package/dist/cjs/api/bluetooth/web/WebBluetoothTransport.d.ts +1 -1
- package/dist/cjs/api/firebase/FirebaseDevice.d.ts +1 -1
- package/dist/cjs/api/firebase/FirebaseUser.d.ts +1 -1
- package/dist/cjs/api/index.js +1 -1
- package/dist/cjs/timesync/Timesync.d.ts +1 -1
- package/dist/cjs/types/awareness.d.ts +1 -1
- package/dist/cjs/types/brainwaves.d.ts +25 -12
- package/dist/cjs/types/credentials.d.ts +4 -4
- package/dist/cjs/types/deviceInfo.d.ts +4 -4
- package/dist/cjs/types/epoch.d.ts +1 -1
- package/dist/cjs/types/experiment.d.ts +1 -1
- package/dist/cjs/types/hapticEffects.d.ts +1 -1
- package/dist/cjs/types/marker.d.ts +1 -1
- package/dist/cjs/types/metrics.d.ts +2 -2
- package/dist/cjs/types/oauth.d.ts +4 -4
- package/dist/cjs/types/sample.d.ts +2 -2
- package/dist/cjs/types/signalQuality.d.ts +1 -1
- package/dist/cjs/types/skill.d.ts +2 -2
- package/dist/cjs/types/user.d.ts +3 -3
- package/dist/cjs/utils/oauth.d.ts +1 -1
- package/dist/cjs/utils/transferDevice.d.ts +3 -3
- package/dist/cjs/utils/whileOnline.d.ts +1 -1
- package/dist/electron/index.js +1 -1
- package/dist/electron/index.js.map +1 -1
- package/dist/esm/__tests__/Neurosity.test.d.ts +1 -0
- package/dist/esm/__tests__/Neurosity.test.js +199 -0
- package/dist/esm/__tests__/WebBluetoothTransport.test.d.ts +1 -0
- package/dist/esm/__tests__/WebBluetoothTransport.test.js +199 -0
- package/dist/esm/__tests__/accelerometer.test.d.ts +1 -0
- package/dist/esm/__tests__/accelerometer.test.js +156 -0
- package/dist/esm/__tests__/auth.test.d.ts +1 -0
- package/dist/esm/__tests__/auth.test.js +237 -0
- package/dist/esm/__tests__/brainwaves.test.d.ts +1 -0
- package/dist/esm/__tests__/brainwaves.test.js +289 -0
- package/dist/esm/__tests__/device.test.d.ts +1 -0
- package/dist/esm/__tests__/device.test.js +279 -0
- package/dist/esm/__tests__/haptics.test.d.ts +1 -0
- package/dist/esm/__tests__/haptics.test.js +160 -0
- package/dist/esm/__tests__/metrics.test.d.ts +1 -0
- package/dist/esm/__tests__/metrics.test.js +176 -0
- package/dist/esm/__tests__/oauth.test.d.ts +1 -0
- package/dist/esm/__tests__/oauth.test.js +133 -0
- package/dist/esm/__tests__/settings.test.d.ts +1 -0
- package/dist/esm/__tests__/settings.test.js +128 -0
- package/dist/esm/__tests__/setup/webBluetooth.setup.d.ts +11 -0
- package/dist/esm/__tests__/setup/webBluetooth.setup.js +35 -0
- package/dist/esm/__tests__/setup.d.ts +0 -0
- package/dist/esm/__tests__/setup.js +7 -0
- package/dist/esm/__tests__/streaming.test.d.ts +1 -0
- package/dist/esm/__tests__/streaming.test.js +257 -0
- package/dist/esm/__tests__/timesync.test.d.ts +1 -0
- package/dist/esm/__tests__/timesync.test.js +52 -0
- package/dist/esm/__tests__/utils.test.d.ts +1 -0
- package/dist/esm/__tests__/utils.test.js +279 -0
- package/dist/esm/api/bluetooth/BluetoothClient.d.ts +6 -6
- package/dist/esm/api/bluetooth/BluetoothTransport.d.ts +1 -1
- package/dist/esm/api/bluetooth/react-native/ReactNativeTransport.d.ts +4 -4
- package/dist/esm/api/bluetooth/react-native/types/ReactNativeTypes.d.ts +2 -2
- package/dist/esm/api/bluetooth/types/index.d.ts +2 -2
- package/dist/esm/api/bluetooth/utils/decodeJSONChunks.d.ts +1 -1
- package/dist/esm/api/bluetooth/utils/stitch.d.ts +1 -1
- package/dist/esm/api/bluetooth/utils/textCodec.d.ts +1 -1
- package/dist/esm/api/bluetooth/web/WebBluetoothTransport.d.ts +1 -1
- package/dist/esm/api/firebase/FirebaseDevice.d.ts +1 -1
- package/dist/esm/api/firebase/FirebaseUser.d.ts +1 -1
- package/dist/esm/api/index.js +2 -2
- package/dist/esm/neurosity.mjs +2480 -1007
- package/dist/esm/timesync/Timesync.d.ts +1 -1
- package/dist/esm/types/awareness.d.ts +1 -1
- package/dist/esm/types/brainwaves.d.ts +25 -12
- package/dist/esm/types/credentials.d.ts +4 -4
- package/dist/esm/types/deviceInfo.d.ts +4 -4
- package/dist/esm/types/epoch.d.ts +1 -1
- package/dist/esm/types/experiment.d.ts +1 -1
- package/dist/esm/types/hapticEffects.d.ts +1 -1
- package/dist/esm/types/marker.d.ts +1 -1
- package/dist/esm/types/metrics.d.ts +2 -2
- package/dist/esm/types/oauth.d.ts +4 -4
- package/dist/esm/types/sample.d.ts +2 -2
- package/dist/esm/types/signalQuality.d.ts +1 -1
- package/dist/esm/types/skill.d.ts +2 -2
- package/dist/esm/types/user.d.ts +3 -3
- package/dist/esm/utils/oauth.d.ts +1 -1
- package/dist/esm/utils/transferDevice.d.ts +3 -3
- package/dist/esm/utils/whileOnline.d.ts +1 -1
- package/dist/examples/neurosity.iife.js +2419 -1009
- package/dist/examples/neurosity.js +180 -148
- package/dist/examples/neurosity.mjs +2480 -1007
- package/package.json +17 -5
|
@@ -42871,7 +42871,7 @@ var Neurosity = (function (exports) {
|
|
|
42871
42871
|
this.firebaseApp = new FirebaseApp(options);
|
|
42872
42872
|
this.firebaseUser = new FirebaseUser(this.firebaseApp);
|
|
42873
42873
|
this._selectedDevice.next(undefined);
|
|
42874
|
-
this.status$ = heartbeatAwareStatus(this.observeNamespace("status").pipe(
|
|
42874
|
+
this.status$ = heartbeatAwareStatus(this.observeNamespace("status").pipe(shareReplay(1))).pipe(filterInternalKeys(), shareReplay(1));
|
|
42875
42875
|
this.osVersion$ = this.observeNamespace("info/osVersion").pipe(shareReplay(1));
|
|
42876
42876
|
this.firebaseUser.onAuthStateChanged().subscribe((user) => {
|
|
42877
42877
|
this.user = user;
|
|
@@ -43689,79 +43689,78 @@ var Neurosity = (function (exports) {
|
|
|
43689
43689
|
return new Error(`${prefix}You are trying to access data with an OAuth token without access to the following scopes: ${requiredScopes.join(", ")}.`);
|
|
43690
43690
|
}
|
|
43691
43691
|
|
|
43692
|
-
|
|
43692
|
+
function bind$1(fn, thisArg) {
|
|
43693
43693
|
return function wrap() {
|
|
43694
|
-
|
|
43695
|
-
for (var i = 0; i < args.length; i++) {
|
|
43696
|
-
args[i] = arguments[i];
|
|
43697
|
-
}
|
|
43698
|
-
return fn.apply(thisArg, args);
|
|
43694
|
+
return fn.apply(thisArg, arguments);
|
|
43699
43695
|
};
|
|
43700
|
-
}
|
|
43696
|
+
}
|
|
43701
43697
|
|
|
43702
43698
|
// utils is a library of generic helper functions non-specific to axios
|
|
43703
43699
|
|
|
43704
|
-
|
|
43700
|
+
const {toString} = Object.prototype;
|
|
43701
|
+
const {getPrototypeOf: getPrototypeOf$1} = Object;
|
|
43702
|
+
|
|
43703
|
+
const kindOf = (cache => thing => {
|
|
43704
|
+
const str = toString.call(thing);
|
|
43705
|
+
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
43706
|
+
})(Object.create(null));
|
|
43707
|
+
|
|
43708
|
+
const kindOfTest = (type) => {
|
|
43709
|
+
type = type.toLowerCase();
|
|
43710
|
+
return (thing) => kindOf(thing) === type
|
|
43711
|
+
};
|
|
43712
|
+
|
|
43713
|
+
const typeOfTest = type => thing => typeof thing === type;
|
|
43705
43714
|
|
|
43706
43715
|
/**
|
|
43707
43716
|
* Determine if a value is an Array
|
|
43708
43717
|
*
|
|
43709
43718
|
* @param {Object} val The value to test
|
|
43719
|
+
*
|
|
43710
43720
|
* @returns {boolean} True if value is an Array, otherwise false
|
|
43711
43721
|
*/
|
|
43712
|
-
|
|
43713
|
-
return Array.isArray(val);
|
|
43714
|
-
}
|
|
43722
|
+
const {isArray: isArray$4} = Array;
|
|
43715
43723
|
|
|
43716
43724
|
/**
|
|
43717
43725
|
* Determine if a value is undefined
|
|
43718
43726
|
*
|
|
43719
|
-
* @param {
|
|
43727
|
+
* @param {*} val The value to test
|
|
43728
|
+
*
|
|
43720
43729
|
* @returns {boolean} True if the value is undefined, otherwise false
|
|
43721
43730
|
*/
|
|
43722
|
-
|
|
43723
|
-
return typeof val === 'undefined';
|
|
43724
|
-
}
|
|
43731
|
+
const isUndefined = typeOfTest('undefined');
|
|
43725
43732
|
|
|
43726
43733
|
/**
|
|
43727
43734
|
* Determine if a value is a Buffer
|
|
43728
43735
|
*
|
|
43729
|
-
* @param {
|
|
43736
|
+
* @param {*} val The value to test
|
|
43737
|
+
*
|
|
43730
43738
|
* @returns {boolean} True if value is a Buffer, otherwise false
|
|
43731
43739
|
*/
|
|
43732
43740
|
function isBuffer(val) {
|
|
43733
43741
|
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
|
|
43734
|
-
&&
|
|
43742
|
+
&& isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
43735
43743
|
}
|
|
43736
43744
|
|
|
43737
43745
|
/**
|
|
43738
43746
|
* Determine if a value is an ArrayBuffer
|
|
43739
43747
|
*
|
|
43740
|
-
* @param {
|
|
43748
|
+
* @param {*} val The value to test
|
|
43749
|
+
*
|
|
43741
43750
|
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
|
|
43742
43751
|
*/
|
|
43743
|
-
|
|
43744
|
-
return toString.call(val) === '[object ArrayBuffer]';
|
|
43745
|
-
}
|
|
43752
|
+
const isArrayBuffer = kindOfTest('ArrayBuffer');
|
|
43746
43753
|
|
|
43747
|
-
/**
|
|
43748
|
-
* Determine if a value is a FormData
|
|
43749
|
-
*
|
|
43750
|
-
* @param {Object} val The value to test
|
|
43751
|
-
* @returns {boolean} True if value is an FormData, otherwise false
|
|
43752
|
-
*/
|
|
43753
|
-
function isFormData(val) {
|
|
43754
|
-
return toString.call(val) === '[object FormData]';
|
|
43755
|
-
}
|
|
43756
43754
|
|
|
43757
43755
|
/**
|
|
43758
43756
|
* Determine if a value is a view on an ArrayBuffer
|
|
43759
43757
|
*
|
|
43760
|
-
* @param {
|
|
43758
|
+
* @param {*} val The value to test
|
|
43759
|
+
*
|
|
43761
43760
|
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
|
|
43762
43761
|
*/
|
|
43763
43762
|
function isArrayBufferView(val) {
|
|
43764
|
-
|
|
43763
|
+
let result;
|
|
43765
43764
|
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
|
|
43766
43765
|
result = ArrayBuffer.isView(val);
|
|
43767
43766
|
} else {
|
|
@@ -43773,144 +43772,145 @@ var Neurosity = (function (exports) {
|
|
|
43773
43772
|
/**
|
|
43774
43773
|
* Determine if a value is a String
|
|
43775
43774
|
*
|
|
43776
|
-
* @param {
|
|
43775
|
+
* @param {*} val The value to test
|
|
43776
|
+
*
|
|
43777
43777
|
* @returns {boolean} True if value is a String, otherwise false
|
|
43778
43778
|
*/
|
|
43779
|
-
|
|
43780
|
-
|
|
43781
|
-
|
|
43779
|
+
const isString = typeOfTest('string');
|
|
43780
|
+
|
|
43781
|
+
/**
|
|
43782
|
+
* Determine if a value is a Function
|
|
43783
|
+
*
|
|
43784
|
+
* @param {*} val The value to test
|
|
43785
|
+
* @returns {boolean} True if value is a Function, otherwise false
|
|
43786
|
+
*/
|
|
43787
|
+
const isFunction$1 = typeOfTest('function');
|
|
43782
43788
|
|
|
43783
43789
|
/**
|
|
43784
43790
|
* Determine if a value is a Number
|
|
43785
43791
|
*
|
|
43786
|
-
* @param {
|
|
43792
|
+
* @param {*} val The value to test
|
|
43793
|
+
*
|
|
43787
43794
|
* @returns {boolean} True if value is a Number, otherwise false
|
|
43788
43795
|
*/
|
|
43789
|
-
|
|
43790
|
-
return typeof val === 'number';
|
|
43791
|
-
}
|
|
43796
|
+
const isNumber = typeOfTest('number');
|
|
43792
43797
|
|
|
43793
43798
|
/**
|
|
43794
43799
|
* Determine if a value is an Object
|
|
43795
43800
|
*
|
|
43796
|
-
* @param {
|
|
43801
|
+
* @param {*} thing The value to test
|
|
43802
|
+
*
|
|
43797
43803
|
* @returns {boolean} True if value is an Object, otherwise false
|
|
43798
43804
|
*/
|
|
43799
|
-
|
|
43800
|
-
|
|
43801
|
-
|
|
43805
|
+
const isObject$1 = (thing) => thing !== null && typeof thing === 'object';
|
|
43806
|
+
|
|
43807
|
+
/**
|
|
43808
|
+
* Determine if a value is a Boolean
|
|
43809
|
+
*
|
|
43810
|
+
* @param {*} thing The value to test
|
|
43811
|
+
* @returns {boolean} True if value is a Boolean, otherwise false
|
|
43812
|
+
*/
|
|
43813
|
+
const isBoolean = thing => thing === true || thing === false;
|
|
43802
43814
|
|
|
43803
43815
|
/**
|
|
43804
43816
|
* Determine if a value is a plain Object
|
|
43805
43817
|
*
|
|
43806
|
-
* @param {
|
|
43807
|
-
*
|
|
43818
|
+
* @param {*} val The value to test
|
|
43819
|
+
*
|
|
43820
|
+
* @returns {boolean} True if value is a plain Object, otherwise false
|
|
43808
43821
|
*/
|
|
43809
|
-
|
|
43810
|
-
if (
|
|
43822
|
+
const isPlainObject = (val) => {
|
|
43823
|
+
if (kindOf(val) !== 'object') {
|
|
43811
43824
|
return false;
|
|
43812
43825
|
}
|
|
43813
43826
|
|
|
43814
|
-
|
|
43815
|
-
return prototype === null || prototype === Object.prototype;
|
|
43816
|
-
}
|
|
43827
|
+
const prototype = getPrototypeOf$1(val);
|
|
43828
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
|
|
43829
|
+
};
|
|
43817
43830
|
|
|
43818
43831
|
/**
|
|
43819
43832
|
* Determine if a value is a Date
|
|
43820
43833
|
*
|
|
43821
|
-
* @param {
|
|
43834
|
+
* @param {*} val The value to test
|
|
43835
|
+
*
|
|
43822
43836
|
* @returns {boolean} True if value is a Date, otherwise false
|
|
43823
43837
|
*/
|
|
43824
|
-
|
|
43825
|
-
return toString.call(val) === '[object Date]';
|
|
43826
|
-
}
|
|
43838
|
+
const isDate = kindOfTest('Date');
|
|
43827
43839
|
|
|
43828
43840
|
/**
|
|
43829
43841
|
* Determine if a value is a File
|
|
43830
43842
|
*
|
|
43831
|
-
* @param {
|
|
43843
|
+
* @param {*} val The value to test
|
|
43844
|
+
*
|
|
43832
43845
|
* @returns {boolean} True if value is a File, otherwise false
|
|
43833
43846
|
*/
|
|
43834
|
-
|
|
43835
|
-
return toString.call(val) === '[object File]';
|
|
43836
|
-
}
|
|
43847
|
+
const isFile = kindOfTest('File');
|
|
43837
43848
|
|
|
43838
43849
|
/**
|
|
43839
43850
|
* Determine if a value is a Blob
|
|
43840
43851
|
*
|
|
43841
|
-
* @param {
|
|
43852
|
+
* @param {*} val The value to test
|
|
43853
|
+
*
|
|
43842
43854
|
* @returns {boolean} True if value is a Blob, otherwise false
|
|
43843
43855
|
*/
|
|
43844
|
-
|
|
43845
|
-
return toString.call(val) === '[object Blob]';
|
|
43846
|
-
}
|
|
43856
|
+
const isBlob = kindOfTest('Blob');
|
|
43847
43857
|
|
|
43848
43858
|
/**
|
|
43849
|
-
* Determine if a value is a
|
|
43859
|
+
* Determine if a value is a FileList
|
|
43850
43860
|
*
|
|
43851
|
-
* @param {
|
|
43852
|
-
*
|
|
43861
|
+
* @param {*} val The value to test
|
|
43862
|
+
*
|
|
43863
|
+
* @returns {boolean} True if value is a File, otherwise false
|
|
43853
43864
|
*/
|
|
43854
|
-
|
|
43855
|
-
return toString.call(val) === '[object Function]';
|
|
43856
|
-
}
|
|
43865
|
+
const isFileList = kindOfTest('FileList');
|
|
43857
43866
|
|
|
43858
43867
|
/**
|
|
43859
43868
|
* Determine if a value is a Stream
|
|
43860
43869
|
*
|
|
43861
|
-
* @param {
|
|
43870
|
+
* @param {*} val The value to test
|
|
43871
|
+
*
|
|
43862
43872
|
* @returns {boolean} True if value is a Stream, otherwise false
|
|
43863
43873
|
*/
|
|
43864
|
-
|
|
43865
|
-
return isObject$1(val) && isFunction$1(val.pipe);
|
|
43866
|
-
}
|
|
43874
|
+
const isStream = (val) => isObject$1(val) && isFunction$1(val.pipe);
|
|
43867
43875
|
|
|
43868
43876
|
/**
|
|
43869
|
-
* Determine if a value is a
|
|
43877
|
+
* Determine if a value is a FormData
|
|
43870
43878
|
*
|
|
43871
|
-
* @param {
|
|
43872
|
-
*
|
|
43879
|
+
* @param {*} thing The value to test
|
|
43880
|
+
*
|
|
43881
|
+
* @returns {boolean} True if value is an FormData, otherwise false
|
|
43873
43882
|
*/
|
|
43874
|
-
|
|
43875
|
-
|
|
43876
|
-
|
|
43883
|
+
const isFormData = (thing) => {
|
|
43884
|
+
let kind;
|
|
43885
|
+
return thing && (
|
|
43886
|
+
(typeof FormData === 'function' && thing instanceof FormData) || (
|
|
43887
|
+
isFunction$1(thing.append) && (
|
|
43888
|
+
(kind = kindOf(thing)) === 'formdata' ||
|
|
43889
|
+
// detect form-data instance
|
|
43890
|
+
(kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
|
|
43891
|
+
)
|
|
43892
|
+
)
|
|
43893
|
+
)
|
|
43894
|
+
};
|
|
43877
43895
|
|
|
43878
43896
|
/**
|
|
43879
|
-
*
|
|
43897
|
+
* Determine if a value is a URLSearchParams object
|
|
43880
43898
|
*
|
|
43881
|
-
* @param {
|
|
43882
|
-
*
|
|
43899
|
+
* @param {*} val The value to test
|
|
43900
|
+
*
|
|
43901
|
+
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
|
43883
43902
|
*/
|
|
43884
|
-
|
|
43885
|
-
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
|
|
43886
|
-
}
|
|
43903
|
+
const isURLSearchParams = kindOfTest('URLSearchParams');
|
|
43887
43904
|
|
|
43888
43905
|
/**
|
|
43889
|
-
*
|
|
43890
|
-
*
|
|
43891
|
-
* This allows axios to run in a web worker, and react-native.
|
|
43892
|
-
* Both environments support XMLHttpRequest, but not fully standard globals.
|
|
43906
|
+
* Trim excess whitespace off the beginning and end of a string
|
|
43893
43907
|
*
|
|
43894
|
-
*
|
|
43895
|
-
* typeof window -> undefined
|
|
43896
|
-
* typeof document -> undefined
|
|
43908
|
+
* @param {String} str The String to trim
|
|
43897
43909
|
*
|
|
43898
|
-
*
|
|
43899
|
-
* navigator.product -> 'ReactNative'
|
|
43900
|
-
* nativescript
|
|
43901
|
-
* navigator.product -> 'NativeScript' or 'NS'
|
|
43910
|
+
* @returns {String} The String freed of excess whitespace
|
|
43902
43911
|
*/
|
|
43903
|
-
|
|
43904
|
-
|
|
43905
|
-
navigator.product === 'NativeScript' ||
|
|
43906
|
-
navigator.product === 'NS')) {
|
|
43907
|
-
return false;
|
|
43908
|
-
}
|
|
43909
|
-
return (
|
|
43910
|
-
typeof window !== 'undefined' &&
|
|
43911
|
-
typeof document !== 'undefined'
|
|
43912
|
-
);
|
|
43913
|
-
}
|
|
43912
|
+
const trim = (str) => str.trim ?
|
|
43913
|
+
str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
|
|
43914
43914
|
|
|
43915
43915
|
/**
|
|
43916
43916
|
* Iterate over an Array or an Object invoking a function for each item.
|
|
@@ -43923,13 +43923,19 @@ var Neurosity = (function (exports) {
|
|
|
43923
43923
|
*
|
|
43924
43924
|
* @param {Object|Array} obj The object to iterate
|
|
43925
43925
|
* @param {Function} fn The callback to invoke for each item
|
|
43926
|
+
*
|
|
43927
|
+
* @param {Boolean} [allOwnKeys = false]
|
|
43928
|
+
* @returns {any}
|
|
43926
43929
|
*/
|
|
43927
|
-
function forEach(obj, fn) {
|
|
43930
|
+
function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
43928
43931
|
// Don't bother if no value provided
|
|
43929
43932
|
if (obj === null || typeof obj === 'undefined') {
|
|
43930
43933
|
return;
|
|
43931
43934
|
}
|
|
43932
43935
|
|
|
43936
|
+
let i;
|
|
43937
|
+
let l;
|
|
43938
|
+
|
|
43933
43939
|
// Force an array if not already something iterable
|
|
43934
43940
|
if (typeof obj !== 'object') {
|
|
43935
43941
|
/*eslint no-param-reassign:0*/
|
|
@@ -43938,19 +43944,44 @@ var Neurosity = (function (exports) {
|
|
|
43938
43944
|
|
|
43939
43945
|
if (isArray$4(obj)) {
|
|
43940
43946
|
// Iterate over array values
|
|
43941
|
-
for (
|
|
43947
|
+
for (i = 0, l = obj.length; i < l; i++) {
|
|
43942
43948
|
fn.call(null, obj[i], i, obj);
|
|
43943
43949
|
}
|
|
43944
43950
|
} else {
|
|
43945
43951
|
// Iterate over object keys
|
|
43946
|
-
|
|
43947
|
-
|
|
43948
|
-
|
|
43949
|
-
|
|
43952
|
+
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
43953
|
+
const len = keys.length;
|
|
43954
|
+
let key;
|
|
43955
|
+
|
|
43956
|
+
for (i = 0; i < len; i++) {
|
|
43957
|
+
key = keys[i];
|
|
43958
|
+
fn.call(null, obj[key], key, obj);
|
|
43959
|
+
}
|
|
43960
|
+
}
|
|
43961
|
+
}
|
|
43962
|
+
|
|
43963
|
+
function findKey(obj, key) {
|
|
43964
|
+
key = key.toLowerCase();
|
|
43965
|
+
const keys = Object.keys(obj);
|
|
43966
|
+
let i = keys.length;
|
|
43967
|
+
let _key;
|
|
43968
|
+
while (i-- > 0) {
|
|
43969
|
+
_key = keys[i];
|
|
43970
|
+
if (key === _key.toLowerCase()) {
|
|
43971
|
+
return _key;
|
|
43950
43972
|
}
|
|
43951
43973
|
}
|
|
43974
|
+
return null;
|
|
43952
43975
|
}
|
|
43953
43976
|
|
|
43977
|
+
const _global = (() => {
|
|
43978
|
+
/*eslint no-undef:0*/
|
|
43979
|
+
if (typeof globalThis !== "undefined") return globalThis;
|
|
43980
|
+
return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
|
|
43981
|
+
})();
|
|
43982
|
+
|
|
43983
|
+
const isContextDefined = (context) => !isUndefined(context) && context !== _global;
|
|
43984
|
+
|
|
43954
43985
|
/**
|
|
43955
43986
|
* Accepts varargs expecting each argument to be an object, then
|
|
43956
43987
|
* immutably merges the properties of each object and returns result.
|
|
@@ -43966,24 +43997,27 @@ var Neurosity = (function (exports) {
|
|
|
43966
43997
|
* ```
|
|
43967
43998
|
*
|
|
43968
43999
|
* @param {Object} obj1 Object to merge
|
|
44000
|
+
*
|
|
43969
44001
|
* @returns {Object} Result of all merge properties
|
|
43970
44002
|
*/
|
|
43971
44003
|
function merge$2(/* obj1, obj2, obj3, ... */) {
|
|
43972
|
-
|
|
43973
|
-
|
|
43974
|
-
|
|
43975
|
-
|
|
44004
|
+
const {caseless} = isContextDefined(this) && this || {};
|
|
44005
|
+
const result = {};
|
|
44006
|
+
const assignValue = (val, key) => {
|
|
44007
|
+
const targetKey = caseless && findKey(result, key) || key;
|
|
44008
|
+
if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
|
|
44009
|
+
result[targetKey] = merge$2(result[targetKey], val);
|
|
43976
44010
|
} else if (isPlainObject(val)) {
|
|
43977
|
-
result[
|
|
44011
|
+
result[targetKey] = merge$2({}, val);
|
|
43978
44012
|
} else if (isArray$4(val)) {
|
|
43979
|
-
result[
|
|
44013
|
+
result[targetKey] = val.slice();
|
|
43980
44014
|
} else {
|
|
43981
|
-
result[
|
|
44015
|
+
result[targetKey] = val;
|
|
43982
44016
|
}
|
|
43983
|
-
}
|
|
44017
|
+
};
|
|
43984
44018
|
|
|
43985
|
-
for (
|
|
43986
|
-
forEach(arguments[i], assignValue);
|
|
44019
|
+
for (let i = 0, l = arguments.length; i < l; i++) {
|
|
44020
|
+
arguments[i] && forEach(arguments[i], assignValue);
|
|
43987
44021
|
}
|
|
43988
44022
|
return result;
|
|
43989
44023
|
}
|
|
@@ -43994,240 +44028,1588 @@ var Neurosity = (function (exports) {
|
|
|
43994
44028
|
* @param {Object} a The object to be extended
|
|
43995
44029
|
* @param {Object} b The object to copy properties from
|
|
43996
44030
|
* @param {Object} thisArg The object to bind function to
|
|
43997
|
-
*
|
|
44031
|
+
*
|
|
44032
|
+
* @param {Boolean} [allOwnKeys]
|
|
44033
|
+
* @returns {Object} The resulting value of object a
|
|
43998
44034
|
*/
|
|
43999
|
-
|
|
44000
|
-
forEach(b,
|
|
44001
|
-
if (thisArg &&
|
|
44035
|
+
const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
|
|
44036
|
+
forEach(b, (val, key) => {
|
|
44037
|
+
if (thisArg && isFunction$1(val)) {
|
|
44002
44038
|
a[key] = bind$1(val, thisArg);
|
|
44003
44039
|
} else {
|
|
44004
44040
|
a[key] = val;
|
|
44005
44041
|
}
|
|
44006
|
-
});
|
|
44042
|
+
}, {allOwnKeys});
|
|
44007
44043
|
return a;
|
|
44008
|
-
}
|
|
44044
|
+
};
|
|
44009
44045
|
|
|
44010
44046
|
/**
|
|
44011
44047
|
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
|
|
44012
44048
|
*
|
|
44013
44049
|
* @param {string} content with BOM
|
|
44014
|
-
*
|
|
44050
|
+
*
|
|
44051
|
+
* @returns {string} content value without BOM
|
|
44015
44052
|
*/
|
|
44016
|
-
|
|
44053
|
+
const stripBOM = (content) => {
|
|
44017
44054
|
if (content.charCodeAt(0) === 0xFEFF) {
|
|
44018
44055
|
content = content.slice(1);
|
|
44019
44056
|
}
|
|
44020
44057
|
return content;
|
|
44021
|
-
}
|
|
44058
|
+
};
|
|
44022
44059
|
|
|
44023
|
-
|
|
44024
|
-
|
|
44025
|
-
|
|
44026
|
-
|
|
44027
|
-
|
|
44028
|
-
|
|
44029
|
-
|
|
44030
|
-
|
|
44031
|
-
|
|
44032
|
-
|
|
44033
|
-
|
|
44034
|
-
|
|
44035
|
-
|
|
44036
|
-
|
|
44037
|
-
|
|
44038
|
-
|
|
44039
|
-
isURLSearchParams: isURLSearchParams,
|
|
44040
|
-
isStandardBrowserEnv: isStandardBrowserEnv,
|
|
44041
|
-
forEach: forEach,
|
|
44042
|
-
merge: merge$2,
|
|
44043
|
-
extend: extend,
|
|
44044
|
-
trim: trim,
|
|
44045
|
-
stripBOM: stripBOM
|
|
44060
|
+
/**
|
|
44061
|
+
* Inherit the prototype methods from one constructor into another
|
|
44062
|
+
* @param {function} constructor
|
|
44063
|
+
* @param {function} superConstructor
|
|
44064
|
+
* @param {object} [props]
|
|
44065
|
+
* @param {object} [descriptors]
|
|
44066
|
+
*
|
|
44067
|
+
* @returns {void}
|
|
44068
|
+
*/
|
|
44069
|
+
const inherits = (constructor, superConstructor, props, descriptors) => {
|
|
44070
|
+
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
|
|
44071
|
+
constructor.prototype.constructor = constructor;
|
|
44072
|
+
Object.defineProperty(constructor, 'super', {
|
|
44073
|
+
value: superConstructor.prototype
|
|
44074
|
+
});
|
|
44075
|
+
props && Object.assign(constructor.prototype, props);
|
|
44046
44076
|
};
|
|
44047
44077
|
|
|
44048
|
-
|
|
44049
|
-
|
|
44050
|
-
|
|
44051
|
-
|
|
44052
|
-
|
|
44053
|
-
|
|
44054
|
-
|
|
44055
|
-
|
|
44056
|
-
|
|
44078
|
+
/**
|
|
44079
|
+
* Resolve object with deep prototype chain to a flat object
|
|
44080
|
+
* @param {Object} sourceObj source object
|
|
44081
|
+
* @param {Object} [destObj]
|
|
44082
|
+
* @param {Function|Boolean} [filter]
|
|
44083
|
+
* @param {Function} [propFilter]
|
|
44084
|
+
*
|
|
44085
|
+
* @returns {Object}
|
|
44086
|
+
*/
|
|
44087
|
+
const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
|
|
44088
|
+
let props;
|
|
44089
|
+
let i;
|
|
44090
|
+
let prop;
|
|
44091
|
+
const merged = {};
|
|
44092
|
+
|
|
44093
|
+
destObj = destObj || {};
|
|
44094
|
+
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
44095
|
+
if (sourceObj == null) return destObj;
|
|
44096
|
+
|
|
44097
|
+
do {
|
|
44098
|
+
props = Object.getOwnPropertyNames(sourceObj);
|
|
44099
|
+
i = props.length;
|
|
44100
|
+
while (i-- > 0) {
|
|
44101
|
+
prop = props[i];
|
|
44102
|
+
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
|
|
44103
|
+
destObj[prop] = sourceObj[prop];
|
|
44104
|
+
merged[prop] = true;
|
|
44105
|
+
}
|
|
44106
|
+
}
|
|
44107
|
+
sourceObj = filter !== false && getPrototypeOf$1(sourceObj);
|
|
44108
|
+
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
44109
|
+
|
|
44110
|
+
return destObj;
|
|
44111
|
+
};
|
|
44057
44112
|
|
|
44058
44113
|
/**
|
|
44059
|
-
*
|
|
44114
|
+
* Determines whether a string ends with the characters of a specified string
|
|
44060
44115
|
*
|
|
44061
|
-
* @param {
|
|
44062
|
-
* @param {
|
|
44063
|
-
* @
|
|
44116
|
+
* @param {String} str
|
|
44117
|
+
* @param {String} searchString
|
|
44118
|
+
* @param {Number} [position= 0]
|
|
44119
|
+
*
|
|
44120
|
+
* @returns {boolean}
|
|
44064
44121
|
*/
|
|
44065
|
-
|
|
44066
|
-
|
|
44067
|
-
if (
|
|
44068
|
-
|
|
44122
|
+
const endsWith = (str, searchString, position) => {
|
|
44123
|
+
str = String(str);
|
|
44124
|
+
if (position === undefined || position > str.length) {
|
|
44125
|
+
position = str.length;
|
|
44126
|
+
}
|
|
44127
|
+
position -= searchString.length;
|
|
44128
|
+
const lastIndex = str.indexOf(searchString, position);
|
|
44129
|
+
return lastIndex !== -1 && lastIndex === position;
|
|
44130
|
+
};
|
|
44131
|
+
|
|
44132
|
+
|
|
44133
|
+
/**
|
|
44134
|
+
* Returns new array from array like object or null if failed
|
|
44135
|
+
*
|
|
44136
|
+
* @param {*} [thing]
|
|
44137
|
+
*
|
|
44138
|
+
* @returns {?Array}
|
|
44139
|
+
*/
|
|
44140
|
+
const toArray$1 = (thing) => {
|
|
44141
|
+
if (!thing) return null;
|
|
44142
|
+
if (isArray$4(thing)) return thing;
|
|
44143
|
+
let i = thing.length;
|
|
44144
|
+
if (!isNumber(i)) return null;
|
|
44145
|
+
const arr = new Array(i);
|
|
44146
|
+
while (i-- > 0) {
|
|
44147
|
+
arr[i] = thing[i];
|
|
44148
|
+
}
|
|
44149
|
+
return arr;
|
|
44150
|
+
};
|
|
44151
|
+
|
|
44152
|
+
/**
|
|
44153
|
+
* Checking if the Uint8Array exists and if it does, it returns a function that checks if the
|
|
44154
|
+
* thing passed in is an instance of Uint8Array
|
|
44155
|
+
*
|
|
44156
|
+
* @param {TypedArray}
|
|
44157
|
+
*
|
|
44158
|
+
* @returns {Array}
|
|
44159
|
+
*/
|
|
44160
|
+
// eslint-disable-next-line func-names
|
|
44161
|
+
const isTypedArray = (TypedArray => {
|
|
44162
|
+
// eslint-disable-next-line func-names
|
|
44163
|
+
return thing => {
|
|
44164
|
+
return TypedArray && thing instanceof TypedArray;
|
|
44165
|
+
};
|
|
44166
|
+
})(typeof Uint8Array !== 'undefined' && getPrototypeOf$1(Uint8Array));
|
|
44167
|
+
|
|
44168
|
+
/**
|
|
44169
|
+
* For each entry in the object, call the function with the key and value.
|
|
44170
|
+
*
|
|
44171
|
+
* @param {Object<any, any>} obj - The object to iterate over.
|
|
44172
|
+
* @param {Function} fn - The function to call for each entry.
|
|
44173
|
+
*
|
|
44174
|
+
* @returns {void}
|
|
44175
|
+
*/
|
|
44176
|
+
const forEachEntry = (obj, fn) => {
|
|
44177
|
+
const generator = obj && obj[Symbol.iterator];
|
|
44178
|
+
|
|
44179
|
+
const iterator = generator.call(obj);
|
|
44180
|
+
|
|
44181
|
+
let result;
|
|
44182
|
+
|
|
44183
|
+
while ((result = iterator.next()) && !result.done) {
|
|
44184
|
+
const pair = result.value;
|
|
44185
|
+
fn.call(obj, pair[0], pair[1]);
|
|
44186
|
+
}
|
|
44187
|
+
};
|
|
44188
|
+
|
|
44189
|
+
/**
|
|
44190
|
+
* It takes a regular expression and a string, and returns an array of all the matches
|
|
44191
|
+
*
|
|
44192
|
+
* @param {string} regExp - The regular expression to match against.
|
|
44193
|
+
* @param {string} str - The string to search.
|
|
44194
|
+
*
|
|
44195
|
+
* @returns {Array<boolean>}
|
|
44196
|
+
*/
|
|
44197
|
+
const matchAll = (regExp, str) => {
|
|
44198
|
+
let matches;
|
|
44199
|
+
const arr = [];
|
|
44200
|
+
|
|
44201
|
+
while ((matches = regExp.exec(str)) !== null) {
|
|
44202
|
+
arr.push(matches);
|
|
44203
|
+
}
|
|
44204
|
+
|
|
44205
|
+
return arr;
|
|
44206
|
+
};
|
|
44207
|
+
|
|
44208
|
+
/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
|
|
44209
|
+
const isHTMLForm = kindOfTest('HTMLFormElement');
|
|
44210
|
+
|
|
44211
|
+
const toCamelCase = str => {
|
|
44212
|
+
return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
|
|
44213
|
+
function replacer(m, p1, p2) {
|
|
44214
|
+
return p1.toUpperCase() + p2;
|
|
44215
|
+
}
|
|
44216
|
+
);
|
|
44217
|
+
};
|
|
44218
|
+
|
|
44219
|
+
/* Creating a function that will check if an object has a property. */
|
|
44220
|
+
const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
|
|
44221
|
+
|
|
44222
|
+
/**
|
|
44223
|
+
* Determine if a value is a RegExp object
|
|
44224
|
+
*
|
|
44225
|
+
* @param {*} val The value to test
|
|
44226
|
+
*
|
|
44227
|
+
* @returns {boolean} True if value is a RegExp object, otherwise false
|
|
44228
|
+
*/
|
|
44229
|
+
const isRegExp = kindOfTest('RegExp');
|
|
44230
|
+
|
|
44231
|
+
const reduceDescriptors = (obj, reducer) => {
|
|
44232
|
+
const descriptors = Object.getOwnPropertyDescriptors(obj);
|
|
44233
|
+
const reducedDescriptors = {};
|
|
44234
|
+
|
|
44235
|
+
forEach(descriptors, (descriptor, name) => {
|
|
44236
|
+
let ret;
|
|
44237
|
+
if ((ret = reducer(descriptor, name, obj)) !== false) {
|
|
44238
|
+
reducedDescriptors[name] = ret || descriptor;
|
|
44239
|
+
}
|
|
44240
|
+
});
|
|
44241
|
+
|
|
44242
|
+
Object.defineProperties(obj, reducedDescriptors);
|
|
44243
|
+
};
|
|
44244
|
+
|
|
44245
|
+
/**
|
|
44246
|
+
* Makes all methods read-only
|
|
44247
|
+
* @param {Object} obj
|
|
44248
|
+
*/
|
|
44249
|
+
|
|
44250
|
+
const freezeMethods = (obj) => {
|
|
44251
|
+
reduceDescriptors(obj, (descriptor, name) => {
|
|
44252
|
+
// skip restricted props in strict mode
|
|
44253
|
+
if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
|
|
44254
|
+
return false;
|
|
44255
|
+
}
|
|
44256
|
+
|
|
44257
|
+
const value = obj[name];
|
|
44258
|
+
|
|
44259
|
+
if (!isFunction$1(value)) return;
|
|
44260
|
+
|
|
44261
|
+
descriptor.enumerable = false;
|
|
44262
|
+
|
|
44263
|
+
if ('writable' in descriptor) {
|
|
44264
|
+
descriptor.writable = false;
|
|
44265
|
+
return;
|
|
44266
|
+
}
|
|
44267
|
+
|
|
44268
|
+
if (!descriptor.set) {
|
|
44269
|
+
descriptor.set = () => {
|
|
44270
|
+
throw Error('Can not rewrite read-only method \'' + name + '\'');
|
|
44271
|
+
};
|
|
44272
|
+
}
|
|
44273
|
+
});
|
|
44274
|
+
};
|
|
44275
|
+
|
|
44276
|
+
const toObjectSet = (arrayOrString, delimiter) => {
|
|
44277
|
+
const obj = {};
|
|
44278
|
+
|
|
44279
|
+
const define = (arr) => {
|
|
44280
|
+
arr.forEach(value => {
|
|
44281
|
+
obj[value] = true;
|
|
44282
|
+
});
|
|
44283
|
+
};
|
|
44284
|
+
|
|
44285
|
+
isArray$4(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
|
|
44286
|
+
|
|
44287
|
+
return obj;
|
|
44288
|
+
};
|
|
44289
|
+
|
|
44290
|
+
const noop$2 = () => {};
|
|
44291
|
+
|
|
44292
|
+
const toFiniteNumber = (value, defaultValue) => {
|
|
44293
|
+
value = +value;
|
|
44294
|
+
return Number.isFinite(value) ? value : defaultValue;
|
|
44295
|
+
};
|
|
44296
|
+
|
|
44297
|
+
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
|
44298
|
+
|
|
44299
|
+
const DIGIT = '0123456789';
|
|
44300
|
+
|
|
44301
|
+
const ALPHABET = {
|
|
44302
|
+
DIGIT,
|
|
44303
|
+
ALPHA,
|
|
44304
|
+
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
|
44305
|
+
};
|
|
44306
|
+
|
|
44307
|
+
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
44308
|
+
let str = '';
|
|
44309
|
+
const {length} = alphabet;
|
|
44310
|
+
while (size--) {
|
|
44311
|
+
str += alphabet[Math.random() * length|0];
|
|
44312
|
+
}
|
|
44313
|
+
|
|
44314
|
+
return str;
|
|
44315
|
+
};
|
|
44316
|
+
|
|
44317
|
+
/**
|
|
44318
|
+
* If the thing is a FormData object, return true, otherwise return false.
|
|
44319
|
+
*
|
|
44320
|
+
* @param {unknown} thing - The thing to check.
|
|
44321
|
+
*
|
|
44322
|
+
* @returns {boolean}
|
|
44323
|
+
*/
|
|
44324
|
+
function isSpecCompliantForm(thing) {
|
|
44325
|
+
return !!(thing && isFunction$1(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
|
|
44326
|
+
}
|
|
44327
|
+
|
|
44328
|
+
const toJSONObject = (obj) => {
|
|
44329
|
+
const stack = new Array(10);
|
|
44330
|
+
|
|
44331
|
+
const visit = (source, i) => {
|
|
44332
|
+
|
|
44333
|
+
if (isObject$1(source)) {
|
|
44334
|
+
if (stack.indexOf(source) >= 0) {
|
|
44335
|
+
return;
|
|
44336
|
+
}
|
|
44337
|
+
|
|
44338
|
+
if(!('toJSON' in source)) {
|
|
44339
|
+
stack[i] = source;
|
|
44340
|
+
const target = isArray$4(source) ? [] : {};
|
|
44341
|
+
|
|
44342
|
+
forEach(source, (value, key) => {
|
|
44343
|
+
const reducedValue = visit(value, i + 1);
|
|
44344
|
+
!isUndefined(reducedValue) && (target[key] = reducedValue);
|
|
44345
|
+
});
|
|
44346
|
+
|
|
44347
|
+
stack[i] = undefined;
|
|
44348
|
+
|
|
44349
|
+
return target;
|
|
44350
|
+
}
|
|
44351
|
+
}
|
|
44352
|
+
|
|
44353
|
+
return source;
|
|
44354
|
+
};
|
|
44355
|
+
|
|
44356
|
+
return visit(obj, 0);
|
|
44357
|
+
};
|
|
44358
|
+
|
|
44359
|
+
const isAsyncFn = kindOfTest('AsyncFunction');
|
|
44360
|
+
|
|
44361
|
+
const isThenable = (thing) =>
|
|
44362
|
+
thing && (isObject$1(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
|
|
44363
|
+
|
|
44364
|
+
var utils = {
|
|
44365
|
+
isArray: isArray$4,
|
|
44366
|
+
isArrayBuffer,
|
|
44367
|
+
isBuffer,
|
|
44368
|
+
isFormData,
|
|
44369
|
+
isArrayBufferView,
|
|
44370
|
+
isString,
|
|
44371
|
+
isNumber,
|
|
44372
|
+
isBoolean,
|
|
44373
|
+
isObject: isObject$1,
|
|
44374
|
+
isPlainObject,
|
|
44375
|
+
isUndefined,
|
|
44376
|
+
isDate,
|
|
44377
|
+
isFile,
|
|
44378
|
+
isBlob,
|
|
44379
|
+
isRegExp,
|
|
44380
|
+
isFunction: isFunction$1,
|
|
44381
|
+
isStream,
|
|
44382
|
+
isURLSearchParams,
|
|
44383
|
+
isTypedArray,
|
|
44384
|
+
isFileList,
|
|
44385
|
+
forEach,
|
|
44386
|
+
merge: merge$2,
|
|
44387
|
+
extend,
|
|
44388
|
+
trim,
|
|
44389
|
+
stripBOM,
|
|
44390
|
+
inherits,
|
|
44391
|
+
toFlatObject,
|
|
44392
|
+
kindOf,
|
|
44393
|
+
kindOfTest,
|
|
44394
|
+
endsWith,
|
|
44395
|
+
toArray: toArray$1,
|
|
44396
|
+
forEachEntry,
|
|
44397
|
+
matchAll,
|
|
44398
|
+
isHTMLForm,
|
|
44399
|
+
hasOwnProperty,
|
|
44400
|
+
hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
|
|
44401
|
+
reduceDescriptors,
|
|
44402
|
+
freezeMethods,
|
|
44403
|
+
toObjectSet,
|
|
44404
|
+
toCamelCase,
|
|
44405
|
+
noop: noop$2,
|
|
44406
|
+
toFiniteNumber,
|
|
44407
|
+
findKey,
|
|
44408
|
+
global: _global,
|
|
44409
|
+
isContextDefined,
|
|
44410
|
+
ALPHABET,
|
|
44411
|
+
generateString,
|
|
44412
|
+
isSpecCompliantForm,
|
|
44413
|
+
toJSONObject,
|
|
44414
|
+
isAsyncFn,
|
|
44415
|
+
isThenable
|
|
44416
|
+
};
|
|
44417
|
+
|
|
44418
|
+
/**
|
|
44419
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
44420
|
+
*
|
|
44421
|
+
* @param {string} message The error message.
|
|
44422
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
44423
|
+
* @param {Object} [config] The config.
|
|
44424
|
+
* @param {Object} [request] The request.
|
|
44425
|
+
* @param {Object} [response] The response.
|
|
44426
|
+
*
|
|
44427
|
+
* @returns {Error} The created error.
|
|
44428
|
+
*/
|
|
44429
|
+
function AxiosError(message, code, config, request, response) {
|
|
44430
|
+
Error.call(this);
|
|
44431
|
+
|
|
44432
|
+
if (Error.captureStackTrace) {
|
|
44433
|
+
Error.captureStackTrace(this, this.constructor);
|
|
44434
|
+
} else {
|
|
44435
|
+
this.stack = (new Error()).stack;
|
|
44436
|
+
}
|
|
44437
|
+
|
|
44438
|
+
this.message = message;
|
|
44439
|
+
this.name = 'AxiosError';
|
|
44440
|
+
code && (this.code = code);
|
|
44441
|
+
config && (this.config = config);
|
|
44442
|
+
request && (this.request = request);
|
|
44443
|
+
response && (this.response = response);
|
|
44444
|
+
}
|
|
44445
|
+
|
|
44446
|
+
utils.inherits(AxiosError, Error, {
|
|
44447
|
+
toJSON: function toJSON() {
|
|
44448
|
+
return {
|
|
44449
|
+
// Standard
|
|
44450
|
+
message: this.message,
|
|
44451
|
+
name: this.name,
|
|
44452
|
+
// Microsoft
|
|
44453
|
+
description: this.description,
|
|
44454
|
+
number: this.number,
|
|
44455
|
+
// Mozilla
|
|
44456
|
+
fileName: this.fileName,
|
|
44457
|
+
lineNumber: this.lineNumber,
|
|
44458
|
+
columnNumber: this.columnNumber,
|
|
44459
|
+
stack: this.stack,
|
|
44460
|
+
// Axios
|
|
44461
|
+
config: utils.toJSONObject(this.config),
|
|
44462
|
+
code: this.code,
|
|
44463
|
+
status: this.response && this.response.status ? this.response.status : null
|
|
44464
|
+
};
|
|
44465
|
+
}
|
|
44466
|
+
});
|
|
44467
|
+
|
|
44468
|
+
const prototype = AxiosError.prototype;
|
|
44469
|
+
const descriptors = {};
|
|
44470
|
+
|
|
44471
|
+
[
|
|
44472
|
+
'ERR_BAD_OPTION_VALUE',
|
|
44473
|
+
'ERR_BAD_OPTION',
|
|
44474
|
+
'ECONNABORTED',
|
|
44475
|
+
'ETIMEDOUT',
|
|
44476
|
+
'ERR_NETWORK',
|
|
44477
|
+
'ERR_FR_TOO_MANY_REDIRECTS',
|
|
44478
|
+
'ERR_DEPRECATED',
|
|
44479
|
+
'ERR_BAD_RESPONSE',
|
|
44480
|
+
'ERR_BAD_REQUEST',
|
|
44481
|
+
'ERR_CANCELED',
|
|
44482
|
+
'ERR_NOT_SUPPORT',
|
|
44483
|
+
'ERR_INVALID_URL'
|
|
44484
|
+
// eslint-disable-next-line func-names
|
|
44485
|
+
].forEach(code => {
|
|
44486
|
+
descriptors[code] = {value: code};
|
|
44487
|
+
});
|
|
44488
|
+
|
|
44489
|
+
Object.defineProperties(AxiosError, descriptors);
|
|
44490
|
+
Object.defineProperty(prototype, 'isAxiosError', {value: true});
|
|
44491
|
+
|
|
44492
|
+
// eslint-disable-next-line func-names
|
|
44493
|
+
AxiosError.from = (error, code, config, request, response, customProps) => {
|
|
44494
|
+
const axiosError = Object.create(prototype);
|
|
44495
|
+
|
|
44496
|
+
utils.toFlatObject(error, axiosError, function filter(obj) {
|
|
44497
|
+
return obj !== Error.prototype;
|
|
44498
|
+
}, prop => {
|
|
44499
|
+
return prop !== 'isAxiosError';
|
|
44500
|
+
});
|
|
44501
|
+
|
|
44502
|
+
AxiosError.call(axiosError, error.message, code, config, request, response);
|
|
44503
|
+
|
|
44504
|
+
axiosError.cause = error;
|
|
44505
|
+
|
|
44506
|
+
axiosError.name = error.name;
|
|
44507
|
+
|
|
44508
|
+
customProps && Object.assign(axiosError, customProps);
|
|
44509
|
+
|
|
44510
|
+
return axiosError;
|
|
44511
|
+
};
|
|
44512
|
+
|
|
44513
|
+
// eslint-disable-next-line strict
|
|
44514
|
+
var httpAdapter = null;
|
|
44515
|
+
|
|
44516
|
+
/**
|
|
44517
|
+
* Determines if the given thing is a array or js object.
|
|
44518
|
+
*
|
|
44519
|
+
* @param {string} thing - The object or array to be visited.
|
|
44520
|
+
*
|
|
44521
|
+
* @returns {boolean}
|
|
44522
|
+
*/
|
|
44523
|
+
function isVisitable(thing) {
|
|
44524
|
+
return utils.isPlainObject(thing) || utils.isArray(thing);
|
|
44525
|
+
}
|
|
44526
|
+
|
|
44527
|
+
/**
|
|
44528
|
+
* It removes the brackets from the end of a string
|
|
44529
|
+
*
|
|
44530
|
+
* @param {string} key - The key of the parameter.
|
|
44531
|
+
*
|
|
44532
|
+
* @returns {string} the key without the brackets.
|
|
44533
|
+
*/
|
|
44534
|
+
function removeBrackets(key) {
|
|
44535
|
+
return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
|
|
44536
|
+
}
|
|
44537
|
+
|
|
44538
|
+
/**
|
|
44539
|
+
* It takes a path, a key, and a boolean, and returns a string
|
|
44540
|
+
*
|
|
44541
|
+
* @param {string} path - The path to the current key.
|
|
44542
|
+
* @param {string} key - The key of the current object being iterated over.
|
|
44543
|
+
* @param {string} dots - If true, the key will be rendered with dots instead of brackets.
|
|
44544
|
+
*
|
|
44545
|
+
* @returns {string} The path to the current key.
|
|
44546
|
+
*/
|
|
44547
|
+
function renderKey(path, key, dots) {
|
|
44548
|
+
if (!path) return key;
|
|
44549
|
+
return path.concat(key).map(function each(token, i) {
|
|
44550
|
+
// eslint-disable-next-line no-param-reassign
|
|
44551
|
+
token = removeBrackets(token);
|
|
44552
|
+
return !dots && i ? '[' + token + ']' : token;
|
|
44553
|
+
}).join(dots ? '.' : '');
|
|
44554
|
+
}
|
|
44555
|
+
|
|
44556
|
+
/**
|
|
44557
|
+
* If the array is an array and none of its elements are visitable, then it's a flat array.
|
|
44558
|
+
*
|
|
44559
|
+
* @param {Array<any>} arr - The array to check
|
|
44560
|
+
*
|
|
44561
|
+
* @returns {boolean}
|
|
44562
|
+
*/
|
|
44563
|
+
function isFlatArray(arr) {
|
|
44564
|
+
return utils.isArray(arr) && !arr.some(isVisitable);
|
|
44565
|
+
}
|
|
44566
|
+
|
|
44567
|
+
const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
|
|
44568
|
+
return /^is[A-Z]/.test(prop);
|
|
44569
|
+
});
|
|
44570
|
+
|
|
44571
|
+
/**
|
|
44572
|
+
* Convert a data object to FormData
|
|
44573
|
+
*
|
|
44574
|
+
* @param {Object} obj
|
|
44575
|
+
* @param {?Object} [formData]
|
|
44576
|
+
* @param {?Object} [options]
|
|
44577
|
+
* @param {Function} [options.visitor]
|
|
44578
|
+
* @param {Boolean} [options.metaTokens = true]
|
|
44579
|
+
* @param {Boolean} [options.dots = false]
|
|
44580
|
+
* @param {?Boolean} [options.indexes = false]
|
|
44581
|
+
*
|
|
44582
|
+
* @returns {Object}
|
|
44583
|
+
**/
|
|
44584
|
+
|
|
44585
|
+
/**
|
|
44586
|
+
* It converts an object into a FormData object
|
|
44587
|
+
*
|
|
44588
|
+
* @param {Object<any, any>} obj - The object to convert to form data.
|
|
44589
|
+
* @param {string} formData - The FormData object to append to.
|
|
44590
|
+
* @param {Object<string, any>} options
|
|
44591
|
+
*
|
|
44592
|
+
* @returns
|
|
44593
|
+
*/
|
|
44594
|
+
function toFormData(obj, formData, options) {
|
|
44595
|
+
if (!utils.isObject(obj)) {
|
|
44596
|
+
throw new TypeError('target must be an object');
|
|
44597
|
+
}
|
|
44598
|
+
|
|
44599
|
+
// eslint-disable-next-line no-param-reassign
|
|
44600
|
+
formData = formData || new (FormData)();
|
|
44601
|
+
|
|
44602
|
+
// eslint-disable-next-line no-param-reassign
|
|
44603
|
+
options = utils.toFlatObject(options, {
|
|
44604
|
+
metaTokens: true,
|
|
44605
|
+
dots: false,
|
|
44606
|
+
indexes: false
|
|
44607
|
+
}, false, function defined(option, source) {
|
|
44608
|
+
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
44609
|
+
return !utils.isUndefined(source[option]);
|
|
44610
|
+
});
|
|
44611
|
+
|
|
44612
|
+
const metaTokens = options.metaTokens;
|
|
44613
|
+
// eslint-disable-next-line no-use-before-define
|
|
44614
|
+
const visitor = options.visitor || defaultVisitor;
|
|
44615
|
+
const dots = options.dots;
|
|
44616
|
+
const indexes = options.indexes;
|
|
44617
|
+
const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
|
|
44618
|
+
const useBlob = _Blob && utils.isSpecCompliantForm(formData);
|
|
44619
|
+
|
|
44620
|
+
if (!utils.isFunction(visitor)) {
|
|
44621
|
+
throw new TypeError('visitor must be a function');
|
|
44622
|
+
}
|
|
44623
|
+
|
|
44624
|
+
function convertValue(value) {
|
|
44625
|
+
if (value === null) return '';
|
|
44626
|
+
|
|
44627
|
+
if (utils.isDate(value)) {
|
|
44628
|
+
return value.toISOString();
|
|
44629
|
+
}
|
|
44630
|
+
|
|
44631
|
+
if (!useBlob && utils.isBlob(value)) {
|
|
44632
|
+
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
|
|
44633
|
+
}
|
|
44634
|
+
|
|
44635
|
+
if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
|
|
44636
|
+
return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
|
|
44637
|
+
}
|
|
44638
|
+
|
|
44639
|
+
return value;
|
|
44640
|
+
}
|
|
44641
|
+
|
|
44642
|
+
/**
|
|
44643
|
+
* Default visitor.
|
|
44644
|
+
*
|
|
44645
|
+
* @param {*} value
|
|
44646
|
+
* @param {String|Number} key
|
|
44647
|
+
* @param {Array<String|Number>} path
|
|
44648
|
+
* @this {FormData}
|
|
44649
|
+
*
|
|
44650
|
+
* @returns {boolean} return true to visit the each prop of the value recursively
|
|
44651
|
+
*/
|
|
44652
|
+
function defaultVisitor(value, key, path) {
|
|
44653
|
+
let arr = value;
|
|
44654
|
+
|
|
44655
|
+
if (value && !path && typeof value === 'object') {
|
|
44656
|
+
if (utils.endsWith(key, '{}')) {
|
|
44657
|
+
// eslint-disable-next-line no-param-reassign
|
|
44658
|
+
key = metaTokens ? key : key.slice(0, -2);
|
|
44659
|
+
// eslint-disable-next-line no-param-reassign
|
|
44660
|
+
value = JSON.stringify(value);
|
|
44661
|
+
} else if (
|
|
44662
|
+
(utils.isArray(value) && isFlatArray(value)) ||
|
|
44663
|
+
((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))
|
|
44664
|
+
)) {
|
|
44665
|
+
// eslint-disable-next-line no-param-reassign
|
|
44666
|
+
key = removeBrackets(key);
|
|
44667
|
+
|
|
44668
|
+
arr.forEach(function each(el, index) {
|
|
44669
|
+
!(utils.isUndefined(el) || el === null) && formData.append(
|
|
44670
|
+
// eslint-disable-next-line no-nested-ternary
|
|
44671
|
+
indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
|
|
44672
|
+
convertValue(el)
|
|
44673
|
+
);
|
|
44674
|
+
});
|
|
44675
|
+
return false;
|
|
44676
|
+
}
|
|
44677
|
+
}
|
|
44678
|
+
|
|
44679
|
+
if (isVisitable(value)) {
|
|
44680
|
+
return true;
|
|
44681
|
+
}
|
|
44682
|
+
|
|
44683
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
44684
|
+
|
|
44685
|
+
return false;
|
|
44686
|
+
}
|
|
44687
|
+
|
|
44688
|
+
const stack = [];
|
|
44689
|
+
|
|
44690
|
+
const exposedHelpers = Object.assign(predicates, {
|
|
44691
|
+
defaultVisitor,
|
|
44692
|
+
convertValue,
|
|
44693
|
+
isVisitable
|
|
44694
|
+
});
|
|
44695
|
+
|
|
44696
|
+
function build(value, path) {
|
|
44697
|
+
if (utils.isUndefined(value)) return;
|
|
44698
|
+
|
|
44699
|
+
if (stack.indexOf(value) !== -1) {
|
|
44700
|
+
throw Error('Circular reference detected in ' + path.join('.'));
|
|
44701
|
+
}
|
|
44702
|
+
|
|
44703
|
+
stack.push(value);
|
|
44704
|
+
|
|
44705
|
+
utils.forEach(value, function each(el, key) {
|
|
44706
|
+
const result = !(utils.isUndefined(el) || el === null) && visitor.call(
|
|
44707
|
+
formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
|
|
44708
|
+
);
|
|
44709
|
+
|
|
44710
|
+
if (result === true) {
|
|
44711
|
+
build(el, path ? path.concat(key) : [key]);
|
|
44712
|
+
}
|
|
44713
|
+
});
|
|
44714
|
+
|
|
44715
|
+
stack.pop();
|
|
44716
|
+
}
|
|
44717
|
+
|
|
44718
|
+
if (!utils.isObject(obj)) {
|
|
44719
|
+
throw new TypeError('data must be an object');
|
|
44720
|
+
}
|
|
44721
|
+
|
|
44722
|
+
build(obj);
|
|
44723
|
+
|
|
44724
|
+
return formData;
|
|
44725
|
+
}
|
|
44726
|
+
|
|
44727
|
+
/**
|
|
44728
|
+
* It encodes a string by replacing all characters that are not in the unreserved set with
|
|
44729
|
+
* their percent-encoded equivalents
|
|
44730
|
+
*
|
|
44731
|
+
* @param {string} str - The string to encode.
|
|
44732
|
+
*
|
|
44733
|
+
* @returns {string} The encoded string.
|
|
44734
|
+
*/
|
|
44735
|
+
function encode(str) {
|
|
44736
|
+
const charMap = {
|
|
44737
|
+
'!': '%21',
|
|
44738
|
+
"'": '%27',
|
|
44739
|
+
'(': '%28',
|
|
44740
|
+
')': '%29',
|
|
44741
|
+
'~': '%7E',
|
|
44742
|
+
'%20': '+',
|
|
44743
|
+
'%00': '\x00'
|
|
44744
|
+
};
|
|
44745
|
+
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
|
|
44746
|
+
return charMap[match];
|
|
44747
|
+
});
|
|
44748
|
+
}
|
|
44749
|
+
|
|
44750
|
+
/**
|
|
44751
|
+
* It takes a params object and converts it to a FormData object
|
|
44752
|
+
*
|
|
44753
|
+
* @param {Object<string, any>} params - The parameters to be converted to a FormData object.
|
|
44754
|
+
* @param {Object<string, any>} options - The options object passed to the Axios constructor.
|
|
44755
|
+
*
|
|
44756
|
+
* @returns {void}
|
|
44757
|
+
*/
|
|
44758
|
+
function AxiosURLSearchParams(params, options) {
|
|
44759
|
+
this._pairs = [];
|
|
44760
|
+
|
|
44761
|
+
params && toFormData(params, this, options);
|
|
44762
|
+
}
|
|
44763
|
+
|
|
44764
|
+
const prototype$1 = AxiosURLSearchParams.prototype;
|
|
44765
|
+
|
|
44766
|
+
prototype$1.append = function append(name, value) {
|
|
44767
|
+
this._pairs.push([name, value]);
|
|
44768
|
+
};
|
|
44769
|
+
|
|
44770
|
+
prototype$1.toString = function toString(encoder) {
|
|
44771
|
+
const _encode = encoder ? function(value) {
|
|
44772
|
+
return encoder.call(this, value, encode);
|
|
44773
|
+
} : encode;
|
|
44774
|
+
|
|
44775
|
+
return this._pairs.map(function each(pair) {
|
|
44776
|
+
return _encode(pair[0]) + '=' + _encode(pair[1]);
|
|
44777
|
+
}, '').join('&');
|
|
44778
|
+
};
|
|
44779
|
+
|
|
44780
|
+
/**
|
|
44781
|
+
* It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
|
|
44782
|
+
* URI encoded counterparts
|
|
44783
|
+
*
|
|
44784
|
+
* @param {string} val The value to be encoded.
|
|
44785
|
+
*
|
|
44786
|
+
* @returns {string} The encoded value.
|
|
44787
|
+
*/
|
|
44788
|
+
function encode$1(val) {
|
|
44789
|
+
return encodeURIComponent(val).
|
|
44790
|
+
replace(/%3A/gi, ':').
|
|
44791
|
+
replace(/%24/g, '$').
|
|
44792
|
+
replace(/%2C/gi, ',').
|
|
44793
|
+
replace(/%20/g, '+').
|
|
44794
|
+
replace(/%5B/gi, '[').
|
|
44795
|
+
replace(/%5D/gi, ']');
|
|
44796
|
+
}
|
|
44797
|
+
|
|
44798
|
+
/**
|
|
44799
|
+
* Build a URL by appending params to the end
|
|
44800
|
+
*
|
|
44801
|
+
* @param {string} url The base of the url (e.g., http://www.google.com)
|
|
44802
|
+
* @param {object} [params] The params to be appended
|
|
44803
|
+
* @param {?object} options
|
|
44804
|
+
*
|
|
44805
|
+
* @returns {string} The formatted url
|
|
44806
|
+
*/
|
|
44807
|
+
function buildURL(url, params, options) {
|
|
44808
|
+
/*eslint no-param-reassign:0*/
|
|
44809
|
+
if (!params) {
|
|
44810
|
+
return url;
|
|
44811
|
+
}
|
|
44812
|
+
|
|
44813
|
+
const _encode = options && options.encode || encode$1;
|
|
44814
|
+
|
|
44815
|
+
const serializeFn = options && options.serialize;
|
|
44816
|
+
|
|
44817
|
+
let serializedParams;
|
|
44818
|
+
|
|
44819
|
+
if (serializeFn) {
|
|
44820
|
+
serializedParams = serializeFn(params, options);
|
|
44821
|
+
} else {
|
|
44822
|
+
serializedParams = utils.isURLSearchParams(params) ?
|
|
44823
|
+
params.toString() :
|
|
44824
|
+
new AxiosURLSearchParams(params, options).toString(_encode);
|
|
44825
|
+
}
|
|
44826
|
+
|
|
44827
|
+
if (serializedParams) {
|
|
44828
|
+
const hashmarkIndex = url.indexOf("#");
|
|
44829
|
+
|
|
44830
|
+
if (hashmarkIndex !== -1) {
|
|
44831
|
+
url = url.slice(0, hashmarkIndex);
|
|
44832
|
+
}
|
|
44833
|
+
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
|
|
44834
|
+
}
|
|
44835
|
+
|
|
44836
|
+
return url;
|
|
44837
|
+
}
|
|
44838
|
+
|
|
44839
|
+
class InterceptorManager {
|
|
44840
|
+
constructor() {
|
|
44841
|
+
this.handlers = [];
|
|
44842
|
+
}
|
|
44843
|
+
|
|
44844
|
+
/**
|
|
44845
|
+
* Add a new interceptor to the stack
|
|
44846
|
+
*
|
|
44847
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
44848
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
44849
|
+
*
|
|
44850
|
+
* @return {Number} An ID used to remove interceptor later
|
|
44851
|
+
*/
|
|
44852
|
+
use(fulfilled, rejected, options) {
|
|
44853
|
+
this.handlers.push({
|
|
44854
|
+
fulfilled,
|
|
44855
|
+
rejected,
|
|
44856
|
+
synchronous: options ? options.synchronous : false,
|
|
44857
|
+
runWhen: options ? options.runWhen : null
|
|
44858
|
+
});
|
|
44859
|
+
return this.handlers.length - 1;
|
|
44860
|
+
}
|
|
44861
|
+
|
|
44862
|
+
/**
|
|
44863
|
+
* Remove an interceptor from the stack
|
|
44864
|
+
*
|
|
44865
|
+
* @param {Number} id The ID that was returned by `use`
|
|
44866
|
+
*
|
|
44867
|
+
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
|
|
44868
|
+
*/
|
|
44869
|
+
eject(id) {
|
|
44870
|
+
if (this.handlers[id]) {
|
|
44871
|
+
this.handlers[id] = null;
|
|
44872
|
+
}
|
|
44873
|
+
}
|
|
44874
|
+
|
|
44875
|
+
/**
|
|
44876
|
+
* Clear all interceptors from the stack
|
|
44877
|
+
*
|
|
44878
|
+
* @returns {void}
|
|
44879
|
+
*/
|
|
44880
|
+
clear() {
|
|
44881
|
+
if (this.handlers) {
|
|
44882
|
+
this.handlers = [];
|
|
44883
|
+
}
|
|
44884
|
+
}
|
|
44885
|
+
|
|
44886
|
+
/**
|
|
44887
|
+
* Iterate over all the registered interceptors
|
|
44888
|
+
*
|
|
44889
|
+
* This method is particularly useful for skipping over any
|
|
44890
|
+
* interceptors that may have become `null` calling `eject`.
|
|
44891
|
+
*
|
|
44892
|
+
* @param {Function} fn The function to call for each interceptor
|
|
44893
|
+
*
|
|
44894
|
+
* @returns {void}
|
|
44895
|
+
*/
|
|
44896
|
+
forEach(fn) {
|
|
44897
|
+
utils.forEach(this.handlers, function forEachHandler(h) {
|
|
44898
|
+
if (h !== null) {
|
|
44899
|
+
fn(h);
|
|
44900
|
+
}
|
|
44901
|
+
});
|
|
44902
|
+
}
|
|
44903
|
+
}
|
|
44904
|
+
|
|
44905
|
+
var transitionalDefaults = {
|
|
44906
|
+
silentJSONParsing: true,
|
|
44907
|
+
forcedJSONParsing: true,
|
|
44908
|
+
clarifyTimeoutError: false
|
|
44909
|
+
};
|
|
44910
|
+
|
|
44911
|
+
var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
|
|
44912
|
+
|
|
44913
|
+
var FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
|
|
44914
|
+
|
|
44915
|
+
var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
|
|
44916
|
+
|
|
44917
|
+
var platform = {
|
|
44918
|
+
isBrowser: true,
|
|
44919
|
+
classes: {
|
|
44920
|
+
URLSearchParams: URLSearchParams$1,
|
|
44921
|
+
FormData: FormData$1,
|
|
44922
|
+
Blob: Blob$1
|
|
44923
|
+
},
|
|
44924
|
+
protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
|
|
44925
|
+
};
|
|
44926
|
+
|
|
44927
|
+
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
44928
|
+
|
|
44929
|
+
/**
|
|
44930
|
+
* Determine if we're running in a standard browser environment
|
|
44931
|
+
*
|
|
44932
|
+
* This allows axios to run in a web worker, and react-native.
|
|
44933
|
+
* Both environments support XMLHttpRequest, but not fully standard globals.
|
|
44934
|
+
*
|
|
44935
|
+
* web workers:
|
|
44936
|
+
* typeof window -> undefined
|
|
44937
|
+
* typeof document -> undefined
|
|
44938
|
+
*
|
|
44939
|
+
* react-native:
|
|
44940
|
+
* navigator.product -> 'ReactNative'
|
|
44941
|
+
* nativescript
|
|
44942
|
+
* navigator.product -> 'NativeScript' or 'NS'
|
|
44943
|
+
*
|
|
44944
|
+
* @returns {boolean}
|
|
44945
|
+
*/
|
|
44946
|
+
const hasStandardBrowserEnv = (
|
|
44947
|
+
(product) => {
|
|
44948
|
+
return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
|
|
44949
|
+
})(typeof navigator !== 'undefined' && navigator.product);
|
|
44950
|
+
|
|
44951
|
+
/**
|
|
44952
|
+
* Determine if we're running in a standard browser webWorker environment
|
|
44953
|
+
*
|
|
44954
|
+
* Although the `isStandardBrowserEnv` method indicates that
|
|
44955
|
+
* `allows axios to run in a web worker`, the WebWorker will still be
|
|
44956
|
+
* filtered out due to its judgment standard
|
|
44957
|
+
* `typeof window !== 'undefined' && typeof document !== 'undefined'`.
|
|
44958
|
+
* This leads to a problem when axios post `FormData` in webWorker
|
|
44959
|
+
*/
|
|
44960
|
+
const hasStandardBrowserWebWorkerEnv = (() => {
|
|
44961
|
+
return (
|
|
44962
|
+
typeof WorkerGlobalScope !== 'undefined' &&
|
|
44963
|
+
// eslint-disable-next-line no-undef
|
|
44964
|
+
self instanceof WorkerGlobalScope &&
|
|
44965
|
+
typeof self.importScripts === 'function'
|
|
44966
|
+
);
|
|
44967
|
+
})();
|
|
44968
|
+
|
|
44969
|
+
var utils$1 = /*#__PURE__*/Object.freeze({
|
|
44970
|
+
hasBrowserEnv: hasBrowserEnv,
|
|
44971
|
+
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
|
44972
|
+
hasStandardBrowserEnv: hasStandardBrowserEnv
|
|
44973
|
+
});
|
|
44974
|
+
|
|
44975
|
+
var platform$1 = {
|
|
44976
|
+
...utils$1,
|
|
44977
|
+
...platform
|
|
44978
|
+
};
|
|
44979
|
+
|
|
44980
|
+
function toURLEncodedForm(data, options) {
|
|
44981
|
+
return toFormData(data, new platform$1.classes.URLSearchParams(), Object.assign({
|
|
44982
|
+
visitor: function(value, key, path, helpers) {
|
|
44983
|
+
|
|
44984
|
+
return helpers.defaultVisitor.apply(this, arguments);
|
|
44985
|
+
}
|
|
44986
|
+
}, options));
|
|
44987
|
+
}
|
|
44988
|
+
|
|
44989
|
+
/**
|
|
44990
|
+
* It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
|
|
44991
|
+
*
|
|
44992
|
+
* @param {string} name - The name of the property to get.
|
|
44993
|
+
*
|
|
44994
|
+
* @returns An array of strings.
|
|
44995
|
+
*/
|
|
44996
|
+
function parsePropPath(name) {
|
|
44997
|
+
// foo[x][y][z]
|
|
44998
|
+
// foo.x.y.z
|
|
44999
|
+
// foo-x-y-z
|
|
45000
|
+
// foo x y z
|
|
45001
|
+
return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
|
|
45002
|
+
return match[0] === '[]' ? '' : match[1] || match[0];
|
|
45003
|
+
});
|
|
45004
|
+
}
|
|
45005
|
+
|
|
45006
|
+
/**
|
|
45007
|
+
* Convert an array to an object.
|
|
45008
|
+
*
|
|
45009
|
+
* @param {Array<any>} arr - The array to convert to an object.
|
|
45010
|
+
*
|
|
45011
|
+
* @returns An object with the same keys and values as the array.
|
|
45012
|
+
*/
|
|
45013
|
+
function arrayToObject(arr) {
|
|
45014
|
+
const obj = {};
|
|
45015
|
+
const keys = Object.keys(arr);
|
|
45016
|
+
let i;
|
|
45017
|
+
const len = keys.length;
|
|
45018
|
+
let key;
|
|
45019
|
+
for (i = 0; i < len; i++) {
|
|
45020
|
+
key = keys[i];
|
|
45021
|
+
obj[key] = arr[key];
|
|
45022
|
+
}
|
|
45023
|
+
return obj;
|
|
45024
|
+
}
|
|
45025
|
+
|
|
45026
|
+
/**
|
|
45027
|
+
* It takes a FormData object and returns a JavaScript object
|
|
45028
|
+
*
|
|
45029
|
+
* @param {string} formData The FormData object to convert to JSON.
|
|
45030
|
+
*
|
|
45031
|
+
* @returns {Object<string, any> | null} The converted object.
|
|
45032
|
+
*/
|
|
45033
|
+
function formDataToJSON(formData) {
|
|
45034
|
+
function buildPath(path, value, target, index) {
|
|
45035
|
+
let name = path[index++];
|
|
45036
|
+
const isNumericKey = Number.isFinite(+name);
|
|
45037
|
+
const isLast = index >= path.length;
|
|
45038
|
+
name = !name && utils.isArray(target) ? target.length : name;
|
|
45039
|
+
|
|
45040
|
+
if (isLast) {
|
|
45041
|
+
if (utils.hasOwnProp(target, name)) {
|
|
45042
|
+
target[name] = [target[name], value];
|
|
45043
|
+
} else {
|
|
45044
|
+
target[name] = value;
|
|
45045
|
+
}
|
|
45046
|
+
|
|
45047
|
+
return !isNumericKey;
|
|
45048
|
+
}
|
|
45049
|
+
|
|
45050
|
+
if (!target[name] || !utils.isObject(target[name])) {
|
|
45051
|
+
target[name] = [];
|
|
45052
|
+
}
|
|
45053
|
+
|
|
45054
|
+
const result = buildPath(path, value, target[name], index);
|
|
45055
|
+
|
|
45056
|
+
if (result && utils.isArray(target[name])) {
|
|
45057
|
+
target[name] = arrayToObject(target[name]);
|
|
45058
|
+
}
|
|
45059
|
+
|
|
45060
|
+
return !isNumericKey;
|
|
45061
|
+
}
|
|
45062
|
+
|
|
45063
|
+
if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
|
|
45064
|
+
const obj = {};
|
|
45065
|
+
|
|
45066
|
+
utils.forEachEntry(formData, (name, value) => {
|
|
45067
|
+
buildPath(parsePropPath(name), value, obj, 0);
|
|
45068
|
+
});
|
|
45069
|
+
|
|
45070
|
+
return obj;
|
|
45071
|
+
}
|
|
45072
|
+
|
|
45073
|
+
return null;
|
|
45074
|
+
}
|
|
45075
|
+
|
|
45076
|
+
/**
|
|
45077
|
+
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
|
45078
|
+
* of the input
|
|
45079
|
+
*
|
|
45080
|
+
* @param {any} rawValue - The value to be stringified.
|
|
45081
|
+
* @param {Function} parser - A function that parses a string into a JavaScript object.
|
|
45082
|
+
* @param {Function} encoder - A function that takes a value and returns a string.
|
|
45083
|
+
*
|
|
45084
|
+
* @returns {string} A stringified version of the rawValue.
|
|
45085
|
+
*/
|
|
45086
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
45087
|
+
if (utils.isString(rawValue)) {
|
|
45088
|
+
try {
|
|
45089
|
+
(parser || JSON.parse)(rawValue);
|
|
45090
|
+
return utils.trim(rawValue);
|
|
45091
|
+
} catch (e) {
|
|
45092
|
+
if (e.name !== 'SyntaxError') {
|
|
45093
|
+
throw e;
|
|
45094
|
+
}
|
|
45095
|
+
}
|
|
45096
|
+
}
|
|
45097
|
+
|
|
45098
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
45099
|
+
}
|
|
45100
|
+
|
|
45101
|
+
const defaults = {
|
|
45102
|
+
|
|
45103
|
+
transitional: transitionalDefaults,
|
|
45104
|
+
|
|
45105
|
+
adapter: ['xhr', 'http'],
|
|
45106
|
+
|
|
45107
|
+
transformRequest: [function transformRequest(data, headers) {
|
|
45108
|
+
const contentType = headers.getContentType() || '';
|
|
45109
|
+
const hasJSONContentType = contentType.indexOf('application/json') > -1;
|
|
45110
|
+
const isObjectPayload = utils.isObject(data);
|
|
45111
|
+
|
|
45112
|
+
if (isObjectPayload && utils.isHTMLForm(data)) {
|
|
45113
|
+
data = new FormData(data);
|
|
45114
|
+
}
|
|
45115
|
+
|
|
45116
|
+
const isFormData = utils.isFormData(data);
|
|
45117
|
+
|
|
45118
|
+
if (isFormData) {
|
|
45119
|
+
if (!hasJSONContentType) {
|
|
45120
|
+
return data;
|
|
45121
|
+
}
|
|
45122
|
+
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
45123
|
+
}
|
|
45124
|
+
|
|
45125
|
+
if (utils.isArrayBuffer(data) ||
|
|
45126
|
+
utils.isBuffer(data) ||
|
|
45127
|
+
utils.isStream(data) ||
|
|
45128
|
+
utils.isFile(data) ||
|
|
45129
|
+
utils.isBlob(data)
|
|
45130
|
+
) {
|
|
45131
|
+
return data;
|
|
45132
|
+
}
|
|
45133
|
+
if (utils.isArrayBufferView(data)) {
|
|
45134
|
+
return data.buffer;
|
|
45135
|
+
}
|
|
45136
|
+
if (utils.isURLSearchParams(data)) {
|
|
45137
|
+
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
|
45138
|
+
return data.toString();
|
|
45139
|
+
}
|
|
45140
|
+
|
|
45141
|
+
let isFileList;
|
|
45142
|
+
|
|
45143
|
+
if (isObjectPayload) {
|
|
45144
|
+
if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
|
|
45145
|
+
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
45146
|
+
}
|
|
45147
|
+
|
|
45148
|
+
if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
|
|
45149
|
+
const _FormData = this.env && this.env.FormData;
|
|
45150
|
+
|
|
45151
|
+
return toFormData(
|
|
45152
|
+
isFileList ? {'files[]': data} : data,
|
|
45153
|
+
_FormData && new _FormData(),
|
|
45154
|
+
this.formSerializer
|
|
45155
|
+
);
|
|
45156
|
+
}
|
|
45157
|
+
}
|
|
45158
|
+
|
|
45159
|
+
if (isObjectPayload || hasJSONContentType ) {
|
|
45160
|
+
headers.setContentType('application/json', false);
|
|
45161
|
+
return stringifySafely(data);
|
|
45162
|
+
}
|
|
45163
|
+
|
|
45164
|
+
return data;
|
|
45165
|
+
}],
|
|
45166
|
+
|
|
45167
|
+
transformResponse: [function transformResponse(data) {
|
|
45168
|
+
const transitional = this.transitional || defaults.transitional;
|
|
45169
|
+
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
45170
|
+
const JSONRequested = this.responseType === 'json';
|
|
45171
|
+
|
|
45172
|
+
if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
|
45173
|
+
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
45174
|
+
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
45175
|
+
|
|
45176
|
+
try {
|
|
45177
|
+
return JSON.parse(data);
|
|
45178
|
+
} catch (e) {
|
|
45179
|
+
if (strictJSONParsing) {
|
|
45180
|
+
if (e.name === 'SyntaxError') {
|
|
45181
|
+
throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
|
|
45182
|
+
}
|
|
45183
|
+
throw e;
|
|
45184
|
+
}
|
|
45185
|
+
}
|
|
45186
|
+
}
|
|
45187
|
+
|
|
45188
|
+
return data;
|
|
45189
|
+
}],
|
|
45190
|
+
|
|
45191
|
+
/**
|
|
45192
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
45193
|
+
* timeout is not created.
|
|
45194
|
+
*/
|
|
45195
|
+
timeout: 0,
|
|
45196
|
+
|
|
45197
|
+
xsrfCookieName: 'XSRF-TOKEN',
|
|
45198
|
+
xsrfHeaderName: 'X-XSRF-TOKEN',
|
|
45199
|
+
|
|
45200
|
+
maxContentLength: -1,
|
|
45201
|
+
maxBodyLength: -1,
|
|
45202
|
+
|
|
45203
|
+
env: {
|
|
45204
|
+
FormData: platform$1.classes.FormData,
|
|
45205
|
+
Blob: platform$1.classes.Blob
|
|
45206
|
+
},
|
|
45207
|
+
|
|
45208
|
+
validateStatus: function validateStatus(status) {
|
|
45209
|
+
return status >= 200 && status < 300;
|
|
45210
|
+
},
|
|
45211
|
+
|
|
45212
|
+
headers: {
|
|
45213
|
+
common: {
|
|
45214
|
+
'Accept': 'application/json, text/plain, */*',
|
|
45215
|
+
'Content-Type': undefined
|
|
45216
|
+
}
|
|
45217
|
+
}
|
|
45218
|
+
};
|
|
45219
|
+
|
|
45220
|
+
utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
|
45221
|
+
defaults.headers[method] = {};
|
|
45222
|
+
});
|
|
45223
|
+
|
|
45224
|
+
// RawAxiosHeaders whose duplicates are ignored by node
|
|
45225
|
+
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
45226
|
+
const ignoreDuplicateOf = utils.toObjectSet([
|
|
45227
|
+
'age', 'authorization', 'content-length', 'content-type', 'etag',
|
|
45228
|
+
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
|
|
45229
|
+
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
|
|
45230
|
+
'referer', 'retry-after', 'user-agent'
|
|
45231
|
+
]);
|
|
45232
|
+
|
|
45233
|
+
/**
|
|
45234
|
+
* Parse headers into an object
|
|
45235
|
+
*
|
|
45236
|
+
* ```
|
|
45237
|
+
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
|
45238
|
+
* Content-Type: application/json
|
|
45239
|
+
* Connection: keep-alive
|
|
45240
|
+
* Transfer-Encoding: chunked
|
|
45241
|
+
* ```
|
|
45242
|
+
*
|
|
45243
|
+
* @param {String} rawHeaders Headers needing to be parsed
|
|
45244
|
+
*
|
|
45245
|
+
* @returns {Object} Headers parsed into an object
|
|
45246
|
+
*/
|
|
45247
|
+
var parseHeaders = rawHeaders => {
|
|
45248
|
+
const parsed = {};
|
|
45249
|
+
let key;
|
|
45250
|
+
let val;
|
|
45251
|
+
let i;
|
|
45252
|
+
|
|
45253
|
+
rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
|
|
45254
|
+
i = line.indexOf(':');
|
|
45255
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
45256
|
+
val = line.substring(i + 1).trim();
|
|
45257
|
+
|
|
45258
|
+
if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
|
|
45259
|
+
return;
|
|
45260
|
+
}
|
|
45261
|
+
|
|
45262
|
+
if (key === 'set-cookie') {
|
|
45263
|
+
if (parsed[key]) {
|
|
45264
|
+
parsed[key].push(val);
|
|
45265
|
+
} else {
|
|
45266
|
+
parsed[key] = [val];
|
|
45267
|
+
}
|
|
45268
|
+
} else {
|
|
45269
|
+
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
45270
|
+
}
|
|
45271
|
+
});
|
|
45272
|
+
|
|
45273
|
+
return parsed;
|
|
45274
|
+
};
|
|
45275
|
+
|
|
45276
|
+
const $internals = Symbol('internals');
|
|
45277
|
+
|
|
45278
|
+
function normalizeHeader(header) {
|
|
45279
|
+
return header && String(header).trim().toLowerCase();
|
|
45280
|
+
}
|
|
45281
|
+
|
|
45282
|
+
function normalizeValue(value) {
|
|
45283
|
+
if (value === false || value == null) {
|
|
45284
|
+
return value;
|
|
45285
|
+
}
|
|
45286
|
+
|
|
45287
|
+
return utils.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
45288
|
+
}
|
|
45289
|
+
|
|
45290
|
+
function parseTokens(str) {
|
|
45291
|
+
const tokens = Object.create(null);
|
|
45292
|
+
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
45293
|
+
let match;
|
|
45294
|
+
|
|
45295
|
+
while ((match = tokensRE.exec(str))) {
|
|
45296
|
+
tokens[match[1]] = match[2];
|
|
45297
|
+
}
|
|
45298
|
+
|
|
45299
|
+
return tokens;
|
|
45300
|
+
}
|
|
45301
|
+
|
|
45302
|
+
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
45303
|
+
|
|
45304
|
+
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
45305
|
+
if (utils.isFunction(filter)) {
|
|
45306
|
+
return filter.call(this, value, header);
|
|
45307
|
+
}
|
|
45308
|
+
|
|
45309
|
+
if (isHeaderNameFilter) {
|
|
45310
|
+
value = header;
|
|
45311
|
+
}
|
|
45312
|
+
|
|
45313
|
+
if (!utils.isString(value)) return;
|
|
45314
|
+
|
|
45315
|
+
if (utils.isString(filter)) {
|
|
45316
|
+
return value.indexOf(filter) !== -1;
|
|
45317
|
+
}
|
|
45318
|
+
|
|
45319
|
+
if (utils.isRegExp(filter)) {
|
|
45320
|
+
return filter.test(value);
|
|
45321
|
+
}
|
|
45322
|
+
}
|
|
45323
|
+
|
|
45324
|
+
function formatHeader(header) {
|
|
45325
|
+
return header.trim()
|
|
45326
|
+
.toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
45327
|
+
return char.toUpperCase() + str;
|
|
45328
|
+
});
|
|
45329
|
+
}
|
|
45330
|
+
|
|
45331
|
+
function buildAccessors(obj, header) {
|
|
45332
|
+
const accessorName = utils.toCamelCase(' ' + header);
|
|
45333
|
+
|
|
45334
|
+
['get', 'set', 'has'].forEach(methodName => {
|
|
45335
|
+
Object.defineProperty(obj, methodName + accessorName, {
|
|
45336
|
+
value: function(arg1, arg2, arg3) {
|
|
45337
|
+
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
45338
|
+
},
|
|
45339
|
+
configurable: true
|
|
45340
|
+
});
|
|
45341
|
+
});
|
|
45342
|
+
}
|
|
45343
|
+
|
|
45344
|
+
class AxiosHeaders {
|
|
45345
|
+
constructor(headers) {
|
|
45346
|
+
headers && this.set(headers);
|
|
45347
|
+
}
|
|
45348
|
+
|
|
45349
|
+
set(header, valueOrRewrite, rewrite) {
|
|
45350
|
+
const self = this;
|
|
45351
|
+
|
|
45352
|
+
function setHeader(_value, _header, _rewrite) {
|
|
45353
|
+
const lHeader = normalizeHeader(_header);
|
|
45354
|
+
|
|
45355
|
+
if (!lHeader) {
|
|
45356
|
+
throw new Error('header name must be a non-empty string');
|
|
45357
|
+
}
|
|
45358
|
+
|
|
45359
|
+
const key = utils.findKey(self, lHeader);
|
|
45360
|
+
|
|
45361
|
+
if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
|
|
45362
|
+
self[key || _header] = normalizeValue(_value);
|
|
45363
|
+
}
|
|
45364
|
+
}
|
|
45365
|
+
|
|
45366
|
+
const setHeaders = (headers, _rewrite) =>
|
|
45367
|
+
utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
45368
|
+
|
|
45369
|
+
if (utils.isPlainObject(header) || header instanceof this.constructor) {
|
|
45370
|
+
setHeaders(header, valueOrRewrite);
|
|
45371
|
+
} else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
45372
|
+
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
45373
|
+
} else {
|
|
45374
|
+
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
45375
|
+
}
|
|
45376
|
+
|
|
45377
|
+
return this;
|
|
45378
|
+
}
|
|
45379
|
+
|
|
45380
|
+
get(header, parser) {
|
|
45381
|
+
header = normalizeHeader(header);
|
|
45382
|
+
|
|
45383
|
+
if (header) {
|
|
45384
|
+
const key = utils.findKey(this, header);
|
|
45385
|
+
|
|
45386
|
+
if (key) {
|
|
45387
|
+
const value = this[key];
|
|
45388
|
+
|
|
45389
|
+
if (!parser) {
|
|
45390
|
+
return value;
|
|
45391
|
+
}
|
|
45392
|
+
|
|
45393
|
+
if (parser === true) {
|
|
45394
|
+
return parseTokens(value);
|
|
45395
|
+
}
|
|
45396
|
+
|
|
45397
|
+
if (utils.isFunction(parser)) {
|
|
45398
|
+
return parser.call(this, value, key);
|
|
45399
|
+
}
|
|
45400
|
+
|
|
45401
|
+
if (utils.isRegExp(parser)) {
|
|
45402
|
+
return parser.exec(value);
|
|
45403
|
+
}
|
|
45404
|
+
|
|
45405
|
+
throw new TypeError('parser must be boolean|regexp|function');
|
|
45406
|
+
}
|
|
45407
|
+
}
|
|
45408
|
+
}
|
|
45409
|
+
|
|
45410
|
+
has(header, matcher) {
|
|
45411
|
+
header = normalizeHeader(header);
|
|
45412
|
+
|
|
45413
|
+
if (header) {
|
|
45414
|
+
const key = utils.findKey(this, header);
|
|
45415
|
+
|
|
45416
|
+
return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
45417
|
+
}
|
|
45418
|
+
|
|
45419
|
+
return false;
|
|
45420
|
+
}
|
|
45421
|
+
|
|
45422
|
+
delete(header, matcher) {
|
|
45423
|
+
const self = this;
|
|
45424
|
+
let deleted = false;
|
|
45425
|
+
|
|
45426
|
+
function deleteHeader(_header) {
|
|
45427
|
+
_header = normalizeHeader(_header);
|
|
45428
|
+
|
|
45429
|
+
if (_header) {
|
|
45430
|
+
const key = utils.findKey(self, _header);
|
|
45431
|
+
|
|
45432
|
+
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
|
|
45433
|
+
delete self[key];
|
|
45434
|
+
|
|
45435
|
+
deleted = true;
|
|
45436
|
+
}
|
|
45437
|
+
}
|
|
45438
|
+
}
|
|
45439
|
+
|
|
45440
|
+
if (utils.isArray(header)) {
|
|
45441
|
+
header.forEach(deleteHeader);
|
|
45442
|
+
} else {
|
|
45443
|
+
deleteHeader(header);
|
|
45444
|
+
}
|
|
45445
|
+
|
|
45446
|
+
return deleted;
|
|
45447
|
+
}
|
|
45448
|
+
|
|
45449
|
+
clear(matcher) {
|
|
45450
|
+
const keys = Object.keys(this);
|
|
45451
|
+
let i = keys.length;
|
|
45452
|
+
let deleted = false;
|
|
45453
|
+
|
|
45454
|
+
while (i--) {
|
|
45455
|
+
const key = keys[i];
|
|
45456
|
+
if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
45457
|
+
delete this[key];
|
|
45458
|
+
deleted = true;
|
|
45459
|
+
}
|
|
45460
|
+
}
|
|
45461
|
+
|
|
45462
|
+
return deleted;
|
|
44069
45463
|
}
|
|
44070
45464
|
|
|
44071
|
-
|
|
44072
|
-
|
|
44073
|
-
|
|
44074
|
-
} else if (utils.isURLSearchParams(params)) {
|
|
44075
|
-
serializedParams = params.toString();
|
|
44076
|
-
} else {
|
|
44077
|
-
var parts = [];
|
|
45465
|
+
normalize(format) {
|
|
45466
|
+
const self = this;
|
|
45467
|
+
const headers = {};
|
|
44078
45468
|
|
|
44079
|
-
utils.forEach(
|
|
44080
|
-
|
|
45469
|
+
utils.forEach(this, (value, header) => {
|
|
45470
|
+
const key = utils.findKey(headers, header);
|
|
45471
|
+
|
|
45472
|
+
if (key) {
|
|
45473
|
+
self[key] = normalizeValue(value);
|
|
45474
|
+
delete self[header];
|
|
44081
45475
|
return;
|
|
44082
45476
|
}
|
|
44083
45477
|
|
|
44084
|
-
|
|
44085
|
-
|
|
44086
|
-
|
|
44087
|
-
|
|
45478
|
+
const normalized = format ? formatHeader(header) : String(header).trim();
|
|
45479
|
+
|
|
45480
|
+
if (normalized !== header) {
|
|
45481
|
+
delete self[header];
|
|
44088
45482
|
}
|
|
44089
45483
|
|
|
44090
|
-
|
|
44091
|
-
|
|
44092
|
-
|
|
44093
|
-
} else if (utils.isObject(v)) {
|
|
44094
|
-
v = JSON.stringify(v);
|
|
44095
|
-
}
|
|
44096
|
-
parts.push(encode(key) + '=' + encode(v));
|
|
44097
|
-
});
|
|
45484
|
+
self[normalized] = normalizeValue(value);
|
|
45485
|
+
|
|
45486
|
+
headers[normalized] = true;
|
|
44098
45487
|
});
|
|
44099
45488
|
|
|
44100
|
-
|
|
45489
|
+
return this;
|
|
44101
45490
|
}
|
|
44102
45491
|
|
|
44103
|
-
|
|
44104
|
-
|
|
44105
|
-
|
|
44106
|
-
url = url.slice(0, hashmarkIndex);
|
|
44107
|
-
}
|
|
45492
|
+
concat(...targets) {
|
|
45493
|
+
return this.constructor.concat(this, ...targets);
|
|
45494
|
+
}
|
|
44108
45495
|
|
|
44109
|
-
|
|
45496
|
+
toJSON(asStrings) {
|
|
45497
|
+
const obj = Object.create(null);
|
|
45498
|
+
|
|
45499
|
+
utils.forEach(this, (value, header) => {
|
|
45500
|
+
value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
|
|
45501
|
+
});
|
|
45502
|
+
|
|
45503
|
+
return obj;
|
|
44110
45504
|
}
|
|
44111
45505
|
|
|
44112
|
-
|
|
44113
|
-
|
|
45506
|
+
[Symbol.iterator]() {
|
|
45507
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
45508
|
+
}
|
|
44114
45509
|
|
|
44115
|
-
|
|
44116
|
-
|
|
44117
|
-
|
|
45510
|
+
toString() {
|
|
45511
|
+
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
|
|
45512
|
+
}
|
|
44118
45513
|
|
|
44119
|
-
|
|
44120
|
-
|
|
44121
|
-
|
|
44122
|
-
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
44123
|
-
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
44124
|
-
*
|
|
44125
|
-
* @return {Number} An ID used to remove interceptor later
|
|
44126
|
-
*/
|
|
44127
|
-
InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
|
|
44128
|
-
this.handlers.push({
|
|
44129
|
-
fulfilled: fulfilled,
|
|
44130
|
-
rejected: rejected,
|
|
44131
|
-
synchronous: options ? options.synchronous : false,
|
|
44132
|
-
runWhen: options ? options.runWhen : null
|
|
44133
|
-
});
|
|
44134
|
-
return this.handlers.length - 1;
|
|
44135
|
-
};
|
|
45514
|
+
get [Symbol.toStringTag]() {
|
|
45515
|
+
return 'AxiosHeaders';
|
|
45516
|
+
}
|
|
44136
45517
|
|
|
44137
|
-
|
|
44138
|
-
|
|
44139
|
-
*
|
|
44140
|
-
* @param {Number} id The ID that was returned by `use`
|
|
44141
|
-
*/
|
|
44142
|
-
InterceptorManager.prototype.eject = function eject(id) {
|
|
44143
|
-
if (this.handlers[id]) {
|
|
44144
|
-
this.handlers[id] = null;
|
|
45518
|
+
static from(thing) {
|
|
45519
|
+
return thing instanceof this ? thing : new this(thing);
|
|
44145
45520
|
}
|
|
44146
|
-
};
|
|
44147
45521
|
|
|
44148
|
-
|
|
44149
|
-
|
|
44150
|
-
|
|
44151
|
-
|
|
44152
|
-
|
|
44153
|
-
|
|
44154
|
-
|
|
44155
|
-
|
|
44156
|
-
|
|
44157
|
-
|
|
44158
|
-
|
|
44159
|
-
|
|
45522
|
+
static concat(first, ...targets) {
|
|
45523
|
+
const computed = new this(first);
|
|
45524
|
+
|
|
45525
|
+
targets.forEach((target) => computed.set(target));
|
|
45526
|
+
|
|
45527
|
+
return computed;
|
|
45528
|
+
}
|
|
45529
|
+
|
|
45530
|
+
static accessor(header) {
|
|
45531
|
+
const internals = this[$internals] = (this[$internals] = {
|
|
45532
|
+
accessors: {}
|
|
45533
|
+
});
|
|
45534
|
+
|
|
45535
|
+
const accessors = internals.accessors;
|
|
45536
|
+
const prototype = this.prototype;
|
|
45537
|
+
|
|
45538
|
+
function defineAccessor(_header) {
|
|
45539
|
+
const lHeader = normalizeHeader(_header);
|
|
45540
|
+
|
|
45541
|
+
if (!accessors[lHeader]) {
|
|
45542
|
+
buildAccessors(prototype, _header);
|
|
45543
|
+
accessors[lHeader] = true;
|
|
45544
|
+
}
|
|
44160
45545
|
}
|
|
44161
|
-
});
|
|
44162
|
-
};
|
|
44163
45546
|
|
|
44164
|
-
|
|
45547
|
+
utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
45548
|
+
|
|
45549
|
+
return this;
|
|
45550
|
+
}
|
|
45551
|
+
}
|
|
45552
|
+
|
|
45553
|
+
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
|
|
44165
45554
|
|
|
44166
|
-
|
|
44167
|
-
|
|
44168
|
-
|
|
44169
|
-
|
|
44170
|
-
|
|
45555
|
+
// reserved names hotfix
|
|
45556
|
+
utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
|
45557
|
+
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
|
45558
|
+
return {
|
|
45559
|
+
get: () => value,
|
|
45560
|
+
set(headerValue) {
|
|
45561
|
+
this[mapped] = headerValue;
|
|
44171
45562
|
}
|
|
44172
|
-
}
|
|
44173
|
-
};
|
|
45563
|
+
}
|
|
45564
|
+
});
|
|
45565
|
+
|
|
45566
|
+
utils.freezeMethods(AxiosHeaders);
|
|
44174
45567
|
|
|
44175
45568
|
/**
|
|
44176
|
-
*
|
|
45569
|
+
* Transform the data for a request or a response
|
|
44177
45570
|
*
|
|
44178
|
-
* @param {
|
|
44179
|
-
* @param {Object}
|
|
44180
|
-
*
|
|
44181
|
-
* @
|
|
44182
|
-
* @param {Object} [response] The response.
|
|
44183
|
-
* @returns {Error} The error.
|
|
45571
|
+
* @param {Array|Function} fns A single function or Array of functions
|
|
45572
|
+
* @param {?Object} response The response object
|
|
45573
|
+
*
|
|
45574
|
+
* @returns {*} The resulting transformed data
|
|
44184
45575
|
*/
|
|
44185
|
-
|
|
44186
|
-
|
|
44187
|
-
|
|
44188
|
-
|
|
44189
|
-
|
|
45576
|
+
function transformData(fns, response) {
|
|
45577
|
+
const config = this || defaults;
|
|
45578
|
+
const context = response || config;
|
|
45579
|
+
const headers = AxiosHeaders.from(context.headers);
|
|
45580
|
+
let data = context.data;
|
|
44190
45581
|
|
|
44191
|
-
|
|
44192
|
-
|
|
44193
|
-
|
|
45582
|
+
utils.forEach(fns, function transform(fn) {
|
|
45583
|
+
data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
|
|
45584
|
+
});
|
|
44194
45585
|
|
|
44195
|
-
|
|
44196
|
-
|
|
44197
|
-
|
|
44198
|
-
|
|
44199
|
-
|
|
44200
|
-
|
|
44201
|
-
|
|
44202
|
-
|
|
44203
|
-
// Mozilla
|
|
44204
|
-
fileName: this.fileName,
|
|
44205
|
-
lineNumber: this.lineNumber,
|
|
44206
|
-
columnNumber: this.columnNumber,
|
|
44207
|
-
stack: this.stack,
|
|
44208
|
-
// Axios
|
|
44209
|
-
config: this.config,
|
|
44210
|
-
code: this.code,
|
|
44211
|
-
status: this.response && this.response.status ? this.response.status : null
|
|
44212
|
-
};
|
|
44213
|
-
};
|
|
44214
|
-
return error;
|
|
44215
|
-
};
|
|
45586
|
+
headers.normalize();
|
|
45587
|
+
|
|
45588
|
+
return data;
|
|
45589
|
+
}
|
|
45590
|
+
|
|
45591
|
+
function isCancel(value) {
|
|
45592
|
+
return !!(value && value.__CANCEL__);
|
|
45593
|
+
}
|
|
44216
45594
|
|
|
44217
45595
|
/**
|
|
44218
|
-
*
|
|
45596
|
+
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
44219
45597
|
*
|
|
44220
|
-
* @param {string} message The
|
|
44221
|
-
* @param {Object} config The config.
|
|
44222
|
-
* @param {
|
|
44223
|
-
*
|
|
44224
|
-
* @
|
|
44225
|
-
* @returns {Error} The created error.
|
|
45598
|
+
* @param {string=} message The message.
|
|
45599
|
+
* @param {Object=} config The config.
|
|
45600
|
+
* @param {Object=} request The request.
|
|
45601
|
+
*
|
|
45602
|
+
* @returns {CanceledError} The created error.
|
|
44226
45603
|
*/
|
|
44227
|
-
|
|
44228
|
-
|
|
44229
|
-
|
|
44230
|
-
|
|
45604
|
+
function CanceledError(message, config, request) {
|
|
45605
|
+
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
45606
|
+
AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
|
|
45607
|
+
this.name = 'CanceledError';
|
|
45608
|
+
}
|
|
45609
|
+
|
|
45610
|
+
utils.inherits(CanceledError, AxiosError, {
|
|
45611
|
+
__CANCEL__: true
|
|
45612
|
+
});
|
|
44231
45613
|
|
|
44232
45614
|
/**
|
|
44233
45615
|
* Resolve or reject a Promise based on response status.
|
|
@@ -44235,97 +45617,51 @@ var Neurosity = (function (exports) {
|
|
|
44235
45617
|
* @param {Function} resolve A function that resolves the promise.
|
|
44236
45618
|
* @param {Function} reject A function that rejects the promise.
|
|
44237
45619
|
* @param {object} response The response.
|
|
45620
|
+
*
|
|
45621
|
+
* @returns {object} The response.
|
|
44238
45622
|
*/
|
|
44239
|
-
|
|
44240
|
-
|
|
45623
|
+
function settle(resolve, reject, response) {
|
|
45624
|
+
const validateStatus = response.config.validateStatus;
|
|
44241
45625
|
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
44242
45626
|
resolve(response);
|
|
44243
45627
|
} else {
|
|
44244
|
-
reject(
|
|
45628
|
+
reject(new AxiosError(
|
|
44245
45629
|
'Request failed with status code ' + response.status,
|
|
45630
|
+
[AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
|
|
44246
45631
|
response.config,
|
|
44247
|
-
null,
|
|
44248
45632
|
response.request,
|
|
44249
45633
|
response
|
|
44250
45634
|
));
|
|
44251
45635
|
}
|
|
44252
|
-
}
|
|
44253
|
-
|
|
44254
|
-
var cookies = (
|
|
44255
|
-
utils.isStandardBrowserEnv() ?
|
|
44256
|
-
|
|
44257
|
-
// Standard browser envs support document.cookie
|
|
44258
|
-
(function standardBrowserEnv() {
|
|
44259
|
-
return {
|
|
44260
|
-
write: function write(name, value, expires, path, domain, secure) {
|
|
44261
|
-
var cookie = [];
|
|
44262
|
-
cookie.push(name + '=' + encodeURIComponent(value));
|
|
44263
|
-
|
|
44264
|
-
if (utils.isNumber(expires)) {
|
|
44265
|
-
cookie.push('expires=' + new Date(expires).toGMTString());
|
|
44266
|
-
}
|
|
44267
|
-
|
|
44268
|
-
if (utils.isString(path)) {
|
|
44269
|
-
cookie.push('path=' + path);
|
|
44270
|
-
}
|
|
44271
|
-
|
|
44272
|
-
if (utils.isString(domain)) {
|
|
44273
|
-
cookie.push('domain=' + domain);
|
|
44274
|
-
}
|
|
44275
|
-
|
|
44276
|
-
if (secure === true) {
|
|
44277
|
-
cookie.push('secure');
|
|
44278
|
-
}
|
|
44279
|
-
|
|
44280
|
-
document.cookie = cookie.join('; ');
|
|
44281
|
-
},
|
|
44282
|
-
|
|
44283
|
-
read: function read(name) {
|
|
44284
|
-
var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
|
44285
|
-
return (match ? decodeURIComponent(match[3]) : null);
|
|
44286
|
-
},
|
|
44287
|
-
|
|
44288
|
-
remove: function remove(name) {
|
|
44289
|
-
this.write(name, '', Date.now() - 86400000);
|
|
44290
|
-
}
|
|
44291
|
-
};
|
|
44292
|
-
})() :
|
|
44293
|
-
|
|
44294
|
-
// Non standard browser env (web workers, react-native) lack needed support.
|
|
44295
|
-
(function nonStandardBrowserEnv() {
|
|
44296
|
-
return {
|
|
44297
|
-
write: function write() {},
|
|
44298
|
-
read: function read() { return null; },
|
|
44299
|
-
remove: function remove() {}
|
|
44300
|
-
};
|
|
44301
|
-
})()
|
|
44302
|
-
);
|
|
45636
|
+
}
|
|
44303
45637
|
|
|
44304
45638
|
/**
|
|
44305
45639
|
* Determines whether the specified URL is absolute
|
|
44306
45640
|
*
|
|
44307
45641
|
* @param {string} url The URL to test
|
|
45642
|
+
*
|
|
44308
45643
|
* @returns {boolean} True if the specified URL is absolute, otherwise false
|
|
44309
45644
|
*/
|
|
44310
|
-
|
|
45645
|
+
function isAbsoluteURL(url) {
|
|
44311
45646
|
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
44312
45647
|
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
44313
45648
|
// by any combination of letters, digits, plus, period, or hyphen.
|
|
44314
45649
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
44315
|
-
}
|
|
45650
|
+
}
|
|
44316
45651
|
|
|
44317
45652
|
/**
|
|
44318
45653
|
* Creates a new URL by combining the specified URLs
|
|
44319
45654
|
*
|
|
44320
45655
|
* @param {string} baseURL The base URL
|
|
44321
45656
|
* @param {string} relativeURL The relative URL
|
|
45657
|
+
*
|
|
44322
45658
|
* @returns {string} The combined URL
|
|
44323
45659
|
*/
|
|
44324
|
-
|
|
45660
|
+
function combineURLs(baseURL, relativeURL) {
|
|
44325
45661
|
return relativeURL
|
|
44326
45662
|
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
|
|
44327
45663
|
: baseURL;
|
|
44328
|
-
}
|
|
45664
|
+
}
|
|
44329
45665
|
|
|
44330
45666
|
/**
|
|
44331
45667
|
* Creates a new URL by combining the baseURL with the requestedURL,
|
|
@@ -44334,154 +45670,110 @@ var Neurosity = (function (exports) {
|
|
|
44334
45670
|
*
|
|
44335
45671
|
* @param {string} baseURL The base URL
|
|
44336
45672
|
* @param {string} requestedURL Absolute or relative URL to combine
|
|
45673
|
+
*
|
|
44337
45674
|
* @returns {string} The combined full path
|
|
44338
45675
|
*/
|
|
44339
|
-
|
|
45676
|
+
function buildFullPath(baseURL, requestedURL) {
|
|
44340
45677
|
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
|
44341
45678
|
return combineURLs(baseURL, requestedURL);
|
|
44342
45679
|
}
|
|
44343
45680
|
return requestedURL;
|
|
44344
|
-
}
|
|
45681
|
+
}
|
|
44345
45682
|
|
|
44346
|
-
|
|
44347
|
-
|
|
44348
|
-
|
|
44349
|
-
|
|
44350
|
-
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
|
|
44351
|
-
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
|
|
44352
|
-
'referer', 'retry-after', 'user-agent'
|
|
44353
|
-
];
|
|
45683
|
+
function parseProtocol(url) {
|
|
45684
|
+
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
45685
|
+
return match && match[1] || '';
|
|
45686
|
+
}
|
|
44354
45687
|
|
|
44355
45688
|
/**
|
|
44356
|
-
*
|
|
44357
|
-
*
|
|
44358
|
-
*
|
|
44359
|
-
*
|
|
44360
|
-
* Content-Type: application/json
|
|
44361
|
-
* Connection: keep-alive
|
|
44362
|
-
* Transfer-Encoding: chunked
|
|
44363
|
-
* ```
|
|
44364
|
-
*
|
|
44365
|
-
* @param {String} headers Headers needing to be parsed
|
|
44366
|
-
* @returns {Object} Headers parsed into an object
|
|
45689
|
+
* Calculate data maxRate
|
|
45690
|
+
* @param {Number} [samplesCount= 10]
|
|
45691
|
+
* @param {Number} [min= 1000]
|
|
45692
|
+
* @returns {Function}
|
|
44367
45693
|
*/
|
|
44368
|
-
|
|
44369
|
-
|
|
44370
|
-
|
|
44371
|
-
|
|
44372
|
-
|
|
45694
|
+
function speedometer(samplesCount, min) {
|
|
45695
|
+
samplesCount = samplesCount || 10;
|
|
45696
|
+
const bytes = new Array(samplesCount);
|
|
45697
|
+
const timestamps = new Array(samplesCount);
|
|
45698
|
+
let head = 0;
|
|
45699
|
+
let tail = 0;
|
|
45700
|
+
let firstSampleTS;
|
|
44373
45701
|
|
|
44374
|
-
|
|
45702
|
+
min = min !== undefined ? min : 1000;
|
|
44375
45703
|
|
|
44376
|
-
|
|
44377
|
-
|
|
44378
|
-
key = utils.trim(line.substr(0, i)).toLowerCase();
|
|
44379
|
-
val = utils.trim(line.substr(i + 1));
|
|
45704
|
+
return function push(chunkLength) {
|
|
45705
|
+
const now = Date.now();
|
|
44380
45706
|
|
|
44381
|
-
|
|
44382
|
-
|
|
44383
|
-
|
|
44384
|
-
|
|
44385
|
-
if (key === 'set-cookie') {
|
|
44386
|
-
parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
|
|
44387
|
-
} else {
|
|
44388
|
-
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
44389
|
-
}
|
|
45707
|
+
const startedAt = timestamps[tail];
|
|
45708
|
+
|
|
45709
|
+
if (!firstSampleTS) {
|
|
45710
|
+
firstSampleTS = now;
|
|
44390
45711
|
}
|
|
44391
|
-
});
|
|
44392
45712
|
|
|
44393
|
-
|
|
44394
|
-
|
|
45713
|
+
bytes[head] = chunkLength;
|
|
45714
|
+
timestamps[head] = now;
|
|
44395
45715
|
|
|
44396
|
-
|
|
44397
|
-
|
|
45716
|
+
let i = tail;
|
|
45717
|
+
let bytesCount = 0;
|
|
44398
45718
|
|
|
44399
|
-
|
|
44400
|
-
|
|
44401
|
-
|
|
44402
|
-
|
|
44403
|
-
var urlParsingNode = document.createElement('a');
|
|
44404
|
-
var originURL;
|
|
45719
|
+
while (i !== head) {
|
|
45720
|
+
bytesCount += bytes[i++];
|
|
45721
|
+
i = i % samplesCount;
|
|
45722
|
+
}
|
|
44405
45723
|
|
|
44406
|
-
|
|
44407
|
-
* Parse a URL to discover it's components
|
|
44408
|
-
*
|
|
44409
|
-
* @param {String} url The URL to be parsed
|
|
44410
|
-
* @returns {Object}
|
|
44411
|
-
*/
|
|
44412
|
-
function resolveURL(url) {
|
|
44413
|
-
var href = url;
|
|
45724
|
+
head = (head + 1) % samplesCount;
|
|
44414
45725
|
|
|
44415
|
-
|
|
44416
|
-
|
|
44417
|
-
|
|
44418
|
-
href = urlParsingNode.href;
|
|
44419
|
-
}
|
|
45726
|
+
if (head === tail) {
|
|
45727
|
+
tail = (tail + 1) % samplesCount;
|
|
45728
|
+
}
|
|
44420
45729
|
|
|
44421
|
-
|
|
45730
|
+
if (now - firstSampleTS < min) {
|
|
45731
|
+
return;
|
|
45732
|
+
}
|
|
44422
45733
|
|
|
44423
|
-
|
|
44424
|
-
return {
|
|
44425
|
-
href: urlParsingNode.href,
|
|
44426
|
-
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
|
44427
|
-
host: urlParsingNode.host,
|
|
44428
|
-
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
|
44429
|
-
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
|
44430
|
-
hostname: urlParsingNode.hostname,
|
|
44431
|
-
port: urlParsingNode.port,
|
|
44432
|
-
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
|
|
44433
|
-
urlParsingNode.pathname :
|
|
44434
|
-
'/' + urlParsingNode.pathname
|
|
44435
|
-
};
|
|
44436
|
-
}
|
|
45734
|
+
const passed = startedAt && now - startedAt;
|
|
44437
45735
|
|
|
44438
|
-
|
|
44439
|
-
|
|
44440
|
-
|
|
44441
|
-
* Determine if a URL shares the same origin as the current location
|
|
44442
|
-
*
|
|
44443
|
-
* @param {String} requestURL The URL to test
|
|
44444
|
-
* @returns {boolean} True if URL shares the same origin, otherwise false
|
|
44445
|
-
*/
|
|
44446
|
-
return function isURLSameOrigin(requestURL) {
|
|
44447
|
-
var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
|
44448
|
-
return (parsed.protocol === originURL.protocol &&
|
|
44449
|
-
parsed.host === originURL.host);
|
|
44450
|
-
};
|
|
44451
|
-
})() :
|
|
45736
|
+
return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
|
|
45737
|
+
};
|
|
45738
|
+
}
|
|
44452
45739
|
|
|
44453
|
-
|
|
44454
|
-
|
|
44455
|
-
|
|
44456
|
-
return true;
|
|
44457
|
-
};
|
|
44458
|
-
})()
|
|
44459
|
-
);
|
|
45740
|
+
function progressEventReducer(listener, isDownloadStream) {
|
|
45741
|
+
let bytesNotified = 0;
|
|
45742
|
+
const _speedometer = speedometer(50, 250);
|
|
44460
45743
|
|
|
44461
|
-
|
|
44462
|
-
|
|
44463
|
-
|
|
44464
|
-
|
|
44465
|
-
|
|
44466
|
-
|
|
44467
|
-
function Cancel(message) {
|
|
44468
|
-
this.message = message;
|
|
44469
|
-
}
|
|
45744
|
+
return e => {
|
|
45745
|
+
const loaded = e.loaded;
|
|
45746
|
+
const total = e.lengthComputable ? e.total : undefined;
|
|
45747
|
+
const progressBytes = loaded - bytesNotified;
|
|
45748
|
+
const rate = _speedometer(progressBytes);
|
|
45749
|
+
const inRange = loaded <= total;
|
|
44470
45750
|
|
|
44471
|
-
|
|
44472
|
-
|
|
44473
|
-
|
|
45751
|
+
bytesNotified = loaded;
|
|
45752
|
+
|
|
45753
|
+
const data = {
|
|
45754
|
+
loaded,
|
|
45755
|
+
total,
|
|
45756
|
+
progress: total ? (loaded / total) : undefined,
|
|
45757
|
+
bytes: progressBytes,
|
|
45758
|
+
rate: rate ? rate : undefined,
|
|
45759
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
|
|
45760
|
+
event: e
|
|
45761
|
+
};
|
|
44474
45762
|
|
|
44475
|
-
|
|
45763
|
+
data[isDownloadStream ? 'download' : 'upload'] = true;
|
|
44476
45764
|
|
|
44477
|
-
|
|
45765
|
+
listener(data);
|
|
45766
|
+
};
|
|
45767
|
+
}
|
|
44478
45768
|
|
|
44479
|
-
|
|
45769
|
+
const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
45770
|
+
|
|
45771
|
+
var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
44480
45772
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
44481
|
-
|
|
44482
|
-
|
|
44483
|
-
|
|
44484
|
-
|
|
45773
|
+
let requestData = config.data;
|
|
45774
|
+
const requestHeaders = AxiosHeaders.from(config.headers).normalize();
|
|
45775
|
+
let {responseType, withXSRFToken} = config;
|
|
45776
|
+
let onCanceled;
|
|
44485
45777
|
function done() {
|
|
44486
45778
|
if (config.cancelToken) {
|
|
44487
45779
|
config.cancelToken.unsubscribe(onCanceled);
|
|
@@ -44492,20 +45784,27 @@ var Neurosity = (function (exports) {
|
|
|
44492
45784
|
}
|
|
44493
45785
|
}
|
|
44494
45786
|
|
|
45787
|
+
let contentType;
|
|
45788
|
+
|
|
44495
45789
|
if (utils.isFormData(requestData)) {
|
|
44496
|
-
|
|
45790
|
+
if ((contentType = requestHeaders.getContentType()) !== false) {
|
|
45791
|
+
// fix semicolon duplication issue for ReactNative FormData implementation
|
|
45792
|
+
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
|
|
45793
|
+
requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
|
45794
|
+
}
|
|
44497
45795
|
}
|
|
44498
45796
|
|
|
44499
|
-
|
|
45797
|
+
let request = new XMLHttpRequest();
|
|
44500
45798
|
|
|
44501
45799
|
// HTTP basic authentication
|
|
44502
45800
|
if (config.auth) {
|
|
44503
|
-
|
|
44504
|
-
|
|
44505
|
-
requestHeaders.Authorization
|
|
45801
|
+
const username = config.auth.username || '';
|
|
45802
|
+
const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
|
|
45803
|
+
requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
|
|
44506
45804
|
}
|
|
44507
45805
|
|
|
44508
|
-
|
|
45806
|
+
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
45807
|
+
|
|
44509
45808
|
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
|
44510
45809
|
|
|
44511
45810
|
// Set the request timeout in MS
|
|
@@ -44516,16 +45815,18 @@ var Neurosity = (function (exports) {
|
|
|
44516
45815
|
return;
|
|
44517
45816
|
}
|
|
44518
45817
|
// Prepare the response
|
|
44519
|
-
|
|
44520
|
-
|
|
45818
|
+
const responseHeaders = AxiosHeaders.from(
|
|
45819
|
+
'getAllResponseHeaders' in request && request.getAllResponseHeaders()
|
|
45820
|
+
);
|
|
45821
|
+
const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
|
|
44521
45822
|
request.responseText : request.response;
|
|
44522
|
-
|
|
45823
|
+
const response = {
|
|
44523
45824
|
data: responseData,
|
|
44524
45825
|
status: request.status,
|
|
44525
45826
|
statusText: request.statusText,
|
|
44526
45827
|
headers: responseHeaders,
|
|
44527
|
-
config
|
|
44528
|
-
request
|
|
45828
|
+
config,
|
|
45829
|
+
request
|
|
44529
45830
|
};
|
|
44530
45831
|
|
|
44531
45832
|
settle(function _resolve(value) {
|
|
@@ -44569,7 +45870,7 @@ var Neurosity = (function (exports) {
|
|
|
44569
45870
|
return;
|
|
44570
45871
|
}
|
|
44571
45872
|
|
|
44572
|
-
reject(
|
|
45873
|
+
reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
|
|
44573
45874
|
|
|
44574
45875
|
// Clean up request
|
|
44575
45876
|
request = null;
|
|
@@ -44579,7 +45880,7 @@ var Neurosity = (function (exports) {
|
|
|
44579
45880
|
request.onerror = function handleError() {
|
|
44580
45881
|
// Real errors are hidden from us by the browser
|
|
44581
45882
|
// onerror should only fire if it's a network error
|
|
44582
|
-
reject(
|
|
45883
|
+
reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));
|
|
44583
45884
|
|
|
44584
45885
|
// Clean up request
|
|
44585
45886
|
request = null;
|
|
@@ -44587,45 +45888,28 @@ var Neurosity = (function (exports) {
|
|
|
44587
45888
|
|
|
44588
45889
|
// Handle timeout
|
|
44589
45890
|
request.ontimeout = function handleTimeout() {
|
|
44590
|
-
|
|
44591
|
-
|
|
45891
|
+
let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
45892
|
+
const transitional = config.transitional || transitionalDefaults;
|
|
44592
45893
|
if (config.timeoutErrorMessage) {
|
|
44593
45894
|
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
44594
45895
|
}
|
|
44595
|
-
reject(
|
|
45896
|
+
reject(new AxiosError(
|
|
44596
45897
|
timeoutErrorMessage,
|
|
45898
|
+
transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
|
|
44597
45899
|
config,
|
|
44598
|
-
transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',
|
|
44599
45900
|
request));
|
|
44600
45901
|
|
|
44601
45902
|
// Clean up request
|
|
44602
45903
|
request = null;
|
|
44603
45904
|
};
|
|
44604
45905
|
|
|
44605
|
-
//
|
|
44606
|
-
|
|
44607
|
-
// Specifically not if we're in a web worker, or react-native.
|
|
44608
|
-
if (utils.isStandardBrowserEnv()) {
|
|
44609
|
-
// Add xsrf header
|
|
44610
|
-
var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
|
|
44611
|
-
cookies.read(config.xsrfCookieName) :
|
|
44612
|
-
undefined;
|
|
44613
|
-
|
|
44614
|
-
if (xsrfValue) {
|
|
44615
|
-
requestHeaders[config.xsrfHeaderName] = xsrfValue;
|
|
44616
|
-
}
|
|
44617
|
-
}
|
|
45906
|
+
// Remove Content-Type if data is undefined
|
|
45907
|
+
requestData === undefined && requestHeaders.setContentType(null);
|
|
44618
45908
|
|
|
44619
45909
|
// Add headers to the request
|
|
44620
45910
|
if ('setRequestHeader' in request) {
|
|
44621
|
-
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
|
|
44622
|
-
|
|
44623
|
-
// Remove Content-Type if data is undefined
|
|
44624
|
-
delete requestHeaders[key];
|
|
44625
|
-
} else {
|
|
44626
|
-
// Otherwise add header to the request
|
|
44627
|
-
request.setRequestHeader(key, val);
|
|
44628
|
-
}
|
|
45911
|
+
utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
45912
|
+
request.setRequestHeader(key, val);
|
|
44629
45913
|
});
|
|
44630
45914
|
}
|
|
44631
45915
|
|
|
@@ -44641,22 +45925,22 @@ var Neurosity = (function (exports) {
|
|
|
44641
45925
|
|
|
44642
45926
|
// Handle progress if needed
|
|
44643
45927
|
if (typeof config.onDownloadProgress === 'function') {
|
|
44644
|
-
request.addEventListener('progress', config.onDownloadProgress);
|
|
45928
|
+
request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));
|
|
44645
45929
|
}
|
|
44646
45930
|
|
|
44647
45931
|
// Not all browsers support upload events
|
|
44648
45932
|
if (typeof config.onUploadProgress === 'function' && request.upload) {
|
|
44649
|
-
request.upload.addEventListener('progress', config.onUploadProgress);
|
|
45933
|
+
request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));
|
|
44650
45934
|
}
|
|
44651
45935
|
|
|
44652
45936
|
if (config.cancelToken || config.signal) {
|
|
44653
45937
|
// Handle cancellation
|
|
44654
45938
|
// eslint-disable-next-line func-names
|
|
44655
|
-
onCanceled =
|
|
45939
|
+
onCanceled = cancel => {
|
|
44656
45940
|
if (!request) {
|
|
44657
45941
|
return;
|
|
44658
45942
|
}
|
|
44659
|
-
reject(!cancel ||
|
|
45943
|
+
reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
|
|
44660
45944
|
request.abort();
|
|
44661
45945
|
request = null;
|
|
44662
45946
|
};
|
|
@@ -44667,168 +45951,98 @@ var Neurosity = (function (exports) {
|
|
|
44667
45951
|
}
|
|
44668
45952
|
}
|
|
44669
45953
|
|
|
44670
|
-
|
|
44671
|
-
|
|
45954
|
+
const protocol = parseProtocol(fullPath);
|
|
45955
|
+
|
|
45956
|
+
if (protocol && platform$1.protocols.indexOf(protocol) === -1) {
|
|
45957
|
+
reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
|
|
45958
|
+
return;
|
|
44672
45959
|
}
|
|
44673
45960
|
|
|
45961
|
+
|
|
44674
45962
|
// Send the request
|
|
44675
|
-
request.send(requestData);
|
|
45963
|
+
request.send(requestData || null);
|
|
44676
45964
|
});
|
|
44677
45965
|
};
|
|
44678
45966
|
|
|
44679
|
-
|
|
44680
|
-
|
|
45967
|
+
const knownAdapters = {
|
|
45968
|
+
http: httpAdapter,
|
|
45969
|
+
xhr: xhrAdapter
|
|
44681
45970
|
};
|
|
44682
45971
|
|
|
44683
|
-
|
|
44684
|
-
if (
|
|
44685
|
-
headers['Content-Type'] = value;
|
|
44686
|
-
}
|
|
44687
|
-
}
|
|
44688
|
-
|
|
44689
|
-
function getDefaultAdapter() {
|
|
44690
|
-
var adapter;
|
|
44691
|
-
if (typeof XMLHttpRequest !== 'undefined') {
|
|
44692
|
-
// For browsers use XHR adapter
|
|
44693
|
-
adapter = xhr;
|
|
44694
|
-
} else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
|
|
44695
|
-
// For node use HTTP adapter
|
|
44696
|
-
adapter = xhr;
|
|
44697
|
-
}
|
|
44698
|
-
return adapter;
|
|
44699
|
-
}
|
|
44700
|
-
|
|
44701
|
-
function stringifySafely(rawValue, parser, encoder) {
|
|
44702
|
-
if (utils.isString(rawValue)) {
|
|
45972
|
+
utils.forEach(knownAdapters, (fn, value) => {
|
|
45973
|
+
if (fn) {
|
|
44703
45974
|
try {
|
|
44704
|
-
(
|
|
44705
|
-
return utils.trim(rawValue);
|
|
45975
|
+
Object.defineProperty(fn, 'name', {value});
|
|
44706
45976
|
} catch (e) {
|
|
44707
|
-
|
|
44708
|
-
throw e;
|
|
44709
|
-
}
|
|
45977
|
+
// eslint-disable-next-line no-empty
|
|
44710
45978
|
}
|
|
45979
|
+
Object.defineProperty(fn, 'adapterName', {value});
|
|
44711
45980
|
}
|
|
45981
|
+
});
|
|
44712
45982
|
|
|
44713
|
-
|
|
44714
|
-
}
|
|
44715
|
-
|
|
44716
|
-
var defaults = {
|
|
44717
|
-
|
|
44718
|
-
transitional: {
|
|
44719
|
-
silentJSONParsing: true,
|
|
44720
|
-
forcedJSONParsing: true,
|
|
44721
|
-
clarifyTimeoutError: false
|
|
44722
|
-
},
|
|
44723
|
-
|
|
44724
|
-
adapter: getDefaultAdapter(),
|
|
44725
|
-
|
|
44726
|
-
transformRequest: [function transformRequest(data, headers) {
|
|
44727
|
-
normalizeHeaderName(headers, 'Accept');
|
|
44728
|
-
normalizeHeaderName(headers, 'Content-Type');
|
|
44729
|
-
|
|
44730
|
-
if (utils.isFormData(data) ||
|
|
44731
|
-
utils.isArrayBuffer(data) ||
|
|
44732
|
-
utils.isBuffer(data) ||
|
|
44733
|
-
utils.isStream(data) ||
|
|
44734
|
-
utils.isFile(data) ||
|
|
44735
|
-
utils.isBlob(data)
|
|
44736
|
-
) {
|
|
44737
|
-
return data;
|
|
44738
|
-
}
|
|
44739
|
-
if (utils.isArrayBufferView(data)) {
|
|
44740
|
-
return data.buffer;
|
|
44741
|
-
}
|
|
44742
|
-
if (utils.isURLSearchParams(data)) {
|
|
44743
|
-
setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
|
|
44744
|
-
return data.toString();
|
|
44745
|
-
}
|
|
44746
|
-
if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {
|
|
44747
|
-
setContentTypeIfUnset(headers, 'application/json');
|
|
44748
|
-
return stringifySafely(data);
|
|
44749
|
-
}
|
|
44750
|
-
return data;
|
|
44751
|
-
}],
|
|
44752
|
-
|
|
44753
|
-
transformResponse: [function transformResponse(data) {
|
|
44754
|
-
var transitional = this.transitional || defaults.transitional;
|
|
44755
|
-
var silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
44756
|
-
var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
44757
|
-
var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';
|
|
44758
|
-
|
|
44759
|
-
if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {
|
|
44760
|
-
try {
|
|
44761
|
-
return JSON.parse(data);
|
|
44762
|
-
} catch (e) {
|
|
44763
|
-
if (strictJSONParsing) {
|
|
44764
|
-
if (e.name === 'SyntaxError') {
|
|
44765
|
-
throw enhanceError(e, this, 'E_JSON_PARSE');
|
|
44766
|
-
}
|
|
44767
|
-
throw e;
|
|
44768
|
-
}
|
|
44769
|
-
}
|
|
44770
|
-
}
|
|
45983
|
+
const renderReason = (reason) => `- ${reason}`;
|
|
44771
45984
|
|
|
44772
|
-
|
|
44773
|
-
}],
|
|
45985
|
+
const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;
|
|
44774
45986
|
|
|
44775
|
-
|
|
44776
|
-
|
|
44777
|
-
|
|
44778
|
-
*/
|
|
44779
|
-
timeout: 0,
|
|
45987
|
+
var adapters = {
|
|
45988
|
+
getAdapter: (adapters) => {
|
|
45989
|
+
adapters = utils.isArray(adapters) ? adapters : [adapters];
|
|
44780
45990
|
|
|
44781
|
-
|
|
44782
|
-
|
|
45991
|
+
const {length} = adapters;
|
|
45992
|
+
let nameOrAdapter;
|
|
45993
|
+
let adapter;
|
|
44783
45994
|
|
|
44784
|
-
|
|
44785
|
-
maxBodyLength: -1,
|
|
45995
|
+
const rejectedReasons = {};
|
|
44786
45996
|
|
|
44787
|
-
|
|
44788
|
-
|
|
44789
|
-
|
|
45997
|
+
for (let i = 0; i < length; i++) {
|
|
45998
|
+
nameOrAdapter = adapters[i];
|
|
45999
|
+
let id;
|
|
44790
46000
|
|
|
44791
|
-
|
|
44792
|
-
common: {
|
|
44793
|
-
'Accept': 'application/json, text/plain, */*'
|
|
44794
|
-
}
|
|
44795
|
-
}
|
|
44796
|
-
};
|
|
46001
|
+
adapter = nameOrAdapter;
|
|
44797
46002
|
|
|
44798
|
-
|
|
44799
|
-
|
|
44800
|
-
});
|
|
46003
|
+
if (!isResolvedHandle(nameOrAdapter)) {
|
|
46004
|
+
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
44801
46005
|
|
|
44802
|
-
|
|
44803
|
-
|
|
44804
|
-
|
|
46006
|
+
if (adapter === undefined) {
|
|
46007
|
+
throw new AxiosError(`Unknown adapter '${id}'`);
|
|
46008
|
+
}
|
|
46009
|
+
}
|
|
44805
46010
|
|
|
44806
|
-
|
|
46011
|
+
if (adapter) {
|
|
46012
|
+
break;
|
|
46013
|
+
}
|
|
44807
46014
|
|
|
44808
|
-
|
|
44809
|
-
|
|
44810
|
-
*
|
|
44811
|
-
* @param {Object|String} data The data to be transformed
|
|
44812
|
-
* @param {Array} headers The headers for the request or response
|
|
44813
|
-
* @param {Array|Function} fns A single function or Array of functions
|
|
44814
|
-
* @returns {*} The resulting transformed data
|
|
44815
|
-
*/
|
|
44816
|
-
var transformData = function transformData(data, headers, fns) {
|
|
44817
|
-
var context = this || defaults_1;
|
|
44818
|
-
/*eslint no-param-reassign:0*/
|
|
44819
|
-
utils.forEach(fns, function transform(fn) {
|
|
44820
|
-
data = fn.call(context, data, headers);
|
|
44821
|
-
});
|
|
46015
|
+
rejectedReasons[id || '#' + i] = adapter;
|
|
46016
|
+
}
|
|
44822
46017
|
|
|
44823
|
-
|
|
44824
|
-
};
|
|
46018
|
+
if (!adapter) {
|
|
44825
46019
|
|
|
44826
|
-
|
|
44827
|
-
|
|
46020
|
+
const reasons = Object.entries(rejectedReasons)
|
|
46021
|
+
.map(([id, state]) => `adapter ${id} ` +
|
|
46022
|
+
(state === false ? 'is not supported by the environment' : 'is not available in the build')
|
|
46023
|
+
);
|
|
46024
|
+
|
|
46025
|
+
let s = length ?
|
|
46026
|
+
(reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
|
|
46027
|
+
'as no adapter specified';
|
|
46028
|
+
|
|
46029
|
+
throw new AxiosError(
|
|
46030
|
+
`There is no suitable adapter to dispatch the request ` + s,
|
|
46031
|
+
'ERR_NOT_SUPPORT'
|
|
46032
|
+
);
|
|
46033
|
+
}
|
|
46034
|
+
|
|
46035
|
+
return adapter;
|
|
46036
|
+
},
|
|
46037
|
+
adapters: knownAdapters
|
|
44828
46038
|
};
|
|
44829
46039
|
|
|
44830
46040
|
/**
|
|
44831
|
-
* Throws a `
|
|
46041
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
46042
|
+
*
|
|
46043
|
+
* @param {Object} config The config that is to be used for the request
|
|
46044
|
+
*
|
|
46045
|
+
* @returns {void}
|
|
44832
46046
|
*/
|
|
44833
46047
|
function throwIfCancellationRequested(config) {
|
|
44834
46048
|
if (config.cancelToken) {
|
|
@@ -44836,7 +46050,7 @@ var Neurosity = (function (exports) {
|
|
|
44836
46050
|
}
|
|
44837
46051
|
|
|
44838
46052
|
if (config.signal && config.signal.aborted) {
|
|
44839
|
-
throw new
|
|
46053
|
+
throw new CanceledError(null, config);
|
|
44840
46054
|
}
|
|
44841
46055
|
}
|
|
44842
46056
|
|
|
@@ -44844,37 +46058,25 @@ var Neurosity = (function (exports) {
|
|
|
44844
46058
|
* Dispatch a request to the server using the configured adapter.
|
|
44845
46059
|
*
|
|
44846
46060
|
* @param {object} config The config that is to be used for the request
|
|
46061
|
+
*
|
|
44847
46062
|
* @returns {Promise} The Promise to be fulfilled
|
|
44848
46063
|
*/
|
|
44849
|
-
|
|
46064
|
+
function dispatchRequest(config) {
|
|
44850
46065
|
throwIfCancellationRequested(config);
|
|
44851
46066
|
|
|
44852
|
-
|
|
44853
|
-
config.headers = config.headers || {};
|
|
46067
|
+
config.headers = AxiosHeaders.from(config.headers);
|
|
44854
46068
|
|
|
44855
46069
|
// Transform request data
|
|
44856
46070
|
config.data = transformData.call(
|
|
44857
46071
|
config,
|
|
44858
|
-
config.data,
|
|
44859
|
-
config.headers,
|
|
44860
46072
|
config.transformRequest
|
|
44861
46073
|
);
|
|
44862
46074
|
|
|
44863
|
-
|
|
44864
|
-
|
|
44865
|
-
|
|
44866
|
-
config.headers[config.method] || {},
|
|
44867
|
-
config.headers
|
|
44868
|
-
);
|
|
44869
|
-
|
|
44870
|
-
utils.forEach(
|
|
44871
|
-
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
|
44872
|
-
function cleanHeaderConfig(method) {
|
|
44873
|
-
delete config.headers[method];
|
|
44874
|
-
}
|
|
44875
|
-
);
|
|
46075
|
+
if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
|
|
46076
|
+
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
|
46077
|
+
}
|
|
44876
46078
|
|
|
44877
|
-
|
|
46079
|
+
const adapter = adapters.getAdapter(config.adapter || defaults.adapter);
|
|
44878
46080
|
|
|
44879
46081
|
return adapter(config).then(function onAdapterResolution(response) {
|
|
44880
46082
|
throwIfCancellationRequested(config);
|
|
@@ -44882,11 +46084,12 @@ var Neurosity = (function (exports) {
|
|
|
44882
46084
|
// Transform response data
|
|
44883
46085
|
response.data = transformData.call(
|
|
44884
46086
|
config,
|
|
44885
|
-
|
|
44886
|
-
response
|
|
44887
|
-
config.transformResponse
|
|
46087
|
+
config.transformResponse,
|
|
46088
|
+
response
|
|
44888
46089
|
);
|
|
44889
46090
|
|
|
46091
|
+
response.headers = AxiosHeaders.from(response.headers);
|
|
46092
|
+
|
|
44890
46093
|
return response;
|
|
44891
46094
|
}, function onAdapterRejection(reason) {
|
|
44892
46095
|
if (!isCancel(reason)) {
|
|
@@ -44896,16 +46099,18 @@ var Neurosity = (function (exports) {
|
|
|
44896
46099
|
if (reason && reason.response) {
|
|
44897
46100
|
reason.response.data = transformData.call(
|
|
44898
46101
|
config,
|
|
44899
|
-
|
|
44900
|
-
reason.response
|
|
44901
|
-
config.transformResponse
|
|
46102
|
+
config.transformResponse,
|
|
46103
|
+
reason.response
|
|
44902
46104
|
);
|
|
46105
|
+
reason.response.headers = AxiosHeaders.from(reason.response.headers);
|
|
44903
46106
|
}
|
|
44904
46107
|
}
|
|
44905
46108
|
|
|
44906
46109
|
return Promise.reject(reason);
|
|
44907
46110
|
});
|
|
44908
|
-
}
|
|
46111
|
+
}
|
|
46112
|
+
|
|
46113
|
+
const headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;
|
|
44909
46114
|
|
|
44910
46115
|
/**
|
|
44911
46116
|
* Config-specific merge-function which creates a new config-object
|
|
@@ -44913,16 +46118,17 @@ var Neurosity = (function (exports) {
|
|
|
44913
46118
|
*
|
|
44914
46119
|
* @param {Object} config1
|
|
44915
46120
|
* @param {Object} config2
|
|
46121
|
+
*
|
|
44916
46122
|
* @returns {Object} New object resulting from merging config2 to config1
|
|
44917
46123
|
*/
|
|
44918
|
-
|
|
46124
|
+
function mergeConfig(config1, config2) {
|
|
44919
46125
|
// eslint-disable-next-line no-param-reassign
|
|
44920
46126
|
config2 = config2 || {};
|
|
44921
|
-
|
|
46127
|
+
const config = {};
|
|
44922
46128
|
|
|
44923
|
-
function getMergedValue(target, source) {
|
|
46129
|
+
function getMergedValue(target, source, caseless) {
|
|
44924
46130
|
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
|
44925
|
-
return utils.merge(target, source);
|
|
46131
|
+
return utils.merge.call({caseless}, target, source);
|
|
44926
46132
|
} else if (utils.isPlainObject(source)) {
|
|
44927
46133
|
return utils.merge({}, source);
|
|
44928
46134
|
} else if (utils.isArray(source)) {
|
|
@@ -44932,99 +46138,100 @@ var Neurosity = (function (exports) {
|
|
|
44932
46138
|
}
|
|
44933
46139
|
|
|
44934
46140
|
// eslint-disable-next-line consistent-return
|
|
44935
|
-
function mergeDeepProperties(
|
|
44936
|
-
if (!utils.isUndefined(
|
|
44937
|
-
return getMergedValue(
|
|
44938
|
-
} else if (!utils.isUndefined(
|
|
44939
|
-
return getMergedValue(undefined,
|
|
46141
|
+
function mergeDeepProperties(a, b, caseless) {
|
|
46142
|
+
if (!utils.isUndefined(b)) {
|
|
46143
|
+
return getMergedValue(a, b, caseless);
|
|
46144
|
+
} else if (!utils.isUndefined(a)) {
|
|
46145
|
+
return getMergedValue(undefined, a, caseless);
|
|
44940
46146
|
}
|
|
44941
46147
|
}
|
|
44942
46148
|
|
|
44943
46149
|
// eslint-disable-next-line consistent-return
|
|
44944
|
-
function valueFromConfig2(
|
|
44945
|
-
if (!utils.isUndefined(
|
|
44946
|
-
return getMergedValue(undefined,
|
|
46150
|
+
function valueFromConfig2(a, b) {
|
|
46151
|
+
if (!utils.isUndefined(b)) {
|
|
46152
|
+
return getMergedValue(undefined, b);
|
|
44947
46153
|
}
|
|
44948
46154
|
}
|
|
44949
46155
|
|
|
44950
46156
|
// eslint-disable-next-line consistent-return
|
|
44951
|
-
function defaultToConfig2(
|
|
44952
|
-
if (!utils.isUndefined(
|
|
44953
|
-
return getMergedValue(undefined,
|
|
44954
|
-
} else if (!utils.isUndefined(
|
|
44955
|
-
return getMergedValue(undefined,
|
|
46157
|
+
function defaultToConfig2(a, b) {
|
|
46158
|
+
if (!utils.isUndefined(b)) {
|
|
46159
|
+
return getMergedValue(undefined, b);
|
|
46160
|
+
} else if (!utils.isUndefined(a)) {
|
|
46161
|
+
return getMergedValue(undefined, a);
|
|
44956
46162
|
}
|
|
44957
46163
|
}
|
|
44958
46164
|
|
|
44959
46165
|
// eslint-disable-next-line consistent-return
|
|
44960
|
-
function mergeDirectKeys(prop) {
|
|
46166
|
+
function mergeDirectKeys(a, b, prop) {
|
|
44961
46167
|
if (prop in config2) {
|
|
44962
|
-
return getMergedValue(
|
|
46168
|
+
return getMergedValue(a, b);
|
|
44963
46169
|
} else if (prop in config1) {
|
|
44964
|
-
return getMergedValue(undefined,
|
|
46170
|
+
return getMergedValue(undefined, a);
|
|
44965
46171
|
}
|
|
44966
46172
|
}
|
|
44967
46173
|
|
|
44968
|
-
|
|
44969
|
-
|
|
44970
|
-
|
|
44971
|
-
|
|
44972
|
-
|
|
44973
|
-
|
|
44974
|
-
|
|
44975
|
-
|
|
44976
|
-
|
|
44977
|
-
|
|
44978
|
-
|
|
44979
|
-
|
|
44980
|
-
|
|
44981
|
-
|
|
44982
|
-
|
|
44983
|
-
|
|
44984
|
-
|
|
44985
|
-
|
|
44986
|
-
|
|
44987
|
-
|
|
44988
|
-
|
|
44989
|
-
|
|
44990
|
-
|
|
44991
|
-
|
|
44992
|
-
|
|
44993
|
-
|
|
44994
|
-
|
|
46174
|
+
const mergeMap = {
|
|
46175
|
+
url: valueFromConfig2,
|
|
46176
|
+
method: valueFromConfig2,
|
|
46177
|
+
data: valueFromConfig2,
|
|
46178
|
+
baseURL: defaultToConfig2,
|
|
46179
|
+
transformRequest: defaultToConfig2,
|
|
46180
|
+
transformResponse: defaultToConfig2,
|
|
46181
|
+
paramsSerializer: defaultToConfig2,
|
|
46182
|
+
timeout: defaultToConfig2,
|
|
46183
|
+
timeoutMessage: defaultToConfig2,
|
|
46184
|
+
withCredentials: defaultToConfig2,
|
|
46185
|
+
withXSRFToken: defaultToConfig2,
|
|
46186
|
+
adapter: defaultToConfig2,
|
|
46187
|
+
responseType: defaultToConfig2,
|
|
46188
|
+
xsrfCookieName: defaultToConfig2,
|
|
46189
|
+
xsrfHeaderName: defaultToConfig2,
|
|
46190
|
+
onUploadProgress: defaultToConfig2,
|
|
46191
|
+
onDownloadProgress: defaultToConfig2,
|
|
46192
|
+
decompress: defaultToConfig2,
|
|
46193
|
+
maxContentLength: defaultToConfig2,
|
|
46194
|
+
maxBodyLength: defaultToConfig2,
|
|
46195
|
+
beforeRedirect: defaultToConfig2,
|
|
46196
|
+
transport: defaultToConfig2,
|
|
46197
|
+
httpAgent: defaultToConfig2,
|
|
46198
|
+
httpsAgent: defaultToConfig2,
|
|
46199
|
+
cancelToken: defaultToConfig2,
|
|
46200
|
+
socketPath: defaultToConfig2,
|
|
46201
|
+
responseEncoding: defaultToConfig2,
|
|
46202
|
+
validateStatus: mergeDirectKeys,
|
|
46203
|
+
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
|
44995
46204
|
};
|
|
44996
46205
|
|
|
44997
|
-
utils.forEach(Object.keys(
|
|
44998
|
-
|
|
44999
|
-
|
|
46206
|
+
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
46207
|
+
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
46208
|
+
const configValue = merge(config1[prop], config2[prop], prop);
|
|
45000
46209
|
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
45001
46210
|
});
|
|
45002
46211
|
|
|
45003
46212
|
return config;
|
|
45004
|
-
}
|
|
45005
|
-
|
|
45006
|
-
var data = {
|
|
45007
|
-
"version": "0.25.0"
|
|
45008
|
-
};
|
|
46213
|
+
}
|
|
45009
46214
|
|
|
45010
|
-
|
|
46215
|
+
const VERSION = "1.6.2";
|
|
45011
46216
|
|
|
45012
|
-
|
|
46217
|
+
const validators = {};
|
|
45013
46218
|
|
|
45014
46219
|
// eslint-disable-next-line func-names
|
|
45015
|
-
['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(
|
|
46220
|
+
['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
|
|
45016
46221
|
validators[type] = function validator(thing) {
|
|
45017
46222
|
return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
|
|
45018
46223
|
};
|
|
45019
46224
|
});
|
|
45020
46225
|
|
|
45021
|
-
|
|
46226
|
+
const deprecatedWarnings = {};
|
|
45022
46227
|
|
|
45023
46228
|
/**
|
|
45024
46229
|
* Transitional option validator
|
|
46230
|
+
*
|
|
45025
46231
|
* @param {function|boolean?} validator - set to false if the transitional option has been removed
|
|
45026
46232
|
* @param {string?} version - deprecated version / removed since version
|
|
45027
46233
|
* @param {string?} message - some message with additional info
|
|
46234
|
+
*
|
|
45028
46235
|
* @returns {function}
|
|
45029
46236
|
*/
|
|
45030
46237
|
validators.transitional = function transitional(validator, version, message) {
|
|
@@ -45033,9 +46240,12 @@ var Neurosity = (function (exports) {
|
|
|
45033
46240
|
}
|
|
45034
46241
|
|
|
45035
46242
|
// eslint-disable-next-line func-names
|
|
45036
|
-
return
|
|
46243
|
+
return (value, opt, opts) => {
|
|
45037
46244
|
if (validator === false) {
|
|
45038
|
-
throw new
|
|
46245
|
+
throw new AxiosError(
|
|
46246
|
+
formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
|
|
46247
|
+
AxiosError.ERR_DEPRECATED
|
|
46248
|
+
);
|
|
45039
46249
|
}
|
|
45040
46250
|
|
|
45041
46251
|
if (version && !deprecatedWarnings[opt]) {
|
|
@@ -45055,168 +46265,205 @@ var Neurosity = (function (exports) {
|
|
|
45055
46265
|
|
|
45056
46266
|
/**
|
|
45057
46267
|
* Assert object's properties type
|
|
46268
|
+
*
|
|
45058
46269
|
* @param {object} options
|
|
45059
46270
|
* @param {object} schema
|
|
45060
46271
|
* @param {boolean?} allowUnknown
|
|
46272
|
+
*
|
|
46273
|
+
* @returns {object}
|
|
45061
46274
|
*/
|
|
45062
46275
|
|
|
45063
46276
|
function assertOptions(options, schema, allowUnknown) {
|
|
45064
46277
|
if (typeof options !== 'object') {
|
|
45065
|
-
throw new
|
|
46278
|
+
throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
|
|
45066
46279
|
}
|
|
45067
|
-
|
|
45068
|
-
|
|
46280
|
+
const keys = Object.keys(options);
|
|
46281
|
+
let i = keys.length;
|
|
45069
46282
|
while (i-- > 0) {
|
|
45070
|
-
|
|
45071
|
-
|
|
46283
|
+
const opt = keys[i];
|
|
46284
|
+
const validator = schema[opt];
|
|
45072
46285
|
if (validator) {
|
|
45073
|
-
|
|
45074
|
-
|
|
46286
|
+
const value = options[opt];
|
|
46287
|
+
const result = value === undefined || validator(value, opt, options);
|
|
45075
46288
|
if (result !== true) {
|
|
45076
|
-
throw new
|
|
46289
|
+
throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
|
|
45077
46290
|
}
|
|
45078
46291
|
continue;
|
|
45079
46292
|
}
|
|
45080
46293
|
if (allowUnknown !== true) {
|
|
45081
|
-
throw
|
|
46294
|
+
throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
|
|
45082
46295
|
}
|
|
45083
46296
|
}
|
|
45084
46297
|
}
|
|
45085
46298
|
|
|
45086
46299
|
var validator = {
|
|
45087
|
-
assertOptions
|
|
45088
|
-
validators
|
|
46300
|
+
assertOptions,
|
|
46301
|
+
validators
|
|
45089
46302
|
};
|
|
45090
46303
|
|
|
45091
|
-
|
|
46304
|
+
const validators$1 = validator.validators;
|
|
46305
|
+
|
|
45092
46306
|
/**
|
|
45093
46307
|
* Create a new instance of Axios
|
|
45094
46308
|
*
|
|
45095
46309
|
* @param {Object} instanceConfig The default config for the instance
|
|
45096
|
-
*/
|
|
45097
|
-
function Axios(instanceConfig) {
|
|
45098
|
-
this.defaults = instanceConfig;
|
|
45099
|
-
this.interceptors = {
|
|
45100
|
-
request: new InterceptorManager_1(),
|
|
45101
|
-
response: new InterceptorManager_1()
|
|
45102
|
-
};
|
|
45103
|
-
}
|
|
45104
|
-
|
|
45105
|
-
/**
|
|
45106
|
-
* Dispatch a request
|
|
45107
46310
|
*
|
|
45108
|
-
* @
|
|
46311
|
+
* @return {Axios} A new instance of Axios
|
|
45109
46312
|
*/
|
|
45110
|
-
Axios
|
|
45111
|
-
|
|
45112
|
-
|
|
45113
|
-
|
|
45114
|
-
|
|
45115
|
-
|
|
45116
|
-
|
|
45117
|
-
config = configOrUrl || {};
|
|
45118
|
-
}
|
|
45119
|
-
|
|
45120
|
-
if (!config.url) {
|
|
45121
|
-
throw new Error('Provided config url is not valid');
|
|
46313
|
+
class Axios {
|
|
46314
|
+
constructor(instanceConfig) {
|
|
46315
|
+
this.defaults = instanceConfig;
|
|
46316
|
+
this.interceptors = {
|
|
46317
|
+
request: new InterceptorManager(),
|
|
46318
|
+
response: new InterceptorManager()
|
|
46319
|
+
};
|
|
45122
46320
|
}
|
|
45123
46321
|
|
|
45124
|
-
|
|
46322
|
+
/**
|
|
46323
|
+
* Dispatch a request
|
|
46324
|
+
*
|
|
46325
|
+
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
46326
|
+
* @param {?Object} config
|
|
46327
|
+
*
|
|
46328
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
46329
|
+
*/
|
|
46330
|
+
request(configOrUrl, config) {
|
|
46331
|
+
/*eslint no-param-reassign:0*/
|
|
46332
|
+
// Allow for axios('example/url'[, config]) a la fetch API
|
|
46333
|
+
if (typeof configOrUrl === 'string') {
|
|
46334
|
+
config = config || {};
|
|
46335
|
+
config.url = configOrUrl;
|
|
46336
|
+
} else {
|
|
46337
|
+
config = configOrUrl || {};
|
|
46338
|
+
}
|
|
45125
46339
|
|
|
45126
|
-
|
|
45127
|
-
if (config.method) {
|
|
45128
|
-
config.method = config.method.toLowerCase();
|
|
45129
|
-
} else if (this.defaults.method) {
|
|
45130
|
-
config.method = this.defaults.method.toLowerCase();
|
|
45131
|
-
} else {
|
|
45132
|
-
config.method = 'get';
|
|
45133
|
-
}
|
|
46340
|
+
config = mergeConfig(this.defaults, config);
|
|
45134
46341
|
|
|
45135
|
-
|
|
46342
|
+
const {transitional, paramsSerializer, headers} = config;
|
|
45136
46343
|
|
|
45137
|
-
|
|
45138
|
-
|
|
45139
|
-
|
|
45140
|
-
|
|
45141
|
-
|
|
45142
|
-
|
|
45143
|
-
|
|
46344
|
+
if (transitional !== undefined) {
|
|
46345
|
+
validator.assertOptions(transitional, {
|
|
46346
|
+
silentJSONParsing: validators$1.transitional(validators$1.boolean),
|
|
46347
|
+
forcedJSONParsing: validators$1.transitional(validators$1.boolean),
|
|
46348
|
+
clarifyTimeoutError: validators$1.transitional(validators$1.boolean)
|
|
46349
|
+
}, false);
|
|
46350
|
+
}
|
|
45144
46351
|
|
|
45145
|
-
|
|
45146
|
-
|
|
45147
|
-
|
|
45148
|
-
|
|
45149
|
-
|
|
45150
|
-
|
|
46352
|
+
if (paramsSerializer != null) {
|
|
46353
|
+
if (utils.isFunction(paramsSerializer)) {
|
|
46354
|
+
config.paramsSerializer = {
|
|
46355
|
+
serialize: paramsSerializer
|
|
46356
|
+
};
|
|
46357
|
+
} else {
|
|
46358
|
+
validator.assertOptions(paramsSerializer, {
|
|
46359
|
+
encode: validators$1.function,
|
|
46360
|
+
serialize: validators$1.function
|
|
46361
|
+
}, true);
|
|
46362
|
+
}
|
|
45151
46363
|
}
|
|
45152
46364
|
|
|
45153
|
-
|
|
46365
|
+
// Set config.method
|
|
46366
|
+
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
|
45154
46367
|
|
|
45155
|
-
|
|
45156
|
-
|
|
46368
|
+
// Flatten headers
|
|
46369
|
+
let contextHeaders = headers && utils.merge(
|
|
46370
|
+
headers.common,
|
|
46371
|
+
headers[config.method]
|
|
46372
|
+
);
|
|
45157
46373
|
|
|
45158
|
-
|
|
45159
|
-
|
|
45160
|
-
|
|
45161
|
-
|
|
46374
|
+
headers && utils.forEach(
|
|
46375
|
+
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
|
46376
|
+
(method) => {
|
|
46377
|
+
delete headers[method];
|
|
46378
|
+
}
|
|
46379
|
+
);
|
|
46380
|
+
|
|
46381
|
+
config.headers = AxiosHeaders.concat(contextHeaders, headers);
|
|
46382
|
+
|
|
46383
|
+
// filter out skipped interceptors
|
|
46384
|
+
const requestInterceptorChain = [];
|
|
46385
|
+
let synchronousRequestInterceptors = true;
|
|
46386
|
+
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
46387
|
+
if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
|
|
46388
|
+
return;
|
|
46389
|
+
}
|
|
46390
|
+
|
|
46391
|
+
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
45162
46392
|
|
|
45163
|
-
|
|
46393
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
46394
|
+
});
|
|
46395
|
+
|
|
46396
|
+
const responseInterceptorChain = [];
|
|
46397
|
+
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
46398
|
+
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
46399
|
+
});
|
|
46400
|
+
|
|
46401
|
+
let promise;
|
|
46402
|
+
let i = 0;
|
|
46403
|
+
let len;
|
|
46404
|
+
|
|
46405
|
+
if (!synchronousRequestInterceptors) {
|
|
46406
|
+
const chain = [dispatchRequest.bind(this), undefined];
|
|
46407
|
+
chain.unshift.apply(chain, requestInterceptorChain);
|
|
46408
|
+
chain.push.apply(chain, responseInterceptorChain);
|
|
46409
|
+
len = chain.length;
|
|
45164
46410
|
|
|
45165
|
-
|
|
45166
|
-
var chain = [dispatchRequest, undefined];
|
|
46411
|
+
promise = Promise.resolve(config);
|
|
45167
46412
|
|
|
45168
|
-
|
|
45169
|
-
|
|
46413
|
+
while (i < len) {
|
|
46414
|
+
promise = promise.then(chain[i++], chain[i++]);
|
|
46415
|
+
}
|
|
45170
46416
|
|
|
45171
|
-
|
|
45172
|
-
while (chain.length) {
|
|
45173
|
-
promise = promise.then(chain.shift(), chain.shift());
|
|
46417
|
+
return promise;
|
|
45174
46418
|
}
|
|
45175
46419
|
|
|
45176
|
-
|
|
45177
|
-
|
|
46420
|
+
len = requestInterceptorChain.length;
|
|
46421
|
+
|
|
46422
|
+
let newConfig = config;
|
|
45178
46423
|
|
|
46424
|
+
i = 0;
|
|
46425
|
+
|
|
46426
|
+
while (i < len) {
|
|
46427
|
+
const onFulfilled = requestInterceptorChain[i++];
|
|
46428
|
+
const onRejected = requestInterceptorChain[i++];
|
|
46429
|
+
try {
|
|
46430
|
+
newConfig = onFulfilled(newConfig);
|
|
46431
|
+
} catch (error) {
|
|
46432
|
+
onRejected.call(this, error);
|
|
46433
|
+
break;
|
|
46434
|
+
}
|
|
46435
|
+
}
|
|
45179
46436
|
|
|
45180
|
-
var newConfig = config;
|
|
45181
|
-
while (requestInterceptorChain.length) {
|
|
45182
|
-
var onFulfilled = requestInterceptorChain.shift();
|
|
45183
|
-
var onRejected = requestInterceptorChain.shift();
|
|
45184
46437
|
try {
|
|
45185
|
-
|
|
46438
|
+
promise = dispatchRequest.call(this, newConfig);
|
|
45186
46439
|
} catch (error) {
|
|
45187
|
-
|
|
45188
|
-
break;
|
|
46440
|
+
return Promise.reject(error);
|
|
45189
46441
|
}
|
|
45190
|
-
}
|
|
45191
46442
|
|
|
45192
|
-
|
|
45193
|
-
|
|
45194
|
-
} catch (error) {
|
|
45195
|
-
return Promise.reject(error);
|
|
45196
|
-
}
|
|
46443
|
+
i = 0;
|
|
46444
|
+
len = responseInterceptorChain.length;
|
|
45197
46445
|
|
|
45198
|
-
|
|
45199
|
-
|
|
45200
|
-
|
|
46446
|
+
while (i < len) {
|
|
46447
|
+
promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
|
|
46448
|
+
}
|
|
45201
46449
|
|
|
45202
|
-
|
|
45203
|
-
|
|
46450
|
+
return promise;
|
|
46451
|
+
}
|
|
45204
46452
|
|
|
45205
|
-
|
|
45206
|
-
|
|
45207
|
-
|
|
46453
|
+
getUri(config) {
|
|
46454
|
+
config = mergeConfig(this.defaults, config);
|
|
46455
|
+
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
46456
|
+
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
45208
46457
|
}
|
|
45209
|
-
|
|
45210
|
-
return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
|
|
45211
|
-
};
|
|
46458
|
+
}
|
|
45212
46459
|
|
|
45213
46460
|
// Provide aliases for supported request methods
|
|
45214
46461
|
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
|
45215
46462
|
/*eslint func-names:0*/
|
|
45216
46463
|
Axios.prototype[method] = function(url, config) {
|
|
45217
46464
|
return this.request(mergeConfig(config || {}, {
|
|
45218
|
-
method
|
|
45219
|
-
url
|
|
46465
|
+
method,
|
|
46466
|
+
url,
|
|
45220
46467
|
data: (config || {}).data
|
|
45221
46468
|
}));
|
|
45222
46469
|
};
|
|
@@ -45224,132 +46471,140 @@ var Neurosity = (function (exports) {
|
|
|
45224
46471
|
|
|
45225
46472
|
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
45226
46473
|
/*eslint func-names:0*/
|
|
45227
|
-
Axios.prototype[method] = function(url, data, config) {
|
|
45228
|
-
return this.request(mergeConfig(config || {}, {
|
|
45229
|
-
method: method,
|
|
45230
|
-
url: url,
|
|
45231
|
-
data: data
|
|
45232
|
-
}));
|
|
45233
|
-
};
|
|
45234
|
-
});
|
|
45235
46474
|
|
|
45236
|
-
|
|
46475
|
+
function generateHTTPMethod(isForm) {
|
|
46476
|
+
return function httpMethod(url, data, config) {
|
|
46477
|
+
return this.request(mergeConfig(config || {}, {
|
|
46478
|
+
method,
|
|
46479
|
+
headers: isForm ? {
|
|
46480
|
+
'Content-Type': 'multipart/form-data'
|
|
46481
|
+
} : {},
|
|
46482
|
+
url,
|
|
46483
|
+
data
|
|
46484
|
+
}));
|
|
46485
|
+
};
|
|
46486
|
+
}
|
|
46487
|
+
|
|
46488
|
+
Axios.prototype[method] = generateHTTPMethod();
|
|
46489
|
+
|
|
46490
|
+
Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
|
|
46491
|
+
});
|
|
45237
46492
|
|
|
45238
46493
|
/**
|
|
45239
46494
|
* A `CancelToken` is an object that can be used to request cancellation of an operation.
|
|
45240
46495
|
*
|
|
45241
|
-
* @class
|
|
45242
46496
|
* @param {Function} executor The executor function.
|
|
46497
|
+
*
|
|
46498
|
+
* @returns {CancelToken}
|
|
45243
46499
|
*/
|
|
45244
|
-
|
|
45245
|
-
|
|
45246
|
-
|
|
45247
|
-
|
|
46500
|
+
class CancelToken {
|
|
46501
|
+
constructor(executor) {
|
|
46502
|
+
if (typeof executor !== 'function') {
|
|
46503
|
+
throw new TypeError('executor must be a function.');
|
|
46504
|
+
}
|
|
45248
46505
|
|
|
45249
|
-
|
|
46506
|
+
let resolvePromise;
|
|
45250
46507
|
|
|
45251
|
-
|
|
45252
|
-
|
|
45253
|
-
|
|
46508
|
+
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
46509
|
+
resolvePromise = resolve;
|
|
46510
|
+
});
|
|
45254
46511
|
|
|
45255
|
-
|
|
46512
|
+
const token = this;
|
|
45256
46513
|
|
|
45257
|
-
|
|
45258
|
-
|
|
45259
|
-
|
|
46514
|
+
// eslint-disable-next-line func-names
|
|
46515
|
+
this.promise.then(cancel => {
|
|
46516
|
+
if (!token._listeners) return;
|
|
45260
46517
|
|
|
45261
|
-
|
|
45262
|
-
var l = token._listeners.length;
|
|
46518
|
+
let i = token._listeners.length;
|
|
45263
46519
|
|
|
45264
|
-
|
|
45265
|
-
|
|
45266
|
-
|
|
45267
|
-
|
|
45268
|
-
|
|
46520
|
+
while (i-- > 0) {
|
|
46521
|
+
token._listeners[i](cancel);
|
|
46522
|
+
}
|
|
46523
|
+
token._listeners = null;
|
|
46524
|
+
});
|
|
45269
46525
|
|
|
45270
|
-
// eslint-disable-next-line func-names
|
|
45271
|
-
this.promise.then = function(onfulfilled) {
|
|
45272
|
-
var _resolve;
|
|
45273
46526
|
// eslint-disable-next-line func-names
|
|
45274
|
-
|
|
45275
|
-
|
|
45276
|
-
|
|
45277
|
-
|
|
46527
|
+
this.promise.then = onfulfilled => {
|
|
46528
|
+
let _resolve;
|
|
46529
|
+
// eslint-disable-next-line func-names
|
|
46530
|
+
const promise = new Promise(resolve => {
|
|
46531
|
+
token.subscribe(resolve);
|
|
46532
|
+
_resolve = resolve;
|
|
46533
|
+
}).then(onfulfilled);
|
|
45278
46534
|
|
|
45279
|
-
|
|
45280
|
-
|
|
45281
|
-
|
|
46535
|
+
promise.cancel = function reject() {
|
|
46536
|
+
token.unsubscribe(_resolve);
|
|
46537
|
+
};
|
|
45282
46538
|
|
|
45283
|
-
|
|
45284
|
-
|
|
46539
|
+
return promise;
|
|
46540
|
+
};
|
|
45285
46541
|
|
|
45286
|
-
|
|
45287
|
-
|
|
45288
|
-
|
|
45289
|
-
|
|
45290
|
-
|
|
46542
|
+
executor(function cancel(message, config, request) {
|
|
46543
|
+
if (token.reason) {
|
|
46544
|
+
// Cancellation has already been requested
|
|
46545
|
+
return;
|
|
46546
|
+
}
|
|
45291
46547
|
|
|
45292
|
-
|
|
45293
|
-
|
|
45294
|
-
|
|
45295
|
-
|
|
46548
|
+
token.reason = new CanceledError(message, config, request);
|
|
46549
|
+
resolvePromise(token.reason);
|
|
46550
|
+
});
|
|
46551
|
+
}
|
|
45296
46552
|
|
|
45297
|
-
|
|
45298
|
-
|
|
45299
|
-
|
|
45300
|
-
|
|
45301
|
-
|
|
45302
|
-
|
|
46553
|
+
/**
|
|
46554
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
46555
|
+
*/
|
|
46556
|
+
throwIfRequested() {
|
|
46557
|
+
if (this.reason) {
|
|
46558
|
+
throw this.reason;
|
|
46559
|
+
}
|
|
45303
46560
|
}
|
|
45304
|
-
};
|
|
45305
46561
|
|
|
45306
|
-
|
|
45307
|
-
|
|
45308
|
-
|
|
46562
|
+
/**
|
|
46563
|
+
* Subscribe to the cancel signal
|
|
46564
|
+
*/
|
|
45309
46565
|
|
|
45310
|
-
|
|
45311
|
-
|
|
45312
|
-
|
|
45313
|
-
|
|
45314
|
-
|
|
46566
|
+
subscribe(listener) {
|
|
46567
|
+
if (this.reason) {
|
|
46568
|
+
listener(this.reason);
|
|
46569
|
+
return;
|
|
46570
|
+
}
|
|
45315
46571
|
|
|
45316
|
-
|
|
45317
|
-
|
|
45318
|
-
|
|
45319
|
-
|
|
46572
|
+
if (this._listeners) {
|
|
46573
|
+
this._listeners.push(listener);
|
|
46574
|
+
} else {
|
|
46575
|
+
this._listeners = [listener];
|
|
46576
|
+
}
|
|
45320
46577
|
}
|
|
45321
|
-
};
|
|
45322
46578
|
|
|
45323
|
-
|
|
45324
|
-
|
|
45325
|
-
|
|
46579
|
+
/**
|
|
46580
|
+
* Unsubscribe from the cancel signal
|
|
46581
|
+
*/
|
|
45326
46582
|
|
|
45327
|
-
|
|
45328
|
-
|
|
45329
|
-
|
|
45330
|
-
|
|
45331
|
-
|
|
45332
|
-
|
|
45333
|
-
|
|
46583
|
+
unsubscribe(listener) {
|
|
46584
|
+
if (!this._listeners) {
|
|
46585
|
+
return;
|
|
46586
|
+
}
|
|
46587
|
+
const index = this._listeners.indexOf(listener);
|
|
46588
|
+
if (index !== -1) {
|
|
46589
|
+
this._listeners.splice(index, 1);
|
|
46590
|
+
}
|
|
45334
46591
|
}
|
|
45335
|
-
};
|
|
45336
|
-
|
|
45337
|
-
/**
|
|
45338
|
-
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
45339
|
-
* cancels the `CancelToken`.
|
|
45340
|
-
*/
|
|
45341
|
-
CancelToken.source = function source() {
|
|
45342
|
-
var cancel;
|
|
45343
|
-
var token = new CancelToken(function executor(c) {
|
|
45344
|
-
cancel = c;
|
|
45345
|
-
});
|
|
45346
|
-
return {
|
|
45347
|
-
token: token,
|
|
45348
|
-
cancel: cancel
|
|
45349
|
-
};
|
|
45350
|
-
};
|
|
45351
46592
|
|
|
45352
|
-
|
|
46593
|
+
/**
|
|
46594
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
46595
|
+
* cancels the `CancelToken`.
|
|
46596
|
+
*/
|
|
46597
|
+
static source() {
|
|
46598
|
+
let cancel;
|
|
46599
|
+
const token = new CancelToken(function executor(c) {
|
|
46600
|
+
cancel = c;
|
|
46601
|
+
});
|
|
46602
|
+
return {
|
|
46603
|
+
token,
|
|
46604
|
+
cancel
|
|
46605
|
+
};
|
|
46606
|
+
}
|
|
46607
|
+
}
|
|
45353
46608
|
|
|
45354
46609
|
/**
|
|
45355
46610
|
* Syntactic sugar for invoking a function and expanding an array for arguments.
|
|
@@ -45369,39 +46624,112 @@ var Neurosity = (function (exports) {
|
|
|
45369
46624
|
* ```
|
|
45370
46625
|
*
|
|
45371
46626
|
* @param {Function} callback
|
|
46627
|
+
*
|
|
45372
46628
|
* @returns {Function}
|
|
45373
46629
|
*/
|
|
45374
|
-
|
|
46630
|
+
function spread(callback) {
|
|
45375
46631
|
return function wrap(arr) {
|
|
45376
46632
|
return callback.apply(null, arr);
|
|
45377
46633
|
};
|
|
45378
|
-
}
|
|
46634
|
+
}
|
|
45379
46635
|
|
|
45380
46636
|
/**
|
|
45381
46637
|
* Determines whether the payload is an error thrown by Axios
|
|
45382
46638
|
*
|
|
45383
46639
|
* @param {*} payload The value to test
|
|
46640
|
+
*
|
|
45384
46641
|
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
|
45385
46642
|
*/
|
|
45386
|
-
|
|
46643
|
+
function isAxiosError(payload) {
|
|
45387
46644
|
return utils.isObject(payload) && (payload.isAxiosError === true);
|
|
46645
|
+
}
|
|
46646
|
+
|
|
46647
|
+
const HttpStatusCode = {
|
|
46648
|
+
Continue: 100,
|
|
46649
|
+
SwitchingProtocols: 101,
|
|
46650
|
+
Processing: 102,
|
|
46651
|
+
EarlyHints: 103,
|
|
46652
|
+
Ok: 200,
|
|
46653
|
+
Created: 201,
|
|
46654
|
+
Accepted: 202,
|
|
46655
|
+
NonAuthoritativeInformation: 203,
|
|
46656
|
+
NoContent: 204,
|
|
46657
|
+
ResetContent: 205,
|
|
46658
|
+
PartialContent: 206,
|
|
46659
|
+
MultiStatus: 207,
|
|
46660
|
+
AlreadyReported: 208,
|
|
46661
|
+
ImUsed: 226,
|
|
46662
|
+
MultipleChoices: 300,
|
|
46663
|
+
MovedPermanently: 301,
|
|
46664
|
+
Found: 302,
|
|
46665
|
+
SeeOther: 303,
|
|
46666
|
+
NotModified: 304,
|
|
46667
|
+
UseProxy: 305,
|
|
46668
|
+
Unused: 306,
|
|
46669
|
+
TemporaryRedirect: 307,
|
|
46670
|
+
PermanentRedirect: 308,
|
|
46671
|
+
BadRequest: 400,
|
|
46672
|
+
Unauthorized: 401,
|
|
46673
|
+
PaymentRequired: 402,
|
|
46674
|
+
Forbidden: 403,
|
|
46675
|
+
NotFound: 404,
|
|
46676
|
+
MethodNotAllowed: 405,
|
|
46677
|
+
NotAcceptable: 406,
|
|
46678
|
+
ProxyAuthenticationRequired: 407,
|
|
46679
|
+
RequestTimeout: 408,
|
|
46680
|
+
Conflict: 409,
|
|
46681
|
+
Gone: 410,
|
|
46682
|
+
LengthRequired: 411,
|
|
46683
|
+
PreconditionFailed: 412,
|
|
46684
|
+
PayloadTooLarge: 413,
|
|
46685
|
+
UriTooLong: 414,
|
|
46686
|
+
UnsupportedMediaType: 415,
|
|
46687
|
+
RangeNotSatisfiable: 416,
|
|
46688
|
+
ExpectationFailed: 417,
|
|
46689
|
+
ImATeapot: 418,
|
|
46690
|
+
MisdirectedRequest: 421,
|
|
46691
|
+
UnprocessableEntity: 422,
|
|
46692
|
+
Locked: 423,
|
|
46693
|
+
FailedDependency: 424,
|
|
46694
|
+
TooEarly: 425,
|
|
46695
|
+
UpgradeRequired: 426,
|
|
46696
|
+
PreconditionRequired: 428,
|
|
46697
|
+
TooManyRequests: 429,
|
|
46698
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
46699
|
+
UnavailableForLegalReasons: 451,
|
|
46700
|
+
InternalServerError: 500,
|
|
46701
|
+
NotImplemented: 501,
|
|
46702
|
+
BadGateway: 502,
|
|
46703
|
+
ServiceUnavailable: 503,
|
|
46704
|
+
GatewayTimeout: 504,
|
|
46705
|
+
HttpVersionNotSupported: 505,
|
|
46706
|
+
VariantAlsoNegotiates: 506,
|
|
46707
|
+
InsufficientStorage: 507,
|
|
46708
|
+
LoopDetected: 508,
|
|
46709
|
+
NotExtended: 510,
|
|
46710
|
+
NetworkAuthenticationRequired: 511,
|
|
45388
46711
|
};
|
|
45389
46712
|
|
|
46713
|
+
Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
46714
|
+
HttpStatusCode[value] = key;
|
|
46715
|
+
});
|
|
46716
|
+
|
|
45390
46717
|
/**
|
|
45391
46718
|
* Create an instance of Axios
|
|
45392
46719
|
*
|
|
45393
46720
|
* @param {Object} defaultConfig The default config for the instance
|
|
45394
|
-
*
|
|
46721
|
+
*
|
|
46722
|
+
* @returns {Axios} A new instance of Axios
|
|
45395
46723
|
*/
|
|
45396
46724
|
function createInstance(defaultConfig) {
|
|
45397
|
-
|
|
45398
|
-
|
|
46725
|
+
const context = new Axios(defaultConfig);
|
|
46726
|
+
const instance = bind$1(Axios.prototype.request, context);
|
|
45399
46727
|
|
|
45400
46728
|
// Copy axios.prototype to instance
|
|
45401
|
-
utils.extend(instance,
|
|
46729
|
+
utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});
|
|
45402
46730
|
|
|
45403
46731
|
// Copy context to instance
|
|
45404
|
-
utils.extend(instance, context);
|
|
46732
|
+
utils.extend(instance, context, null, {allOwnKeys: true});
|
|
45405
46733
|
|
|
45406
46734
|
// Factory for creating new instances
|
|
45407
46735
|
instance.create = function create(instanceConfig) {
|
|
@@ -45412,33 +46740,46 @@ var Neurosity = (function (exports) {
|
|
|
45412
46740
|
}
|
|
45413
46741
|
|
|
45414
46742
|
// Create the default instance to be exported
|
|
45415
|
-
|
|
46743
|
+
const axios = createInstance(defaults);
|
|
45416
46744
|
|
|
45417
46745
|
// Expose Axios class to allow class inheritance
|
|
45418
|
-
axios.Axios =
|
|
46746
|
+
axios.Axios = Axios;
|
|
45419
46747
|
|
|
45420
46748
|
// Expose Cancel & CancelToken
|
|
45421
|
-
axios.
|
|
45422
|
-
axios.CancelToken =
|
|
46749
|
+
axios.CanceledError = CanceledError;
|
|
46750
|
+
axios.CancelToken = CancelToken;
|
|
45423
46751
|
axios.isCancel = isCancel;
|
|
45424
|
-
axios.VERSION =
|
|
46752
|
+
axios.VERSION = VERSION;
|
|
46753
|
+
axios.toFormData = toFormData;
|
|
46754
|
+
|
|
46755
|
+
// Expose AxiosError class
|
|
46756
|
+
axios.AxiosError = AxiosError;
|
|
46757
|
+
|
|
46758
|
+
// alias for CanceledError for backward compatibility
|
|
46759
|
+
axios.Cancel = axios.CanceledError;
|
|
45425
46760
|
|
|
45426
46761
|
// Expose all/spread
|
|
45427
46762
|
axios.all = function all(promises) {
|
|
45428
46763
|
return Promise.all(promises);
|
|
45429
46764
|
};
|
|
46765
|
+
|
|
45430
46766
|
axios.spread = spread;
|
|
45431
46767
|
|
|
45432
46768
|
// Expose isAxiosError
|
|
45433
46769
|
axios.isAxiosError = isAxiosError;
|
|
45434
46770
|
|
|
45435
|
-
|
|
46771
|
+
// Expose mergeConfig
|
|
46772
|
+
axios.mergeConfig = mergeConfig;
|
|
46773
|
+
|
|
46774
|
+
axios.AxiosHeaders = AxiosHeaders;
|
|
46775
|
+
|
|
46776
|
+
axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
45436
46777
|
|
|
45437
|
-
|
|
45438
|
-
var default_1 = axios;
|
|
45439
|
-
axios_1.default = default_1;
|
|
46778
|
+
axios.getAdapter = adapters.getAdapter;
|
|
45440
46779
|
|
|
45441
|
-
|
|
46780
|
+
axios.HttpStatusCode = HttpStatusCode;
|
|
46781
|
+
|
|
46782
|
+
axios.default = axios;
|
|
45442
46783
|
|
|
45443
46784
|
const prodFunctionsBaseUrl = "https://us-central1-neurosity-device.cloudfunctions.net";
|
|
45444
46785
|
|
|
@@ -45454,7 +46795,7 @@ var Neurosity = (function (exports) {
|
|
|
45454
46795
|
function createOAuthURL(config, sdkOptions) {
|
|
45455
46796
|
const { clientId, clientSecret, responseType, redirectUri, scope, state } = config;
|
|
45456
46797
|
const baseUrl = getFunctionsBaseURL(sdkOptions);
|
|
45457
|
-
return axios
|
|
46798
|
+
return axios
|
|
45458
46799
|
.get(`${baseUrl}/authorize/entry`, {
|
|
45459
46800
|
params: Object.assign(Object.assign({ client_id: clientId }, (clientSecret ? { client_secret: clientSecret } : {})), { response_type: responseType, redirect_uri: redirectUri, scope: scope.join(","), state: state, redirect: "false" })
|
|
45460
46801
|
})
|
|
@@ -45474,9 +46815,9 @@ var Neurosity = (function (exports) {
|
|
|
45474
46815
|
return __awaiter$a(this, void 0, void 0, function* () {
|
|
45475
46816
|
const baseUrl = getFunctionsBaseURL(sdkOptions);
|
|
45476
46817
|
// Get refresh token
|
|
45477
|
-
const refreshResponse = yield axios
|
|
46818
|
+
const refreshResponse = yield axios.post(`${baseUrl}/getOAuthRefreshToken`, query);
|
|
45478
46819
|
const refreshToken = refreshResponse.data;
|
|
45479
|
-
return axios
|
|
46820
|
+
return axios
|
|
45480
46821
|
.post(`${baseUrl}/token`, {
|
|
45481
46822
|
grant_type: "refresh_token",
|
|
45482
46823
|
refresh_token: refreshToken.data,
|
|
@@ -45940,7 +47281,6 @@ var Neurosity = (function (exports) {
|
|
|
45940
47281
|
return fromArrayBuffer(value, encodingOrOffset, length)
|
|
45941
47282
|
}
|
|
45942
47283
|
|
|
45943
|
-
|
|
45944
47284
|
if (typeof value === 'number') {
|
|
45945
47285
|
throw new TypeError(
|
|
45946
47286
|
'The "value" argument must not be of type number. Received type number'
|
|
@@ -46123,7 +47463,6 @@ var Neurosity = (function (exports) {
|
|
|
46123
47463
|
}
|
|
46124
47464
|
}
|
|
46125
47465
|
|
|
46126
|
-
|
|
46127
47466
|
function checked (length) {
|
|
46128
47467
|
// Note: cannot use `length < K_MAX_LENGTH` here because that fails when
|
|
46129
47468
|
// length is NaN (which is otherwise coerced to zero.)
|
|
@@ -46234,7 +47573,6 @@ var Neurosity = (function (exports) {
|
|
|
46234
47573
|
return buffer
|
|
46235
47574
|
};
|
|
46236
47575
|
|
|
46237
|
-
|
|
46238
47576
|
function byteLength (string, encoding) {
|
|
46239
47577
|
if (Buffer.isBuffer(string)) {
|
|
46240
47578
|
return string.length
|
|
@@ -46831,7 +48169,6 @@ var Neurosity = (function (exports) {
|
|
|
46831
48169
|
return decodeCodePointsArray(res)
|
|
46832
48170
|
}
|
|
46833
48171
|
|
|
46834
|
-
|
|
46835
48172
|
// Based on http://stackoverflow.com/a/22747272/680742, the browser with
|
|
46836
48173
|
// the lowest limit is Chrome, with 0x10000 args.
|
|
46837
48174
|
// We go 1 magnitude less, for safety
|
|
@@ -49301,30 +50638,78 @@ var Neurosity = (function (exports) {
|
|
|
49301
50638
|
// Max safe segment length for coercion.
|
|
49302
50639
|
const MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
49303
50640
|
|
|
50641
|
+
// Max safe length for a build identifier. The max length minus 6 characters for
|
|
50642
|
+
// the shortest version with a build 0.0.0+BUILD.
|
|
50643
|
+
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
50644
|
+
|
|
50645
|
+
const RELEASE_TYPES = [
|
|
50646
|
+
'major',
|
|
50647
|
+
'premajor',
|
|
50648
|
+
'minor',
|
|
50649
|
+
'preminor',
|
|
50650
|
+
'patch',
|
|
50651
|
+
'prepatch',
|
|
50652
|
+
'prerelease',
|
|
50653
|
+
];
|
|
50654
|
+
|
|
49304
50655
|
var constants = {
|
|
49305
|
-
SEMVER_SPEC_VERSION,
|
|
49306
50656
|
MAX_LENGTH,
|
|
49307
|
-
MAX_SAFE_INTEGER,
|
|
49308
50657
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
50658
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
50659
|
+
MAX_SAFE_INTEGER,
|
|
50660
|
+
RELEASE_TYPES,
|
|
50661
|
+
SEMVER_SPEC_VERSION,
|
|
50662
|
+
FLAG_INCLUDE_PRERELEASE: 0b001,
|
|
50663
|
+
FLAG_LOOSE: 0b010,
|
|
49309
50664
|
};
|
|
49310
50665
|
|
|
49311
50666
|
var re_1 = createCommonjsModule(function (module, exports) {
|
|
49312
|
-
const {
|
|
50667
|
+
const {
|
|
50668
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
50669
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
50670
|
+
MAX_LENGTH,
|
|
50671
|
+
} = constants;
|
|
49313
50672
|
|
|
49314
50673
|
exports = module.exports = {};
|
|
49315
50674
|
|
|
49316
50675
|
// The actual regexps go on exports.re
|
|
49317
50676
|
const re = exports.re = [];
|
|
50677
|
+
const safeRe = exports.safeRe = [];
|
|
49318
50678
|
const src = exports.src = [];
|
|
49319
50679
|
const t = exports.t = {};
|
|
49320
50680
|
let R = 0;
|
|
49321
50681
|
|
|
50682
|
+
const LETTERDASHNUMBER = '[a-zA-Z0-9-]';
|
|
50683
|
+
|
|
50684
|
+
// Replace some greedy regex tokens to prevent regex dos issues. These regex are
|
|
50685
|
+
// used internally via the safeRe object since all inputs in this library get
|
|
50686
|
+
// normalized first to trim and collapse all extra whitespace. The original
|
|
50687
|
+
// regexes are exported for userland consumption and lower level usage. A
|
|
50688
|
+
// future breaking change could export the safer regex only with a note that
|
|
50689
|
+
// all input should have extra whitespace removed.
|
|
50690
|
+
const safeRegexReplacements = [
|
|
50691
|
+
['\\s', 1],
|
|
50692
|
+
['\\d', MAX_LENGTH],
|
|
50693
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
|
|
50694
|
+
];
|
|
50695
|
+
|
|
50696
|
+
const makeSafeRegex = (value) => {
|
|
50697
|
+
for (const [token, max] of safeRegexReplacements) {
|
|
50698
|
+
value = value
|
|
50699
|
+
.split(`${token}*`).join(`${token}{0,${max}}`)
|
|
50700
|
+
.split(`${token}+`).join(`${token}{1,${max}}`);
|
|
50701
|
+
}
|
|
50702
|
+
return value
|
|
50703
|
+
};
|
|
50704
|
+
|
|
49322
50705
|
const createToken = (name, value, isGlobal) => {
|
|
50706
|
+
const safe = makeSafeRegex(value);
|
|
49323
50707
|
const index = R++;
|
|
49324
50708
|
debug_1(name, index, value);
|
|
49325
50709
|
t[name] = index;
|
|
49326
50710
|
src[index] = value;
|
|
49327
50711
|
re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
|
|
50712
|
+
safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined);
|
|
49328
50713
|
};
|
|
49329
50714
|
|
|
49330
50715
|
// The following Regular Expressions can be used for tokenizing,
|
|
@@ -49334,13 +50719,13 @@ var Neurosity = (function (exports) {
|
|
|
49334
50719
|
// A single `0`, or a non-zero digit followed by zero or more digits.
|
|
49335
50720
|
|
|
49336
50721
|
createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
|
|
49337
|
-
createToken('NUMERICIDENTIFIERLOOSE', '
|
|
50722
|
+
createToken('NUMERICIDENTIFIERLOOSE', '\\d+');
|
|
49338
50723
|
|
|
49339
50724
|
// ## Non-numeric Identifier
|
|
49340
50725
|
// Zero or more digits, followed by a letter or hyphen, and then zero or
|
|
49341
50726
|
// more letters, digits, or hyphens.
|
|
49342
50727
|
|
|
49343
|
-
createToken('NONNUMERICIDENTIFIER',
|
|
50728
|
+
createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
49344
50729
|
|
|
49345
50730
|
// ## Main Version
|
|
49346
50731
|
// Three dot-separated numeric identifiers.
|
|
@@ -49375,7 +50760,7 @@ var Neurosity = (function (exports) {
|
|
|
49375
50760
|
// ## Build Metadata Identifier
|
|
49376
50761
|
// Any combination of digits, letters, or hyphens.
|
|
49377
50762
|
|
|
49378
|
-
createToken('BUILDIDENTIFIER',
|
|
50763
|
+
createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`);
|
|
49379
50764
|
|
|
49380
50765
|
// ## Build Metadata
|
|
49381
50766
|
// Plus sign, followed by one or more period-separated build metadata
|
|
@@ -49435,12 +50820,17 @@ var Neurosity = (function (exports) {
|
|
|
49435
50820
|
|
|
49436
50821
|
// Coercion.
|
|
49437
50822
|
// Extract anything that could conceivably be a part of a valid semver
|
|
49438
|
-
createToken('
|
|
50823
|
+
createToken('COERCEPLAIN', `${'(^|[^\\d])' +
|
|
49439
50824
|
'(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
|
|
49440
50825
|
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
|
|
49441
|
-
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`
|
|
50826
|
+
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
50827
|
+
createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
50828
|
+
createToken('COERCEFULL', src[t.COERCEPLAIN] +
|
|
50829
|
+
`(?:${src[t.PRERELEASE]})?` +
|
|
50830
|
+
`(?:${src[t.BUILD]})?` +
|
|
49442
50831
|
`(?:$|[^\\d])`);
|
|
49443
50832
|
createToken('COERCERTL', src[t.COERCE], true);
|
|
50833
|
+
createToken('COERCERTLFULL', src[t.COERCEFULL], true);
|
|
49444
50834
|
|
|
49445
50835
|
// Tilde ranges.
|
|
49446
50836
|
// Meaning is "reasonably at or greater than"
|
|
@@ -49493,22 +50883,27 @@ var Neurosity = (function (exports) {
|
|
|
49493
50883
|
createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$');
|
|
49494
50884
|
});
|
|
49495
50885
|
var re_2 = re_1.re;
|
|
49496
|
-
var re_3 = re_1.
|
|
49497
|
-
var re_4 = re_1.
|
|
49498
|
-
var re_5 = re_1.
|
|
49499
|
-
var re_6 = re_1.
|
|
49500
|
-
var re_7 = re_1.
|
|
49501
|
-
|
|
49502
|
-
|
|
49503
|
-
//
|
|
49504
|
-
const
|
|
49505
|
-
const
|
|
49506
|
-
|
|
49507
|
-
|
|
49508
|
-
|
|
49509
|
-
|
|
49510
|
-
|
|
49511
|
-
|
|
50886
|
+
var re_3 = re_1.safeRe;
|
|
50887
|
+
var re_4 = re_1.src;
|
|
50888
|
+
var re_5 = re_1.t;
|
|
50889
|
+
var re_6 = re_1.tildeTrimReplace;
|
|
50890
|
+
var re_7 = re_1.caretTrimReplace;
|
|
50891
|
+
var re_8 = re_1.comparatorTrimReplace;
|
|
50892
|
+
|
|
50893
|
+
// parse out just the options we care about
|
|
50894
|
+
const looseOption = Object.freeze({ loose: true });
|
|
50895
|
+
const emptyOpts = Object.freeze({ });
|
|
50896
|
+
const parseOptions = options => {
|
|
50897
|
+
if (!options) {
|
|
50898
|
+
return emptyOpts
|
|
50899
|
+
}
|
|
50900
|
+
|
|
50901
|
+
if (typeof options !== 'object') {
|
|
50902
|
+
return looseOption
|
|
50903
|
+
}
|
|
50904
|
+
|
|
50905
|
+
return options
|
|
50906
|
+
};
|
|
49512
50907
|
var parseOptions_1 = parseOptions;
|
|
49513
50908
|
|
|
49514
50909
|
const numeric = /^[0-9]+$/;
|
|
@@ -49536,7 +50931,7 @@ var Neurosity = (function (exports) {
|
|
|
49536
50931
|
};
|
|
49537
50932
|
|
|
49538
50933
|
const { MAX_LENGTH: MAX_LENGTH$1, MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1 } = constants;
|
|
49539
|
-
const {
|
|
50934
|
+
const { safeRe: re$1, t: t$1 } = re_1;
|
|
49540
50935
|
|
|
49541
50936
|
|
|
49542
50937
|
const { compareIdentifiers: compareIdentifiers$1 } = identifiers;
|
|
@@ -49552,7 +50947,7 @@ var Neurosity = (function (exports) {
|
|
|
49552
50947
|
version = version.version;
|
|
49553
50948
|
}
|
|
49554
50949
|
} else if (typeof version !== 'string') {
|
|
49555
|
-
throw new TypeError(`Invalid
|
|
50950
|
+
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
|
|
49556
50951
|
}
|
|
49557
50952
|
|
|
49558
50953
|
if (version.length > MAX_LENGTH$1) {
|
|
@@ -49694,7 +51089,7 @@ var Neurosity = (function (exports) {
|
|
|
49694
51089
|
do {
|
|
49695
51090
|
const a = this.build[i];
|
|
49696
51091
|
const b = other.build[i];
|
|
49697
|
-
debug_1('
|
|
51092
|
+
debug_1('build compare', i, a, b);
|
|
49698
51093
|
if (a === undefined && b === undefined) {
|
|
49699
51094
|
return 0
|
|
49700
51095
|
} else if (b === undefined) {
|
|
@@ -49711,36 +51106,36 @@ var Neurosity = (function (exports) {
|
|
|
49711
51106
|
|
|
49712
51107
|
// preminor will bump the version up to the next minor release, and immediately
|
|
49713
51108
|
// down to pre-release. premajor and prepatch work the same way.
|
|
49714
|
-
inc (release, identifier) {
|
|
51109
|
+
inc (release, identifier, identifierBase) {
|
|
49715
51110
|
switch (release) {
|
|
49716
51111
|
case 'premajor':
|
|
49717
51112
|
this.prerelease.length = 0;
|
|
49718
51113
|
this.patch = 0;
|
|
49719
51114
|
this.minor = 0;
|
|
49720
51115
|
this.major++;
|
|
49721
|
-
this.inc('pre', identifier);
|
|
51116
|
+
this.inc('pre', identifier, identifierBase);
|
|
49722
51117
|
break
|
|
49723
51118
|
case 'preminor':
|
|
49724
51119
|
this.prerelease.length = 0;
|
|
49725
51120
|
this.patch = 0;
|
|
49726
51121
|
this.minor++;
|
|
49727
|
-
this.inc('pre', identifier);
|
|
51122
|
+
this.inc('pre', identifier, identifierBase);
|
|
49728
51123
|
break
|
|
49729
51124
|
case 'prepatch':
|
|
49730
51125
|
// If this is already a prerelease, it will bump to the next version
|
|
49731
51126
|
// drop any prereleases that might already exist, since they are not
|
|
49732
51127
|
// relevant at this point.
|
|
49733
51128
|
this.prerelease.length = 0;
|
|
49734
|
-
this.inc('patch', identifier);
|
|
49735
|
-
this.inc('pre', identifier);
|
|
51129
|
+
this.inc('patch', identifier, identifierBase);
|
|
51130
|
+
this.inc('pre', identifier, identifierBase);
|
|
49736
51131
|
break
|
|
49737
51132
|
// If the input is a non-prerelease version, this acts the same as
|
|
49738
51133
|
// prepatch.
|
|
49739
51134
|
case 'prerelease':
|
|
49740
51135
|
if (this.prerelease.length === 0) {
|
|
49741
|
-
this.inc('patch', identifier);
|
|
51136
|
+
this.inc('patch', identifier, identifierBase);
|
|
49742
51137
|
}
|
|
49743
|
-
this.inc('pre', identifier);
|
|
51138
|
+
this.inc('pre', identifier, identifierBase);
|
|
49744
51139
|
break
|
|
49745
51140
|
|
|
49746
51141
|
case 'major':
|
|
@@ -49782,9 +51177,15 @@ var Neurosity = (function (exports) {
|
|
|
49782
51177
|
break
|
|
49783
51178
|
// This probably shouldn't be used publicly.
|
|
49784
51179
|
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
49785
|
-
case 'pre':
|
|
51180
|
+
case 'pre': {
|
|
51181
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
51182
|
+
|
|
51183
|
+
if (!identifier && identifierBase === false) {
|
|
51184
|
+
throw new Error('invalid increment argument: identifier is empty')
|
|
51185
|
+
}
|
|
51186
|
+
|
|
49786
51187
|
if (this.prerelease.length === 0) {
|
|
49787
|
-
this.prerelease = [
|
|
51188
|
+
this.prerelease = [base];
|
|
49788
51189
|
} else {
|
|
49789
51190
|
let i = this.prerelease.length;
|
|
49790
51191
|
while (--i >= 0) {
|
|
@@ -49795,27 +51196,36 @@ var Neurosity = (function (exports) {
|
|
|
49795
51196
|
}
|
|
49796
51197
|
if (i === -1) {
|
|
49797
51198
|
// didn't increment anything
|
|
49798
|
-
this.prerelease.
|
|
51199
|
+
if (identifier === this.prerelease.join('.') && identifierBase === false) {
|
|
51200
|
+
throw new Error('invalid increment argument: identifier already exists')
|
|
51201
|
+
}
|
|
51202
|
+
this.prerelease.push(base);
|
|
49799
51203
|
}
|
|
49800
51204
|
}
|
|
49801
51205
|
if (identifier) {
|
|
49802
51206
|
// 1.2.0-beta.1 bumps to 1.2.0-beta.2,
|
|
49803
51207
|
// 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
|
|
51208
|
+
let prerelease = [identifier, base];
|
|
51209
|
+
if (identifierBase === false) {
|
|
51210
|
+
prerelease = [identifier];
|
|
51211
|
+
}
|
|
49804
51212
|
if (compareIdentifiers$1(this.prerelease[0], identifier) === 0) {
|
|
49805
51213
|
if (isNaN(this.prerelease[1])) {
|
|
49806
|
-
this.prerelease =
|
|
51214
|
+
this.prerelease = prerelease;
|
|
49807
51215
|
}
|
|
49808
51216
|
} else {
|
|
49809
|
-
this.prerelease =
|
|
51217
|
+
this.prerelease = prerelease;
|
|
49810
51218
|
}
|
|
49811
51219
|
}
|
|
49812
51220
|
break
|
|
49813
|
-
|
|
51221
|
+
}
|
|
49814
51222
|
default:
|
|
49815
51223
|
throw new Error(`invalid increment argument: ${release}`)
|
|
49816
51224
|
}
|
|
49817
|
-
this.format();
|
|
49818
|
-
this.
|
|
51225
|
+
this.raw = this.format();
|
|
51226
|
+
if (this.build.length) {
|
|
51227
|
+
this.raw += `+${this.build.join('.')}`;
|
|
51228
|
+
}
|
|
49819
51229
|
return this
|
|
49820
51230
|
}
|
|
49821
51231
|
}
|