@medplum/core 2.0.13 → 2.0.15

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.
Files changed (59) hide show
  1. package/dist/cjs/index.cjs +1259 -1065
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/cjs/index.min.cjs +1 -1
  4. package/dist/esm/base64.mjs +33 -0
  5. package/dist/esm/base64.mjs.map +1 -0
  6. package/dist/esm/bundle.mjs +36 -0
  7. package/dist/esm/bundle.mjs.map +1 -0
  8. package/dist/esm/cache.mjs +17 -23
  9. package/dist/esm/cache.mjs.map +1 -1
  10. package/dist/esm/client.mjs +523 -385
  11. package/dist/esm/client.mjs.map +1 -1
  12. package/dist/esm/eventtarget.mjs +6 -11
  13. package/dist/esm/eventtarget.mjs.map +1 -1
  14. package/dist/esm/fhirlexer/parse.mjs +15 -23
  15. package/dist/esm/fhirlexer/parse.mjs.map +1 -1
  16. package/dist/esm/fhirlexer/tokenize.mjs +190 -180
  17. package/dist/esm/fhirlexer/tokenize.mjs.map +1 -1
  18. package/dist/esm/fhirmapper/parse.mjs +264 -252
  19. package/dist/esm/fhirmapper/parse.mjs.map +1 -1
  20. package/dist/esm/fhirmapper/tokenize.mjs +2 -4
  21. package/dist/esm/fhirmapper/tokenize.mjs.map +1 -1
  22. package/dist/esm/fhirpath/atoms.mjs +13 -20
  23. package/dist/esm/fhirpath/atoms.mjs.map +1 -1
  24. package/dist/esm/fhirpath/parse.mjs +0 -1
  25. package/dist/esm/fhirpath/parse.mjs.map +1 -1
  26. package/dist/esm/fhirpath/tokenize.mjs +0 -1
  27. package/dist/esm/fhirpath/tokenize.mjs.map +1 -1
  28. package/dist/esm/filter/parse.mjs +1 -4
  29. package/dist/esm/filter/parse.mjs.map +1 -1
  30. package/dist/esm/filter/tokenize.mjs +2 -4
  31. package/dist/esm/filter/tokenize.mjs.map +1 -1
  32. package/dist/esm/index.min.mjs +1 -1
  33. package/dist/esm/index.mjs +1 -0
  34. package/dist/esm/index.mjs.map +1 -1
  35. package/dist/esm/jwt.mjs +2 -9
  36. package/dist/esm/jwt.mjs.map +1 -1
  37. package/dist/esm/readablepromise.mjs +18 -23
  38. package/dist/esm/readablepromise.mjs.map +1 -1
  39. package/dist/esm/schema.mjs +149 -127
  40. package/dist/esm/schema.mjs.map +1 -1
  41. package/dist/esm/search/match.mjs +1 -4
  42. package/dist/esm/search/match.mjs.map +1 -1
  43. package/dist/esm/storage.mjs +13 -19
  44. package/dist/esm/storage.mjs.map +1 -1
  45. package/dist/types/base64.d.ts +14 -0
  46. package/dist/types/bundle.d.ts +11 -0
  47. package/dist/types/cache.d.ts +3 -1
  48. package/dist/types/client.d.ts +164 -1
  49. package/dist/types/eventtarget.d.ts +1 -1
  50. package/dist/types/fhirlexer/parse.d.ts +5 -2
  51. package/dist/types/fhirlexer/tokenize.d.ts +28 -1
  52. package/dist/types/fhirpath/atoms.d.ts +1 -1
  53. package/dist/types/index.d.ts +1 -0
  54. package/dist/types/readablepromise.d.ts +4 -1
  55. package/dist/types/schema.d.ts +33 -1
  56. package/dist/types/storage.d.ts +2 -2
  57. package/package.json +1 -1
  58. package/dist/esm/node_modules/tslib/tslib.es6.mjs +0 -30
  59. package/dist/esm/node_modules/tslib/tslib.es6.mjs.map +0 -1
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Decodes a base64 string.
3
+ * Handles both browser and Node environments.
4
+ * @param data The base-64 encoded input string.
5
+ * @returns The decoded string.
6
+ */
7
+ function decodeBase64(data) {
8
+ if (typeof window !== 'undefined') {
9
+ return window.atob(data);
10
+ }
11
+ if (typeof Buffer !== 'undefined') {
12
+ return Buffer.from(data, 'base64').toString('binary');
13
+ }
14
+ throw new Error('Unable to decode base64');
15
+ }
16
+ /**
17
+ * Encodes a base64 string.
18
+ * Handles both browser and Node environments.
19
+ * @param data The unencoded input string.
20
+ * @returns The base-64 encoded string.
21
+ */
22
+ function encodeBase64(data) {
23
+ if (typeof window !== 'undefined') {
24
+ return window.btoa(data);
25
+ }
26
+ if (typeof Buffer !== 'undefined') {
27
+ return Buffer.from(data, 'binary').toString('base64');
28
+ }
29
+ throw new Error('Unable to encode base64');
30
+ }
31
+
32
+ export { decodeBase64, encodeBase64 };
33
+ //# sourceMappingURL=base64.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64.mjs","sources":["../../src/base64.ts"],"sourcesContent":["/**\n * Decodes a base64 string.\n * Handles both browser and Node environments.\n * @param data The base-64 encoded input string.\n * @returns The decoded string.\n */\nexport function decodeBase64(data: string): string {\n if (typeof window !== 'undefined') {\n return window.atob(data);\n }\n if (typeof Buffer !== 'undefined') {\n return Buffer.from(data, 'base64').toString('binary');\n }\n throw new Error('Unable to decode base64');\n}\n\n/**\n * Encodes a base64 string.\n * Handles both browser and Node environments.\n * @param data The unencoded input string.\n * @returns The base-64 encoded string.\n */\nexport function encodeBase64(data: string): string {\n if (typeof window !== 'undefined') {\n return window.btoa(data);\n }\n if (typeof Buffer !== 'undefined') {\n return Buffer.from(data, 'binary').toString('base64');\n }\n throw new Error('Unable to encode base64');\n}\n"],"names":[],"mappings":"AAAA;;;;;AAKG;AACG,SAAU,YAAY,CAAC,IAAY,EAAA;AACvC,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACjC,QAAA,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,KAAA;AACD,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACjC,QAAA,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACvD,KAAA;AACD,IAAA,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AAC7C,CAAC;AAED;;;;;AAKG;AACG,SAAU,YAAY,CAAC,IAAY,EAAA;AACvC,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACjC,QAAA,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,KAAA;AACD,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACjC,QAAA,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACvD,KAAA;AACD,IAAA,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AAC7C;;;;"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * More on Bundles can be found here
3
+ * http://hl7.org/fhir/R4/bundle.html
4
+ */
5
+ /**
6
+ * Takes a bundle and creates a Transaction Type bundle
7
+ * @param bundle The Bundle object that we'll receive from the search query
8
+ * @returns transaction type bundle
9
+ */
10
+ function convertToTransactionBundle(bundle) {
11
+ for (const entry of bundle.entry || []) {
12
+ delete entry?.resource?.meta;
13
+ entry.fullUrl = 'urn:uuid:' + entry?.resource?.id;
14
+ delete entry?.resource?.id;
15
+ }
16
+ const input = bundle.entry;
17
+ const jsonString = JSON.stringify({
18
+ resourceType: 'Bundle',
19
+ type: 'transaction',
20
+ entry: input?.map((entry) => ({
21
+ fullUrl: entry.fullUrl,
22
+ request: { method: 'POST', url: entry.resource.resourceType },
23
+ resource: entry.resource,
24
+ })),
25
+ }, replacer, 2);
26
+ return JSON.parse(jsonString);
27
+ }
28
+ function replacer(key, value) {
29
+ if (key === 'reference' && typeof value === 'string' && value.includes('/')) {
30
+ return 'urn:uuid:' + value.split('/')[1];
31
+ }
32
+ return value;
33
+ }
34
+
35
+ export { convertToTransactionBundle };
36
+ //# sourceMappingURL=bundle.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundle.mjs","sources":["../../src/bundle.ts"],"sourcesContent":["import { Bundle } from '@medplum/fhirtypes';\n\n/**\n * More on Bundles can be found here\n * http://hl7.org/fhir/R4/bundle.html\n */\n\n/**\n * Takes a bundle and creates a Transaction Type bundle\n * @param bundle The Bundle object that we'll receive from the search query\n * @returns transaction type bundle\n */\nexport function convertToTransactionBundle(bundle: Bundle): Bundle {\n for (const entry of bundle.entry || []) {\n delete entry?.resource?.meta;\n entry.fullUrl = 'urn:uuid:' + entry?.resource?.id;\n delete entry?.resource?.id;\n }\n const input = bundle.entry;\n const jsonString = JSON.stringify(\n {\n resourceType: 'Bundle',\n type: 'transaction',\n entry: input?.map((entry: any) => ({\n fullUrl: entry.fullUrl,\n request: { method: 'POST', url: entry.resource.resourceType },\n resource: entry.resource,\n })),\n },\n replacer,\n 2\n );\n return JSON.parse(jsonString);\n}\n\nfunction replacer(key: string, value: string): string {\n if (key === 'reference' && typeof value === 'string' && value.includes('/')) {\n return 'urn:uuid:' + value.split('/')[1];\n }\n return value;\n}\n"],"names":[],"mappings":"AAEA;;;AAGG;AAEH;;;;AAIG;AACG,SAAU,0BAA0B,CAAC,MAAc,EAAA;IACvD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,KAAK,IAAI,EAAE,EAAE;AACtC,QAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC;QAC7B,KAAK,CAAC,OAAO,GAAG,WAAW,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC;AAClD,QAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC;AAC5B,KAAA;AACD,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AAC3B,IAAA,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAC/B;AACE,QAAA,YAAY,EAAE,QAAQ;AACtB,QAAA,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,KAAU,MAAM;YACjC,OAAO,EAAE,KAAK,CAAC,OAAO;AACtB,YAAA,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,QAAQ,CAAC,YAAY,EAAE;YAC7D,QAAQ,EAAE,KAAK,CAAC,QAAQ;AACzB,SAAA,CAAC,CAAC;AACJ,KAAA,EACD,QAAQ,EACR,CAAC,CACF,CAAC;AACF,IAAA,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,QAAQ,CAAC,GAAW,EAAE,KAAa,EAAA;AAC1C,IAAA,IAAI,GAAG,KAAK,WAAW,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC3E,OAAO,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1C,KAAA;AACD,IAAA,OAAO,KAAK,CAAC;AACf;;;;"}
@@ -1,23 +1,17 @@
1
- import { __classPrivateFieldSet, __classPrivateFieldGet } from './node_modules/tslib/tslib.es6.mjs';
2
-
3
- var _LRUCache_instances, _LRUCache_max, _LRUCache_cache, _LRUCache_first;
4
1
  /**
5
2
  * LRU cache (least recently used)
6
3
  * Source: https://stackoverflow.com/a/46432113
7
4
  */
