@medplum/core 5.1.10 → 5.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.
@@ -4999,10 +4999,27 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
4999
4999
  refreshIfExpired(gracePeriod?: number): Promise<void>;
5000
5000
  /**
5001
5001
  * Tries to refresh the auth tokens.
5002
+ *
5003
+ * When `navigator.locks` is available, the network call is wrapped in a Web Lock
5004
+ * scoped to this client's storage namespace. This serializes refresh attempts across
5005
+ * browser tabs/windows on the same origin so a single-use refresh token is not
5006
+ * consumed by more than one tab. Tabs that wait on the lock re-read the latest
5007
+ * tokens from storage when they acquire it and skip the network call if another tab
5008
+ * has already refreshed.
5009
+ *
5010
+ * @param gracePeriod - Optional grace period in milliseconds threaded through to the post-lock authentication check.
5002
5011
  * @returns The refresh promise if available; otherwise undefined.
5003
5012
  * @see https://openid.net/specs/openid-connect-core-1_0.html#RefreshTokens
5004
5013
  */
5005
5014
  private refresh;
5015
+ /**
5016
+ * Acquires a cross-tab Web Lock (when available) and performs the token refresh.
5017
+ * Tabs that wait on the lock check storage on acquisition and skip the network call
5018
+ * if a peer tab has already produced a fresh access token.
5019
+ * @param gracePeriod - Optional grace period in milliseconds used by the post-lock authentication check to decide whether the current token still has enough life left to skip the network refresh.
5020
+ * @returns Promise that resolves when the refresh (or short-circuit) is complete.
5021
+ */
5022
+ private runRefreshWithLock;
5006
5023
  /**
5007
5024
  * Starts a new OAuth2 client credentials flow.
5008
5025
  *
@@ -4999,10 +4999,27 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
4999
4999
  refreshIfExpired(gracePeriod?: number): Promise<void>;
5000
5000
  /**
5001
5001
  * Tries to refresh the auth tokens.
5002
+ *
5003
+ * When `navigator.locks` is available, the network call is wrapped in a Web Lock
5004
+ * scoped to this client's storage namespace. This serializes refresh attempts across
5005
+ * browser tabs/windows on the same origin so a single-use refresh token is not
5006
+ * consumed by more than one tab. Tabs that wait on the lock re-read the latest
5007
+ * tokens from storage when they acquire it and skip the network call if another tab
5008
+ * has already refreshed.
5009
+ *
5010
+ * @param gracePeriod - Optional grace period in milliseconds threaded through to the post-lock authentication check.
5002
5011
  * @returns The refresh promise if available; otherwise undefined.
5003
5012
  * @see https://openid.net/specs/openid-connect-core-1_0.html#RefreshTokens
5004
5013
  */
5005
5014
  private refresh;
5015
+ /**
5016
+ * Acquires a cross-tab Web Lock (when available) and performs the token refresh.
5017
+ * Tabs that wait on the lock check storage on acquisition and skip the network call
5018
+ * if a peer tab has already produced a fresh access token.
5019
+ * @param gracePeriod - Optional grace period in milliseconds used by the post-lock authentication check to decide whether the current token still has enough life left to skip the network refresh.
5020
+ * @returns Promise that resolves when the refresh (or short-circuit) is complete.
5021
+ */
5022
+ private runRefreshWithLock;
5006
5023
  /**
5007
5024
  * Starts a new OAuth2 client credentials flow.
5008
5025
  *