onlineornot 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/onlineornot-dist/cli.js +478 -214
- package/onlineornot-dist/cli.js.map +4 -4
- package/package.json +4 -3
package/onlineornot-dist/cli.js
CHANGED
|
@@ -544,7 +544,7 @@ var require_has_flag = __commonJS({
|
|
|
544
544
|
var require_supports_colors = __commonJS({
|
|
545
545
|
"../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/system/supports-colors.js"(exports, module2) {
|
|
546
546
|
"use strict";
|
|
547
|
-
var
|
|
547
|
+
var os7 = require("os");
|
|
548
548
|
var hasFlag3 = require_has_flag();
|
|
549
549
|
var env5 = process.env;
|
|
550
550
|
var forceColor = void 0;
|
|
@@ -582,7 +582,7 @@ var require_supports_colors = __commonJS({
|
|
|
582
582
|
}
|
|
583
583
|
var min = forceColor ? 1 : 0;
|
|
584
584
|
if (process.platform === "win32") {
|
|
585
|
-
var osRelease =
|
|
585
|
+
var osRelease = os7.release().split(".");
|
|
586
586
|
if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
587
587
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
588
588
|
}
|
|
@@ -2071,9 +2071,9 @@ var require_strip_json_comments = __commonJS({
|
|
|
2071
2071
|
var require_utils2 = __commonJS({
|
|
2072
2072
|
"../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/lib/utils.js"(exports) {
|
|
2073
2073
|
"use strict";
|
|
2074
|
-
var
|
|
2074
|
+
var fs5 = require("fs");
|
|
2075
2075
|
var ini = require_ini();
|
|
2076
|
-
var
|
|
2076
|
+
var path8 = require("path");
|
|
2077
2077
|
var stripJsonComments = require_strip_json_comments();
|
|
2078
2078
|
var parse = exports.parse = function(content) {
|
|
2079
2079
|
if (/^\s*{/.test(content))
|
|
@@ -2087,10 +2087,10 @@ var require_utils2 = __commonJS({
|
|
|
2087
2087
|
for (var i in args)
|
|
2088
2088
|
if ("string" !== typeof args[i])
|
|
2089
2089
|
return;
|
|
2090
|
-
var file2 =
|
|
2090
|
+
var file2 = path8.join.apply(null, args);
|
|
2091
2091
|
var content;
|
|
2092
2092
|
try {
|
|
2093
|
-
return
|
|
2093
|
+
return fs5.readFileSync(file2, "utf-8");
|
|
2094
2094
|
} catch (err) {
|
|
2095
2095
|
return;
|
|
2096
2096
|
}
|
|
@@ -2125,15 +2125,15 @@ var require_utils2 = __commonJS({
|
|
|
2125
2125
|
return obj;
|
|
2126
2126
|
};
|
|
2127
2127
|
var find = exports.find = function() {
|
|
2128
|
-
var rel =
|
|
2128
|
+
var rel = path8.join.apply(null, [].slice.call(arguments));
|
|
2129
2129
|
function find2(start, rel2) {
|
|
2130
|
-
var file2 =
|
|
2130
|
+
var file2 = path8.join(start, rel2);
|
|
2131
2131
|
try {
|
|
2132
|
-
|
|
2132
|
+
fs5.statSync(file2);
|
|
2133
2133
|
return file2;
|
|
2134
2134
|
} catch (err) {
|
|
2135
|
-
if (
|
|
2136
|
-
return find2(
|
|
2135
|
+
if (path8.dirname(start) !== start)
|
|
2136
|
+
return find2(path8.dirname(start), rel2);
|
|
2137
2137
|
}
|
|
2138
2138
|
}
|
|
2139
2139
|
return find2(process.cwd(), rel);
|
|
@@ -2635,8 +2635,8 @@ var require_registry_auth_token = __commonJS({
|
|
|
2635
2635
|
}
|
|
2636
2636
|
return void 0;
|
|
2637
2637
|
}
|
|
2638
|
-
function normalizePath2(
|
|
2639
|
-
return
|
|
2638
|
+
function normalizePath2(path8) {
|
|
2639
|
+
return path8[path8.length - 1] === "/" ? path8 : path8 + "/";
|
|
2640
2640
|
}
|
|
2641
2641
|
function getAuthInfoForUrl(regUrl, npmrc) {
|
|
2642
2642
|
var bearerAuth = getBearerToken(npmrc[regUrl + tokenKey] || npmrc[regUrl + "/" + tokenKey]);
|
|
@@ -2683,19 +2683,19 @@ var require_update_check = __commonJS({
|
|
|
2683
2683
|
"../../node_modules/.pnpm/update-check@1.5.4/node_modules/update-check/index.js"(exports, module2) {
|
|
2684
2684
|
var { URL: URL2 } = require("url");
|
|
2685
2685
|
var { join } = require("path");
|
|
2686
|
-
var
|
|
2686
|
+
var fs5 = require("fs");
|
|
2687
2687
|
var { promisify: promisify2 } = require("util");
|
|
2688
2688
|
var { tmpdir: tmpdir2 } = require("os");
|
|
2689
2689
|
var registryUrl = require_registry_url();
|
|
2690
|
-
var writeFile2 = promisify2(
|
|
2691
|
-
var mkdir = promisify2(
|
|
2692
|
-
var readFile = promisify2(
|
|
2690
|
+
var writeFile2 = promisify2(fs5.writeFile);
|
|
2691
|
+
var mkdir = promisify2(fs5.mkdir);
|
|
2692
|
+
var readFile = promisify2(fs5.readFile);
|
|
2693
2693
|
var compareVersions = (a, b) => a.localeCompare(b, "en-US", { numeric: true });
|
|
2694
2694
|
var encode = (value) => encodeURIComponent(value).replace(/^%40/, "@");
|
|
2695
2695
|
var getFile = async (details, distTag) => {
|
|
2696
2696
|
const rootDir = tmpdir2();
|
|
2697
2697
|
const subDir = join(rootDir, "update-check");
|
|
2698
|
-
if (!
|
|
2698
|
+
if (!fs5.existsSync(subDir)) {
|
|
2699
2699
|
await mkdir(subDir);
|
|
2700
2700
|
}
|
|
2701
2701
|
let name = `${details.name}-${distTag}.json`;
|
|
@@ -2705,7 +2705,7 @@ var require_update_check = __commonJS({
|
|
|
2705
2705
|
return join(subDir, name);
|
|
2706
2706
|
};
|
|
2707
2707
|
var evaluateCache = async (file, time, interval) => {
|
|
2708
|
-
if (
|
|
2708
|
+
if (fs5.existsSync(file)) {
|
|
2709
2709
|
const content = await readFile(file, "utf8");
|
|
2710
2710
|
const { lastUpdate, latest } = JSON.parse(content);
|
|
2711
2711
|
const nextCheck = lastUpdate + interval;
|
|
@@ -2836,11 +2836,11 @@ var require_update_check = __commonJS({
|
|
|
2836
2836
|
var require_is_docker = __commonJS({
|
|
2837
2837
|
"../../node_modules/.pnpm/is-docker@2.2.1/node_modules/is-docker/index.js"(exports, module2) {
|
|
2838
2838
|
"use strict";
|
|
2839
|
-
var
|
|
2839
|
+
var fs5 = require("fs");
|
|
2840
2840
|
var isDocker;
|
|
2841
2841
|
function hasDockerEnv() {
|
|
2842
2842
|
try {
|
|
2843
|
-
|
|
2843
|
+
fs5.statSync("/.dockerenv");
|
|
2844
2844
|
return true;
|
|
2845
2845
|
} catch (_) {
|
|
2846
2846
|
return false;
|
|
@@ -2848,7 +2848,7 @@ var require_is_docker = __commonJS({
|
|
|
2848
2848
|
}
|
|
2849
2849
|
function hasDockerCGroup() {
|
|
2850
2850
|
try {
|
|
2851
|
-
return
|
|
2851
|
+
return fs5.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
2852
2852
|
} catch (_) {
|
|
2853
2853
|
return false;
|
|
2854
2854
|
}
|
|
@@ -2866,21 +2866,21 @@ var require_is_docker = __commonJS({
|
|
|
2866
2866
|
var require_is_wsl = __commonJS({
|
|
2867
2867
|
"../../node_modules/.pnpm/is-wsl@2.2.0/node_modules/is-wsl/index.js"(exports, module2) {
|
|
2868
2868
|
"use strict";
|
|
2869
|
-
var
|
|
2870
|
-
var
|
|
2869
|
+
var os7 = require("os");
|
|
2870
|
+
var fs5 = require("fs");
|
|
2871
2871
|
var isDocker = require_is_docker();
|
|
2872
2872
|
var isWsl = () => {
|
|
2873
2873
|
if (process.platform !== "linux") {
|
|
2874
2874
|
return false;
|
|
2875
2875
|
}
|
|
2876
|
-
if (
|
|
2876
|
+
if (os7.release().toLowerCase().includes("microsoft")) {
|
|
2877
2877
|
if (isDocker()) {
|
|
2878
2878
|
return false;
|
|
2879
2879
|
}
|
|
2880
2880
|
return true;
|
|
2881
2881
|
}
|
|
2882
2882
|
try {
|
|
2883
|
-
return
|
|
2883
|
+
return fs5.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isDocker() : false;
|
|
2884
2884
|
} catch (_) {
|
|
2885
2885
|
return false;
|
|
2886
2886
|
}
|
|
@@ -2919,17 +2919,17 @@ var require_define_lazy_prop = __commonJS({
|
|
|
2919
2919
|
// ../../node_modules/.pnpm/open@8.4.2/node_modules/open/index.js
|
|
2920
2920
|
var require_open = __commonJS({
|
|
2921
2921
|
"../../node_modules/.pnpm/open@8.4.2/node_modules/open/index.js"(exports, module2) {
|
|
2922
|
-
var
|
|
2922
|
+
var path8 = require("path");
|
|
2923
2923
|
var childProcess = require("child_process");
|
|
2924
|
-
var { promises:
|
|
2924
|
+
var { promises: fs5, constants: fsConstants } = require("fs");
|
|
2925
2925
|
var isWsl = require_is_wsl();
|
|
2926
2926
|
var isDocker = require_is_docker();
|
|
2927
2927
|
var defineLazyProperty = require_define_lazy_prop();
|
|
2928
|
-
var localXdgOpenPath =
|
|
2928
|
+
var localXdgOpenPath = path8.join(__dirname, "xdg-open");
|
|
2929
2929
|
var { platform, arch } = process;
|
|
2930
2930
|
var hasContainerEnv = () => {
|
|
2931
2931
|
try {
|
|
2932
|
-
|
|
2932
|
+
fs5.statSync("/run/.containerenv");
|
|
2933
2933
|
return true;
|
|
2934
2934
|
} catch {
|
|
2935
2935
|
return false;
|
|
@@ -2952,14 +2952,14 @@ var require_open = __commonJS({
|
|
|
2952
2952
|
const configFilePath = "/etc/wsl.conf";
|
|
2953
2953
|
let isConfigFileExists = false;
|
|
2954
2954
|
try {
|
|
2955
|
-
await
|
|
2955
|
+
await fs5.access(configFilePath, fsConstants.F_OK);
|
|
2956
2956
|
isConfigFileExists = true;
|
|
2957
2957
|
} catch {
|
|
2958
2958
|
}
|
|
2959
2959
|
if (!isConfigFileExists) {
|
|
2960
2960
|
return defaultMountPoint;
|
|
2961
2961
|
}
|
|
2962
|
-
const configContent = await
|
|
2962
|
+
const configContent = await fs5.readFile(configFilePath, { encoding: "utf8" });
|
|
2963
2963
|
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
|
2964
2964
|
if (!configMountPoint) {
|
|
2965
2965
|
return defaultMountPoint;
|
|
@@ -3059,7 +3059,7 @@ var require_open = __commonJS({
|
|
|
3059
3059
|
const isBundled = !__dirname || __dirname === "/";
|
|
3060
3060
|
let exeLocalXdgOpen = false;
|
|
3061
3061
|
try {
|
|
3062
|
-
await
|
|
3062
|
+
await fs5.access(localXdgOpenPath, fsConstants.X_OK);
|
|
3063
3063
|
exeLocalXdgOpen = true;
|
|
3064
3064
|
} catch {
|
|
3065
3065
|
}
|
|
@@ -3635,14 +3635,14 @@ var require_util = __commonJS({
|
|
|
3635
3635
|
}
|
|
3636
3636
|
const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
|
|
3637
3637
|
let origin = url2.origin != null ? url2.origin : `${url2.protocol}//${url2.hostname}:${port}`;
|
|
3638
|
-
let
|
|
3638
|
+
let path8 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
|
|
3639
3639
|
if (origin.endsWith("/")) {
|
|
3640
3640
|
origin = origin.substring(0, origin.length - 1);
|
|
3641
3641
|
}
|
|
3642
|
-
if (
|
|
3643
|
-
|
|
3642
|
+
if (path8 && !path8.startsWith("/")) {
|
|
3643
|
+
path8 = `/${path8}`;
|
|
3644
3644
|
}
|
|
3645
|
-
url2 = new URL(origin +
|
|
3645
|
+
url2 = new URL(origin + path8);
|
|
3646
3646
|
}
|
|
3647
3647
|
return url2;
|
|
3648
3648
|
}
|
|
@@ -5258,19 +5258,19 @@ var require_parseParams = __commonJS({
|
|
|
5258
5258
|
var require_basename = __commonJS({
|
|
5259
5259
|
"../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/basename.js"(exports, module2) {
|
|
5260
5260
|
"use strict";
|
|
5261
|
-
module2.exports = function basename2(
|
|
5262
|
-
if (typeof
|
|
5261
|
+
module2.exports = function basename2(path8) {
|
|
5262
|
+
if (typeof path8 !== "string") {
|
|
5263
5263
|
return "";
|
|
5264
5264
|
}
|
|
5265
|
-
for (var i =
|
|
5266
|
-
switch (
|
|
5265
|
+
for (var i = path8.length - 1; i >= 0; --i) {
|
|
5266
|
+
switch (path8.charCodeAt(i)) {
|
|
5267
5267
|
case 47:
|
|
5268
5268
|
case 92:
|
|
5269
|
-
|
|
5270
|
-
return
|
|
5269
|
+
path8 = path8.slice(i + 1);
|
|
5270
|
+
return path8 === ".." || path8 === "." ? "" : path8;
|
|
5271
5271
|
}
|
|
5272
5272
|
}
|
|
5273
|
-
return
|
|
5273
|
+
return path8 === ".." || path8 === "." ? "" : path8;
|
|
5274
5274
|
};
|
|
5275
5275
|
}
|
|
5276
5276
|
});
|
|
@@ -8296,7 +8296,7 @@ var require_request = __commonJS({
|
|
|
8296
8296
|
}
|
|
8297
8297
|
var Request = class {
|
|
8298
8298
|
constructor(origin, {
|
|
8299
|
-
path:
|
|
8299
|
+
path: path8,
|
|
8300
8300
|
method,
|
|
8301
8301
|
body,
|
|
8302
8302
|
headers,
|
|
@@ -8310,11 +8310,11 @@ var require_request = __commonJS({
|
|
|
8310
8310
|
throwOnError,
|
|
8311
8311
|
expectContinue
|
|
8312
8312
|
}, handler6) {
|
|
8313
|
-
if (typeof
|
|
8313
|
+
if (typeof path8 !== "string") {
|
|
8314
8314
|
throw new InvalidArgumentError("path must be a string");
|
|
8315
|
-
} else if (
|
|
8315
|
+
} else if (path8[0] !== "/" && !(path8.startsWith("http://") || path8.startsWith("https://")) && method !== "CONNECT") {
|
|
8316
8316
|
throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
|
|
8317
|
-
} else if (invalidPathRegex.exec(
|
|
8317
|
+
} else if (invalidPathRegex.exec(path8) !== null) {
|
|
8318
8318
|
throw new InvalidArgumentError("invalid request path");
|
|
8319
8319
|
}
|
|
8320
8320
|
if (typeof method !== "string") {
|
|
@@ -8377,7 +8377,7 @@ var require_request = __commonJS({
|
|
|
8377
8377
|
this.completed = false;
|
|
8378
8378
|
this.aborted = false;
|
|
8379
8379
|
this.upgrade = upgrade || null;
|
|
8380
|
-
this.path = query ? util.buildURL(
|
|
8380
|
+
this.path = query ? util.buildURL(path8, query) : path8;
|
|
8381
8381
|
this.origin = origin;
|
|
8382
8382
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
8383
8383
|
this.blocking = blocking == null ? false : blocking;
|
|
@@ -9394,9 +9394,9 @@ var require_RedirectHandler = __commonJS({
|
|
|
9394
9394
|
return this.handler.onHeaders(statusCode, headers, resume, statusText);
|
|
9395
9395
|
}
|
|
9396
9396
|
const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
9397
|
-
const
|
|
9397
|
+
const path8 = search ? `${pathname}${search}` : pathname;
|
|
9398
9398
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
|
|
9399
|
-
this.opts.path =
|
|
9399
|
+
this.opts.path = path8;
|
|
9400
9400
|
this.opts.origin = origin;
|
|
9401
9401
|
this.opts.maxRedirections = 0;
|
|
9402
9402
|
this.opts.query = null;
|
|
@@ -10636,7 +10636,7 @@ var require_client = __commonJS({
|
|
|
10636
10636
|
writeH2(client, client[kHTTP2Session], request);
|
|
10637
10637
|
return;
|
|
10638
10638
|
}
|
|
10639
|
-
const { body, method, path:
|
|
10639
|
+
const { body, method, path: path8, host, upgrade, headers, blocking, reset } = request;
|
|
10640
10640
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
10641
10641
|
if (body && typeof body.read === "function") {
|
|
10642
10642
|
body.read(0);
|
|
@@ -10686,7 +10686,7 @@ var require_client = __commonJS({
|
|
|
10686
10686
|
if (blocking) {
|
|
10687
10687
|
socket[kBlocking] = true;
|
|
10688
10688
|
}
|
|
10689
|
-
let header = `${method} ${
|
|
10689
|
+
let header = `${method} ${path8} HTTP/1.1\r
|
|
10690
10690
|
`;
|
|
10691
10691
|
if (typeof host === "string") {
|
|
10692
10692
|
header += `host: ${host}\r
|
|
@@ -10749,7 +10749,7 @@ upgrade: ${upgrade}\r
|
|
|
10749
10749
|
return true;
|
|
10750
10750
|
}
|
|
10751
10751
|
function writeH2(client, session, request) {
|
|
10752
|
-
const { body, method, path:
|
|
10752
|
+
const { body, method, path: path8, host, upgrade, expectContinue, signal, headers: reqHeaders } = request;
|
|
10753
10753
|
let headers;
|
|
10754
10754
|
if (typeof reqHeaders === "string")
|
|
10755
10755
|
headers = Request[kHTTP2CopyHeaders](reqHeaders.trim());
|
|
@@ -10795,7 +10795,7 @@ upgrade: ${upgrade}\r
|
|
|
10795
10795
|
});
|
|
10796
10796
|
return true;
|
|
10797
10797
|
}
|
|
10798
|
-
headers[HTTP2_HEADER_PATH] =
|
|
10798
|
+
headers[HTTP2_HEADER_PATH] = path8;
|
|
10799
10799
|
headers[HTTP2_HEADER_SCHEME] = "https";
|
|
10800
10800
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
10801
10801
|
if (body && typeof body.read === "function") {
|
|
@@ -13036,20 +13036,20 @@ var require_mock_utils = __commonJS({
|
|
|
13036
13036
|
}
|
|
13037
13037
|
return true;
|
|
13038
13038
|
}
|
|
13039
|
-
function safeUrl(
|
|
13040
|
-
if (typeof
|
|
13041
|
-
return
|
|
13039
|
+
function safeUrl(path8) {
|
|
13040
|
+
if (typeof path8 !== "string") {
|
|
13041
|
+
return path8;
|
|
13042
13042
|
}
|
|
13043
|
-
const pathSegments =
|
|
13043
|
+
const pathSegments = path8.split("?");
|
|
13044
13044
|
if (pathSegments.length !== 2) {
|
|
13045
|
-
return
|
|
13045
|
+
return path8;
|
|
13046
13046
|
}
|
|
13047
13047
|
const qp = new URLSearchParams(pathSegments.pop());
|
|
13048
13048
|
qp.sort();
|
|
13049
13049
|
return [...pathSegments, qp.toString()].join("?");
|
|
13050
13050
|
}
|
|
13051
|
-
function matchKey(mockDispatch2, { path:
|
|
13052
|
-
const pathMatch = matchValue(mockDispatch2.path,
|
|
13051
|
+
function matchKey(mockDispatch2, { path: path8, method, body, headers }) {
|
|
13052
|
+
const pathMatch = matchValue(mockDispatch2.path, path8);
|
|
13053
13053
|
const methodMatch = matchValue(mockDispatch2.method, method);
|
|
13054
13054
|
const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
|
|
13055
13055
|
const headersMatch = matchHeaders(mockDispatch2, headers);
|
|
@@ -13067,7 +13067,7 @@ var require_mock_utils = __commonJS({
|
|
|
13067
13067
|
function getMockDispatch(mockDispatches, key) {
|
|
13068
13068
|
const basePath = key.query ? buildURL(key.path, key.query) : key.path;
|
|
13069
13069
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
13070
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path:
|
|
13070
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path8 }) => matchValue(safeUrl(path8), resolvedPath));
|
|
13071
13071
|
if (matchedMockDispatches.length === 0) {
|
|
13072
13072
|
throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
13073
13073
|
}
|
|
@@ -13104,9 +13104,9 @@ var require_mock_utils = __commonJS({
|
|
|
13104
13104
|
}
|
|
13105
13105
|
}
|
|
13106
13106
|
function buildKey(opts) {
|
|
13107
|
-
const { path:
|
|
13107
|
+
const { path: path8, method, body, headers, query } = opts;
|
|
13108
13108
|
return {
|
|
13109
|
-
path:
|
|
13109
|
+
path: path8,
|
|
13110
13110
|
method,
|
|
13111
13111
|
body,
|
|
13112
13112
|
headers,
|
|
@@ -13555,10 +13555,10 @@ var require_pending_interceptors_formatter = __commonJS({
|
|
|
13555
13555
|
}
|
|
13556
13556
|
format(pendingInterceptors) {
|
|
13557
13557
|
const withPrettyHeaders = pendingInterceptors.map(
|
|
13558
|
-
({ method, path:
|
|
13558
|
+
({ method, path: path8, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
|
|
13559
13559
|
Method: method,
|
|
13560
13560
|
Origin: origin,
|
|
13561
|
-
Path:
|
|
13561
|
+
Path: path8,
|
|
13562
13562
|
"Status code": statusCode,
|
|
13563
13563
|
Persistent: persist ? "\u2705" : "\u274C",
|
|
13564
13564
|
Invocations: timesInvoked,
|
|
@@ -18183,8 +18183,8 @@ var require_util6 = __commonJS({
|
|
|
18183
18183
|
}
|
|
18184
18184
|
}
|
|
18185
18185
|
}
|
|
18186
|
-
function validateCookiePath(
|
|
18187
|
-
for (const char of
|
|
18186
|
+
function validateCookiePath(path8) {
|
|
18187
|
+
for (const char of path8) {
|
|
18188
18188
|
const code = char.charCodeAt(0);
|
|
18189
18189
|
if (code < 33 || char === ";") {
|
|
18190
18190
|
throw new Error("Invalid cookie path");
|
|
@@ -19864,11 +19864,11 @@ var require_undici = __commonJS({
|
|
|
19864
19864
|
if (typeof opts.path !== "string") {
|
|
19865
19865
|
throw new InvalidArgumentError("invalid opts.path");
|
|
19866
19866
|
}
|
|
19867
|
-
let
|
|
19867
|
+
let path8 = opts.path;
|
|
19868
19868
|
if (!opts.path.startsWith("/")) {
|
|
19869
|
-
|
|
19869
|
+
path8 = `/${path8}`;
|
|
19870
19870
|
}
|
|
19871
|
-
url2 = new URL(util.parseOrigin(url2).origin +
|
|
19871
|
+
url2 = new URL(util.parseOrigin(url2).origin + path8);
|
|
19872
19872
|
} else {
|
|
19873
19873
|
if (!opts) {
|
|
19874
19874
|
opts = typeof url2 === "object" ? url2 : {};
|
|
@@ -23147,8 +23147,8 @@ var require_utils4 = __commonJS({
|
|
|
23147
23147
|
}
|
|
23148
23148
|
return ind;
|
|
23149
23149
|
}
|
|
23150
|
-
function removeDotSegments(
|
|
23151
|
-
let input =
|
|
23150
|
+
function removeDotSegments(path8) {
|
|
23151
|
+
let input = path8;
|
|
23152
23152
|
const output = [];
|
|
23153
23153
|
let nextSlash = -1;
|
|
23154
23154
|
let len = 0;
|
|
@@ -23347,8 +23347,8 @@ var require_schemes = __commonJS({
|
|
|
23347
23347
|
wsComponent.secure = void 0;
|
|
23348
23348
|
}
|
|
23349
23349
|
if (wsComponent.resourceName) {
|
|
23350
|
-
const [
|
|
23351
|
-
wsComponent.path =
|
|
23350
|
+
const [path8, query] = wsComponent.resourceName.split("?");
|
|
23351
|
+
wsComponent.path = path8 && path8 !== "/" ? path8 : void 0;
|
|
23352
23352
|
wsComponent.query = query;
|
|
23353
23353
|
wsComponent.resourceName = void 0;
|
|
23354
23354
|
}
|
|
@@ -27535,12 +27535,12 @@ var require_dist = __commonJS({
|
|
|
27535
27535
|
throw new Error(`Unknown format "${name}"`);
|
|
27536
27536
|
return f;
|
|
27537
27537
|
};
|
|
27538
|
-
function addFormats(ajv, list,
|
|
27538
|
+
function addFormats(ajv, list, fs5, exportName) {
|
|
27539
27539
|
var _a2;
|
|
27540
27540
|
var _b2;
|
|
27541
27541
|
(_a2 = (_b2 = ajv.opts.code).formats) !== null && _a2 !== void 0 ? _a2 : _b2.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
|
|
27542
27542
|
for (const f of list)
|
|
27543
|
-
ajv.addFormat(f,
|
|
27543
|
+
ajv.addFormat(f, fs5[f]);
|
|
27544
27544
|
}
|
|
27545
27545
|
module2.exports = exports = formatsPlugin;
|
|
27546
27546
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -30522,11 +30522,11 @@ var parser = new YargsParser({
|
|
|
30522
30522
|
resolve: import_path.resolve,
|
|
30523
30523
|
// TODO: figure out a way to combine ESM and CJS coverage, such that
|
|
30524
30524
|
// we can exercise all the lines below:
|
|
30525
|
-
require: (
|
|
30525
|
+
require: (path8) => {
|
|
30526
30526
|
if (typeof require !== "undefined") {
|
|
30527
|
-
return require(
|
|
30528
|
-
} else if (
|
|
30529
|
-
return JSON.parse((0, import_fs.readFileSync)(
|
|
30527
|
+
return require(path8);
|
|
30528
|
+
} else if (path8.match(/\.json$/)) {
|
|
30529
|
+
return JSON.parse((0, import_fs.readFileSync)(path8, "utf8"));
|
|
30530
30530
|
} else {
|
|
30531
30531
|
throw Error("only .json config files are supported in ESM");
|
|
30532
30532
|
}
|
|
@@ -31107,6 +31107,175 @@ var esm_default = {
|
|
|
31107
31107
|
})
|
|
31108
31108
|
};
|
|
31109
31109
|
|
|
31110
|
+
// src/auto-update.ts
|
|
31111
|
+
var import_node_child_process = require("node:child_process");
|
|
31112
|
+
var import_promises = __toESM(require("node:fs/promises"));
|
|
31113
|
+
var import_node_os = __toESM(require("node:os"));
|
|
31114
|
+
var import_node_path = __toESM(require("node:path"));
|
|
31115
|
+
|
|
31116
|
+
// package.json
|
|
31117
|
+
var version = "1.2.2";
|
|
31118
|
+
var package_default = {
|
|
31119
|
+
name: "onlineornot",
|
|
31120
|
+
version,
|
|
31121
|
+
description: "Command-line interface for OnlineOrNot",
|
|
31122
|
+
keywords: [
|
|
31123
|
+
"uptime monitoring"
|
|
31124
|
+
],
|
|
31125
|
+
homepage: "https://github.com/OnlineOrNot/onlineornot#readme",
|
|
31126
|
+
bugs: {
|
|
31127
|
+
url: "https://github.com/OnlineOrNot/onlineornot/issues"
|
|
31128
|
+
},
|
|
31129
|
+
license: "MIT",
|
|
31130
|
+
author: "Max Rozen <max@onlineornot.com>",
|
|
31131
|
+
repository: {
|
|
31132
|
+
type: "git",
|
|
31133
|
+
url: "https://github.com/OnlineOrNot/onlineornot.git"
|
|
31134
|
+
},
|
|
31135
|
+
bin: {
|
|
31136
|
+
onlineornot: "./bin/onlineornot.js"
|
|
31137
|
+
},
|
|
31138
|
+
files: [
|
|
31139
|
+
"onlineornot-dist",
|
|
31140
|
+
"bin"
|
|
31141
|
+
],
|
|
31142
|
+
main: "onlineornot-dist/cli.js",
|
|
31143
|
+
publishConfig: {
|
|
31144
|
+
access: "public",
|
|
31145
|
+
registry: "https://registry.npmjs.org"
|
|
31146
|
+
},
|
|
31147
|
+
scripts: {
|
|
31148
|
+
build: "pnpm run clean && pnpm run bundle",
|
|
31149
|
+
"build:sea": "bash scripts/build-sea.sh",
|
|
31150
|
+
bundle: "node -r esbuild-register scripts/bundle.ts",
|
|
31151
|
+
clean: "rimraf dist sea",
|
|
31152
|
+
prepublishOnly: "SOURCEMAPS=false pnpm run build",
|
|
31153
|
+
start: "pnpm run bundle && cross-env NODE_OPTIONS=--enable-source-maps ./bin/onlineornot.js",
|
|
31154
|
+
"check:type": "tsgo --noEmit",
|
|
31155
|
+
test: "vitest",
|
|
31156
|
+
"test:ci": "vitest run"
|
|
31157
|
+
},
|
|
31158
|
+
dependencies: {
|
|
31159
|
+
chalk: "^5.2.0",
|
|
31160
|
+
"cli-table3": "^0.6.3",
|
|
31161
|
+
conf: "^15.1.0",
|
|
31162
|
+
esbuild: "^0.17.7",
|
|
31163
|
+
open: "^8.4.2",
|
|
31164
|
+
"supports-color": "^9.3.1",
|
|
31165
|
+
undici: "^5.18.0",
|
|
31166
|
+
"update-check": "^1.5.4",
|
|
31167
|
+
yargs: "^17.7.2"
|
|
31168
|
+
},
|
|
31169
|
+
devDependencies: {
|
|
31170
|
+
"@types/node": "^22",
|
|
31171
|
+
"@types/yargs": "^17.0.35",
|
|
31172
|
+
"cross-env": "^7.0.3",
|
|
31173
|
+
"esbuild-register": "^3.4.2",
|
|
31174
|
+
rimraf: "^6.1.3",
|
|
31175
|
+
vitest: "^4.0.0"
|
|
31176
|
+
},
|
|
31177
|
+
engines: {
|
|
31178
|
+
node: ">=25"
|
|
31179
|
+
}
|
|
31180
|
+
};
|
|
31181
|
+
|
|
31182
|
+
// src/auto-update.ts
|
|
31183
|
+
var INSTALL_DIR = process.env.ONLINEORNOT_INSTALL_DIR || import_node_path.default.join(import_node_os.default.homedir(), ".onlineornot");
|
|
31184
|
+
var PENDING_DIR = import_node_path.default.join(INSTALL_DIR, "pending");
|
|
31185
|
+
var VERSION_FILE = import_node_path.default.join(INSTALL_DIR, "version");
|
|
31186
|
+
var REPO = "OnlineOrNot/onlineornot-cli";
|
|
31187
|
+
function isSEA() {
|
|
31188
|
+
return process.env.ONLINEORNOT_SEA === "true";
|
|
31189
|
+
}
|
|
31190
|
+
async function applyPendingUpdate() {
|
|
31191
|
+
if (!isSEA())
|
|
31192
|
+
return;
|
|
31193
|
+
try {
|
|
31194
|
+
const files = await import_promises.default.readdir(PENDING_DIR).catch(() => []);
|
|
31195
|
+
if (files.length === 0)
|
|
31196
|
+
return;
|
|
31197
|
+
const pendingBinary = import_node_path.default.join(PENDING_DIR, files[0]);
|
|
31198
|
+
const currentBinary = process.execPath;
|
|
31199
|
+
await import_promises.default.copyFile(pendingBinary, currentBinary);
|
|
31200
|
+
await import_promises.default.rm(PENDING_DIR, { recursive: true, force: true });
|
|
31201
|
+
const newVersion = files[0].replace("onlineornot-", "");
|
|
31202
|
+
await import_promises.default.writeFile(VERSION_FILE, newVersion);
|
|
31203
|
+
} catch {
|
|
31204
|
+
}
|
|
31205
|
+
}
|
|
31206
|
+
function checkForUpdateInBackground() {
|
|
31207
|
+
if (!isSEA())
|
|
31208
|
+
return;
|
|
31209
|
+
const child = (0, import_node_child_process.spawn)(process.execPath, ["--onlineornot-check-update"], {
|
|
31210
|
+
detached: true,
|
|
31211
|
+
stdio: "ignore",
|
|
31212
|
+
env: {
|
|
31213
|
+
...process.env,
|
|
31214
|
+
ONLINEORNOT_UPDATE_CHECK: "true"
|
|
31215
|
+
}
|
|
31216
|
+
});
|
|
31217
|
+
child.unref();
|
|
31218
|
+
}
|
|
31219
|
+
async function performUpdateCheck() {
|
|
31220
|
+
try {
|
|
31221
|
+
const currentVersion = package_default.version;
|
|
31222
|
+
const response = await fetch(
|
|
31223
|
+
`https://api.github.com/repos/${REPO}/releases`,
|
|
31224
|
+
{
|
|
31225
|
+
headers: {
|
|
31226
|
+
"User-Agent": "onlineornot-cli"
|
|
31227
|
+
}
|
|
31228
|
+
}
|
|
31229
|
+
);
|
|
31230
|
+
if (!response.ok)
|
|
31231
|
+
return;
|
|
31232
|
+
const releases = await response.json();
|
|
31233
|
+
const release = releases.find((r) => r.tag_name.startsWith("onlineornot@"));
|
|
31234
|
+
if (!release)
|
|
31235
|
+
return;
|
|
31236
|
+
const latestVersion = release.tag_name.replace(/^onlineornot@/, "");
|
|
31237
|
+
if (!isNewerVersion(latestVersion, currentVersion))
|
|
31238
|
+
return;
|
|
31239
|
+
const osName = process.platform === "darwin" ? "darwin" : "linux";
|
|
31240
|
+
const arch = process.arch === "arm64" ? "arm64" : "amd64";
|
|
31241
|
+
const binaryName = `onlineornot-${osName}-${arch}`;
|
|
31242
|
+
const asset = release.assets.find(
|
|
31243
|
+
(a) => a.name === binaryName
|
|
31244
|
+
);
|
|
31245
|
+
if (!asset)
|
|
31246
|
+
return;
|
|
31247
|
+
await import_promises.default.mkdir(PENDING_DIR, { recursive: true });
|
|
31248
|
+
const pendingPath = import_node_path.default.join(PENDING_DIR, `onlineornot-${latestVersion}`);
|
|
31249
|
+
const binaryResponse = await fetch(asset.browser_download_url);
|
|
31250
|
+
if (!binaryResponse.ok)
|
|
31251
|
+
return;
|
|
31252
|
+
const buffer = await binaryResponse.arrayBuffer();
|
|
31253
|
+
await import_promises.default.writeFile(pendingPath, Buffer.from(buffer));
|
|
31254
|
+
await import_promises.default.chmod(pendingPath, 493);
|
|
31255
|
+
} catch {
|
|
31256
|
+
}
|
|
31257
|
+
}
|
|
31258
|
+
function isNewerVersion(a, b) {
|
|
31259
|
+
const partsA = a.split(".").map(Number);
|
|
31260
|
+
const partsB = b.split(".").map(Number);
|
|
31261
|
+
for (let i = 0; i < 3; i++) {
|
|
31262
|
+
const numA = partsA[i] || 0;
|
|
31263
|
+
const numB = partsB[i] || 0;
|
|
31264
|
+
if (numA > numB)
|
|
31265
|
+
return true;
|
|
31266
|
+
if (numA < numB)
|
|
31267
|
+
return false;
|
|
31268
|
+
}
|
|
31269
|
+
return false;
|
|
31270
|
+
}
|
|
31271
|
+
async function handleUpdateCheckFlag() {
|
|
31272
|
+
if (process.env.ONLINEORNOT_UPDATE_CHECK === "true") {
|
|
31273
|
+
await performUpdateCheck();
|
|
31274
|
+
return true;
|
|
31275
|
+
}
|
|
31276
|
+
return false;
|
|
31277
|
+
}
|
|
31278
|
+
|
|
31110
31279
|
// src/errors.ts
|
|
31111
31280
|
var FatalError = class extends Error {
|
|
31112
31281
|
constructor(message, code) {
|
|
@@ -34339,71 +34508,6 @@ function isYargsInstance(y) {
|
|
|
34339
34508
|
var Yargs = YargsFactory(esm_default);
|
|
34340
34509
|
var yargs_default = Yargs;
|
|
34341
34510
|
|
|
34342
|
-
// package.json
|
|
34343
|
-
var version = "1.2.0";
|
|
34344
|
-
var package_default = {
|
|
34345
|
-
name: "onlineornot",
|
|
34346
|
-
version,
|
|
34347
|
-
description: "Command-line interface for OnlineOrNot",
|
|
34348
|
-
keywords: [
|
|
34349
|
-
"uptime monitoring"
|
|
34350
|
-
],
|
|
34351
|
-
homepage: "https://github.com/OnlineOrNot/onlineornot#readme",
|
|
34352
|
-
bugs: {
|
|
34353
|
-
url: "https://github.com/OnlineOrNot/onlineornot/issues"
|
|
34354
|
-
},
|
|
34355
|
-
license: "MIT",
|
|
34356
|
-
author: "Max Rozen <max@onlineornot.com>",
|
|
34357
|
-
repository: {
|
|
34358
|
-
type: "git",
|
|
34359
|
-
url: "https://github.com/OnlineOrNot/onlineornot.git"
|
|
34360
|
-
},
|
|
34361
|
-
bin: {
|
|
34362
|
-
onlineornot: "./bin/onlineornot.js"
|
|
34363
|
-
},
|
|
34364
|
-
files: [
|
|
34365
|
-
"onlineornot-dist",
|
|
34366
|
-
"bin"
|
|
34367
|
-
],
|
|
34368
|
-
main: "onlineornot-dist/cli.js",
|
|
34369
|
-
publishConfig: {
|
|
34370
|
-
access: "public",
|
|
34371
|
-
registry: "https://registry.npmjs.org"
|
|
34372
|
-
},
|
|
34373
|
-
scripts: {
|
|
34374
|
-
build: "pnpm run clean && pnpm run bundle",
|
|
34375
|
-
bundle: "node -r esbuild-register scripts/bundle.ts",
|
|
34376
|
-
clean: "rimraf dist",
|
|
34377
|
-
prepublishOnly: "SOURCEMAPS=false pnpm run build",
|
|
34378
|
-
start: "pnpm run bundle && cross-env NODE_OPTIONS=--enable-source-maps ./bin/onlineornot.js",
|
|
34379
|
-
"check:type": "tsgo --noEmit",
|
|
34380
|
-
test: "vitest",
|
|
34381
|
-
"test:ci": "vitest run"
|
|
34382
|
-
},
|
|
34383
|
-
dependencies: {
|
|
34384
|
-
chalk: "^5.2.0",
|
|
34385
|
-
"cli-table3": "^0.6.3",
|
|
34386
|
-
conf: "^15.1.0",
|
|
34387
|
-
esbuild: "^0.17.7",
|
|
34388
|
-
open: "^8.4.2",
|
|
34389
|
-
"supports-color": "^9.3.1",
|
|
34390
|
-
undici: "^5.18.0",
|
|
34391
|
-
"update-check": "^1.5.4",
|
|
34392
|
-
yargs: "^17.7.2"
|
|
34393
|
-
},
|
|
34394
|
-
devDependencies: {
|
|
34395
|
-
"@types/node": "^22",
|
|
34396
|
-
"@types/yargs": "^17.0.35",
|
|
34397
|
-
"cross-env": "^7.0.3",
|
|
34398
|
-
"esbuild-register": "^3.4.2",
|
|
34399
|
-
rimraf: "^6.1.3",
|
|
34400
|
-
vitest: "^4.0.0"
|
|
34401
|
-
},
|
|
34402
|
-
engines: {
|
|
34403
|
-
node: ">=22"
|
|
34404
|
-
}
|
|
34405
|
-
};
|
|
34406
|
-
|
|
34407
34511
|
// ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
34408
34512
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
34409
34513
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
@@ -34592,7 +34696,7 @@ var ansi_styles_default = ansiStyles;
|
|
|
34592
34696
|
|
|
34593
34697
|
// ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js
|
|
34594
34698
|
var import_node_process = __toESM(require("node:process"), 1);
|
|
34595
|
-
var
|
|
34699
|
+
var import_node_os2 = __toESM(require("node:os"), 1);
|
|
34596
34700
|
var import_node_tty = __toESM(require("node:tty"), 1);
|
|
34597
34701
|
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) {
|
|
34598
34702
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
@@ -34657,7 +34761,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
34657
34761
|
return min;
|
|
34658
34762
|
}
|
|
34659
34763
|
if (import_node_process.default.platform === "win32") {
|
|
34660
|
-
const osRelease =
|
|
34764
|
+
const osRelease = import_node_os2.default.release().split(".");
|
|
34661
34765
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
34662
34766
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
34663
34767
|
}
|
|
@@ -34901,7 +35005,7 @@ var source_default = chalk;
|
|
|
34901
35005
|
|
|
34902
35006
|
// ../../node_modules/.pnpm/supports-color@9.4.0/node_modules/supports-color/index.js
|
|
34903
35007
|
var import_node_process2 = __toESM(require("node:process"), 1);
|
|
34904
|
-
var
|
|
35008
|
+
var import_node_os3 = __toESM(require("node:os"), 1);
|
|
34905
35009
|
var import_node_tty2 = __toESM(require("node:tty"), 1);
|
|
34906
35010
|
function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process2.default.argv) {
|
|
34907
35011
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
@@ -34966,7 +35070,7 @@ function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
34966
35070
|
return min;
|
|
34967
35071
|
}
|
|
34968
35072
|
if (import_node_process2.default.platform === "win32") {
|
|
34969
|
-
const osRelease =
|
|
35073
|
+
const osRelease = import_node_os3.default.release().split(".");
|
|
34970
35074
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
34971
35075
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
34972
35076
|
}
|
|
@@ -35028,7 +35132,6 @@ var supports_color_default2 = supportsColor2;
|
|
|
35028
35132
|
// src/logger.ts
|
|
35029
35133
|
var import_node_util = require("node:util");
|
|
35030
35134
|
var import_cli_table3 = __toESM(require_cli_table3());
|
|
35031
|
-
var import_esbuild = require("esbuild");
|
|
35032
35135
|
|
|
35033
35136
|
// src/environment-variables/factory.ts
|
|
35034
35137
|
function getEnvironmentVariableFactory({
|
|
@@ -35045,6 +35148,11 @@ function getEnvironmentVariableFactory({
|
|
|
35045
35148
|
}
|
|
35046
35149
|
|
|
35047
35150
|
// src/logger.ts
|
|
35151
|
+
var formatMessagesSync;
|
|
35152
|
+
try {
|
|
35153
|
+
formatMessagesSync = require("esbuild").formatMessagesSync;
|
|
35154
|
+
} catch {
|
|
35155
|
+
}
|
|
35048
35156
|
var LOGGER_LEVELS = {
|
|
35049
35157
|
none: -1,
|
|
35050
35158
|
error: 0,
|
|
@@ -35089,14 +35197,17 @@ var Logger = class {
|
|
|
35089
35197
|
}
|
|
35090
35198
|
formatMessage(level, message) {
|
|
35091
35199
|
const kind = LOGGER_LEVEL_FORMAT_TYPE_MAP[level];
|
|
35092
|
-
if (kind) {
|
|
35200
|
+
if (kind && formatMessagesSync) {
|
|
35093
35201
|
const [firstLine, ...otherLines] = message.split("\n");
|
|
35094
35202
|
const notes = otherLines.length > 0 ? otherLines.map((text) => ({ text })) : void 0;
|
|
35095
|
-
return
|
|
35203
|
+
return formatMessagesSync([{ text: firstLine, notes }], {
|
|
35096
35204
|
color: true,
|
|
35097
35205
|
kind,
|
|
35098
35206
|
terminalWidth: this.columns
|
|
35099
35207
|
})[0];
|
|
35208
|
+
} else if (kind) {
|
|
35209
|
+
const prefix = kind === "error" ? source_default.red("\u2718") : source_default.yellow("\u26A0");
|
|
35210
|
+
return `${prefix} ${message}`;
|
|
35100
35211
|
} else {
|
|
35101
35212
|
return message;
|
|
35102
35213
|
}
|
|
@@ -35216,7 +35327,7 @@ var getOnlineOrNotAPITokenFromEnv = getEnvironmentVariableFactory({
|
|
|
35216
35327
|
var import_node_util3 = require("node:util");
|
|
35217
35328
|
var import_node_process8 = __toESM(require("node:process"), 1);
|
|
35218
35329
|
var import_node_fs2 = __toESM(require("node:fs"), 1);
|
|
35219
|
-
var
|
|
35330
|
+
var import_node_path5 = __toESM(require("node:path"), 1);
|
|
35220
35331
|
var import_node_crypto = __toESM(require("node:crypto"), 1);
|
|
35221
35332
|
var import_node_assert = __toESM(require("node:assert"), 1);
|
|
35222
35333
|
|
|
@@ -35253,16 +35364,16 @@ function processSegment(segment, parts) {
|
|
|
35253
35364
|
}
|
|
35254
35365
|
return true;
|
|
35255
35366
|
}
|
|
35256
|
-
function parsePath(
|
|
35257
|
-
if (typeof
|
|
35258
|
-
throw new TypeError(`Expected a string, got ${typeof
|
|
35367
|
+
function parsePath(path8) {
|
|
35368
|
+
if (typeof path8 !== "string") {
|
|
35369
|
+
throw new TypeError(`Expected a string, got ${typeof path8}`);
|
|
35259
35370
|
}
|
|
35260
35371
|
const parts = [];
|
|
35261
35372
|
let currentSegment = "";
|
|
35262
35373
|
let currentPart = "start";
|
|
35263
35374
|
let isEscaping = false;
|
|
35264
35375
|
let position = 0;
|
|
35265
|
-
for (const character of
|
|
35376
|
+
for (const character of path8) {
|
|
35266
35377
|
position++;
|
|
35267
35378
|
if (isEscaping) {
|
|
35268
35379
|
currentSegment += character;
|
|
@@ -35372,13 +35483,13 @@ function parsePath(path6) {
|
|
|
35372
35483
|
}
|
|
35373
35484
|
return parts;
|
|
35374
35485
|
}
|
|
35375
|
-
function normalizePath(
|
|
35376
|
-
if (typeof
|
|
35377
|
-
return parsePath(
|
|
35486
|
+
function normalizePath(path8) {
|
|
35487
|
+
if (typeof path8 === "string") {
|
|
35488
|
+
return parsePath(path8);
|
|
35378
35489
|
}
|
|
35379
|
-
if (Array.isArray(
|
|
35490
|
+
if (Array.isArray(path8)) {
|
|
35380
35491
|
const normalized = [];
|
|
35381
|
-
for (const [index, segment] of
|
|
35492
|
+
for (const [index, segment] of path8.entries()) {
|
|
35382
35493
|
if (typeof segment !== "string" && typeof segment !== "number") {
|
|
35383
35494
|
throw new TypeError(`Expected a string or number for path segment at index ${index}, got ${typeof segment}`);
|
|
35384
35495
|
}
|
|
@@ -35398,11 +35509,11 @@ function normalizePath(path6) {
|
|
|
35398
35509
|
}
|
|
35399
35510
|
return [];
|
|
35400
35511
|
}
|
|
35401
|
-
function getProperty(object,
|
|
35402
|
-
if (!isObject(object) || typeof
|
|
35512
|
+
function getProperty(object, path8, value) {
|
|
35513
|
+
if (!isObject(object) || typeof path8 !== "string" && !Array.isArray(path8)) {
|
|
35403
35514
|
return value === void 0 ? object : value;
|
|
35404
35515
|
}
|
|
35405
|
-
const pathArray = normalizePath(
|
|
35516
|
+
const pathArray = normalizePath(path8);
|
|
35406
35517
|
if (pathArray.length === 0) {
|
|
35407
35518
|
return value;
|
|
35408
35519
|
}
|
|
@@ -35418,12 +35529,12 @@ function getProperty(object, path6, value) {
|
|
|
35418
35529
|
}
|
|
35419
35530
|
return object === void 0 ? value : object;
|
|
35420
35531
|
}
|
|
35421
|
-
function setProperty(object,
|
|
35422
|
-
if (!isObject(object) || typeof
|
|
35532
|
+
function setProperty(object, path8, value) {
|
|
35533
|
+
if (!isObject(object) || typeof path8 !== "string" && !Array.isArray(path8)) {
|
|
35423
35534
|
return object;
|
|
35424
35535
|
}
|
|
35425
35536
|
const root = object;
|
|
35426
|
-
const pathArray = normalizePath(
|
|
35537
|
+
const pathArray = normalizePath(path8);
|
|
35427
35538
|
if (pathArray.length === 0) {
|
|
35428
35539
|
return object;
|
|
35429
35540
|
}
|
|
@@ -35440,11 +35551,11 @@ function setProperty(object, path6, value) {
|
|
|
35440
35551
|
}
|
|
35441
35552
|
return root;
|
|
35442
35553
|
}
|
|
35443
|
-
function deleteProperty(object,
|
|
35444
|
-
if (!isObject(object) || typeof
|
|
35554
|
+
function deleteProperty(object, path8) {
|
|
35555
|
+
if (!isObject(object) || typeof path8 !== "string" && !Array.isArray(path8)) {
|
|
35445
35556
|
return false;
|
|
35446
35557
|
}
|
|
35447
|
-
const pathArray = normalizePath(
|
|
35558
|
+
const pathArray = normalizePath(path8);
|
|
35448
35559
|
if (pathArray.length === 0) {
|
|
35449
35560
|
return false;
|
|
35450
35561
|
}
|
|
@@ -35464,11 +35575,11 @@ function deleteProperty(object, path6) {
|
|
|
35464
35575
|
}
|
|
35465
35576
|
}
|
|
35466
35577
|
}
|
|
35467
|
-
function hasProperty(object,
|
|
35468
|
-
if (!isObject(object) || typeof
|
|
35578
|
+
function hasProperty(object, path8) {
|
|
35579
|
+
if (!isObject(object) || typeof path8 !== "string" && !Array.isArray(path8)) {
|
|
35469
35580
|
return false;
|
|
35470
35581
|
}
|
|
35471
|
-
const pathArray = normalizePath(
|
|
35582
|
+
const pathArray = normalizePath(path8);
|
|
35472
35583
|
if (pathArray.length === 0) {
|
|
35473
35584
|
return false;
|
|
35474
35585
|
}
|
|
@@ -35482,43 +35593,43 @@ function hasProperty(object, path6) {
|
|
|
35482
35593
|
}
|
|
35483
35594
|
|
|
35484
35595
|
// ../../node_modules/.pnpm/env-paths@3.0.0/node_modules/env-paths/index.js
|
|
35485
|
-
var
|
|
35486
|
-
var
|
|
35596
|
+
var import_node_path2 = __toESM(require("node:path"), 1);
|
|
35597
|
+
var import_node_os4 = __toESM(require("node:os"), 1);
|
|
35487
35598
|
var import_node_process3 = __toESM(require("node:process"), 1);
|
|
35488
|
-
var homedir =
|
|
35489
|
-
var tmpdir =
|
|
35599
|
+
var homedir = import_node_os4.default.homedir();
|
|
35600
|
+
var tmpdir = import_node_os4.default.tmpdir();
|
|
35490
35601
|
var { env: env4 } = import_node_process3.default;
|
|
35491
35602
|
var macos = (name) => {
|
|
35492
|
-
const library =
|
|
35603
|
+
const library = import_node_path2.default.join(homedir, "Library");
|
|
35493
35604
|
return {
|
|
35494
|
-
data:
|
|
35495
|
-
config:
|
|
35496
|
-
cache:
|
|
35497
|
-
log:
|
|
35498
|
-
temp:
|
|
35605
|
+
data: import_node_path2.default.join(library, "Application Support", name),
|
|
35606
|
+
config: import_node_path2.default.join(library, "Preferences", name),
|
|
35607
|
+
cache: import_node_path2.default.join(library, "Caches", name),
|
|
35608
|
+
log: import_node_path2.default.join(library, "Logs", name),
|
|
35609
|
+
temp: import_node_path2.default.join(tmpdir, name)
|
|
35499
35610
|
};
|
|
35500
35611
|
};
|
|
35501
35612
|
var windows = (name) => {
|
|
35502
|
-
const appData = env4.APPDATA ||
|
|
35503
|
-
const localAppData = env4.LOCALAPPDATA ||
|
|
35613
|
+
const appData = env4.APPDATA || import_node_path2.default.join(homedir, "AppData", "Roaming");
|
|
35614
|
+
const localAppData = env4.LOCALAPPDATA || import_node_path2.default.join(homedir, "AppData", "Local");
|
|
35504
35615
|
return {
|
|
35505
35616
|
// Data/config/cache/log are invented by me as Windows isn't opinionated about this
|
|
35506
|
-
data:
|
|
35507
|
-
config:
|
|
35508
|
-
cache:
|
|
35509
|
-
log:
|
|
35510
|
-
temp:
|
|
35617
|
+
data: import_node_path2.default.join(localAppData, name, "Data"),
|
|
35618
|
+
config: import_node_path2.default.join(appData, name, "Config"),
|
|
35619
|
+
cache: import_node_path2.default.join(localAppData, name, "Cache"),
|
|
35620
|
+
log: import_node_path2.default.join(localAppData, name, "Log"),
|
|
35621
|
+
temp: import_node_path2.default.join(tmpdir, name)
|
|
35511
35622
|
};
|
|
35512
35623
|
};
|
|
35513
35624
|
var linux = (name) => {
|
|
35514
|
-
const username =
|
|
35625
|
+
const username = import_node_path2.default.basename(homedir);
|
|
35515
35626
|
return {
|
|
35516
|
-
data:
|
|
35517
|
-
config:
|
|
35518
|
-
cache:
|
|
35627
|
+
data: import_node_path2.default.join(env4.XDG_DATA_HOME || import_node_path2.default.join(homedir, ".local", "share"), name),
|
|
35628
|
+
config: import_node_path2.default.join(env4.XDG_CONFIG_HOME || import_node_path2.default.join(homedir, ".config"), name),
|
|
35629
|
+
cache: import_node_path2.default.join(env4.XDG_CACHE_HOME || import_node_path2.default.join(homedir, ".cache"), name),
|
|
35519
35630
|
// https://wiki.debian.org/XDGBaseDirectorySpecification#state
|
|
35520
|
-
log:
|
|
35521
|
-
temp:
|
|
35631
|
+
log: import_node_path2.default.join(env4.XDG_STATE_HOME || import_node_path2.default.join(homedir, ".local", "state"), name),
|
|
35632
|
+
temp: import_node_path2.default.join(tmpdir, username, name)
|
|
35522
35633
|
};
|
|
35523
35634
|
};
|
|
35524
35635
|
function envPaths(name, { suffix = "nodejs" } = {}) {
|
|
@@ -35538,7 +35649,7 @@ function envPaths(name, { suffix = "nodejs" } = {}) {
|
|
|
35538
35649
|
}
|
|
35539
35650
|
|
|
35540
35651
|
// ../../node_modules/.pnpm/atomically@2.1.1/node_modules/atomically/dist/index.js
|
|
35541
|
-
var
|
|
35652
|
+
var import_node_path4 = __toESM(require("node:path"), 1);
|
|
35542
35653
|
|
|
35543
35654
|
// ../../node_modules/.pnpm/stubborn-fs@2.0.0/node_modules/stubborn-fs/dist/index.js
|
|
35544
35655
|
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
@@ -35738,7 +35849,7 @@ var isUndefined = (value) => {
|
|
|
35738
35849
|
};
|
|
35739
35850
|
|
|
35740
35851
|
// ../../node_modules/.pnpm/atomically@2.1.1/node_modules/atomically/dist/utils/temp.js
|
|
35741
|
-
var
|
|
35852
|
+
var import_node_path3 = __toESM(require("node:path"), 1);
|
|
35742
35853
|
|
|
35743
35854
|
// ../../node_modules/.pnpm/when-exit@2.1.5/node_modules/when-exit/dist/node/interceptor.js
|
|
35744
35855
|
var import_node_process7 = __toESM(require("node:process"), 1);
|
|
@@ -35843,7 +35954,7 @@ var Temp = {
|
|
|
35843
35954
|
}
|
|
35844
35955
|
},
|
|
35845
35956
|
truncate: (filePath) => {
|
|
35846
|
-
const basename2 =
|
|
35957
|
+
const basename2 = import_node_path3.default.basename(filePath);
|
|
35847
35958
|
if (basename2.length <= LIMIT_BASENAME_LENGTH)
|
|
35848
35959
|
return filePath;
|
|
35849
35960
|
const truncable = /^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(basename2);
|
|
@@ -35885,7 +35996,7 @@ function writeFileSync(filePath, data, options6 = DEFAULT_WRITE_OPTIONS) {
|
|
|
35885
35996
|
}
|
|
35886
35997
|
}
|
|
35887
35998
|
if (!filePathExists) {
|
|
35888
|
-
const parentPath =
|
|
35999
|
+
const parentPath = import_node_path4.default.dirname(filePath);
|
|
35889
36000
|
dist_default.attempt.mkdirSync(parentPath, {
|
|
35890
36001
|
mode: DEFAULT_FOLDER_MODE,
|
|
35891
36002
|
recursive: true
|
|
@@ -36479,7 +36590,7 @@ var Conf = class {
|
|
|
36479
36590
|
throw new Error("Config schema violation: " + errors.join("; "));
|
|
36480
36591
|
}
|
|
36481
36592
|
_ensureDirectory() {
|
|
36482
|
-
import_node_fs2.default.mkdirSync(
|
|
36593
|
+
import_node_fs2.default.mkdirSync(import_node_path5.default.dirname(this.path), { recursive: true });
|
|
36483
36594
|
}
|
|
36484
36595
|
_write(value) {
|
|
36485
36596
|
let data = this._serialize(value);
|
|
@@ -36518,8 +36629,8 @@ var Conf = class {
|
|
|
36518
36629
|
this.#debouncedChangeHandler ??= debounce_fn_default(() => {
|
|
36519
36630
|
this.events.dispatchEvent(new Event("change"));
|
|
36520
36631
|
}, { wait: 100 });
|
|
36521
|
-
const directory =
|
|
36522
|
-
const basename2 =
|
|
36632
|
+
const directory = import_node_path5.default.dirname(this.path);
|
|
36633
|
+
const basename2 = import_node_path5.default.basename(this.path);
|
|
36523
36634
|
this.#watcher = import_node_fs2.default.watch(directory, { persistent: false, encoding: "utf8" }, (_eventType, filename) => {
|
|
36524
36635
|
if (filename && filename !== basename2) {
|
|
36525
36636
|
return;
|
|
@@ -36700,7 +36811,7 @@ var Conf = class {
|
|
|
36700
36811
|
#resolvePath(options6) {
|
|
36701
36812
|
const normalizedFileExtension = typeof options6.fileExtension === "string" ? options6.fileExtension : void 0;
|
|
36702
36813
|
const fileExtension = normalizedFileExtension ? `.${normalizedFileExtension}` : "";
|
|
36703
|
-
return
|
|
36814
|
+
return import_node_path5.default.resolve(options6.cwd, `${options6.configName ?? "config"}${fileExtension}`);
|
|
36704
36815
|
}
|
|
36705
36816
|
#initializeStore(options6) {
|
|
36706
36817
|
if (options6.migrations) {
|
|
@@ -36742,11 +36853,11 @@ var Conf = class {
|
|
|
36742
36853
|
};
|
|
36743
36854
|
|
|
36744
36855
|
// src/auth/credentials.ts
|
|
36745
|
-
var
|
|
36746
|
-
var
|
|
36856
|
+
var import_node_os5 = __toESM(require("node:os"));
|
|
36857
|
+
var import_node_path6 = __toESM(require("node:path"));
|
|
36747
36858
|
var config = new Conf({
|
|
36748
36859
|
projectName: "onlineornot",
|
|
36749
|
-
cwd:
|
|
36860
|
+
cwd: import_node_path6.default.join(import_node_os5.default.homedir(), ".config", "onlineornot"),
|
|
36750
36861
|
configName: "credentials"
|
|
36751
36862
|
});
|
|
36752
36863
|
function validateCredentials(data) {
|
|
@@ -37194,6 +37305,7 @@ async function fetchPagedResult(resource, init = {}, queryParams) {
|
|
|
37194
37305
|
while (getMoreResults) {
|
|
37195
37306
|
queryParams = new import_node_url2.URLSearchParams(queryParams);
|
|
37196
37307
|
queryParams.set("page", String(page));
|
|
37308
|
+
queryParams.set("page_size", "100");
|
|
37197
37309
|
const json = await fetchInternal(
|
|
37198
37310
|
resource,
|
|
37199
37311
|
init,
|
|
@@ -38049,6 +38161,142 @@ async function logoutHandler() {
|
|
|
38049
38161
|
logger.log("Successfully logged out.");
|
|
38050
38162
|
}
|
|
38051
38163
|
|
|
38164
|
+
// src/update.ts
|
|
38165
|
+
var import_promises2 = __toESM(require("node:fs/promises"));
|
|
38166
|
+
var import_node_os6 = __toESM(require("node:os"));
|
|
38167
|
+
var import_node_path7 = __toESM(require("node:path"));
|
|
38168
|
+
var INSTALL_DIR2 = process.env.ONLINEORNOT_INSTALL_DIR || import_node_path7.default.join(import_node_os6.default.homedir(), ".onlineornot");
|
|
38169
|
+
var REPO2 = "OnlineOrNot/onlineornot-cli";
|
|
38170
|
+
function isSEA2() {
|
|
38171
|
+
return process.env.ONLINEORNOT_SEA === "true";
|
|
38172
|
+
}
|
|
38173
|
+
function isNewerVersion2(a, b) {
|
|
38174
|
+
const partsA = a.replace(/^v/, "").split(".").map(Number);
|
|
38175
|
+
const partsB = b.replace(/^v/, "").split(".").map(Number);
|
|
38176
|
+
for (let i = 0; i < 3; i++) {
|
|
38177
|
+
const numA = partsA[i] || 0;
|
|
38178
|
+
const numB = partsB[i] || 0;
|
|
38179
|
+
if (numA > numB)
|
|
38180
|
+
return true;
|
|
38181
|
+
if (numA < numB)
|
|
38182
|
+
return false;
|
|
38183
|
+
}
|
|
38184
|
+
return false;
|
|
38185
|
+
}
|
|
38186
|
+
function updateOptions(yargs) {
|
|
38187
|
+
return yargs.option("force", {
|
|
38188
|
+
alias: "f",
|
|
38189
|
+
type: "boolean",
|
|
38190
|
+
description: "Force update even if already on latest version",
|
|
38191
|
+
default: false
|
|
38192
|
+
}).option("check", {
|
|
38193
|
+
alias: "c",
|
|
38194
|
+
type: "boolean",
|
|
38195
|
+
description: "Only check for updates, don't install",
|
|
38196
|
+
default: false
|
|
38197
|
+
});
|
|
38198
|
+
}
|
|
38199
|
+
async function updateHandler(args) {
|
|
38200
|
+
const currentVersion = package_default.version;
|
|
38201
|
+
if (!isSEA2()) {
|
|
38202
|
+
logger.log("");
|
|
38203
|
+
logger.log(
|
|
38204
|
+
`You're running OnlineOrNot CLI via ${source_default.cyan("npm/pnpm")}, not as a standalone binary.`
|
|
38205
|
+
);
|
|
38206
|
+
logger.log("");
|
|
38207
|
+
logger.log("To update, run:");
|
|
38208
|
+
logger.log(source_default.dim(" npm update -g onlineornot"));
|
|
38209
|
+
logger.log(source_default.dim(" # or"));
|
|
38210
|
+
logger.log(source_default.dim(" pnpm update -g onlineornot"));
|
|
38211
|
+
logger.log("");
|
|
38212
|
+
logger.log(`Or install the standalone binary for auto-updates:`);
|
|
38213
|
+
logger.log(
|
|
38214
|
+
source_default.dim(" curl -fsSL https://onlineornot.com/install | bash")
|
|
38215
|
+
);
|
|
38216
|
+
return;
|
|
38217
|
+
}
|
|
38218
|
+
logger.log(`Current version: ${source_default.cyan(currentVersion)}`);
|
|
38219
|
+
logger.log("Checking for updates...");
|
|
38220
|
+
const response = await fetch(
|
|
38221
|
+
`https://api.github.com/repos/${REPO2}/releases`,
|
|
38222
|
+
{
|
|
38223
|
+
headers: {
|
|
38224
|
+
"User-Agent": "onlineornot-cli"
|
|
38225
|
+
}
|
|
38226
|
+
}
|
|
38227
|
+
);
|
|
38228
|
+
if (!response.ok) {
|
|
38229
|
+
logger.error("Failed to check for updates. Please try again later.");
|
|
38230
|
+
return;
|
|
38231
|
+
}
|
|
38232
|
+
const releases = await response.json();
|
|
38233
|
+
const release = releases.find((r) => r.tag_name.startsWith("onlineornot@"));
|
|
38234
|
+
if (!release) {
|
|
38235
|
+
logger.error("No releases found.");
|
|
38236
|
+
return;
|
|
38237
|
+
}
|
|
38238
|
+
const latestVersion = release.tag_name.replace(/^onlineornot@/, "");
|
|
38239
|
+
if (!args.force && !isNewerVersion2(latestVersion, currentVersion)) {
|
|
38240
|
+
logger.log("");
|
|
38241
|
+
logger.log(source_default.green("\u2713") + " You're already on the latest version!");
|
|
38242
|
+
return;
|
|
38243
|
+
}
|
|
38244
|
+
logger.log(`Latest version: ${source_default.green(latestVersion)}`);
|
|
38245
|
+
if (args.check) {
|
|
38246
|
+
if (isNewerVersion2(latestVersion, currentVersion)) {
|
|
38247
|
+
logger.log("");
|
|
38248
|
+
logger.log(
|
|
38249
|
+
`Run ${source_default.cyan("onlineornot update")} to install the latest version.`
|
|
38250
|
+
);
|
|
38251
|
+
}
|
|
38252
|
+
return;
|
|
38253
|
+
}
|
|
38254
|
+
const osName = process.platform === "darwin" ? "darwin" : "linux";
|
|
38255
|
+
const arch = process.arch === "arm64" ? "arm64" : "amd64";
|
|
38256
|
+
const binaryName = `onlineornot-${osName}-${arch}`;
|
|
38257
|
+
const asset = release.assets.find((a) => a.name === binaryName);
|
|
38258
|
+
if (!asset) {
|
|
38259
|
+
logger.error(`No binary available for your platform (${osName}-${arch})`);
|
|
38260
|
+
return;
|
|
38261
|
+
}
|
|
38262
|
+
logger.log("");
|
|
38263
|
+
logger.log(`Downloading ${source_default.cyan(binaryName)}...`);
|
|
38264
|
+
const binaryResponse = await fetch(asset.browser_download_url);
|
|
38265
|
+
if (!binaryResponse.ok) {
|
|
38266
|
+
logger.error("Failed to download update. Please try again later.");
|
|
38267
|
+
return;
|
|
38268
|
+
}
|
|
38269
|
+
const buffer = await binaryResponse.arrayBuffer();
|
|
38270
|
+
const currentBinary = process.execPath;
|
|
38271
|
+
const tempPath = `${currentBinary}.new`;
|
|
38272
|
+
await import_promises2.default.writeFile(tempPath, Buffer.from(buffer));
|
|
38273
|
+
await import_promises2.default.chmod(tempPath, 493);
|
|
38274
|
+
const backupPath = `${currentBinary}.backup`;
|
|
38275
|
+
try {
|
|
38276
|
+
await import_promises2.default.copyFile(currentBinary, backupPath);
|
|
38277
|
+
await import_promises2.default.rename(tempPath, currentBinary);
|
|
38278
|
+
await import_promises2.default.rm(backupPath, { force: true });
|
|
38279
|
+
} catch (error) {
|
|
38280
|
+
try {
|
|
38281
|
+
await import_promises2.default.rename(backupPath, currentBinary);
|
|
38282
|
+
} catch {
|
|
38283
|
+
}
|
|
38284
|
+
throw error;
|
|
38285
|
+
}
|
|
38286
|
+
await import_promises2.default.mkdir(INSTALL_DIR2, { recursive: true });
|
|
38287
|
+
await import_promises2.default.writeFile(import_node_path7.default.join(INSTALL_DIR2, "version"), latestVersion);
|
|
38288
|
+
logger.log("");
|
|
38289
|
+
logger.log(
|
|
38290
|
+
source_default.green("\u2713") + ` Updated to version ${source_default.cyan(latestVersion)}!`
|
|
38291
|
+
);
|
|
38292
|
+
logger.log("");
|
|
38293
|
+
logger.log(
|
|
38294
|
+
source_default.dim(
|
|
38295
|
+
"Restart your terminal or run a new command to use the new version."
|
|
38296
|
+
)
|
|
38297
|
+
);
|
|
38298
|
+
}
|
|
38299
|
+
|
|
38052
38300
|
// src/whoami.ts
|
|
38053
38301
|
async function whoami() {
|
|
38054
38302
|
logger.log("Getting User settings...");
|
|
@@ -38224,6 +38472,12 @@ function createCLIParser(argv) {
|
|
|
38224
38472
|
}
|
|
38225
38473
|
}
|
|
38226
38474
|
);
|
|
38475
|
+
onlineornot.command(
|
|
38476
|
+
"update",
|
|
38477
|
+
"\u2B06\uFE0F Update OnlineOrNot CLI to the latest version",
|
|
38478
|
+
updateOptions,
|
|
38479
|
+
updateHandler
|
|
38480
|
+
);
|
|
38227
38481
|
onlineornot.exitProcess(false);
|
|
38228
38482
|
return onlineornot;
|
|
38229
38483
|
}
|
|
@@ -38248,10 +38502,20 @@ async function main(argv) {
|
|
|
38248
38502
|
}
|
|
38249
38503
|
|
|
38250
38504
|
// src/cli.ts
|
|
38251
|
-
|
|
38252
|
-
|
|
38253
|
-
|
|
38254
|
-
}
|
|
38505
|
+
async function run() {
|
|
38506
|
+
if (await handleUpdateCheckFlag()) {
|
|
38507
|
+
return;
|
|
38508
|
+
}
|
|
38509
|
+
await applyPendingUpdate();
|
|
38510
|
+
checkForUpdateInBackground();
|
|
38511
|
+
try {
|
|
38512
|
+
await main(hideBin(import_process.default.argv));
|
|
38513
|
+
} catch (e) {
|
|
38514
|
+
const exitCode = e instanceof FatalError && e.code || 1;
|
|
38515
|
+
import_process.default.exit(exitCode);
|
|
38516
|
+
}
|
|
38517
|
+
}
|
|
38518
|
+
run();
|
|
38255
38519
|
/*! Bundled license information:
|
|
38256
38520
|
|
|
38257
38521
|
deep-extend/lib/deep-extend.js:
|