xgen-dex-cli 1.2.2 → 1.3.0
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/dist/chunks/{chunk-GS2Q7ZZA.js → chunk-ULMEXJOR.js} +14 -3
- package/dist/chunks/chunk-ULMEXJOR.js.map +7 -0
- package/dist/chunks/{tui-PNFWGJTJ.js → tui-GDC2NODL.js} +304 -138
- package/dist/chunks/tui-GDC2NODL.js.map +7 -0
- package/dist/cli.js +3 -3
- package/package.json +1 -1
- package/dist/chunks/chunk-GS2Q7ZZA.js.map +0 -7
- package/dist/chunks/tui-PNFWGJTJ.js.map +0 -7
|
@@ -361,15 +361,26 @@ function validateProfileName(input) {
|
|
|
361
361
|
return name;
|
|
362
362
|
}
|
|
363
363
|
function validateServerUrl(input) {
|
|
364
|
+
const raw = input.trim();
|
|
365
|
+
if (!raw) {
|
|
366
|
+
throw new DexError("config_invalid", "\uC11C\uBC84 \uC8FC\uC18C\uB97C \uC785\uB825\uD558\uC138\uC694.");
|
|
367
|
+
}
|
|
368
|
+
const hasScheme = /^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(raw);
|
|
369
|
+
const bare = raw.replace(/^\/+/, "");
|
|
370
|
+
const local = /^(localhost|127\.0\.0\.1|\[?::1\]?)(:|$|\/)/i.test(bare);
|
|
371
|
+
const candidate = hasScheme ? raw : `${local ? "http" : "https"}://${bare}`;
|
|
364
372
|
let url;
|
|
365
373
|
try {
|
|
366
|
-
url = new URL(
|
|
374
|
+
url = new URL(candidate);
|
|
367
375
|
} catch {
|
|
368
|
-
throw new DexError("config_invalid", "\uC11C\uBC84
|
|
376
|
+
throw new DexError("config_invalid", "\uC11C\uBC84 \uC8FC\uC18C\uB97C \uC54C\uC544\uBCFC \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC608: xgen.example.com");
|
|
369
377
|
}
|
|
370
378
|
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
|
371
379
|
throw new DexError("config_invalid", "\uC11C\uBC84 URL\uC740 http:// \uB610\uB294 https://\uB9CC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.");
|
|
372
380
|
}
|
|
381
|
+
if (!url.hostname) {
|
|
382
|
+
throw new DexError("config_invalid", "\uC11C\uBC84 \uC8FC\uC18C\uC5D0 \uD638\uC2A4\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uC608: xgen.example.com");
|
|
383
|
+
}
|
|
373
384
|
if (url.username || url.password || url.search || url.hash) {
|
|
374
385
|
throw new DexError("config_invalid", "\uC11C\uBC84 URL\uC5D0\uB294 \uC790\uACA9 \uC99D\uBA85, query, fragment\uB97C \uB123\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
375
386
|
}
|
|
@@ -4631,4 +4642,4 @@ export {
|
|
|
4631
4642
|
credentialBackend,
|
|
4632
4643
|
SystemCredentialStore
|
|
4633
4644
|
};
|
|
4634
|
-
//# sourceMappingURL=chunk-
|
|
4645
|
+
//# sourceMappingURL=chunk-ULMEXJOR.js.map
|