8
5
  class LRUCache {
9
6
  constructor(max = 10) {
10
- _LRUCache_instances.add(this);
11
- _LRUCache_max.set(this, void 0);
12
- _LRUCache_cache.set(this, void 0);
13
- __classPrivateFieldSet(this, _LRUCache_max, max, "f");
14
- __classPrivateFieldSet(this, _LRUCache_cache, new Map(), "f");
7
+ this.max = max;
8
+ this.cache = new Map();
15
9
  }
16
10
  /**
17
11
  * Deletes all values from the cache.
18
12
  */
19
13
  clear() {
20
- __classPrivateFieldGet(this, _LRUCache_cache, "f").clear();
14
+ this.cache.clear();
21
15
  }
22
16
  /**
23
17
  * Returns the value for the given key.
@@ -25,10 +19,10 @@ class LRUCache {
25
19
  * @returns The value if found; undefined otherwise.
26
20
  */
27
21
  get(key) {
28
- const item = __classPrivateFieldGet(this, _LRUCache_cache, "f").get(key);
22
+ const item = this.cache.get(key);
29
23
  if (item) {
30
- __classPrivateFieldGet(this, _LRUCache_cache, "f").delete(key);
31
- __classPrivateFieldGet(this, _LRUCache_cache, "f").set(key, item);
24
+ this.cache.delete(key);
25
+ this.cache.set(key, item);
32
26
  }
33
27
  return item;
34
28
  }
@@ -38,33 +32,33 @@ class LRUCache {
38
32
  * @param val The value to set.
39
33
  */
40
34
  set(key, val) {
41
- if (__classPrivateFieldGet(this, _LRUCache_cache, "f").has(key)) {
42
- __classPrivateFieldGet(this, _LRUCache_cache, "f").delete(key);
35
+ if (this.cache.has(key)) {
36
+ this.cache.delete(key);
43
37
  }
44
- else if (__classPrivateFieldGet(this, _LRUCache_cache, "f").size >= __classPrivateFieldGet(this, _LRUCache_max, "f")) {
45
- __classPrivateFieldGet(this, _LRUCache_cache, "f").delete(__classPrivateFieldGet(this, _LRUCache_instances, "m", _LRUCache_first).call(this));
38
+ else if (this.cache.size >= this.max) {
39
+ this.cache.delete(this.first());
46
40
  }
47
- __classPrivateFieldGet(this, _LRUCache_cache, "f").set(key, val);
41
+ this.cache.set(key, val);
48
42
  }
49
43
  /**
50
44
  * Deletes the value for the given key.
51
45
  * @param key The key to delete.
52
46
  */
53
47
  delete(key) {
54
- __classPrivateFieldGet(this, _LRUCache_cache, "f").delete(key);
48
+ this.cache.delete(key);
55
49
  }
56
50
  /**
57
51
  * Returns the list of all keys in the cache.
58
52
  * @returns The array of keys in the cache.
59
53
  */
60
54
  keys() {
61
- return __classPrivateFieldGet(this, _LRUCache_cache, "f").keys();
55
+ return this.cache.keys();
56
+ }
57
+ first() {
58
+ // This works because the Map class maintains ordered keys.
59
+ return this.cache.keys().next().value;
62
60
  }
63
61
  }
64
- _LRUCache_max = new WeakMap(), _LRUCache_cache = new WeakMap(), _LRUCache_instances = new WeakSet(), _LRUCache_first = function _LRUCache_first() {
65
- // This works because the Map class maintains ordered keys.
66
- return __classPrivateFieldGet(this, _LRUCache_cache, "f").keys().next().value;
67
- };
68
62
 
69
63
  export { LRUCache };
70
64
  //# sourceMappingURL=cache.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"cache.mjs","sources":["../../src/cache.ts"],"sourcesContent":["/**\n * LRU cache (least recently used)\n * Source: https://stackoverflow.com/a/46432113\n */\nexport class LRUCache<T> {\n readonly #max: number;\n readonly #cache: Map<string, T>;\n\n constructor(max = 10) {\n this.#max = max;\n this.#cache = new Map();\n }\n\n /**\n * Deletes all values from the cache.\n */\n clear(): void {\n this.#cache.clear();\n }\n\n /**\n * Returns the value for the given key.\n * @param key The key to retrieve.\n * @returns The value if found; undefined otherwise.\n */\n get(key: string): T | undefined {\n const item = this.#cache.get(key);\n if (item) {\n this.#cache.delete(key);\n this.#cache.set(key, item);\n }\n return item;\n }\n\n /**\n * Sets the value for the given key.\n * @param key The key to set.\n * @param val The value to set.\n */\n set(key: string, val: T): void {\n if (this.#cache.has(key)) {\n this.#cache.delete(key);\n } else if (this.#cache.size >= this.#max) {\n this.#cache.delete(this.#first());\n }\n this.#cache.set(key, val);\n }\n\n /**\n * Deletes the value for the given key.\n * @param key The key to delete.\n */\n delete(key: string): void {\n this.#cache.delete(key);\n }\n\n /**\n * Returns the list of all keys in the cache.\n * @returns The array of keys in the cache.\n */\n keys(): IterableIterator<string> {\n return this.#cache.keys();\n }\n\n #first(): string {\n // This works because the Map class maintains ordered keys.\n return this.#cache.keys().next().value;\n }\n}\n"],"names":[],"mappings":";;;AAAA;;;AAGG;MACU,QAAQ,CAAA;IAInB,WAAY,CAAA,GAAG,GAAG,EAAE,EAAA;;QAHX,aAAa,CAAA,GAAA,CAAA,IAAA,EAAA,KAAA,CAAA,CAAA,CAAA;QACb,eAAuB,CAAA,GAAA,CAAA,IAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAG9B,QAAA,sBAAA,CAAA,IAAI,EAAA,aAAA,EAAQ,GAAG,EAAA,GAAA,CAAA,CAAC;AAChB,QAAA,sBAAA,CAAA,IAAI,EAAU,eAAA,EAAA,IAAI,GAAG,EAAE,MAAA,CAAC;KACzB;AAED;;AAEG;IACH,KAAK,GAAA;AACH,QAAA,sBAAA,CAAA,IAAI,EAAA,eAAA,EAAA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GAAA,CAAA,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;KACzB;AAED;;;AAGG;IACH,IAAI,GAAA;AACF,QAAA,OAAO,uBAAA,IAAI,EAAA,eAAA,EAAA,GAAA,CAAO,CAAC,IAAI,EAAE,CAAC;KAC3B;AAMF,CAAA;;;IAFG,OAAO,sBAAA,CAAA,IAAI,EAAA,eAAA,EAAA,GAAA,CAAO,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC;AACzC,CAAC;;;;"}
1
+ {"version":3,"file":"cache.mjs","sources":["../../src/cache.ts"],"sourcesContent":["/**\n * LRU cache (least recently used)\n * Source: https://stackoverflow.com/a/46432113\n */\nexport class LRUCache<T> {\n private readonly max: number;\n private readonly cache: Map<string, T>;\n\n constructor(max = 10) {\n this.max = max;\n this.cache = new Map();\n }\n\n /**\n * Deletes all values from the cache.\n */\n clear(): void {\n this.cache.clear();\n }\n\n /**\n * Returns the value for the given key.\n * @param key The key to retrieve.\n * @returns The value if found; undefined otherwise.\n */\n get(key: string): T | undefined {\n const item = this.cache.get(key);\n if (item) {\n this.cache.delete(key);\n this.cache.set(key, item);\n }\n return item;\n }\n\n /**\n * Sets the value for the given key.\n * @param key The key to set.\n * @param val The value to set.\n */\n set(key: string, val: T): void {\n if (this.cache.has(key)) {\n this.cache.delete(key);\n } else if (this.cache.size >= this.max) {\n this.cache.delete(this.first());\n }\n this.cache.set(key, val);\n }\n\n /**\n * Deletes the value for the given key.\n * @param key The key to delete.\n */\n delete(key: string): void {\n this.cache.delete(key);\n }\n\n /**\n * Returns the list of all keys in the cache.\n * @returns The array of keys in the cache.\n */\n keys(): IterableIterator<string> {\n return this.cache.keys();\n }\n\n private first(): string {\n // This works because the Map class maintains ordered keys.\n return this.cache.keys().next().value;\n }\n}\n"],"names":[],"mappings":"AAAA;;;AAGG;MACU,QAAQ,CAAA;IAInB,WAAY,CAAA,GAAG,GAAG,EAAE,EAAA;AAClB,QAAA,IAAI,CAAC,GAAG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