dicom-curate 0.31.0 → 0.32.1

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.
@@ -80107,8 +80107,8 @@ async function curateOne({
80107
80107
  console.error(
80108
80108
  `Upload failed for ${uploadUrl}: ${resp.status} ${resp.statusText}`
80109
80109
  );
80110
- clonedMapResults.errors = clonedMapResults.errors ?? [];
80111
- clonedMapResults.errors.push(
80110
+ clonedMapResults.uploadErrors = clonedMapResults.uploadErrors ?? [];
80111
+ clonedMapResults.uploadErrors.push(
80112
80112
  `Upload failed: ${resp.status} ${resp.statusText}`
80113
80113
  );
80114
80114
  } else {
@@ -80121,8 +80121,8 @@ async function curateOne({
80121
80121
  }
80122
80122
  } catch (e4) {
80123
80123
  console.error("Upload error", e4);
80124
- clonedMapResults.errors = clonedMapResults.errors ?? [];
80125
- clonedMapResults.errors.push(
80124
+ clonedMapResults.uploadErrors = clonedMapResults.uploadErrors ?? [];
80125
+ clonedMapResults.uploadErrors.push(
80126
80126
  `Upload error: ${e4 instanceof Error ? e4.message : String(e4)}`
80127
80127
  );
80128
80128
  }
@@ -80161,8 +80161,8 @@ async function curateOne({
80161
80161
  };
80162
80162
  } catch (e4) {
80163
80163
  console.error("S3 Upload error", e4);
80164
- clonedMapResults.errors = clonedMapResults.errors ?? [];
80165
- clonedMapResults.errors.push(
80164
+ clonedMapResults.uploadErrors = clonedMapResults.uploadErrors ?? [];
80165
+ clonedMapResults.uploadErrors.push(
80166
80166
  `S3 Upload error: ${e4 instanceof Error ? e4.message : String(e4)}`
80167
80167
  );
80168
80168
  }
@@ -73816,8 +73816,8 @@ async function curateOne({
73816
73816
  console.error(
73817
73817
  `Upload failed for ${uploadUrl}: ${resp.status} ${resp.statusText}`
73818
73818
  );
73819
- clonedMapResults.errors = clonedMapResults.errors ?? [];
73820
- clonedMapResults.errors.push(
73819
+ clonedMapResults.uploadErrors = clonedMapResults.uploadErrors ?? [];
73820
+ clonedMapResults.uploadErrors.push(
73821
73821
  `Upload failed: ${resp.status} ${resp.statusText}`
73822
73822
  );
73823
73823
  } else {
@@ -73830,8 +73830,8 @@ async function curateOne({
73830
73830
  }
73831
73831
  } catch (e4) {
73832
73832
  console.error("Upload error", e4);
73833
- clonedMapResults.errors = clonedMapResults.errors ?? [];
73834
- clonedMapResults.errors.push(
73833
+ clonedMapResults.uploadErrors = clonedMapResults.uploadErrors ?? [];
73834
+ clonedMapResults.uploadErrors.push(
73835
73835
  `Upload error: ${e4 instanceof Error ? e4.message : String(e4)}`
73836
73836
  );
73837
73837
  }
@@ -73870,8 +73870,8 @@ async function curateOne({
73870
73870
  };
73871
73871
  } catch (e4) {
73872
73872
  console.error("S3 Upload error", e4);
73873
- clonedMapResults.errors = clonedMapResults.errors ?? [];
73874
- clonedMapResults.errors.push(
73873
+ clonedMapResults.uploadErrors = clonedMapResults.uploadErrors ?? [];
73874
+ clonedMapResults.uploadErrors.push(
73875
73875
  `S3 Upload error: ${e4 instanceof Error ? e4.message : String(e4)}`
73876
73876
  );
73877
73877
  }
package/dist/esm/index.js CHANGED
@@ -81667,8 +81667,8 @@ async function curateOne({
81667
81667
  console.error(
81668
81668
  `Upload failed for ${uploadUrl}: ${resp.status} ${resp.statusText}`
81669
81669
  );
81670
- clonedMapResults.errors = clonedMapResults.errors ?? [];
81671
- clonedMapResults.errors.push(
81670
+ clonedMapResults.uploadErrors = clonedMapResults.uploadErrors ?? [];
81671
+ clonedMapResults.uploadErrors.push(
81672
81672
  `Upload failed: ${resp.status} ${resp.statusText}`
81673
81673
  );
81674
81674
  } else {
@@ -81681,8 +81681,8 @@ async function curateOne({
81681
81681
  }
81682
81682
  } catch (e4) {
81683
81683
  console.error("Upload error", e4);
81684
- clonedMapResults.errors = clonedMapResults.errors ?? [];
81685
- clonedMapResults.errors.push(
81684
+ clonedMapResults.uploadErrors = clonedMapResults.uploadErrors ?? [];
81685
+ clonedMapResults.uploadErrors.push(
81686
81686
  `Upload error: ${e4 instanceof Error ? e4.message : String(e4)}`
81687
81687
  );
81688
81688
  }
@@ -81721,8 +81721,8 @@ async function curateOne({
81721
81721
  };
81722
81722
  } catch (e4) {
81723
81723
  console.error("S3 Upload error", e4);
81724
- clonedMapResults.errors = clonedMapResults.errors ?? [];
81725
- clonedMapResults.errors.push(
81724
+ clonedMapResults.uploadErrors = clonedMapResults.uploadErrors ?? [];
81725
+ clonedMapResults.uploadErrors.push(
81726
81726
  `S3 Upload error: ${e4 instanceof Error ? e4.message : String(e4)}`
81727
81727
  );
81728
81728
  }
@@ -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 = void 0;
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/httpHeaders.ts
11980
- async function getHttpInputHeaders(fileInfo) {
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 = void 0;
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
  }
@@ -37452,7 +37452,7 @@ async function scanS3Bucket(bucketOptions) {
37452
37452
  endpoint: bucketOptions.endpoint,
37453
37453
  forcePathStyle: bucketOptions.forcePathStyle
37454
37454
  });
37455
- let continuationToken = void 0;
37455
+ let continuationToken;
37456
37456
  do {
37457
37457
  const listCommand = new s32.ListObjectsV2Command({
37458
37458
  Bucket: bucketOptions.bucketName,
@@ -37572,6 +37572,12 @@ async function scanDirectory(dir) {
37572
37572
  },
37573
37573
  previousFileInfo: prev
37574
37574
  });
37575
+ if (totalDiscovered % 100 === 0) {
37576
+ globalThis.postMessage({
37577
+ response: "count",
37578
+ totalDiscovered
37579
+ });
37580
+ }
37575
37581
  } else if (fileAnomalies.length > 0) {
37576
37582
  globalThis.postMessage({
37577
37583
  response: "scanAnomalies",
@@ -37602,6 +37608,10 @@ async function scanDirectory(dir) {
37602
37608
  countingMode = false;
37603
37609
  await drainBuffer();
37604
37610
  }
37611
+ globalThis.postMessage({
37612
+ response: "count",
37613
+ totalDiscovered
37614
+ });
37605
37615
  globalThis.postMessage({ response: "done" });
37606
37616
  } catch (error2) {
37607
37617
  globalThis.postMessage({
@@ -37686,6 +37696,12 @@ async function scanDirectoryNode(dirPath) {
37686
37696
  },
37687
37697
  previousFileInfo: prev
37688
37698
  });
37699
+ if (totalDiscovered % 100 === 0) {
37700
+ globalThis.postMessage({
37701
+ response: "count",
37702
+ totalDiscovered
37703
+ });
37704
+ }
37689
37705
  } else if (fileAnomalies.length > 0) {
37690
37706
  globalThis.postMessage({
37691
37707
  response: "scanAnomalies",
@@ -37716,6 +37732,10 @@ async function scanDirectoryNode(dirPath) {
37716
37732
  countingMode = false;
37717
37733
  await drainBuffer();
37718
37734
  }
37735
+ globalThis.postMessage({
37736
+ response: "count",
37737
+ totalDiscovered
37738
+ });
37719
37739
  globalThis.postMessage({ response: "done" });
37720
37740
  } catch (error2) {
37721
37741
  globalThis.postMessage({
@@ -1,4 +1,4 @@
1
- import type { TFileInfo, THashMethod, TOutputTarget, TMappingOptions, TMapResults } from './types';
1
+ import type { TFileInfo, THashMethod, TMappingOptions, TMapResults, TOutputTarget } from './types';
2
2
  export type TCurateOneArgs = {
3
3
  fileInfo: TFileInfo;
4
4
  outputTarget: TOutputTarget;
@@ -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 { TMappingOptions, TFileInfo, TProgressMessage, TOutputTarget, TFileInfoIndex, THashMethod } from './types';
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 {};
@@ -1,6 +1,6 @@
1
- import { TColumnMappings, TMappedValues, Row } from './csvMapping';
2
1
  import type { TNaturalData } from 'dcmjs';
3
2
  import type { SpecPart } from './composeSpecs';
3
+ import type { Row, TColumnMappings, TMappedValues } from './csvMapping';
4
4
  export type Iso8601Duration = string;
5
5
  export type TPs315Options = {
6
6
  cleanDescriptorsOption: boolean;
@@ -131,6 +131,9 @@ export type TMapResults = {
131
131
  };
132
132
  anomalies: string[];
133
133
  errors: string[];
134
+ /** Upload/write failures only (retryable). Separate from `errors` which
135
+ * contains DICOM validation issues that cannot be resolved by retrying. */
136
+ uploadErrors?: string[];
134
137
  quarantine: {
135
138
  [objectPath: string]: string;
136
139
  };
@@ -470,7 +470,7 @@
470
470
  forcePathStyle: bucketOptions.forcePathStyle,
471
471
  });
472
472
  // Page through the S3 bucket listing using ContinuationToken
473
- let continuationToken = undefined;
473
+ let continuationToken;
474
474
  do {
475
475
  const listCommand = new s3.ListObjectsV2Command({
476
476
  Bucket: bucketOptions.bucketName,
@@ -605,6 +605,14 @@
605
605
  },
606
606
  previousFileInfo: prev,
607
607
  });
608
+ // Periodically sync totalDiscovered with the main thread so
609
+ // progress reporting stays accurate after exiting counting mode.
610
+ if (totalDiscovered % 100 === 0) {
611
+ globalThis.postMessage({
612
+ response: 'count',
613
+ totalDiscovered,
614
+ });
615
+ }
608
616
  }
609
617
  else if (fileAnomalies.length > 0) {
610
618
  globalThis.postMessage({
@@ -636,6 +644,11 @@
636
644
  countingMode = false;
637
645
  await drainBuffer();
638
646
  }
647
+ // Final count sync so the main thread has the exact total before 'done'
648
+ globalThis.postMessage({
649
+ response: 'count',
650
+ totalDiscovered,
651
+ });
639
652
  globalThis.postMessage({ response: 'done' });
640
653
  }
641
654
  catch (error) {
@@ -722,6 +735,14 @@
722
735
  },
723
736
  previousFileInfo: prev,
724
737
  });
738
+ // Periodically sync totalDiscovered with the main thread so
739
+ // progress reporting stays accurate after exiting counting mode.
740
+ if (totalDiscovered % 100 === 0) {
741
+ globalThis.postMessage({
742
+ response: 'count',
743
+ totalDiscovered,
744
+ });
745
+ }
725
746
  }
726
747
  else if (fileAnomalies.length > 0) {
727
748
  globalThis.postMessage({
@@ -753,6 +774,11 @@
753
774
  countingMode = false;
754
775
  await drainBuffer();
755
776
  }
777
+ // Final count sync so the main thread has the exact total before 'done'
778
+ globalThis.postMessage({
779
+ response: 'count',
780
+ totalDiscovered,
781
+ });
756
782
  globalThis.postMessage({ response: 'done' });
757
783
  }
758
784
  catch (error) {
@@ -49509,8 +49535,8 @@
49509
49535
  });
49510
49536
  if (!resp.ok) {
49511
49537
  console.error(`Upload failed for ${uploadUrl}: ${resp.status} ${resp.statusText}`);
49512
- clonedMapResults.errors = clonedMapResults.errors ?? [];
49513
- clonedMapResults.errors.push(`Upload failed: ${resp.status} ${resp.statusText}`);
49538
+ clonedMapResults.uploadErrors = clonedMapResults.uploadErrors ?? [];
49539
+ clonedMapResults.uploadErrors.push(`Upload failed: ${resp.status} ${resp.statusText}`);
49514
49540
  }
49515
49541
  else {
49516
49542
  // attach upload info if available
@@ -49524,8 +49550,8 @@
49524
49550
  }
49525
49551
  catch (e) {
49526
49552
  console.error('Upload error', e);
49527
- clonedMapResults.errors = clonedMapResults.errors ?? [];
49528
- clonedMapResults.errors.push(`Upload error: ${e instanceof Error ? e.message : String(e)}`);
49553
+ clonedMapResults.uploadErrors = clonedMapResults.uploadErrors ?? [];
49554
+ clonedMapResults.uploadErrors.push(`Upload error: ${e instanceof Error ? e.message : String(e)}`);
49529
49555
  }
49530
49556
  }
49531
49557
  else if (outputTarget?.s3) {
@@ -49570,8 +49596,8 @@
49570
49596
  }
49571
49597
  catch (e) {
49572
49598
  console.error('S3 Upload error', e);
49573
- clonedMapResults.errors = clonedMapResults.errors ?? [];
49574
- clonedMapResults.errors.push(`S3 Upload error: ${e instanceof Error ? e.message : String(e)}`);
49599
+ clonedMapResults.uploadErrors = clonedMapResults.uploadErrors ?? [];
49600
+ clonedMapResults.uploadErrors.push(`S3 Upload error: ${e instanceof Error ? e.message : String(e)}`);
49575
49601
  }
49576
49602
  }
49577
49603
  }
@@ -111646,8 +111672,8 @@
111646
111672
  });
111647
111673
  if (!resp.ok) {
111648
111674
  console.error(`Upload failed for ${uploadUrl}: ${resp.status} ${resp.statusText}`);
111649
- clonedMapResults.errors = clonedMapResults.errors ?? [];
111650
- clonedMapResults.errors.push(`Upload failed: ${resp.status} ${resp.statusText}`);
111675
+ clonedMapResults.uploadErrors = clonedMapResults.uploadErrors ?? [];
111676
+ clonedMapResults.uploadErrors.push(`Upload failed: ${resp.status} ${resp.statusText}`);
111651
111677
  }
111652
111678
  else {
111653
111679
  // attach upload info if available
@@ -111661,8 +111687,8 @@
111661
111687
  }
111662
111688
  catch (e) {
111663
111689
  console.error('Upload error', e);
111664
- clonedMapResults.errors = clonedMapResults.errors ?? [];
111665
- clonedMapResults.errors.push(`Upload error: ${e instanceof Error ? e.message : String(e)}`);
111690
+ clonedMapResults.uploadErrors = clonedMapResults.uploadErrors ?? [];
111691
+ clonedMapResults.uploadErrors.push(`Upload error: ${e instanceof Error ? e.message : String(e)}`);
111666
111692
  }
111667
111693
  }
111668
111694
  else if (outputTarget?.s3) {
@@ -111707,8 +111733,8 @@
111707
111733
  }
111708
111734
  catch (e) {
111709
111735
  console.error('S3 Upload error', e);
111710
- clonedMapResults.errors = clonedMapResults.errors ?? [];
111711
- clonedMapResults.errors.push(`S3 Upload error: ${e instanceof Error ? e.message : String(e)}`);
111736
+ clonedMapResults.uploadErrors = clonedMapResults.uploadErrors ?? [];
111737
+ clonedMapResults.uploadErrors.push(`S3 Upload error: ${e instanceof Error ? e.message : String(e)}`);
111712
111738
  }
111713
111739
  }
111714
111740
  }
@@ -113924,6 +113950,38 @@
113924
113950
  return URL.createObjectURL(blob);
113925
113951
  }
113926
113952
 
113953
+ /**
113954
+ * HTTP header resolution helpers for dynamic header providers.
113955
+ *
113956
+ * Extracted from index.ts to avoid circular dependencies between
113957
+ * index.ts and mappingWorkerPool.ts.
113958
+ */
113959
+ // If the TFileInfo represents an HTTP resource with dynamic headers,
113960
+ // resolve the headers by calling the provider function.
113961
+ async function getHttpInputHeaders(fileInfo) {
113962
+ if (fileInfo.kind === 'http' && typeof fileInfo.headers === 'function') {
113963
+ const clonedFileInfo = { ...fileInfo };
113964
+ clonedFileInfo.headers = await fileInfo.headers();
113965
+ return clonedFileInfo;
113966
+ }
113967
+ return fileInfo;
113968
+ }
113969
+ // If the outputTarget includes HTTP with dynamic headers,
113970
+ // resolve the headers by calling the provider function.
113971
+ async function getHttpOutputHeaders(outputTarget) {
113972
+ if (outputTarget?.http && typeof outputTarget.http.headers === 'function') {
113973
+ const clonedOutputTarget = {
113974
+ ...outputTarget,
113975
+ };
113976
+ clonedOutputTarget.http = {
113977
+ ...outputTarget.http,
113978
+ headers: await outputTarget.http.headers(),
113979
+ };
113980
+ return clonedOutputTarget;
113981
+ }
113982
+ return outputTarget;
113983
+ }
113984
+
113927
113985
  // This file was generated. Do not modify manually!
113928
113986
  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];
113929
113987
 
@@ -127132,38 +127190,6 @@
127132
127190
  return { ...rest, curationSpecStr };
127133
127191
  }
127134
127192
 
127135
- /**
127136
- * HTTP header resolution helpers for dynamic header providers.
127137
- *
127138
- * Extracted from index.ts to avoid circular dependencies between
127139
- * index.ts and mappingWorkerPool.ts.
127140
- */
127141
- // If the TFileInfo represents an HTTP resource with dynamic headers,
127142
- // resolve the headers by calling the provider function.
127143
- async function getHttpInputHeaders(fileInfo) {
127144
- if (fileInfo.kind === 'http' && typeof fileInfo.headers === 'function') {
127145
- const clonedFileInfo = { ...fileInfo };
127146
- clonedFileInfo.headers = await fileInfo.headers();
127147
- return clonedFileInfo;
127148
- }
127149
- return fileInfo;
127150
- }
127151
- // If the outputTarget includes HTTP with dynamic headers,
127152
- // resolve the headers by calling the provider function.
127153
- async function getHttpOutputHeaders(outputTarget) {
127154
- if (outputTarget?.http && typeof outputTarget.http.headers === 'function') {
127155
- const clonedOutputTarget = {
127156
- ...outputTarget,
127157
- };
127158
- clonedOutputTarget.http = {
127159
- ...outputTarget.http,
127160
- headers: await outputTarget.http.headers(),
127161
- };
127162
- return clonedOutputTarget;
127163
- }
127164
- return outputTarget;
127165
- }
127166
-
127167
127193
  // Kept here, because it is also imported from the worker
127168
127194
  const OUTPUT_FILE_PREFIX = 'output#';
127169
127195
 
@@ -127217,7 +127243,7 @@
127217
127243
  // Total files discovered by the scanner (including those still buffered in the
127218
127244
  // worker). Set via 'count' messages from the scan worker. When available, used
127219
127245
  // in place of the queue-based heuristic for progress reporting.
127220
- let totalDiscoveredFiles = undefined;
127246
+ let totalDiscoveredFiles;
127221
127247
  /**
127222
127248
  * Low-water mark for the file processing queue. When the queue size drops
127223
127249
  * below this threshold after a dispatch, the scan worker is resumed.
@@ -127524,7 +127550,7 @@
127524
127550
  console.log(`Finished mapping ${filesMapped} files`);
127525
127551
  }
127526
127552
  break;
127527
- case 'error':
127553
+ case 'error': {
127528
127554
  console.error('Error in mapping worker:', event.data.error);
127529
127555
  availableMappingWorkers.push(mappingWorker);
127530
127556
  const errorMapResults = {
@@ -127548,6 +127574,7 @@
127548
127574
  });
127549
127575
  dispatchMappingJobs();
127550
127576
  break;
127577
+ }
127551
127578
  default:
127552
127579
  console.error(`Unknown response from worker ${event.data.response}`);
127553
127580
  }