bililive-cli 1.6.2 → 1.8.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/README.md +7 -3
- package/lib/{chunked-exec-De50pd_R.cjs → chunked-exec-BWQ1zFn6.cjs} +5 -7
- package/lib/fonts-BextoGQN.cjs +33 -0
- package/lib/{index-CSU11uxG.cjs → index-CEo5tP7w.cjs} +23518 -26931
- package/lib/{index-BZRzMMRb.cjs → index-Dkt7D2TB.cjs} +4 -4
- package/lib/{index-BvslFWVg.cjs → index-nT_yCbCf.cjs} +41894 -14660
- package/lib/index.cjs +547 -265
- package/lib/{linux-CzPApWjU.cjs → linux-CbFmQBj-.cjs} +57 -281
- package/lib/{macos-DJE3Xyb_.cjs → macos-Bb6zXuPv.cjs} +2 -2
- package/lib/{windows-CuDjLP0Y.cjs → windows-B6jKfaWo.cjs} +2 -2
- package/package.json +12 -10
|
@@ -3,26 +3,28 @@
|
|
|
3
3
|
var os$3 = require('node:os');
|
|
4
4
|
var path$5 = require('node:path');
|
|
5
5
|
var fs$3 = require('node:fs');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var require$$1 = require('
|
|
9
|
-
var require$$0
|
|
10
|
-
var require$$
|
|
11
|
-
var require$$1
|
|
6
|
+
var crypto = require('node:crypto');
|
|
7
|
+
var index = require('./index-CEo5tP7w.cjs');
|
|
8
|
+
var require$$0$1 = require('fs');
|
|
9
|
+
var require$$0 = require('path');
|
|
10
|
+
var require$$0$2 = require('child_process');
|
|
11
|
+
var require$$1 = require('os');
|
|
12
|
+
var require$$1$1 = require('util');
|
|
12
13
|
var require$$5 = require('assert');
|
|
13
|
-
var require$$0$
|
|
14
|
-
var require$$0$
|
|
15
|
-
var
|
|
14
|
+
var require$$0$3 = require('events');
|
|
15
|
+
var require$$0$5 = require('buffer');
|
|
16
|
+
var require$$0$4 = require('stream');
|
|
16
17
|
var process$2 = require('node:process');
|
|
17
18
|
require('constants');
|
|
18
19
|
require('url');
|
|
20
|
+
require('node:child_process');
|
|
21
|
+
require('node:fs/promises');
|
|
22
|
+
require('node:util');
|
|
19
23
|
require('node:events');
|
|
20
24
|
require('ntsuspend');
|
|
21
|
-
require('node:child_process');
|
|
22
25
|
require('node:readline');
|
|
23
26
|
require('http');
|
|
24
27
|
require('https');
|
|
25
|
-
require('node:crypto');
|
|
26
28
|
require('zlib');
|
|
27
29
|
require('net');
|
|
28
30
|
require('dns');
|
|
@@ -31,76 +33,15 @@ require('tls');
|
|
|
31
33
|
require('punycode');
|
|
32
34
|
require('tty');
|
|
33
35
|
require('node:url');
|
|
36
|
+
require('@napi-rs/canvas');
|
|
37
|
+
require('node:stream');
|
|
38
|
+
require('node:stream/promises');
|
|
34
39
|
require('vm');
|
|
35
40
|
require('node:net');
|
|
36
41
|
require('node:https');
|
|
37
42
|
require('node:buffer');
|
|
38
43
|
require('node:zlib');
|
|
39
44
|
|
|
40
|
-
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
41
|
-
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
42
|
-
// generators (like Math.random()).
|
|
43
|
-
var getRandomValues;
|
|
44
|
-
var rnds8 = new Uint8Array(16);
|
|
45
|
-
function rng() {
|
|
46
|
-
// lazy load so that environments that need to polyfill have a chance to do so
|
|
47
|
-
if (!getRandomValues) {
|
|
48
|
-
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
|
|
49
|
-
// find the complete implementation of crypto (msCrypto) on IE11.
|
|
50
|
-
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
|
|
51
|
-
|
|
52
|
-
if (!getRandomValues) {
|
|
53
|
-
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return getRandomValues(rnds8);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
61
|
-
|
|
62
|
-
function validate(uuid) {
|
|
63
|
-
return typeof uuid === 'string' && REGEX.test(uuid);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Convert array of 16 byte values to UUID string format of the form:
|
|
68
|
-
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
|
-
var byteToHex = [];
|
|
72
|
-
|
|
73
|
-
for (var i = 0; i < 256; ++i) {
|
|
74
|
-
byteToHex.push((i + 0x100).toString(16).substr(1));
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function stringify(arr) {
|
|
78
|
-
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
79
|
-
// Note: Be careful editing this code! It's been tuned for performance
|
|
80
|
-
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
81
|
-
var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
|
|
82
|
-
// of the following:
|
|
83
|
-
// - One or more input array values don't map to a hex octet (leading to
|
|
84
|
-
// "undefined" in the uuid)
|
|
85
|
-
// - Invalid input values for the RFC `version` or `variant` fields
|
|
86
|
-
|
|
87
|
-
if (!validate(uuid)) {
|
|
88
|
-
throw TypeError('Stringified UUID is invalid');
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return uuid;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function v4(options, buf, offset) {
|
|
95
|
-
options = options || {};
|
|
96
|
-
var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
97
|
-
|
|
98
|
-
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
99
|
-
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
100
|
-
|
|
101
|
-
return stringify(rnds);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
45
|
var xdgTrashdir$1 = {exports: {}};
|
|
105
46
|
|
|
106
47
|
var df$5 = {exports: {}};
|
|
@@ -113,7 +54,7 @@ const isWindows = process.platform === 'win32' ||
|
|
|
113
54
|
process.env.OSTYPE === 'cygwin' ||
|
|
114
55
|
process.env.OSTYPE === 'msys';
|
|
115
56
|
|
|
116
|
-
const path$4 = require$$
|
|
57
|
+
const path$4 = require$$0;
|
|
117
58
|
const COLON = isWindows ? ';' : ':';
|
|
118
59
|
const isexe = index.isexe_1;
|
|
119
60
|
|
|
@@ -254,7 +195,7 @@ pathKey$1.exports.default = pathKey;
|
|
|
254
195
|
|
|
255
196
|
var pathKeyExports = pathKey$1.exports;
|
|
256
197
|
|
|
257
|
-
const path$3 = require$$
|
|
198
|
+
const path$3 = require$$0;
|
|
258
199
|
const which = which_1;
|
|
259
200
|
const getPathKey = pathKeyExports;
|
|
260
201
|
|
|
@@ -322,15 +263,17 @@ function escapeArgument(arg, doubleEscapeMetaChars) {
|
|
|
322
263
|
arg = `${arg}`;
|
|
323
264
|
|
|
324
265
|
// Algorithm below is based on https://qntm.org/cmd
|
|
266
|
+
// It's slightly altered to disable JS backtracking to avoid hanging on specially crafted input
|
|
267
|
+
// Please see https://github.com/moxystudio/node-cross-spawn/pull/160 for more information
|
|
325
268
|
|
|
326
269
|
// Sequence of backslashes followed by a double quote:
|
|
327
270
|
// double up all the backslashes and escape the double quote
|
|
328
|
-
arg = arg.replace(/(
|
|
271
|
+
arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
|
|
329
272
|
|
|
330
273
|
// Sequence of backslashes followed by the end of the string
|
|
331
274
|
// (which will become a double quote later):
|
|
332
275
|
// double up all the backslashes
|
|
333
|
-
arg = arg.replace(/(
|
|
276
|
+
arg = arg.replace(/(?=(\\+?)?)\1$/, '$1$1');
|
|
334
277
|
|
|
335
278
|
// All other backslashes occur literally
|
|
336
279
|
|
|
@@ -372,7 +315,7 @@ var shebangCommand$1 = (string = '') => {
|
|
|
372
315
|
return argument ? `${binary} ${argument}` : binary;
|
|
373
316
|
};
|
|
374
317
|
|
|
375
|
-
const fs$2 = require$$0;
|
|
318
|
+
const fs$2 = require$$0$1;
|
|
376
319
|
const shebangCommand = shebangCommand$1;
|
|
377
320
|
|
|
378
321
|
function readShebang$1(command) {
|
|
@@ -394,7 +337,7 @@ function readShebang$1(command) {
|
|
|
394
337
|
|
|
395
338
|
var readShebang_1 = readShebang$1;
|
|
396
339
|
|
|
397
|
-
const path$2 = require$$
|
|
340
|
+
const path$2 = require$$0;
|
|
398
341
|
const resolveCommand = resolveCommand_1;
|
|
399
342
|
const escape = _escape;
|
|
400
343
|
const readShebang = readShebang_1;
|
|
@@ -542,7 +485,7 @@ var enoent$1 = {
|
|
|
542
485
|
notFoundError,
|
|
543
486
|
};
|
|
544
487
|
|
|
545
|
-
const cp = require$$0$
|
|
488
|
+
const cp = require$$0$2;
|
|
546
489
|
const parse = parse_1;
|
|
547
490
|
const enoent = enoent$1;
|
|
548
491
|
|
|
@@ -602,7 +545,7 @@ var npmRunPath$1 = {exports: {}};
|
|
|
602
545
|
npmRunPath$1.exports;
|
|
603
546
|
|
|
604
547
|
(function (module) {
|
|
605
|
-
const path = require$$
|
|
548
|
+
const path = require$$0;
|
|
606
549
|
const pathKey = pathKeyExports;
|
|
607
550
|
|
|
608
551
|
const npmRunPath = options => {
|
|
@@ -714,8 +657,8 @@ onetime$2.exports.callCount = function_ => {
|
|
|
714
657
|
|
|
715
658
|
var onetimeExports = onetime$2.exports;
|
|
716
659
|
|
|
717
|
-
const os$2 = require$$1
|
|
718
|
-
const util = require$$1$
|
|
660
|
+
const os$2 = require$$1;
|
|
661
|
+
const util = require$$1$1;
|
|
719
662
|
|
|
720
663
|
const getCode = (error, code) => {
|
|
721
664
|
if (error && error.code) {
|
|
@@ -954,7 +897,7 @@ if (!processOk(process$1)) {
|
|
|
954
897
|
var signals = requireSignals();
|
|
955
898
|
var isWin = /^win/i.test(process$1.platform);
|
|
956
899
|
|
|
957
|
-
var EE = require$$0$
|
|
900
|
+
var EE = require$$0$3;
|
|
958
901
|
/* istanbul ignore if */
|
|
959
902
|
if (typeof EE !== 'function') {
|
|
960
903
|
EE = EE.EventEmitter;
|
|
@@ -1146,7 +1089,7 @@ var pFinally$1 = async (
|
|
|
1146
1089
|
return value;
|
|
1147
1090
|
};
|
|
1148
1091
|
|
|
1149
|
-
const os$1 = require$$1
|
|
1092
|
+
const os$1 = require$$1;
|
|
1150
1093
|
const onExit = signalExitExports;
|
|
1151
1094
|
const pFinally = pFinally$1;
|
|
1152
1095
|
|
|
@@ -1376,7 +1319,11 @@ var endOfStream = eos$1;
|
|
|
1376
1319
|
|
|
1377
1320
|
var once = index.onceExports;
|
|
1378
1321
|
var eos = endOfStream;
|
|
1379
|
-
var fs$1
|
|
1322
|
+
var fs$1;
|
|
1323
|
+
|
|
1324
|
+
try {
|
|
1325
|
+
fs$1 = require('fs'); // we only need fs to get the ReadStream and WriteStream prototypes
|
|
1326
|
+
} catch (e) {}
|
|
1380
1327
|
|
|
1381
1328
|
var noop = function () {};
|
|
1382
1329
|
var ancient = /^v?\.0/.test(process.version);
|
|
@@ -1457,7 +1404,7 @@ var pump$1 = function () {
|
|
|
1457
1404
|
|
|
1458
1405
|
var pump_1 = pump$1;
|
|
1459
1406
|
|
|
1460
|
-
const {PassThrough: PassThroughStream} =
|
|
1407
|
+
const {PassThrough: PassThroughStream} = require$$0$4;
|
|
1461
1408
|
|
|
1462
1409
|
var bufferStream$1 = options => {
|
|
1463
1410
|
options = {...options};
|
|
@@ -1509,7 +1456,7 @@ var bufferStream$1 = options => {
|
|
|
1509
1456
|
return stream;
|
|
1510
1457
|
};
|
|
1511
1458
|
|
|
1512
|
-
const {constants: BufferConstants} = require$$0$
|
|
1459
|
+
const {constants: BufferConstants} = require$$0$5;
|
|
1513
1460
|
const pump = pump_1;
|
|
1514
1461
|
const bufferStream = bufferStream$1;
|
|
1515
1462
|
|
|
@@ -1571,7 +1518,7 @@ getStream$2.exports.MaxBufferError = MaxBufferError;
|
|
|
1571
1518
|
|
|
1572
1519
|
var getStreamExports = getStream$2.exports;
|
|
1573
1520
|
|
|
1574
|
-
const { PassThrough } =
|
|
1521
|
+
const { PassThrough } = require$$0$4;
|
|
1575
1522
|
|
|
1576
1523
|
var mergeStream$1 = function (/*streams...*/) {
|
|
1577
1524
|
var sources = [];
|
|
@@ -1805,8 +1752,8 @@ var command = {
|
|
|
1805
1752
|
parseCommand: parseCommand$1
|
|
1806
1753
|
};
|
|
1807
1754
|
|
|
1808
|
-
const path$1 = require$$
|
|
1809
|
-
const childProcess$1 = require$$0$
|
|
1755
|
+
const path$1 = require$$0;
|
|
1756
|
+
const childProcess$1 = require$$0$2;
|
|
1810
1757
|
const crossSpawn = crossSpawnExports;
|
|
1811
1758
|
const stripFinalNewline = stripFinalNewline$1;
|
|
1812
1759
|
const npmRunPath = npmRunPathExports;
|
|
@@ -2158,7 +2105,7 @@ var dfExports$1 = df$5.exports;
|
|
|
2158
2105
|
|
|
2159
2106
|
var df$3 = {exports: {}};
|
|
2160
2107
|
|
|
2161
|
-
var childProcess = require$$0$
|
|
2108
|
+
var childProcess = require$$0$2;
|
|
2162
2109
|
|
|
2163
2110
|
function run(args, cb) {
|
|
2164
2111
|
childProcess.execFile('df', args, function (err, stdout) {
|
|
@@ -2608,7 +2555,7 @@ var mountPoint$1 = function (file) {
|
|
|
2608
2555
|
});
|
|
2609
2556
|
};
|
|
2610
2557
|
|
|
2611
|
-
var os = require$$1
|
|
2558
|
+
var os = require$$1;
|
|
2612
2559
|
|
|
2613
2560
|
function homedir() {
|
|
2614
2561
|
var env = process.env;
|
|
@@ -2637,8 +2584,8 @@ var userHome$1 = osHomedir();
|
|
|
2637
2584
|
var xdgBasedir$1 = {};
|
|
2638
2585
|
|
|
2639
2586
|
(function (exports) {
|
|
2640
|
-
const os = require$$1
|
|
2641
|
-
const path = require$$
|
|
2587
|
+
const os = require$$1;
|
|
2588
|
+
const path = require$$0;
|
|
2642
2589
|
|
|
2643
2590
|
const homeDirectory = os.homedir();
|
|
2644
2591
|
const {env} = process;
|
|
@@ -2666,8 +2613,8 @@ var xdgBasedir$1 = {};
|
|
|
2666
2613
|
}
|
|
2667
2614
|
} (xdgBasedir$1));
|
|
2668
2615
|
|
|
2669
|
-
const fs = require$$0.promises;
|
|
2670
|
-
const path = require$$
|
|
2616
|
+
const fs = require$$0$1.promises;
|
|
2617
|
+
const path = require$$0;
|
|
2671
2618
|
const df = dfExports$1;
|
|
2672
2619
|
const mountPoint = mountPoint$1;
|
|
2673
2620
|
const userHome = userHome$1;
|
|
@@ -2733,177 +2680,6 @@ xdgTrashdir$1.exports.all = async () => {
|
|
|
2733
2680
|
var xdgTrashdirExports = xdgTrashdir$1.exports;
|
|
2734
2681
|
var xdgTrashdir = /*@__PURE__*/index.getDefaultExportFromCjs(xdgTrashdirExports);
|
|
2735
2682
|
|
|
2736
|
-
function indentString(string, count = 1, options = {}) {
|
|
2737
|
-
const {
|
|
2738
|
-
indent = ' ',
|
|
2739
|
-
includeEmptyLines = false
|
|
2740
|
-
} = options;
|
|
2741
|
-
|
|
2742
|
-
if (typeof string !== 'string') {
|
|
2743
|
-
throw new TypeError(
|
|
2744
|
-
`Expected \`input\` to be a \`string\`, got \`${typeof string}\``
|
|
2745
|
-
);
|
|
2746
|
-
}
|
|
2747
|
-
|
|
2748
|
-
if (typeof count !== 'number') {
|
|
2749
|
-
throw new TypeError(
|
|
2750
|
-
`Expected \`count\` to be a \`number\`, got \`${typeof count}\``
|
|
2751
|
-
);
|
|
2752
|
-
}
|
|
2753
|
-
|
|
2754
|
-
if (count < 0) {
|
|
2755
|
-
throw new RangeError(
|
|
2756
|
-
`Expected \`count\` to be at least 0, got \`${count}\``
|
|
2757
|
-
);
|
|
2758
|
-
}
|
|
2759
|
-
|
|
2760
|
-
if (typeof indent !== 'string') {
|
|
2761
|
-
throw new TypeError(
|
|
2762
|
-
`Expected \`options.indent\` to be a \`string\`, got \`${typeof indent}\``
|
|
2763
|
-
);
|
|
2764
|
-
}
|
|
2765
|
-
|
|
2766
|
-
if (count === 0) {
|
|
2767
|
-
return string;
|
|
2768
|
-
}
|
|
2769
|
-
|
|
2770
|
-
const regex = includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
|
|
2771
|
-
|
|
2772
|
-
return string.replace(regex, indent.repeat(count));
|
|
2773
|
-
}
|
|
2774
|
-
|
|
2775
|
-
function escapeStringRegexp(string) {
|
|
2776
|
-
if (typeof string !== 'string') {
|
|
2777
|
-
throw new TypeError('Expected a string');
|
|
2778
|
-
}
|
|
2779
|
-
|
|
2780
|
-
// Escape characters with special meaning either inside or outside character sets.
|
|
2781
|
-
// Use a simple backslash escape when it’s always valid, and a `\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.
|
|
2782
|
-
return string
|
|
2783
|
-
.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')
|
|
2784
|
-
.replace(/-/g, '\\x2d');
|
|
2785
|
-
}
|
|
2786
|
-
|
|
2787
|
-
const extractPathRegex = /\s+at.*[(\s](.*)\)?/;
|
|
2788
|
-
const pathRegex = /^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/;
|
|
2789
|
-
const homeDir = typeof require$$1$1.homedir === 'undefined' ? '' : require$$1$1.homedir().replace(/\\/g, '/');
|
|
2790
|
-
|
|
2791
|
-
function cleanStack(stack, {pretty = false, basePath} = {}) {
|
|
2792
|
-
const basePathRegex = basePath && new RegExp(`(at | \\()${escapeStringRegexp(basePath.replace(/\\/g, '/'))}`, 'g');
|
|
2793
|
-
|
|
2794
|
-
if (typeof stack !== 'string') {
|
|
2795
|
-
return undefined;
|
|
2796
|
-
}
|
|
2797
|
-
|
|
2798
|
-
return stack.replace(/\\/g, '/')
|
|
2799
|
-
.split('\n')
|
|
2800
|
-
.filter(line => {
|
|
2801
|
-
const pathMatches = line.match(extractPathRegex);
|
|
2802
|
-
if (pathMatches === null || !pathMatches[1]) {
|
|
2803
|
-
return true;
|
|
2804
|
-
}
|
|
2805
|
-
|
|
2806
|
-
const match = pathMatches[1];
|
|
2807
|
-
|
|
2808
|
-
// Electron
|
|
2809
|
-
if (
|
|
2810
|
-
match.includes('.app/Contents/Resources/electron.asar') ||
|
|
2811
|
-
match.includes('.app/Contents/Resources/default_app.asar') ||
|
|
2812
|
-
match.includes('node_modules/electron/dist/resources/electron.asar') ||
|
|
2813
|
-
match.includes('node_modules/electron/dist/resources/default_app.asar')
|
|
2814
|
-
) {
|
|
2815
|
-
return false;
|
|
2816
|
-
}
|
|
2817
|
-
|
|
2818
|
-
return !pathRegex.test(match);
|
|
2819
|
-
})
|
|
2820
|
-
.filter(line => line.trim() !== '')
|
|
2821
|
-
.map(line => {
|
|
2822
|
-
if (basePathRegex) {
|
|
2823
|
-
line = line.replace(basePathRegex, '$1');
|
|
2824
|
-
}
|
|
2825
|
-
|
|
2826
|
-
if (pretty) {
|
|
2827
|
-
line = line.replace(extractPathRegex, (m, p1) => m.replace(p1, p1.replace(homeDir, '~')));
|
|
2828
|
-
}
|
|
2829
|
-
|
|
2830
|
-
return line;
|
|
2831
|
-
})
|
|
2832
|
-
.join('\n');
|
|
2833
|
-
}
|
|
2834
|
-
|
|
2835
|
-
const cleanInternalStack = stack => stack.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g, '');
|
|
2836
|
-
|
|
2837
|
-
class AggregateError extends Error {
|
|
2838
|
-
#errors;
|
|
2839
|
-
|
|
2840
|
-
name = 'AggregateError';
|
|
2841
|
-
|
|
2842
|
-
constructor(errors) {
|
|
2843
|
-
if (!Array.isArray(errors)) {
|
|
2844
|
-
throw new TypeError(`Expected input to be an Array, got ${typeof errors}`);
|
|
2845
|
-
}
|
|
2846
|
-
|
|
2847
|
-
errors = errors.map(error => {
|
|
2848
|
-
if (error instanceof Error) {
|
|
2849
|
-
return error;
|
|
2850
|
-
}
|
|
2851
|
-
|
|
2852
|
-
if (error !== null && typeof error === 'object') {
|
|
2853
|
-
// Handle plain error objects with message property and/or possibly other metadata
|
|
2854
|
-
return Object.assign(new Error(error.message), error);
|
|
2855
|
-
}
|
|
2856
|
-
|
|
2857
|
-
return new Error(error);
|
|
2858
|
-
});
|
|
2859
|
-
|
|
2860
|
-
let message = errors
|
|
2861
|
-
.map(error => {
|
|
2862
|
-
// The `stack` property is not standardized, so we can't assume it exists
|
|
2863
|
-
return typeof error.stack === 'string' && error.stack.length > 0 ? cleanInternalStack(cleanStack(error.stack)) : String(error);
|
|
2864
|
-
})
|
|
2865
|
-
.join('\n');
|
|
2866
|
-
message = '\n' + indentString(message, 4);
|
|
2867
|
-
super(message);
|
|
2868
|
-
|
|
2869
|
-
this.#errors = errors;
|
|
2870
|
-
}
|
|
2871
|
-
|
|
2872
|
-
get errors() {
|
|
2873
|
-
return this.#errors.slice();
|
|
2874
|
-
}
|
|
2875
|
-
}
|
|
2876
|
-
|
|
2877
|
-
/**
|
|
2878
|
-
An error to be thrown when the request is aborted by AbortController.
|
|
2879
|
-
DOMException is thrown instead of this Error when DOMException is available.
|
|
2880
|
-
*/
|
|
2881
|
-
class AbortError extends Error {
|
|
2882
|
-
constructor(message) {
|
|
2883
|
-
super();
|
|
2884
|
-
this.name = 'AbortError';
|
|
2885
|
-
this.message = message;
|
|
2886
|
-
}
|
|
2887
|
-
}
|
|
2888
|
-
|
|
2889
|
-
/**
|
|
2890
|
-
TODO: Remove AbortError and just throw DOMException when targeting Node 18.
|
|
2891
|
-
*/
|
|
2892
|
-
const getDOMException = errorMessage => globalThis.DOMException === undefined
|
|
2893
|
-
? new AbortError(errorMessage)
|
|
2894
|
-
: new DOMException(errorMessage);
|
|
2895
|
-
|
|
2896
|
-
/**
|
|
2897
|
-
TODO: Remove below function and just 'reject(signal.reason)' when targeting Node 18.
|
|
2898
|
-
*/
|
|
2899
|
-
const getAbortedReason = signal => {
|
|
2900
|
-
const reason = signal.reason === undefined
|
|
2901
|
-
? getDOMException('This operation was aborted.')
|
|
2902
|
-
: signal.reason;
|
|
2903
|
-
|
|
2904
|
-
return reason instanceof Error ? reason : getDOMException(reason);
|
|
2905
|
-
};
|
|
2906
|
-
|
|
2907
2683
|
async function pMap(
|
|
2908
2684
|
iterable,
|
|
2909
2685
|
mapper,
|
|
@@ -2922,7 +2698,7 @@ async function pMap(
|
|
|
2922
2698
|
throw new TypeError('Mapper function is required');
|
|
2923
2699
|
}
|
|
2924
2700
|
|
|
2925
|
-
if (!((Number.isSafeInteger(concurrency)
|
|
2701
|
+
if (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {
|
|
2926
2702
|
throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
|
|
2927
2703
|
}
|
|
2928
2704
|
|
|
@@ -2944,11 +2720,11 @@ async function pMap(
|
|
|
2944
2720
|
|
|
2945
2721
|
if (signal) {
|
|
2946
2722
|
if (signal.aborted) {
|
|
2947
|
-
reject(
|
|
2723
|
+
reject(signal.reason);
|
|
2948
2724
|
}
|
|
2949
2725
|
|
|
2950
2726
|
signal.addEventListener('abort', () => {
|
|
2951
|
-
reject(
|
|
2727
|
+
reject(signal.reason);
|
|
2952
2728
|
});
|
|
2953
2729
|
}
|
|
2954
2730
|
|
|
@@ -2973,7 +2749,7 @@ async function pMap(
|
|
|
2973
2749
|
|
|
2974
2750
|
if (resolvingCount === 0 && !isResolved) {
|
|
2975
2751
|
if (!stopOnError && errors.length > 0) {
|
|
2976
|
-
reject(new AggregateError(errors));
|
|
2752
|
+
reject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message
|
|
2977
2753
|
return;
|
|
2978
2754
|
}
|
|
2979
2755
|
|
|
@@ -3247,7 +3023,7 @@ const {
|
|
|
3247
3023
|
closeSync,
|
|
3248
3024
|
readFileSync,
|
|
3249
3025
|
existsSync,
|
|
3250
|
-
} = require$$0;
|
|
3026
|
+
} = require$$0$1;
|
|
3251
3027
|
|
|
3252
3028
|
const tmpBufMinLen = 4096 * 2;
|
|
3253
3029
|
const tmpBufMaxLen = 4096 * 8;
|
|
@@ -3522,11 +3298,11 @@ const getDeletionDate = date => date.getFullYear()
|
|
|
3522
3298
|
+ ':' + pad(date.getSeconds());
|
|
3523
3299
|
|
|
3524
3300
|
const trash = async (filePath, trashPaths) => {
|
|
3525
|
-
const name =
|
|
3301
|
+
const name = crypto.randomUUID();
|
|
3526
3302
|
const destination = path$5.join(trashPaths.filesPath, name);
|
|
3527
3303
|
const trashInfoPath = path$5.join(trashPaths.infoPath, `${name}.trashinfo`);
|
|
3528
3304
|
|
|
3529
|
-
const trashInfoData = `[Trash Info]\nPath=${filePath.
|
|
3305
|
+
const trashInfoData = `[Trash Info]\nPath=${filePath.replaceAll(/\s/g, '%20')}\nDeletionDate=${getDeletionDate(new Date())}`;
|
|
3530
3306
|
|
|
3531
3307
|
await fs$3.promises.writeFile(trashInfoPath, trashInfoData);
|
|
3532
3308
|
await moveFile(filePath, destination);
|
|
@@ -3554,11 +3330,11 @@ async function linux(paths) {
|
|
|
3554
3330
|
|
|
3555
3331
|
const trashPathsCache = new Map();
|
|
3556
3332
|
|
|
3557
|
-
const getDeviceTrashPaths = async
|
|
3558
|
-
let trashPathsPromise = trashPathsCache.get(
|
|
3333
|
+
const getDeviceTrashPaths = async developmentId => {
|
|
3334
|
+
let trashPathsPromise = trashPathsCache.get(developmentId);
|
|
3559
3335
|
if (trashPathsPromise === undefined) {
|
|
3560
3336
|
trashPathsPromise = (async () => {
|
|
3561
|
-
const trashPath = await xdgTrashdir(mountPointMap.get(
|
|
3337
|
+
const trashPath = await xdgTrashdir(mountPointMap.get(developmentId));
|
|
3562
3338
|
const paths = {
|
|
3563
3339
|
filesPath: path$5.join(trashPath, 'files'),
|
|
3564
3340
|
infoPath: path$5.join(trashPath, 'info'),
|
|
@@ -3567,7 +3343,7 @@ async function linux(paths) {
|
|
|
3567
3343
|
await fs$3.promises.mkdir(paths.infoPath, {mode: 0o700, recursive: true});
|
|
3568
3344
|
return paths;
|
|
3569
3345
|
})();
|
|
3570
|
-
trashPathsCache.set(
|
|
3346
|
+
trashPathsCache.set(developmentId, trashPathsPromise);
|
|
3571
3347
|
}
|
|
3572
3348
|
|
|
3573
3349
|
return trashPathsPromise;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var os = require('node:os');
|
|
4
|
-
var chunkedExec = require('./chunked-exec-
|
|
4
|
+
var chunkedExec = require('./chunked-exec-BWQ1zFn6.cjs');
|
|
5
5
|
require('node:util');
|
|
6
6
|
require('node:child_process');
|
|
7
7
|
require('node:url');
|
|
@@ -10,7 +10,7 @@ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentS
|
|
|
10
10
|
const isOlderThanMountainLion = Number(os.release().split('.')[0]) < 12;
|
|
11
11
|
|
|
12
12
|
// Binary source: https://github.com/sindresorhus/macos-trash
|
|
13
|
-
const binary = new URL('macos-trash', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('macos-
|
|
13
|
+
const binary = new URL('macos-trash', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('macos-Bb6zXuPv.cjs', document.baseURI).href)));
|
|
14
14
|
|
|
15
15
|
async function macOS(paths) {
|
|
16
16
|
if (isOlderThanMountainLion) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var chunkedExec = require('./chunked-exec-
|
|
3
|
+
var chunkedExec = require('./chunked-exec-BWQ1zFn6.cjs');
|
|
4
4
|
require('node:util');
|
|
5
5
|
require('node:child_process');
|
|
6
6
|
require('node:url');
|
|
7
7
|
|
|
8
8
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
9
9
|
// Binary source: https://github.com/sindresorhus/recycle-bin
|
|
10
|
-
const binary = new URL('windows-trash.exe', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('windows-
|
|
10
|
+
const binary = new URL('windows-trash.exe', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('windows-B6jKfaWo.cjs', document.baseURI).href)));
|
|
11
11
|
|
|
12
12
|
async function windows(paths) {
|
|
13
13
|
await chunkedExec.chunkedExec(binary, paths, 200);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bililive-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "biliLive-tools的cli程序",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -24,20 +24,22 @@
|
|
|
24
24
|
"lib"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@napi-rs/canvas": "^0.1.
|
|
28
|
-
"
|
|
27
|
+
"@napi-rs/canvas": "^0.1.60",
|
|
28
|
+
"font-ls": "0.3.2",
|
|
29
|
+
"ntsuspend": "^1.0.2",
|
|
30
|
+
"better-sqlite3": "11.6.0"
|
|
29
31
|
},
|
|
30
32
|
"devDependencies": {
|
|
31
|
-
"@types/cli-progress": "^3.11.
|
|
32
|
-
"@yao-pkg/pkg": "^6.
|
|
33
|
+
"@types/cli-progress": "^3.11.6",
|
|
34
|
+
"@yao-pkg/pkg": "^6.1.1",
|
|
33
35
|
"bestzip": "^2.2.1",
|
|
34
36
|
"cli-progress": "^3.12.0",
|
|
35
|
-
"commander": "^12.
|
|
37
|
+
"commander": "^12.1.0",
|
|
36
38
|
"rimraf": "^6.0.1",
|
|
37
|
-
"tsx": "^4.
|
|
38
|
-
"@biliLive-tools/
|
|
39
|
-
"@biliLive-tools/
|
|
40
|
-
"@biliLive-tools/
|
|
39
|
+
"tsx": "^4.19.2",
|
|
40
|
+
"@biliLive-tools/http": "1.8.0",
|
|
41
|
+
"@biliLive-tools/shared": "1.8.0",
|
|
42
|
+
"@biliLive-tools/types": "1.8.0"
|
|
41
43
|
},
|
|
42
44
|
"scripts": {
|
|
43
45
|
"start": "tsx src/index.ts",
|