@medplum/core 3.2.7 → 3.2.8

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.
@@ -2707,6 +2707,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
2707
2707
  private readonly onUnauthenticated?;
2708
2708
  private readonly autoBatchTime;
2709
2709
  private readonly autoBatchQueue;
2710
+ private readonly refreshGracePeriod;
2710
2711
  private subscriptionManager?;
2711
2712
  private medplumServer?;
2712
2713
  private clientId?;
@@ -3955,9 +3956,10 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
3955
3956
  processCode(code: string, loginParams?: Partial<BaseLoginRequest>): Promise<ProfileResource>;
3956
3957
  /**
3957
3958
  * Refreshes the access token using the refresh token if available.
3959
+ * @param gracePeriod - Optional grace period in milliseconds. If not specified, uses the client configured grace period (default 5 minutes).
3958
3960
  * @returns Promise to refresh the access token.
3959
3961
  */
3960
- refreshIfExpired(): Promise<void>;
3962
+ refreshIfExpired(gracePeriod?: number): Promise<void>;
3961
3963
  /**
3962
3964
  * Tries to refresh the auth tokens.
3963
3965
  * @returns The refresh promise if available; otherwise undefined.
@@ -4295,6 +4297,14 @@ export declare interface MedplumClientOptions {
4295
4297
  * Default value is 0, which disables auto batching.
4296
4298
  */
4297
4299
  autoBatchTime?: number;
4300
+ /**
4301
+ * The refresh grace period in milliseconds.
4302
+ *
4303
+ * This is the amount of time before the access token expires that the client will attempt to refresh the token.
4304
+ *
4305
+ * Default value is 300000 (5 minutes).
4306
+ */
4307
+ refreshGracePeriod?: number;
4298
4308
  /**
4299
4309
  * Fetch implementation.
4300
4310
  *
@@ -5694,8 +5704,9 @@ export declare class SubscriptionManager {
5694
5704
  private pingTimer;
5695
5705
  private pingIntervalMs;
5696
5706
  private waitingForPong;
5707
+ private currentProfile;
5697
5708
  constructor(medplum: MedplumClient, wsUrl: URL | string, options?: SubManagerOptions);
5698
- private setupWebSocketListeners;
5709
+ private setupListeners;
5699
5710
  private emitError;
5700
5711
  private maybeEmitDisconnect;
5701
5712
  private getTokenForCriteria;
@@ -2707,6 +2707,7 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
2707
2707
  private readonly onUnauthenticated?;
2708
2708
  private readonly autoBatchTime;
2709
2709
  private readonly autoBatchQueue;
2710
+ private readonly refreshGracePeriod;
2710
2711
  private subscriptionManager?;
2711
2712
  private medplumServer?;
2712
2713
  private clientId?;
@@ -3955,9 +3956,10 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
3955
3956
  processCode(code: string, loginParams?: Partial<BaseLoginRequest>): Promise<ProfileResource>;
3956
3957
  /**
3957
3958
  * Refreshes the access token using the refresh token if available.
3959
+ * @param gracePeriod - Optional grace period in milliseconds. If not specified, uses the client configured grace period (default 5 minutes).
3958
3960
  * @returns Promise to refresh the access token.
3959
3961
  */
3960
- refreshIfExpired(): Promise<void>;
3962
+ refreshIfExpired(gracePeriod?: number): Promise<void>;
3961
3963
  /**
3962
3964
  * Tries to refresh the auth tokens.
3963
3965
  * @returns The refresh promise if available; otherwise undefined.
@@ -4295,6 +4297,14 @@ export declare interface MedplumClientOptions {
4295
4297
  * Default value is 0, which disables auto batching.
4296
4298
  */
4297
4299
  autoBatchTime?: number;
4300
+ /**
4301
+ * The refresh grace period in milliseconds.
4302
+ *
4303
+ * This is the amount of time before the access token expires that the client will attempt to refresh the token.
4304
+ *
4305
+ * Default value is 300000 (5 minutes).
4306
+ */
4307
+ refreshGracePeriod?: number;
4298
4308
  /**
4299
4309
  * Fetch implementation.
4300
4310
  *
@@ -5694,8 +5704,9 @@ export declare class SubscriptionManager {
5694
5704
  private pingTimer;
5695
5705
  private pingIntervalMs;
5696
5706
  private waitingForPong;
5707
+ private currentProfile;
5697
5708
  constructor(medplum: MedplumClient, wsUrl: URL | string, options?: SubManagerOptions);
5698
- private setupWebSocketListeners;
5709
+ private setupListeners;
5699
5710
  private emitError;
5700
5711
  private maybeEmitDisconnect;
5701
5712
  private getTokenForCriteria;