@medplum/mock 5.1.32 → 5.1.34
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.
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.cjs.map +3 -3
- package/dist/cjs/index.d.ts +18 -1
- package/dist/esm/index.d.ts +18 -1
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/index.mjs.map +3 -3
- package/package.json +5 -5
package/dist/cjs/index.d.ts
CHANGED
|
@@ -437,6 +437,16 @@ export declare interface MockClientOptions extends Pick<MedplumClientOptions, 'b
|
|
|
437
437
|
* Override the `MockFetchClient` used by this `MockClient`.
|
|
438
438
|
*/
|
|
439
439
|
readonly mockFetchOverride?: MockFetchOverrideOptions;
|
|
440
|
+
/**
|
|
441
|
+
* Whether to seed the mock repository with default example data (Homer Simpson, Dr. Alice Smith,
|
|
442
|
+
* the example message thread, `TestProject`, etc.) on first request. Defaults to `true`.
|
|
443
|
+
*
|
|
444
|
+
* Set to `false` to start with an empty repository, e.g. to avoid this example data colliding with
|
|
445
|
+
* a test's own fixtures. Note that `getProfile()`/`getProject()` still return their defaults
|
|
446
|
+
* (`DrAliceSmith`/`TestProject`) even when seeding is skipped, since those come from in-memory
|
|
447
|
+
* client state rather than the repository.
|
|
448
|
+
*/
|
|
449
|
+
readonly seedDefaultData?: boolean;
|
|
440
450
|
}
|
|
441
451
|
|
|
442
452
|
declare interface MockClientTestMethods {
|
|
@@ -459,9 +469,10 @@ export declare class MockFetchClient {
|
|
|
459
469
|
readonly repo: MemoryRepository;
|
|
460
470
|
readonly baseUrl: string;
|
|
461
471
|
readonly debug: boolean;
|
|
472
|
+
readonly seedDefaultData: boolean;
|
|
462
473
|
initialized: boolean;
|
|
463
474
|
initPromise?: Promise<void>;
|
|
464
|
-
constructor(router: FhirRouter, repo: MemoryRepository, baseUrl: string,
|
|
475
|
+
constructor(router: FhirRouter, repo: MemoryRepository, baseUrl: string, options?: MockFetchClientOptions);
|
|
465
476
|
mockFetch(url: string, options: any): Promise<Partial<Response>>;
|
|
466
477
|
mockCreatePdf(docDefinition: TDocumentDefinitions, tableLayouts?: {
|
|
467
478
|
[name: string]: CustomTableLayout;
|
|
@@ -476,9 +487,15 @@ export declare class MockFetchClient {
|
|
|
476
487
|
private mockResetPasswordHandler;
|
|
477
488
|
private mockOAuthHandler;
|
|
478
489
|
private initMockRepo;
|
|
490
|
+
private seedDefaultResources;
|
|
479
491
|
private mockFhirHandler;
|
|
480
492
|
}
|
|
481
493
|
|
|
494
|
+
declare interface MockFetchClientOptions {
|
|
495
|
+
debug?: boolean;
|
|
496
|
+
seedDefaultData?: boolean;
|
|
497
|
+
}
|
|
498
|
+
|
|
482
499
|
/**
|
|
483
500
|
* Override must contain all of `router`, `repo`, and `client`.
|
|
484
501
|
*/
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -437,6 +437,16 @@ export declare interface MockClientOptions extends Pick<MedplumClientOptions, 'b
|
|
|
437
437
|
* Override the `MockFetchClient` used by this `MockClient`.
|
|
438
438
|
*/
|
|
439
439
|
readonly mockFetchOverride?: MockFetchOverrideOptions;
|
|
440
|
+
/**
|
|
441
|
+
* Whether to seed the mock repository with default example data (Homer Simpson, Dr. Alice Smith,
|
|
442
|
+
* the example message thread, `TestProject`, etc.) on first request. Defaults to `true`.
|
|
443
|
+
*
|
|
444
|
+
* Set to `false` to start with an empty repository, e.g. to avoid this example data colliding with
|
|
445
|
+
* a test's own fixtures. Note that `getProfile()`/`getProject()` still return their defaults
|
|
446
|
+
* (`DrAliceSmith`/`TestProject`) even when seeding is skipped, since those come from in-memory
|
|
447
|
+
* client state rather than the repository.
|
|
448
|
+
*/
|
|
449
|
+
readonly seedDefaultData?: boolean;
|
|
440
450
|
}
|
|
441
451
|
|
|
442
452
|
declare interface MockClientTestMethods {
|
|
@@ -459,9 +469,10 @@ export declare class MockFetchClient {
|
|
|
459
469
|
readonly repo: MemoryRepository;
|
|
460
470
|
readonly baseUrl: string;
|
|
461
471
|
readonly debug: boolean;
|
|
472
|
+
readonly seedDefaultData: boolean;
|
|
462
473
|
initialized: boolean;
|
|
463
474
|
initPromise?: Promise<void>;
|
|
464
|
-
constructor(router: FhirRouter, repo: MemoryRepository, baseUrl: string,
|
|
475
|
+
constructor(router: FhirRouter, repo: MemoryRepository, baseUrl: string, options?: MockFetchClientOptions);
|
|
465
476
|
mockFetch(url: string, options: any): Promise<Partial<Response>>;
|
|
466
477
|
mockCreatePdf(docDefinition: TDocumentDefinitions, tableLayouts?: {
|
|
467
478
|
[name: string]: CustomTableLayout;
|
|
@@ -476,9 +487,15 @@ export declare class MockFetchClient {
|
|
|
476
487
|
private mockResetPasswordHandler;
|
|
477
488
|
private mockOAuthHandler;
|
|
478
489
|
private initMockRepo;
|
|
490
|
+
private seedDefaultResources;
|
|
479
491
|
private mockFhirHandler;
|
|
480
492
|
}
|
|
481
493
|
|
|
494
|
+
declare interface MockFetchClientOptions {
|
|
495
|
+
debug?: boolean;
|
|
496
|
+
seedDefaultData?: boolean;
|
|
497
|
+
}
|
|
498
|
+
|
|
482
499
|
/**
|
|
483
500
|
* Override must contain all of `router`, `repo`, and `client`.
|
|
484
501
|
*/
|