@medplum/core 0.9.8 → 0.9.9
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/cody-pdf-test.js +1 -1
- package/dist/cjs/index.js +21 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.min.js +1 -1
- package/dist/cjs/index.min.js.map +1 -1
- package/dist/esm/index.js +21 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +1 -1
- package/dist/esm/index.min.js.map +1 -1
- package/dist/types/client.d.ts +2 -2
- package/dist/types/pdf.d.ts +2 -2
- package/package.json +2 -2
- package/test9-2.pdf +0 -0
- package/test9-3.pdf +0 -0
- package/test9-4.pdf +0 -0
- package/test9.pdf +0 -0
package/dist/esm/index.js
CHANGED
|
@@ -856,7 +856,7 @@ function generatePdfServerSide(docDefinition, tableLayouts, fonts) {
|
|
|
856
856
|
const pdfDoc = printer.createPdfKitDocument(docDefinition, { tableLayouts });
|
|
857
857
|
const chunks = [];
|
|
858
858
|
pdfDoc.on('data', (chunk) => chunks.push(chunk));
|
|
859
|
-
pdfDoc.on('end', () => resolve(
|
|
859
|
+
pdfDoc.on('end', () => resolve(concat(chunks)));
|
|
860
860
|
pdfDoc.on('error', reject);
|
|
861
861
|
pdfDoc.end();
|
|
862
862
|
});
|
|
@@ -888,6 +888,24 @@ function generatePdfClientSide(docDefinition, tableLayouts, fonts) {
|
|
|
888
888
|
});
|
|
889
889
|
});
|
|
890
890
|
}
|
|
891
|
+
/**
|
|
892
|
+
* Concatenates an array of Uint8Arrays into a single Uint8Array.
|
|
893
|
+
* @param arrays An array of arrays of bytes.
|
|
894
|
+
* @returns A single array of bytes.
|
|
895
|
+
*/
|
|
896
|
+
function concat(arrays) {
|
|
897
|
+
let len = 0;
|
|
898
|
+
for (const array of arrays) {
|
|
899
|
+
len += array.length;
|
|
900
|
+
}
|
|
901
|
+
const result = new Uint8Array(len);
|
|
902
|
+
let index = 0;
|
|
903
|
+
for (const array of arrays) {
|
|
904
|
+
result.set(array, index);
|
|
905
|
+
index += array.length;
|
|
906
|
+
}
|
|
907
|
+
return result;
|
|
908
|
+
}
|
|
891
909
|
|
|
892
910
|
var _ReadablePromise_suspender, _ReadablePromise_status, _ReadablePromise_response, _ReadablePromise_error, _a;
|
|
893
911
|
/**
|
|
@@ -2552,8 +2570,8 @@ _MedplumClient_fetch = new WeakMap(), _MedplumClient_storage = new WeakMap(), _M
|
|
|
2552
2570
|
}, _MedplumClient_setRequestBody = function _MedplumClient_setRequestBody(options, data) {
|
|
2553
2571
|
if (typeof data === 'string' ||
|
|
2554
2572
|
(typeof Blob !== 'undefined' && data instanceof Blob) ||
|
|
2555
|
-
(typeof
|
|
2556
|
-
(typeof
|
|
2573
|
+
(typeof File !== 'undefined' && data instanceof File) ||
|
|
2574
|
+
(typeof Uint8Array !== 'undefined' && data instanceof Uint8Array)) {
|
|
2557
2575
|
options.body = data;
|
|
2558
2576
|
}
|
|
2559
2577
|
else if (data) {
|