@medplum/core 2.1.14 → 2.1.16

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.
@@ -258,9 +258,9 @@ export declare function checkForNull(value: unknown, path: string, issues: Opera
258
258
  *
259
259
  * When Using MedplumClient in the server, it will be backed by the MemoryStorage class. For example, the Medplum CLI uses `FileSystemStorage`.
260
260
  */
261
- export declare class ClientStorage {
261
+ export declare class ClientStorage implements IClientStorage {
262
262
  private readonly storage;
263
- constructor();
263
+ constructor(storage?: Storage);
264
264
  clear(): void;
265
265
  getString(key: string): string | undefined;
266
266
  setString(key: string, value: string | undefined): void;
@@ -1491,6 +1491,15 @@ export declare interface HumanNameFormatOptions {
1491
1491
 
1492
1492
  export declare const ICD10 = "http://hl7.org/fhir/sid/icd-10";
1493
1493
 
1494
+ export declare interface IClientStorage {
1495
+ getInitPromise?(): Promise<void>;
1496
+ clear(): void;
1497
+ getString(key: string): string | undefined;
1498
+ setString(key: string, value: string | undefined): void;
1499
+ getObject<T>(key: string): T | undefined;
1500
+ setObject<T>(key: string, value: T): void;
1501
+ }
1502
+
1494
1503
  /**
1495
1504
  * 6.5.5. implies
1496
1505
  * Returns true if left is true and right is true,
@@ -2022,7 +2031,19 @@ export declare class MedplumClient extends EventTarget_2 {
2022
2031
  private profilePromise?;
2023
2032
  private sessionDetails?;
2024
2033
  private basicAuth?;
2034
+ private initPromise;
2035
+ private initComplete;
2025
2036
  constructor(options?: MedplumClientOptions);
2037
+ /**
2038
+ * @returns Whether the client has been fully initialized or not. Should always be true unless a custom asynchronous `ClientStorage` was passed into the constructor.
2039
+ */
2040
+ get isInitialized(): boolean;
2041
+ /**
2042
+ * Gets a Promise that resolves when async initialization is complete. This is particularly useful for waiting for an async `ClientStorage` and/or authentication to finish.
2043
+ * @returns A Promise that resolves when any async initialization of the client is finished.
2044
+ */
2045
+ getInitPromise(): Promise<void>;
2046
+ private attemptResumeActiveLogin;
2026
2047
  /**
2027
2048
  * Returns the current base URL for all API requests.
2028
2049
  * By default, this is set to `https://api.medplum.com/`.
@@ -3421,7 +3442,7 @@ export declare interface MedplumClientOptions {
3421
3442
  *
3422
3443
  * Default is window.localStorage (if available), this is the common implementation for use in the browser, or an in-memory storage implementation. If using Medplum on a server it may be useful to provide a custom storage implementation, for example using redis, a database or a file based storage. Medplum CLI is an an example of `FileSystemStorage`, for reference.
3423
3444
  */
3424
- storage?: ClientStorage;
3445
+ storage?: IClientStorage;
3425
3446
  /**
3426
3447
  * Create PDF implementation.
3427
3448
  *
@@ -3513,6 +3534,7 @@ export declare interface MedplumInfraConfig {
3513
3534
  maxAzs: number;
3514
3535
  rdsInstances: number;
3515
3536
  rdsInstanceType: string;
3537
+ rdsInstanceVersion?: string;
3516
3538
  rdsSecretsArn?: string;
3517
3539
  cacheNodeType?: string;
3518
3540
  desiredServerCount: number;
@@ -3571,6 +3593,7 @@ export declare interface MedplumSourceInfraConfig {
3571
3593
  maxAzs: ValueOrExternalSecret<number>;
3572
3594
  rdsInstances: ValueOrExternalSecret<number>;
3573
3595
  rdsInstanceType: ValueOrExternalSecret<string>;
3596
+ rdsInstanceVersion: ValueOrExternalSecret<string>;
3574
3597
  rdsSecretsArn?: ValueOrExternalSecret<string>;
3575
3598
  cacheNodeType?: ValueOrExternalSecret<string>;
3576
3599
  desiredServerCount: ValueOrExternalSecret<number>;