omni-dsh-plugins 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/bin.js +429 -132
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ never ships here.
|
|
|
22
22
|
- Node.js 20 or newer.
|
|
23
23
|
- The official `dsh` executable on `PATH` for add, update and remove operations.
|
|
24
24
|
- Network access for discovery. With no `--catalog`, the CLI reads the snapshot published at
|
|
25
|
-
<https://dsh-plugins.
|
|
25
|
+
<https://dsh-plugins.omniskill.online/catalog.snapshot.json> and accepts the revision that
|
|
26
26
|
snapshot declares, so a plugin merged today is findable today. Passing `--revision` turns the
|
|
27
27
|
fetch into an exact-commit demand and rejects any snapshot declaring a different one.
|
|
28
28
|
|
|
@@ -136,7 +136,7 @@ granting `--allow-code-execution`.
|
|
|
136
136
|
|
|
137
137
|
`--catalog` accepts a local catalog directory, a local
|
|
138
138
|
`omni-dsh-catalog-snapshot-v1` JSON file, or one of two allowlisted HTTPS URLs: the stable
|
|
139
|
-
site-hosted snapshot `https://dsh-plugins.
|
|
139
|
+
site-hosted snapshot `https://dsh-plugins.omniskill.online/catalog.snapshot.json` (the
|
|
140
140
|
operational remote source) or the raw GitHub form embedding the revision in its path.
|
|
141
141
|
Remote snapshots require `--revision <40-character-commit-sha>` and the snapshot document must
|
|
142
142
|
declare exactly that SHA. Redirects, alternate hosts, traversal, symlinks, oversized inputs,
|
|
@@ -144,7 +144,7 @@ and revision mismatches are rejected before catalog validation.
|
|
|
144
144
|
|
|
145
145
|
```bash
|
|
146
146
|
npx omni-dsh-plugins search tui \
|
|
147
|
-
--catalog https://dsh-plugins.
|
|
147
|
+
--catalog https://dsh-plugins.omniskill.online/catalog.snapshot.json \
|
|
148
148
|
--revision <published-catalog-revision>
|
|
149
149
|
```
|
|
150
150
|
|
package/dist/bin.js
CHANGED
|
@@ -6534,9 +6534,28 @@ var require_utils = __commonJS({
|
|
|
6534
6534
|
"use strict";
|
|
6535
6535
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
6536
6536
|
var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
6537
|
+
var isPort = RegExp.prototype.test.bind(/^\d*$/u);
|
|
6537
6538
|
var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
|
|
6538
6539
|
var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
|
|
6539
|
-
var isPathCharacter = RegExp.prototype.test.bind(/^[
|
|
6540
|
+
var isPathCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u);
|
|
6541
|
+
var isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u);
|
|
6542
|
+
var isUserinfoCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u);
|
|
6543
|
+
var BYTE_HEX = new Array(256);
|
|
6544
|
+
{
|
|
6545
|
+
const HEX_DIGITS = "0123456789ABCDEF";
|
|
6546
|
+
for (let i = 0; i < 256; i++) {
|
|
6547
|
+
BYTE_HEX[i] = "%" + HEX_DIGITS[i >> 4] + HEX_DIGITS[i & 15];
|
|
6548
|
+
}
|
|
6549
|
+
}
|
|
6550
|
+
function percentEncodeNonAscii(cp2) {
|
|
6551
|
+
if (cp2 < 2048) {
|
|
6552
|
+
return BYTE_HEX[192 | cp2 >> 6] + BYTE_HEX[128 | cp2 & 63];
|
|
6553
|
+
}
|
|
6554
|
+
if (cp2 < 65536) {
|
|
6555
|
+
return BYTE_HEX[224 | cp2 >> 12] + BYTE_HEX[128 | cp2 >> 6 & 63] + BYTE_HEX[128 | cp2 & 63];
|
|
6556
|
+
}
|
|
6557
|
+
return BYTE_HEX[240 | cp2 >> 18] + BYTE_HEX[128 | cp2 >> 12 & 63] + BYTE_HEX[128 | cp2 >> 6 & 63] + BYTE_HEX[128 | cp2 & 63];
|
|
6558
|
+
}
|
|
6540
6559
|
function stringArrayToHexStripped(input) {
|
|
6541
6560
|
let acc = "";
|
|
6542
6561
|
let code = 0;
|
|
@@ -6561,91 +6580,105 @@ var require_utils = __commonJS({
|
|
|
6561
6580
|
}
|
|
6562
6581
|
return acc;
|
|
6563
6582
|
}
|
|
6583
|
+
var isHextet = RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/);
|
|
6584
|
+
var isIPvFuture = RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/);
|
|
6585
|
+
var isZoneCharacter = RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/);
|
|
6564
6586
|
var nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
|
|
6565
|
-
function
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
if (hex !== "") {
|
|
6573
|
-
address.push(hex);
|
|
6574
|
-
} else {
|
|
6575
|
-
output.error = true;
|
|
6576
|
-
return false;
|
|
6587
|
+
function isZoneIdentifier(zone) {
|
|
6588
|
+
if (zone.length === 0) return false;
|
|
6589
|
+
for (let i = 0; i < zone.length; i++) {
|
|
6590
|
+
if (isZoneCharacter(zone[i])) continue;
|
|
6591
|
+
if (zone[i] === "%" && i + 2 < zone.length && isHexPair(zone.slice(i + 1, i + 3))) {
|
|
6592
|
+
i += 2;
|
|
6593
|
+
continue;
|
|
6577
6594
|
}
|
|
6578
|
-
|
|
6595
|
+
return false;
|
|
6579
6596
|
}
|
|
6580
6597
|
return true;
|
|
6581
6598
|
}
|
|
6582
|
-
function
|
|
6583
|
-
let
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
let
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
}
|
|
6595
|
-
if (cursor === ":") {
|
|
6596
|
-
if (endipv6Encountered === true) {
|
|
6597
|
-
endIpv6 = true;
|
|
6598
|
-
}
|
|
6599
|
-
if (!consume(buffer, address, output)) {
|
|
6600
|
-
break;
|
|
6601
|
-
}
|
|
6602
|
-
if (++tokenCount > 7) {
|
|
6603
|
-
output.error = true;
|
|
6604
|
-
break;
|
|
6599
|
+
function compressIPv6ZeroRun(hextets) {
|
|
6600
|
+
let bestStart = -1;
|
|
6601
|
+
let bestLength = 0;
|
|
6602
|
+
let runStart = -1;
|
|
6603
|
+
let runLength = 0;
|
|
6604
|
+
for (let i = 0; i < hextets.length; i++) {
|
|
6605
|
+
if (hextets[i] === "0") {
|
|
6606
|
+
if (runStart === -1) runStart = i;
|
|
6607
|
+
runLength++;
|
|
6608
|
+
if (runLength > bestLength) {
|
|
6609
|
+
bestLength = runLength;
|
|
6610
|
+
bestStart = runStart;
|
|
6605
6611
|
}
|
|
6606
|
-
if (i > 0 && input[i - 1] === ":") {
|
|
6607
|
-
endipv6Encountered = true;
|
|
6608
|
-
}
|
|
6609
|
-
address.push(":");
|
|
6610
|
-
continue;
|
|
6611
|
-
} else if (cursor === "%") {
|
|
6612
|
-
if (!consume(buffer, address, output)) {
|
|
6613
|
-
break;
|
|
6614
|
-
}
|
|
6615
|
-
consume = consumeIsZone;
|
|
6616
6612
|
} else {
|
|
6617
|
-
|
|
6613
|
+
runStart = -1;
|
|
6614
|
+
runLength = 0;
|
|
6615
|
+
}
|
|
6616
|
+
}
|
|
6617
|
+
if (bestLength < 2) return hextets.join(":");
|
|
6618
|
+
const head = hextets.slice(0, bestStart).join(":");
|
|
6619
|
+
const tail = hextets.slice(bestStart + bestLength).join(":");
|
|
6620
|
+
return head + "::" + tail;
|
|
6621
|
+
}
|
|
6622
|
+
function normalizeIPv6Address(input) {
|
|
6623
|
+
const compression = input.indexOf("::");
|
|
6624
|
+
if (compression !== -1 && input.indexOf("::", compression + 1) !== -1) return void 0;
|
|
6625
|
+
const left = compression === -1 ? input.split(":") : input.slice(0, compression).split(":");
|
|
6626
|
+
const right = compression === -1 ? [] : input.slice(compression + 2).split(":");
|
|
6627
|
+
if (compression !== -1) {
|
|
6628
|
+
if (left.length === 1 && left[0] === "") left.length = 0;
|
|
6629
|
+
if (right.length === 1 && right[0] === "") right.length = 0;
|
|
6630
|
+
}
|
|
6631
|
+
const parts = left.concat(right);
|
|
6632
|
+
let hextetCount = 0;
|
|
6633
|
+
for (let i = 0; i < parts.length; i++) {
|
|
6634
|
+
const part = parts[i];
|
|
6635
|
+
if (part === "") return void 0;
|
|
6636
|
+
if (part.indexOf(".") !== -1) {
|
|
6637
|
+
if (i !== parts.length - 1 || compression !== -1 && right.length === 0 || !isIPv4(part)) return void 0;
|
|
6638
|
+
hextetCount += 2;
|
|
6618
6639
|
continue;
|
|
6619
6640
|
}
|
|
6641
|
+
if (!isHextet(part)) return void 0;
|
|
6642
|
+
parts[i] = parseInt(part, 16).toString(16);
|
|
6643
|
+
hextetCount++;
|
|
6620
6644
|
}
|
|
6621
|
-
if (
|
|
6622
|
-
if (
|
|
6623
|
-
|
|
6624
|
-
} else if (endIpv6) {
|
|
6625
|
-
address.push(buffer.join(""));
|
|
6626
|
-
} else {
|
|
6627
|
-
address.push(stringArrayToHexStripped(buffer));
|
|
6628
|
-
}
|
|
6645
|
+
if (compression === -1) {
|
|
6646
|
+
if (hextetCount !== 8) return void 0;
|
|
6647
|
+
return compressIPv6ZeroRun(parts);
|
|
6629
6648
|
}
|
|
6630
|
-
|
|
6631
|
-
|
|
6649
|
+
if (hextetCount >= 8) return void 0;
|
|
6650
|
+
const expanded = parts.slice(0, left.length);
|
|
6651
|
+
for (let i = hextetCount; i < 8; i++) expanded.push("0");
|
|
6652
|
+
for (let i = left.length; i < parts.length; i++) expanded.push(parts[i]);
|
|
6653
|
+
return compressIPv6ZeroRun(expanded);
|
|
6632
6654
|
}
|
|
6633
6655
|
function normalizeIPv6(host) {
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
}
|
|
6637
|
-
|
|
6638
|
-
if (
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6656
|
+
const bracketed = host[0] === "[" && host[host.length - 1] === "]";
|
|
6657
|
+
const hasBracket = host[0] === "[" || host[host.length - 1] === "]";
|
|
6658
|
+
if (hasBracket && !bracketed) return { host, isIPV6: false, error: true };
|
|
6659
|
+
let input = bracketed ? host.slice(1, -1) : host;
|
|
6660
|
+
if (bracketed && isIPvFuture(input)) {
|
|
6661
|
+
input = input.toLowerCase();
|
|
6662
|
+
return { host: `[${input}]`, escapedHost: input, isIPV6: false, isIPVFuture: true };
|
|
6663
|
+
}
|
|
6664
|
+
if (findToken(input, ":") < 2) {
|
|
6665
|
+
return { host, isIPV6: false, error: bracketed };
|
|
6666
|
+
}
|
|
6667
|
+
let zoneIdentifier = "";
|
|
6668
|
+
const zoneSeparator = input.indexOf("%");
|
|
6669
|
+
if (zoneSeparator !== -1) {
|
|
6670
|
+
const separatorLength = input.slice(zoneSeparator, zoneSeparator + 3).toLowerCase() === "%25" ? 3 : 1;
|
|
6671
|
+
zoneIdentifier = input.slice(zoneSeparator + separatorLength);
|
|
6672
|
+
if (!isZoneIdentifier(zoneIdentifier)) return { host, isIPV6: false, error: true };
|
|
6673
|
+
input = input.slice(0, zoneSeparator);
|
|
6674
|
+
}
|
|
6675
|
+
const address = normalizeIPv6Address(input);
|
|
6676
|
+
if (address === void 0) return { host, isIPV6: false, error: true };
|
|
6677
|
+
return {
|
|
6678
|
+
host: address + (zoneIdentifier ? "%" + zoneIdentifier : ""),
|
|
6679
|
+
escapedHost: address + (zoneIdentifier ? "%25" + zoneIdentifier : ""),
|
|
6680
|
+
isIPV6: true
|
|
6681
|
+
};
|
|
6649
6682
|
}
|
|
6650
6683
|
function findToken(str, token) {
|
|
6651
6684
|
let ind = 0;
|
|
@@ -6764,7 +6797,8 @@ var require_utils = __commonJS({
|
|
|
6764
6797
|
function normalizePathEncoding(input) {
|
|
6765
6798
|
let output = "";
|
|
6766
6799
|
for (let i = 0; i < input.length; i++) {
|
|
6767
|
-
|
|
6800
|
+
const ch = input[i];
|
|
6801
|
+
if (ch === "%" && i + 2 < input.length) {
|
|
6768
6802
|
const hex = input.slice(i + 1, i + 3);
|
|
6769
6803
|
if (isHexPair(hex)) {
|
|
6770
6804
|
const normalizedHex = hex.toUpperCase();
|
|
@@ -6778,10 +6812,152 @@ var require_utils = __commonJS({
|
|
|
6778
6812
|
continue;
|
|
6779
6813
|
}
|
|
6780
6814
|
}
|
|
6781
|
-
if (isPathCharacter(
|
|
6782
|
-
output +=
|
|
6815
|
+
if (isPathCharacter(ch)) {
|
|
6816
|
+
output += ch;
|
|
6817
|
+
} else {
|
|
6818
|
+
const code = input.charCodeAt(i);
|
|
6819
|
+
if (code < 128) {
|
|
6820
|
+
output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
|
|
6821
|
+
} else if (code < 55296 || code > 57343) {
|
|
6822
|
+
output += percentEncodeNonAscii(code);
|
|
6823
|
+
} else if (code <= 56319 && i + 1 < input.length) {
|
|
6824
|
+
const low = input.charCodeAt(i + 1);
|
|
6825
|
+
if (low >= 56320 && low <= 57343) {
|
|
6826
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
6827
|
+
i++;
|
|
6828
|
+
} else {
|
|
6829
|
+
output += percentEncodeNonAscii(65533);
|
|
6830
|
+
}
|
|
6831
|
+
} else {
|
|
6832
|
+
output += percentEncodeNonAscii(65533);
|
|
6833
|
+
}
|
|
6834
|
+
}
|
|
6835
|
+
}
|
|
6836
|
+
return output;
|
|
6837
|
+
}
|
|
6838
|
+
function serializePathEncoding(input, pathNoScheme = false) {
|
|
6839
|
+
let output = "";
|
|
6840
|
+
let firstSegment = pathNoScheme && input[0] !== "/";
|
|
6841
|
+
for (let i = 0; i < input.length; i++) {
|
|
6842
|
+
const ch = input[i];
|
|
6843
|
+
if (ch === "%" && i + 2 < input.length) {
|
|
6844
|
+
const hex = input.slice(i + 1, i + 3);
|
|
6845
|
+
if (isHexPair(hex)) {
|
|
6846
|
+
output += "%" + hex.toUpperCase();
|
|
6847
|
+
i += 2;
|
|
6848
|
+
continue;
|
|
6849
|
+
}
|
|
6850
|
+
}
|
|
6851
|
+
if (ch === "/") {
|
|
6852
|
+
firstSegment = false;
|
|
6853
|
+
}
|
|
6854
|
+
if (isPathCharacter(ch) && (ch !== ":" || !firstSegment)) {
|
|
6855
|
+
output += ch;
|
|
6856
|
+
} else {
|
|
6857
|
+
const code = input.charCodeAt(i);
|
|
6858
|
+
if (code < 128) {
|
|
6859
|
+
output += BYTE_HEX[code];
|
|
6860
|
+
} else if (code < 55296 || code > 57343) {
|
|
6861
|
+
output += percentEncodeNonAscii(code);
|
|
6862
|
+
} else if (code <= 56319 && i + 1 < input.length) {
|
|
6863
|
+
const low = input.charCodeAt(i + 1);
|
|
6864
|
+
if (low >= 56320 && low <= 57343) {
|
|
6865
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
6866
|
+
i++;
|
|
6867
|
+
} else {
|
|
6868
|
+
output += percentEncodeNonAscii(65533);
|
|
6869
|
+
}
|
|
6870
|
+
} else {
|
|
6871
|
+
output += percentEncodeNonAscii(65533);
|
|
6872
|
+
}
|
|
6873
|
+
}
|
|
6874
|
+
}
|
|
6875
|
+
return output;
|
|
6876
|
+
}
|
|
6877
|
+
function encodeComponent(input, isAllowed) {
|
|
6878
|
+
let output = "";
|
|
6879
|
+
for (let i = 0; i < input.length; i++) {
|
|
6880
|
+
const ch = input[i];
|
|
6881
|
+
if (ch === "%" && i + 2 < input.length) {
|
|
6882
|
+
const hex = input.slice(i + 1, i + 3);
|
|
6883
|
+
if (isHexPair(hex)) {
|
|
6884
|
+
output += "%" + hex.toUpperCase();
|
|
6885
|
+
i += 2;
|
|
6886
|
+
continue;
|
|
6887
|
+
}
|
|
6888
|
+
}
|
|
6889
|
+
if (isAllowed(ch)) {
|
|
6890
|
+
output += ch;
|
|
6891
|
+
} else {
|
|
6892
|
+
const code = input.charCodeAt(i);
|
|
6893
|
+
if (code < 128) {
|
|
6894
|
+
output += BYTE_HEX[code];
|
|
6895
|
+
} else if (code < 55296 || code > 57343) {
|
|
6896
|
+
output += percentEncodeNonAscii(code);
|
|
6897
|
+
} else if (code <= 56319 && i + 1 < input.length) {
|
|
6898
|
+
const low = input.charCodeAt(i + 1);
|
|
6899
|
+
if (low >= 56320 && low <= 57343) {
|
|
6900
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
6901
|
+
i++;
|
|
6902
|
+
} else {
|
|
6903
|
+
output += percentEncodeNonAscii(65533);
|
|
6904
|
+
}
|
|
6905
|
+
} else {
|
|
6906
|
+
output += percentEncodeNonAscii(65533);
|
|
6907
|
+
}
|
|
6908
|
+
}
|
|
6909
|
+
}
|
|
6910
|
+
return output;
|
|
6911
|
+
}
|
|
6912
|
+
function encodeUserinfo(input) {
|
|
6913
|
+
return encodeComponent(input, isUserinfoCharacter);
|
|
6914
|
+
}
|
|
6915
|
+
function encodeQuery(input) {
|
|
6916
|
+
return encodeComponent(input, isQueryFragmentCharacter);
|
|
6917
|
+
}
|
|
6918
|
+
function encodeFragment(input) {
|
|
6919
|
+
return encodeComponent(input, isQueryFragmentCharacter);
|
|
6920
|
+
}
|
|
6921
|
+
function isEscapeSafe(cp2) {
|
|
6922
|
+
return cp2 >= 48 && cp2 <= 57 || cp2 >= 65 && cp2 <= 90 || cp2 >= 97 && cp2 <= 122 || cp2 === 42 || cp2 === 43 || cp2 === 45 || cp2 === 46 || cp2 === 47 || cp2 === 64 || cp2 === 95;
|
|
6923
|
+
}
|
|
6924
|
+
function normalizeQueryFragmentEncoding(input) {
|
|
6925
|
+
let output = "";
|
|
6926
|
+
for (let i = 0; i < input.length; i++) {
|
|
6927
|
+
const ch = input[i];
|
|
6928
|
+
if (ch === "%" && i + 2 < input.length) {
|
|
6929
|
+
const hex = input.slice(i + 1, i + 3);
|
|
6930
|
+
if (isHexPair(hex)) {
|
|
6931
|
+
const normalizedHex = hex.toUpperCase();
|
|
6932
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
6933
|
+
if (isUnreserved(decoded)) {
|
|
6934
|
+
output += decoded;
|
|
6935
|
+
} else {
|
|
6936
|
+
output += "%" + normalizedHex;
|
|
6937
|
+
}
|
|
6938
|
+
i += 2;
|
|
6939
|
+
continue;
|
|
6940
|
+
}
|
|
6941
|
+
}
|
|
6942
|
+
if (isQueryFragmentCharacter(ch)) {
|
|
6943
|
+
output += ch;
|
|
6783
6944
|
} else {
|
|
6784
|
-
|
|
6945
|
+
const code = input.charCodeAt(i);
|
|
6946
|
+
if (code < 128) {
|
|
6947
|
+
output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
|
|
6948
|
+
} else if (code < 55296 || code > 57343) {
|
|
6949
|
+
output += percentEncodeNonAscii(code);
|
|
6950
|
+
} else if (code <= 56319 && i + 1 < input.length) {
|
|
6951
|
+
const low = input.charCodeAt(i + 1);
|
|
6952
|
+
if (low >= 56320 && low <= 57343) {
|
|
6953
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
6954
|
+
i++;
|
|
6955
|
+
} else {
|
|
6956
|
+
output += percentEncodeNonAscii(65533);
|
|
6957
|
+
}
|
|
6958
|
+
} else {
|
|
6959
|
+
output += percentEncodeNonAscii(65533);
|
|
6960
|
+
}
|
|
6785
6961
|
}
|
|
6786
6962
|
}
|
|
6787
6963
|
return output;
|
|
@@ -6804,14 +6980,18 @@ var require_utils = __commonJS({
|
|
|
6804
6980
|
function recomposeAuthority(component) {
|
|
6805
6981
|
const uriTokens = [];
|
|
6806
6982
|
if (component.userinfo !== void 0) {
|
|
6807
|
-
uriTokens.push(component.userinfo);
|
|
6983
|
+
uriTokens.push(encodeUserinfo(component.userinfo));
|
|
6808
6984
|
uriTokens.push("@");
|
|
6809
6985
|
}
|
|
6810
6986
|
if (component.host !== void 0) {
|
|
6811
|
-
let host =
|
|
6987
|
+
let host = component.host;
|
|
6812
6988
|
if (!isIPv4(host)) {
|
|
6813
|
-
|
|
6814
|
-
if (ipV6res.isIPV6
|
|
6989
|
+
let ipV6res = normalizeIPv6(host);
|
|
6990
|
+
if (ipV6res.isIPV6 !== true && ipV6res.isIPVFuture !== true) {
|
|
6991
|
+
host = normalizePercentEncoding(host, true);
|
|
6992
|
+
ipV6res = normalizeIPv6(host);
|
|
6993
|
+
}
|
|
6994
|
+
if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) {
|
|
6815
6995
|
host = `[${ipV6res.escapedHost}]`;
|
|
6816
6996
|
} else {
|
|
6817
6997
|
host = reescapeHostDelimiters(host, false);
|
|
@@ -6820,8 +7000,12 @@ var require_utils = __commonJS({
|
|
|
6820
7000
|
uriTokens.push(host);
|
|
6821
7001
|
}
|
|
6822
7002
|
if (typeof component.port === "number" || typeof component.port === "string") {
|
|
7003
|
+
const port = String(component.port);
|
|
7004
|
+
if (!isPort(port)) {
|
|
7005
|
+
throw new TypeError("URI port is malformed.");
|
|
7006
|
+
}
|
|
6823
7007
|
uriTokens.push(":");
|
|
6824
|
-
uriTokens.push(
|
|
7008
|
+
uriTokens.push(port);
|
|
6825
7009
|
}
|
|
6826
7010
|
return uriTokens.length ? uriTokens.join("") : void 0;
|
|
6827
7011
|
}
|
|
@@ -6831,6 +7015,11 @@ var require_utils = __commonJS({
|
|
|
6831
7015
|
reescapeHostDelimiters,
|
|
6832
7016
|
normalizePercentEncoding,
|
|
6833
7017
|
normalizePathEncoding,
|
|
7018
|
+
serializePathEncoding,
|
|
7019
|
+
normalizeQueryFragmentEncoding,
|
|
7020
|
+
encodeUserinfo,
|
|
7021
|
+
encodeQuery,
|
|
7022
|
+
encodeFragment,
|
|
6834
7023
|
escapePreservingEscapes,
|
|
6835
7024
|
removeDotSegments,
|
|
6836
7025
|
isIPv4,
|
|
@@ -6846,7 +7035,7 @@ var require_schemes = __commonJS({
|
|
|
6846
7035
|
"node_modules/fast-uri/lib/schemes.js"(exports, module) {
|
|
6847
7036
|
"use strict";
|
|
6848
7037
|
var { isUUID } = require_utils();
|
|
6849
|
-
var URN_REG =
|
|
7038
|
+
var URN_REG = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;
|
|
6850
7039
|
var supportedSchemeNames = (
|
|
6851
7040
|
/** @type {const} */
|
|
6852
7041
|
[
|
|
@@ -6907,9 +7096,10 @@ var require_schemes = __commonJS({
|
|
|
6907
7096
|
wsComponent.secure = void 0;
|
|
6908
7097
|
}
|
|
6909
7098
|
if (wsComponent.resourceName) {
|
|
6910
|
-
const
|
|
7099
|
+
const queryIndex = wsComponent.resourceName.indexOf("?");
|
|
7100
|
+
const path = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
|
|
6911
7101
|
wsComponent.path = path && path !== "/" ? path : void 0;
|
|
6912
|
-
wsComponent.query =
|
|
7102
|
+
wsComponent.query = queryIndex === -1 ? void 0 : wsComponent.resourceName.slice(queryIndex + 1);
|
|
6913
7103
|
wsComponent.resourceName = void 0;
|
|
6914
7104
|
}
|
|
6915
7105
|
wsComponent.fragment = void 0;
|
|
@@ -6921,7 +7111,7 @@ var require_schemes = __commonJS({
|
|
|
6921
7111
|
return urnComponent;
|
|
6922
7112
|
}
|
|
6923
7113
|
const matches = urnComponent.path.match(URN_REG);
|
|
6924
|
-
if (matches) {
|
|
7114
|
+
if (matches && matches[0] === urnComponent.path) {
|
|
6925
7115
|
const scheme = options.scheme || urnComponent.scheme || "urn";
|
|
6926
7116
|
urnComponent.nid = matches[1].toLowerCase();
|
|
6927
7117
|
urnComponent.nss = matches[2];
|
|
@@ -7055,8 +7245,17 @@ var require_schemes = __commonJS({
|
|
|
7055
7245
|
var require_fast_uri = __commonJS({
|
|
7056
7246
|
"node_modules/fast-uri/index.js"(exports, module) {
|
|
7057
7247
|
"use strict";
|
|
7058
|
-
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding,
|
|
7248
|
+
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
7059
7249
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
7250
|
+
var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
|
|
7251
|
+
var MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
|
|
7252
|
+
function decodeValidScheme(scheme) {
|
|
7253
|
+
const decodedScheme = unescape(String(scheme));
|
|
7254
|
+
if (!VALID_SCHEME.test(decodedScheme)) {
|
|
7255
|
+
throw new TypeError(MALFORMED_SCHEME_ERROR);
|
|
7256
|
+
}
|
|
7257
|
+
return decodedScheme;
|
|
7258
|
+
}
|
|
7060
7259
|
function normalize(uri, options) {
|
|
7061
7260
|
if (typeof uri === "string") {
|
|
7062
7261
|
uri = /** @type {T} */
|
|
@@ -7069,12 +7268,34 @@ var require_fast_uri = __commonJS({
|
|
|
7069
7268
|
}
|
|
7070
7269
|
function resolve9(baseURI, relativeURI, options) {
|
|
7071
7270
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
7072
|
-
const {
|
|
7073
|
-
|
|
7074
|
-
|
|
7271
|
+
const {
|
|
7272
|
+
parsed: baseParsed,
|
|
7273
|
+
malformedAuthorityOrPort: baseMalformed,
|
|
7274
|
+
malformedPercentEncoding: baseMalformedPercentEncoding,
|
|
7275
|
+
malformedSchemeSpecific: baseMalformedSchemeSpecific,
|
|
7276
|
+
malformedHost: baseMalformedHost,
|
|
7277
|
+
malformedScheme: baseMalformedScheme
|
|
7278
|
+
} = parseWithStatus(baseURI, schemelessOptions);
|
|
7279
|
+
const {
|
|
7280
|
+
parsed: relativeParsed,
|
|
7281
|
+
malformedAuthorityOrPort: relativeMalformed,
|
|
7282
|
+
malformedPercentEncoding: relativeMalformedPercentEncoding,
|
|
7283
|
+
malformedSchemeSpecific: relativeMalformedSchemeSpecific,
|
|
7284
|
+
malformedHost: relativeMalformedHost,
|
|
7285
|
+
malformedScheme: relativeMalformedScheme
|
|
7286
|
+
} = parseWithStatus(relativeURI, schemelessOptions);
|
|
7287
|
+
if (baseMalformed || relativeMalformed || baseMalformedPercentEncoding || relativeMalformedPercentEncoding || baseMalformedSchemeSpecific || relativeMalformedSchemeSpecific || baseMalformedHost || relativeMalformedHost || baseMalformedScheme || relativeMalformedScheme) {
|
|
7075
7288
|
throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed.");
|
|
7076
7289
|
}
|
|
7077
7290
|
const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true);
|
|
7291
|
+
const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme);
|
|
7292
|
+
const resolvedHost = resolved.host;
|
|
7293
|
+
const resolvedHostIsIP = resolvedHost !== void 0 && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6);
|
|
7294
|
+
canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP);
|
|
7295
|
+
const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !new RegExp("\\P{ASCII}", "u").test(resolvedHost);
|
|
7296
|
+
if (resolved.error && !encodedASCIIHost) {
|
|
7297
|
+
throw new Error(resolved.error);
|
|
7298
|
+
}
|
|
7078
7299
|
schemelessOptions.skipEscape = true;
|
|
7079
7300
|
return serialize(resolved, schemelessOptions);
|
|
7080
7301
|
}
|
|
@@ -7134,7 +7355,7 @@ var require_fast_uri = __commonJS({
|
|
|
7134
7355
|
function equal(uriA, uriB, options) {
|
|
7135
7356
|
const normalizedA = normalizeComparableURI(uriA, options);
|
|
7136
7357
|
const normalizedB = normalizeComparableURI(uriB, options);
|
|
7137
|
-
return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA
|
|
7358
|
+
return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA === normalizedB;
|
|
7138
7359
|
}
|
|
7139
7360
|
function serialize(cmpts, opts) {
|
|
7140
7361
|
const component = {
|
|
@@ -7155,19 +7376,22 @@ var require_fast_uri = __commonJS({
|
|
|
7155
7376
|
};
|
|
7156
7377
|
const options = Object.assign({}, opts);
|
|
7157
7378
|
const uriTokens = [];
|
|
7379
|
+
if (component.scheme) {
|
|
7380
|
+
component.scheme = decodeValidScheme(component.scheme);
|
|
7381
|
+
}
|
|
7158
7382
|
const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
|
|
7159
7383
|
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
|
|
7384
|
+
const hasAuthority = component.userinfo !== void 0 || component.host !== void 0 || component.port !== void 0;
|
|
7385
|
+
const pathNoScheme = !options.skipEscape && component.scheme === void 0 && !hasAuthority;
|
|
7160
7386
|
if (component.path !== void 0) {
|
|
7161
7387
|
if (!options.skipEscape) {
|
|
7162
|
-
component.path =
|
|
7163
|
-
if (component.scheme !== void 0) {
|
|
7164
|
-
component.path = component.path.split("%3A").join(":");
|
|
7165
|
-
}
|
|
7388
|
+
component.path = serializePathEncoding(component.path, pathNoScheme);
|
|
7166
7389
|
} else {
|
|
7167
7390
|
component.path = normalizePercentEncoding(component.path);
|
|
7168
7391
|
}
|
|
7169
7392
|
}
|
|
7170
7393
|
if (options.reference !== "suffix" && component.scheme) {
|
|
7394
|
+
component.scheme = decodeValidScheme(component.scheme);
|
|
7171
7395
|
uriTokens.push(component.scheme, ":");
|
|
7172
7396
|
}
|
|
7173
7397
|
const authority = recomposeAuthority(component);
|
|
@@ -7185,16 +7409,19 @@ var require_fast_uri = __commonJS({
|
|
|
7185
7409
|
if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
7186
7410
|
s = removeDotSegments(s);
|
|
7187
7411
|
}
|
|
7412
|
+
if (pathNoScheme) {
|
|
7413
|
+
s = serializePathEncoding(s, true);
|
|
7414
|
+
}
|
|
7188
7415
|
if (authority === void 0 && s[0] === "/" && s[1] === "/") {
|
|
7189
7416
|
s = "/%2F" + s.slice(2);
|
|
7190
7417
|
}
|
|
7191
7418
|
uriTokens.push(s);
|
|
7192
7419
|
}
|
|
7193
7420
|
if (component.query !== void 0) {
|
|
7194
|
-
uriTokens.push("?", component.query);
|
|
7421
|
+
uriTokens.push("?", encodeQuery(component.query));
|
|
7195
7422
|
}
|
|
7196
7423
|
if (component.fragment !== void 0) {
|
|
7197
|
-
uriTokens.push("#", component.fragment);
|
|
7424
|
+
uriTokens.push("#", encodeFragment(component.fragment));
|
|
7198
7425
|
}
|
|
7199
7426
|
return uriTokens.join("");
|
|
7200
7427
|
}
|
|
@@ -7210,6 +7437,35 @@ var require_fast_uri = __commonJS({
|
|
|
7210
7437
|
}
|
|
7211
7438
|
return void 0;
|
|
7212
7439
|
}
|
|
7440
|
+
function hasMalformedPercentEncoding(component) {
|
|
7441
|
+
if (component === void 0) return false;
|
|
7442
|
+
let percent = component.indexOf("%");
|
|
7443
|
+
while (percent !== -1) {
|
|
7444
|
+
if (percent + 2 >= component.length || !/^[\da-f]{2}$/iu.test(component.slice(percent + 1, percent + 3))) {
|
|
7445
|
+
return true;
|
|
7446
|
+
}
|
|
7447
|
+
percent = component.indexOf("%", percent + 3);
|
|
7448
|
+
}
|
|
7449
|
+
return false;
|
|
7450
|
+
}
|
|
7451
|
+
function isIPLiteral(host) {
|
|
7452
|
+
return host[0] === "[" && host[host.length - 1] === "]";
|
|
7453
|
+
}
|
|
7454
|
+
function hasMalformedComponentPercentEncoding(matches) {
|
|
7455
|
+
const host = matches[4];
|
|
7456
|
+
return hasMalformedPercentEncoding(matches[3]) || host !== void 0 && !isIPLiteral(host) && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
|
|
7457
|
+
}
|
|
7458
|
+
function canonicalizeHost(parsed, options, schemeHandler, isIP) {
|
|
7459
|
+
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
7460
|
+
try {
|
|
7461
|
+
parsed.host = new URL("http://" + parsed.host).hostname;
|
|
7462
|
+
} catch (e) {
|
|
7463
|
+
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
7464
|
+
return true;
|
|
7465
|
+
}
|
|
7466
|
+
}
|
|
7467
|
+
return false;
|
|
7468
|
+
}
|
|
7213
7469
|
function parseWithStatus(uri, opts) {
|
|
7214
7470
|
const options = Object.assign({}, opts);
|
|
7215
7471
|
const parsed = {
|
|
@@ -7222,6 +7478,11 @@ var require_fast_uri = __commonJS({
|
|
|
7222
7478
|
fragment: void 0
|
|
7223
7479
|
};
|
|
7224
7480
|
let malformedAuthorityOrPort = false;
|
|
7481
|
+
let malformedPercentEncoding = false;
|
|
7482
|
+
let malformedSchemeSpecific = false;
|
|
7483
|
+
let malformedHost = false;
|
|
7484
|
+
let malformedIPLiteral = false;
|
|
7485
|
+
let malformedScheme = false;
|
|
7225
7486
|
let isIP = false;
|
|
7226
7487
|
if (options.reference === "suffix") {
|
|
7227
7488
|
if (options.scheme) {
|
|
@@ -7258,6 +7519,19 @@ var require_fast_uri = __commonJS({
|
|
|
7258
7519
|
parsed.path = matches[6] || "";
|
|
7259
7520
|
parsed.query = matches[7];
|
|
7260
7521
|
parsed.fragment = matches[8];
|
|
7522
|
+
if (parsed.scheme !== void 0) {
|
|
7523
|
+
const decodedScheme = unescape(parsed.scheme);
|
|
7524
|
+
if (VALID_SCHEME.test(decodedScheme)) {
|
|
7525
|
+
parsed.scheme = decodedScheme.toLowerCase();
|
|
7526
|
+
} else {
|
|
7527
|
+
parsed.error = parsed.error || MALFORMED_SCHEME_ERROR;
|
|
7528
|
+
malformedScheme = true;
|
|
7529
|
+
}
|
|
7530
|
+
}
|
|
7531
|
+
malformedPercentEncoding = hasMalformedComponentPercentEncoding(matches);
|
|
7532
|
+
if (malformedPercentEncoding) {
|
|
7533
|
+
parsed.error = parsed.error || "URI contains malformed percent-encoding.";
|
|
7534
|
+
}
|
|
7261
7535
|
if (isNaN(parsed.port)) {
|
|
7262
7536
|
parsed.port = matches[5];
|
|
7263
7537
|
}
|
|
@@ -7269,9 +7543,16 @@ var require_fast_uri = __commonJS({
|
|
|
7269
7543
|
if (parsed.host) {
|
|
7270
7544
|
const ipv4result = isIPv4(parsed.host);
|
|
7271
7545
|
if (ipv4result === false) {
|
|
7546
|
+
const bracketedIPLiteral = isIPLiteral(parsed.host);
|
|
7547
|
+
const hasIPLiteralBracket = parsed.host.indexOf("[") !== -1 || parsed.host.indexOf("]") !== -1;
|
|
7272
7548
|
const ipv6result = normalizeIPv6(parsed.host);
|
|
7273
|
-
|
|
7274
|
-
|
|
7549
|
+
isIP = ipv6result.isIPV6 || ipv6result.isIPVFuture === true;
|
|
7550
|
+
malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true);
|
|
7551
|
+
parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
|
|
7552
|
+
if (malformedIPLiteral) {
|
|
7553
|
+
parsed.error = parsed.error || "URI host is malformed.";
|
|
7554
|
+
malformedAuthorityOrPort = true;
|
|
7555
|
+
}
|
|
7275
7556
|
} else {
|
|
7276
7557
|
isIP = true;
|
|
7277
7558
|
}
|
|
@@ -7289,42 +7570,36 @@ var require_fast_uri = __commonJS({
|
|
|
7289
7570
|
parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
|
|
7290
7571
|
}
|
|
7291
7572
|
const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
|
|
7292
|
-
if (!
|
|
7293
|
-
|
|
7294
|
-
try {
|
|
7295
|
-
parsed.host = new URL("http://" + parsed.host).hostname;
|
|
7296
|
-
} catch (e) {
|
|
7297
|
-
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
7298
|
-
}
|
|
7299
|
-
}
|
|
7573
|
+
if (!malformedIPLiteral) {
|
|
7574
|
+
malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP);
|
|
7300
7575
|
}
|
|
7301
7576
|
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
7302
7577
|
if (uri.indexOf("%") !== -1) {
|
|
7303
|
-
if (parsed.
|
|
7304
|
-
parsed.
|
|
7305
|
-
|
|
7306
|
-
if (parsed.host !== void 0) {
|
|
7307
|
-
parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP);
|
|
7578
|
+
if (parsed.host !== void 0 && !malformedIPLiteral) {
|
|
7579
|
+
const host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
|
|
7580
|
+
parsed.host = reescapeHostDelimiters(host, isIP);
|
|
7308
7581
|
}
|
|
7309
7582
|
}
|
|
7310
7583
|
if (parsed.path) {
|
|
7311
7584
|
parsed.path = normalizePathEncoding(parsed.path);
|
|
7312
7585
|
}
|
|
7586
|
+
if (parsed.query) {
|
|
7587
|
+
parsed.query = normalizeQueryFragmentEncoding(parsed.query);
|
|
7588
|
+
}
|
|
7313
7589
|
if (parsed.fragment) {
|
|
7314
|
-
|
|
7315
|
-
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
|
|
7316
|
-
} catch {
|
|
7317
|
-
parsed.error = parsed.error || "URI malformed";
|
|
7318
|
-
}
|
|
7590
|
+
parsed.fragment = normalizeQueryFragmentEncoding(parsed.fragment);
|
|
7319
7591
|
}
|
|
7320
7592
|
}
|
|
7321
7593
|
if (schemeHandler && schemeHandler.parse) {
|
|
7322
7594
|
schemeHandler.parse(parsed, options);
|
|
7595
|
+
if (schemeHandler === SCHEMES.urn && parsed.nid === void 0) {
|
|
7596
|
+
malformedSchemeSpecific = true;
|
|
7597
|
+
}
|
|
7323
7598
|
}
|
|
7324
7599
|
} else {
|
|
7325
7600
|
parsed.error = parsed.error || "URI can not be parsed.";
|
|
7326
7601
|
}
|
|
7327
|
-
return { parsed, malformedAuthorityOrPort };
|
|
7602
|
+
return { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme };
|
|
7328
7603
|
}
|
|
7329
7604
|
function parse(uri, opts) {
|
|
7330
7605
|
return parseWithStatus(uri, opts).parsed;
|
|
@@ -7333,20 +7608,28 @@ var require_fast_uri = __commonJS({
|
|
|
7333
7608
|
return normalizeStringWithStatus(uri, opts).normalized;
|
|
7334
7609
|
}
|
|
7335
7610
|
function normalizeStringWithStatus(uri, opts) {
|
|
7336
|
-
const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
|
|
7611
|
+
const { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = parseWithStatus(uri, opts);
|
|
7337
7612
|
return {
|
|
7338
|
-
normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
|
|
7339
|
-
malformedAuthorityOrPort
|
|
7613
|
+
normalized: malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri : serialize(parsed, opts),
|
|
7614
|
+
malformedAuthorityOrPort,
|
|
7615
|
+
malformedPercentEncoding,
|
|
7616
|
+
malformedSchemeSpecific,
|
|
7617
|
+
malformedHost,
|
|
7618
|
+
malformedScheme
|
|
7340
7619
|
};
|
|
7341
7620
|
}
|
|
7342
7621
|
function normalizeComparableURI(uri, opts) {
|
|
7343
|
-
if (typeof uri
|
|
7344
|
-
|
|
7345
|
-
return malformedAuthorityOrPort ? void 0 : normalized;
|
|
7622
|
+
if (typeof uri !== "string" && typeof uri !== "object") {
|
|
7623
|
+
return void 0;
|
|
7346
7624
|
}
|
|
7347
|
-
|
|
7348
|
-
|
|
7625
|
+
let value;
|
|
7626
|
+
try {
|
|
7627
|
+
value = typeof uri === "string" ? uri : serialize(uri, opts);
|
|
7628
|
+
} catch {
|
|
7629
|
+
return void 0;
|
|
7349
7630
|
}
|
|
7631
|
+
const { normalized, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = normalizeStringWithStatus(value, opts);
|
|
7632
|
+
return malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? void 0 : normalized;
|
|
7350
7633
|
}
|
|
7351
7634
|
var fastUri = {
|
|
7352
7635
|
SCHEMES,
|
|
@@ -23774,7 +24057,7 @@ function sanitizedErrorMessage(error) {
|
|
|
23774
24057
|
// src/catalogSnapshot.ts
|
|
23775
24058
|
var CATALOG_SNAPSHOT_FORMAT_V1 = "omni-dsh-catalog-snapshot-v1";
|
|
23776
24059
|
var PUBLIC_CATALOG_RAW_ORIGIN = "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-dsh-plugins";
|
|
23777
|
-
var PUBLIC_SNAPSHOT_SITE_URL = "https://dsh-plugins.
|
|
24060
|
+
var PUBLIC_SNAPSHOT_SITE_URL = "https://dsh-plugins.omniskill.online/catalog.snapshot.json";
|
|
23778
24061
|
var CATALOG_SNAPSHOT_LIMITS = Object.freeze({
|
|
23779
24062
|
snapshotBytes: 128 * 1024 * 1024,
|
|
23780
24063
|
totalFileBytes: 128 * 1024 * 1024,
|
|
@@ -29515,15 +29798,29 @@ function addMutationOptions(command) {
|
|
|
29515
29798
|
"consent to DSH/pnpm lifecycle code (native Windows disabled; use WSL)"
|
|
29516
29799
|
);
|
|
29517
29800
|
}
|
|
29801
|
+
function parseManifestVersion(raw) {
|
|
29802
|
+
const manifest = JSON.parse(raw);
|
|
29803
|
+
const version = manifest.version;
|
|
29804
|
+
if (typeof version !== "string" || !/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/u.test(version)) {
|
|
29805
|
+
throw new Error("the package manifest does not declare an exact version");
|
|
29806
|
+
}
|
|
29807
|
+
return version;
|
|
29808
|
+
}
|
|
29518
29809
|
function publishedVersion() {
|
|
29519
|
-
|
|
29520
|
-
readFileSync(new URL("../package.json", import.meta.url), "utf8")
|
|
29521
|
-
);
|
|
29522
|
-
return manifest.version;
|
|
29810
|
+
return parseManifestVersion(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
29523
29811
|
}
|
|
29524
29812
|
async function runCli(argv, dependencies = defaultDependencies3) {
|
|
29525
29813
|
let result = 0;
|
|
29526
|
-
|
|
29814
|
+
let version;
|
|
29815
|
+
try {
|
|
29816
|
+
version = publishedVersion();
|
|
29817
|
+
} catch (error) {
|
|
29818
|
+
dependencies.stderr(`${sanitizedErrorMessage(error)}
|
|
29819
|
+
`);
|
|
29820
|
+
dependencies.stderr("Command failed safely; no changes were made.\n");
|
|
29821
|
+
return 1;
|
|
29822
|
+
}
|
|
29823
|
+
const program2 = new Command().name("dsh-plugins").version(version).description("Unofficial catalog and safe installer for DeepSeek Harness plugins.").addHelpText(
|
|
29527
29824
|
"after",
|
|
29528
29825
|
"\nUnofficial community project. Not affiliated with, endorsed by, or sponsored by DeepSeek.\nNative Windows add/update/remove with code execution are disabled; use WSL.\nDry-run and read-only catalog/search/info/list/doctor commands remain available.\nNative Windows recovery markers require documented manual recovery.\n"
|
|
29529
29826
|
).configureOutput({
|