pinme 1.2.1 → 1.2.2-alpha.1
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/README.md +55 -1
- package/dist/index.js +1719 -876
- package/dist/utils/getDeviceId.js +61 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8,6 +8,10 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
8
8
|
var __commonJS = (cb, mod) => function __require() {
|
|
9
9
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
10
|
};
|
|
11
|
+
var __export = (target, all3) => {
|
|
12
|
+
for (var name in all3)
|
|
13
|
+
__defProp(target, name, { get: all3[name], enumerable: true });
|
|
14
|
+
};
|
|
11
15
|
var __copyProps = (to, from, except, desc) => {
|
|
12
16
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
17
|
for (let key of __getOwnPropNames(from))
|
|
@@ -25,9 +29,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
29
|
mod
|
|
26
30
|
));
|
|
27
31
|
|
|
28
|
-
// node_modules
|
|
32
|
+
// node_modules/dotenv/package.json
|
|
29
33
|
var require_package = __commonJS({
|
|
30
|
-
"node_modules
|
|
34
|
+
"node_modules/dotenv/package.json"(exports2, module2) {
|
|
31
35
|
module2.exports = {
|
|
32
36
|
name: "dotenv",
|
|
33
37
|
version: "16.5.0",
|
|
@@ -93,13 +97,13 @@ var require_package = __commonJS({
|
|
|
93
97
|
}
|
|
94
98
|
});
|
|
95
99
|
|
|
96
|
-
// node_modules
|
|
100
|
+
// node_modules/dotenv/lib/main.js
|
|
97
101
|
var require_main = __commonJS({
|
|
98
|
-
"node_modules
|
|
99
|
-
var
|
|
100
|
-
var
|
|
102
|
+
"node_modules/dotenv/lib/main.js"(exports2, module2) {
|
|
103
|
+
var fs8 = require("fs");
|
|
104
|
+
var path8 = require("path");
|
|
101
105
|
var os4 = require("os");
|
|
102
|
-
var
|
|
106
|
+
var crypto3 = require("crypto");
|
|
103
107
|
var packageJson = require_package();
|
|
104
108
|
var version2 = packageJson.version;
|
|
105
109
|
var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
@@ -200,7 +204,7 @@ var require_main = __commonJS({
|
|
|
200
204
|
if (options && options.path && options.path.length > 0) {
|
|
201
205
|
if (Array.isArray(options.path)) {
|
|
202
206
|
for (const filepath of options.path) {
|
|
203
|
-
if (
|
|
207
|
+
if (fs8.existsSync(filepath)) {
|
|
204
208
|
possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
205
209
|
}
|
|
206
210
|
}
|
|
@@ -208,15 +212,15 @@ var require_main = __commonJS({
|
|
|
208
212
|
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
209
213
|
}
|
|
210
214
|
} else {
|
|
211
|
-
possibleVaultPath =
|
|
215
|
+
possibleVaultPath = path8.resolve(process.cwd(), ".env.vault");
|
|
212
216
|
}
|
|
213
|
-
if (
|
|
217
|
+
if (fs8.existsSync(possibleVaultPath)) {
|
|
214
218
|
return possibleVaultPath;
|
|
215
219
|
}
|
|
216
220
|
return null;
|
|
217
221
|
}
|
|
218
222
|
function _resolveHome(envPath) {
|
|
219
|
-
return envPath[0] === "~" ?
|
|
223
|
+
return envPath[0] === "~" ? path8.join(os4.homedir(), envPath.slice(1)) : envPath;
|
|
220
224
|
}
|
|
221
225
|
function _configVault(options) {
|
|
222
226
|
const debug = Boolean(options && options.debug);
|
|
@@ -232,7 +236,7 @@ var require_main = __commonJS({
|
|
|
232
236
|
return { parsed };
|
|
233
237
|
}
|
|
234
238
|
function configDotenv(options) {
|
|
235
|
-
const dotenvPath =
|
|
239
|
+
const dotenvPath = path8.resolve(process.cwd(), ".env");
|
|
236
240
|
let encoding = "utf8";
|
|
237
241
|
const debug = Boolean(options && options.debug);
|
|
238
242
|
if (options && options.encoding) {
|
|
@@ -255,13 +259,13 @@ var require_main = __commonJS({
|
|
|
255
259
|
}
|
|
256
260
|
let lastError;
|
|
257
261
|
const parsedAll = {};
|
|
258
|
-
for (const
|
|
262
|
+
for (const path9 of optionPaths) {
|
|
259
263
|
try {
|
|
260
|
-
const parsed = DotenvModule.parse(
|
|
264
|
+
const parsed = DotenvModule.parse(fs8.readFileSync(path9, { encoding }));
|
|
261
265
|
DotenvModule.populate(parsedAll, parsed, options);
|
|
262
266
|
} catch (e) {
|
|
263
267
|
if (debug) {
|
|
264
|
-
_debug(`Failed to load ${
|
|
268
|
+
_debug(`Failed to load ${path9} ${e.message}`);
|
|
265
269
|
}
|
|
266
270
|
lastError = e;
|
|
267
271
|
}
|
|
@@ -295,7 +299,7 @@ var require_main = __commonJS({
|
|
|
295
299
|
const authTag = ciphertext.subarray(-16);
|
|
296
300
|
ciphertext = ciphertext.subarray(12, -16);
|
|
297
301
|
try {
|
|
298
|
-
const aesgcm =
|
|
302
|
+
const aesgcm = crypto3.createDecipheriv("aes-256-gcm", key, nonce);
|
|
299
303
|
aesgcm.setAuthTag(authTag);
|
|
300
304
|
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
|
|
301
305
|
} catch (error) {
|
|
@@ -360,9 +364,9 @@ var require_main = __commonJS({
|
|
|
360
364
|
}
|
|
361
365
|
});
|
|
362
366
|
|
|
363
|
-
// node_modules
|
|
367
|
+
// node_modules/proxy-from-env/index.js
|
|
364
368
|
var require_proxy_from_env = __commonJS({
|
|
365
|
-
"node_modules
|
|
369
|
+
"node_modules/proxy-from-env/index.js"(exports2) {
|
|
366
370
|
"use strict";
|
|
367
371
|
var parseUrl = require("url").parse;
|
|
368
372
|
var DEFAULT_PORTS = {
|
|
@@ -376,7 +380,7 @@ var require_proxy_from_env = __commonJS({
|
|
|
376
380
|
var stringEndsWith = String.prototype.endsWith || function(s) {
|
|
377
381
|
return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1;
|
|
378
382
|
};
|
|
379
|
-
function
|
|
383
|
+
function getProxyForUrl(url2) {
|
|
380
384
|
var parsedUrl = typeof url2 === "string" ? parseUrl(url2) : url2 || {};
|
|
381
385
|
var proto = parsedUrl.protocol;
|
|
382
386
|
var hostname = parsedUrl.host;
|
|
@@ -426,13 +430,13 @@ var require_proxy_from_env = __commonJS({
|
|
|
426
430
|
function getEnv(key) {
|
|
427
431
|
return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
|
|
428
432
|
}
|
|
429
|
-
exports2.getProxyForUrl =
|
|
433
|
+
exports2.getProxyForUrl = getProxyForUrl;
|
|
430
434
|
}
|
|
431
435
|
});
|
|
432
436
|
|
|
433
|
-
// node_modules
|
|
437
|
+
// node_modules/ms/index.js
|
|
434
438
|
var require_ms = __commonJS({
|
|
435
|
-
"node_modules
|
|
439
|
+
"node_modules/ms/index.js"(exports2, module2) {
|
|
436
440
|
var s = 1e3;
|
|
437
441
|
var m = s * 60;
|
|
438
442
|
var h = m * 60;
|
|
@@ -546,10 +550,9 @@ var require_ms = __commonJS({
|
|
|
546
550
|
}
|
|
547
551
|
});
|
|
548
552
|
|
|
549
|
-
// node_modules
|
|
553
|
+
// node_modules/debug/src/common.js
|
|
550
554
|
var require_common = __commonJS({
|
|
551
|
-
"node_modules
|
|
552
|
-
"use strict";
|
|
555
|
+
"node_modules/debug/src/common.js"(exports2, module2) {
|
|
553
556
|
function setup(env) {
|
|
554
557
|
createDebug.debug = createDebug;
|
|
555
558
|
createDebug.default = createDebug;
|
|
@@ -558,16 +561,16 @@ var require_common = __commonJS({
|
|
|
558
561
|
createDebug.enable = enable;
|
|
559
562
|
createDebug.enabled = enabled;
|
|
560
563
|
createDebug.humanize = require_ms();
|
|
561
|
-
|
|
564
|
+
createDebug.destroy = destroy;
|
|
565
|
+
Object.keys(env).forEach((key) => {
|
|
562
566
|
createDebug[key] = env[key];
|
|
563
567
|
});
|
|
564
|
-
createDebug.instances = [];
|
|
565
568
|
createDebug.names = [];
|
|
566
569
|
createDebug.skips = [];
|
|
567
570
|
createDebug.formatters = {};
|
|
568
571
|
function selectColor(namespace) {
|
|
569
|
-
|
|
570
|
-
for (
|
|
572
|
+
let hash = 0;
|
|
573
|
+
for (let i = 0; i < namespace.length; i++) {
|
|
571
574
|
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
572
575
|
hash |= 0;
|
|
573
576
|
}
|
|
@@ -575,17 +578,17 @@ var require_common = __commonJS({
|
|
|
575
578
|
}
|
|
576
579
|
createDebug.selectColor = selectColor;
|
|
577
580
|
function createDebug(namespace) {
|
|
578
|
-
|
|
579
|
-
|
|
581
|
+
let prevTime;
|
|
582
|
+
let enableOverride = null;
|
|
583
|
+
let namespacesCache;
|
|
584
|
+
let enabledCache;
|
|
585
|
+
function debug(...args) {
|
|
580
586
|
if (!debug.enabled) {
|
|
581
587
|
return;
|
|
582
588
|
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
var self2 = debug;
|
|
587
|
-
var curr = Number(/* @__PURE__ */ new Date());
|
|
588
|
-
var ms = curr - (prevTime || curr);
|
|
589
|
+
const self2 = debug;
|
|
590
|
+
const curr = Number(/* @__PURE__ */ new Date());
|
|
591
|
+
const ms = curr - (prevTime || curr);
|
|
589
592
|
self2.diff = ms;
|
|
590
593
|
self2.prev = prevTime;
|
|
591
594
|
self2.curr = curr;
|
|
@@ -594,15 +597,15 @@ var require_common = __commonJS({
|
|
|
594
597
|
if (typeof args[0] !== "string") {
|
|
595
598
|
args.unshift("%O");
|
|
596
599
|
}
|
|
597
|
-
|
|
598
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g,
|
|
600
|
+
let index = 0;
|
|
601
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
|
599
602
|
if (match === "%%") {
|
|
600
|
-
return
|
|
603
|
+
return "%";
|
|
601
604
|
}
|
|
602
605
|
index++;
|
|
603
|
-
|
|
606
|
+
const formatter = createDebug.formatters[format];
|
|
604
607
|
if (typeof formatter === "function") {
|
|
605
|
-
|
|
608
|
+
const val = args[index];
|
|
606
609
|
match = formatter.call(self2, val);
|
|
607
610
|
args.splice(index, 1);
|
|
608
611
|
index--;
|
|
@@ -610,71 +613,99 @@ var require_common = __commonJS({
|
|
|
610
613
|
return match;
|
|
611
614
|
});
|
|
612
615
|
createDebug.formatArgs.call(self2, args);
|
|
613
|
-
|
|
616
|
+
const logFn = self2.log || createDebug.log;
|
|
614
617
|
logFn.apply(self2, args);
|
|
615
618
|
}
|
|
616
619
|
debug.namespace = namespace;
|
|
617
|
-
debug.enabled = createDebug.enabled(namespace);
|
|
618
620
|
debug.useColors = createDebug.useColors();
|
|
619
|
-
debug.color = selectColor(namespace);
|
|
620
|
-
debug.destroy = destroy;
|
|
621
|
+
debug.color = createDebug.selectColor(namespace);
|
|
621
622
|
debug.extend = extend2;
|
|
623
|
+
debug.destroy = createDebug.destroy;
|
|
624
|
+
Object.defineProperty(debug, "enabled", {
|
|
625
|
+
enumerable: true,
|
|
626
|
+
configurable: false,
|
|
627
|
+
get: () => {
|
|
628
|
+
if (enableOverride !== null) {
|
|
629
|
+
return enableOverride;
|
|
630
|
+
}
|
|
631
|
+
if (namespacesCache !== createDebug.namespaces) {
|
|
632
|
+
namespacesCache = createDebug.namespaces;
|
|
633
|
+
enabledCache = createDebug.enabled(namespace);
|
|
634
|
+
}
|
|
635
|
+
return enabledCache;
|
|
636
|
+
},
|
|
637
|
+
set: (v) => {
|
|
638
|
+
enableOverride = v;
|
|
639
|
+
}
|
|
640
|
+
});
|
|
622
641
|
if (typeof createDebug.init === "function") {
|
|
623
642
|
createDebug.init(debug);
|
|
624
643
|
}
|
|
625
|
-
createDebug.instances.push(debug);
|
|
626
644
|
return debug;
|
|
627
645
|
}
|
|
628
|
-
function destroy() {
|
|
629
|
-
var index = createDebug.instances.indexOf(this);
|
|
630
|
-
if (index !== -1) {
|
|
631
|
-
createDebug.instances.splice(index, 1);
|
|
632
|
-
return true;
|
|
633
|
-
}
|
|
634
|
-
return false;
|
|
635
|
-
}
|
|
636
646
|
function extend2(namespace, delimiter) {
|
|
637
|
-
|
|
647
|
+
const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
|
|
648
|
+
newDebug.log = this.log;
|
|
649
|
+
return newDebug;
|
|
638
650
|
}
|
|
639
651
|
function enable(namespaces) {
|
|
640
652
|
createDebug.save(namespaces);
|
|
653
|
+
createDebug.namespaces = namespaces;
|
|
641
654
|
createDebug.names = [];
|
|
642
655
|
createDebug.skips = [];
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
656
|
+
const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
|
|
657
|
+
for (const ns of split) {
|
|
658
|
+
if (ns[0] === "-") {
|
|
659
|
+
createDebug.skips.push(ns.slice(1));
|
|
660
|
+
} else {
|
|
661
|
+
createDebug.names.push(ns);
|
|
649
662
|
}
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
function matchesTemplate(search, template) {
|
|
666
|
+
let searchIndex = 0;
|
|
667
|
+
let templateIndex = 0;
|
|
668
|
+
let starIndex = -1;
|
|
669
|
+
let matchIndex = 0;
|
|
670
|
+
while (searchIndex < search.length) {
|
|
671
|
+
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
|
|
672
|
+
if (template[templateIndex] === "*") {
|
|
673
|
+
starIndex = templateIndex;
|
|
674
|
+
matchIndex = searchIndex;
|
|
675
|
+
templateIndex++;
|
|
676
|
+
} else {
|
|
677
|
+
searchIndex++;
|
|
678
|
+
templateIndex++;
|
|
679
|
+
}
|
|
680
|
+
} else if (starIndex !== -1) {
|
|
681
|
+
templateIndex = starIndex + 1;
|
|
682
|
+
matchIndex++;
|
|
683
|
+
searchIndex = matchIndex;
|
|
653
684
|
} else {
|
|
654
|
-
|
|
685
|
+
return false;
|
|
655
686
|
}
|
|
656
687
|
}
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
instance.enabled = createDebug.enabled(instance.namespace);
|
|
688
|
+
while (templateIndex < template.length && template[templateIndex] === "*") {
|
|
689
|
+
templateIndex++;
|
|
660
690
|
}
|
|
691
|
+
return templateIndex === template.length;
|
|
661
692
|
}
|
|
662
693
|
function disable() {
|
|
694
|
+
const namespaces = [
|
|
695
|
+
...createDebug.names,
|
|
696
|
+
...createDebug.skips.map((namespace) => "-" + namespace)
|
|
697
|
+
].join(",");
|
|
663
698
|
createDebug.enable("");
|
|
699
|
+
return namespaces;
|
|
664
700
|
}
|
|
665
701
|
function enabled(name) {
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
}
|
|
669
|
-
var i;
|
|
670
|
-
var len;
|
|
671
|
-
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
|
672
|
-
if (createDebug.skips[i].test(name)) {
|
|
702
|
+
for (const skip of createDebug.skips) {
|
|
703
|
+
if (matchesTemplate(name, skip)) {
|
|
673
704
|
return false;
|
|
674
705
|
}
|
|
675
706
|
}
|
|
676
|
-
for (
|
|
677
|
-
if (
|
|
707
|
+
for (const ns of createDebug.names) {
|
|
708
|
+
if (matchesTemplate(name, ns)) {
|
|
678
709
|
return true;
|
|
679
710
|
}
|
|
680
711
|
}
|
|
@@ -686,6 +717,9 @@ var require_common = __commonJS({
|
|
|
686
717
|
}
|
|
687
718
|
return val;
|
|
688
719
|
}
|
|
720
|
+
function destroy() {
|
|
721
|
+
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
722
|
+
}
|
|
689
723
|
createDebug.enable(createDebug.load());
|
|
690
724
|
return createDebug;
|
|
691
725
|
}
|
|
@@ -693,29 +727,101 @@ var require_common = __commonJS({
|
|
|
693
727
|
}
|
|
694
728
|
});
|
|
695
729
|
|
|
696
|
-
// node_modules
|
|
730
|
+
// node_modules/debug/src/browser.js
|
|
697
731
|
var require_browser = __commonJS({
|
|
698
|
-
"node_modules
|
|
699
|
-
"use strict";
|
|
700
|
-
function _typeof(obj) {
|
|
701
|
-
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
702
|
-
_typeof = function _typeof2(obj2) {
|
|
703
|
-
return typeof obj2;
|
|
704
|
-
};
|
|
705
|
-
} else {
|
|
706
|
-
_typeof = function _typeof2(obj2) {
|
|
707
|
-
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
708
|
-
};
|
|
709
|
-
}
|
|
710
|
-
return _typeof(obj);
|
|
711
|
-
}
|
|
712
|
-
exports2.log = log;
|
|
732
|
+
"node_modules/debug/src/browser.js"(exports2, module2) {
|
|
713
733
|
exports2.formatArgs = formatArgs;
|
|
714
734
|
exports2.save = save;
|
|
715
735
|
exports2.load = load;
|
|
716
736
|
exports2.useColors = useColors;
|
|
717
737
|
exports2.storage = localstorage();
|
|
718
|
-
exports2.
|
|
738
|
+
exports2.destroy = /* @__PURE__ */ (() => {
|
|
739
|
+
let warned = false;
|
|
740
|
+
return () => {
|
|
741
|
+
if (!warned) {
|
|
742
|
+
warned = true;
|
|
743
|
+
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
744
|
+
}
|
|
745
|
+
};
|
|
746
|
+
})();
|
|
747
|
+
exports2.colors = [
|
|
748
|
+
"#0000CC",
|
|
749
|
+
"#0000FF",
|
|
750
|
+
"#0033CC",
|
|
751
|
+
"#0033FF",
|
|
752
|
+
"#0066CC",
|
|
753
|
+
"#0066FF",
|
|
754
|
+
"#0099CC",
|
|
755
|
+
"#0099FF",
|
|
756
|
+
"#00CC00",
|
|
757
|
+
"#00CC33",
|
|
758
|
+
"#00CC66",
|
|
759
|
+
"#00CC99",
|
|
760
|
+
"#00CCCC",
|
|
761
|
+
"#00CCFF",
|
|
762
|
+
"#3300CC",
|
|
763
|
+
"#3300FF",
|
|
764
|
+
"#3333CC",
|
|
765
|
+
"#3333FF",
|
|
766
|
+
"#3366CC",
|
|
767
|
+
"#3366FF",
|
|
768
|
+
"#3399CC",
|
|
769
|
+
"#3399FF",
|
|
770
|
+
"#33CC00",
|
|
771
|
+
"#33CC33",
|
|
772
|
+
"#33CC66",
|
|
773
|
+
"#33CC99",
|
|
774
|
+
"#33CCCC",
|
|
775
|
+
"#33CCFF",
|
|
776
|
+
"#6600CC",
|
|
777
|
+
"#6600FF",
|
|
778
|
+
"#6633CC",
|
|
779
|
+
"#6633FF",
|
|
780
|
+
"#66CC00",
|
|
781
|
+
"#66CC33",
|
|
782
|
+
"#9900CC",
|
|
783
|
+
"#9900FF",
|
|
784
|
+
"#9933CC",
|
|
785
|
+
"#9933FF",
|
|
786
|
+
"#99CC00",
|
|
787
|
+
"#99CC33",
|
|
788
|
+
"#CC0000",
|
|
789
|
+
"#CC0033",
|
|
790
|
+
"#CC0066",
|
|
791
|
+
"#CC0099",
|
|
792
|
+
"#CC00CC",
|
|
793
|
+
"#CC00FF",
|
|
794
|
+
"#CC3300",
|
|
795
|
+
"#CC3333",
|
|
796
|
+
"#CC3366",
|
|
797
|
+
"#CC3399",
|
|
798
|
+
"#CC33CC",
|
|
799
|
+
"#CC33FF",
|
|
800
|
+
"#CC6600",
|
|
801
|
+
"#CC6633",
|
|
802
|
+
"#CC9900",
|
|
803
|
+
"#CC9933",
|
|
804
|
+
"#CCCC00",
|
|
805
|
+
"#CCCC33",
|
|
806
|
+
"#FF0000",
|
|
807
|
+
"#FF0033",
|
|
808
|
+
"#FF0066",
|
|
809
|
+
"#FF0099",
|
|
810
|
+
"#FF00CC",
|
|
811
|
+
"#FF00FF",
|
|
812
|
+
"#FF3300",
|
|
813
|
+
"#FF3333",
|
|
814
|
+
"#FF3366",
|
|
815
|
+
"#FF3399",
|
|
816
|
+
"#FF33CC",
|
|
817
|
+
"#FF33FF",
|
|
818
|
+
"#FF6600",
|
|
819
|
+
"#FF6633",
|
|
820
|
+
"#FF9900",
|
|
821
|
+
"#FF9933",
|
|
822
|
+
"#FFCC00",
|
|
823
|
+
"#FFCC33"
|
|
824
|
+
];
|
|
719
825
|
function useColors() {
|
|
720
826
|
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
|
|
721
827
|
return true;
|
|
@@ -723,10 +829,11 @@ var require_browser = __commonJS({
|
|
|
723
829
|
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
724
830
|
return false;
|
|
725
831
|
}
|
|
832
|
+
let m;
|
|
726
833
|
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
727
834
|
typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
728
835
|
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
729
|
-
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(
|
|
836
|
+
typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
|
|
730
837
|
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
731
838
|
}
|
|
732
839
|
function formatArgs(args) {
|
|
@@ -734,11 +841,11 @@ var require_browser = __commonJS({
|
|
|
734
841
|
if (!this.useColors) {
|
|
735
842
|
return;
|
|
736
843
|
}
|
|
737
|
-
|
|
844
|
+
const c = "color: " + this.color;
|
|
738
845
|
args.splice(1, 0, c, "color: inherit");
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
args[0].replace(/%[a-zA-Z%]/g,
|
|
846
|
+
let index = 0;
|
|
847
|
+
let lastC = 0;
|
|
848
|
+
args[0].replace(/%[a-zA-Z%]/g, (match) => {
|
|
742
849
|
if (match === "%%") {
|
|
743
850
|
return;
|
|
744
851
|
}
|
|
@@ -749,10 +856,8 @@ var require_browser = __commonJS({
|
|
|
749
856
|
});
|
|
750
857
|
args.splice(lastC, 0, c);
|
|
751
858
|
}
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
return (typeof console === "undefined" ? "undefined" : _typeof(console)) === "object" && console.log && (_console = console).log.apply(_console, arguments);
|
|
755
|
-
}
|
|
859
|
+
exports2.log = console.debug || console.log || (() => {
|
|
860
|
+
});
|
|
756
861
|
function save(namespaces) {
|
|
757
862
|
try {
|
|
758
863
|
if (namespaces) {
|
|
@@ -764,9 +869,9 @@ var require_browser = __commonJS({
|
|
|
764
869
|
}
|
|
765
870
|
}
|
|
766
871
|
function load() {
|
|
767
|
-
|
|
872
|
+
let r;
|
|
768
873
|
try {
|
|
769
|
-
r = exports2.storage.getItem("debug");
|
|
874
|
+
r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
|
|
770
875
|
} catch (error) {
|
|
771
876
|
}
|
|
772
877
|
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
@@ -781,7 +886,7 @@ var require_browser = __commonJS({
|
|
|
781
886
|
}
|
|
782
887
|
}
|
|
783
888
|
module2.exports = require_common()(exports2);
|
|
784
|
-
var formatters = module2.exports
|
|
889
|
+
var { formatters } = module2.exports;
|
|
785
890
|
formatters.j = function(v) {
|
|
786
891
|
try {
|
|
787
892
|
return JSON.stringify(v);
|
|
@@ -792,9 +897,9 @@ var require_browser = __commonJS({
|
|
|
792
897
|
}
|
|
793
898
|
});
|
|
794
899
|
|
|
795
|
-
// node_modules
|
|
900
|
+
// node_modules/has-flag/index.js
|
|
796
901
|
var require_has_flag = __commonJS({
|
|
797
|
-
"node_modules
|
|
902
|
+
"node_modules/has-flag/index.js"(exports2, module2) {
|
|
798
903
|
"use strict";
|
|
799
904
|
module2.exports = (flag, argv) => {
|
|
800
905
|
argv = argv || process.argv;
|
|
@@ -806,9 +911,9 @@ var require_has_flag = __commonJS({
|
|
|
806
911
|
}
|
|
807
912
|
});
|
|
808
913
|
|
|
809
|
-
// node_modules
|
|
914
|
+
// node_modules/supports-color/index.js
|
|
810
915
|
var require_supports_color = __commonJS({
|
|
811
|
-
"node_modules
|
|
916
|
+
"node_modules/supports-color/index.js"(exports2, module2) {
|
|
812
917
|
"use strict";
|
|
813
918
|
var os4 = require("os");
|
|
814
919
|
var hasFlag = require_has_flag();
|
|
@@ -901,34 +1006,114 @@ var require_supports_color = __commonJS({
|
|
|
901
1006
|
}
|
|
902
1007
|
});
|
|
903
1008
|
|
|
904
|
-
// node_modules
|
|
1009
|
+
// node_modules/debug/src/node.js
|
|
905
1010
|
var require_node = __commonJS({
|
|
906
|
-
"node_modules
|
|
907
|
-
"use strict";
|
|
1011
|
+
"node_modules/debug/src/node.js"(exports2, module2) {
|
|
908
1012
|
var tty = require("tty");
|
|
909
|
-
var
|
|
1013
|
+
var util3 = require("util");
|
|
910
1014
|
exports2.init = init;
|
|
911
1015
|
exports2.log = log;
|
|
912
1016
|
exports2.formatArgs = formatArgs;
|
|
913
1017
|
exports2.save = save;
|
|
914
1018
|
exports2.load = load;
|
|
915
1019
|
exports2.useColors = useColors;
|
|
1020
|
+
exports2.destroy = util3.deprecate(
|
|
1021
|
+
() => {
|
|
1022
|
+
},
|
|
1023
|
+
"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
|
|
1024
|
+
);
|
|
916
1025
|
exports2.colors = [6, 2, 3, 4, 5, 1];
|
|
917
1026
|
try {
|
|
918
|
-
supportsColor = require_supports_color();
|
|
1027
|
+
const supportsColor = require_supports_color();
|
|
919
1028
|
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
920
|
-
exports2.colors = [
|
|
1029
|
+
exports2.colors = [
|
|
1030
|
+
20,
|
|
1031
|
+
21,
|
|
1032
|
+
26,
|
|
1033
|
+
27,
|
|
1034
|
+
32,
|
|
1035
|
+
33,
|
|
1036
|
+
38,
|
|
1037
|
+
39,
|
|
1038
|
+
40,
|
|
1039
|
+
41,
|
|
1040
|
+
42,
|
|
1041
|
+
43,
|
|
1042
|
+
44,
|
|
1043
|
+
45,
|
|
1044
|
+
56,
|
|
1045
|
+
57,
|
|
1046
|
+
62,
|
|
1047
|
+
63,
|
|
1048
|
+
68,
|
|
1049
|
+
69,
|
|
1050
|
+
74,
|
|
1051
|
+
75,
|
|
1052
|
+
76,
|
|
1053
|
+
77,
|
|
1054
|
+
78,
|
|
1055
|
+
79,
|
|
1056
|
+
80,
|
|
1057
|
+
81,
|
|
1058
|
+
92,
|
|
1059
|
+
93,
|
|
1060
|
+
98,
|
|
1061
|
+
99,
|
|
1062
|
+
112,
|
|
1063
|
+
113,
|
|
1064
|
+
128,
|
|
1065
|
+
129,
|
|
1066
|
+
134,
|
|
1067
|
+
135,
|
|
1068
|
+
148,
|
|
1069
|
+
149,
|
|
1070
|
+
160,
|
|
1071
|
+
161,
|
|
1072
|
+
162,
|
|
1073
|
+
163,
|
|
1074
|
+
164,
|
|
1075
|
+
165,
|
|
1076
|
+
166,
|
|
1077
|
+
167,
|
|
1078
|
+
168,
|
|
1079
|
+
169,
|
|
1080
|
+
170,
|
|
1081
|
+
171,
|
|
1082
|
+
172,
|
|
1083
|
+
173,
|
|
1084
|
+
178,
|
|
1085
|
+
179,
|
|
1086
|
+
184,
|
|
1087
|
+
185,
|
|
1088
|
+
196,
|
|
1089
|
+
197,
|
|
1090
|
+
198,
|
|
1091
|
+
199,
|
|
1092
|
+
200,
|
|
1093
|
+
201,
|
|
1094
|
+
202,
|
|
1095
|
+
203,
|
|
1096
|
+
204,
|
|
1097
|
+
205,
|
|
1098
|
+
206,
|
|
1099
|
+
207,
|
|
1100
|
+
208,
|
|
1101
|
+
209,
|
|
1102
|
+
214,
|
|
1103
|
+
215,
|
|
1104
|
+
220,
|
|
1105
|
+
221
|
|
1106
|
+
];
|
|
921
1107
|
}
|
|
922
1108
|
} catch (error) {
|
|
923
1109
|
}
|
|
924
|
-
|
|
925
|
-
exports2.inspectOpts = Object.keys(process.env).filter(function(key) {
|
|
1110
|
+
exports2.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
926
1111
|
return /^debug_/i.test(key);
|
|
927
|
-
}).reduce(
|
|
928
|
-
|
|
1112
|
+
}).reduce((obj, key) => {
|
|
1113
|
+
const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
|
|
929
1114
|
return k.toUpperCase();
|
|
930
1115
|
});
|
|
931
|
-
|
|
1116
|
+
let val = process.env[key];
|
|
932
1117
|
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
933
1118
|
val = true;
|
|
934
1119
|
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
@@ -945,11 +1130,11 @@ var require_node = __commonJS({
|
|
|
945
1130
|
return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd);
|
|
946
1131
|
}
|
|
947
1132
|
function formatArgs(args) {
|
|
948
|
-
|
|
1133
|
+
const { namespace: name, useColors: useColors2 } = this;
|
|
949
1134
|
if (useColors2) {
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
1135
|
+
const c = this.color;
|
|
1136
|
+
const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
|
|
1137
|
+
const prefix = ` ${colorCode};1m${name} \x1B[0m`;
|
|
953
1138
|
args[0] = prefix + args[0].split("\n").join("\n" + prefix);
|
|
954
1139
|
args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
|
|
955
1140
|
} else {
|
|
@@ -962,8 +1147,8 @@ var require_node = __commonJS({
|
|
|
962
1147
|
}
|
|
963
1148
|
return (/* @__PURE__ */ new Date()).toISOString() + " ";
|
|
964
1149
|
}
|
|
965
|
-
function log() {
|
|
966
|
-
return process.stderr.write(
|
|
1150
|
+
function log(...args) {
|
|
1151
|
+
return process.stderr.write(util3.formatWithOptions(exports2.inspectOpts, ...args) + "\n");
|
|
967
1152
|
}
|
|
968
1153
|
function save(namespaces) {
|
|
969
1154
|
if (namespaces) {
|
|
@@ -977,30 +1162,27 @@ var require_node = __commonJS({
|
|
|
977
1162
|
}
|
|
978
1163
|
function init(debug) {
|
|
979
1164
|
debug.inspectOpts = {};
|
|
980
|
-
|
|
981
|
-
for (
|
|
1165
|
+
const keys = Object.keys(exports2.inspectOpts);
|
|
1166
|
+
for (let i = 0; i < keys.length; i++) {
|
|
982
1167
|
debug.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
|
|
983
1168
|
}
|
|
984
1169
|
}
|
|
985
1170
|
module2.exports = require_common()(exports2);
|
|
986
|
-
var formatters = module2.exports
|
|
1171
|
+
var { formatters } = module2.exports;
|
|
987
1172
|
formatters.o = function(v) {
|
|
988
1173
|
this.inspectOpts.colors = this.useColors;
|
|
989
|
-
return
|
|
990
|
-
return str.trim();
|
|
991
|
-
}).join(" ");
|
|
1174
|
+
return util3.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
|
|
992
1175
|
};
|
|
993
1176
|
formatters.O = function(v) {
|
|
994
1177
|
this.inspectOpts.colors = this.useColors;
|
|
995
|
-
return
|
|
1178
|
+
return util3.inspect(v, this.inspectOpts);
|
|
996
1179
|
};
|
|
997
1180
|
}
|
|
998
1181
|
});
|
|
999
1182
|
|
|
1000
|
-
// node_modules
|
|
1183
|
+
// node_modules/debug/src/index.js
|
|
1001
1184
|
var require_src = __commonJS({
|
|
1002
|
-
"node_modules
|
|
1003
|
-
"use strict";
|
|
1185
|
+
"node_modules/debug/src/index.js"(exports2, module2) {
|
|
1004
1186
|
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
1005
1187
|
module2.exports = require_browser();
|
|
1006
1188
|
} else {
|
|
@@ -1009,9 +1191,9 @@ var require_src = __commonJS({
|
|
|
1009
1191
|
}
|
|
1010
1192
|
});
|
|
1011
1193
|
|
|
1012
|
-
// node_modules
|
|
1194
|
+
// node_modules/follow-redirects/debug.js
|
|
1013
1195
|
var require_debug = __commonJS({
|
|
1014
|
-
"node_modules
|
|
1196
|
+
"node_modules/follow-redirects/debug.js"(exports2, module2) {
|
|
1015
1197
|
var debug;
|
|
1016
1198
|
module2.exports = function() {
|
|
1017
1199
|
if (!debug) {
|
|
@@ -1029,16 +1211,43 @@ var require_debug = __commonJS({
|
|
|
1029
1211
|
}
|
|
1030
1212
|
});
|
|
1031
1213
|
|
|
1032
|
-
// node_modules
|
|
1214
|
+
// node_modules/follow-redirects/index.js
|
|
1033
1215
|
var require_follow_redirects = __commonJS({
|
|
1034
|
-
"node_modules
|
|
1216
|
+
"node_modules/follow-redirects/index.js"(exports2, module2) {
|
|
1035
1217
|
var url2 = require("url");
|
|
1036
|
-
var
|
|
1218
|
+
var URL4 = url2.URL;
|
|
1037
1219
|
var http2 = require("http");
|
|
1038
1220
|
var https2 = require("https");
|
|
1039
1221
|
var Writable = require("stream").Writable;
|
|
1040
1222
|
var assert = require("assert");
|
|
1041
1223
|
var debug = require_debug();
|
|
1224
|
+
(function detectUnsupportedEnvironment() {
|
|
1225
|
+
var looksLikeNode = typeof process !== "undefined";
|
|
1226
|
+
var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined";
|
|
1227
|
+
var looksLikeV8 = isFunction2(Error.captureStackTrace);
|
|
1228
|
+
if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) {
|
|
1229
|
+
console.warn("The follow-redirects package should be excluded from browser builds.");
|
|
1230
|
+
}
|
|
1231
|
+
})();
|
|
1232
|
+
var useNativeURL = false;
|
|
1233
|
+
try {
|
|
1234
|
+
assert(new URL4(""));
|
|
1235
|
+
} catch (error) {
|
|
1236
|
+
useNativeURL = error.code === "ERR_INVALID_URL";
|
|
1237
|
+
}
|
|
1238
|
+
var preservedUrlFields = [
|
|
1239
|
+
"auth",
|
|
1240
|
+
"host",
|
|
1241
|
+
"hostname",
|
|
1242
|
+
"href",
|
|
1243
|
+
"path",
|
|
1244
|
+
"pathname",
|
|
1245
|
+
"port",
|
|
1246
|
+
"protocol",
|
|
1247
|
+
"query",
|
|
1248
|
+
"search",
|
|
1249
|
+
"hash"
|
|
1250
|
+
];
|
|
1042
1251
|
var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
|
|
1043
1252
|
var eventHandlers = /* @__PURE__ */ Object.create(null);
|
|
1044
1253
|
events.forEach(function(event) {
|
|
@@ -1057,7 +1266,8 @@ var require_follow_redirects = __commonJS({
|
|
|
1057
1266
|
);
|
|
1058
1267
|
var TooManyRedirectsError = createErrorType(
|
|
1059
1268
|
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
1060
|
-
"Maximum number of redirects exceeded"
|
|
1269
|
+
"Maximum number of redirects exceeded",
|
|
1270
|
+
RedirectionError
|
|
1061
1271
|
);
|
|
1062
1272
|
var MaxBodyLengthExceededError = createErrorType(
|
|
1063
1273
|
"ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
|
|
@@ -1067,6 +1277,7 @@ var require_follow_redirects = __commonJS({
|
|
|
1067
1277
|
"ERR_STREAM_WRITE_AFTER_END",
|
|
1068
1278
|
"write after end"
|
|
1069
1279
|
);
|
|
1280
|
+
var destroy = Writable.prototype.destroy || noop2;
|
|
1070
1281
|
function RedirectableRequest(options, responseCallback) {
|
|
1071
1282
|
Writable.call(this);
|
|
1072
1283
|
this._sanitizeOptions(options);
|
|
@@ -1082,15 +1293,25 @@ var require_follow_redirects = __commonJS({
|
|
|
1082
1293
|
}
|
|
1083
1294
|
var self2 = this;
|
|
1084
1295
|
this._onNativeResponse = function(response) {
|
|
1085
|
-
|
|
1296
|
+
try {
|
|
1297
|
+
self2._processResponse(response);
|
|
1298
|
+
} catch (cause) {
|
|
1299
|
+
self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause }));
|
|
1300
|
+
}
|
|
1086
1301
|
};
|
|
1087
1302
|
this._performRequest();
|
|
1088
1303
|
}
|
|
1089
1304
|
RedirectableRequest.prototype = Object.create(Writable.prototype);
|
|
1090
1305
|
RedirectableRequest.prototype.abort = function() {
|
|
1091
|
-
|
|
1306
|
+
destroyRequest(this._currentRequest);
|
|
1307
|
+
this._currentRequest.abort();
|
|
1092
1308
|
this.emit("abort");
|
|
1093
1309
|
};
|
|
1310
|
+
RedirectableRequest.prototype.destroy = function(error) {
|
|
1311
|
+
destroyRequest(this._currentRequest, error);
|
|
1312
|
+
destroy.call(this, error);
|
|
1313
|
+
return this;
|
|
1314
|
+
};
|
|
1094
1315
|
RedirectableRequest.prototype.write = function(data, encoding, callback) {
|
|
1095
1316
|
if (this._ending) {
|
|
1096
1317
|
throw new WriteAfterEndError();
|
|
@@ -1171,6 +1392,7 @@ var require_follow_redirects = __commonJS({
|
|
|
1171
1392
|
self2.removeListener("abort", clearTimer);
|
|
1172
1393
|
self2.removeListener("error", clearTimer);
|
|
1173
1394
|
self2.removeListener("response", clearTimer);
|
|
1395
|
+
self2.removeListener("close", clearTimer);
|
|
1174
1396
|
if (callback) {
|
|
1175
1397
|
self2.removeListener("timeout", callback);
|
|
1176
1398
|
}
|
|
@@ -1190,6 +1412,7 @@ var require_follow_redirects = __commonJS({
|
|
|
1190
1412
|
this.on("abort", clearTimer);
|
|
1191
1413
|
this.on("error", clearTimer);
|
|
1192
1414
|
this.on("response", clearTimer);
|
|
1415
|
+
this.on("close", clearTimer);
|
|
1193
1416
|
return this;
|
|
1194
1417
|
};
|
|
1195
1418
|
[
|
|
@@ -1233,8 +1456,7 @@ var require_follow_redirects = __commonJS({
|
|
|
1233
1456
|
var protocol = this._options.protocol;
|
|
1234
1457
|
var nativeProtocol = this._options.nativeProtocols[protocol];
|
|
1235
1458
|
if (!nativeProtocol) {
|
|
1236
|
-
|
|
1237
|
-
return;
|
|
1459
|
+
throw new TypeError("Unsupported protocol " + protocol);
|
|
1238
1460
|
}
|
|
1239
1461
|
if (this._options.agents) {
|
|
1240
1462
|
var scheme = protocol.slice(0, -1);
|
|
@@ -1287,11 +1509,10 @@ var require_follow_redirects = __commonJS({
|
|
|
1287
1509
|
this._requestBodyBuffers = [];
|
|
1288
1510
|
return;
|
|
1289
1511
|
}
|
|
1290
|
-
|
|
1512
|
+
destroyRequest(this._currentRequest);
|
|
1291
1513
|
response.destroy();
|
|
1292
1514
|
if (++this._redirectCount > this._options.maxRedirects) {
|
|
1293
|
-
|
|
1294
|
-
return;
|
|
1515
|
+
throw new TooManyRedirectsError();
|
|
1295
1516
|
}
|
|
1296
1517
|
var requestHeaders;
|
|
1297
1518
|
var beforeRedirect = this._options.beforeRedirect;
|
|
@@ -1312,22 +1533,15 @@ var require_follow_redirects = __commonJS({
|
|
|
1312
1533
|
removeMatchingHeaders(/^content-/i, this._options.headers);
|
|
1313
1534
|
}
|
|
1314
1535
|
var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
|
|
1315
|
-
var currentUrlParts =
|
|
1536
|
+
var currentUrlParts = parseUrl(this._currentUrl);
|
|
1316
1537
|
var currentHost = currentHostHeader || currentUrlParts.host;
|
|
1317
1538
|
var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url2.format(Object.assign(currentUrlParts, { host: currentHost }));
|
|
1318
|
-
var redirectUrl;
|
|
1319
|
-
|
|
1320
|
-
redirectUrl = url2.resolve(currentUrl, location);
|
|
1321
|
-
} catch (cause) {
|
|
1322
|
-
this.emit("error", new RedirectionError({ cause }));
|
|
1323
|
-
return;
|
|
1324
|
-
}
|
|
1325
|
-
debug("redirecting to", redirectUrl);
|
|
1539
|
+
var redirectUrl = resolveUrl(location, currentUrl);
|
|
1540
|
+
debug("redirecting to", redirectUrl.href);
|
|
1326
1541
|
this._isRedirect = true;
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
|
|
1542
|
+
spreadUrlObject(redirectUrl, this._options);
|
|
1543
|
+
if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) {
|
|
1544
|
+
removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
|
|
1331
1545
|
}
|
|
1332
1546
|
if (isFunction2(beforeRedirect)) {
|
|
1333
1547
|
var responseDetails = {
|
|
@@ -1339,19 +1553,10 @@ var require_follow_redirects = __commonJS({
|
|
|
1339
1553
|
method,
|
|
1340
1554
|
headers: requestHeaders
|
|
1341
1555
|
};
|
|
1342
|
-
|
|
1343
|
-
beforeRedirect(this._options, responseDetails, requestDetails);
|
|
1344
|
-
} catch (err) {
|
|
1345
|
-
this.emit("error", err);
|
|
1346
|
-
return;
|
|
1347
|
-
}
|
|
1556
|
+
beforeRedirect(this._options, responseDetails, requestDetails);
|
|
1348
1557
|
this._sanitizeOptions(this._options);
|
|
1349
1558
|
}
|
|
1350
|
-
|
|
1351
|
-
this._performRequest();
|
|
1352
|
-
} catch (cause) {
|
|
1353
|
-
this.emit("error", new RedirectionError({ cause }));
|
|
1354
|
-
}
|
|
1559
|
+
this._performRequest();
|
|
1355
1560
|
};
|
|
1356
1561
|
function wrap(protocols) {
|
|
1357
1562
|
var exports3 = {
|
|
@@ -1364,22 +1569,13 @@ var require_follow_redirects = __commonJS({
|
|
|
1364
1569
|
var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
|
|
1365
1570
|
var wrappedProtocol = exports3[scheme] = Object.create(nativeProtocol);
|
|
1366
1571
|
function request(input, options, callback) {
|
|
1367
|
-
if (
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
} catch (err) {
|
|
1372
|
-
parsed = url2.parse(input);
|
|
1373
|
-
}
|
|
1374
|
-
if (!isString2(parsed.protocol)) {
|
|
1375
|
-
throw new InvalidUrlError({ input });
|
|
1376
|
-
}
|
|
1377
|
-
input = parsed;
|
|
1378
|
-
} else if (URL3 && input instanceof URL3) {
|
|
1379
|
-
input = urlToOptions(input);
|
|
1572
|
+
if (isURL(input)) {
|
|
1573
|
+
input = spreadUrlObject(input);
|
|
1574
|
+
} else if (isString2(input)) {
|
|
1575
|
+
input = spreadUrlObject(parseUrl(input));
|
|
1380
1576
|
} else {
|
|
1381
1577
|
callback = options;
|
|
1382
|
-
options = input;
|
|
1578
|
+
options = validateUrl(input);
|
|
1383
1579
|
input = { protocol };
|
|
1384
1580
|
}
|
|
1385
1581
|
if (isFunction2(options)) {
|
|
@@ -1412,23 +1608,43 @@ var require_follow_redirects = __commonJS({
|
|
|
1412
1608
|
}
|
|
1413
1609
|
function noop2() {
|
|
1414
1610
|
}
|
|
1415
|
-
function
|
|
1416
|
-
var
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
)
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1611
|
+
function parseUrl(input) {
|
|
1612
|
+
var parsed;
|
|
1613
|
+
if (useNativeURL) {
|
|
1614
|
+
parsed = new URL4(input);
|
|
1615
|
+
} else {
|
|
1616
|
+
parsed = validateUrl(url2.parse(input));
|
|
1617
|
+
if (!isString2(parsed.protocol)) {
|
|
1618
|
+
throw new InvalidUrlError({ input });
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
return parsed;
|
|
1622
|
+
}
|
|
1623
|
+
function resolveUrl(relative, base) {
|
|
1624
|
+
return useNativeURL ? new URL4(relative, base) : parseUrl(url2.resolve(base, relative));
|
|
1625
|
+
}
|
|
1626
|
+
function validateUrl(input) {
|
|
1627
|
+
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
1628
|
+
throw new InvalidUrlError({ input: input.href || input });
|
|
1629
|
+
}
|
|
1630
|
+
if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
|
|
1631
|
+
throw new InvalidUrlError({ input: input.href || input });
|
|
1632
|
+
}
|
|
1633
|
+
return input;
|
|
1634
|
+
}
|
|
1635
|
+
function spreadUrlObject(urlObject, target) {
|
|
1636
|
+
var spread3 = target || {};
|
|
1637
|
+
for (var key of preservedUrlFields) {
|
|
1638
|
+
spread3[key] = urlObject[key];
|
|
1639
|
+
}
|
|
1640
|
+
if (spread3.hostname.startsWith("[")) {
|
|
1641
|
+
spread3.hostname = spread3.hostname.slice(1, -1);
|
|
1430
1642
|
}
|
|
1431
|
-
|
|
1643
|
+
if (spread3.port !== "") {
|
|
1644
|
+
spread3.port = Number(spread3.port);
|
|
1645
|
+
}
|
|
1646
|
+
spread3.path = spread3.search ? spread3.pathname + spread3.search : spread3.pathname;
|
|
1647
|
+
return spread3;
|
|
1432
1648
|
}
|
|
1433
1649
|
function removeMatchingHeaders(regex, headers) {
|
|
1434
1650
|
var lastValue;
|
|
@@ -1442,22 +1658,32 @@ var require_follow_redirects = __commonJS({
|
|
|
1442
1658
|
}
|
|
1443
1659
|
function createErrorType(code, message, baseClass) {
|
|
1444
1660
|
function CustomError(properties) {
|
|
1445
|
-
Error.captureStackTrace
|
|
1661
|
+
if (isFunction2(Error.captureStackTrace)) {
|
|
1662
|
+
Error.captureStackTrace(this, this.constructor);
|
|
1663
|
+
}
|
|
1446
1664
|
Object.assign(this, properties || {});
|
|
1447
1665
|
this.code = code;
|
|
1448
1666
|
this.message = this.cause ? message + ": " + this.cause.message : message;
|
|
1449
1667
|
}
|
|
1450
1668
|
CustomError.prototype = new (baseClass || Error)();
|
|
1451
|
-
CustomError.prototype
|
|
1452
|
-
|
|
1669
|
+
Object.defineProperties(CustomError.prototype, {
|
|
1670
|
+
constructor: {
|
|
1671
|
+
value: CustomError,
|
|
1672
|
+
enumerable: false
|
|
1673
|
+
},
|
|
1674
|
+
name: {
|
|
1675
|
+
value: "Error [" + code + "]",
|
|
1676
|
+
enumerable: false
|
|
1677
|
+
}
|
|
1678
|
+
});
|
|
1453
1679
|
return CustomError;
|
|
1454
1680
|
}
|
|
1455
|
-
function
|
|
1681
|
+
function destroyRequest(request, error) {
|
|
1456
1682
|
for (var event of events) {
|
|
1457
1683
|
request.removeListener(event, eventHandlers[event]);
|
|
1458
1684
|
}
|
|
1459
1685
|
request.on("error", noop2);
|
|
1460
|
-
request.
|
|
1686
|
+
request.destroy(error);
|
|
1461
1687
|
}
|
|
1462
1688
|
function isSubdomain(subdomain, domain) {
|
|
1463
1689
|
assert(isString2(subdomain) && isString2(domain));
|
|
@@ -1473,6 +1699,9 @@ var require_follow_redirects = __commonJS({
|
|
|
1473
1699
|
function isBuffer2(value) {
|
|
1474
1700
|
return typeof value === "object" && "length" in value;
|
|
1475
1701
|
}
|
|
1702
|
+
function isURL(value) {
|
|
1703
|
+
return URL4 && value instanceof URL4;
|
|
1704
|
+
}
|
|
1476
1705
|
module2.exports = wrap({ http: http2, https: https2 });
|
|
1477
1706
|
module2.exports.wrap = wrap;
|
|
1478
1707
|
}
|
|
@@ -1519,11 +1748,11 @@ function checkNodeVersion() {
|
|
|
1519
1748
|
|
|
1520
1749
|
// bin/index.ts
|
|
1521
1750
|
var import_commander = require("commander");
|
|
1522
|
-
var
|
|
1523
|
-
var
|
|
1751
|
+
var import_chalk12 = __toESM(require("chalk"));
|
|
1752
|
+
var import_figlet4 = __toESM(require("figlet"));
|
|
1524
1753
|
|
|
1525
1754
|
// package.json
|
|
1526
|
-
var version = "1.2.1";
|
|
1755
|
+
var version = "1.2.2-alpha.1";
|
|
1527
1756
|
|
|
1528
1757
|
// bin/upload.ts
|
|
1529
1758
|
var import_path6 = __toESM(require("path"));
|
|
@@ -1531,16 +1760,17 @@ var import_chalk4 = __toESM(require("chalk"));
|
|
|
1531
1760
|
var import_inquirer = __toESM(require("inquirer"));
|
|
1532
1761
|
var import_figlet = __toESM(require("figlet"));
|
|
1533
1762
|
|
|
1534
|
-
// node_modules
|
|
1763
|
+
// node_modules/axios/lib/helpers/bind.js
|
|
1535
1764
|
function bind(fn, thisArg) {
|
|
1536
1765
|
return function wrap() {
|
|
1537
1766
|
return fn.apply(thisArg, arguments);
|
|
1538
1767
|
};
|
|
1539
1768
|
}
|
|
1540
1769
|
|
|
1541
|
-
// node_modules
|
|
1770
|
+
// node_modules/axios/lib/utils.js
|
|
1542
1771
|
var { toString } = Object.prototype;
|
|
1543
1772
|
var { getPrototypeOf } = Object;
|
|
1773
|
+
var { iterator, toStringTag } = Symbol;
|
|
1544
1774
|
var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
|
|
1545
1775
|
const str = toString.call(thing);
|
|
1546
1776
|
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
@@ -1575,7 +1805,7 @@ var isPlainObject = (val) => {
|
|
|
1575
1805
|
return false;
|
|
1576
1806
|
}
|
|
1577
1807
|
const prototype3 = getPrototypeOf(val);
|
|
1578
|
-
return (prototype3 === null || prototype3 === Object.prototype || Object.getPrototypeOf(prototype3) === null) && !(
|
|
1808
|
+
return (prototype3 === null || prototype3 === Object.prototype || Object.getPrototypeOf(prototype3) === null) && !(toStringTag in val) && !(iterator in val);
|
|
1579
1809
|
};
|
|
1580
1810
|
var isDate = kindOfTest("Date");
|
|
1581
1811
|
var isFile = kindOfTest("File");
|
|
@@ -1583,10 +1813,12 @@ var isBlob = kindOfTest("Blob");
|
|
|
1583
1813
|
var isFileList = kindOfTest("FileList");
|
|
1584
1814
|
var isStream = (val) => isObject(val) && isFunction(val.pipe);
|
|
1585
1815
|
var isFormData = (thing) => {
|
|
1586
|
-
|
|
1587
|
-
return thing && (typeof FormData === "function" && thing instanceof FormData ||
|
|
1816
|
+
let kind;
|
|
1817
|
+
return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
|
|
1818
|
+
kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
|
|
1588
1819
|
};
|
|
1589
1820
|
var isURLSearchParams = kindOfTest("URLSearchParams");
|
|
1821
|
+
var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
|
|
1590
1822
|
var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
1591
1823
|
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
1592
1824
|
if (obj === null || typeof obj === "undefined") {
|
|
@@ -1720,10 +1952,10 @@ var isTypedArray = /* @__PURE__ */ ((TypedArray) => {
|
|
|
1720
1952
|
};
|
|
1721
1953
|
})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
|
|
1722
1954
|
var forEachEntry = (obj, fn) => {
|
|
1723
|
-
const generator = obj && obj[
|
|
1724
|
-
const
|
|
1955
|
+
const generator = obj && obj[iterator];
|
|
1956
|
+
const _iterator = generator.call(obj);
|
|
1725
1957
|
let result;
|
|
1726
|
-
while ((result =
|
|
1958
|
+
while ((result = _iterator.next()) && !result.done) {
|
|
1727
1959
|
const pair = result.value;
|
|
1728
1960
|
fn.call(obj, pair[0], pair[1]);
|
|
1729
1961
|
}
|
|
@@ -1751,8 +1983,9 @@ var reduceDescriptors = (obj, reducer) => {
|
|
|
1751
1983
|
const descriptors2 = Object.getOwnPropertyDescriptors(obj);
|
|
1752
1984
|
const reducedDescriptors = {};
|
|
1753
1985
|
forEach(descriptors2, (descriptor, name) => {
|
|
1754
|
-
|
|
1755
|
-
|
|
1986
|
+
let ret;
|
|
1987
|
+
if ((ret = reducer(descriptor, name, obj)) !== false) {
|
|
1988
|
+
reducedDescriptors[name] = ret || descriptor;
|
|
1756
1989
|
}
|
|
1757
1990
|
});
|
|
1758
1991
|
Object.defineProperties(obj, reducedDescriptors);
|
|
@@ -1789,26 +2022,10 @@ var toObjectSet = (arrayOrString, delimiter) => {
|
|
|
1789
2022
|
var noop = () => {
|
|
1790
2023
|
};
|
|
1791
2024
|
var toFiniteNumber = (value, defaultValue) => {
|
|
1792
|
-
value = +value;
|
|
1793
|
-
return Number.isFinite(value) ? value : defaultValue;
|
|
1794
|
-
};
|
|
1795
|
-
var ALPHA = "abcdefghijklmnopqrstuvwxyz";
|
|
1796
|
-
var DIGIT = "0123456789";
|
|
1797
|
-
var ALPHABET = {
|
|
1798
|
-
DIGIT,
|
|
1799
|
-
ALPHA,
|
|
1800
|
-
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
|
1801
|
-
};
|
|
1802
|
-
var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
1803
|
-
let str = "";
|
|
1804
|
-
const { length } = alphabet;
|
|
1805
|
-
while (size--) {
|
|
1806
|
-
str += alphabet[Math.random() * length | 0];
|
|
1807
|
-
}
|
|
1808
|
-
return str;
|
|
2025
|
+
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
1809
2026
|
};
|
|
1810
2027
|
function isSpecCompliantForm(thing) {
|
|
1811
|
-
return !!(thing && isFunction(thing.append) && thing[
|
|
2028
|
+
return !!(thing && isFunction(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
|
|
1812
2029
|
}
|
|
1813
2030
|
var toJSONObject = (obj) => {
|
|
1814
2031
|
const stack = new Array(10);
|
|
@@ -1832,6 +2049,29 @@ var toJSONObject = (obj) => {
|
|
|
1832
2049
|
};
|
|
1833
2050
|
return visit(obj, 0);
|
|
1834
2051
|
};
|
|
2052
|
+
var isAsyncFn = kindOfTest("AsyncFunction");
|
|
2053
|
+
var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
|
2054
|
+
var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
2055
|
+
if (setImmediateSupported) {
|
|
2056
|
+
return setImmediate;
|
|
2057
|
+
}
|
|
2058
|
+
return postMessageSupported ? ((token, callbacks) => {
|
|
2059
|
+
_global.addEventListener("message", ({ source, data }) => {
|
|
2060
|
+
if (source === _global && data === token) {
|
|
2061
|
+
callbacks.length && callbacks.shift()();
|
|
2062
|
+
}
|
|
2063
|
+
}, false);
|
|
2064
|
+
return (cb) => {
|
|
2065
|
+
callbacks.push(cb);
|
|
2066
|
+
_global.postMessage(token, "*");
|
|
2067
|
+
};
|
|
2068
|
+
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
2069
|
+
})(
|
|
2070
|
+
typeof setImmediate === "function",
|
|
2071
|
+
isFunction(_global.postMessage)
|
|
2072
|
+
);
|
|
2073
|
+
var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
|
|
2074
|
+
var isIterable = (thing) => thing != null && isFunction(thing[iterator]);
|
|
1835
2075
|
var utils_default = {
|
|
1836
2076
|
isArray,
|
|
1837
2077
|
isArrayBuffer,
|
|
@@ -1843,6 +2083,10 @@ var utils_default = {
|
|
|
1843
2083
|
isBoolean,
|
|
1844
2084
|
isObject,
|
|
1845
2085
|
isPlainObject,
|
|
2086
|
+
isReadableStream,
|
|
2087
|
+
isRequest,
|
|
2088
|
+
isResponse,
|
|
2089
|
+
isHeaders,
|
|
1846
2090
|
isUndefined,
|
|
1847
2091
|
isDate,
|
|
1848
2092
|
isFile,
|
|
@@ -1879,13 +2123,16 @@ var utils_default = {
|
|
|
1879
2123
|
findKey,
|
|
1880
2124
|
global: _global,
|
|
1881
2125
|
isContextDefined,
|
|
1882
|
-
ALPHABET,
|
|
1883
|
-
generateString,
|
|
1884
2126
|
isSpecCompliantForm,
|
|
1885
|
-
toJSONObject
|
|
2127
|
+
toJSONObject,
|
|
2128
|
+
isAsyncFn,
|
|
2129
|
+
isThenable,
|
|
2130
|
+
setImmediate: _setImmediate,
|
|
2131
|
+
asap,
|
|
2132
|
+
isIterable
|
|
1886
2133
|
};
|
|
1887
2134
|
|
|
1888
|
-
// node_modules
|
|
2135
|
+
// node_modules/axios/lib/core/AxiosError.js
|
|
1889
2136
|
function AxiosError(message, code, config, request, response) {
|
|
1890
2137
|
Error.call(this);
|
|
1891
2138
|
if (Error.captureStackTrace) {
|
|
@@ -1898,7 +2145,10 @@ function AxiosError(message, code, config, request, response) {
|
|
|
1898
2145
|
code && (this.code = code);
|
|
1899
2146
|
config && (this.config = config);
|
|
1900
2147
|
request && (this.request = request);
|
|
1901
|
-
|
|
2148
|
+
if (response) {
|
|
2149
|
+
this.response = response;
|
|
2150
|
+
this.status = response.status ? response.status : null;
|
|
2151
|
+
}
|
|
1902
2152
|
}
|
|
1903
2153
|
utils_default.inherits(AxiosError, Error, {
|
|
1904
2154
|
toJSON: function toJSON() {
|
|
@@ -1917,7 +2167,7 @@ utils_default.inherits(AxiosError, Error, {
|
|
|
1917
2167
|
// Axios
|
|
1918
2168
|
config: utils_default.toJSONObject(this.config),
|
|
1919
2169
|
code: this.code,
|
|
1920
|
-
status: this.
|
|
2170
|
+
status: this.status
|
|
1921
2171
|
};
|
|
1922
2172
|
}
|
|
1923
2173
|
});
|
|
@@ -1957,20 +2207,20 @@ AxiosError.from = (error, code, config, request, response, customProps) => {
|
|
|
1957
2207
|
};
|
|
1958
2208
|
var AxiosError_default = AxiosError;
|
|
1959
2209
|
|
|
1960
|
-
// node_modules
|
|
2210
|
+
// node_modules/axios/lib/platform/node/classes/FormData.js
|
|
1961
2211
|
var import_form_data = __toESM(require("form-data"), 1);
|
|
1962
2212
|
var FormData_default = import_form_data.default;
|
|
1963
2213
|
|
|
1964
|
-
// node_modules
|
|
2214
|
+
// node_modules/axios/lib/helpers/toFormData.js
|
|
1965
2215
|
function isVisitable(thing) {
|
|
1966
2216
|
return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
|
|
1967
2217
|
}
|
|
1968
2218
|
function removeBrackets(key) {
|
|
1969
2219
|
return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
1970
2220
|
}
|
|
1971
|
-
function renderKey(
|
|
1972
|
-
if (!
|
|
1973
|
-
return
|
|
2221
|
+
function renderKey(path8, key, dots) {
|
|
2222
|
+
if (!path8) return key;
|
|
2223
|
+
return path8.concat(key).map(function each(token, i) {
|
|
1974
2224
|
token = removeBrackets(token);
|
|
1975
2225
|
return !dots && i ? "[" + token + "]" : token;
|
|
1976
2226
|
}).join(dots ? "." : "");
|
|
@@ -2015,9 +2265,9 @@ function toFormData(obj, formData, options) {
|
|
|
2015
2265
|
}
|
|
2016
2266
|
return value;
|
|
2017
2267
|
}
|
|
2018
|
-
function defaultVisitor(value, key,
|
|
2268
|
+
function defaultVisitor(value, key, path8) {
|
|
2019
2269
|
let arr = value;
|
|
2020
|
-
if (value && !
|
|
2270
|
+
if (value && !path8 && typeof value === "object") {
|
|
2021
2271
|
if (utils_default.endsWith(key, "{}")) {
|
|
2022
2272
|
key = metaTokens ? key : key.slice(0, -2);
|
|
2023
2273
|
value = JSON.stringify(value);
|
|
@@ -2036,7 +2286,7 @@ function toFormData(obj, formData, options) {
|
|
|
2036
2286
|
if (isVisitable(value)) {
|
|
2037
2287
|
return true;
|
|
2038
2288
|
}
|
|
2039
|
-
formData.append(renderKey(
|
|
2289
|
+
formData.append(renderKey(path8, key, dots), convertValue(value));
|
|
2040
2290
|
return false;
|
|
2041
2291
|
}
|
|
2042
2292
|
const stack = [];
|
|
@@ -2045,10 +2295,10 @@ function toFormData(obj, formData, options) {
|
|
|
2045
2295
|
convertValue,
|
|
2046
2296
|
isVisitable
|
|
2047
2297
|
});
|
|
2048
|
-
function build(value,
|
|
2298
|
+
function build(value, path8) {
|
|
2049
2299
|
if (utils_default.isUndefined(value)) return;
|
|
2050
2300
|
if (stack.indexOf(value) !== -1) {
|
|
2051
|
-
throw Error("Circular reference detected in " +
|
|
2301
|
+
throw Error("Circular reference detected in " + path8.join("."));
|
|
2052
2302
|
}
|
|
2053
2303
|
stack.push(value);
|
|
2054
2304
|
utils_default.forEach(value, function each(el, key) {
|
|
@@ -2056,11 +2306,11 @@ function toFormData(obj, formData, options) {
|
|
|
2056
2306
|
formData,
|
|
2057
2307
|
el,
|
|
2058
2308
|
utils_default.isString(key) ? key.trim() : key,
|
|
2059
|
-
|
|
2309
|
+
path8,
|
|
2060
2310
|
exposedHelpers
|
|
2061
2311
|
);
|
|
2062
2312
|
if (result === true) {
|
|
2063
|
-
build(el,
|
|
2313
|
+
build(el, path8 ? path8.concat(key) : [key]);
|
|
2064
2314
|
}
|
|
2065
2315
|
});
|
|
2066
2316
|
stack.pop();
|
|
@@ -2073,7 +2323,7 @@ function toFormData(obj, formData, options) {
|
|
|
2073
2323
|
}
|
|
2074
2324
|
var toFormData_default = toFormData;
|
|
2075
2325
|
|
|
2076
|
-
// node_modules
|
|
2326
|
+
// node_modules/axios/lib/helpers/AxiosURLSearchParams.js
|
|
2077
2327
|
function encode(str) {
|
|
2078
2328
|
const charMap = {
|
|
2079
2329
|
"!": "%21",
|
|
@@ -2106,7 +2356,7 @@ prototype2.toString = function toString2(encoder) {
|
|
|
2106
2356
|
};
|
|
2107
2357
|
var AxiosURLSearchParams_default = AxiosURLSearchParams;
|
|
2108
2358
|
|
|
2109
|
-
// node_modules
|
|
2359
|
+
// node_modules/axios/lib/helpers/buildURL.js
|
|
2110
2360
|
function encode2(val) {
|
|
2111
2361
|
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
2112
2362
|
}
|
|
@@ -2115,6 +2365,11 @@ function buildURL(url2, params, options) {
|
|
|
2115
2365
|
return url2;
|
|
2116
2366
|
}
|
|
2117
2367
|
const _encode = options && options.encode || encode2;
|
|
2368
|
+
if (utils_default.isFunction(options)) {
|
|
2369
|
+
options = {
|
|
2370
|
+
serialize: options
|
|
2371
|
+
};
|
|
2372
|
+
}
|
|
2118
2373
|
const serializeFn = options && options.serialize;
|
|
2119
2374
|
let serializedParams;
|
|
2120
2375
|
if (serializeFn) {
|
|
@@ -2132,7 +2387,7 @@ function buildURL(url2, params, options) {
|
|
|
2132
2387
|
return url2;
|
|
2133
2388
|
}
|
|
2134
2389
|
|
|
2135
|
-
// node_modules
|
|
2390
|
+
// node_modules/axios/lib/core/InterceptorManager.js
|
|
2136
2391
|
var InterceptorManager = class {
|
|
2137
2392
|
constructor() {
|
|
2138
2393
|
this.handlers = [];
|
|
@@ -2196,18 +2451,38 @@ var InterceptorManager = class {
|
|
|
2196
2451
|
};
|
|
2197
2452
|
var InterceptorManager_default = InterceptorManager;
|
|
2198
2453
|
|
|
2199
|
-
// node_modules
|
|
2454
|
+
// node_modules/axios/lib/defaults/transitional.js
|
|
2200
2455
|
var transitional_default = {
|
|
2201
2456
|
silentJSONParsing: true,
|
|
2202
2457
|
forcedJSONParsing: true,
|
|
2203
2458
|
clarifyTimeoutError: false
|
|
2204
2459
|
};
|
|
2205
2460
|
|
|
2206
|
-
// node_modules
|
|
2461
|
+
// node_modules/axios/lib/platform/node/index.js
|
|
2462
|
+
var import_crypto = __toESM(require("crypto"), 1);
|
|
2463
|
+
|
|
2464
|
+
// node_modules/axios/lib/platform/node/classes/URLSearchParams.js
|
|
2207
2465
|
var import_url = __toESM(require("url"), 1);
|
|
2208
2466
|
var URLSearchParams_default = import_url.default.URLSearchParams;
|
|
2209
2467
|
|
|
2210
|
-
// node_modules
|
|
2468
|
+
// node_modules/axios/lib/platform/node/index.js
|
|
2469
|
+
var ALPHA = "abcdefghijklmnopqrstuvwxyz";
|
|
2470
|
+
var DIGIT = "0123456789";
|
|
2471
|
+
var ALPHABET = {
|
|
2472
|
+
DIGIT,
|
|
2473
|
+
ALPHA,
|
|
2474
|
+
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
|
2475
|
+
};
|
|
2476
|
+
var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
2477
|
+
let str = "";
|
|
2478
|
+
const { length } = alphabet;
|
|
2479
|
+
const randomValues = new Uint32Array(size);
|
|
2480
|
+
import_crypto.default.randomFillSync(randomValues);
|
|
2481
|
+
for (let i = 0; i < size; i++) {
|
|
2482
|
+
str += alphabet[randomValues[i] % length];
|
|
2483
|
+
}
|
|
2484
|
+
return str;
|
|
2485
|
+
};
|
|
2211
2486
|
var node_default = {
|
|
2212
2487
|
isNode: true,
|
|
2213
2488
|
classes: {
|
|
@@ -2215,14 +2490,40 @@ var node_default = {
|
|
|
2215
2490
|
FormData: FormData_default,
|
|
2216
2491
|
Blob: typeof Blob !== "undefined" && Blob || null
|
|
2217
2492
|
},
|
|
2493
|
+
ALPHABET,
|
|
2494
|
+
generateString,
|
|
2218
2495
|
protocols: ["http", "https", "file", "data"]
|
|
2219
2496
|
};
|
|
2220
2497
|
|
|
2221
|
-
// node_modules
|
|
2498
|
+
// node_modules/axios/lib/platform/common/utils.js
|
|
2499
|
+
var utils_exports = {};
|
|
2500
|
+
__export(utils_exports, {
|
|
2501
|
+
hasBrowserEnv: () => hasBrowserEnv,
|
|
2502
|
+
hasStandardBrowserEnv: () => hasStandardBrowserEnv,
|
|
2503
|
+
hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv,
|
|
2504
|
+
navigator: () => _navigator,
|
|
2505
|
+
origin: () => origin
|
|
2506
|
+
});
|
|
2507
|
+
var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
|
|
2508
|
+
var _navigator = typeof navigator === "object" && navigator || void 0;
|
|
2509
|
+
var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
|
|
2510
|
+
var hasStandardBrowserWebWorkerEnv = (() => {
|
|
2511
|
+
return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
|
|
2512
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
2513
|
+
})();
|
|
2514
|
+
var origin = hasBrowserEnv && window.location.href || "http://localhost";
|
|
2515
|
+
|
|
2516
|
+
// node_modules/axios/lib/platform/index.js
|
|
2517
|
+
var platform_default = {
|
|
2518
|
+
...utils_exports,
|
|
2519
|
+
...node_default
|
|
2520
|
+
};
|
|
2521
|
+
|
|
2522
|
+
// node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
2222
2523
|
function toURLEncodedForm(data, options) {
|
|
2223
|
-
return toFormData_default(data, new
|
|
2224
|
-
visitor: function(value, key,
|
|
2225
|
-
if (
|
|
2524
|
+
return toFormData_default(data, new platform_default.classes.URLSearchParams(), Object.assign({
|
|
2525
|
+
visitor: function(value, key, path8, helpers) {
|
|
2526
|
+
if (platform_default.isNode && utils_default.isBuffer(value)) {
|
|
2226
2527
|
this.append(key, value.toString("base64"));
|
|
2227
2528
|
return false;
|
|
2228
2529
|
}
|
|
@@ -2231,7 +2532,7 @@ function toURLEncodedForm(data, options) {
|
|
|
2231
2532
|
}, options));
|
|
2232
2533
|
}
|
|
2233
2534
|
|
|
2234
|
-
// node_modules
|
|
2535
|
+
// node_modules/axios/lib/helpers/formDataToJSON.js
|
|
2235
2536
|
function parsePropPath(name) {
|
|
2236
2537
|
return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
2237
2538
|
return match[0] === "[]" ? "" : match[1] || match[0];
|
|
@@ -2250,10 +2551,11 @@ function arrayToObject(arr) {
|
|
|
2250
2551
|
return obj;
|
|
2251
2552
|
}
|
|
2252
2553
|
function formDataToJSON(formData) {
|
|
2253
|
-
function buildPath(
|
|
2254
|
-
let name =
|
|
2554
|
+
function buildPath(path8, value, target, index) {
|
|
2555
|
+
let name = path8[index++];
|
|
2556
|
+
if (name === "__proto__") return true;
|
|
2255
2557
|
const isNumericKey = Number.isFinite(+name);
|
|
2256
|
-
const isLast = index >=
|
|
2558
|
+
const isLast = index >= path8.length;
|
|
2257
2559
|
name = !name && utils_default.isArray(target) ? target.length : name;
|
|
2258
2560
|
if (isLast) {
|
|
2259
2561
|
if (utils_default.hasOwnProp(target, name)) {
|
|
@@ -2266,7 +2568,7 @@ function formDataToJSON(formData) {
|
|
|
2266
2568
|
if (!target[name] || !utils_default.isObject(target[name])) {
|
|
2267
2569
|
target[name] = [];
|
|
2268
2570
|
}
|
|
2269
|
-
const result = buildPath(
|
|
2571
|
+
const result = buildPath(path8, value, target[name], index);
|
|
2270
2572
|
if (result && utils_default.isArray(target[name])) {
|
|
2271
2573
|
target[name] = arrayToObject(target[name]);
|
|
2272
2574
|
}
|
|
@@ -2283,10 +2585,7 @@ function formDataToJSON(formData) {
|
|
|
2283
2585
|
}
|
|
2284
2586
|
var formDataToJSON_default = formDataToJSON;
|
|
2285
2587
|
|
|
2286
|
-
// node_modules
|
|
2287
|
-
var DEFAULT_CONTENT_TYPE = {
|
|
2288
|
-
"Content-Type": void 0
|
|
2289
|
-
};
|
|
2588
|
+
// node_modules/axios/lib/defaults/index.js
|
|
2290
2589
|
function stringifySafely(rawValue, parser, encoder) {
|
|
2291
2590
|
if (utils_default.isString(rawValue)) {
|
|
2292
2591
|
try {
|
|
@@ -2302,7 +2601,7 @@ function stringifySafely(rawValue, parser, encoder) {
|
|
|
2302
2601
|
}
|
|
2303
2602
|
var defaults = {
|
|
2304
2603
|
transitional: transitional_default,
|
|
2305
|
-
adapter: ["xhr", "http"],
|
|
2604
|
+
adapter: ["xhr", "http", "fetch"],
|
|
2306
2605
|
transformRequest: [function transformRequest(data, headers) {
|
|
2307
2606
|
const contentType = headers.getContentType() || "";
|
|
2308
2607
|
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
@@ -2312,12 +2611,9 @@ var defaults = {
|
|
|
2312
2611
|
}
|
|
2313
2612
|
const isFormData2 = utils_default.isFormData(data);
|
|
2314
2613
|
if (isFormData2) {
|
|
2315
|
-
if (!hasJSONContentType) {
|
|
2316
|
-
return data;
|
|
2317
|
-
}
|
|
2318
2614
|
return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
|
|
2319
2615
|
}
|
|
2320
|
-
if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data)) {
|
|
2616
|
+
if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) {
|
|
2321
2617
|
return data;
|
|
2322
2618
|
}
|
|
2323
2619
|
if (utils_default.isArrayBufferView(data)) {
|
|
@@ -2351,6 +2647,9 @@ var defaults = {
|
|
|
2351
2647
|
const transitional2 = this.transitional || defaults.transitional;
|
|
2352
2648
|
const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
|
|
2353
2649
|
const JSONRequested = this.responseType === "json";
|
|
2650
|
+
if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) {
|
|
2651
|
+
return data;
|
|
2652
|
+
}
|
|
2354
2653
|
if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
|
2355
2654
|
const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
|
|
2356
2655
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
@@ -2377,27 +2676,25 @@ var defaults = {
|
|
|
2377
2676
|
maxContentLength: -1,
|
|
2378
2677
|
maxBodyLength: -1,
|
|
2379
2678
|
env: {
|
|
2380
|
-
FormData:
|
|
2381
|
-
Blob:
|
|
2679
|
+
FormData: platform_default.classes.FormData,
|
|
2680
|
+
Blob: platform_default.classes.Blob
|
|
2382
2681
|
},
|
|
2383
2682
|
validateStatus: function validateStatus(status) {
|
|
2384
2683
|
return status >= 200 && status < 300;
|
|
2385
2684
|
},
|
|
2386
2685
|
headers: {
|
|
2387
2686
|
common: {
|
|
2388
|
-
"Accept": "application/json, text/plain, */*"
|
|
2687
|
+
"Accept": "application/json, text/plain, */*",
|
|
2688
|
+
"Content-Type": void 0
|
|
2389
2689
|
}
|
|
2390
2690
|
}
|
|
2391
2691
|
};
|
|
2392
|
-
utils_default.forEach(["delete", "get", "head"],
|
|
2692
|
+
utils_default.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
|
|
2393
2693
|
defaults.headers[method] = {};
|
|
2394
2694
|
});
|
|
2395
|
-
utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
2396
|
-
defaults.headers[method] = utils_default.merge(DEFAULT_CONTENT_TYPE);
|
|
2397
|
-
});
|
|
2398
2695
|
var defaults_default = defaults;
|
|
2399
2696
|
|
|
2400
|
-
// node_modules
|
|
2697
|
+
// node_modules/axios/lib/helpers/parseHeaders.js
|
|
2401
2698
|
var ignoreDuplicateOf = utils_default.toObjectSet([
|
|
2402
2699
|
"age",
|
|
2403
2700
|
"authorization",
|
|
@@ -2442,7 +2739,7 @@ var parseHeaders_default = (rawHeaders) => {
|
|
|
2442
2739
|
return parsed;
|
|
2443
2740
|
};
|
|
2444
2741
|
|
|
2445
|
-
// node_modules
|
|
2742
|
+
// node_modules/axios/lib/core/AxiosHeaders.js
|
|
2446
2743
|
var $internals = Symbol("internals");
|
|
2447
2744
|
function normalizeHeader(header) {
|
|
2448
2745
|
return header && String(header).trim().toLowerCase();
|
|
@@ -2462,13 +2759,14 @@ function parseTokens(str) {
|
|
|
2462
2759
|
}
|
|
2463
2760
|
return tokens;
|
|
2464
2761
|
}
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
}
|
|
2468
|
-
function matchHeaderValue(context, value, header, filter2) {
|
|
2762
|
+
var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
2763
|
+
function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
|
|
2469
2764
|
if (utils_default.isFunction(filter2)) {
|
|
2470
2765
|
return filter2.call(this, value, header);
|
|
2471
2766
|
}
|
|
2767
|
+
if (isHeaderNameFilter) {
|
|
2768
|
+
value = header;
|
|
2769
|
+
}
|
|
2472
2770
|
if (!utils_default.isString(value)) return;
|
|
2473
2771
|
if (utils_default.isString(filter2)) {
|
|
2474
2772
|
return value.indexOf(filter2) !== -1;
|
|
@@ -2514,6 +2812,15 @@ var AxiosHeaders = class {
|
|
|
2514
2812
|
setHeaders(header, valueOrRewrite);
|
|
2515
2813
|
} else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
2516
2814
|
setHeaders(parseHeaders_default(header), valueOrRewrite);
|
|
2815
|
+
} else if (utils_default.isObject(header) && utils_default.isIterable(header)) {
|
|
2816
|
+
let obj = {}, dest, key;
|
|
2817
|
+
for (const entry of header) {
|
|
2818
|
+
if (!utils_default.isArray(entry)) {
|
|
2819
|
+
throw TypeError("Object iterator must return a key-value pair");
|
|
2820
|
+
}
|
|
2821
|
+
obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
|
|
2822
|
+
}
|
|
2823
|
+
setHeaders(obj, valueOrRewrite);
|
|
2517
2824
|
} else {
|
|
2518
2825
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
2519
2826
|
}
|
|
@@ -2575,7 +2882,7 @@ var AxiosHeaders = class {
|
|
|
2575
2882
|
let deleted = false;
|
|
2576
2883
|
while (i--) {
|
|
2577
2884
|
const key = keys[i];
|
|
2578
|
-
if (!matcher || matchHeaderValue(this, this[key], key, matcher)) {
|
|
2885
|
+
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
2579
2886
|
delete this[key];
|
|
2580
2887
|
deleted = true;
|
|
2581
2888
|
}
|
|
@@ -2617,6 +2924,9 @@ var AxiosHeaders = class {
|
|
|
2617
2924
|
toString() {
|
|
2618
2925
|
return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
|
|
2619
2926
|
}
|
|
2927
|
+
getSetCookie() {
|
|
2928
|
+
return this.get("set-cookie") || [];
|
|
2929
|
+
}
|
|
2620
2930
|
get [Symbol.toStringTag]() {
|
|
2621
2931
|
return "AxiosHeaders";
|
|
2622
2932
|
}
|
|
@@ -2646,11 +2956,19 @@ var AxiosHeaders = class {
|
|
|
2646
2956
|
}
|
|
2647
2957
|
};
|
|
2648
2958
|
AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
2649
|
-
utils_default.
|
|
2959
|
+
utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
|
|
2960
|
+
let mapped = key[0].toUpperCase() + key.slice(1);
|
|
2961
|
+
return {
|
|
2962
|
+
get: () => value,
|
|
2963
|
+
set(headerValue) {
|
|
2964
|
+
this[mapped] = headerValue;
|
|
2965
|
+
}
|
|
2966
|
+
};
|
|
2967
|
+
});
|
|
2650
2968
|
utils_default.freezeMethods(AxiosHeaders);
|
|
2651
2969
|
var AxiosHeaders_default = AxiosHeaders;
|
|
2652
2970
|
|
|
2653
|
-
// node_modules
|
|
2971
|
+
// node_modules/axios/lib/core/transformData.js
|
|
2654
2972
|
function transformData(fns, response) {
|
|
2655
2973
|
const config = this || defaults_default;
|
|
2656
2974
|
const context = response || config;
|
|
@@ -2663,12 +2981,12 @@ function transformData(fns, response) {
|
|
|
2663
2981
|
return data;
|
|
2664
2982
|
}
|
|
2665
2983
|
|
|
2666
|
-
// node_modules
|
|
2984
|
+
// node_modules/axios/lib/cancel/isCancel.js
|
|
2667
2985
|
function isCancel(value) {
|
|
2668
2986
|
return !!(value && value.__CANCEL__);
|
|
2669
2987
|
}
|
|
2670
2988
|
|
|
2671
|
-
// node_modules
|
|
2989
|
+
// node_modules/axios/lib/cancel/CanceledError.js
|
|
2672
2990
|
function CanceledError(message, config, request) {
|
|
2673
2991
|
AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
|
|
2674
2992
|
this.name = "CanceledError";
|
|
@@ -2678,7 +2996,7 @@ utils_default.inherits(CanceledError, AxiosError_default, {
|
|
|
2678
2996
|
});
|
|
2679
2997
|
var CanceledError_default = CanceledError;
|
|
2680
2998
|
|
|
2681
|
-
// node_modules
|
|
2999
|
+
// node_modules/axios/lib/core/settle.js
|
|
2682
3000
|
function settle(resolve, reject, response) {
|
|
2683
3001
|
const validateStatus2 = response.config.validateStatus;
|
|
2684
3002
|
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
@@ -2694,25 +3012,26 @@ function settle(resolve, reject, response) {
|
|
|
2694
3012
|
}
|
|
2695
3013
|
}
|
|
2696
3014
|
|
|
2697
|
-
// node_modules
|
|
3015
|
+
// node_modules/axios/lib/helpers/isAbsoluteURL.js
|
|
2698
3016
|
function isAbsoluteURL(url2) {
|
|
2699
3017
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2);
|
|
2700
3018
|
}
|
|
2701
3019
|
|
|
2702
|
-
// node_modules
|
|
3020
|
+
// node_modules/axios/lib/helpers/combineURLs.js
|
|
2703
3021
|
function combineURLs(baseURL, relativeURL) {
|
|
2704
|
-
return relativeURL ? baseURL.replace(
|
|
3022
|
+
return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
2705
3023
|
}
|
|
2706
3024
|
|
|
2707
|
-
// node_modules
|
|
2708
|
-
function buildFullPath(baseURL, requestedURL) {
|
|
2709
|
-
|
|
3025
|
+
// node_modules/axios/lib/core/buildFullPath.js
|
|
3026
|
+
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
3027
|
+
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
3028
|
+
if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
|
|
2710
3029
|
return combineURLs(baseURL, requestedURL);
|
|
2711
3030
|
}
|
|
2712
3031
|
return requestedURL;
|
|
2713
3032
|
}
|
|
2714
3033
|
|
|
2715
|
-
// node_modules
|
|
3034
|
+
// node_modules/axios/lib/adapters/http.js
|
|
2716
3035
|
var import_proxy_from_env = __toESM(require_proxy_from_env(), 1);
|
|
2717
3036
|
var import_http = __toESM(require("http"), 1);
|
|
2718
3037
|
var import_https = __toESM(require("https"), 1);
|
|
@@ -2720,19 +3039,19 @@ var import_util2 = __toESM(require("util"), 1);
|
|
|
2720
3039
|
var import_follow_redirects = __toESM(require_follow_redirects(), 1);
|
|
2721
3040
|
var import_zlib = __toESM(require("zlib"), 1);
|
|
2722
3041
|
|
|
2723
|
-
// node_modules
|
|
2724
|
-
var VERSION = "1.
|
|
3042
|
+
// node_modules/axios/lib/env/data.js
|
|
3043
|
+
var VERSION = "1.9.0";
|
|
2725
3044
|
|
|
2726
|
-
// node_modules
|
|
3045
|
+
// node_modules/axios/lib/helpers/parseProtocol.js
|
|
2727
3046
|
function parseProtocol(url2) {
|
|
2728
3047
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2);
|
|
2729
3048
|
return match && match[1] || "";
|
|
2730
3049
|
}
|
|
2731
3050
|
|
|
2732
|
-
// node_modules
|
|
3051
|
+
// node_modules/axios/lib/helpers/fromDataURI.js
|
|
2733
3052
|
var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
|
|
2734
3053
|
function fromDataURI(uri, asBlob, options) {
|
|
2735
|
-
const _Blob = options && options.Blob ||
|
|
3054
|
+
const _Blob = options && options.Blob || platform_default.classes.Blob;
|
|
2736
3055
|
const protocol = parseProtocol(uri);
|
|
2737
3056
|
if (asBlob === void 0 && _Blob) {
|
|
2738
3057
|
asBlob = true;
|
|
@@ -2758,75 +3077,11 @@ function fromDataURI(uri, asBlob, options) {
|
|
|
2758
3077
|
throw new AxiosError_default("Unsupported protocol " + protocol, AxiosError_default.ERR_NOT_SUPPORT);
|
|
2759
3078
|
}
|
|
2760
3079
|
|
|
2761
|
-
// node_modules
|
|
3080
|
+
// node_modules/axios/lib/adapters/http.js
|
|
2762
3081
|
var import_stream4 = __toESM(require("stream"), 1);
|
|
2763
3082
|
|
|
2764
|
-
// node_modules
|
|
3083
|
+
// node_modules/axios/lib/helpers/AxiosTransformStream.js
|
|
2765
3084
|
var import_stream = __toESM(require("stream"), 1);
|
|
2766
|
-
|
|
2767
|
-
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/throttle.js
|
|
2768
|
-
function throttle(fn, freq) {
|
|
2769
|
-
let timestamp = 0;
|
|
2770
|
-
const threshold = 1e3 / freq;
|
|
2771
|
-
let timer = null;
|
|
2772
|
-
return function throttled(force, args) {
|
|
2773
|
-
const now = Date.now();
|
|
2774
|
-
if (force || now - timestamp > threshold) {
|
|
2775
|
-
if (timer) {
|
|
2776
|
-
clearTimeout(timer);
|
|
2777
|
-
timer = null;
|
|
2778
|
-
}
|
|
2779
|
-
timestamp = now;
|
|
2780
|
-
return fn.apply(null, args);
|
|
2781
|
-
}
|
|
2782
|
-
if (!timer) {
|
|
2783
|
-
timer = setTimeout(() => {
|
|
2784
|
-
timer = null;
|
|
2785
|
-
timestamp = Date.now();
|
|
2786
|
-
return fn.apply(null, args);
|
|
2787
|
-
}, threshold - (now - timestamp));
|
|
2788
|
-
}
|
|
2789
|
-
};
|
|
2790
|
-
}
|
|
2791
|
-
var throttle_default = throttle;
|
|
2792
|
-
|
|
2793
|
-
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/speedometer.js
|
|
2794
|
-
function speedometer(samplesCount, min) {
|
|
2795
|
-
samplesCount = samplesCount || 10;
|
|
2796
|
-
const bytes = new Array(samplesCount);
|
|
2797
|
-
const timestamps = new Array(samplesCount);
|
|
2798
|
-
let head = 0;
|
|
2799
|
-
let tail = 0;
|
|
2800
|
-
let firstSampleTS;
|
|
2801
|
-
min = min !== void 0 ? min : 1e3;
|
|
2802
|
-
return function push(chunkLength) {
|
|
2803
|
-
const now = Date.now();
|
|
2804
|
-
const startedAt = timestamps[tail];
|
|
2805
|
-
if (!firstSampleTS) {
|
|
2806
|
-
firstSampleTS = now;
|
|
2807
|
-
}
|
|
2808
|
-
bytes[head] = chunkLength;
|
|
2809
|
-
timestamps[head] = now;
|
|
2810
|
-
let i = tail;
|
|
2811
|
-
let bytesCount = 0;
|
|
2812
|
-
while (i !== head) {
|
|
2813
|
-
bytesCount += bytes[i++];
|
|
2814
|
-
i = i % samplesCount;
|
|
2815
|
-
}
|
|
2816
|
-
head = (head + 1) % samplesCount;
|
|
2817
|
-
if (head === tail) {
|
|
2818
|
-
tail = (tail + 1) % samplesCount;
|
|
2819
|
-
}
|
|
2820
|
-
if (now - firstSampleTS < min) {
|
|
2821
|
-
return;
|
|
2822
|
-
}
|
|
2823
|
-
const passed = startedAt && now - startedAt;
|
|
2824
|
-
return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
|
|
2825
|
-
};
|
|
2826
|
-
}
|
|
2827
|
-
var speedometer_default = speedometer;
|
|
2828
|
-
|
|
2829
|
-
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/AxiosTransformStream.js
|
|
2830
3085
|
var kInternals = Symbol("internals");
|
|
2831
3086
|
var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
2832
3087
|
constructor(options) {
|
|
@@ -2843,11 +3098,8 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
|
2843
3098
|
super({
|
|
2844
3099
|
readableHighWaterMark: options.chunkSize
|
|
2845
3100
|
});
|
|
2846
|
-
const self2 = this;
|
|
2847
3101
|
const internals = this[kInternals] = {
|
|
2848
|
-
length: options.length,
|
|
2849
3102
|
timeWindow: options.timeWindow,
|
|
2850
|
-
ticksRate: options.ticksRate,
|
|
2851
3103
|
chunkSize: options.chunkSize,
|
|
2852
3104
|
maxRate: options.maxRate,
|
|
2853
3105
|
minChunkSize: options.minChunkSize,
|
|
@@ -2858,7 +3110,6 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
|
2858
3110
|
bytes: 0,
|
|
2859
3111
|
onReadCallback: null
|
|
2860
3112
|
};
|
|
2861
|
-
const _speedometer = speedometer_default(internals.ticksRate * options.samplesCount, internals.timeWindow);
|
|
2862
3113
|
this.on("newListener", (event) => {
|
|
2863
3114
|
if (event === "progress") {
|
|
2864
3115
|
if (!internals.isCaptured) {
|
|
@@ -2866,30 +3117,6 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
|
2866
3117
|
}
|
|
2867
3118
|
}
|
|
2868
3119
|
});
|
|
2869
|
-
let bytesNotified = 0;
|
|
2870
|
-
internals.updateProgress = throttle_default(function throttledHandler() {
|
|
2871
|
-
const totalBytes = internals.length;
|
|
2872
|
-
const bytesTransferred = internals.bytesSeen;
|
|
2873
|
-
const progressBytes = bytesTransferred - bytesNotified;
|
|
2874
|
-
if (!progressBytes || self2.destroyed) return;
|
|
2875
|
-
const rate = _speedometer(progressBytes);
|
|
2876
|
-
bytesNotified = bytesTransferred;
|
|
2877
|
-
process.nextTick(() => {
|
|
2878
|
-
self2.emit("progress", {
|
|
2879
|
-
"loaded": bytesTransferred,
|
|
2880
|
-
"total": totalBytes,
|
|
2881
|
-
"progress": totalBytes ? bytesTransferred / totalBytes : void 0,
|
|
2882
|
-
"bytes": progressBytes,
|
|
2883
|
-
"rate": rate ? rate : void 0,
|
|
2884
|
-
"estimated": rate && totalBytes && bytesTransferred <= totalBytes ? (totalBytes - bytesTransferred) / rate : void 0
|
|
2885
|
-
});
|
|
2886
|
-
});
|
|
2887
|
-
}, internals.ticksRate);
|
|
2888
|
-
const onFinish = () => {
|
|
2889
|
-
internals.updateProgress(true);
|
|
2890
|
-
};
|
|
2891
|
-
this.once("end", onFinish);
|
|
2892
|
-
this.once("error", onFinish);
|
|
2893
3120
|
}
|
|
2894
3121
|
_read(size) {
|
|
2895
3122
|
const internals = this[kInternals];
|
|
@@ -2899,7 +3126,6 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
|
2899
3126
|
return super._read(size);
|
|
2900
3127
|
}
|
|
2901
3128
|
_transform(chunk, encoding, callback) {
|
|
2902
|
-
const self2 = this;
|
|
2903
3129
|
const internals = this[kInternals];
|
|
2904
3130
|
const maxRate = internals.maxRate;
|
|
2905
3131
|
const readableHighWaterMark = this.readableHighWaterMark;
|
|
@@ -2907,14 +3133,12 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
|
2907
3133
|
const divider = 1e3 / timeWindow;
|
|
2908
3134
|
const bytesThreshold = maxRate / divider;
|
|
2909
3135
|
const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
|
|
2910
|
-
|
|
3136
|
+
const pushChunk = (_chunk, _callback) => {
|
|
2911
3137
|
const bytes = Buffer.byteLength(_chunk);
|
|
2912
3138
|
internals.bytesSeen += bytes;
|
|
2913
3139
|
internals.bytes += bytes;
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
}
|
|
2917
|
-
if (self2.push(_chunk)) {
|
|
3140
|
+
internals.isCaptured && this.emit("progress", internals.bytesSeen);
|
|
3141
|
+
if (this.push(_chunk)) {
|
|
2918
3142
|
process.nextTick(_callback);
|
|
2919
3143
|
} else {
|
|
2920
3144
|
internals.onReadCallback = () => {
|
|
@@ -2922,7 +3146,7 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
|
2922
3146
|
process.nextTick(_callback);
|
|
2923
3147
|
};
|
|
2924
3148
|
}
|
|
2925
|
-
}
|
|
3149
|
+
};
|
|
2926
3150
|
const transformChunk = (_chunk, _callback) => {
|
|
2927
3151
|
const chunkSize = Buffer.byteLength(_chunk);
|
|
2928
3152
|
let chunkRemainder = null;
|
|
@@ -2968,21 +3192,17 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
|
2968
3192
|
}
|
|
2969
3193
|
});
|
|
2970
3194
|
}
|
|
2971
|
-
setLength(length) {
|
|
2972
|
-
this[kInternals].length = +length;
|
|
2973
|
-
return this;
|
|
2974
|
-
}
|
|
2975
3195
|
};
|
|
2976
3196
|
var AxiosTransformStream_default = AxiosTransformStream;
|
|
2977
3197
|
|
|
2978
|
-
// node_modules
|
|
2979
|
-
var import_events =
|
|
3198
|
+
// node_modules/axios/lib/adapters/http.js
|
|
3199
|
+
var import_events = require("events");
|
|
2980
3200
|
|
|
2981
|
-
// node_modules
|
|
2982
|
-
var import_util = require("util");
|
|
3201
|
+
// node_modules/axios/lib/helpers/formDataToStream.js
|
|
3202
|
+
var import_util = __toESM(require("util"), 1);
|
|
2983
3203
|
var import_stream2 = require("stream");
|
|
2984
3204
|
|
|
2985
|
-
// node_modules
|
|
3205
|
+
// node_modules/axios/lib/helpers/readBlob.js
|
|
2986
3206
|
var { asyncIterator } = Symbol;
|
|
2987
3207
|
var readBlob = async function* (blob) {
|
|
2988
3208
|
if (blob.stream) {
|
|
@@ -2997,9 +3217,9 @@ var readBlob = async function* (blob) {
|
|
|
2997
3217
|
};
|
|
2998
3218
|
var readBlob_default = readBlob;
|
|
2999
3219
|
|
|
3000
|
-
// node_modules
|
|
3001
|
-
var BOUNDARY_ALPHABET =
|
|
3002
|
-
var textEncoder = new import_util.TextEncoder();
|
|
3220
|
+
// node_modules/axios/lib/helpers/formDataToStream.js
|
|
3221
|
+
var BOUNDARY_ALPHABET = platform_default.ALPHABET.ALPHA_DIGIT + "-_";
|
|
3222
|
+
var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new import_util.default.TextEncoder();
|
|
3003
3223
|
var CRLF = "\r\n";
|
|
3004
3224
|
var CRLF_BYTES = textEncoder.encode(CRLF);
|
|
3005
3225
|
var CRLF_BYTES_COUNT = 2;
|
|
@@ -3041,7 +3261,7 @@ var formDataToStream = (form, headersHandler, options) => {
|
|
|
3041
3261
|
const {
|
|
3042
3262
|
tag = "form-data-boundary",
|
|
3043
3263
|
size = 25,
|
|
3044
|
-
boundary = tag + "-" +
|
|
3264
|
+
boundary = tag + "-" + platform_default.generateString(size, BOUNDARY_ALPHABET)
|
|
3045
3265
|
} = options || {};
|
|
3046
3266
|
if (!utils_default.isFormData(form)) {
|
|
3047
3267
|
throw TypeError("FormData instance required");
|
|
@@ -3050,7 +3270,7 @@ var formDataToStream = (form, headersHandler, options) => {
|
|
|
3050
3270
|
throw Error("boundary must be 10-70 characters long");
|
|
3051
3271
|
}
|
|
3052
3272
|
const boundaryBytes = textEncoder.encode("--" + boundary + CRLF);
|
|
3053
|
-
const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF
|
|
3273
|
+
const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF);
|
|
3054
3274
|
let contentLength = footerBytes.byteLength;
|
|
3055
3275
|
const parts = Array.from(form.entries()).map(([name, value]) => {
|
|
3056
3276
|
const part = new FormDataPart(name, value);
|
|
@@ -3076,7 +3296,7 @@ var formDataToStream = (form, headersHandler, options) => {
|
|
|
3076
3296
|
};
|
|
3077
3297
|
var formDataToStream_default = formDataToStream;
|
|
3078
3298
|
|
|
3079
|
-
// node_modules
|
|
3299
|
+
// node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
|
|
3080
3300
|
var import_stream3 = __toESM(require("stream"), 1);
|
|
3081
3301
|
var ZlibHeaderTransformStream = class extends import_stream3.default.Transform {
|
|
3082
3302
|
__transform(chunk, encoding, callback) {
|
|
@@ -3098,56 +3318,181 @@ var ZlibHeaderTransformStream = class extends import_stream3.default.Transform {
|
|
|
3098
3318
|
};
|
|
3099
3319
|
var ZlibHeaderTransformStream_default = ZlibHeaderTransformStream;
|
|
3100
3320
|
|
|
3101
|
-
// node_modules
|
|
3102
|
-
var
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3321
|
+
// node_modules/axios/lib/helpers/callbackify.js
|
|
3322
|
+
var callbackify = (fn, reducer) => {
|
|
3323
|
+
return utils_default.isAsyncFn(fn) ? function(...args) {
|
|
3324
|
+
const cb = args.pop();
|
|
3325
|
+
fn.apply(this, args).then((value) => {
|
|
3326
|
+
try {
|
|
3327
|
+
reducer ? cb(null, ...reducer(value)) : cb(null, value);
|
|
3328
|
+
} catch (err) {
|
|
3329
|
+
cb(err);
|
|
3330
|
+
}
|
|
3331
|
+
}, cb);
|
|
3332
|
+
} : fn;
|
|
3109
3333
|
};
|
|
3110
|
-
var
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
if (!proxy && proxy !== false) {
|
|
3127
|
-
const proxyUrl = (0, import_proxy_from_env.getProxyForUrl)(location);
|
|
3128
|
-
if (proxyUrl) {
|
|
3129
|
-
proxy = new URL(proxyUrl);
|
|
3334
|
+
var callbackify_default = callbackify;
|
|
3335
|
+
|
|
3336
|
+
// node_modules/axios/lib/helpers/speedometer.js
|
|
3337
|
+
function speedometer(samplesCount, min) {
|
|
3338
|
+
samplesCount = samplesCount || 10;
|
|
3339
|
+
const bytes = new Array(samplesCount);
|
|
3340
|
+
const timestamps = new Array(samplesCount);
|
|
3341
|
+
let head = 0;
|
|
3342
|
+
let tail = 0;
|
|
3343
|
+
let firstSampleTS;
|
|
3344
|
+
min = min !== void 0 ? min : 1e3;
|
|
3345
|
+
return function push(chunkLength) {
|
|
3346
|
+
const now = Date.now();
|
|
3347
|
+
const startedAt = timestamps[tail];
|
|
3348
|
+
if (!firstSampleTS) {
|
|
3349
|
+
firstSampleTS = now;
|
|
3130
3350
|
}
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3351
|
+
bytes[head] = chunkLength;
|
|
3352
|
+
timestamps[head] = now;
|
|
3353
|
+
let i = tail;
|
|
3354
|
+
let bytesCount = 0;
|
|
3355
|
+
while (i !== head) {
|
|
3356
|
+
bytesCount += bytes[i++];
|
|
3357
|
+
i = i % samplesCount;
|
|
3135
3358
|
}
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
}
|
|
3140
|
-
const base64 = Buffer.from(proxy.auth, "utf8").toString("base64");
|
|
3141
|
-
options.headers["Proxy-Authorization"] = "Basic " + base64;
|
|
3359
|
+
head = (head + 1) % samplesCount;
|
|
3360
|
+
if (head === tail) {
|
|
3361
|
+
tail = (tail + 1) % samplesCount;
|
|
3142
3362
|
}
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3363
|
+
if (now - firstSampleTS < min) {
|
|
3364
|
+
return;
|
|
3365
|
+
}
|
|
3366
|
+
const passed = startedAt && now - startedAt;
|
|
3367
|
+
return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
|
|
3368
|
+
};
|
|
3369
|
+
}
|
|
3370
|
+
var speedometer_default = speedometer;
|
|
3371
|
+
|
|
3372
|
+
// node_modules/axios/lib/helpers/throttle.js
|
|
3373
|
+
function throttle(fn, freq) {
|
|
3374
|
+
let timestamp = 0;
|
|
3375
|
+
let threshold = 1e3 / freq;
|
|
3376
|
+
let lastArgs;
|
|
3377
|
+
let timer;
|
|
3378
|
+
const invoke = (args, now = Date.now()) => {
|
|
3379
|
+
timestamp = now;
|
|
3380
|
+
lastArgs = null;
|
|
3381
|
+
if (timer) {
|
|
3382
|
+
clearTimeout(timer);
|
|
3383
|
+
timer = null;
|
|
3384
|
+
}
|
|
3385
|
+
fn.apply(null, args);
|
|
3386
|
+
};
|
|
3387
|
+
const throttled = (...args) => {
|
|
3388
|
+
const now = Date.now();
|
|
3389
|
+
const passed = now - timestamp;
|
|
3390
|
+
if (passed >= threshold) {
|
|
3391
|
+
invoke(args, now);
|
|
3392
|
+
} else {
|
|
3393
|
+
lastArgs = args;
|
|
3394
|
+
if (!timer) {
|
|
3395
|
+
timer = setTimeout(() => {
|
|
3396
|
+
timer = null;
|
|
3397
|
+
invoke(lastArgs);
|
|
3398
|
+
}, threshold - passed);
|
|
3399
|
+
}
|
|
3400
|
+
}
|
|
3401
|
+
};
|
|
3402
|
+
const flush = () => lastArgs && invoke(lastArgs);
|
|
3403
|
+
return [throttled, flush];
|
|
3404
|
+
}
|
|
3405
|
+
var throttle_default = throttle;
|
|
3406
|
+
|
|
3407
|
+
// node_modules/axios/lib/helpers/progressEventReducer.js
|
|
3408
|
+
var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
3409
|
+
let bytesNotified = 0;
|
|
3410
|
+
const _speedometer = speedometer_default(50, 250);
|
|
3411
|
+
return throttle_default((e) => {
|
|
3412
|
+
const loaded = e.loaded;
|
|
3413
|
+
const total = e.lengthComputable ? e.total : void 0;
|
|
3414
|
+
const progressBytes = loaded - bytesNotified;
|
|
3415
|
+
const rate = _speedometer(progressBytes);
|
|
3416
|
+
const inRange = loaded <= total;
|
|
3417
|
+
bytesNotified = loaded;
|
|
3418
|
+
const data = {
|
|
3419
|
+
loaded,
|
|
3420
|
+
total,
|
|
3421
|
+
progress: total ? loaded / total : void 0,
|
|
3422
|
+
bytes: progressBytes,
|
|
3423
|
+
rate: rate ? rate : void 0,
|
|
3424
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
|
|
3425
|
+
event: e,
|
|
3426
|
+
lengthComputable: total != null,
|
|
3427
|
+
[isDownloadStream ? "download" : "upload"]: true
|
|
3428
|
+
};
|
|
3429
|
+
listener(data);
|
|
3430
|
+
}, freq);
|
|
3431
|
+
};
|
|
3432
|
+
var progressEventDecorator = (total, throttled) => {
|
|
3433
|
+
const lengthComputable = total != null;
|
|
3434
|
+
return [(loaded) => throttled[0]({
|
|
3435
|
+
lengthComputable,
|
|
3436
|
+
total,
|
|
3437
|
+
loaded
|
|
3438
|
+
}), throttled[1]];
|
|
3439
|
+
};
|
|
3440
|
+
var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
|
|
3441
|
+
|
|
3442
|
+
// node_modules/axios/lib/adapters/http.js
|
|
3443
|
+
var zlibOptions = {
|
|
3444
|
+
flush: import_zlib.default.constants.Z_SYNC_FLUSH,
|
|
3445
|
+
finishFlush: import_zlib.default.constants.Z_SYNC_FLUSH
|
|
3446
|
+
};
|
|
3447
|
+
var brotliOptions = {
|
|
3448
|
+
flush: import_zlib.default.constants.BROTLI_OPERATION_FLUSH,
|
|
3449
|
+
finishFlush: import_zlib.default.constants.BROTLI_OPERATION_FLUSH
|
|
3450
|
+
};
|
|
3451
|
+
var isBrotliSupported = utils_default.isFunction(import_zlib.default.createBrotliDecompress);
|
|
3452
|
+
var { http: httpFollow, https: httpsFollow } = import_follow_redirects.default;
|
|
3453
|
+
var isHttps = /https:?/;
|
|
3454
|
+
var supportedProtocols = platform_default.protocols.map((protocol) => {
|
|
3455
|
+
return protocol + ":";
|
|
3456
|
+
});
|
|
3457
|
+
var flushOnFinish = (stream4, [throttled, flush]) => {
|
|
3458
|
+
stream4.on("end", flush).on("error", flush);
|
|
3459
|
+
return throttled;
|
|
3460
|
+
};
|
|
3461
|
+
function dispatchBeforeRedirect(options, responseDetails) {
|
|
3462
|
+
if (options.beforeRedirects.proxy) {
|
|
3463
|
+
options.beforeRedirects.proxy(options);
|
|
3464
|
+
}
|
|
3465
|
+
if (options.beforeRedirects.config) {
|
|
3466
|
+
options.beforeRedirects.config(options, responseDetails);
|
|
3467
|
+
}
|
|
3468
|
+
}
|
|
3469
|
+
function setProxy(options, configProxy, location) {
|
|
3470
|
+
let proxy = configProxy;
|
|
3471
|
+
if (!proxy && proxy !== false) {
|
|
3472
|
+
const proxyUrl = import_proxy_from_env.default.getProxyForUrl(location);
|
|
3473
|
+
if (proxyUrl) {
|
|
3474
|
+
proxy = new URL(proxyUrl);
|
|
3475
|
+
}
|
|
3476
|
+
}
|
|
3477
|
+
if (proxy) {
|
|
3478
|
+
if (proxy.username) {
|
|
3479
|
+
proxy.auth = (proxy.username || "") + ":" + (proxy.password || "");
|
|
3480
|
+
}
|
|
3481
|
+
if (proxy.auth) {
|
|
3482
|
+
if (proxy.auth.username || proxy.auth.password) {
|
|
3483
|
+
proxy.auth = (proxy.auth.username || "") + ":" + (proxy.auth.password || "");
|
|
3484
|
+
}
|
|
3485
|
+
const base64 = Buffer.from(proxy.auth, "utf8").toString("base64");
|
|
3486
|
+
options.headers["Proxy-Authorization"] = "Basic " + base64;
|
|
3487
|
+
}
|
|
3488
|
+
options.headers.host = options.hostname + (options.port ? ":" + options.port : "");
|
|
3489
|
+
const proxyHost = proxy.hostname || proxy.host;
|
|
3490
|
+
options.hostname = proxyHost;
|
|
3491
|
+
options.host = proxyHost;
|
|
3492
|
+
options.port = proxy.port;
|
|
3493
|
+
options.path = location;
|
|
3494
|
+
if (proxy.protocol) {
|
|
3495
|
+
options.protocol = proxy.protocol.includes(":") ? proxy.protocol : `${proxy.protocol}:`;
|
|
3151
3496
|
}
|
|
3152
3497
|
}
|
|
3153
3498
|
options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
|
|
@@ -3155,20 +3500,58 @@ function setProxy(options, configProxy, location) {
|
|
|
3155
3500
|
};
|
|
3156
3501
|
}
|
|
3157
3502
|
var isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process";
|
|
3503
|
+
var wrapAsync = (asyncExecutor) => {
|
|
3504
|
+
return new Promise((resolve, reject) => {
|
|
3505
|
+
let onDone;
|
|
3506
|
+
let isDone;
|
|
3507
|
+
const done = (value, isRejected) => {
|
|
3508
|
+
if (isDone) return;
|
|
3509
|
+
isDone = true;
|
|
3510
|
+
onDone && onDone(value, isRejected);
|
|
3511
|
+
};
|
|
3512
|
+
const _resolve = (value) => {
|
|
3513
|
+
done(value);
|
|
3514
|
+
resolve(value);
|
|
3515
|
+
};
|
|
3516
|
+
const _reject = (reason) => {
|
|
3517
|
+
done(reason, true);
|
|
3518
|
+
reject(reason);
|
|
3519
|
+
};
|
|
3520
|
+
asyncExecutor(_resolve, _reject, (onDoneHandler) => onDone = onDoneHandler).catch(_reject);
|
|
3521
|
+
});
|
|
3522
|
+
};
|
|
3523
|
+
var resolveFamily = ({ address, family }) => {
|
|
3524
|
+
if (!utils_default.isString(address)) {
|
|
3525
|
+
throw TypeError("address must be a string");
|
|
3526
|
+
}
|
|
3527
|
+
return {
|
|
3528
|
+
address,
|
|
3529
|
+
family: family || (address.indexOf(".") < 0 ? 6 : 4)
|
|
3530
|
+
};
|
|
3531
|
+
};
|
|
3532
|
+
var buildAddressEntry = (address, family) => resolveFamily(utils_default.isObject(address) ? address : { address, family });
|
|
3158
3533
|
var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
3159
|
-
return
|
|
3160
|
-
let data = config
|
|
3161
|
-
const responseType = config
|
|
3162
|
-
const responseEncoding = config.responseEncoding;
|
|
3534
|
+
return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
|
|
3535
|
+
let { data, lookup, family } = config;
|
|
3536
|
+
const { responseType, responseEncoding } = config;
|
|
3163
3537
|
const method = config.method.toUpperCase();
|
|
3164
|
-
let isFinished;
|
|
3165
3538
|
let isDone;
|
|
3166
3539
|
let rejected = false;
|
|
3167
3540
|
let req;
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3541
|
+
if (lookup) {
|
|
3542
|
+
const _lookup = callbackify_default(lookup, (value) => utils_default.isArray(value) ? value : [value]);
|
|
3543
|
+
lookup = (hostname, opt, cb) => {
|
|
3544
|
+
_lookup(hostname, opt, (err, arg0, arg1) => {
|
|
3545
|
+
if (err) {
|
|
3546
|
+
return cb(err);
|
|
3547
|
+
}
|
|
3548
|
+
const addresses = utils_default.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
|
|
3549
|
+
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
|
|
3550
|
+
});
|
|
3551
|
+
};
|
|
3552
|
+
}
|
|
3553
|
+
const emitter = new import_events.EventEmitter();
|
|
3554
|
+
const onFinished = () => {
|
|
3172
3555
|
if (config.cancelToken) {
|
|
3173
3556
|
config.cancelToken.unsubscribe(abort);
|
|
3174
3557
|
}
|
|
@@ -3176,22 +3559,14 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3176
3559
|
config.signal.removeEventListener("abort", abort);
|
|
3177
3560
|
}
|
|
3178
3561
|
emitter.removeAllListeners();
|
|
3179
|
-
}
|
|
3180
|
-
|
|
3181
|
-
if (isDone) return;
|
|
3562
|
+
};
|
|
3563
|
+
onDone((value, isRejected) => {
|
|
3182
3564
|
isDone = true;
|
|
3183
3565
|
if (isRejected) {
|
|
3184
3566
|
rejected = true;
|
|
3185
3567
|
onFinished();
|
|
3186
3568
|
}
|
|
3187
|
-
|
|
3188
|
-
}
|
|
3189
|
-
const resolve = function resolve2(value) {
|
|
3190
|
-
done(value);
|
|
3191
|
-
};
|
|
3192
|
-
const reject = function reject2(value) {
|
|
3193
|
-
done(value, true);
|
|
3194
|
-
};
|
|
3569
|
+
});
|
|
3195
3570
|
function abort(reason) {
|
|
3196
3571
|
emitter.emit("abort", !reason || reason.type ? new CanceledError_default(null, config, req) : reason);
|
|
3197
3572
|
}
|
|
@@ -3202,8 +3577,8 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3202
3577
|
config.signal.aborted ? abort() : config.signal.addEventListener("abort", abort);
|
|
3203
3578
|
}
|
|
3204
3579
|
}
|
|
3205
|
-
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
3206
|
-
const parsed = new URL(fullPath,
|
|
3580
|
+
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
|
3581
|
+
const parsed = new URL(fullPath, platform_default.hasBrowserEnv ? platform_default.origin : void 0);
|
|
3207
3582
|
const protocol = parsed.protocol || supportedProtocols[0];
|
|
3208
3583
|
if (protocol === "data:") {
|
|
3209
3584
|
let convertedData;
|
|
@@ -3247,8 +3622,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3247
3622
|
}
|
|
3248
3623
|
const headers = AxiosHeaders_default.from(config.headers).normalize();
|
|
3249
3624
|
headers.set("User-Agent", "axios/" + VERSION, false);
|
|
3250
|
-
const onDownloadProgress = config
|
|
3251
|
-
const onUploadProgress = config.onUploadProgress;
|
|
3625
|
+
const { onUploadProgress, onDownloadProgress } = config;
|
|
3252
3626
|
const maxRate = config.maxRate;
|
|
3253
3627
|
let maxUploadRate = void 0;
|
|
3254
3628
|
let maxDownloadRate = void 0;
|
|
@@ -3265,11 +3639,11 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3265
3639
|
if (!headers.hasContentLength()) {
|
|
3266
3640
|
try {
|
|
3267
3641
|
const knownLength = await import_util2.default.promisify(data.getLength).call(data);
|
|
3268
|
-
headers.setContentLength(knownLength);
|
|
3642
|
+
Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
|
|
3269
3643
|
} catch (e) {
|
|
3270
3644
|
}
|
|
3271
3645
|
}
|
|
3272
|
-
} else if (utils_default.isBlob(data)) {
|
|
3646
|
+
} else if (utils_default.isBlob(data) || utils_default.isFile(data)) {
|
|
3273
3647
|
data.size && headers.setContentType(data.type || "application/octet-stream");
|
|
3274
3648
|
headers.setContentLength(data.size || 0);
|
|
3275
3649
|
data = import_stream4.default.Readable.from(readBlob_default(data));
|
|
@@ -3307,14 +3681,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3307
3681
|
data = import_stream4.default.Readable.from(data, { objectMode: false });
|
|
3308
3682
|
}
|
|
3309
3683
|
data = import_stream4.default.pipeline([data, new AxiosTransformStream_default({
|
|
3310
|
-
length: contentLength,
|
|
3311
3684
|
maxRate: utils_default.toFiniteNumber(maxUploadRate)
|
|
3312
3685
|
})], utils_default.noop);
|
|
3313
|
-
onUploadProgress && data.on("progress", (
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3686
|
+
onUploadProgress && data.on("progress", flushOnFinish(
|
|
3687
|
+
data,
|
|
3688
|
+
progressEventDecorator(
|
|
3689
|
+
contentLength,
|
|
3690
|
+
progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
|
|
3691
|
+
)
|
|
3692
|
+
));
|
|
3318
3693
|
}
|
|
3319
3694
|
let auth = void 0;
|
|
3320
3695
|
if (config.auth) {
|
|
@@ -3328,9 +3703,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3328
3703
|
auth = urlUsername + ":" + urlPassword;
|
|
3329
3704
|
}
|
|
3330
3705
|
auth && headers.delete("authorization");
|
|
3331
|
-
let
|
|
3706
|
+
let path8;
|
|
3332
3707
|
try {
|
|
3333
|
-
|
|
3708
|
+
path8 = buildURL(
|
|
3334
3709
|
parsed.pathname + parsed.search,
|
|
3335
3710
|
config.params,
|
|
3336
3711
|
config.paramsSerializer
|
|
@@ -3348,19 +3723,21 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3348
3723
|
false
|
|
3349
3724
|
);
|
|
3350
3725
|
const options = {
|
|
3351
|
-
path:
|
|
3726
|
+
path: path8,
|
|
3352
3727
|
method,
|
|
3353
3728
|
headers: headers.toJSON(),
|
|
3354
3729
|
agents: { http: config.httpAgent, https: config.httpsAgent },
|
|
3355
3730
|
auth,
|
|
3356
3731
|
protocol,
|
|
3732
|
+
family,
|
|
3357
3733
|
beforeRedirect: dispatchBeforeRedirect,
|
|
3358
3734
|
beforeRedirects: {}
|
|
3359
3735
|
};
|
|
3736
|
+
!utils_default.isUndefined(lookup) && (options.lookup = lookup);
|
|
3360
3737
|
if (config.socketPath) {
|
|
3361
3738
|
options.socketPath = config.socketPath;
|
|
3362
3739
|
} else {
|
|
3363
|
-
options.hostname = parsed.hostname;
|
|
3740
|
+
options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
|
|
3364
3741
|
options.port = parsed.port;
|
|
3365
3742
|
setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
|
|
3366
3743
|
}
|
|
@@ -3392,16 +3769,17 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3392
3769
|
if (req.destroyed) return;
|
|
3393
3770
|
const streams = [res];
|
|
3394
3771
|
const responseLength = +res.headers["content-length"];
|
|
3395
|
-
if (onDownloadProgress) {
|
|
3772
|
+
if (onDownloadProgress || maxDownloadRate) {
|
|
3396
3773
|
const transformStream = new AxiosTransformStream_default({
|
|
3397
|
-
length: utils_default.toFiniteNumber(responseLength),
|
|
3398
3774
|
maxRate: utils_default.toFiniteNumber(maxDownloadRate)
|
|
3399
3775
|
});
|
|
3400
|
-
onDownloadProgress && transformStream.on("progress", (
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3776
|
+
onDownloadProgress && transformStream.on("progress", flushOnFinish(
|
|
3777
|
+
transformStream,
|
|
3778
|
+
progressEventDecorator(
|
|
3779
|
+
responseLength,
|
|
3780
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
|
|
3781
|
+
)
|
|
3782
|
+
));
|
|
3405
3783
|
streams.push(transformStream);
|
|
3406
3784
|
}
|
|
3407
3785
|
let responseStream = res;
|
|
@@ -3410,7 +3788,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3410
3788
|
if (method === "HEAD" || res.statusCode === 204) {
|
|
3411
3789
|
delete res.headers["content-encoding"];
|
|
3412
3790
|
}
|
|
3413
|
-
switch (res.headers["content-encoding"]) {
|
|
3791
|
+
switch ((res.headers["content-encoding"] || "").toLowerCase()) {
|
|
3414
3792
|
/*eslint default-case:0*/
|
|
3415
3793
|
case "gzip":
|
|
3416
3794
|
case "x-gzip":
|
|
@@ -3468,7 +3846,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3468
3846
|
return;
|
|
3469
3847
|
}
|
|
3470
3848
|
const err = new AxiosError_default(
|
|
3471
|
-
"
|
|
3849
|
+
"stream has been aborted",
|
|
3472
3850
|
AxiosError_default.ERR_BAD_RESPONSE,
|
|
3473
3851
|
config,
|
|
3474
3852
|
lastRequest
|
|
@@ -3491,7 +3869,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3491
3869
|
}
|
|
3492
3870
|
response.data = responseData;
|
|
3493
3871
|
} catch (err) {
|
|
3494
|
-
reject(AxiosError_default.from(err, null, config, response.request, response));
|
|
3872
|
+
return reject(AxiosError_default.from(err, null, config, response.request, response));
|
|
3495
3873
|
}
|
|
3496
3874
|
settle(resolve, reject, response);
|
|
3497
3875
|
});
|
|
@@ -3515,7 +3893,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3515
3893
|
});
|
|
3516
3894
|
if (config.timeout) {
|
|
3517
3895
|
const timeout = parseInt(config.timeout, 10);
|
|
3518
|
-
if (isNaN(timeout)) {
|
|
3896
|
+
if (Number.isNaN(timeout)) {
|
|
3519
3897
|
reject(new AxiosError_default(
|
|
3520
3898
|
"error trying to parse `config.timeout` to int",
|
|
3521
3899
|
AxiosError_default.ERR_BAD_OPTION_VALUE,
|
|
@@ -3562,144 +3940,181 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3562
3940
|
});
|
|
3563
3941
|
};
|
|
3564
3942
|
|
|
3565
|
-
// node_modules
|
|
3566
|
-
var
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
if (utils_default.isNumber(expires)) {
|
|
3574
|
-
cookie.push("expires=" + new Date(expires).toGMTString());
|
|
3575
|
-
}
|
|
3576
|
-
if (utils_default.isString(path7)) {
|
|
3577
|
-
cookie.push("path=" + path7);
|
|
3578
|
-
}
|
|
3579
|
-
if (utils_default.isString(domain)) {
|
|
3580
|
-
cookie.push("domain=" + domain);
|
|
3581
|
-
}
|
|
3582
|
-
if (secure === true) {
|
|
3583
|
-
cookie.push("secure");
|
|
3584
|
-
}
|
|
3585
|
-
document.cookie = cookie.join("; ");
|
|
3586
|
-
},
|
|
3587
|
-
read: function read(name) {
|
|
3588
|
-
const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
|
|
3589
|
-
return match ? decodeURIComponent(match[3]) : null;
|
|
3590
|
-
},
|
|
3591
|
-
remove: function remove(name) {
|
|
3592
|
-
this.write(name, "", Date.now() - 864e5);
|
|
3593
|
-
}
|
|
3594
|
-
};
|
|
3595
|
-
}()
|
|
3596
|
-
) : (
|
|
3597
|
-
// Non standard browser env (web workers, react-native) lack needed support.
|
|
3598
|
-
/* @__PURE__ */ function nonStandardBrowserEnv() {
|
|
3599
|
-
return {
|
|
3600
|
-
write: function write() {
|
|
3601
|
-
},
|
|
3602
|
-
read: function read() {
|
|
3603
|
-
return null;
|
|
3604
|
-
},
|
|
3605
|
-
remove: function remove() {
|
|
3606
|
-
}
|
|
3607
|
-
};
|
|
3608
|
-
}()
|
|
3609
|
-
);
|
|
3943
|
+
// node_modules/axios/lib/helpers/isURLSameOrigin.js
|
|
3944
|
+
var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url2) => {
|
|
3945
|
+
url2 = new URL(url2, platform_default.origin);
|
|
3946
|
+
return origin2.protocol === url2.protocol && origin2.host === url2.host && (isMSIE || origin2.port === url2.port);
|
|
3947
|
+
})(
|
|
3948
|
+
new URL(platform_default.origin),
|
|
3949
|
+
platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)
|
|
3950
|
+
) : () => true;
|
|
3610
3951
|
|
|
3611
|
-
// node_modules
|
|
3612
|
-
var
|
|
3613
|
-
// Standard browser envs
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
host: urlParsingNode.host,
|
|
3630
|
-
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
|
|
3631
|
-
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
|
|
3632
|
-
hostname: urlParsingNode.hostname,
|
|
3633
|
-
port: urlParsingNode.port,
|
|
3634
|
-
pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
|
|
3635
|
-
};
|
|
3952
|
+
// node_modules/axios/lib/helpers/cookies.js
|
|
3953
|
+
var cookies_default = platform_default.hasStandardBrowserEnv ? (
|
|
3954
|
+
// Standard browser envs support document.cookie
|
|
3955
|
+
{
|
|
3956
|
+
write(name, value, expires, path8, domain, secure) {
|
|
3957
|
+
const cookie = [name + "=" + encodeURIComponent(value)];
|
|
3958
|
+
utils_default.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
|
|
3959
|
+
utils_default.isString(path8) && cookie.push("path=" + path8);
|
|
3960
|
+
utils_default.isString(domain) && cookie.push("domain=" + domain);
|
|
3961
|
+
secure === true && cookie.push("secure");
|
|
3962
|
+
document.cookie = cookie.join("; ");
|
|
3963
|
+
},
|
|
3964
|
+
read(name) {
|
|
3965
|
+
const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
|
|
3966
|
+
return match ? decodeURIComponent(match[3]) : null;
|
|
3967
|
+
},
|
|
3968
|
+
remove(name) {
|
|
3969
|
+
this.write(name, "", Date.now() - 864e5);
|
|
3636
3970
|
}
|
|
3637
|
-
|
|
3638
|
-
return function isURLSameOrigin(requestURL) {
|
|
3639
|
-
const parsed = utils_default.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
|
3640
|
-
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
|
3641
|
-
};
|
|
3642
|
-
}()
|
|
3971
|
+
}
|
|
3643
3972
|
) : (
|
|
3644
|
-
// Non
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3973
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
3974
|
+
{
|
|
3975
|
+
write() {
|
|
3976
|
+
},
|
|
3977
|
+
read() {
|
|
3978
|
+
return null;
|
|
3979
|
+
},
|
|
3980
|
+
remove() {
|
|
3981
|
+
}
|
|
3982
|
+
}
|
|
3650
3983
|
);
|
|
3651
3984
|
|
|
3652
|
-
// node_modules
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3985
|
+
// node_modules/axios/lib/core/mergeConfig.js
|
|
3986
|
+
var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
|
|
3987
|
+
function mergeConfig(config1, config2) {
|
|
3988
|
+
config2 = config2 || {};
|
|
3989
|
+
const config = {};
|
|
3990
|
+
function getMergedValue(target, source, prop, caseless) {
|
|
3991
|
+
if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
|
|
3992
|
+
return utils_default.merge.call({ caseless }, target, source);
|
|
3993
|
+
} else if (utils_default.isPlainObject(source)) {
|
|
3994
|
+
return utils_default.merge({}, source);
|
|
3995
|
+
} else if (utils_default.isArray(source)) {
|
|
3996
|
+
return source.slice();
|
|
3997
|
+
}
|
|
3998
|
+
return source;
|
|
3999
|
+
}
|
|
4000
|
+
function mergeDeepProperties(a, b, prop, caseless) {
|
|
4001
|
+
if (!utils_default.isUndefined(b)) {
|
|
4002
|
+
return getMergedValue(a, b, prop, caseless);
|
|
4003
|
+
} else if (!utils_default.isUndefined(a)) {
|
|
4004
|
+
return getMergedValue(void 0, a, prop, caseless);
|
|
4005
|
+
}
|
|
4006
|
+
}
|
|
4007
|
+
function valueFromConfig2(a, b) {
|
|
4008
|
+
if (!utils_default.isUndefined(b)) {
|
|
4009
|
+
return getMergedValue(void 0, b);
|
|
4010
|
+
}
|
|
4011
|
+
}
|
|
4012
|
+
function defaultToConfig2(a, b) {
|
|
4013
|
+
if (!utils_default.isUndefined(b)) {
|
|
4014
|
+
return getMergedValue(void 0, b);
|
|
4015
|
+
} else if (!utils_default.isUndefined(a)) {
|
|
4016
|
+
return getMergedValue(void 0, a);
|
|
4017
|
+
}
|
|
4018
|
+
}
|
|
4019
|
+
function mergeDirectKeys(a, b, prop) {
|
|
4020
|
+
if (prop in config2) {
|
|
4021
|
+
return getMergedValue(a, b);
|
|
4022
|
+
} else if (prop in config1) {
|
|
4023
|
+
return getMergedValue(void 0, a);
|
|
4024
|
+
}
|
|
4025
|
+
}
|
|
4026
|
+
const mergeMap = {
|
|
4027
|
+
url: valueFromConfig2,
|
|
4028
|
+
method: valueFromConfig2,
|
|
4029
|
+
data: valueFromConfig2,
|
|
4030
|
+
baseURL: defaultToConfig2,
|
|
4031
|
+
transformRequest: defaultToConfig2,
|
|
4032
|
+
transformResponse: defaultToConfig2,
|
|
4033
|
+
paramsSerializer: defaultToConfig2,
|
|
4034
|
+
timeout: defaultToConfig2,
|
|
4035
|
+
timeoutMessage: defaultToConfig2,
|
|
4036
|
+
withCredentials: defaultToConfig2,
|
|
4037
|
+
withXSRFToken: defaultToConfig2,
|
|
4038
|
+
adapter: defaultToConfig2,
|
|
4039
|
+
responseType: defaultToConfig2,
|
|
4040
|
+
xsrfCookieName: defaultToConfig2,
|
|
4041
|
+
xsrfHeaderName: defaultToConfig2,
|
|
4042
|
+
onUploadProgress: defaultToConfig2,
|
|
4043
|
+
onDownloadProgress: defaultToConfig2,
|
|
4044
|
+
decompress: defaultToConfig2,
|
|
4045
|
+
maxContentLength: defaultToConfig2,
|
|
4046
|
+
maxBodyLength: defaultToConfig2,
|
|
4047
|
+
beforeRedirect: defaultToConfig2,
|
|
4048
|
+
transport: defaultToConfig2,
|
|
4049
|
+
httpAgent: defaultToConfig2,
|
|
4050
|
+
httpsAgent: defaultToConfig2,
|
|
4051
|
+
cancelToken: defaultToConfig2,
|
|
4052
|
+
socketPath: defaultToConfig2,
|
|
4053
|
+
responseEncoding: defaultToConfig2,
|
|
4054
|
+
validateStatus: mergeDirectKeys,
|
|
4055
|
+
headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
|
|
3674
4056
|
};
|
|
4057
|
+
utils_default.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
4058
|
+
const merge2 = mergeMap[prop] || mergeDeepProperties;
|
|
4059
|
+
const configValue = merge2(config1[prop], config2[prop], prop);
|
|
4060
|
+
utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
|
|
4061
|
+
});
|
|
4062
|
+
return config;
|
|
3675
4063
|
}
|
|
4064
|
+
|
|
4065
|
+
// node_modules/axios/lib/helpers/resolveConfig.js
|
|
4066
|
+
var resolveConfig_default = (config) => {
|
|
4067
|
+
const newConfig = mergeConfig({}, config);
|
|
4068
|
+
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
|
|
4069
|
+
newConfig.headers = headers = AxiosHeaders_default.from(headers);
|
|
4070
|
+
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
|
|
4071
|
+
if (auth) {
|
|
4072
|
+
headers.set(
|
|
4073
|
+
"Authorization",
|
|
4074
|
+
"Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
|
|
4075
|
+
);
|
|
4076
|
+
}
|
|
4077
|
+
let contentType;
|
|
4078
|
+
if (utils_default.isFormData(data)) {
|
|
4079
|
+
if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
|
|
4080
|
+
headers.setContentType(void 0);
|
|
4081
|
+
} else if ((contentType = headers.getContentType()) !== false) {
|
|
4082
|
+
const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
|
|
4083
|
+
headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
|
|
4084
|
+
}
|
|
4085
|
+
}
|
|
4086
|
+
if (platform_default.hasStandardBrowserEnv) {
|
|
4087
|
+
withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
4088
|
+
if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) {
|
|
4089
|
+
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName);
|
|
4090
|
+
if (xsrfValue) {
|
|
4091
|
+
headers.set(xsrfHeaderName, xsrfValue);
|
|
4092
|
+
}
|
|
4093
|
+
}
|
|
4094
|
+
}
|
|
4095
|
+
return newConfig;
|
|
4096
|
+
};
|
|
4097
|
+
|
|
4098
|
+
// node_modules/axios/lib/adapters/xhr.js
|
|
3676
4099
|
var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
3677
4100
|
var xhr_default = isXHRAdapterSupported && function(config) {
|
|
3678
4101
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
const
|
|
4102
|
+
const _config = resolveConfig_default(config);
|
|
4103
|
+
let requestData = _config.data;
|
|
4104
|
+
const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
|
|
4105
|
+
let { responseType, onUploadProgress, onDownloadProgress } = _config;
|
|
3682
4106
|
let onCanceled;
|
|
4107
|
+
let uploadThrottled, downloadThrottled;
|
|
4108
|
+
let flushUpload, flushDownload;
|
|
3683
4109
|
function done() {
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
config.signal.removeEventListener("abort", onCanceled);
|
|
3689
|
-
}
|
|
3690
|
-
}
|
|
3691
|
-
if (utils_default.isFormData(requestData) && (node_default.isStandardBrowserEnv || node_default.isStandardBrowserWebWorkerEnv)) {
|
|
3692
|
-
requestHeaders.setContentType(false);
|
|
4110
|
+
flushUpload && flushUpload();
|
|
4111
|
+
flushDownload && flushDownload();
|
|
4112
|
+
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
4113
|
+
_config.signal && _config.signal.removeEventListener("abort", onCanceled);
|
|
3693
4114
|
}
|
|
3694
4115
|
let request = new XMLHttpRequest();
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
|
|
3698
|
-
requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password));
|
|
3699
|
-
}
|
|
3700
|
-
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
3701
|
-
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
|
3702
|
-
request.timeout = config.timeout;
|
|
4116
|
+
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
4117
|
+
request.timeout = _config.timeout;
|
|
3703
4118
|
function onloadend() {
|
|
3704
4119
|
if (!request) {
|
|
3705
4120
|
return;
|
|
@@ -3750,10 +4165,10 @@ var xhr_default = isXHRAdapterSupported && function(config) {
|
|
|
3750
4165
|
request = null;
|
|
3751
4166
|
};
|
|
3752
4167
|
request.ontimeout = function handleTimeout() {
|
|
3753
|
-
let timeoutErrorMessage =
|
|
3754
|
-
const transitional2 =
|
|
3755
|
-
if (
|
|
3756
|
-
timeoutErrorMessage =
|
|
4168
|
+
let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
|
|
4169
|
+
const transitional2 = _config.transitional || transitional_default;
|
|
4170
|
+
if (_config.timeoutErrorMessage) {
|
|
4171
|
+
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
3757
4172
|
}
|
|
3758
4173
|
reject(new AxiosError_default(
|
|
3759
4174
|
timeoutErrorMessage,
|
|
@@ -3763,31 +4178,28 @@ var xhr_default = isXHRAdapterSupported && function(config) {
|
|
|
3763
4178
|
));
|
|
3764
4179
|
request = null;
|
|
3765
4180
|
};
|
|
3766
|
-
if (node_default.isStandardBrowserEnv) {
|
|
3767
|
-
const xsrfValue = (config.withCredentials || isURLSameOrigin_default(fullPath)) && config.xsrfCookieName && cookies_default.read(config.xsrfCookieName);
|
|
3768
|
-
if (xsrfValue) {
|
|
3769
|
-
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
|
3770
|
-
}
|
|
3771
|
-
}
|
|
3772
4181
|
requestData === void 0 && requestHeaders.setContentType(null);
|
|
3773
4182
|
if ("setRequestHeader" in request) {
|
|
3774
4183
|
utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
3775
4184
|
request.setRequestHeader(key, val);
|
|
3776
4185
|
});
|
|
3777
4186
|
}
|
|
3778
|
-
if (!utils_default.isUndefined(
|
|
3779
|
-
request.withCredentials = !!
|
|
4187
|
+
if (!utils_default.isUndefined(_config.withCredentials)) {
|
|
4188
|
+
request.withCredentials = !!_config.withCredentials;
|
|
3780
4189
|
}
|
|
3781
4190
|
if (responseType && responseType !== "json") {
|
|
3782
|
-
request.responseType =
|
|
4191
|
+
request.responseType = _config.responseType;
|
|
3783
4192
|
}
|
|
3784
|
-
if (
|
|
3785
|
-
|
|
4193
|
+
if (onDownloadProgress) {
|
|
4194
|
+
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
|
4195
|
+
request.addEventListener("progress", downloadThrottled);
|
|
3786
4196
|
}
|
|
3787
|
-
if (
|
|
3788
|
-
|
|
4197
|
+
if (onUploadProgress && request.upload) {
|
|
4198
|
+
[uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
|
|
4199
|
+
request.upload.addEventListener("progress", uploadThrottled);
|
|
4200
|
+
request.upload.addEventListener("loadend", flushUpload);
|
|
3789
4201
|
}
|
|
3790
|
-
if (
|
|
4202
|
+
if (_config.cancelToken || _config.signal) {
|
|
3791
4203
|
onCanceled = (cancel) => {
|
|
3792
4204
|
if (!request) {
|
|
3793
4205
|
return;
|
|
@@ -3796,24 +4208,302 @@ var xhr_default = isXHRAdapterSupported && function(config) {
|
|
|
3796
4208
|
request.abort();
|
|
3797
4209
|
request = null;
|
|
3798
4210
|
};
|
|
3799
|
-
|
|
3800
|
-
if (
|
|
3801
|
-
|
|
4211
|
+
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
4212
|
+
if (_config.signal) {
|
|
4213
|
+
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
|
|
4214
|
+
}
|
|
4215
|
+
}
|
|
4216
|
+
const protocol = parseProtocol(_config.url);
|
|
4217
|
+
if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
|
|
4218
|
+
reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config));
|
|
4219
|
+
return;
|
|
4220
|
+
}
|
|
4221
|
+
request.send(requestData || null);
|
|
4222
|
+
});
|
|
4223
|
+
};
|
|
4224
|
+
|
|
4225
|
+
// node_modules/axios/lib/helpers/composeSignals.js
|
|
4226
|
+
var composeSignals = (signals, timeout) => {
|
|
4227
|
+
const { length } = signals = signals ? signals.filter(Boolean) : [];
|
|
4228
|
+
if (timeout || length) {
|
|
4229
|
+
let controller = new AbortController();
|
|
4230
|
+
let aborted;
|
|
4231
|
+
const onabort = function(reason) {
|
|
4232
|
+
if (!aborted) {
|
|
4233
|
+
aborted = true;
|
|
4234
|
+
unsubscribe();
|
|
4235
|
+
const err = reason instanceof Error ? reason : this.reason;
|
|
4236
|
+
controller.abort(err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err));
|
|
4237
|
+
}
|
|
4238
|
+
};
|
|
4239
|
+
let timer = timeout && setTimeout(() => {
|
|
4240
|
+
timer = null;
|
|
4241
|
+
onabort(new AxiosError_default(`timeout ${timeout} of ms exceeded`, AxiosError_default.ETIMEDOUT));
|
|
4242
|
+
}, timeout);
|
|
4243
|
+
const unsubscribe = () => {
|
|
4244
|
+
if (signals) {
|
|
4245
|
+
timer && clearTimeout(timer);
|
|
4246
|
+
timer = null;
|
|
4247
|
+
signals.forEach((signal2) => {
|
|
4248
|
+
signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
|
|
4249
|
+
});
|
|
4250
|
+
signals = null;
|
|
4251
|
+
}
|
|
4252
|
+
};
|
|
4253
|
+
signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
|
|
4254
|
+
const { signal } = controller;
|
|
4255
|
+
signal.unsubscribe = () => utils_default.asap(unsubscribe);
|
|
4256
|
+
return signal;
|
|
4257
|
+
}
|
|
4258
|
+
};
|
|
4259
|
+
var composeSignals_default = composeSignals;
|
|
4260
|
+
|
|
4261
|
+
// node_modules/axios/lib/helpers/trackStream.js
|
|
4262
|
+
var streamChunk = function* (chunk, chunkSize) {
|
|
4263
|
+
let len = chunk.byteLength;
|
|
4264
|
+
if (!chunkSize || len < chunkSize) {
|
|
4265
|
+
yield chunk;
|
|
4266
|
+
return;
|
|
4267
|
+
}
|
|
4268
|
+
let pos = 0;
|
|
4269
|
+
let end;
|
|
4270
|
+
while (pos < len) {
|
|
4271
|
+
end = pos + chunkSize;
|
|
4272
|
+
yield chunk.slice(pos, end);
|
|
4273
|
+
pos = end;
|
|
4274
|
+
}
|
|
4275
|
+
};
|
|
4276
|
+
var readBytes = async function* (iterable, chunkSize) {
|
|
4277
|
+
for await (const chunk of readStream(iterable)) {
|
|
4278
|
+
yield* streamChunk(chunk, chunkSize);
|
|
4279
|
+
}
|
|
4280
|
+
};
|
|
4281
|
+
var readStream = async function* (stream4) {
|
|
4282
|
+
if (stream4[Symbol.asyncIterator]) {
|
|
4283
|
+
yield* stream4;
|
|
4284
|
+
return;
|
|
4285
|
+
}
|
|
4286
|
+
const reader = stream4.getReader();
|
|
4287
|
+
try {
|
|
4288
|
+
for (; ; ) {
|
|
4289
|
+
const { done, value } = await reader.read();
|
|
4290
|
+
if (done) {
|
|
4291
|
+
break;
|
|
4292
|
+
}
|
|
4293
|
+
yield value;
|
|
4294
|
+
}
|
|
4295
|
+
} finally {
|
|
4296
|
+
await reader.cancel();
|
|
4297
|
+
}
|
|
4298
|
+
};
|
|
4299
|
+
var trackStream = (stream4, chunkSize, onProgress, onFinish) => {
|
|
4300
|
+
const iterator2 = readBytes(stream4, chunkSize);
|
|
4301
|
+
let bytes = 0;
|
|
4302
|
+
let done;
|
|
4303
|
+
let _onFinish = (e) => {
|
|
4304
|
+
if (!done) {
|
|
4305
|
+
done = true;
|
|
4306
|
+
onFinish && onFinish(e);
|
|
4307
|
+
}
|
|
4308
|
+
};
|
|
4309
|
+
return new ReadableStream({
|
|
4310
|
+
async pull(controller) {
|
|
4311
|
+
try {
|
|
4312
|
+
const { done: done2, value } = await iterator2.next();
|
|
4313
|
+
if (done2) {
|
|
4314
|
+
_onFinish();
|
|
4315
|
+
controller.close();
|
|
4316
|
+
return;
|
|
4317
|
+
}
|
|
4318
|
+
let len = value.byteLength;
|
|
4319
|
+
if (onProgress) {
|
|
4320
|
+
let loadedBytes = bytes += len;
|
|
4321
|
+
onProgress(loadedBytes);
|
|
4322
|
+
}
|
|
4323
|
+
controller.enqueue(new Uint8Array(value));
|
|
4324
|
+
} catch (err) {
|
|
4325
|
+
_onFinish(err);
|
|
4326
|
+
throw err;
|
|
4327
|
+
}
|
|
4328
|
+
},
|
|
4329
|
+
cancel(reason) {
|
|
4330
|
+
_onFinish(reason);
|
|
4331
|
+
return iterator2.return();
|
|
4332
|
+
}
|
|
4333
|
+
}, {
|
|
4334
|
+
highWaterMark: 2
|
|
4335
|
+
});
|
|
4336
|
+
};
|
|
4337
|
+
|
|
4338
|
+
// node_modules/axios/lib/adapters/fetch.js
|
|
4339
|
+
var isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
|
|
4340
|
+
var isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
|
|
4341
|
+
var encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()));
|
|
4342
|
+
var test = (fn, ...args) => {
|
|
4343
|
+
try {
|
|
4344
|
+
return !!fn(...args);
|
|
4345
|
+
} catch (e) {
|
|
4346
|
+
return false;
|
|
4347
|
+
}
|
|
4348
|
+
};
|
|
4349
|
+
var supportsRequestStream = isReadableStreamSupported && test(() => {
|
|
4350
|
+
let duplexAccessed = false;
|
|
4351
|
+
const hasContentType = new Request(platform_default.origin, {
|
|
4352
|
+
body: new ReadableStream(),
|
|
4353
|
+
method: "POST",
|
|
4354
|
+
get duplex() {
|
|
4355
|
+
duplexAccessed = true;
|
|
4356
|
+
return "half";
|
|
4357
|
+
}
|
|
4358
|
+
}).headers.has("Content-Type");
|
|
4359
|
+
return duplexAccessed && !hasContentType;
|
|
4360
|
+
});
|
|
4361
|
+
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
4362
|
+
var supportsResponseStream = isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
|
|
4363
|
+
var resolvers = {
|
|
4364
|
+
stream: supportsResponseStream && ((res) => res.body)
|
|
4365
|
+
};
|
|
4366
|
+
isFetchSupported && ((res) => {
|
|
4367
|
+
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
|
|
4368
|
+
!resolvers[type] && (resolvers[type] = utils_default.isFunction(res[type]) ? (res2) => res2[type]() : (_, config) => {
|
|
4369
|
+
throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config);
|
|
4370
|
+
});
|
|
4371
|
+
});
|
|
4372
|
+
})(new Response());
|
|
4373
|
+
var getBodyLength = async (body) => {
|
|
4374
|
+
if (body == null) {
|
|
4375
|
+
return 0;
|
|
4376
|
+
}
|
|
4377
|
+
if (utils_default.isBlob(body)) {
|
|
4378
|
+
return body.size;
|
|
4379
|
+
}
|
|
4380
|
+
if (utils_default.isSpecCompliantForm(body)) {
|
|
4381
|
+
const _request = new Request(platform_default.origin, {
|
|
4382
|
+
method: "POST",
|
|
4383
|
+
body
|
|
4384
|
+
});
|
|
4385
|
+
return (await _request.arrayBuffer()).byteLength;
|
|
4386
|
+
}
|
|
4387
|
+
if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
|
|
4388
|
+
return body.byteLength;
|
|
4389
|
+
}
|
|
4390
|
+
if (utils_default.isURLSearchParams(body)) {
|
|
4391
|
+
body = body + "";
|
|
4392
|
+
}
|
|
4393
|
+
if (utils_default.isString(body)) {
|
|
4394
|
+
return (await encodeText(body)).byteLength;
|
|
4395
|
+
}
|
|
4396
|
+
};
|
|
4397
|
+
var resolveBodyLength = async (headers, body) => {
|
|
4398
|
+
const length = utils_default.toFiniteNumber(headers.getContentLength());
|
|
4399
|
+
return length == null ? getBodyLength(body) : length;
|
|
4400
|
+
};
|
|
4401
|
+
var fetch_default = isFetchSupported && (async (config) => {
|
|
4402
|
+
let {
|
|
4403
|
+
url: url2,
|
|
4404
|
+
method,
|
|
4405
|
+
data,
|
|
4406
|
+
signal,
|
|
4407
|
+
cancelToken,
|
|
4408
|
+
timeout,
|
|
4409
|
+
onDownloadProgress,
|
|
4410
|
+
onUploadProgress,
|
|
4411
|
+
responseType,
|
|
4412
|
+
headers,
|
|
4413
|
+
withCredentials = "same-origin",
|
|
4414
|
+
fetchOptions
|
|
4415
|
+
} = resolveConfig_default(config);
|
|
4416
|
+
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
4417
|
+
let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
4418
|
+
let request;
|
|
4419
|
+
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
4420
|
+
composedSignal.unsubscribe();
|
|
4421
|
+
});
|
|
4422
|
+
let requestContentLength;
|
|
4423
|
+
try {
|
|
4424
|
+
if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
|
|
4425
|
+
let _request = new Request(url2, {
|
|
4426
|
+
method: "POST",
|
|
4427
|
+
body: data,
|
|
4428
|
+
duplex: "half"
|
|
4429
|
+
});
|
|
4430
|
+
let contentTypeHeader;
|
|
4431
|
+
if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
|
|
4432
|
+
headers.setContentType(contentTypeHeader);
|
|
4433
|
+
}
|
|
4434
|
+
if (_request.body) {
|
|
4435
|
+
const [onProgress, flush] = progressEventDecorator(
|
|
4436
|
+
requestContentLength,
|
|
4437
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
4438
|
+
);
|
|
4439
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
3802
4440
|
}
|
|
3803
4441
|
}
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config));
|
|
3807
|
-
return;
|
|
4442
|
+
if (!utils_default.isString(withCredentials)) {
|
|
4443
|
+
withCredentials = withCredentials ? "include" : "omit";
|
|
3808
4444
|
}
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
4445
|
+
const isCredentialsSupported = "credentials" in Request.prototype;
|
|
4446
|
+
request = new Request(url2, {
|
|
4447
|
+
...fetchOptions,
|
|
4448
|
+
signal: composedSignal,
|
|
4449
|
+
method: method.toUpperCase(),
|
|
4450
|
+
headers: headers.normalize().toJSON(),
|
|
4451
|
+
body: data,
|
|
4452
|
+
duplex: "half",
|
|
4453
|
+
credentials: isCredentialsSupported ? withCredentials : void 0
|
|
4454
|
+
});
|
|
4455
|
+
let response = await fetch(request);
|
|
4456
|
+
const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
|
|
4457
|
+
if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
|
|
4458
|
+
const options = {};
|
|
4459
|
+
["status", "statusText", "headers"].forEach((prop) => {
|
|
4460
|
+
options[prop] = response[prop];
|
|
4461
|
+
});
|
|
4462
|
+
const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
|
|
4463
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
4464
|
+
responseContentLength,
|
|
4465
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
4466
|
+
) || [];
|
|
4467
|
+
response = new Response(
|
|
4468
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
4469
|
+
flush && flush();
|
|
4470
|
+
unsubscribe && unsubscribe();
|
|
4471
|
+
}),
|
|
4472
|
+
options
|
|
4473
|
+
);
|
|
4474
|
+
}
|
|
4475
|
+
responseType = responseType || "text";
|
|
4476
|
+
let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
|
|
4477
|
+
!isStreamResponse && unsubscribe && unsubscribe();
|
|
4478
|
+
return await new Promise((resolve, reject) => {
|
|
4479
|
+
settle(resolve, reject, {
|
|
4480
|
+
data: responseData,
|
|
4481
|
+
headers: AxiosHeaders_default.from(response.headers),
|
|
4482
|
+
status: response.status,
|
|
4483
|
+
statusText: response.statusText,
|
|
4484
|
+
config,
|
|
4485
|
+
request
|
|
4486
|
+
});
|
|
4487
|
+
});
|
|
4488
|
+
} catch (err) {
|
|
4489
|
+
unsubscribe && unsubscribe();
|
|
4490
|
+
if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
|
|
4491
|
+
throw Object.assign(
|
|
4492
|
+
new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request),
|
|
4493
|
+
{
|
|
4494
|
+
cause: err.cause || err
|
|
4495
|
+
}
|
|
4496
|
+
);
|
|
4497
|
+
}
|
|
4498
|
+
throw AxiosError_default.from(err, err && err.code, config, request);
|
|
4499
|
+
}
|
|
4500
|
+
});
|
|
3812
4501
|
|
|
3813
|
-
// node_modules
|
|
4502
|
+
// node_modules/axios/lib/adapters/adapters.js
|
|
3814
4503
|
var knownAdapters = {
|
|
3815
4504
|
http: http_default,
|
|
3816
|
-
xhr: xhr_default
|
|
4505
|
+
xhr: xhr_default,
|
|
4506
|
+
fetch: fetch_default
|
|
3817
4507
|
};
|
|
3818
4508
|
utils_default.forEach(knownAdapters, (fn, value) => {
|
|
3819
4509
|
if (fn) {
|
|
@@ -3824,38 +4514,46 @@ utils_default.forEach(knownAdapters, (fn, value) => {
|
|
|
3824
4514
|
Object.defineProperty(fn, "adapterName", { value });
|
|
3825
4515
|
}
|
|
3826
4516
|
});
|
|
4517
|
+
var renderReason = (reason) => `- ${reason}`;
|
|
4518
|
+
var isResolvedHandle = (adapter) => utils_default.isFunction(adapter) || adapter === null || adapter === false;
|
|
3827
4519
|
var adapters_default = {
|
|
3828
4520
|
getAdapter: (adapters) => {
|
|
3829
4521
|
adapters = utils_default.isArray(adapters) ? adapters : [adapters];
|
|
3830
4522
|
const { length } = adapters;
|
|
3831
4523
|
let nameOrAdapter;
|
|
3832
4524
|
let adapter;
|
|
4525
|
+
const rejectedReasons = {};
|
|
3833
4526
|
for (let i = 0; i < length; i++) {
|
|
3834
4527
|
nameOrAdapter = adapters[i];
|
|
3835
|
-
|
|
4528
|
+
let id;
|
|
4529
|
+
adapter = nameOrAdapter;
|
|
4530
|
+
if (!isResolvedHandle(nameOrAdapter)) {
|
|
4531
|
+
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
4532
|
+
if (adapter === void 0) {
|
|
4533
|
+
throw new AxiosError_default(`Unknown adapter '${id}'`);
|
|
4534
|
+
}
|
|
4535
|
+
}
|
|
4536
|
+
if (adapter) {
|
|
3836
4537
|
break;
|
|
3837
4538
|
}
|
|
4539
|
+
rejectedReasons[id || "#" + i] = adapter;
|
|
3838
4540
|
}
|
|
3839
4541
|
if (!adapter) {
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
utils_default.hasOwnProp(knownAdapters, nameOrAdapter) ? `Adapter '${nameOrAdapter}' is not available in the build` : `Unknown adapter '${nameOrAdapter}'`
|
|
4542
|
+
const reasons = Object.entries(rejectedReasons).map(
|
|
4543
|
+
([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
|
|
4544
|
+
);
|
|
4545
|
+
let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
|
|
4546
|
+
throw new AxiosError_default(
|
|
4547
|
+
`There is no suitable adapter to dispatch the request ` + s,
|
|
4548
|
+
"ERR_NOT_SUPPORT"
|
|
3848
4549
|
);
|
|
3849
|
-
}
|
|
3850
|
-
if (!utils_default.isFunction(adapter)) {
|
|
3851
|
-
throw new TypeError("adapter is not a function");
|
|
3852
4550
|
}
|
|
3853
4551
|
return adapter;
|
|
3854
4552
|
},
|
|
3855
4553
|
adapters: knownAdapters
|
|
3856
4554
|
};
|
|
3857
4555
|
|
|
3858
|
-
// node_modules
|
|
4556
|
+
// node_modules/axios/lib/core/dispatchRequest.js
|
|
3859
4557
|
function throwIfCancellationRequested(config) {
|
|
3860
4558
|
if (config.cancelToken) {
|
|
3861
4559
|
config.cancelToken.throwIfRequested();
|
|
@@ -3900,86 +4598,7 @@ function dispatchRequest(config) {
|
|
|
3900
4598
|
});
|
|
3901
4599
|
}
|
|
3902
4600
|
|
|
3903
|
-
// node_modules
|
|
3904
|
-
var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? thing.toJSON() : thing;
|
|
3905
|
-
function mergeConfig(config1, config2) {
|
|
3906
|
-
config2 = config2 || {};
|
|
3907
|
-
const config = {};
|
|
3908
|
-
function getMergedValue(target, source, caseless) {
|
|
3909
|
-
if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
|
|
3910
|
-
return utils_default.merge.call({ caseless }, target, source);
|
|
3911
|
-
} else if (utils_default.isPlainObject(source)) {
|
|
3912
|
-
return utils_default.merge({}, source);
|
|
3913
|
-
} else if (utils_default.isArray(source)) {
|
|
3914
|
-
return source.slice();
|
|
3915
|
-
}
|
|
3916
|
-
return source;
|
|
3917
|
-
}
|
|
3918
|
-
function mergeDeepProperties(a, b, caseless) {
|
|
3919
|
-
if (!utils_default.isUndefined(b)) {
|
|
3920
|
-
return getMergedValue(a, b, caseless);
|
|
3921
|
-
} else if (!utils_default.isUndefined(a)) {
|
|
3922
|
-
return getMergedValue(void 0, a, caseless);
|
|
3923
|
-
}
|
|
3924
|
-
}
|
|
3925
|
-
function valueFromConfig2(a, b) {
|
|
3926
|
-
if (!utils_default.isUndefined(b)) {
|
|
3927
|
-
return getMergedValue(void 0, b);
|
|
3928
|
-
}
|
|
3929
|
-
}
|
|
3930
|
-
function defaultToConfig2(a, b) {
|
|
3931
|
-
if (!utils_default.isUndefined(b)) {
|
|
3932
|
-
return getMergedValue(void 0, b);
|
|
3933
|
-
} else if (!utils_default.isUndefined(a)) {
|
|
3934
|
-
return getMergedValue(void 0, a);
|
|
3935
|
-
}
|
|
3936
|
-
}
|
|
3937
|
-
function mergeDirectKeys(a, b, prop) {
|
|
3938
|
-
if (prop in config2) {
|
|
3939
|
-
return getMergedValue(a, b);
|
|
3940
|
-
} else if (prop in config1) {
|
|
3941
|
-
return getMergedValue(void 0, a);
|
|
3942
|
-
}
|
|
3943
|
-
}
|
|
3944
|
-
const mergeMap = {
|
|
3945
|
-
url: valueFromConfig2,
|
|
3946
|
-
method: valueFromConfig2,
|
|
3947
|
-
data: valueFromConfig2,
|
|
3948
|
-
baseURL: defaultToConfig2,
|
|
3949
|
-
transformRequest: defaultToConfig2,
|
|
3950
|
-
transformResponse: defaultToConfig2,
|
|
3951
|
-
paramsSerializer: defaultToConfig2,
|
|
3952
|
-
timeout: defaultToConfig2,
|
|
3953
|
-
timeoutMessage: defaultToConfig2,
|
|
3954
|
-
withCredentials: defaultToConfig2,
|
|
3955
|
-
adapter: defaultToConfig2,
|
|
3956
|
-
responseType: defaultToConfig2,
|
|
3957
|
-
xsrfCookieName: defaultToConfig2,
|
|
3958
|
-
xsrfHeaderName: defaultToConfig2,
|
|
3959
|
-
onUploadProgress: defaultToConfig2,
|
|
3960
|
-
onDownloadProgress: defaultToConfig2,
|
|
3961
|
-
decompress: defaultToConfig2,
|
|
3962
|
-
maxContentLength: defaultToConfig2,
|
|
3963
|
-
maxBodyLength: defaultToConfig2,
|
|
3964
|
-
beforeRedirect: defaultToConfig2,
|
|
3965
|
-
transport: defaultToConfig2,
|
|
3966
|
-
httpAgent: defaultToConfig2,
|
|
3967
|
-
httpsAgent: defaultToConfig2,
|
|
3968
|
-
cancelToken: defaultToConfig2,
|
|
3969
|
-
socketPath: defaultToConfig2,
|
|
3970
|
-
responseEncoding: defaultToConfig2,
|
|
3971
|
-
validateStatus: mergeDirectKeys,
|
|
3972
|
-
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
|
3973
|
-
};
|
|
3974
|
-
utils_default.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
|
|
3975
|
-
const merge2 = mergeMap[prop] || mergeDeepProperties;
|
|
3976
|
-
const configValue = merge2(config1[prop], config2[prop], prop);
|
|
3977
|
-
utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
|
|
3978
|
-
});
|
|
3979
|
-
return config;
|
|
3980
|
-
}
|
|
3981
|
-
|
|
3982
|
-
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/validator.js
|
|
4601
|
+
// node_modules/axios/lib/helpers/validator.js
|
|
3983
4602
|
var validators = {};
|
|
3984
4603
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
3985
4604
|
validators[type] = function validator(thing) {
|
|
@@ -4010,6 +4629,12 @@ validators.transitional = function transitional(validator, version2, message) {
|
|
|
4010
4629
|
return validator ? validator(value, opt, opts) : true;
|
|
4011
4630
|
};
|
|
4012
4631
|
};
|
|
4632
|
+
validators.spelling = function spelling(correctSpelling) {
|
|
4633
|
+
return (value, opt) => {
|
|
4634
|
+
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
|
4635
|
+
return true;
|
|
4636
|
+
};
|
|
4637
|
+
};
|
|
4013
4638
|
function assertOptions(options, schema, allowUnknown) {
|
|
4014
4639
|
if (typeof options !== "object") {
|
|
4015
4640
|
throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE);
|
|
@@ -4037,11 +4662,11 @@ var validator_default = {
|
|
|
4037
4662
|
validators
|
|
4038
4663
|
};
|
|
4039
4664
|
|
|
4040
|
-
// node_modules
|
|
4665
|
+
// node_modules/axios/lib/core/Axios.js
|
|
4041
4666
|
var validators2 = validator_default.validators;
|
|
4042
4667
|
var Axios = class {
|
|
4043
4668
|
constructor(instanceConfig) {
|
|
4044
|
-
this.defaults = instanceConfig;
|
|
4669
|
+
this.defaults = instanceConfig || {};
|
|
4045
4670
|
this.interceptors = {
|
|
4046
4671
|
request: new InterceptorManager_default(),
|
|
4047
4672
|
response: new InterceptorManager_default()
|
|
@@ -4055,7 +4680,27 @@ var Axios = class {
|
|
|
4055
4680
|
*
|
|
4056
4681
|
* @returns {Promise} The Promise to be fulfilled
|
|
4057
4682
|
*/
|
|
4058
|
-
request(configOrUrl, config) {
|
|
4683
|
+
async request(configOrUrl, config) {
|
|
4684
|
+
try {
|
|
4685
|
+
return await this._request(configOrUrl, config);
|
|
4686
|
+
} catch (err) {
|
|
4687
|
+
if (err instanceof Error) {
|
|
4688
|
+
let dummy = {};
|
|
4689
|
+
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
4690
|
+
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
|
|
4691
|
+
try {
|
|
4692
|
+
if (!err.stack) {
|
|
4693
|
+
err.stack = stack;
|
|
4694
|
+
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
|
|
4695
|
+
err.stack += "\n" + stack;
|
|
4696
|
+
}
|
|
4697
|
+
} catch (e) {
|
|
4698
|
+
}
|
|
4699
|
+
}
|
|
4700
|
+
throw err;
|
|
4701
|
+
}
|
|
4702
|
+
}
|
|
4703
|
+
_request(configOrUrl, config) {
|
|
4059
4704
|
if (typeof configOrUrl === "string") {
|
|
4060
4705
|
config = config || {};
|
|
4061
4706
|
config.url = configOrUrl;
|
|
@@ -4071,19 +4716,34 @@ var Axios = class {
|
|
|
4071
4716
|
clarifyTimeoutError: validators2.transitional(validators2.boolean)
|
|
4072
4717
|
}, false);
|
|
4073
4718
|
}
|
|
4074
|
-
if (paramsSerializer
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4719
|
+
if (paramsSerializer != null) {
|
|
4720
|
+
if (utils_default.isFunction(paramsSerializer)) {
|
|
4721
|
+
config.paramsSerializer = {
|
|
4722
|
+
serialize: paramsSerializer
|
|
4723
|
+
};
|
|
4724
|
+
} else {
|
|
4725
|
+
validator_default.assertOptions(paramsSerializer, {
|
|
4726
|
+
encode: validators2.function,
|
|
4727
|
+
serialize: validators2.function
|
|
4728
|
+
}, true);
|
|
4729
|
+
}
|
|
4730
|
+
}
|
|
4731
|
+
if (config.allowAbsoluteUrls !== void 0) {
|
|
4732
|
+
} else if (this.defaults.allowAbsoluteUrls !== void 0) {
|
|
4733
|
+
config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
|
|
4734
|
+
} else {
|
|
4735
|
+
config.allowAbsoluteUrls = true;
|
|
4079
4736
|
}
|
|
4737
|
+
validator_default.assertOptions(config, {
|
|
4738
|
+
baseUrl: validators2.spelling("baseURL"),
|
|
4739
|
+
withXsrfToken: validators2.spelling("withXSRFToken")
|
|
4740
|
+
}, true);
|
|
4080
4741
|
config.method = (config.method || this.defaults.method || "get").toLowerCase();
|
|
4081
|
-
let contextHeaders
|
|
4082
|
-
contextHeaders = headers && utils_default.merge(
|
|
4742
|
+
let contextHeaders = headers && utils_default.merge(
|
|
4083
4743
|
headers.common,
|
|
4084
4744
|
headers[config.method]
|
|
4085
4745
|
);
|
|
4086
|
-
|
|
4746
|
+
headers && utils_default.forEach(
|
|
4087
4747
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
4088
4748
|
(method) => {
|
|
4089
4749
|
delete headers[method];
|
|
@@ -4144,11 +4804,11 @@ var Axios = class {
|
|
|
4144
4804
|
}
|
|
4145
4805
|
getUri(config) {
|
|
4146
4806
|
config = mergeConfig(this.defaults, config);
|
|
4147
|
-
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
4807
|
+
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
|
4148
4808
|
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
4149
4809
|
}
|
|
4150
4810
|
};
|
|
4151
|
-
utils_default.forEach(["delete", "get", "head", "options"], function
|
|
4811
|
+
utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
|
|
4152
4812
|
Axios.prototype[method] = function(url2, config) {
|
|
4153
4813
|
return this.request(mergeConfig(config || {}, {
|
|
4154
4814
|
method,
|
|
@@ -4157,7 +4817,7 @@ utils_default.forEach(["delete", "get", "head", "options"], function forEachMeth
|
|
|
4157
4817
|
}));
|
|
4158
4818
|
};
|
|
4159
4819
|
});
|
|
4160
|
-
utils_default.forEach(["post", "put", "patch"], function
|
|
4820
|
+
utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
4161
4821
|
function generateHTTPMethod(isForm) {
|
|
4162
4822
|
return function httpMethod(url2, data, config) {
|
|
4163
4823
|
return this.request(mergeConfig(config || {}, {
|
|
@@ -4175,7 +4835,7 @@ utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData2(
|
|
|
4175
4835
|
});
|
|
4176
4836
|
var Axios_default = Axios;
|
|
4177
4837
|
|
|
4178
|
-
// node_modules
|
|
4838
|
+
// node_modules/axios/lib/cancel/CancelToken.js
|
|
4179
4839
|
var CancelToken = class _CancelToken {
|
|
4180
4840
|
constructor(executor) {
|
|
4181
4841
|
if (typeof executor !== "function") {
|
|
@@ -4247,6 +4907,15 @@ var CancelToken = class _CancelToken {
|
|
|
4247
4907
|
this._listeners.splice(index, 1);
|
|
4248
4908
|
}
|
|
4249
4909
|
}
|
|
4910
|
+
toAbortSignal() {
|
|
4911
|
+
const controller = new AbortController();
|
|
4912
|
+
const abort = (err) => {
|
|
4913
|
+
controller.abort(err);
|
|
4914
|
+
};
|
|
4915
|
+
this.subscribe(abort);
|
|
4916
|
+
controller.signal.unsubscribe = () => this.unsubscribe(abort);
|
|
4917
|
+
return controller.signal;
|
|
4918
|
+
}
|
|
4250
4919
|
/**
|
|
4251
4920
|
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
4252
4921
|
* cancels the `CancelToken`.
|
|
@@ -4264,19 +4933,19 @@ var CancelToken = class _CancelToken {
|
|
|
4264
4933
|
};
|
|
4265
4934
|
var CancelToken_default = CancelToken;
|
|
4266
4935
|
|
|
4267
|
-
// node_modules
|
|
4936
|
+
// node_modules/axios/lib/helpers/spread.js
|
|
4268
4937
|
function spread(callback) {
|
|
4269
4938
|
return function wrap(arr) {
|
|
4270
4939
|
return callback.apply(null, arr);
|
|
4271
4940
|
};
|
|
4272
4941
|
}
|
|
4273
4942
|
|
|
4274
|
-
// node_modules
|
|
4943
|
+
// node_modules/axios/lib/helpers/isAxiosError.js
|
|
4275
4944
|
function isAxiosError(payload) {
|
|
4276
4945
|
return utils_default.isObject(payload) && payload.isAxiosError === true;
|
|
4277
4946
|
}
|
|
4278
4947
|
|
|
4279
|
-
// node_modules
|
|
4948
|
+
// node_modules/axios/lib/helpers/HttpStatusCode.js
|
|
4280
4949
|
var HttpStatusCode = {
|
|
4281
4950
|
Continue: 100,
|
|
4282
4951
|
SwitchingProtocols: 101,
|
|
@@ -4347,7 +5016,7 @@ Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
|
4347
5016
|
});
|
|
4348
5017
|
var HttpStatusCode_default = HttpStatusCode;
|
|
4349
5018
|
|
|
4350
|
-
// node_modules
|
|
5019
|
+
// node_modules/axios/lib/axios.js
|
|
4351
5020
|
function createInstance(defaultConfig) {
|
|
4352
5021
|
const context = new Axios_default(defaultConfig);
|
|
4353
5022
|
const instance = bind(Axios_default.prototype.request, context);
|
|
@@ -4375,11 +5044,12 @@ axios.isAxiosError = isAxiosError;
|
|
|
4375
5044
|
axios.mergeConfig = mergeConfig;
|
|
4376
5045
|
axios.AxiosHeaders = AxiosHeaders_default;
|
|
4377
5046
|
axios.formToJSON = (thing) => formDataToJSON_default(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
5047
|
+
axios.getAdapter = adapters_default.getAdapter;
|
|
4378
5048
|
axios.HttpStatusCode = HttpStatusCode_default;
|
|
4379
5049
|
axios.default = axios;
|
|
4380
5050
|
var axios_default = axios;
|
|
4381
5051
|
|
|
4382
|
-
// node_modules
|
|
5052
|
+
// node_modules/axios/index.js
|
|
4383
5053
|
var {
|
|
4384
5054
|
Axios: Axios2,
|
|
4385
5055
|
AxiosError: AxiosError2,
|
|
@@ -4395,6 +5065,7 @@ var {
|
|
|
4395
5065
|
AxiosHeaders: AxiosHeaders2,
|
|
4396
5066
|
HttpStatusCode: HttpStatusCode2,
|
|
4397
5067
|
formToJSON,
|
|
5068
|
+
getAdapter,
|
|
4398
5069
|
mergeConfig: mergeConfig2
|
|
4399
5070
|
} = axios_default;
|
|
4400
5071
|
|
|
@@ -4403,7 +5074,7 @@ var import_fs_extra4 = __toESM(require("fs-extra"));
|
|
|
4403
5074
|
var import_path5 = __toESM(require("path"));
|
|
4404
5075
|
var import_form_data2 = __toESM(require("form-data"));
|
|
4405
5076
|
var import_ora = __toESM(require("ora"));
|
|
4406
|
-
var
|
|
5077
|
+
var crypto2 = __toESM(require("crypto"));
|
|
4407
5078
|
|
|
4408
5079
|
// bin/utils/uploadLimits.ts
|
|
4409
5080
|
var import_fs = __toESM(require("fs"));
|
|
@@ -4737,7 +5408,7 @@ var StepProgressBar = class {
|
|
|
4737
5408
|
};
|
|
4738
5409
|
async function calculateMD5(filePath) {
|
|
4739
5410
|
return new Promise((resolve, reject) => {
|
|
4740
|
-
const hash =
|
|
5411
|
+
const hash = crypto2.createHash("md5");
|
|
4741
5412
|
const stream4 = import_fs_extra4.default.createReadStream(filePath);
|
|
4742
5413
|
stream4.on("data", hash.update.bind(hash));
|
|
4743
5414
|
stream4.on("end", () => resolve(hash.digest("hex")));
|
|
@@ -4928,11 +5599,15 @@ async function uploadFileChunks(filePath, sessionId, totalChunks, chunkSize, dev
|
|
|
4928
5599
|
throw fatalError ? new Error(fatalError) : error;
|
|
4929
5600
|
}
|
|
4930
5601
|
}
|
|
4931
|
-
async function completeChunkUpload(sessionId, deviceId) {
|
|
5602
|
+
async function completeChunkUpload(sessionId, deviceId, importAsCar = false) {
|
|
4932
5603
|
try {
|
|
5604
|
+
const requestBody = { session_id: sessionId, uid: deviceId };
|
|
5605
|
+
if (importAsCar) {
|
|
5606
|
+
requestBody.import_as_car = true;
|
|
5607
|
+
}
|
|
4933
5608
|
const response = await axios_default.post(
|
|
4934
5609
|
`${IPFS_API_URL}/chunk/complete`,
|
|
4935
|
-
|
|
5610
|
+
requestBody,
|
|
4936
5611
|
{
|
|
4937
5612
|
timeout: TIMEOUT,
|
|
4938
5613
|
headers: { "Content-Type": "application/json" }
|
|
@@ -5008,7 +5683,7 @@ async function monitorChunkProgress(traceId, deviceId, progressBar) {
|
|
|
5008
5683
|
}
|
|
5009
5684
|
}
|
|
5010
5685
|
}
|
|
5011
|
-
async function uploadDirectoryInChunks(directoryPath, deviceId) {
|
|
5686
|
+
async function uploadDirectoryInChunks(directoryPath, deviceId, importAsCar = false) {
|
|
5012
5687
|
const sizeCheck = checkDirectorySizeLimit(directoryPath);
|
|
5013
5688
|
if (sizeCheck.exceeds) {
|
|
5014
5689
|
throw new Error(
|
|
@@ -5036,7 +5711,7 @@ async function uploadDirectoryInChunks(directoryPath, deviceId) {
|
|
|
5036
5711
|
);
|
|
5037
5712
|
progressBar.completeStep();
|
|
5038
5713
|
progressBar.startStep(3, "Completing upload");
|
|
5039
|
-
const traceId = await completeChunkUpload(sessionInfo.session_id, deviceId);
|
|
5714
|
+
const traceId = await completeChunkUpload(sessionInfo.session_id, deviceId, importAsCar);
|
|
5040
5715
|
progressBar.completeStep();
|
|
5041
5716
|
progressBar.startStep(4, "Waiting for processing");
|
|
5042
5717
|
const result = await monitorChunkProgress(traceId, deviceId, progressBar);
|
|
@@ -5065,7 +5740,7 @@ async function uploadDirectoryInChunks(directoryPath, deviceId) {
|
|
|
5065
5740
|
throw error;
|
|
5066
5741
|
}
|
|
5067
5742
|
}
|
|
5068
|
-
async function uploadFileInChunks(filePath, deviceId) {
|
|
5743
|
+
async function uploadFileInChunks(filePath, deviceId, importAsCar = false) {
|
|
5069
5744
|
const sizeCheck = checkFileSizeLimit(filePath);
|
|
5070
5745
|
if (sizeCheck.exceeds) {
|
|
5071
5746
|
throw new Error(
|
|
@@ -5091,7 +5766,7 @@ async function uploadFileInChunks(filePath, deviceId) {
|
|
|
5091
5766
|
);
|
|
5092
5767
|
progressBar.completeStep();
|
|
5093
5768
|
progressBar.startStep(2, "Completing upload");
|
|
5094
|
-
const traceId = await completeChunkUpload(sessionInfo.session_id, deviceId);
|
|
5769
|
+
const traceId = await completeChunkUpload(sessionInfo.session_id, deviceId, importAsCar);
|
|
5095
5770
|
progressBar.completeStep();
|
|
5096
5771
|
progressBar.startStep(3, "Waiting for processing");
|
|
5097
5772
|
const result = await monitorChunkProgress(traceId, deviceId, progressBar);
|
|
@@ -5117,14 +5792,14 @@ async function uploadFileInChunks(filePath, deviceId) {
|
|
|
5117
5792
|
throw error;
|
|
5118
5793
|
}
|
|
5119
5794
|
}
|
|
5120
|
-
async function uploadToIpfsSplit_default(filePath) {
|
|
5795
|
+
async function uploadToIpfsSplit_default(filePath, importAsCar = false) {
|
|
5121
5796
|
const deviceId = getUid();
|
|
5122
5797
|
if (!deviceId) {
|
|
5123
5798
|
throw new Error("Device ID not found");
|
|
5124
5799
|
}
|
|
5125
5800
|
try {
|
|
5126
5801
|
const isDirectory = import_fs_extra4.default.statSync(filePath).isDirectory();
|
|
5127
|
-
const result = isDirectory ? await uploadDirectoryInChunks(filePath, deviceId) : await uploadFileInChunks(filePath, deviceId);
|
|
5802
|
+
const result = isDirectory ? await uploadDirectoryInChunks(filePath, deviceId, importAsCar) : await uploadFileInChunks(filePath, deviceId, importAsCar);
|
|
5128
5803
|
if (result == null ? void 0 : result.hash) {
|
|
5129
5804
|
return {
|
|
5130
5805
|
contentHash: result.hash,
|
|
@@ -5389,18 +6064,183 @@ var upload_default = async (options) => {
|
|
|
5389
6064
|
}
|
|
5390
6065
|
};
|
|
5391
6066
|
|
|
5392
|
-
// bin/
|
|
5393
|
-
var
|
|
6067
|
+
// bin/import.ts
|
|
6068
|
+
var import_path7 = __toESM(require("path"));
|
|
6069
|
+
var import_chalk5 = __toESM(require("chalk"));
|
|
5394
6070
|
var import_inquirer2 = __toESM(require("inquirer"));
|
|
5395
6071
|
var import_figlet2 = __toESM(require("figlet"));
|
|
6072
|
+
var import_fs3 = __toESM(require("fs"));
|
|
6073
|
+
var import_crypto_js2 = __toESM(require("crypto-js"));
|
|
6074
|
+
var URL3 = "https://pinme.eth.limo/#/preview/";
|
|
6075
|
+
var secretKey2 = "pinme-secret-key";
|
|
6076
|
+
checkNodeVersion();
|
|
6077
|
+
function encryptHash2(contentHash, key, uid) {
|
|
6078
|
+
try {
|
|
6079
|
+
if (!key) {
|
|
6080
|
+
throw new Error("Secret key not found");
|
|
6081
|
+
}
|
|
6082
|
+
const combined = uid ? `${contentHash}-${uid}` : contentHash;
|
|
6083
|
+
const encrypted = import_crypto_js2.default.RC4.encrypt(combined, key).toString();
|
|
6084
|
+
const urlSafe = encrypted.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
6085
|
+
return urlSafe;
|
|
6086
|
+
} catch (error) {
|
|
6087
|
+
console.error(`Encryption error: ${error.message}`);
|
|
6088
|
+
return contentHash;
|
|
6089
|
+
}
|
|
6090
|
+
}
|
|
6091
|
+
function checkPathSync2(inputPath) {
|
|
6092
|
+
try {
|
|
6093
|
+
const absolutePath = import_path7.default.resolve(inputPath);
|
|
6094
|
+
if (import_fs3.default.existsSync(absolutePath)) {
|
|
6095
|
+
return absolutePath;
|
|
6096
|
+
}
|
|
6097
|
+
return null;
|
|
6098
|
+
} catch (error) {
|
|
6099
|
+
console.error(import_chalk5.default.red(`error checking path: ${error.message}`));
|
|
6100
|
+
return null;
|
|
6101
|
+
}
|
|
6102
|
+
}
|
|
6103
|
+
function getDomainFromArgs2() {
|
|
6104
|
+
const args = process.argv.slice(2);
|
|
6105
|
+
const dIdx = args.findIndex((a) => a === "--domain" || a === "-d");
|
|
6106
|
+
if (dIdx >= 0 && args[dIdx + 1] && !args[dIdx + 1].startsWith("-")) {
|
|
6107
|
+
return String(args[dIdx + 1]).trim();
|
|
6108
|
+
}
|
|
6109
|
+
return null;
|
|
6110
|
+
}
|
|
6111
|
+
function getUid2() {
|
|
6112
|
+
const auth = getAuthConfig();
|
|
6113
|
+
if (auth == null ? void 0 : auth.address) {
|
|
6114
|
+
return auth.address;
|
|
6115
|
+
}
|
|
6116
|
+
return getDeviceId();
|
|
6117
|
+
}
|
|
6118
|
+
var import_default = async (options) => {
|
|
6119
|
+
try {
|
|
6120
|
+
console.log(
|
|
6121
|
+
import_figlet2.default.textSync("PINME IMPORT", {
|
|
6122
|
+
font: "Standard",
|
|
6123
|
+
horizontalLayout: "default",
|
|
6124
|
+
verticalLayout: "default",
|
|
6125
|
+
width: 180,
|
|
6126
|
+
whitespaceBreak: true
|
|
6127
|
+
})
|
|
6128
|
+
);
|
|
6129
|
+
const argPath = process.argv[3];
|
|
6130
|
+
const domainArg = getDomainFromArgs2();
|
|
6131
|
+
if (argPath && !argPath.startsWith("-")) {
|
|
6132
|
+
const absolutePath = checkPathSync2(argPath);
|
|
6133
|
+
if (!absolutePath) {
|
|
6134
|
+
console.log(import_chalk5.default.red(`path ${argPath} does not exist`));
|
|
6135
|
+
return;
|
|
6136
|
+
}
|
|
6137
|
+
if (domainArg) {
|
|
6138
|
+
const check = await checkDomainAvailable(domainArg);
|
|
6139
|
+
if (!check.is_valid) {
|
|
6140
|
+
console.log(import_chalk5.default.red(`Domain not available: ${check.error || "unknown reason"}`));
|
|
6141
|
+
return;
|
|
6142
|
+
}
|
|
6143
|
+
console.log(import_chalk5.default.green(`Domain available: ${domainArg}`));
|
|
6144
|
+
}
|
|
6145
|
+
console.log(import_chalk5.default.blue(`importing ${absolutePath} to ipfs as CAR...`));
|
|
6146
|
+
try {
|
|
6147
|
+
const result = await uploadToIpfsSplit_default(absolutePath, true);
|
|
6148
|
+
if (result) {
|
|
6149
|
+
const uid = getUid2();
|
|
6150
|
+
const encryptedCID = encryptHash2(result.contentHash, secretKey2, uid);
|
|
6151
|
+
console.log(
|
|
6152
|
+
import_chalk5.default.cyan(
|
|
6153
|
+
import_figlet2.default.textSync("Successful", { horizontalLayout: "full" })
|
|
6154
|
+
)
|
|
6155
|
+
);
|
|
6156
|
+
console.log(import_chalk5.default.cyan(`URL:`));
|
|
6157
|
+
console.log(import_chalk5.default.cyan(`${URL3}${encryptedCID}`));
|
|
6158
|
+
if (domainArg) {
|
|
6159
|
+
console.log(import_chalk5.default.blue(`Binding domain: ${domainArg} with CID: ${result.contentHash}`));
|
|
6160
|
+
const ok = await bindPinmeDomain(domainArg, result.contentHash);
|
|
6161
|
+
if (ok) {
|
|
6162
|
+
console.log(import_chalk5.default.green(`Bind success: ${domainArg}`));
|
|
6163
|
+
console.log(import_chalk5.default.white(`Visit (Pinme subdomain example): https://${domainArg}.pinit.eth.limo`));
|
|
6164
|
+
} else {
|
|
6165
|
+
console.log(import_chalk5.default.red("Binding failed. Please try again later."));
|
|
6166
|
+
}
|
|
6167
|
+
}
|
|
6168
|
+
console.log(import_chalk5.default.green("\n\u{1F389} import successful, program exit"));
|
|
6169
|
+
}
|
|
6170
|
+
} catch (error) {
|
|
6171
|
+
console.error(import_chalk5.default.red(`Error: ${error.message}`));
|
|
6172
|
+
}
|
|
6173
|
+
process.exit(0);
|
|
6174
|
+
}
|
|
6175
|
+
const answer = await import_inquirer2.default.prompt([
|
|
6176
|
+
{
|
|
6177
|
+
type: "input",
|
|
6178
|
+
name: "path",
|
|
6179
|
+
message: "path to import: "
|
|
6180
|
+
}
|
|
6181
|
+
]);
|
|
6182
|
+
if (answer.path) {
|
|
6183
|
+
const absolutePath = checkPathSync2(answer.path);
|
|
6184
|
+
if (!absolutePath) {
|
|
6185
|
+
console.log(import_chalk5.default.red(`path ${answer.path} does not exist`));
|
|
6186
|
+
return;
|
|
6187
|
+
}
|
|
6188
|
+
if (domainArg) {
|
|
6189
|
+
const check = await checkDomainAvailable(domainArg);
|
|
6190
|
+
if (!check.is_valid) {
|
|
6191
|
+
console.log(import_chalk5.default.red(`Domain not available: ${check.error || "unknown reason"}`));
|
|
6192
|
+
return;
|
|
6193
|
+
}
|
|
6194
|
+
console.log(import_chalk5.default.green(`Domain available: ${domainArg}`));
|
|
6195
|
+
}
|
|
6196
|
+
console.log(import_chalk5.default.blue(`importing ${absolutePath} to ipfs as CAR...`));
|
|
6197
|
+
try {
|
|
6198
|
+
const result = await uploadToIpfsSplit_default(absolutePath, true);
|
|
6199
|
+
if (result) {
|
|
6200
|
+
const uid = getUid2();
|
|
6201
|
+
const encryptedCID = encryptHash2(result.contentHash, secretKey2, uid);
|
|
6202
|
+
console.log(
|
|
6203
|
+
import_chalk5.default.cyan(
|
|
6204
|
+
import_figlet2.default.textSync("Successful", { horizontalLayout: "full" })
|
|
6205
|
+
)
|
|
6206
|
+
);
|
|
6207
|
+
console.log(import_chalk5.default.cyan(`URL:`));
|
|
6208
|
+
console.log(import_chalk5.default.cyan(`${URL3}${encryptedCID}`));
|
|
6209
|
+
if (domainArg) {
|
|
6210
|
+
console.log(import_chalk5.default.blue(`Binding domain: ${domainArg} with CID: ${result.contentHash}`));
|
|
6211
|
+
const ok = await bindPinmeDomain(domainArg, result.contentHash);
|
|
6212
|
+
if (ok) {
|
|
6213
|
+
console.log(import_chalk5.default.green(`Bind success: ${domainArg}`));
|
|
6214
|
+
console.log(import_chalk5.default.white(`Visit (Pinme subdomain example): https://${domainArg}.pinit.eth.limo`));
|
|
6215
|
+
} else {
|
|
6216
|
+
console.log(import_chalk5.default.red("Binding failed. Please try again later."));
|
|
6217
|
+
}
|
|
6218
|
+
}
|
|
6219
|
+
console.log(import_chalk5.default.green("\n\u{1F389} import successful, program exit"));
|
|
6220
|
+
}
|
|
6221
|
+
} catch (error) {
|
|
6222
|
+
console.error(import_chalk5.default.red(`Error: ${error.message}`));
|
|
6223
|
+
}
|
|
6224
|
+
process.exit(0);
|
|
6225
|
+
}
|
|
6226
|
+
} catch (error) {
|
|
6227
|
+
console.error(import_chalk5.default.red(`error executing: ${error.message}`));
|
|
6228
|
+
console.error(error.stack);
|
|
6229
|
+
}
|
|
6230
|
+
};
|
|
6231
|
+
|
|
6232
|
+
// bin/remove.ts
|
|
6233
|
+
var import_chalk7 = __toESM(require("chalk"));
|
|
6234
|
+
var import_inquirer3 = __toESM(require("inquirer"));
|
|
6235
|
+
var import_figlet3 = __toESM(require("figlet"));
|
|
5396
6236
|
|
|
5397
6237
|
// bin/utils/removeFromIpfs.ts
|
|
5398
|
-
var
|
|
6238
|
+
var import_chalk6 = __toESM(require("chalk"));
|
|
5399
6239
|
var ipfsApiUrl = "https://pinme.dev/api/v3";
|
|
5400
6240
|
async function removeFromIpfs(value, type = "hash") {
|
|
5401
6241
|
try {
|
|
5402
6242
|
const uid = getUid();
|
|
5403
|
-
console.log(
|
|
6243
|
+
console.log(import_chalk6.default.blue(`Removing content from IPFS: ${value}...`));
|
|
5404
6244
|
const queryParams = new URLSearchParams({
|
|
5405
6245
|
uid
|
|
5406
6246
|
});
|
|
@@ -5418,49 +6258,49 @@ async function removeFromIpfs(value, type = "hash") {
|
|
|
5418
6258
|
);
|
|
5419
6259
|
const { code, msg, data } = response.data;
|
|
5420
6260
|
if (code === 200) {
|
|
5421
|
-
console.log(
|
|
6261
|
+
console.log(import_chalk6.default.green("\u2713 Removal successful!"));
|
|
5422
6262
|
console.log(
|
|
5423
|
-
|
|
6263
|
+
import_chalk6.default.cyan(
|
|
5424
6264
|
`Content ${type}: ${value} has been removed from IPFS network`
|
|
5425
6265
|
)
|
|
5426
6266
|
);
|
|
5427
6267
|
return true;
|
|
5428
6268
|
} else {
|
|
5429
|
-
console.log(
|
|
5430
|
-
console.log(
|
|
6269
|
+
console.log(import_chalk6.default.red("\u2717 Removal failed"));
|
|
6270
|
+
console.log(import_chalk6.default.red(`Error: ${msg || "Unknown error occurred"}`));
|
|
5431
6271
|
return false;
|
|
5432
6272
|
}
|
|
5433
6273
|
} catch (error) {
|
|
5434
|
-
console.log(
|
|
6274
|
+
console.log(import_chalk6.default.red("\u2717 Removal failed", error));
|
|
5435
6275
|
if (error.response) {
|
|
5436
6276
|
const { status, data } = error.response;
|
|
5437
6277
|
console.log(
|
|
5438
|
-
|
|
6278
|
+
import_chalk6.default.red(`HTTP Error ${status}: ${(data == null ? void 0 : data.msg) || "Server error"}`)
|
|
5439
6279
|
);
|
|
5440
6280
|
if (status === 404) {
|
|
5441
6281
|
console.log(
|
|
5442
|
-
|
|
6282
|
+
import_chalk6.default.yellow("Content not found on the network or already removed")
|
|
5443
6283
|
);
|
|
5444
6284
|
} else if (status === 403) {
|
|
5445
6285
|
console.log(
|
|
5446
|
-
|
|
6286
|
+
import_chalk6.default.yellow(
|
|
5447
6287
|
"Permission denied - you may not have access to remove this content"
|
|
5448
6288
|
)
|
|
5449
6289
|
);
|
|
5450
6290
|
} else if (status === 500) {
|
|
5451
6291
|
console.log(
|
|
5452
|
-
|
|
6292
|
+
import_chalk6.default.yellow("Server internal error - please try again later")
|
|
5453
6293
|
);
|
|
5454
6294
|
}
|
|
5455
6295
|
} else if (error.request) {
|
|
5456
6296
|
console.log(
|
|
5457
|
-
|
|
6297
|
+
import_chalk6.default.red("Network error: Unable to connect to IPFS service")
|
|
5458
6298
|
);
|
|
5459
6299
|
console.log(
|
|
5460
|
-
|
|
6300
|
+
import_chalk6.default.yellow("Please check your internet connection and try again")
|
|
5461
6301
|
);
|
|
5462
6302
|
} else {
|
|
5463
|
-
console.log(
|
|
6303
|
+
console.log(import_chalk6.default.red(`Error: ${error.message}`));
|
|
5464
6304
|
}
|
|
5465
6305
|
return false;
|
|
5466
6306
|
}
|
|
@@ -5508,7 +6348,7 @@ function parseInput(input) {
|
|
|
5508
6348
|
var remove_default = async (options) => {
|
|
5509
6349
|
try {
|
|
5510
6350
|
console.log(
|
|
5511
|
-
|
|
6351
|
+
import_figlet3.default.textSync("PINME", {
|
|
5512
6352
|
font: "Standard",
|
|
5513
6353
|
horizontalLayout: "default",
|
|
5514
6354
|
verticalLayout: "default",
|
|
@@ -5520,32 +6360,32 @@ var remove_default = async (options) => {
|
|
|
5520
6360
|
if (argHash && !argHash.startsWith("-")) {
|
|
5521
6361
|
const parsedInput = parseInput(argHash);
|
|
5522
6362
|
if (!parsedInput) {
|
|
5523
|
-
console.log(
|
|
5524
|
-
console.log(
|
|
5525
|
-
console.log(
|
|
5526
|
-
console.log(
|
|
5527
|
-
console.log(
|
|
5528
|
-
console.log(
|
|
6363
|
+
console.log(import_chalk7.default.red(`Invalid input format: ${argHash}`));
|
|
6364
|
+
console.log(import_chalk7.default.yellow("Supported formats:"));
|
|
6365
|
+
console.log(import_chalk7.default.yellow(" - IPFS hash: bafybeig..."));
|
|
6366
|
+
console.log(import_chalk7.default.yellow(" - Full URL: https://bafybeig....pinme.dev"));
|
|
6367
|
+
console.log(import_chalk7.default.yellow(" - Subname: 3abt6ztu"));
|
|
6368
|
+
console.log(import_chalk7.default.yellow(" - Subname URL: https://3abt6ztu.pinit.eth.limo"));
|
|
5529
6369
|
return;
|
|
5530
6370
|
}
|
|
5531
6371
|
try {
|
|
5532
6372
|
const success = await removeFromIpfs(parsedInput.value, parsedInput.type);
|
|
5533
6373
|
if (success) {
|
|
5534
6374
|
console.log(
|
|
5535
|
-
|
|
5536
|
-
|
|
6375
|
+
import_chalk7.default.cyan(
|
|
6376
|
+
import_figlet3.default.textSync("Successful", { horizontalLayout: "full" })
|
|
5537
6377
|
)
|
|
5538
6378
|
);
|
|
5539
6379
|
}
|
|
5540
6380
|
} catch (error) {
|
|
5541
|
-
console.error(
|
|
6381
|
+
console.error(import_chalk7.default.red(`Error: ${error.message}`));
|
|
5542
6382
|
}
|
|
5543
6383
|
return;
|
|
5544
6384
|
}
|
|
5545
|
-
console.log(
|
|
5546
|
-
console.log(
|
|
6385
|
+
console.log(import_chalk7.default.yellow("\u26A0\uFE0F Warning: This action will permanently remove the content from IPFS network"));
|
|
6386
|
+
console.log(import_chalk7.default.yellow("\u26A0\uFE0F Make sure you have the correct IPFS hash"));
|
|
5547
6387
|
console.log("");
|
|
5548
|
-
const confirmAnswer = await
|
|
6388
|
+
const confirmAnswer = await import_inquirer3.default.prompt([
|
|
5549
6389
|
{
|
|
5550
6390
|
type: "confirm",
|
|
5551
6391
|
name: "confirm",
|
|
@@ -5554,10 +6394,10 @@ var remove_default = async (options) => {
|
|
|
5554
6394
|
}
|
|
5555
6395
|
]);
|
|
5556
6396
|
if (!confirmAnswer.confirm) {
|
|
5557
|
-
console.log(
|
|
6397
|
+
console.log(import_chalk7.default.yellow("Operation cancelled"));
|
|
5558
6398
|
return;
|
|
5559
6399
|
}
|
|
5560
|
-
const answer = await
|
|
6400
|
+
const answer = await import_inquirer3.default.prompt([
|
|
5561
6401
|
{
|
|
5562
6402
|
type: "input",
|
|
5563
6403
|
name: "input",
|
|
@@ -5577,10 +6417,10 @@ var remove_default = async (options) => {
|
|
|
5577
6417
|
if (answer.input) {
|
|
5578
6418
|
const parsedInput = parseInput(answer.input.trim());
|
|
5579
6419
|
if (!parsedInput) {
|
|
5580
|
-
console.log(
|
|
6420
|
+
console.log(import_chalk7.default.red("Invalid input format"));
|
|
5581
6421
|
return;
|
|
5582
6422
|
}
|
|
5583
|
-
const finalConfirm = await
|
|
6423
|
+
const finalConfirm = await import_inquirer3.default.prompt([
|
|
5584
6424
|
{
|
|
5585
6425
|
type: "confirm",
|
|
5586
6426
|
name: "confirm",
|
|
@@ -5589,37 +6429,37 @@ var remove_default = async (options) => {
|
|
|
5589
6429
|
}
|
|
5590
6430
|
]);
|
|
5591
6431
|
if (!finalConfirm.confirm) {
|
|
5592
|
-
console.log(
|
|
6432
|
+
console.log(import_chalk7.default.yellow("Operation cancelled"));
|
|
5593
6433
|
return;
|
|
5594
6434
|
}
|
|
5595
6435
|
try {
|
|
5596
6436
|
const success = await removeFromIpfs(parsedInput.value, parsedInput.type);
|
|
5597
6437
|
if (success) {
|
|
5598
6438
|
console.log(
|
|
5599
|
-
|
|
5600
|
-
|
|
6439
|
+
import_chalk7.default.cyan(
|
|
6440
|
+
import_figlet3.default.textSync("Successful", { horizontalLayout: "full" })
|
|
5601
6441
|
)
|
|
5602
6442
|
);
|
|
5603
6443
|
}
|
|
5604
6444
|
} catch (error) {
|
|
5605
|
-
console.error(
|
|
6445
|
+
console.error(import_chalk7.default.red(`Error: ${error.message}`));
|
|
5606
6446
|
}
|
|
5607
6447
|
}
|
|
5608
6448
|
} catch (error) {
|
|
5609
|
-
console.error(
|
|
6449
|
+
console.error(import_chalk7.default.red(`Error executing remove command: ${error.message}`));
|
|
5610
6450
|
console.error(error.stack);
|
|
5611
6451
|
}
|
|
5612
6452
|
};
|
|
5613
6453
|
|
|
5614
6454
|
// bin/set-appkey.ts
|
|
5615
|
-
var
|
|
5616
|
-
var
|
|
6455
|
+
var import_chalk8 = __toESM(require("chalk"));
|
|
6456
|
+
var import_inquirer4 = __toESM(require("inquirer"));
|
|
5617
6457
|
async function setAppKeyCmd() {
|
|
5618
6458
|
try {
|
|
5619
6459
|
const argAppKey = process.argv[3];
|
|
5620
6460
|
let appKey = argAppKey;
|
|
5621
6461
|
if (!appKey) {
|
|
5622
|
-
const ans = await
|
|
6462
|
+
const ans = await import_inquirer4.default.prompt([
|
|
5623
6463
|
{
|
|
5624
6464
|
type: "input",
|
|
5625
6465
|
name: "appKey",
|
|
@@ -5629,34 +6469,34 @@ async function setAppKeyCmd() {
|
|
|
5629
6469
|
appKey = ans.appKey;
|
|
5630
6470
|
}
|
|
5631
6471
|
if (!appKey) {
|
|
5632
|
-
console.log(
|
|
6472
|
+
console.log(import_chalk8.default.red("AppKey not provided."));
|
|
5633
6473
|
return;
|
|
5634
6474
|
}
|
|
5635
6475
|
const saved = setAuthToken(appKey);
|
|
5636
|
-
console.log(
|
|
6476
|
+
console.log(import_chalk8.default.green(`Auth set for address: ${saved.address}`));
|
|
5637
6477
|
const deviceId = getDeviceId();
|
|
5638
6478
|
const ok = await bindAnonymousDevice(deviceId);
|
|
5639
6479
|
if (ok) {
|
|
5640
|
-
console.log(
|
|
6480
|
+
console.log(import_chalk8.default.green("Anonymous history merged to current account."));
|
|
5641
6481
|
} else {
|
|
5642
|
-
console.log(
|
|
6482
|
+
console.log(import_chalk8.default.yellow("Anonymous history merge not confirmed. You may retry later."));
|
|
5643
6483
|
}
|
|
5644
6484
|
} catch (e) {
|
|
5645
|
-
console.log(
|
|
6485
|
+
console.log(import_chalk8.default.red(`Failed to set AppKey: ${(e == null ? void 0 : e.message) || e}`));
|
|
5646
6486
|
}
|
|
5647
6487
|
}
|
|
5648
6488
|
|
|
5649
6489
|
// bin/logout.ts
|
|
5650
|
-
var
|
|
5651
|
-
var
|
|
6490
|
+
var import_chalk9 = __toESM(require("chalk"));
|
|
6491
|
+
var import_inquirer5 = __toESM(require("inquirer"));
|
|
5652
6492
|
async function logoutCmd() {
|
|
5653
6493
|
try {
|
|
5654
6494
|
const auth = getAuthConfig();
|
|
5655
6495
|
if (!auth) {
|
|
5656
|
-
console.log(
|
|
6496
|
+
console.log(import_chalk9.default.yellow("No active session found. You are already logged out."));
|
|
5657
6497
|
return;
|
|
5658
6498
|
}
|
|
5659
|
-
const answer = await
|
|
6499
|
+
const answer = await import_inquirer5.default.prompt([
|
|
5660
6500
|
{
|
|
5661
6501
|
type: "confirm",
|
|
5662
6502
|
name: "confirm",
|
|
@@ -5665,74 +6505,74 @@ async function logoutCmd() {
|
|
|
5665
6505
|
}
|
|
5666
6506
|
]);
|
|
5667
6507
|
if (!answer.confirm) {
|
|
5668
|
-
console.log(
|
|
6508
|
+
console.log(import_chalk9.default.blue("Logout cancelled."));
|
|
5669
6509
|
return;
|
|
5670
6510
|
}
|
|
5671
6511
|
clearAuthToken();
|
|
5672
|
-
console.log(
|
|
5673
|
-
console.log(
|
|
6512
|
+
console.log(import_chalk9.default.green("Successfully logged out."));
|
|
6513
|
+
console.log(import_chalk9.default.gray(`Address ${auth.address} has been removed from local storage.`));
|
|
5674
6514
|
} catch (e) {
|
|
5675
|
-
console.log(
|
|
6515
|
+
console.log(import_chalk9.default.red(`Failed to logout: ${(e == null ? void 0 : e.message) || e}`));
|
|
5676
6516
|
}
|
|
5677
6517
|
}
|
|
5678
6518
|
|
|
5679
6519
|
// bin/show-appkey.ts
|
|
5680
|
-
var
|
|
6520
|
+
var import_chalk10 = __toESM(require("chalk"));
|
|
5681
6521
|
function showAppKeyCmd() {
|
|
5682
6522
|
try {
|
|
5683
6523
|
const auth = getAuthConfig();
|
|
5684
6524
|
if (!auth) {
|
|
5685
|
-
console.log(
|
|
5686
|
-
console.log(
|
|
6525
|
+
console.log(import_chalk10.default.yellow("No AppKey found. Please set your AppKey first."));
|
|
6526
|
+
console.log(import_chalk10.default.gray("Run: pinme set-appkey <AppKey>"));
|
|
5687
6527
|
return;
|
|
5688
6528
|
}
|
|
5689
|
-
console.log(
|
|
5690
|
-
console.log(
|
|
6529
|
+
console.log(import_chalk10.default.green("Current AppKey Information:"));
|
|
6530
|
+
console.log(import_chalk10.default.cyan(` Address: ${auth.address}`));
|
|
5691
6531
|
const token = auth.token;
|
|
5692
6532
|
if (token.length > 12) {
|
|
5693
6533
|
const maskedToken = `${token.substring(0, 8)}${"*".repeat(token.length - 12)}${token.substring(token.length - 4)}`;
|
|
5694
|
-
console.log(
|
|
6534
|
+
console.log(import_chalk10.default.cyan(` Token: ${maskedToken}`));
|
|
5695
6535
|
} else {
|
|
5696
|
-
console.log(
|
|
6536
|
+
console.log(import_chalk10.default.cyan(` Token: ${"*".repeat(token.length)}`));
|
|
5697
6537
|
}
|
|
5698
6538
|
const combined = `${auth.address}-${auth.token}`;
|
|
5699
6539
|
if (combined.length > 20) {
|
|
5700
6540
|
const maskedAppKey = `${combined.substring(0, 12)}${"*".repeat(combined.length - 16)}${combined.substring(combined.length - 4)}`;
|
|
5701
|
-
console.log(
|
|
6541
|
+
console.log(import_chalk10.default.cyan(` AppKey: ${maskedAppKey}`));
|
|
5702
6542
|
} else {
|
|
5703
|
-
console.log(
|
|
6543
|
+
console.log(import_chalk10.default.cyan(` AppKey: ${"*".repeat(combined.length)}`));
|
|
5704
6544
|
}
|
|
5705
6545
|
} catch (e) {
|
|
5706
|
-
console.log(
|
|
6546
|
+
console.log(import_chalk10.default.red(`Failed to show AppKey: ${(e == null ? void 0 : e.message) || e}`));
|
|
5707
6547
|
}
|
|
5708
6548
|
}
|
|
5709
6549
|
|
|
5710
6550
|
// bin/my-domains.ts
|
|
5711
|
-
var
|
|
6551
|
+
var import_chalk11 = __toESM(require("chalk"));
|
|
5712
6552
|
var import_dayjs2 = __toESM(require("dayjs"));
|
|
5713
6553
|
async function myDomainsCmd() {
|
|
5714
6554
|
try {
|
|
5715
6555
|
const list = await getMyDomains();
|
|
5716
6556
|
if (!list.length) {
|
|
5717
|
-
console.log(
|
|
6557
|
+
console.log(import_chalk11.default.yellow("No bound domains found."));
|
|
5718
6558
|
return;
|
|
5719
6559
|
}
|
|
5720
|
-
console.log(
|
|
5721
|
-
console.log(
|
|
6560
|
+
console.log(import_chalk11.default.cyan("My domains:"));
|
|
6561
|
+
console.log(import_chalk11.default.cyan("-".repeat(80)));
|
|
5722
6562
|
list.forEach((item, i) => {
|
|
5723
|
-
console.log(
|
|
5724
|
-
console.log(
|
|
6563
|
+
console.log(import_chalk11.default.green(`${i + 1}. ${item.domain_name}`));
|
|
6564
|
+
console.log(import_chalk11.default.white(` Type: ${item.domain_type}`));
|
|
5725
6565
|
if (item.bind_time) {
|
|
5726
|
-
console.log(
|
|
6566
|
+
console.log(import_chalk11.default.white(` Bind time: ${(0, import_dayjs2.default)(item.bind_time * 1e3).format("YYYY-MM-DD HH:mm:ss")}`));
|
|
5727
6567
|
}
|
|
5728
6568
|
if (typeof item.expire_time === "number") {
|
|
5729
6569
|
const label = item.expire_time === 0 ? "Never" : (0, import_dayjs2.default)(item.expire_time * 1e3).format("YYYY-MM-DD HH:mm:ss");
|
|
5730
|
-
console.log(
|
|
6570
|
+
console.log(import_chalk11.default.white(` Expire time: ${label}`));
|
|
5731
6571
|
}
|
|
5732
|
-
console.log(
|
|
6572
|
+
console.log(import_chalk11.default.cyan("-".repeat(80)));
|
|
5733
6573
|
});
|
|
5734
6574
|
} catch (e) {
|
|
5735
|
-
console.log(
|
|
6575
|
+
console.log(import_chalk11.default.red(`Failed to fetch domains: ${(e == null ? void 0 : e.message) || e}`));
|
|
5736
6576
|
}
|
|
5737
6577
|
}
|
|
5738
6578
|
|
|
@@ -5741,15 +6581,16 @@ import_dotenv.default.config();
|
|
|
5741
6581
|
checkNodeVersion();
|
|
5742
6582
|
function showBanner() {
|
|
5743
6583
|
console.log(
|
|
5744
|
-
|
|
6584
|
+
import_chalk12.default.cyan(import_figlet4.default.textSync("Pinme", { horizontalLayout: "full" }))
|
|
5745
6585
|
);
|
|
5746
|
-
console.log(
|
|
6586
|
+
console.log(import_chalk12.default.cyan("A command-line tool for uploading files to IPFS\n"));
|
|
5747
6587
|
}
|
|
5748
6588
|
var program = new import_commander.Command();
|
|
5749
6589
|
program.name("pinme").version(version).option("-v, --version", "output the current version");
|
|
5750
6590
|
program.command("upload").description(
|
|
5751
6591
|
"upload a file or directory to IPFS. Supports --domain to bind after upload"
|
|
5752
6592
|
).option("-d, --domain <name>", "Pinme subdomain").action(() => upload_default());
|
|
6593
|
+
program.command("import").description("import a CAR file to IPFS. Supports --domain to bind after import").option("-d, --domain <name>", "Pinme subdomain").action(() => import_default());
|
|
5753
6594
|
program.command("rm").description("remove a file from IPFS network").action(() => remove_default());
|
|
5754
6595
|
program.command("set-appkey").description(
|
|
5755
6596
|
"Set AppKey for authentication, and auto-merge anonymous history"
|
|
@@ -5789,6 +6630,8 @@ program.on("--help", () => {
|
|
|
5789
6630
|
console.log("Examples:");
|
|
5790
6631
|
console.log(" $ pinme upload");
|
|
5791
6632
|
console.log(" $ pinme upload <path> --domain <name>");
|
|
6633
|
+
console.log(" $ pinme import");
|
|
6634
|
+
console.log(" $ pinme import <path> --domain <name>");
|
|
5792
6635
|
console.log(" $ pinme rm <hash>");
|
|
5793
6636
|
console.log(" $ pinme set-appkey <AppKey>");
|
|
5794
6637
|
console.log(" $ pinme show-appkey");
|