@medplum/core 2.1.8 → 2.1.10

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 (50) hide show
  1. package/api-extractor.json +3 -0
  2. package/dist/cjs/index.cjs +3 -3
  3. package/dist/cjs/index.cjs.map +4 -4
  4. package/dist/esm/index.mjs +3 -3
  5. package/dist/esm/index.mjs.map +4 -4
  6. package/dist/types.d.ts +4181 -0
  7. package/package.json +4 -4
  8. package/dist/types/access.d.ts +0 -77
  9. package/dist/types/base-schema.d.ts +0 -7
  10. package/dist/types/base64.d.ts +0 -14
  11. package/dist/types/bundle.d.ts +0 -32
  12. package/dist/types/cache.d.ts +0 -36
  13. package/dist/types/client.d.ts +0 -1728
  14. package/dist/types/config.d.ts +0 -57
  15. package/dist/types/constants.d.ts +0 -6
  16. package/dist/types/contenttype.d.ts +0 -18
  17. package/dist/types/crypto.d.ts +0 -19
  18. package/dist/types/eventtarget.d.ts +0 -18
  19. package/dist/types/fhircast/index.d.ts +0 -115
  20. package/dist/types/fhircast/test-utils.d.ts +0 -2
  21. package/dist/types/fhirlexer/parse.d.ts +0 -55
  22. package/dist/types/fhirlexer/tokenize.d.ts +0 -45
  23. package/dist/types/fhirmapper/parse.d.ts +0 -7
  24. package/dist/types/fhirmapper/tokenize.d.ts +0 -2
  25. package/dist/types/fhirpath/atoms.d.ts +0 -139
  26. package/dist/types/fhirpath/date.d.ts +0 -1
  27. package/dist/types/fhirpath/functions.d.ts +0 -4
  28. package/dist/types/fhirpath/parse.d.ts +0 -65
  29. package/dist/types/fhirpath/tokenize.d.ts +0 -4
  30. package/dist/types/fhirpath/utils.d.ts +0 -96
  31. package/dist/types/filter/parse.d.ts +0 -7
  32. package/dist/types/filter/tokenize.d.ts +0 -2
  33. package/dist/types/filter/types.d.ts +0 -32
  34. package/dist/types/format.d.ts +0 -120
  35. package/dist/types/hl7.d.ts +0 -242
  36. package/dist/types/index.d.ts +0 -34
  37. package/dist/types/jwt.d.ts +0 -18
  38. package/dist/types/outcomes.d.ts +0 -58
  39. package/dist/types/readablepromise.d.ts +0 -51
  40. package/dist/types/schema.d.ts +0 -43
  41. package/dist/types/search/details.d.ts +0 -37
  42. package/dist/types/search/match.d.ts +0 -9
  43. package/dist/types/search/search.d.ts +0 -102
  44. package/dist/types/sftp.d.ts +0 -9
  45. package/dist/types/storage.d.ts +0 -55
  46. package/dist/types/types.d.ts +0 -202
  47. package/dist/types/typeschema/crawler.d.ts +0 -12
  48. package/dist/types/typeschema/types.d.ts +0 -92
  49. package/dist/types/typeschema/validation.d.ts +0 -25
  50. package/dist/types/utils.d.ts +0 -326
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medplum/core",
3
- "version": "2.1.8",
3
+ "version": "2.1.10",
4
4
  "description": "Medplum TS/JS Library",
5
5
  "author": "Medplum <hello@medplum.com>",
6
6
  "license": "Apache-2.0",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "scripts": {
17
17
  "clean": "rimraf dist",
18
- "build": "npm run clean && tsc --project tsconfig.build.json && node esbuild.mjs",
18
+ "build": "npm run clean && tsc --project tsconfig.build.json && node esbuild.mjs && api-extractor run --local",
19
19
  "test": "jest"
20
20
  },
21
21
  "devDependencies": {
@@ -31,11 +31,11 @@
31
31
  "optional": true
32
32
  }
