pinme 1.0.9 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/dist/index.js +4234 -27
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -360,26 +360,4010 @@ var require_main = __commonJS({
|
|
|
360
360
|
}
|
|
361
361
|
});
|
|
362
362
|
|
|
363
|
+
// node_modules/.pnpm/proxy-from-env@1.1.0/node_modules/proxy-from-env/index.js
|
|
364
|
+
var require_proxy_from_env = __commonJS({
|
|
365
|
+
"node_modules/.pnpm/proxy-from-env@1.1.0/node_modules/proxy-from-env/index.js"(exports2) {
|
|
366
|
+
"use strict";
|
|
367
|
+
var parseUrl = require("url").parse;
|
|
368
|
+
var DEFAULT_PORTS = {
|
|
369
|
+
ftp: 21,
|
|
370
|
+
gopher: 70,
|
|
371
|
+
http: 80,
|
|
372
|
+
https: 443,
|
|
373
|
+
ws: 80,
|
|
374
|
+
wss: 443
|
|
375
|
+
};
|
|
376
|
+
var stringEndsWith = String.prototype.endsWith || function(s) {
|
|
377
|
+
return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1;
|
|
378
|
+
};
|
|
379
|
+
function getProxyForUrl2(url2) {
|
|
380
|
+
var parsedUrl = typeof url2 === "string" ? parseUrl(url2) : url2 || {};
|
|
381
|
+
var proto = parsedUrl.protocol;
|
|
382
|
+
var hostname = parsedUrl.host;
|
|
383
|
+
var port = parsedUrl.port;
|
|
384
|
+
if (typeof hostname !== "string" || !hostname || typeof proto !== "string") {
|
|
385
|
+
return "";
|
|
386
|
+
}
|
|
387
|
+
proto = proto.split(":", 1)[0];
|
|
388
|
+
hostname = hostname.replace(/:\d*$/, "");
|
|
389
|
+
port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
|
|
390
|
+
if (!shouldProxy(hostname, port)) {
|
|
391
|
+
return "";
|
|
392
|
+
}
|
|
393
|
+
var proxy = getEnv("npm_config_" + proto + "_proxy") || getEnv(proto + "_proxy") || getEnv("npm_config_proxy") || getEnv("all_proxy");
|
|
394
|
+
if (proxy && proxy.indexOf("://") === -1) {
|
|
395
|
+
proxy = proto + "://" + proxy;
|
|
396
|
+
}
|
|
397
|
+
return proxy;
|
|
398
|
+
}
|
|
399
|
+
function shouldProxy(hostname, port) {
|
|
400
|
+
var NO_PROXY = (getEnv("npm_config_no_proxy") || getEnv("no_proxy")).toLowerCase();
|
|
401
|
+
if (!NO_PROXY) {
|
|
402
|
+
return true;
|
|
403
|
+
}
|
|
404
|
+
if (NO_PROXY === "*") {
|
|
405
|
+
return false;
|
|
406
|
+
}
|
|
407
|
+
return NO_PROXY.split(/[,\s]/).every(function(proxy) {
|
|
408
|
+
if (!proxy) {
|
|
409
|
+
return true;
|
|
410
|
+
}
|
|
411
|
+
var parsedProxy = proxy.match(/^(.+):(\d+)$/);
|
|
412
|
+
var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
|
|
413
|
+
var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
|
|
414
|
+
if (parsedProxyPort && parsedProxyPort !== port) {
|
|
415
|
+
return true;
|
|
416
|
+
}
|
|
417
|
+
if (!/^[.*]/.test(parsedProxyHostname)) {
|
|
418
|
+
return hostname !== parsedProxyHostname;
|
|
419
|
+
}
|
|
420
|
+
if (parsedProxyHostname.charAt(0) === "*") {
|
|
421
|
+
parsedProxyHostname = parsedProxyHostname.slice(1);
|
|
422
|
+
}
|
|
423
|
+
return !stringEndsWith.call(hostname, parsedProxyHostname);
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
function getEnv(key) {
|
|
427
|
+
return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
|
|
428
|
+
}
|
|
429
|
+
exports2.getProxyForUrl = getProxyForUrl2;
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
// node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js
|
|
434
|
+
var require_ms = __commonJS({
|
|
435
|
+
"node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js"(exports2, module2) {
|
|
436
|
+
var s = 1e3;
|
|
437
|
+
var m = s * 60;
|
|
438
|
+
var h = m * 60;
|
|
439
|
+
var d = h * 24;
|
|
440
|
+
var w = d * 7;
|
|
441
|
+
var y = d * 365.25;
|
|
442
|
+
module2.exports = function(val, options) {
|
|
443
|
+
options = options || {};
|
|
444
|
+
var type = typeof val;
|
|
445
|
+
if (type === "string" && val.length > 0) {
|
|
446
|
+
return parse(val);
|
|
447
|
+
} else if (type === "number" && isFinite(val)) {
|
|
448
|
+
return options.long ? fmtLong(val) : fmtShort(val);
|
|
449
|
+
}
|
|
450
|
+
throw new Error(
|
|
451
|
+
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
452
|
+
);
|
|
453
|
+
};
|
|
454
|
+
function parse(str) {
|
|
455
|
+
str = String(str);
|
|
456
|
+
if (str.length > 100) {
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
460
|
+
str
|
|
461
|
+
);
|
|
462
|
+
if (!match) {
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
var n = parseFloat(match[1]);
|
|
466
|
+
var type = (match[2] || "ms").toLowerCase();
|
|
467
|
+
switch (type) {
|
|
468
|
+
case "years":
|
|
469
|
+
case "year":
|
|
470
|
+
case "yrs":
|
|
471
|
+
case "yr":
|
|
472
|
+
case "y":
|
|
473
|
+
return n * y;
|
|
474
|
+
case "weeks":
|
|
475
|
+
case "week":
|
|
476
|
+
case "w":
|
|
477
|
+
return n * w;
|
|
478
|
+
case "days":
|
|
479
|
+
case "day":
|
|
480
|
+
case "d":
|
|
481
|
+
return n * d;
|
|
482
|
+
case "hours":
|
|
483
|
+
case "hour":
|
|
484
|
+
case "hrs":
|
|
485
|
+
case "hr":
|
|
486
|
+
case "h":
|
|
487
|
+
return n * h;
|
|
488
|
+
case "minutes":
|
|
489
|
+
case "minute":
|
|
490
|
+
case "mins":
|
|
491
|
+
case "min":
|
|
492
|
+
case "m":
|
|
493
|
+
return n * m;
|
|
494
|
+
case "seconds":
|
|
495
|
+
case "second":
|
|
496
|
+
case "secs":
|
|
497
|
+
case "sec":
|
|
498
|
+
case "s":
|
|
499
|
+
return n * s;
|
|
500
|
+
case "milliseconds":
|
|
501
|
+
case "millisecond":
|
|
502
|
+
case "msecs":
|
|
503
|
+
case "msec":
|
|
504
|
+
case "ms":
|
|
505
|
+
return n;
|
|
506
|
+
default:
|
|
507
|
+
return void 0;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
function fmtShort(ms) {
|
|
511
|
+
var msAbs = Math.abs(ms);
|
|
512
|
+
if (msAbs >= d) {
|
|
513
|
+
return Math.round(ms / d) + "d";
|
|
514
|
+
}
|
|
515
|
+
if (msAbs >= h) {
|
|
516
|
+
return Math.round(ms / h) + "h";
|
|
517
|
+
}
|
|
518
|
+
if (msAbs >= m) {
|
|
519
|
+
return Math.round(ms / m) + "m";
|
|
520
|
+
}
|
|
521
|
+
if (msAbs >= s) {
|
|
522
|
+
return Math.round(ms / s) + "s";
|
|
523
|
+
}
|
|
524
|
+
return ms + "ms";
|
|
525
|
+
}
|
|
526
|
+
function fmtLong(ms) {
|
|
527
|
+
var msAbs = Math.abs(ms);
|
|
528
|
+
if (msAbs >= d) {
|
|
529
|
+
return plural(ms, msAbs, d, "day");
|
|
530
|
+
}
|
|
531
|
+
if (msAbs >= h) {
|
|
532
|
+
return plural(ms, msAbs, h, "hour");
|
|
533
|
+
}
|
|
534
|
+
if (msAbs >= m) {
|
|
535
|
+
return plural(ms, msAbs, m, "minute");
|
|
536
|
+
}
|
|
537
|
+
if (msAbs >= s) {
|
|
538
|
+
return plural(ms, msAbs, s, "second");
|
|
539
|
+
}
|
|
540
|
+
return ms + " ms";
|
|
541
|
+
}
|
|
542
|
+
function plural(ms, msAbs, n, name) {
|
|
543
|
+
var isPlural = msAbs >= n * 1.5;
|
|
544
|
+
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
});
|
|
548
|
+
|
|
549
|
+
// node_modules/.pnpm/debug@3.2.7/node_modules/debug/src/common.js
|
|
550
|
+
var require_common = __commonJS({
|
|
551
|
+
"node_modules/.pnpm/debug@3.2.7/node_modules/debug/src/common.js"(exports2, module2) {
|
|
552
|
+
"use strict";
|
|
553
|
+
function setup(env) {
|
|
554
|
+
createDebug.debug = createDebug;
|
|
555
|
+
createDebug.default = createDebug;
|
|
556
|
+
createDebug.coerce = coerce;
|
|
557
|
+
createDebug.disable = disable;
|
|
558
|
+
createDebug.enable = enable;
|
|
559
|
+
createDebug.enabled = enabled;
|
|
560
|
+
createDebug.humanize = require_ms();
|
|
561
|
+
Object.keys(env).forEach(function(key) {
|
|
562
|
+
createDebug[key] = env[key];
|
|
563
|
+
});
|
|
564
|
+
createDebug.instances = [];
|
|
565
|
+
createDebug.names = [];
|
|
566
|
+
createDebug.skips = [];
|
|
567
|
+
createDebug.formatters = {};
|
|
568
|
+
function selectColor(namespace) {
|
|
569
|
+
var hash = 0;
|
|
570
|
+
for (var i = 0; i < namespace.length; i++) {
|
|
571
|
+
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
572
|
+
hash |= 0;
|
|
573
|
+
}
|
|
574
|
+
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
575
|
+
}
|
|
576
|
+
createDebug.selectColor = selectColor;
|
|
577
|
+
function createDebug(namespace) {
|
|
578
|
+
var prevTime;
|
|
579
|
+
function debug() {
|
|
580
|
+
if (!debug.enabled) {
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
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);
|
|
589
|
+
self2.diff = ms;
|
|
590
|
+
self2.prev = prevTime;
|
|
591
|
+
self2.curr = curr;
|
|
592
|
+
prevTime = curr;
|
|
593
|
+
args[0] = createDebug.coerce(args[0]);
|
|
594
|
+
if (typeof args[0] !== "string") {
|
|
595
|
+
args.unshift("%O");
|
|
596
|
+
}
|
|
597
|
+
var index = 0;
|
|
598
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
|
|
599
|
+
if (match === "%%") {
|
|
600
|
+
return match;
|
|
601
|
+
}
|
|
602
|
+
index++;
|
|
603
|
+
var formatter = createDebug.formatters[format];
|
|
604
|
+
if (typeof formatter === "function") {
|
|
605
|
+
var val = args[index];
|
|
606
|
+
match = formatter.call(self2, val);
|
|
607
|
+
args.splice(index, 1);
|
|
608
|
+
index--;
|
|
609
|
+
}
|
|
610
|
+
return match;
|
|
611
|
+
});
|
|
612
|
+
createDebug.formatArgs.call(self2, args);
|
|
613
|
+
var logFn = self2.log || createDebug.log;
|
|
614
|
+
logFn.apply(self2, args);
|
|
615
|
+
}
|
|
616
|
+
debug.namespace = namespace;
|
|
617
|
+
debug.enabled = createDebug.enabled(namespace);
|
|
618
|
+
debug.useColors = createDebug.useColors();
|
|
619
|
+
debug.color = selectColor(namespace);
|
|
620
|
+
debug.destroy = destroy;
|
|
621
|
+
debug.extend = extend2;
|
|
622
|
+
if (typeof createDebug.init === "function") {
|
|
623
|
+
createDebug.init(debug);
|
|
624
|
+
}
|
|
625
|
+
createDebug.instances.push(debug);
|
|
626
|
+
return debug;
|
|
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
|
+
}
|
|
636
|
+
function extend2(namespace, delimiter) {
|
|
637
|
+
return createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
|
|
638
|
+
}
|
|
639
|
+
function enable(namespaces) {
|
|
640
|
+
createDebug.save(namespaces);
|
|
641
|
+
createDebug.names = [];
|
|
642
|
+
createDebug.skips = [];
|
|
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;
|
|
649
|
+
}
|
|
650
|
+
namespaces = split[i].replace(/\*/g, ".*?");
|
|
651
|
+
if (namespaces[0] === "-") {
|
|
652
|
+
createDebug.skips.push(new RegExp("^" + namespaces.substr(1) + "$"));
|
|
653
|
+
} else {
|
|
654
|
+
createDebug.names.push(new RegExp("^" + namespaces + "$"));
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
for (i = 0; i < createDebug.instances.length; i++) {
|
|
658
|
+
var instance = createDebug.instances[i];
|
|
659
|
+
instance.enabled = createDebug.enabled(instance.namespace);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
function disable() {
|
|
663
|
+
createDebug.enable("");
|
|
664
|
+
}
|
|
665
|
+
function enabled(name) {
|
|
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)) {
|
|
673
|
+
return false;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
|
677
|
+
if (createDebug.names[i].test(name)) {
|
|
678
|
+
return true;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
return false;
|
|
682
|
+
}
|
|
683
|
+
function coerce(val) {
|
|
684
|
+
if (val instanceof Error) {
|
|
685
|
+
return val.stack || val.message;
|
|
686
|
+
}
|
|
687
|
+
return val;
|
|
688
|
+
}
|
|
689
|
+
createDebug.enable(createDebug.load());
|
|
690
|
+
return createDebug;
|
|
691
|
+
}
|
|
692
|
+
module2.exports = setup;
|
|
693
|
+
}
|
|
694
|
+
});
|
|
695
|
+
|
|
696
|
+
// node_modules/.pnpm/debug@3.2.7/node_modules/debug/src/browser.js
|
|
697
|
+
var require_browser = __commonJS({
|
|
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;
|
|
713
|
+
exports2.formatArgs = formatArgs;
|
|
714
|
+
exports2.save = save;
|
|
715
|
+
exports2.load = load;
|
|
716
|
+
exports2.useColors = useColors;
|
|
717
|
+
exports2.storage = localstorage();
|
|
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"];
|
|
719
|
+
function useColors() {
|
|
720
|
+
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
|
|
721
|
+
return true;
|
|
722
|
+
}
|
|
723
|
+
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
724
|
+
return false;
|
|
725
|
+
}
|
|
726
|
+
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
727
|
+
typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
728
|
+
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
729
|
+
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
|
|
730
|
+
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
731
|
+
}
|
|
732
|
+
function formatArgs(args) {
|
|
733
|
+
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
|
|
734
|
+
if (!this.useColors) {
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
var c = "color: " + this.color;
|
|
738
|
+
args.splice(1, 0, c, "color: inherit");
|
|
739
|
+
var index = 0;
|
|
740
|
+
var lastC = 0;
|
|
741
|
+
args[0].replace(/%[a-zA-Z%]/g, function(match) {
|
|
742
|
+
if (match === "%%") {
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
index++;
|
|
746
|
+
if (match === "%c") {
|
|
747
|
+
lastC = index;
|
|
748
|
+
}
|
|
749
|
+
});
|
|
750
|
+
args.splice(lastC, 0, c);
|
|
751
|
+
}
|
|
752
|
+
function log() {
|
|
753
|
+
var _console;
|
|
754
|
+
return (typeof console === "undefined" ? "undefined" : _typeof(console)) === "object" && console.log && (_console = console).log.apply(_console, arguments);
|
|
755
|
+
}
|
|
756
|
+
function save(namespaces) {
|
|
757
|
+
try {
|
|
758
|
+
if (namespaces) {
|
|
759
|
+
exports2.storage.setItem("debug", namespaces);
|
|
760
|
+
} else {
|
|
761
|
+
exports2.storage.removeItem("debug");
|
|
762
|
+
}
|
|
763
|
+
} catch (error) {
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
function load() {
|
|
767
|
+
var r;
|
|
768
|
+
try {
|
|
769
|
+
r = exports2.storage.getItem("debug");
|
|
770
|
+
} catch (error) {
|
|
771
|
+
}
|
|
772
|
+
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
773
|
+
r = process.env.DEBUG;
|
|
774
|
+
}
|
|
775
|
+
return r;
|
|
776
|
+
}
|
|
777
|
+
function localstorage() {
|
|
778
|
+
try {
|
|
779
|
+
return localStorage;
|
|
780
|
+
} catch (error) {
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
module2.exports = require_common()(exports2);
|
|
784
|
+
var formatters = module2.exports.formatters;
|
|
785
|
+
formatters.j = function(v) {
|
|
786
|
+
try {
|
|
787
|
+
return JSON.stringify(v);
|
|
788
|
+
} catch (error) {
|
|
789
|
+
return "[UnexpectedJSONParseError]: " + error.message;
|
|
790
|
+
}
|
|
791
|
+
};
|
|
792
|
+
}
|
|
793
|
+
});
|
|
794
|
+
|
|
795
|
+
// node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js
|
|
796
|
+
var require_has_flag = __commonJS({
|
|
797
|
+
"node_modules/.pnpm/has-flag@3.0.0/node_modules/has-flag/index.js"(exports2, module2) {
|
|
798
|
+
"use strict";
|
|
799
|
+
module2.exports = (flag, argv) => {
|
|
800
|
+
argv = argv || process.argv;
|
|
801
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
802
|
+
const pos = argv.indexOf(prefix + flag);
|
|
803
|
+
const terminatorPos = argv.indexOf("--");
|
|
804
|
+
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
});
|
|
808
|
+
|
|
809
|
+
// node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js
|
|
810
|
+
var require_supports_color = __commonJS({
|
|
811
|
+
"node_modules/.pnpm/supports-color@5.5.0/node_modules/supports-color/index.js"(exports2, module2) {
|
|
812
|
+
"use strict";
|
|
813
|
+
var os3 = require("os");
|
|
814
|
+
var hasFlag = require_has_flag();
|
|
815
|
+
var env = process.env;
|
|
816
|
+
var forceColor;
|
|
817
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
|
|
818
|
+
forceColor = false;
|
|
819
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
820
|
+
forceColor = true;
|
|
821
|
+
}
|
|
822
|
+
if ("FORCE_COLOR" in env) {
|
|
823
|
+
forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
|
|
824
|
+
}
|
|
825
|
+
function translateLevel(level) {
|
|
826
|
+
if (level === 0) {
|
|
827
|
+
return false;
|
|
828
|
+
}
|
|
829
|
+
return {
|
|
830
|
+
level,
|
|
831
|
+
hasBasic: true,
|
|
832
|
+
has256: level >= 2,
|
|
833
|
+
has16m: level >= 3
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
function supportsColor(stream4) {
|
|
837
|
+
if (forceColor === false) {
|
|
838
|
+
return 0;
|
|
839
|
+
}
|
|
840
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
841
|
+
return 3;
|
|
842
|
+
}
|
|
843
|
+
if (hasFlag("color=256")) {
|
|
844
|
+
return 2;
|
|
845
|
+
}
|
|
846
|
+
if (stream4 && !stream4.isTTY && forceColor !== true) {
|
|
847
|
+
return 0;
|
|
848
|
+
}
|
|
849
|
+
const min = forceColor ? 1 : 0;
|
|
850
|
+
if (process.platform === "win32") {
|
|
851
|
+
const osRelease = os3.release().split(".");
|
|
852
|
+
if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
853
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
854
|
+
}
|
|
855
|
+
return 1;
|
|
856
|
+
}
|
|
857
|
+
if ("CI" in env) {
|
|
858
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
859
|
+
return 1;
|
|
860
|
+
}
|
|
861
|
+
return min;
|
|
862
|
+
}
|
|
863
|
+
if ("TEAMCITY_VERSION" in env) {
|
|
864
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
865
|
+
}
|
|
866
|
+
if (env.COLORTERM === "truecolor") {
|
|
867
|
+
return 3;
|
|
868
|
+
}
|
|
869
|
+
if ("TERM_PROGRAM" in env) {
|
|
870
|
+
const version2 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
871
|
+
switch (env.TERM_PROGRAM) {
|
|
872
|
+
case "iTerm.app":
|
|
873
|
+
return version2 >= 3 ? 3 : 2;
|
|
874
|
+
case "Apple_Terminal":
|
|
875
|
+
return 2;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
879
|
+
return 2;
|
|
880
|
+
}
|
|
881
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
882
|
+
return 1;
|
|
883
|
+
}
|
|
884
|
+
if ("COLORTERM" in env) {
|
|
885
|
+
return 1;
|
|
886
|
+
}
|
|
887
|
+
if (env.TERM === "dumb") {
|
|
888
|
+
return min;
|
|
889
|
+
}
|
|
890
|
+
return min;
|
|
891
|
+
}
|
|
892
|
+
function getSupportLevel(stream4) {
|
|
893
|
+
const level = supportsColor(stream4);
|
|
894
|
+
return translateLevel(level);
|
|
895
|
+
}
|
|
896
|
+
module2.exports = {
|
|
897
|
+
supportsColor: getSupportLevel,
|
|
898
|
+
stdout: getSupportLevel(process.stdout),
|
|
899
|
+
stderr: getSupportLevel(process.stderr)
|
|
900
|
+
};
|
|
901
|
+
}
|
|
902
|
+
});
|
|
903
|
+
|
|
904
|
+
// node_modules/.pnpm/debug@3.2.7/node_modules/debug/src/node.js
|
|
905
|
+
var require_node = __commonJS({
|
|
906
|
+
"node_modules/.pnpm/debug@3.2.7/node_modules/debug/src/node.js"(exports2, module2) {
|
|
907
|
+
"use strict";
|
|
908
|
+
var tty = require("tty");
|
|
909
|
+
var util2 = require("util");
|
|
910
|
+
exports2.init = init;
|
|
911
|
+
exports2.log = log;
|
|
912
|
+
exports2.formatArgs = formatArgs;
|
|
913
|
+
exports2.save = save;
|
|
914
|
+
exports2.load = load;
|
|
915
|
+
exports2.useColors = useColors;
|
|
916
|
+
exports2.colors = [6, 2, 3, 4, 5, 1];
|
|
917
|
+
try {
|
|
918
|
+
supportsColor = require_supports_color();
|
|
919
|
+
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
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];
|
|
921
|
+
}
|
|
922
|
+
} catch (error) {
|
|
923
|
+
}
|
|
924
|
+
var supportsColor;
|
|
925
|
+
exports2.inspectOpts = Object.keys(process.env).filter(function(key) {
|
|
926
|
+
return /^debug_/i.test(key);
|
|
927
|
+
}).reduce(function(obj, key) {
|
|
928
|
+
var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function(_, k) {
|
|
929
|
+
return k.toUpperCase();
|
|
930
|
+
});
|
|
931
|
+
var val = process.env[key];
|
|
932
|
+
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
933
|
+
val = true;
|
|
934
|
+
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
935
|
+
val = false;
|
|
936
|
+
} else if (val === "null") {
|
|
937
|
+
val = null;
|
|
938
|
+
} else {
|
|
939
|
+
val = Number(val);
|
|
940
|
+
}
|
|
941
|
+
obj[prop] = val;
|
|
942
|
+
return obj;
|
|
943
|
+
}, {});
|
|
944
|
+
function useColors() {
|
|
945
|
+
return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd);
|
|
946
|
+
}
|
|
947
|
+
function formatArgs(args) {
|
|
948
|
+
var name = this.namespace, useColors2 = this.useColors;
|
|
949
|
+
if (useColors2) {
|
|
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");
|
|
953
|
+
args[0] = prefix + args[0].split("\n").join("\n" + prefix);
|
|
954
|
+
args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
|
|
955
|
+
} else {
|
|
956
|
+
args[0] = getDate() + name + " " + args[0];
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
function getDate() {
|
|
960
|
+
if (exports2.inspectOpts.hideDate) {
|
|
961
|
+
return "";
|
|
962
|
+
}
|
|
963
|
+
return (/* @__PURE__ */ new Date()).toISOString() + " ";
|
|
964
|
+
}
|
|
965
|
+
function log() {
|
|
966
|
+
return process.stderr.write(util2.format.apply(util2, arguments) + "\n");
|
|
967
|
+
}
|
|
968
|
+
function save(namespaces) {
|
|
969
|
+
if (namespaces) {
|
|
970
|
+
process.env.DEBUG = namespaces;
|
|
971
|
+
} else {
|
|
972
|
+
delete process.env.DEBUG;
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
function load() {
|
|
976
|
+
return process.env.DEBUG;
|
|
977
|
+
}
|
|
978
|
+
function init(debug) {
|
|
979
|
+
debug.inspectOpts = {};
|
|
980
|
+
var keys = Object.keys(exports2.inspectOpts);
|
|
981
|
+
for (var i = 0; i < keys.length; i++) {
|
|
982
|
+
debug.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
module2.exports = require_common()(exports2);
|
|
986
|
+
var formatters = module2.exports.formatters;
|
|
987
|
+
formatters.o = function(v) {
|
|
988
|
+
this.inspectOpts.colors = this.useColors;
|
|
989
|
+
return util2.inspect(v, this.inspectOpts).split("\n").map(function(str) {
|
|
990
|
+
return str.trim();
|
|
991
|
+
}).join(" ");
|
|
992
|
+
};
|
|
993
|
+
formatters.O = function(v) {
|
|
994
|
+
this.inspectOpts.colors = this.useColors;
|
|
995
|
+
return util2.inspect(v, this.inspectOpts);
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
});
|
|
999
|
+
|
|
1000
|
+
// node_modules/.pnpm/debug@3.2.7/node_modules/debug/src/index.js
|
|
1001
|
+
var require_src = __commonJS({
|
|
1002
|
+
"node_modules/.pnpm/debug@3.2.7/node_modules/debug/src/index.js"(exports2, module2) {
|
|
1003
|
+
"use strict";
|
|
1004
|
+
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
1005
|
+
module2.exports = require_browser();
|
|
1006
|
+
} else {
|
|
1007
|
+
module2.exports = require_node();
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
});
|
|
1011
|
+
|
|
1012
|
+
// node_modules/.pnpm/follow-redirects@1.15.2/node_modules/follow-redirects/debug.js
|
|
1013
|
+
var require_debug = __commonJS({
|
|
1014
|
+
"node_modules/.pnpm/follow-redirects@1.15.2/node_modules/follow-redirects/debug.js"(exports2, module2) {
|
|
1015
|
+
var debug;
|
|
1016
|
+
module2.exports = function() {
|
|
1017
|
+
if (!debug) {
|
|
1018
|
+
try {
|
|
1019
|
+
debug = require_src()("follow-redirects");
|
|
1020
|
+
} catch (error) {
|
|
1021
|
+
}
|
|
1022
|
+
if (typeof debug !== "function") {
|
|
1023
|
+
debug = function() {
|
|
1024
|
+
};
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
debug.apply(null, arguments);
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
});
|
|
1031
|
+
|
|
1032
|
+
// node_modules/.pnpm/follow-redirects@1.15.2/node_modules/follow-redirects/index.js
|
|
1033
|
+
var require_follow_redirects = __commonJS({
|
|
1034
|
+
"node_modules/.pnpm/follow-redirects@1.15.2/node_modules/follow-redirects/index.js"(exports2, module2) {
|
|
1035
|
+
var url2 = require("url");
|
|
1036
|
+
var URL3 = url2.URL;
|
|
1037
|
+
var http2 = require("http");
|
|
1038
|
+
var https2 = require("https");
|
|
1039
|
+
var Writable = require("stream").Writable;
|
|
1040
|
+
var assert = require("assert");
|
|
1041
|
+
var debug = require_debug();
|
|
1042
|
+
var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
|
|
1043
|
+
var eventHandlers = /* @__PURE__ */ Object.create(null);
|
|
1044
|
+
events.forEach(function(event) {
|
|
1045
|
+
eventHandlers[event] = function(arg1, arg2, arg3) {
|
|
1046
|
+
this._redirectable.emit(event, arg1, arg2, arg3);
|
|
1047
|
+
};
|
|
1048
|
+
});
|
|
1049
|
+
var InvalidUrlError = createErrorType(
|
|
1050
|
+
"ERR_INVALID_URL",
|
|
1051
|
+
"Invalid URL",
|
|
1052
|
+
TypeError
|
|
1053
|
+
);
|
|
1054
|
+
var RedirectionError = createErrorType(
|
|
1055
|
+
"ERR_FR_REDIRECTION_FAILURE",
|
|
1056
|
+
"Redirected request failed"
|
|
1057
|
+
);
|
|
1058
|
+
var TooManyRedirectsError = createErrorType(
|
|
1059
|
+
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
1060
|
+
"Maximum number of redirects exceeded"
|
|
1061
|
+
);
|
|
1062
|
+
var MaxBodyLengthExceededError = createErrorType(
|
|
1063
|
+
"ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
|
|
1064
|
+
"Request body larger than maxBodyLength limit"
|
|
1065
|
+
);
|
|
1066
|
+
var WriteAfterEndError = createErrorType(
|
|
1067
|
+
"ERR_STREAM_WRITE_AFTER_END",
|
|
1068
|
+
"write after end"
|
|
1069
|
+
);
|
|
1070
|
+
function RedirectableRequest(options, responseCallback) {
|
|
1071
|
+
Writable.call(this);
|
|
1072
|
+
this._sanitizeOptions(options);
|
|
1073
|
+
this._options = options;
|
|
1074
|
+
this._ended = false;
|
|
1075
|
+
this._ending = false;
|
|
1076
|
+
this._redirectCount = 0;
|
|
1077
|
+
this._redirects = [];
|
|
1078
|
+
this._requestBodyLength = 0;
|
|
1079
|
+
this._requestBodyBuffers = [];
|
|
1080
|
+
if (responseCallback) {
|
|
1081
|
+
this.on("response", responseCallback);
|
|
1082
|
+
}
|
|
1083
|
+
var self2 = this;
|
|
1084
|
+
this._onNativeResponse = function(response) {
|
|
1085
|
+
self2._processResponse(response);
|
|
1086
|
+
};
|
|
1087
|
+
this._performRequest();
|
|
1088
|
+
}
|
|
1089
|
+
RedirectableRequest.prototype = Object.create(Writable.prototype);
|
|
1090
|
+
RedirectableRequest.prototype.abort = function() {
|
|
1091
|
+
abortRequest(this._currentRequest);
|
|
1092
|
+
this.emit("abort");
|
|
1093
|
+
};
|
|
1094
|
+
RedirectableRequest.prototype.write = function(data, encoding, callback) {
|
|
1095
|
+
if (this._ending) {
|
|
1096
|
+
throw new WriteAfterEndError();
|
|
1097
|
+
}
|
|
1098
|
+
if (!isString2(data) && !isBuffer2(data)) {
|
|
1099
|
+
throw new TypeError("data should be a string, Buffer or Uint8Array");
|
|
1100
|
+
}
|
|
1101
|
+
if (isFunction2(encoding)) {
|
|
1102
|
+
callback = encoding;
|
|
1103
|
+
encoding = null;
|
|
1104
|
+
}
|
|
1105
|
+
if (data.length === 0) {
|
|
1106
|
+
if (callback) {
|
|
1107
|
+
callback();
|
|
1108
|
+
}
|
|
1109
|
+
return;
|
|
1110
|
+
}
|
|
1111
|
+
if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {
|
|
1112
|
+
this._requestBodyLength += data.length;
|
|
1113
|
+
this._requestBodyBuffers.push({ data, encoding });
|
|
1114
|
+
this._currentRequest.write(data, encoding, callback);
|
|
1115
|
+
} else {
|
|
1116
|
+
this.emit("error", new MaxBodyLengthExceededError());
|
|
1117
|
+
this.abort();
|
|
1118
|
+
}
|
|
1119
|
+
};
|
|
1120
|
+
RedirectableRequest.prototype.end = function(data, encoding, callback) {
|
|
1121
|
+
if (isFunction2(data)) {
|
|
1122
|
+
callback = data;
|
|
1123
|
+
data = encoding = null;
|
|
1124
|
+
} else if (isFunction2(encoding)) {
|
|
1125
|
+
callback = encoding;
|
|
1126
|
+
encoding = null;
|
|
1127
|
+
}
|
|
1128
|
+
if (!data) {
|
|
1129
|
+
this._ended = this._ending = true;
|
|
1130
|
+
this._currentRequest.end(null, null, callback);
|
|
1131
|
+
} else {
|
|
1132
|
+
var self2 = this;
|
|
1133
|
+
var currentRequest = this._currentRequest;
|
|
1134
|
+
this.write(data, encoding, function() {
|
|
1135
|
+
self2._ended = true;
|
|
1136
|
+
currentRequest.end(null, null, callback);
|
|
1137
|
+
});
|
|
1138
|
+
this._ending = true;
|
|
1139
|
+
}
|
|
1140
|
+
};
|
|
1141
|
+
RedirectableRequest.prototype.setHeader = function(name, value) {
|
|
1142
|
+
this._options.headers[name] = value;
|
|
1143
|
+
this._currentRequest.setHeader(name, value);
|
|
1144
|
+
};
|
|
1145
|
+
RedirectableRequest.prototype.removeHeader = function(name) {
|
|
1146
|
+
delete this._options.headers[name];
|
|
1147
|
+
this._currentRequest.removeHeader(name);
|
|
1148
|
+
};
|
|
1149
|
+
RedirectableRequest.prototype.setTimeout = function(msecs, callback) {
|
|
1150
|
+
var self2 = this;
|
|
1151
|
+
function destroyOnTimeout(socket) {
|
|
1152
|
+
socket.setTimeout(msecs);
|
|
1153
|
+
socket.removeListener("timeout", socket.destroy);
|
|
1154
|
+
socket.addListener("timeout", socket.destroy);
|
|
1155
|
+
}
|
|
1156
|
+
function startTimer(socket) {
|
|
1157
|
+
if (self2._timeout) {
|
|
1158
|
+
clearTimeout(self2._timeout);
|
|
1159
|
+
}
|
|
1160
|
+
self2._timeout = setTimeout(function() {
|
|
1161
|
+
self2.emit("timeout");
|
|
1162
|
+
clearTimer();
|
|
1163
|
+
}, msecs);
|
|
1164
|
+
destroyOnTimeout(socket);
|
|
1165
|
+
}
|
|
1166
|
+
function clearTimer() {
|
|
1167
|
+
if (self2._timeout) {
|
|
1168
|
+
clearTimeout(self2._timeout);
|
|
1169
|
+
self2._timeout = null;
|
|
1170
|
+
}
|
|
1171
|
+
self2.removeListener("abort", clearTimer);
|
|
1172
|
+
self2.removeListener("error", clearTimer);
|
|
1173
|
+
self2.removeListener("response", clearTimer);
|
|
1174
|
+
if (callback) {
|
|
1175
|
+
self2.removeListener("timeout", callback);
|
|
1176
|
+
}
|
|
1177
|
+
if (!self2.socket) {
|
|
1178
|
+
self2._currentRequest.removeListener("socket", startTimer);
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
if (callback) {
|
|
1182
|
+
this.on("timeout", callback);
|
|
1183
|
+
}
|
|
1184
|
+
if (this.socket) {
|
|
1185
|
+
startTimer(this.socket);
|
|
1186
|
+
} else {
|
|
1187
|
+
this._currentRequest.once("socket", startTimer);
|
|
1188
|
+
}
|
|
1189
|
+
this.on("socket", destroyOnTimeout);
|
|
1190
|
+
this.on("abort", clearTimer);
|
|
1191
|
+
this.on("error", clearTimer);
|
|
1192
|
+
this.on("response", clearTimer);
|
|
1193
|
+
return this;
|
|
1194
|
+
};
|
|
1195
|
+
[
|
|
1196
|
+
"flushHeaders",
|
|
1197
|
+
"getHeader",
|
|
1198
|
+
"setNoDelay",
|
|
1199
|
+
"setSocketKeepAlive"
|
|
1200
|
+
].forEach(function(method) {
|
|
1201
|
+
RedirectableRequest.prototype[method] = function(a, b) {
|
|
1202
|
+
return this._currentRequest[method](a, b);
|
|
1203
|
+
};
|
|
1204
|
+
});
|
|
1205
|
+
["aborted", "connection", "socket"].forEach(function(property) {
|
|
1206
|
+
Object.defineProperty(RedirectableRequest.prototype, property, {
|
|
1207
|
+
get: function() {
|
|
1208
|
+
return this._currentRequest[property];
|
|
1209
|
+
}
|
|
1210
|
+
});
|
|
1211
|
+
});
|
|
1212
|
+
RedirectableRequest.prototype._sanitizeOptions = function(options) {
|
|
1213
|
+
if (!options.headers) {
|
|
1214
|
+
options.headers = {};
|
|
1215
|
+
}
|
|
1216
|
+
if (options.host) {
|
|
1217
|
+
if (!options.hostname) {
|
|
1218
|
+
options.hostname = options.host;
|
|
1219
|
+
}
|
|
1220
|
+
delete options.host;
|
|
1221
|
+
}
|
|
1222
|
+
if (!options.pathname && options.path) {
|
|
1223
|
+
var searchPos = options.path.indexOf("?");
|
|
1224
|
+
if (searchPos < 0) {
|
|
1225
|
+
options.pathname = options.path;
|
|
1226
|
+
} else {
|
|
1227
|
+
options.pathname = options.path.substring(0, searchPos);
|
|
1228
|
+
options.search = options.path.substring(searchPos);
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
};
|
|
1232
|
+
RedirectableRequest.prototype._performRequest = function() {
|
|
1233
|
+
var protocol = this._options.protocol;
|
|
1234
|
+
var nativeProtocol = this._options.nativeProtocols[protocol];
|
|
1235
|
+
if (!nativeProtocol) {
|
|
1236
|
+
this.emit("error", new TypeError("Unsupported protocol " + protocol));
|
|
1237
|
+
return;
|
|
1238
|
+
}
|
|
1239
|
+
if (this._options.agents) {
|
|
1240
|
+
var scheme = protocol.slice(0, -1);
|
|
1241
|
+
this._options.agent = this._options.agents[scheme];
|
|
1242
|
+
}
|
|
1243
|
+
var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse);
|
|
1244
|
+
request._redirectable = this;
|
|
1245
|
+
for (var event of events) {
|
|
1246
|
+
request.on(event, eventHandlers[event]);
|
|
1247
|
+
}
|
|
1248
|
+
this._currentUrl = /^\//.test(this._options.path) ? url2.format(this._options) : (
|
|
1249
|
+
// When making a request to a proxy, […]
|
|
1250
|
+
// a client MUST send the target URI in absolute-form […].
|
|
1251
|
+
this._options.path
|
|
1252
|
+
);
|
|
1253
|
+
if (this._isRedirect) {
|
|
1254
|
+
var i = 0;
|
|
1255
|
+
var self2 = this;
|
|
1256
|
+
var buffers = this._requestBodyBuffers;
|
|
1257
|
+
(function writeNext(error) {
|
|
1258
|
+
if (request === self2._currentRequest) {
|
|
1259
|
+
if (error) {
|
|
1260
|
+
self2.emit("error", error);
|
|
1261
|
+
} else if (i < buffers.length) {
|
|
1262
|
+
var buffer = buffers[i++];
|
|
1263
|
+
if (!request.finished) {
|
|
1264
|
+
request.write(buffer.data, buffer.encoding, writeNext);
|
|
1265
|
+
}
|
|
1266
|
+
} else if (self2._ended) {
|
|
1267
|
+
request.end();
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
})();
|
|
1271
|
+
}
|
|
1272
|
+
};
|
|
1273
|
+
RedirectableRequest.prototype._processResponse = function(response) {
|
|
1274
|
+
var statusCode = response.statusCode;
|
|
1275
|
+
if (this._options.trackRedirects) {
|
|
1276
|
+
this._redirects.push({
|
|
1277
|
+
url: this._currentUrl,
|
|
1278
|
+
headers: response.headers,
|
|
1279
|
+
statusCode
|
|
1280
|
+
});
|
|
1281
|
+
}
|
|
1282
|
+
var location = response.headers.location;
|
|
1283
|
+
if (!location || this._options.followRedirects === false || statusCode < 300 || statusCode >= 400) {
|
|
1284
|
+
response.responseUrl = this._currentUrl;
|
|
1285
|
+
response.redirects = this._redirects;
|
|
1286
|
+
this.emit("response", response);
|
|
1287
|
+
this._requestBodyBuffers = [];
|
|
1288
|
+
return;
|
|
1289
|
+
}
|
|
1290
|
+
abortRequest(this._currentRequest);
|
|
1291
|
+
response.destroy();
|
|
1292
|
+
if (++this._redirectCount > this._options.maxRedirects) {
|
|
1293
|
+
this.emit("error", new TooManyRedirectsError());
|
|
1294
|
+
return;
|
|
1295
|
+
}
|
|
1296
|
+
var requestHeaders;
|
|
1297
|
+
var beforeRedirect = this._options.beforeRedirect;
|
|
1298
|
+
if (beforeRedirect) {
|
|
1299
|
+
requestHeaders = Object.assign({
|
|
1300
|
+
// The Host header was set by nativeProtocol.request
|
|
1301
|
+
Host: response.req.getHeader("host")
|
|
1302
|
+
}, this._options.headers);
|
|
1303
|
+
}
|
|
1304
|
+
var method = this._options.method;
|
|
1305
|
+
if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || // RFC7231§6.4.4: The 303 (See Other) status code indicates that
|
|
1306
|
+
// the server is redirecting the user agent to a different resource […]
|
|
1307
|
+
// A user agent can perform a retrieval request targeting that URI
|
|
1308
|
+
// (a GET or HEAD request if using HTTP) […]
|
|
1309
|
+
statusCode === 303 && !/^(?:GET|HEAD)$/.test(this._options.method)) {
|
|
1310
|
+
this._options.method = "GET";
|
|
1311
|
+
this._requestBodyBuffers = [];
|
|
1312
|
+
removeMatchingHeaders(/^content-/i, this._options.headers);
|
|
1313
|
+
}
|
|
1314
|
+
var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
|
|
1315
|
+
var currentUrlParts = url2.parse(this._currentUrl);
|
|
1316
|
+
var currentHost = currentHostHeader || currentUrlParts.host;
|
|
1317
|
+
var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url2.format(Object.assign(currentUrlParts, { host: currentHost }));
|
|
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);
|
|
1326
|
+
this._isRedirect = true;
|
|
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);
|
|
1331
|
+
}
|
|
1332
|
+
if (isFunction2(beforeRedirect)) {
|
|
1333
|
+
var responseDetails = {
|
|
1334
|
+
headers: response.headers,
|
|
1335
|
+
statusCode
|
|
1336
|
+
};
|
|
1337
|
+
var requestDetails = {
|
|
1338
|
+
url: currentUrl,
|
|
1339
|
+
method,
|
|
1340
|
+
headers: requestHeaders
|
|
1341
|
+
};
|
|
1342
|
+
try {
|
|
1343
|
+
beforeRedirect(this._options, responseDetails, requestDetails);
|
|
1344
|
+
} catch (err) {
|
|
1345
|
+
this.emit("error", err);
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1348
|
+
this._sanitizeOptions(this._options);
|
|
1349
|
+
}
|
|
1350
|
+
try {
|
|
1351
|
+
this._performRequest();
|
|
1352
|
+
} catch (cause) {
|
|
1353
|
+
this.emit("error", new RedirectionError({ cause }));
|
|
1354
|
+
}
|
|
1355
|
+
};
|
|
1356
|
+
function wrap(protocols) {
|
|
1357
|
+
var exports3 = {
|
|
1358
|
+
maxRedirects: 21,
|
|
1359
|
+
maxBodyLength: 10 * 1024 * 1024
|
|
1360
|
+
};
|
|
1361
|
+
var nativeProtocols = {};
|
|
1362
|
+
Object.keys(protocols).forEach(function(scheme) {
|
|
1363
|
+
var protocol = scheme + ":";
|
|
1364
|
+
var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
|
|
1365
|
+
var wrappedProtocol = exports3[scheme] = Object.create(nativeProtocol);
|
|
1366
|
+
function request(input, options, callback) {
|
|
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);
|
|
1380
|
+
} else {
|
|
1381
|
+
callback = options;
|
|
1382
|
+
options = input;
|
|
1383
|
+
input = { protocol };
|
|
1384
|
+
}
|
|
1385
|
+
if (isFunction2(options)) {
|
|
1386
|
+
callback = options;
|
|
1387
|
+
options = null;
|
|
1388
|
+
}
|
|
1389
|
+
options = Object.assign({
|
|
1390
|
+
maxRedirects: exports3.maxRedirects,
|
|
1391
|
+
maxBodyLength: exports3.maxBodyLength
|
|
1392
|
+
}, input, options);
|
|
1393
|
+
options.nativeProtocols = nativeProtocols;
|
|
1394
|
+
if (!isString2(options.host) && !isString2(options.hostname)) {
|
|
1395
|
+
options.hostname = "::1";
|
|
1396
|
+
}
|
|
1397
|
+
assert.equal(options.protocol, protocol, "protocol mismatch");
|
|
1398
|
+
debug("options", options);
|
|
1399
|
+
return new RedirectableRequest(options, callback);
|
|
1400
|
+
}
|
|
1401
|
+
function get(input, options, callback) {
|
|
1402
|
+
var wrappedRequest = wrappedProtocol.request(input, options, callback);
|
|
1403
|
+
wrappedRequest.end();
|
|
1404
|
+
return wrappedRequest;
|
|
1405
|
+
}
|
|
1406
|
+
Object.defineProperties(wrappedProtocol, {
|
|
1407
|
+
request: { value: request, configurable: true, enumerable: true, writable: true },
|
|
1408
|
+
get: { value: get, configurable: true, enumerable: true, writable: true }
|
|
1409
|
+
});
|
|
1410
|
+
});
|
|
1411
|
+
return exports3;
|
|
1412
|
+
}
|
|
1413
|
+
function noop2() {
|
|
1414
|
+
}
|
|
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);
|
|
1430
|
+
}
|
|
1431
|
+
return options;
|
|
1432
|
+
}
|
|
1433
|
+
function removeMatchingHeaders(regex, headers) {
|
|
1434
|
+
var lastValue;
|
|
1435
|
+
for (var header in headers) {
|
|
1436
|
+
if (regex.test(header)) {
|
|
1437
|
+
lastValue = headers[header];
|
|
1438
|
+
delete headers[header];
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
return lastValue === null || typeof lastValue === "undefined" ? void 0 : String(lastValue).trim();
|
|
1442
|
+
}
|
|
1443
|
+
function createErrorType(code, message, baseClass) {
|
|
1444
|
+
function CustomError(properties) {
|
|
1445
|
+
Error.captureStackTrace(this, this.constructor);
|
|
1446
|
+
Object.assign(this, properties || {});
|
|
1447
|
+
this.code = code;
|
|
1448
|
+
this.message = this.cause ? message + ": " + this.cause.message : message;
|
|
1449
|
+
}
|
|
1450
|
+
CustomError.prototype = new (baseClass || Error)();
|
|
1451
|
+
CustomError.prototype.constructor = CustomError;
|
|
1452
|
+
CustomError.prototype.name = "Error [" + code + "]";
|
|
1453
|
+
return CustomError;
|
|
1454
|
+
}
|
|
1455
|
+
function abortRequest(request) {
|
|
1456
|
+
for (var event of events) {
|
|
1457
|
+
request.removeListener(event, eventHandlers[event]);
|
|
1458
|
+
}
|
|
1459
|
+
request.on("error", noop2);
|
|
1460
|
+
request.abort();
|
|
1461
|
+
}
|
|
1462
|
+
function isSubdomain(subdomain, domain) {
|
|
1463
|
+
assert(isString2(subdomain) && isString2(domain));
|
|
1464
|
+
var dot = subdomain.length - domain.length - 1;
|
|
1465
|
+
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
|
|
1466
|
+
}
|
|
1467
|
+
function isString2(value) {
|
|
1468
|
+
return typeof value === "string" || value instanceof String;
|
|
1469
|
+
}
|
|
1470
|
+
function isFunction2(value) {
|
|
1471
|
+
return typeof value === "function";
|
|
1472
|
+
}
|
|
1473
|
+
function isBuffer2(value) {
|
|
1474
|
+
return typeof value === "object" && "length" in value;
|
|
1475
|
+
}
|
|
1476
|
+
module2.exports = wrap({ http: http2, https: https2 });
|
|
1477
|
+
module2.exports.wrap = wrap;
|
|
1478
|
+
}
|
|
1479
|
+
});
|
|
1480
|
+
|
|
363
1481
|
// bin/index.ts
|
|
364
1482
|
var import_dotenv = __toESM(require_main());
|
|
365
1483
|
var import_commander = require("commander");
|
|
366
|
-
var
|
|
367
|
-
var
|
|
1484
|
+
var import_chalk6 = __toESM(require("chalk"));
|
|
1485
|
+
var import_figlet3 = __toESM(require("figlet"));
|
|
1486
|
+
|
|
1487
|
+
// package.json
|
|
1488
|
+
var version = "1.1.1";
|
|
1489
|
+
|
|
1490
|
+
// bin/upload.ts
|
|
1491
|
+
var import_path5 = __toESM(require("path"));
|
|
1492
|
+
var import_chalk3 = __toESM(require("chalk"));
|
|
1493
|
+
var import_inquirer = __toESM(require("inquirer"));
|
|
1494
|
+
var import_figlet = __toESM(require("figlet"));
|
|
1495
|
+
|
|
1496
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/bind.js
|
|
1497
|
+
function bind(fn, thisArg) {
|
|
1498
|
+
return function wrap() {
|
|
1499
|
+
return fn.apply(thisArg, arguments);
|
|
1500
|
+
};
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/utils.js
|
|
1504
|
+
var { toString } = Object.prototype;
|
|
1505
|
+
var { getPrototypeOf } = Object;
|
|
1506
|
+
var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
|
|
1507
|
+
const str = toString.call(thing);
|
|
1508
|
+
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
1509
|
+
})(/* @__PURE__ */ Object.create(null));
|
|
1510
|
+
var kindOfTest = (type) => {
|
|
1511
|
+
type = type.toLowerCase();
|
|
1512
|
+
return (thing) => kindOf(thing) === type;
|
|
1513
|
+
};
|
|
1514
|
+
var typeOfTest = (type) => (thing) => typeof thing === type;
|
|
1515
|
+
var { isArray } = Array;
|
|
1516
|
+
var isUndefined = typeOfTest("undefined");
|
|
1517
|
+
function isBuffer(val) {
|
|
1518
|
+
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
1519
|
+
}
|
|
1520
|
+
var isArrayBuffer = kindOfTest("ArrayBuffer");
|
|
1521
|
+
function isArrayBufferView(val) {
|
|
1522
|
+
let result;
|
|
1523
|
+
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
1524
|
+
result = ArrayBuffer.isView(val);
|
|
1525
|
+
} else {
|
|
1526
|
+
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
1527
|
+
}
|
|
1528
|
+
return result;
|
|
1529
|
+
}
|
|
1530
|
+
var isString = typeOfTest("string");
|
|
1531
|
+
var isFunction = typeOfTest("function");
|
|
1532
|
+
var isNumber = typeOfTest("number");
|
|
1533
|
+
var isObject = (thing) => thing !== null && typeof thing === "object";
|
|
1534
|
+
var isBoolean = (thing) => thing === true || thing === false;
|
|
1535
|
+
var isPlainObject = (val) => {
|
|
1536
|
+
if (kindOf(val) !== "object") {
|
|
1537
|
+
return false;
|
|
1538
|
+
}
|
|
1539
|
+
const prototype3 = getPrototypeOf(val);
|
|
1540
|
+
return (prototype3 === null || prototype3 === Object.prototype || Object.getPrototypeOf(prototype3) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
|
|
1541
|
+
};
|
|
1542
|
+
var isDate = kindOfTest("Date");
|
|
1543
|
+
var isFile = kindOfTest("File");
|
|
1544
|
+
var isBlob = kindOfTest("Blob");
|
|
1545
|
+
var isFileList = kindOfTest("FileList");
|
|
1546
|
+
var isStream = (val) => isObject(val) && isFunction(val.pipe);
|
|
1547
|
+
var isFormData = (thing) => {
|
|
1548
|
+
const pattern = "[object FormData]";
|
|
1549
|
+
return thing && (typeof FormData === "function" && thing instanceof FormData || toString.call(thing) === pattern || isFunction(thing.toString) && thing.toString() === pattern);
|
|
1550
|
+
};
|
|
1551
|
+
var isURLSearchParams = kindOfTest("URLSearchParams");
|
|
1552
|
+
var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
1553
|
+
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
1554
|
+
if (obj === null || typeof obj === "undefined") {
|
|
1555
|
+
return;
|
|
1556
|
+
}
|
|
1557
|
+
let i;
|
|
1558
|
+
let l;
|
|
1559
|
+
if (typeof obj !== "object") {
|
|
1560
|
+
obj = [obj];
|
|
1561
|
+
}
|
|
1562
|
+
if (isArray(obj)) {
|
|
1563
|
+
for (i = 0, l = obj.length; i < l; i++) {
|
|
1564
|
+
fn.call(null, obj[i], i, obj);
|
|
1565
|
+
}
|
|
1566
|
+
} else {
|
|
1567
|
+
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
1568
|
+
const len = keys.length;
|
|
1569
|
+
let key;
|
|
1570
|
+
for (i = 0; i < len; i++) {
|
|
1571
|
+
key = keys[i];
|
|
1572
|
+
fn.call(null, obj[key], key, obj);
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
function findKey(obj, key) {
|
|
1577
|
+
key = key.toLowerCase();
|
|
1578
|
+
const keys = Object.keys(obj);
|
|
1579
|
+
let i = keys.length;
|
|
1580
|
+
let _key;
|
|
1581
|
+
while (i-- > 0) {
|
|
1582
|
+
_key = keys[i];
|
|
1583
|
+
if (key === _key.toLowerCase()) {
|
|
1584
|
+
return _key;
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
return null;
|
|
1588
|
+
}
|
|
1589
|
+
var _global = (() => {
|
|
1590
|
+
if (typeof globalThis !== "undefined") return globalThis;
|
|
1591
|
+
return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
|
|
1592
|
+
})();
|
|
1593
|
+
var isContextDefined = (context) => !isUndefined(context) && context !== _global;
|
|
1594
|
+
function merge() {
|
|
1595
|
+
const { caseless } = isContextDefined(this) && this || {};
|
|
1596
|
+
const result = {};
|
|
1597
|
+
const assignValue = (val, key) => {
|
|
1598
|
+
const targetKey = caseless && findKey(result, key) || key;
|
|
1599
|
+
if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
|
|
1600
|
+
result[targetKey] = merge(result[targetKey], val);
|
|
1601
|
+
} else if (isPlainObject(val)) {
|
|
1602
|
+
result[targetKey] = merge({}, val);
|
|
1603
|
+
} else if (isArray(val)) {
|
|
1604
|
+
result[targetKey] = val.slice();
|
|
1605
|
+
} else {
|
|
1606
|
+
result[targetKey] = val;
|
|
1607
|
+
}
|
|
1608
|
+
};
|
|
1609
|
+
for (let i = 0, l = arguments.length; i < l; i++) {
|
|
1610
|
+
arguments[i] && forEach(arguments[i], assignValue);
|
|
1611
|
+
}
|
|
1612
|
+
return result;
|
|
1613
|
+
}
|
|
1614
|
+
var extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
1615
|
+
forEach(b, (val, key) => {
|
|
1616
|
+
if (thisArg && isFunction(val)) {
|
|
1617
|
+
a[key] = bind(val, thisArg);
|
|
1618
|
+
} else {
|
|
1619
|
+
a[key] = val;
|
|
1620
|
+
}
|
|
1621
|
+
}, { allOwnKeys });
|
|
1622
|
+
return a;
|
|
1623
|
+
};
|
|
1624
|
+
var stripBOM = (content) => {
|
|
1625
|
+
if (content.charCodeAt(0) === 65279) {
|
|
1626
|
+
content = content.slice(1);
|
|
1627
|
+
}
|
|
1628
|
+
return content;
|
|
1629
|
+
};
|
|
1630
|
+
var inherits = (constructor, superConstructor, props, descriptors2) => {
|
|
1631
|
+
constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
|
|
1632
|
+
constructor.prototype.constructor = constructor;
|
|
1633
|
+
Object.defineProperty(constructor, "super", {
|
|
1634
|
+
value: superConstructor.prototype
|
|
1635
|
+
});
|
|
1636
|
+
props && Object.assign(constructor.prototype, props);
|
|
1637
|
+
};
|
|
1638
|
+
var toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
|
|
1639
|
+
let props;
|
|
1640
|
+
let i;
|
|
1641
|
+
let prop;
|
|
1642
|
+
const merged = {};
|
|
1643
|
+
destObj = destObj || {};
|
|
1644
|
+
if (sourceObj == null) return destObj;
|
|
1645
|
+
do {
|
|
1646
|
+
props = Object.getOwnPropertyNames(sourceObj);
|
|
1647
|
+
i = props.length;
|
|
1648
|
+
while (i-- > 0) {
|
|
1649
|
+
prop = props[i];
|
|
1650
|
+
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
|
|
1651
|
+
destObj[prop] = sourceObj[prop];
|
|
1652
|
+
merged[prop] = true;
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
|
|
1656
|
+
} while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
1657
|
+
return destObj;
|
|
1658
|
+
};
|
|
1659
|
+
var endsWith = (str, searchString, position) => {
|
|
1660
|
+
str = String(str);
|
|
1661
|
+
if (position === void 0 || position > str.length) {
|
|
1662
|
+
position = str.length;
|
|
1663
|
+
}
|
|
1664
|
+
position -= searchString.length;
|
|
1665
|
+
const lastIndex = str.indexOf(searchString, position);
|
|
1666
|
+
return lastIndex !== -1 && lastIndex === position;
|
|
1667
|
+
};
|
|
1668
|
+
var toArray = (thing) => {
|
|
1669
|
+
if (!thing) return null;
|
|
1670
|
+
if (isArray(thing)) return thing;
|
|
1671
|
+
let i = thing.length;
|
|
1672
|
+
if (!isNumber(i)) return null;
|
|
1673
|
+
const arr = new Array(i);
|
|
1674
|
+
while (i-- > 0) {
|
|
1675
|
+
arr[i] = thing[i];
|
|
1676
|
+
}
|
|
1677
|
+
return arr;
|
|
1678
|
+
};
|
|
1679
|
+
var isTypedArray = /* @__PURE__ */ ((TypedArray) => {
|
|
1680
|
+
return (thing) => {
|
|
1681
|
+
return TypedArray && thing instanceof TypedArray;
|
|
1682
|
+
};
|
|
1683
|
+
})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
|
|
1684
|
+
var forEachEntry = (obj, fn) => {
|
|
1685
|
+
const generator = obj && obj[Symbol.iterator];
|
|
1686
|
+
const iterator = generator.call(obj);
|
|
1687
|
+
let result;
|
|
1688
|
+
while ((result = iterator.next()) && !result.done) {
|
|
1689
|
+
const pair = result.value;
|
|
1690
|
+
fn.call(obj, pair[0], pair[1]);
|
|
1691
|
+
}
|
|
1692
|
+
};
|
|
1693
|
+
var matchAll = (regExp, str) => {
|
|
1694
|
+
let matches;
|
|
1695
|
+
const arr = [];
|
|
1696
|
+
while ((matches = regExp.exec(str)) !== null) {
|
|
1697
|
+
arr.push(matches);
|
|
1698
|
+
}
|
|
1699
|
+
return arr;
|
|
1700
|
+
};
|
|
1701
|
+
var isHTMLForm = kindOfTest("HTMLFormElement");
|
|
1702
|
+
var toCamelCase = (str) => {
|
|
1703
|
+
return str.toLowerCase().replace(
|
|
1704
|
+
/[-_\s]([a-z\d])(\w*)/g,
|
|
1705
|
+
function replacer(m, p1, p2) {
|
|
1706
|
+
return p1.toUpperCase() + p2;
|
|
1707
|
+
}
|
|
1708
|
+
);
|
|
1709
|
+
};
|
|
1710
|
+
var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
|
|
1711
|
+
var isRegExp = kindOfTest("RegExp");
|
|
1712
|
+
var reduceDescriptors = (obj, reducer) => {
|
|
1713
|
+
const descriptors2 = Object.getOwnPropertyDescriptors(obj);
|
|
1714
|
+
const reducedDescriptors = {};
|
|
1715
|
+
forEach(descriptors2, (descriptor, name) => {
|
|
1716
|
+
if (reducer(descriptor, name, obj) !== false) {
|
|
1717
|
+
reducedDescriptors[name] = descriptor;
|
|
1718
|
+
}
|
|
1719
|
+
});
|
|
1720
|
+
Object.defineProperties(obj, reducedDescriptors);
|
|
1721
|
+
};
|
|
1722
|
+
var freezeMethods = (obj) => {
|
|
1723
|
+
reduceDescriptors(obj, (descriptor, name) => {
|
|
1724
|
+
if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
|
|
1725
|
+
return false;
|
|
1726
|
+
}
|
|
1727
|
+
const value = obj[name];
|
|
1728
|
+
if (!isFunction(value)) return;
|
|
1729
|
+
descriptor.enumerable = false;
|
|
1730
|
+
if ("writable" in descriptor) {
|
|
1731
|
+
descriptor.writable = false;
|
|
1732
|
+
return;
|
|
1733
|
+
}
|
|
1734
|
+
if (!descriptor.set) {
|
|
1735
|
+
descriptor.set = () => {
|
|
1736
|
+
throw Error("Can not rewrite read-only method '" + name + "'");
|
|
1737
|
+
};
|
|
1738
|
+
}
|
|
1739
|
+
});
|
|
1740
|
+
};
|
|
1741
|
+
var toObjectSet = (arrayOrString, delimiter) => {
|
|
1742
|
+
const obj = {};
|
|
1743
|
+
const define = (arr) => {
|
|
1744
|
+
arr.forEach((value) => {
|
|
1745
|
+
obj[value] = true;
|
|
1746
|
+
});
|
|
1747
|
+
};
|
|
1748
|
+
isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
|
|
1749
|
+
return obj;
|
|
1750
|
+
};
|
|
1751
|
+
var noop = () => {
|
|
1752
|
+
};
|
|
1753
|
+
var toFiniteNumber = (value, defaultValue) => {
|
|
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;
|
|
1771
|
+
};
|
|
1772
|
+
function isSpecCompliantForm(thing) {
|
|
1773
|
+
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
|
|
1774
|
+
}
|
|
1775
|
+
var toJSONObject = (obj) => {
|
|
1776
|
+
const stack = new Array(10);
|
|
1777
|
+
const visit = (source, i) => {
|
|
1778
|
+
if (isObject(source)) {
|
|
1779
|
+
if (stack.indexOf(source) >= 0) {
|
|
1780
|
+
return;
|
|
1781
|
+
}
|
|
1782
|
+
if (!("toJSON" in source)) {
|
|
1783
|
+
stack[i] = source;
|
|
1784
|
+
const target = isArray(source) ? [] : {};
|
|
1785
|
+
forEach(source, (value, key) => {
|
|
1786
|
+
const reducedValue = visit(value, i + 1);
|
|
1787
|
+
!isUndefined(reducedValue) && (target[key] = reducedValue);
|
|
1788
|
+
});
|
|
1789
|
+
stack[i] = void 0;
|
|
1790
|
+
return target;
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
return source;
|
|
1794
|
+
};
|
|
1795
|
+
return visit(obj, 0);
|
|
1796
|
+
};
|
|
1797
|
+
var utils_default = {
|
|
1798
|
+
isArray,
|
|
1799
|
+
isArrayBuffer,
|
|
1800
|
+
isBuffer,
|
|
1801
|
+
isFormData,
|
|
1802
|
+
isArrayBufferView,
|
|
1803
|
+
isString,
|
|
1804
|
+
isNumber,
|
|
1805
|
+
isBoolean,
|
|
1806
|
+
isObject,
|
|
1807
|
+
isPlainObject,
|
|
1808
|
+
isUndefined,
|
|
1809
|
+
isDate,
|
|
1810
|
+
isFile,
|
|
1811
|
+
isBlob,
|
|
1812
|
+
isRegExp,
|
|
1813
|
+
isFunction,
|
|
1814
|
+
isStream,
|
|
1815
|
+
isURLSearchParams,
|
|
1816
|
+
isTypedArray,
|
|
1817
|
+
isFileList,
|
|
1818
|
+
forEach,
|
|
1819
|
+
merge,
|
|
1820
|
+
extend,
|
|
1821
|
+
trim,
|
|
1822
|
+
stripBOM,
|
|
1823
|
+
inherits,
|
|
1824
|
+
toFlatObject,
|
|
1825
|
+
kindOf,
|
|
1826
|
+
kindOfTest,
|
|
1827
|
+
endsWith,
|
|
1828
|
+
toArray,
|
|
1829
|
+
forEachEntry,
|
|
1830
|
+
matchAll,
|
|
1831
|
+
isHTMLForm,
|
|
1832
|
+
hasOwnProperty,
|
|
1833
|
+
hasOwnProp: hasOwnProperty,
|
|
1834
|
+
// an alias to avoid ESLint no-prototype-builtins detection
|
|
1835
|
+
reduceDescriptors,
|
|
1836
|
+
freezeMethods,
|
|
1837
|
+
toObjectSet,
|
|
1838
|
+
toCamelCase,
|
|
1839
|
+
noop,
|
|
1840
|
+
toFiniteNumber,
|
|
1841
|
+
findKey,
|
|
1842
|
+
global: _global,
|
|
1843
|
+
isContextDefined,
|
|
1844
|
+
ALPHABET,
|
|
1845
|
+
generateString,
|
|
1846
|
+
isSpecCompliantForm,
|
|
1847
|
+
toJSONObject
|
|
1848
|
+
};
|
|
1849
|
+
|
|
1850
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/core/AxiosError.js
|
|
1851
|
+
function AxiosError(message, code, config, request, response) {
|
|
1852
|
+
Error.call(this);
|
|
1853
|
+
if (Error.captureStackTrace) {
|
|
1854
|
+
Error.captureStackTrace(this, this.constructor);
|
|
1855
|
+
} else {
|
|
1856
|
+
this.stack = new Error().stack;
|
|
1857
|
+
}
|
|
1858
|
+
this.message = message;
|
|
1859
|
+
this.name = "AxiosError";
|
|
1860
|
+
code && (this.code = code);
|
|
1861
|
+
config && (this.config = config);
|
|
1862
|
+
request && (this.request = request);
|
|
1863
|
+
response && (this.response = response);
|
|
1864
|
+
}
|
|
1865
|
+
utils_default.inherits(AxiosError, Error, {
|
|
1866
|
+
toJSON: function toJSON() {
|
|
1867
|
+
return {
|
|
1868
|
+
// Standard
|
|
1869
|
+
message: this.message,
|
|
1870
|
+
name: this.name,
|
|
1871
|
+
// Microsoft
|
|
1872
|
+
description: this.description,
|
|
1873
|
+
number: this.number,
|
|
1874
|
+
// Mozilla
|
|
1875
|
+
fileName: this.fileName,
|
|
1876
|
+
lineNumber: this.lineNumber,
|
|
1877
|
+
columnNumber: this.columnNumber,
|
|
1878
|
+
stack: this.stack,
|
|
1879
|
+
// Axios
|
|
1880
|
+
config: utils_default.toJSONObject(this.config),
|
|
1881
|
+
code: this.code,
|
|
1882
|
+
status: this.response && this.response.status ? this.response.status : null
|
|
1883
|
+
};
|
|
1884
|
+
}
|
|
1885
|
+
});
|
|
1886
|
+
var prototype = AxiosError.prototype;
|
|
1887
|
+
var descriptors = {};
|
|
1888
|
+
[
|
|
1889
|
+
"ERR_BAD_OPTION_VALUE",
|
|
1890
|
+
"ERR_BAD_OPTION",
|
|
1891
|
+
"ECONNABORTED",
|
|
1892
|
+
"ETIMEDOUT",
|
|
1893
|
+
"ERR_NETWORK",
|
|
1894
|
+
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
1895
|
+
"ERR_DEPRECATED",
|
|
1896
|
+
"ERR_BAD_RESPONSE",
|
|
1897
|
+
"ERR_BAD_REQUEST",
|
|
1898
|
+
"ERR_CANCELED",
|
|
1899
|
+
"ERR_NOT_SUPPORT",
|
|
1900
|
+
"ERR_INVALID_URL"
|
|
1901
|
+
// eslint-disable-next-line func-names
|
|
1902
|
+
].forEach((code) => {
|
|
1903
|
+
descriptors[code] = { value: code };
|
|
1904
|
+
});
|
|
1905
|
+
Object.defineProperties(AxiosError, descriptors);
|
|
1906
|
+
Object.defineProperty(prototype, "isAxiosError", { value: true });
|
|
1907
|
+
AxiosError.from = (error, code, config, request, response, customProps) => {
|
|
1908
|
+
const axiosError = Object.create(prototype);
|
|
1909
|
+
utils_default.toFlatObject(error, axiosError, function filter2(obj) {
|
|
1910
|
+
return obj !== Error.prototype;
|
|
1911
|
+
}, (prop) => {
|
|
1912
|
+
return prop !== "isAxiosError";
|
|
1913
|
+
});
|
|
1914
|
+
AxiosError.call(axiosError, error.message, code, config, request, response);
|
|
1915
|
+
axiosError.cause = error;
|
|
1916
|
+
axiosError.name = error.name;
|
|
1917
|
+
customProps && Object.assign(axiosError, customProps);
|
|
1918
|
+
return axiosError;
|
|
1919
|
+
};
|
|
1920
|
+
var AxiosError_default = AxiosError;
|
|
1921
|
+
|
|
1922
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/platform/node/classes/FormData.js
|
|
1923
|
+
var import_form_data = __toESM(require("form-data"), 1);
|
|
1924
|
+
var FormData_default = import_form_data.default;
|
|
1925
|
+
|
|
1926
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/toFormData.js
|
|
1927
|
+
function isVisitable(thing) {
|
|
1928
|
+
return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
|
|
1929
|
+
}
|
|
1930
|
+
function removeBrackets(key) {
|
|
1931
|
+
return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
1932
|
+
}
|
|
1933
|
+
function renderKey(path6, key, dots) {
|
|
1934
|
+
if (!path6) return key;
|
|
1935
|
+
return path6.concat(key).map(function each(token, i) {
|
|
1936
|
+
token = removeBrackets(token);
|
|
1937
|
+
return !dots && i ? "[" + token + "]" : token;
|
|
1938
|
+
}).join(dots ? "." : "");
|
|
1939
|
+
}
|
|
1940
|
+
function isFlatArray(arr) {
|
|
1941
|
+
return utils_default.isArray(arr) && !arr.some(isVisitable);
|
|
1942
|
+
}
|
|
1943
|
+
var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) {
|
|
1944
|
+
return /^is[A-Z]/.test(prop);
|
|
1945
|
+
});
|
|
1946
|
+
function toFormData(obj, formData, options) {
|
|
1947
|
+
if (!utils_default.isObject(obj)) {
|
|
1948
|
+
throw new TypeError("target must be an object");
|
|
1949
|
+
}
|
|
1950
|
+
formData = formData || new (FormData_default || FormData)();
|
|
1951
|
+
options = utils_default.toFlatObject(options, {
|
|
1952
|
+
metaTokens: true,
|
|
1953
|
+
dots: false,
|
|
1954
|
+
indexes: false
|
|
1955
|
+
}, false, function defined(option, source) {
|
|
1956
|
+
return !utils_default.isUndefined(source[option]);
|
|
1957
|
+
});
|
|
1958
|
+
const metaTokens = options.metaTokens;
|
|
1959
|
+
const visitor = options.visitor || defaultVisitor;
|
|
1960
|
+
const dots = options.dots;
|
|
1961
|
+
const indexes = options.indexes;
|
|
1962
|
+
const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
|
|
1963
|
+
const useBlob = _Blob && utils_default.isSpecCompliantForm(formData);
|
|
1964
|
+
if (!utils_default.isFunction(visitor)) {
|
|
1965
|
+
throw new TypeError("visitor must be a function");
|
|
1966
|
+
}
|
|
1967
|
+
function convertValue(value) {
|
|
1968
|
+
if (value === null) return "";
|
|
1969
|
+
if (utils_default.isDate(value)) {
|
|
1970
|
+
return value.toISOString();
|
|
1971
|
+
}
|
|
1972
|
+
if (!useBlob && utils_default.isBlob(value)) {
|
|
1973
|
+
throw new AxiosError_default("Blob is not supported. Use a Buffer instead.");
|
|
1974
|
+
}
|
|
1975
|
+
if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) {
|
|
1976
|
+
return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
|
|
1977
|
+
}
|
|
1978
|
+
return value;
|
|
1979
|
+
}
|
|
1980
|
+
function defaultVisitor(value, key, path6) {
|
|
1981
|
+
let arr = value;
|
|
1982
|
+
if (value && !path6 && typeof value === "object") {
|
|
1983
|
+
if (utils_default.endsWith(key, "{}")) {
|
|
1984
|
+
key = metaTokens ? key : key.slice(0, -2);
|
|
1985
|
+
value = JSON.stringify(value);
|
|
1986
|
+
} else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) {
|
|
1987
|
+
key = removeBrackets(key);
|
|
1988
|
+
arr.forEach(function each(el, index) {
|
|
1989
|
+
!(utils_default.isUndefined(el) || el === null) && formData.append(
|
|
1990
|
+
// eslint-disable-next-line no-nested-ternary
|
|
1991
|
+
indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
|
|
1992
|
+
convertValue(el)
|
|
1993
|
+
);
|
|
1994
|
+
});
|
|
1995
|
+
return false;
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
if (isVisitable(value)) {
|
|
1999
|
+
return true;
|
|
2000
|
+
}
|
|
2001
|
+
formData.append(renderKey(path6, key, dots), convertValue(value));
|
|
2002
|
+
return false;
|
|
2003
|
+
}
|
|
2004
|
+
const stack = [];
|
|
2005
|
+
const exposedHelpers = Object.assign(predicates, {
|
|
2006
|
+
defaultVisitor,
|
|
2007
|
+
convertValue,
|
|
2008
|
+
isVisitable
|
|
2009
|
+
});
|
|
2010
|
+
function build(value, path6) {
|
|
2011
|
+
if (utils_default.isUndefined(value)) return;
|
|
2012
|
+
if (stack.indexOf(value) !== -1) {
|
|
2013
|
+
throw Error("Circular reference detected in " + path6.join("."));
|
|
2014
|
+
}
|
|
2015
|
+
stack.push(value);
|
|
2016
|
+
utils_default.forEach(value, function each(el, key) {
|
|
2017
|
+
const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(
|
|
2018
|
+
formData,
|
|
2019
|
+
el,
|
|
2020
|
+
utils_default.isString(key) ? key.trim() : key,
|
|
2021
|
+
path6,
|
|
2022
|
+
exposedHelpers
|
|
2023
|
+
);
|
|
2024
|
+
if (result === true) {
|
|
2025
|
+
build(el, path6 ? path6.concat(key) : [key]);
|
|
2026
|
+
}
|
|
2027
|
+
});
|
|
2028
|
+
stack.pop();
|
|
2029
|
+
}
|
|
2030
|
+
if (!utils_default.isObject(obj)) {
|
|
2031
|
+
throw new TypeError("data must be an object");
|
|
2032
|
+
}
|
|
2033
|
+
build(obj);
|
|
2034
|
+
return formData;
|
|
2035
|
+
}
|
|
2036
|
+
var toFormData_default = toFormData;
|
|
2037
|
+
|
|
2038
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
|
|
2039
|
+
function encode(str) {
|
|
2040
|
+
const charMap = {
|
|
2041
|
+
"!": "%21",
|
|
2042
|
+
"'": "%27",
|
|
2043
|
+
"(": "%28",
|
|
2044
|
+
")": "%29",
|
|
2045
|
+
"~": "%7E",
|
|
2046
|
+
"%20": "+",
|
|
2047
|
+
"%00": "\0"
|
|
2048
|
+
};
|
|
2049
|
+
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
|
|
2050
|
+
return charMap[match];
|
|
2051
|
+
});
|
|
2052
|
+
}
|
|
2053
|
+
function AxiosURLSearchParams(params, options) {
|
|
2054
|
+
this._pairs = [];
|
|
2055
|
+
params && toFormData_default(params, this, options);
|
|
2056
|
+
}
|
|
2057
|
+
var prototype2 = AxiosURLSearchParams.prototype;
|
|
2058
|
+
prototype2.append = function append(name, value) {
|
|
2059
|
+
this._pairs.push([name, value]);
|
|
2060
|
+
};
|
|
2061
|
+
prototype2.toString = function toString2(encoder) {
|
|
2062
|
+
const _encode = encoder ? function(value) {
|
|
2063
|
+
return encoder.call(this, value, encode);
|
|
2064
|
+
} : encode;
|
|
2065
|
+
return this._pairs.map(function each(pair) {
|
|
2066
|
+
return _encode(pair[0]) + "=" + _encode(pair[1]);
|
|
2067
|
+
}, "").join("&");
|
|
2068
|
+
};
|
|
2069
|
+
var AxiosURLSearchParams_default = AxiosURLSearchParams;
|
|
2070
|
+
|
|
2071
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/buildURL.js
|
|
2072
|
+
function encode2(val) {
|
|
2073
|
+
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
2074
|
+
}
|
|
2075
|
+
function buildURL(url2, params, options) {
|
|
2076
|
+
if (!params) {
|
|
2077
|
+
return url2;
|
|
2078
|
+
}
|
|
2079
|
+
const _encode = options && options.encode || encode2;
|
|
2080
|
+
const serializeFn = options && options.serialize;
|
|
2081
|
+
let serializedParams;
|
|
2082
|
+
if (serializeFn) {
|
|
2083
|
+
serializedParams = serializeFn(params, options);
|
|
2084
|
+
} else {
|
|
2085
|
+
serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams_default(params, options).toString(_encode);
|
|
2086
|
+
}
|
|
2087
|
+
if (serializedParams) {
|
|
2088
|
+
const hashmarkIndex = url2.indexOf("#");
|
|
2089
|
+
if (hashmarkIndex !== -1) {
|
|
2090
|
+
url2 = url2.slice(0, hashmarkIndex);
|
|
2091
|
+
}
|
|
2092
|
+
url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams;
|
|
2093
|
+
}
|
|
2094
|
+
return url2;
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/core/InterceptorManager.js
|
|
2098
|
+
var InterceptorManager = class {
|
|
2099
|
+
constructor() {
|
|
2100
|
+
this.handlers = [];
|
|
2101
|
+
}
|
|
2102
|
+
/**
|
|
2103
|
+
* Add a new interceptor to the stack
|
|
2104
|
+
*
|
|
2105
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
2106
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
2107
|
+
*
|
|
2108
|
+
* @return {Number} An ID used to remove interceptor later
|
|
2109
|
+
*/
|
|
2110
|
+
use(fulfilled, rejected, options) {
|
|
2111
|
+
this.handlers.push({
|
|
2112
|
+
fulfilled,
|
|
2113
|
+
rejected,
|
|
2114
|
+
synchronous: options ? options.synchronous : false,
|
|
2115
|
+
runWhen: options ? options.runWhen : null
|
|
2116
|
+
});
|
|
2117
|
+
return this.handlers.length - 1;
|
|
2118
|
+
}
|
|
2119
|
+
/**
|
|
2120
|
+
* Remove an interceptor from the stack
|
|
2121
|
+
*
|
|
2122
|
+
* @param {Number} id The ID that was returned by `use`
|
|
2123
|
+
*
|
|
2124
|
+
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
|
|
2125
|
+
*/
|
|
2126
|
+
eject(id) {
|
|
2127
|
+
if (this.handlers[id]) {
|
|
2128
|
+
this.handlers[id] = null;
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
/**
|
|
2132
|
+
* Clear all interceptors from the stack
|
|
2133
|
+
*
|
|
2134
|
+
* @returns {void}
|
|
2135
|
+
*/
|
|
2136
|
+
clear() {
|
|
2137
|
+
if (this.handlers) {
|
|
2138
|
+
this.handlers = [];
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
/**
|
|
2142
|
+
* Iterate over all the registered interceptors
|
|
2143
|
+
*
|
|
2144
|
+
* This method is particularly useful for skipping over any
|
|
2145
|
+
* interceptors that may have become `null` calling `eject`.
|
|
2146
|
+
*
|
|
2147
|
+
* @param {Function} fn The function to call for each interceptor
|
|
2148
|
+
*
|
|
2149
|
+
* @returns {void}
|
|
2150
|
+
*/
|
|
2151
|
+
forEach(fn) {
|
|
2152
|
+
utils_default.forEach(this.handlers, function forEachHandler(h) {
|
|
2153
|
+
if (h !== null) {
|
|
2154
|
+
fn(h);
|
|
2155
|
+
}
|
|
2156
|
+
});
|
|
2157
|
+
}
|
|
2158
|
+
};
|
|
2159
|
+
var InterceptorManager_default = InterceptorManager;
|
|
2160
|
+
|
|
2161
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/defaults/transitional.js
|
|
2162
|
+
var transitional_default = {
|
|
2163
|
+
silentJSONParsing: true,
|
|
2164
|
+
forcedJSONParsing: true,
|
|
2165
|
+
clarifyTimeoutError: false
|
|
2166
|
+
};
|
|
2167
|
+
|
|
2168
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
|
|
2169
|
+
var import_url = __toESM(require("url"), 1);
|
|
2170
|
+
var URLSearchParams_default = import_url.default.URLSearchParams;
|
|
2171
|
+
|
|
2172
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/platform/node/index.js
|
|
2173
|
+
var node_default = {
|
|
2174
|
+
isNode: true,
|
|
2175
|
+
classes: {
|
|
2176
|
+
URLSearchParams: URLSearchParams_default,
|
|
2177
|
+
FormData: FormData_default,
|
|
2178
|
+
Blob: typeof Blob !== "undefined" && Blob || null
|
|
2179
|
+
},
|
|
2180
|
+
protocols: ["http", "https", "file", "data"]
|
|
2181
|
+
};
|
|
2182
|
+
|
|
2183
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
2184
|
+
function toURLEncodedForm(data, options) {
|
|
2185
|
+
return toFormData_default(data, new node_default.classes.URLSearchParams(), Object.assign({
|
|
2186
|
+
visitor: function(value, key, path6, helpers) {
|
|
2187
|
+
if (node_default.isNode && utils_default.isBuffer(value)) {
|
|
2188
|
+
this.append(key, value.toString("base64"));
|
|
2189
|
+
return false;
|
|
2190
|
+
}
|
|
2191
|
+
return helpers.defaultVisitor.apply(this, arguments);
|
|
2192
|
+
}
|
|
2193
|
+
}, options));
|
|
2194
|
+
}
|
|
2195
|
+
|
|
2196
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/formDataToJSON.js
|
|
2197
|
+
function parsePropPath(name) {
|
|
2198
|
+
return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
2199
|
+
return match[0] === "[]" ? "" : match[1] || match[0];
|
|
2200
|
+
});
|
|
2201
|
+
}
|
|
2202
|
+
function arrayToObject(arr) {
|
|
2203
|
+
const obj = {};
|
|
2204
|
+
const keys = Object.keys(arr);
|
|
2205
|
+
let i;
|
|
2206
|
+
const len = keys.length;
|
|
2207
|
+
let key;
|
|
2208
|
+
for (i = 0; i < len; i++) {
|
|
2209
|
+
key = keys[i];
|
|
2210
|
+
obj[key] = arr[key];
|
|
2211
|
+
}
|
|
2212
|
+
return obj;
|
|
2213
|
+
}
|
|
2214
|
+
function formDataToJSON(formData) {
|
|
2215
|
+
function buildPath(path6, value, target, index) {
|
|
2216
|
+
let name = path6[index++];
|
|
2217
|
+
const isNumericKey = Number.isFinite(+name);
|
|
2218
|
+
const isLast = index >= path6.length;
|
|
2219
|
+
name = !name && utils_default.isArray(target) ? target.length : name;
|
|
2220
|
+
if (isLast) {
|
|
2221
|
+
if (utils_default.hasOwnProp(target, name)) {
|
|
2222
|
+
target[name] = [target[name], value];
|
|
2223
|
+
} else {
|
|
2224
|
+
target[name] = value;
|
|
2225
|
+
}
|
|
2226
|
+
return !isNumericKey;
|
|
2227
|
+
}
|
|
2228
|
+
if (!target[name] || !utils_default.isObject(target[name])) {
|
|
2229
|
+
target[name] = [];
|
|
2230
|
+
}
|
|
2231
|
+
const result = buildPath(path6, value, target[name], index);
|
|
2232
|
+
if (result && utils_default.isArray(target[name])) {
|
|
2233
|
+
target[name] = arrayToObject(target[name]);
|
|
2234
|
+
}
|
|
2235
|
+
return !isNumericKey;
|
|
2236
|
+
}
|
|
2237
|
+
if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) {
|
|
2238
|
+
const obj = {};
|
|
2239
|
+
utils_default.forEachEntry(formData, (name, value) => {
|
|
2240
|
+
buildPath(parsePropPath(name), value, obj, 0);
|
|
2241
|
+
});
|
|
2242
|
+
return obj;
|
|
2243
|
+
}
|
|
2244
|
+
return null;
|
|
2245
|
+
}
|
|
2246
|
+
var formDataToJSON_default = formDataToJSON;
|
|
2247
|
+
|
|
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
|
+
};
|
|
2252
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
2253
|
+
if (utils_default.isString(rawValue)) {
|
|
2254
|
+
try {
|
|
2255
|
+
(parser || JSON.parse)(rawValue);
|
|
2256
|
+
return utils_default.trim(rawValue);
|
|
2257
|
+
} catch (e) {
|
|
2258
|
+
if (e.name !== "SyntaxError") {
|
|
2259
|
+
throw e;
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
2263
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
2264
|
+
}
|
|
2265
|
+
var defaults = {
|
|
2266
|
+
transitional: transitional_default,
|
|
2267
|
+
adapter: ["xhr", "http"],
|
|
2268
|
+
transformRequest: [function transformRequest(data, headers) {
|
|
2269
|
+
const contentType = headers.getContentType() || "";
|
|
2270
|
+
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
2271
|
+
const isObjectPayload = utils_default.isObject(data);
|
|
2272
|
+
if (isObjectPayload && utils_default.isHTMLForm(data)) {
|
|
2273
|
+
data = new FormData(data);
|
|
2274
|
+
}
|
|
2275
|
+
const isFormData2 = utils_default.isFormData(data);
|
|
2276
|
+
if (isFormData2) {
|
|
2277
|
+
if (!hasJSONContentType) {
|
|
2278
|
+
return data;
|
|
2279
|
+
}
|
|
2280
|
+
return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
|
|
2281
|
+
}
|
|
2282
|
+
if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data)) {
|
|
2283
|
+
return data;
|
|
2284
|
+
}
|
|
2285
|
+
if (utils_default.isArrayBufferView(data)) {
|
|
2286
|
+
return data.buffer;
|
|
2287
|
+
}
|
|
2288
|
+
if (utils_default.isURLSearchParams(data)) {
|
|
2289
|
+
headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
|
|
2290
|
+
return data.toString();
|
|
2291
|
+
}
|
|
2292
|
+
let isFileList2;
|
|
2293
|
+
if (isObjectPayload) {
|
|
2294
|
+
if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
|
|
2295
|
+
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
2296
|
+
}
|
|
2297
|
+
if ((isFileList2 = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
2298
|
+
const _FormData = this.env && this.env.FormData;
|
|
2299
|
+
return toFormData_default(
|
|
2300
|
+
isFileList2 ? { "files[]": data } : data,
|
|
2301
|
+
_FormData && new _FormData(),
|
|
2302
|
+
this.formSerializer
|
|
2303
|
+
);
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
if (isObjectPayload || hasJSONContentType) {
|
|
2307
|
+
headers.setContentType("application/json", false);
|
|
2308
|
+
return stringifySafely(data);
|
|
2309
|
+
}
|
|
2310
|
+
return data;
|
|
2311
|
+
}],
|
|
2312
|
+
transformResponse: [function transformResponse(data) {
|
|
2313
|
+
const transitional2 = this.transitional || defaults.transitional;
|
|
2314
|
+
const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
|
|
2315
|
+
const JSONRequested = this.responseType === "json";
|
|
2316
|
+
if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
|
2317
|
+
const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
|
|
2318
|
+
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
2319
|
+
try {
|
|
2320
|
+
return JSON.parse(data);
|
|
2321
|
+
} catch (e) {
|
|
2322
|
+
if (strictJSONParsing) {
|
|
2323
|
+
if (e.name === "SyntaxError") {
|
|
2324
|
+
throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, this.response);
|
|
2325
|
+
}
|
|
2326
|
+
throw e;
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
return data;
|
|
2331
|
+
}],
|
|
2332
|
+
/**
|
|
2333
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
2334
|
+
* timeout is not created.
|
|
2335
|
+
*/
|
|
2336
|
+
timeout: 0,
|
|
2337
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
2338
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
2339
|
+
maxContentLength: -1,
|
|
2340
|
+
maxBodyLength: -1,
|
|
2341
|
+
env: {
|
|
2342
|
+
FormData: node_default.classes.FormData,
|
|
2343
|
+
Blob: node_default.classes.Blob
|
|
2344
|
+
},
|
|
2345
|
+
validateStatus: function validateStatus(status) {
|
|
2346
|
+
return status >= 200 && status < 300;
|
|
2347
|
+
},
|
|
2348
|
+
headers: {
|
|
2349
|
+
common: {
|
|
2350
|
+
"Accept": "application/json, text/plain, */*"
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
};
|
|
2354
|
+
utils_default.forEach(["delete", "get", "head"], function forEachMethodNoData(method) {
|
|
2355
|
+
defaults.headers[method] = {};
|
|
2356
|
+
});
|
|
2357
|
+
utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
2358
|
+
defaults.headers[method] = utils_default.merge(DEFAULT_CONTENT_TYPE);
|
|
2359
|
+
});
|
|
2360
|
+
var defaults_default = defaults;
|
|
2361
|
+
|
|
2362
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/parseHeaders.js
|
|
2363
|
+
var ignoreDuplicateOf = utils_default.toObjectSet([
|
|
2364
|
+
"age",
|
|
2365
|
+
"authorization",
|
|
2366
|
+
"content-length",
|
|
2367
|
+
"content-type",
|
|
2368
|
+
"etag",
|
|
2369
|
+
"expires",
|
|
2370
|
+
"from",
|
|
2371
|
+
"host",
|
|
2372
|
+
"if-modified-since",
|
|
2373
|
+
"if-unmodified-since",
|
|
2374
|
+
"last-modified",
|
|
2375
|
+
"location",
|
|
2376
|
+
"max-forwards",
|
|
2377
|
+
"proxy-authorization",
|
|
2378
|
+
"referer",
|
|
2379
|
+
"retry-after",
|
|
2380
|
+
"user-agent"
|
|
2381
|
+
]);
|
|
2382
|
+
var parseHeaders_default = (rawHeaders) => {
|
|
2383
|
+
const parsed = {};
|
|
2384
|
+
let key;
|
|
2385
|
+
let val;
|
|
2386
|
+
let i;
|
|
2387
|
+
rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
|
|
2388
|
+
i = line.indexOf(":");
|
|
2389
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
2390
|
+
val = line.substring(i + 1).trim();
|
|
2391
|
+
if (!key || parsed[key] && ignoreDuplicateOf[key]) {
|
|
2392
|
+
return;
|
|
2393
|
+
}
|
|
2394
|
+
if (key === "set-cookie") {
|
|
2395
|
+
if (parsed[key]) {
|
|
2396
|
+
parsed[key].push(val);
|
|
2397
|
+
} else {
|
|
2398
|
+
parsed[key] = [val];
|
|
2399
|
+
}
|
|
2400
|
+
} else {
|
|
2401
|
+
parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
|
|
2402
|
+
}
|
|
2403
|
+
});
|
|
2404
|
+
return parsed;
|
|
2405
|
+
};
|
|
2406
|
+
|
|
2407
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/core/AxiosHeaders.js
|
|
2408
|
+
var $internals = Symbol("internals");
|
|
2409
|
+
function normalizeHeader(header) {
|
|
2410
|
+
return header && String(header).trim().toLowerCase();
|
|
2411
|
+
}
|
|
2412
|
+
function normalizeValue(value) {
|
|
2413
|
+
if (value === false || value == null) {
|
|
2414
|
+
return value;
|
|
2415
|
+
}
|
|
2416
|
+
return utils_default.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
2417
|
+
}
|
|
2418
|
+
function parseTokens(str) {
|
|
2419
|
+
const tokens = /* @__PURE__ */ Object.create(null);
|
|
2420
|
+
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
2421
|
+
let match;
|
|
2422
|
+
while (match = tokensRE.exec(str)) {
|
|
2423
|
+
tokens[match[1]] = match[2];
|
|
2424
|
+
}
|
|
2425
|
+
return tokens;
|
|
2426
|
+
}
|
|
2427
|
+
function isValidHeaderName(str) {
|
|
2428
|
+
return /^[-_a-zA-Z]+$/.test(str.trim());
|
|
2429
|
+
}
|
|
2430
|
+
function matchHeaderValue(context, value, header, filter2) {
|
|
2431
|
+
if (utils_default.isFunction(filter2)) {
|
|
2432
|
+
return filter2.call(this, value, header);
|
|
2433
|
+
}
|
|
2434
|
+
if (!utils_default.isString(value)) return;
|
|
2435
|
+
if (utils_default.isString(filter2)) {
|
|
2436
|
+
return value.indexOf(filter2) !== -1;
|
|
2437
|
+
}
|
|
2438
|
+
if (utils_default.isRegExp(filter2)) {
|
|
2439
|
+
return filter2.test(value);
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
function formatHeader(header) {
|
|
2443
|
+
return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
2444
|
+
return char.toUpperCase() + str;
|
|
2445
|
+
});
|
|
2446
|
+
}
|
|
2447
|
+
function buildAccessors(obj, header) {
|
|
2448
|
+
const accessorName = utils_default.toCamelCase(" " + header);
|
|
2449
|
+
["get", "set", "has"].forEach((methodName) => {
|
|
2450
|
+
Object.defineProperty(obj, methodName + accessorName, {
|
|
2451
|
+
value: function(arg1, arg2, arg3) {
|
|
2452
|
+
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
2453
|
+
},
|
|
2454
|
+
configurable: true
|
|
2455
|
+
});
|
|
2456
|
+
});
|
|
2457
|
+
}
|
|
2458
|
+
var AxiosHeaders = class {
|
|
2459
|
+
constructor(headers) {
|
|
2460
|
+
headers && this.set(headers);
|
|
2461
|
+
}
|
|
2462
|
+
set(header, valueOrRewrite, rewrite) {
|
|
2463
|
+
const self2 = this;
|
|
2464
|
+
function setHeader(_value, _header, _rewrite) {
|
|
2465
|
+
const lHeader = normalizeHeader(_header);
|
|
2466
|
+
if (!lHeader) {
|
|
2467
|
+
throw new Error("header name must be a non-empty string");
|
|
2468
|
+
}
|
|
2469
|
+
const key = utils_default.findKey(self2, lHeader);
|
|
2470
|
+
if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
|
|
2471
|
+
self2[key || _header] = normalizeValue(_value);
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
2475
|
+
if (utils_default.isPlainObject(header) || header instanceof this.constructor) {
|
|
2476
|
+
setHeaders(header, valueOrRewrite);
|
|
2477
|
+
} else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
2478
|
+
setHeaders(parseHeaders_default(header), valueOrRewrite);
|
|
2479
|
+
} else {
|
|
2480
|
+
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
2481
|
+
}
|
|
2482
|
+
return this;
|
|
2483
|
+
}
|
|
2484
|
+
get(header, parser) {
|
|
2485
|
+
header = normalizeHeader(header);
|
|
2486
|
+
if (header) {
|
|
2487
|
+
const key = utils_default.findKey(this, header);
|
|
2488
|
+
if (key) {
|
|
2489
|
+
const value = this[key];
|
|
2490
|
+
if (!parser) {
|
|
2491
|
+
return value;
|
|
2492
|
+
}
|
|
2493
|
+
if (parser === true) {
|
|
2494
|
+
return parseTokens(value);
|
|
2495
|
+
}
|
|
2496
|
+
if (utils_default.isFunction(parser)) {
|
|
2497
|
+
return parser.call(this, value, key);
|
|
2498
|
+
}
|
|
2499
|
+
if (utils_default.isRegExp(parser)) {
|
|
2500
|
+
return parser.exec(value);
|
|
2501
|
+
}
|
|
2502
|
+
throw new TypeError("parser must be boolean|regexp|function");
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
}
|
|
2506
|
+
has(header, matcher) {
|
|
2507
|
+
header = normalizeHeader(header);
|
|
2508
|
+
if (header) {
|
|
2509
|
+
const key = utils_default.findKey(this, header);
|
|
2510
|
+
return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
2511
|
+
}
|
|
2512
|
+
return false;
|
|
2513
|
+
}
|
|
2514
|
+
delete(header, matcher) {
|
|
2515
|
+
const self2 = this;
|
|
2516
|
+
let deleted = false;
|
|
2517
|
+
function deleteHeader(_header) {
|
|
2518
|
+
_header = normalizeHeader(_header);
|
|
2519
|
+
if (_header) {
|
|
2520
|
+
const key = utils_default.findKey(self2, _header);
|
|
2521
|
+
if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
|
|
2522
|
+
delete self2[key];
|
|
2523
|
+
deleted = true;
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
}
|
|
2527
|
+
if (utils_default.isArray(header)) {
|
|
2528
|
+
header.forEach(deleteHeader);
|
|
2529
|
+
} else {
|
|
2530
|
+
deleteHeader(header);
|
|
2531
|
+
}
|
|
2532
|
+
return deleted;
|
|
2533
|
+
}
|
|
2534
|
+
clear(matcher) {
|
|
2535
|
+
const keys = Object.keys(this);
|
|
2536
|
+
let i = keys.length;
|
|
2537
|
+
let deleted = false;
|
|
2538
|
+
while (i--) {
|
|
2539
|
+
const key = keys[i];
|
|
2540
|
+
if (!matcher || matchHeaderValue(this, this[key], key, matcher)) {
|
|
2541
|
+
delete this[key];
|
|
2542
|
+
deleted = true;
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
return deleted;
|
|
2546
|
+
}
|
|
2547
|
+
normalize(format) {
|
|
2548
|
+
const self2 = this;
|
|
2549
|
+
const headers = {};
|
|
2550
|
+
utils_default.forEach(this, (value, header) => {
|
|
2551
|
+
const key = utils_default.findKey(headers, header);
|
|
2552
|
+
if (key) {
|
|
2553
|
+
self2[key] = normalizeValue(value);
|
|
2554
|
+
delete self2[header];
|
|
2555
|
+
return;
|
|
2556
|
+
}
|
|
2557
|
+
const normalized = format ? formatHeader(header) : String(header).trim();
|
|
2558
|
+
if (normalized !== header) {
|
|
2559
|
+
delete self2[header];
|
|
2560
|
+
}
|
|
2561
|
+
self2[normalized] = normalizeValue(value);
|
|
2562
|
+
headers[normalized] = true;
|
|
2563
|
+
});
|
|
2564
|
+
return this;
|
|
2565
|
+
}
|
|
2566
|
+
concat(...targets) {
|
|
2567
|
+
return this.constructor.concat(this, ...targets);
|
|
2568
|
+
}
|
|
2569
|
+
toJSON(asStrings) {
|
|
2570
|
+
const obj = /* @__PURE__ */ Object.create(null);
|
|
2571
|
+
utils_default.forEach(this, (value, header) => {
|
|
2572
|
+
value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value);
|
|
2573
|
+
});
|
|
2574
|
+
return obj;
|
|
2575
|
+
}
|
|
2576
|
+
[Symbol.iterator]() {
|
|
2577
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
2578
|
+
}
|
|
2579
|
+
toString() {
|
|
2580
|
+
return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
|
|
2581
|
+
}
|
|
2582
|
+
get [Symbol.toStringTag]() {
|
|
2583
|
+
return "AxiosHeaders";
|
|
2584
|
+
}
|
|
2585
|
+
static from(thing) {
|
|
2586
|
+
return thing instanceof this ? thing : new this(thing);
|
|
2587
|
+
}
|
|
2588
|
+
static concat(first, ...targets) {
|
|
2589
|
+
const computed = new this(first);
|
|
2590
|
+
targets.forEach((target) => computed.set(target));
|
|
2591
|
+
return computed;
|
|
2592
|
+
}
|
|
2593
|
+
static accessor(header) {
|
|
2594
|
+
const internals = this[$internals] = this[$internals] = {
|
|
2595
|
+
accessors: {}
|
|
2596
|
+
};
|
|
2597
|
+
const accessors = internals.accessors;
|
|
2598
|
+
const prototype3 = this.prototype;
|
|
2599
|
+
function defineAccessor(_header) {
|
|
2600
|
+
const lHeader = normalizeHeader(_header);
|
|
2601
|
+
if (!accessors[lHeader]) {
|
|
2602
|
+
buildAccessors(prototype3, _header);
|
|
2603
|
+
accessors[lHeader] = true;
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2606
|
+
utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
2607
|
+
return this;
|
|
2608
|
+
}
|
|
2609
|
+
};
|
|
2610
|
+
AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
2611
|
+
utils_default.freezeMethods(AxiosHeaders.prototype);
|
|
2612
|
+
utils_default.freezeMethods(AxiosHeaders);
|
|
2613
|
+
var AxiosHeaders_default = AxiosHeaders;
|
|
2614
|
+
|
|
2615
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/core/transformData.js
|
|
2616
|
+
function transformData(fns, response) {
|
|
2617
|
+
const config = this || defaults_default;
|
|
2618
|
+
const context = response || config;
|
|
2619
|
+
const headers = AxiosHeaders_default.from(context.headers);
|
|
2620
|
+
let data = context.data;
|
|
2621
|
+
utils_default.forEach(fns, function transform(fn) {
|
|
2622
|
+
data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
|
|
2623
|
+
});
|
|
2624
|
+
headers.normalize();
|
|
2625
|
+
return data;
|
|
2626
|
+
}
|
|
2627
|
+
|
|
2628
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/cancel/isCancel.js
|
|
2629
|
+
function isCancel(value) {
|
|
2630
|
+
return !!(value && value.__CANCEL__);
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2633
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/cancel/CanceledError.js
|
|
2634
|
+
function CanceledError(message, config, request) {
|
|
2635
|
+
AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
|
|
2636
|
+
this.name = "CanceledError";
|
|
2637
|
+
}
|
|
2638
|
+
utils_default.inherits(CanceledError, AxiosError_default, {
|
|
2639
|
+
__CANCEL__: true
|
|
2640
|
+
});
|
|
2641
|
+
var CanceledError_default = CanceledError;
|
|
2642
|
+
|
|
2643
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/core/settle.js
|
|
2644
|
+
function settle(resolve, reject, response) {
|
|
2645
|
+
const validateStatus2 = response.config.validateStatus;
|
|
2646
|
+
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
2647
|
+
resolve(response);
|
|
2648
|
+
} else {
|
|
2649
|
+
reject(new AxiosError_default(
|
|
2650
|
+
"Request failed with status code " + response.status,
|
|
2651
|
+
[AxiosError_default.ERR_BAD_REQUEST, AxiosError_default.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
|
|
2652
|
+
response.config,
|
|
2653
|
+
response.request,
|
|
2654
|
+
response
|
|
2655
|
+
));
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
|
|
2659
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/isAbsoluteURL.js
|
|
2660
|
+
function isAbsoluteURL(url2) {
|
|
2661
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2);
|
|
2662
|
+
}
|
|
2663
|
+
|
|
2664
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/combineURLs.js
|
|
2665
|
+
function combineURLs(baseURL, relativeURL) {
|
|
2666
|
+
return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
2667
|
+
}
|
|
2668
|
+
|
|
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)) {
|
|
2672
|
+
return combineURLs(baseURL, requestedURL);
|
|
2673
|
+
}
|
|
2674
|
+
return requestedURL;
|
|
2675
|
+
}
|
|
2676
|
+
|
|
2677
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/adapters/http.js
|
|
2678
|
+
var import_proxy_from_env = __toESM(require_proxy_from_env(), 1);
|
|
2679
|
+
var import_http = __toESM(require("http"), 1);
|
|
2680
|
+
var import_https = __toESM(require("https"), 1);
|
|
2681
|
+
var import_util2 = __toESM(require("util"), 1);
|
|
2682
|
+
var import_follow_redirects = __toESM(require_follow_redirects(), 1);
|
|
2683
|
+
var import_zlib = __toESM(require("zlib"), 1);
|
|
2684
|
+
|
|
2685
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/env/data.js
|
|
2686
|
+
var VERSION = "1.3.2";
|
|
2687
|
+
|
|
2688
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/parseProtocol.js
|
|
2689
|
+
function parseProtocol(url2) {
|
|
2690
|
+
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2);
|
|
2691
|
+
return match && match[1] || "";
|
|
2692
|
+
}
|
|
2693
|
+
|
|
2694
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/fromDataURI.js
|
|
2695
|
+
var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
|
|
2696
|
+
function fromDataURI(uri, asBlob, options) {
|
|
2697
|
+
const _Blob = options && options.Blob || node_default.classes.Blob;
|
|
2698
|
+
const protocol = parseProtocol(uri);
|
|
2699
|
+
if (asBlob === void 0 && _Blob) {
|
|
2700
|
+
asBlob = true;
|
|
2701
|
+
}
|
|
2702
|
+
if (protocol === "data") {
|
|
2703
|
+
uri = protocol.length ? uri.slice(protocol.length + 1) : uri;
|
|
2704
|
+
const match = DATA_URL_PATTERN.exec(uri);
|
|
2705
|
+
if (!match) {
|
|
2706
|
+
throw new AxiosError_default("Invalid URL", AxiosError_default.ERR_INVALID_URL);
|
|
2707
|
+
}
|
|
2708
|
+
const mime = match[1];
|
|
2709
|
+
const isBase64 = match[2];
|
|
2710
|
+
const body = match[3];
|
|
2711
|
+
const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? "base64" : "utf8");
|
|
2712
|
+
if (asBlob) {
|
|
2713
|
+
if (!_Blob) {
|
|
2714
|
+
throw new AxiosError_default("Blob is not supported", AxiosError_default.ERR_NOT_SUPPORT);
|
|
2715
|
+
}
|
|
2716
|
+
return new _Blob([buffer], { type: mime });
|
|
2717
|
+
}
|
|
2718
|
+
return buffer;
|
|
2719
|
+
}
|
|
2720
|
+
throw new AxiosError_default("Unsupported protocol " + protocol, AxiosError_default.ERR_NOT_SUPPORT);
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/adapters/http.js
|
|
2724
|
+
var import_stream4 = __toESM(require("stream"), 1);
|
|
2725
|
+
|
|
2726
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/AxiosTransformStream.js
|
|
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
|
|
2792
|
+
var kInternals = Symbol("internals");
|
|
2793
|
+
var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
2794
|
+
constructor(options) {
|
|
2795
|
+
options = utils_default.toFlatObject(options, {
|
|
2796
|
+
maxRate: 0,
|
|
2797
|
+
chunkSize: 64 * 1024,
|
|
2798
|
+
minChunkSize: 100,
|
|
2799
|
+
timeWindow: 500,
|
|
2800
|
+
ticksRate: 2,
|
|
2801
|
+
samplesCount: 15
|
|
2802
|
+
}, null, (prop, source) => {
|
|
2803
|
+
return !utils_default.isUndefined(source[prop]);
|
|
2804
|
+
});
|
|
2805
|
+
super({
|
|
2806
|
+
readableHighWaterMark: options.chunkSize
|
|
2807
|
+
});
|
|
2808
|
+
const self2 = this;
|
|
2809
|
+
const internals = this[kInternals] = {
|
|
2810
|
+
length: options.length,
|
|
2811
|
+
timeWindow: options.timeWindow,
|
|
2812
|
+
ticksRate: options.ticksRate,
|
|
2813
|
+
chunkSize: options.chunkSize,
|
|
2814
|
+
maxRate: options.maxRate,
|
|
2815
|
+
minChunkSize: options.minChunkSize,
|
|
2816
|
+
bytesSeen: 0,
|
|
2817
|
+
isCaptured: false,
|
|
2818
|
+
notifiedBytesLoaded: 0,
|
|
2819
|
+
ts: Date.now(),
|
|
2820
|
+
bytes: 0,
|
|
2821
|
+
onReadCallback: null
|
|
2822
|
+
};
|
|
2823
|
+
const _speedometer = speedometer_default(internals.ticksRate * options.samplesCount, internals.timeWindow);
|
|
2824
|
+
this.on("newListener", (event) => {
|
|
2825
|
+
if (event === "progress") {
|
|
2826
|
+
if (!internals.isCaptured) {
|
|
2827
|
+
internals.isCaptured = true;
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
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);
|
|
2855
|
+
}
|
|
2856
|
+
_read(size) {
|
|
2857
|
+
const internals = this[kInternals];
|
|
2858
|
+
if (internals.onReadCallback) {
|
|
2859
|
+
internals.onReadCallback();
|
|
2860
|
+
}
|
|
2861
|
+
return super._read(size);
|
|
2862
|
+
}
|
|
2863
|
+
_transform(chunk, encoding, callback) {
|
|
2864
|
+
const self2 = this;
|
|
2865
|
+
const internals = this[kInternals];
|
|
2866
|
+
const maxRate = internals.maxRate;
|
|
2867
|
+
const readableHighWaterMark = this.readableHighWaterMark;
|
|
2868
|
+
const timeWindow = internals.timeWindow;
|
|
2869
|
+
const divider = 1e3 / timeWindow;
|
|
2870
|
+
const bytesThreshold = maxRate / divider;
|
|
2871
|
+
const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
|
|
2872
|
+
function pushChunk(_chunk, _callback) {
|
|
2873
|
+
const bytes = Buffer.byteLength(_chunk);
|
|
2874
|
+
internals.bytesSeen += bytes;
|
|
2875
|
+
internals.bytes += bytes;
|
|
2876
|
+
if (internals.isCaptured) {
|
|
2877
|
+
internals.updateProgress();
|
|
2878
|
+
}
|
|
2879
|
+
if (self2.push(_chunk)) {
|
|
2880
|
+
process.nextTick(_callback);
|
|
2881
|
+
} else {
|
|
2882
|
+
internals.onReadCallback = () => {
|
|
2883
|
+
internals.onReadCallback = null;
|
|
2884
|
+
process.nextTick(_callback);
|
|
2885
|
+
};
|
|
2886
|
+
}
|
|
2887
|
+
}
|
|
2888
|
+
const transformChunk = (_chunk, _callback) => {
|
|
2889
|
+
const chunkSize = Buffer.byteLength(_chunk);
|
|
2890
|
+
let chunkRemainder = null;
|
|
2891
|
+
let maxChunkSize = readableHighWaterMark;
|
|
2892
|
+
let bytesLeft;
|
|
2893
|
+
let passed = 0;
|
|
2894
|
+
if (maxRate) {
|
|
2895
|
+
const now = Date.now();
|
|
2896
|
+
if (!internals.ts || (passed = now - internals.ts) >= timeWindow) {
|
|
2897
|
+
internals.ts = now;
|
|
2898
|
+
bytesLeft = bytesThreshold - internals.bytes;
|
|
2899
|
+
internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;
|
|
2900
|
+
passed = 0;
|
|
2901
|
+
}
|
|
2902
|
+
bytesLeft = bytesThreshold - internals.bytes;
|
|
2903
|
+
}
|
|
2904
|
+
if (maxRate) {
|
|
2905
|
+
if (bytesLeft <= 0) {
|
|
2906
|
+
return setTimeout(() => {
|
|
2907
|
+
_callback(null, _chunk);
|
|
2908
|
+
}, timeWindow - passed);
|
|
2909
|
+
}
|
|
2910
|
+
if (bytesLeft < maxChunkSize) {
|
|
2911
|
+
maxChunkSize = bytesLeft;
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) {
|
|
2915
|
+
chunkRemainder = _chunk.subarray(maxChunkSize);
|
|
2916
|
+
_chunk = _chunk.subarray(0, maxChunkSize);
|
|
2917
|
+
}
|
|
2918
|
+
pushChunk(_chunk, chunkRemainder ? () => {
|
|
2919
|
+
process.nextTick(_callback, null, chunkRemainder);
|
|
2920
|
+
} : _callback);
|
|
2921
|
+
};
|
|
2922
|
+
transformChunk(chunk, function transformNextChunk(err, _chunk) {
|
|
2923
|
+
if (err) {
|
|
2924
|
+
return callback(err);
|
|
2925
|
+
}
|
|
2926
|
+
if (_chunk) {
|
|
2927
|
+
transformChunk(_chunk, transformNextChunk);
|
|
2928
|
+
} else {
|
|
2929
|
+
callback(null);
|
|
2930
|
+
}
|
|
2931
|
+
});
|
|
2932
|
+
}
|
|
2933
|
+
setLength(length) {
|
|
2934
|
+
this[kInternals].length = +length;
|
|
2935
|
+
return this;
|
|
2936
|
+
}
|
|
2937
|
+
};
|
|
2938
|
+
var AxiosTransformStream_default = AxiosTransformStream;
|
|
2939
|
+
|
|
2940
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/adapters/http.js
|
|
2941
|
+
var import_events = __toESM(require("events"), 1);
|
|
2942
|
+
|
|
2943
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/formDataToStream.js
|
|
2944
|
+
var import_util = require("util");
|
|
2945
|
+
var import_stream2 = require("stream");
|
|
2946
|
+
|
|
2947
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/readBlob.js
|
|
2948
|
+
var { asyncIterator } = Symbol;
|
|
2949
|
+
var readBlob = async function* (blob) {
|
|
2950
|
+
if (blob.stream) {
|
|
2951
|
+
yield* blob.stream();
|
|
2952
|
+
} else if (blob.arrayBuffer) {
|
|
2953
|
+
yield await blob.arrayBuffer();
|
|
2954
|
+
} else if (blob[asyncIterator]) {
|
|
2955
|
+
yield* blob[asyncIterator]();
|
|
2956
|
+
} else {
|
|
2957
|
+
yield blob;
|
|
2958
|
+
}
|
|
2959
|
+
};
|
|
2960
|
+
var readBlob_default = readBlob;
|
|
2961
|
+
|
|
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();
|
|
2965
|
+
var CRLF = "\r\n";
|
|
2966
|
+
var CRLF_BYTES = textEncoder.encode(CRLF);
|
|
2967
|
+
var CRLF_BYTES_COUNT = 2;
|
|
2968
|
+
var FormDataPart = class {
|
|
2969
|
+
constructor(name, value) {
|
|
2970
|
+
const { escapeName } = this.constructor;
|
|
2971
|
+
const isStringValue = utils_default.isString(value);
|
|
2972
|
+
let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ""}${CRLF}`;
|
|
2973
|
+
if (isStringValue) {
|
|
2974
|
+
value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
|
|
2975
|
+
} else {
|
|
2976
|
+
headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`;
|
|
2977
|
+
}
|
|
2978
|
+
this.headers = textEncoder.encode(headers + CRLF);
|
|
2979
|
+
this.contentLength = isStringValue ? value.byteLength : value.size;
|
|
2980
|
+
this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;
|
|
2981
|
+
this.name = name;
|
|
2982
|
+
this.value = value;
|
|
2983
|
+
}
|
|
2984
|
+
async *encode() {
|
|
2985
|
+
yield this.headers;
|
|
2986
|
+
const { value } = this;
|
|
2987
|
+
if (utils_default.isTypedArray(value)) {
|
|
2988
|
+
yield value;
|
|
2989
|
+
} else {
|
|
2990
|
+
yield* readBlob_default(value);
|
|
2991
|
+
}
|
|
2992
|
+
yield CRLF_BYTES;
|
|
2993
|
+
}
|
|
2994
|
+
static escapeName(name) {
|
|
2995
|
+
return String(name).replace(/[\r\n"]/g, (match) => ({
|
|
2996
|
+
"\r": "%0D",
|
|
2997
|
+
"\n": "%0A",
|
|
2998
|
+
'"': "%22"
|
|
2999
|
+
})[match]);
|
|
3000
|
+
}
|
|
3001
|
+
};
|
|
3002
|
+
var formDataToStream = (form, headersHandler, options) => {
|
|
3003
|
+
const {
|
|
3004
|
+
tag = "form-data-boundary",
|
|
3005
|
+
size = 25,
|
|
3006
|
+
boundary = tag + "-" + utils_default.generateString(size, BOUNDARY_ALPHABET)
|
|
3007
|
+
} = options || {};
|
|
3008
|
+
if (!utils_default.isFormData(form)) {
|
|
3009
|
+
throw TypeError("FormData instance required");
|
|
3010
|
+
}
|
|
3011
|
+
if (boundary.length < 1 || boundary.length > 70) {
|
|
3012
|
+
throw Error("boundary must be 10-70 characters long");
|
|
3013
|
+
}
|
|
3014
|
+
const boundaryBytes = textEncoder.encode("--" + boundary + CRLF);
|
|
3015
|
+
const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF + CRLF);
|
|
3016
|
+
let contentLength = footerBytes.byteLength;
|
|
3017
|
+
const parts = Array.from(form.entries()).map(([name, value]) => {
|
|
3018
|
+
const part = new FormDataPart(name, value);
|
|
3019
|
+
contentLength += part.size;
|
|
3020
|
+
return part;
|
|
3021
|
+
});
|
|
3022
|
+
contentLength += boundaryBytes.byteLength * parts.length;
|
|
3023
|
+
contentLength = utils_default.toFiniteNumber(contentLength);
|
|
3024
|
+
const computedHeaders = {
|
|
3025
|
+
"Content-Type": `multipart/form-data; boundary=${boundary}`
|
|
3026
|
+
};
|
|
3027
|
+
if (Number.isFinite(contentLength)) {
|
|
3028
|
+
computedHeaders["Content-Length"] = contentLength;
|
|
3029
|
+
}
|
|
3030
|
+
headersHandler && headersHandler(computedHeaders);
|
|
3031
|
+
return import_stream2.Readable.from(async function* () {
|
|
3032
|
+
for (const part of parts) {
|
|
3033
|
+
yield boundaryBytes;
|
|
3034
|
+
yield* part.encode();
|
|
3035
|
+
}
|
|
3036
|
+
yield footerBytes;
|
|
3037
|
+
}());
|
|
3038
|
+
};
|
|
3039
|
+
var formDataToStream_default = formDataToStream;
|
|
3040
|
+
|
|
3041
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
|
|
3042
|
+
var import_stream3 = __toESM(require("stream"), 1);
|
|
3043
|
+
var ZlibHeaderTransformStream = class extends import_stream3.default.Transform {
|
|
3044
|
+
__transform(chunk, encoding, callback) {
|
|
3045
|
+
this.push(chunk);
|
|
3046
|
+
callback();
|
|
3047
|
+
}
|
|
3048
|
+
_transform(chunk, encoding, callback) {
|
|
3049
|
+
if (chunk.length !== 0) {
|
|
3050
|
+
this._transform = this.__transform;
|
|
3051
|
+
if (chunk[0] !== 120) {
|
|
3052
|
+
const header = Buffer.alloc(2);
|
|
3053
|
+
header[0] = 120;
|
|
3054
|
+
header[1] = 156;
|
|
3055
|
+
this.push(header, encoding);
|
|
3056
|
+
}
|
|
3057
|
+
}
|
|
3058
|
+
this.__transform(chunk, encoding, callback);
|
|
3059
|
+
}
|
|
3060
|
+
};
|
|
3061
|
+
var ZlibHeaderTransformStream_default = ZlibHeaderTransformStream;
|
|
3062
|
+
|
|
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
|
|
3067
|
+
};
|
|
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);
|
|
3092
|
+
}
|
|
3093
|
+
}
|
|
3094
|
+
if (proxy) {
|
|
3095
|
+
if (proxy.username) {
|
|
3096
|
+
proxy.auth = (proxy.username || "") + ":" + (proxy.password || "");
|
|
3097
|
+
}
|
|
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;
|
|
3104
|
+
}
|
|
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}:`;
|
|
3113
|
+
}
|
|
3114
|
+
}
|
|
3115
|
+
options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
|
|
3116
|
+
setProxy(redirectOptions, configProxy, redirectOptions.href);
|
|
3117
|
+
};
|
|
3118
|
+
}
|
|
3119
|
+
var isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process";
|
|
3120
|
+
var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
3121
|
+
return new Promise(async function dispatchHttpRequest(resolvePromise, rejectPromise) {
|
|
3122
|
+
let data = config.data;
|
|
3123
|
+
const responseType = config.responseType;
|
|
3124
|
+
const responseEncoding = config.responseEncoding;
|
|
3125
|
+
const method = config.method.toUpperCase();
|
|
3126
|
+
let isFinished;
|
|
3127
|
+
let isDone;
|
|
3128
|
+
let rejected = false;
|
|
3129
|
+
let req;
|
|
3130
|
+
const emitter = new import_events.default();
|
|
3131
|
+
function onFinished() {
|
|
3132
|
+
if (isFinished) return;
|
|
3133
|
+
isFinished = true;
|
|
3134
|
+
if (config.cancelToken) {
|
|
3135
|
+
config.cancelToken.unsubscribe(abort);
|
|
3136
|
+
}
|
|
3137
|
+
if (config.signal) {
|
|
3138
|
+
config.signal.removeEventListener("abort", abort);
|
|
3139
|
+
}
|
|
3140
|
+
emitter.removeAllListeners();
|
|
3141
|
+
}
|
|
3142
|
+
function done(value, isRejected) {
|
|
3143
|
+
if (isDone) return;
|
|
3144
|
+
isDone = true;
|
|
3145
|
+
if (isRejected) {
|
|
3146
|
+
rejected = true;
|
|
3147
|
+
onFinished();
|
|
3148
|
+
}
|
|
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
|
+
};
|
|
3157
|
+
function abort(reason) {
|
|
3158
|
+
emitter.emit("abort", !reason || reason.type ? new CanceledError_default(null, config, req) : reason);
|
|
3159
|
+
}
|
|
3160
|
+
emitter.once("abort", reject);
|
|
3161
|
+
if (config.cancelToken || config.signal) {
|
|
3162
|
+
config.cancelToken && config.cancelToken.subscribe(abort);
|
|
3163
|
+
if (config.signal) {
|
|
3164
|
+
config.signal.aborted ? abort() : config.signal.addEventListener("abort", abort);
|
|
3165
|
+
}
|
|
3166
|
+
}
|
|
3167
|
+
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
3168
|
+
const parsed = new URL(fullPath, "http://localhost");
|
|
3169
|
+
const protocol = parsed.protocol || supportedProtocols[0];
|
|
3170
|
+
if (protocol === "data:") {
|
|
3171
|
+
let convertedData;
|
|
3172
|
+
if (method !== "GET") {
|
|
3173
|
+
return settle(resolve, reject, {
|
|
3174
|
+
status: 405,
|
|
3175
|
+
statusText: "method not allowed",
|
|
3176
|
+
headers: {},
|
|
3177
|
+
config
|
|
3178
|
+
});
|
|
3179
|
+
}
|
|
3180
|
+
try {
|
|
3181
|
+
convertedData = fromDataURI(config.url, responseType === "blob", {
|
|
3182
|
+
Blob: config.env && config.env.Blob
|
|
3183
|
+
});
|
|
3184
|
+
} catch (err) {
|
|
3185
|
+
throw AxiosError_default.from(err, AxiosError_default.ERR_BAD_REQUEST, config);
|
|
3186
|
+
}
|
|
3187
|
+
if (responseType === "text") {
|
|
3188
|
+
convertedData = convertedData.toString(responseEncoding);
|
|
3189
|
+
if (!responseEncoding || responseEncoding === "utf8") {
|
|
3190
|
+
convertedData = utils_default.stripBOM(convertedData);
|
|
3191
|
+
}
|
|
3192
|
+
} else if (responseType === "stream") {
|
|
3193
|
+
convertedData = import_stream4.default.Readable.from(convertedData);
|
|
3194
|
+
}
|
|
3195
|
+
return settle(resolve, reject, {
|
|
3196
|
+
data: convertedData,
|
|
3197
|
+
status: 200,
|
|
3198
|
+
statusText: "OK",
|
|
3199
|
+
headers: new AxiosHeaders_default(),
|
|
3200
|
+
config
|
|
3201
|
+
});
|
|
3202
|
+
}
|
|
3203
|
+
if (supportedProtocols.indexOf(protocol) === -1) {
|
|
3204
|
+
return reject(new AxiosError_default(
|
|
3205
|
+
"Unsupported protocol " + protocol,
|
|
3206
|
+
AxiosError_default.ERR_BAD_REQUEST,
|
|
3207
|
+
config
|
|
3208
|
+
));
|
|
3209
|
+
}
|
|
3210
|
+
const headers = AxiosHeaders_default.from(config.headers).normalize();
|
|
3211
|
+
headers.set("User-Agent", "axios/" + VERSION, false);
|
|
3212
|
+
const onDownloadProgress = config.onDownloadProgress;
|
|
3213
|
+
const onUploadProgress = config.onUploadProgress;
|
|
3214
|
+
const maxRate = config.maxRate;
|
|
3215
|
+
let maxUploadRate = void 0;
|
|
3216
|
+
let maxDownloadRate = void 0;
|
|
3217
|
+
if (utils_default.isSpecCompliantForm(data)) {
|
|
3218
|
+
const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
|
|
3219
|
+
data = formDataToStream_default(data, (formHeaders) => {
|
|
3220
|
+
headers.set(formHeaders);
|
|
3221
|
+
}, {
|
|
3222
|
+
tag: `axios-${VERSION}-boundary`,
|
|
3223
|
+
boundary: userBoundary && userBoundary[1] || void 0
|
|
3224
|
+
});
|
|
3225
|
+
} else if (utils_default.isFormData(data) && utils_default.isFunction(data.getHeaders)) {
|
|
3226
|
+
headers.set(data.getHeaders());
|
|
3227
|
+
if (!headers.hasContentLength()) {
|
|
3228
|
+
try {
|
|
3229
|
+
const knownLength = await import_util2.default.promisify(data.getLength).call(data);
|
|
3230
|
+
headers.setContentLength(knownLength);
|
|
3231
|
+
} catch (e) {
|
|
3232
|
+
}
|
|
3233
|
+
}
|
|
3234
|
+
} else if (utils_default.isBlob(data)) {
|
|
3235
|
+
data.size && headers.setContentType(data.type || "application/octet-stream");
|
|
3236
|
+
headers.setContentLength(data.size || 0);
|
|
3237
|
+
data = import_stream4.default.Readable.from(readBlob_default(data));
|
|
3238
|
+
} else if (data && !utils_default.isStream(data)) {
|
|
3239
|
+
if (Buffer.isBuffer(data)) {
|
|
3240
|
+
} else if (utils_default.isArrayBuffer(data)) {
|
|
3241
|
+
data = Buffer.from(new Uint8Array(data));
|
|
3242
|
+
} else if (utils_default.isString(data)) {
|
|
3243
|
+
data = Buffer.from(data, "utf-8");
|
|
3244
|
+
} else {
|
|
3245
|
+
return reject(new AxiosError_default(
|
|
3246
|
+
"Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",
|
|
3247
|
+
AxiosError_default.ERR_BAD_REQUEST,
|
|
3248
|
+
config
|
|
3249
|
+
));
|
|
3250
|
+
}
|
|
3251
|
+
headers.setContentLength(data.length, false);
|
|
3252
|
+
if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
|
|
3253
|
+
return reject(new AxiosError_default(
|
|
3254
|
+
"Request body larger than maxBodyLength limit",
|
|
3255
|
+
AxiosError_default.ERR_BAD_REQUEST,
|
|
3256
|
+
config
|
|
3257
|
+
));
|
|
3258
|
+
}
|
|
3259
|
+
}
|
|
3260
|
+
const contentLength = utils_default.toFiniteNumber(headers.getContentLength());
|
|
3261
|
+
if (utils_default.isArray(maxRate)) {
|
|
3262
|
+
maxUploadRate = maxRate[0];
|
|
3263
|
+
maxDownloadRate = maxRate[1];
|
|
3264
|
+
} else {
|
|
3265
|
+
maxUploadRate = maxDownloadRate = maxRate;
|
|
3266
|
+
}
|
|
3267
|
+
if (data && (onUploadProgress || maxUploadRate)) {
|
|
3268
|
+
if (!utils_default.isStream(data)) {
|
|
3269
|
+
data = import_stream4.default.Readable.from(data, { objectMode: false });
|
|
3270
|
+
}
|
|
3271
|
+
data = import_stream4.default.pipeline([data, new AxiosTransformStream_default({
|
|
3272
|
+
length: contentLength,
|
|
3273
|
+
maxRate: utils_default.toFiniteNumber(maxUploadRate)
|
|
3274
|
+
})], utils_default.noop);
|
|
3275
|
+
onUploadProgress && data.on("progress", (progress) => {
|
|
3276
|
+
onUploadProgress(Object.assign(progress, {
|
|
3277
|
+
upload: true
|
|
3278
|
+
}));
|
|
3279
|
+
});
|
|
3280
|
+
}
|
|
3281
|
+
let auth = void 0;
|
|
3282
|
+
if (config.auth) {
|
|
3283
|
+
const username = config.auth.username || "";
|
|
3284
|
+
const password = config.auth.password || "";
|
|
3285
|
+
auth = username + ":" + password;
|
|
3286
|
+
}
|
|
3287
|
+
if (!auth && parsed.username) {
|
|
3288
|
+
const urlUsername = parsed.username;
|
|
3289
|
+
const urlPassword = parsed.password;
|
|
3290
|
+
auth = urlUsername + ":" + urlPassword;
|
|
3291
|
+
}
|
|
3292
|
+
auth && headers.delete("authorization");
|
|
3293
|
+
let path6;
|
|
3294
|
+
try {
|
|
3295
|
+
path6 = buildURL(
|
|
3296
|
+
parsed.pathname + parsed.search,
|
|
3297
|
+
config.params,
|
|
3298
|
+
config.paramsSerializer
|
|
3299
|
+
).replace(/^\?/, "");
|
|
3300
|
+
} catch (err) {
|
|
3301
|
+
const customErr = new Error(err.message);
|
|
3302
|
+
customErr.config = config;
|
|
3303
|
+
customErr.url = config.url;
|
|
3304
|
+
customErr.exists = true;
|
|
3305
|
+
return reject(customErr);
|
|
3306
|
+
}
|
|
3307
|
+
headers.set(
|
|
3308
|
+
"Accept-Encoding",
|
|
3309
|
+
"gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""),
|
|
3310
|
+
false
|
|
3311
|
+
);
|
|
3312
|
+
const options = {
|
|
3313
|
+
path: path6,
|
|
3314
|
+
method,
|
|
3315
|
+
headers: headers.toJSON(),
|
|
3316
|
+
agents: { http: config.httpAgent, https: config.httpsAgent },
|
|
3317
|
+
auth,
|
|
3318
|
+
protocol,
|
|
3319
|
+
beforeRedirect: dispatchBeforeRedirect,
|
|
3320
|
+
beforeRedirects: {}
|
|
3321
|
+
};
|
|
3322
|
+
if (config.socketPath) {
|
|
3323
|
+
options.socketPath = config.socketPath;
|
|
3324
|
+
} else {
|
|
3325
|
+
options.hostname = parsed.hostname;
|
|
3326
|
+
options.port = parsed.port;
|
|
3327
|
+
setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
|
|
3328
|
+
}
|
|
3329
|
+
let transport;
|
|
3330
|
+
const isHttpsRequest = isHttps.test(options.protocol);
|
|
3331
|
+
options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
|
|
3332
|
+
if (config.transport) {
|
|
3333
|
+
transport = config.transport;
|
|
3334
|
+
} else if (config.maxRedirects === 0) {
|
|
3335
|
+
transport = isHttpsRequest ? import_https.default : import_http.default;
|
|
3336
|
+
} else {
|
|
3337
|
+
if (config.maxRedirects) {
|
|
3338
|
+
options.maxRedirects = config.maxRedirects;
|
|
3339
|
+
}
|
|
3340
|
+
if (config.beforeRedirect) {
|
|
3341
|
+
options.beforeRedirects.config = config.beforeRedirect;
|
|
3342
|
+
}
|
|
3343
|
+
transport = isHttpsRequest ? httpsFollow : httpFollow;
|
|
3344
|
+
}
|
|
3345
|
+
if (config.maxBodyLength > -1) {
|
|
3346
|
+
options.maxBodyLength = config.maxBodyLength;
|
|
3347
|
+
} else {
|
|
3348
|
+
options.maxBodyLength = Infinity;
|
|
3349
|
+
}
|
|
3350
|
+
if (config.insecureHTTPParser) {
|
|
3351
|
+
options.insecureHTTPParser = config.insecureHTTPParser;
|
|
3352
|
+
}
|
|
3353
|
+
req = transport.request(options, function handleResponse(res) {
|
|
3354
|
+
if (req.destroyed) return;
|
|
3355
|
+
const streams = [res];
|
|
3356
|
+
const responseLength = +res.headers["content-length"];
|
|
3357
|
+
if (onDownloadProgress) {
|
|
3358
|
+
const transformStream = new AxiosTransformStream_default({
|
|
3359
|
+
length: utils_default.toFiniteNumber(responseLength),
|
|
3360
|
+
maxRate: utils_default.toFiniteNumber(maxDownloadRate)
|
|
3361
|
+
});
|
|
3362
|
+
onDownloadProgress && transformStream.on("progress", (progress) => {
|
|
3363
|
+
onDownloadProgress(Object.assign(progress, {
|
|
3364
|
+
download: true
|
|
3365
|
+
}));
|
|
3366
|
+
});
|
|
3367
|
+
streams.push(transformStream);
|
|
3368
|
+
}
|
|
3369
|
+
let responseStream = res;
|
|
3370
|
+
const lastRequest = res.req || req;
|
|
3371
|
+
if (config.decompress !== false && res.headers["content-encoding"]) {
|
|
3372
|
+
if (method === "HEAD" || res.statusCode === 204) {
|
|
3373
|
+
delete res.headers["content-encoding"];
|
|
3374
|
+
}
|
|
3375
|
+
switch (res.headers["content-encoding"]) {
|
|
3376
|
+
/*eslint default-case:0*/
|
|
3377
|
+
case "gzip":
|
|
3378
|
+
case "x-gzip":
|
|
3379
|
+
case "compress":
|
|
3380
|
+
case "x-compress":
|
|
3381
|
+
streams.push(import_zlib.default.createUnzip(zlibOptions));
|
|
3382
|
+
delete res.headers["content-encoding"];
|
|
3383
|
+
break;
|
|
3384
|
+
case "deflate":
|
|
3385
|
+
streams.push(new ZlibHeaderTransformStream_default());
|
|
3386
|
+
streams.push(import_zlib.default.createUnzip(zlibOptions));
|
|
3387
|
+
delete res.headers["content-encoding"];
|
|
3388
|
+
break;
|
|
3389
|
+
case "br":
|
|
3390
|
+
if (isBrotliSupported) {
|
|
3391
|
+
streams.push(import_zlib.default.createBrotliDecompress(brotliOptions));
|
|
3392
|
+
delete res.headers["content-encoding"];
|
|
3393
|
+
}
|
|
3394
|
+
}
|
|
3395
|
+
}
|
|
3396
|
+
responseStream = streams.length > 1 ? import_stream4.default.pipeline(streams, utils_default.noop) : streams[0];
|
|
3397
|
+
const offListeners = import_stream4.default.finished(responseStream, () => {
|
|
3398
|
+
offListeners();
|
|
3399
|
+
onFinished();
|
|
3400
|
+
});
|
|
3401
|
+
const response = {
|
|
3402
|
+
status: res.statusCode,
|
|
3403
|
+
statusText: res.statusMessage,
|
|
3404
|
+
headers: new AxiosHeaders_default(res.headers),
|
|
3405
|
+
config,
|
|
3406
|
+
request: lastRequest
|
|
3407
|
+
};
|
|
3408
|
+
if (responseType === "stream") {
|
|
3409
|
+
response.data = responseStream;
|
|
3410
|
+
settle(resolve, reject, response);
|
|
3411
|
+
} else {
|
|
3412
|
+
const responseBuffer = [];
|
|
3413
|
+
let totalResponseBytes = 0;
|
|
3414
|
+
responseStream.on("data", function handleStreamData(chunk) {
|
|
3415
|
+
responseBuffer.push(chunk);
|
|
3416
|
+
totalResponseBytes += chunk.length;
|
|
3417
|
+
if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
|
|
3418
|
+
rejected = true;
|
|
3419
|
+
responseStream.destroy();
|
|
3420
|
+
reject(new AxiosError_default(
|
|
3421
|
+
"maxContentLength size of " + config.maxContentLength + " exceeded",
|
|
3422
|
+
AxiosError_default.ERR_BAD_RESPONSE,
|
|
3423
|
+
config,
|
|
3424
|
+
lastRequest
|
|
3425
|
+
));
|
|
3426
|
+
}
|
|
3427
|
+
});
|
|
3428
|
+
responseStream.on("aborted", function handlerStreamAborted() {
|
|
3429
|
+
if (rejected) {
|
|
3430
|
+
return;
|
|
3431
|
+
}
|
|
3432
|
+
const err = new AxiosError_default(
|
|
3433
|
+
"maxContentLength size of " + config.maxContentLength + " exceeded",
|
|
3434
|
+
AxiosError_default.ERR_BAD_RESPONSE,
|
|
3435
|
+
config,
|
|
3436
|
+
lastRequest
|
|
3437
|
+
);
|
|
3438
|
+
responseStream.destroy(err);
|
|
3439
|
+
reject(err);
|
|
3440
|
+
});
|
|
3441
|
+
responseStream.on("error", function handleStreamError(err) {
|
|
3442
|
+
if (req.destroyed) return;
|
|
3443
|
+
reject(AxiosError_default.from(err, null, config, lastRequest));
|
|
3444
|
+
});
|
|
3445
|
+
responseStream.on("end", function handleStreamEnd() {
|
|
3446
|
+
try {
|
|
3447
|
+
let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
|
|
3448
|
+
if (responseType !== "arraybuffer") {
|
|
3449
|
+
responseData = responseData.toString(responseEncoding);
|
|
3450
|
+
if (!responseEncoding || responseEncoding === "utf8") {
|
|
3451
|
+
responseData = utils_default.stripBOM(responseData);
|
|
3452
|
+
}
|
|
3453
|
+
}
|
|
3454
|
+
response.data = responseData;
|
|
3455
|
+
} catch (err) {
|
|
3456
|
+
reject(AxiosError_default.from(err, null, config, response.request, response));
|
|
3457
|
+
}
|
|
3458
|
+
settle(resolve, reject, response);
|
|
3459
|
+
});
|
|
3460
|
+
}
|
|
3461
|
+
emitter.once("abort", (err) => {
|
|
3462
|
+
if (!responseStream.destroyed) {
|
|
3463
|
+
responseStream.emit("error", err);
|
|
3464
|
+
responseStream.destroy();
|
|
3465
|
+
}
|
|
3466
|
+
});
|
|
3467
|
+
});
|
|
3468
|
+
emitter.once("abort", (err) => {
|
|
3469
|
+
reject(err);
|
|
3470
|
+
req.destroy(err);
|
|
3471
|
+
});
|
|
3472
|
+
req.on("error", function handleRequestError(err) {
|
|
3473
|
+
reject(AxiosError_default.from(err, null, config, req));
|
|
3474
|
+
});
|
|
3475
|
+
req.on("socket", function handleRequestSocket(socket) {
|
|
3476
|
+
socket.setKeepAlive(true, 1e3 * 60);
|
|
3477
|
+
});
|
|
3478
|
+
if (config.timeout) {
|
|
3479
|
+
const timeout = parseInt(config.timeout, 10);
|
|
3480
|
+
if (isNaN(timeout)) {
|
|
3481
|
+
reject(new AxiosError_default(
|
|
3482
|
+
"error trying to parse `config.timeout` to int",
|
|
3483
|
+
AxiosError_default.ERR_BAD_OPTION_VALUE,
|
|
3484
|
+
config,
|
|
3485
|
+
req
|
|
3486
|
+
));
|
|
3487
|
+
return;
|
|
3488
|
+
}
|
|
3489
|
+
req.setTimeout(timeout, function handleRequestTimeout() {
|
|
3490
|
+
if (isDone) return;
|
|
3491
|
+
let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
|
|
3492
|
+
const transitional2 = config.transitional || transitional_default;
|
|
3493
|
+
if (config.timeoutErrorMessage) {
|
|
3494
|
+
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
3495
|
+
}
|
|
3496
|
+
reject(new AxiosError_default(
|
|
3497
|
+
timeoutErrorMessage,
|
|
3498
|
+
transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
|
|
3499
|
+
config,
|
|
3500
|
+
req
|
|
3501
|
+
));
|
|
3502
|
+
abort();
|
|
3503
|
+
});
|
|
3504
|
+
}
|
|
3505
|
+
if (utils_default.isStream(data)) {
|
|
3506
|
+
let ended = false;
|
|
3507
|
+
let errored = false;
|
|
3508
|
+
data.on("end", () => {
|
|
3509
|
+
ended = true;
|
|
3510
|
+
});
|
|
3511
|
+
data.once("error", (err) => {
|
|
3512
|
+
errored = true;
|
|
3513
|
+
req.destroy(err);
|
|
3514
|
+
});
|
|
3515
|
+
data.on("close", () => {
|
|
3516
|
+
if (!ended && !errored) {
|
|
3517
|
+
abort(new CanceledError_default("Request stream has been aborted", config, req));
|
|
3518
|
+
}
|
|
3519
|
+
});
|
|
3520
|
+
data.pipe(req);
|
|
3521
|
+
} else {
|
|
3522
|
+
req.end(data);
|
|
3523
|
+
}
|
|
3524
|
+
});
|
|
3525
|
+
};
|
|
3526
|
+
|
|
3527
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/cookies.js
|
|
3528
|
+
var cookies_default = node_default.isStandardBrowserEnv ? (
|
|
3529
|
+
// Standard browser envs support document.cookie
|
|
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
|
+
}()
|
|
3558
|
+
) : (
|
|
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
|
+
}()
|
|
3571
|
+
);
|
|
368
3572
|
|
|
369
|
-
//
|
|
370
|
-
var
|
|
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
|
+
};
|
|
3598
|
+
}
|
|
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
|
+
);
|
|
371
3613
|
|
|
372
|
-
//
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
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);
|
|
3636
|
+
};
|
|
3637
|
+
}
|
|
3638
|
+
var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
3639
|
+
var xhr_default = isXHRAdapterSupported && function(config) {
|
|
3640
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
3641
|
+
let requestData = config.data;
|
|
3642
|
+
const requestHeaders = AxiosHeaders_default.from(config.headers).normalize();
|
|
3643
|
+
const responseType = config.responseType;
|
|
3644
|
+
let onCanceled;
|
|
3645
|
+
function done() {
|
|
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);
|
|
3655
|
+
}
|
|
3656
|
+
let request = new XMLHttpRequest();
|
|
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;
|
|
3665
|
+
function onloadend() {
|
|
3666
|
+
if (!request) {
|
|
3667
|
+
return;
|
|
3668
|
+
}
|
|
3669
|
+
const responseHeaders = AxiosHeaders_default.from(
|
|
3670
|
+
"getAllResponseHeaders" in request && request.getAllResponseHeaders()
|
|
3671
|
+
);
|
|
3672
|
+
const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
|
|
3673
|
+
const response = {
|
|
3674
|
+
data: responseData,
|
|
3675
|
+
status: request.status,
|
|
3676
|
+
statusText: request.statusText,
|
|
3677
|
+
headers: responseHeaders,
|
|
3678
|
+
config,
|
|
3679
|
+
request
|
|
3680
|
+
};
|
|
3681
|
+
settle(function _resolve(value) {
|
|
3682
|
+
resolve(value);
|
|
3683
|
+
done();
|
|
3684
|
+
}, function _reject(err) {
|
|
3685
|
+
reject(err);
|
|
3686
|
+
done();
|
|
3687
|
+
}, response);
|
|
3688
|
+
request = null;
|
|
3689
|
+
}
|
|
3690
|
+
if ("onloadend" in request) {
|
|
3691
|
+
request.onloadend = onloadend;
|
|
3692
|
+
} else {
|
|
3693
|
+
request.onreadystatechange = function handleLoad() {
|
|
3694
|
+
if (!request || request.readyState !== 4) {
|
|
3695
|
+
return;
|
|
3696
|
+
}
|
|
3697
|
+
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
|
|
3698
|
+
return;
|
|
3699
|
+
}
|
|
3700
|
+
setTimeout(onloadend);
|
|
3701
|
+
};
|
|
3702
|
+
}
|
|
3703
|
+
request.onabort = function handleAbort() {
|
|
3704
|
+
if (!request) {
|
|
3705
|
+
return;
|
|
3706
|
+
}
|
|
3707
|
+
reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request));
|
|
3708
|
+
request = null;
|
|
3709
|
+
};
|
|
3710
|
+
request.onerror = function handleError() {
|
|
3711
|
+
reject(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request));
|
|
3712
|
+
request = null;
|
|
3713
|
+
};
|
|
3714
|
+
request.ontimeout = function handleTimeout() {
|
|
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;
|
|
3719
|
+
}
|
|
3720
|
+
reject(new AxiosError_default(
|
|
3721
|
+
timeoutErrorMessage,
|
|
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);
|
|
3732
|
+
}
|
|
3733
|
+
}
|
|
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);
|
|
3738
|
+
});
|
|
3739
|
+
}
|
|
3740
|
+
if (!utils_default.isUndefined(config.withCredentials)) {
|
|
3741
|
+
request.withCredentials = !!config.withCredentials;
|
|
3742
|
+
}
|
|
3743
|
+
if (responseType && responseType !== "json") {
|
|
3744
|
+
request.responseType = config.responseType;
|
|
3745
|
+
}
|
|
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;
|
|
3756
|
+
}
|
|
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
|
+
}
|
|
3765
|
+
}
|
|
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
|
+
};
|
|
3774
|
+
|
|
3775
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/adapters/adapters.js
|
|
3776
|
+
var knownAdapters = {
|
|
3777
|
+
http: http_default,
|
|
3778
|
+
xhr: xhr_default
|
|
3779
|
+
};
|
|
3780
|
+
utils_default.forEach(knownAdapters, (fn, value) => {
|
|
3781
|
+
if (fn) {
|
|
3782
|
+
try {
|
|
3783
|
+
Object.defineProperty(fn, "name", { value });
|
|
3784
|
+
} catch (e) {
|
|
3785
|
+
}
|
|
3786
|
+
Object.defineProperty(fn, "adapterName", { value });
|
|
3787
|
+
}
|
|
3788
|
+
});
|
|
3789
|
+
var adapters_default = {
|
|
3790
|
+
getAdapter: (adapters) => {
|
|
3791
|
+
adapters = utils_default.isArray(adapters) ? adapters : [adapters];
|
|
3792
|
+
const { length } = adapters;
|
|
3793
|
+
let nameOrAdapter;
|
|
3794
|
+
let adapter;
|
|
3795
|
+
for (let i = 0; i < length; i++) {
|
|
3796
|
+
nameOrAdapter = adapters[i];
|
|
3797
|
+
if (adapter = utils_default.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter) {
|
|
3798
|
+
break;
|
|
3799
|
+
}
|
|
3800
|
+
}
|
|
3801
|
+
if (!adapter) {
|
|
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}'`
|
|
3810
|
+
);
|
|
3811
|
+
}
|
|
3812
|
+
if (!utils_default.isFunction(adapter)) {
|
|
3813
|
+
throw new TypeError("adapter is not a function");
|
|
3814
|
+
}
|
|
3815
|
+
return adapter;
|
|
3816
|
+
},
|
|
3817
|
+
adapters: knownAdapters
|
|
3818
|
+
};
|
|
3819
|
+
|
|
3820
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/core/dispatchRequest.js
|
|
3821
|
+
function throwIfCancellationRequested(config) {
|
|
3822
|
+
if (config.cancelToken) {
|
|
3823
|
+
config.cancelToken.throwIfRequested();
|
|
3824
|
+
}
|
|
3825
|
+
if (config.signal && config.signal.aborted) {
|
|
3826
|
+
throw new CanceledError_default(null, config);
|
|
3827
|
+
}
|
|
3828
|
+
}
|
|
3829
|
+
function dispatchRequest(config) {
|
|
3830
|
+
throwIfCancellationRequested(config);
|
|
3831
|
+
config.headers = AxiosHeaders_default.from(config.headers);
|
|
3832
|
+
config.data = transformData.call(
|
|
3833
|
+
config,
|
|
3834
|
+
config.transformRequest
|
|
3835
|
+
);
|
|
3836
|
+
if (["post", "put", "patch"].indexOf(config.method) !== -1) {
|
|
3837
|
+
config.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
3838
|
+
}
|
|
3839
|
+
const adapter = adapters_default.getAdapter(config.adapter || defaults_default.adapter);
|
|
3840
|
+
return adapter(config).then(function onAdapterResolution(response) {
|
|
3841
|
+
throwIfCancellationRequested(config);
|
|
3842
|
+
response.data = transformData.call(
|
|
3843
|
+
config,
|
|
3844
|
+
config.transformResponse,
|
|
3845
|
+
response
|
|
3846
|
+
);
|
|
3847
|
+
response.headers = AxiosHeaders_default.from(response.headers);
|
|
3848
|
+
return response;
|
|
3849
|
+
}, function onAdapterRejection(reason) {
|
|
3850
|
+
if (!isCancel(reason)) {
|
|
3851
|
+
throwIfCancellationRequested(config);
|
|
3852
|
+
if (reason && reason.response) {
|
|
3853
|
+
reason.response.data = transformData.call(
|
|
3854
|
+
config,
|
|
3855
|
+
config.transformResponse,
|
|
3856
|
+
reason.response
|
|
3857
|
+
);
|
|
3858
|
+
reason.response.headers = AxiosHeaders_default.from(reason.response.headers);
|
|
3859
|
+
}
|
|
3860
|
+
}
|
|
3861
|
+
return Promise.reject(reason);
|
|
3862
|
+
});
|
|
3863
|
+
}
|
|
3864
|
+
|
|
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
|
|
3945
|
+
var validators = {};
|
|
3946
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
3947
|
+
validators[type] = function validator(thing) {
|
|
3948
|
+
return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
|
|
3949
|
+
};
|
|
3950
|
+
});
|
|
3951
|
+
var deprecatedWarnings = {};
|
|
3952
|
+
validators.transitional = function transitional(validator, version2, message) {
|
|
3953
|
+
function formatMessage(opt, desc) {
|
|
3954
|
+
return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
|
|
3955
|
+
}
|
|
3956
|
+
return (value, opt, opts) => {
|
|
3957
|
+
if (validator === false) {
|
|
3958
|
+
throw new AxiosError_default(
|
|
3959
|
+
formatMessage(opt, " has been removed" + (version2 ? " in " + version2 : "")),
|
|
3960
|
+
AxiosError_default.ERR_DEPRECATED
|
|
3961
|
+
);
|
|
3962
|
+
}
|
|
3963
|
+
if (version2 && !deprecatedWarnings[opt]) {
|
|
3964
|
+
deprecatedWarnings[opt] = true;
|
|
3965
|
+
console.warn(
|
|
3966
|
+
formatMessage(
|
|
3967
|
+
opt,
|
|
3968
|
+
" has been deprecated since v" + version2 + " and will be removed in the near future"
|
|
3969
|
+
)
|
|
3970
|
+
);
|
|
3971
|
+
}
|
|
3972
|
+
return validator ? validator(value, opt, opts) : true;
|
|
3973
|
+
};
|
|
3974
|
+
};
|
|
3975
|
+
function assertOptions(options, schema, allowUnknown) {
|
|
3976
|
+
if (typeof options !== "object") {
|
|
3977
|
+
throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE);
|
|
3978
|
+
}
|
|
3979
|
+
const keys = Object.keys(options);
|
|
3980
|
+
let i = keys.length;
|
|
3981
|
+
while (i-- > 0) {
|
|
3982
|
+
const opt = keys[i];
|
|
3983
|
+
const validator = schema[opt];
|
|
3984
|
+
if (validator) {
|
|
3985
|
+
const value = options[opt];
|
|
3986
|
+
const result = value === void 0 || validator(value, opt, options);
|
|
3987
|
+
if (result !== true) {
|
|
3988
|
+
throw new AxiosError_default("option " + opt + " must be " + result, AxiosError_default.ERR_BAD_OPTION_VALUE);
|
|
3989
|
+
}
|
|
3990
|
+
continue;
|
|
3991
|
+
}
|
|
3992
|
+
if (allowUnknown !== true) {
|
|
3993
|
+
throw new AxiosError_default("Unknown option " + opt, AxiosError_default.ERR_BAD_OPTION);
|
|
3994
|
+
}
|
|
3995
|
+
}
|
|
3996
|
+
}
|
|
3997
|
+
var validator_default = {
|
|
3998
|
+
assertOptions,
|
|
3999
|
+
validators
|
|
4000
|
+
};
|
|
4001
|
+
|
|
4002
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/core/Axios.js
|
|
4003
|
+
var validators2 = validator_default.validators;
|
|
4004
|
+
var Axios = class {
|
|
4005
|
+
constructor(instanceConfig) {
|
|
4006
|
+
this.defaults = instanceConfig;
|
|
4007
|
+
this.interceptors = {
|
|
4008
|
+
request: new InterceptorManager_default(),
|
|
4009
|
+
response: new InterceptorManager_default()
|
|
4010
|
+
};
|
|
4011
|
+
}
|
|
4012
|
+
/**
|
|
4013
|
+
* Dispatch a request
|
|
4014
|
+
*
|
|
4015
|
+
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
4016
|
+
* @param {?Object} config
|
|
4017
|
+
*
|
|
4018
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
4019
|
+
*/
|
|
4020
|
+
request(configOrUrl, config) {
|
|
4021
|
+
if (typeof configOrUrl === "string") {
|
|
4022
|
+
config = config || {};
|
|
4023
|
+
config.url = configOrUrl;
|
|
4024
|
+
} else {
|
|
4025
|
+
config = configOrUrl || {};
|
|
4026
|
+
}
|
|
4027
|
+
config = mergeConfig(this.defaults, config);
|
|
4028
|
+
const { transitional: transitional2, paramsSerializer, headers } = config;
|
|
4029
|
+
if (transitional2 !== void 0) {
|
|
4030
|
+
validator_default.assertOptions(transitional2, {
|
|
4031
|
+
silentJSONParsing: validators2.transitional(validators2.boolean),
|
|
4032
|
+
forcedJSONParsing: validators2.transitional(validators2.boolean),
|
|
4033
|
+
clarifyTimeoutError: validators2.transitional(validators2.boolean)
|
|
4034
|
+
}, false);
|
|
4035
|
+
}
|
|
4036
|
+
if (paramsSerializer !== void 0) {
|
|
4037
|
+
validator_default.assertOptions(paramsSerializer, {
|
|
4038
|
+
encode: validators2.function,
|
|
4039
|
+
serialize: validators2.function
|
|
4040
|
+
}, true);
|
|
4041
|
+
}
|
|
4042
|
+
config.method = (config.method || this.defaults.method || "get").toLowerCase();
|
|
4043
|
+
let contextHeaders;
|
|
4044
|
+
contextHeaders = headers && utils_default.merge(
|
|
4045
|
+
headers.common,
|
|
4046
|
+
headers[config.method]
|
|
4047
|
+
);
|
|
4048
|
+
contextHeaders && utils_default.forEach(
|
|
4049
|
+
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
4050
|
+
(method) => {
|
|
4051
|
+
delete headers[method];
|
|
4052
|
+
}
|
|
4053
|
+
);
|
|
4054
|
+
config.headers = AxiosHeaders_default.concat(contextHeaders, headers);
|
|
4055
|
+
const requestInterceptorChain = [];
|
|
4056
|
+
let synchronousRequestInterceptors = true;
|
|
4057
|
+
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
4058
|
+
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
|
|
4059
|
+
return;
|
|
4060
|
+
}
|
|
4061
|
+
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
4062
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
4063
|
+
});
|
|
4064
|
+
const responseInterceptorChain = [];
|
|
4065
|
+
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
4066
|
+
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
4067
|
+
});
|
|
4068
|
+
let promise;
|
|
4069
|
+
let i = 0;
|
|
4070
|
+
let len;
|
|
4071
|
+
if (!synchronousRequestInterceptors) {
|
|
4072
|
+
const chain = [dispatchRequest.bind(this), void 0];
|
|
4073
|
+
chain.unshift.apply(chain, requestInterceptorChain);
|
|
4074
|
+
chain.push.apply(chain, responseInterceptorChain);
|
|
4075
|
+
len = chain.length;
|
|
4076
|
+
promise = Promise.resolve(config);
|
|
4077
|
+
while (i < len) {
|
|
4078
|
+
promise = promise.then(chain[i++], chain[i++]);
|
|
4079
|
+
}
|
|
4080
|
+
return promise;
|
|
4081
|
+
}
|
|
4082
|
+
len = requestInterceptorChain.length;
|
|
4083
|
+
let newConfig = config;
|
|
4084
|
+
i = 0;
|
|
4085
|
+
while (i < len) {
|
|
4086
|
+
const onFulfilled = requestInterceptorChain[i++];
|
|
4087
|
+
const onRejected = requestInterceptorChain[i++];
|
|
4088
|
+
try {
|
|
4089
|
+
newConfig = onFulfilled(newConfig);
|
|
4090
|
+
} catch (error) {
|
|
4091
|
+
onRejected.call(this, error);
|
|
4092
|
+
break;
|
|
4093
|
+
}
|
|
4094
|
+
}
|
|
4095
|
+
try {
|
|
4096
|
+
promise = dispatchRequest.call(this, newConfig);
|
|
4097
|
+
} catch (error) {
|
|
4098
|
+
return Promise.reject(error);
|
|
4099
|
+
}
|
|
4100
|
+
i = 0;
|
|
4101
|
+
len = responseInterceptorChain.length;
|
|
4102
|
+
while (i < len) {
|
|
4103
|
+
promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
|
|
4104
|
+
}
|
|
4105
|
+
return promise;
|
|
4106
|
+
}
|
|
4107
|
+
getUri(config) {
|
|
4108
|
+
config = mergeConfig(this.defaults, config);
|
|
4109
|
+
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
4110
|
+
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
4111
|
+
}
|
|
4112
|
+
};
|
|
4113
|
+
utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData2(method) {
|
|
4114
|
+
Axios.prototype[method] = function(url2, config) {
|
|
4115
|
+
return this.request(mergeConfig(config || {}, {
|
|
4116
|
+
method,
|
|
4117
|
+
url: url2,
|
|
4118
|
+
data: (config || {}).data
|
|
4119
|
+
}));
|
|
4120
|
+
};
|
|
4121
|
+
});
|
|
4122
|
+
utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData2(method) {
|
|
4123
|
+
function generateHTTPMethod(isForm) {
|
|
4124
|
+
return function httpMethod(url2, data, config) {
|
|
4125
|
+
return this.request(mergeConfig(config || {}, {
|
|
4126
|
+
method,
|
|
4127
|
+
headers: isForm ? {
|
|
4128
|
+
"Content-Type": "multipart/form-data"
|
|
4129
|
+
} : {},
|
|
4130
|
+
url: url2,
|
|
4131
|
+
data
|
|
4132
|
+
}));
|
|
4133
|
+
};
|
|
4134
|
+
}
|
|
4135
|
+
Axios.prototype[method] = generateHTTPMethod();
|
|
4136
|
+
Axios.prototype[method + "Form"] = generateHTTPMethod(true);
|
|
4137
|
+
});
|
|
4138
|
+
var Axios_default = Axios;
|
|
4139
|
+
|
|
4140
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/cancel/CancelToken.js
|
|
4141
|
+
var CancelToken = class _CancelToken {
|
|
4142
|
+
constructor(executor) {
|
|
4143
|
+
if (typeof executor !== "function") {
|
|
4144
|
+
throw new TypeError("executor must be a function.");
|
|
4145
|
+
}
|
|
4146
|
+
let resolvePromise;
|
|
4147
|
+
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
4148
|
+
resolvePromise = resolve;
|
|
4149
|
+
});
|
|
4150
|
+
const token = this;
|
|
4151
|
+
this.promise.then((cancel) => {
|
|
4152
|
+
if (!token._listeners) return;
|
|
4153
|
+
let i = token._listeners.length;
|
|
4154
|
+
while (i-- > 0) {
|
|
4155
|
+
token._listeners[i](cancel);
|
|
4156
|
+
}
|
|
4157
|
+
token._listeners = null;
|
|
4158
|
+
});
|
|
4159
|
+
this.promise.then = (onfulfilled) => {
|
|
4160
|
+
let _resolve;
|
|
4161
|
+
const promise = new Promise((resolve) => {
|
|
4162
|
+
token.subscribe(resolve);
|
|
4163
|
+
_resolve = resolve;
|
|
4164
|
+
}).then(onfulfilled);
|
|
4165
|
+
promise.cancel = function reject() {
|
|
4166
|
+
token.unsubscribe(_resolve);
|
|
4167
|
+
};
|
|
4168
|
+
return promise;
|
|
4169
|
+
};
|
|
4170
|
+
executor(function cancel(message, config, request) {
|
|
4171
|
+
if (token.reason) {
|
|
4172
|
+
return;
|
|
4173
|
+
}
|
|
4174
|
+
token.reason = new CanceledError_default(message, config, request);
|
|
4175
|
+
resolvePromise(token.reason);
|
|
4176
|
+
});
|
|
4177
|
+
}
|
|
4178
|
+
/**
|
|
4179
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
4180
|
+
*/
|
|
4181
|
+
throwIfRequested() {
|
|
4182
|
+
if (this.reason) {
|
|
4183
|
+
throw this.reason;
|
|
4184
|
+
}
|
|
4185
|
+
}
|
|
4186
|
+
/**
|
|
4187
|
+
* Subscribe to the cancel signal
|
|
4188
|
+
*/
|
|
4189
|
+
subscribe(listener) {
|
|
4190
|
+
if (this.reason) {
|
|
4191
|
+
listener(this.reason);
|
|
4192
|
+
return;
|
|
4193
|
+
}
|
|
4194
|
+
if (this._listeners) {
|
|
4195
|
+
this._listeners.push(listener);
|
|
4196
|
+
} else {
|
|
4197
|
+
this._listeners = [listener];
|
|
4198
|
+
}
|
|
4199
|
+
}
|
|
4200
|
+
/**
|
|
4201
|
+
* Unsubscribe from the cancel signal
|
|
4202
|
+
*/
|
|
4203
|
+
unsubscribe(listener) {
|
|
4204
|
+
if (!this._listeners) {
|
|
4205
|
+
return;
|
|
4206
|
+
}
|
|
4207
|
+
const index = this._listeners.indexOf(listener);
|
|
4208
|
+
if (index !== -1) {
|
|
4209
|
+
this._listeners.splice(index, 1);
|
|
4210
|
+
}
|
|
4211
|
+
}
|
|
4212
|
+
/**
|
|
4213
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
4214
|
+
* cancels the `CancelToken`.
|
|
4215
|
+
*/
|
|
4216
|
+
static source() {
|
|
4217
|
+
let cancel;
|
|
4218
|
+
const token = new _CancelToken(function executor(c) {
|
|
4219
|
+
cancel = c;
|
|
4220
|
+
});
|
|
4221
|
+
return {
|
|
4222
|
+
token,
|
|
4223
|
+
cancel
|
|
4224
|
+
};
|
|
4225
|
+
}
|
|
4226
|
+
};
|
|
4227
|
+
var CancelToken_default = CancelToken;
|
|
4228
|
+
|
|
4229
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/spread.js
|
|
4230
|
+
function spread(callback) {
|
|
4231
|
+
return function wrap(arr) {
|
|
4232
|
+
return callback.apply(null, arr);
|
|
4233
|
+
};
|
|
4234
|
+
}
|
|
4235
|
+
|
|
4236
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/isAxiosError.js
|
|
4237
|
+
function isAxiosError(payload) {
|
|
4238
|
+
return utils_default.isObject(payload) && payload.isAxiosError === true;
|
|
4239
|
+
}
|
|
4240
|
+
|
|
4241
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/helpers/HttpStatusCode.js
|
|
4242
|
+
var HttpStatusCode = {
|
|
4243
|
+
Continue: 100,
|
|
4244
|
+
SwitchingProtocols: 101,
|
|
4245
|
+
Processing: 102,
|
|
4246
|
+
EarlyHints: 103,
|
|
4247
|
+
Ok: 200,
|
|
4248
|
+
Created: 201,
|
|
4249
|
+
Accepted: 202,
|
|
4250
|
+
NonAuthoritativeInformation: 203,
|
|
4251
|
+
NoContent: 204,
|
|
4252
|
+
ResetContent: 205,
|
|
4253
|
+
PartialContent: 206,
|
|
4254
|
+
MultiStatus: 207,
|
|
4255
|
+
AlreadyReported: 208,
|
|
4256
|
+
ImUsed: 226,
|
|
4257
|
+
MultipleChoices: 300,
|
|
4258
|
+
MovedPermanently: 301,
|
|
4259
|
+
Found: 302,
|
|
4260
|
+
SeeOther: 303,
|
|
4261
|
+
NotModified: 304,
|
|
4262
|
+
UseProxy: 305,
|
|
4263
|
+
Unused: 306,
|
|
4264
|
+
TemporaryRedirect: 307,
|
|
4265
|
+
PermanentRedirect: 308,
|
|
4266
|
+
BadRequest: 400,
|
|
4267
|
+
Unauthorized: 401,
|
|
4268
|
+
PaymentRequired: 402,
|
|
4269
|
+
Forbidden: 403,
|
|
4270
|
+
NotFound: 404,
|
|
4271
|
+
MethodNotAllowed: 405,
|
|
4272
|
+
NotAcceptable: 406,
|
|
4273
|
+
ProxyAuthenticationRequired: 407,
|
|
4274
|
+
RequestTimeout: 408,
|
|
4275
|
+
Conflict: 409,
|
|
4276
|
+
Gone: 410,
|
|
4277
|
+
LengthRequired: 411,
|
|
4278
|
+
PreconditionFailed: 412,
|
|
4279
|
+
PayloadTooLarge: 413,
|
|
4280
|
+
UriTooLong: 414,
|
|
4281
|
+
UnsupportedMediaType: 415,
|
|
4282
|
+
RangeNotSatisfiable: 416,
|
|
4283
|
+
ExpectationFailed: 417,
|
|
4284
|
+
ImATeapot: 418,
|
|
4285
|
+
MisdirectedRequest: 421,
|
|
4286
|
+
UnprocessableEntity: 422,
|
|
4287
|
+
Locked: 423,
|
|
4288
|
+
FailedDependency: 424,
|
|
4289
|
+
TooEarly: 425,
|
|
4290
|
+
UpgradeRequired: 426,
|
|
4291
|
+
PreconditionRequired: 428,
|
|
4292
|
+
TooManyRequests: 429,
|
|
4293
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
4294
|
+
UnavailableForLegalReasons: 451,
|
|
4295
|
+
InternalServerError: 500,
|
|
4296
|
+
NotImplemented: 501,
|
|
4297
|
+
BadGateway: 502,
|
|
4298
|
+
ServiceUnavailable: 503,
|
|
4299
|
+
GatewayTimeout: 504,
|
|
4300
|
+
HttpVersionNotSupported: 505,
|
|
4301
|
+
VariantAlsoNegotiates: 506,
|
|
4302
|
+
InsufficientStorage: 507,
|
|
4303
|
+
LoopDetected: 508,
|
|
4304
|
+
NotExtended: 510,
|
|
4305
|
+
NetworkAuthenticationRequired: 511
|
|
4306
|
+
};
|
|
4307
|
+
Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
4308
|
+
HttpStatusCode[value] = key;
|
|
4309
|
+
});
|
|
4310
|
+
var HttpStatusCode_default = HttpStatusCode;
|
|
4311
|
+
|
|
4312
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/lib/axios.js
|
|
4313
|
+
function createInstance(defaultConfig) {
|
|
4314
|
+
const context = new Axios_default(defaultConfig);
|
|
4315
|
+
const instance = bind(Axios_default.prototype.request, context);
|
|
4316
|
+
utils_default.extend(instance, Axios_default.prototype, context, { allOwnKeys: true });
|
|
4317
|
+
utils_default.extend(instance, context, null, { allOwnKeys: true });
|
|
4318
|
+
instance.create = function create(instanceConfig) {
|
|
4319
|
+
return createInstance(mergeConfig(defaultConfig, instanceConfig));
|
|
4320
|
+
};
|
|
4321
|
+
return instance;
|
|
4322
|
+
}
|
|
4323
|
+
var axios = createInstance(defaults_default);
|
|
4324
|
+
axios.Axios = Axios_default;
|
|
4325
|
+
axios.CanceledError = CanceledError_default;
|
|
4326
|
+
axios.CancelToken = CancelToken_default;
|
|
4327
|
+
axios.isCancel = isCancel;
|
|
4328
|
+
axios.VERSION = VERSION;
|
|
4329
|
+
axios.toFormData = toFormData_default;
|
|
4330
|
+
axios.AxiosError = AxiosError_default;
|
|
4331
|
+
axios.Cancel = axios.CanceledError;
|
|
4332
|
+
axios.all = function all(promises) {
|
|
4333
|
+
return Promise.all(promises);
|
|
4334
|
+
};
|
|
4335
|
+
axios.spread = spread;
|
|
4336
|
+
axios.isAxiosError = isAxiosError;
|
|
4337
|
+
axios.mergeConfig = mergeConfig;
|
|
4338
|
+
axios.AxiosHeaders = AxiosHeaders_default;
|
|
4339
|
+
axios.formToJSON = (thing) => formDataToJSON_default(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
4340
|
+
axios.HttpStatusCode = HttpStatusCode_default;
|
|
4341
|
+
axios.default = axios;
|
|
4342
|
+
var axios_default = axios;
|
|
4343
|
+
|
|
4344
|
+
// node_modules/.pnpm/axios@1.3.2/node_modules/axios/index.js
|
|
4345
|
+
var {
|
|
4346
|
+
Axios: Axios2,
|
|
4347
|
+
AxiosError: AxiosError2,
|
|
4348
|
+
CanceledError: CanceledError2,
|
|
4349
|
+
isCancel: isCancel2,
|
|
4350
|
+
CancelToken: CancelToken2,
|
|
4351
|
+
VERSION: VERSION2,
|
|
4352
|
+
all: all2,
|
|
4353
|
+
Cancel,
|
|
4354
|
+
isAxiosError: isAxiosError2,
|
|
4355
|
+
spread: spread2,
|
|
4356
|
+
toFormData: toFormData2,
|
|
4357
|
+
AxiosHeaders: AxiosHeaders2,
|
|
4358
|
+
HttpStatusCode: HttpStatusCode2,
|
|
4359
|
+
formToJSON,
|
|
4360
|
+
mergeConfig: mergeConfig2
|
|
4361
|
+
} = axios_default;
|
|
377
4362
|
|
|
378
4363
|
// bin/utils/uploadToIpfs.ts
|
|
379
|
-
var import_axios = __toESM(require("axios"));
|
|
380
4364
|
var import_fs_extra3 = __toESM(require("fs-extra"));
|
|
381
4365
|
var import_path4 = __toESM(require("path"));
|
|
382
|
-
var
|
|
4366
|
+
var import_form_data2 = __toESM(require("form-data"));
|
|
383
4367
|
var import_ora = __toESM(require("ora"));
|
|
384
4368
|
var import_chalk2 = __toESM(require("chalk"));
|
|
385
4369
|
|
|
@@ -546,7 +4530,7 @@ var dirPath = null;
|
|
|
546
4530
|
function loadFilesToArrRecursively(directoryPath, dist) {
|
|
547
4531
|
const filesArr = [];
|
|
548
4532
|
const sep = import_path4.default.sep;
|
|
549
|
-
dirPath
|
|
4533
|
+
dirPath = dirPath || directoryPath.replace(dist, "");
|
|
550
4534
|
if (import_fs_extra3.default.statSync(directoryPath).isDirectory()) {
|
|
551
4535
|
const files = import_fs_extra3.default.readdirSync(directoryPath);
|
|
552
4536
|
files.forEach((file) => {
|
|
@@ -599,33 +4583,43 @@ async function uploadDirectory(directoryPath, deviceId) {
|
|
|
599
4583
|
)} (size: ${formatSize(sizeCheck.size)})`
|
|
600
4584
|
);
|
|
601
4585
|
}
|
|
602
|
-
const formData = new
|
|
4586
|
+
const formData = new import_form_data2.default();
|
|
603
4587
|
if (directoryPath.endsWith(import_path4.default.sep))
|
|
604
4588
|
directoryPath = directoryPath.slice(0, -1);
|
|
605
4589
|
const dist = directoryPath.split(import_path4.default.sep).pop() || "";
|
|
606
4590
|
const files = loadFilesToArrRecursively(directoryPath, dist);
|
|
4591
|
+
const totalFiles = files.length;
|
|
607
4592
|
files.forEach((file) => {
|
|
608
4593
|
formData.append("file", import_fs_extra3.default.createReadStream(file.path), {
|
|
609
4594
|
filename: file.name
|
|
610
4595
|
});
|
|
611
4596
|
});
|
|
612
|
-
const
|
|
4597
|
+
const startTime = Date.now();
|
|
4598
|
+
const spinner = (0, import_ora.default)(`Uploading ${dist} (${totalFiles} files)... 0s`).start();
|
|
4599
|
+
const timeInterval = setInterval(() => {
|
|
4600
|
+
const elapsed = Math.floor((Date.now() - startTime) / 1e3);
|
|
4601
|
+
spinner.text = `Uploading ${dist} (${totalFiles} files)... ${elapsed}s`;
|
|
4602
|
+
}, 1e3);
|
|
613
4603
|
try {
|
|
614
|
-
const response = await
|
|
4604
|
+
const response = await axios_default.post(
|
|
615
4605
|
`${ipfsApiUrl}/add?uid=${deviceId}&cidV=1`,
|
|
616
4606
|
formData,
|
|
617
4607
|
{
|
|
618
4608
|
headers: {
|
|
619
4609
|
...formData.getHeaders()
|
|
620
|
-
}
|
|
4610
|
+
},
|
|
4611
|
+
timeout: 18e5
|
|
4612
|
+
// 30 minutes timeout
|
|
621
4613
|
}
|
|
622
4614
|
);
|
|
4615
|
+
clearInterval(timeInterval);
|
|
623
4616
|
const resData = response.data.data;
|
|
624
4617
|
if (Array.isArray(resData) && resData.length > 0) {
|
|
625
4618
|
const directoryItem = resData.find((item) => item.Name === dist);
|
|
626
4619
|
if (directoryItem) {
|
|
4620
|
+
const elapsed = Math.floor((Date.now() - startTime) / 1e3);
|
|
627
4621
|
spinner.succeed(
|
|
628
|
-
`Successfully uploaded ${
|
|
4622
|
+
`Successfully uploaded ${dist} (${totalFiles} files) in ${elapsed}s`
|
|
629
4623
|
);
|
|
630
4624
|
const fileCount = countFilesInDirectory(directoryPath);
|
|
631
4625
|
const uploadData = {
|
|
@@ -652,6 +4646,7 @@ async function uploadDirectory(directoryPath, deviceId) {
|
|
|
652
4646
|
}
|
|
653
4647
|
return null;
|
|
654
4648
|
} catch (error) {
|
|
4649
|
+
clearInterval(timeInterval);
|
|
655
4650
|
if (error.response && error.response.data && error.response.data.code) {
|
|
656
4651
|
const errorCode = error.response.data.code.toString();
|
|
657
4652
|
if (ERROR_CODES[errorCode]) {
|
|
@@ -676,28 +4671,37 @@ async function uploadFile(filePath, deviceId) {
|
|
|
676
4671
|
)} (size: ${formatSize(sizeCheck.size)})`
|
|
677
4672
|
);
|
|
678
4673
|
}
|
|
679
|
-
const
|
|
4674
|
+
const fileName = filePath.split(import_path4.default.sep).pop() || "";
|
|
4675
|
+
const startTime = Date.now();
|
|
4676
|
+
const spinner = (0, import_ora.default)(`Uploading ${fileName}... 0s`).start();
|
|
4677
|
+
const timeInterval = setInterval(() => {
|
|
4678
|
+
const elapsed = Math.floor((Date.now() - startTime) / 1e3);
|
|
4679
|
+
spinner.text = `Uploading ${fileName}... ${elapsed}s`;
|
|
4680
|
+
}, 1e3);
|
|
680
4681
|
try {
|
|
681
|
-
const formData = new
|
|
682
|
-
const fileName = filePath.split(import_path4.default.sep).pop() || "";
|
|
4682
|
+
const formData = new import_form_data2.default();
|
|
683
4683
|
const encodedFileName = encodeURIComponent(fileName);
|
|
684
4684
|
formData.append("file", import_fs_extra3.default.createReadStream(filePath), {
|
|
685
4685
|
filename: encodedFileName
|
|
686
4686
|
});
|
|
687
|
-
const response = await
|
|
4687
|
+
const response = await axios_default.post(
|
|
688
4688
|
`${ipfsApiUrl}/add?uid=${deviceId}&cidV=1`,
|
|
689
4689
|
formData,
|
|
690
4690
|
{
|
|
691
4691
|
headers: {
|
|
692
4692
|
...formData.getHeaders()
|
|
693
|
-
}
|
|
4693
|
+
},
|
|
4694
|
+
timeout: 18e5
|
|
4695
|
+
// 30 minutes timeout
|
|
694
4696
|
}
|
|
695
4697
|
);
|
|
4698
|
+
clearInterval(timeInterval);
|
|
696
4699
|
const resData = response.data.data;
|
|
697
4700
|
if (Array.isArray(resData) && resData.length > 0) {
|
|
698
4701
|
const fileItem = resData.find((item) => item.Name === fileName);
|
|
699
4702
|
if (fileItem) {
|
|
700
|
-
|
|
4703
|
+
const elapsed = Math.floor((Date.now() - startTime) / 1e3);
|
|
4704
|
+
spinner.succeed(`Successfully uploaded ${fileName} in ${elapsed}s`);
|
|
701
4705
|
const uploadData = {
|
|
702
4706
|
path: filePath,
|
|
703
4707
|
filename: fileName,
|
|
@@ -722,6 +4726,7 @@ async function uploadFile(filePath, deviceId) {
|
|
|
722
4726
|
}
|
|
723
4727
|
return null;
|
|
724
4728
|
} catch (error) {
|
|
4729
|
+
clearInterval(timeInterval);
|
|
725
4730
|
if (error.response && error.response.data && error.response.data.code) {
|
|
726
4731
|
const errorCode = error.response.data.code.toString();
|
|
727
4732
|
if (ERROR_CODES[errorCode]) {
|
|
@@ -801,7 +4806,7 @@ var upload_default = async (options) => {
|
|
|
801
4806
|
try {
|
|
802
4807
|
console.log(
|
|
803
4808
|
import_figlet.default.textSync("PINME", {
|
|
804
|
-
font: "
|
|
4809
|
+
font: "Standard",
|
|
805
4810
|
horizontalLayout: "default",
|
|
806
4811
|
verticalLayout: "default",
|
|
807
4812
|
width: 180,
|
|
@@ -869,19 +4874,220 @@ var upload_default = async (options) => {
|
|
|
869
4874
|
}
|
|
870
4875
|
};
|
|
871
4876
|
|
|
4877
|
+
// bin/remove.ts
|
|
4878
|
+
var import_chalk5 = __toESM(require("chalk"));
|
|
4879
|
+
var import_inquirer2 = __toESM(require("inquirer"));
|
|
4880
|
+
var import_figlet2 = __toESM(require("figlet"));
|
|
4881
|
+
|
|
4882
|
+
// bin/utils/removeFromIpfs.ts
|
|
4883
|
+
var import_chalk4 = __toESM(require("chalk"));
|
|
4884
|
+
var ipfsApiUrl2 = "https://pinme.dev/api/v2";
|
|
4885
|
+
async function removeFromIpfs(value, type = "hash") {
|
|
4886
|
+
try {
|
|
4887
|
+
const uid = getDeviceId();
|
|
4888
|
+
console.log(import_chalk4.default.blue(`Removing content from IPFS: ${value}...`));
|
|
4889
|
+
const queryParams = new URLSearchParams({
|
|
4890
|
+
uid
|
|
4891
|
+
});
|
|
4892
|
+
if (type === "subname") {
|
|
4893
|
+
queryParams.append("subname", value);
|
|
4894
|
+
} else {
|
|
4895
|
+
queryParams.append("arg", value);
|
|
4896
|
+
}
|
|
4897
|
+
const response = await axios_default.post(`${ipfsApiUrl2}/block/rm?${queryParams.toString()}`, {
|
|
4898
|
+
timeout: 3e4
|
|
4899
|
+
// 30 seconds timeout
|
|
4900
|
+
});
|
|
4901
|
+
const { code, msg, data } = response.data;
|
|
4902
|
+
if (code === 200) {
|
|
4903
|
+
console.log(import_chalk4.default.green("\u2713 Removal successful!"));
|
|
4904
|
+
console.log(import_chalk4.default.cyan(`Content ${type}: ${value} has been removed from IPFS network`));
|
|
4905
|
+
return true;
|
|
4906
|
+
} else {
|
|
4907
|
+
console.log(import_chalk4.default.red("\u2717 Removal failed"));
|
|
4908
|
+
console.log(import_chalk4.default.red(`Error: ${msg || "Unknown error occurred"}`));
|
|
4909
|
+
return false;
|
|
4910
|
+
}
|
|
4911
|
+
} catch (error) {
|
|
4912
|
+
console.log(import_chalk4.default.red("\u2717 Removal failed", error));
|
|
4913
|
+
if (error.response) {
|
|
4914
|
+
const { status, data } = error.response;
|
|
4915
|
+
console.log(import_chalk4.default.red(`HTTP Error ${status}: ${(data == null ? void 0 : data.msg) || "Server error"}`));
|
|
4916
|
+
if (status === 404) {
|
|
4917
|
+
console.log(import_chalk4.default.yellow("Content not found on the network or already removed"));
|
|
4918
|
+
} else if (status === 403) {
|
|
4919
|
+
console.log(import_chalk4.default.yellow("Permission denied - you may not have access to remove this content"));
|
|
4920
|
+
} else if (status === 500) {
|
|
4921
|
+
console.log(import_chalk4.default.yellow("Server internal error - please try again later"));
|
|
4922
|
+
}
|
|
4923
|
+
} else if (error.request) {
|
|
4924
|
+
console.log(import_chalk4.default.red("Network error: Unable to connect to IPFS service"));
|
|
4925
|
+
console.log(import_chalk4.default.yellow("Please check your internet connection and try again"));
|
|
4926
|
+
} else {
|
|
4927
|
+
console.log(import_chalk4.default.red(`Error: ${error.message}`));
|
|
4928
|
+
}
|
|
4929
|
+
return false;
|
|
4930
|
+
}
|
|
4931
|
+
}
|
|
4932
|
+
|
|
4933
|
+
// bin/remove.ts
|
|
4934
|
+
function isValidIPFSHash(hash) {
|
|
4935
|
+
const v0Pattern = /^Qm[1-9A-HJ-NP-Za-km-z]{44}$/;
|
|
4936
|
+
const v1Pattern = /^bafy[a-z2-7]{50,}$/;
|
|
4937
|
+
const v1kPattern = /^bafk[a-z2-7]{50,}$/;
|
|
4938
|
+
const v1bePattern = /^bafybe[a-z2-7]{50,}$/;
|
|
4939
|
+
return v0Pattern.test(hash) || v1Pattern.test(hash) || v1kPattern.test(hash) || v1bePattern.test(hash);
|
|
4940
|
+
}
|
|
4941
|
+
function isValidSubname(subname) {
|
|
4942
|
+
const subnamePattern = /^[a-zA-Z0-9]{6,12}$/;
|
|
4943
|
+
return subnamePattern.test(subname);
|
|
4944
|
+
}
|
|
4945
|
+
function parseInput(input) {
|
|
4946
|
+
const trimmedInput = input.trim();
|
|
4947
|
+
const hashUrlPattern = /https?:\/\/([a-z0-9]{50,})\.pinme\.dev/i;
|
|
4948
|
+
const hashUrlMatch = trimmedInput.match(hashUrlPattern);
|
|
4949
|
+
if (hashUrlMatch) {
|
|
4950
|
+
const hash = hashUrlMatch[1];
|
|
4951
|
+
if (isValidIPFSHash(hash)) {
|
|
4952
|
+
return { type: "hash", value: hash };
|
|
4953
|
+
}
|
|
4954
|
+
}
|
|
4955
|
+
if (isValidIPFSHash(trimmedInput)) {
|
|
4956
|
+
return { type: "hash", value: trimmedInput };
|
|
4957
|
+
}
|
|
4958
|
+
const subnameUrlPattern = /https?:\/\/([a-zA-Z0-9]{6,12})\.pinit\.eth\.limo/i;
|
|
4959
|
+
const subnameUrlMatch = trimmedInput.match(subnameUrlPattern);
|
|
4960
|
+
if (subnameUrlMatch) {
|
|
4961
|
+
const subname = subnameUrlMatch[1];
|
|
4962
|
+
if (isValidSubname(subname)) {
|
|
4963
|
+
return { type: "subname", value: subname };
|
|
4964
|
+
}
|
|
4965
|
+
}
|
|
4966
|
+
if (isValidSubname(trimmedInput)) {
|
|
4967
|
+
return { type: "subname", value: trimmedInput };
|
|
4968
|
+
}
|
|
4969
|
+
return null;
|
|
4970
|
+
}
|
|
4971
|
+
var remove_default = async (options) => {
|
|
4972
|
+
try {
|
|
4973
|
+
console.log(
|
|
4974
|
+
import_figlet2.default.textSync("PINME", {
|
|
4975
|
+
font: "Standard",
|
|
4976
|
+
horizontalLayout: "default",
|
|
4977
|
+
verticalLayout: "default",
|
|
4978
|
+
width: 180,
|
|
4979
|
+
whitespaceBreak: true
|
|
4980
|
+
})
|
|
4981
|
+
);
|
|
4982
|
+
const argHash = process.argv[3];
|
|
4983
|
+
if (argHash && !argHash.startsWith("-")) {
|
|
4984
|
+
const parsedInput = parseInput(argHash);
|
|
4985
|
+
if (!parsedInput) {
|
|
4986
|
+
console.log(import_chalk5.default.red(`Invalid input format: ${argHash}`));
|
|
4987
|
+
console.log(import_chalk5.default.yellow("Supported formats:"));
|
|
4988
|
+
console.log(import_chalk5.default.yellow(" - IPFS hash: bafybeig..."));
|
|
4989
|
+
console.log(import_chalk5.default.yellow(" - Full URL: https://bafybeig....pinme.dev"));
|
|
4990
|
+
console.log(import_chalk5.default.yellow(" - Subname: 3abt6ztu"));
|
|
4991
|
+
console.log(import_chalk5.default.yellow(" - Subname URL: https://3abt6ztu.pinit.eth.limo"));
|
|
4992
|
+
return;
|
|
4993
|
+
}
|
|
4994
|
+
try {
|
|
4995
|
+
const success = await removeFromIpfs(parsedInput.value, parsedInput.type);
|
|
4996
|
+
if (success) {
|
|
4997
|
+
console.log(
|
|
4998
|
+
import_chalk5.default.cyan(
|
|
4999
|
+
import_figlet2.default.textSync("Successful", { horizontalLayout: "full" })
|
|
5000
|
+
)
|
|
5001
|
+
);
|
|
5002
|
+
}
|
|
5003
|
+
} catch (error) {
|
|
5004
|
+
console.error(import_chalk5.default.red(`Error: ${error.message}`));
|
|
5005
|
+
}
|
|
5006
|
+
return;
|
|
5007
|
+
}
|
|
5008
|
+
console.log(import_chalk5.default.yellow("\u26A0\uFE0F Warning: This action will permanently remove the content from IPFS network"));
|
|
5009
|
+
console.log(import_chalk5.default.yellow("\u26A0\uFE0F Make sure you have the correct IPFS hash"));
|
|
5010
|
+
console.log("");
|
|
5011
|
+
const confirmAnswer = await import_inquirer2.default.prompt([
|
|
5012
|
+
{
|
|
5013
|
+
type: "confirm",
|
|
5014
|
+
name: "confirm",
|
|
5015
|
+
message: "Do you want to continue?",
|
|
5016
|
+
default: false
|
|
5017
|
+
}
|
|
5018
|
+
]);
|
|
5019
|
+
if (!confirmAnswer.confirm) {
|
|
5020
|
+
console.log(import_chalk5.default.yellow("Operation cancelled"));
|
|
5021
|
+
return;
|
|
5022
|
+
}
|
|
5023
|
+
const answer = await import_inquirer2.default.prompt([
|
|
5024
|
+
{
|
|
5025
|
+
type: "input",
|
|
5026
|
+
name: "input",
|
|
5027
|
+
message: "Enter IPFS hash, subname, or URL to remove:",
|
|
5028
|
+
validate: (input) => {
|
|
5029
|
+
if (!input.trim()) {
|
|
5030
|
+
return "Please enter an IPFS hash, subname, or URL";
|
|
5031
|
+
}
|
|
5032
|
+
const parsedInput = parseInput(input.trim());
|
|
5033
|
+
if (!parsedInput) {
|
|
5034
|
+
return "Invalid format. Supported: IPFS hash, full URL (*.pinme.dev), subname, or subname URL (*.pinit.eth.limo)";
|
|
5035
|
+
}
|
|
5036
|
+
return true;
|
|
5037
|
+
}
|
|
5038
|
+
}
|
|
5039
|
+
]);
|
|
5040
|
+
if (answer.input) {
|
|
5041
|
+
const parsedInput = parseInput(answer.input.trim());
|
|
5042
|
+
if (!parsedInput) {
|
|
5043
|
+
console.log(import_chalk5.default.red("Invalid input format"));
|
|
5044
|
+
return;
|
|
5045
|
+
}
|
|
5046
|
+
const finalConfirm = await import_inquirer2.default.prompt([
|
|
5047
|
+
{
|
|
5048
|
+
type: "confirm",
|
|
5049
|
+
name: "confirm",
|
|
5050
|
+
message: `Are you sure you want to remove ${parsedInput.type === "hash" ? "hash" : "subname"}: ${parsedInput.value}?`,
|
|
5051
|
+
default: false
|
|
5052
|
+
}
|
|
5053
|
+
]);
|
|
5054
|
+
if (!finalConfirm.confirm) {
|
|
5055
|
+
console.log(import_chalk5.default.yellow("Operation cancelled"));
|
|
5056
|
+
return;
|
|
5057
|
+
}
|
|
5058
|
+
try {
|
|
5059
|
+
const success = await removeFromIpfs(parsedInput.value, parsedInput.type);
|
|
5060
|
+
if (success) {
|
|
5061
|
+
console.log(
|
|
5062
|
+
import_chalk5.default.cyan(
|
|
5063
|
+
import_figlet2.default.textSync("Successful", { horizontalLayout: "full" })
|
|
5064
|
+
)
|
|
5065
|
+
);
|
|
5066
|
+
}
|
|
5067
|
+
} catch (error) {
|
|
5068
|
+
console.error(import_chalk5.default.red(`Error: ${error.message}`));
|
|
5069
|
+
}
|
|
5070
|
+
}
|
|
5071
|
+
} catch (error) {
|
|
5072
|
+
console.error(import_chalk5.default.red(`Error executing remove command: ${error.message}`));
|
|
5073
|
+
console.error(error.stack);
|
|
5074
|
+
}
|
|
5075
|
+
};
|
|
5076
|
+
|
|
872
5077
|
// bin/index.ts
|
|
873
5078
|
import_dotenv.default.config();
|
|
874
5079
|
function showBanner() {
|
|
875
5080
|
console.log(
|
|
876
|
-
|
|
877
|
-
|
|
5081
|
+
import_chalk6.default.cyan(
|
|
5082
|
+
import_figlet3.default.textSync("Pinme", { horizontalLayout: "full" })
|
|
878
5083
|
)
|
|
879
5084
|
);
|
|
880
|
-
console.log(
|
|
5085
|
+
console.log(import_chalk6.default.cyan("A command-line tool for uploading files to IPFS\n"));
|
|
881
5086
|
}
|
|
882
5087
|
var program = new import_commander.Command();
|
|
883
5088
|
program.name("pinme").version(version).option("-v, --version", "output the current version");
|
|
884
5089
|
program.command("upload").description("upload a file or directory to IPFS").action(() => upload_default());
|
|
5090
|
+
program.command("rm").description("remove a file from IPFS network").action(() => remove_default());
|
|
885
5091
|
program.command("list").description("show upload history").option("-l, --limit <number>", "limit the number of records to show", parseInt).option("-c, --clear", "clear all upload history").action((options) => {
|
|
886
5092
|
if (options.clear) {
|
|
887
5093
|
clearUploadHistory();
|
|
@@ -904,6 +5110,7 @@ program.on("--help", () => {
|
|
|
904
5110
|
console.log("");
|
|
905
5111
|
console.log("Examples:");
|
|
906
5112
|
console.log(" $ pinme upload");
|
|
5113
|
+
console.log(" $ pinme rm <hash>");
|
|
907
5114
|
console.log(" $ pinme list -l 5");
|
|
908
5115
|
console.log(" $ pinme ls");
|
|
909
5116
|
console.log(" $ pinme help");
|