bitfab-cli 0.2.147 → 0.2.149
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/index.js +135 -48
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5029,12 +5029,15 @@ var require_data = __commonJS({
|
|
|
5029
5029
|
}
|
|
5030
5030
|
});
|
|
5031
5031
|
|
|
5032
|
-
// ../node_modules/.pnpm/fast-uri@3.1.
|
|
5032
|
+
// ../node_modules/.pnpm/fast-uri@3.1.3/node_modules/fast-uri/lib/utils.js
|
|
5033
5033
|
var require_utils = __commonJS({
|
|
5034
|
-
"../node_modules/.pnpm/fast-uri@3.1.
|
|
5034
|
+
"../node_modules/.pnpm/fast-uri@3.1.3/node_modules/fast-uri/lib/utils.js"(exports, module) {
|
|
5035
5035
|
"use strict";
|
|
5036
5036
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
5037
5037
|
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);
|
|
5038
|
+
var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
|
|
5039
|
+
var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
|
|
5040
|
+
var isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
|
|
5038
5041
|
function stringArrayToHexStripped(input) {
|
|
5039
5042
|
let acc = "";
|
|
5040
5043
|
let code = 0;
|
|
@@ -5227,27 +5230,77 @@ var require_utils = __commonJS({
|
|
|
5227
5230
|
}
|
|
5228
5231
|
return output.join("");
|
|
5229
5232
|
}
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5233
|
+
var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
|
|
5234
|
+
var HOST_DELIM_RE = /[@/?#:]/g;
|
|
5235
|
+
var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
|
|
5236
|
+
function reescapeHostDelimiters(host, isIP) {
|
|
5237
|
+
const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
|
|
5238
|
+
re.lastIndex = 0;
|
|
5239
|
+
return host.replace(re, (ch) => HOST_DELIMS[ch]);
|
|
5240
|
+
}
|
|
5241
|
+
function normalizePercentEncoding(input, decodeUnreserved = false) {
|
|
5242
|
+
if (input.indexOf("%") === -1) {
|
|
5243
|
+
return input;
|
|
5240
5244
|
}
|
|
5241
|
-
|
|
5242
|
-
|
|
5245
|
+
let output = "";
|
|
5246
|
+
for (let i = 0; i < input.length; i++) {
|
|
5247
|
+
if (input[i] === "%" && i + 2 < input.length) {
|
|
5248
|
+
const hex3 = input.slice(i + 1, i + 3);
|
|
5249
|
+
if (isHexPair(hex3)) {
|
|
5250
|
+
const normalizedHex = hex3.toUpperCase();
|
|
5251
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
5252
|
+
if (decodeUnreserved && isUnreserved(decoded)) {
|
|
5253
|
+
output += decoded;
|
|
5254
|
+
} else {
|
|
5255
|
+
output += "%" + normalizedHex;
|
|
5256
|
+
}
|
|
5257
|
+
i += 2;
|
|
5258
|
+
continue;
|
|
5259
|
+
}
|
|
5260
|
+
}
|
|
5261
|
+
output += input[i];
|
|
5243
5262
|
}
|
|
5244
|
-
|
|
5245
|
-
|
|
5263
|
+
return output;
|
|
5264
|
+
}
|
|
5265
|
+
function normalizePathEncoding(input) {
|
|
5266
|
+
let output = "";
|
|
5267
|
+
for (let i = 0; i < input.length; i++) {
|
|
5268
|
+
if (input[i] === "%" && i + 2 < input.length) {
|
|
5269
|
+
const hex3 = input.slice(i + 1, i + 3);
|
|
5270
|
+
if (isHexPair(hex3)) {
|
|
5271
|
+
const normalizedHex = hex3.toUpperCase();
|
|
5272
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
5273
|
+
if (decoded !== "." && isUnreserved(decoded)) {
|
|
5274
|
+
output += decoded;
|
|
5275
|
+
} else {
|
|
5276
|
+
output += "%" + normalizedHex;
|
|
5277
|
+
}
|
|
5278
|
+
i += 2;
|
|
5279
|
+
continue;
|
|
5280
|
+
}
|
|
5281
|
+
}
|
|
5282
|
+
if (isPathCharacter(input[i])) {
|
|
5283
|
+
output += input[i];
|
|
5284
|
+
} else {
|
|
5285
|
+
output += escape(input[i]);
|
|
5286
|
+
}
|
|
5246
5287
|
}
|
|
5247
|
-
|
|
5248
|
-
|
|
5288
|
+
return output;
|
|
5289
|
+
}
|
|
5290
|
+
function escapePreservingEscapes(input) {
|
|
5291
|
+
let output = "";
|
|
5292
|
+
for (let i = 0; i < input.length; i++) {
|
|
5293
|
+
if (input[i] === "%" && i + 2 < input.length) {
|
|
5294
|
+
const hex3 = input.slice(i + 1, i + 3);
|
|
5295
|
+
if (isHexPair(hex3)) {
|
|
5296
|
+
output += "%" + hex3.toUpperCase();
|
|
5297
|
+
i += 2;
|
|
5298
|
+
continue;
|
|
5299
|
+
}
|
|
5300
|
+
}
|
|
5301
|
+
output += escape(input[i]);
|
|
5249
5302
|
}
|
|
5250
|
-
return
|
|
5303
|
+
return output;
|
|
5251
5304
|
}
|
|
5252
5305
|
function recomposeAuthority(component) {
|
|
5253
5306
|
const uriTokens = [];
|
|
@@ -5262,7 +5315,7 @@ var require_utils = __commonJS({
|
|
|
5262
5315
|
if (ipV6res.isIPV6 === true) {
|
|
5263
5316
|
host = `[${ipV6res.escapedHost}]`;
|
|
5264
5317
|
} else {
|
|
5265
|
-
host =
|
|
5318
|
+
host = reescapeHostDelimiters(host, false);
|
|
5266
5319
|
}
|
|
5267
5320
|
}
|
|
5268
5321
|
uriTokens.push(host);
|
|
@@ -5276,7 +5329,10 @@ var require_utils = __commonJS({
|
|
|
5276
5329
|
module.exports = {
|
|
5277
5330
|
nonSimpleDomain,
|
|
5278
5331
|
recomposeAuthority,
|
|
5279
|
-
|
|
5332
|
+
reescapeHostDelimiters,
|
|
5333
|
+
normalizePercentEncoding,
|
|
5334
|
+
normalizePathEncoding,
|
|
5335
|
+
escapePreservingEscapes,
|
|
5280
5336
|
removeDotSegments,
|
|
5281
5337
|
isIPv4,
|
|
5282
5338
|
isUUID,
|
|
@@ -5286,9 +5342,9 @@ var require_utils = __commonJS({
|
|
|
5286
5342
|
}
|
|
5287
5343
|
});
|
|
5288
5344
|
|
|
5289
|
-
// ../node_modules/.pnpm/fast-uri@3.1.
|
|
5345
|
+
// ../node_modules/.pnpm/fast-uri@3.1.3/node_modules/fast-uri/lib/schemes.js
|
|
5290
5346
|
var require_schemes = __commonJS({
|
|
5291
|
-
"../node_modules/.pnpm/fast-uri@3.1.
|
|
5347
|
+
"../node_modules/.pnpm/fast-uri@3.1.3/node_modules/fast-uri/lib/schemes.js"(exports, module) {
|
|
5292
5348
|
"use strict";
|
|
5293
5349
|
var { isUUID } = require_utils();
|
|
5294
5350
|
var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
|
|
@@ -5496,16 +5552,16 @@ var require_schemes = __commonJS({
|
|
|
5496
5552
|
}
|
|
5497
5553
|
});
|
|
5498
5554
|
|
|
5499
|
-
// ../node_modules/.pnpm/fast-uri@3.1.
|
|
5555
|
+
// ../node_modules/.pnpm/fast-uri@3.1.3/node_modules/fast-uri/index.js
|
|
5500
5556
|
var require_fast_uri = __commonJS({
|
|
5501
|
-
"../node_modules/.pnpm/fast-uri@3.1.
|
|
5557
|
+
"../node_modules/.pnpm/fast-uri@3.1.3/node_modules/fast-uri/index.js"(exports, module) {
|
|
5502
5558
|
"use strict";
|
|
5503
|
-
var { normalizeIPv6, removeDotSegments, recomposeAuthority,
|
|
5559
|
+
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
5504
5560
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
5505
5561
|
function normalize(uri, options) {
|
|
5506
5562
|
if (typeof uri === "string") {
|
|
5507
5563
|
uri = /** @type {T} */
|
|
5508
|
-
|
|
5564
|
+
normalizeString(uri, options);
|
|
5509
5565
|
} else if (typeof uri === "object") {
|
|
5510
5566
|
uri = /** @type {T} */
|
|
5511
5567
|
parse3(serialize2(uri, options), options);
|
|
@@ -5572,19 +5628,9 @@ var require_fast_uri = __commonJS({
|
|
|
5572
5628
|
return target;
|
|
5573
5629
|
}
|
|
5574
5630
|
function equal(uriA, uriB, options) {
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
} else if (typeof uriA === "object") {
|
|
5579
|
-
uriA = serialize2(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
|
|
5580
|
-
}
|
|
5581
|
-
if (typeof uriB === "string") {
|
|
5582
|
-
uriB = unescape(uriB);
|
|
5583
|
-
uriB = serialize2(normalizeComponentEncoding(parse3(uriB, options), true), { ...options, skipEscape: true });
|
|
5584
|
-
} else if (typeof uriB === "object") {
|
|
5585
|
-
uriB = serialize2(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
|
|
5586
|
-
}
|
|
5587
|
-
return uriA.toLowerCase() === uriB.toLowerCase();
|
|
5631
|
+
const normalizedA = normalizeComparableURI(uriA, options);
|
|
5632
|
+
const normalizedB = normalizeComparableURI(uriB, options);
|
|
5633
|
+
return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA.toLowerCase() === normalizedB.toLowerCase();
|
|
5588
5634
|
}
|
|
5589
5635
|
function serialize2(cmpts, opts) {
|
|
5590
5636
|
const component = {
|
|
@@ -5609,12 +5655,12 @@ var require_fast_uri = __commonJS({
|
|
|
5609
5655
|
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
|
|
5610
5656
|
if (component.path !== void 0) {
|
|
5611
5657
|
if (!options.skipEscape) {
|
|
5612
|
-
component.path =
|
|
5658
|
+
component.path = escapePreservingEscapes(component.path);
|
|
5613
5659
|
if (component.scheme !== void 0) {
|
|
5614
5660
|
component.path = component.path.split("%3A").join(":");
|
|
5615
5661
|
}
|
|
5616
5662
|
} else {
|
|
5617
|
-
component.path =
|
|
5663
|
+
component.path = normalizePercentEncoding(component.path);
|
|
5618
5664
|
}
|
|
5619
5665
|
}
|
|
5620
5666
|
if (options.reference !== "suffix" && component.scheme) {
|
|
@@ -5649,7 +5695,16 @@ var require_fast_uri = __commonJS({
|
|
|
5649
5695
|
return uriTokens.join("");
|
|
5650
5696
|
}
|
|
5651
5697
|
var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
5652
|
-
function
|
|
5698
|
+
function getParseError(parsed, matches) {
|
|
5699
|
+
if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
|
|
5700
|
+
return 'URI path must start with "/" when authority is present.';
|
|
5701
|
+
}
|
|
5702
|
+
if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) {
|
|
5703
|
+
return "URI port is malformed.";
|
|
5704
|
+
}
|
|
5705
|
+
return void 0;
|
|
5706
|
+
}
|
|
5707
|
+
function parseWithStatus(uri, opts) {
|
|
5653
5708
|
const options = Object.assign({}, opts);
|
|
5654
5709
|
const parsed = {
|
|
5655
5710
|
scheme: void 0,
|
|
@@ -5660,6 +5715,7 @@ var require_fast_uri = __commonJS({
|
|
|
5660
5715
|
query: void 0,
|
|
5661
5716
|
fragment: void 0
|
|
5662
5717
|
};
|
|
5718
|
+
let malformedAuthorityOrPort = false;
|
|
5663
5719
|
let isIP = false;
|
|
5664
5720
|
if (options.reference === "suffix") {
|
|
5665
5721
|
if (options.scheme) {
|
|
@@ -5680,6 +5736,11 @@ var require_fast_uri = __commonJS({
|
|
|
5680
5736
|
if (isNaN(parsed.port)) {
|
|
5681
5737
|
parsed.port = matches[5];
|
|
5682
5738
|
}
|
|
5739
|
+
const parseError = getParseError(parsed, matches);
|
|
5740
|
+
if (parseError !== void 0) {
|
|
5741
|
+
parsed.error = parsed.error || parseError;
|
|
5742
|
+
malformedAuthorityOrPort = true;
|
|
5743
|
+
}
|
|
5683
5744
|
if (parsed.host) {
|
|
5684
5745
|
const ipv4result = isIPv4(parsed.host);
|
|
5685
5746
|
if (ipv4result === false) {
|
|
@@ -5706,7 +5767,7 @@ var require_fast_uri = __commonJS({
|
|
|
5706
5767
|
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
|
|
5707
5768
|
if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
5708
5769
|
try {
|
|
5709
|
-
parsed.host = URL
|
|
5770
|
+
parsed.host = new URL("http://" + parsed.host).hostname;
|
|
5710
5771
|
} catch (e) {
|
|
5711
5772
|
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
5712
5773
|
}
|
|
@@ -5718,14 +5779,18 @@ var require_fast_uri = __commonJS({
|
|
|
5718
5779
|
parsed.scheme = unescape(parsed.scheme);
|
|
5719
5780
|
}
|
|
5720
5781
|
if (parsed.host !== void 0) {
|
|
5721
|
-
parsed.host = unescape(parsed.host);
|
|
5782
|
+
parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP);
|
|
5722
5783
|
}
|
|
5723
5784
|
}
|
|
5724
5785
|
if (parsed.path) {
|
|
5725
|
-
parsed.path =
|
|
5786
|
+
parsed.path = normalizePathEncoding(parsed.path);
|
|
5726
5787
|
}
|
|
5727
5788
|
if (parsed.fragment) {
|
|
5728
|
-
|
|
5789
|
+
try {
|
|
5790
|
+
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
|
|
5791
|
+
} catch {
|
|
5792
|
+
parsed.error = parsed.error || "URI malformed";
|
|
5793
|
+
}
|
|
5729
5794
|
}
|
|
5730
5795
|
}
|
|
5731
5796
|
if (schemeHandler && schemeHandler.parse) {
|
|
@@ -5734,7 +5799,29 @@ var require_fast_uri = __commonJS({
|
|
|
5734
5799
|
} else {
|
|
5735
5800
|
parsed.error = parsed.error || "URI can not be parsed.";
|
|
5736
5801
|
}
|
|
5737
|
-
return parsed;
|
|
5802
|
+
return { parsed, malformedAuthorityOrPort };
|
|
5803
|
+
}
|
|
5804
|
+
function parse3(uri, opts) {
|
|
5805
|
+
return parseWithStatus(uri, opts).parsed;
|
|
5806
|
+
}
|
|
5807
|
+
function normalizeString(uri, opts) {
|
|
5808
|
+
return normalizeStringWithStatus(uri, opts).normalized;
|
|
5809
|
+
}
|
|
5810
|
+
function normalizeStringWithStatus(uri, opts) {
|
|
5811
|
+
const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
|
|
5812
|
+
return {
|
|
5813
|
+
normalized: malformedAuthorityOrPort ? uri : serialize2(parsed, opts),
|
|
5814
|
+
malformedAuthorityOrPort
|
|
5815
|
+
};
|
|
5816
|
+
}
|
|
5817
|
+
function normalizeComparableURI(uri, opts) {
|
|
5818
|
+
if (typeof uri === "string") {
|
|
5819
|
+
const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts);
|
|
5820
|
+
return malformedAuthorityOrPort ? void 0 : normalized;
|
|
5821
|
+
}
|
|
5822
|
+
if (typeof uri === "object") {
|
|
5823
|
+
return serialize2(uri, opts);
|
|
5824
|
+
}
|
|
5738
5825
|
}
|
|
5739
5826
|
var fastUri = {
|
|
5740
5827
|
SCHEMES,
|