dicom-curate 0.26.0 → 0.26.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.
- package/dist/esm/applyMappingsWorker.js +37 -4
- package/dist/esm/httpHeaders.js +26 -0
- package/dist/esm/index.js +7422 -7307
- package/dist/esm/mappingWorkerPool.js +12282 -0
- package/dist/types/applyMappingsWorker.d.ts +2 -5
- package/dist/types/curateOne.d.ts +2 -6
- package/dist/types/httpHeaders.d.ts +9 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/mappingWorkerPool.d.ts +53 -0
- package/dist/types/types.d.ts +6 -0
- package/dist/umd/dicom-curate.umd.js +13577 -13344
- 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
|
@@ -85756,6 +85756,35 @@ async function fixupNodeWorkerEnvironment() {
|
|
|
85756
85756
|
}
|
|
85757
85757
|
|
|
85758
85758
|
// src/applyMappingsWorker.ts
|
|
85759
|
+
function safeSerializeError(error2) {
|
|
85760
|
+
if (error2 instanceof Error) {
|
|
85761
|
+
return `${error2.name}: ${error2.message}`;
|
|
85762
|
+
}
|
|
85763
|
+
try {
|
|
85764
|
+
return String(error2);
|
|
85765
|
+
} catch {
|
|
85766
|
+
return "Unknown error (could not serialize)";
|
|
85767
|
+
}
|
|
85768
|
+
}
|
|
85769
|
+
function postErrorResponse(error2, fileInfo) {
|
|
85770
|
+
try {
|
|
85771
|
+
globalThis.postMessage({
|
|
85772
|
+
response: "error",
|
|
85773
|
+
error: safeSerializeError(error2),
|
|
85774
|
+
fileInfo
|
|
85775
|
+
});
|
|
85776
|
+
} catch {
|
|
85777
|
+
globalThis.postMessage({
|
|
85778
|
+
response: "error",
|
|
85779
|
+
error: "Worker error (failed to serialize)",
|
|
85780
|
+
fileInfo: {
|
|
85781
|
+
name: fileInfo?.name ?? "unknown",
|
|
85782
|
+
path: fileInfo?.path ?? "unknown",
|
|
85783
|
+
kind: fileInfo?.kind ?? "unknown"
|
|
85784
|
+
}
|
|
85785
|
+
});
|
|
85786
|
+
}
|
|
85787
|
+
}
|
|
85759
85788
|
var postMappedFileInfo;
|
|
85760
85789
|
fixupNodeWorkerEnvironment().then(() => {
|
|
85761
85790
|
globalThis.addEventListener(
|
|
@@ -85775,7 +85804,7 @@ fixupNodeWorkerEnvironment().then(() => {
|
|
|
85775
85804
|
try {
|
|
85776
85805
|
curateOne({
|
|
85777
85806
|
fileInfo,
|
|
85778
|
-
outputTarget: event.data.outputTarget
|
|
85807
|
+
outputTarget: event.data.outputTarget ?? {},
|
|
85779
85808
|
hashMethod: event.data.hashMethod,
|
|
85780
85809
|
mappingOptions,
|
|
85781
85810
|
previousSourceFileInfo: event.data.previousFileInfo,
|
|
@@ -85789,18 +85818,22 @@ fixupNodeWorkerEnvironment().then(() => {
|
|
|
85789
85818
|
mapResults
|
|
85790
85819
|
});
|
|
85791
85820
|
}).catch((error2) => {
|
|
85792
|
-
|
|
85821
|
+
postErrorResponse(error2, fileInfo);
|
|
85793
85822
|
});
|
|
85794
85823
|
} catch (error2) {
|
|
85795
|
-
|
|
85824
|
+
postErrorResponse(error2, fileInfo);
|
|
85796
85825
|
}
|
|
85797
85826
|
break;
|
|
85798
85827
|
}
|
|
85799
85828
|
default:
|
|
85800
|
-
console.error(
|
|
85829
|
+
console.error(
|
|
85830
|
+
`Unknown request ${event.data.request}`
|
|
85831
|
+
);
|
|
85801
85832
|
}
|
|
85802
85833
|
}
|
|
85803
85834
|
);
|
|
85835
|
+
}).catch((error2) => {
|
|
85836
|
+
console.error("Failed to initialize mapping worker environment:", error2);
|
|
85804
85837
|
});
|
|
85805
85838
|
/*! Bundled license information:
|
|
85806
85839
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/httpHeaders.ts
|
|
2
|
+
async function getHttpInputHeaders(fileInfo) {
|
|
3
|
+
if (fileInfo.kind === "http" && typeof fileInfo.headers === "function") {
|
|
4
|
+
const clonedFileInfo = { ...fileInfo };
|
|
5
|
+
clonedFileInfo.headers = await fileInfo.headers();
|
|
6
|
+
return clonedFileInfo;
|
|
7
|
+
}
|
|
8
|
+
return fileInfo;
|
|
9
|
+
}
|
|
10
|
+
async function getHttpOutputHeaders(outputTarget) {
|
|
11
|
+
if (outputTarget?.http && typeof outputTarget.http.headers === "function") {
|
|
12
|
+
const clonedOutputTarget = {
|
|
13
|
+
...outputTarget
|
|
14
|
+
};
|
|
15
|
+
clonedOutputTarget.http = {
|
|
16
|
+
...outputTarget.http,
|
|
17
|
+
headers: await outputTarget.http.headers()
|
|
18
|
+
};
|
|
19
|
+
return clonedOutputTarget;
|
|
20
|
+
}
|
|
21
|
+
return outputTarget;
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
getHttpInputHeaders,
|
|
25
|
+
getHttpOutputHeaders
|
|
26
|
+
};
|