@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/cody-pdf-test.js
CHANGED
|
@@ -10,7 +10,7 @@ async function main() {
|
|
|
10
10
|
|
|
11
11
|
console.log('set access token...');
|
|
12
12
|
medplum.setAccessToken(
|
|
13
|
-
'eyJhbGciOiJSUzI1NiIsImtpZCI6Ijk5MjI2MjNmLTVmMjctNDFiYi04NTQ1LTZkY2IwZmVkODk4MSIsInR5cCI6IkpXVCJ9.
|
|
13
|
+
'eyJhbGciOiJSUzI1NiIsImtpZCI6Ijk5MjI2MjNmLTVmMjctNDFiYi04NTQ1LTZkY2IwZmVkODk4MSIsInR5cCI6IkpXVCJ9.eyJsb2dpbl9pZCI6IjE2MDdhZDc0LWNmMTktNDFiZS1iYWIxLWZlNGZmMWI3MDkzYSIsInN1YiI6ImJiNjJmNmQzLTNiYjAtNDRjYS1iN2UzLTBmZDAwYmRmYTYyNCIsInVzZXJuYW1lIjoiYmI2MmY2ZDMtM2JiMC00NGNhLWI3ZTMtMGZkMDBiZGZhNjI0Iiwic2NvcGUiOiJvcGVuaWQiLCJwcm9maWxlIjoiUHJhY3RpdGlvbmVyL2ZkNWFiZjYyLWE5NmEtNDdkYi04MDczLTQ4ZDgxOWI0NWU4NCIsImlhdCI6MTY1NDcxNTA3OSwiaXNzIjoiaHR0cHM6Ly9hcGkubWVkcGx1bS5jb20vIiwiZXhwIjoxNjU0NzE4Njc5fQ.scpSfDKpkMu2V5LlmHoOZ4-grHtG-AsgkbFNkrtAqSjE6jeCzJf_ngHhCtZJsVTE9YFt8zyc1r-8_TRseztrxSQ5_iKa7a5J0Vq64bioJYMmU2cTpTw5q2ADdkVJHrvaM1ZALSpJusC9OlKfeLPEV_IFsIWTQu2lsO1k2mmlgHEZpKZBpH3h1KVajOZHIKj2l8WFiu5YlTUNp2BeCmQAndDBv3M8saHuw4pssS-N_mpAmFZy_2nuS3hNBpKBXhdKQeV0njutdF9MMzBkbMHGk8ZgY8Np5OMJ6XZTdfW9bIp8RK2zFUWpZIvGEWZhuGOdtmYx85DIXLS1o5eQSiz4NA'
|
|
14
14
|
);
|
|
15
15
|
|
|
16
16
|
console.log('createpdf...');
|
package/dist/cjs/index.js
CHANGED
|
@@ -862,7 +862,7 @@
|
|
|
862
862
|
const pdfDoc = printer.createPdfKitDocument(docDefinition, { tableLayouts });
|
|
863
863
|
const chunks = [];
|
|
864
864
|
pdfDoc.on('data', (chunk) => chunks.push(chunk));
|
|
865
|
-
pdfDoc.on('end', () => resolve(
|
|
865
|
+
pdfDoc.on('end', () => resolve(concat(chunks)));
|
|
866
866
|
pdfDoc.on('error', reject);
|
|
867
867
|
pdfDoc.end();
|
|
868
868
|
});
|
|
@@ -894,6 +894,24 @@
|
|
|
894
894
|
});
|
|
895
895
|
});
|
|
896
896
|
}
|
|
897
|
+
/**
|
|
898
|
+
* Concatenates an array of Uint8Arrays into a single Uint8Array.
|
|
899
|
+
* @param arrays An array of arrays of bytes.
|
|
900
|
+
* @returns A single array of bytes.
|
|
901
|
+
*/
|
|
902
|
+
function concat(arrays) {
|
|
903
|
+
let len = 0;
|
|
904
|
+
for (const array of arrays) {
|
|
905
|
+
len += array.length;
|
|
906
|
+
}
|
|
907
|
+
const result = new Uint8Array(len);
|
|
908
|
+
let index = 0;
|
|
909
|
+
for (const array of arrays) {
|
|
910
|
+
result.set(array, index);
|
|
911
|
+
index += array.length;
|
|
912
|
+
}
|
|
913
|
+
return result;
|
|
914
|
+
}
|
|
897
915
|
|
|
898
916
|
var _ReadablePromise_suspender, _ReadablePromise_status, _ReadablePromise_response, _ReadablePromise_error, _a;
|
|
899
917
|
/**
|
|
@@ -2558,8 +2576,8 @@
|
|
|
2558
2576
|
}, _MedplumClient_setRequestBody = function _MedplumClient_setRequestBody(options, data) {
|
|
2559
2577
|
if (typeof data === 'string' ||
|
|
2560
2578
|
(typeof Blob !== 'undefined' && data instanceof Blob) ||
|
|
2561
|
-
(typeof
|
|
2562
|
-
(typeof
|
|
2579
|
+
(typeof File !== 'undefined' && data instanceof File) ||
|
|
2580
|
+
(typeof Uint8Array !== 'undefined' && data instanceof Uint8Array)) {
|
|
2563
2581
|
options.body = data;
|
|
2564
2582
|
}
|
|
2565
2583
|
else if (data) {
|