dicom-curate 0.25.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 +42 -4
- package/dist/esm/curateOne.js +5 -0
- package/dist/esm/httpHeaders.js +26 -0
- package/dist/esm/index.js +7426 -7306
- 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 +13608 -13361
- 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
|
@@ -79936,6 +79936,11 @@ async function curateOne({
|
|
|
79936
79936
|
dicomData,
|
|
79937
79937
|
mappingOptions
|
|
79938
79938
|
));
|
|
79939
|
+
if (Object.keys(clonedMapResults.mappings).length === 0) {
|
|
79940
|
+
mappedDicomData = {
|
|
79941
|
+
write: () => fileArrayBuffer
|
|
79942
|
+
};
|
|
79943
|
+
}
|
|
79939
79944
|
clonedMapResults.mappingRequired = true;
|
|
79940
79945
|
} else {
|
|
79941
79946
|
mappedDicomData = {
|
|
@@ -85751,6 +85756,35 @@ async function fixupNodeWorkerEnvironment() {
|
|
|
85751
85756
|
}
|
|
85752
85757
|
|
|
85753
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
|
+
}
|
|
85754
85788
|
var postMappedFileInfo;
|
|
85755
85789
|
fixupNodeWorkerEnvironment().then(() => {
|
|
85756
85790
|
globalThis.addEventListener(
|
|
@@ -85770,7 +85804,7 @@ fixupNodeWorkerEnvironment().then(() => {
|
|
|
85770
85804
|
try {
|
|
85771
85805
|
curateOne({
|
|
85772
85806
|
fileInfo,
|
|
85773
|
-
outputTarget: event.data.outputTarget
|
|
85807
|
+
outputTarget: event.data.outputTarget ?? {},
|
|
85774
85808
|
hashMethod: event.data.hashMethod,
|
|
85775
85809
|
mappingOptions,
|
|
85776
85810
|
previousSourceFileInfo: event.data.previousFileInfo,
|
|
@@ -85784,18 +85818,22 @@ fixupNodeWorkerEnvironment().then(() => {
|
|
|
85784
85818
|
mapResults
|
|
85785
85819
|
});
|
|
85786
85820
|
}).catch((error2) => {
|
|
85787
|
-
|
|
85821
|
+
postErrorResponse(error2, fileInfo);
|
|
85788
85822
|
});
|
|
85789
85823
|
} catch (error2) {
|
|
85790
|
-
|
|
85824
|
+
postErrorResponse(error2, fileInfo);
|
|
85791
85825
|
}
|
|
85792
85826
|
break;
|
|
85793
85827
|
}
|
|
85794
85828
|
default:
|
|
85795
|
-
console.error(
|
|
85829
|
+
console.error(
|
|
85830
|
+
`Unknown request ${event.data.request}`
|
|
85831
|
+
);
|
|
85796
85832
|
}
|
|
85797
85833
|
}
|
|
85798
85834
|
);
|
|
85835
|
+
}).catch((error2) => {
|
|
85836
|
+
console.error("Failed to initialize mapping worker environment:", error2);
|
|
85799
85837
|
});
|
|
85800
85838
|
/*! Bundled license information:
|
|
85801
85839
|
|
package/dist/esm/curateOne.js
CHANGED
|
@@ -73645,6 +73645,11 @@ async function curateOne({
|
|
|
73645
73645
|
dicomData,
|
|
73646
73646
|
mappingOptions
|
|
73647
73647
|
));
|
|
73648
|
+
if (Object.keys(clonedMapResults.mappings).length === 0) {
|
|
73649
|
+
mappedDicomData = {
|
|
73650
|
+
write: () => fileArrayBuffer
|
|
73651
|
+
};
|
|
73652
|
+
}
|
|
73648
73653
|
clonedMapResults.mappingRequired = true;
|
|
73649
73654
|
} else {
|
|
73650
73655
|
mappedDicomData = {
|
|
@@ -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
|
+
};
|