@medplum/core 2.0.30 → 2.0.32
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/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/access.d.ts +35 -1
- package/dist/types/config.d.ts +1 -0
- package/dist/types/search/search.d.ts +0 -2
- package/dist/types/typeschema/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/types/access.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccessPolicy, Resource, ResourceType } from '@medplum/fhirtypes';
|
|
1
|
+
import { AccessPolicy, AccessPolicyResource, Resource, ResourceType } from '@medplum/fhirtypes';
|
|
2
2
|
/**
|
|
3
3
|
* Public resource types are in the "public" project.
|
|
4
4
|
* They are available to all users.
|
|
@@ -14,6 +14,31 @@ export declare const protectedResourceTypes: string[];
|
|
|
14
14
|
* accessible to project administrators.
|
|
15
15
|
*/
|
|
16
16
|
export declare const projectAdminResourceTypes: string[];
|
|
17
|
+
/**
|
|
18
|
+
* Interactions with a resource that can be controlled via an access policy.
|
|
19
|
+
*
|
|
20
|
+
* Codes taken from http://hl7.org/fhir/codesystem-restful-interaction.html
|
|
21
|
+
*/
|
|
22
|
+
export declare enum AccessPolicyInteraction {
|
|
23
|
+
READ = "read",
|
|
24
|
+
VREAD = "vread",
|
|
25
|
+
UPDATE = "update",
|
|
26
|
+
PATCH = "patch",
|
|
27
|
+
DELETE = "delete",
|
|
28
|
+
HISTORY = "history",
|
|
29
|
+
HISTORY_INSTANCE = "history-instance",
|
|
30
|
+
HISTORY_TYPE = "history-type",
|
|
31
|
+
HISTORY_SYSTEM = "history-system",
|
|
32
|
+
CREATE = "create",
|
|
33
|
+
SEARCH = "search",
|
|
34
|
+
SEARCH_TYPE = "search-type",
|
|
35
|
+
SEARCH_SYSTEM = "search-system",
|
|
36
|
+
SEARCH_COMPARTMENT = "search-compartment",
|
|
37
|
+
CAPABILITIES = "capabilities",
|
|
38
|
+
TRANSACTION = "transaction",
|
|
39
|
+
BATCH = "batch",
|
|
40
|
+
OPERATION = "operation"
|
|
41
|
+
}
|
|
17
42
|
/**
|
|
18
43
|
* Determines if the current user can read the specified resource type.
|
|
19
44
|
* @param accessPolicy The access policy.
|
|
@@ -44,5 +69,14 @@ export declare function canWriteResource(accessPolicy: AccessPolicy, resource: R
|
|
|
44
69
|
* @param resource The resource.
|
|
45
70
|
* @param readonlyMode True if the resource is being read.
|
|
46
71
|
* @returns True if the resource matches the access policy.
|
|
72
|
+
* @deprecated Use satisfiedAccessPolicy() instead.
|
|
47
73
|
*/
|
|
48
74
|
export declare function matchesAccessPolicy(accessPolicy: AccessPolicy, resource: Resource, readonlyMode: boolean): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Checks that there is an access policy permitting the given resource interaction, returning the matching policy object.
|
|
77
|
+
* @param resource The resource being acted upon.
|
|
78
|
+
* @param interaction The interaction being performed on the resource.
|
|
79
|
+
* @param accessPolicy The relevant access policy for the current user.
|
|
80
|
+
* @returns The satisfied access policy, or undefined if the access policy does not permit the given interaction.
|
|
81
|
+
*/
|
|
82
|
+
export declare function satisfiedAccessPolicy(resource: Resource, interaction: AccessPolicyInteraction, accessPolicy: AccessPolicy | undefined): AccessPolicyResource | undefined;
|
package/dist/types/config.d.ts
CHANGED