@medplum/core 2.1.9 → 2.1.11
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/api-extractor.json +7 -0
- package/dist/cjs/index.cjs +4 -4
- package/dist/cjs/index.cjs.map +3 -3
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/index.mjs.map +3 -3
- package/dist/types.d.ts +4592 -0
- package/package.json +33 -31
- package/test.setup.cjs +7 -0
- package/tsdoc.json +4 -0
- package/dist/types/access.d.ts +0 -77
- package/dist/types/base-schema.d.ts +0 -7
- package/dist/types/base64.d.ts +0 -14
- package/dist/types/bundle.d.ts +0 -32
- package/dist/types/cache.d.ts +0 -36
- package/dist/types/client.d.ts +0 -1728
- package/dist/types/config.d.ts +0 -127
- package/dist/types/constants.d.ts +0 -6
- package/dist/types/contenttype.d.ts +0 -18
- package/dist/types/crypto.d.ts +0 -19
- package/dist/types/eventtarget.d.ts +0 -18
- package/dist/types/fhircast/index.d.ts +0 -115
- package/dist/types/fhircast/test-utils.d.ts +0 -2
- package/dist/types/fhirlexer/parse.d.ts +0 -55
- package/dist/types/fhirlexer/tokenize.d.ts +0 -45
- package/dist/types/fhirmapper/parse.d.ts +0 -7
- package/dist/types/fhirmapper/tokenize.d.ts +0 -2
- package/dist/types/fhirpath/atoms.d.ts +0 -139
- package/dist/types/fhirpath/date.d.ts +0 -1
- package/dist/types/fhirpath/functions.d.ts +0 -4
- package/dist/types/fhirpath/parse.d.ts +0 -65
- package/dist/types/fhirpath/tokenize.d.ts +0 -4
- package/dist/types/fhirpath/utils.d.ts +0 -96
- package/dist/types/filter/parse.d.ts +0 -7
- package/dist/types/filter/tokenize.d.ts +0 -2
- package/dist/types/filter/types.d.ts +0 -32
- package/dist/types/format.d.ts +0 -120
- package/dist/types/hl7.d.ts +0 -242
- package/dist/types/index.d.ts +0 -34
- package/dist/types/jwt.d.ts +0 -18
- package/dist/types/outcomes.d.ts +0 -58
- package/dist/types/readablepromise.d.ts +0 -51
- package/dist/types/schema.d.ts +0 -43
- package/dist/types/search/details.d.ts +0 -37
- package/dist/types/search/match.d.ts +0 -9
- package/dist/types/search/search.d.ts +0 -102
- package/dist/types/sftp.d.ts +0 -9
- package/dist/types/storage.d.ts +0 -55
- package/dist/types/types.d.ts +0 -203
- package/dist/types/typeschema/crawler.d.ts +0 -12
- package/dist/types/typeschema/types.d.ts +0 -92
- package/dist/types/typeschema/validation.d.ts +0 -25
- package/dist/types/utils.d.ts +0 -326
package/package.json
CHANGED
|
@@ -1,21 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medplum/core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.11",
|
|
4
4
|
"description": "Medplum TS/JS Library",
|
|
5
|
-
"
|
|
6
|
-
|
|
5
|
+
"keywords": [
|
|
6
|
+
"medplum",
|
|
7
|
+
"fhir",
|
|
8
|
+
"healthcare",
|
|
9
|
+
"interoperability",
|
|
10
|
+
"json",
|
|
11
|
+
"serialization",
|
|
12
|
+
"hl7",
|
|
13
|
+
"standards",
|
|
14
|
+
"clinical",
|
|
15
|
+
"dstu2",
|
|
16
|
+
"stu3",
|
|
17
|
+
"r4",
|
|
18
|
+
"normative"
|
|
19
|
+
],
|
|
7
20
|
"homepage": "https://www.medplum.com/",
|
|
8
21
|
"repository": {
|
|
9
22
|
"type": "git",
|
|
10
|
-
"url": "https://github.com/medplum/medplum.git",
|
|
23
|
+
"url": "git+https://github.com/medplum/medplum.git",
|
|
11
24
|
"directory": "packages/core"
|
|
12
25
|
},
|
|
13
|
-
"
|
|
14
|
-
|
|
26
|
+
"license": "Apache-2.0",
|
|
27
|
+
"author": "Medplum <hello@medplum.com>",
|
|
28
|
+
"sideEffects": false,
|
|
29
|
+
"exports": {
|
|
30
|
+
"types": "./dist/types.d.ts",
|
|
31
|
+
"require": "./dist/cjs/index.cjs",
|
|
32
|
+
"import": "./dist/esm/index.mjs"
|
|
15
33
|
},
|
|
34
|
+
"main": "dist/cjs/index.cjs",
|
|
35
|
+
"module": "dist/esm/index.mjs",
|
|
36
|
+
"types": "dist/types.d.ts",
|
|
16
37
|
"scripts": {
|
|
38
|
+
"api-extractor": "api-extractor run --local",
|
|
39
|
+
"api-documenter": "api-documenter markdown --input-folder ./dist/api/ --output-folder ./dist/docs/",
|
|
40
|
+
"build": "npm run clean && tsc --project tsconfig.build.json && node esbuild.mjs && npm run api-extractor && npm run api-documenter",
|
|
17
41
|
"clean": "rimraf dist",
|
|
18
|
-
"build": "npm run clean && tsc --project tsconfig.build.json && node esbuild.mjs",
|
|
19
42
|
"test": "jest"
|
|
20
43
|
},
|
|
21
44
|
"devDependencies": {
|
|
@@ -31,28 +54,7 @@
|
|
|
31
54
|
"optional": true
|
|
32
55
|
}
|
|
33
56
|
},
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"exports": {
|
|
38
|
-
"types": "./dist/types/index.d.ts",
|
|
39
|
-
"require": "./dist/cjs/index.cjs",
|
|
40
|
-
"import": "./dist/esm/index.mjs"
|
|
41
|
-
},
|
|
42
|
-
"sideEffects": false,
|
|
43
|
-
"keywords": [
|
|
44
|
-
"medplum",
|
|
45
|
-
"fhir",
|
|
46
|
-
"healthcare",
|
|
47
|
-
"interoperability",
|
|
48
|
-
"json",
|
|
49
|
-
"serialization",
|
|
50
|
-
"hl7",
|
|
51
|
-
"standards",
|
|
52
|
-
"clinical",
|
|
53
|
-
"dstu2",
|
|
54
|
-
"stu3",
|
|
55
|
-
"r4",
|
|
56
|
-
"normative"
|
|
57
|
-
]
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=18.0.0"
|
|
59
|
+
}
|
|
58
60
|
}
|
package/test.setup.cjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/* globals module require globalThis */
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
3
|
+
const { MemoryStorage } = require('@medplum/core');
|
|
4
|
+
|
|
5
|
+
module.exports = () => {
|
|
6
|
+
Object.defineProperty(globalThis.window, 'sessionStorage', { value: new MemoryStorage() });
|
|
7
|
+
};
|
package/tsdoc.json
ADDED
package/dist/types/access.d.ts
DELETED
|
@@ -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>;
|
package/dist/types/base64.d.ts
DELETED
|
@@ -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;
|
package/dist/types/bundle.d.ts
DELETED
|
@@ -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;
|
package/dist/types/cache.d.ts
DELETED
|
@@ -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
|
-
}
|