dicom-curate 0.32.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +26 -25
- package/dist/esm/mappingWorkerPool.js +28 -27
- package/dist/esm/scanDirectoryWorker.js +114 -224
- package/dist/types/mappingWorkerPool.d.ts +1 -1
- package/dist/types/scanDirectoryWorker.d.ts +1 -1
- package/dist/umd/dicom-curate.umd.js +205 -303
- package/dist/umd/dicom-curate.umd.js.map +1 -1
- package/dist/umd/dicom-curate.umd.min.js +2 -2
- package/dist/umd/dicom-curate.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -81787,6 +81787,29 @@ function dataURLToBlobURL(dataURL) {
|
|
|
81787
81787
|
return URL.createObjectURL(blob);
|
|
81788
81788
|
}
|
|
81789
81789
|
|
|
81790
|
+
// src/httpHeaders.ts
|
|
81791
|
+
async function getHttpInputHeaders(fileInfo) {
|
|
81792
|
+
if (fileInfo.kind === "http" && typeof fileInfo.headers === "function") {
|
|
81793
|
+
const clonedFileInfo = { ...fileInfo };
|
|
81794
|
+
clonedFileInfo.headers = await fileInfo.headers();
|
|
81795
|
+
return clonedFileInfo;
|
|
81796
|
+
}
|
|
81797
|
+
return fileInfo;
|
|
81798
|
+
}
|
|
81799
|
+
async function getHttpOutputHeaders(outputTarget) {
|
|
81800
|
+
if (outputTarget?.http && typeof outputTarget.http.headers === "function") {
|
|
81801
|
+
const clonedOutputTarget = {
|
|
81802
|
+
...outputTarget
|
|
81803
|
+
};
|
|
81804
|
+
clonedOutputTarget.http = {
|
|
81805
|
+
...outputTarget.http,
|
|
81806
|
+
headers: await outputTarget.http.headers()
|
|
81807
|
+
};
|
|
81808
|
+
return clonedOutputTarget;
|
|
81809
|
+
}
|
|
81810
|
+
return outputTarget;
|
|
81811
|
+
}
|
|
81812
|
+
|
|
81790
81813
|
// node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.mjs
|
|
81791
81814
|
var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
|
81792
81815
|
var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];
|
|
@@ -87448,29 +87471,6 @@ function serializeMappingOptions(mappingOptions) {
|
|
|
87448
87471
|
return { ...rest, curationSpecStr };
|
|
87449
87472
|
}
|
|
87450
87473
|
|
|
87451
|
-
// src/httpHeaders.ts
|
|
87452
|
-
async function getHttpInputHeaders(fileInfo) {
|
|
87453
|
-
if (fileInfo.kind === "http" && typeof fileInfo.headers === "function") {
|
|
87454
|
-
const clonedFileInfo = { ...fileInfo };
|
|
87455
|
-
clonedFileInfo.headers = await fileInfo.headers();
|
|
87456
|
-
return clonedFileInfo;
|
|
87457
|
-
}
|
|
87458
|
-
return fileInfo;
|
|
87459
|
-
}
|
|
87460
|
-
async function getHttpOutputHeaders(outputTarget) {
|
|
87461
|
-
if (outputTarget?.http && typeof outputTarget.http.headers === "function") {
|
|
87462
|
-
const clonedOutputTarget = {
|
|
87463
|
-
...outputTarget
|
|
87464
|
-
};
|
|
87465
|
-
clonedOutputTarget.http = {
|
|
87466
|
-
...outputTarget.http,
|
|
87467
|
-
headers: await outputTarget.http.headers()
|
|
87468
|
-
};
|
|
87469
|
-
return clonedOutputTarget;
|
|
87470
|
-
}
|
|
87471
|
-
return outputTarget;
|
|
87472
|
-
}
|
|
87473
|
-
|
|
87474
87474
|
// src/types.ts
|
|
87475
87475
|
var OUTPUT_FILE_PREFIX = "output#";
|
|
87476
87476
|
|
|
@@ -87495,7 +87495,7 @@ var progressCallback = () => {
|
|
|
87495
87495
|
};
|
|
87496
87496
|
var scanResumeCallback = null;
|
|
87497
87497
|
var scanPaused = false;
|
|
87498
|
-
var totalDiscoveredFiles
|
|
87498
|
+
var totalDiscoveredFiles;
|
|
87499
87499
|
var LOW_WATER_MARK = 50;
|
|
87500
87500
|
function setMappingWorkerOptions(opts) {
|
|
87501
87501
|
mappingWorkerOptions = opts;
|
|
@@ -87716,7 +87716,7 @@ async function createMappingWorker() {
|
|
|
87716
87716
|
console.log(`Finished mapping ${filesMapped} files`);
|
|
87717
87717
|
}
|
|
87718
87718
|
break;
|
|
87719
|
-
case "error":
|
|
87719
|
+
case "error": {
|
|
87720
87720
|
console.error("Error in mapping worker:", event.data.error);
|
|
87721
87721
|
availableMappingWorkers.push(mappingWorker);
|
|
87722
87722
|
const errorMapResults = {
|
|
@@ -87739,6 +87739,7 @@ async function createMappingWorker() {
|
|
|
87739
87739
|
});
|
|
87740
87740
|
dispatchMappingJobs();
|
|
87741
87741
|
break;
|
|
87742
|
+
}
|
|
87742
87743
|
default:
|
|
87743
87744
|
console.error(`Unknown response from worker ${event.data.response}`);
|
|
87744
87745
|
}
|
|
@@ -6315,6 +6315,29 @@ var require_acorn_globals = __commonJS({
|
|
|
6315
6315
|
}
|
|
6316
6316
|
});
|
|
6317
6317
|
|
|
6318
|
+
// src/httpHeaders.ts
|
|
6319
|
+
async function getHttpInputHeaders(fileInfo) {
|
|
6320
|
+
if (fileInfo.kind === "http" && typeof fileInfo.headers === "function") {
|
|
6321
|
+
const clonedFileInfo = { ...fileInfo };
|
|
6322
|
+
clonedFileInfo.headers = await fileInfo.headers();
|
|
6323
|
+
return clonedFileInfo;
|
|
6324
|
+
}
|
|
6325
|
+
return fileInfo;
|
|
6326
|
+
}
|
|
6327
|
+
async function getHttpOutputHeaders(outputTarget) {
|
|
6328
|
+
if (outputTarget?.http && typeof outputTarget.http.headers === "function") {
|
|
6329
|
+
const clonedOutputTarget = {
|
|
6330
|
+
...outputTarget
|
|
6331
|
+
};
|
|
6332
|
+
clonedOutputTarget.http = {
|
|
6333
|
+
...outputTarget.http,
|
|
6334
|
+
headers: await outputTarget.http.headers()
|
|
6335
|
+
};
|
|
6336
|
+
return clonedOutputTarget;
|
|
6337
|
+
}
|
|
6338
|
+
return outputTarget;
|
|
6339
|
+
}
|
|
6340
|
+
|
|
6318
6341
|
// node_modules/.pnpm/acorn@8.15.0/node_modules/acorn/dist/acorn.mjs
|
|
6319
6342
|
var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
|
6320
6343
|
var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];
|
|
@@ -11976,28 +11999,8 @@ function serializeMappingOptions(mappingOptions) {
|
|
|
11976
11999
|
return { ...rest, curationSpecStr };
|
|
11977
12000
|
}
|
|
11978
12001
|
|
|
11979
|
-
// src/
|
|
11980
|
-
|
|
11981
|
-
if (fileInfo.kind === "http" && typeof fileInfo.headers === "function") {
|
|
11982
|
-
const clonedFileInfo = { ...fileInfo };
|
|
11983
|
-
clonedFileInfo.headers = await fileInfo.headers();
|
|
11984
|
-
return clonedFileInfo;
|
|
11985
|
-
}
|
|
11986
|
-
return fileInfo;
|
|
11987
|
-
}
|
|
11988
|
-
async function getHttpOutputHeaders(outputTarget) {
|
|
11989
|
-
if (outputTarget?.http && typeof outputTarget.http.headers === "function") {
|
|
11990
|
-
const clonedOutputTarget = {
|
|
11991
|
-
...outputTarget
|
|
11992
|
-
};
|
|
11993
|
-
clonedOutputTarget.http = {
|
|
11994
|
-
...outputTarget.http,
|
|
11995
|
-
headers: await outputTarget.http.headers()
|
|
11996
|
-
};
|
|
11997
|
-
return clonedOutputTarget;
|
|
11998
|
-
}
|
|
11999
|
-
return outputTarget;
|
|
12000
|
-
}
|
|
12002
|
+
// src/types.ts
|
|
12003
|
+
var OUTPUT_FILE_PREFIX = "output#";
|
|
12001
12004
|
|
|
12002
12005
|
// src/worker.ts
|
|
12003
12006
|
var wt = null;
|
|
@@ -12043,9 +12046,6 @@ function dataURLToBlobURL(dataURL) {
|
|
|
12043
12046
|
return URL.createObjectURL(blob);
|
|
12044
12047
|
}
|
|
12045
12048
|
|
|
12046
|
-
// src/types.ts
|
|
12047
|
-
var OUTPUT_FILE_PREFIX = "output#";
|
|
12048
|
-
|
|
12049
12049
|
// src/mappingWorkerPool.ts
|
|
12050
12050
|
var mappingWorkerOptions = {};
|
|
12051
12051
|
var availableMappingWorkers = [];
|
|
@@ -12067,7 +12067,7 @@ var progressCallback = () => {
|
|
|
12067
12067
|
};
|
|
12068
12068
|
var scanResumeCallback = null;
|
|
12069
12069
|
var scanPaused = false;
|
|
12070
|
-
var totalDiscoveredFiles
|
|
12070
|
+
var totalDiscoveredFiles;
|
|
12071
12071
|
var LOW_WATER_MARK = 50;
|
|
12072
12072
|
function setMappingWorkerOptions(opts) {
|
|
12073
12073
|
mappingWorkerOptions = opts;
|
|
@@ -12291,7 +12291,7 @@ async function createMappingWorker() {
|
|
|
12291
12291
|
console.log(`Finished mapping ${filesMapped} files`);
|
|
12292
12292
|
}
|
|
12293
12293
|
break;
|
|
12294
|
-
case "error":
|
|
12294
|
+
case "error": {
|
|
12295
12295
|
console.error("Error in mapping worker:", event.data.error);
|
|
12296
12296
|
availableMappingWorkers.push(mappingWorker);
|
|
12297
12297
|
const errorMapResults = {
|
|
@@ -12314,6 +12314,7 @@ async function createMappingWorker() {
|
|
|
12314
12314
|
});
|
|
12315
12315
|
dispatchMappingJobs();
|
|
12316
12316
|
break;
|
|
12317
|
+
}
|
|
12317
12318
|
default:
|
|
12318
12319
|
console.error(`Unknown response from worker ${event.data.response}`);
|
|
12319
12320
|
}
|
|
@@ -37140,11 +37140,8 @@ var keepScanning = true;
|
|
|
37140
37140
|
var pauseResolve = null;
|
|
37141
37141
|
var pausePromise = null;
|
|
37142
37142
|
var totalDiscovered = 0;
|
|
37143
|
-
var countingMode = false;
|
|
37144
|
-
var fileBuffer = [];
|
|
37145
37143
|
function pauseScanning() {
|
|
37146
37144
|
if (!pausePromise) {
|
|
37147
|
-
countingMode = true;
|
|
37148
37145
|
pausePromise = new Promise((resolve) => {
|
|
37149
37146
|
pauseResolve = resolve;
|
|
37150
37147
|
});
|
|
@@ -37152,7 +37149,6 @@ function pauseScanning() {
|
|
|
37152
37149
|
}
|
|
37153
37150
|
function resumeScanning() {
|
|
37154
37151
|
if (pauseResolve) {
|
|
37155
|
-
countingMode = false;
|
|
37156
37152
|
pauseResolve();
|
|
37157
37153
|
pauseResolve = null;
|
|
37158
37154
|
pausePromise = null;
|
|
@@ -37286,7 +37282,7 @@ async function shouldProcessFileNode(filePath, fileName, fileSize, fileAnomalies
|
|
|
37286
37282
|
return true;
|
|
37287
37283
|
}
|
|
37288
37284
|
}
|
|
37289
|
-
function
|
|
37285
|
+
function cheapFilterNameOnly(fileName, filePath) {
|
|
37290
37286
|
const allExcludedFiletypes = [
|
|
37291
37287
|
...noDefaultExclusions ? [] : DEFAULT_EXCLUDED_FILETYPES,
|
|
37292
37288
|
...excludedFiletypes
|
|
@@ -37299,100 +37295,8 @@ function cheapFilter(fileName, fileSize, filePath) {
|
|
|
37299
37295
|
)) {
|
|
37300
37296
|
return false;
|
|
37301
37297
|
}
|
|
37302
|
-
if (noDicomSignatureCheck) {
|
|
37303
|
-
return true;
|
|
37304
|
-
}
|
|
37305
|
-
if (fileSize < 132) {
|
|
37306
|
-
return false;
|
|
37307
|
-
}
|
|
37308
37298
|
return true;
|
|
37309
37299
|
}
|
|
37310
|
-
async function drainBuffer() {
|
|
37311
|
-
while (fileBuffer.length > 0 && keepScanning) {
|
|
37312
|
-
const item = fileBuffer.shift();
|
|
37313
|
-
const fileAnomalies = [];
|
|
37314
|
-
if (item.kind === "handle") {
|
|
37315
|
-
const filePath = `${item.prefix}/${item.name}`;
|
|
37316
|
-
if (await shouldProcessFile(item.file, fileAnomalies, filePath)) {
|
|
37317
|
-
globalThis.postMessage({
|
|
37318
|
-
response: "file",
|
|
37319
|
-
fileInfo: {
|
|
37320
|
-
path: item.prefix,
|
|
37321
|
-
name: item.name,
|
|
37322
|
-
size: item.size,
|
|
37323
|
-
kind: "handle",
|
|
37324
|
-
fileHandle: item.entry
|
|
37325
|
-
},
|
|
37326
|
-
previousFileInfo: item.prev
|
|
37327
|
-
});
|
|
37328
|
-
} else {
|
|
37329
|
-
totalDiscovered--;
|
|
37330
|
-
globalThis.postMessage({
|
|
37331
|
-
response: "count",
|
|
37332
|
-
totalDiscovered
|
|
37333
|
-
});
|
|
37334
|
-
if (fileAnomalies.length > 0) {
|
|
37335
|
-
globalThis.postMessage({
|
|
37336
|
-
response: "scanAnomalies",
|
|
37337
|
-
fileInfo: {
|
|
37338
|
-
path: item.prefix,
|
|
37339
|
-
name: item.name,
|
|
37340
|
-
size: item.size,
|
|
37341
|
-
kind: "handle",
|
|
37342
|
-
fileHandle: item.entry
|
|
37343
|
-
},
|
|
37344
|
-
anomalies: fileAnomalies,
|
|
37345
|
-
previousFileInfo: item.prev
|
|
37346
|
-
});
|
|
37347
|
-
}
|
|
37348
|
-
}
|
|
37349
|
-
} else {
|
|
37350
|
-
if (await shouldProcessFileNode(
|
|
37351
|
-
item.filePath,
|
|
37352
|
-
item.name,
|
|
37353
|
-
item.size,
|
|
37354
|
-
fileAnomalies,
|
|
37355
|
-
`${item.prefix}/${item.name}`
|
|
37356
|
-
)) {
|
|
37357
|
-
globalThis.postMessage({
|
|
37358
|
-
response: "file",
|
|
37359
|
-
fileInfo: {
|
|
37360
|
-
path: item.prefix,
|
|
37361
|
-
name: item.name,
|
|
37362
|
-
size: item.size,
|
|
37363
|
-
kind: "path",
|
|
37364
|
-
fullPath: item.filePath
|
|
37365
|
-
},
|
|
37366
|
-
previousFileInfo: item.prev
|
|
37367
|
-
});
|
|
37368
|
-
} else {
|
|
37369
|
-
totalDiscovered--;
|
|
37370
|
-
globalThis.postMessage({
|
|
37371
|
-
response: "count",
|
|
37372
|
-
totalDiscovered
|
|
37373
|
-
});
|
|
37374
|
-
if (fileAnomalies.length > 0) {
|
|
37375
|
-
globalThis.postMessage({
|
|
37376
|
-
response: "scanAnomalies",
|
|
37377
|
-
fileInfo: {
|
|
37378
|
-
path: item.prefix,
|
|
37379
|
-
name: item.name,
|
|
37380
|
-
size: item.size,
|
|
37381
|
-
kind: "path",
|
|
37382
|
-
fullPath: item.filePath
|
|
37383
|
-
},
|
|
37384
|
-
anomalies: fileAnomalies,
|
|
37385
|
-
previousFileInfo: item.prev
|
|
37386
|
-
});
|
|
37387
|
-
}
|
|
37388
|
-
}
|
|
37389
|
-
}
|
|
37390
|
-
if (!await waitIfPaused())
|
|
37391
|
-
return;
|
|
37392
|
-
if (countingMode)
|
|
37393
|
-
return;
|
|
37394
|
-
}
|
|
37395
|
-
}
|
|
37396
37300
|
fixupNodeWorkerEnvironment().then(() => {
|
|
37397
37301
|
globalThis.addEventListener("message", (event) => {
|
|
37398
37302
|
switch (event.data.request) {
|
|
@@ -37417,8 +37321,6 @@ fixupNodeWorkerEnvironment().then(() => {
|
|
|
37417
37321
|
noDefaultExclusions = event.data.noDefaultExclusions ?? false;
|
|
37418
37322
|
keepScanning = true;
|
|
37419
37323
|
totalDiscovered = 0;
|
|
37420
|
-
countingMode = false;
|
|
37421
|
-
fileBuffer.length = 0;
|
|
37422
37324
|
if ("path" in eventData) {
|
|
37423
37325
|
scanDirectoryNode(eventData.path);
|
|
37424
37326
|
} else if ("directoryHandle" in eventData) {
|
|
@@ -37452,7 +37354,7 @@ async function scanS3Bucket(bucketOptions) {
|
|
|
37452
37354
|
endpoint: bucketOptions.endpoint,
|
|
37453
37355
|
forcePathStyle: bucketOptions.forcePathStyle
|
|
37454
37356
|
});
|
|
37455
|
-
let continuationToken
|
|
37357
|
+
let continuationToken;
|
|
37456
37358
|
do {
|
|
37457
37359
|
const listCommand = new s32.ListObjectsV2Command({
|
|
37458
37360
|
Bucket: bucketOptions.bucketName,
|
|
@@ -37496,8 +37398,16 @@ async function scanS3Bucket(bucketOptions) {
|
|
|
37496
37398
|
}
|
|
37497
37399
|
}
|
|
37498
37400
|
}
|
|
37401
|
+
globalThis.postMessage({
|
|
37402
|
+
response: "count",
|
|
37403
|
+
totalDiscovered
|
|
37404
|
+
});
|
|
37499
37405
|
continuationToken = data2.NextContinuationToken;
|
|
37500
37406
|
} while (continuationToken);
|
|
37407
|
+
globalThis.postMessage({
|
|
37408
|
+
response: "count",
|
|
37409
|
+
totalDiscovered
|
|
37410
|
+
});
|
|
37501
37411
|
globalThis.postMessage({ response: "done" });
|
|
37502
37412
|
} catch (error2) {
|
|
37503
37413
|
globalThis.postMessage({
|
|
@@ -37509,58 +37419,37 @@ async function scanS3Bucket(bucketOptions) {
|
|
|
37509
37419
|
}
|
|
37510
37420
|
}
|
|
37511
37421
|
async function scanDirectory(dir) {
|
|
37512
|
-
async function
|
|
37513
|
-
for await (const entry of
|
|
37422
|
+
async function counter(dirHandle, prefix) {
|
|
37423
|
+
for await (const entry of dirHandle.values()) {
|
|
37424
|
+
if (!keepScanning)
|
|
37425
|
+
return;
|
|
37426
|
+
if (entry.kind === "file") {
|
|
37427
|
+
const key = `${prefix}/${entry.name}`;
|
|
37428
|
+
if (cheapFilterNameOnly(entry.name, key)) {
|
|
37429
|
+
totalDiscovered++;
|
|
37430
|
+
globalThis.postMessage({
|
|
37431
|
+
response: "count",
|
|
37432
|
+
totalDiscovered
|
|
37433
|
+
});
|
|
37434
|
+
}
|
|
37435
|
+
} else if (entry.kind === "directory") {
|
|
37436
|
+
await counter(
|
|
37437
|
+
entry,
|
|
37438
|
+
prefix + "/" + entry.name
|
|
37439
|
+
);
|
|
37440
|
+
}
|
|
37441
|
+
}
|
|
37442
|
+
}
|
|
37443
|
+
async function feeder(dirHandle, prefix) {
|
|
37444
|
+
for await (const entry of dirHandle.values()) {
|
|
37514
37445
|
if (!keepScanning)
|
|
37515
37446
|
return;
|
|
37516
37447
|
if (entry.kind === "file") {
|
|
37517
37448
|
const file = await entry.getFile();
|
|
37518
37449
|
const key = `${prefix}/${entry.name}`;
|
|
37519
37450
|
const prev = previousIndex ? previousIndex[key] : void 0;
|
|
37520
|
-
if (countingMode) {
|
|
37521
|
-
if (cheapFilter(entry.name, file.size, key)) {
|
|
37522
|
-
totalDiscovered++;
|
|
37523
|
-
fileBuffer.push({
|
|
37524
|
-
kind: "handle",
|
|
37525
|
-
entry,
|
|
37526
|
-
file,
|
|
37527
|
-
prefix,
|
|
37528
|
-
name: entry.name,
|
|
37529
|
-
size: file.size,
|
|
37530
|
-
prev
|
|
37531
|
-
});
|
|
37532
|
-
globalThis.postMessage({
|
|
37533
|
-
response: "count",
|
|
37534
|
-
totalDiscovered
|
|
37535
|
-
});
|
|
37536
|
-
}
|
|
37537
|
-
continue;
|
|
37538
|
-
}
|
|
37539
|
-
if (fileBuffer.length > 0) {
|
|
37540
|
-
await drainBuffer();
|
|
37541
|
-
if (countingMode) {
|
|
37542
|
-
if (cheapFilter(entry.name, file.size, key)) {
|
|
37543
|
-
totalDiscovered++;
|
|
37544
|
-
fileBuffer.push({
|
|
37545
|
-
kind: "handle",
|
|
37546
|
-
entry,
|
|
37547
|
-
file,
|
|
37548
|
-
prefix,
|
|
37549
|
-
name: entry.name,
|
|
37550
|
-
size: file.size,
|
|
37551
|
-
prev
|
|
37552
|
-
});
|
|
37553
|
-
globalThis.postMessage({
|
|
37554
|
-
response: "count",
|
|
37555
|
-
totalDiscovered
|
|
37556
|
-
});
|
|
37557
|
-
}
|
|
37558
|
-
continue;
|
|
37559
|
-
}
|
|
37560
|
-
}
|
|
37561
37451
|
const fileAnomalies = [];
|
|
37562
37452
|
if (await shouldProcessFile(file, fileAnomalies, key)) {
|
|
37563
|
-
totalDiscovered++;
|
|
37564
37453
|
globalThis.postMessage({
|
|
37565
37454
|
response: "file",
|
|
37566
37455
|
fileInfo: {
|
|
@@ -37572,24 +37461,33 @@ async function scanDirectory(dir) {
|
|
|
37572
37461
|
},
|
|
37573
37462
|
previousFileInfo: prev
|
|
37574
37463
|
});
|
|
37575
|
-
} else
|
|
37576
|
-
|
|
37577
|
-
|
|
37578
|
-
|
|
37579
|
-
|
|
37580
|
-
|
|
37581
|
-
|
|
37582
|
-
|
|
37583
|
-
|
|
37584
|
-
|
|
37585
|
-
|
|
37586
|
-
|
|
37587
|
-
|
|
37464
|
+
} else {
|
|
37465
|
+
if (cheapFilterNameOnly(entry.name, key)) {
|
|
37466
|
+
totalDiscovered--;
|
|
37467
|
+
globalThis.postMessage({
|
|
37468
|
+
response: "count",
|
|
37469
|
+
totalDiscovered
|
|
37470
|
+
});
|
|
37471
|
+
}
|
|
37472
|
+
if (fileAnomalies.length > 0) {
|
|
37473
|
+
globalThis.postMessage({
|
|
37474
|
+
response: "scanAnomalies",
|
|
37475
|
+
fileInfo: {
|
|
37476
|
+
path: prefix,
|
|
37477
|
+
name: entry.name,
|
|
37478
|
+
size: file.size,
|
|
37479
|
+
kind: "handle",
|
|
37480
|
+
fileHandle: entry
|
|
37481
|
+
},
|
|
37482
|
+
anomalies: fileAnomalies,
|
|
37483
|
+
previousFileInfo: prev
|
|
37484
|
+
});
|
|
37485
|
+
}
|
|
37588
37486
|
}
|
|
37589
37487
|
if (!await waitIfPaused())
|
|
37590
37488
|
return;
|
|
37591
37489
|
} else if (entry.kind === "directory") {
|
|
37592
|
-
await
|
|
37490
|
+
await feeder(
|
|
37593
37491
|
entry,
|
|
37594
37492
|
prefix + "/" + entry.name
|
|
37595
37493
|
);
|
|
@@ -37597,11 +37495,11 @@ async function scanDirectory(dir) {
|
|
|
37597
37495
|
}
|
|
37598
37496
|
}
|
|
37599
37497
|
try {
|
|
37600
|
-
await
|
|
37601
|
-
|
|
37602
|
-
|
|
37603
|
-
|
|
37604
|
-
}
|
|
37498
|
+
await Promise.all([counter(dir, dir.name), feeder(dir, dir.name)]);
|
|
37499
|
+
globalThis.postMessage({
|
|
37500
|
+
response: "count",
|
|
37501
|
+
totalDiscovered
|
|
37502
|
+
});
|
|
37605
37503
|
globalThis.postMessage({ response: "done" });
|
|
37606
37504
|
} catch (error2) {
|
|
37607
37505
|
globalThis.postMessage({
|
|
@@ -37616,7 +37514,30 @@ async function scanDirectoryNode(dirPath) {
|
|
|
37616
37514
|
try {
|
|
37617
37515
|
const fs = await import("fs/promises");
|
|
37618
37516
|
const path = await import("path");
|
|
37619
|
-
async function
|
|
37517
|
+
async function counter(currentPath, prefix) {
|
|
37518
|
+
const entries = await fs.readdir(currentPath, { withFileTypes: true });
|
|
37519
|
+
entries.sort((a4, b4) => a4.name.localeCompare(b4.name));
|
|
37520
|
+
for (const entry of entries) {
|
|
37521
|
+
if (!keepScanning)
|
|
37522
|
+
return;
|
|
37523
|
+
if (entry.isFile()) {
|
|
37524
|
+
const key = `${prefix}/${entry.name}`;
|
|
37525
|
+
if (cheapFilterNameOnly(entry.name, key)) {
|
|
37526
|
+
totalDiscovered++;
|
|
37527
|
+
globalThis.postMessage({
|
|
37528
|
+
response: "count",
|
|
37529
|
+
totalDiscovered
|
|
37530
|
+
});
|
|
37531
|
+
}
|
|
37532
|
+
} else if (entry.isDirectory()) {
|
|
37533
|
+
await counter(
|
|
37534
|
+
path.join(currentPath, entry.name),
|
|
37535
|
+
prefix + "/" + entry.name
|
|
37536
|
+
);
|
|
37537
|
+
}
|
|
37538
|
+
}
|
|
37539
|
+
}
|
|
37540
|
+
async function feeder(currentPath, prefix) {
|
|
37620
37541
|
const entries = await fs.readdir(currentPath, { withFileTypes: true });
|
|
37621
37542
|
entries.sort((a4, b4) => a4.name.localeCompare(b4.name));
|
|
37622
37543
|
for (const entry of entries) {
|
|
@@ -37627,45 +37548,6 @@ async function scanDirectoryNode(dirPath) {
|
|
|
37627
37548
|
const stats = await fs.stat(filePath);
|
|
37628
37549
|
const key = `${prefix}/${entry.name}`;
|
|
37629
37550
|
const prev = previousIndex ? previousIndex[key] : void 0;
|
|
37630
|
-
if (countingMode) {
|
|
37631
|
-
if (cheapFilter(entry.name, stats.size, key)) {
|
|
37632
|
-
totalDiscovered++;
|
|
37633
|
-
fileBuffer.push({
|
|
37634
|
-
kind: "path",
|
|
37635
|
-
filePath,
|
|
37636
|
-
name: entry.name,
|
|
37637
|
-
size: stats.size,
|
|
37638
|
-
prefix,
|
|
37639
|
-
prev
|
|
37640
|
-
});
|
|
37641
|
-
globalThis.postMessage({
|
|
37642
|
-
response: "count",
|
|
37643
|
-
totalDiscovered
|
|
37644
|
-
});
|
|
37645
|
-
}
|
|
37646
|
-
continue;
|
|
37647
|
-
}
|
|
37648
|
-
if (fileBuffer.length > 0) {
|
|
37649
|
-
await drainBuffer();
|
|
37650
|
-
if (countingMode) {
|
|
37651
|
-
if (cheapFilter(entry.name, stats.size, key)) {
|
|
37652
|
-
totalDiscovered++;
|
|
37653
|
-
fileBuffer.push({
|
|
37654
|
-
kind: "path",
|
|
37655
|
-
filePath,
|
|
37656
|
-
name: entry.name,
|
|
37657
|
-
size: stats.size,
|
|
37658
|
-
prefix,
|
|
37659
|
-
prev
|
|
37660
|
-
});
|
|
37661
|
-
globalThis.postMessage({
|
|
37662
|
-
response: "count",
|
|
37663
|
-
totalDiscovered
|
|
37664
|
-
});
|
|
37665
|
-
}
|
|
37666
|
-
continue;
|
|
37667
|
-
}
|
|
37668
|
-
}
|
|
37669
37551
|
const fileAnomalies = [];
|
|
37670
37552
|
if (await shouldProcessFileNode(
|
|
37671
37553
|
filePath,
|
|
@@ -37674,7 +37556,6 @@ async function scanDirectoryNode(dirPath) {
|
|
|
37674
37556
|
fileAnomalies,
|
|
37675
37557
|
key
|
|
37676
37558
|
)) {
|
|
37677
|
-
totalDiscovered++;
|
|
37678
37559
|
globalThis.postMessage({
|
|
37679
37560
|
response: "file",
|
|
37680
37561
|
fileInfo: {
|
|
@@ -37686,36 +37567,45 @@ async function scanDirectoryNode(dirPath) {
|
|
|
37686
37567
|
},
|
|
37687
37568
|
previousFileInfo: prev
|
|
37688
37569
|
});
|
|
37689
|
-
} else
|
|
37690
|
-
|
|
37691
|
-
|
|
37692
|
-
|
|
37693
|
-
|
|
37694
|
-
|
|
37695
|
-
|
|
37696
|
-
|
|
37697
|
-
|
|
37698
|
-
|
|
37699
|
-
|
|
37700
|
-
|
|
37701
|
-
|
|
37570
|
+
} else {
|
|
37571
|
+
if (cheapFilterNameOnly(entry.name, key)) {
|
|
37572
|
+
totalDiscovered--;
|
|
37573
|
+
globalThis.postMessage({
|
|
37574
|
+
response: "count",
|
|
37575
|
+
totalDiscovered
|
|
37576
|
+
});
|
|
37577
|
+
}
|
|
37578
|
+
if (fileAnomalies.length > 0) {
|
|
37579
|
+
globalThis.postMessage({
|
|
37580
|
+
response: "scanAnomalies",
|
|
37581
|
+
fileInfo: {
|
|
37582
|
+
path: prefix,
|
|
37583
|
+
name: entry.name,
|
|
37584
|
+
size: stats.size,
|
|
37585
|
+
kind: "path",
|
|
37586
|
+
fullPath: filePath
|
|
37587
|
+
},
|
|
37588
|
+
anomalies: fileAnomalies,
|
|
37589
|
+
previousFileInfo: prev
|
|
37590
|
+
});
|
|
37591
|
+
}
|
|
37702
37592
|
}
|
|
37703
37593
|
if (!await waitIfPaused())
|
|
37704
37594
|
return;
|
|
37705
37595
|
} else if (entry.isDirectory()) {
|
|
37706
|
-
await
|
|
37596
|
+
await feeder(
|
|
37707
37597
|
path.join(currentPath, entry.name),
|
|
37708
37598
|
prefix + "/" + entry.name
|
|
37709
37599
|
);
|
|
37710
37600
|
}
|
|
37711
37601
|
}
|
|
37712
37602
|
}
|
|
37713
|
-
const dirName =
|
|
37714
|
-
await
|
|
37715
|
-
|
|
37716
|
-
|
|
37717
|
-
|
|
37718
|
-
}
|
|
37603
|
+
const dirName = path.basename(dirPath);
|
|
37604
|
+
await Promise.all([counter(dirPath, dirName), feeder(dirPath, dirName)]);
|
|
37605
|
+
globalThis.postMessage({
|
|
37606
|
+
response: "count",
|
|
37607
|
+
totalDiscovered
|
|
37608
|
+
});
|
|
37719
37609
|
globalThis.postMessage({ response: "done" });
|
|
37720
37610
|
} catch (error2) {
|
|
37721
37611
|
globalThis.postMessage({
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Handles worker creation, crash recovery, replacement spawning, dispatch, and
|
|
6
6
|
* the stall watchdog. Extracted from index.ts for maintainability.
|
|
7
7
|
*/
|
|
8
|
-
import type {
|
|
8
|
+
import type { TFileInfo, TFileInfoIndex, THashMethod, TMappingOptions, TOutputTarget, TProgressMessage } from './types';
|
|
9
9
|
export type TMappingWorkerOptions = TMappingOptions & {
|
|
10
10
|
outputTarget?: TOutputTarget;
|
|
11
11
|
hashMethod?: THashMethod;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { TFileInfo, TFileInfoIndex, TS3BucketOptions } from './types';
|
|
2
|
-
export {};
|
|
3
2
|
export type FileScanMsg = {
|
|
4
3
|
response: 'file';
|
|
5
4
|
fileInfo: TFileInfo;
|
|
@@ -47,3 +46,4 @@ export type FileScanRequest = ({
|
|
|
47
46
|
} | {
|
|
48
47
|
request: 'resume';
|
|
49
48
|
};
|
|
49
|
+
export {};
|