@unicom-cloud/axios 0.1.2 → 0.1.3
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/chunk/{xVYu0pcc.js → CYdDqQOh.js} +110 -104
- package/chunk/DtlKw_Ta.js +67 -0
- package/index.d.cts +791 -0
- package/index.d.ts +28 -11
- package/index.js +1 -1
- package/lib/axios.js +228 -210
- package/lib/utils.js +2 -2
- package/mock-adapter/index.js +3 -3
- package/mock-adapter/request.js +2 -2
- package/mock-adapter/utils.js +3 -3
- package/package.json +1 -1
- package/chunk/g6FYfJ02.js +0 -62
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
/*
|
|
2
|
-
function
|
|
1
|
+
/* 2026-02-26 14:42:51 */
|
|
2
|
+
function M(e, t) {
|
|
3
3
|
return function() {
|
|
4
4
|
return e.apply(t, arguments);
|
|
5
5
|
};
|
|
6
6
|
}
|
|
7
|
-
const { toString:
|
|
8
|
-
const n =
|
|
7
|
+
const { toString: _ } = Object.prototype, { getPrototypeOf: F } = Object, { iterator: g, toStringTag: B } = Symbol, b = /* @__PURE__ */ ((e) => (t) => {
|
|
8
|
+
const n = _.call(t);
|
|
9
9
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
10
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
10
|
+
})(/* @__PURE__ */ Object.create(null)), c = (e) => (e = e.toLowerCase(), (t) => b(t) === e), O = (e) => (t) => typeof t === e, { isArray: p } = Array, a = O("undefined");
|
|
11
11
|
function d(e) {
|
|
12
|
-
return e !== null && !a(e) && e.constructor !== null && !a(e.constructor) &&
|
|
12
|
+
return e !== null && !a(e) && e.constructor !== null && !a(e.constructor) && f(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
13
13
|
}
|
|
14
|
-
const
|
|
15
|
-
function
|
|
14
|
+
const C = c("ArrayBuffer");
|
|
15
|
+
function U(e) {
|
|
16
16
|
let t;
|
|
17
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer &&
|
|
17
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && C(e.buffer), t;
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const N = O("string"), f = O("function"), D = O("number"), y = (e) => e !== null && typeof e == "object", I = (e) => e === !0 || e === !1, w = (e) => {
|
|
20
20
|
if (b(e) !== "object")
|
|
21
21
|
return !1;
|
|
22
|
-
const t =
|
|
23
|
-
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(
|
|
24
|
-
},
|
|
22
|
+
const t = F(e);
|
|
23
|
+
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(B in e) && !(g in e);
|
|
24
|
+
}, k = (e) => {
|
|
25
25
|
if (!y(e) || d(e))
|
|
26
26
|
return !1;
|
|
27
27
|
try {
|
|
@@ -29,16 +29,20 @@ const k = O("string"), c = O("function"), B = O("number"), y = (e) => e !== null
|
|
|
29
29
|
} catch {
|
|
30
30
|
return !1;
|
|
31
31
|
}
|
|
32
|
-
},
|
|
32
|
+
}, V = c("Date"), q = c("File"), H = c("Blob"), z = c("FileList"), G = (e) => y(e) && f(e.pipe);
|
|
33
|
+
function J() {
|
|
34
|
+
return typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
|
|
35
|
+
}
|
|
36
|
+
const x = J(), P = typeof x.FormData < "u" ? x.FormData : void 0, K = (e) => {
|
|
33
37
|
let t;
|
|
34
|
-
return e && (
|
|
35
|
-
t === "object" &&
|
|
36
|
-
},
|
|
38
|
+
return e && (P && e instanceof P || f(e.append) && ((t = b(e)) === "formdata" || // detect form-data instance
|
|
39
|
+
t === "object" && f(e.toString) && e.toString() === "[object FormData]"));
|
|
40
|
+
}, $ = c("URLSearchParams"), [W, Q, X, Y] = [
|
|
37
41
|
"ReadableStream",
|
|
38
42
|
"Request",
|
|
39
43
|
"Response",
|
|
40
44
|
"Headers"
|
|
41
|
-
].map(
|
|
45
|
+
].map(c), Z = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
42
46
|
function m(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
43
47
|
if (e === null || typeof e > "u")
|
|
44
48
|
return;
|
|
@@ -50,9 +54,9 @@ function m(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
50
54
|
if (d(e))
|
|
51
55
|
return;
|
|
52
56
|
const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
|
|
53
|
-
let
|
|
57
|
+
let u;
|
|
54
58
|
for (r = 0; r < i; r++)
|
|
55
|
-
|
|
59
|
+
u = o[r], t.call(null, e[u], u, e);
|
|
56
60
|
}
|
|
57
61
|
}
|
|
58
62
|
function E(e, t) {
|
|
@@ -66,21 +70,23 @@ function E(e, t) {
|
|
|
66
70
|
return s;
|
|
67
71
|
return null;
|
|
68
72
|
}
|
|
69
|
-
const
|
|
70
|
-
function
|
|
73
|
+
const l = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, L = (e) => !a(e) && e !== l;
|
|
74
|
+
function h() {
|
|
71
75
|
const { caseless: e, skipUndefined: t } = L(this) && this || {}, n = {}, r = (s, o) => {
|
|
76
|
+
if (o === "__proto__" || o === "constructor" || o === "prototype")
|
|
77
|
+
return;
|
|
72
78
|
const i = e && E(n, o) || o;
|
|
73
|
-
w(n[i]) && w(s) ? n[i] =
|
|
79
|
+
w(n[i]) && w(s) ? n[i] = h(n[i], s) : w(s) ? n[i] = h({}, s) : p(s) ? n[i] = s.slice() : (!t || !a(s)) && (n[i] = s);
|
|
74
80
|
};
|
|
75
81
|
for (let s = 0, o = arguments.length; s < o; s++)
|
|
76
82
|
arguments[s] && m(arguments[s], r);
|
|
77
83
|
return n;
|
|
78
84
|
}
|
|
79
|
-
const
|
|
85
|
+
const j = (e, t, n, { allOwnKeys: r } = {}) => (m(
|
|
80
86
|
t,
|
|
81
87
|
(s, o) => {
|
|
82
|
-
n &&
|
|
83
|
-
value:
|
|
88
|
+
n && f(s) ? Object.defineProperty(e, o, {
|
|
89
|
+
value: M(s, n),
|
|
84
90
|
writable: !0,
|
|
85
91
|
enumerable: !0,
|
|
86
92
|
configurable: !0
|
|
@@ -92,7 +98,7 @@ const X = (e, t, n, { allOwnKeys: r } = {}) => (m(
|
|
|
92
98
|
});
|
|
93
99
|
},
|
|
94
100
|
{ allOwnKeys: r }
|
|
95
|
-
), e),
|
|
101
|
+
), e), v = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), ee = (e, t, n, r) => {
|
|
96
102
|
e.prototype = Object.create(
|
|
97
103
|
t.prototype,
|
|
98
104
|
r
|
|
@@ -104,56 +110,56 @@ const X = (e, t, n, { allOwnKeys: r } = {}) => (m(
|
|
|
104
110
|
}), Object.defineProperty(e, "super", {
|
|
105
111
|
value: t.prototype
|
|
106
112
|
}), n && Object.assign(e.prototype, n);
|
|
107
|
-
},
|
|
113
|
+
}, te = (e, t, n, r) => {
|
|
108
114
|
let s, o, i;
|
|
109
|
-
const
|
|
115
|
+
const u = {};
|
|
110
116
|
if (t = t || {}, e == null) return t;
|
|
111
117
|
do {
|
|
112
118
|
for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
|
|
113
|
-
i = s[o], (!r || r(i, e, t)) && !
|
|
114
|
-
e = n !== !1 &&
|
|
119
|
+
i = s[o], (!r || r(i, e, t)) && !u[i] && (t[i] = e[i], u[i] = !0);
|
|
120
|
+
e = n !== !1 && F(e);
|
|
115
121
|
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
116
122
|
return t;
|
|
117
|
-
},
|
|
123
|
+
}, ne = (e, t, n) => {
|
|
118
124
|
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
|
|
119
125
|
const r = e.indexOf(t, n);
|
|
120
126
|
return r !== -1 && r === n;
|
|
121
|
-
},
|
|
127
|
+
}, re = (e) => {
|
|
122
128
|
if (!e) return null;
|
|
123
129
|
if (p(e)) return e;
|
|
124
130
|
let t = e.length;
|
|
125
|
-
if (!
|
|
131
|
+
if (!D(t)) return null;
|
|
126
132
|
const n = new Array(t);
|
|
127
133
|
for (; t-- > 0; )
|
|
128
134
|
n[t] = e[t];
|
|
129
135
|
return n;
|
|
130
|
-
},
|
|
136
|
+
}, se = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && F(Uint8Array)), oe = (e, t) => {
|
|
131
137
|
const r = (e && e[g]).call(e);
|
|
132
138
|
let s;
|
|
133
139
|
for (; (s = r.next()) && !s.done; ) {
|
|
134
140
|
const o = s.value;
|
|
135
141
|
t.call(e, o[0], o[1]);
|
|
136
142
|
}
|
|
137
|
-
},
|
|
143
|
+
}, ie = (e, t) => {
|
|
138
144
|
let n;
|
|
139
145
|
const r = [];
|
|
140
146
|
for (; (n = e.exec(t)) !== null; )
|
|
141
147
|
r.push(n);
|
|
142
148
|
return r;
|
|
143
|
-
},
|
|
149
|
+
}, fe = c("HTMLFormElement"), ce = (e) => e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(n, r, s) {
|
|
144
150
|
return r.toUpperCase() + s;
|
|
145
|
-
}),
|
|
151
|
+
}), S = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), ue = c("RegExp"), T = (e, t) => {
|
|
146
152
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
147
153
|
m(n, (s, o) => {
|
|
148
154
|
let i;
|
|
149
155
|
(i = t(s, o, e)) !== !1 && (r[o] = i || s);
|
|
150
156
|
}), Object.defineProperties(e, r);
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
if (
|
|
157
|
+
}, le = (e) => {
|
|
158
|
+
T(e, (t, n) => {
|
|
159
|
+
if (f(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
154
160
|
return !1;
|
|
155
161
|
const r = e[n];
|
|
156
|
-
if (
|
|
162
|
+
if (f(r)) {
|
|
157
163
|
if (t.enumerable = !1, "writable" in t) {
|
|
158
164
|
t.writable = !1;
|
|
159
165
|
return;
|
|
@@ -163,19 +169,19 @@ const X = (e, t, n, { allOwnKeys: r } = {}) => (m(
|
|
|
163
169
|
});
|
|
164
170
|
}
|
|
165
171
|
});
|
|
166
|
-
},
|
|
172
|
+
}, ae = (e, t) => {
|
|
167
173
|
const n = {}, r = (s) => {
|
|
168
174
|
s.forEach((o) => {
|
|
169
175
|
n[o] = !0;
|
|
170
176
|
});
|
|
171
177
|
};
|
|
172
178
|
return p(e) ? r(e) : r(String(e).split(t)), n;
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
function
|
|
176
|
-
return !!(e &&
|
|
179
|
+
}, pe = () => {
|
|
180
|
+
}, de = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
181
|
+
function ye(e) {
|
|
182
|
+
return !!(e && f(e.append) && e[B] === "FormData" && e[g]);
|
|
177
183
|
}
|
|
178
|
-
const
|
|
184
|
+
const me = (e) => {
|
|
179
185
|
const t = new Array(10), n = (r, s) => {
|
|
180
186
|
if (y(r)) {
|
|
181
187
|
if (t.indexOf(r) >= 0)
|
|
@@ -185,84 +191,84 @@ const pe = (e) => {
|
|
|
185
191
|
if (!("toJSON" in r)) {
|
|
186
192
|
t[s] = r;
|
|
187
193
|
const o = p(r) ? [] : {};
|
|
188
|
-
return m(r, (i,
|
|
194
|
+
return m(r, (i, u) => {
|
|
189
195
|
const A = n(i, s + 1);
|
|
190
|
-
!a(A) && (o[
|
|
196
|
+
!a(A) && (o[u] = A);
|
|
191
197
|
}), t[s] = void 0, o;
|
|
192
198
|
}
|
|
193
199
|
}
|
|
194
200
|
return r;
|
|
195
201
|
};
|
|
196
202
|
return n(e, 0);
|
|
197
|
-
},
|
|
203
|
+
}, we = c("AsyncFunction"), ge = (e) => e && (y(e) || f(e)) && f(e.then) && f(e.catch), R = ((e, t) => e ? setImmediate : t ? ((n, r) => (l.addEventListener(
|
|
198
204
|
"message",
|
|
199
205
|
({ source: s, data: o }) => {
|
|
200
|
-
s ===
|
|
206
|
+
s === l && o === n && r.length && r.shift()();
|
|
201
207
|
},
|
|
202
208
|
!1
|
|
203
209
|
), (s) => {
|
|
204
|
-
r.push(s),
|
|
205
|
-
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(typeof setImmediate == "function",
|
|
210
|
+
r.push(s), l.postMessage(n, "*");
|
|
211
|
+
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(typeof setImmediate == "function", f(l.postMessage)), be = typeof queueMicrotask < "u" ? queueMicrotask.bind(l) : typeof process < "u" && process.nextTick || R, Oe = (e) => e != null && f(e[g]), he = {
|
|
206
212
|
isArray: p,
|
|
207
|
-
isArrayBuffer:
|
|
213
|
+
isArrayBuffer: C,
|
|
208
214
|
isBuffer: d,
|
|
209
|
-
isFormData:
|
|
210
|
-
isArrayBufferView:
|
|
211
|
-
isString:
|
|
212
|
-
isNumber:
|
|
213
|
-
isBoolean:
|
|
215
|
+
isFormData: K,
|
|
216
|
+
isArrayBufferView: U,
|
|
217
|
+
isString: N,
|
|
218
|
+
isNumber: D,
|
|
219
|
+
isBoolean: I,
|
|
214
220
|
isObject: y,
|
|
215
221
|
isPlainObject: w,
|
|
216
|
-
isEmptyObject:
|
|
217
|
-
isReadableStream:
|
|
218
|
-
isRequest:
|
|
219
|
-
isResponse:
|
|
220
|
-
isHeaders:
|
|
222
|
+
isEmptyObject: k,
|
|
223
|
+
isReadableStream: W,
|
|
224
|
+
isRequest: Q,
|
|
225
|
+
isResponse: X,
|
|
226
|
+
isHeaders: Y,
|
|
221
227
|
isUndefined: a,
|
|
222
|
-
isDate:
|
|
223
|
-
isFile:
|
|
224
|
-
isBlob:
|
|
225
|
-
isRegExp:
|
|
226
|
-
isFunction:
|
|
227
|
-
isStream:
|
|
228
|
-
isURLSearchParams:
|
|
229
|
-
isTypedArray:
|
|
230
|
-
isFileList:
|
|
228
|
+
isDate: V,
|
|
229
|
+
isFile: q,
|
|
230
|
+
isBlob: H,
|
|
231
|
+
isRegExp: ue,
|
|
232
|
+
isFunction: f,
|
|
233
|
+
isStream: G,
|
|
234
|
+
isURLSearchParams: $,
|
|
235
|
+
isTypedArray: se,
|
|
236
|
+
isFileList: z,
|
|
231
237
|
forEach: m,
|
|
232
|
-
merge:
|
|
233
|
-
extend:
|
|
234
|
-
trim:
|
|
235
|
-
stripBOM:
|
|
236
|
-
inherits:
|
|
237
|
-
toFlatObject:
|
|
238
|
+
merge: h,
|
|
239
|
+
extend: j,
|
|
240
|
+
trim: Z,
|
|
241
|
+
stripBOM: v,
|
|
242
|
+
inherits: ee,
|
|
243
|
+
toFlatObject: te,
|
|
238
244
|
kindOf: b,
|
|
239
|
-
kindOfTest:
|
|
240
|
-
endsWith:
|
|
241
|
-
toArray:
|
|
242
|
-
forEachEntry:
|
|
243
|
-
matchAll:
|
|
244
|
-
isHTMLForm:
|
|
245
|
-
hasOwnProperty:
|
|
246
|
-
hasOwnProp:
|
|
245
|
+
kindOfTest: c,
|
|
246
|
+
endsWith: ne,
|
|
247
|
+
toArray: re,
|
|
248
|
+
forEachEntry: oe,
|
|
249
|
+
matchAll: ie,
|
|
250
|
+
isHTMLForm: fe,
|
|
251
|
+
hasOwnProperty: S,
|
|
252
|
+
hasOwnProp: S,
|
|
247
253
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
248
|
-
reduceDescriptors:
|
|
249
|
-
freezeMethods:
|
|
250
|
-
toObjectSet:
|
|
251
|
-
toCamelCase:
|
|
252
|
-
noop:
|
|
253
|
-
toFiniteNumber:
|
|
254
|
+
reduceDescriptors: T,
|
|
255
|
+
freezeMethods: le,
|
|
256
|
+
toObjectSet: ae,
|
|
257
|
+
toCamelCase: ce,
|
|
258
|
+
noop: pe,
|
|
259
|
+
toFiniteNumber: de,
|
|
254
260
|
findKey: E,
|
|
255
|
-
global:
|
|
261
|
+
global: l,
|
|
256
262
|
isContextDefined: L,
|
|
257
|
-
isSpecCompliantForm:
|
|
258
|
-
toJSONObject:
|
|
259
|
-
isAsyncFn:
|
|
260
|
-
isThenable:
|
|
261
|
-
setImmediate:
|
|
262
|
-
asap:
|
|
263
|
-
isIterable:
|
|
263
|
+
isSpecCompliantForm: ye,
|
|
264
|
+
toJSONObject: me,
|
|
265
|
+
isAsyncFn: we,
|
|
266
|
+
isThenable: ge,
|
|
267
|
+
setImmediate: R,
|
|
268
|
+
asap: be,
|
|
269
|
+
isIterable: Oe
|
|
264
270
|
};
|
|
265
271
|
export {
|
|
266
|
-
|
|
267
|
-
|
|
272
|
+
he as A,
|
|
273
|
+
M as b
|
|
268
274
|
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/* 2026-02-26 14:42:51 */
|
|
2
|
+
import { A as O } from "./CYdDqQOh.js";
|
|
3
|
+
class t extends Error {
|
|
4
|
+
static from(R, e, i, _, E, a) {
|
|
5
|
+
const s = new t(
|
|
6
|
+
R.message,
|
|
7
|
+
e || R.code,
|
|
8
|
+
i,
|
|
9
|
+
_,
|
|
10
|
+
E
|
|
11
|
+
);
|
|
12
|
+
return s.cause = R, s.name = R.name, R.status != null && s.status == null && (s.status = R.status), a && Object.assign(s, a), s;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
16
|
+
*
|
|
17
|
+
* @param {string} message The error message.
|
|
18
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
19
|
+
* @param {Object} [config] The config.
|
|
20
|
+
* @param {Object} [request] The request.
|
|
21
|
+
* @param {Object} [response] The response.
|
|
22
|
+
*
|
|
23
|
+
* @returns {Error} The created error.
|
|
24
|
+
*/
|
|
25
|
+
constructor(R, e, i, _, E) {
|
|
26
|
+
super(R), Object.defineProperty(this, "message", {
|
|
27
|
+
value: R,
|
|
28
|
+
enumerable: !0,
|
|
29
|
+
writable: !0,
|
|
30
|
+
configurable: !0
|
|
31
|
+
}), this.name = "AxiosError", this.isAxiosError = !0, e && (this.code = e), i && (this.config = i), _ && (this.request = _), E && (this.response = E, this.status = E.status);
|
|
32
|
+
}
|
|
33
|
+
toJSON() {
|
|
34
|
+
return {
|
|
35
|
+
// Standard
|
|
36
|
+
message: this.message,
|
|
37
|
+
name: this.name,
|
|
38
|
+
// Microsoft
|
|
39
|
+
description: this.description,
|
|
40
|
+
number: this.number,
|
|
41
|
+
// Mozilla
|
|
42
|
+
fileName: this.fileName,
|
|
43
|
+
lineNumber: this.lineNumber,
|
|
44
|
+
columnNumber: this.columnNumber,
|
|
45
|
+
stack: this.stack,
|
|
46
|
+
// Axios
|
|
47
|
+
config: O.toJSONObject(this.config),
|
|
48
|
+
code: this.code,
|
|
49
|
+
status: this.status
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
t.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
|
54
|
+
t.ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
|
55
|
+
t.ECONNABORTED = "ECONNABORTED";
|
|
56
|
+
t.ETIMEDOUT = "ETIMEDOUT";
|
|
57
|
+
t.ERR_NETWORK = "ERR_NETWORK";
|
|
58
|
+
t.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
|
59
|
+
t.ERR_DEPRECATED = "ERR_DEPRECATED";
|
|
60
|
+
t.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
|
|
61
|
+
t.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
|
|
62
|
+
t.ERR_CANCELED = "ERR_CANCELED";
|
|
63
|
+
t.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
64
|
+
t.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
65
|
+
export {
|
|
66
|
+
t as A
|
|
67
|
+
};
|