@mx-space/api-client 1.13.0 → 1.13.2
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/controllers/ack.ts +3 -2
- package/controllers/activity.ts +2 -1
- package/controllers/aggregate.ts +3 -3
- package/controllers/ai.ts +2 -1
- package/controllers/base.ts +2 -1
- package/controllers/category.ts +6 -4
- package/controllers/comment.ts +2 -1
- package/controllers/link.ts +4 -2
- package/controllers/note.ts +2 -1
- package/controllers/page.ts +2 -1
- package/controllers/post.ts +2 -1
- package/controllers/project.ts +4 -2
- package/controllers/recently.ts +2 -1
- package/controllers/say.ts +4 -2
- package/controllers/search.ts +2 -1
- package/controllers/severless.ts +2 -1
- package/controllers/snippet.ts +2 -1
- package/controllers/subscribe.ts +2 -1
- package/controllers/topic.ts +4 -2
- package/controllers/user.ts +2 -1
- package/dist/adaptors/axios.d.cts +1 -1
- package/dist/adaptors/axios.d.ts +1 -1
- package/dist/adaptors/axios.global.js +698 -422
- package/dist/adaptors/fetch.d.cts +1 -1
- package/dist/adaptors/fetch.d.ts +1 -1
- package/dist/adaptors/umi-request.d.cts +1 -1
- package/dist/adaptors/umi-request.d.ts +1 -1
- package/dist/adaptors/umi-request.global.js +74 -123
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +61 -60
- package/dist/index.d.ts +61 -60
- package/dist/index.global.js +1 -1
- package/dist/index.js +1 -1
- package/models/base.ts +1 -0
- package/models/comment.ts +2 -1
- package/package.json +3 -3
- /package/dist/{adapter-4fDtRx9o.d.cts → adapter-B8tKfr1O.d.cts} +0 -0
- /package/dist/{adapter-4fDtRx9o.d.ts → adapter-B8tKfr1O.d.ts} +0 -0
package/dist/adaptors/fetch.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as IRequestAdapter } from '../adapter-
|
|
1
|
+
import { I as IRequestAdapter } from '../adapter-B8tKfr1O.cjs';
|
|
2
2
|
import { RequestMethod, RequestResponse } from 'umi-request';
|
|
3
3
|
|
|
4
4
|
declare const umiAdaptor: IRequestAdapter<RequestMethod<true>, RequestResponse>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as IRequestAdapter } from '../adapter-
|
|
1
|
+
import { I as IRequestAdapter } from '../adapter-B8tKfr1O.js';
|
|
2
2
|
import { RequestMethod, RequestResponse } from 'umi-request';
|
|
3
3
|
|
|
4
4
|
declare const umiAdaptor: IRequestAdapter<RequestMethod<true>, RequestResponse>;
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
10
10
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
11
11
|
}) : x)(function(x) {
|
|
12
|
-
if (typeof require !== "undefined")
|
|
13
|
-
return require.apply(this, arguments);
|
|
12
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
14
13
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
15
14
|
});
|
|
16
15
|
var __commonJS = (cb, mod) => function __require2() {
|
|
@@ -265,9 +264,9 @@
|
|
|
265
264
|
}
|
|
266
265
|
});
|
|
267
266
|
|
|
268
|
-
// ../../node_modules/.pnpm/hasown@2.0.
|
|
267
|
+
// ../../node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js
|
|
269
268
|
var require_hasown = __commonJS({
|
|
270
|
-
"../../node_modules/.pnpm/hasown@2.0.
|
|
269
|
+
"../../node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js"(exports, module) {
|
|
271
270
|
"use strict";
|
|
272
271
|
var call = Function.prototype.call;
|
|
273
272
|
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
@@ -1438,9 +1437,9 @@
|
|
|
1438
1437
|
}
|
|
1439
1438
|
});
|
|
1440
1439
|
|
|
1441
|
-
// ../../node_modules/.pnpm/qs@6.
|
|
1440
|
+
// ../../node_modules/.pnpm/qs@6.13.0/node_modules/qs/lib/formats.js
|
|
1442
1441
|
var require_formats = __commonJS({
|
|
1443
|
-
"../../node_modules/.pnpm/qs@6.
|
|
1442
|
+
"../../node_modules/.pnpm/qs@6.13.0/node_modules/qs/lib/formats.js"(exports, module) {
|
|
1444
1443
|
"use strict";
|
|
1445
1444
|
var replace = String.prototype.replace;
|
|
1446
1445
|
var percentTwenties = /%20/g;
|
|
@@ -1464,9 +1463,9 @@
|
|
|
1464
1463
|
}
|
|
1465
1464
|
});
|
|
1466
1465
|
|
|
1467
|
-
// ../../node_modules/.pnpm/qs@6.
|
|
1466
|
+
// ../../node_modules/.pnpm/qs@6.13.0/node_modules/qs/lib/utils.js
|
|
1468
1467
|
var require_utils = __commonJS({
|
|
1469
|
-
"../../node_modules/.pnpm/qs@6.
|
|
1468
|
+
"../../node_modules/.pnpm/qs@6.13.0/node_modules/qs/lib/utils.js"(exports, module) {
|
|
1470
1469
|
"use strict";
|
|
1471
1470
|
var formats = require_formats();
|
|
1472
1471
|
var has = Object.prototype.hasOwnProperty;
|
|
@@ -1669,9 +1668,9 @@
|
|
|
1669
1668
|
}
|
|
1670
1669
|
});
|
|
1671
1670
|
|
|
1672
|
-
// ../../node_modules/.pnpm/qs@6.
|
|
1671
|
+
// ../../node_modules/.pnpm/qs@6.13.0/node_modules/qs/lib/stringify.js
|
|
1673
1672
|
var require_stringify = __commonJS({
|
|
1674
|
-
"../../node_modules/.pnpm/qs@6.
|
|
1673
|
+
"../../node_modules/.pnpm/qs@6.13.0/node_modules/qs/lib/stringify.js"(exports, module) {
|
|
1675
1674
|
"use strict";
|
|
1676
1675
|
var getSideChannel = require_side_channel();
|
|
1677
1676
|
var utils = require_utils();
|
|
@@ -1949,9 +1948,9 @@
|
|
|
1949
1948
|
}
|
|
1950
1949
|
});
|
|
1951
1950
|
|
|
1952
|
-
// ../../node_modules/.pnpm/qs@6.
|
|
1951
|
+
// ../../node_modules/.pnpm/qs@6.13.0/node_modules/qs/lib/parse.js
|
|
1953
1952
|
var require_parse = __commonJS({
|
|
1954
|
-
"../../node_modules/.pnpm/qs@6.
|
|
1953
|
+
"../../node_modules/.pnpm/qs@6.13.0/node_modules/qs/lib/parse.js"(exports, module) {
|
|
1955
1954
|
"use strict";
|
|
1956
1955
|
var utils = require_utils();
|
|
1957
1956
|
var has = Object.prototype.hasOwnProperty;
|
|
@@ -1975,6 +1974,7 @@
|
|
|
1975
1974
|
parameterLimit: 1e3,
|
|
1976
1975
|
parseArrays: true,
|
|
1977
1976
|
plainObjects: false,
|
|
1977
|
+
strictDepth: false,
|
|
1978
1978
|
strictNullHandling: false
|
|
1979
1979
|
};
|
|
1980
1980
|
var interpretNumericEntities = function(str) {
|
|
@@ -1993,6 +1993,7 @@
|
|
|
1993
1993
|
var parseValues = function parseQueryStringValues(str, options) {
|
|
1994
1994
|
var obj = { __proto__: null };
|
|
1995
1995
|
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str;
|
|
1996
|
+
cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
1996
1997
|
var limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit;
|
|
1997
1998
|
var parts = cleanStr.split(options.delimiter, limit);
|
|
1998
1999
|
var skipIndex = -1;
|
|
@@ -2052,7 +2053,7 @@
|
|
|
2052
2053
|
var obj;
|
|
2053
2054
|
var root = chain[i];
|
|
2054
2055
|
if (root === "[]" && options.parseArrays) {
|
|
2055
|
-
obj = options.allowEmptyArrays && leaf === "" ? [] : [].concat(leaf);
|
|
2056
|
+
obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : [].concat(leaf);
|
|
2056
2057
|
} else {
|
|
2057
2058
|
obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
2058
2059
|
var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
|
|
@@ -2100,6 +2101,9 @@
|
|
|
2100
2101
|
keys.push(segment[1]);
|
|
2101
2102
|
}
|
|
2102
2103
|
if (segment) {
|
|
2104
|
+
if (options.strictDepth === true) {
|
|
2105
|
+
throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true");
|
|
2106
|
+
}
|
|
2103
2107
|
keys.push("[" + key.slice(segment.index) + "]");
|
|
2104
2108
|
}
|
|
2105
2109
|
return parseObject(keys, val, options, valuesParsed);
|
|
@@ -2146,6 +2150,7 @@
|
|
|
2146
2150
|
parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults.parameterLimit,
|
|
2147
2151
|
parseArrays: opts.parseArrays !== false,
|
|
2148
2152
|
plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults.plainObjects,
|
|
2153
|
+
strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults.strictDepth,
|
|
2149
2154
|
strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling
|
|
2150
2155
|
};
|
|
2151
2156
|
};
|
|
@@ -2170,9 +2175,9 @@
|
|
|
2170
2175
|
}
|
|
2171
2176
|
});
|
|
2172
2177
|
|
|
2173
|
-
// ../../node_modules/.pnpm/qs@6.
|
|
2178
|
+
// ../../node_modules/.pnpm/qs@6.13.0/node_modules/qs/lib/index.js
|
|
2174
2179
|
var require_lib = __commonJS({
|
|
2175
|
-
"../../node_modules/.pnpm/qs@6.
|
|
2180
|
+
"../../node_modules/.pnpm/qs@6.13.0/node_modules/qs/lib/index.js"(exports, module) {
|
|
2176
2181
|
"use strict";
|
|
2177
2182
|
var stringify2 = require_stringify();
|
|
2178
2183
|
var parse2 = require_parse();
|
|
@@ -2194,18 +2199,14 @@
|
|
|
2194
2199
|
var safer = {};
|
|
2195
2200
|
var key;
|
|
2196
2201
|
for (key in buffer) {
|
|
2197
|
-
if (!buffer.hasOwnProperty(key))
|
|
2198
|
-
|
|
2199
|
-
if (key === "SlowBuffer" || key === "Buffer")
|
|
2200
|
-
continue;
|
|
2202
|
+
if (!buffer.hasOwnProperty(key)) continue;
|
|
2203
|
+
if (key === "SlowBuffer" || key === "Buffer") continue;
|
|
2201
2204
|
safer[key] = buffer[key];
|
|
2202
2205
|
}
|
|
2203
2206
|
var Safer = safer.Buffer = {};
|
|
2204
2207
|
for (key in Buffer2) {
|
|
2205
|
-
if (!Buffer2.hasOwnProperty(key))
|
|
2206
|
-
|
|
2207
|
-
if (key === "allocUnsafe" || key === "allocUnsafeSlow")
|
|
2208
|
-
continue;
|
|
2208
|
+
if (!Buffer2.hasOwnProperty(key)) continue;
|
|
2209
|
+
if (key === "allocUnsafe" || key === "allocUnsafeSlow") continue;
|
|
2209
2210
|
Safer[key] = Buffer2[key];
|
|
2210
2211
|
}
|
|
2211
2212
|
safer.Buffer.prototype = Buffer2.prototype;
|
|
@@ -2653,14 +2654,10 @@
|
|
|
2653
2654
|
return "utf-32be";
|
|
2654
2655
|
}
|
|
2655
2656
|
}
|
|
2656
|
-
if (b[0] !== 0 || b[1] > 16)
|
|
2657
|
-
|
|
2658
|
-
if (b[
|
|
2659
|
-
|
|
2660
|
-
if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0))
|
|
2661
|
-
bmpCharsBE++;
|
|
2662
|
-
if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0)
|
|
2663
|
-
bmpCharsLE++;
|
|
2657
|
+
if (b[0] !== 0 || b[1] > 16) invalidBE++;
|
|
2658
|
+
if (b[3] !== 0 || b[2] > 16) invalidLE++;
|
|
2659
|
+
if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++;
|
|
2660
|
+
if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++;
|
|
2664
2661
|
b.length = 0;
|
|
2665
2662
|
charsProcessed++;
|
|
2666
2663
|
if (charsProcessed >= 100) {
|
|
@@ -2669,10 +2666,8 @@
|
|
|
2669
2666
|
}
|
|
2670
2667
|
}
|
|
2671
2668
|
}
|
|
2672
|
-
if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE)
|
|
2673
|
-
|
|
2674
|
-
if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE)
|
|
2675
|
-
return "utf-32le";
|
|
2669
|
+
if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return "utf-32be";
|
|
2670
|
+
if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return "utf-32le";
|
|
2676
2671
|
return defaultEncoding || "utf-32le";
|
|
2677
2672
|
}
|
|
2678
2673
|
}
|
|
@@ -2792,15 +2787,11 @@
|
|
|
2792
2787
|
b.push(buf[j]);
|
|
2793
2788
|
if (b.length === 2) {
|
|
2794
2789
|
if (charsProcessed === 0) {
|
|
2795
|
-
if (b[0] === 255 && b[1] === 254)
|
|
2796
|
-
|
|
2797
|
-
if (b[0] === 254 && b[1] === 255)
|
|
2798
|
-
return "utf-16be";
|
|
2790
|
+
if (b[0] === 255 && b[1] === 254) return "utf-16le";
|
|
2791
|
+
if (b[0] === 254 && b[1] === 255) return "utf-16be";
|
|
2799
2792
|
}
|
|
2800
|
-
if (b[0] === 0 && b[1] !== 0)
|
|
2801
|
-
|
|
2802
|
-
if (b[0] !== 0 && b[1] === 0)
|
|
2803
|
-
asciiCharsLE++;
|
|
2793
|
+
if (b[0] === 0 && b[1] !== 0) asciiCharsBE++;
|
|
2794
|
+
if (b[0] !== 0 && b[1] === 0) asciiCharsLE++;
|
|
2804
2795
|
b.length = 0;
|
|
2805
2796
|
charsProcessed++;
|
|
2806
2797
|
if (charsProcessed >= 100) {
|
|
@@ -2809,10 +2800,8 @@
|
|
|
2809
2800
|
}
|
|
2810
2801
|
}
|
|
2811
2802
|
}
|
|
2812
|
-
if (asciiCharsBE > asciiCharsLE)
|
|
2813
|
-
|
|
2814
|
-
if (asciiCharsBE < asciiCharsLE)
|
|
2815
|
-
return "utf-16le";
|
|
2803
|
+
if (asciiCharsBE > asciiCharsLE) return "utf-16be";
|
|
2804
|
+
if (asciiCharsBE < asciiCharsLE) return "utf-16le";
|
|
2816
2805
|
return defaultEncoding || "utf-16le";
|
|
2817
2806
|
}
|
|
2818
2807
|
}
|
|
@@ -3763,10 +3752,8 @@
|
|
|
3763
3752
|
this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]);
|
|
3764
3753
|
}
|
|
3765
3754
|
this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)];
|
|
3766
|
-
if (this.defCharSB === UNASSIGNED)
|
|
3767
|
-
|
|
3768
|
-
if (this.defCharSB === UNASSIGNED)
|
|
3769
|
-
this.defCharSB = "?".charCodeAt(0);
|
|
3755
|
+
if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]["?"];
|
|
3756
|
+
if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0);
|
|
3770
3757
|
}
|
|
3771
3758
|
DBCSCodec.prototype.encoder = DBCSEncoder;
|
|
3772
3759
|
DBCSCodec.prototype.decoder = DBCSDecoder;
|
|
@@ -3847,8 +3834,7 @@
|
|
|
3847
3834
|
node = this.encodeTableSeq[SEQ_START - bucket[low]];
|
|
3848
3835
|
} else {
|
|
3849
3836
|
node = {};
|
|
3850
|
-
if (bucket[low] !== UNASSIGNED)
|
|
3851
|
-
node[DEF_CHAR] = bucket[low];
|
|
3837
|
+
if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low];
|
|
3852
3838
|
bucket[low] = SEQ_START - this.encodeTableSeq.length;
|
|
3853
3839
|
this.encodeTableSeq.push(node);
|
|
3854
3840
|
}
|
|
@@ -3905,8 +3891,7 @@
|
|
|
3905
3891
|
var newBuf = Buffer2.alloc(str.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i2 = 0, j = 0;
|
|
3906
3892
|
while (true) {
|
|
3907
3893
|
if (nextChar === -1) {
|
|
3908
|
-
if (i2 == str.length)
|
|
3909
|
-
break;
|
|
3894
|
+
if (i2 == str.length) break;
|
|
3910
3895
|
var uCode = str.charCodeAt(i2++);
|
|
3911
3896
|
} else {
|
|
3912
3897
|
var uCode = nextChar;
|
|
@@ -5647,8 +5632,7 @@
|
|
|
5647
5632
|
return done(new Error("Iconv encoding stream needs strings as its input."));
|
|
5648
5633
|
try {
|
|
5649
5634
|
var res = this.conv.write(chunk);
|
|
5650
|
-
if (res && res.length)
|
|
5651
|
-
this.push(res);
|
|
5635
|
+
if (res && res.length) this.push(res);
|
|
5652
5636
|
done();
|
|
5653
5637
|
} catch (e) {
|
|
5654
5638
|
done(e);
|
|
@@ -5657,8 +5641,7 @@
|
|
|
5657
5641
|
IconvLiteEncoderStream.prototype._flush = function(done) {
|
|
5658
5642
|
try {
|
|
5659
5643
|
var res = this.conv.end();
|
|
5660
|
-
if (res && res.length)
|
|
5661
|
-
this.push(res);
|
|
5644
|
+
if (res && res.length) this.push(res);
|
|
5662
5645
|
done();
|
|
5663
5646
|
} catch (e) {
|
|
5664
5647
|
done(e);
|
|
@@ -5689,8 +5672,7 @@
|
|
|
5689
5672
|
return done(new Error("Iconv decoding stream needs buffers as its input."));
|
|
5690
5673
|
try {
|
|
5691
5674
|
var res = this.conv.write(chunk);
|
|
5692
|
-
if (res && res.length)
|
|
5693
|
-
this.push(res, this.encoding);
|
|
5675
|
+
if (res && res.length) this.push(res, this.encoding);
|
|
5694
5676
|
done();
|
|
5695
5677
|
} catch (e) {
|
|
5696
5678
|
done(e);
|
|
@@ -5699,8 +5681,7 @@
|
|
|
5699
5681
|
IconvLiteDecoderStream.prototype._flush = function(done) {
|
|
5700
5682
|
try {
|
|
5701
5683
|
var res = this.conv.end();
|
|
5702
|
-
if (res && res.length)
|
|
5703
|
-
this.push(res, this.encoding);
|
|
5684
|
+
if (res && res.length) this.push(res, this.encoding);
|
|
5704
5685
|
done();
|
|
5705
5686
|
} catch (e) {
|
|
5706
5687
|
done(e);
|
|
@@ -6477,16 +6458,13 @@
|
|
|
6477
6458
|
var descriptor = props[i];
|
|
6478
6459
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
6479
6460
|
descriptor.configurable = true;
|
|
6480
|
-
if ("value" in descriptor)
|
|
6481
|
-
descriptor.writable = true;
|
|
6461
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
6482
6462
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
6483
6463
|
}
|
|
6484
6464
|
}
|
|
6485
6465
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
6486
|
-
if (protoProps)
|
|
6487
|
-
|
|
6488
|
-
if (staticProps)
|
|
6489
|
-
_defineProperties(Constructor, staticProps);
|
|
6466
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
6467
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
6490
6468
|
return Constructor;
|
|
6491
6469
|
}
|
|
6492
6470
|
function _defineProperty(obj, key, value) {
|
|
@@ -6513,8 +6491,7 @@
|
|
|
6513
6491
|
configurable: true
|
|
6514
6492
|
}
|
|
6515
6493
|
});
|
|
6516
|
-
if (superClass)
|
|
6517
|
-
_setPrototypeOf(subClass, superClass);
|
|
6494
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
6518
6495
|
}
|
|
6519
6496
|
function _getPrototypeOf(o) {
|
|
6520
6497
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o2) {
|
|
@@ -6530,12 +6507,9 @@
|
|
|
6530
6507
|
return _setPrototypeOf(o, p);
|
|
6531
6508
|
}
|
|
6532
6509
|
function _isNativeReflectConstruct() {
|
|
6533
|
-
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
6534
|
-
|
|
6535
|
-
if (
|
|
6536
|
-
return false;
|
|
6537
|
-
if (typeof Proxy === "function")
|
|
6538
|
-
return true;
|
|
6510
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
6511
|
+
if (Reflect.construct.sham) return false;
|
|
6512
|
+
if (typeof Proxy === "function") return true;
|
|
6539
6513
|
try {
|
|
6540
6514
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
6541
6515
|
}));
|
|
@@ -6553,8 +6527,7 @@
|
|
|
6553
6527
|
a.push.apply(a, args2);
|
|
6554
6528
|
var Constructor = Function.bind.apply(Parent2, a);
|
|
6555
6529
|
var instance = new Constructor();
|
|
6556
|
-
if (Class2)
|
|
6557
|
-
_setPrototypeOf(instance, Class2.prototype);
|
|
6530
|
+
if (Class2) _setPrototypeOf(instance, Class2.prototype);
|
|
6558
6531
|
return instance;
|
|
6559
6532
|
};
|
|
6560
6533
|
}
|
|
@@ -6566,14 +6539,12 @@
|
|
|
6566
6539
|
function _wrapNativeSuper(Class) {
|
|
6567
6540
|
var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
6568
6541
|
_wrapNativeSuper = function _wrapNativeSuper2(Class2) {
|
|
6569
|
-
if (Class2 === null || !_isNativeFunction(Class2))
|
|
6570
|
-
return Class2;
|
|
6542
|
+
if (Class2 === null || !_isNativeFunction(Class2)) return Class2;
|
|
6571
6543
|
if (typeof Class2 !== "function") {
|
|
6572
6544
|
throw new TypeError("Super expression must either be null or a function");
|
|
6573
6545
|
}
|
|
6574
6546
|
if (typeof _cache !== "undefined") {
|
|
6575
|
-
if (_cache.has(Class2))
|
|
6576
|
-
return _cache.get(Class2);
|
|
6547
|
+
if (_cache.has(Class2)) return _cache.get(Class2);
|
|
6577
6548
|
_cache.set(Class2, Wrapper);
|
|
6578
6549
|
}
|
|
6579
6550
|
function Wrapper() {
|
|
@@ -6622,39 +6593,29 @@
|
|
|
6622
6593
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
6623
6594
|
}
|
|
6624
6595
|
function _arrayWithoutHoles(arr) {
|
|
6625
|
-
if (Array.isArray(arr))
|
|
6626
|
-
return _arrayLikeToArray(arr);
|
|
6596
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
6627
6597
|
}
|
|
6628
6598
|
function _iterableToArray(iter) {
|
|
6629
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
6630
|
-
return Array.from(iter);
|
|
6599
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
6631
6600
|
}
|
|
6632
6601
|
function _unsupportedIterableToArray(o, minLen) {
|
|
6633
|
-
if (!o)
|
|
6634
|
-
|
|
6635
|
-
if (typeof o === "string")
|
|
6636
|
-
return _arrayLikeToArray(o, minLen);
|
|
6602
|
+
if (!o) return;
|
|
6603
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
6637
6604
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
6638
|
-
if (n === "Object" && o.constructor)
|
|
6639
|
-
|
|
6640
|
-
if (n === "
|
|
6641
|
-
return Array.from(o);
|
|
6642
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
6643
|
-
return _arrayLikeToArray(o, minLen);
|
|
6605
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
6606
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
6607
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
6644
6608
|
}
|
|
6645
6609
|
function _arrayLikeToArray(arr, len) {
|
|
6646
|
-
if (len == null || len > arr.length)
|
|
6647
|
-
|
|
6648
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
6649
|
-
arr2[i] = arr[i];
|
|
6610
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
6611
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
6650
6612
|
return arr2;
|
|
6651
6613
|
}
|
|
6652
6614
|
function _nonIterableSpread() {
|
|
6653
6615
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
6654
6616
|
}
|
|
6655
6617
|
function compose(middlewares) {
|
|
6656
|
-
if (!Array.isArray(middlewares))
|
|
6657
|
-
throw new TypeError("Middlewares must be an array!");
|
|
6618
|
+
if (!Array.isArray(middlewares)) throw new TypeError("Middlewares must be an array!");
|
|
6658
6619
|
var middlewaresLen = middlewares.length;
|
|
6659
6620
|
for (var i = 0; i < middlewaresLen; i++) {
|
|
6660
6621
|
if (typeof middlewares[i] !== "function") {
|
|
@@ -6669,8 +6630,7 @@
|
|
|
6669
6630
|
}
|
|
6670
6631
|
index = i2;
|
|
6671
6632
|
var fn = middlewares[i2] || next;
|
|
6672
|
-
if (!fn)
|
|
6673
|
-
return Promise.resolve();
|
|
6633
|
+
if (!fn) return Promise.resolve();
|
|
6674
6634
|
try {
|
|
6675
6635
|
return Promise.resolve(fn(params, function() {
|
|
6676
6636
|
return dispatch(i2 + 1);
|
|
@@ -6685,8 +6645,7 @@
|
|
|
6685
6645
|
var Onion = /* @__PURE__ */ function() {
|
|
6686
6646
|
function Onion2(defaultMiddlewares) {
|
|
6687
6647
|
_classCallCheck(this, Onion2);
|
|
6688
|
-
if (!Array.isArray(defaultMiddlewares))
|
|
6689
|
-
throw new TypeError("Default middlewares must be an array!");
|
|
6648
|
+
if (!Array.isArray(defaultMiddlewares)) throw new TypeError("Default middlewares must be an array!");
|
|
6690
6649
|
this.defaultMiddlewares = _toConsumableArray(defaultMiddlewares);
|
|
6691
6650
|
this.middlewares = [];
|
|
6692
6651
|
}
|
|
@@ -6892,8 +6851,7 @@
|
|
|
6892
6851
|
return val !== null && _typeof(val) === "object";
|
|
6893
6852
|
}
|
|
6894
6853
|
function forEach2ObjArr(target, callback) {
|
|
6895
|
-
if (!target)
|
|
6896
|
-
return;
|
|
6854
|
+
if (!target) return;
|
|
6897
6855
|
if (_typeof(target) !== "object") {
|
|
6898
6856
|
target = [target];
|
|
6899
6857
|
}
|
|
@@ -6953,8 +6911,7 @@
|
|
|
6953
6911
|
return method.toLowerCase() === "get";
|
|
6954
6912
|
}
|
|
6955
6913
|
function fetchMiddleware(ctx, next) {
|
|
6956
|
-
if (!ctx)
|
|
6957
|
-
return next();
|
|
6914
|
+
if (!ctx) return next();
|
|
6958
6915
|
var _ctx$req = ctx.req;
|
|
6959
6916
|
_ctx$req = _ctx$req === void 0 ? {} : _ctx$req;
|
|
6960
6917
|
var _ctx$req$options = _ctx$req.options, options = _ctx$req$options === void 0 ? {} : _ctx$req$options, _ctx$req$url = _ctx$req.url, url = _ctx$req$url === void 0 ? "" : _ctx$req$url, cache = ctx.cache, responseInterceptors = ctx.responseInterceptors;
|
|
@@ -7016,8 +6973,7 @@
|
|
|
7016
6973
|
function parseResponseMiddleware(ctx, next) {
|
|
7017
6974
|
var copy;
|
|
7018
6975
|
return next().then(function() {
|
|
7019
|
-
if (!ctx)
|
|
7020
|
-
return;
|
|
6976
|
+
if (!ctx) return;
|
|
7021
6977
|
var _ctx$res = ctx.res, res = _ctx$res === void 0 ? {} : _ctx$res, _ctx$req = ctx.req, req = _ctx$req === void 0 ? {} : _ctx$req;
|
|
7022
6978
|
var _ref = req || {}, _ref$options = _ref.options;
|
|
7023
6979
|
_ref$options = _ref$options === void 0 ? {} : _ref$options;
|
|
@@ -7049,8 +7005,7 @@
|
|
|
7049
7005
|
throw new ResponseError(copy, "responseType not support", null, req, "ParseError");
|
|
7050
7006
|
}
|
|
7051
7007
|
}).then(function(body) {
|
|
7052
|
-
if (!ctx)
|
|
7053
|
-
return;
|
|
7008
|
+
if (!ctx) return;
|
|
7054
7009
|
var _ctx$res2 = ctx.res, _ctx$req2 = ctx.req, req = _ctx$req2 === void 0 ? {} : _ctx$req2;
|
|
7055
7010
|
var _ref2 = req || {}, _ref2$options = _ref2.options;
|
|
7056
7011
|
_ref2$options = _ref2$options === void 0 ? {} : _ref2$options;
|
|
@@ -7083,8 +7038,7 @@
|
|
|
7083
7038
|
});
|
|
7084
7039
|
}
|
|
7085
7040
|
function simplePostMiddleware(ctx, next) {
|
|
7086
|
-
if (!ctx)
|
|
7087
|
-
return next();
|
|
7041
|
+
if (!ctx) return next();
|
|
7088
7042
|
var _ctx$req = ctx.req;
|
|
7089
7043
|
_ctx$req = _ctx$req === void 0 ? {} : _ctx$req;
|
|
7090
7044
|
var _ctx$req$options = _ctx$req.options, options = _ctx$req$options === void 0 ? {} : _ctx$req$options;
|
|
@@ -7161,8 +7115,7 @@
|
|
|
7161
7115
|
return serializedParams;
|
|
7162
7116
|
}
|
|
7163
7117
|
function simpleGetMiddleware(ctx, next) {
|
|
7164
|
-
if (!ctx)
|
|
7165
|
-
return next();
|
|
7118
|
+
if (!ctx) return next();
|
|
7166
7119
|
var _ctx$req = ctx.req;
|
|
7167
7120
|
_ctx$req = _ctx$req === void 0 ? {} : _ctx$req;
|
|
7168
7121
|
var _ctx$req$options = _ctx$req.options, options = _ctx$req$options === void 0 ? {} : _ctx$req$options;
|
|
@@ -7280,8 +7233,7 @@
|
|
|
7280
7233
|
var opt = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
7281
7234
|
global: true
|
|
7282
7235
|
};
|
|
7283
|
-
if (typeof handler !== "function")
|
|
7284
|
-
throw new TypeError("Interceptor must be function!");
|
|
7236
|
+
if (typeof handler !== "function") throw new TypeError("Interceptor must be function!");
|
|
7285
7237
|
if (opt.global) {
|
|
7286
7238
|
Core2.requestInterceptors.push(handler);
|
|
7287
7239
|
} else {
|
|
@@ -7296,8 +7248,7 @@
|
|
|
7296
7248
|
var opt = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
7297
7249
|
global: true
|
|
7298
7250
|
};
|
|
7299
|
-
if (typeof handler !== "function")
|
|
7300
|
-
throw new TypeError("Interceptor must be function!");
|
|
7251
|
+
if (typeof handler !== "function") throw new TypeError("Interceptor must be function!");
|
|
7301
7252
|
if (opt.global) {
|
|
7302
7253
|
Core2.responseInterceptors.push(handler);
|
|
7303
7254
|
} else {
|
package/dist/index.cjs
CHANGED
|
@@ -1114,7 +1114,7 @@ var HTTPClient = class {
|
|
|
1114
1114
|
const cameledObject = (Array.isArray(data) || isPlainObject(data)) && that.options.transformResponse ? that.options.transformResponse(data) : data;
|
|
1115
1115
|
let nextObject = cameledObject;
|
|
1116
1116
|
if (cameledObject && typeof cameledObject === "object") {
|
|
1117
|
-
nextObject = { ...cameledObject };
|
|
1117
|
+
nextObject = Array.isArray(cameledObject) ? [...cameledObject] : { ...cameledObject };
|
|
1118
1118
|
Object.defineProperty(nextObject, "$raw", {
|
|
1119
1119
|
get() {
|
|
1120
1120
|
return res;
|