@helloao/cli 0.0.10 → 0.0.12
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/cjs/cli.cjs +9939 -8987
- package/dist/cjs/index.cjs +16455 -0
- package/dist/esm/index.js +8105 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/types/actions.d.ts +10 -0
- package/dist/types/db.d.ts +2 -1
- package/dist/types/files.d.ts +2 -2
- package/dist/types/s3.d.ts +1 -1
- package/dist/types/uploads.d.ts +4 -0
- package/migrations/20241204173229_add_license_notes/migration.sql +5 -0
- package/migrations/20241204182154_add_book_intro_summaries/migration.sql +2 -0
- package/migrations/20241218211246_add_profiles/migration.sql +12 -0
- package/migrations/20241218211453_add_profile_references/migration.sql +6 -0
- package/node_modules/@zip.js/zip.js/.github/workflows/publish.yml +17 -0
- package/node_modules/@zip.js/zip.js/deno.json +10 -1
- package/node_modules/@zip.js/zip.js/dist/z-worker-fflate.js +1 -1
- package/node_modules/@zip.js/zip.js/dist/z-worker-pako.js +1 -1
- package/node_modules/@zip.js/zip.js/dist/z-worker.js +1 -1
- package/node_modules/@zip.js/zip.js/dist/zip-fs-full.js +274 -133
- package/node_modules/@zip.js/zip.js/dist/zip-fs-full.min.js +1 -1
- package/node_modules/@zip.js/zip.js/dist/zip-fs.js +274 -125
- package/node_modules/@zip.js/zip.js/dist/zip-fs.min.js +1 -1
- package/node_modules/@zip.js/zip.js/dist/zip-full.js +233 -122
- package/node_modules/@zip.js/zip.js/dist/zip-full.min.js +1 -1
- package/node_modules/@zip.js/zip.js/dist/zip-no-worker-deflate.min.js +1 -1
- package/node_modules/@zip.js/zip.js/dist/zip-no-worker-inflate.min.js +1 -1
- package/node_modules/@zip.js/zip.js/dist/zip-no-worker.min.js +1 -1
- package/node_modules/@zip.js/zip.js/dist/zip.js +233 -114
- package/node_modules/@zip.js/zip.js/dist/zip.min.js +1 -1
- package/node_modules/@zip.js/zip.js/eslint.config.mjs +49 -0
- package/node_modules/@zip.js/zip.js/index-fflate.js +2 -1
- package/node_modules/@zip.js/zip.js/index.cjs +274 -133
- package/node_modules/@zip.js/zip.js/index.d.ts +254 -34
- package/node_modules/@zip.js/zip.js/index.js +3 -1
- package/node_modules/@zip.js/zip.js/index.min.js +1 -1
- package/node_modules/@zip.js/zip.js/lib/core/codec-pool.js +3 -1
- package/node_modules/@zip.js/zip.js/lib/core/codec-worker.js +11 -8
- package/node_modules/@zip.js/zip.js/lib/core/configuration.js +2 -1
- package/node_modules/@zip.js/zip.js/lib/core/constants.js +8 -0
- package/node_modules/@zip.js/zip.js/lib/core/io.js +10 -3
- package/node_modules/@zip.js/zip.js/lib/core/streams/aes-crypto-stream.js +4 -3
- package/node_modules/@zip.js/zip.js/lib/core/streams/codecs/deflate.js +0 -4
- package/node_modules/@zip.js/zip.js/lib/core/streams/codecs/inflate.js +0 -4
- package/node_modules/@zip.js/zip.js/lib/core/streams/crc32-stream.js +1 -0
- package/node_modules/@zip.js/zip.js/lib/core/streams/zip-entry-stream.js +4 -2
- package/node_modules/@zip.js/zip.js/lib/core/util/mime-type.js +0 -2
- package/node_modules/@zip.js/zip.js/lib/core/util/stream-codec-shim.js +4 -4
- package/node_modules/@zip.js/zip.js/lib/core/z-worker-core.js +4 -2
- package/node_modules/@zip.js/zip.js/lib/core/zip-entry.js +17 -5
- package/node_modules/@zip.js/zip.js/lib/core/zip-fs-core.js +41 -11
- package/node_modules/@zip.js/zip.js/lib/core/zip-reader.js +45 -23
- package/node_modules/@zip.js/zip.js/lib/core/zip-writer.js +147 -66
- package/node_modules/@zip.js/zip.js/lib/z-worker-inline-template.js +1 -1
- package/node_modules/@zip.js/zip.js/lib/z-worker-inline.js +1 -1
- package/node_modules/@zip.js/zip.js/lib/zip-data-uri.js +4 -1
- package/node_modules/@zip.js/zip.js/lib/zip-fs.js +2 -1
- package/node_modules/@zip.js/zip.js/lib/zip-full-fflate.js +2 -1
- package/node_modules/@zip.js/zip.js/lib/zip-full.js +2 -1
- package/node_modules/@zip.js/zip.js/lib/zip.js +2 -1
- package/node_modules/@zip.js/zip.js/package.json +121 -78
- package/package.json +14 -6
- package/prisma-gen/client.d.ts +1 -0
- package/prisma-gen/client.js +4 -0
- package/prisma-gen/default.d.ts +1 -1
- package/prisma-gen/edge.d.ts +1 -1
- package/prisma-gen/edge.js +30 -9
- package/prisma-gen/index-browser.js +25 -4
- package/prisma-gen/index.d.ts +3530 -1572
- package/prisma-gen/index.js +30 -9
- package/prisma-gen/runtime/edge-esm.js +21 -18
- package/prisma-gen/runtime/edge.js +21 -18
- package/prisma-gen/runtime/index-browser.d.ts +1 -1
- package/prisma-gen/runtime/index-browser.js +1 -1
- package/prisma-gen/runtime/library.d.ts +306 -71
- package/prisma-gen/runtime/library.js +70 -67
- package/prisma-gen/runtime/react-native.js +80 -0
- package/prisma-gen/runtime/wasm.js +22 -19
- package/prisma-gen/wasm.d.ts +1 -1
- package/prisma-gen/wasm.js +25 -4
- package/schema.prisma +27 -0
- package/node_modules/@zip.js/.ignored_zip.js +0 -0
|
@@ -64,6 +64,7 @@ async function runWorker(stream, workerOptions) {
|
|
|
64
64
|
options.useCompressionStream = useCompressionStream || (useCompressionStream === UNDEFINED_VALUE && config.useCompressionStream);
|
|
65
65
|
return (await getWorker()).run();
|
|
66
66
|
|
|
67
|
+
// deno-lint-ignore require-await
|
|
67
68
|
async function getWorker() {
|
|
68
69
|
const workerData = pool.find(workerData => !workerData.busy);
|
|
69
70
|
if (workerData) {
|
|
@@ -103,7 +104,8 @@ function terminateWorker(workerData, workerOptions) {
|
|
|
103
104
|
pool = pool.filter(data => data != workerData);
|
|
104
105
|
try {
|
|
105
106
|
await workerData.terminate();
|
|
106
|
-
|
|
107
|
+
// eslint-disable-next-line no-unused-vars
|
|
108
|
+
} catch (_) {
|
|
107
109
|
// ignored
|
|
108
110
|
}
|
|
109
111
|
}, terminateWorkerTimeout);
|
|
@@ -43,7 +43,6 @@ import {
|
|
|
43
43
|
MESSAGE_CLOSE
|
|
44
44
|
} from "./streams/codec-stream.js";
|
|
45
45
|
|
|
46
|
-
// deno-lint-ignore valid-typeof
|
|
47
46
|
let WEB_WORKERS_SUPPORTED = typeof Worker != UNDEFINED_TYPE;
|
|
48
47
|
|
|
49
48
|
export {
|
|
@@ -125,7 +124,8 @@ class ProgressWatcherStream extends TransformStream {
|
|
|
125
124
|
async function callHandler(handler, ...parameters) {
|
|
126
125
|
try {
|
|
127
126
|
await handler(...parameters);
|
|
128
|
-
|
|
127
|
+
// eslint-disable-next-line no-unused-vars
|
|
128
|
+
} catch (_) {
|
|
129
129
|
// ignored
|
|
130
130
|
}
|
|
131
131
|
}
|
|
@@ -142,7 +142,8 @@ function createWebWorkerInterface(workerData, config) {
|
|
|
142
142
|
let worker;
|
|
143
143
|
try {
|
|
144
144
|
worker = getWebWorker(workerData.scripts[0], baseURL, workerData);
|
|
145
|
-
|
|
145
|
+
// eslint-disable-next-line no-unused-vars
|
|
146
|
+
} catch (_) {
|
|
146
147
|
WEB_WORKERS_SUPPORTED = false;
|
|
147
148
|
return createWorkerInterface(workerData, config);
|
|
148
149
|
}
|
|
@@ -239,19 +240,20 @@ let transferStreamsSupported = true;
|
|
|
239
240
|
function getWebWorker(url, baseURL, workerData) {
|
|
240
241
|
const workerOptions = { type: "module" };
|
|
241
242
|
let scriptUrl, worker;
|
|
242
|
-
// deno-lint-ignore valid-typeof
|
|
243
243
|
if (typeof url == FUNCTION_TYPE) {
|
|
244
244
|
url = url();
|
|
245
245
|
}
|
|
246
246
|
try {
|
|
247
247
|
scriptUrl = new URL(url, baseURL);
|
|
248
|
-
|
|
248
|
+
// eslint-disable-next-line no-unused-vars
|
|
249
|
+
} catch (_) {
|
|
249
250
|
scriptUrl = url;
|
|
250
251
|
}
|
|
251
252
|
if (classicWorkersSupported) {
|
|
252
253
|
try {
|
|
253
254
|
worker = new Worker(scriptUrl);
|
|
254
|
-
|
|
255
|
+
// eslint-disable-next-line no-unused-vars
|
|
256
|
+
} catch (_) {
|
|
255
257
|
classicWorkersSupported = false;
|
|
256
258
|
worker = new Worker(scriptUrl, workerOptions);
|
|
257
259
|
}
|
|
@@ -264,7 +266,7 @@ function getWebWorker(url, baseURL, workerData) {
|
|
|
264
266
|
|
|
265
267
|
function sendMessage(message, { worker, writer, onTaskFinished, transferStreams }) {
|
|
266
268
|
try {
|
|
267
|
-
|
|
269
|
+
const { value, readable, writable } = message;
|
|
268
270
|
const transferables = [];
|
|
269
271
|
if (value) {
|
|
270
272
|
if (value.byteLength < value.buffer.byteLength) {
|
|
@@ -289,7 +291,8 @@ function sendMessage(message, { worker, writer, onTaskFinished, transferStreams
|
|
|
289
291
|
try {
|
|
290
292
|
worker.postMessage(message, transferables);
|
|
291
293
|
return true;
|
|
292
|
-
|
|
294
|
+
// eslint-disable-next-line no-unused-vars
|
|
295
|
+
} catch (_) {
|
|
293
296
|
transferStreamsSupported = false;
|
|
294
297
|
message.readable = message.writable = null;
|
|
295
298
|
worker.postMessage(message);
|
|
@@ -40,7 +40,8 @@ try {
|
|
|
40
40
|
if (typeof navigator != UNDEFINED_TYPE && navigator.hardwareConcurrency) {
|
|
41
41
|
maxWorkers = navigator.hardwareConcurrency;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
// eslint-disable-next-line no-unused-vars
|
|
44
|
+
} catch (_) {
|
|
44
45
|
// ignored
|
|
45
46
|
}
|
|
46
47
|
const DEFAULT_CONFIGURATION = {
|
|
@@ -58,6 +58,10 @@ const BITFLAG_LEVEL = 0x06;
|
|
|
58
58
|
const BITFLAG_DATA_DESCRIPTOR = 0x0008;
|
|
59
59
|
const BITFLAG_LANG_ENCODING_FLAG = 0x0800;
|
|
60
60
|
const FILE_ATTR_MSDOS_DIR_MASK = 0x10;
|
|
61
|
+
const FILE_ATTR_UNIX_TYPE_MASK = 0o170000;
|
|
62
|
+
const FILE_ATTR_UNIX_TYPE_DIR = 0o040000;
|
|
63
|
+
const FILE_ATTR_UNIX_EXECUTABLE_MASK = 0o111;
|
|
64
|
+
const FILE_ATTR_UNIX_DEFAULT_MASK = 0o644;
|
|
61
65
|
|
|
62
66
|
const VERSION_DEFLATE = 0x14;
|
|
63
67
|
const VERSION_ZIP64 = 0x2D;
|
|
@@ -102,6 +106,10 @@ export {
|
|
|
102
106
|
BITFLAG_DATA_DESCRIPTOR,
|
|
103
107
|
BITFLAG_LANG_ENCODING_FLAG,
|
|
104
108
|
FILE_ATTR_MSDOS_DIR_MASK,
|
|
109
|
+
FILE_ATTR_UNIX_TYPE_MASK,
|
|
110
|
+
FILE_ATTR_UNIX_TYPE_DIR,
|
|
111
|
+
FILE_ATTR_UNIX_EXECUTABLE_MASK,
|
|
112
|
+
FILE_ATTR_UNIX_DEFAULT_MASK,
|
|
105
113
|
VERSION_DEFLATE,
|
|
106
114
|
VERSION_ZIP64,
|
|
107
115
|
VERSION_AES,
|
|
@@ -39,6 +39,7 @@ import { getConfiguration } from "./configuration.js";
|
|
|
39
39
|
const ERR_HTTP_STATUS = "HTTP error ";
|
|
40
40
|
const ERR_HTTP_RANGE = "HTTP Range not supported";
|
|
41
41
|
const ERR_ITERATOR_COMPLETED_TOO_SOON = "Writer iterator completed too soon";
|
|
42
|
+
const ERR_WRITER_NOT_INITIALIZED = "Writer not initialized";
|
|
42
43
|
|
|
43
44
|
const CONTENT_TYPE_TEXT_PLAIN = "text/plain";
|
|
44
45
|
const HTTP_HEADER_CONTENT_LENGTH = "Content-Length";
|
|
@@ -76,8 +77,10 @@ class Reader extends Stream {
|
|
|
76
77
|
async pull(controller) {
|
|
77
78
|
const { offset = 0, size, diskNumberStart } = readable;
|
|
78
79
|
const { chunkOffset } = this;
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
const dataSize = size === UNDEFINED_VALUE ? chunkSize : Math.min(chunkSize, size - chunkOffset);
|
|
81
|
+
const data = await readUint8Array(reader, offset + chunkOffset, dataSize, diskNumberStart);
|
|
82
|
+
controller.enqueue(data);
|
|
83
|
+
if ((chunkOffset + chunkSize > size) || (size === UNDEFINED_VALUE && !data.length && dataSize)) {
|
|
81
84
|
controller.close();
|
|
82
85
|
} else {
|
|
83
86
|
this.chunkOffset += chunkSize;
|
|
@@ -95,6 +98,9 @@ class Writer extends Stream {
|
|
|
95
98
|
const writer = this;
|
|
96
99
|
const writable = new WritableStream({
|
|
97
100
|
write(chunk) {
|
|
101
|
+
if (!writer.initialized) {
|
|
102
|
+
throw new Error(ERR_WRITER_NOT_INITIALIZED);
|
|
103
|
+
}
|
|
98
104
|
return writer.writeUint8Array(chunk);
|
|
99
105
|
}
|
|
100
106
|
});
|
|
@@ -745,5 +751,6 @@ export {
|
|
|
745
751
|
SplitDataReader,
|
|
746
752
|
SplitDataWriter,
|
|
747
753
|
ERR_HTTP_RANGE,
|
|
748
|
-
ERR_ITERATOR_COMPLETED_TOO_SOON
|
|
754
|
+
ERR_ITERATOR_COMPLETED_TOO_SOON,
|
|
755
|
+
ERR_WRITER_NOT_INITIALIZED
|
|
749
756
|
};
|
|
@@ -56,7 +56,6 @@ const SALT_LENGTH = [8, 12, 16];
|
|
|
56
56
|
const KEY_LENGTH = [16, 24, 32];
|
|
57
57
|
const SIGNATURE_LENGTH = 10;
|
|
58
58
|
const COUNTER_DEFAULT_VALUE = [0, 0, 0, 0];
|
|
59
|
-
// deno-lint-ignore valid-typeof
|
|
60
59
|
const CRYPTO_API_SUPPORTED = typeof crypto != UNDEFINED_TYPE;
|
|
61
60
|
const subtle = CRYPTO_API_SUPPORTED && crypto.subtle;
|
|
62
61
|
const SUBTLE_API_SUPPORTED = CRYPTO_API_SUPPORTED && typeof subtle != UNDEFINED_TYPE;
|
|
@@ -265,7 +264,8 @@ async function importKey(format, password, algorithm, extractable, keyUsages) {
|
|
|
265
264
|
if (IMPORT_KEY_SUPPORTED) {
|
|
266
265
|
try {
|
|
267
266
|
return await subtle.importKey(format, password, algorithm, extractable, keyUsages);
|
|
268
|
-
|
|
267
|
+
// eslint-disable-next-line no-unused-vars
|
|
268
|
+
} catch (_) {
|
|
269
269
|
IMPORT_KEY_SUPPORTED = false;
|
|
270
270
|
return misc.importKey(password);
|
|
271
271
|
}
|
|
@@ -278,7 +278,8 @@ async function deriveBits(algorithm, baseKey, length) {
|
|
|
278
278
|
if (DERIVE_BITS_SUPPORTED) {
|
|
279
279
|
try {
|
|
280
280
|
return await subtle.deriveBits(algorithm, baseKey, length);
|
|
281
|
-
|
|
281
|
+
// eslint-disable-next-line no-unused-vars
|
|
282
|
+
} catch (_) {
|
|
282
283
|
DERIVE_BITS_SUPPORTED = false;
|
|
283
284
|
return misc.pbkdf2(baseKey, algorithm.salt, DERIVED_BITS_ALGORITHM.iterations, length);
|
|
284
285
|
}
|
|
@@ -1237,7 +1237,6 @@ function Deflate() {
|
|
|
1237
1237
|
}
|
|
1238
1238
|
|
|
1239
1239
|
// Copy as much as possible from input to output:
|
|
1240
|
-
// eslint-disable-next-line no-constant-condition
|
|
1241
1240
|
while (true) {
|
|
1242
1241
|
// Fill the win as much as possible:
|
|
1243
1242
|
if (lookahead <= 1) {
|
|
@@ -1332,7 +1331,6 @@ function Deflate() {
|
|
|
1332
1331
|
|
|
1333
1332
|
// We check for insufficient lookahead only every 8th comparison;
|
|
1334
1333
|
// the 256th check will be made at strstart+258.
|
|
1335
|
-
// eslint-disable-next-line no-empty
|
|
1336
1334
|
do {
|
|
1337
1335
|
// empty block
|
|
1338
1336
|
} while (win[++scan] == win[++match] && win[++scan] == win[++match] && win[++scan] == win[++match]
|
|
@@ -1368,7 +1366,6 @@ function Deflate() {
|
|
|
1368
1366
|
let hash_head = 0; // head of the hash chain
|
|
1369
1367
|
let bflush; // set if current block must be flushed
|
|
1370
1368
|
|
|
1371
|
-
// eslint-disable-next-line no-constant-condition
|
|
1372
1369
|
while (true) {
|
|
1373
1370
|
// Make sure that we always have enough lookahead, except
|
|
1374
1371
|
// at the end of the input file. We need MAX_MATCH bytes
|
|
@@ -1475,7 +1472,6 @@ function Deflate() {
|
|
|
1475
1472
|
let max_insert;
|
|
1476
1473
|
|
|
1477
1474
|
// Process the input block.
|
|
1478
|
-
// eslint-disable-next-line no-constant-condition
|
|
1479
1475
|
while (true) {
|
|
1480
1476
|
// Make sure that we always have enough lookahead, except
|
|
1481
1477
|
// at the end of the input file. We need MAX_MATCH bytes
|
|
@@ -766,7 +766,6 @@ function InfCodes() {
|
|
|
766
766
|
m = q < s.read ? s.read - q - 1 : s.end - q;
|
|
767
767
|
|
|
768
768
|
// process input and output based on current state
|
|
769
|
-
// eslint-disable-next-line no-constant-condition
|
|
770
769
|
while (true) {
|
|
771
770
|
switch (mode) {
|
|
772
771
|
// waiting for "i:"=input, "o:"=output, "x:"=nothing
|
|
@@ -1257,7 +1256,6 @@ function InfBlocks(z, w) {
|
|
|
1257
1256
|
|
|
1258
1257
|
// process input based on current state
|
|
1259
1258
|
// DEBUG dtree
|
|
1260
|
-
// eslint-disable-next-line no-constant-condition
|
|
1261
1259
|
while (true) {
|
|
1262
1260
|
let bl, bd, tl, td, bl_, bd_, tl_, td_;
|
|
1263
1261
|
switch (mode) {
|
|
@@ -1534,7 +1532,6 @@ function InfBlocks(z, w) {
|
|
|
1534
1532
|
mode = DTREE;
|
|
1535
1533
|
/* falls through */
|
|
1536
1534
|
case DTREE:
|
|
1537
|
-
// eslint-disable-next-line no-constant-condition
|
|
1538
1535
|
while (true) {
|
|
1539
1536
|
t = table;
|
|
1540
1537
|
if (index >= 258 + (t & 0x1f) + ((t >> 5) & 0x1f)) {
|
|
@@ -1842,7 +1839,6 @@ function Inflate() {
|
|
|
1842
1839
|
const istate = z.istate;
|
|
1843
1840
|
f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK;
|
|
1844
1841
|
r = Z_BUF_ERROR;
|
|
1845
|
-
// eslint-disable-next-line no-constant-condition
|
|
1846
1842
|
while (true) {
|
|
1847
1843
|
switch (istate.mode) {
|
|
1848
1844
|
case METHOD:
|
|
@@ -146,11 +146,13 @@ function pipeThroughCommpressionStream(readable, useCompressionStream, options,
|
|
|
146
146
|
try {
|
|
147
147
|
const CompressionStream = useCompressionStream && CodecStreamNative ? CodecStreamNative : CodecStream;
|
|
148
148
|
readable = pipeThrough(readable, new CompressionStream(COMPRESSION_FORMAT, options));
|
|
149
|
-
|
|
149
|
+
// eslint-disable-next-line no-unused-vars
|
|
150
|
+
} catch (_) {
|
|
150
151
|
if (useCompressionStream) {
|
|
151
152
|
try {
|
|
152
153
|
readable = pipeThrough(readable, new CodecStream(COMPRESSION_FORMAT, options));
|
|
153
|
-
|
|
154
|
+
// eslint-disable-next-line no-unused-vars
|
|
155
|
+
} catch (_) {
|
|
154
156
|
return readable;
|
|
155
157
|
}
|
|
156
158
|
} else {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-prototype-builtins */
|
|
1
2
|
|
|
2
3
|
/*
|
|
3
4
|
Copyright (c) 2022 Gildas Lormeau. All rights reserved.
|
|
@@ -27,8 +28,6 @@
|
|
|
27
28
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
29
|
*/
|
|
29
30
|
|
|
30
|
-
// deno-lint-ignore-file no-this-alias
|
|
31
|
-
|
|
32
31
|
import { FUNCTION_TYPE, UNDEFINED_VALUE } from "../constants.js";
|
|
33
32
|
|
|
34
33
|
export {
|
|
@@ -43,8 +42,9 @@ function initShimAsyncCodec(library, options = {}, registerDataHandler) {
|
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
function objectHasOwn(object, propertyName) {
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
return typeof Object.hasOwn === FUNCTION_TYPE ?
|
|
46
|
+
Object.hasOwn(object, propertyName) :
|
|
47
|
+
object.hasOwnProperty(propertyName);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
function createCodecClass(constructor, constructorOptions, registerDataHandler) {
|
|
@@ -80,7 +80,8 @@ async function init(message) {
|
|
|
80
80
|
} else {
|
|
81
81
|
await imporModuleScripts(scripts);
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
// eslint-disable-next-line no-unused-vars
|
|
84
|
+
} catch (_) {
|
|
84
85
|
importScriptSupported = false;
|
|
85
86
|
await imporModuleScripts(scripts);
|
|
86
87
|
}
|
|
@@ -159,7 +160,8 @@ function sendMessage(message) {
|
|
|
159
160
|
value = new Uint8Array(value);
|
|
160
161
|
message.value = value.buffer;
|
|
161
162
|
postMessage(message, [message.value]);
|
|
162
|
-
|
|
163
|
+
// eslint-disable-next-line no-unused-vars
|
|
164
|
+
} catch (_) {
|
|
163
165
|
postMessage(message);
|
|
164
166
|
}
|
|
165
167
|
} else {
|
|
@@ -41,19 +41,23 @@ const PROPERTY_NAME_RAW_LAST_ACCESS_DATE = "rawLastAccessDate";
|
|
|
41
41
|
const PROPERTY_NAME_CREATION_DATE = "creationDate";
|
|
42
42
|
const PROPERTY_NAME_RAW_CREATION_DATE = "rawCreationDate";
|
|
43
43
|
const PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE = "internalFileAttribute";
|
|
44
|
+
const PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES = "internalFileAttributes";
|
|
44
45
|
const PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE = "externalFileAttribute";
|
|
46
|
+
const PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES = "externalFileAttributes";
|
|
45
47
|
const PROPERTY_NAME_MS_DOS_COMPATIBLE = "msDosCompatible";
|
|
46
48
|
const PROPERTY_NAME_ZIP64 = "zip64";
|
|
49
|
+
const PROPERTY_NAME_ENCRYPTED = "encrypted";
|
|
50
|
+
const PROPERTY_NAME_VERSION = "version";
|
|
51
|
+
const PROPERTY_NAME_VERSION_MADE_BY = "versionMadeBy";
|
|
52
|
+
const PROPERTY_NAME_ZIPCRYPTO = "zipCrypto";
|
|
53
|
+
const PROPERTY_NAME_DIRECTORY = "directory";
|
|
54
|
+
const PROPERTY_NAME_EXECUTABLE = "executable";
|
|
47
55
|
|
|
48
56
|
const PROPERTY_NAMES = [
|
|
49
57
|
PROPERTY_NAME_FILENAME, PROPERTY_NAME_RAW_FILENAME, PROPERTY_NAME_COMPPRESSED_SIZE, PROPERTY_NAME_UNCOMPPRESSED_SIZE,
|
|
50
58
|
PROPERTY_NAME_LAST_MODIFICATION_DATE, PROPERTY_NAME_RAW_LAST_MODIFICATION_DATE, PROPERTY_NAME_COMMENT, PROPERTY_NAME_RAW_COMMENT,
|
|
51
59
|
PROPERTY_NAME_LAST_ACCESS_DATE, PROPERTY_NAME_CREATION_DATE, PROPERTY_NAME_OFFSET, PROPERTY_NAME_DISK_NUMBER_START,
|
|
52
|
-
PROPERTY_NAME_DISK_NUMBER_START, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE,
|
|
53
|
-
PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64,
|
|
54
|
-
"directory", "bitFlag", "encrypted", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "version", "versionMadeBy",
|
|
55
|
-
"extraField", "rawExtraField", "extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS",
|
|
56
|
-
"extraFieldExtendedTimestamp"];
|
|
60
|
+
PROPERTY_NAME_DISK_NUMBER_START, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES, PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64, PROPERTY_NAME_ENCRYPTED, PROPERTY_NAME_VERSION, PROPERTY_NAME_VERSION_MADE_BY, PROPERTY_NAME_ZIPCRYPTO, PROPERTY_NAME_DIRECTORY, PROPERTY_NAME_EXECUTABLE, "bitFlag", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "extraField", "rawExtraField", "extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS", "extraFieldExtendedTimestamp"];
|
|
57
61
|
|
|
58
62
|
class Entry {
|
|
59
63
|
|
|
@@ -79,8 +83,16 @@ export {
|
|
|
79
83
|
PROPERTY_NAME_CREATION_DATE,
|
|
80
84
|
PROPERTY_NAME_RAW_CREATION_DATE,
|
|
81
85
|
PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE,
|
|
86
|
+
PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES,
|
|
82
87
|
PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE,
|
|
88
|
+
PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES,
|
|
83
89
|
PROPERTY_NAME_MS_DOS_COMPATIBLE,
|
|
84
90
|
PROPERTY_NAME_ZIP64,
|
|
91
|
+
PROPERTY_NAME_ENCRYPTED,
|
|
92
|
+
PROPERTY_NAME_VERSION,
|
|
93
|
+
PROPERTY_NAME_VERSION_MADE_BY,
|
|
94
|
+
PROPERTY_NAME_ZIPCRYPTO,
|
|
95
|
+
PROPERTY_NAME_DIRECTORY,
|
|
96
|
+
PROPERTY_NAME_EXECUTABLE,
|
|
85
97
|
Entry
|
|
86
98
|
};
|
|
@@ -72,7 +72,8 @@ class ZipEntry {
|
|
|
72
72
|
id: fs.entries.length,
|
|
73
73
|
parent,
|
|
74
74
|
children: [],
|
|
75
|
-
uncompressedSize: params.uncompressedSize || 0
|
|
75
|
+
uncompressedSize: params.uncompressedSize || 0,
|
|
76
|
+
passThrough: params.passThrough
|
|
76
77
|
});
|
|
77
78
|
fs.entries.push(zipEntry);
|
|
78
79
|
if (parent) {
|
|
@@ -415,7 +416,8 @@ class ZipDirectoryEntry extends ZipEntry {
|
|
|
415
416
|
importedEntries.push(addChild(parent, name, {
|
|
416
417
|
data: entry,
|
|
417
418
|
Reader: getZipBlobReader(Object.assign({}, options)),
|
|
418
|
-
uncompressedSize: entry.uncompressedSize
|
|
419
|
+
uncompressedSize: entry.uncompressedSize,
|
|
420
|
+
passThrough: options.passThrough
|
|
419
421
|
}));
|
|
420
422
|
}
|
|
421
423
|
} catch (error) {
|
|
@@ -423,7 +425,8 @@ class ZipDirectoryEntry extends ZipEntry {
|
|
|
423
425
|
error.cause = {
|
|
424
426
|
entry
|
|
425
427
|
};
|
|
426
|
-
|
|
428
|
+
// eslint-disable-next-line no-unused-vars
|
|
429
|
+
} catch (_) {
|
|
427
430
|
// ignored
|
|
428
431
|
}
|
|
429
432
|
throw error;
|
|
@@ -621,7 +624,7 @@ class FS {
|
|
|
621
624
|
return this.root.isPasswordProtected();
|
|
622
625
|
}
|
|
623
626
|
|
|
624
|
-
|
|
627
|
+
checkPassword(password, options) {
|
|
625
628
|
return this.root.checkPassword(password, options);
|
|
626
629
|
}
|
|
627
630
|
}
|
|
@@ -681,7 +684,8 @@ async function initReaders(entry, options) {
|
|
|
681
684
|
error.cause = {
|
|
682
685
|
entry: child
|
|
683
686
|
};
|
|
684
|
-
|
|
687
|
+
// eslint-disable-next-line no-unused-vars
|
|
688
|
+
} catch (_) {
|
|
685
689
|
// ignored
|
|
686
690
|
}
|
|
687
691
|
throw error;
|
|
@@ -723,25 +727,50 @@ async function exportZip(zipWriter, entry, totalSize, options) {
|
|
|
723
727
|
|
|
724
728
|
async function processChild(child) {
|
|
725
729
|
const name = options.relativePath ? child.getRelativeName(selectedEntry) : child.getFullname();
|
|
726
|
-
|
|
730
|
+
const childOptions = child.options || {};
|
|
727
731
|
let zipEntryOptions = {};
|
|
728
732
|
if (child.data instanceof Entry) {
|
|
729
733
|
const {
|
|
730
|
-
|
|
734
|
+
externalFileAttributes,
|
|
731
735
|
versionMadeBy,
|
|
732
736
|
comment,
|
|
733
737
|
lastModDate,
|
|
734
738
|
creationDate,
|
|
735
|
-
lastAccessDate
|
|
739
|
+
lastAccessDate,
|
|
740
|
+
uncompressedSize,
|
|
741
|
+
encrypted,
|
|
742
|
+
zipCrypto,
|
|
743
|
+
signature,
|
|
744
|
+
compressionMethod,
|
|
745
|
+
extraFieldAES
|
|
736
746
|
} = child.data;
|
|
737
747
|
zipEntryOptions = {
|
|
738
|
-
|
|
748
|
+
externalFileAttributes,
|
|
739
749
|
versionMadeBy,
|
|
740
750
|
comment,
|
|
741
751
|
lastModDate,
|
|
742
752
|
creationDate,
|
|
743
753
|
lastAccessDate
|
|
744
754
|
};
|
|
755
|
+
if (child.passThrough) {
|
|
756
|
+
let level, encryptionStrength;
|
|
757
|
+
if (compressionMethod === 0) {
|
|
758
|
+
level = 0;
|
|
759
|
+
}
|
|
760
|
+
if (extraFieldAES) {
|
|
761
|
+
encryptionStrength = extraFieldAES.strength;
|
|
762
|
+
}
|
|
763
|
+
zipEntryOptions = Object.assign(zipEntryOptions, {
|
|
764
|
+
passThrough: true,
|
|
765
|
+
encrypted,
|
|
766
|
+
zipCrypto,
|
|
767
|
+
signature,
|
|
768
|
+
uncompressedSize,
|
|
769
|
+
level,
|
|
770
|
+
encryptionStrength,
|
|
771
|
+
compressionMethod
|
|
772
|
+
});
|
|
773
|
+
}
|
|
745
774
|
}
|
|
746
775
|
await zipWriter.add(name, child.reader, Object.assign({
|
|
747
776
|
directory: child.directory
|
|
@@ -751,7 +780,8 @@ async function exportZip(zipWriter, entry, totalSize, options) {
|
|
|
751
780
|
entryOffsets.set(name, indexProgress);
|
|
752
781
|
try {
|
|
753
782
|
await options.onprogress(Array.from(entryOffsets.values()).reduce((previousValue, currentValue) => previousValue + currentValue), totalSize);
|
|
754
|
-
|
|
783
|
+
// eslint-disable-next-line no-unused-vars
|
|
784
|
+
} catch (_) {
|
|
755
785
|
// ignored
|
|
756
786
|
}
|
|
757
787
|
}
|
|
@@ -762,7 +792,7 @@ async function exportZip(zipWriter, entry, totalSize, options) {
|
|
|
762
792
|
}
|
|
763
793
|
}
|
|
764
794
|
|
|
765
|
-
|
|
795
|
+
function addFileSystemHandle(zipEntry, handle, options) {
|
|
766
796
|
return addFile(zipEntry, handle, []);
|
|
767
797
|
|
|
768
798
|
async function addFile(parentEntry, handle, addedEntries) {
|