@medplum/core 4.1.9 → 4.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.
@@ -72,25 +72,25 @@ export declare const AccessPolicyInteraction: {
72
72
  readonly READ: "read";
73
73
  readonly VREAD: "vread";
74
74
  readonly UPDATE: "update";
75
- readonly PATCH: "patch";
76
75
  readonly DELETE: "delete";
77
76
  readonly HISTORY: "history";
78
- readonly HISTORY_INSTANCE: "history-instance";
79
- readonly HISTORY_TYPE: "history-type";
80
- readonly HISTORY_SYSTEM: "history-system";
81
77
  readonly CREATE: "create";
82
78
  readonly SEARCH: "search";
83
- readonly SEARCH_TYPE: "search-type";
84
- readonly SEARCH_SYSTEM: "search-system";
85
- readonly SEARCH_COMPARTMENT: "search-compartment";
86
- readonly CAPABILITIES: "capabilities";
87
- readonly TRANSACTION: "transaction";
88
- readonly BATCH: "batch";
89
- readonly OPERATION: "operation";
90
79
  };
91
80
 
92
81
  export declare type AccessPolicyInteraction = (typeof AccessPolicyInteraction)[keyof typeof AccessPolicyInteraction];
93
82
 
83
+ /**
84
+ * Shallow check that an interaction is permitted by the AccessPolicy on a given resource type,
85
+ * at least for some resources. A more in-depth check for the specific resource(s) being accessed
86
+ * is required in addition to this one.
87
+ * @param accessPolicy - The AccessPolicy to check against.
88
+ * @param interaction - The FHIR interaction being performed.
89
+ * @param resourceType - The type of resource being interacted with.
90
+ * @returns True when the interaction is provisionally permitted by the AccessPolicy.
91
+ */
92
+ export declare function accessPolicySupportsInteraction(accessPolicy: AccessPolicy, interaction: AccessPolicyInteraction, resourceType: ResourceType): boolean;
93
+
94
94
  export declare const AckCode: {
95
95
  /** AA - Application Accept */
96
96
  readonly AA: "AA";
@@ -406,6 +406,7 @@ export declare type CanBePopulated = {
406
406
  * @param accessPolicy - The access policy.
407
407
  * @param resourceType - The resource type.
408
408
  * @returns True if the current user can read the specified resource type.
409
+ * @deprecated Use accessPolicySupportsInteraction() instead.
409
410
  */
410
411
  export declare function canReadResourceType(accessPolicy: AccessPolicy, resourceType: ResourceType): boolean;
411
412
 
@@ -415,6 +416,7 @@ export declare function canReadResourceType(accessPolicy: AccessPolicy, resource
415
416
  * @param accessPolicy - The access policy.
416
417
  * @param resource - The resource.
417
418
  * @returns True if the current user can write the specified resource type.
419
+ * @deprecated Use satisfiedAccessPolicy() instead.
418
420
  */
419
421
  export declare function canWriteResource(accessPolicy: AccessPolicy, resource: Resource): boolean;
420
422
 
@@ -425,6 +427,7 @@ export declare function canWriteResource(accessPolicy: AccessPolicy, resource: R
425
427
  * @param accessPolicy - The access policy.
426
428
  * @param resourceType - The resource type.
427
429
  * @returns True if the current user can write the specified resource type.
430
+ * @deprecated Use accessPolicySupportsInteraction() instead.
428
431
  */
429
432
  export declare function canWriteResourceType(accessPolicy: AccessPolicy, resourceType: ResourceType): boolean;
430
433
 
@@ -555,6 +558,7 @@ export declare const ContentType: {
555
558
  readonly JAVASCRIPT: "text/javascript";
556
559
  readonly JSON: "application/json";
557
560
  readonly JSON_PATCH: "application/json-patch+json";
561
+ readonly JWT: "application/jwt";
558
562
  readonly MULTIPART_FORM_DATA: "multipart/form-data";
559
563
  readonly PNG: "image/png";
560
564
  readonly SCIM_JSON: "application/scim+json";
@@ -728,6 +732,15 @@ export declare type CurrentContext<T extends FhircastAnchorResourceType | '' = F
728
732
  context: FhircastEventContext<AnchorResourceOpenEvent<T>>[];
729
733
  } : never;
730
734
 
735
+ export declare interface DataSampleOptions {
736
+ /** Code for the data points. */
737
+ code?: CodeableConcept;
738
+ /** Unit for the data points. */
739
+ unit?: QuantityUnit;
740
+ /** Sampling information for high-frequency Observations. */
741
+ sampling?: Omit<SampledData, 'data'>;
742
+ }
743
+
731
744
  export declare class DataSampler {
732
745
  private code?;
733
746
  private unit?;
@@ -735,15 +748,8 @@ export declare class DataSampler {
735
748
  private readonly dataPoints;
736
749
  /**
737
750
  * @param opts - Optional parameters.
738
- * @param opts.code - Code for data points.
739
- * @param opts.unit - Unit for data points.
740
- * @param opts.sampling - Sampling information for high-frequency Observations.
741
- */
742
- constructor(opts?: {
743
- code?: CodeableConcept;
744
- unit?: QuantityUnit;
745
- sampling?: SamplingInfo;
746
- });
751
+ */
752
+ constructor(opts?: DataSampleOptions);
747
753
  addObservation(obs: Observation): void;
748
754
  addData(...data: number[]): void;
749
755
  private checkUnit;
@@ -2465,6 +2471,15 @@ export declare function isDateTimeString(input: unknown): input is string;
2465
2471
  */
2466
2472
  export declare function isEmpty(v: unknown): boolean;
2467
2473
 
2474
+ /**
2475
+ * Returns true if the input is an Error object.
2476
+ * This should be replaced with `Error.isError` when it is more widely supported.
2477
+ * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/isError
2478
+ * @param value - The candidate value.
2479
+ * @returns True if the input is an Error object.
2480
+ */
2481
+ export declare function isError(value: unknown): value is Error;
2482
+
2468
2483
  /**
2469
2484
  * Checks if a `ResourceType` can be used in a `FHIRcast` context.
2470
2485
  *
@@ -5702,6 +5717,8 @@ export declare class ReadablePromise<T> implements Promise<T> {
5702
5717
  finally(onfinally?: (() => void) | null): Promise<T>;
5703
5718
  }
5704
5719
 
5720
+ export declare const readInteractions: AccessPolicyInteraction[];
5721
+
5705
5722
  export declare class ReconnectingWebSocket<WS extends IWebSocket = WebSocket> extends TypedEventTarget<WebSocketEventMap_2> implements IReconnectingWebSocket {
5706
5723
  private _ws;
5707
5724
  private _retryCount;
@@ -72,25 +72,25 @@ export declare const AccessPolicyInteraction: {
72
72
  readonly READ: "read";
73
73
  readonly VREAD: "vread";
74
74
  readonly UPDATE: "update";
75
- readonly PATCH: "patch";
76
75
  readonly DELETE: "delete";
77
76
  readonly HISTORY: "history";
78
- readonly HISTORY_INSTANCE: "history-instance";
79
- readonly HISTORY_TYPE: "history-type";
80
- readonly HISTORY_SYSTEM: "history-system";
81
77
  readonly CREATE: "create";
82
78
  readonly SEARCH: "search";
83
- readonly SEARCH_TYPE: "search-type";
84
- readonly SEARCH_SYSTEM: "search-system";
85
- readonly SEARCH_COMPARTMENT: "search-compartment";
86
- readonly CAPABILITIES: "capabilities";
87
- readonly TRANSACTION: "transaction";
88
- readonly BATCH: "batch";
89
- readonly OPERATION: "operation";
90
79
  };
91
80
 
92
81
  export declare type AccessPolicyInteraction = (typeof AccessPolicyInteraction)[keyof typeof AccessPolicyInteraction];
93
82
 
83
+ /**
84
+ * Shallow check that an interaction is permitted by the AccessPolicy on a given resource type,
85
+ * at least for some resources. A more in-depth check for the specific resource(s) being accessed
86
+ * is required in addition to this one.
87
+ * @param accessPolicy - The AccessPolicy to check against.
88
+ * @param interaction - The FHIR interaction being performed.
89
+ * @param resourceType - The type of resource being interacted with.
90
+ * @returns True when the interaction is provisionally permitted by the AccessPolicy.
91
+ */
92
+ export declare function accessPolicySupportsInteraction(accessPolicy: AccessPolicy, interaction: AccessPolicyInteraction, resourceType: ResourceType): boolean;
93
+
94
94
  export declare const AckCode: {
95
95
  /** AA - Application Accept */
96
96
  readonly AA: "AA";
@@ -406,6 +406,7 @@ export declare type CanBePopulated = {
406
406
  * @param accessPolicy - The access policy.
407
407
  * @param resourceType - The resource type.
408
408
  * @returns True if the current user can read the specified resource type.
409
+ * @deprecated Use accessPolicySupportsInteraction() instead.
409
410
  */
410
411
  export declare function canReadResourceType(accessPolicy: AccessPolicy, resourceType: ResourceType): boolean;
411
412
 
@@ -415,6 +416,7 @@ export declare function canReadResourceType(accessPolicy: AccessPolicy, resource
415
416
  * @param accessPolicy - The access policy.
416
417
  * @param resource - The resource.
417
418
  * @returns True if the current user can write the specified resource type.
419
+ * @deprecated Use satisfiedAccessPolicy() instead.
418
420
  */
419
421
  export declare function canWriteResource(accessPolicy: AccessPolicy, resource: Resource): boolean;
420
422
 
@@ -425,6 +427,7 @@ export declare function canWriteResource(accessPolicy: AccessPolicy, resource: R
425
427
  * @param accessPolicy - The access policy.
426
428
  * @param resourceType - The resource type.
427
429
  * @returns True if the current user can write the specified resource type.
430
+ * @deprecated Use accessPolicySupportsInteraction() instead.
428
431
  */
429
432
  export declare function canWriteResourceType(accessPolicy: AccessPolicy, resourceType: ResourceType): boolean;
430
433
 
@@ -555,6 +558,7 @@ export declare const ContentType: {
555
558
  readonly JAVASCRIPT: "text/javascript";
556
559
  readonly JSON: "application/json";
557
560
  readonly JSON_PATCH: "application/json-patch+json";
561
+ readonly JWT: "application/jwt";
558
562
  readonly MULTIPART_FORM_DATA: "multipart/form-data";
559
563
  readonly PNG: "image/png";
560
564
  readonly SCIM_JSON: "application/scim+json";
@@ -728,6 +732,15 @@ export declare type CurrentContext<T extends FhircastAnchorResourceType | '' = F
728
732
  context: FhircastEventContext<AnchorResourceOpenEvent<T>>[];
729
733
  } : never;
730
734
 
735
+ export declare interface DataSampleOptions {
736
+ /** Code for the data points. */
737
+ code?: CodeableConcept;
738
+ /** Unit for the data points. */
739
+ unit?: QuantityUnit;
740
+ /** Sampling information for high-frequency Observations. */
741
+ sampling?: Omit<SampledData, 'data'>;
742
+ }
743
+
731
744
  export declare class DataSampler {
732
745
  private code?;
733
746
  private unit?;
@@ -735,15 +748,8 @@ export declare class DataSampler {
735
748
  private readonly dataPoints;
736
749
  /**
737
750
  * @param opts - Optional parameters.
738
- * @param opts.code - Code for data points.
739
- * @param opts.unit - Unit for data points.
740
- * @param opts.sampling - Sampling information for high-frequency Observations.
741
- */
742
- constructor(opts?: {
743
- code?: CodeableConcept;
744
- unit?: QuantityUnit;
745
- sampling?: SamplingInfo;
746
- });
751
+ */
752
+ constructor(opts?: DataSampleOptions);
747
753
  addObservation(obs: Observation): void;
748
754
  addData(...data: number[]): void;
749
755
  private checkUnit;
@@ -2465,6 +2471,15 @@ export declare function isDateTimeString(input: unknown): input is string;
2465
2471
  */
2466
2472
  export declare function isEmpty(v: unknown): boolean;
2467
2473
 
2474
+ /**
2475
+ * Returns true if the input is an Error object.
2476
+ * This should be replaced with `Error.isError` when it is more widely supported.
2477
+ * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/isError
2478
+ * @param value - The candidate value.
2479
+ * @returns True if the input is an Error object.
2480
+ */
2481
+ export declare function isError(value: unknown): value is Error;
2482
+
2468
2483
  /**
2469
2484
  * Checks if a `ResourceType` can be used in a `FHIRcast` context.
2470
2485
  *
@@ -5702,6 +5717,8 @@ export declare class ReadablePromise<T> implements Promise<T> {
5702
5717
  finally(onfinally?: (() => void) | null): Promise<T>;
5703
5718
  }
5704
5719
 
5720
+ export declare const readInteractions: AccessPolicyInteraction[];
5721
+
5705
5722
  export declare class ReconnectingWebSocket<WS extends IWebSocket = WebSocket> extends TypedEventTarget<WebSocketEventMap_2> implements IReconnectingWebSocket {
5706
5723
  private _ws;
5707
5724
  private _retryCount;