@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.
@@ -1,27 +1,27 @@
1
- /* 2025-11-19 09:59:53 */
2
- function R(e, t) {
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: T } = Object.prototype, { getPrototypeOf: h } = Object, { iterator: g, toStringTag: P } = Symbol, b = /* @__PURE__ */ ((e) => (t) => {
8
- const n = T.call(t);
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)), f = (e) => (e = e.toLowerCase(), (t) => b(t) === e), O = (e) => (t) => typeof t === e, { isArray: p } = Array, a = O("undefined");
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) && c(e.constructor.isBuffer) && e.constructor.isBuffer(e);
12
+ return e !== null && !a(e) && e.constructor !== null && !a(e.constructor) && f(e.constructor.isBuffer) && e.constructor.isBuffer(e);
13
13
  }
14
- const S = f("ArrayBuffer");
15
- function M(e) {
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 && S(e.buffer), t;
17
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && C(e.buffer), t;
18
18
  }
19
- const k = O("string"), c = O("function"), B = O("number"), y = (e) => e !== null && typeof e == "object", U = (e) => e === !0 || e === !1, w = (e) => {
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 = h(e);
23
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(P in e) && !(g in e);
24
- }, N = (e) => {
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
- }, I = f("Date"), V = f("File"), _ = f("Blob"), q = f("FileList"), H = (e) => y(e) && c(e.pipe), z = (e) => {
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 && (typeof FormData == "function" && e instanceof FormData || c(e.append) && ((t = b(e)) === "formdata" || // detect form-data instance
35
- t === "object" && c(e.toString) && e.toString() === "[object FormData]"));
36
- }, J = f("URLSearchParams"), [K, $, W, G] = [
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(f), Q = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
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 l;
57
+ let u;
54
58
  for (r = 0; r < i; r++)
55
- l = o[r], t.call(null, e[l], l, e);
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 u = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, L = (e) => !a(e) && e !== u;
70
- function F() {
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] = F(n[i], s) : w(s) ? n[i] = F({}, s) : p(s) ? n[i] = s.slice() : (!t || !a(s)) && (n[i] = s);
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 X = (e, t, n, { allOwnKeys: r } = {}) => (m(
85
+ const j = (e, t, n, { allOwnKeys: r } = {}) => (m(
80
86
  t,
81
87
  (s, o) => {
82
- n && c(s) ? Object.defineProperty(e, o, {
83
- value: R(s, n),
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), Y = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Z = (e, t, n, r) => {
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
- }, j = (e, t, n, r) => {
113
+ }, te = (e, t, n, r) => {
108
114
  let s, o, i;
109
- const l = {};
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)) && !l[i] && (t[i] = e[i], l[i] = !0);
114
- e = n !== !1 && h(e);
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
- }, v = (e, t, n) => {
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
- }, ee = (e) => {
127
+ }, re = (e) => {
122
128
  if (!e) return null;
123
129
  if (p(e)) return e;
124
130
  let t = e.length;
125
- if (!B(t)) return null;
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
- }, te = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && h(Uint8Array)), ne = (e, t) => {
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
- }, re = (e, t) => {
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
- }, se = f("HTMLFormElement"), oe = (e) => e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(n, r, s) {
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
- }), x = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), ie = f("RegExp"), C = (e, t) => {
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
- }, ce = (e) => {
152
- C(e, (t, n) => {
153
- if (c(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
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 (c(r)) {
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
- }, fe = (e, t) => {
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
- }, le = () => {
174
- }, ue = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
175
- function ae(e) {
176
- return !!(e && c(e.append) && e[P] === "FormData" && e[g]);
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 pe = (e) => {
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, l) => {
194
+ return m(r, (i, u) => {
189
195
  const A = n(i, s + 1);
190
- !a(A) && (o[l] = A);
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
- }, de = f("AsyncFunction"), ye = (e) => e && (y(e) || c(e)) && c(e.then) && c(e.catch), D = ((e, t) => e ? setImmediate : t ? ((n, r) => (u.addEventListener(
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 === u && o === n && r.length && r.shift()();
206
+ s === l && o === n && r.length && r.shift()();
201
207
  },
202
208
  !1
203
209
  ), (s) => {
204
- r.push(s), u.postMessage(n, "*");
205
- }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(typeof setImmediate == "function", c(u.postMessage)), me = typeof queueMicrotask < "u" ? queueMicrotask.bind(u) : typeof process < "u" && process.nextTick || D, we = (e) => e != null && c(e[g]), ge = {
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: S,
213
+ isArrayBuffer: C,
208
214
  isBuffer: d,
209
- isFormData: z,
210
- isArrayBufferView: M,
211
- isString: k,
212
- isNumber: B,
213
- isBoolean: U,
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: N,
217
- isReadableStream: K,
218
- isRequest: $,
219
- isResponse: W,
220
- isHeaders: G,
222
+ isEmptyObject: k,
223
+ isReadableStream: W,
224
+ isRequest: Q,
225
+ isResponse: X,
226
+ isHeaders: Y,
221
227
  isUndefined: a,
222
- isDate: I,
223
- isFile: V,
224
- isBlob: _,
225
- isRegExp: ie,
226
- isFunction: c,
227
- isStream: H,
228
- isURLSearchParams: J,
229
- isTypedArray: te,
230
- isFileList: q,
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: F,
233
- extend: X,
234
- trim: Q,
235
- stripBOM: Y,
236
- inherits: Z,
237
- toFlatObject: j,
238
+ merge: h,
239
+ extend: j,
240
+ trim: Z,
241
+ stripBOM: v,
242
+ inherits: ee,
243
+ toFlatObject: te,
238
244
  kindOf: b,
239
- kindOfTest: f,
240
- endsWith: v,
241
- toArray: ee,
242
- forEachEntry: ne,
243
- matchAll: re,
244
- isHTMLForm: se,
245
- hasOwnProperty: x,
246
- hasOwnProp: x,
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: C,
249
- freezeMethods: ce,
250
- toObjectSet: fe,
251
- toCamelCase: oe,
252
- noop: le,
253
- toFiniteNumber: ue,
254
+ reduceDescriptors: T,
255
+ freezeMethods: le,
256
+ toObjectSet: ae,
257
+ toCamelCase: ce,
258
+ noop: pe,
259
+ toFiniteNumber: de,
254
260
  findKey: E,
255
- global: u,
261
+ global: l,
256
262
  isContextDefined: L,
257
- isSpecCompliantForm: ae,
258
- toJSONObject: pe,
259
- isAsyncFn: de,
260
- isThenable: ye,
261
- setImmediate: D,
262
- asap: me,
263
- isIterable: we
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
- ge as A,
267
- R as b
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
+ };