@medplum/core 3.2.7 → 3.2.9

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.
@@ -713,6 +713,7 @@ export declare type DataTypesMap = {
713
713
  /**
714
714
  * Decodes a base64 string.
715
715
  * Handles both browser and Node environments.
716
+ * Supports Unicode characters.
716
717
  * @param data - The base-64 encoded input string.
717
718
  * @returns The decoded string.
718
719
  */
@@ -828,6 +829,7 @@ export declare class EmptySetAtom implements Atom {
828
829
  /**
829
830
  * Encodes a base64 string.
830
831
  * Handles both browser and Node environments.
832
+ * Supports Unicode characters.
831
833
  * @param data - The unencoded input string.
832
834
  * @returns The base-64 encoded string.
833
835
  */
@@ -2368,6 +2370,8 @@ export declare function isTextObject(value: unknown): value is {
2368
2370
  text: string;
2369
2371
  };
2370
2372
 
2373
+ export declare function isUnauthenticated(outcome: OperationOutcome): boolean;
2374
+
2371
2375
  /**
2372
2376
  * Returns true if the input string is a UUID.
2373
2377
  * @param input - The input string.
@@ -2546,7 +2550,7 @@ export declare interface MailAddress {
2546
2550
  * Compatible with nodemailer Mail.Options.
2547
2551
  */
2548
2552
  export declare interface MailAttachment {
2549
- /** String, Buffer or a Stream contents for the attachmentent */
2553
+ /** String, Buffer or a Stream contents for the attachment */
2550
2554
  readonly content?: string;
2551
2555
  /** path to a file or an URL (data uris are allowed as well) if you want to stream the file instead of including it (better for larger attachments) */
2552
2556
  readonly path?: string;
@@ -2707,6 +2711,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
2707
2711
  private readonly onUnauthenticated?;
2708
2712
  private readonly autoBatchTime;
2709
2713
  private readonly autoBatchQueue;
2714
+ private readonly refreshGracePeriod;
2710
2715
  private subscriptionManager?;
2711
2716
  private medplumServer?;
2712
2717
  private clientId?;
@@ -3440,7 +3445,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
3440
3445
  /**
3441
3446
  * Creates a FHIR `Communication` resource with the provided data content.
3442
3447
  *
3443
- * This is a convenience method to handle commmon cases where a `Communication` resource is created with a `payload`.
3448
+ * This is a convenience method to handle common cases where a `Communication` resource is created with a `payload`.
3444
3449
  * @category Create
3445
3450
  * @param resource - The FHIR resource to comment on.
3446
3451
  * @param text - The text of the comment.
@@ -3955,9 +3960,10 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
3955
3960
  processCode(code: string, loginParams?: Partial<BaseLoginRequest>): Promise<ProfileResource>;
3956
3961
  /**
3957
3962
  * Refreshes the access token using the refresh token if available.
3963
+ * @param gracePeriod - Optional grace period in milliseconds. If not specified, uses the client configured grace period (default 5 minutes).
3958
3964
  * @returns Promise to refresh the access token.
3959
3965
  */
3960
- refreshIfExpired(): Promise<void>;
3966
+ refreshIfExpired(gracePeriod?: number): Promise<void>;
3961
3967
  /**
3962
3968
  * Tries to refresh the auth tokens.
3963
3969
  * @returns The refresh promise if available; otherwise undefined.
@@ -4295,6 +4301,14 @@ export declare interface MedplumClientOptions {
4295
4301
  * Default value is 0, which disables auto batching.
4296
4302
  */
4297
4303
  autoBatchTime?: number;
4304
+ /**
4305
+ * The refresh grace period in milliseconds.
4306
+ *
4307
+ * This is the amount of time before the access token expires that the client will attempt to refresh the token.
4308
+ *
4309
+ * Default value is 300000 (5 minutes).
4310
+ */
4311
+ refreshGracePeriod?: number;
4298
4312
  /**
4299
4313
  * Fetch implementation.
4300
4314
  *
@@ -4404,7 +4418,7 @@ export declare interface MedplumInfraConfig {
4404
4418
  rdsInstances: number;
4405
4419
  rdsInstanceType: string;
4406
4420
  rdsInstanceVersion?: string;
4407
- rdsInstanceParameters?: StringMap;
4421
+ rdsClusterParameters?: StringMap;
4408
4422
  rdsSecretsArn?: string;
4409
4423
  rdsReaderInstanceType?: string;
4410
4424
  rdsProxyEnabled?: boolean;
@@ -5694,8 +5708,9 @@ export declare class SubscriptionManager {
5694
5708
  private pingTimer;
5695
5709
  private pingIntervalMs;
5696
5710
  private waitingForPong;
5711
+ private currentProfile;
5697
5712
  constructor(medplum: MedplumClient, wsUrl: URL | string, options?: SubManagerOptions);
5698
- private setupWebSocketListeners;
5713
+ private setupListeners;
5699
5714
  private emitError;
5700
5715
  private maybeEmitDisconnect;
5701
5716
  private getTokenForCriteria;
@@ -5890,6 +5905,10 @@ export declare class UnaryOperatorAtom extends PrefixOperatorAtom {
5890
5905
 
5891
5906
  export declare const unauthorized: OperationOutcome;
5892
5907
 
5908
+ export declare const unauthorizedTokenAudience: OperationOutcome;
5909
+
5910
+ export declare const unauthorizedTokenExpired: OperationOutcome;
5911
+
5893
5912
  export declare class UnionAtom extends InfixOperatorAtom {
5894
5913
  constructor(left: Atom, right: Atom);
5895
5914
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
@@ -713,6 +713,7 @@ export declare type DataTypesMap = {
713
713
  /**
714
714
  * Decodes a base64 string.
715
715
  * Handles both browser and Node environments.
716
+ * Supports Unicode characters.
716
717
  * @param data - The base-64 encoded input string.
717
718
  * @returns The decoded string.
718
719
  */
@@ -828,6 +829,7 @@ export declare class EmptySetAtom implements Atom {
828
829
  /**
829
830
  * Encodes a base64 string.
830
831
  * Handles both browser and Node environments.
832
+ * Supports Unicode characters.
831
833
  * @param data - The unencoded input string.
832
834
  * @returns The base-64 encoded string.
833
835
  */
@@ -2368,6 +2370,8 @@ export declare function isTextObject(value: unknown): value is {
2368
2370
  text: string;
2369
2371
  };
2370
2372
 
2373
+ export declare function isUnauthenticated(outcome: OperationOutcome): boolean;
2374
+
2371
2375
  /**
2372
2376
  * Returns true if the input string is a UUID.
2373
2377
  * @param input - The input string.
@@ -2546,7 +2550,7 @@ export declare interface MailAddress {
2546
2550
  * Compatible with nodemailer Mail.Options.
2547
2551
  */
2548
2552
  export declare interface MailAttachment {
2549
- /** String, Buffer or a Stream contents for the attachmentent */
2553
+ /** String, Buffer or a Stream contents for the attachment */
2550
2554
  readonly content?: string;
2551
2555
  /** path to a file or an URL (data uris are allowed as well) if you want to stream the file instead of including it (better for larger attachments) */
2552
2556
  readonly path?: string;
@@ -2707,6 +2711,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
2707
2711
  private readonly onUnauthenticated?;
2708
2712
  private readonly autoBatchTime;
2709
2713
  private readonly autoBatchQueue;
2714
+ private readonly refreshGracePeriod;
2710
2715
  private subscriptionManager?;
2711
2716
  private medplumServer?;
2712
2717
  private clientId?;
@@ -3440,7 +3445,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
3440
3445
  /**
3441
3446
  * Creates a FHIR `Communication` resource with the provided data content.
3442
3447
  *
3443
- * This is a convenience method to handle commmon cases where a `Communication` resource is created with a `payload`.
3448
+ * This is a convenience method to handle common cases where a `Communication` resource is created with a `payload`.
3444
3449
  * @category Create
3445
3450
  * @param resource - The FHIR resource to comment on.
3446
3451
  * @param text - The text of the comment.
@@ -3955,9 +3960,10 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
3955
3960
  processCode(code: string, loginParams?: Partial<BaseLoginRequest>): Promise<ProfileResource>;
3956
3961
  /**
3957
3962
  * Refreshes the access token using the refresh token if available.
3963
+ * @param gracePeriod - Optional grace period in milliseconds. If not specified, uses the client configured grace period (default 5 minutes).
3958
3964
  * @returns Promise to refresh the access token.
3959
3965
  */
3960
- refreshIfExpired(): Promise<void>;
3966
+ refreshIfExpired(gracePeriod?: number): Promise<void>;
3961
3967
  /**
3962
3968
  * Tries to refresh the auth tokens.
3963
3969
  * @returns The refresh promise if available; otherwise undefined.
@@ -4295,6 +4301,14 @@ export declare interface MedplumClientOptions {
4295
4301
  * Default value is 0, which disables auto batching.
4296
4302
  */
4297
4303
  autoBatchTime?: number;
4304
+ /**
4305
+ * The refresh grace period in milliseconds.
4306
+ *
4307
+ * This is the amount of time before the access token expires that the client will attempt to refresh the token.
4308
+ *
4309
+ * Default value is 300000 (5 minutes).
4310
+ */
4311
+ refreshGracePeriod?: number;
4298
4312
  /**
4299
4313
  * Fetch implementation.
4300
4314
  *
@@ -4404,7 +4418,7 @@ export declare interface MedplumInfraConfig {
4404
4418
  rdsInstances: number;
4405
4419
  rdsInstanceType: string;
4406
4420
  rdsInstanceVersion?: string;
4407
- rdsInstanceParameters?: StringMap;
4421
+ rdsClusterParameters?: StringMap;
4408
4422
  rdsSecretsArn?: string;
4409
4423
  rdsReaderInstanceType?: string;
4410
4424
  rdsProxyEnabled?: boolean;
@@ -5694,8 +5708,9 @@ export declare class SubscriptionManager {
5694
5708
  private pingTimer;
5695
5709
  private pingIntervalMs;
5696
5710
  private waitingForPong;
5711
+ private currentProfile;
5697
5712
  constructor(medplum: MedplumClient, wsUrl: URL | string, options?: SubManagerOptions);
5698
- private setupWebSocketListeners;
5713
+ private setupListeners;
5699
5714
  private emitError;
5700
5715
  private maybeEmitDisconnect;
5701
5716
  private getTokenForCriteria;
@@ -5890,6 +5905,10 @@ export declare class UnaryOperatorAtom extends PrefixOperatorAtom {
5890
5905
 
5891
5906
  export declare const unauthorized: OperationOutcome;
5892
5907
 
5908
+ export declare const unauthorizedTokenAudience: OperationOutcome;
5909
+
5910
+ export declare const unauthorizedTokenExpired: OperationOutcome;
5911
+
5893
5912
  export declare class UnionAtom extends InfixOperatorAtom {
5894
5913
  constructor(left: Atom, right: Atom);
5895
5914
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];