hanbiro-react16-sdk 1.0.19 → 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 +10 -10
- package/dist/utils/api.d.ts +9 -0
- package/dist/utils/api.js +55 -0
- package/package.json +9 -7
- 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,429 +0,0 @@
|
|
|
1
|
-
import bind from "./helpers/bind.js";
|
|
2
|
-
const { toString } = Object.prototype;
|
|
3
|
-
const { getPrototypeOf } = Object;
|
|
4
|
-
const { iterator, toStringTag } = Symbol;
|
|
5
|
-
const kindOf = /* @__PURE__ */ ((cache) => (thing) => {
|
|
6
|
-
const str = toString.call(thing);
|
|
7
|
-
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
8
|
-
})(/* @__PURE__ */ Object.create(null));
|
|
9
|
-
const kindOfTest = (type) => {
|
|
10
|
-
type = type.toLowerCase();
|
|
11
|
-
return (thing) => kindOf(thing) === type;
|
|
12
|
-
};
|
|
13
|
-
const typeOfTest = (type) => (thing) => typeof thing === type;
|
|
14
|
-
const { isArray } = Array;
|
|
15
|
-
const isUndefined = typeOfTest("undefined");
|
|
16
|
-
function isBuffer(val) {
|
|
17
|
-
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
18
|
-
}
|
|
19
|
-
const isArrayBuffer = kindOfTest("ArrayBuffer");
|
|
20
|
-
function isArrayBufferView(val) {
|
|
21
|
-
let result;
|
|
22
|
-
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
23
|
-
result = ArrayBuffer.isView(val);
|
|
24
|
-
} else {
|
|
25
|
-
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
26
|
-
}
|
|
27
|
-
return result;
|
|
28
|
-
}
|
|
29
|
-
const isString = typeOfTest("string");
|
|
30
|
-
const isFunction = typeOfTest("function");
|
|
31
|
-
const isNumber = typeOfTest("number");
|
|
32
|
-
const isObject = (thing) => thing !== null && typeof thing === "object";
|
|
33
|
-
const isBoolean = (thing) => thing === true || thing === false;
|
|
34
|
-
const isPlainObject = (val) => {
|
|
35
|
-
if (kindOf(val) !== "object") {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
const prototype = getPrototypeOf(val);
|
|
39
|
-
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
|
|
40
|
-
};
|
|
41
|
-
const isEmptyObject = (val) => {
|
|
42
|
-
if (!isObject(val) || isBuffer(val)) {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
try {
|
|
46
|
-
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
|
47
|
-
} catch (e) {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
const isDate = kindOfTest("Date");
|
|
52
|
-
const isFile = kindOfTest("File");
|
|
53
|
-
const isReactNativeBlob = (value) => {
|
|
54
|
-
return !!(value && typeof value.uri !== "undefined");
|
|
55
|
-
};
|
|
56
|
-
const isReactNative = (formData) => formData && typeof formData.getParts !== "undefined";
|
|
57
|
-
const isBlob = kindOfTest("Blob");
|
|
58
|
-
const isFileList = kindOfTest("FileList");
|
|
59
|
-
const isStream = (val) => isObject(val) && isFunction(val.pipe);
|
|
60
|
-
function getGlobal() {
|
|
61
|
-
if (typeof globalThis !== "undefined") return globalThis;
|
|
62
|
-
if (typeof self !== "undefined") return self;
|
|
63
|
-
if (typeof window !== "undefined") return window;
|
|
64
|
-
if (typeof global !== "undefined") return global;
|
|
65
|
-
return {};
|
|
66
|
-
}
|
|
67
|
-
const G = getGlobal();
|
|
68
|
-
const FormDataCtor = typeof G.FormData !== "undefined" ? G.FormData : void 0;
|
|
69
|
-
const isFormData = (thing) => {
|
|
70
|
-
let kind;
|
|
71
|
-
return thing && (FormDataCtor && thing instanceof FormDataCtor || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
|
|
72
|
-
kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
|
|
73
|
-
};
|
|
74
|
-
const isURLSearchParams = kindOfTest("URLSearchParams");
|
|
75
|
-
const [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
76
|
-
"ReadableStream",
|
|
77
|
-
"Request",
|
|
78
|
-
"Response",
|
|
79
|
-
"Headers"
|
|
80
|
-
].map(kindOfTest);
|
|
81
|
-
const trim = (str) => {
|
|
82
|
-
return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
83
|
-
};
|
|
84
|
-
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
85
|
-
if (obj === null || typeof obj === "undefined") {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
let i;
|
|
89
|
-
let l;
|
|
90
|
-
if (typeof obj !== "object") {
|
|
91
|
-
obj = [obj];
|
|
92
|
-
}
|
|
93
|
-
if (isArray(obj)) {
|
|
94
|
-
for (i = 0, l = obj.length; i < l; i++) {
|
|
95
|
-
fn.call(null, obj[i], i, obj);
|
|
96
|
-
}
|
|
97
|
-
} else {
|
|
98
|
-
if (isBuffer(obj)) {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
102
|
-
const len = keys.length;
|
|
103
|
-
let key;
|
|
104
|
-
for (i = 0; i < len; i++) {
|
|
105
|
-
key = keys[i];
|
|
106
|
-
fn.call(null, obj[key], key, obj);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
function findKey(obj, key) {
|
|
111
|
-
if (isBuffer(obj)) {
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
key = key.toLowerCase();
|
|
115
|
-
const keys = Object.keys(obj);
|
|
116
|
-
let i = keys.length;
|
|
117
|
-
let _key;
|
|
118
|
-
while (i-- > 0) {
|
|
119
|
-
_key = keys[i];
|
|
120
|
-
if (key === _key.toLowerCase()) {
|
|
121
|
-
return _key;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
return null;
|
|
125
|
-
}
|
|
126
|
-
const _global = (() => {
|
|
127
|
-
if (typeof globalThis !== "undefined") return globalThis;
|
|
128
|
-
return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
|
|
129
|
-
})();
|
|
130
|
-
const isContextDefined = (context) => !isUndefined(context) && context !== _global;
|
|
131
|
-
function merge() {
|
|
132
|
-
const { caseless, skipUndefined } = isContextDefined(this) && this || {};
|
|
133
|
-
const result = {};
|
|
134
|
-
const assignValue = (val, key) => {
|
|
135
|
-
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
const targetKey = caseless && findKey(result, key) || key;
|
|
139
|
-
if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
|
|
140
|
-
result[targetKey] = merge(result[targetKey], val);
|
|
141
|
-
} else if (isPlainObject(val)) {
|
|
142
|
-
result[targetKey] = merge({}, val);
|
|
143
|
-
} else if (isArray(val)) {
|
|
144
|
-
result[targetKey] = val.slice();
|
|
145
|
-
} else if (!skipUndefined || !isUndefined(val)) {
|
|
146
|
-
result[targetKey] = val;
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
for (let i = 0, l = arguments.length; i < l; i++) {
|
|
150
|
-
arguments[i] && forEach(arguments[i], assignValue);
|
|
151
|
-
}
|
|
152
|
-
return result;
|
|
153
|
-
}
|
|
154
|
-
const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
155
|
-
forEach(
|
|
156
|
-
b,
|
|
157
|
-
(val, key) => {
|
|
158
|
-
if (thisArg && isFunction(val)) {
|
|
159
|
-
Object.defineProperty(a, key, {
|
|
160
|
-
value: bind(val, thisArg),
|
|
161
|
-
writable: true,
|
|
162
|
-
enumerable: true,
|
|
163
|
-
configurable: true
|
|
164
|
-
});
|
|
165
|
-
} else {
|
|
166
|
-
Object.defineProperty(a, key, {
|
|
167
|
-
value: val,
|
|
168
|
-
writable: true,
|
|
169
|
-
enumerable: true,
|
|
170
|
-
configurable: true
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
{ allOwnKeys }
|
|
175
|
-
);
|
|
176
|
-
return a;
|
|
177
|
-
};
|
|
178
|
-
const stripBOM = (content) => {
|
|
179
|
-
if (content.charCodeAt(0) === 65279) {
|
|
180
|
-
content = content.slice(1);
|
|
181
|
-
}
|
|
182
|
-
return content;
|
|
183
|
-
};
|
|
184
|
-
const inherits = (constructor, superConstructor, props, descriptors) => {
|
|
185
|
-
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
|
|
186
|
-
Object.defineProperty(constructor.prototype, "constructor", {
|
|
187
|
-
value: constructor,
|
|
188
|
-
writable: true,
|
|
189
|
-
enumerable: false,
|
|
190
|
-
configurable: true
|
|
191
|
-
});
|
|
192
|
-
Object.defineProperty(constructor, "super", {
|
|
193
|
-
value: superConstructor.prototype
|
|
194
|
-
});
|
|
195
|
-
props && Object.assign(constructor.prototype, props);
|
|
196
|
-
};
|
|
197
|
-
const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
|
|
198
|
-
let props;
|
|
199
|
-
let i;
|
|
200
|
-
let prop;
|
|
201
|
-
const merged = {};
|
|
202
|
-
destObj = destObj || {};
|
|
203
|
-
if (sourceObj == null) return destObj;
|
|
204
|
-
do {
|
|
205
|
-
props = Object.getOwnPropertyNames(sourceObj);
|
|
206
|
-
i = props.length;
|
|
207
|
-
while (i-- > 0) {
|
|
208
|
-
prop = props[i];
|
|
209
|
-
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
|
|
210
|
-
destObj[prop] = sourceObj[prop];
|
|
211
|
-
merged[prop] = true;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
sourceObj = filter !== false && getPrototypeOf(sourceObj);
|
|
215
|
-
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
216
|
-
return destObj;
|
|
217
|
-
};
|
|
218
|
-
const endsWith = (str, searchString, position) => {
|
|
219
|
-
str = String(str);
|
|
220
|
-
if (position === void 0 || position > str.length) {
|
|
221
|
-
position = str.length;
|
|
222
|
-
}
|
|
223
|
-
position -= searchString.length;
|
|
224
|
-
const lastIndex = str.indexOf(searchString, position);
|
|
225
|
-
return lastIndex !== -1 && lastIndex === position;
|
|
226
|
-
};
|
|
227
|
-
const toArray = (thing) => {
|
|
228
|
-
if (!thing) return null;
|
|
229
|
-
if (isArray(thing)) return thing;
|
|
230
|
-
let i = thing.length;
|
|
231
|
-
if (!isNumber(i)) return null;
|
|
232
|
-
const arr = new Array(i);
|
|
233
|
-
while (i-- > 0) {
|
|
234
|
-
arr[i] = thing[i];
|
|
235
|
-
}
|
|
236
|
-
return arr;
|
|
237
|
-
};
|
|
238
|
-
const isTypedArray = /* @__PURE__ */ ((TypedArray) => {
|
|
239
|
-
return (thing) => {
|
|
240
|
-
return TypedArray && thing instanceof TypedArray;
|
|
241
|
-
};
|
|
242
|
-
})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
|
|
243
|
-
const forEachEntry = (obj, fn) => {
|
|
244
|
-
const generator = obj && obj[iterator];
|
|
245
|
-
const _iterator = generator.call(obj);
|
|
246
|
-
let result;
|
|
247
|
-
while ((result = _iterator.next()) && !result.done) {
|
|
248
|
-
const pair = result.value;
|
|
249
|
-
fn.call(obj, pair[0], pair[1]);
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
const matchAll = (regExp, str) => {
|
|
253
|
-
let matches;
|
|
254
|
-
const arr = [];
|
|
255
|
-
while ((matches = regExp.exec(str)) !== null) {
|
|
256
|
-
arr.push(matches);
|
|
257
|
-
}
|
|
258
|
-
return arr;
|
|
259
|
-
};
|
|
260
|
-
const isHTMLForm = kindOfTest("HTMLFormElement");
|
|
261
|
-
const toCamelCase = (str) => {
|
|
262
|
-
return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
|
|
263
|
-
return p1.toUpperCase() + p2;
|
|
264
|
-
});
|
|
265
|
-
};
|
|
266
|
-
const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
|
|
267
|
-
const isRegExp = kindOfTest("RegExp");
|
|
268
|
-
const reduceDescriptors = (obj, reducer) => {
|
|
269
|
-
const descriptors = Object.getOwnPropertyDescriptors(obj);
|
|
270
|
-
const reducedDescriptors = {};
|
|
271
|
-
forEach(descriptors, (descriptor, name) => {
|
|
272
|
-
let ret;
|
|
273
|
-
if ((ret = reducer(descriptor, name, obj)) !== false) {
|
|
274
|
-
reducedDescriptors[name] = ret || descriptor;
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
Object.defineProperties(obj, reducedDescriptors);
|
|
278
|
-
};
|
|
279
|
-
const freezeMethods = (obj) => {
|
|
280
|
-
reduceDescriptors(obj, (descriptor, name) => {
|
|
281
|
-
if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
|
|
282
|
-
return false;
|
|
283
|
-
}
|
|
284
|
-
const value = obj[name];
|
|
285
|
-
if (!isFunction(value)) return;
|
|
286
|
-
descriptor.enumerable = false;
|
|
287
|
-
if ("writable" in descriptor) {
|
|
288
|
-
descriptor.writable = false;
|
|
289
|
-
return;
|
|
290
|
-
}
|
|
291
|
-
if (!descriptor.set) {
|
|
292
|
-
descriptor.set = () => {
|
|
293
|
-
throw Error("Can not rewrite read-only method '" + name + "'");
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
});
|
|
297
|
-
};
|
|
298
|
-
const toObjectSet = (arrayOrString, delimiter) => {
|
|
299
|
-
const obj = {};
|
|
300
|
-
const define = (arr) => {
|
|
301
|
-
arr.forEach((value) => {
|
|
302
|
-
obj[value] = true;
|
|
303
|
-
});
|
|
304
|
-
};
|
|
305
|
-
isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
|
|
306
|
-
return obj;
|
|
307
|
-
};
|
|
308
|
-
const noop = () => {
|
|
309
|
-
};
|
|
310
|
-
const toFiniteNumber = (value, defaultValue) => {
|
|
311
|
-
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
312
|
-
};
|
|
313
|
-
function isSpecCompliantForm(thing) {
|
|
314
|
-
return !!(thing && isFunction(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
|
|
315
|
-
}
|
|
316
|
-
const toJSONObject = (obj) => {
|
|
317
|
-
const stack = new Array(10);
|
|
318
|
-
const visit = (source, i) => {
|
|
319
|
-
if (isObject(source)) {
|
|
320
|
-
if (stack.indexOf(source) >= 0) {
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
|
-
if (isBuffer(source)) {
|
|
324
|
-
return source;
|
|
325
|
-
}
|
|
326
|
-
if (!("toJSON" in source)) {
|
|
327
|
-
stack[i] = source;
|
|
328
|
-
const target = isArray(source) ? [] : {};
|
|
329
|
-
forEach(source, (value, key) => {
|
|
330
|
-
const reducedValue = visit(value, i + 1);
|
|
331
|
-
!isUndefined(reducedValue) && (target[key] = reducedValue);
|
|
332
|
-
});
|
|
333
|
-
stack[i] = void 0;
|
|
334
|
-
return target;
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
return source;
|
|
338
|
-
};
|
|
339
|
-
return visit(obj, 0);
|
|
340
|
-
};
|
|
341
|
-
const isAsyncFn = kindOfTest("AsyncFunction");
|
|
342
|
-
const isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
|
343
|
-
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
344
|
-
if (setImmediateSupported) {
|
|
345
|
-
return setImmediate;
|
|
346
|
-
}
|
|
347
|
-
return postMessageSupported ? ((token, callbacks) => {
|
|
348
|
-
_global.addEventListener(
|
|
349
|
-
"message",
|
|
350
|
-
({ source, data }) => {
|
|
351
|
-
if (source === _global && data === token) {
|
|
352
|
-
callbacks.length && callbacks.shift()();
|
|
353
|
-
}
|
|
354
|
-
},
|
|
355
|
-
false
|
|
356
|
-
);
|
|
357
|
-
return (cb) => {
|
|
358
|
-
callbacks.push(cb);
|
|
359
|
-
_global.postMessage(token, "*");
|
|
360
|
-
};
|
|
361
|
-
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
362
|
-
})(typeof setImmediate === "function", isFunction(_global.postMessage));
|
|
363
|
-
const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
|
|
364
|
-
const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
|
|
365
|
-
const utils = {
|
|
366
|
-
isArray,
|
|
367
|
-
isArrayBuffer,
|
|
368
|
-
isBuffer,
|
|
369
|
-
isFormData,
|
|
370
|
-
isArrayBufferView,
|
|
371
|
-
isString,
|
|
372
|
-
isNumber,
|
|
373
|
-
isBoolean,
|
|
374
|
-
isObject,
|
|
375
|
-
isPlainObject,
|
|
376
|
-
isEmptyObject,
|
|
377
|
-
isReadableStream,
|
|
378
|
-
isRequest,
|
|
379
|
-
isResponse,
|
|
380
|
-
isHeaders,
|
|
381
|
-
isUndefined,
|
|
382
|
-
isDate,
|
|
383
|
-
isFile,
|
|
384
|
-
isReactNativeBlob,
|
|
385
|
-
isReactNative,
|
|
386
|
-
isBlob,
|
|
387
|
-
isRegExp,
|
|
388
|
-
isFunction,
|
|
389
|
-
isStream,
|
|
390
|
-
isURLSearchParams,
|
|
391
|
-
isTypedArray,
|
|
392
|
-
isFileList,
|
|
393
|
-
forEach,
|
|
394
|
-
merge,
|
|
395
|
-
extend,
|
|
396
|
-
trim,
|
|
397
|
-
stripBOM,
|
|
398
|
-
inherits,
|
|
399
|
-
toFlatObject,
|
|
400
|
-
kindOf,
|
|
401
|
-
kindOfTest,
|
|
402
|
-
endsWith,
|
|
403
|
-
toArray,
|
|
404
|
-
forEachEntry,
|
|
405
|
-
matchAll,
|
|
406
|
-
isHTMLForm,
|
|
407
|
-
hasOwnProperty,
|
|
408
|
-
hasOwnProp: hasOwnProperty,
|
|
409
|
-
// an alias to avoid ESLint no-prototype-builtins detection
|
|
410
|
-
reduceDescriptors,
|
|
411
|
-
freezeMethods,
|
|
412
|
-
toObjectSet,
|
|
413
|
-
toCamelCase,
|
|
414
|
-
noop,
|
|
415
|
-
toFiniteNumber,
|
|
416
|
-
findKey,
|
|
417
|
-
global: _global,
|
|
418
|
-
isContextDefined,
|
|
419
|
-
isSpecCompliantForm,
|
|
420
|
-
toJSONObject,
|
|
421
|
-
isAsyncFn,
|
|
422
|
-
isThenable,
|
|
423
|
-
setImmediate: _setImmediate,
|
|
424
|
-
asap,
|
|
425
|
-
isIterable
|
|
426
|
-
};
|
|
427
|
-
export {
|
|
428
|
-
utils as default
|
|
429
|
-
};
|
package/dist/utils/axiosAPI.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const axiosApi: import('axios').AxiosInstance;
|
package/dist/utils/axiosAPI.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
var __async = (__this, __arguments, generator) => {
|
|
2
|
-
return new Promise((resolve, reject) => {
|
|
3
|
-
var fulfilled = (value) => {
|
|
4
|
-
try {
|
|
5
|
-
step(generator.next(value));
|
|
6
|
-
} catch (e) {
|
|
7
|
-
reject(e);
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
var rejected = (value) => {
|
|
11
|
-
try {
|
|
12
|
-
step(generator.throw(value));
|
|
13
|
-
} catch (e) {
|
|
14
|
-
reject(e);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
import "../node_modules/axios/index.js";
|
|
22
|
-
import { getBaseUrl } from "./url.js";
|
|
23
|
-
import axios from "../node_modules/axios/lib/axios.js";
|
|
24
|
-
const axiosApi = axios.create({
|
|
25
|
-
baseURL: getBaseUrl(),
|
|
26
|
-
withCredentials: true,
|
|
27
|
-
headers: {
|
|
28
|
-
Accept: "application/json, text/plain, */*",
|
|
29
|
-
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
|
30
|
-
"Access-Control-Allow-Origin": "*"
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
axiosApi.interceptors.request.use((config) => __async(void 0, null, function* () {
|
|
34
|
-
try {
|
|
35
|
-
config.baseURL = getBaseUrl();
|
|
36
|
-
} catch (e) {
|
|
37
|
-
console.error("Axios request error:", e);
|
|
38
|
-
}
|
|
39
|
-
return config;
|
|
40
|
-
}));
|
|
41
|
-
axiosApi.interceptors.response.use(
|
|
42
|
-
(response) => {
|
|
43
|
-
const responseData = response == null ? void 0 : response.data;
|
|
44
|
-
const dataError = responseData == null ? void 0 : responseData.error;
|
|
45
|
-
if (dataError && (dataError == null ? void 0 : dataError.code) && dataError.code == 808) {
|
|
46
|
-
console.error("Password expired!");
|
|
47
|
-
}
|
|
48
|
-
return response == null ? void 0 : response.data;
|
|
49
|
-
},
|
|
50
|
-
(error) => {
|
|
51
|
-
const serverResponse = error == null ? void 0 : error.response;
|
|
52
|
-
const errorStatus = serverResponse == null ? void 0 : serverResponse.status;
|
|
53
|
-
const responseData = serverResponse == null ? void 0 : serverResponse.data;
|
|
54
|
-
if (errorStatus === 401) {
|
|
55
|
-
console.error("Authentication failed!");
|
|
56
|
-
}
|
|
57
|
-
switch (errorStatus) {
|
|
58
|
-
case 404:
|
|
59
|
-
if (!(responseData == null ? void 0 : responseData.success)) {
|
|
60
|
-
const message = (responseData == null ? void 0 : responseData.msg) || "Not Found";
|
|
61
|
-
console.error("Axios 404: ", message);
|
|
62
|
-
}
|
|
63
|
-
break;
|
|
64
|
-
case 401:
|
|
65
|
-
if (!(responseData == null ? void 0 : responseData.success)) {
|
|
66
|
-
const message = (responseData == null ? void 0 : responseData.detail) || (responseData == null ? void 0 : responseData.msg);
|
|
67
|
-
console.error("Axios 401: ", message);
|
|
68
|
-
}
|
|
69
|
-
break;
|
|
70
|
-
case 505:
|
|
71
|
-
if (!(responseData == null ? void 0 : responseData.success)) {
|
|
72
|
-
const message = (responseData == null ? void 0 : responseData.error) || "";
|
|
73
|
-
console.error("Axios 505: ", message);
|
|
74
|
-
}
|
|
75
|
-
return responseData;
|
|
76
|
-
case 0:
|
|
77
|
-
console.error("Axios sever error!");
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
if (typeof errorStatus === "undefined") {
|
|
81
|
-
console.error("Unexpected Error");
|
|
82
|
-
}
|
|
83
|
-
console.log(error);
|
|
84
|
-
return Promise.reject(error);
|
|
85
|
-
}
|
|
86
|
-
);
|
|
87
|
-
export {
|
|
88
|
-
axiosApi
|
|
89
|
-
};
|