@medplum/mock 3.1.7 → 3.1.9
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/README.md +1 -1
- package/dist/cjs/index.cjs +4 -4
- package/dist/cjs/index.cjs.map +3 -3
- package/dist/cjs/index.d.ts +19 -8
- package/dist/esm/index.d.ts +19 -8
- package/dist/esm/index.mjs +5 -5
- package/dist/esm/index.mjs.map +3 -3
- package/package.json +5 -5
package/dist/cjs/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ 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';
|
|
16
17
|
import { LoginState } from '@medplum/core';
|
|
17
18
|
import { Media } from '@medplum/fhirtypes';
|
|
18
19
|
import { MedplumClient } from '@medplum/core';
|
|
@@ -271,8 +272,8 @@ export declare class MockClient extends MedplumClient {
|
|
|
271
272
|
pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device> | string, body: any, contentType?: string | undefined, _waitForResponse?: boolean | undefined, _options?: MedplumRequestOptions | undefined): Promise<any>;
|
|
272
273
|
setAgentAvailable(value: boolean): void;
|
|
273
274
|
getSubscriptionManager(): MockSubscriptionManager;
|
|
274
|
-
subscribeToCriteria(criteria: string): SubscriptionEmitter;
|
|
275
|
-
unsubscribeFromCriteria(criteria: string): void;
|
|
275
|
+
subscribeToCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): SubscriptionEmitter;
|
|
276
|
+
unsubscribeFromCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): void;
|
|
276
277
|
getMasterSubscriptionEmitter(): SubscriptionEmitter;
|
|
277
278
|
}
|
|
278
279
|
|
|
@@ -283,8 +284,16 @@ export declare interface MockClientOptions extends MedplumClientOptions {
|
|
|
283
284
|
* MedplumContext.profile returning undefined as if no one were logged in.
|
|
284
285
|
*/
|
|
285
286
|
readonly profile?: ReturnType<MedplumClient['getProfile']> | null;
|
|
287
|
+
readonly storage?: IClientStorage;
|
|
286
288
|
}
|
|
287
289
|
|
|
290
|
+
export declare type MockCriteriaEntry = {
|
|
291
|
+
criteria: string;
|
|
292
|
+
subscriptionProps?: Partial<Subscription>;
|
|
293
|
+
emitter: SubscriptionEmitter;
|
|
294
|
+
count: number;
|
|
295
|
+
};
|
|
296
|
+
|
|
288
297
|
export declare class MockFetchClient {
|
|
289
298
|
readonly router: FhirRouter;
|
|
290
299
|
readonly repo: MemoryRepository;
|
|
@@ -315,17 +324,19 @@ export declare interface MockSubManagerOptions {
|
|
|
315
324
|
}
|
|
316
325
|
|
|
317
326
|
export declare class MockSubscriptionManager extends SubscriptionManager {
|
|
318
|
-
|
|
319
|
-
counts: Map<string, number>;
|
|
327
|
+
entries: Map<string, MockCriteriaEntry[]>;
|
|
320
328
|
masterEmitter: SubscriptionEmitter;
|
|
321
329
|
constructor(medplum: MedplumClient, _wsUrl: string, options?: MockSubManagerOptions);
|
|
322
|
-
|
|
323
|
-
|
|
330
|
+
private maybeGetMockCriteriaEntry;
|
|
331
|
+
private removeMockCriteriaEntry;
|
|
332
|
+
private getAllMockCriteriaEmitters;
|
|
333
|
+
addCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): SubscriptionEmitter;
|
|
334
|
+
removeCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): void;
|
|
324
335
|
closeWebSocket(): void;
|
|
325
336
|
getCriteriaCount(): number;
|
|
326
337
|
getMasterEmitter(): SubscriptionEmitter;
|
|
327
|
-
emitEventForCriteria<K extends keyof SubscriptionEventMap = keyof SubscriptionEventMap>(criteria: string, event: SubscriptionEventMap[K]): void;
|
|
328
|
-
getEmitter(criteria: string): SubscriptionEmitter | undefined;
|
|
338
|
+
emitEventForCriteria<K extends keyof SubscriptionEventMap = keyof SubscriptionEventMap>(criteria: string, event: SubscriptionEventMap[K], subscriptionProps?: Partial<Subscription>): void;
|
|
339
|
+
getEmitter(criteria: string, subscriptionProps?: Partial<Subscription>): SubscriptionEmitter | undefined;
|
|
329
340
|
}
|
|
330
341
|
|
|
331
342
|
export declare type ProfileStructureDefinition = StructureDefinition & {
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ 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';
|
|
16
17
|
import { LoginState } from '@medplum/core';
|
|
17
18
|
import { Media } from '@medplum/fhirtypes';
|
|
18
19
|
import { MedplumClient } from '@medplum/core';
|
|
@@ -271,8 +272,8 @@ export declare class MockClient extends MedplumClient {
|
|
|
271
272
|
pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device> | string, body: any, contentType?: string | undefined, _waitForResponse?: boolean | undefined, _options?: MedplumRequestOptions | undefined): Promise<any>;
|
|
272
273
|
setAgentAvailable(value: boolean): void;
|
|
273
274
|
getSubscriptionManager(): MockSubscriptionManager;
|
|
274
|
-
subscribeToCriteria(criteria: string): SubscriptionEmitter;
|
|
275
|
-
unsubscribeFromCriteria(criteria: string): void;
|
|
275
|
+
subscribeToCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): SubscriptionEmitter;
|
|
276
|
+
unsubscribeFromCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): void;
|
|
276
277
|
getMasterSubscriptionEmitter(): SubscriptionEmitter;
|
|
277
278
|
}
|
|
278
279
|
|
|
@@ -283,8 +284,16 @@ export declare interface MockClientOptions extends MedplumClientOptions {
|
|
|
283
284
|
* MedplumContext.profile returning undefined as if no one were logged in.
|
|
284
285
|
*/
|
|
285
286
|
readonly profile?: ReturnType<MedplumClient['getProfile']> | null;
|
|
287
|
+
readonly storage?: IClientStorage;
|
|
286
288
|
}
|
|
287
289
|
|
|
290
|
+
export declare type MockCriteriaEntry = {
|
|
291
|
+
criteria: string;
|
|
292
|
+
subscriptionProps?: Partial<Subscription>;
|
|
293
|
+
emitter: SubscriptionEmitter;
|
|
294
|
+
count: number;
|
|
295
|
+
};
|
|
296
|
+
|
|
288
297
|
export declare class MockFetchClient {
|
|
289
298
|
readonly router: FhirRouter;
|
|
290
299
|
readonly repo: MemoryRepository;
|
|
@@ -315,17 +324,19 @@ export declare interface MockSubManagerOptions {
|
|
|
315
324
|
}
|
|
316
325
|
|
|
317
326
|
export declare class MockSubscriptionManager extends SubscriptionManager {
|
|
318
|
-
|
|
319
|
-
counts: Map<string, number>;
|
|
327
|
+
entries: Map<string, MockCriteriaEntry[]>;
|
|
320
328
|
masterEmitter: SubscriptionEmitter;
|
|
321
329
|
constructor(medplum: MedplumClient, _wsUrl: string, options?: MockSubManagerOptions);
|
|
322
|
-
|
|
323
|
-
|
|
330
|
+
private maybeGetMockCriteriaEntry;
|
|
331
|
+
private removeMockCriteriaEntry;
|
|
332
|
+
private getAllMockCriteriaEmitters;
|
|
333
|
+
addCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): SubscriptionEmitter;
|
|
334
|
+
removeCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): void;
|
|
324
335
|
closeWebSocket(): void;
|
|
325
336
|
getCriteriaCount(): number;
|
|
326
337
|
getMasterEmitter(): SubscriptionEmitter;
|
|
327
|
-
emitEventForCriteria<K extends keyof SubscriptionEventMap = keyof SubscriptionEventMap>(criteria: string, event: SubscriptionEventMap[K]): void;
|
|
328
|
-
getEmitter(criteria: string): SubscriptionEmitter | undefined;
|
|
338
|
+
emitEventForCriteria<K extends keyof SubscriptionEventMap = keyof SubscriptionEventMap>(criteria: string, event: SubscriptionEventMap[K], subscriptionProps?: Partial<Subscription>): void;
|
|
339
|
+
getEmitter(criteria: string, subscriptionProps?: Partial<Subscription>): SubscriptionEmitter | undefined;
|
|
329
340
|
}
|
|
330
341
|
|
|
331
342
|
export declare type ProfileStructureDefinition = StructureDefinition & {
|