onlineornot 0.0.13 → 0.0.15
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/onlineornot-dist/cli.js +657 -230
- package/onlineornot-dist/cli.js.map +4 -4
- package/package.json +2 -1
package/onlineornot-dist/cli.js
CHANGED
|
@@ -357,12 +357,12 @@ var require_utils = __commonJS({
|
|
|
357
357
|
head: []
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
|
-
function mergeOptions(
|
|
361
|
-
|
|
360
|
+
function mergeOptions(options4, defaults) {
|
|
361
|
+
options4 = options4 || {};
|
|
362
362
|
defaults = defaults || defaultOptions();
|
|
363
|
-
let ret = Object.assign({}, defaults,
|
|
364
|
-
ret.chars = Object.assign({}, defaults.chars,
|
|
365
|
-
ret.style = Object.assign({}, defaults.style,
|
|
363
|
+
let ret = Object.assign({}, defaults, options4);
|
|
364
|
+
ret.chars = Object.assign({}, defaults.chars, options4.chars);
|
|
365
|
+
ret.style = Object.assign({}, defaults.style, options4.style);
|
|
366
366
|
return ret;
|
|
367
367
|
}
|
|
368
368
|
function wordWrap(maxLength, input) {
|
|
@@ -417,9 +417,9 @@ var require_utils = __commonJS({
|
|
|
417
417
|
function multiLineWordWrap(maxLength, input, wrapOnWordBoundary = true) {
|
|
418
418
|
let output = [];
|
|
419
419
|
input = input.split("\n");
|
|
420
|
-
const
|
|
420
|
+
const handler4 = wrapOnWordBoundary ? wordWrap : textWrap;
|
|
421
421
|
for (let i = 0; i < input.length; i++) {
|
|
422
|
-
output.push.apply(output,
|
|
422
|
+
output.push.apply(output, handler4(maxLength, input[i]));
|
|
423
423
|
}
|
|
424
424
|
return output;
|
|
425
425
|
}
|
|
@@ -633,7 +633,7 @@ var require_supports_colors = __commonJS({
|
|
|
633
633
|
// ../../node_modules/@colors/colors/lib/custom/trap.js
|
|
634
634
|
var require_trap = __commonJS({
|
|
635
635
|
"../../node_modules/@colors/colors/lib/custom/trap.js"(exports, module2) {
|
|
636
|
-
module2["exports"] = function runTheTrap(text,
|
|
636
|
+
module2["exports"] = function runTheTrap(text, options4) {
|
|
637
637
|
var result = "";
|
|
638
638
|
text = text || "Run the trap, drop the bass";
|
|
639
639
|
text = text.split("");
|
|
@@ -702,7 +702,7 @@ var require_trap = __commonJS({
|
|
|
702
702
|
// ../../node_modules/@colors/colors/lib/custom/zalgo.js
|
|
703
703
|
var require_zalgo = __commonJS({
|
|
704
704
|
"../../node_modules/@colors/colors/lib/custom/zalgo.js"(exports, module2) {
|
|
705
|
-
module2["exports"] = function zalgo(text,
|
|
705
|
+
module2["exports"] = function zalgo(text, options4) {
|
|
706
706
|
text = text || " he is here ";
|
|
707
707
|
var soul = {
|
|
708
708
|
"up": [
|
|
@@ -836,15 +836,15 @@ var require_zalgo = __commonJS({
|
|
|
836
836
|
});
|
|
837
837
|
return bool;
|
|
838
838
|
}
|
|
839
|
-
function heComes(text2,
|
|
839
|
+
function heComes(text2, options5) {
|
|
840
840
|
var result = "";
|
|
841
841
|
var counts;
|
|
842
842
|
var l;
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
843
|
+
options5 = options5 || {};
|
|
844
|
+
options5["up"] = typeof options5["up"] !== "undefined" ? options5["up"] : true;
|
|
845
|
+
options5["mid"] = typeof options5["mid"] !== "undefined" ? options5["mid"] : true;
|
|
846
|
+
options5["down"] = typeof options5["down"] !== "undefined" ? options5["down"] : true;
|
|
847
|
+
options5["size"] = typeof options5["size"] !== "undefined" ? options5["size"] : "maxi";
|
|
848
848
|
text2 = text2.split("");
|
|
849
849
|
for (l in text2) {
|
|
850
850
|
if (isChar(l)) {
|
|
@@ -852,7 +852,7 @@ var require_zalgo = __commonJS({
|
|
|
852
852
|
}
|
|
853
853
|
result = result + text2[l];
|
|
854
854
|
counts = { "up": 0, "down": 0, "mid": 0 };
|
|
855
|
-
switch (
|
|
855
|
+
switch (options5.size) {
|
|
856
856
|
case "mini":
|
|
857
857
|
counts.up = randomNumber(8);
|
|
858
858
|
counts.mid = randomNumber(2);
|
|
@@ -873,7 +873,7 @@ var require_zalgo = __commonJS({
|
|
|
873
873
|
for (var d in arr) {
|
|
874
874
|
var index = arr[d];
|
|
875
875
|
for (var i = 0; i <= counts[index]; i++) {
|
|
876
|
-
if (
|
|
876
|
+
if (options5[index]) {
|
|
877
877
|
result = result + soul[index][randomNumber(soul[index].length)];
|
|
878
878
|
}
|
|
879
879
|
}
|
|
@@ -881,7 +881,7 @@ var require_zalgo = __commonJS({
|
|
|
881
881
|
}
|
|
882
882
|
return result;
|
|
883
883
|
}
|
|
884
|
-
return heComes(text,
|
|
884
|
+
return heComes(text, options4);
|
|
885
885
|
};
|
|
886
886
|
}
|
|
887
887
|
});
|
|
@@ -1128,18 +1128,18 @@ var require_cell = __commonJS({
|
|
|
1128
1128
|
* @param options
|
|
1129
1129
|
* @constructor
|
|
1130
1130
|
*/
|
|
1131
|
-
constructor(
|
|
1132
|
-
this.setOptions(
|
|
1131
|
+
constructor(options4) {
|
|
1132
|
+
this.setOptions(options4);
|
|
1133
1133
|
this.x = null;
|
|
1134
1134
|
this.y = null;
|
|
1135
1135
|
}
|
|
1136
|
-
setOptions(
|
|
1137
|
-
if (["boolean", "number", "string"].indexOf(typeof
|
|
1138
|
-
|
|
1136
|
+
setOptions(options4) {
|
|
1137
|
+
if (["boolean", "number", "string"].indexOf(typeof options4) !== -1) {
|
|
1138
|
+
options4 = { content: "" + options4 };
|
|
1139
1139
|
}
|
|
1140
|
-
|
|
1141
|
-
this.options =
|
|
1142
|
-
let content =
|
|
1140
|
+
options4 = options4 || {};
|
|
1141
|
+
this.options = options4;
|
|
1142
|
+
let content = options4.content;
|
|
1143
1143
|
if (["boolean", "number", "string"].indexOf(typeof content) !== -1) {
|
|
1144
1144
|
this.content = String(content);
|
|
1145
1145
|
} else if (!content) {
|
|
@@ -1147,8 +1147,8 @@ var require_cell = __commonJS({
|
|
|
1147
1147
|
} else {
|
|
1148
1148
|
throw new Error("Content needs to be a primitive, got: " + typeof content);
|
|
1149
1149
|
}
|
|
1150
|
-
this.colSpan =
|
|
1151
|
-
this.rowSpan =
|
|
1150
|
+
this.colSpan = options4.colSpan || 1;
|
|
1151
|
+
this.rowSpan = options4.rowSpan || 1;
|
|
1152
1152
|
if (this.options.href) {
|
|
1153
1153
|
Object.defineProperty(this, "href", {
|
|
1154
1154
|
get() {
|
|
@@ -1739,25 +1739,25 @@ var require_table = __commonJS({
|
|
|
1739
1739
|
var Table = class extends Array {
|
|
1740
1740
|
constructor(opts) {
|
|
1741
1741
|
super();
|
|
1742
|
-
const
|
|
1742
|
+
const options4 = utils.mergeOptions(opts);
|
|
1743
1743
|
Object.defineProperty(this, "options", {
|
|
1744
|
-
value:
|
|
1745
|
-
enumerable:
|
|
1744
|
+
value: options4,
|
|
1745
|
+
enumerable: options4.debug
|
|
1746
1746
|
});
|
|
1747
|
-
if (
|
|
1748
|
-
switch (typeof
|
|
1747
|
+
if (options4.debug) {
|
|
1748
|
+
switch (typeof options4.debug) {
|
|
1749
1749
|
case "boolean":
|
|
1750
1750
|
debug.setDebugLevel(debug.WARN);
|
|
1751
1751
|
break;
|
|
1752
1752
|
case "number":
|
|
1753
|
-
debug.setDebugLevel(
|
|
1753
|
+
debug.setDebugLevel(options4.debug);
|
|
1754
1754
|
break;
|
|
1755
1755
|
case "string":
|
|
1756
|
-
debug.setDebugLevel(parseInt(
|
|
1756
|
+
debug.setDebugLevel(parseInt(options4.debug, 10));
|
|
1757
1757
|
break;
|
|
1758
1758
|
default:
|
|
1759
1759
|
debug.setDebugLevel(debug.WARN);
|
|
1760
|
-
debug.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof
|
|
1760
|
+
debug.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof options4.debug}`);
|
|
1761
1761
|
}
|
|
1762
1762
|
Object.defineProperty(this, "messages", {
|
|
1763
1763
|
get() {
|
|
@@ -2592,32 +2592,32 @@ var require_registry_auth_token = __commonJS({
|
|
|
2592
2592
|
var passwordKey = ":_password";
|
|
2593
2593
|
module2.exports = function() {
|
|
2594
2594
|
var checkUrl;
|
|
2595
|
-
var
|
|
2595
|
+
var options4;
|
|
2596
2596
|
if (arguments.length >= 2) {
|
|
2597
2597
|
checkUrl = arguments[0];
|
|
2598
|
-
|
|
2598
|
+
options4 = arguments[1];
|
|
2599
2599
|
} else if (typeof arguments[0] === "string") {
|
|
2600
2600
|
checkUrl = arguments[0];
|
|
2601
2601
|
} else {
|
|
2602
|
-
|
|
2602
|
+
options4 = arguments[0];
|
|
2603
2603
|
}
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
checkUrl = checkUrl ||
|
|
2607
|
-
return getRegistryAuthInfo(checkUrl,
|
|
2604
|
+
options4 = options4 || {};
|
|
2605
|
+
options4.npmrc = options4.npmrc || require_rc()("npm", { registry: "https://registry.npmjs.org/" });
|
|
2606
|
+
checkUrl = checkUrl || options4.npmrc.registry;
|
|
2607
|
+
return getRegistryAuthInfo(checkUrl, options4) || getLegacyAuthInfo(options4.npmrc);
|
|
2608
2608
|
};
|
|
2609
|
-
function getRegistryAuthInfo(checkUrl,
|
|
2609
|
+
function getRegistryAuthInfo(checkUrl, options4) {
|
|
2610
2610
|
var parsed = url.parse(checkUrl, false, true);
|
|
2611
2611
|
var pathname;
|
|
2612
2612
|
while (pathname !== "/" && parsed.pathname !== pathname) {
|
|
2613
2613
|
pathname = parsed.pathname || "/";
|
|
2614
2614
|
var regUrl = "//" + parsed.host + pathname.replace(/\/$/, "");
|
|
2615
|
-
var authInfo = getAuthInfoForUrl(regUrl,
|
|
2615
|
+
var authInfo = getAuthInfoForUrl(regUrl, options4.npmrc);
|
|
2616
2616
|
if (authInfo) {
|
|
2617
2617
|
return authInfo;
|
|
2618
2618
|
}
|
|
2619
|
-
if (!
|
|
2620
|
-
return /\/$/.test(checkUrl) ? void 0 : getRegistryAuthInfo(url.resolve(checkUrl, "."),
|
|
2619
|
+
if (!options4.recursive) {
|
|
2620
|
+
return /\/$/.test(checkUrl) ? void 0 : getRegistryAuthInfo(url.resolve(checkUrl, "."), options4);
|
|
2621
2621
|
}
|
|
2622
2622
|
parsed.pathname = url.resolve(normalizePath(pathname), "..") || "/";
|
|
2623
2623
|
}
|
|
@@ -2723,7 +2723,7 @@ var require_update_check = __commonJS({
|
|
|
2723
2723
|
await writeFile2(file, content, "utf8");
|
|
2724
2724
|
};
|
|
2725
2725
|
var loadPackage = (url, authInfo) => new Promise((resolve5, reject) => {
|
|
2726
|
-
const
|
|
2726
|
+
const options4 = {
|
|
2727
2727
|
host: url.hostname,
|
|
2728
2728
|
path: url.pathname,
|
|
2729
2729
|
port: url.port,
|
|
@@ -2733,10 +2733,10 @@ var require_update_check = __commonJS({
|
|
|
2733
2733
|
timeout: 2e3
|
|
2734
2734
|
};
|
|
2735
2735
|
if (authInfo) {
|
|
2736
|
-
|
|
2736
|
+
options4.headers.authorization = `${authInfo.type} ${authInfo.token}`;
|
|
2737
2737
|
}
|
|
2738
2738
|
const { get } = url.protocol === "https:" ? require("https") : require("http");
|
|
2739
|
-
get(
|
|
2739
|
+
get(options4, (response) => {
|
|
2740
2740
|
const { statusCode } = response;
|
|
2741
2741
|
if (statusCode !== 200) {
|
|
2742
2742
|
const error = new Error(`Request failed with code ${statusCode}`);
|
|
@@ -2826,6 +2826,345 @@ var require_update_check = __commonJS({
|
|
|
2826
2826
|
}
|
|
2827
2827
|
});
|
|
2828
2828
|
|
|
2829
|
+
// ../../node_modules/is-docker/index.js
|
|
2830
|
+
var require_is_docker = __commonJS({
|
|
2831
|
+
"../../node_modules/is-docker/index.js"(exports, module2) {
|
|
2832
|
+
"use strict";
|
|
2833
|
+
var fs = require("fs");
|
|
2834
|
+
var isDocker;
|
|
2835
|
+
function hasDockerEnv() {
|
|
2836
|
+
try {
|
|
2837
|
+
fs.statSync("/.dockerenv");
|
|
2838
|
+
return true;
|
|
2839
|
+
} catch (_) {
|
|
2840
|
+
return false;
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
function hasDockerCGroup() {
|
|
2844
|
+
try {
|
|
2845
|
+
return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
2846
|
+
} catch (_) {
|
|
2847
|
+
return false;
|
|
2848
|
+
}
|
|
2849
|
+
}
|
|
2850
|
+
module2.exports = () => {
|
|
2851
|
+
if (isDocker === void 0) {
|
|
2852
|
+
isDocker = hasDockerEnv() || hasDockerCGroup();
|
|
2853
|
+
}
|
|
2854
|
+
return isDocker;
|
|
2855
|
+
};
|
|
2856
|
+
}
|
|
2857
|
+
});
|
|
2858
|
+
|
|
2859
|
+
// ../../node_modules/is-wsl/index.js
|
|
2860
|
+
var require_is_wsl = __commonJS({
|
|
2861
|
+
"../../node_modules/is-wsl/index.js"(exports, module2) {
|
|
2862
|
+
"use strict";
|
|
2863
|
+
var os3 = require("os");
|
|
2864
|
+
var fs = require("fs");
|
|
2865
|
+
var isDocker = require_is_docker();
|
|
2866
|
+
var isWsl = () => {
|
|
2867
|
+
if (process.platform !== "linux") {
|
|
2868
|
+
return false;
|
|
2869
|
+
}
|
|
2870
|
+
if (os3.release().toLowerCase().includes("microsoft")) {
|
|
2871
|
+
if (isDocker()) {
|
|
2872
|
+
return false;
|
|
2873
|
+
}
|
|
2874
|
+
return true;
|
|
2875
|
+
}
|
|
2876
|
+
try {
|
|
2877
|
+
return fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isDocker() : false;
|
|
2878
|
+
} catch (_) {
|
|
2879
|
+
return false;
|
|
2880
|
+
}
|
|
2881
|
+
};
|
|
2882
|
+
if (process.env.__IS_WSL_TEST__) {
|
|
2883
|
+
module2.exports = isWsl;
|
|
2884
|
+
} else {
|
|
2885
|
+
module2.exports = isWsl();
|
|
2886
|
+
}
|
|
2887
|
+
}
|
|
2888
|
+
});
|
|
2889
|
+
|
|
2890
|
+
// ../../node_modules/define-lazy-prop/index.js
|
|
2891
|
+
var require_define_lazy_prop = __commonJS({
|
|
2892
|
+
"../../node_modules/define-lazy-prop/index.js"(exports, module2) {
|
|
2893
|
+
"use strict";
|
|
2894
|
+
module2.exports = (object, propertyName, fn) => {
|
|
2895
|
+
const define = (value) => Object.defineProperty(object, propertyName, { value, enumerable: true, writable: true });
|
|
2896
|
+
Object.defineProperty(object, propertyName, {
|
|
2897
|
+
configurable: true,
|
|
2898
|
+
enumerable: true,
|
|
2899
|
+
get() {
|
|
2900
|
+
const result = fn();
|
|
2901
|
+
define(result);
|
|
2902
|
+
return result;
|
|
2903
|
+
},
|
|
2904
|
+
set(value) {
|
|
2905
|
+
define(value);
|
|
2906
|
+
}
|
|
2907
|
+
});
|
|
2908
|
+
return object;
|
|
2909
|
+
};
|
|
2910
|
+
}
|
|
2911
|
+
});
|
|
2912
|
+
|
|
2913
|
+
// ../../node_modules/open/index.js
|
|
2914
|
+
var require_open = __commonJS({
|
|
2915
|
+
"../../node_modules/open/index.js"(exports, module2) {
|
|
2916
|
+
var path = require("path");
|
|
2917
|
+
var childProcess = require("child_process");
|
|
2918
|
+
var { promises: fs, constants: fsConstants } = require("fs");
|
|
2919
|
+
var isWsl = require_is_wsl();
|
|
2920
|
+
var isDocker = require_is_docker();
|
|
2921
|
+
var defineLazyProperty = require_define_lazy_prop();
|
|
2922
|
+
var localXdgOpenPath = path.join(__dirname, "xdg-open");
|
|
2923
|
+
var { platform, arch } = process;
|
|
2924
|
+
var hasContainerEnv = () => {
|
|
2925
|
+
try {
|
|
2926
|
+
fs.statSync("/run/.containerenv");
|
|
2927
|
+
return true;
|
|
2928
|
+
} catch {
|
|
2929
|
+
return false;
|
|
2930
|
+
}
|
|
2931
|
+
};
|
|
2932
|
+
var cachedResult;
|
|
2933
|
+
function isInsideContainer() {
|
|
2934
|
+
if (cachedResult === void 0) {
|
|
2935
|
+
cachedResult = hasContainerEnv() || isDocker();
|
|
2936
|
+
}
|
|
2937
|
+
return cachedResult;
|
|
2938
|
+
}
|
|
2939
|
+
var getWslDrivesMountPoint = (() => {
|
|
2940
|
+
const defaultMountPoint = "/mnt/";
|
|
2941
|
+
let mountPoint;
|
|
2942
|
+
return async function() {
|
|
2943
|
+
if (mountPoint) {
|
|
2944
|
+
return mountPoint;
|
|
2945
|
+
}
|
|
2946
|
+
const configFilePath = "/etc/wsl.conf";
|
|
2947
|
+
let isConfigFileExists = false;
|
|
2948
|
+
try {
|
|
2949
|
+
await fs.access(configFilePath, fsConstants.F_OK);
|
|
2950
|
+
isConfigFileExists = true;
|
|
2951
|
+
} catch {
|
|
2952
|
+
}
|
|
2953
|
+
if (!isConfigFileExists) {
|
|
2954
|
+
return defaultMountPoint;
|
|
2955
|
+
}
|
|
2956
|
+
const configContent = await fs.readFile(configFilePath, { encoding: "utf8" });
|
|
2957
|
+
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
|
2958
|
+
if (!configMountPoint) {
|
|
2959
|
+
return defaultMountPoint;
|
|
2960
|
+
}
|
|
2961
|
+
mountPoint = configMountPoint.groups.mountPoint.trim();
|
|
2962
|
+
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
2963
|
+
return mountPoint;
|
|
2964
|
+
};
|
|
2965
|
+
})();
|
|
2966
|
+
var pTryEach = async (array, mapper) => {
|
|
2967
|
+
let latestError;
|
|
2968
|
+
for (const item of array) {
|
|
2969
|
+
try {
|
|
2970
|
+
return await mapper(item);
|
|
2971
|
+
} catch (error) {
|
|
2972
|
+
latestError = error;
|
|
2973
|
+
}
|
|
2974
|
+
}
|
|
2975
|
+
throw latestError;
|
|
2976
|
+
};
|
|
2977
|
+
var baseOpen = async (options4) => {
|
|
2978
|
+
options4 = {
|
|
2979
|
+
wait: false,
|
|
2980
|
+
background: false,
|
|
2981
|
+
newInstance: false,
|
|
2982
|
+
allowNonzeroExitCode: false,
|
|
2983
|
+
...options4
|
|
2984
|
+
};
|
|
2985
|
+
if (Array.isArray(options4.app)) {
|
|
2986
|
+
return pTryEach(options4.app, (singleApp) => baseOpen({
|
|
2987
|
+
...options4,
|
|
2988
|
+
app: singleApp
|
|
2989
|
+
}));
|
|
2990
|
+
}
|
|
2991
|
+
let { name: app, arguments: appArguments = [] } = options4.app || {};
|
|
2992
|
+
appArguments = [...appArguments];
|
|
2993
|
+
if (Array.isArray(app)) {
|
|
2994
|
+
return pTryEach(app, (appName) => baseOpen({
|
|
2995
|
+
...options4,
|
|
2996
|
+
app: {
|
|
2997
|
+
name: appName,
|
|
2998
|
+
arguments: appArguments
|
|
2999
|
+
}
|
|
3000
|
+
}));
|
|
3001
|
+
}
|
|
3002
|
+
let command2;
|
|
3003
|
+
const cliArguments = [];
|
|
3004
|
+
const childProcessOptions = {};
|
|
3005
|
+
if (platform === "darwin") {
|
|
3006
|
+
command2 = "open";
|
|
3007
|
+
if (options4.wait) {
|
|
3008
|
+
cliArguments.push("--wait-apps");
|
|
3009
|
+
}
|
|
3010
|
+
if (options4.background) {
|
|
3011
|
+
cliArguments.push("--background");
|
|
3012
|
+
}
|
|
3013
|
+
if (options4.newInstance) {
|
|
3014
|
+
cliArguments.push("--new");
|
|
3015
|
+
}
|
|
3016
|
+
if (app) {
|
|
3017
|
+
cliArguments.push("-a", app);
|
|
3018
|
+
}
|
|
3019
|
+
} else if (platform === "win32" || isWsl && !isInsideContainer() && !app) {
|
|
3020
|
+
const mountPoint = await getWslDrivesMountPoint();
|
|
3021
|
+
command2 = isWsl ? `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe` : `${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`;
|
|
3022
|
+
cliArguments.push(
|
|
3023
|
+
"-NoProfile",
|
|
3024
|
+
"-NonInteractive",
|
|
3025
|
+
"\u2013ExecutionPolicy",
|
|
3026
|
+
"Bypass",
|
|
3027
|
+
"-EncodedCommand"
|
|
3028
|
+
);
|
|
3029
|
+
if (!isWsl) {
|
|
3030
|
+
childProcessOptions.windowsVerbatimArguments = true;
|
|
3031
|
+
}
|
|
3032
|
+
const encodedArguments = ["Start"];
|
|
3033
|
+
if (options4.wait) {
|
|
3034
|
+
encodedArguments.push("-Wait");
|
|
3035
|
+
}
|
|
3036
|
+
if (app) {
|
|
3037
|
+
encodedArguments.push(`"\`"${app}\`""`, "-ArgumentList");
|
|
3038
|
+
if (options4.target) {
|
|
3039
|
+
appArguments.unshift(options4.target);
|
|
3040
|
+
}
|
|
3041
|
+
} else if (options4.target) {
|
|
3042
|
+
encodedArguments.push(`"${options4.target}"`);
|
|
3043
|
+
}
|
|
3044
|
+
if (appArguments.length > 0) {
|
|
3045
|
+
appArguments = appArguments.map((arg) => `"\`"${arg}\`""`);
|
|
3046
|
+
encodedArguments.push(appArguments.join(","));
|
|
3047
|
+
}
|
|
3048
|
+
options4.target = Buffer.from(encodedArguments.join(" "), "utf16le").toString("base64");
|
|
3049
|
+
} else {
|
|
3050
|
+
if (app) {
|
|
3051
|
+
command2 = app;
|
|
3052
|
+
} else {
|
|
3053
|
+
const isBundled = !__dirname || __dirname === "/";
|
|
3054
|
+
let exeLocalXdgOpen = false;
|
|
3055
|
+
try {
|
|
3056
|
+
await fs.access(localXdgOpenPath, fsConstants.X_OK);
|
|
3057
|
+
exeLocalXdgOpen = true;
|
|
3058
|
+
} catch {
|
|
3059
|
+
}
|
|
3060
|
+
const useSystemXdgOpen = process.versions.electron || platform === "android" || isBundled || !exeLocalXdgOpen;
|
|
3061
|
+
command2 = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
3062
|
+
}
|
|
3063
|
+
if (appArguments.length > 0) {
|
|
3064
|
+
cliArguments.push(...appArguments);
|
|
3065
|
+
}
|
|
3066
|
+
if (!options4.wait) {
|
|
3067
|
+
childProcessOptions.stdio = "ignore";
|
|
3068
|
+
childProcessOptions.detached = true;
|
|
3069
|
+
}
|
|
3070
|
+
}
|
|
3071
|
+
if (options4.target) {
|
|
3072
|
+
cliArguments.push(options4.target);
|
|
3073
|
+
}
|
|
3074
|
+
if (platform === "darwin" && appArguments.length > 0) {
|
|
3075
|
+
cliArguments.push("--args", ...appArguments);
|
|
3076
|
+
}
|
|
3077
|
+
const subprocess = childProcess.spawn(command2, cliArguments, childProcessOptions);
|
|
3078
|
+
if (options4.wait) {
|
|
3079
|
+
return new Promise((resolve5, reject) => {
|
|
3080
|
+
subprocess.once("error", reject);
|
|
3081
|
+
subprocess.once("close", (exitCode) => {
|
|
3082
|
+
if (!options4.allowNonzeroExitCode && exitCode > 0) {
|
|
3083
|
+
reject(new Error(`Exited with code ${exitCode}`));
|
|
3084
|
+
return;
|
|
3085
|
+
}
|
|
3086
|
+
resolve5(subprocess);
|
|
3087
|
+
});
|
|
3088
|
+
});
|
|
3089
|
+
}
|
|
3090
|
+
subprocess.unref();
|
|
3091
|
+
return subprocess;
|
|
3092
|
+
};
|
|
3093
|
+
var open2 = (target, options4) => {
|
|
3094
|
+
if (typeof target !== "string") {
|
|
3095
|
+
throw new TypeError("Expected a `target`");
|
|
3096
|
+
}
|
|
3097
|
+
return baseOpen({
|
|
3098
|
+
...options4,
|
|
3099
|
+
target
|
|
3100
|
+
});
|
|
3101
|
+
};
|
|
3102
|
+
var openApp = (name, options4) => {
|
|
3103
|
+
if (typeof name !== "string") {
|
|
3104
|
+
throw new TypeError("Expected a `name`");
|
|
3105
|
+
}
|
|
3106
|
+
const { arguments: appArguments = [] } = options4 || {};
|
|
3107
|
+
if (appArguments !== void 0 && appArguments !== null && !Array.isArray(appArguments)) {
|
|
3108
|
+
throw new TypeError("Expected `appArguments` as Array type");
|
|
3109
|
+
}
|
|
3110
|
+
return baseOpen({
|
|
3111
|
+
...options4,
|
|
3112
|
+
app: {
|
|
3113
|
+
name,
|
|
3114
|
+
arguments: appArguments
|
|
3115
|
+
}
|
|
3116
|
+
});
|
|
3117
|
+
};
|
|
3118
|
+
function detectArchBinary(binary) {
|
|
3119
|
+
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
3120
|
+
return binary;
|
|
3121
|
+
}
|
|
3122
|
+
const { [arch]: archBinary } = binary;
|
|
3123
|
+
if (!archBinary) {
|
|
3124
|
+
throw new Error(`${arch} is not supported`);
|
|
3125
|
+
}
|
|
3126
|
+
return archBinary;
|
|
3127
|
+
}
|
|
3128
|
+
function detectPlatformBinary({ [platform]: platformBinary }, { wsl }) {
|
|
3129
|
+
if (wsl && isWsl) {
|
|
3130
|
+
return detectArchBinary(wsl);
|
|
3131
|
+
}
|
|
3132
|
+
if (!platformBinary) {
|
|
3133
|
+
throw new Error(`${platform} is not supported`);
|
|
3134
|
+
}
|
|
3135
|
+
return detectArchBinary(platformBinary);
|
|
3136
|
+
}
|
|
3137
|
+
var apps = {};
|
|
3138
|
+
defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
|
|
3139
|
+
darwin: "google chrome",
|
|
3140
|
+
win32: "chrome",
|
|
3141
|
+
linux: ["google-chrome", "google-chrome-stable", "chromium"]
|
|
3142
|
+
}, {
|
|
3143
|
+
wsl: {
|
|
3144
|
+
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
3145
|
+
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
|
|
3146
|
+
}
|
|
3147
|
+
}));
|
|
3148
|
+
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
|
|
3149
|
+
darwin: "firefox",
|
|
3150
|
+
win32: "C:\\Program Files\\Mozilla Firefox\\firefox.exe",
|
|
3151
|
+
linux: "firefox"
|
|
3152
|
+
}, {
|
|
3153
|
+
wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
|
|
3154
|
+
}));
|
|
3155
|
+
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
3156
|
+
darwin: "microsoft edge",
|
|
3157
|
+
win32: "msedge",
|
|
3158
|
+
linux: ["microsoft-edge", "microsoft-edge-dev"]
|
|
3159
|
+
}, {
|
|
3160
|
+
wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
|
|
3161
|
+
}));
|
|
3162
|
+
open2.apps = apps;
|
|
3163
|
+
open2.openApp = openApp;
|
|
3164
|
+
module2.exports = open2;
|
|
3165
|
+
}
|
|
3166
|
+
});
|
|
3167
|
+
|
|
2829
3168
|
// ../../node_modules/undici/lib/core/symbols.js
|
|
2830
3169
|
var require_symbols = __commonJS({
|
|
2831
3170
|
"../../node_modules/undici/lib/core/symbols.js"(exports, module2) {
|
|
@@ -3266,31 +3605,31 @@ var require_util = __commonJS({
|
|
|
3266
3605
|
function isBuffer(buffer) {
|
|
3267
3606
|
return buffer instanceof Uint8Array || Buffer.isBuffer(buffer);
|
|
3268
3607
|
}
|
|
3269
|
-
function validateHandler(
|
|
3270
|
-
if (!
|
|
3608
|
+
function validateHandler(handler4, method, upgrade) {
|
|
3609
|
+
if (!handler4 || typeof handler4 !== "object") {
|
|
3271
3610
|
throw new InvalidArgumentError("handler must be an object");
|
|
3272
3611
|
}
|
|
3273
|
-
if (typeof
|
|
3612
|
+
if (typeof handler4.onConnect !== "function") {
|
|
3274
3613
|
throw new InvalidArgumentError("invalid onConnect method");
|
|
3275
3614
|
}
|
|
3276
|
-
if (typeof
|
|
3615
|
+
if (typeof handler4.onError !== "function") {
|
|
3277
3616
|
throw new InvalidArgumentError("invalid onError method");
|
|
3278
3617
|
}
|
|
3279
|
-
if (typeof
|
|
3618
|
+
if (typeof handler4.onBodySent !== "function" && handler4.onBodySent !== void 0) {
|
|
3280
3619
|
throw new InvalidArgumentError("invalid onBodySent method");
|
|
3281
3620
|
}
|
|
3282
3621
|
if (upgrade || method === "CONNECT") {
|
|
3283
|
-
if (typeof
|
|
3622
|
+
if (typeof handler4.onUpgrade !== "function") {
|
|
3284
3623
|
throw new InvalidArgumentError("invalid onUpgrade method");
|
|
3285
3624
|
}
|
|
3286
3625
|
} else {
|
|
3287
|
-
if (typeof
|
|
3626
|
+
if (typeof handler4.onHeaders !== "function") {
|
|
3288
3627
|
throw new InvalidArgumentError("invalid onHeaders method");
|
|
3289
3628
|
}
|
|
3290
|
-
if (typeof
|
|
3629
|
+
if (typeof handler4.onData !== "function") {
|
|
3291
3630
|
throw new InvalidArgumentError("invalid onData method");
|
|
3292
3631
|
}
|
|
3293
|
-
if (typeof
|
|
3632
|
+
if (typeof handler4.onComplete !== "function") {
|
|
3294
3633
|
throw new InvalidArgumentError("invalid onComplete method");
|
|
3295
3634
|
}
|
|
3296
3635
|
}
|
|
@@ -7346,7 +7685,7 @@ var require_constants = __commonJS({
|
|
|
7346
7685
|
var channel;
|
|
7347
7686
|
var structuredClone = globalThis.structuredClone ?? // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js
|
|
7348
7687
|
// structuredClone was added in v17.0.0, but fetch supports v16.8
|
|
7349
|
-
function structuredClone2(value,
|
|
7688
|
+
function structuredClone2(value, options4 = void 0) {
|
|
7350
7689
|
if (arguments.length === 0) {
|
|
7351
7690
|
throw new TypeError("missing argument");
|
|
7352
7691
|
}
|
|
@@ -7355,7 +7694,7 @@ var require_constants = __commonJS({
|
|
|
7355
7694
|
}
|
|
7356
7695
|
channel.port1.unref();
|
|
7357
7696
|
channel.port2.unref();
|
|
7358
|
-
channel.port1.postMessage(value,
|
|
7697
|
+
channel.port1.postMessage(value, options4?.transfer);
|
|
7359
7698
|
return receiveMessageOnPort(channel.port2).message;
|
|
7360
7699
|
};
|
|
7361
7700
|
module2.exports = {
|
|
@@ -8092,8 +8431,8 @@ var require_webidl = __commonJS({
|
|
|
8092
8431
|
message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`
|
|
8093
8432
|
});
|
|
8094
8433
|
}
|
|
8095
|
-
for (const
|
|
8096
|
-
const { key, defaultValue, required, converter } =
|
|
8434
|
+
for (const options4 of converters) {
|
|
8435
|
+
const { key, defaultValue, required, converter } = options4;
|
|
8097
8436
|
if (required === true) {
|
|
8098
8437
|
if (!hasOwn(dictionary, key)) {
|
|
8099
8438
|
throw webidl.errors.exception({
|
|
@@ -8103,16 +8442,16 @@ var require_webidl = __commonJS({
|
|
|
8103
8442
|
}
|
|
8104
8443
|
}
|
|
8105
8444
|
let value = dictionary[key];
|
|
8106
|
-
const hasDefault = hasOwn(
|
|
8445
|
+
const hasDefault = hasOwn(options4, "defaultValue");
|
|
8107
8446
|
if (hasDefault && value !== null) {
|
|
8108
8447
|
value = value ?? defaultValue;
|
|
8109
8448
|
}
|
|
8110
8449
|
if (required || hasDefault || value !== void 0) {
|
|
8111
8450
|
value = converter(value);
|
|
8112
|
-
if (
|
|
8451
|
+
if (options4.allowedValues && !options4.allowedValues.includes(value)) {
|
|
8113
8452
|
throw webidl.errors.exception({
|
|
8114
8453
|
header: "Dictionary",
|
|
8115
|
-
message: `${value} is not an accepted type. Expected one of ${
|
|
8454
|
+
message: `${value} is not an accepted type. Expected one of ${options4.allowedValues.join(", ")}.`
|
|
8116
8455
|
});
|
|
8117
8456
|
}
|
|
8118
8457
|
dict[key] = value;
|
|
@@ -8511,13 +8850,13 @@ var require_file = __commonJS({
|
|
|
8511
8850
|
var { parseMIMEType, serializeAMimeType } = require_dataURL();
|
|
8512
8851
|
var { kEnumerableProperty } = require_util();
|
|
8513
8852
|
var File = class extends Blob2 {
|
|
8514
|
-
constructor(fileBits, fileName,
|
|
8853
|
+
constructor(fileBits, fileName, options4 = {}) {
|
|
8515
8854
|
webidl.argumentLengthCheck(arguments, 2, { header: "File constructor" });
|
|
8516
8855
|
fileBits = webidl.converters["sequence<BlobPart>"](fileBits);
|
|
8517
8856
|
fileName = webidl.converters.USVString(fileName);
|
|
8518
|
-
|
|
8857
|
+
options4 = webidl.converters.FilePropertyBag(options4);
|
|
8519
8858
|
const n = fileName;
|
|
8520
|
-
let t =
|
|
8859
|
+
let t = options4.type;
|
|
8521
8860
|
let d;
|
|
8522
8861
|
substep: {
|
|
8523
8862
|
if (t) {
|
|
@@ -8528,9 +8867,9 @@ var require_file = __commonJS({
|
|
|
8528
8867
|
}
|
|
8529
8868
|
t = serializeAMimeType(t).toLowerCase();
|
|
8530
8869
|
}
|
|
8531
|
-
d =
|
|
8870
|
+
d = options4.lastModified;
|
|
8532
8871
|
}
|
|
8533
|
-
super(processBlobParts(fileBits,
|
|
8872
|
+
super(processBlobParts(fileBits, options4), { type: t });
|
|
8534
8873
|
this[kState] = {
|
|
8535
8874
|
name: n,
|
|
8536
8875
|
lastModified: d,
|
|
@@ -8551,10 +8890,10 @@ var require_file = __commonJS({
|
|
|
8551
8890
|
}
|
|
8552
8891
|
};
|
|
8553
8892
|
var FileLike = class {
|
|
8554
|
-
constructor(blobLike, fileName,
|
|
8893
|
+
constructor(blobLike, fileName, options4 = {}) {
|
|
8555
8894
|
const n = fileName;
|
|
8556
|
-
const t =
|
|
8557
|
-
const d =
|
|
8895
|
+
const t = options4.type;
|
|
8896
|
+
const d = options4.lastModified ?? Date.now();
|
|
8558
8897
|
this[kState] = {
|
|
8559
8898
|
blobLike,
|
|
8560
8899
|
name: n,
|
|
@@ -8647,12 +8986,12 @@ var require_file = __commonJS({
|
|
|
8647
8986
|
defaultValue: "transparent"
|
|
8648
8987
|
}
|
|
8649
8988
|
]);
|
|
8650
|
-
function processBlobParts(parts,
|
|
8989
|
+
function processBlobParts(parts, options4) {
|
|
8651
8990
|
const bytes = [];
|
|
8652
8991
|
for (const element of parts) {
|
|
8653
8992
|
if (typeof element === "string") {
|
|
8654
8993
|
let s = element;
|
|
8655
|
-
if (
|
|
8994
|
+
if (options4.endings === "native") {
|
|
8656
8995
|
s = convertLineEndingsNative(s);
|
|
8657
8996
|
}
|
|
8658
8997
|
bytes.push(new TextEncoder().encode(s));
|
|
@@ -8833,11 +9172,11 @@ var require_formdata = __commonJS({
|
|
|
8833
9172
|
value = value instanceof Blob2 ? new File([value], "blob", { type: value.type }) : new FileLike(value, "blob", { type: value.type });
|
|
8834
9173
|
}
|
|
8835
9174
|
if (filename !== void 0) {
|
|
8836
|
-
const
|
|
9175
|
+
const options4 = {
|
|
8837
9176
|
type: value.type,
|
|
8838
9177
|
lastModified: value.lastModified
|
|
8839
9178
|
};
|
|
8840
|
-
value = NativeFile && value instanceof NativeFile || value instanceof UndiciFile ? new File([value], filename,
|
|
9179
|
+
value = NativeFile && value instanceof NativeFile || value instanceof UndiciFile ? new File([value], filename, options4) : new FileLike(value, filename, options4);
|
|
8841
9180
|
}
|
|
8842
9181
|
}
|
|
8843
9182
|
return { name, value };
|
|
@@ -9259,7 +9598,7 @@ var require_request = __commonJS({
|
|
|
9259
9598
|
bodyTimeout,
|
|
9260
9599
|
reset,
|
|
9261
9600
|
throwOnError
|
|
9262
|
-
},
|
|
9601
|
+
}, handler4) {
|
|
9263
9602
|
if (typeof path !== "string") {
|
|
9264
9603
|
throw new InvalidArgumentError("path must be a string");
|
|
9265
9604
|
} else if (path[0] !== "/" && !(path.startsWith("http://") || path.startsWith("https://")) && method !== "CONNECT") {
|
|
@@ -9352,9 +9691,9 @@ var require_request = __commonJS({
|
|
|
9352
9691
|
this.headers += `content-type: ${body.type}\r
|
|
9353
9692
|
`;
|
|
9354
9693
|
}
|
|
9355
|
-
util.validateHandler(
|
|
9694
|
+
util.validateHandler(handler4, method, upgrade);
|
|
9356
9695
|
this.servername = util.getServerName(this.host);
|
|
9357
|
-
this[kHandler] =
|
|
9696
|
+
this[kHandler] = handler4;
|
|
9358
9697
|
if (channels.create.hasSubscribers) {
|
|
9359
9698
|
channels.create.publish({ request: this });
|
|
9360
9699
|
}
|
|
@@ -9619,20 +9958,20 @@ var require_dispatcher_base = __commonJS({
|
|
|
9619
9958
|
queueMicrotask(onDestroyed);
|
|
9620
9959
|
});
|
|
9621
9960
|
}
|
|
9622
|
-
[kInterceptedDispatch](opts,
|
|
9961
|
+
[kInterceptedDispatch](opts, handler4) {
|
|
9623
9962
|
if (!this[kInterceptors] || this[kInterceptors].length === 0) {
|
|
9624
9963
|
this[kInterceptedDispatch] = this[kDispatch];
|
|
9625
|
-
return this[kDispatch](opts,
|
|
9964
|
+
return this[kDispatch](opts, handler4);
|
|
9626
9965
|
}
|
|
9627
9966
|
let dispatch = this[kDispatch].bind(this);
|
|
9628
9967
|
for (let i = this[kInterceptors].length - 1; i >= 0; i--) {
|
|
9629
9968
|
dispatch = this[kInterceptors][i](dispatch);
|
|
9630
9969
|
}
|
|
9631
9970
|
this[kInterceptedDispatch] = dispatch;
|
|
9632
|
-
return dispatch(opts,
|
|
9971
|
+
return dispatch(opts, handler4);
|
|
9633
9972
|
}
|
|
9634
|
-
dispatch(opts,
|
|
9635
|
-
if (!
|
|
9973
|
+
dispatch(opts, handler4) {
|
|
9974
|
+
if (!handler4 || typeof handler4 !== "object") {
|
|
9636
9975
|
throw new InvalidArgumentError("handler must be an object");
|
|
9637
9976
|
}
|
|
9638
9977
|
try {
|
|
@@ -9645,12 +9984,12 @@ var require_dispatcher_base = __commonJS({
|
|
|
9645
9984
|
if (this[kClosed]) {
|
|
9646
9985
|
throw new ClientClosedError();
|
|
9647
9986
|
}
|
|
9648
|
-
return this[kInterceptedDispatch](opts,
|
|
9987
|
+
return this[kInterceptedDispatch](opts, handler4);
|
|
9649
9988
|
} catch (err) {
|
|
9650
|
-
if (typeof
|
|
9989
|
+
if (typeof handler4.onError !== "function") {
|
|
9651
9990
|
throw new InvalidArgumentError("invalid onError method");
|
|
9652
9991
|
}
|
|
9653
|
-
|
|
9992
|
+
handler4.onError(err);
|
|
9654
9993
|
return false;
|
|
9655
9994
|
}
|
|
9656
9995
|
}
|
|
@@ -9721,7 +10060,7 @@ var require_connect = __commonJS({
|
|
|
9721
10060
|
if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
|
|
9722
10061
|
throw new InvalidArgumentError("maxCachedSessions must be a positive integer or zero");
|
|
9723
10062
|
}
|
|
9724
|
-
const
|
|
10063
|
+
const options4 = { path: socketPath, ...opts };
|
|
9725
10064
|
const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions);
|
|
9726
10065
|
timeout = timeout == null ? 1e4 : timeout;
|
|
9727
10066
|
return function connect({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
|
|
@@ -9730,14 +10069,14 @@ var require_connect = __commonJS({
|
|
|
9730
10069
|
if (!tls) {
|
|
9731
10070
|
tls = require("tls");
|
|
9732
10071
|
}
|
|
9733
|
-
servername = servername ||
|
|
10072
|
+
servername = servername || options4.servername || util.getServerName(host) || null;
|
|
9734
10073
|
const sessionKey = servername || hostname;
|
|
9735
10074
|
const session = sessionCache.get(sessionKey) || null;
|
|
9736
10075
|
assert2(sessionKey);
|
|
9737
10076
|
socket = tls.connect({
|
|
9738
10077
|
highWaterMark: 16384,
|
|
9739
10078
|
// TLS in node can't have bigger HWM anyway...
|
|
9740
|
-
...
|
|
10079
|
+
...options4,
|
|
9741
10080
|
servername,
|
|
9742
10081
|
session,
|
|
9743
10082
|
localAddress,
|
|
@@ -9754,14 +10093,14 @@ var require_connect = __commonJS({
|
|
|
9754
10093
|
socket = net.connect({
|
|
9755
10094
|
highWaterMark: 64 * 1024,
|
|
9756
10095
|
// Same as nodejs fs streams.
|
|
9757
|
-
...
|
|
10096
|
+
...options4,
|
|
9758
10097
|
localAddress,
|
|
9759
10098
|
port: port || 80,
|
|
9760
10099
|
host: hostname
|
|
9761
10100
|
});
|
|
9762
10101
|
}
|
|
9763
|
-
if (
|
|
9764
|
-
const keepAliveInitialDelay =
|
|
10102
|
+
if (options4.keepAlive == null || options4.keepAlive) {
|
|
10103
|
+
const keepAliveInitialDelay = options4.keepAliveInitialDelay === void 0 ? 6e4 : options4.keepAliveInitialDelay;
|
|
9765
10104
|
socket.setKeepAlive(true, keepAliveInitialDelay);
|
|
9766
10105
|
}
|
|
9767
10106
|
const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout);
|
|
@@ -10176,17 +10515,17 @@ var require_RedirectHandler = __commonJS({
|
|
|
10176
10515
|
}
|
|
10177
10516
|
};
|
|
10178
10517
|
var RedirectHandler = class {
|
|
10179
|
-
constructor(dispatch, maxRedirections, opts,
|
|
10518
|
+
constructor(dispatch, maxRedirections, opts, handler4) {
|
|
10180
10519
|
if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
|
|
10181
10520
|
throw new InvalidArgumentError("maxRedirections must be a positive number");
|
|
10182
10521
|
}
|
|
10183
|
-
util.validateHandler(
|
|
10522
|
+
util.validateHandler(handler4, opts.method, opts.upgrade);
|
|
10184
10523
|
this.dispatch = dispatch;
|
|
10185
10524
|
this.location = null;
|
|
10186
10525
|
this.abort = null;
|
|
10187
10526
|
this.opts = { ...opts, maxRedirections: 0 };
|
|
10188
10527
|
this.maxRedirections = maxRedirections;
|
|
10189
|
-
this.handler =
|
|
10528
|
+
this.handler = handler4;
|
|
10190
10529
|
this.history = [];
|
|
10191
10530
|
if (util.isStream(this.opts.body)) {
|
|
10192
10531
|
if (util.bodyLength(this.opts.body) === 0) {
|
|
@@ -10300,12 +10639,12 @@ var require_redirectInterceptor = __commonJS({
|
|
|
10300
10639
|
var RedirectHandler = require_RedirectHandler();
|
|
10301
10640
|
function createRedirectInterceptor({ maxRedirections: defaultMaxRedirections }) {
|
|
10302
10641
|
return (dispatch) => {
|
|
10303
|
-
return function Intercept(opts,
|
|
10642
|
+
return function Intercept(opts, handler4) {
|
|
10304
10643
|
const { maxRedirections = defaultMaxRedirections } = opts;
|
|
10305
10644
|
if (!maxRedirections) {
|
|
10306
|
-
return dispatch(opts,
|
|
10645
|
+
return dispatch(opts, handler4);
|
|
10307
10646
|
}
|
|
10308
|
-
const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts,
|
|
10647
|
+
const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler4);
|
|
10309
10648
|
opts = { ...opts, maxRedirections: 0 };
|
|
10310
10649
|
return dispatch(opts, redirectHandler);
|
|
10311
10650
|
};
|
|
@@ -10557,9 +10896,9 @@ var require_client = __commonJS({
|
|
|
10557
10896
|
connect(this);
|
|
10558
10897
|
this.once("connect", cb);
|
|
10559
10898
|
}
|
|
10560
|
-
[kDispatch](opts,
|
|
10899
|
+
[kDispatch](opts, handler4) {
|
|
10561
10900
|
const origin = opts.origin || this[kUrl].origin;
|
|
10562
|
-
const request = new Request(origin, opts,
|
|
10901
|
+
const request = new Request(origin, opts, handler4);
|
|
10563
10902
|
this[kQueue].push(request);
|
|
10564
10903
|
if (this[kResuming]) {
|
|
10565
10904
|
} else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {
|
|
@@ -11862,13 +12201,13 @@ var require_pool_base = __commonJS({
|
|
|
11862
12201
|
}
|
|
11863
12202
|
return Promise.all(this[kClients].map((c) => c.destroy(err)));
|
|
11864
12203
|
}
|
|
11865
|
-
[kDispatch](opts,
|
|
12204
|
+
[kDispatch](opts, handler4) {
|
|
11866
12205
|
const dispatcher = this[kGetDispatcher]();
|
|
11867
12206
|
if (!dispatcher) {
|
|
11868
12207
|
this[kNeedDrain] = true;
|
|
11869
|
-
this[kQueue].push({ opts, handler:
|
|
12208
|
+
this[kQueue].push({ opts, handler: handler4 });
|
|
11870
12209
|
this[kQueued]++;
|
|
11871
|
-
} else if (!dispatcher.dispatch(opts,
|
|
12210
|
+
} else if (!dispatcher.dispatch(opts, handler4)) {
|
|
11872
12211
|
dispatcher[kNeedDrain] = true;
|
|
11873
12212
|
this[kNeedDrain] = !this[kGetDispatcher]();
|
|
11874
12213
|
}
|
|
@@ -11940,7 +12279,7 @@ var require_pool = __commonJS({
|
|
|
11940
12279
|
tls,
|
|
11941
12280
|
maxCachedSessions,
|
|
11942
12281
|
socketPath,
|
|
11943
|
-
...
|
|
12282
|
+
...options4
|
|
11944
12283
|
} = {}) {
|
|
11945
12284
|
super();
|
|
11946
12285
|
if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
|
|
@@ -11961,11 +12300,11 @@ var require_pool = __commonJS({
|
|
|
11961
12300
|
...connect
|
|
11962
12301
|
});
|
|
11963
12302
|
}
|
|
11964
|
-
this[kInterceptors] =
|
|
12303
|
+
this[kInterceptors] = options4.interceptors && options4.interceptors.Pool && Array.isArray(options4.interceptors.Pool) ? options4.interceptors.Pool : [];
|
|
11965
12304
|
this[kConnections] = connections || null;
|
|
11966
12305
|
this[kUrl] = util.parseOrigin(origin);
|
|
11967
|
-
this[kOptions] = { ...util.deepClone(
|
|
11968
|
-
this[kOptions].interceptors =
|
|
12306
|
+
this[kOptions] = { ...util.deepClone(options4), connect };
|
|
12307
|
+
this[kOptions].interceptors = options4.interceptors ? { ...options4.interceptors } : void 0;
|
|
11969
12308
|
this[kFactory] = factory;
|
|
11970
12309
|
}
|
|
11971
12310
|
[kGetDispatcher]() {
|
|
@@ -12178,7 +12517,7 @@ var require_agent = __commonJS({
|
|
|
12178
12517
|
return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts);
|
|
12179
12518
|
}
|
|
12180
12519
|
var Agent = class extends DispatcherBase {
|
|
12181
|
-
constructor({ factory = defaultFactory, maxRedirections = 0, connect, ...
|
|
12520
|
+
constructor({ factory = defaultFactory, maxRedirections = 0, connect, ...options4 } = {}) {
|
|
12182
12521
|
super();
|
|
12183
12522
|
if (typeof factory !== "function") {
|
|
12184
12523
|
throw new InvalidArgumentError("factory must be a function.");
|
|
@@ -12192,9 +12531,9 @@ var require_agent = __commonJS({
|
|
|
12192
12531
|
if (connect && typeof connect !== "function") {
|
|
12193
12532
|
connect = { ...connect };
|
|
12194
12533
|
}
|
|
12195
|
-
this[kInterceptors] =
|
|
12196
|
-
this[kOptions] = { ...util.deepClone(
|
|
12197
|
-
this[kOptions].interceptors =
|
|
12534
|
+
this[kInterceptors] = options4.interceptors && options4.interceptors.Agent && Array.isArray(options4.interceptors.Agent) ? options4.interceptors.Agent : [createRedirectInterceptor({ maxRedirections })];
|
|
12535
|
+
this[kOptions] = { ...util.deepClone(options4), connect };
|
|
12536
|
+
this[kOptions].interceptors = options4.interceptors ? { ...options4.interceptors } : void 0;
|
|
12198
12537
|
this[kMaxRedirections] = maxRedirections;
|
|
12199
12538
|
this[kFactory] = factory;
|
|
12200
12539
|
this[kClients] = /* @__PURE__ */ new Map();
|
|
@@ -12231,7 +12570,7 @@ var require_agent = __commonJS({
|
|
|
12231
12570
|
}
|
|
12232
12571
|
return ret;
|
|
12233
12572
|
}
|
|
12234
|
-
[kDispatch](opts,
|
|
12573
|
+
[kDispatch](opts, handler4) {
|
|
12235
12574
|
let key;
|
|
12236
12575
|
if (opts.origin && (typeof opts.origin === "string" || opts.origin instanceof URL)) {
|
|
12237
12576
|
key = String(opts.origin);
|
|
@@ -12245,7 +12584,7 @@ var require_agent = __commonJS({
|
|
|
12245
12584
|
this[kClients].set(key, new WeakRef2(dispatcher));
|
|
12246
12585
|
this[kFinalizer].register(dispatcher, key);
|
|
12247
12586
|
}
|
|
12248
|
-
return dispatcher.dispatch(opts,
|
|
12587
|
+
return dispatcher.dispatch(opts, handler4);
|
|
12249
12588
|
}
|
|
12250
12589
|
async [kClose]() {
|
|
12251
12590
|
const closePromises = [];
|
|
@@ -12924,11 +13263,11 @@ var require_api_pipeline = __commonJS({
|
|
|
12924
13263
|
}
|
|
12925
13264
|
};
|
|
12926
13265
|
var PipelineHandler = class extends AsyncResource {
|
|
12927
|
-
constructor(opts,
|
|
13266
|
+
constructor(opts, handler4) {
|
|
12928
13267
|
if (!opts || typeof opts !== "object") {
|
|
12929
13268
|
throw new InvalidArgumentError("invalid opts");
|
|
12930
13269
|
}
|
|
12931
|
-
if (typeof
|
|
13270
|
+
if (typeof handler4 !== "function") {
|
|
12932
13271
|
throw new InvalidArgumentError("invalid handler");
|
|
12933
13272
|
}
|
|
12934
13273
|
const { signal, method, opaque, onInfo, responseHeaders } = opts;
|
|
@@ -12944,7 +13283,7 @@ var require_api_pipeline = __commonJS({
|
|
|
12944
13283
|
super("UNDICI_PIPELINE");
|
|
12945
13284
|
this.opaque = opaque || null;
|
|
12946
13285
|
this.responseHeaders = responseHeaders || null;
|
|
12947
|
-
this.handler =
|
|
13286
|
+
this.handler = handler4;
|
|
12948
13287
|
this.abort = null;
|
|
12949
13288
|
this.context = null;
|
|
12950
13289
|
this.onInfo = onInfo || null;
|
|
@@ -12997,7 +13336,7 @@ var require_api_pipeline = __commonJS({
|
|
|
12997
13336
|
this.context = context;
|
|
12998
13337
|
}
|
|
12999
13338
|
onHeaders(statusCode, rawHeaders, resume) {
|
|
13000
|
-
const { opaque, handler:
|
|
13339
|
+
const { opaque, handler: handler4, context } = this;
|
|
13001
13340
|
if (statusCode < 200) {
|
|
13002
13341
|
if (this.onInfo) {
|
|
13003
13342
|
const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders);
|
|
@@ -13010,7 +13349,7 @@ var require_api_pipeline = __commonJS({
|
|
|
13010
13349
|
try {
|
|
13011
13350
|
this.handler = null;
|
|
13012
13351
|
const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders);
|
|
13013
|
-
body = this.runInAsyncScope(
|
|
13352
|
+
body = this.runInAsyncScope(handler4, null, {
|
|
13014
13353
|
statusCode,
|
|
13015
13354
|
headers,
|
|
13016
13355
|
opaque,
|
|
@@ -13057,9 +13396,9 @@ var require_api_pipeline = __commonJS({
|
|
|
13057
13396
|
util.destroy(ret, err);
|
|
13058
13397
|
}
|
|
13059
13398
|
};
|
|
13060
|
-
function pipeline(opts,
|
|
13399
|
+
function pipeline(opts, handler4) {
|
|
13061
13400
|
try {
|
|
13062
|
-
const pipelineHandler = new PipelineHandler(opts,
|
|
13401
|
+
const pipelineHandler = new PipelineHandler(opts, handler4);
|
|
13063
13402
|
this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler);
|
|
13064
13403
|
return pipelineHandler.ret;
|
|
13065
13404
|
} catch (err) {
|
|
@@ -13475,7 +13814,7 @@ var require_mock_utils = __commonJS({
|
|
|
13475
13814
|
}
|
|
13476
13815
|
return Buffer.concat(buffers).toString("utf8");
|
|
13477
13816
|
}
|
|
13478
|
-
function mockDispatch(opts,
|
|
13817
|
+
function mockDispatch(opts, handler4) {
|
|
13479
13818
|
const key = buildKey(opts);
|
|
13480
13819
|
const mockDispatch2 = getMockDispatch(this[kDispatches], key);
|
|
13481
13820
|
mockDispatch2.timesInvoked++;
|
|
@@ -13488,7 +13827,7 @@ var require_mock_utils = __commonJS({
|
|
|
13488
13827
|
mockDispatch2.pending = timesInvoked < times;
|
|
13489
13828
|
if (error !== null) {
|
|
13490
13829
|
deleteMockDispatch(this[kDispatches], key);
|
|
13491
|
-
|
|
13830
|
+
handler4.onError(error);
|
|
13492
13831
|
return true;
|
|
13493
13832
|
}
|
|
13494
13833
|
if (typeof delay === "number" && delay > 0) {
|
|
@@ -13508,10 +13847,10 @@ var require_mock_utils = __commonJS({
|
|
|
13508
13847
|
const responseData = getResponseData(body);
|
|
13509
13848
|
const responseHeaders = generateKeyValues(headers);
|
|
13510
13849
|
const responseTrailers = generateKeyValues(trailers);
|
|
13511
|
-
|
|
13512
|
-
|
|
13513
|
-
|
|
13514
|
-
|
|
13850
|
+
handler4.abort = nop;
|
|
13851
|
+
handler4.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode));
|
|
13852
|
+
handler4.onData(Buffer.from(responseData));
|
|
13853
|
+
handler4.onComplete(responseTrailers);
|
|
13515
13854
|
deleteMockDispatch(mockDispatches, key);
|
|
13516
13855
|
}
|
|
13517
13856
|
function resume() {
|
|
@@ -13522,10 +13861,10 @@ var require_mock_utils = __commonJS({
|
|
|
13522
13861
|
const agent = this[kMockAgent];
|
|
13523
13862
|
const origin = this[kOrigin];
|
|
13524
13863
|
const originalDispatch = this[kOriginalDispatch];
|
|
13525
|
-
return function dispatch(opts,
|
|
13864
|
+
return function dispatch(opts, handler4) {
|
|
13526
13865
|
if (agent.isMockActive) {
|
|
13527
13866
|
try {
|
|
13528
|
-
mockDispatch.call(this, opts,
|
|
13867
|
+
mockDispatch.call(this, opts, handler4);
|
|
13529
13868
|
} catch (error) {
|
|
13530
13869
|
if (error instanceof MockNotMatchedError) {
|
|
13531
13870
|
const netConnect = agent[kGetNetConnect]();
|
|
@@ -13533,7 +13872,7 @@ var require_mock_utils = __commonJS({
|
|
|
13533
13872
|
throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`);
|
|
13534
13873
|
}
|
|
13535
13874
|
if (checkNetConnect(netConnect, origin)) {
|
|
13536
|
-
originalDispatch.call(this, opts,
|
|
13875
|
+
originalDispatch.call(this, opts, handler4);
|
|
13537
13876
|
} else {
|
|
13538
13877
|
throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`);
|
|
13539
13878
|
}
|
|
@@ -13542,7 +13881,7 @@ var require_mock_utils = __commonJS({
|
|
|
13542
13881
|
}
|
|
13543
13882
|
}
|
|
13544
13883
|
} else {
|
|
13545
|
-
originalDispatch.call(this, opts,
|
|
13884
|
+
originalDispatch.call(this, opts, handler4);
|
|
13546
13885
|
}
|
|
13547
13886
|
};
|
|
13548
13887
|
}
|
|
@@ -13970,9 +14309,9 @@ var require_mock_agent = __commonJS({
|
|
|
13970
14309
|
}
|
|
13971
14310
|
return dispatcher;
|
|
13972
14311
|
}
|
|
13973
|
-
dispatch(opts,
|
|
14312
|
+
dispatch(opts, handler4) {
|
|
13974
14313
|
this.get(opts.origin);
|
|
13975
|
-
return this[kAgent].dispatch(opts,
|
|
14314
|
+
return this[kAgent].dispatch(opts, handler4);
|
|
13976
14315
|
}
|
|
13977
14316
|
async close() {
|
|
13978
14317
|
await this[kAgent].close();
|
|
@@ -14155,7 +14494,7 @@ var require_proxy_agent = __commonJS({
|
|
|
14155
14494
|
}
|
|
14156
14495
|
});
|
|
14157
14496
|
}
|
|
14158
|
-
dispatch(opts,
|
|
14497
|
+
dispatch(opts, handler4) {
|
|
14159
14498
|
const { host } = new URL2(opts.origin);
|
|
14160
14499
|
const headers = buildHeaders(opts.headers);
|
|
14161
14500
|
throwIfProxyAuthIsSent(headers);
|
|
@@ -14167,7 +14506,7 @@ var require_proxy_agent = __commonJS({
|
|
|
14167
14506
|
host
|
|
14168
14507
|
}
|
|
14169
14508
|
},
|
|
14170
|
-
|
|
14509
|
+
handler4
|
|
14171
14510
|
);
|
|
14172
14511
|
}
|
|
14173
14512
|
async [kClose]() {
|
|
@@ -14235,8 +14574,8 @@ var require_DecoratorHandler = __commonJS({
|
|
|
14235
14574
|
"../../node_modules/undici/lib/handler/DecoratorHandler.js"(exports, module2) {
|
|
14236
14575
|
"use strict";
|
|
14237
14576
|
module2.exports = class DecoratorHandler {
|
|
14238
|
-
constructor(
|
|
14239
|
-
this.handler =
|
|
14577
|
+
constructor(handler4) {
|
|
14578
|
+
this.handler = handler4;
|
|
14240
14579
|
}
|
|
14241
14580
|
onConnect(...args) {
|
|
14242
14581
|
return this.handler.onConnect(...args);
|
|
@@ -19117,9 +19456,9 @@ var require_undici = __commonJS({
|
|
|
19117
19456
|
module2.exports.buildConnector = buildConnector;
|
|
19118
19457
|
module2.exports.errors = errors;
|
|
19119
19458
|
function makeDispatcher(fn) {
|
|
19120
|
-
return (url, opts,
|
|
19459
|
+
return (url, opts, handler4) => {
|
|
19121
19460
|
if (typeof opts === "function") {
|
|
19122
|
-
|
|
19461
|
+
handler4 = opts;
|
|
19123
19462
|
opts = null;
|
|
19124
19463
|
}
|
|
19125
19464
|
if (!url || typeof url !== "string" && typeof url !== "object" && !(url instanceof URL)) {
|
|
@@ -19152,7 +19491,7 @@ var require_undici = __commonJS({
|
|
|
19152
19491
|
origin: url.origin,
|
|
19153
19492
|
path: url.search ? `${url.pathname}${url.search}` : url.pathname,
|
|
19154
19493
|
method: opts.method || (opts.body ? "PUT" : "GET")
|
|
19155
|
-
},
|
|
19494
|
+
}, handler4);
|
|
19156
19495
|
};
|
|
19157
19496
|
}
|
|
19158
19497
|
module2.exports.setGlobalDispatcher = setGlobalDispatcher;
|
|
@@ -19397,7 +19736,7 @@ var YargsParser = class {
|
|
|
19397
19736
|
constructor(_mixin) {
|
|
19398
19737
|
mixin = _mixin;
|
|
19399
19738
|
}
|
|
19400
|
-
parse(argsInput,
|
|
19739
|
+
parse(argsInput, options4) {
|
|
19401
19740
|
const opts = Object.assign({
|
|
19402
19741
|
alias: void 0,
|
|
19403
19742
|
array: void 0,
|
|
@@ -19415,7 +19754,7 @@ var YargsParser = class {
|
|
|
19415
19754
|
number: void 0,
|
|
19416
19755
|
__: void 0,
|
|
19417
19756
|
key: void 0
|
|
19418
|
-
},
|
|
19757
|
+
}, options4);
|
|
19419
19758
|
const args = tokenizeArgString(argsInput);
|
|
19420
19759
|
const inputIsString = typeof argsInput === "string";
|
|
19421
19760
|
const aliases = combineAliases(Object.assign(/* @__PURE__ */ Object.create(null), opts.alias));
|
|
@@ -20784,13 +21123,13 @@ var y18n_default = y18n2;
|
|
|
20784
21123
|
var import_meta = {};
|
|
20785
21124
|
var REQUIRE_ERROR = "require is not supported by ESM";
|
|
20786
21125
|
var REQUIRE_DIRECTORY_ERROR = "loading a directory of commands is not supported yet for ESM";
|
|
20787
|
-
var
|
|
21126
|
+
var __dirname2;
|
|
20788
21127
|
try {
|
|
20789
|
-
|
|
21128
|
+
__dirname2 = (0, import_url.fileURLToPath)(import_meta.url);
|
|
20790
21129
|
} catch (e) {
|
|
20791
|
-
|
|
21130
|
+
__dirname2 = process.cwd();
|
|
20792
21131
|
}
|
|
20793
|
-
var mainFilename =
|
|
21132
|
+
var mainFilename = __dirname2.substring(0, __dirname2.lastIndexOf("node_modules"));
|
|
20794
21133
|
var esm_default = {
|
|
20795
21134
|
assert: {
|
|
20796
21135
|
notStrictEqual: import_assert.notStrictEqual,
|
|
@@ -20835,7 +21174,7 @@ var esm_default = {
|
|
|
20835
21174
|
return [...str].length;
|
|
20836
21175
|
},
|
|
20837
21176
|
y18n: y18n_default({
|
|
20838
|
-
directory: (0, import_path4.resolve)(
|
|
21177
|
+
directory: (0, import_path4.resolve)(__dirname2, "../../../locales"),
|
|
20839
21178
|
updateFiles: false
|
|
20840
21179
|
})
|
|
20841
21180
|
};
|
|
@@ -21097,10 +21436,10 @@ var CommandInstance = class {
|
|
|
21097
21436
|
};
|
|
21098
21437
|
this.shim.requireDirectory({ require: req, filename: callerFile }, dir, opts);
|
|
21099
21438
|
}
|
|
21100
|
-
addHandler(cmd, description, builder,
|
|
21439
|
+
addHandler(cmd, description, builder, handler4, commandMiddleware, deprecated) {
|
|
21101
21440
|
let aliases = [];
|
|
21102
21441
|
const middlewares = commandMiddlewareFactory(commandMiddleware);
|
|
21103
|
-
|
|
21442
|
+
handler4 = handler4 || (() => {
|
|
21104
21443
|
});
|
|
21105
21444
|
if (Array.isArray(cmd)) {
|
|
21106
21445
|
if (isCommandAndAliases(cmd)) {
|
|
@@ -21147,7 +21486,7 @@ var CommandInstance = class {
|
|
|
21147
21486
|
this.handlers[parsedCommand.cmd] = {
|
|
21148
21487
|
original: cmd,
|
|
21149
21488
|
description,
|
|
21150
|
-
handler:
|
|
21489
|
+
handler: handler4,
|
|
21151
21490
|
builder: builder || {},
|
|
21152
21491
|
middlewares,
|
|
21153
21492
|
deprecated,
|
|
@@ -21325,28 +21664,28 @@ var CommandInstance = class {
|
|
|
21325
21664
|
return parseOptions;
|
|
21326
21665
|
}
|
|
21327
21666
|
postProcessPositionals(argv, positionalMap, parseOptions, yargs) {
|
|
21328
|
-
const
|
|
21329
|
-
|
|
21667
|
+
const options4 = Object.assign({}, yargs.getOptions());
|
|
21668
|
+
options4.default = Object.assign(parseOptions.default, options4.default);
|
|
21330
21669
|
for (const key of Object.keys(parseOptions.alias)) {
|
|
21331
|
-
|
|
21670
|
+
options4.alias[key] = (options4.alias[key] || []).concat(parseOptions.alias[key]);
|
|
21332
21671
|
}
|
|
21333
|
-
|
|
21334
|
-
|
|
21672
|
+
options4.array = options4.array.concat(parseOptions.array);
|
|
21673
|
+
options4.config = {};
|
|
21335
21674
|
const unparsed = [];
|
|
21336
21675
|
Object.keys(positionalMap).forEach((key) => {
|
|
21337
21676
|
positionalMap[key].map((value) => {
|
|
21338
|
-
if (
|
|
21339
|
-
|
|
21677
|
+
if (options4.configuration["unknown-options-as-args"])
|
|
21678
|
+
options4.key[key] = true;
|
|
21340
21679
|
unparsed.push(`--${key}`);
|
|
21341
21680
|
unparsed.push(value);
|
|
21342
21681
|
});
|
|
21343
21682
|
});
|
|
21344
21683
|
if (!unparsed.length)
|
|
21345
21684
|
return;
|
|
21346
|
-
const config = Object.assign({},
|
|
21685
|
+
const config = Object.assign({}, options4.configuration, {
|
|
21347
21686
|
"populate--": false
|
|
21348
21687
|
});
|
|
21349
|
-
const parsed = this.shim.Parser.detailed(unparsed, Object.assign({},
|
|
21688
|
+
const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options4, {
|
|
21350
21689
|
configuration: config
|
|
21351
21690
|
}));
|
|
21352
21691
|
if (parsed.error) {
|
|
@@ -21625,12 +21964,12 @@ function usage(yargs, shim3) {
|
|
|
21625
21964
|
const demandedCommands = yargs.getDemandedCommands();
|
|
21626
21965
|
const deprecatedOptions = yargs.getDeprecatedOptions();
|
|
21627
21966
|
const groups = yargs.getGroups();
|
|
21628
|
-
const
|
|
21967
|
+
const options4 = yargs.getOptions();
|
|
21629
21968
|
let keys = [];
|
|
21630
21969
|
keys = keys.concat(Object.keys(descriptions));
|
|
21631
21970
|
keys = keys.concat(Object.keys(demandedOptions));
|
|
21632
21971
|
keys = keys.concat(Object.keys(demandedCommands));
|
|
21633
|
-
keys = keys.concat(Object.keys(
|
|
21972
|
+
keys = keys.concat(Object.keys(options4.default));
|
|
21634
21973
|
keys = keys.filter(filterHiddenOptions);
|
|
21635
21974
|
keys = Object.keys(keys.reduce((acc, key) => {
|
|
21636
21975
|
if (key !== "_")
|
|
@@ -21703,19 +22042,19 @@ function usage(yargs, shim3) {
|
|
|
21703
22042
|
});
|
|
21704
22043
|
ui2.div();
|
|
21705
22044
|
}
|
|
21706
|
-
const aliasKeys = (Object.keys(
|
|
21707
|
-
keys = keys.filter((key) => !yargs.parsed.newAliases[key] && aliasKeys.every((alias) => (
|
|
22045
|
+
const aliasKeys = (Object.keys(options4.alias) || []).concat(Object.keys(yargs.parsed.newAliases) || []);
|
|
22046
|
+
keys = keys.filter((key) => !yargs.parsed.newAliases[key] && aliasKeys.every((alias) => (options4.alias[alias] || []).indexOf(key) === -1));
|
|
21708
22047
|
const defaultGroup = __("Options:");
|
|
21709
22048
|
if (!groups[defaultGroup])
|
|
21710
22049
|
groups[defaultGroup] = [];
|
|
21711
|
-
addUngroupedKeys(keys,
|
|
22050
|
+
addUngroupedKeys(keys, options4.alias, groups, defaultGroup);
|
|
21712
22051
|
const isLongSwitch = (sw) => /^--/.test(getText(sw));
|
|
21713
22052
|
const displayedGroups = Object.keys(groups).filter((groupName) => groups[groupName].length > 0).map((groupName) => {
|
|
21714
22053
|
const normalizedKeys = groups[groupName].filter(filterHiddenOptions).map((key) => {
|
|
21715
22054
|
if (aliasKeys.includes(key))
|
|
21716
22055
|
return key;
|
|
21717
22056
|
for (let i = 0, aliasKey; (aliasKey = aliasKeys[i]) !== void 0; i++) {
|
|
21718
|
-
if ((
|
|
22057
|
+
if ((options4.alias[aliasKey] || []).includes(key))
|
|
21719
22058
|
return aliasKey;
|
|
21720
22059
|
}
|
|
21721
22060
|
return key;
|
|
@@ -21723,11 +22062,11 @@ function usage(yargs, shim3) {
|
|
|
21723
22062
|
return { groupName, normalizedKeys };
|
|
21724
22063
|
}).filter(({ normalizedKeys }) => normalizedKeys.length > 0).map(({ groupName, normalizedKeys }) => {
|
|
21725
22064
|
const switches = normalizedKeys.reduce((acc, key) => {
|
|
21726
|
-
acc[key] = [key].concat(
|
|
22065
|
+
acc[key] = [key].concat(options4.alias[key] || []).map((sw) => {
|
|
21727
22066
|
if (groupName === self.getPositionalGroupName())
|
|
21728
22067
|
return sw;
|
|
21729
22068
|
else {
|
|
21730
|
-
return (/^[0-9]$/.test(sw) ?
|
|
22069
|
+
return (/^[0-9]$/.test(sw) ? options4.boolean.includes(key) ? "-" : "--" : sw.length > 1 ? "--" : "-") + sw;
|
|
21731
22070
|
}
|
|
21732
22071
|
}).sort((sw1, sw2) => isLongSwitch(sw1) === isLongSwitch(sw2) ? 0 : isLongSwitch(sw1) ? 1 : -1).join(", ");
|
|
21733
22072
|
return acc;
|
|
@@ -21752,25 +22091,25 @@ function usage(yargs, shim3) {
|
|
|
21752
22091
|
let type = null;
|
|
21753
22092
|
if (desc.includes(deferY18nLookupPrefix))
|
|
21754
22093
|
desc = __(desc.substring(deferY18nLookupPrefix.length));
|
|
21755
|
-
if (
|
|
22094
|
+
if (options4.boolean.includes(key))
|
|
21756
22095
|
type = `[${__("boolean")}]`;
|
|
21757
|
-
if (
|
|
22096
|
+
if (options4.count.includes(key))
|
|
21758
22097
|
type = `[${__("count")}]`;
|
|
21759
|
-
if (
|
|
22098
|
+
if (options4.string.includes(key))
|
|
21760
22099
|
type = `[${__("string")}]`;
|
|
21761
|
-
if (
|
|
22100
|
+
if (options4.normalize.includes(key))
|
|
21762
22101
|
type = `[${__("string")}]`;
|
|
21763
|
-
if (
|
|
22102
|
+
if (options4.array.includes(key))
|
|
21764
22103
|
type = `[${__("array")}]`;
|
|
21765
|
-
if (
|
|
22104
|
+
if (options4.number.includes(key))
|
|
21766
22105
|
type = `[${__("number")}]`;
|
|
21767
22106
|
const deprecatedExtra = (deprecated) => typeof deprecated === "string" ? `[${__("deprecated: %s", deprecated)}]` : `[${__("deprecated")}]`;
|
|
21768
22107
|
const extra = [
|
|
21769
22108
|
key in deprecatedOptions ? deprecatedExtra(deprecatedOptions[key]) : null,
|
|
21770
22109
|
type,
|
|
21771
22110
|
key in demandedOptions ? `[${__("required")}]` : null,
|
|
21772
|
-
|
|
21773
|
-
defaultString(
|
|
22111
|
+
options4.choices && options4.choices[key] ? `[${__("choices:")} ${self.stringifiedValues(options4.choices[key])}]` : null,
|
|
22112
|
+
defaultString(options4.default[key], options4.defaultDescription[key])
|
|
21774
22113
|
].filter(Boolean).join(" ");
|
|
21775
22114
|
ui2.span({
|
|
21776
22115
|
text: getText(kswitch),
|
|
@@ -21828,24 +22167,24 @@ function usage(yargs, shim3) {
|
|
|
21828
22167
|
}
|
|
21829
22168
|
function normalizeAliases() {
|
|
21830
22169
|
const demandedOptions = yargs.getDemandedOptions();
|
|
21831
|
-
const
|
|
21832
|
-
(Object.keys(
|
|
21833
|
-
|
|
22170
|
+
const options4 = yargs.getOptions();
|
|
22171
|
+
(Object.keys(options4.alias) || []).forEach((key) => {
|
|
22172
|
+
options4.alias[key].forEach((alias) => {
|
|
21834
22173
|
if (descriptions[alias])
|
|
21835
22174
|
self.describe(key, descriptions[alias]);
|
|
21836
22175
|
if (alias in demandedOptions)
|
|
21837
22176
|
yargs.demandOption(key, demandedOptions[alias]);
|
|
21838
|
-
if (
|
|
22177
|
+
if (options4.boolean.includes(alias))
|
|
21839
22178
|
yargs.boolean(key);
|
|
21840
|
-
if (
|
|
22179
|
+
if (options4.count.includes(alias))
|
|
21841
22180
|
yargs.count(key);
|
|
21842
|
-
if (
|
|
22181
|
+
if (options4.string.includes(alias))
|
|
21843
22182
|
yargs.string(key);
|
|
21844
|
-
if (
|
|
22183
|
+
if (options4.normalize.includes(alias))
|
|
21845
22184
|
yargs.normalize(key);
|
|
21846
|
-
if (
|
|
22185
|
+
if (options4.array.includes(alias))
|
|
21847
22186
|
yargs.array(key);
|
|
21848
|
-
if (
|
|
22187
|
+
if (options4.number.includes(alias))
|
|
21849
22188
|
yargs.number(key);
|
|
21850
22189
|
});
|
|
21851
22190
|
});
|
|
@@ -22105,14 +22444,14 @@ var Completion = class {
|
|
|
22105
22444
|
}
|
|
22106
22445
|
optionCompletions(completions, args, argv, current) {
|
|
22107
22446
|
if ((current.match(/^-/) || current === "" && completions.length === 0) && !this.previousArgHasChoices(args)) {
|
|
22108
|
-
const
|
|
22447
|
+
const options4 = this.yargs.getOptions();
|
|
22109
22448
|
const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [];
|
|
22110
|
-
Object.keys(
|
|
22111
|
-
const negable = !!
|
|
22449
|
+
Object.keys(options4.key).forEach((key) => {
|
|
22450
|
+
const negable = !!options4.configuration["boolean-negation"] && options4.boolean.includes(key);
|
|
22112
22451
|
const isPositionalKey = positionalKeys.includes(key);
|
|
22113
|
-
if (!isPositionalKey && !
|
|
22452
|
+
if (!isPositionalKey && !options4.hiddenOptions.includes(key) && !this.argsContainKey(args, key, negable)) {
|
|
22114
22453
|
this.completeOptionKey(key, completions, current);
|
|
22115
|
-
if (negable && !!
|
|
22454
|
+
if (negable && !!options4.default[key])
|
|
22116
22455
|
this.completeOptionKey(`no-${key}`, completions, current);
|
|
22117
22456
|
}
|
|
22118
22457
|
});
|
|
@@ -22155,15 +22494,15 @@ var Completion = class {
|
|
|
22155
22494
|
if (!previousArg.startsWith("-"))
|
|
22156
22495
|
return;
|
|
22157
22496
|
const previousArgKey = previousArg.replace(/^-+/, "");
|
|
22158
|
-
const
|
|
22497
|
+
const options4 = this.yargs.getOptions();
|
|
22159
22498
|
const possibleAliases = [
|
|
22160
22499
|
previousArgKey,
|
|
22161
22500
|
...this.yargs.getAliases()[previousArgKey] || []
|
|
22162
22501
|
];
|
|
22163
22502
|
let choices;
|
|
22164
22503
|
for (const possibleAlias of possibleAliases) {
|
|
22165
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
22166
|
-
choices =
|
|
22504
|
+
if (Object.prototype.hasOwnProperty.call(options4.key, possibleAlias) && Array.isArray(options4.choices[possibleAlias])) {
|
|
22505
|
+
choices = options4.choices[possibleAlias];
|
|
22167
22506
|
break;
|
|
22168
22507
|
}
|
|
22169
22508
|
}
|
|
@@ -22402,14 +22741,14 @@ ${customMsgs.join("\n")}` : "";
|
|
|
22402
22741
|
return [key, ...aliases[key]].some((a) => !Object.prototype.hasOwnProperty.call(newAliases, a) || !newAliases[key]);
|
|
22403
22742
|
};
|
|
22404
22743
|
self.limitedChoices = function limitedChoices(argv) {
|
|
22405
|
-
const
|
|
22744
|
+
const options4 = yargs.getOptions();
|
|
22406
22745
|
const invalid = {};
|
|
22407
|
-
if (!Object.keys(
|
|
22746
|
+
if (!Object.keys(options4.choices).length)
|
|
22408
22747
|
return;
|
|
22409
22748
|
Object.keys(argv).forEach((key) => {
|
|
22410
|
-
if (specialKeys.indexOf(key) === -1 && Object.prototype.hasOwnProperty.call(
|
|
22749
|
+
if (specialKeys.indexOf(key) === -1 && Object.prototype.hasOwnProperty.call(options4.choices, key)) {
|
|
22411
22750
|
[].concat(argv[key]).forEach((value) => {
|
|
22412
|
-
if (
|
|
22751
|
+
if (options4.choices[key].indexOf(value) === -1 && value !== void 0) {
|
|
22413
22752
|
invalid[key] = (invalid[key] || []).concat(value);
|
|
22414
22753
|
}
|
|
22415
22754
|
});
|
|
@@ -22421,7 +22760,7 @@ ${customMsgs.join("\n")}` : "";
|
|
|
22421
22760
|
let msg = __("Invalid values:");
|
|
22422
22761
|
invalidKeys.forEach((key) => {
|
|
22423
22762
|
msg += `
|
|
22424
|
-
${__("Argument: %s, Given: %s, Choices: %s", key, usage2.stringifiedValues(invalid[key]), usage2.stringifiedValues(
|
|
22763
|
+
${__("Argument: %s, Given: %s, Choices: %s", key, usage2.stringifiedValues(invalid[key]), usage2.stringifiedValues(options4.choices[key]))}`;
|
|
22425
22764
|
});
|
|
22426
22765
|
usage2.fail(msg);
|
|
22427
22766
|
};
|
|
@@ -22863,13 +23202,13 @@ var YargsInstance = class {
|
|
|
22863
23202
|
__classPrivateFieldGet(this, _YargsInstance_completion, "f").registerFunction(fn);
|
|
22864
23203
|
return this;
|
|
22865
23204
|
}
|
|
22866
|
-
command(cmd, description, builder,
|
|
22867
|
-
argsert("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]", [cmd, description, builder,
|
|
22868
|
-
__classPrivateFieldGet(this, _YargsInstance_command, "f").addHandler(cmd, description, builder,
|
|
23205
|
+
command(cmd, description, builder, handler4, middlewares, deprecated) {
|
|
23206
|
+
argsert("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]", [cmd, description, builder, handler4, middlewares, deprecated], arguments.length);
|
|
23207
|
+
__classPrivateFieldGet(this, _YargsInstance_command, "f").addHandler(cmd, description, builder, handler4, middlewares, deprecated);
|
|
22869
23208
|
return this;
|
|
22870
23209
|
}
|
|
22871
|
-
commands(cmd, description, builder,
|
|
22872
|
-
return this.command(cmd, description, builder,
|
|
23210
|
+
commands(cmd, description, builder, handler4, middlewares, deprecated) {
|
|
23211
|
+
return this.command(cmd, description, builder, handler4, middlewares, deprecated);
|
|
22873
23212
|
}
|
|
22874
23213
|
commandDir(dir, opts) {
|
|
22875
23214
|
argsert("<string> [object]", [dir, opts], arguments.length);
|
|
@@ -23471,12 +23810,12 @@ var YargsInstance = class {
|
|
|
23471
23810
|
__classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.updateLocale(obj);
|
|
23472
23811
|
return this;
|
|
23473
23812
|
}
|
|
23474
|
-
usage(msg, description, builder,
|
|
23475
|
-
argsert("<string|null|undefined> [string|boolean] [function|object] [function]", [msg, description, builder,
|
|
23813
|
+
usage(msg, description, builder, handler4) {
|
|
23814
|
+
argsert("<string|null|undefined> [string|boolean] [function|object] [function]", [msg, description, builder, handler4], arguments.length);
|
|
23476
23815
|
if (description !== void 0) {
|
|
23477
23816
|
assertNotStrictEqual(msg, null, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
|
|
23478
23817
|
if ((msg || "").match(/^\$0( |$)/)) {
|
|
23479
|
-
return this.command(msg, description, builder,
|
|
23818
|
+
return this.command(msg, description, builder, handler4);
|
|
23480
23819
|
} else {
|
|
23481
23820
|
throw new YError(".usage() description must start with $0 if being used as alias for .command()");
|
|
23482
23821
|
}
|
|
@@ -24051,7 +24390,7 @@ var Yargs = YargsFactory(esm_default);
|
|
|
24051
24390
|
var yargs_default = Yargs;
|
|
24052
24391
|
|
|
24053
24392
|
// package.json
|
|
24054
|
-
var version = "0.0.
|
|
24393
|
+
var version = "0.0.15";
|
|
24055
24394
|
var package_default = {
|
|
24056
24395
|
name: "onlineornot",
|
|
24057
24396
|
version,
|
|
@@ -24094,6 +24433,7 @@ var package_default = {
|
|
|
24094
24433
|
chalk: "^5.2.0",
|
|
24095
24434
|
"cli-table3": "^0.6.3",
|
|
24096
24435
|
esbuild: "^0.17.7",
|
|
24436
|
+
open: "^8.4.2",
|
|
24097
24437
|
"supports-color": "^9.3.1",
|
|
24098
24438
|
undici: "^5.18.0",
|
|
24099
24439
|
"update-check": "^1.5.4",
|
|
@@ -24413,10 +24753,10 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
24413
24753
|
}
|
|
24414
24754
|
return min;
|
|
24415
24755
|
}
|
|
24416
|
-
function createSupportsColor(stream,
|
|
24756
|
+
function createSupportsColor(stream, options4 = {}) {
|
|
24417
24757
|
const level = _supportsColor(stream, {
|
|
24418
24758
|
streamIsTTY: stream && stream.isTTY,
|
|
24419
|
-
...
|
|
24759
|
+
...options4
|
|
24420
24760
|
});
|
|
24421
24761
|
return translateLevel(level);
|
|
24422
24762
|
}
|
|
@@ -24468,21 +24808,21 @@ var levelMapping = [
|
|
|
24468
24808
|
"ansi16m"
|
|
24469
24809
|
];
|
|
24470
24810
|
var styles2 = /* @__PURE__ */ Object.create(null);
|
|
24471
|
-
var applyOptions = (object,
|
|
24472
|
-
if (
|
|
24811
|
+
var applyOptions = (object, options4 = {}) => {
|
|
24812
|
+
if (options4.level && !(Number.isInteger(options4.level) && options4.level >= 0 && options4.level <= 3)) {
|
|
24473
24813
|
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
24474
24814
|
}
|
|
24475
24815
|
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
24476
|
-
object.level =
|
|
24816
|
+
object.level = options4.level === void 0 ? colorLevel : options4.level;
|
|
24477
24817
|
};
|
|
24478
|
-
var chalkFactory = (
|
|
24818
|
+
var chalkFactory = (options4) => {
|
|
24479
24819
|
const chalk2 = (...strings) => strings.join(" ");
|
|
24480
|
-
applyOptions(chalk2,
|
|
24820
|
+
applyOptions(chalk2, options4);
|
|
24481
24821
|
Object.setPrototypeOf(chalk2, createChalk.prototype);
|
|
24482
24822
|
return chalk2;
|
|
24483
24823
|
};
|
|
24484
|
-
function createChalk(
|
|
24485
|
-
return chalkFactory(
|
|
24824
|
+
function createChalk(options4) {
|
|
24825
|
+
return chalkFactory(options4);
|
|
24486
24826
|
}
|
|
24487
24827
|
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
24488
24828
|
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
@@ -24551,18 +24891,18 @@ var proto = Object.defineProperties(() => {
|
|
|
24551
24891
|
}
|
|
24552
24892
|
}
|
|
24553
24893
|
});
|
|
24554
|
-
var createStyler = (
|
|
24894
|
+
var createStyler = (open2, close, parent) => {
|
|
24555
24895
|
let openAll;
|
|
24556
24896
|
let closeAll;
|
|
24557
24897
|
if (parent === void 0) {
|
|
24558
|
-
openAll =
|
|
24898
|
+
openAll = open2;
|
|
24559
24899
|
closeAll = close;
|
|
24560
24900
|
} else {
|
|
24561
|
-
openAll = parent.openAll +
|
|
24901
|
+
openAll = parent.openAll + open2;
|
|
24562
24902
|
closeAll = close + parent.closeAll;
|
|
24563
24903
|
}
|
|
24564
24904
|
return {
|
|
24565
|
-
open,
|
|
24905
|
+
open: open2,
|
|
24566
24906
|
close,
|
|
24567
24907
|
openAll,
|
|
24568
24908
|
closeAll,
|
|
@@ -24716,10 +25056,10 @@ function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
24716
25056
|
}
|
|
24717
25057
|
return min;
|
|
24718
25058
|
}
|
|
24719
|
-
function createSupportsColor2(stream,
|
|
25059
|
+
function createSupportsColor2(stream, options4 = {}) {
|
|
24720
25060
|
const level = _supportsColor2(stream, {
|
|
24721
25061
|
streamIsTTY: stream && stream.isTTY,
|
|
24722
|
-
...
|
|
25062
|
+
...options4
|
|
24723
25063
|
});
|
|
24724
25064
|
return translateLevel2(level);
|
|
24725
25065
|
}
|
|
@@ -24831,6 +25171,26 @@ async function printBanner() {
|
|
|
24831
25171
|
);
|
|
24832
25172
|
}
|
|
24833
25173
|
|
|
25174
|
+
// src/open-in-browser.ts
|
|
25175
|
+
var import_open = __toESM(require_open());
|
|
25176
|
+
async function openInBrowser(url) {
|
|
25177
|
+
const childProcess = await (0, import_open.default)(url);
|
|
25178
|
+
childProcess.on("error", () => {
|
|
25179
|
+
logger.warn("Failed to open");
|
|
25180
|
+
});
|
|
25181
|
+
}
|
|
25182
|
+
|
|
25183
|
+
// src/billing/index.ts
|
|
25184
|
+
function billingOptions() {
|
|
25185
|
+
return {};
|
|
25186
|
+
}
|
|
25187
|
+
async function billingHandler() {
|
|
25188
|
+
const urlToOpen = "https://onlineornot.com/app/settings/billing";
|
|
25189
|
+
await printBanner();
|
|
25190
|
+
logger.log(`Opening a link in your default browser: ${urlToOpen}`);
|
|
25191
|
+
await openInBrowser(urlToOpen);
|
|
25192
|
+
}
|
|
25193
|
+
|
|
24834
25194
|
// src/fetch/index.ts
|
|
24835
25195
|
var import_node_url = require("node:url");
|
|
24836
25196
|
|
|
@@ -25069,8 +25429,25 @@ ${" ".repeat(level)}- ${renderError(chainedError, level + 1)}`
|
|
|
25069
25429
|
return (err.code ? `${err.message} [code: ${err.code}]` : err.message) + chainedMessages;
|
|
25070
25430
|
}
|
|
25071
25431
|
|
|
25072
|
-
// src/checks/
|
|
25432
|
+
// src/checks/delete.ts
|
|
25073
25433
|
function options(yargs) {
|
|
25434
|
+
return yargs.positional("id", {
|
|
25435
|
+
describe: "The ID of the check you wish to delete",
|
|
25436
|
+
type: "string",
|
|
25437
|
+
demandOption: true
|
|
25438
|
+
});
|
|
25439
|
+
}
|
|
25440
|
+
async function handler(args) {
|
|
25441
|
+
await printBanner();
|
|
25442
|
+
await verifyToken();
|
|
25443
|
+
await fetchResult(`/checks/${args.id}`, {
|
|
25444
|
+
method: "DELETE"
|
|
25445
|
+
});
|
|
25446
|
+
logger.log(`Deleted check ${args.id}`);
|
|
25447
|
+
}
|
|
25448
|
+
|
|
25449
|
+
// src/checks/individualCheck.ts
|
|
25450
|
+
function options2(yargs) {
|
|
25074
25451
|
return yargs.positional("id", {
|
|
25075
25452
|
describe: "The ID of the check you wish to fetch",
|
|
25076
25453
|
type: "string",
|
|
@@ -25081,7 +25458,7 @@ function options(yargs) {
|
|
|
25081
25458
|
default: false
|
|
25082
25459
|
});
|
|
25083
25460
|
}
|
|
25084
|
-
async function
|
|
25461
|
+
async function handler2(args) {
|
|
25085
25462
|
await verifyToken();
|
|
25086
25463
|
const result = await fetchResult(`/checks/${args.id}`);
|
|
25087
25464
|
if (args.json) {
|
|
@@ -25101,14 +25478,14 @@ async function handler(args) {
|
|
|
25101
25478
|
}
|
|
25102
25479
|
|
|
25103
25480
|
// src/checks/list.ts
|
|
25104
|
-
function
|
|
25481
|
+
function options3(yargs) {
|
|
25105
25482
|
return yargs.option("json", {
|
|
25106
25483
|
describe: "Return output as JSON",
|
|
25107
25484
|
type: "boolean",
|
|
25108
25485
|
default: false
|
|
25109
25486
|
});
|
|
25110
25487
|
}
|
|
25111
|
-
async function
|
|
25488
|
+
async function handler3(args) {
|
|
25112
25489
|
await verifyToken();
|
|
25113
25490
|
const results = await fetchPagedResult("/checks");
|
|
25114
25491
|
if (args.json) {
|
|
@@ -25120,8 +25497,8 @@ async function handler2(args) {
|
|
|
25120
25497
|
"Check ID": result.id,
|
|
25121
25498
|
Name: result.name,
|
|
25122
25499
|
URL: result.url,
|
|
25123
|
-
Status: result.status,
|
|
25124
|
-
"Last queued": result.lastQueued
|
|
25500
|
+
Status: result.status ? result.status : "Pending",
|
|
25501
|
+
"Last queued": result.lastQueued ? result.lastQueued : "Waiting to be queued"
|
|
25125
25502
|
}))
|
|
25126
25503
|
);
|
|
25127
25504
|
}
|
|
@@ -25129,14 +25506,46 @@ async function handler2(args) {
|
|
|
25129
25506
|
|
|
25130
25507
|
// src/checks/index.ts
|
|
25131
25508
|
function checks(yargs) {
|
|
25132
|
-
return yargs.command("list", "List uptime checks",
|
|
25509
|
+
return yargs.command("list", "List uptime checks", options3, handler3).command(
|
|
25133
25510
|
"view <id>",
|
|
25134
25511
|
"View a specific uptime check",
|
|
25512
|
+
options2,
|
|
25513
|
+
handler2
|
|
25514
|
+
).command(
|
|
25515
|
+
"delete <id>",
|
|
25516
|
+
"Delete a specific uptime check",
|
|
25135
25517
|
options,
|
|
25136
25518
|
handler
|
|
25137
25519
|
);
|
|
25138
25520
|
}
|
|
25139
25521
|
|
|
25522
|
+
// src/docs/index.ts
|
|
25523
|
+
function docsOptions() {
|
|
25524
|
+
return {};
|
|
25525
|
+
}
|
|
25526
|
+
async function docsHandler() {
|
|
25527
|
+
const urlToOpen = "https://onlineornot.com/docs/welcome";
|
|
25528
|
+
await printBanner();
|
|
25529
|
+
logger.log(`Opening a link in your default browser: ${urlToOpen}`);
|
|
25530
|
+
await openInBrowser(urlToOpen);
|
|
25531
|
+
}
|
|
25532
|
+
|
|
25533
|
+
// src/login/index.ts
|
|
25534
|
+
function loginOptions() {
|
|
25535
|
+
return {};
|
|
25536
|
+
}
|
|
25537
|
+
async function loginHandler() {
|
|
25538
|
+
const urlToOpen = "https://onlineornot.com/app/settings/developers";
|
|
25539
|
+
await printBanner();
|
|
25540
|
+
logger.log(`Opening a link in your default browser: ${urlToOpen}`);
|
|
25541
|
+
logger.log(
|
|
25542
|
+
`-----------------------------------------------------------------------`
|
|
25543
|
+
);
|
|
25544
|
+
logger.log(`Create an API token, then add it to your environment variables:`);
|
|
25545
|
+
logger.log(`export ONLINEORNOT_API_TOKEN=your-api-token`);
|
|
25546
|
+
await openInBrowser(urlToOpen);
|
|
25547
|
+
}
|
|
25548
|
+
|
|
25140
25549
|
// src/whoami.ts
|
|
25141
25550
|
async function whoami() {
|
|
25142
25551
|
logger.log("Getting User settings...");
|
|
@@ -25223,9 +25632,27 @@ function createCLIParser(argv) {
|
|
|
25223
25632
|
}
|
|
25224
25633
|
}
|
|
25225
25634
|
);
|
|
25635
|
+
onlineornot.command(
|
|
25636
|
+
"docs",
|
|
25637
|
+
"\u{1F4DA} Open OnlineOrNot's docs in your browser",
|
|
25638
|
+
docsOptions,
|
|
25639
|
+
docsHandler
|
|
25640
|
+
);
|
|
25226
25641
|
onlineornot.command("checks", "\u2705 Manage your uptime checks", (d1Yargs) => {
|
|
25227
25642
|
return checks(d1Yargs.command(subHelp));
|
|
25228
25643
|
});
|
|
25644
|
+
onlineornot.command(
|
|
25645
|
+
"billing",
|
|
25646
|
+
"\u{1F9FE} Open OnlineOrNot's billing in your browser",
|
|
25647
|
+
billingOptions,
|
|
25648
|
+
billingHandler
|
|
25649
|
+
);
|
|
25650
|
+
onlineornot.command(
|
|
25651
|
+
"login",
|
|
25652
|
+
"\u{1F513} Opens your browser to OnlineOrNot's Developer settings",
|
|
25653
|
+
loginOptions,
|
|
25654
|
+
loginHandler
|
|
25655
|
+
);
|
|
25229
25656
|
onlineornot.command(
|
|
25230
25657
|
"whoami",
|
|
25231
25658
|
"\u{1F575}\uFE0F Retrieve your user info and test your auth config",
|