33
33
  },
34
- "types": "dist/types/index.d.ts",
34
+ "types": "dist/types.d.ts",
35
35
  "main": "dist/cjs/index.cjs",
36
36
  "module": "dist/esm/index.mjs",
37
37
  "exports": {
38
- "types": "./dist/types/index.d.ts",
38
+ "types": "./dist/types.d.ts",
39
39
  "require": "./dist/cjs/index.cjs",
40
40
  "import": "./dist/esm/index.mjs"
41
41
  },
@@ -1,77 +0,0 @@
1
- import { AccessPolicy, AccessPolicyResource, Resource, ResourceType } from '@medplum/fhirtypes';
2
- /**
3
- * Protected resource types are in the "medplum" project.
4
- * Reading and writing is limited to the system account.
5
- */
6
- export declare const protectedResourceTypes: string[];
7
- /**
8
- * Project admin resource types are special resources that are only
9
- * accessible to project administrators.
10
- */
11
- export declare const projectAdminResourceTypes: string[];
12
- /**
13
- * Interactions with a resource that can be controlled via an access policy.
14
- *
15
- * Codes taken from http://hl7.org/fhir/codesystem-restful-interaction.html
16
- */
17
- export declare enum AccessPolicyInteraction {
18
- READ = "read",
19
- VREAD = "vread",
20
- UPDATE = "update",
21
- PATCH = "patch",
22
- DELETE = "delete",
23
- HISTORY = "history",
24
- HISTORY_INSTANCE = "history-instance",
25
- HISTORY_TYPE = "history-type",
26
- HISTORY_SYSTEM = "history-system",
27
- CREATE = "create",
28
- SEARCH = "search",
29
- SEARCH_TYPE = "search-type",
30
- SEARCH_SYSTEM = "search-system",
31
- SEARCH_COMPARTMENT = "search-compartment",
32
- CAPABILITIES = "capabilities",
33
- TRANSACTION = "transaction",
34
- BATCH = "batch",
35
- OPERATION = "operation"
36
- }
37
- /**
38
- * Determines if the current user can read the specified resource type.
39
- * @param accessPolicy The access policy.
40
- * @param resourceType The resource type.
41
- * @returns True if the current user can read the specified resource type.
42
- */
43
- export declare function canReadResourceType(accessPolicy: AccessPolicy, resourceType: ResourceType): boolean;
44
- /**
45
- * Determines if the current user can write the specified resource type.
46
- * This is a preliminary check before evaluating a write operation in depth.
47
- * If a user cannot write a resource type at all, then don't bother looking up previous versions.
48
- * @param accessPolicy The access policy.
49
- * @param resourceType The resource type.
50
- * @returns True if the current user can write the specified resource type.
51
- */
52
- export declare function canWriteResourceType(accessPolicy: AccessPolicy, resourceType: ResourceType): boolean;
53
- /**
54
- * Determines if the current user can write the specified resource.
55
- * This is a more in-depth check after building the candidate result of a write operation.
56
- * @param accessPolicy The access policy.
57
- * @param resource The resource.
58
- * @returns True if the current user can write the specified resource type.
59
- */
60
- export declare function canWriteResource(accessPolicy: AccessPolicy, resource: Resource): boolean;
61
- /**
62
- * Returns true if the resource satisfies the current access policy.
63
- * @param accessPolicy The access policy.
64
- * @param resource The resource.
65
- * @param readonlyMode True if the resource is being read.
66
- * @returns True if the resource matches the access policy.
67
- * @deprecated Use satisfiedAccessPolicy() instead.
68
- */
69
- export declare function matchesAccessPolicy(accessPolicy: AccessPolicy, resource: Resource, readonlyMode: boolean): boolean;
70
- /**
71
- * Checks that there is an access policy permitting the given resource interaction, returning the matching policy object.
72
- * @param resource The resource being acted upon.
73
- * @param interaction The interaction being performed on the resource.
74
- * @param accessPolicy The relevant access policy for the current user.
75
- * @returns The satisfied access policy, or undefined if the access policy does not permit the given interaction.
76
- */
77
- export declare function satisfiedAccessPolicy(resource: Resource, interaction: AccessPolicyInteraction, accessPolicy: AccessPolicy | undefined): AccessPolicyResource | undefined;
@@ -1,7 +0,0 @@
1
- import { InternalSchemaElement, InternalTypeSchema } from './typeschema/types';
2
- export type BaseSchema = Record<string, {
3
- elements: Record<string, Partial<InternalSchemaElement>>;
4
- }>;
5
- export declare function compressElement(element: InternalSchemaElement): Partial<InternalSchemaElement>;
6
- export declare function inflateElement(partial: Partial<InternalSchemaElement>): InternalSchemaElement;
7
- export declare function inflateBaseSchema(base: BaseSchema): Record<string, InternalTypeSchema>;
@@ -1,14 +0,0 @@
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
- export declare function decodeBase64(data: string): string;
8
- /**
9
- * Encodes a base64 string.
10
- * Handles both browser and Node environments.
11
- * @param data The unencoded input string.
12
- * @returns The base-64 encoded string.
13
- */
14
- export declare function encodeBase64(data: string): string;
@@ -1,32 +0,0 @@
1
- import { Bundle, Resource } from '@medplum/fhirtypes';
2
- /**
3
- * More on Bundles can be found here
4
- * http://hl7.org/fhir/R4/bundle.html
5
- */
6
- /**
7
- * Takes a bundle and creates a Transaction Type bundle
8
- * @param bundle The Bundle object that we'll receive from the search query
9
- * @returns transaction type bundle
10
- */
11
- export declare function convertToTransactionBundle(bundle: Bundle): Bundle;
12
- /**
13
- * Topologically sorts a `batch` or `transaction` bundle to improve reference resolution.
14
- * The bundle is sorted such that a resource is created _before_ references to that resource appear in the bundle.
15
- *
16
- * In the event of cycles, this function will first create a POST request for each resource in the cycle, and then will
17
- * append a PUT request to the bundle. This ensures that each resources in the cycle is visited twice, and all
18
- * references can be resolved
19
- * @param bundle Input bundle with type `batch` or `transaction`
20
- * @returns Bundle of the same type, with Bundle.entry reordered
21
- */
22
- export declare function reorderBundle(bundle: Bundle): Bundle;
23
- /**
24
- * Converts a resource with contained resources to a transaction bundle.
25
- * This function is useful when creating a resource that contains other resources.
26
- * Handles local references and topological sorting.
27
- * @param resource The input resource which may or may not include contained resources.
28
- * @returns A bundle with the input resource and all contained resources.
29
- */
30
- export declare function convertContainedResourcesToBundle(resource: Resource & {
31
- contained?: Resource[];
32
- }): Bundle;
@@ -1,36 +0,0 @@
1
- /**
2
- * LRU cache (least recently used)
3
- * Source: https://stackoverflow.com/a/46432113
4
- */
5
- export declare class LRUCache<T> {
6
- private readonly max;
7
- private readonly cache;
8
- constructor(max?: number);
9
- /**
10
- * Deletes all values from the cache.
11
- */
12
- clear(): void;
13
- /**
14
- * Returns the value for the given key.
15
- * @param key The key to retrieve.
16
- * @returns The value if found; undefined otherwise.
17
- */
18
- get(key: string): T | undefined;
19
- /**
20
- * Sets the value for the given key.
21
- * @param key The key to set.
22
- * @param val The value to set.
23
- */
24
- set(key: string, val: T): void;
25
- /**
26
- * Deletes the value for the given key.
27
- * @param key The key to delete.
28
- */
29
- delete(key: string): void;
30
- /**
31
- * Returns the list of all keys in the cache.
32
- * @returns The array of keys in the cache.
33
- */
34
- keys(): IterableIterator<string>;
35
- private first;
36
- }