pinme 1.1.0 → 1.1.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +1199 -1540
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8,10 +8,6 @@ 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
|
-
};
|
|
15
11
|
var __copyProps = (to, from, except, desc) => {
|
|
16
12
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
13
|
for (let key of __getOwnPropNames(from))
|
|
@@ -29,9 +25,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
25
|
mod
|
|
30
26
|
));
|
|
31
27
|
|
|
32
|
-
// node_modules/dotenv/package.json
|
|
28
|
+
// node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/package.json
|
|
33
29
|
var require_package = __commonJS({
|
|
34
|
-
"node_modules/dotenv/package.json"(exports2, module2) {
|
|
30
|
+
"node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/package.json"(exports2, module2) {
|
|
35
31
|
module2.exports = {
|
|
36
32
|
name: "dotenv",
|
|
37
33
|
version: "16.5.0",
|
|
@@ -97,13 +93,13 @@ var require_package = __commonJS({
|
|
|
97
93
|
}
|
|
98
94
|
});
|
|
99
95
|
|
|
100
|
-
// node_modules/dotenv/lib/main.js
|
|
96
|
+
// node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/lib/main.js
|
|
101
97
|
var require_main = __commonJS({
|
|
102
|
-
"node_modules/dotenv/lib/main.js"(exports2, module2) {
|
|
98
|
+
"node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/lib/main.js"(exports2, module2) {
|
|
103
99
|
var fs6 = require("fs");
|
|
104
100
|
var path6 = require("path");
|
|
105
101
|
var os3 = require("os");
|
|
106
|
-
var
|
|
102
|
+
var crypto = require("crypto");
|
|
107
103
|
var packageJson = require_package();
|
|
108
104
|
var version2 = packageJson.version;
|
|
109
105
|
var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
@@ -299,7 +295,7 @@ var require_main = __commonJS({
|
|
|
299
295
|
const authTag = ciphertext.subarray(-16);
|
|
300
296
|
ciphertext = ciphertext.subarray(12, -16);
|
|
301
297
|
try {
|
|
302
|
-
const aesgcm =
|
|
298
|
+
const aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
|
|
303
299
|
aesgcm.setAuthTag(authTag);
|
|
304
300
|
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
|
|
305
301
|
} catch (error) {
|
|
@@ -364,9 +360,9 @@ var require_main = __commonJS({
|
|
|
364
360
|
}
|
|
365
361
|
});
|
|
366
362
|
|
|
367
|
-
// node_modules/proxy-from-env/index.js
|
|
363
|
+
// node_modules/.pnpm/proxy-from-env@1.1.0/node_modules/proxy-from-env/index.js
|
|
368
364
|
var require_proxy_from_env = __commonJS({
|
|
369
|
-
"node_modules/proxy-from-env/index.js"(exports2) {
|
|
365
|
+
"node_modules/.pnpm/proxy-from-env@1.1.0/node_modules/proxy-from-env/index.js"(exports2) {
|
|
370
366
|
"use strict";
|
|
371
367
|
var parseUrl = require("url").parse;
|
|
372
368
|
var DEFAULT_PORTS = {
|
|
@@ -380,7 +376,7 @@ var require_proxy_from_env = __commonJS({
|
|
|
380
376
|
var stringEndsWith = String.prototype.endsWith || function(s) {
|
|
381
377
|
return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1;
|
|
382
378
|
};
|
|
383
|
-
function
|
|
379
|
+
function getProxyForUrl2(url2) {
|
|
384
380
|
var parsedUrl = typeof url2 === "string" ? parseUrl(url2) : url2 || {};
|
|
385
381
|
var proto = parsedUrl.protocol;
|
|
386
382
|
var hostname = parsedUrl.host;
|
|
@@ -430,13 +426,13 @@ var require_proxy_from_env = __commonJS({
|
|
|
430
426
|
function getEnv(key) {
|
|
431
427
|
return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
|
|
432
428
|
}
|
|
433
|
-
exports2.getProxyForUrl =
|
|
429
|
+
exports2.getProxyForUrl = getProxyForUrl2;
|
|
434
430
|
}
|
|
435
431
|
});
|
|
436
432
|
|
|
437
|
-
// node_modules/ms/index.js
|
|
433
|
+
// node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js
|
|
438
434
|
var require_ms = __commonJS({
|
|
439
|
-
"node_modules/ms/index.js"(exports2, module2) {
|
|
435
|
+
"node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js"(exports2, module2) {
|
|
440
436
|
var s = 1e3;
|
|
441
437
|
var m = s * 60;
|
|
442
438
|
var h = m * 60;
|
|
@@ -550,9 +546,10 @@ var require_ms = __commonJS({
|
|
|
550
546
|
}
|
|
551
547
|
});
|
|
552
548
|
|
|
553
|
-
// node_modules/debug/src/common.js
|
|
549
|
+
// node_modules/.pnpm/debug@3.2.7/node_modules/debug/src/common.js
|
|
554
550
|
var require_common = __commonJS({
|
|
555
|
-
"node_modules/debug/src/common.js"(exports2, module2) {
|
|
551
|
+
"node_modules/.pnpm/debug@3.2.7/node_modules/debug/src/common.js"(exports2, module2) {
|
|
552
|
+
"use strict";
|
|
556
553
|
function setup(env) {
|
|
557
554
|
createDebug.debug = createDebug;
|
|
558
555
|
createDebug.default = createDebug;
|
|
@@ -561,16 +558,16 @@ var require_common = __commonJS({
|
|
|
561
558
|
createDebug.enable = enable;
|
|
562
559
|
createDebug.enabled = enabled;
|
|
563
560
|
createDebug.humanize = require_ms();
|
|
564
|
-
|
|
565
|
-
Object.keys(env).forEach((key) => {
|
|
561
|
+
Object.keys(env).forEach(function(key) {
|
|
566
562
|
createDebug[key] = env[key];
|
|
567
563
|
});
|
|
564
|
+
createDebug.instances = [];
|
|
568
565
|
createDebug.names = [];
|
|
569
566
|
createDebug.skips = [];
|
|
570
567
|
createDebug.formatters = {};
|
|
571
568
|
function selectColor(namespace) {
|
|
572
|
-
|
|
573
|
-
for (
|
|
569
|
+
var hash = 0;
|
|
570
|
+
for (var i = 0; i < namespace.length; i++) {
|
|
574
571
|
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
575
572
|
hash |= 0;
|
|
576
573
|
}
|
|
@@ -578,17 +575,17 @@ var require_common = __commonJS({
|
|
|
578
575
|
}
|
|
579
576
|
createDebug.selectColor = selectColor;
|
|
580
577
|
function createDebug(namespace) {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
let namespacesCache;
|
|
584
|
-
let enabledCache;
|
|
585
|
-
function debug(...args) {
|
|
578
|
+
var prevTime;
|
|
579
|
+
function debug() {
|
|
586
580
|
if (!debug.enabled) {
|
|
587
581
|
return;
|
|
588
582
|
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
583
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
584
|
+
args[_key] = arguments[_key];
|
|
585
|
+
}
|
|
586
|
+
var self2 = debug;
|
|
587
|
+
var curr = Number(/* @__PURE__ */ new Date());
|
|
588
|
+
var ms = curr - (prevTime || curr);
|
|
592
589
|
self2.diff = ms;
|
|
593
590
|
self2.prev = prevTime;
|
|
594
591
|
self2.curr = curr;
|
|
@@ -597,15 +594,15 @@ var require_common = __commonJS({
|
|
|
597
594
|
if (typeof args[0] !== "string") {
|
|
598
595
|
args.unshift("%O");
|
|
599
596
|
}
|
|
600
|
-
|
|
601
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format)
|
|
597
|
+
var index = 0;
|
|
598
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
|
|
602
599
|
if (match === "%%") {
|
|
603
|
-
return
|
|
600
|
+
return match;
|
|
604
601
|
}
|
|
605
602
|
index++;
|
|
606
|
-
|
|
603
|
+
var formatter = createDebug.formatters[format];
|
|
607
604
|
if (typeof formatter === "function") {
|
|
608
|
-
|
|
605
|
+
var val = args[index];
|
|
609
606
|
match = formatter.call(self2, val);
|
|
610
607
|
args.splice(index, 1);
|
|
611
608
|
index--;
|
|
@@ -613,99 +610,71 @@ var require_common = __commonJS({
|
|
|
613
610
|
return match;
|
|
614
611
|
});
|
|
615
612
|
createDebug.formatArgs.call(self2, args);
|
|
616
|
-
|
|
613
|
+
var logFn = self2.log || createDebug.log;
|
|
617
614
|
logFn.apply(self2, args);
|
|
618
615
|
}
|
|
619
616
|
debug.namespace = namespace;
|
|
617
|
+
debug.enabled = createDebug.enabled(namespace);
|
|
620
618
|
debug.useColors = createDebug.useColors();
|
|
621
|
-
debug.color =
|
|
619
|
+
debug.color = selectColor(namespace);
|
|
620
|
+
debug.destroy = destroy;
|
|
622
621
|
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
|
-
});
|
|
641
622
|
if (typeof createDebug.init === "function") {
|
|
642
623
|
createDebug.init(debug);
|
|
643
624
|
}
|
|
625
|
+
createDebug.instances.push(debug);
|
|
644
626
|
return debug;
|
|
645
627
|
}
|
|
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
|
+
}
|
|
646
636
|
function extend2(namespace, delimiter) {
|
|
647
|
-
|
|
648
|
-
newDebug.log = this.log;
|
|
649
|
-
return newDebug;
|
|
637
|
+
return createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
|
|
650
638
|
}
|
|
651
639
|
function enable(namespaces) {
|
|
652
640
|
createDebug.save(namespaces);
|
|
653
|
-
createDebug.namespaces = namespaces;
|
|
654
641
|
createDebug.names = [];
|
|
655
642
|
createDebug.skips = [];
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
643
|
+
var i;
|
|
644
|
+
var split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
|
|
645
|
+
var len = split.length;
|
|
646
|
+
for (i = 0; i < len; i++) {
|
|
647
|
+
if (!split[i]) {
|
|
648
|
+
continue;
|
|
662
649
|
}
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
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;
|
|
650
|
+
namespaces = split[i].replace(/\*/g, ".*?");
|
|
651
|
+
if (namespaces[0] === "-") {
|
|
652
|
+
createDebug.skips.push(new RegExp("^" + namespaces.substr(1) + "$"));
|
|
684
653
|
} else {
|
|
685
|
-
|
|
654
|
+
createDebug.names.push(new RegExp("^" + namespaces + "$"));
|
|
686
655
|
}
|
|
687
656
|
}
|
|
688
|
-
|
|
689
|
-
|
|
657
|
+
for (i = 0; i < createDebug.instances.length; i++) {
|
|
658
|
+
var instance = createDebug.instances[i];
|
|
659
|
+
instance.enabled = createDebug.enabled(instance.namespace);
|
|
690
660
|
}
|
|
691
|
-
return templateIndex === template.length;
|
|
692
661
|
}
|
|
693
662
|
function disable() {
|
|
694
|
-
const namespaces = [
|
|
695
|
-
...createDebug.names,
|
|
696
|
-
...createDebug.skips.map((namespace) => "-" + namespace)
|
|
697
|
-
].join(",");
|
|
698
663
|
createDebug.enable("");
|
|
699
|
-
return namespaces;
|
|
700
664
|
}
|
|
701
665
|
function enabled(name) {
|
|
702
|
-
|
|
703
|
-
|
|
666
|
+
if (name[name.length - 1] === "*") {
|
|
667
|
+
return true;
|
|
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)) {
|
|
704
673
|
return false;
|
|
705
674
|
}
|
|
706
675
|
}
|
|
707
|
-
for (
|
|
708
|
-
if (
|
|
676
|
+
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
|
677
|
+
if (createDebug.names[i].test(name)) {
|
|
709
678
|
return true;
|
|
710
679
|
}
|
|
711
680
|
}
|
|
@@ -717,9 +686,6 @@ var require_common = __commonJS({
|
|
|
717
686
|
}
|
|
718
687
|
return val;
|
|
719
688
|
}
|
|
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
|
-
}
|
|
723
689
|
createDebug.enable(createDebug.load());
|
|
724
690
|
return createDebug;
|
|
725
691
|
}
|
|
@@ -727,101 +693,29 @@ var require_common = __commonJS({
|
|
|
727
693
|
}
|
|
728
694
|
});
|
|
729
695
|
|
|
730
|
-
// node_modules/debug/src/browser.js
|
|
696
|
+
// node_modules/.pnpm/debug@3.2.7/node_modules/debug/src/browser.js
|
|
731
697
|
var require_browser = __commonJS({
|
|
732
|
-
"node_modules/debug/src/browser.js"(exports2, module2) {
|
|
698
|
+
"node_modules/.pnpm/debug@3.2.7/node_modules/debug/src/browser.js"(exports2, module2) {
|
|
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;
|
|
733
713
|
exports2.formatArgs = formatArgs;
|
|
734
714
|
exports2.save = save;
|
|
735
715
|
exports2.load = load;
|
|
736
716
|
exports2.useColors = useColors;
|
|
737
717
|
exports2.storage = localstorage();
|
|
738
|
-
exports2.
|
|
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
|
-
];
|
|
718
|
+
exports2.colors = ["#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33"];
|
|
825
719
|
function useColors() {
|
|
826
720
|
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
|
|
827
721
|
return true;
|
|
@@ -829,11 +723,10 @@ var require_browser = __commonJS({
|
|
|
829
723
|
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
830
724
|
return false;
|
|
831
725
|
}
|
|
832
|
-
let m;
|
|
833
726
|
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
834
727
|
typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
835
728
|
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
836
|
-
typeof navigator !== "undefined" && navigator.userAgent &&
|
|
729
|
+
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
|
|
837
730
|
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
838
731
|
}
|
|
839
732
|
function formatArgs(args) {
|
|
@@ -841,11 +734,11 @@ var require_browser = __commonJS({
|
|
|
841
734
|
if (!this.useColors) {
|
|
842
735
|
return;
|
|
843
736
|
}
|
|
844
|
-
|
|
737
|
+
var c = "color: " + this.color;
|
|
845
738
|
args.splice(1, 0, c, "color: inherit");
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
args[0].replace(/%[a-zA-Z%]/g, (match)
|
|
739
|
+
var index = 0;
|
|
740
|
+
var lastC = 0;
|
|
741
|
+
args[0].replace(/%[a-zA-Z%]/g, function(match) {
|
|
849
742
|
if (match === "%%") {
|
|
850
743
|
return;
|
|
851
744
|
}
|
|
@@ -856,8 +749,10 @@ var require_browser = __commonJS({
|
|
|
856
749
|
});
|
|
857
750
|
args.splice(lastC, 0, c);
|
|
858
751
|
}
|
|
859
|
-
|
|
860
|
-
|
|
752
|
+
function log() {
|
|
753
|
+
var _console;
|
|
754
|
+
return (typeof console === "undefined" ? "undefined" : _typeof(console)) === "object" && console.log && (_console = console).log.apply(_console, arguments);
|
|
755
|
+
}
|
|
861
756
|
function save(namespaces) {
|
|
862
757
|
try {
|
|
863
758
|
if (namespaces) {
|
|
@@ -869,9 +764,9 @@ var require_browser = __commonJS({
|
|
|
869
764
|
}
|
|
870
765
|
}
|
|
871
766
|
function load() {
|
|
872
|
-
|
|
767
|
+
var r;
|
|
873
768
|
try {
|
|
874
|
-
r = exports2.storage.getItem("debug")
|
|
769
|
+
r = exports2.storage.getItem("debug");
|
|
875
770
|
} catch (error) {
|
|
876
771
|
}
|
|
877
772
|
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
@@ -886,7 +781,7 @@ var require_browser = __commonJS({
|
|
|
886
781
|
}
|
|
887
782
|
}
|
|
888
783
|
module2.exports = require_common()(exports2);
|
|
889
|
-
var
|
|
784
|
+
var formatters = module2.exports.formatters;
|
|
890
785
|
formatters.j = function(v) {
|
|
891
786
|
try {
|
|
892
787
|
return JSON.stringify(v);
|
|
@@ -897,9 +792,9 @@ var require_browser = __commonJS({
|
|
|
897
792
|
}
|
|
898
793
|
});
|
|
899
794
|
|
|
900
|
-
// node_modules/has-flag/index.js
|
|
795
|
+
// node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js
|
|
901
796
|
var require_has_flag = __commonJS({
|
|
902
|
-
"node_modules/has-flag/index.js"(exports2, module2) {
|
|
797
|
+
"node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js"(exports2, module2) {
|
|
903
798
|
"use strict";
|
|
904
799
|
module2.exports = (flag, argv) => {
|
|
905
800
|
argv = argv || process.argv;
|
|
@@ -911,9 +806,9 @@ var require_has_flag = __commonJS({
|
|
|
911
806
|
}
|
|
912
807
|
});
|
|
913
808
|
|
|
914
|
-
// node_modules/supports-color/index.js
|
|
809
|
+
// node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js
|
|
915
810
|
var require_supports_color = __commonJS({
|
|
916
|
-
"node_modules/supports-color/index.js"(exports2, module2) {
|
|
811
|
+
"node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js"(exports2, module2) {
|
|
917
812
|
"use strict";
|
|
918
813
|
var os3 = require("os");
|
|
919
814
|
var hasFlag = require_has_flag();
|
|
@@ -1006,114 +901,34 @@ var require_supports_color = __commonJS({
|
|
|
1006
901
|
}
|
|
1007
902
|
});
|
|
1008
903
|
|
|
1009
|
-
// node_modules/debug/src/node.js
|
|
904
|
+
// node_modules/.pnpm/debug@3.2.7/node_modules/debug/src/node.js
|
|
1010
905
|
var require_node = __commonJS({
|
|
1011
|
-
"node_modules/debug/src/node.js"(exports2, module2) {
|
|
906
|
+
"node_modules/.pnpm/debug@3.2.7/node_modules/debug/src/node.js"(exports2, module2) {
|
|
907
|
+
"use strict";
|
|
1012
908
|
var tty = require("tty");
|
|
1013
|
-
var
|
|
909
|
+
var util2 = require("util");
|
|
1014
910
|
exports2.init = init;
|
|
1015
911
|
exports2.log = log;
|
|
1016
912
|
exports2.formatArgs = formatArgs;
|
|
1017
913
|
exports2.save = save;
|
|
1018
914
|
exports2.load = load;
|
|
1019
915
|
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
|
-
);
|
|
1025
916
|
exports2.colors = [6, 2, 3, 4, 5, 1];
|
|
1026
917
|
try {
|
|
1027
|
-
|
|
918
|
+
supportsColor = require_supports_color();
|
|
1028
919
|
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
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
|
-
];
|
|
920
|
+
exports2.colors = [20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221];
|
|
1107
921
|
}
|
|
1108
922
|
} catch (error) {
|
|
1109
923
|
}
|
|
1110
|
-
|
|
924
|
+
var supportsColor;
|
|
925
|
+
exports2.inspectOpts = Object.keys(process.env).filter(function(key) {
|
|
1111
926
|
return /^debug_/i.test(key);
|
|
1112
|
-
}).reduce((obj, key)
|
|
1113
|
-
|
|
927
|
+
}).reduce(function(obj, key) {
|
|
928
|
+
var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function(_, k) {
|
|
1114
929
|
return k.toUpperCase();
|
|
1115
930
|
});
|
|
1116
|
-
|
|
931
|
+
var val = process.env[key];
|
|
1117
932
|
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
1118
933
|
val = true;
|
|
1119
934
|
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
@@ -1130,11 +945,11 @@ var require_node = __commonJS({
|
|
|
1130
945
|
return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd);
|
|
1131
946
|
}
|
|
1132
947
|
function formatArgs(args) {
|
|
1133
|
-
|
|
948
|
+
var name = this.namespace, useColors2 = this.useColors;
|
|
1134
949
|
if (useColors2) {
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
950
|
+
var c = this.color;
|
|
951
|
+
var colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
|
|
952
|
+
var prefix = " ".concat(colorCode, ";1m").concat(name, " \x1B[0m");
|
|
1138
953
|
args[0] = prefix + args[0].split("\n").join("\n" + prefix);
|
|
1139
954
|
args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
|
|
1140
955
|
} else {
|
|
@@ -1147,8 +962,8 @@ var require_node = __commonJS({
|
|
|
1147
962
|
}
|
|
1148
963
|
return (/* @__PURE__ */ new Date()).toISOString() + " ";
|
|
1149
964
|
}
|
|
1150
|
-
function log(
|
|
1151
|
-
return process.stderr.write(
|
|
965
|
+
function log() {
|
|
966
|
+
return process.stderr.write(util2.format.apply(util2, arguments) + "\n");
|
|
1152
967
|
}
|
|
1153
968
|
function save(namespaces) {
|
|
1154
969
|
if (namespaces) {
|
|
@@ -1162,27 +977,30 @@ var require_node = __commonJS({
|
|
|
1162
977
|
}
|
|
1163
978
|
function init(debug) {
|
|
1164
979
|
debug.inspectOpts = {};
|
|
1165
|
-
|
|
1166
|
-
for (
|
|
980
|
+
var keys = Object.keys(exports2.inspectOpts);
|
|
981
|
+
for (var i = 0; i < keys.length; i++) {
|
|
1167
982
|
debug.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
|
|
1168
983
|
}
|
|
1169
984
|
}
|
|
1170
985
|
module2.exports = require_common()(exports2);
|
|
1171
|
-
var
|
|
986
|
+
var formatters = module2.exports.formatters;
|
|
1172
987
|
formatters.o = function(v) {
|
|
1173
988
|
this.inspectOpts.colors = this.useColors;
|
|
1174
|
-
return
|
|
989
|
+
return util2.inspect(v, this.inspectOpts).split("\n").map(function(str) {
|
|
990
|
+
return str.trim();
|
|
991
|
+
}).join(" ");
|
|
1175
992
|
};
|
|
1176
993
|
formatters.O = function(v) {
|
|
1177
994
|
this.inspectOpts.colors = this.useColors;
|
|
1178
|
-
return
|
|
995
|
+
return util2.inspect(v, this.inspectOpts);
|
|
1179
996
|
};
|
|
1180
997
|
}
|
|
1181
998
|
});
|
|
1182
999
|
|
|
1183
|
-
// node_modules/debug/src/index.js
|
|
1000
|
+
// node_modules/.pnpm/debug@3.2.7/node_modules/debug/src/index.js
|
|
1184
1001
|
var require_src = __commonJS({
|
|
1185
|
-
"node_modules/debug/src/index.js"(exports2, module2) {
|
|
1002
|
+
"node_modules/.pnpm/debug@3.2.7/node_modules/debug/src/index.js"(exports2, module2) {
|
|
1003
|
+
"use strict";
|
|
1186
1004
|
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
1187
1005
|
module2.exports = require_browser();
|
|
1188
1006
|
} else {
|
|
@@ -1191,9 +1009,9 @@ var require_src = __commonJS({
|
|
|
1191
1009
|
}
|
|
1192
1010
|
});
|
|
1193
1011
|
|
|
1194
|
-
// node_modules/follow-redirects/debug.js
|
|
1012
|
+
// node_modules/.pnpm/follow-redirects@1.15.2/node_modules/follow-redirects/debug.js
|
|
1195
1013
|
var require_debug = __commonJS({
|
|
1196
|
-
"node_modules/follow-redirects/debug.js"(exports2, module2) {
|
|
1014
|
+
"node_modules/.pnpm/follow-redirects@1.15.2/node_modules/follow-redirects/debug.js"(exports2, module2) {
|
|
1197
1015
|
var debug;
|
|
1198
1016
|
module2.exports = function() {
|
|
1199
1017
|
if (!debug) {
|
|
@@ -1211,9 +1029,9 @@ var require_debug = __commonJS({
|
|
|
1211
1029
|
}
|
|
1212
1030
|
});
|
|
1213
1031
|
|
|
1214
|
-
// node_modules/follow-redirects/index.js
|
|
1032
|
+
// node_modules/.pnpm/follow-redirects@1.15.2/node_modules/follow-redirects/index.js
|
|
1215
1033
|
var require_follow_redirects = __commonJS({
|
|
1216
|
-
"node_modules/follow-redirects/index.js"(exports2, module2) {
|
|
1034
|
+
"node_modules/.pnpm/follow-redirects@1.15.2/node_modules/follow-redirects/index.js"(exports2, module2) {
|
|
1217
1035
|
var url2 = require("url");
|
|
1218
1036
|
var URL3 = url2.URL;
|
|
1219
1037
|
var http2 = require("http");
|
|
@@ -1221,33 +1039,6 @@ var require_follow_redirects = __commonJS({
|
|
|
1221
1039
|
var Writable = require("stream").Writable;
|
|
1222
1040
|
var assert = require("assert");
|
|
1223
1041
|
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 URL3(""));
|
|
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
|
-
];
|
|
1251
1042
|
var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
|
|
1252
1043
|
var eventHandlers = /* @__PURE__ */ Object.create(null);
|
|
1253
1044
|
events.forEach(function(event) {
|
|
@@ -1266,8 +1057,7 @@ var require_follow_redirects = __commonJS({
|
|
|
1266
1057
|
);
|
|
1267
1058
|
var TooManyRedirectsError = createErrorType(
|
|
1268
1059
|
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
1269
|
-
"Maximum number of redirects exceeded"
|
|
1270
|
-
RedirectionError
|
|
1060
|
+
"Maximum number of redirects exceeded"
|
|
1271
1061
|
);
|
|
1272
1062
|
var MaxBodyLengthExceededError = createErrorType(
|
|
1273
1063
|
"ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
|
|
@@ -1277,7 +1067,6 @@ var require_follow_redirects = __commonJS({
|
|
|
1277
1067
|
"ERR_STREAM_WRITE_AFTER_END",
|
|
1278
1068
|
"write after end"
|
|
1279
1069
|
);
|
|
1280
|
-
var destroy = Writable.prototype.destroy || noop2;
|
|
1281
1070
|
function RedirectableRequest(options, responseCallback) {
|
|
1282
1071
|
Writable.call(this);
|
|
1283
1072
|
this._sanitizeOptions(options);
|
|
@@ -1293,25 +1082,15 @@ var require_follow_redirects = __commonJS({
|
|
|
1293
1082
|
}
|
|
1294
1083
|
var self2 = this;
|
|
1295
1084
|
this._onNativeResponse = function(response) {
|
|
1296
|
-
|
|
1297
|
-
self2._processResponse(response);
|
|
1298
|
-
} catch (cause) {
|
|
1299
|
-
self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause }));
|
|
1300
|
-
}
|
|
1085
|
+
self2._processResponse(response);
|
|
1301
1086
|
};
|
|
1302
1087
|
this._performRequest();
|
|
1303
1088
|
}
|
|
1304
1089
|
RedirectableRequest.prototype = Object.create(Writable.prototype);
|
|
1305
1090
|
RedirectableRequest.prototype.abort = function() {
|
|
1306
|
-
|
|
1307
|
-
this._currentRequest.abort();
|
|
1091
|
+
abortRequest(this._currentRequest);
|
|
1308
1092
|
this.emit("abort");
|
|
1309
1093
|
};
|
|
1310
|
-
RedirectableRequest.prototype.destroy = function(error) {
|
|
1311
|
-
destroyRequest(this._currentRequest, error);
|
|
1312
|
-
destroy.call(this, error);
|
|
1313
|
-
return this;
|
|
1314
|
-
};
|
|
1315
1094
|
RedirectableRequest.prototype.write = function(data, encoding, callback) {
|
|
1316
1095
|
if (this._ending) {
|
|
1317
1096
|
throw new WriteAfterEndError();
|
|
@@ -1392,7 +1171,6 @@ var require_follow_redirects = __commonJS({
|
|
|
1392
1171
|
self2.removeListener("abort", clearTimer);
|
|
1393
1172
|
self2.removeListener("error", clearTimer);
|
|
1394
1173
|
self2.removeListener("response", clearTimer);
|
|
1395
|
-
self2.removeListener("close", clearTimer);
|
|
1396
1174
|
if (callback) {
|
|
1397
1175
|
self2.removeListener("timeout", callback);
|
|
1398
1176
|
}
|
|
@@ -1412,7 +1190,6 @@ var require_follow_redirects = __commonJS({
|
|
|
1412
1190
|
this.on("abort", clearTimer);
|
|
1413
1191
|
this.on("error", clearTimer);
|
|
1414
1192
|
this.on("response", clearTimer);
|
|
1415
|
-
this.on("close", clearTimer);
|
|
1416
1193
|
return this;
|
|
1417
1194
|
};
|
|
1418
1195
|
[
|
|
@@ -1456,7 +1233,8 @@ var require_follow_redirects = __commonJS({
|
|
|
1456
1233
|
var protocol = this._options.protocol;
|
|
1457
1234
|
var nativeProtocol = this._options.nativeProtocols[protocol];
|
|
1458
1235
|
if (!nativeProtocol) {
|
|
1459
|
-
|
|
1236
|
+
this.emit("error", new TypeError("Unsupported protocol " + protocol));
|
|
1237
|
+
return;
|
|
1460
1238
|
}
|
|
1461
1239
|
if (this._options.agents) {
|
|
1462
1240
|
var scheme = protocol.slice(0, -1);
|
|
@@ -1509,10 +1287,11 @@ var require_follow_redirects = __commonJS({
|
|
|
1509
1287
|
this._requestBodyBuffers = [];
|
|
1510
1288
|
return;
|
|
1511
1289
|
}
|
|
1512
|
-
|
|
1290
|
+
abortRequest(this._currentRequest);
|
|
1513
1291
|
response.destroy();
|
|
1514
1292
|
if (++this._redirectCount > this._options.maxRedirects) {
|
|
1515
|
-
|
|
1293
|
+
this.emit("error", new TooManyRedirectsError());
|
|
1294
|
+
return;
|
|
1516
1295
|
}
|
|
1517
1296
|
var requestHeaders;
|
|
1518
1297
|
var beforeRedirect = this._options.beforeRedirect;
|
|
@@ -1533,15 +1312,22 @@ var require_follow_redirects = __commonJS({
|
|
|
1533
1312
|
removeMatchingHeaders(/^content-/i, this._options.headers);
|
|
1534
1313
|
}
|
|
1535
1314
|
var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
|
|
1536
|
-
var currentUrlParts =
|
|
1315
|
+
var currentUrlParts = url2.parse(this._currentUrl);
|
|
1537
1316
|
var currentHost = currentHostHeader || currentUrlParts.host;
|
|
1538
1317
|
var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url2.format(Object.assign(currentUrlParts, { host: currentHost }));
|
|
1539
|
-
var redirectUrl
|
|
1540
|
-
|
|
1318
|
+
var redirectUrl;
|
|
1319
|
+
try {
|
|
1320
|
+
redirectUrl = url2.resolve(currentUrl, location);
|
|
1321
|
+
} catch (cause) {
|
|
1322
|
+
this.emit("error", new RedirectionError({ cause }));
|
|
1323
|
+
return;
|
|
1324
|
+
}
|
|
1325
|
+
debug("redirecting to", redirectUrl);
|
|
1541
1326
|
this._isRedirect = true;
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1327
|
+
var redirectUrlParts = url2.parse(redirectUrl);
|
|
1328
|
+
Object.assign(this._options, redirectUrlParts);
|
|
1329
|
+
if (redirectUrlParts.protocol !== currentUrlParts.protocol && redirectUrlParts.protocol !== "https:" || redirectUrlParts.host !== currentHost && !isSubdomain(redirectUrlParts.host, currentHost)) {
|
|
1330
|
+
removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
|
|
1545
1331
|
}
|
|
1546
1332
|
if (isFunction2(beforeRedirect)) {
|
|
1547
1333
|
var responseDetails = {
|
|
@@ -1553,10 +1339,19 @@ var require_follow_redirects = __commonJS({
|
|
|
1553
1339
|
method,
|
|
1554
1340
|
headers: requestHeaders
|
|
1555
1341
|
};
|
|
1556
|
-
|
|
1342
|
+
try {
|
|
1343
|
+
beforeRedirect(this._options, responseDetails, requestDetails);
|
|
1344
|
+
} catch (err) {
|
|
1345
|
+
this.emit("error", err);
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1557
1348
|
this._sanitizeOptions(this._options);
|
|
1558
1349
|
}
|
|
1559
|
-
|
|
1350
|
+
try {
|
|
1351
|
+
this._performRequest();
|
|
1352
|
+
} catch (cause) {
|
|
1353
|
+
this.emit("error", new RedirectionError({ cause }));
|
|
1354
|
+
}
|
|
1560
1355
|
};
|
|
1561
1356
|
function wrap(protocols) {
|
|
1562
1357
|
var exports3 = {
|
|
@@ -1569,13 +1364,22 @@ var require_follow_redirects = __commonJS({
|
|
|
1569
1364
|
var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
|
|
1570
1365
|
var wrappedProtocol = exports3[scheme] = Object.create(nativeProtocol);
|
|
1571
1366
|
function request(input, options, callback) {
|
|
1572
|
-
if (
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1367
|
+
if (isString2(input)) {
|
|
1368
|
+
var parsed;
|
|
1369
|
+
try {
|
|
1370
|
+
parsed = urlToOptions(new URL3(input));
|
|
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);
|
|
1576
1380
|
} else {
|
|
1577
1381
|
callback = options;
|
|
1578
|
-
options =
|
|
1382
|
+
options = input;
|
|
1579
1383
|
input = { protocol };
|
|
1580
1384
|
}
|
|
1581
1385
|
if (isFunction2(options)) {
|
|
@@ -1608,43 +1412,23 @@ var require_follow_redirects = __commonJS({
|
|
|
1608
1412
|
}
|
|
1609
1413
|
function noop2() {
|
|
1610
1414
|
}
|
|
1611
|
-
function
|
|
1612
|
-
var
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
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);
|
|
1642
|
-
}
|
|
1643
|
-
if (spread3.port !== "") {
|
|
1644
|
-
spread3.port = Number(spread3.port);
|
|
1415
|
+
function urlToOptions(urlObject) {
|
|
1416
|
+
var options = {
|
|
1417
|
+
protocol: urlObject.protocol,
|
|
1418
|
+
hostname: urlObject.hostname.startsWith("[") ? (
|
|
1419
|
+
/* istanbul ignore next */
|
|
1420
|
+
urlObject.hostname.slice(1, -1)
|
|
1421
|
+
) : urlObject.hostname,
|
|
1422
|
+
hash: urlObject.hash,
|
|
1423
|
+
search: urlObject.search,
|
|
1424
|
+
pathname: urlObject.pathname,
|
|
1425
|
+
path: urlObject.pathname + urlObject.search,
|
|
1426
|
+
href: urlObject.href
|
|
1427
|
+
};
|
|
1428
|
+
if (urlObject.port !== "") {
|
|
1429
|
+
options.port = Number(urlObject.port);
|
|
1645
1430
|
}
|
|
1646
|
-
|
|
1647
|
-
return spread3;
|
|
1431
|
+
return options;
|
|
1648
1432
|
}
|
|
1649
1433
|
function removeMatchingHeaders(regex, headers) {
|
|
1650
1434
|
var lastValue;
|
|
@@ -1658,32 +1442,22 @@ var require_follow_redirects = __commonJS({
|
|
|
1658
1442
|
}
|
|
1659
1443
|
function createErrorType(code, message, baseClass) {
|
|
1660
1444
|
function CustomError(properties) {
|
|
1661
|
-
|
|
1662
|
-
Error.captureStackTrace(this, this.constructor);
|
|
1663
|
-
}
|
|
1445
|
+
Error.captureStackTrace(this, this.constructor);
|
|
1664
1446
|
Object.assign(this, properties || {});
|
|
1665
1447
|
this.code = code;
|
|
1666
1448
|
this.message = this.cause ? message + ": " + this.cause.message : message;
|
|
1667
1449
|
}
|
|
1668
1450
|
CustomError.prototype = new (baseClass || Error)();
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
value: CustomError,
|
|
1672
|
-
enumerable: false
|
|
1673
|
-
},
|
|
1674
|
-
name: {
|
|
1675
|
-
value: "Error [" + code + "]",
|
|
1676
|
-
enumerable: false
|
|
1677
|
-
}
|
|
1678
|
-
});
|
|
1451
|
+
CustomError.prototype.constructor = CustomError;
|
|
1452
|
+
CustomError.prototype.name = "Error [" + code + "]";
|
|
1679
1453
|
return CustomError;
|
|
1680
1454
|
}
|
|
1681
|
-
function
|
|
1455
|
+
function abortRequest(request) {
|
|
1682
1456
|
for (var event of events) {
|
|
1683
1457
|
request.removeListener(event, eventHandlers[event]);
|
|
1684
1458
|
}
|
|
1685
1459
|
request.on("error", noop2);
|
|
1686
|
-
request.
|
|
1460
|
+
request.abort();
|
|
1687
1461
|
}
|
|
1688
1462
|
function isSubdomain(subdomain, domain) {
|
|
1689
1463
|
assert(isString2(subdomain) && isString2(domain));
|
|
@@ -1699,9 +1473,6 @@ var require_follow_redirects = __commonJS({
|
|
|
1699
1473
|
function isBuffer2(value) {
|
|
1700
1474
|
return typeof value === "object" && "length" in value;
|
|
1701
1475
|
}
|
|
1702
|
-
function isURL(value) {
|
|
1703
|
-
return URL3 && value instanceof URL3;
|
|
1704
|
-
}
|
|
1705
1476
|
module2.exports = wrap({ http: http2, https: https2 });
|
|
1706
1477
|
module2.exports.wrap = wrap;
|
|
1707
1478
|
}
|
|
@@ -1714,7 +1485,7 @@ var import_chalk6 = __toESM(require("chalk"));
|
|
|
1714
1485
|
var import_figlet3 = __toESM(require("figlet"));
|
|
1715
1486
|
|
|
1716
1487
|
// package.json
|
|
1717
|
-
var version = "1.1.
|
|
1488
|
+
var version = "1.1.1-alpha.2";
|
|
1718
1489
|
|
|
1719
1490
|
// bin/upload.ts
|
|
1720
1491
|
var import_path5 = __toESM(require("path"));
|
|
@@ -1722,17 +1493,16 @@ var import_chalk3 = __toESM(require("chalk"));
|
|
|
1722
1493
|
var import_inquirer = __toESM(require("inquirer"));
|
|
1723
1494
|
var import_figlet = __toESM(require("figlet"));
|
|
1724
1495
|
|
|
1725
|
-
// node_modules/axios/lib/helpers/bind.js
|
|
1496
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/bind.js
|
|
1726
1497
|
function bind(fn, thisArg) {
|
|
1727
1498
|
return function wrap() {
|
|
1728
1499
|
return fn.apply(thisArg, arguments);
|
|
1729
1500
|
};
|
|
1730
1501
|
}
|
|
1731
1502
|
|
|
1732
|
-
// node_modules/axios/lib/utils.js
|
|
1503
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/utils.js
|
|
1733
1504
|
var { toString } = Object.prototype;
|
|
1734
1505
|
var { getPrototypeOf } = Object;
|
|
1735
|
-
var { iterator, toStringTag } = Symbol;
|
|
1736
1506
|
var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
|
|
1737
1507
|
const str = toString.call(thing);
|
|
1738
1508
|
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
@@ -1767,7 +1537,7 @@ var isPlainObject = (val) => {
|
|
|
1767
1537
|
return false;
|
|
1768
1538
|
}
|
|
1769
1539
|
const prototype3 = getPrototypeOf(val);
|
|
1770
|
-
return (prototype3 === null || prototype3 === Object.prototype || Object.getPrototypeOf(prototype3) === null) && !(toStringTag in val) && !(iterator in val);
|
|
1540
|
+
return (prototype3 === null || prototype3 === Object.prototype || Object.getPrototypeOf(prototype3) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
|
|
1771
1541
|
};
|
|
1772
1542
|
var isDate = kindOfTest("Date");
|
|
1773
1543
|
var isFile = kindOfTest("File");
|
|
@@ -1775,12 +1545,10 @@ var isBlob = kindOfTest("Blob");
|
|
|
1775
1545
|
var isFileList = kindOfTest("FileList");
|
|
1776
1546
|
var isStream = (val) => isObject(val) && isFunction(val.pipe);
|
|
1777
1547
|
var isFormData = (thing) => {
|
|
1778
|
-
|
|
1779
|
-
return thing && (typeof FormData === "function" && thing instanceof FormData ||
|
|
1780
|
-
kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
|
|
1548
|
+
const pattern = "[object FormData]";
|
|
1549
|
+
return thing && (typeof FormData === "function" && thing instanceof FormData || toString.call(thing) === pattern || isFunction(thing.toString) && thing.toString() === pattern);
|
|
1781
1550
|
};
|
|
1782
1551
|
var isURLSearchParams = kindOfTest("URLSearchParams");
|
|
1783
|
-
var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
|
|
1784
1552
|
var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
1785
1553
|
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
1786
1554
|
if (obj === null || typeof obj === "undefined") {
|
|
@@ -1914,10 +1682,10 @@ var isTypedArray = /* @__PURE__ */ ((TypedArray) => {
|
|
|
1914
1682
|
};
|
|
1915
1683
|
})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
|
|
1916
1684
|
var forEachEntry = (obj, fn) => {
|
|
1917
|
-
const generator = obj && obj[iterator];
|
|
1918
|
-
const
|
|
1685
|
+
const generator = obj && obj[Symbol.iterator];
|
|
1686
|
+
const iterator = generator.call(obj);
|
|
1919
1687
|
let result;
|
|
1920
|
-
while ((result =
|
|
1688
|
+
while ((result = iterator.next()) && !result.done) {
|
|
1921
1689
|
const pair = result.value;
|
|
1922
1690
|
fn.call(obj, pair[0], pair[1]);
|
|
1923
1691
|
}
|
|
@@ -1945,9 +1713,8 @@ var reduceDescriptors = (obj, reducer) => {
|
|
|
1945
1713
|
const descriptors2 = Object.getOwnPropertyDescriptors(obj);
|
|
1946
1714
|
const reducedDescriptors = {};
|
|
1947
1715
|
forEach(descriptors2, (descriptor, name) => {
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
reducedDescriptors[name] = ret || descriptor;
|
|
1716
|
+
if (reducer(descriptor, name, obj) !== false) {
|
|
1717
|
+
reducedDescriptors[name] = descriptor;
|
|
1951
1718
|
}
|
|
1952
1719
|
});
|
|
1953
1720
|
Object.defineProperties(obj, reducedDescriptors);
|
|
@@ -1984,10 +1751,26 @@ var toObjectSet = (arrayOrString, delimiter) => {
|
|
|
1984
1751
|
var noop = () => {
|
|
1985
1752
|
};
|
|
1986
1753
|
var toFiniteNumber = (value, defaultValue) => {
|
|
1987
|
-
|
|
1754
|
+
value = +value;
|
|
1755
|
+
return Number.isFinite(value) ? value : defaultValue;
|
|
1756
|
+
};
|
|
1757
|
+
var ALPHA = "abcdefghijklmnopqrstuvwxyz";
|
|
1758
|
+
var DIGIT = "0123456789";
|
|
1759
|
+
var ALPHABET = {
|
|
1760
|
+
DIGIT,
|
|
1761
|
+
ALPHA,
|
|
1762
|
+
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
|
1763
|
+
};
|
|
1764
|
+
var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
1765
|
+
let str = "";
|
|
1766
|
+
const { length } = alphabet;
|
|
1767
|
+
while (size--) {
|
|
1768
|
+
str += alphabet[Math.random() * length | 0];
|
|
1769
|
+
}
|
|
1770
|
+
return str;
|
|
1988
1771
|
};
|
|
1989
1772
|
function isSpecCompliantForm(thing) {
|
|
1990
|
-
return !!(thing && isFunction(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
|
|
1773
|
+
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
|
|
1991
1774
|
}
|
|
1992
1775
|
var toJSONObject = (obj) => {
|
|
1993
1776
|
const stack = new Array(10);
|
|
@@ -2011,29 +1794,6 @@ var toJSONObject = (obj) => {
|
|
|
2011
1794
|
};
|
|
2012
1795
|
return visit(obj, 0);
|
|
2013
1796
|
};
|
|
2014
|
-
var isAsyncFn = kindOfTest("AsyncFunction");
|
|
2015
|
-
var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
|
2016
|
-
var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
2017
|
-
if (setImmediateSupported) {
|
|
2018
|
-
return setImmediate;
|
|
2019
|
-
}
|
|
2020
|
-
return postMessageSupported ? ((token, callbacks) => {
|
|
2021
|
-
_global.addEventListener("message", ({ source, data }) => {
|
|
2022
|
-
if (source === _global && data === token) {
|
|
2023
|
-
callbacks.length && callbacks.shift()();
|
|
2024
|
-
}
|
|
2025
|
-
}, false);
|
|
2026
|
-
return (cb) => {
|
|
2027
|
-
callbacks.push(cb);
|
|
2028
|
-
_global.postMessage(token, "*");
|
|
2029
|
-
};
|
|
2030
|
-
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
2031
|
-
})(
|
|
2032
|
-
typeof setImmediate === "function",
|
|
2033
|
-
isFunction(_global.postMessage)
|
|
2034
|
-
);
|
|
2035
|
-
var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
|
|
2036
|
-
var isIterable = (thing) => thing != null && isFunction(thing[iterator]);
|
|
2037
1797
|
var utils_default = {
|
|
2038
1798
|
isArray,
|
|
2039
1799
|
isArrayBuffer,
|
|
@@ -2045,10 +1805,6 @@ var utils_default = {
|
|
|
2045
1805
|
isBoolean,
|
|
2046
1806
|
isObject,
|
|
2047
1807
|
isPlainObject,
|
|
2048
|
-
isReadableStream,
|
|
2049
|
-
isRequest,
|
|
2050
|
-
isResponse,
|
|
2051
|
-
isHeaders,
|
|
2052
1808
|
isUndefined,
|
|
2053
1809
|
isDate,
|
|
2054
1810
|
isFile,
|
|
@@ -2085,16 +1841,13 @@ var utils_default = {
|
|
|
2085
1841
|
findKey,
|
|
2086
1842
|
global: _global,
|
|
2087
1843
|
isContextDefined,
|
|
1844
|
+
ALPHABET,
|
|
1845
|
+
generateString,
|
|
2088
1846
|
isSpecCompliantForm,
|
|
2089
|
-
toJSONObject
|
|
2090
|
-
isAsyncFn,
|
|
2091
|
-
isThenable,
|
|
2092
|
-
setImmediate: _setImmediate,
|
|
2093
|
-
asap,
|
|
2094
|
-
isIterable
|
|
1847
|
+
toJSONObject
|
|
2095
1848
|
};
|
|
2096
1849
|
|
|
2097
|
-
// node_modules/axios/lib/core/AxiosError.js
|
|
1850
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/core/AxiosError.js
|
|
2098
1851
|
function AxiosError(message, code, config, request, response) {
|
|
2099
1852
|
Error.call(this);
|
|
2100
1853
|
if (Error.captureStackTrace) {
|
|
@@ -2107,10 +1860,7 @@ function AxiosError(message, code, config, request, response) {
|
|
|
2107
1860
|
code && (this.code = code);
|
|
2108
1861
|
config && (this.config = config);
|
|
2109
1862
|
request && (this.request = request);
|
|
2110
|
-
|
|
2111
|
-
this.response = response;
|
|
2112
|
-
this.status = response.status ? response.status : null;
|
|
2113
|
-
}
|
|
1863
|
+
response && (this.response = response);
|
|
2114
1864
|
}
|
|
2115
1865
|
utils_default.inherits(AxiosError, Error, {
|
|
2116
1866
|
toJSON: function toJSON() {
|
|
@@ -2129,7 +1879,7 @@ utils_default.inherits(AxiosError, Error, {
|
|
|
2129
1879
|
// Axios
|
|
2130
1880
|
config: utils_default.toJSONObject(this.config),
|
|
2131
1881
|
code: this.code,
|
|
2132
|
-
status: this.status
|
|
1882
|
+
status: this.response && this.response.status ? this.response.status : null
|
|
2133
1883
|
};
|
|
2134
1884
|
}
|
|
2135
1885
|
});
|
|
@@ -2169,11 +1919,11 @@ AxiosError.from = (error, code, config, request, response, customProps) => {
|
|
|
2169
1919
|
};
|
|
2170
1920
|
var AxiosError_default = AxiosError;
|
|
2171
1921
|
|
|
2172
|
-
// node_modules/axios/lib/platform/node/classes/FormData.js
|
|
1922
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/platform/node/classes/FormData.js
|
|
2173
1923
|
var import_form_data = __toESM(require("form-data"), 1);
|
|
2174
1924
|
var FormData_default = import_form_data.default;
|
|
2175
1925
|
|
|
2176
|
-
// node_modules/axios/lib/helpers/toFormData.js
|
|
1926
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/toFormData.js
|
|
2177
1927
|
function isVisitable(thing) {
|
|
2178
1928
|
return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
|
|
2179
1929
|
}
|
|
@@ -2285,7 +2035,7 @@ function toFormData(obj, formData, options) {
|
|
|
2285
2035
|
}
|
|
2286
2036
|
var toFormData_default = toFormData;
|
|
2287
2037
|
|
|
2288
|
-
// node_modules/axios/lib/helpers/AxiosURLSearchParams.js
|
|
2038
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
|
|
2289
2039
|
function encode(str) {
|
|
2290
2040
|
const charMap = {
|
|
2291
2041
|
"!": "%21",
|
|
@@ -2318,7 +2068,7 @@ prototype2.toString = function toString2(encoder) {
|
|
|
2318
2068
|
};
|
|
2319
2069
|
var AxiosURLSearchParams_default = AxiosURLSearchParams;
|
|
2320
2070
|
|
|
2321
|
-
// node_modules/axios/lib/helpers/buildURL.js
|
|
2071
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/buildURL.js
|
|
2322
2072
|
function encode2(val) {
|
|
2323
2073
|
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
2324
2074
|
}
|
|
@@ -2327,11 +2077,6 @@ function buildURL(url2, params, options) {
|
|
|
2327
2077
|
return url2;
|
|
2328
2078
|
}
|
|
2329
2079
|
const _encode = options && options.encode || encode2;
|
|
2330
|
-
if (utils_default.isFunction(options)) {
|
|
2331
|
-
options = {
|
|
2332
|
-
serialize: options
|
|
2333
|
-
};
|
|
2334
|
-
}
|
|
2335
2080
|
const serializeFn = options && options.serialize;
|
|
2336
2081
|
let serializedParams;
|
|
2337
2082
|
if (serializeFn) {
|
|
@@ -2349,7 +2094,7 @@ function buildURL(url2, params, options) {
|
|
|
2349
2094
|
return url2;
|
|
2350
2095
|
}
|
|
2351
2096
|
|
|
2352
|
-
// node_modules/axios/lib/core/InterceptorManager.js
|
|
2097
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/core/InterceptorManager.js
|
|
2353
2098
|
var InterceptorManager = class {
|
|
2354
2099
|
constructor() {
|
|
2355
2100
|
this.handlers = [];
|
|
@@ -2413,38 +2158,18 @@ var InterceptorManager = class {
|
|
|
2413
2158
|
};
|
|
2414
2159
|
var InterceptorManager_default = InterceptorManager;
|
|
2415
2160
|
|
|
2416
|
-
// node_modules/axios/lib/defaults/transitional.js
|
|
2161
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/defaults/transitional.js
|
|
2417
2162
|
var transitional_default = {
|
|
2418
2163
|
silentJSONParsing: true,
|
|
2419
2164
|
forcedJSONParsing: true,
|
|
2420
2165
|
clarifyTimeoutError: false
|
|
2421
2166
|
};
|
|
2422
2167
|
|
|
2423
|
-
// node_modules/axios/lib/platform/node/
|
|
2424
|
-
var import_crypto = __toESM(require("crypto"), 1);
|
|
2425
|
-
|
|
2426
|
-
// node_modules/axios/lib/platform/node/classes/URLSearchParams.js
|
|
2168
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
|
|
2427
2169
|
var import_url = __toESM(require("url"), 1);
|
|
2428
2170
|
var URLSearchParams_default = import_url.default.URLSearchParams;
|
|
2429
2171
|
|
|
2430
|
-
// node_modules/axios/lib/platform/node/index.js
|
|
2431
|
-
var ALPHA = "abcdefghijklmnopqrstuvwxyz";
|
|
2432
|
-
var DIGIT = "0123456789";
|
|
2433
|
-
var ALPHABET = {
|
|
2434
|
-
DIGIT,
|
|
2435
|
-
ALPHA,
|
|
2436
|
-
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
|
2437
|
-
};
|
|
2438
|
-
var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
2439
|
-
let str = "";
|
|
2440
|
-
const { length } = alphabet;
|
|
2441
|
-
const randomValues = new Uint32Array(size);
|
|
2442
|
-
import_crypto.default.randomFillSync(randomValues);
|
|
2443
|
-
for (let i = 0; i < size; i++) {
|
|
2444
|
-
str += alphabet[randomValues[i] % length];
|
|
2445
|
-
}
|
|
2446
|
-
return str;
|
|
2447
|
-
};
|
|
2172
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/platform/node/index.js
|
|
2448
2173
|
var node_default = {
|
|
2449
2174
|
isNode: true,
|
|
2450
2175
|
classes: {
|
|
@@ -2452,40 +2177,14 @@ var node_default = {
|
|
|
2452
2177
|
FormData: FormData_default,
|
|
2453
2178
|
Blob: typeof Blob !== "undefined" && Blob || null
|
|
2454
2179
|
},
|
|
2455
|
-
ALPHABET,
|
|
2456
|
-
generateString,
|
|
2457
2180
|
protocols: ["http", "https", "file", "data"]
|
|
2458
2181
|
};
|
|
2459
2182
|
|
|
2460
|
-
// node_modules/axios/lib/
|
|
2461
|
-
var utils_exports = {};
|
|
2462
|
-
__export(utils_exports, {
|
|
2463
|
-
hasBrowserEnv: () => hasBrowserEnv,
|
|
2464
|
-
hasStandardBrowserEnv: () => hasStandardBrowserEnv,
|
|
2465
|
-
hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv,
|
|
2466
|
-
navigator: () => _navigator,
|
|
2467
|
-
origin: () => origin
|
|
2468
|
-
});
|
|
2469
|
-
var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
|
|
2470
|
-
var _navigator = typeof navigator === "object" && navigator || void 0;
|
|
2471
|
-
var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
|
|
2472
|
-
var hasStandardBrowserWebWorkerEnv = (() => {
|
|
2473
|
-
return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
|
|
2474
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
2475
|
-
})();
|
|
2476
|
-
var origin = hasBrowserEnv && window.location.href || "http://localhost";
|
|
2477
|
-
|
|
2478
|
-
// node_modules/axios/lib/platform/index.js
|
|
2479
|
-
var platform_default = {
|
|
2480
|
-
...utils_exports,
|
|
2481
|
-
...node_default
|
|
2482
|
-
};
|
|
2483
|
-
|
|
2484
|
-
// node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
2183
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
2485
2184
|
function toURLEncodedForm(data, options) {
|
|
2486
|
-
return toFormData_default(data, new
|
|
2185
|
+
return toFormData_default(data, new node_default.classes.URLSearchParams(), Object.assign({
|
|
2487
2186
|
visitor: function(value, key, path6, helpers) {
|
|
2488
|
-
if (
|
|
2187
|
+
if (node_default.isNode && utils_default.isBuffer(value)) {
|
|
2489
2188
|
this.append(key, value.toString("base64"));
|
|
2490
2189
|
return false;
|
|
2491
2190
|
}
|
|
@@ -2494,7 +2193,7 @@ function toURLEncodedForm(data, options) {
|
|
|
2494
2193
|
}, options));
|
|
2495
2194
|
}
|
|
2496
2195
|
|
|
2497
|
-
// node_modules/axios/lib/helpers/formDataToJSON.js
|
|
2196
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/formDataToJSON.js
|
|
2498
2197
|
function parsePropPath(name) {
|
|
2499
2198
|
return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
2500
2199
|
return match[0] === "[]" ? "" : match[1] || match[0];
|
|
@@ -2515,7 +2214,6 @@ function arrayToObject(arr) {
|
|
|
2515
2214
|
function formDataToJSON(formData) {
|
|
2516
2215
|
function buildPath(path6, value, target, index) {
|
|
2517
2216
|
let name = path6[index++];
|
|
2518
|
-
if (name === "__proto__") return true;
|
|
2519
2217
|
const isNumericKey = Number.isFinite(+name);
|
|
2520
2218
|
const isLast = index >= path6.length;
|
|
2521
2219
|
name = !name && utils_default.isArray(target) ? target.length : name;
|
|
@@ -2547,7 +2245,10 @@ function formDataToJSON(formData) {
|
|
|
2547
2245
|
}
|
|
2548
2246
|
var formDataToJSON_default = formDataToJSON;
|
|
2549
2247
|
|
|
2550
|
-
// node_modules/axios/lib/defaults/index.js
|
|
2248
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/defaults/index.js
|
|
2249
|
+
var DEFAULT_CONTENT_TYPE = {
|
|
2250
|
+
"Content-Type": void 0
|
|
2251
|
+
};
|
|
2551
2252
|
function stringifySafely(rawValue, parser, encoder) {
|
|
2552
2253
|
if (utils_default.isString(rawValue)) {
|
|
2553
2254
|
try {
|
|
@@ -2563,7 +2264,7 @@ function stringifySafely(rawValue, parser, encoder) {
|
|
|
2563
2264
|
}
|
|
2564
2265
|
var defaults = {
|
|
2565
2266
|
transitional: transitional_default,
|
|
2566
|
-
adapter: ["xhr", "http"
|
|
2267
|
+
adapter: ["xhr", "http"],
|
|
2567
2268
|
transformRequest: [function transformRequest(data, headers) {
|
|
2568
2269
|
const contentType = headers.getContentType() || "";
|
|
2569
2270
|
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
@@ -2573,9 +2274,12 @@ var defaults = {
|
|
|
2573
2274
|
}
|
|
2574
2275
|
const isFormData2 = utils_default.isFormData(data);
|
|
2575
2276
|
if (isFormData2) {
|
|
2277
|
+
if (!hasJSONContentType) {
|
|
2278
|
+
return data;
|
|
2279
|
+
}
|
|
2576
2280
|
return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
|
|
2577
2281
|
}
|
|
2578
|
-
if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data)
|
|
2282
|
+
if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data)) {
|
|
2579
2283
|
return data;
|
|
2580
2284
|
}
|
|
2581
2285
|
if (utils_default.isArrayBufferView(data)) {
|
|
@@ -2609,9 +2313,6 @@ var defaults = {
|
|
|
2609
2313
|
const transitional2 = this.transitional || defaults.transitional;
|
|
2610
2314
|
const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
|
|
2611
2315
|
const JSONRequested = this.responseType === "json";
|
|
2612
|
-
if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) {
|
|
2613
|
-
return data;
|
|
2614
|
-
}
|
|
2615
2316
|
if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
|
2616
2317
|
const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
|
|
2617
2318
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
@@ -2638,25 +2339,27 @@ var defaults = {
|
|
|
2638
2339
|
maxContentLength: -1,
|
|
2639
2340
|
maxBodyLength: -1,
|
|
2640
2341
|
env: {
|
|
2641
|
-
FormData:
|
|
2642
|
-
Blob:
|
|
2342
|
+
FormData: node_default.classes.FormData,
|
|
2343
|
+
Blob: node_default.classes.Blob
|
|
2643
2344
|
},
|
|
2644
2345
|
validateStatus: function validateStatus(status) {
|
|
2645
2346
|
return status >= 200 && status < 300;
|
|
2646
2347
|
},
|
|
2647
2348
|
headers: {
|
|
2648
2349
|
common: {
|
|
2649
|
-
"Accept": "application/json, text/plain, */*"
|
|
2650
|
-
"Content-Type": void 0
|
|
2350
|
+
"Accept": "application/json, text/plain, */*"
|
|
2651
2351
|
}
|
|
2652
2352
|
}
|
|
2653
2353
|
};
|
|
2654
|
-
utils_default.forEach(["delete", "get", "head",
|
|
2354
|
+
utils_default.forEach(["delete", "get", "head"], function forEachMethodNoData(method) {
|
|
2655
2355
|
defaults.headers[method] = {};
|
|
2656
2356
|
});
|
|
2357
|
+
utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
2358
|
+
defaults.headers[method] = utils_default.merge(DEFAULT_CONTENT_TYPE);
|
|
2359
|
+
});
|
|
2657
2360
|
var defaults_default = defaults;
|
|
2658
2361
|
|
|
2659
|
-
// node_modules/axios/lib/helpers/parseHeaders.js
|
|
2362
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/parseHeaders.js
|
|
2660
2363
|
var ignoreDuplicateOf = utils_default.toObjectSet([
|
|
2661
2364
|
"age",
|
|
2662
2365
|
"authorization",
|
|
@@ -2701,7 +2404,7 @@ var parseHeaders_default = (rawHeaders) => {
|
|
|
2701
2404
|
return parsed;
|
|
2702
2405
|
};
|
|
2703
2406
|
|
|
2704
|
-
// node_modules/axios/lib/core/AxiosHeaders.js
|
|
2407
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/core/AxiosHeaders.js
|
|
2705
2408
|
var $internals = Symbol("internals");
|
|
2706
2409
|
function normalizeHeader(header) {
|
|
2707
2410
|
return header && String(header).trim().toLowerCase();
|
|
@@ -2721,14 +2424,13 @@ function parseTokens(str) {
|
|
|
2721
2424
|
}
|
|
2722
2425
|
return tokens;
|
|
2723
2426
|
}
|
|
2724
|
-
|
|
2725
|
-
|
|
2427
|
+
function isValidHeaderName(str) {
|
|
2428
|
+
return /^[-_a-zA-Z]+$/.test(str.trim());
|
|
2429
|
+
}
|
|
2430
|
+
function matchHeaderValue(context, value, header, filter2) {
|
|
2726
2431
|
if (utils_default.isFunction(filter2)) {
|
|
2727
2432
|
return filter2.call(this, value, header);
|
|
2728
2433
|
}
|
|
2729
|
-
if (isHeaderNameFilter) {
|
|
2730
|
-
value = header;
|
|
2731
|
-
}
|
|
2732
2434
|
if (!utils_default.isString(value)) return;
|
|
2733
2435
|
if (utils_default.isString(filter2)) {
|
|
2734
2436
|
return value.indexOf(filter2) !== -1;
|
|
@@ -2774,15 +2476,6 @@ var AxiosHeaders = class {
|
|
|
2774
2476
|
setHeaders(header, valueOrRewrite);
|
|
2775
2477
|
} else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
2776
2478
|
setHeaders(parseHeaders_default(header), valueOrRewrite);
|
|
2777
|
-
} else if (utils_default.isObject(header) && utils_default.isIterable(header)) {
|
|
2778
|
-
let obj = {}, dest, key;
|
|
2779
|
-
for (const entry of header) {
|
|
2780
|
-
if (!utils_default.isArray(entry)) {
|
|
2781
|
-
throw TypeError("Object iterator must return a key-value pair");
|
|
2782
|
-
}
|
|
2783
|
-
obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
|
|
2784
|
-
}
|
|
2785
|
-
setHeaders(obj, valueOrRewrite);
|
|
2786
2479
|
} else {
|
|
2787
2480
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
2788
2481
|
}
|
|
@@ -2844,7 +2537,7 @@ var AxiosHeaders = class {
|
|
|
2844
2537
|
let deleted = false;
|
|
2845
2538
|
while (i--) {
|
|
2846
2539
|
const key = keys[i];
|
|
2847
|
-
if (!matcher || matchHeaderValue(this, this[key], key, matcher
|
|
2540
|
+
if (!matcher || matchHeaderValue(this, this[key], key, matcher)) {
|
|
2848
2541
|
delete this[key];
|
|
2849
2542
|
deleted = true;
|
|
2850
2543
|
}
|
|
@@ -2886,9 +2579,6 @@ var AxiosHeaders = class {
|
|
|
2886
2579
|
toString() {
|
|
2887
2580
|
return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
|
|
2888
2581
|
}
|
|
2889
|
-
getSetCookie() {
|
|
2890
|
-
return this.get("set-cookie") || [];
|
|
2891
|
-
}
|
|
2892
2582
|
get [Symbol.toStringTag]() {
|
|
2893
2583
|
return "AxiosHeaders";
|
|
2894
2584
|
}
|
|
@@ -2918,19 +2608,11 @@ var AxiosHeaders = class {
|
|
|
2918
2608
|
}
|
|
2919
2609
|
};
|
|
2920
2610
|
AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
2921
|
-
utils_default.
|
|
2922
|
-
let mapped = key[0].toUpperCase() + key.slice(1);
|
|
2923
|
-
return {
|
|
2924
|
-
get: () => value,
|
|
2925
|
-
set(headerValue) {
|
|
2926
|
-
this[mapped] = headerValue;
|
|
2927
|
-
}
|
|
2928
|
-
};
|
|
2929
|
-
});
|
|
2611
|
+
utils_default.freezeMethods(AxiosHeaders.prototype);
|
|
2930
2612
|
utils_default.freezeMethods(AxiosHeaders);
|
|
2931
2613
|
var AxiosHeaders_default = AxiosHeaders;
|
|
2932
2614
|
|
|
2933
|
-
// node_modules/axios/lib/core/transformData.js
|
|
2615
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/core/transformData.js
|
|
2934
2616
|
function transformData(fns, response) {
|
|
2935
2617
|
const config = this || defaults_default;
|
|
2936
2618
|
const context = response || config;
|
|
@@ -2943,12 +2625,12 @@ function transformData(fns, response) {
|
|
|
2943
2625
|
return data;
|
|
2944
2626
|
}
|
|
2945
2627
|
|
|
2946
|
-
// node_modules/axios/lib/cancel/isCancel.js
|
|
2628
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/cancel/isCancel.js
|
|
2947
2629
|
function isCancel(value) {
|
|
2948
2630
|
return !!(value && value.__CANCEL__);
|
|
2949
2631
|
}
|
|
2950
2632
|
|
|
2951
|
-
// node_modules/axios/lib/cancel/CanceledError.js
|
|
2633
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/cancel/CanceledError.js
|
|
2952
2634
|
function CanceledError(message, config, request) {
|
|
2953
2635
|
AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
|
|
2954
2636
|
this.name = "CanceledError";
|
|
@@ -2958,7 +2640,7 @@ utils_default.inherits(CanceledError, AxiosError_default, {
|
|
|
2958
2640
|
});
|
|
2959
2641
|
var CanceledError_default = CanceledError;
|
|
2960
2642
|
|
|
2961
|
-
// node_modules/axios/lib/core/settle.js
|
|
2643
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/core/settle.js
|
|
2962
2644
|
function settle(resolve, reject, response) {
|
|
2963
2645
|
const validateStatus2 = response.config.validateStatus;
|
|
2964
2646
|
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
@@ -2974,26 +2656,25 @@ function settle(resolve, reject, response) {
|
|
|
2974
2656
|
}
|
|
2975
2657
|
}
|
|
2976
2658
|
|
|
2977
|
-
// node_modules/axios/lib/helpers/isAbsoluteURL.js
|
|
2659
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/isAbsoluteURL.js
|
|
2978
2660
|
function isAbsoluteURL(url2) {
|
|
2979
2661
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2);
|
|
2980
2662
|
}
|
|
2981
2663
|
|
|
2982
|
-
// node_modules/axios/lib/helpers/combineURLs.js
|
|
2664
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/combineURLs.js
|
|
2983
2665
|
function combineURLs(baseURL, relativeURL) {
|
|
2984
|
-
return relativeURL ? baseURL.replace(
|
|
2666
|
+
return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
2985
2667
|
}
|
|
2986
2668
|
|
|
2987
|
-
// node_modules/axios/lib/core/buildFullPath.js
|
|
2988
|
-
function buildFullPath(baseURL, requestedURL
|
|
2989
|
-
|
|
2990
|
-
if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
|
|
2669
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/core/buildFullPath.js
|
|
2670
|
+
function buildFullPath(baseURL, requestedURL) {
|
|
2671
|
+
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
|
2991
2672
|
return combineURLs(baseURL, requestedURL);
|
|
2992
2673
|
}
|
|
2993
2674
|
return requestedURL;
|
|
2994
2675
|
}
|
|
2995
2676
|
|
|
2996
|
-
// node_modules/axios/lib/adapters/http.js
|
|
2677
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/adapters/http.js
|
|
2997
2678
|
var import_proxy_from_env = __toESM(require_proxy_from_env(), 1);
|
|
2998
2679
|
var import_http = __toESM(require("http"), 1);
|
|
2999
2680
|
var import_https = __toESM(require("https"), 1);
|
|
@@ -3001,19 +2682,19 @@ var import_util2 = __toESM(require("util"), 1);
|
|
|
3001
2682
|
var import_follow_redirects = __toESM(require_follow_redirects(), 1);
|
|
3002
2683
|
var import_zlib = __toESM(require("zlib"), 1);
|
|
3003
2684
|
|
|
3004
|
-
// node_modules/axios/lib/env/data.js
|
|
3005
|
-
var VERSION = "1.
|
|
2685
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/env/data.js
|
|
2686
|
+
var VERSION = "1.3.2";
|
|
3006
2687
|
|
|
3007
|
-
// node_modules/axios/lib/helpers/parseProtocol.js
|
|
2688
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/parseProtocol.js
|
|
3008
2689
|
function parseProtocol(url2) {
|
|
3009
2690
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2);
|
|
3010
2691
|
return match && match[1] || "";
|
|
3011
2692
|
}
|
|
3012
2693
|
|
|
3013
|
-
// node_modules/axios/lib/helpers/fromDataURI.js
|
|
2694
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/fromDataURI.js
|
|
3014
2695
|
var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
|
|
3015
2696
|
function fromDataURI(uri, asBlob, options) {
|
|
3016
|
-
const _Blob = options && options.Blob ||
|
|
2697
|
+
const _Blob = options && options.Blob || node_default.classes.Blob;
|
|
3017
2698
|
const protocol = parseProtocol(uri);
|
|
3018
2699
|
if (asBlob === void 0 && _Blob) {
|
|
3019
2700
|
asBlob = true;
|
|
@@ -3039,11 +2720,75 @@ function fromDataURI(uri, asBlob, options) {
|
|
|
3039
2720
|
throw new AxiosError_default("Unsupported protocol " + protocol, AxiosError_default.ERR_NOT_SUPPORT);
|
|
3040
2721
|
}
|
|
3041
2722
|
|
|
3042
|
-
// node_modules/axios/lib/adapters/http.js
|
|
2723
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/adapters/http.js
|
|
3043
2724
|
var import_stream4 = __toESM(require("stream"), 1);
|
|
3044
2725
|
|
|
3045
|
-
// node_modules/axios/lib/helpers/AxiosTransformStream.js
|
|
2726
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/AxiosTransformStream.js
|
|
3046
2727
|
var import_stream = __toESM(require("stream"), 1);
|
|
2728
|
+
|
|
2729
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/throttle.js
|
|
2730
|
+
function throttle(fn, freq) {
|
|
2731
|
+
let timestamp = 0;
|
|
2732
|
+
const threshold = 1e3 / freq;
|
|
2733
|
+
let timer = null;
|
|
2734
|
+
return function throttled(force, args) {
|
|
2735
|
+
const now = Date.now();
|
|
2736
|
+
if (force || now - timestamp > threshold) {
|
|
2737
|
+
if (timer) {
|
|
2738
|
+
clearTimeout(timer);
|
|
2739
|
+
timer = null;
|
|
2740
|
+
}
|
|
2741
|
+
timestamp = now;
|
|
2742
|
+
return fn.apply(null, args);
|
|
2743
|
+
}
|
|
2744
|
+
if (!timer) {
|
|
2745
|
+
timer = setTimeout(() => {
|
|
2746
|
+
timer = null;
|
|
2747
|
+
timestamp = Date.now();
|
|
2748
|
+
return fn.apply(null, args);
|
|
2749
|
+
}, threshold - (now - timestamp));
|
|
2750
|
+
}
|
|
2751
|
+
};
|
|
2752
|
+
}
|
|
2753
|
+
var throttle_default = throttle;
|
|
2754
|
+
|
|
2755
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/speedometer.js
|
|
2756
|
+
function speedometer(samplesCount, min) {
|
|
2757
|
+
samplesCount = samplesCount || 10;
|
|
2758
|
+
const bytes = new Array(samplesCount);
|
|
2759
|
+
const timestamps = new Array(samplesCount);
|
|
2760
|
+
let head = 0;
|
|
2761
|
+
let tail = 0;
|
|
2762
|
+
let firstSampleTS;
|
|
2763
|
+
min = min !== void 0 ? min : 1e3;
|
|
2764
|
+
return function push(chunkLength) {
|
|
2765
|
+
const now = Date.now();
|
|
2766
|
+
const startedAt = timestamps[tail];
|
|
2767
|
+
if (!firstSampleTS) {
|
|
2768
|
+
firstSampleTS = now;
|
|
2769
|
+
}
|
|
2770
|
+
bytes[head] = chunkLength;
|
|
2771
|
+
timestamps[head] = now;
|
|
2772
|
+
let i = tail;
|
|
2773
|
+
let bytesCount = 0;
|
|
2774
|
+
while (i !== head) {
|
|
2775
|
+
bytesCount += bytes[i++];
|
|
2776
|
+
i = i % samplesCount;
|
|
2777
|
+
}
|
|
2778
|
+
head = (head + 1) % samplesCount;
|
|
2779
|
+
if (head === tail) {
|
|
2780
|
+
tail = (tail + 1) % samplesCount;
|
|
2781
|
+
}
|
|
2782
|
+
if (now - firstSampleTS < min) {
|
|
2783
|
+
return;
|
|
2784
|
+
}
|
|
2785
|
+
const passed = startedAt && now - startedAt;
|
|
2786
|
+
return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
|
|
2787
|
+
};
|
|
2788
|
+
}
|
|
2789
|
+
var speedometer_default = speedometer;
|
|
2790
|
+
|
|
2791
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/AxiosTransformStream.js
|
|
3047
2792
|
var kInternals = Symbol("internals");
|
|
3048
2793
|
var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
3049
2794
|
constructor(options) {
|
|
@@ -3060,8 +2805,11 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
|
3060
2805
|
super({
|
|
3061
2806
|
readableHighWaterMark: options.chunkSize
|
|
3062
2807
|
});
|
|
2808
|
+
const self2 = this;
|
|
3063
2809
|
const internals = this[kInternals] = {
|
|
2810
|
+
length: options.length,
|
|
3064
2811
|
timeWindow: options.timeWindow,
|
|
2812
|
+
ticksRate: options.ticksRate,
|
|
3065
2813
|
chunkSize: options.chunkSize,
|
|
3066
2814
|
maxRate: options.maxRate,
|
|
3067
2815
|
minChunkSize: options.minChunkSize,
|
|
@@ -3072,6 +2820,7 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
|
3072
2820
|
bytes: 0,
|
|
3073
2821
|
onReadCallback: null
|
|
3074
2822
|
};
|
|
2823
|
+
const _speedometer = speedometer_default(internals.ticksRate * options.samplesCount, internals.timeWindow);
|
|
3075
2824
|
this.on("newListener", (event) => {
|
|
3076
2825
|
if (event === "progress") {
|
|
3077
2826
|
if (!internals.isCaptured) {
|
|
@@ -3079,6 +2828,30 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
|
3079
2828
|
}
|
|
3080
2829
|
}
|
|
3081
2830
|
});
|
|
2831
|
+
let bytesNotified = 0;
|
|
2832
|
+
internals.updateProgress = throttle_default(function throttledHandler() {
|
|
2833
|
+
const totalBytes = internals.length;
|
|
2834
|
+
const bytesTransferred = internals.bytesSeen;
|
|
2835
|
+
const progressBytes = bytesTransferred - bytesNotified;
|
|
2836
|
+
if (!progressBytes || self2.destroyed) return;
|
|
2837
|
+
const rate = _speedometer(progressBytes);
|
|
2838
|
+
bytesNotified = bytesTransferred;
|
|
2839
|
+
process.nextTick(() => {
|
|
2840
|
+
self2.emit("progress", {
|
|
2841
|
+
"loaded": bytesTransferred,
|
|
2842
|
+
"total": totalBytes,
|
|
2843
|
+
"progress": totalBytes ? bytesTransferred / totalBytes : void 0,
|
|
2844
|
+
"bytes": progressBytes,
|
|
2845
|
+
"rate": rate ? rate : void 0,
|
|
2846
|
+
"estimated": rate && totalBytes && bytesTransferred <= totalBytes ? (totalBytes - bytesTransferred) / rate : void 0
|
|
2847
|
+
});
|
|
2848
|
+
});
|
|
2849
|
+
}, internals.ticksRate);
|
|
2850
|
+
const onFinish = () => {
|
|
2851
|
+
internals.updateProgress(true);
|
|
2852
|
+
};
|
|
2853
|
+
this.once("end", onFinish);
|
|
2854
|
+
this.once("error", onFinish);
|
|
3082
2855
|
}
|
|
3083
2856
|
_read(size) {
|
|
3084
2857
|
const internals = this[kInternals];
|
|
@@ -3088,6 +2861,7 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
|
3088
2861
|
return super._read(size);
|
|
3089
2862
|
}
|
|
3090
2863
|
_transform(chunk, encoding, callback) {
|
|
2864
|
+
const self2 = this;
|
|
3091
2865
|
const internals = this[kInternals];
|
|
3092
2866
|
const maxRate = internals.maxRate;
|
|
3093
2867
|
const readableHighWaterMark = this.readableHighWaterMark;
|
|
@@ -3095,12 +2869,14 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
|
3095
2869
|
const divider = 1e3 / timeWindow;
|
|
3096
2870
|
const bytesThreshold = maxRate / divider;
|
|
3097
2871
|
const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
|
|
3098
|
-
|
|
2872
|
+
function pushChunk(_chunk, _callback) {
|
|
3099
2873
|
const bytes = Buffer.byteLength(_chunk);
|
|
3100
2874
|
internals.bytesSeen += bytes;
|
|
3101
2875
|
internals.bytes += bytes;
|
|
3102
|
-
|
|
3103
|
-
|
|
2876
|
+
if (internals.isCaptured) {
|
|
2877
|
+
internals.updateProgress();
|
|
2878
|
+
}
|
|
2879
|
+
if (self2.push(_chunk)) {
|
|
3104
2880
|
process.nextTick(_callback);
|
|
3105
2881
|
} else {
|
|
3106
2882
|
internals.onReadCallback = () => {
|
|
@@ -3108,7 +2884,7 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
|
3108
2884
|
process.nextTick(_callback);
|
|
3109
2885
|
};
|
|
3110
2886
|
}
|
|
3111
|
-
}
|
|
2887
|
+
}
|
|
3112
2888
|
const transformChunk = (_chunk, _callback) => {
|
|
3113
2889
|
const chunkSize = Buffer.byteLength(_chunk);
|
|
3114
2890
|
let chunkRemainder = null;
|
|
@@ -3154,17 +2930,21 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
|
3154
2930
|
}
|
|
3155
2931
|
});
|
|
3156
2932
|
}
|
|
2933
|
+
setLength(length) {
|
|
2934
|
+
this[kInternals].length = +length;
|
|
2935
|
+
return this;
|
|
2936
|
+
}
|
|
3157
2937
|
};
|
|
3158
2938
|
var AxiosTransformStream_default = AxiosTransformStream;
|
|
3159
2939
|
|
|
3160
|
-
// node_modules/axios/lib/adapters/http.js
|
|
3161
|
-
var import_events = require("events");
|
|
2940
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/adapters/http.js
|
|
2941
|
+
var import_events = __toESM(require("events"), 1);
|
|
3162
2942
|
|
|
3163
|
-
// node_modules/axios/lib/helpers/formDataToStream.js
|
|
3164
|
-
var import_util =
|
|
2943
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/formDataToStream.js
|
|
2944
|
+
var import_util = require("util");
|
|
3165
2945
|
var import_stream2 = require("stream");
|
|
3166
2946
|
|
|
3167
|
-
// node_modules/axios/lib/helpers/readBlob.js
|
|
2947
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/readBlob.js
|
|
3168
2948
|
var { asyncIterator } = Symbol;
|
|
3169
2949
|
var readBlob = async function* (blob) {
|
|
3170
2950
|
if (blob.stream) {
|
|
@@ -3179,9 +2959,9 @@ var readBlob = async function* (blob) {
|
|
|
3179
2959
|
};
|
|
3180
2960
|
var readBlob_default = readBlob;
|
|
3181
2961
|
|
|
3182
|
-
// node_modules/axios/lib/helpers/formDataToStream.js
|
|
3183
|
-
var BOUNDARY_ALPHABET =
|
|
3184
|
-
var textEncoder =
|
|
2962
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/formDataToStream.js
|
|
2963
|
+
var BOUNDARY_ALPHABET = utils_default.ALPHABET.ALPHA_DIGIT + "-_";
|
|
2964
|
+
var textEncoder = new import_util.TextEncoder();
|
|
3185
2965
|
var CRLF = "\r\n";
|
|
3186
2966
|
var CRLF_BYTES = textEncoder.encode(CRLF);
|
|
3187
2967
|
var CRLF_BYTES_COUNT = 2;
|
|
@@ -3223,7 +3003,7 @@ var formDataToStream = (form, headersHandler, options) => {
|
|
|
3223
3003
|
const {
|
|
3224
3004
|
tag = "form-data-boundary",
|
|
3225
3005
|
size = 25,
|
|
3226
|
-
boundary = tag + "-" +
|
|
3006
|
+
boundary = tag + "-" + utils_default.generateString(size, BOUNDARY_ALPHABET)
|
|
3227
3007
|
} = options || {};
|
|
3228
3008
|
if (!utils_default.isFormData(form)) {
|
|
3229
3009
|
throw TypeError("FormData instance required");
|
|
@@ -3232,7 +3012,7 @@ var formDataToStream = (form, headersHandler, options) => {
|
|
|
3232
3012
|
throw Error("boundary must be 10-70 characters long");
|
|
3233
3013
|
}
|
|
3234
3014
|
const boundaryBytes = textEncoder.encode("--" + boundary + CRLF);
|
|
3235
|
-
const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF);
|
|
3015
|
+
const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF + CRLF);
|
|
3236
3016
|
let contentLength = footerBytes.byteLength;
|
|
3237
3017
|
const parts = Array.from(form.entries()).map(([name, value]) => {
|
|
3238
3018
|
const part = new FormDataPart(name, value);
|
|
@@ -3258,7 +3038,7 @@ var formDataToStream = (form, headersHandler, options) => {
|
|
|
3258
3038
|
};
|
|
3259
3039
|
var formDataToStream_default = formDataToStream;
|
|
3260
3040
|
|
|
3261
|
-
// node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
|
|
3041
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
|
|
3262
3042
|
var import_stream3 = __toESM(require("stream"), 1);
|
|
3263
3043
|
var ZlibHeaderTransformStream = class extends import_stream3.default.Transform {
|
|
3264
3044
|
__transform(chunk, encoding, callback) {
|
|
@@ -3280,181 +3060,56 @@ var ZlibHeaderTransformStream = class extends import_stream3.default.Transform {
|
|
|
3280
3060
|
};
|
|
3281
3061
|
var ZlibHeaderTransformStream_default = ZlibHeaderTransformStream;
|
|
3282
3062
|
|
|
3283
|
-
// node_modules/axios/lib/
|
|
3284
|
-
var
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
fn.apply(this, args).then((value) => {
|
|
3288
|
-
try {
|
|
3289
|
-
reducer ? cb(null, ...reducer(value)) : cb(null, value);
|
|
3290
|
-
} catch (err) {
|
|
3291
|
-
cb(err);
|
|
3292
|
-
}
|
|
3293
|
-
}, cb);
|
|
3294
|
-
} : fn;
|
|
3063
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/adapters/http.js
|
|
3064
|
+
var zlibOptions = {
|
|
3065
|
+
flush: import_zlib.default.constants.Z_SYNC_FLUSH,
|
|
3066
|
+
finishFlush: import_zlib.default.constants.Z_SYNC_FLUSH
|
|
3295
3067
|
};
|
|
3296
|
-
var
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3068
|
+
var brotliOptions = {
|
|
3069
|
+
flush: import_zlib.default.constants.BROTLI_OPERATION_FLUSH,
|
|
3070
|
+
finishFlush: import_zlib.default.constants.BROTLI_OPERATION_FLUSH
|
|
3071
|
+
};
|
|
3072
|
+
var isBrotliSupported = utils_default.isFunction(import_zlib.default.createBrotliDecompress);
|
|
3073
|
+
var { http: httpFollow, https: httpsFollow } = import_follow_redirects.default;
|
|
3074
|
+
var isHttps = /https:?/;
|
|
3075
|
+
var supportedProtocols = node_default.protocols.map((protocol) => {
|
|
3076
|
+
return protocol + ":";
|
|
3077
|
+
});
|
|
3078
|
+
function dispatchBeforeRedirect(options) {
|
|
3079
|
+
if (options.beforeRedirects.proxy) {
|
|
3080
|
+
options.beforeRedirects.proxy(options);
|
|
3081
|
+
}
|
|
3082
|
+
if (options.beforeRedirects.config) {
|
|
3083
|
+
options.beforeRedirects.config(options);
|
|
3084
|
+
}
|
|
3085
|
+
}
|
|
3086
|
+
function setProxy(options, configProxy, location) {
|
|
3087
|
+
let proxy = configProxy;
|
|
3088
|
+
if (!proxy && proxy !== false) {
|
|
3089
|
+
const proxyUrl = (0, import_proxy_from_env.getProxyForUrl)(location);
|
|
3090
|
+
if (proxyUrl) {
|
|
3091
|
+
proxy = new URL(proxyUrl);
|
|
3312
3092
|
}
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
while (i !== head) {
|
|
3318
|
-
bytesCount += bytes[i++];
|
|
3319
|
-
i = i % samplesCount;
|
|
3093
|
+
}
|
|
3094
|
+
if (proxy) {
|
|
3095
|
+
if (proxy.username) {
|
|
3096
|
+
proxy.auth = (proxy.username || "") + ":" + (proxy.password || "");
|
|
3320
3097
|
}
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3098
|
+
if (proxy.auth) {
|
|
3099
|
+
if (proxy.auth.username || proxy.auth.password) {
|
|
3100
|
+
proxy.auth = (proxy.auth.username || "") + ":" + (proxy.auth.password || "");
|
|
3101
|
+
}
|
|
3102
|
+
const base64 = Buffer.from(proxy.auth, "utf8").toString("base64");
|
|
3103
|
+
options.headers["Proxy-Authorization"] = "Basic " + base64;
|
|
3324
3104
|
}
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
// node_modules/axios/lib/helpers/throttle.js
|
|
3335
|
-
function throttle(fn, freq) {
|
|
3336
|
-
let timestamp = 0;
|
|
3337
|
-
let threshold = 1e3 / freq;
|
|
3338
|
-
let lastArgs;
|
|
3339
|
-
let timer;
|
|
3340
|
-
const invoke = (args, now = Date.now()) => {
|
|
3341
|
-
timestamp = now;
|
|
3342
|
-
lastArgs = null;
|
|
3343
|
-
if (timer) {
|
|
3344
|
-
clearTimeout(timer);
|
|
3345
|
-
timer = null;
|
|
3346
|
-
}
|
|
3347
|
-
fn.apply(null, args);
|
|
3348
|
-
};
|
|
3349
|
-
const throttled = (...args) => {
|
|
3350
|
-
const now = Date.now();
|
|
3351
|
-
const passed = now - timestamp;
|
|
3352
|
-
if (passed >= threshold) {
|
|
3353
|
-
invoke(args, now);
|
|
3354
|
-
} else {
|
|
3355
|
-
lastArgs = args;
|
|
3356
|
-
if (!timer) {
|
|
3357
|
-
timer = setTimeout(() => {
|
|
3358
|
-
timer = null;
|
|
3359
|
-
invoke(lastArgs);
|
|
3360
|
-
}, threshold - passed);
|
|
3361
|
-
}
|
|
3362
|
-
}
|
|
3363
|
-
};
|
|
3364
|
-
const flush = () => lastArgs && invoke(lastArgs);
|
|
3365
|
-
return [throttled, flush];
|
|
3366
|
-
}
|
|
3367
|
-
var throttle_default = throttle;
|
|
3368
|
-
|
|
3369
|
-
// node_modules/axios/lib/helpers/progressEventReducer.js
|
|
3370
|
-
var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
3371
|
-
let bytesNotified = 0;
|
|
3372
|
-
const _speedometer = speedometer_default(50, 250);
|
|
3373
|
-
return throttle_default((e) => {
|
|
3374
|
-
const loaded = e.loaded;
|
|
3375
|
-
const total = e.lengthComputable ? e.total : void 0;
|
|
3376
|
-
const progressBytes = loaded - bytesNotified;
|
|
3377
|
-
const rate = _speedometer(progressBytes);
|
|
3378
|
-
const inRange = loaded <= total;
|
|
3379
|
-
bytesNotified = loaded;
|
|
3380
|
-
const data = {
|
|
3381
|
-
loaded,
|
|
3382
|
-
total,
|
|
3383
|
-
progress: total ? loaded / total : void 0,
|
|
3384
|
-
bytes: progressBytes,
|
|
3385
|
-
rate: rate ? rate : void 0,
|
|
3386
|
-
estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
|
|
3387
|
-
event: e,
|
|
3388
|
-
lengthComputable: total != null,
|
|
3389
|
-
[isDownloadStream ? "download" : "upload"]: true
|
|
3390
|
-
};
|
|
3391
|
-
listener(data);
|
|
3392
|
-
}, freq);
|
|
3393
|
-
};
|
|
3394
|
-
var progressEventDecorator = (total, throttled) => {
|
|
3395
|
-
const lengthComputable = total != null;
|
|
3396
|
-
return [(loaded) => throttled[0]({
|
|
3397
|
-
lengthComputable,
|
|
3398
|
-
total,
|
|
3399
|
-
loaded
|
|
3400
|
-
}), throttled[1]];
|
|
3401
|
-
};
|
|
3402
|
-
var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
|
|
3403
|
-
|
|
3404
|
-
// node_modules/axios/lib/adapters/http.js
|
|
3405
|
-
var zlibOptions = {
|
|
3406
|
-
flush: import_zlib.default.constants.Z_SYNC_FLUSH,
|
|
3407
|
-
finishFlush: import_zlib.default.constants.Z_SYNC_FLUSH
|
|
3408
|
-
};
|
|
3409
|
-
var brotliOptions = {
|
|
3410
|
-
flush: import_zlib.default.constants.BROTLI_OPERATION_FLUSH,
|
|
3411
|
-
finishFlush: import_zlib.default.constants.BROTLI_OPERATION_FLUSH
|
|
3412
|
-
};
|
|
3413
|
-
var isBrotliSupported = utils_default.isFunction(import_zlib.default.createBrotliDecompress);
|
|
3414
|
-
var { http: httpFollow, https: httpsFollow } = import_follow_redirects.default;
|
|
3415
|
-
var isHttps = /https:?/;
|
|
3416
|
-
var supportedProtocols = platform_default.protocols.map((protocol) => {
|
|
3417
|
-
return protocol + ":";
|
|
3418
|
-
});
|
|
3419
|
-
var flushOnFinish = (stream4, [throttled, flush]) => {
|
|
3420
|
-
stream4.on("end", flush).on("error", flush);
|
|
3421
|
-
return throttled;
|
|
3422
|
-
};
|
|
3423
|
-
function dispatchBeforeRedirect(options, responseDetails) {
|
|
3424
|
-
if (options.beforeRedirects.proxy) {
|
|
3425
|
-
options.beforeRedirects.proxy(options);
|
|
3426
|
-
}
|
|
3427
|
-
if (options.beforeRedirects.config) {
|
|
3428
|
-
options.beforeRedirects.config(options, responseDetails);
|
|
3429
|
-
}
|
|
3430
|
-
}
|
|
3431
|
-
function setProxy(options, configProxy, location) {
|
|
3432
|
-
let proxy = configProxy;
|
|
3433
|
-
if (!proxy && proxy !== false) {
|
|
3434
|
-
const proxyUrl = import_proxy_from_env.default.getProxyForUrl(location);
|
|
3435
|
-
if (proxyUrl) {
|
|
3436
|
-
proxy = new URL(proxyUrl);
|
|
3437
|
-
}
|
|
3438
|
-
}
|
|
3439
|
-
if (proxy) {
|
|
3440
|
-
if (proxy.username) {
|
|
3441
|
-
proxy.auth = (proxy.username || "") + ":" + (proxy.password || "");
|
|
3442
|
-
}
|
|
3443
|
-
if (proxy.auth) {
|
|
3444
|
-
if (proxy.auth.username || proxy.auth.password) {
|
|
3445
|
-
proxy.auth = (proxy.auth.username || "") + ":" + (proxy.auth.password || "");
|
|
3446
|
-
}
|
|
3447
|
-
const base64 = Buffer.from(proxy.auth, "utf8").toString("base64");
|
|
3448
|
-
options.headers["Proxy-Authorization"] = "Basic " + base64;
|
|
3449
|
-
}
|
|
3450
|
-
options.headers.host = options.hostname + (options.port ? ":" + options.port : "");
|
|
3451
|
-
const proxyHost = proxy.hostname || proxy.host;
|
|
3452
|
-
options.hostname = proxyHost;
|
|
3453
|
-
options.host = proxyHost;
|
|
3454
|
-
options.port = proxy.port;
|
|
3455
|
-
options.path = location;
|
|
3456
|
-
if (proxy.protocol) {
|
|
3457
|
-
options.protocol = proxy.protocol.includes(":") ? proxy.protocol : `${proxy.protocol}:`;
|
|
3105
|
+
options.headers.host = options.hostname + (options.port ? ":" + options.port : "");
|
|
3106
|
+
const proxyHost = proxy.hostname || proxy.host;
|
|
3107
|
+
options.hostname = proxyHost;
|
|
3108
|
+
options.host = proxyHost;
|
|
3109
|
+
options.port = proxy.port;
|
|
3110
|
+
options.path = location;
|
|
3111
|
+
if (proxy.protocol) {
|
|
3112
|
+
options.protocol = proxy.protocol.includes(":") ? proxy.protocol : `${proxy.protocol}:`;
|
|
3458
3113
|
}
|
|
3459
3114
|
}
|
|
3460
3115
|
options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
|
|
@@ -3462,58 +3117,20 @@ function setProxy(options, configProxy, location) {
|
|
|
3462
3117
|
};
|
|
3463
3118
|
}
|
|
3464
3119
|
var isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process";
|
|
3465
|
-
var wrapAsync = (asyncExecutor) => {
|
|
3466
|
-
return new Promise((resolve, reject) => {
|
|
3467
|
-
let onDone;
|
|
3468
|
-
let isDone;
|
|
3469
|
-
const done = (value, isRejected) => {
|
|
3470
|
-
if (isDone) return;
|
|
3471
|
-
isDone = true;
|
|
3472
|
-
onDone && onDone(value, isRejected);
|
|
3473
|
-
};
|
|
3474
|
-
const _resolve = (value) => {
|
|
3475
|
-
done(value);
|
|
3476
|
-
resolve(value);
|
|
3477
|
-
};
|
|
3478
|
-
const _reject = (reason) => {
|
|
3479
|
-
done(reason, true);
|
|
3480
|
-
reject(reason);
|
|
3481
|
-
};
|
|
3482
|
-
asyncExecutor(_resolve, _reject, (onDoneHandler) => onDone = onDoneHandler).catch(_reject);
|
|
3483
|
-
});
|
|
3484
|
-
};
|
|
3485
|
-
var resolveFamily = ({ address, family }) => {
|
|
3486
|
-
if (!utils_default.isString(address)) {
|
|
3487
|
-
throw TypeError("address must be a string");
|
|
3488
|
-
}
|
|
3489
|
-
return {
|
|
3490
|
-
address,
|
|
3491
|
-
family: family || (address.indexOf(".") < 0 ? 6 : 4)
|
|
3492
|
-
};
|
|
3493
|
-
};
|
|
3494
|
-
var buildAddressEntry = (address, family) => resolveFamily(utils_default.isObject(address) ? address : { address, family });
|
|
3495
3120
|
var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
3496
|
-
return
|
|
3497
|
-
let
|
|
3498
|
-
const
|
|
3121
|
+
return new Promise(async function dispatchHttpRequest(resolvePromise, rejectPromise) {
|
|
3122
|
+
let data = config.data;
|
|
3123
|
+
const responseType = config.responseType;
|
|
3124
|
+
const responseEncoding = config.responseEncoding;
|
|
3499
3125
|
const method = config.method.toUpperCase();
|
|
3126
|
+
let isFinished;
|
|
3500
3127
|
let isDone;
|
|
3501
3128
|
let rejected = false;
|
|
3502
3129
|
let req;
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
if (err) {
|
|
3508
|
-
return cb(err);
|
|
3509
|
-
}
|
|
3510
|
-
const addresses = utils_default.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
|
|
3511
|
-
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
|
|
3512
|
-
});
|
|
3513
|
-
};
|
|
3514
|
-
}
|
|
3515
|
-
const emitter = new import_events.EventEmitter();
|
|
3516
|
-
const onFinished = () => {
|
|
3130
|
+
const emitter = new import_events.default();
|
|
3131
|
+
function onFinished() {
|
|
3132
|
+
if (isFinished) return;
|
|
3133
|
+
isFinished = true;
|
|
3517
3134
|
if (config.cancelToken) {
|
|
3518
3135
|
config.cancelToken.unsubscribe(abort);
|
|
3519
3136
|
}
|
|
@@ -3521,14 +3138,22 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3521
3138
|
config.signal.removeEventListener("abort", abort);
|
|
3522
3139
|
}
|
|
3523
3140
|
emitter.removeAllListeners();
|
|
3524
|
-
}
|
|
3525
|
-
|
|
3141
|
+
}
|
|
3142
|
+
function done(value, isRejected) {
|
|
3143
|
+
if (isDone) return;
|
|
3526
3144
|
isDone = true;
|
|
3527
3145
|
if (isRejected) {
|
|
3528
3146
|
rejected = true;
|
|
3529
3147
|
onFinished();
|
|
3530
3148
|
}
|
|
3531
|
-
|
|
3149
|
+
isRejected ? rejectPromise(value) : resolvePromise(value);
|
|
3150
|
+
}
|
|
3151
|
+
const resolve = function resolve2(value) {
|
|
3152
|
+
done(value);
|
|
3153
|
+
};
|
|
3154
|
+
const reject = function reject2(value) {
|
|
3155
|
+
done(value, true);
|
|
3156
|
+
};
|
|
3532
3157
|
function abort(reason) {
|
|
3533
3158
|
emitter.emit("abort", !reason || reason.type ? new CanceledError_default(null, config, req) : reason);
|
|
3534
3159
|
}
|
|
@@ -3539,8 +3164,8 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3539
3164
|
config.signal.aborted ? abort() : config.signal.addEventListener("abort", abort);
|
|
3540
3165
|
}
|
|
3541
3166
|
}
|
|
3542
|
-
const fullPath = buildFullPath(config.baseURL, config.url
|
|
3543
|
-
const parsed = new URL(fullPath,
|
|
3167
|
+
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
3168
|
+
const parsed = new URL(fullPath, "http://localhost");
|
|
3544
3169
|
const protocol = parsed.protocol || supportedProtocols[0];
|
|
3545
3170
|
if (protocol === "data:") {
|
|
3546
3171
|
let convertedData;
|
|
@@ -3584,7 +3209,8 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3584
3209
|
}
|
|
3585
3210
|
const headers = AxiosHeaders_default.from(config.headers).normalize();
|
|
3586
3211
|
headers.set("User-Agent", "axios/" + VERSION, false);
|
|
3587
|
-
const
|
|
3212
|
+
const onDownloadProgress = config.onDownloadProgress;
|
|
3213
|
+
const onUploadProgress = config.onUploadProgress;
|
|
3588
3214
|
const maxRate = config.maxRate;
|
|
3589
3215
|
let maxUploadRate = void 0;
|
|
3590
3216
|
let maxDownloadRate = void 0;
|
|
@@ -3601,11 +3227,11 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3601
3227
|
if (!headers.hasContentLength()) {
|
|
3602
3228
|
try {
|
|
3603
3229
|
const knownLength = await import_util2.default.promisify(data.getLength).call(data);
|
|
3604
|
-
|
|
3230
|
+
headers.setContentLength(knownLength);
|
|
3605
3231
|
} catch (e) {
|
|
3606
3232
|
}
|
|
3607
3233
|
}
|
|
3608
|
-
} else if (utils_default.isBlob(data)
|
|
3234
|
+
} else if (utils_default.isBlob(data)) {
|
|
3609
3235
|
data.size && headers.setContentType(data.type || "application/octet-stream");
|
|
3610
3236
|
headers.setContentLength(data.size || 0);
|
|
3611
3237
|
data = import_stream4.default.Readable.from(readBlob_default(data));
|
|
@@ -3643,15 +3269,14 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3643
3269
|
data = import_stream4.default.Readable.from(data, { objectMode: false });
|
|
3644
3270
|
}
|
|
3645
3271
|
data = import_stream4.default.pipeline([data, new AxiosTransformStream_default({
|
|
3272
|
+
length: contentLength,
|
|
3646
3273
|
maxRate: utils_default.toFiniteNumber(maxUploadRate)
|
|
3647
3274
|
})], utils_default.noop);
|
|
3648
|
-
onUploadProgress && data.on("progress",
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
)
|
|
3654
|
-
));
|
|
3275
|
+
onUploadProgress && data.on("progress", (progress) => {
|
|
3276
|
+
onUploadProgress(Object.assign(progress, {
|
|
3277
|
+
upload: true
|
|
3278
|
+
}));
|
|
3279
|
+
});
|
|
3655
3280
|
}
|
|
3656
3281
|
let auth = void 0;
|
|
3657
3282
|
if (config.auth) {
|
|
@@ -3691,15 +3316,13 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3691
3316
|
agents: { http: config.httpAgent, https: config.httpsAgent },
|
|
3692
3317
|
auth,
|
|
3693
3318
|
protocol,
|
|
3694
|
-
family,
|
|
3695
3319
|
beforeRedirect: dispatchBeforeRedirect,
|
|
3696
3320
|
beforeRedirects: {}
|
|
3697
3321
|
};
|
|
3698
|
-
!utils_default.isUndefined(lookup) && (options.lookup = lookup);
|
|
3699
3322
|
if (config.socketPath) {
|
|
3700
3323
|
options.socketPath = config.socketPath;
|
|
3701
3324
|
} else {
|
|
3702
|
-
options.hostname = parsed.hostname
|
|
3325
|
+
options.hostname = parsed.hostname;
|
|
3703
3326
|
options.port = parsed.port;
|
|
3704
3327
|
setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
|
|
3705
3328
|
}
|
|
@@ -3731,17 +3354,16 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3731
3354
|
if (req.destroyed) return;
|
|
3732
3355
|
const streams = [res];
|
|
3733
3356
|
const responseLength = +res.headers["content-length"];
|
|
3734
|
-
if (onDownloadProgress
|
|
3357
|
+
if (onDownloadProgress) {
|
|
3735
3358
|
const transformStream = new AxiosTransformStream_default({
|
|
3359
|
+
length: utils_default.toFiniteNumber(responseLength),
|
|
3736
3360
|
maxRate: utils_default.toFiniteNumber(maxDownloadRate)
|
|
3737
3361
|
});
|
|
3738
|
-
onDownloadProgress && transformStream.on("progress",
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
)
|
|
3744
|
-
));
|
|
3362
|
+
onDownloadProgress && transformStream.on("progress", (progress) => {
|
|
3363
|
+
onDownloadProgress(Object.assign(progress, {
|
|
3364
|
+
download: true
|
|
3365
|
+
}));
|
|
3366
|
+
});
|
|
3745
3367
|
streams.push(transformStream);
|
|
3746
3368
|
}
|
|
3747
3369
|
let responseStream = res;
|
|
@@ -3750,7 +3372,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3750
3372
|
if (method === "HEAD" || res.statusCode === 204) {
|
|
3751
3373
|
delete res.headers["content-encoding"];
|
|
3752
3374
|
}
|
|
3753
|
-
switch (
|
|
3375
|
+
switch (res.headers["content-encoding"]) {
|
|
3754
3376
|
/*eslint default-case:0*/
|
|
3755
3377
|
case "gzip":
|
|
3756
3378
|
case "x-gzip":
|
|
@@ -3808,7 +3430,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3808
3430
|
return;
|
|
3809
3431
|
}
|
|
3810
3432
|
const err = new AxiosError_default(
|
|
3811
|
-
"
|
|
3433
|
+
"maxContentLength size of " + config.maxContentLength + " exceeded",
|
|
3812
3434
|
AxiosError_default.ERR_BAD_RESPONSE,
|
|
3813
3435
|
config,
|
|
3814
3436
|
lastRequest
|
|
@@ -3831,7 +3453,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3831
3453
|
}
|
|
3832
3454
|
response.data = responseData;
|
|
3833
3455
|
} catch (err) {
|
|
3834
|
-
|
|
3456
|
+
reject(AxiosError_default.from(err, null, config, response.request, response));
|
|
3835
3457
|
}
|
|
3836
3458
|
settle(resolve, reject, response);
|
|
3837
3459
|
});
|
|
@@ -3855,7 +3477,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3855
3477
|
});
|
|
3856
3478
|
if (config.timeout) {
|
|
3857
3479
|
const timeout = parseInt(config.timeout, 10);
|
|
3858
|
-
if (
|
|
3480
|
+
if (isNaN(timeout)) {
|
|
3859
3481
|
reject(new AxiosError_default(
|
|
3860
3482
|
"error trying to parse `config.timeout` to int",
|
|
3861
3483
|
AxiosError_default.ERR_BAD_OPTION_VALUE,
|
|
@@ -3902,181 +3524,144 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3902
3524
|
});
|
|
3903
3525
|
};
|
|
3904
3526
|
|
|
3905
|
-
// node_modules/axios/lib/helpers/
|
|
3906
|
-
var
|
|
3907
|
-
url2 = new URL(url2, platform_default.origin);
|
|
3908
|
-
return origin2.protocol === url2.protocol && origin2.host === url2.host && (isMSIE || origin2.port === url2.port);
|
|
3909
|
-
})(
|
|
3910
|
-
new URL(platform_default.origin),
|
|
3911
|
-
platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)
|
|
3912
|
-
) : () => true;
|
|
3913
|
-
|
|
3914
|
-
// node_modules/axios/lib/helpers/cookies.js
|
|
3915
|
-
var cookies_default = platform_default.hasStandardBrowserEnv ? (
|
|
3527
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/cookies.js
|
|
3528
|
+
var cookies_default = node_default.isStandardBrowserEnv ? (
|
|
3916
3529
|
// Standard browser envs support document.cookie
|
|
3917
|
-
{
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3530
|
+
/* @__PURE__ */ function standardBrowserEnv() {
|
|
3531
|
+
return {
|
|
3532
|
+
write: function write(name, value, expires, path6, domain, secure) {
|
|
3533
|
+
const cookie = [];
|
|
3534
|
+
cookie.push(name + "=" + encodeURIComponent(value));
|
|
3535
|
+
if (utils_default.isNumber(expires)) {
|
|
3536
|
+
cookie.push("expires=" + new Date(expires).toGMTString());
|
|
3537
|
+
}
|
|
3538
|
+
if (utils_default.isString(path6)) {
|
|
3539
|
+
cookie.push("path=" + path6);
|
|
3540
|
+
}
|
|
3541
|
+
if (utils_default.isString(domain)) {
|
|
3542
|
+
cookie.push("domain=" + domain);
|
|
3543
|
+
}
|
|
3544
|
+
if (secure === true) {
|
|
3545
|
+
cookie.push("secure");
|
|
3546
|
+
}
|
|
3547
|
+
document.cookie = cookie.join("; ");
|
|
3548
|
+
},
|
|
3549
|
+
read: function read(name) {
|
|
3550
|
+
const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
|
|
3551
|
+
return match ? decodeURIComponent(match[3]) : null;
|
|
3552
|
+
},
|
|
3553
|
+
remove: function remove(name) {
|
|
3554
|
+
this.write(name, "", Date.now() - 864e5);
|
|
3555
|
+
}
|
|
3556
|
+
};
|
|
3557
|
+
}()
|
|
3934
3558
|
) : (
|
|
3935
|
-
// Non
|
|
3936
|
-
{
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3559
|
+
// Non standard browser env (web workers, react-native) lack needed support.
|
|
3560
|
+
/* @__PURE__ */ function nonStandardBrowserEnv() {
|
|
3561
|
+
return {
|
|
3562
|
+
write: function write() {
|
|
3563
|
+
},
|
|
3564
|
+
read: function read() {
|
|
3565
|
+
return null;
|
|
3566
|
+
},
|
|
3567
|
+
remove: function remove() {
|
|
3568
|
+
}
|
|
3569
|
+
};
|
|
3570
|
+
}()
|
|
3945
3571
|
);
|
|
3946
3572
|
|
|
3947
|
-
// node_modules/axios/lib/
|
|
3948
|
-
var
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
}
|
|
3973
|
-
}
|
|
3974
|
-
function defaultToConfig2(a, b) {
|
|
3975
|
-
if (!utils_default.isUndefined(b)) {
|
|
3976
|
-
return getMergedValue(void 0, b);
|
|
3977
|
-
} else if (!utils_default.isUndefined(a)) {
|
|
3978
|
-
return getMergedValue(void 0, a);
|
|
3979
|
-
}
|
|
3980
|
-
}
|
|
3981
|
-
function mergeDirectKeys(a, b, prop) {
|
|
3982
|
-
if (prop in config2) {
|
|
3983
|
-
return getMergedValue(a, b);
|
|
3984
|
-
} else if (prop in config1) {
|
|
3985
|
-
return getMergedValue(void 0, a);
|
|
3573
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/isURLSameOrigin.js
|
|
3574
|
+
var isURLSameOrigin_default = node_default.isStandardBrowserEnv ? (
|
|
3575
|
+
// Standard browser envs have full support of the APIs needed to test
|
|
3576
|
+
// whether the request URL is of the same origin as current location.
|
|
3577
|
+
function standardBrowserEnv2() {
|
|
3578
|
+
const msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
3579
|
+
const urlParsingNode = document.createElement("a");
|
|
3580
|
+
let originURL;
|
|
3581
|
+
function resolveURL(url2) {
|
|
3582
|
+
let href = url2;
|
|
3583
|
+
if (msie) {
|
|
3584
|
+
urlParsingNode.setAttribute("href", href);
|
|
3585
|
+
href = urlParsingNode.href;
|
|
3586
|
+
}
|
|
3587
|
+
urlParsingNode.setAttribute("href", href);
|
|
3588
|
+
return {
|
|
3589
|
+
href: urlParsingNode.href,
|
|
3590
|
+
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
|
|
3591
|
+
host: urlParsingNode.host,
|
|
3592
|
+
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
|
|
3593
|
+
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
|
|
3594
|
+
hostname: urlParsingNode.hostname,
|
|
3595
|
+
port: urlParsingNode.port,
|
|
3596
|
+
pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
|
|
3597
|
+
};
|
|
3986
3598
|
}
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
3599
|
+
originURL = resolveURL(window.location.href);
|
|
3600
|
+
return function isURLSameOrigin(requestURL) {
|
|
3601
|
+
const parsed = utils_default.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
|
3602
|
+
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
|
3603
|
+
};
|
|
3604
|
+
}()
|
|
3605
|
+
) : (
|
|
3606
|
+
// Non standard browser envs (web workers, react-native) lack needed support.
|
|
3607
|
+
/* @__PURE__ */ function nonStandardBrowserEnv2() {
|
|
3608
|
+
return function isURLSameOrigin() {
|
|
3609
|
+
return true;
|
|
3610
|
+
};
|
|
3611
|
+
}()
|
|
3612
|
+
);
|
|
3613
|
+
|
|
3614
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/adapters/xhr.js
|
|
3615
|
+
function progressEventReducer(listener, isDownloadStream) {
|
|
3616
|
+
let bytesNotified = 0;
|
|
3617
|
+
const _speedometer = speedometer_default(50, 250);
|
|
3618
|
+
return (e) => {
|
|
3619
|
+
const loaded = e.loaded;
|
|
3620
|
+
const total = e.lengthComputable ? e.total : void 0;
|
|
3621
|
+
const progressBytes = loaded - bytesNotified;
|
|
3622
|
+
const rate = _speedometer(progressBytes);
|
|
3623
|
+
const inRange = loaded <= total;
|
|
3624
|
+
bytesNotified = loaded;
|
|
3625
|
+
const data = {
|
|
3626
|
+
loaded,
|
|
3627
|
+
total,
|
|
3628
|
+
progress: total ? loaded / total : void 0,
|
|
3629
|
+
bytes: progressBytes,
|
|
3630
|
+
rate: rate ? rate : void 0,
|
|
3631
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
|
|
3632
|
+
event: e
|
|
3633
|
+
};
|
|
3634
|
+
data[isDownloadStream ? "download" : "upload"] = true;
|
|
3635
|
+
listener(data);
|
|
4018
3636
|
};
|
|
4019
|
-
utils_default.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
4020
|
-
const merge2 = mergeMap[prop] || mergeDeepProperties;
|
|
4021
|
-
const configValue = merge2(config1[prop], config2[prop], prop);
|
|
4022
|
-
utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
|
|
4023
|
-
});
|
|
4024
|
-
return config;
|
|
4025
3637
|
}
|
|
4026
|
-
|
|
4027
|
-
// node_modules/axios/lib/helpers/resolveConfig.js
|
|
4028
|
-
var resolveConfig_default = (config) => {
|
|
4029
|
-
const newConfig = mergeConfig({}, config);
|
|
4030
|
-
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
|
|
4031
|
-
newConfig.headers = headers = AxiosHeaders_default.from(headers);
|
|
4032
|
-
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
|
|
4033
|
-
if (auth) {
|
|
4034
|
-
headers.set(
|
|
4035
|
-
"Authorization",
|
|
4036
|
-
"Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
|
|
4037
|
-
);
|
|
4038
|
-
}
|
|
4039
|
-
let contentType;
|
|
4040
|
-
if (utils_default.isFormData(data)) {
|
|
4041
|
-
if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
|
|
4042
|
-
headers.setContentType(void 0);
|
|
4043
|
-
} else if ((contentType = headers.getContentType()) !== false) {
|
|
4044
|
-
const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
|
|
4045
|
-
headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
|
|
4046
|
-
}
|
|
4047
|
-
}
|
|
4048
|
-
if (platform_default.hasStandardBrowserEnv) {
|
|
4049
|
-
withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
4050
|
-
if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) {
|
|
4051
|
-
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName);
|
|
4052
|
-
if (xsrfValue) {
|
|
4053
|
-
headers.set(xsrfHeaderName, xsrfValue);
|
|
4054
|
-
}
|
|
4055
|
-
}
|
|
4056
|
-
}
|
|
4057
|
-
return newConfig;
|
|
4058
|
-
};
|
|
4059
|
-
|
|
4060
|
-
// node_modules/axios/lib/adapters/xhr.js
|
|
4061
3638
|
var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
4062
3639
|
var xhr_default = isXHRAdapterSupported && function(config) {
|
|
4063
3640
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
const
|
|
4067
|
-
let { responseType, onUploadProgress, onDownloadProgress } = _config;
|
|
3641
|
+
let requestData = config.data;
|
|
3642
|
+
const requestHeaders = AxiosHeaders_default.from(config.headers).normalize();
|
|
3643
|
+
const responseType = config.responseType;
|
|
4068
3644
|
let onCanceled;
|
|
4069
|
-
let uploadThrottled, downloadThrottled;
|
|
4070
|
-
let flushUpload, flushDownload;
|
|
4071
3645
|
function done() {
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
3646
|
+
if (config.cancelToken) {
|
|
3647
|
+
config.cancelToken.unsubscribe(onCanceled);
|
|
3648
|
+
}
|
|
3649
|
+
if (config.signal) {
|
|
3650
|
+
config.signal.removeEventListener("abort", onCanceled);
|
|
3651
|
+
}
|
|
3652
|
+
}
|
|
3653
|
+
if (utils_default.isFormData(requestData) && (node_default.isStandardBrowserEnv || node_default.isStandardBrowserWebWorkerEnv)) {
|
|
3654
|
+
requestHeaders.setContentType(false);
|
|
4076
3655
|
}
|
|
4077
3656
|
let request = new XMLHttpRequest();
|
|
4078
|
-
|
|
4079
|
-
|
|
3657
|
+
if (config.auth) {
|
|
3658
|
+
const username = config.auth.username || "";
|
|
3659
|
+
const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
|
|
3660
|
+
requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password));
|
|
3661
|
+
}
|
|
3662
|
+
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
3663
|
+
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
|
3664
|
+
request.timeout = config.timeout;
|
|
4080
3665
|
function onloadend() {
|
|
4081
3666
|
if (!request) {
|
|
4082
3667
|
return;
|
|
@@ -4127,345 +3712,70 @@ var xhr_default = isXHRAdapterSupported && function(config) {
|
|
|
4127
3712
|
request = null;
|
|
4128
3713
|
};
|
|
4129
3714
|
request.ontimeout = function handleTimeout() {
|
|
4130
|
-
let timeoutErrorMessage =
|
|
4131
|
-
const transitional2 =
|
|
4132
|
-
if (
|
|
4133
|
-
timeoutErrorMessage =
|
|
3715
|
+
let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
|
|
3716
|
+
const transitional2 = config.transitional || transitional_default;
|
|
3717
|
+
if (config.timeoutErrorMessage) {
|
|
3718
|
+
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
4134
3719
|
}
|
|
4135
3720
|
reject(new AxiosError_default(
|
|
4136
3721
|
timeoutErrorMessage,
|
|
4137
|
-
transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
|
|
4138
|
-
config,
|
|
4139
|
-
request
|
|
4140
|
-
));
|
|
4141
|
-
request = null;
|
|
4142
|
-
};
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
});
|
|
4148
|
-
}
|
|
4149
|
-
if (!utils_default.isUndefined(_config.withCredentials)) {
|
|
4150
|
-
request.withCredentials = !!_config.withCredentials;
|
|
4151
|
-
}
|
|
4152
|
-
if (responseType && responseType !== "json") {
|
|
4153
|
-
request.responseType = _config.responseType;
|
|
4154
|
-
}
|
|
4155
|
-
if (onDownloadProgress) {
|
|
4156
|
-
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
|
4157
|
-
request.addEventListener("progress", downloadThrottled);
|
|
4158
|
-
}
|
|
4159
|
-
if (onUploadProgress && request.upload) {
|
|
4160
|
-
[uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
|
|
4161
|
-
request.upload.addEventListener("progress", uploadThrottled);
|
|
4162
|
-
request.upload.addEventListener("loadend", flushUpload);
|
|
4163
|
-
}
|
|
4164
|
-
if (_config.cancelToken || _config.signal) {
|
|
4165
|
-
onCanceled = (cancel) => {
|
|
4166
|
-
if (!request) {
|
|
4167
|
-
return;
|
|
4168
|
-
}
|
|
4169
|
-
reject(!cancel || cancel.type ? new CanceledError_default(null, config, request) : cancel);
|
|
4170
|
-
request.abort();
|
|
4171
|
-
request = null;
|
|
4172
|
-
};
|
|
4173
|
-
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
4174
|
-
if (_config.signal) {
|
|
4175
|
-
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
|
|
4176
|
-
}
|
|
4177
|
-
}
|
|
4178
|
-
const protocol = parseProtocol(_config.url);
|
|
4179
|
-
if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
|
|
4180
|
-
reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config));
|
|
4181
|
-
return;
|
|
4182
|
-
}
|
|
4183
|
-
request.send(requestData || null);
|
|
4184
|
-
});
|
|
4185
|
-
};
|
|
4186
|
-
|
|
4187
|
-
// node_modules/axios/lib/helpers/composeSignals.js
|
|
4188
|
-
var composeSignals = (signals, timeout) => {
|
|
4189
|
-
const { length } = signals = signals ? signals.filter(Boolean) : [];
|
|
4190
|
-
if (timeout || length) {
|
|
4191
|
-
let controller = new AbortController();
|
|
4192
|
-
let aborted;
|
|
4193
|
-
const onabort = function(reason) {
|
|
4194
|
-
if (!aborted) {
|
|
4195
|
-
aborted = true;
|
|
4196
|
-
unsubscribe();
|
|
4197
|
-
const err = reason instanceof Error ? reason : this.reason;
|
|
4198
|
-
controller.abort(err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err));
|
|
4199
|
-
}
|
|
4200
|
-
};
|
|
4201
|
-
let timer = timeout && setTimeout(() => {
|
|
4202
|
-
timer = null;
|
|
4203
|
-
onabort(new AxiosError_default(`timeout ${timeout} of ms exceeded`, AxiosError_default.ETIMEDOUT));
|
|
4204
|
-
}, timeout);
|
|
4205
|
-
const unsubscribe = () => {
|
|
4206
|
-
if (signals) {
|
|
4207
|
-
timer && clearTimeout(timer);
|
|
4208
|
-
timer = null;
|
|
4209
|
-
signals.forEach((signal2) => {
|
|
4210
|
-
signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
|
|
4211
|
-
});
|
|
4212
|
-
signals = null;
|
|
4213
|
-
}
|
|
4214
|
-
};
|
|
4215
|
-
signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
|
|
4216
|
-
const { signal } = controller;
|
|
4217
|
-
signal.unsubscribe = () => utils_default.asap(unsubscribe);
|
|
4218
|
-
return signal;
|
|
4219
|
-
}
|
|
4220
|
-
};
|
|
4221
|
-
var composeSignals_default = composeSignals;
|
|
4222
|
-
|
|
4223
|
-
// node_modules/axios/lib/helpers/trackStream.js
|
|
4224
|
-
var streamChunk = function* (chunk, chunkSize) {
|
|
4225
|
-
let len = chunk.byteLength;
|
|
4226
|
-
if (!chunkSize || len < chunkSize) {
|
|
4227
|
-
yield chunk;
|
|
4228
|
-
return;
|
|
4229
|
-
}
|
|
4230
|
-
let pos = 0;
|
|
4231
|
-
let end;
|
|
4232
|
-
while (pos < len) {
|
|
4233
|
-
end = pos + chunkSize;
|
|
4234
|
-
yield chunk.slice(pos, end);
|
|
4235
|
-
pos = end;
|
|
4236
|
-
}
|
|
4237
|
-
};
|
|
4238
|
-
var readBytes = async function* (iterable, chunkSize) {
|
|
4239
|
-
for await (const chunk of readStream(iterable)) {
|
|
4240
|
-
yield* streamChunk(chunk, chunkSize);
|
|
4241
|
-
}
|
|
4242
|
-
};
|
|
4243
|
-
var readStream = async function* (stream4) {
|
|
4244
|
-
if (stream4[Symbol.asyncIterator]) {
|
|
4245
|
-
yield* stream4;
|
|
4246
|
-
return;
|
|
4247
|
-
}
|
|
4248
|
-
const reader = stream4.getReader();
|
|
4249
|
-
try {
|
|
4250
|
-
for (; ; ) {
|
|
4251
|
-
const { done, value } = await reader.read();
|
|
4252
|
-
if (done) {
|
|
4253
|
-
break;
|
|
4254
|
-
}
|
|
4255
|
-
yield value;
|
|
4256
|
-
}
|
|
4257
|
-
} finally {
|
|
4258
|
-
await reader.cancel();
|
|
4259
|
-
}
|
|
4260
|
-
};
|
|
4261
|
-
var trackStream = (stream4, chunkSize, onProgress, onFinish) => {
|
|
4262
|
-
const iterator2 = readBytes(stream4, chunkSize);
|
|
4263
|
-
let bytes = 0;
|
|
4264
|
-
let done;
|
|
4265
|
-
let _onFinish = (e) => {
|
|
4266
|
-
if (!done) {
|
|
4267
|
-
done = true;
|
|
4268
|
-
onFinish && onFinish(e);
|
|
4269
|
-
}
|
|
4270
|
-
};
|
|
4271
|
-
return new ReadableStream({
|
|
4272
|
-
async pull(controller) {
|
|
4273
|
-
try {
|
|
4274
|
-
const { done: done2, value } = await iterator2.next();
|
|
4275
|
-
if (done2) {
|
|
4276
|
-
_onFinish();
|
|
4277
|
-
controller.close();
|
|
4278
|
-
return;
|
|
4279
|
-
}
|
|
4280
|
-
let len = value.byteLength;
|
|
4281
|
-
if (onProgress) {
|
|
4282
|
-
let loadedBytes = bytes += len;
|
|
4283
|
-
onProgress(loadedBytes);
|
|
4284
|
-
}
|
|
4285
|
-
controller.enqueue(new Uint8Array(value));
|
|
4286
|
-
} catch (err) {
|
|
4287
|
-
_onFinish(err);
|
|
4288
|
-
throw err;
|
|
3722
|
+
transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
|
|
3723
|
+
config,
|
|
3724
|
+
request
|
|
3725
|
+
));
|
|
3726
|
+
request = null;
|
|
3727
|
+
};
|
|
3728
|
+
if (node_default.isStandardBrowserEnv) {
|
|
3729
|
+
const xsrfValue = (config.withCredentials || isURLSameOrigin_default(fullPath)) && config.xsrfCookieName && cookies_default.read(config.xsrfCookieName);
|
|
3730
|
+
if (xsrfValue) {
|
|
3731
|
+
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
|
4289
3732
|
}
|
|
4290
|
-
},
|
|
4291
|
-
cancel(reason) {
|
|
4292
|
-
_onFinish(reason);
|
|
4293
|
-
return iterator2.return();
|
|
4294
3733
|
}
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
// node_modules/axios/lib/adapters/fetch.js
|
|
4301
|
-
var isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
|
|
4302
|
-
var isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
|
|
4303
|
-
var encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()));
|
|
4304
|
-
var test = (fn, ...args) => {
|
|
4305
|
-
try {
|
|
4306
|
-
return !!fn(...args);
|
|
4307
|
-
} catch (e) {
|
|
4308
|
-
return false;
|
|
4309
|
-
}
|
|
4310
|
-
};
|
|
4311
|
-
var supportsRequestStream = isReadableStreamSupported && test(() => {
|
|
4312
|
-
let duplexAccessed = false;
|
|
4313
|
-
const hasContentType = new Request(platform_default.origin, {
|
|
4314
|
-
body: new ReadableStream(),
|
|
4315
|
-
method: "POST",
|
|
4316
|
-
get duplex() {
|
|
4317
|
-
duplexAccessed = true;
|
|
4318
|
-
return "half";
|
|
4319
|
-
}
|
|
4320
|
-
}).headers.has("Content-Type");
|
|
4321
|
-
return duplexAccessed && !hasContentType;
|
|
4322
|
-
});
|
|
4323
|
-
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
4324
|
-
var supportsResponseStream = isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
|
|
4325
|
-
var resolvers = {
|
|
4326
|
-
stream: supportsResponseStream && ((res) => res.body)
|
|
4327
|
-
};
|
|
4328
|
-
isFetchSupported && ((res) => {
|
|
4329
|
-
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
|
|
4330
|
-
!resolvers[type] && (resolvers[type] = utils_default.isFunction(res[type]) ? (res2) => res2[type]() : (_, config) => {
|
|
4331
|
-
throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config);
|
|
4332
|
-
});
|
|
4333
|
-
});
|
|
4334
|
-
})(new Response());
|
|
4335
|
-
var getBodyLength = async (body) => {
|
|
4336
|
-
if (body == null) {
|
|
4337
|
-
return 0;
|
|
4338
|
-
}
|
|
4339
|
-
if (utils_default.isBlob(body)) {
|
|
4340
|
-
return body.size;
|
|
4341
|
-
}
|
|
4342
|
-
if (utils_default.isSpecCompliantForm(body)) {
|
|
4343
|
-
const _request = new Request(platform_default.origin, {
|
|
4344
|
-
method: "POST",
|
|
4345
|
-
body
|
|
4346
|
-
});
|
|
4347
|
-
return (await _request.arrayBuffer()).byteLength;
|
|
4348
|
-
}
|
|
4349
|
-
if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
|
|
4350
|
-
return body.byteLength;
|
|
4351
|
-
}
|
|
4352
|
-
if (utils_default.isURLSearchParams(body)) {
|
|
4353
|
-
body = body + "";
|
|
4354
|
-
}
|
|
4355
|
-
if (utils_default.isString(body)) {
|
|
4356
|
-
return (await encodeText(body)).byteLength;
|
|
4357
|
-
}
|
|
4358
|
-
};
|
|
4359
|
-
var resolveBodyLength = async (headers, body) => {
|
|
4360
|
-
const length = utils_default.toFiniteNumber(headers.getContentLength());
|
|
4361
|
-
return length == null ? getBodyLength(body) : length;
|
|
4362
|
-
};
|
|
4363
|
-
var fetch_default = isFetchSupported && (async (config) => {
|
|
4364
|
-
let {
|
|
4365
|
-
url: url2,
|
|
4366
|
-
method,
|
|
4367
|
-
data,
|
|
4368
|
-
signal,
|
|
4369
|
-
cancelToken,
|
|
4370
|
-
timeout,
|
|
4371
|
-
onDownloadProgress,
|
|
4372
|
-
onUploadProgress,
|
|
4373
|
-
responseType,
|
|
4374
|
-
headers,
|
|
4375
|
-
withCredentials = "same-origin",
|
|
4376
|
-
fetchOptions
|
|
4377
|
-
} = resolveConfig_default(config);
|
|
4378
|
-
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
4379
|
-
let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
4380
|
-
let request;
|
|
4381
|
-
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
4382
|
-
composedSignal.unsubscribe();
|
|
4383
|
-
});
|
|
4384
|
-
let requestContentLength;
|
|
4385
|
-
try {
|
|
4386
|
-
if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
|
|
4387
|
-
let _request = new Request(url2, {
|
|
4388
|
-
method: "POST",
|
|
4389
|
-
body: data,
|
|
4390
|
-
duplex: "half"
|
|
3734
|
+
requestData === void 0 && requestHeaders.setContentType(null);
|
|
3735
|
+
if ("setRequestHeader" in request) {
|
|
3736
|
+
utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
3737
|
+
request.setRequestHeader(key, val);
|
|
4391
3738
|
});
|
|
4392
|
-
let contentTypeHeader;
|
|
4393
|
-
if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
|
|
4394
|
-
headers.setContentType(contentTypeHeader);
|
|
4395
|
-
}
|
|
4396
|
-
if (_request.body) {
|
|
4397
|
-
const [onProgress, flush] = progressEventDecorator(
|
|
4398
|
-
requestContentLength,
|
|
4399
|
-
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
4400
|
-
);
|
|
4401
|
-
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
4402
|
-
}
|
|
4403
3739
|
}
|
|
4404
|
-
if (!utils_default.
|
|
4405
|
-
withCredentials = withCredentials
|
|
3740
|
+
if (!utils_default.isUndefined(config.withCredentials)) {
|
|
3741
|
+
request.withCredentials = !!config.withCredentials;
|
|
4406
3742
|
}
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
...fetchOptions,
|
|
4410
|
-
signal: composedSignal,
|
|
4411
|
-
method: method.toUpperCase(),
|
|
4412
|
-
headers: headers.normalize().toJSON(),
|
|
4413
|
-
body: data,
|
|
4414
|
-
duplex: "half",
|
|
4415
|
-
credentials: isCredentialsSupported ? withCredentials : void 0
|
|
4416
|
-
});
|
|
4417
|
-
let response = await fetch(request);
|
|
4418
|
-
const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
|
|
4419
|
-
if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
|
|
4420
|
-
const options = {};
|
|
4421
|
-
["status", "statusText", "headers"].forEach((prop) => {
|
|
4422
|
-
options[prop] = response[prop];
|
|
4423
|
-
});
|
|
4424
|
-
const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
|
|
4425
|
-
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
4426
|
-
responseContentLength,
|
|
4427
|
-
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
4428
|
-
) || [];
|
|
4429
|
-
response = new Response(
|
|
4430
|
-
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
4431
|
-
flush && flush();
|
|
4432
|
-
unsubscribe && unsubscribe();
|
|
4433
|
-
}),
|
|
4434
|
-
options
|
|
4435
|
-
);
|
|
3743
|
+
if (responseType && responseType !== "json") {
|
|
3744
|
+
request.responseType = config.responseType;
|
|
4436
3745
|
}
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
request
|
|
4448
|
-
});
|
|
4449
|
-
});
|
|
4450
|
-
} catch (err) {
|
|
4451
|
-
unsubscribe && unsubscribe();
|
|
4452
|
-
if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
|
|
4453
|
-
throw Object.assign(
|
|
4454
|
-
new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request),
|
|
4455
|
-
{
|
|
4456
|
-
cause: err.cause || err
|
|
3746
|
+
if (typeof config.onDownloadProgress === "function") {
|
|
3747
|
+
request.addEventListener("progress", progressEventReducer(config.onDownloadProgress, true));
|
|
3748
|
+
}
|
|
3749
|
+
if (typeof config.onUploadProgress === "function" && request.upload) {
|
|
3750
|
+
request.upload.addEventListener("progress", progressEventReducer(config.onUploadProgress));
|
|
3751
|
+
}
|
|
3752
|
+
if (config.cancelToken || config.signal) {
|
|
3753
|
+
onCanceled = (cancel) => {
|
|
3754
|
+
if (!request) {
|
|
3755
|
+
return;
|
|
4457
3756
|
}
|
|
4458
|
-
|
|
3757
|
+
reject(!cancel || cancel.type ? new CanceledError_default(null, config, request) : cancel);
|
|
3758
|
+
request.abort();
|
|
3759
|
+
request = null;
|
|
3760
|
+
};
|
|
3761
|
+
config.cancelToken && config.cancelToken.subscribe(onCanceled);
|
|
3762
|
+
if (config.signal) {
|
|
3763
|
+
config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled);
|
|
3764
|
+
}
|
|
4459
3765
|
}
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
3766
|
+
const protocol = parseProtocol(fullPath);
|
|
3767
|
+
if (protocol && node_default.protocols.indexOf(protocol) === -1) {
|
|
3768
|
+
reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config));
|
|
3769
|
+
return;
|
|
3770
|
+
}
|
|
3771
|
+
request.send(requestData || null);
|
|
3772
|
+
});
|
|
3773
|
+
};
|
|
4463
3774
|
|
|
4464
|
-
// node_modules/axios/lib/adapters/adapters.js
|
|
3775
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/adapters/adapters.js
|
|
4465
3776
|
var knownAdapters = {
|
|
4466
3777
|
http: http_default,
|
|
4467
|
-
xhr: xhr_default
|
|
4468
|
-
fetch: fetch_default
|
|
3778
|
+
xhr: xhr_default
|
|
4469
3779
|
};
|
|
4470
3780
|
utils_default.forEach(knownAdapters, (fn, value) => {
|
|
4471
3781
|
if (fn) {
|
|
@@ -4476,46 +3786,38 @@ utils_default.forEach(knownAdapters, (fn, value) => {
|
|
|
4476
3786
|
Object.defineProperty(fn, "adapterName", { value });
|
|
4477
3787
|
}
|
|
4478
3788
|
});
|
|
4479
|
-
var renderReason = (reason) => `- ${reason}`;
|
|
4480
|
-
var isResolvedHandle = (adapter) => utils_default.isFunction(adapter) || adapter === null || adapter === false;
|
|
4481
3789
|
var adapters_default = {
|
|
4482
3790
|
getAdapter: (adapters) => {
|
|
4483
3791
|
adapters = utils_default.isArray(adapters) ? adapters : [adapters];
|
|
4484
3792
|
const { length } = adapters;
|
|
4485
3793
|
let nameOrAdapter;
|
|
4486
3794
|
let adapter;
|
|
4487
|
-
const rejectedReasons = {};
|
|
4488
3795
|
for (let i = 0; i < length; i++) {
|
|
4489
3796
|
nameOrAdapter = adapters[i];
|
|
4490
|
-
|
|
4491
|
-
adapter = nameOrAdapter;
|
|
4492
|
-
if (!isResolvedHandle(nameOrAdapter)) {
|
|
4493
|
-
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
4494
|
-
if (adapter === void 0) {
|
|
4495
|
-
throw new AxiosError_default(`Unknown adapter '${id}'`);
|
|
4496
|
-
}
|
|
4497
|
-
}
|
|
4498
|
-
if (adapter) {
|
|
3797
|
+
if (adapter = utils_default.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter) {
|
|
4499
3798
|
break;
|
|
4500
3799
|
}
|
|
4501
|
-
rejectedReasons[id || "#" + i] = adapter;
|
|
4502
3800
|
}
|
|
4503
3801
|
if (!adapter) {
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
3802
|
+
if (adapter === false) {
|
|
3803
|
+
throw new AxiosError_default(
|
|
3804
|
+
`Adapter ${nameOrAdapter} is not supported by the environment`,
|
|
3805
|
+
"ERR_NOT_SUPPORT"
|
|
3806
|
+
);
|
|
3807
|
+
}
|
|
3808
|
+
throw new Error(
|
|
3809
|
+
utils_default.hasOwnProp(knownAdapters, nameOrAdapter) ? `Adapter '${nameOrAdapter}' is not available in the build` : `Unknown adapter '${nameOrAdapter}'`
|
|
4511
3810
|
);
|
|
4512
3811
|
}
|
|
3812
|
+
if (!utils_default.isFunction(adapter)) {
|
|
3813
|
+
throw new TypeError("adapter is not a function");
|
|
3814
|
+
}
|
|
4513
3815
|
return adapter;
|
|
4514
3816
|
},
|
|
4515
3817
|
adapters: knownAdapters
|
|
4516
3818
|
};
|
|
4517
3819
|
|
|
4518
|
-
// node_modules/axios/lib/core/dispatchRequest.js
|
|
3820
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/core/dispatchRequest.js
|
|
4519
3821
|
function throwIfCancellationRequested(config) {
|
|
4520
3822
|
if (config.cancelToken) {
|
|
4521
3823
|
config.cancelToken.throwIfRequested();
|
|
@@ -4560,7 +3862,86 @@ function dispatchRequest(config) {
|
|
|
4560
3862
|
});
|
|
4561
3863
|
}
|
|
4562
3864
|
|
|
4563
|
-
// node_modules/axios/lib/
|
|
3865
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/core/mergeConfig.js
|
|
3866
|
+
var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? thing.toJSON() : thing;
|
|
3867
|
+
function mergeConfig(config1, config2) {
|
|
3868
|
+
config2 = config2 || {};
|
|
3869
|
+
const config = {};
|
|
3870
|
+
function getMergedValue(target, source, caseless) {
|
|
3871
|
+
if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
|
|
3872
|
+
return utils_default.merge.call({ caseless }, target, source);
|
|
3873
|
+
} else if (utils_default.isPlainObject(source)) {
|
|
3874
|
+
return utils_default.merge({}, source);
|
|
3875
|
+
} else if (utils_default.isArray(source)) {
|
|
3876
|
+
return source.slice();
|
|
3877
|
+
}
|
|
3878
|
+
return source;
|
|
3879
|
+
}
|
|
3880
|
+
function mergeDeepProperties(a, b, caseless) {
|
|
3881
|
+
if (!utils_default.isUndefined(b)) {
|
|
3882
|
+
return getMergedValue(a, b, caseless);
|
|
3883
|
+
} else if (!utils_default.isUndefined(a)) {
|
|
3884
|
+
return getMergedValue(void 0, a, caseless);
|
|
3885
|
+
}
|
|
3886
|
+
}
|
|
3887
|
+
function valueFromConfig2(a, b) {
|
|
3888
|
+
if (!utils_default.isUndefined(b)) {
|
|
3889
|
+
return getMergedValue(void 0, b);
|
|
3890
|
+
}
|
|
3891
|
+
}
|
|
3892
|
+
function defaultToConfig2(a, b) {
|
|
3893
|
+
if (!utils_default.isUndefined(b)) {
|
|
3894
|
+
return getMergedValue(void 0, b);
|
|
3895
|
+
} else if (!utils_default.isUndefined(a)) {
|
|
3896
|
+
return getMergedValue(void 0, a);
|
|
3897
|
+
}
|
|
3898
|
+
}
|
|
3899
|
+
function mergeDirectKeys(a, b, prop) {
|
|
3900
|
+
if (prop in config2) {
|
|
3901
|
+
return getMergedValue(a, b);
|
|
3902
|
+
} else if (prop in config1) {
|
|
3903
|
+
return getMergedValue(void 0, a);
|
|
3904
|
+
}
|
|
3905
|
+
}
|
|
3906
|
+
const mergeMap = {
|
|
3907
|
+
url: valueFromConfig2,
|
|
3908
|
+
method: valueFromConfig2,
|
|
3909
|
+
data: valueFromConfig2,
|
|
3910
|
+
baseURL: defaultToConfig2,
|
|
3911
|
+
transformRequest: defaultToConfig2,
|
|
3912
|
+
transformResponse: defaultToConfig2,
|
|
3913
|
+
paramsSerializer: defaultToConfig2,
|
|
3914
|
+
timeout: defaultToConfig2,
|
|
3915
|
+
timeoutMessage: defaultToConfig2,
|
|
3916
|
+
withCredentials: defaultToConfig2,
|
|
3917
|
+
adapter: defaultToConfig2,
|
|
3918
|
+
responseType: defaultToConfig2,
|
|
3919
|
+
xsrfCookieName: defaultToConfig2,
|
|
3920
|
+
xsrfHeaderName: defaultToConfig2,
|
|
3921
|
+
onUploadProgress: defaultToConfig2,
|
|
3922
|
+
onDownloadProgress: defaultToConfig2,
|
|
3923
|
+
decompress: defaultToConfig2,
|
|
3924
|
+
maxContentLength: defaultToConfig2,
|
|
3925
|
+
maxBodyLength: defaultToConfig2,
|
|
3926
|
+
beforeRedirect: defaultToConfig2,
|
|
3927
|
+
transport: defaultToConfig2,
|
|
3928
|
+
httpAgent: defaultToConfig2,
|
|
3929
|
+
httpsAgent: defaultToConfig2,
|
|
3930
|
+
cancelToken: defaultToConfig2,
|
|
3931
|
+
socketPath: defaultToConfig2,
|
|
3932
|
+
responseEncoding: defaultToConfig2,
|
|
3933
|
+
validateStatus: mergeDirectKeys,
|
|
3934
|
+
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
|
3935
|
+
};
|
|
3936
|
+
utils_default.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
|
|
3937
|
+
const merge2 = mergeMap[prop] || mergeDeepProperties;
|
|
3938
|
+
const configValue = merge2(config1[prop], config2[prop], prop);
|
|
3939
|
+
utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
|
|
3940
|
+
});
|
|
3941
|
+
return config;
|
|
3942
|
+
}
|
|
3943
|
+
|
|
3944
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/validator.js
|
|
4564
3945
|
var validators = {};
|
|
4565
3946
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
4566
3947
|
validators[type] = function validator(thing) {
|
|
@@ -4591,12 +3972,6 @@ validators.transitional = function transitional(validator, version2, message) {
|
|
|
4591
3972
|
return validator ? validator(value, opt, opts) : true;
|
|
4592
3973
|
};
|
|
4593
3974
|
};
|
|
4594
|
-
validators.spelling = function spelling(correctSpelling) {
|
|
4595
|
-
return (value, opt) => {
|
|
4596
|
-
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
|
4597
|
-
return true;
|
|
4598
|
-
};
|
|
4599
|
-
};
|
|
4600
3975
|
function assertOptions(options, schema, allowUnknown) {
|
|
4601
3976
|
if (typeof options !== "object") {
|
|
4602
3977
|
throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE);
|
|
@@ -4624,11 +3999,11 @@ var validator_default = {
|
|
|
4624
3999
|
validators
|
|
4625
4000
|
};
|
|
4626
4001
|
|
|
4627
|
-
// node_modules/axios/lib/core/Axios.js
|
|
4002
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/core/Axios.js
|
|
4628
4003
|
var validators2 = validator_default.validators;
|
|
4629
4004
|
var Axios = class {
|
|
4630
4005
|
constructor(instanceConfig) {
|
|
4631
|
-
this.defaults = instanceConfig
|
|
4006
|
+
this.defaults = instanceConfig;
|
|
4632
4007
|
this.interceptors = {
|
|
4633
4008
|
request: new InterceptorManager_default(),
|
|
4634
4009
|
response: new InterceptorManager_default()
|
|
@@ -4642,27 +4017,7 @@ var Axios = class {
|
|
|
4642
4017
|
*
|
|
4643
4018
|
* @returns {Promise} The Promise to be fulfilled
|
|
4644
4019
|
*/
|
|
4645
|
-
|
|
4646
|
-
try {
|
|
4647
|
-
return await this._request(configOrUrl, config);
|
|
4648
|
-
} catch (err) {
|
|
4649
|
-
if (err instanceof Error) {
|
|
4650
|
-
let dummy = {};
|
|
4651
|
-
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
4652
|
-
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
|
|
4653
|
-
try {
|
|
4654
|
-
if (!err.stack) {
|
|
4655
|
-
err.stack = stack;
|
|
4656
|
-
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
|
|
4657
|
-
err.stack += "\n" + stack;
|
|
4658
|
-
}
|
|
4659
|
-
} catch (e) {
|
|
4660
|
-
}
|
|
4661
|
-
}
|
|
4662
|
-
throw err;
|
|
4663
|
-
}
|
|
4664
|
-
}
|
|
4665
|
-
_request(configOrUrl, config) {
|
|
4020
|
+
request(configOrUrl, config) {
|
|
4666
4021
|
if (typeof configOrUrl === "string") {
|
|
4667
4022
|
config = config || {};
|
|
4668
4023
|
config.url = configOrUrl;
|
|
@@ -4678,34 +4033,19 @@ var Axios = class {
|
|
|
4678
4033
|
clarifyTimeoutError: validators2.transitional(validators2.boolean)
|
|
4679
4034
|
}, false);
|
|
4680
4035
|
}
|
|
4681
|
-
if (paramsSerializer
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
} else {
|
|
4687
|
-
validator_default.assertOptions(paramsSerializer, {
|
|
4688
|
-
encode: validators2.function,
|
|
4689
|
-
serialize: validators2.function
|
|
4690
|
-
}, true);
|
|
4691
|
-
}
|
|
4692
|
-
}
|
|
4693
|
-
if (config.allowAbsoluteUrls !== void 0) {
|
|
4694
|
-
} else if (this.defaults.allowAbsoluteUrls !== void 0) {
|
|
4695
|
-
config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
|
|
4696
|
-
} else {
|
|
4697
|
-
config.allowAbsoluteUrls = true;
|
|
4036
|
+
if (paramsSerializer !== void 0) {
|
|
4037
|
+
validator_default.assertOptions(paramsSerializer, {
|
|
4038
|
+
encode: validators2.function,
|
|
4039
|
+
serialize: validators2.function
|
|
4040
|
+
}, true);
|
|
4698
4041
|
}
|
|
4699
|
-
validator_default.assertOptions(config, {
|
|
4700
|
-
baseUrl: validators2.spelling("baseURL"),
|
|
4701
|
-
withXsrfToken: validators2.spelling("withXSRFToken")
|
|
4702
|
-
}, true);
|
|
4703
4042
|
config.method = (config.method || this.defaults.method || "get").toLowerCase();
|
|
4704
|
-
let contextHeaders
|
|
4043
|
+
let contextHeaders;
|
|
4044
|
+
contextHeaders = headers && utils_default.merge(
|
|
4705
4045
|
headers.common,
|
|
4706
4046
|
headers[config.method]
|
|
4707
4047
|
);
|
|
4708
|
-
|
|
4048
|
+
contextHeaders && utils_default.forEach(
|
|
4709
4049
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
4710
4050
|
(method) => {
|
|
4711
4051
|
delete headers[method];
|
|
@@ -4766,11 +4106,11 @@ var Axios = class {
|
|
|
4766
4106
|
}
|
|
4767
4107
|
getUri(config) {
|
|
4768
4108
|
config = mergeConfig(this.defaults, config);
|
|
4769
|
-
const fullPath = buildFullPath(config.baseURL, config.url
|
|
4109
|
+
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
4770
4110
|
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
4771
4111
|
}
|
|
4772
4112
|
};
|
|
4773
|
-
utils_default.forEach(["delete", "get", "head", "options"], function
|
|
4113
|
+
utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData2(method) {
|
|
4774
4114
|
Axios.prototype[method] = function(url2, config) {
|
|
4775
4115
|
return this.request(mergeConfig(config || {}, {
|
|
4776
4116
|
method,
|
|
@@ -4779,7 +4119,7 @@ utils_default.forEach(["delete", "get", "head", "options"], function forEachMeth
|
|
|
4779
4119
|
}));
|
|
4780
4120
|
};
|
|
4781
4121
|
});
|
|
4782
|
-
utils_default.forEach(["post", "put", "patch"], function
|
|
4122
|
+
utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData2(method) {
|
|
4783
4123
|
function generateHTTPMethod(isForm) {
|
|
4784
4124
|
return function httpMethod(url2, data, config) {
|
|
4785
4125
|
return this.request(mergeConfig(config || {}, {
|
|
@@ -4797,7 +4137,7 @@ utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(m
|
|
|
4797
4137
|
});
|
|
4798
4138
|
var Axios_default = Axios;
|
|
4799
4139
|
|
|
4800
|
-
// node_modules/axios/lib/cancel/CancelToken.js
|
|
4140
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/cancel/CancelToken.js
|
|
4801
4141
|
var CancelToken = class _CancelToken {
|
|
4802
4142
|
constructor(executor) {
|
|
4803
4143
|
if (typeof executor !== "function") {
|
|
@@ -4869,15 +4209,6 @@ var CancelToken = class _CancelToken {
|
|
|
4869
4209
|
this._listeners.splice(index, 1);
|
|
4870
4210
|
}
|
|
4871
4211
|
}
|
|
4872
|
-
toAbortSignal() {
|
|
4873
|
-
const controller = new AbortController();
|
|
4874
|
-
const abort = (err) => {
|
|
4875
|
-
controller.abort(err);
|
|
4876
|
-
};
|
|
4877
|
-
this.subscribe(abort);
|
|
4878
|
-
controller.signal.unsubscribe = () => this.unsubscribe(abort);
|
|
4879
|
-
return controller.signal;
|
|
4880
|
-
}
|
|
4881
4212
|
/**
|
|
4882
4213
|
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
4883
4214
|
* cancels the `CancelToken`.
|
|
@@ -4895,19 +4226,19 @@ var CancelToken = class _CancelToken {
|
|
|
4895
4226
|
};
|
|
4896
4227
|
var CancelToken_default = CancelToken;
|
|
4897
4228
|
|
|
4898
|
-
// node_modules/axios/lib/helpers/spread.js
|
|
4229
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/spread.js
|
|
4899
4230
|
function spread(callback) {
|
|
4900
4231
|
return function wrap(arr) {
|
|
4901
4232
|
return callback.apply(null, arr);
|
|
4902
4233
|
};
|
|
4903
4234
|
}
|
|
4904
4235
|
|
|
4905
|
-
// node_modules/axios/lib/helpers/isAxiosError.js
|
|
4236
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/isAxiosError.js
|
|
4906
4237
|
function isAxiosError(payload) {
|
|
4907
4238
|
return utils_default.isObject(payload) && payload.isAxiosError === true;
|
|
4908
4239
|
}
|
|
4909
4240
|
|
|
4910
|
-
// node_modules/axios/lib/helpers/HttpStatusCode.js
|
|
4241
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/HttpStatusCode.js
|
|
4911
4242
|
var HttpStatusCode = {
|
|
4912
4243
|
Continue: 100,
|
|
4913
4244
|
SwitchingProtocols: 101,
|
|
@@ -4978,7 +4309,7 @@ Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
|
4978
4309
|
});
|
|
4979
4310
|
var HttpStatusCode_default = HttpStatusCode;
|
|
4980
4311
|
|
|
4981
|
-
// node_modules/axios/lib/axios.js
|
|
4312
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/axios.js
|
|
4982
4313
|
function createInstance(defaultConfig) {
|
|
4983
4314
|
const context = new Axios_default(defaultConfig);
|
|
4984
4315
|
const instance = bind(Axios_default.prototype.request, context);
|
|
@@ -5006,12 +4337,11 @@ axios.isAxiosError = isAxiosError;
|
|
|
5006
4337
|
axios.mergeConfig = mergeConfig;
|
|
5007
4338
|
axios.AxiosHeaders = AxiosHeaders_default;
|
|
5008
4339
|
axios.formToJSON = (thing) => formDataToJSON_default(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
5009
|
-
axios.getAdapter = adapters_default.getAdapter;
|
|
5010
4340
|
axios.HttpStatusCode = HttpStatusCode_default;
|
|
5011
4341
|
axios.default = axios;
|
|
5012
4342
|
var axios_default = axios;
|
|
5013
4343
|
|
|
5014
|
-
// node_modules/axios/index.js
|
|
4344
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/index.js
|
|
5015
4345
|
var {
|
|
5016
4346
|
Axios: Axios2,
|
|
5017
4347
|
AxiosError: AxiosError2,
|
|
@@ -5027,7 +4357,6 @@ var {
|
|
|
5027
4357
|
AxiosHeaders: AxiosHeaders2,
|
|
5028
4358
|
HttpStatusCode: HttpStatusCode2,
|
|
5029
4359
|
formToJSON,
|
|
5030
|
-
getAdapter,
|
|
5031
4360
|
mergeConfig: mergeConfig2
|
|
5032
4361
|
} = axios_default;
|
|
5033
4362
|
|
|
@@ -5192,18 +4521,109 @@ function getDeviceId() {
|
|
|
5192
4521
|
}
|
|
5193
4522
|
|
|
5194
4523
|
// bin/utils/uploadToIpfs.ts
|
|
5195
|
-
var ipfsApiUrl = "https://pinme.dev/api/
|
|
4524
|
+
var ipfsApiUrl = "https://pinme.dev/api/v3";
|
|
4525
|
+
var maxPollTime = parseInt(process.env.MAX_POLL_TIME_MINUTES || "5") * 60 * 1e3;
|
|
4526
|
+
var pollInterval = parseInt(process.env.POLL_INTERVAL_SECONDS || "2") * 1e3;
|
|
4527
|
+
var pollTimeout = parseInt(process.env.POLL_TIMEOUT_SECONDS || "10") * 1e3;
|
|
4528
|
+
async function pollUploadStatus(traceId, deviceId, smartProgress, startTime) {
|
|
4529
|
+
let consecutiveErrors = 0;
|
|
4530
|
+
const maxConsecutiveErrors = 3;
|
|
4531
|
+
while (Date.now() - startTime < maxPollTime) {
|
|
4532
|
+
try {
|
|
4533
|
+
const response = await axios_default.get(
|
|
4534
|
+
`${ipfsApiUrl}/up_status?trace_id=${traceId}&uid=${deviceId}`,
|
|
4535
|
+
{
|
|
4536
|
+
timeout: pollTimeout,
|
|
4537
|
+
headers: {
|
|
4538
|
+
"User-Agent": "Pinme-CLI/1.0.0",
|
|
4539
|
+
Accept: "*/*",
|
|
4540
|
+
Host: new URL(ipfsApiUrl).host,
|
|
4541
|
+
Connection: "keep-alive"
|
|
4542
|
+
}
|
|
4543
|
+
}
|
|
4544
|
+
);
|
|
4545
|
+
const { code, msg, data } = response.data;
|
|
4546
|
+
if (code === 200) {
|
|
4547
|
+
consecutiveErrors = 0;
|
|
4548
|
+
if (data.is_ready) {
|
|
4549
|
+
smartProgress.complete(traceId);
|
|
4550
|
+
return data;
|
|
4551
|
+
} else {
|
|
4552
|
+
smartProgress.update();
|
|
4553
|
+
}
|
|
4554
|
+
} else {
|
|
4555
|
+
console.log(import_chalk2.default.yellow(`Warning: ${msg}`));
|
|
4556
|
+
}
|
|
4557
|
+
} catch (error) {
|
|
4558
|
+
consecutiveErrors++;
|
|
4559
|
+
console.log(import_chalk2.default.yellow(`Polling error: ${error.message}`));
|
|
4560
|
+
if (consecutiveErrors >= maxConsecutiveErrors) {
|
|
4561
|
+
console.log(import_chalk2.default.red(`Too many consecutive polling errors (${consecutiveErrors}), stopping progress updates`));
|
|
4562
|
+
break;
|
|
4563
|
+
}
|
|
4564
|
+
}
|
|
4565
|
+
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
4566
|
+
}
|
|
4567
|
+
const maxPollTimeMinutes = Math.floor(maxPollTime / (60 * 1e3));
|
|
4568
|
+
smartProgress.fail(`Upload timeout after ${maxPollTimeMinutes} minutes`, traceId);
|
|
4569
|
+
return null;
|
|
4570
|
+
}
|
|
4571
|
+
function diagnoseDirectoryUploadError(directoryName, resData, expectedName) {
|
|
4572
|
+
const issues = [];
|
|
4573
|
+
if (directoryName.length > 100) {
|
|
4574
|
+
issues.push(
|
|
4575
|
+
`Directory name too long (${directoryName.length} characters, recommended under 100 characters)`
|
|
4576
|
+
);
|
|
4577
|
+
}
|
|
4578
|
+
const availableName = resData.Name;
|
|
4579
|
+
issues.push(`Name returned by IPFS: ${availableName}`);
|
|
4580
|
+
issues.push(`Expected directory name: ${expectedName}`);
|
|
4581
|
+
const encodedName = encodeURIComponent(directoryName);
|
|
4582
|
+
if (encodedName !== directoryName) {
|
|
4583
|
+
issues.push(`Directory name after encoding: ${encodedName}`);
|
|
4584
|
+
}
|
|
4585
|
+
return issues.join("\n - ");
|
|
4586
|
+
}
|
|
4587
|
+
function handleMultipartError(error, context) {
|
|
4588
|
+
if (error.message && error.message.includes("multipart: NextPart: EOF")) {
|
|
4589
|
+
return `Multipart form data error: ${context}. This usually indicates:
|
|
4590
|
+
- Empty directory or no valid files
|
|
4591
|
+
- File access permissions issue
|
|
4592
|
+
- Network interruption during upload
|
|
4593
|
+
- Server-side multipart parsing error`;
|
|
4594
|
+
}
|
|
4595
|
+
if (error.message && error.message.includes("ENOENT")) {
|
|
4596
|
+
return `File not found error: ${context}. Please check:
|
|
4597
|
+
- File path is correct
|
|
4598
|
+
- File exists and is accessible
|
|
4599
|
+
- No permission issues`;
|
|
4600
|
+
}
|
|
4601
|
+
if (error.message && error.message.includes("EACCES")) {
|
|
4602
|
+
return `Permission denied error: ${context}. Please check:
|
|
4603
|
+
- File read permissions
|
|
4604
|
+
- Directory access permissions
|
|
4605
|
+
- User has sufficient privileges`;
|
|
4606
|
+
}
|
|
4607
|
+
return `Upload error: ${error.message}`;
|
|
4608
|
+
}
|
|
5196
4609
|
var ERROR_CODES = {
|
|
5197
4610
|
"30001": `File too large, single file max size: ${"20"}MB,single folder max size: ${"500"}MB`,
|
|
5198
4611
|
"30002": `Max storage quorum ${Number("1000") / 1e3} GB reached`
|
|
5199
4612
|
};
|
|
5200
|
-
|
|
5201
|
-
function loadFilesToArrRecursively(directoryPath, dist) {
|
|
4613
|
+
function loadFilesToArrRecursively(directoryPath, dist, basePath) {
|
|
5202
4614
|
const filesArr = [];
|
|
5203
4615
|
const sep = import_path4.default.sep;
|
|
5204
|
-
|
|
4616
|
+
if (!basePath) {
|
|
4617
|
+
const parentDir = import_path4.default.dirname(directoryPath);
|
|
4618
|
+
basePath = parentDir.endsWith(sep) ? parentDir : parentDir + sep;
|
|
4619
|
+
}
|
|
4620
|
+
console.log(import_chalk2.default.blue("\n\u{1F4C1} Directory Structure Analysis:"));
|
|
4621
|
+
console.log(import_chalk2.default.gray(` Upload directory: ${directoryPath}`));
|
|
4622
|
+
console.log(import_chalk2.default.gray(` Base path: ${basePath}`));
|
|
4623
|
+
console.log(import_chalk2.default.gray(` Directory name: ${dist}`));
|
|
5205
4624
|
if (import_fs_extra3.default.statSync(directoryPath).isDirectory()) {
|
|
5206
4625
|
const files = import_fs_extra3.default.readdirSync(directoryPath);
|
|
4626
|
+
console.log(import_chalk2.default.gray(` Files found in directory: ${files.length}`));
|
|
5207
4627
|
files.forEach((file) => {
|
|
5208
4628
|
const filePath = import_path4.default.join(directoryPath, file);
|
|
5209
4629
|
if (import_fs_extra3.default.statSync(filePath).isFile()) {
|
|
@@ -5215,20 +4635,27 @@ function loadFilesToArrRecursively(directoryPath, dist) {
|
|
|
5215
4635
|
)} (size: ${formatSize(sizeCheck.size)})`
|
|
5216
4636
|
);
|
|
5217
4637
|
}
|
|
5218
|
-
const
|
|
5219
|
-
const
|
|
4638
|
+
const relativePath = filePath.replace(basePath, "");
|
|
4639
|
+
const encodedPath = relativePath.replaceAll(sep, "%2F");
|
|
4640
|
+
console.log(import_chalk2.default.cyan(` \u{1F4C4} File: ${file}`));
|
|
4641
|
+
console.log(import_chalk2.default.gray(` Full path: ${filePath}`));
|
|
4642
|
+
console.log(import_chalk2.default.gray(` Relative path: ${relativePath}`));
|
|
4643
|
+
console.log(import_chalk2.default.gray(` Encoded path: ${encodedPath}`));
|
|
5220
4644
|
filesArr.push({
|
|
5221
|
-
name:
|
|
4645
|
+
name: encodedPath,
|
|
5222
4646
|
path: filePath
|
|
5223
4647
|
});
|
|
5224
4648
|
} else if (import_fs_extra3.default.statSync(filePath).isDirectory()) {
|
|
5225
|
-
|
|
4649
|
+
console.log(import_chalk2.default.yellow(` \u{1F4C2} Subdirectory: ${file}`));
|
|
4650
|
+
console.log(import_chalk2.default.gray(` Path: ${filePath}`));
|
|
4651
|
+
const recursiveFiles = loadFilesToArrRecursively(filePath, dist, basePath);
|
|
5226
4652
|
filesArr.push(...recursiveFiles);
|
|
5227
4653
|
}
|
|
5228
4654
|
});
|
|
5229
4655
|
} else {
|
|
5230
4656
|
console.error("Error: path must be a directory");
|
|
5231
4657
|
}
|
|
4658
|
+
console.log(import_chalk2.default.green(` \u2705 Total files processed: ${filesArr.length}`));
|
|
5232
4659
|
return filesArr;
|
|
5233
4660
|
}
|
|
5234
4661
|
function countFilesInDirectory(directoryPath) {
|
|
@@ -5260,18 +4687,44 @@ async function uploadDirectory(directoryPath, deviceId) {
|
|
|
5260
4687
|
const dist = directoryPath.split(import_path4.default.sep).pop() || "";
|
|
5261
4688
|
const files = loadFilesToArrRecursively(directoryPath, dist);
|
|
5262
4689
|
const totalFiles = files.length;
|
|
4690
|
+
if (totalFiles === 0) {
|
|
4691
|
+
throw new Error(`Directory ${directoryPath} is empty or contains no valid files`);
|
|
4692
|
+
}
|
|
4693
|
+
console.log(import_chalk2.default.blue("\n\u{1F4CB} Final Upload File List:"));
|
|
4694
|
+
console.log(import_chalk2.default.gray(` Upload root directory: ${dist}`));
|
|
4695
|
+
files.forEach((file, index) => {
|
|
4696
|
+
console.log(import_chalk2.default.gray(` ${index + 1}. ${file.name}`));
|
|
4697
|
+
});
|
|
4698
|
+
console.log(import_chalk2.default.green(` Total files to upload: ${totalFiles}
|
|
4699
|
+
`));
|
|
5263
4700
|
files.forEach((file) => {
|
|
4701
|
+
if (!import_fs_extra3.default.existsSync(file.path)) {
|
|
4702
|
+
throw new Error(`File not found: ${file.path}`);
|
|
4703
|
+
}
|
|
4704
|
+
const fileStats = import_fs_extra3.default.statSync(file.path);
|
|
4705
|
+
if (!fileStats.isFile()) {
|
|
4706
|
+
throw new Error(`Path is not a file: ${file.path}`);
|
|
4707
|
+
}
|
|
5264
4708
|
formData.append("file", import_fs_extra3.default.createReadStream(file.path), {
|
|
5265
4709
|
filename: file.name
|
|
5266
4710
|
});
|
|
5267
4711
|
});
|
|
5268
4712
|
const startTime = Date.now();
|
|
5269
|
-
const spinner = (0, import_ora.default)(`
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
4713
|
+
const spinner = (0, import_ora.default)(`Preparing upload...`).start();
|
|
4714
|
+
let totalSize = 0;
|
|
4715
|
+
files.forEach((file) => {
|
|
4716
|
+
try {
|
|
4717
|
+
const stats = import_fs_extra3.default.statSync(file.path);
|
|
4718
|
+
totalSize += stats.size;
|
|
4719
|
+
} catch (error) {
|
|
4720
|
+
}
|
|
4721
|
+
});
|
|
4722
|
+
const smartProgress = new SmartProgressBar(dist, totalFiles, totalSize, spinner);
|
|
4723
|
+
const progressInterval = setInterval(() => {
|
|
4724
|
+
smartProgress.update();
|
|
4725
|
+
}, 200);
|
|
5274
4726
|
try {
|
|
4727
|
+
smartProgress.startUpload();
|
|
5275
4728
|
const response = await axios_default.post(
|
|
5276
4729
|
`${ipfsApiUrl}/add?uid=${deviceId}&cidV=1`,
|
|
5277
4730
|
formData,
|
|
@@ -5279,56 +4732,92 @@ async function uploadDirectory(directoryPath, deviceId) {
|
|
|
5279
4732
|
headers: {
|
|
5280
4733
|
...formData.getHeaders()
|
|
5281
4734
|
},
|
|
5282
|
-
timeout:
|
|
5283
|
-
//
|
|
4735
|
+
timeout: 18e5
|
|
4736
|
+
// 30 minutes timeout
|
|
5284
4737
|
}
|
|
5285
4738
|
);
|
|
5286
|
-
clearInterval(
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
spinner.succeed(
|
|
5293
|
-
`Successfully uploaded ${dist} (${totalFiles} files) in ${elapsed}s`
|
|
5294
|
-
);
|
|
5295
|
-
const fileCount = countFilesInDirectory(directoryPath);
|
|
5296
|
-
const uploadData = {
|
|
5297
|
-
path: directoryPath,
|
|
5298
|
-
filename: import_path4.default.basename(directoryPath),
|
|
5299
|
-
contentHash: directoryItem.Hash,
|
|
5300
|
-
previewHash: null,
|
|
5301
|
-
size: sizeCheck.size,
|
|
5302
|
-
fileCount,
|
|
5303
|
-
isDirectory: true,
|
|
5304
|
-
shortUrl: directoryItem.ShortUrl || null
|
|
5305
|
-
};
|
|
5306
|
-
saveUploadHistory(uploadData);
|
|
5307
|
-
return {
|
|
5308
|
-
hash: directoryItem.Hash,
|
|
5309
|
-
shortUrl: directoryItem.ShortUrl
|
|
5310
|
-
};
|
|
5311
|
-
}
|
|
5312
|
-
spinner.fail(`Directory hash not found in response`);
|
|
5313
|
-
console.log(import_chalk2.default.red(`Directory hash not found in response`));
|
|
5314
|
-
} else {
|
|
5315
|
-
spinner.fail(`Invalid response format from IPFS`);
|
|
5316
|
-
console.log(import_chalk2.default.red(`Invalid response format from IPFS`));
|
|
4739
|
+
clearInterval(progressInterval);
|
|
4740
|
+
smartProgress.startPolling();
|
|
4741
|
+
const { trace_id } = response.data.data;
|
|
4742
|
+
if (!trace_id) {
|
|
4743
|
+
smartProgress.fail("No request id received from server");
|
|
4744
|
+
return null;
|
|
5317
4745
|
}
|
|
5318
|
-
|
|
4746
|
+
smartProgress.update();
|
|
4747
|
+
const uploadResult = await pollUploadStatus(
|
|
4748
|
+
trace_id,
|
|
4749
|
+
deviceId,
|
|
4750
|
+
smartProgress,
|
|
4751
|
+
startTime
|
|
4752
|
+
);
|
|
4753
|
+
if (!uploadResult) {
|
|
4754
|
+
return null;
|
|
4755
|
+
}
|
|
4756
|
+
const directoryItem = uploadResult.upload_rst;
|
|
4757
|
+
if (directoryItem) {
|
|
4758
|
+
const fileCount = countFilesInDirectory(directoryPath);
|
|
4759
|
+
const uploadData = {
|
|
4760
|
+
path: directoryPath,
|
|
4761
|
+
filename: import_path4.default.basename(directoryPath),
|
|
4762
|
+
contentHash: directoryItem.Hash,
|
|
4763
|
+
previewHash: null,
|
|
4764
|
+
size: sizeCheck.size,
|
|
4765
|
+
fileCount,
|
|
4766
|
+
isDirectory: true,
|
|
4767
|
+
shortUrl: directoryItem.ShortUrl || null
|
|
4768
|
+
};
|
|
4769
|
+
saveUploadHistory(uploadData);
|
|
4770
|
+
return {
|
|
4771
|
+
hash: directoryItem.Hash,
|
|
4772
|
+
shortUrl: directoryItem.ShortUrl
|
|
4773
|
+
};
|
|
4774
|
+
}
|
|
4775
|
+
const diagnosticInfo = diagnoseDirectoryUploadError(
|
|
4776
|
+
dist,
|
|
4777
|
+
uploadResult.upload_rst,
|
|
4778
|
+
dist
|
|
4779
|
+
);
|
|
4780
|
+
smartProgress.fail("Directory hash not found in response", trace_id);
|
|
4781
|
+
console.log(
|
|
4782
|
+
import_chalk2.default.red(
|
|
4783
|
+
`
|
|
4784
|
+
\u274C Directory upload failed: Directory hash not found in response`
|
|
4785
|
+
)
|
|
4786
|
+
);
|
|
4787
|
+
console.log(import_chalk2.default.yellow(`
|
|
4788
|
+
\u{1F4CB} Error diagnosis information:`));
|
|
4789
|
+
console.log(import_chalk2.default.gray(` - ${diagnosticInfo}`));
|
|
4790
|
+
console.log(import_chalk2.default.blue(`
|
|
4791
|
+
\u{1F527} Solutions:`));
|
|
4792
|
+
console.log(
|
|
4793
|
+
import_chalk2.default.gray(
|
|
4794
|
+
` 1. Ensure directory is not empty and contains valid files`
|
|
4795
|
+
)
|
|
4796
|
+
);
|
|
4797
|
+
console.log(import_chalk2.default.gray(` 2. Check network connection stability`));
|
|
4798
|
+
console.log(
|
|
4799
|
+
import_chalk2.default.gray(` 3. Try uploading a smaller directory for testing`)
|
|
4800
|
+
);
|
|
5319
4801
|
} catch (error) {
|
|
5320
|
-
clearInterval(
|
|
4802
|
+
clearInterval(progressInterval);
|
|
4803
|
+
if (error.message && error.message.includes("multipart")) {
|
|
4804
|
+
const errorMessage = handleMultipartError(error, `Directory upload: ${dist}`);
|
|
4805
|
+
smartProgress.fail(errorMessage);
|
|
4806
|
+
console.log(import_chalk2.default.red(`
|
|
4807
|
+
\u274C ${errorMessage}`));
|
|
4808
|
+
return null;
|
|
4809
|
+
}
|
|
5321
4810
|
if (error.response && error.response.data && error.response.data.code) {
|
|
5322
4811
|
const errorCode = error.response.data.code.toString();
|
|
5323
4812
|
if (ERROR_CODES[errorCode]) {
|
|
5324
|
-
|
|
4813
|
+
smartProgress.fail(`Error: ${ERROR_CODES[errorCode]} (Code: ${errorCode})`);
|
|
5325
4814
|
console.log(
|
|
5326
4815
|
import_chalk2.default.red(`Error: ${ERROR_CODES[errorCode]} (Code: ${errorCode})`)
|
|
5327
4816
|
);
|
|
5328
4817
|
return null;
|
|
5329
4818
|
}
|
|
5330
4819
|
}
|
|
5331
|
-
|
|
4820
|
+
smartProgress.fail(`Error: ${error.message}`);
|
|
5332
4821
|
console.log(import_chalk2.default.red(`Error: ${error.message}`));
|
|
5333
4822
|
return null;
|
|
5334
4823
|
}
|
|
@@ -5343,13 +4832,34 @@ async function uploadFile(filePath, deviceId) {
|
|
|
5343
4832
|
);
|
|
5344
4833
|
}
|
|
5345
4834
|
const fileName = filePath.split(import_path4.default.sep).pop() || "";
|
|
4835
|
+
if (!import_fs_extra3.default.existsSync(filePath)) {
|
|
4836
|
+
throw new Error(`File not found: ${filePath}`);
|
|
4837
|
+
}
|
|
4838
|
+
const fileStats = import_fs_extra3.default.statSync(filePath);
|
|
4839
|
+
if (!fileStats.isFile()) {
|
|
4840
|
+
throw new Error(`Path is not a file: ${filePath}`);
|
|
4841
|
+
}
|
|
4842
|
+
console.log(import_chalk2.default.blue("\n\u{1F4C4} File Upload Analysis:"));
|
|
4843
|
+
console.log(import_chalk2.default.gray(` File path: ${filePath}`));
|
|
4844
|
+
console.log(import_chalk2.default.gray(` File name: ${fileName}`));
|
|
4845
|
+
console.log(import_chalk2.default.gray(` File size: ${formatSize(fileStats.size)}`));
|
|
4846
|
+
console.log(import_chalk2.default.gray(` File exists: ${import_fs_extra3.default.existsSync(filePath)}`));
|
|
4847
|
+
console.log(import_chalk2.default.gray(` Is file: ${fileStats.isFile()}
|
|
4848
|
+
`));
|
|
5346
4849
|
const startTime = Date.now();
|
|
5347
|
-
const spinner = (0, import_ora.default)(`
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
4850
|
+
const spinner = (0, import_ora.default)(`Preparing upload...`).start();
|
|
4851
|
+
let totalSize = 0;
|
|
4852
|
+
try {
|
|
4853
|
+
const stats = import_fs_extra3.default.statSync(filePath);
|
|
4854
|
+
totalSize = stats.size;
|
|
4855
|
+
} catch (error) {
|
|
4856
|
+
}
|
|
4857
|
+
const smartProgress = new SmartProgressBar(fileName, 1, totalSize, spinner);
|
|
4858
|
+
const progressInterval = setInterval(() => {
|
|
4859
|
+
smartProgress.update();
|
|
4860
|
+
}, 200);
|
|
5352
4861
|
try {
|
|
4862
|
+
smartProgress.startUpload();
|
|
5353
4863
|
const formData = new import_form_data2.default();
|
|
5354
4864
|
const encodedFileName = encodeURIComponent(fileName);
|
|
5355
4865
|
formData.append("file", import_fs_extra3.default.createReadStream(filePath), {
|
|
@@ -5362,57 +4872,206 @@ async function uploadFile(filePath, deviceId) {
|
|
|
5362
4872
|
headers: {
|
|
5363
4873
|
...formData.getHeaders()
|
|
5364
4874
|
},
|
|
5365
|
-
timeout:
|
|
5366
|
-
//
|
|
4875
|
+
timeout: 18e5
|
|
4876
|
+
// 30 minutes timeout
|
|
5367
4877
|
}
|
|
5368
4878
|
);
|
|
5369
|
-
clearInterval(
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
spinner.succeed(`Successfully uploaded ${fileName} in ${elapsed}s`);
|
|
5376
|
-
const uploadData = {
|
|
5377
|
-
path: filePath,
|
|
5378
|
-
filename: fileName,
|
|
5379
|
-
contentHash: fileItem.Hash,
|
|
5380
|
-
previewHash: null,
|
|
5381
|
-
size: sizeCheck.size,
|
|
5382
|
-
fileCount: 1,
|
|
5383
|
-
isDirectory: false,
|
|
5384
|
-
shortUrl: fileItem.ShortUrl || null
|
|
5385
|
-
};
|
|
5386
|
-
saveUploadHistory(uploadData);
|
|
5387
|
-
return {
|
|
5388
|
-
hash: fileItem.Hash,
|
|
5389
|
-
shortUrl: fileItem.ShortUrl
|
|
5390
|
-
};
|
|
5391
|
-
}
|
|
5392
|
-
spinner.fail(`File hash not found in response`);
|
|
5393
|
-
console.log(import_chalk2.default.red(`File hash not found in response`));
|
|
5394
|
-
} else {
|
|
5395
|
-
spinner.fail(`Invalid response format from IPFS`);
|
|
5396
|
-
console.log(import_chalk2.default.red(`Invalid response format from IPFS`));
|
|
4879
|
+
clearInterval(progressInterval);
|
|
4880
|
+
smartProgress.startPolling();
|
|
4881
|
+
const trace_id = response.data.data.trace_id;
|
|
4882
|
+
if (!trace_id) {
|
|
4883
|
+
smartProgress.fail("No request id received from server");
|
|
4884
|
+
return null;
|
|
5397
4885
|
}
|
|
5398
|
-
|
|
4886
|
+
smartProgress.update();
|
|
4887
|
+
const uploadResult = await pollUploadStatus(
|
|
4888
|
+
trace_id,
|
|
4889
|
+
deviceId,
|
|
4890
|
+
smartProgress,
|
|
4891
|
+
startTime
|
|
4892
|
+
);
|
|
4893
|
+
if (!uploadResult) {
|
|
4894
|
+
return null;
|
|
4895
|
+
}
|
|
4896
|
+
const fileItem = uploadResult.upload_rst;
|
|
4897
|
+
if (fileItem) {
|
|
4898
|
+
const uploadData = {
|
|
4899
|
+
path: filePath,
|
|
4900
|
+
filename: fileName,
|
|
4901
|
+
contentHash: fileItem.Hash,
|
|
4902
|
+
previewHash: null,
|
|
4903
|
+
size: sizeCheck.size,
|
|
4904
|
+
fileCount: 1,
|
|
4905
|
+
isDirectory: false,
|
|
4906
|
+
shortUrl: fileItem.ShortUrl || null
|
|
4907
|
+
};
|
|
4908
|
+
saveUploadHistory(uploadData);
|
|
4909
|
+
smartProgress.complete(trace_id);
|
|
4910
|
+
return {
|
|
4911
|
+
hash: fileItem.Hash,
|
|
4912
|
+
shortUrl: fileItem.ShortUrl
|
|
4913
|
+
};
|
|
4914
|
+
}
|
|
4915
|
+
smartProgress.fail("File hash not found in response", trace_id);
|
|
4916
|
+
console.log(
|
|
4917
|
+
import_chalk2.default.red(`
|
|
4918
|
+
\u274C File upload failed: File hash not found in response`)
|
|
4919
|
+
);
|
|
4920
|
+
console.log(import_chalk2.default.yellow(`
|
|
4921
|
+
\u{1F4CB} Error diagnosis information:`));
|
|
4922
|
+
console.log(import_chalk2.default.gray(` - File name: ${fileName}`));
|
|
4923
|
+
console.log(
|
|
4924
|
+
import_chalk2.default.gray(
|
|
4925
|
+
` - Name returned by IPFS: ${uploadResult.upload_rst.Name}`
|
|
4926
|
+
)
|
|
4927
|
+
);
|
|
4928
|
+
console.log(import_chalk2.default.blue(`
|
|
4929
|
+
\u{1F527} Solutions:`));
|
|
4930
|
+
console.log(import_chalk2.default.gray(` 1. Check if file is corrupted or unreadable`));
|
|
4931
|
+
console.log(import_chalk2.default.gray(` 2. Check network connection stability`));
|
|
4932
|
+
console.log(import_chalk2.default.gray(` 3. Try uploading a smaller file for testing`));
|
|
5399
4933
|
} catch (error) {
|
|
5400
|
-
clearInterval(
|
|
4934
|
+
clearInterval(progressInterval);
|
|
4935
|
+
if (error.message && error.message.includes("multipart")) {
|
|
4936
|
+
const errorMessage = handleMultipartError(error, `File upload: ${fileName}`);
|
|
4937
|
+
smartProgress.fail(errorMessage);
|
|
4938
|
+
console.log(import_chalk2.default.red(`
|
|
4939
|
+
\u274C ${errorMessage}`));
|
|
4940
|
+
return null;
|
|
4941
|
+
}
|
|
5401
4942
|
if (error.response && error.response.data && error.response.data.code) {
|
|
5402
4943
|
const errorCode = error.response.data.code.toString();
|
|
5403
4944
|
if (ERROR_CODES[errorCode]) {
|
|
5404
|
-
|
|
4945
|
+
smartProgress.fail(`Error: ${ERROR_CODES[errorCode]} (Code: ${errorCode})`);
|
|
5405
4946
|
console.log(
|
|
5406
4947
|
import_chalk2.default.red(`Error: ${ERROR_CODES[errorCode]} (Code: ${errorCode})`)
|
|
5407
4948
|
);
|
|
5408
4949
|
return null;
|
|
5409
4950
|
}
|
|
5410
4951
|
}
|
|
5411
|
-
|
|
4952
|
+
smartProgress.fail(`Error: ${error.message}`);
|
|
5412
4953
|
console.log(import_chalk2.default.red(`Error: ${error.message}`));
|
|
5413
4954
|
return null;
|
|
5414
4955
|
}
|
|
5415
4956
|
}
|
|
4957
|
+
var SmartProgressBar = class {
|
|
4958
|
+
timeConstant;
|
|
4959
|
+
startTime;
|
|
4960
|
+
uploadStartTime;
|
|
4961
|
+
isUploading;
|
|
4962
|
+
isPolling;
|
|
4963
|
+
fileCount;
|
|
4964
|
+
totalSize;
|
|
4965
|
+
spinner;
|
|
4966
|
+
fileName;
|
|
4967
|
+
isCompleted;
|
|
4968
|
+
// Add completion flag
|
|
4969
|
+
constructor(fileName, fileCount, totalSize, spinner) {
|
|
4970
|
+
this.fileName = fileName;
|
|
4971
|
+
this.fileCount = fileCount;
|
|
4972
|
+
this.totalSize = totalSize;
|
|
4973
|
+
this.spinner = spinner;
|
|
4974
|
+
this.timeConstant = this.calcTimeConstant(fileCount, totalSize);
|
|
4975
|
+
this.startTime = Date.now();
|
|
4976
|
+
this.uploadStartTime = 0;
|
|
4977
|
+
this.isUploading = false;
|
|
4978
|
+
this.isPolling = false;
|
|
4979
|
+
this.isCompleted = false;
|
|
4980
|
+
}
|
|
4981
|
+
// Calculate time constant based on file count and total size
|
|
4982
|
+
calcTimeConstant(fileCount, totalSize) {
|
|
4983
|
+
const base = 8e3;
|
|
4984
|
+
const countFactor = 0.3 * Math.log(1 + fileCount);
|
|
4985
|
+
const sizeFactor = 0.7 * Math.log(1 + totalSize / 1024 / 1024);
|
|
4986
|
+
const minTimeConstant = 15e3;
|
|
4987
|
+
const calculatedTimeConstant = base * (1 + countFactor + sizeFactor);
|
|
4988
|
+
return Math.max(calculatedTimeConstant, minTimeConstant);
|
|
4989
|
+
}
|
|
4990
|
+
// Calculate progress using exponential decay model with upper limit
|
|
4991
|
+
calculateProgress() {
|
|
4992
|
+
const elapsed = Date.now() - this.startTime;
|
|
4993
|
+
const rawProgress = 1 - Math.exp(-elapsed / this.timeConstant);
|
|
4994
|
+
const maxProgress = this.isPolling ? 0.95 : 0.9;
|
|
4995
|
+
return Math.min(rawProgress, maxProgress);
|
|
4996
|
+
}
|
|
4997
|
+
// Start upload phase
|
|
4998
|
+
startUpload() {
|
|
4999
|
+
this.isUploading = true;
|
|
5000
|
+
this.uploadStartTime = Date.now();
|
|
5001
|
+
}
|
|
5002
|
+
// Start polling phase
|
|
5003
|
+
startPolling() {
|
|
5004
|
+
this.isPolling = true;
|
|
5005
|
+
this.isUploading = false;
|
|
5006
|
+
}
|
|
5007
|
+
// Update progress display
|
|
5008
|
+
update() {
|
|
5009
|
+
if (this.isCompleted) {
|
|
5010
|
+
return;
|
|
5011
|
+
}
|
|
5012
|
+
const progress = this.calculateProgress();
|
|
5013
|
+
const elapsed = Math.floor((Date.now() - this.startTime) / 1e3);
|
|
5014
|
+
const progressBar = this.createProgressBar(progress);
|
|
5015
|
+
const duration = this.formatDuration(elapsed);
|
|
5016
|
+
let status = "";
|
|
5017
|
+
if (this.isUploading) {
|
|
5018
|
+
status = "uploading";
|
|
5019
|
+
} else if (this.isPolling) {
|
|
5020
|
+
status = "processing";
|
|
5021
|
+
} else {
|
|
5022
|
+
status = "preparing";
|
|
5023
|
+
}
|
|
5024
|
+
const fileInfo = this.fileCount > 1 ? `${this.fileName} (${this.fileCount} files)` : this.fileName;
|
|
5025
|
+
this.spinner.text = `Uploading ${fileInfo} ${progressBar} ${duration} (${status})`;
|
|
5026
|
+
}
|
|
5027
|
+
// Complete progress
|
|
5028
|
+
complete(traceId) {
|
|
5029
|
+
if (this.isCompleted) {
|
|
5030
|
+
return;
|
|
5031
|
+
}
|
|
5032
|
+
const progressBar = this.createProgressBar(1);
|
|
5033
|
+
const elapsed = Math.floor((Date.now() - this.startTime) / 1e3);
|
|
5034
|
+
const duration = this.formatDuration(elapsed);
|
|
5035
|
+
const traceInfo = traceId ? ` (trace_id: ${traceId})` : "";
|
|
5036
|
+
this.spinner.succeed(`Upload completed ${progressBar} ${duration}${traceInfo}`);
|
|
5037
|
+
this.isCompleted = true;
|
|
5038
|
+
}
|
|
5039
|
+
// Fail progress
|
|
5040
|
+
fail(message, traceId) {
|
|
5041
|
+
if (this.isCompleted) {
|
|
5042
|
+
return;
|
|
5043
|
+
}
|
|
5044
|
+
const elapsed = Math.floor((Date.now() - this.startTime) / 1e3);
|
|
5045
|
+
const duration = this.formatDuration(elapsed);
|
|
5046
|
+
const traceInfo = traceId ? ` (trace_id: ${traceId})` : "";
|
|
5047
|
+
this.spinner.fail(`${message} ${duration}${traceInfo}`);
|
|
5048
|
+
this.isCompleted = true;
|
|
5049
|
+
}
|
|
5050
|
+
// Create visual progress bar
|
|
5051
|
+
createProgressBar(progress, width = 20) {
|
|
5052
|
+
const percentage = Math.min(progress, 1);
|
|
5053
|
+
const filledWidth = Math.round(width * percentage);
|
|
5054
|
+
const emptyWidth = width - filledWidth;
|
|
5055
|
+
const filled = "\u2588".repeat(filledWidth);
|
|
5056
|
+
const empty = "\u2591".repeat(emptyWidth);
|
|
5057
|
+
return `[${filled}${empty}] ${Math.round(percentage * 100)}%`;
|
|
5058
|
+
}
|
|
5059
|
+
// Format time duration
|
|
5060
|
+
formatDuration(seconds) {
|
|
5061
|
+
if (seconds < 60) {
|
|
5062
|
+
return `${seconds}s`;
|
|
5063
|
+
} else if (seconds < 3600) {
|
|
5064
|
+
const minutes = Math.floor(seconds / 60);
|
|
5065
|
+
const remainingSeconds = seconds % 60;
|
|
5066
|
+
return `${minutes}m ${remainingSeconds}s`;
|
|
5067
|
+
} else {
|
|
5068
|
+
const hours = Math.floor(seconds / 3600);
|
|
5069
|
+
const minutes = Math.floor(seconds % 3600 / 60);
|
|
5070
|
+
const remainingSeconds = seconds % 60;
|
|
5071
|
+
return `${hours}h ${minutes}m ${remainingSeconds}s`;
|
|
5072
|
+
}
|
|
5073
|
+
}
|
|
5074
|
+
};
|
|
5416
5075
|
async function uploadToIpfs_default(filePath) {
|
|
5417
5076
|
const deviceId = getDeviceId();
|
|
5418
5077
|
if (!deviceId) {
|
|
@@ -5552,7 +5211,7 @@ var import_figlet2 = __toESM(require("figlet"));
|
|
|
5552
5211
|
|
|
5553
5212
|
// bin/utils/removeFromIpfs.ts
|
|
5554
5213
|
var import_chalk4 = __toESM(require("chalk"));
|
|
5555
|
-
var ipfsApiUrl2 = "https://pinme.dev/api/
|
|
5214
|
+
var ipfsApiUrl2 = "https://pinme.dev/api/v3";
|
|
5556
5215
|
async function removeFromIpfs(value, type = "hash") {
|
|
5557
5216
|
try {
|
|
5558
5217
|
const uid = getDeviceId();
|