@medplum/mock 3.1.10 → 3.2.0
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 +3 -3
- package/dist/cjs/index.cjs.map +3 -3
- package/dist/cjs/index.d.ts +14 -3
- package/dist/esm/index.d.ts +14 -3
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/index.mjs.map +3 -3
- package/package.json +5 -5
package/dist/cjs/index.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ import { DiagnosticReport } from '@medplum/fhirtypes';
|
|
|
13
13
|
import { Encounter } from '@medplum/fhirtypes';
|
|
14
14
|
import { FhirRouter } from '@medplum/fhir-router';
|
|
15
15
|
import { Group } from '@medplum/fhirtypes';
|
|
16
|
-
import { IClientStorage } from '@medplum/core';
|
|
17
16
|
import { LoginState } from '@medplum/core';
|
|
18
17
|
import { Media } from '@medplum/fhirtypes';
|
|
19
18
|
import { MedplumClient } from '@medplum/core';
|
|
@@ -277,14 +276,17 @@ export declare class MockClient extends MedplumClient {
|
|
|
277
276
|
getMasterSubscriptionEmitter(): SubscriptionEmitter;
|
|
278
277
|
}
|
|
279
278
|
|
|
280
|
-
export declare interface MockClientOptions extends MedplumClientOptions {
|
|
279
|
+
export declare interface MockClientOptions extends Pick<MedplumClientOptions, 'baseUrl' | 'clientId' | 'storage' | 'cacheTime'> {
|
|
281
280
|
readonly debug?: boolean;
|
|
282
281
|
/**
|
|
283
282
|
* Override currently logged in user. Specifying null results in
|
|
284
283
|
* MedplumContext.profile returning undefined as if no one were logged in.
|
|
285
284
|
*/
|
|
286
285
|
readonly profile?: ReturnType<MedplumClient['getProfile']> | null;
|
|
287
|
-
|
|
286
|
+
/**
|
|
287
|
+
* Override the `MockFetchClient` used by this `MockClient`.
|
|
288
|
+
*/
|
|
289
|
+
readonly mockFetchOverride?: MockFetchOverrideOptions;
|
|
288
290
|
}
|
|
289
291
|
|
|
290
292
|
export declare type MockCriteriaEntry = {
|
|
@@ -319,6 +321,15 @@ export declare class MockFetchClient {
|
|
|
319
321
|
private mockFhirHandler;
|
|
320
322
|
}
|
|
321
323
|
|
|
324
|
+
/**
|
|
325
|
+
* Override must contain all of `router`, `repo`, and `client`.
|
|
326
|
+
*/
|
|
327
|
+
export declare type MockFetchOverrideOptions = {
|
|
328
|
+
client: MockFetchClient;
|
|
329
|
+
router: FhirRouter;
|
|
330
|
+
repo: MemoryRepository;
|
|
331
|
+
};
|
|
332
|
+
|
|
322
333
|
export declare interface MockSubManagerOptions {
|
|
323
334
|
mockRobustWebSocket?: boolean;
|
|
324
335
|
}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ import { DiagnosticReport } from '@medplum/fhirtypes';
|
|
|
13
13
|
import { Encounter } from '@medplum/fhirtypes';
|
|
14
14
|
import { FhirRouter } from '@medplum/fhir-router';
|
|
15
15
|
import { Group } from '@medplum/fhirtypes';
|
|
16
|
-
import { IClientStorage } from '@medplum/core';
|
|
17
16
|
import { LoginState } from '@medplum/core';
|
|
18
17
|
import { Media } from '@medplum/fhirtypes';
|
|
19
18
|
import { MedplumClient } from '@medplum/core';
|
|
@@ -277,14 +276,17 @@ export declare class MockClient extends MedplumClient {
|
|
|
277
276
|
getMasterSubscriptionEmitter(): SubscriptionEmitter;
|
|
278
277
|
}
|
|
279
278
|
|
|
280
|
-
export declare interface MockClientOptions extends MedplumClientOptions {
|
|
279
|
+
export declare interface MockClientOptions extends Pick<MedplumClientOptions, 'baseUrl' | 'clientId' | 'storage' | 'cacheTime'> {
|
|
281
280
|
readonly debug?: boolean;
|
|
282
281
|
/**
|
|
283
282
|
* Override currently logged in user. Specifying null results in
|
|
284
283
|
* MedplumContext.profile returning undefined as if no one were logged in.
|
|
285
284
|
*/
|
|
286
285
|
readonly profile?: ReturnType<MedplumClient['getProfile']> | null;
|
|
287
|
-
|
|
286
|
+
/**
|
|
287
|
+
* Override the `MockFetchClient` used by this `MockClient`.
|
|
288
|
+
*/
|
|
289
|
+
readonly mockFetchOverride?: MockFetchOverrideOptions;
|
|
288
290
|
}
|
|
289
291
|
|
|
290
292
|
export declare type MockCriteriaEntry = {
|
|
@@ -319,6 +321,15 @@ export declare class MockFetchClient {
|
|
|
319
321
|
private mockFhirHandler;
|
|
320
322
|
}
|
|
321
323
|
|
|
324
|
+
/**
|
|
325
|
+
* Override must contain all of `router`, `repo`, and `client`.
|
|
326
|
+
*/
|
|
327
|
+
export declare type MockFetchOverrideOptions = {
|
|
328
|
+
client: MockFetchClient;
|
|
329
|
+
router: FhirRouter;
|
|
330
|
+
repo: MemoryRepository;
|
|
331
|
+
};
|
|
332
|
+
|
|
322
333
|
export declare interface MockSubManagerOptions {
|
|
323
334
|
mockRobustWebSocket?: boolean;
|
|
324
335
|
}
|