hanbiro-react16-sdk 1.0.20 → 1.0.21
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/components/ChatAIDraft/SettingPopper.js +5 -5
- package/dist/components/CountryFlag/flags/KRFlag.js +1 -1
- package/dist/hanbiro-react16-sdk.style.css +1 -1
- package/dist/hanbiro-react16-sdk.umd.js +2 -2
- package/dist/index.js +1 -1
- package/dist/utils/api.d.ts +9 -0
- package/dist/utils/api.js +55 -0
- package/package.json +1 -2
- package/dist/node_modules/axios/index.js +0 -38
- package/dist/node_modules/axios/lib/adapters/adapters.js +0 -71
- package/dist/node_modules/axios/lib/adapters/fetch.js +0 -272
- package/dist/node_modules/axios/lib/adapters/xhr.js +0 -153
- package/dist/node_modules/axios/lib/axios.js +0 -50
- package/dist/node_modules/axios/lib/cancel/CancelToken.js +0 -99
- package/dist/node_modules/axios/lib/cancel/CanceledError.js +0 -20
- package/dist/node_modules/axios/lib/cancel/isCancel.js +0 -6
- package/dist/node_modules/axios/lib/core/Axios.js +0 -220
- package/dist/node_modules/axios/lib/core/AxiosError.js +0 -76
- package/dist/node_modules/axios/lib/core/AxiosHeaders.js +0 -238
- package/dist/node_modules/axios/lib/core/InterceptorManager.js +0 -66
- package/dist/node_modules/axios/lib/core/buildFullPath.js +0 -12
- package/dist/node_modules/axios/lib/core/dispatchRequest.js +0 -48
- package/dist/node_modules/axios/lib/core/mergeConfig.js +0 -100
- package/dist/node_modules/axios/lib/core/settle.js +0 -20
- package/dist/node_modules/axios/lib/core/transformData.js +0 -17
- package/dist/node_modules/axios/lib/defaults/index.js +0 -120
- package/dist/node_modules/axios/lib/defaults/transitional.js +0 -9
- package/dist/node_modules/axios/lib/env/data.js +0 -4
- package/dist/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -34
- package/dist/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -77
- package/dist/node_modules/axios/lib/helpers/bind.js +0 -8
- package/dist/node_modules/axios/lib/helpers/buildURL.js +0 -32
- package/dist/node_modules/axios/lib/helpers/combineURLs.js +0 -6
- package/dist/node_modules/axios/lib/helpers/composeSignals.js +0 -41
- package/dist/node_modules/axios/lib/helpers/cookies.js +0 -49
- package/dist/node_modules/axios/lib/helpers/formDataToJSON.js +0 -54
- package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -9
- package/dist/node_modules/axios/lib/helpers/isAxiosError.js +0 -7
- package/dist/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -11
- package/dist/node_modules/axios/lib/helpers/null.js +0 -4
- package/dist/node_modules/axios/lib/helpers/parseHeaders.js +0 -47
- package/dist/node_modules/axios/lib/helpers/parseProtocol.js +0 -7
- package/dist/node_modules/axios/lib/helpers/progressEventReducer.js +0 -44
- package/dist/node_modules/axios/lib/helpers/resolveConfig.js +0 -52
- package/dist/node_modules/axios/lib/helpers/speedometer.js +0 -36
- package/dist/node_modules/axios/lib/helpers/spread.js +0 -8
- package/dist/node_modules/axios/lib/helpers/throttle.js +0 -35
- package/dist/node_modules/axios/lib/helpers/toFormData.js +0 -120
- package/dist/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -33
- package/dist/node_modules/axios/lib/helpers/trackStream.js +0 -169
- package/dist/node_modules/axios/lib/helpers/validator.js +0 -70
- package/dist/node_modules/axios/lib/platform/browser/classes/Blob.js +0 -4
- package/dist/node_modules/axios/lib/platform/browser/classes/FormData.js +0 -4
- package/dist/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +0 -5
- package/dist/node_modules/axios/lib/platform/browser/index.js +0 -15
- package/dist/node_modules/axios/lib/platform/common/utils.js +0 -15
- package/dist/node_modules/axios/lib/platform/index.js +0 -22
- package/dist/node_modules/axios/lib/utils.js +0 -429
- package/dist/utils/axiosAPI.d.ts +0 -1
- package/dist/utils/axiosAPI.js +0 -89
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import utils from "../utils.js";
|
|
2
|
-
class InterceptorManager {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.handlers = [];
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Add a new interceptor to the stack
|
|
8
|
-
*
|
|
9
|
-
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
10
|
-
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
11
|
-
* @param {Object} options The options for the interceptor, synchronous and runWhen
|
|
12
|
-
*
|
|
13
|
-
* @return {Number} An ID used to remove interceptor later
|
|
14
|
-
*/
|
|
15
|
-
use(fulfilled, rejected, options) {
|
|
16
|
-
this.handlers.push({
|
|
17
|
-
fulfilled,
|
|
18
|
-
rejected,
|
|
19
|
-
synchronous: options ? options.synchronous : false,
|
|
20
|
-
runWhen: options ? options.runWhen : null
|
|
21
|
-
});
|
|
22
|
-
return this.handlers.length - 1;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Remove an interceptor from the stack
|
|
26
|
-
*
|
|
27
|
-
* @param {Number} id The ID that was returned by `use`
|
|
28
|
-
*
|
|
29
|
-
* @returns {void}
|
|
30
|
-
*/
|
|
31
|
-
eject(id) {
|
|
32
|
-
if (this.handlers[id]) {
|
|
33
|
-
this.handlers[id] = null;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Clear all interceptors from the stack
|
|
38
|
-
*
|
|
39
|
-
* @returns {void}
|
|
40
|
-
*/
|
|
41
|
-
clear() {
|
|
42
|
-
if (this.handlers) {
|
|
43
|
-
this.handlers = [];
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Iterate over all the registered interceptors
|
|
48
|
-
*
|
|
49
|
-
* This method is particularly useful for skipping over any
|
|
50
|
-
* interceptors that may have become `null` calling `eject`.
|
|
51
|
-
*
|
|
52
|
-
* @param {Function} fn The function to call for each interceptor
|
|
53
|
-
*
|
|
54
|
-
* @returns {void}
|
|
55
|
-
*/
|
|
56
|
-
forEach(fn) {
|
|
57
|
-
utils.forEach(this.handlers, function forEachHandler(h) {
|
|
58
|
-
if (h !== null) {
|
|
59
|
-
fn(h);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
export {
|
|
65
|
-
InterceptorManager as default
|
|
66
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import isAbsoluteURL from "../helpers/isAbsoluteURL.js";
|
|
2
|
-
import combineURLs from "../helpers/combineURLs.js";
|
|
3
|
-
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
4
|
-
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
5
|
-
if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
|
|
6
|
-
return combineURLs(baseURL, requestedURL);
|
|
7
|
-
}
|
|
8
|
-
return requestedURL;
|
|
9
|
-
}
|
|
10
|
-
export {
|
|
11
|
-
buildFullPath as default
|
|
12
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import transformData from "./transformData.js";
|
|
2
|
-
import isCancel from "../cancel/isCancel.js";
|
|
3
|
-
import defaults from "../defaults/index.js";
|
|
4
|
-
import CanceledError from "../cancel/CanceledError.js";
|
|
5
|
-
import AxiosHeaders from "./AxiosHeaders.js";
|
|
6
|
-
import adapters from "../adapters/adapters.js";
|
|
7
|
-
function throwIfCancellationRequested(config) {
|
|
8
|
-
if (config.cancelToken) {
|
|
9
|
-
config.cancelToken.throwIfRequested();
|
|
10
|
-
}
|
|
11
|
-
if (config.signal && config.signal.aborted) {
|
|
12
|
-
throw new CanceledError(null, config);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function dispatchRequest(config) {
|
|
16
|
-
throwIfCancellationRequested(config);
|
|
17
|
-
config.headers = AxiosHeaders.from(config.headers);
|
|
18
|
-
config.data = transformData.call(config, config.transformRequest);
|
|
19
|
-
if (["post", "put", "patch"].indexOf(config.method) !== -1) {
|
|
20
|
-
config.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
21
|
-
}
|
|
22
|
-
const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
|
|
23
|
-
return adapter(config).then(
|
|
24
|
-
function onAdapterResolution(response) {
|
|
25
|
-
throwIfCancellationRequested(config);
|
|
26
|
-
response.data = transformData.call(config, config.transformResponse, response);
|
|
27
|
-
response.headers = AxiosHeaders.from(response.headers);
|
|
28
|
-
return response;
|
|
29
|
-
},
|
|
30
|
-
function onAdapterRejection(reason) {
|
|
31
|
-
if (!isCancel(reason)) {
|
|
32
|
-
throwIfCancellationRequested(config);
|
|
33
|
-
if (reason && reason.response) {
|
|
34
|
-
reason.response.data = transformData.call(
|
|
35
|
-
config,
|
|
36
|
-
config.transformResponse,
|
|
37
|
-
reason.response
|
|
38
|
-
);
|
|
39
|
-
reason.response.headers = AxiosHeaders.from(reason.response.headers);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return Promise.reject(reason);
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
export {
|
|
47
|
-
dispatchRequest as default
|
|
48
|
-
};
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
import utils from "../utils.js";
|
|
18
|
-
import AxiosHeaders from "./AxiosHeaders.js";
|
|
19
|
-
const headersToObject = (thing) => thing instanceof AxiosHeaders ? __spreadValues({}, thing) : thing;
|
|
20
|
-
function mergeConfig(config1, config2) {
|
|
21
|
-
config2 = config2 || {};
|
|
22
|
-
const config = {};
|
|
23
|
-
function getMergedValue(target, source, prop, caseless) {
|
|
24
|
-
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
|
25
|
-
return utils.merge.call({ caseless }, target, source);
|
|
26
|
-
} else if (utils.isPlainObject(source)) {
|
|
27
|
-
return utils.merge({}, source);
|
|
28
|
-
} else if (utils.isArray(source)) {
|
|
29
|
-
return source.slice();
|
|
30
|
-
}
|
|
31
|
-
return source;
|
|
32
|
-
}
|
|
33
|
-
function mergeDeepProperties(a, b, prop, caseless) {
|
|
34
|
-
if (!utils.isUndefined(b)) {
|
|
35
|
-
return getMergedValue(a, b, prop, caseless);
|
|
36
|
-
} else if (!utils.isUndefined(a)) {
|
|
37
|
-
return getMergedValue(void 0, a, prop, caseless);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function valueFromConfig2(a, b) {
|
|
41
|
-
if (!utils.isUndefined(b)) {
|
|
42
|
-
return getMergedValue(void 0, b);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
function defaultToConfig2(a, b) {
|
|
46
|
-
if (!utils.isUndefined(b)) {
|
|
47
|
-
return getMergedValue(void 0, b);
|
|
48
|
-
} else if (!utils.isUndefined(a)) {
|
|
49
|
-
return getMergedValue(void 0, a);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function mergeDirectKeys(a, b, prop) {
|
|
53
|
-
if (prop in config2) {
|
|
54
|
-
return getMergedValue(a, b);
|
|
55
|
-
} else if (prop in config1) {
|
|
56
|
-
return getMergedValue(void 0, a);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
const mergeMap = {
|
|
60
|
-
url: valueFromConfig2,
|
|
61
|
-
method: valueFromConfig2,
|
|
62
|
-
data: valueFromConfig2,
|
|
63
|
-
baseURL: defaultToConfig2,
|
|
64
|
-
transformRequest: defaultToConfig2,
|
|
65
|
-
transformResponse: defaultToConfig2,
|
|
66
|
-
paramsSerializer: defaultToConfig2,
|
|
67
|
-
timeout: defaultToConfig2,
|
|
68
|
-
timeoutMessage: defaultToConfig2,
|
|
69
|
-
withCredentials: defaultToConfig2,
|
|
70
|
-
withXSRFToken: defaultToConfig2,
|
|
71
|
-
adapter: defaultToConfig2,
|
|
72
|
-
responseType: defaultToConfig2,
|
|
73
|
-
xsrfCookieName: defaultToConfig2,
|
|
74
|
-
xsrfHeaderName: defaultToConfig2,
|
|
75
|
-
onUploadProgress: defaultToConfig2,
|
|
76
|
-
onDownloadProgress: defaultToConfig2,
|
|
77
|
-
decompress: defaultToConfig2,
|
|
78
|
-
maxContentLength: defaultToConfig2,
|
|
79
|
-
maxBodyLength: defaultToConfig2,
|
|
80
|
-
beforeRedirect: defaultToConfig2,
|
|
81
|
-
transport: defaultToConfig2,
|
|
82
|
-
httpAgent: defaultToConfig2,
|
|
83
|
-
httpsAgent: defaultToConfig2,
|
|
84
|
-
cancelToken: defaultToConfig2,
|
|
85
|
-
socketPath: defaultToConfig2,
|
|
86
|
-
responseEncoding: defaultToConfig2,
|
|
87
|
-
validateStatus: mergeDirectKeys,
|
|
88
|
-
headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
|
|
89
|
-
};
|
|
90
|
-
utils.forEach(Object.keys(__spreadValues(__spreadValues({}, config1), config2)), function computeConfigValue(prop) {
|
|
91
|
-
if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return;
|
|
92
|
-
const merge = utils.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
93
|
-
const configValue = merge(config1[prop], config2[prop], prop);
|
|
94
|
-
utils.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
|
|
95
|
-
});
|
|
96
|
-
return config;
|
|
97
|
-
}
|
|
98
|
-
export {
|
|
99
|
-
mergeConfig as default
|
|
100
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import AxiosError from "./AxiosError.js";
|
|
2
|
-
function settle(resolve, reject, response) {
|
|
3
|
-
const validateStatus = response.config.validateStatus;
|
|
4
|
-
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
5
|
-
resolve(response);
|
|
6
|
-
} else {
|
|
7
|
-
reject(
|
|
8
|
-
new AxiosError(
|
|
9
|
-
"Request failed with status code " + response.status,
|
|
10
|
-
[AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
|
|
11
|
-
response.config,
|
|
12
|
-
response.request,
|
|
13
|
-
response
|
|
14
|
-
)
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
settle as default
|
|
20
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import utils from "../utils.js";
|
|
2
|
-
import defaults from "../defaults/index.js";
|
|
3
|
-
import AxiosHeaders from "./AxiosHeaders.js";
|
|
4
|
-
function transformData(fns, response) {
|
|
5
|
-
const config = this || defaults;
|
|
6
|
-
const context = response || config;
|
|
7
|
-
const headers = AxiosHeaders.from(context.headers);
|
|
8
|
-
let data = context.data;
|
|
9
|
-
utils.forEach(fns, function transform(fn) {
|
|
10
|
-
data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
|
|
11
|
-
});
|
|
12
|
-
headers.normalize();
|
|
13
|
-
return data;
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
transformData as default
|
|
17
|
-
};
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import utils from "../utils.js";
|
|
2
|
-
import AxiosError from "../core/AxiosError.js";
|
|
3
|
-
import transitionalDefaults from "./transitional.js";
|
|
4
|
-
import toFormData from "../helpers/toFormData.js";
|
|
5
|
-
import toURLEncodedForm from "../helpers/toURLEncodedForm.js";
|
|
6
|
-
import platform from "../platform/index.js";
|
|
7
|
-
import formDataToJSON from "../helpers/formDataToJSON.js";
|
|
8
|
-
function stringifySafely(rawValue, parser, encoder) {
|
|
9
|
-
if (utils.isString(rawValue)) {
|
|
10
|
-
try {
|
|
11
|
-
(parser || JSON.parse)(rawValue);
|
|
12
|
-
return utils.trim(rawValue);
|
|
13
|
-
} catch (e) {
|
|
14
|
-
if (e.name !== "SyntaxError") {
|
|
15
|
-
throw e;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return (encoder || JSON.stringify)(rawValue);
|
|
20
|
-
}
|
|
21
|
-
const defaults = {
|
|
22
|
-
transitional: transitionalDefaults,
|
|
23
|
-
adapter: ["xhr", "http", "fetch"],
|
|
24
|
-
transformRequest: [
|
|
25
|
-
function transformRequest(data, headers) {
|
|
26
|
-
const contentType = headers.getContentType() || "";
|
|
27
|
-
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
28
|
-
const isObjectPayload = utils.isObject(data);
|
|
29
|
-
if (isObjectPayload && utils.isHTMLForm(data)) {
|
|
30
|
-
data = new FormData(data);
|
|
31
|
-
}
|
|
32
|
-
const isFormData = utils.isFormData(data);
|
|
33
|
-
if (isFormData) {
|
|
34
|
-
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
35
|
-
}
|
|
36
|
-
if (utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data) || utils.isReadableStream(data)) {
|
|
37
|
-
return data;
|
|
38
|
-
}
|
|
39
|
-
if (utils.isArrayBufferView(data)) {
|
|
40
|
-
return data.buffer;
|
|
41
|
-
}
|
|
42
|
-
if (utils.isURLSearchParams(data)) {
|
|
43
|
-
headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
|
|
44
|
-
return data.toString();
|
|
45
|
-
}
|
|
46
|
-
let isFileList;
|
|
47
|
-
if (isObjectPayload) {
|
|
48
|
-
if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
|
|
49
|
-
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
50
|
-
}
|
|
51
|
-
if ((isFileList = utils.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
52
|
-
const _FormData = this.env && this.env.FormData;
|
|
53
|
-
return toFormData(
|
|
54
|
-
isFileList ? { "files[]": data } : data,
|
|
55
|
-
_FormData && new _FormData(),
|
|
56
|
-
this.formSerializer
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
if (isObjectPayload || hasJSONContentType) {
|
|
61
|
-
headers.setContentType("application/json", false);
|
|
62
|
-
return stringifySafely(data);
|
|
63
|
-
}
|
|
64
|
-
return data;
|
|
65
|
-
}
|
|
66
|
-
],
|
|
67
|
-
transformResponse: [
|
|
68
|
-
function transformResponse(data) {
|
|
69
|
-
const transitional = this.transitional || defaults.transitional;
|
|
70
|
-
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
71
|
-
const JSONRequested = this.responseType === "json";
|
|
72
|
-
if (utils.isResponse(data) || utils.isReadableStream(data)) {
|
|
73
|
-
return data;
|
|
74
|
-
}
|
|
75
|
-
if (data && utils.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
|
76
|
-
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
77
|
-
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
78
|
-
try {
|
|
79
|
-
return JSON.parse(data, this.parseReviver);
|
|
80
|
-
} catch (e) {
|
|
81
|
-
if (strictJSONParsing) {
|
|
82
|
-
if (e.name === "SyntaxError") {
|
|
83
|
-
throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
|
|
84
|
-
}
|
|
85
|
-
throw e;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return data;
|
|
90
|
-
}
|
|
91
|
-
],
|
|
92
|
-
/**
|
|
93
|
-
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
94
|
-
* timeout is not created.
|
|
95
|
-
*/
|
|
96
|
-
timeout: 0,
|
|
97
|
-
xsrfCookieName: "XSRF-TOKEN",
|
|
98
|
-
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
99
|
-
maxContentLength: -1,
|
|
100
|
-
maxBodyLength: -1,
|
|
101
|
-
env: {
|
|
102
|
-
FormData: platform.classes.FormData,
|
|
103
|
-
Blob: platform.classes.Blob
|
|
104
|
-
},
|
|
105
|
-
validateStatus: function validateStatus(status) {
|
|
106
|
-
return status >= 200 && status < 300;
|
|
107
|
-
},
|
|
108
|
-
headers: {
|
|
109
|
-
common: {
|
|
110
|
-
Accept: "application/json, text/plain, */*",
|
|
111
|
-
"Content-Type": void 0
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
utils.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
|
|
116
|
-
defaults.headers[method] = {};
|
|
117
|
-
});
|
|
118
|
-
export {
|
|
119
|
-
defaults as default
|
|
120
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import toFormData from "./toFormData.js";
|
|
2
|
-
function encode(str) {
|
|
3
|
-
const charMap = {
|
|
4
|
-
"!": "%21",
|
|
5
|
-
"'": "%27",
|
|
6
|
-
"(": "%28",
|
|
7
|
-
")": "%29",
|
|
8
|
-
"~": "%7E",
|
|
9
|
-
"%20": "+",
|
|
10
|
-
"%00": "\0"
|
|
11
|
-
};
|
|
12
|
-
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
|
|
13
|
-
return charMap[match];
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
function AxiosURLSearchParams(params, options) {
|
|
17
|
-
this._pairs = [];
|
|
18
|
-
params && toFormData(params, this, options);
|
|
19
|
-
}
|
|
20
|
-
const prototype = AxiosURLSearchParams.prototype;
|
|
21
|
-
prototype.append = function append(name, value) {
|
|
22
|
-
this._pairs.push([name, value]);
|
|
23
|
-
};
|
|
24
|
-
prototype.toString = function toString(encoder) {
|
|
25
|
-
const _encode = encoder ? function(value) {
|
|
26
|
-
return encoder.call(this, value, encode);
|
|
27
|
-
} : encode;
|
|
28
|
-
return this._pairs.map(function each(pair) {
|
|
29
|
-
return _encode(pair[0]) + "=" + _encode(pair[1]);
|
|
30
|
-
}, "").join("&");
|
|
31
|
-
};
|
|
32
|
-
export {
|
|
33
|
-
AxiosURLSearchParams as default
|
|
34
|
-
};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
const HttpStatusCode = {
|
|
2
|
-
Continue: 100,
|
|
3
|
-
SwitchingProtocols: 101,
|
|
4
|
-
Processing: 102,
|
|
5
|
-
EarlyHints: 103,
|
|
6
|
-
Ok: 200,
|
|
7
|
-
Created: 201,
|
|
8
|
-
Accepted: 202,
|
|
9
|
-
NonAuthoritativeInformation: 203,
|
|
10
|
-
NoContent: 204,
|
|
11
|
-
ResetContent: 205,
|
|
12
|
-
PartialContent: 206,
|
|
13
|
-
MultiStatus: 207,
|
|
14
|
-
AlreadyReported: 208,
|
|
15
|
-
ImUsed: 226,
|
|
16
|
-
MultipleChoices: 300,
|
|
17
|
-
MovedPermanently: 301,
|
|
18
|
-
Found: 302,
|
|
19
|
-
SeeOther: 303,
|
|
20
|
-
NotModified: 304,
|
|
21
|
-
UseProxy: 305,
|
|
22
|
-
Unused: 306,
|
|
23
|
-
TemporaryRedirect: 307,
|
|
24
|
-
PermanentRedirect: 308,
|
|
25
|
-
BadRequest: 400,
|
|
26
|
-
Unauthorized: 401,
|
|
27
|
-
PaymentRequired: 402,
|
|
28
|
-
Forbidden: 403,
|
|
29
|
-
NotFound: 404,
|
|
30
|
-
MethodNotAllowed: 405,
|
|
31
|
-
NotAcceptable: 406,
|
|
32
|
-
ProxyAuthenticationRequired: 407,
|
|
33
|
-
RequestTimeout: 408,
|
|
34
|
-
Conflict: 409,
|
|
35
|
-
Gone: 410,
|
|
36
|
-
LengthRequired: 411,
|
|
37
|
-
PreconditionFailed: 412,
|
|
38
|
-
PayloadTooLarge: 413,
|
|
39
|
-
UriTooLong: 414,
|
|
40
|
-
UnsupportedMediaType: 415,
|
|
41
|
-
RangeNotSatisfiable: 416,
|
|
42
|
-
ExpectationFailed: 417,
|
|
43
|
-
ImATeapot: 418,
|
|
44
|
-
MisdirectedRequest: 421,
|
|
45
|
-
UnprocessableEntity: 422,
|
|
46
|
-
Locked: 423,
|
|
47
|
-
FailedDependency: 424,
|
|
48
|
-
TooEarly: 425,
|
|
49
|
-
UpgradeRequired: 426,
|
|
50
|
-
PreconditionRequired: 428,
|
|
51
|
-
TooManyRequests: 429,
|
|
52
|
-
RequestHeaderFieldsTooLarge: 431,
|
|
53
|
-
UnavailableForLegalReasons: 451,
|
|
54
|
-
InternalServerError: 500,
|
|
55
|
-
NotImplemented: 501,
|
|
56
|
-
BadGateway: 502,
|
|
57
|
-
ServiceUnavailable: 503,
|
|
58
|
-
GatewayTimeout: 504,
|
|
59
|
-
HttpVersionNotSupported: 505,
|
|
60
|
-
VariantAlsoNegotiates: 506,
|
|
61
|
-
InsufficientStorage: 507,
|
|
62
|
-
LoopDetected: 508,
|
|
63
|
-
NotExtended: 510,
|
|
64
|
-
NetworkAuthenticationRequired: 511,
|
|
65
|
-
WebServerIsDown: 521,
|
|
66
|
-
ConnectionTimedOut: 522,
|
|
67
|
-
OriginIsUnreachable: 523,
|
|
68
|
-
TimeoutOccurred: 524,
|
|
69
|
-
SslHandshakeFailed: 525,
|
|
70
|
-
InvalidSslCertificate: 526
|
|
71
|
-
};
|
|
72
|
-
Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
73
|
-
HttpStatusCode[value] = key;
|
|
74
|
-
});
|
|
75
|
-
export {
|
|
76
|
-
HttpStatusCode as default
|
|
77
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import utils from "../utils.js";
|
|
2
|
-
import AxiosURLSearchParams from "./AxiosURLSearchParams.js";
|
|
3
|
-
function encode(val) {
|
|
4
|
-
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
5
|
-
}
|
|
6
|
-
function buildURL(url, params, options) {
|
|
7
|
-
if (!params) {
|
|
8
|
-
return url;
|
|
9
|
-
}
|
|
10
|
-
const _encode = options && options.encode || encode;
|
|
11
|
-
const _options = utils.isFunction(options) ? {
|
|
12
|
-
serialize: options
|
|
13
|
-
} : options;
|
|
14
|
-
const serializeFn = _options && _options.serialize;
|
|
15
|
-
let serializedParams;
|
|
16
|
-
if (serializeFn) {
|
|
17
|
-
serializedParams = serializeFn(params, _options);
|
|
18
|
-
} else {
|
|
19
|
-
serializedParams = utils.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
20
|
-
}
|
|
21
|
-
if (serializedParams) {
|
|
22
|
-
const hashmarkIndex = url.indexOf("#");
|
|
23
|
-
if (hashmarkIndex !== -1) {
|
|
24
|
-
url = url.slice(0, hashmarkIndex);
|
|
25
|
-
}
|
|
26
|
-
url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
|
|
27
|
-
}
|
|
28
|
-
return url;
|
|
29
|
-
}
|
|
30
|
-
export {
|
|
31
|
-
buildURL as default
|
|
32
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import CanceledError from "../cancel/CanceledError.js";
|
|
2
|
-
import AxiosError from "../core/AxiosError.js";
|
|
3
|
-
import utils from "../utils.js";
|
|
4
|
-
const composeSignals = (signals, timeout) => {
|
|
5
|
-
const { length } = signals = signals ? signals.filter(Boolean) : [];
|
|
6
|
-
if (timeout || length) {
|
|
7
|
-
let controller = new AbortController();
|
|
8
|
-
let aborted;
|
|
9
|
-
const onabort = function(reason) {
|
|
10
|
-
if (!aborted) {
|
|
11
|
-
aborted = true;
|
|
12
|
-
unsubscribe();
|
|
13
|
-
const err = reason instanceof Error ? reason : this.reason;
|
|
14
|
-
controller.abort(
|
|
15
|
-
err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err)
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
let timer = timeout && setTimeout(() => {
|
|
20
|
-
timer = null;
|
|
21
|
-
onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
|
|
22
|
-
}, timeout);
|
|
23
|
-
const unsubscribe = () => {
|
|
24
|
-
if (signals) {
|
|
25
|
-
timer && clearTimeout(timer);
|
|
26
|
-
timer = null;
|
|
27
|
-
signals.forEach((signal2) => {
|
|
28
|
-
signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
|
|
29
|
-
});
|
|
30
|
-
signals = null;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
|
|
34
|
-
const { signal } = controller;
|
|
35
|
-
signal.unsubscribe = () => utils.asap(unsubscribe);
|
|
36
|
-
return signal;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
export {
|
|
40
|
-
composeSignals as default
|
|
41
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import utils from "../utils.js";
|
|
2
|
-
import platform from "../platform/index.js";
|
|
3
|
-
const cookies = platform.hasStandardBrowserEnv ? (
|
|
4
|
-
// Standard browser envs support document.cookie
|
|
5
|
-
{
|
|
6
|
-
write(name, value, expires, path, domain, secure, sameSite) {
|
|
7
|
-
if (typeof document === "undefined") return;
|
|
8
|
-
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
9
|
-
if (utils.isNumber(expires)) {
|
|
10
|
-
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
11
|
-
}
|
|
12
|
-
if (utils.isString(path)) {
|
|
13
|
-
cookie.push(`path=${path}`);
|
|
14
|
-
}
|
|
15
|
-
if (utils.isString(domain)) {
|
|
16
|
-
cookie.push(`domain=${domain}`);
|
|
17
|
-
}
|
|
18
|
-
if (secure === true) {
|
|
19
|
-
cookie.push("secure");
|
|
20
|
-
}
|
|
21
|
-
if (utils.isString(sameSite)) {
|
|
22
|
-
cookie.push(`SameSite=${sameSite}`);
|
|
23
|
-
}
|
|
24
|
-
document.cookie = cookie.join("; ");
|
|
25
|
-
},
|
|
26
|
-
read(name) {
|
|
27
|
-
if (typeof document === "undefined") return null;
|
|
28
|
-
const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
|
|
29
|
-
return match ? decodeURIComponent(match[1]) : null;
|
|
30
|
-
},
|
|
31
|
-
remove(name) {
|
|
32
|
-
this.write(name, "", Date.now() - 864e5, "/");
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
) : (
|
|
36
|
-
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
37
|
-
{
|
|
38
|
-
write() {
|
|
39
|
-
},
|
|
40
|
-
read() {
|
|
41
|
-
return null;
|
|
42
|
-
},
|
|
43
|
-
remove() {
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
export {
|
|
48
|
-
cookies as default
|
|
49
|
-
};
|