@medplum/mock 3.0.9 → 3.0.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.
@@ -15,6 +15,7 @@ import { LoginState } from '@medplum/core';
15
15
  import { Media } from '@medplum/fhirtypes';
16
16
  import { MedplumClient } from '@medplum/core';
17
17
  import { MedplumClientOptions } from '@medplum/core';
18
+ import { MedplumRequestOptions } from '@medplum/core';
18
19
  import { MemoryRepository } from '@medplum/fhir-router';
19
20
  import { Observation } from '@medplum/fhirtypes';
20
21
  import { Organization } from '@medplum/fhirtypes';
@@ -154,17 +155,18 @@ export declare class MockClient extends MedplumClient {
154
155
  readonly debug: boolean;
155
156
  activeLoginOverride?: LoginState;
156
157
  private agentAvailable;
157
- private readonly profile;
158
+ private profile;
158
159
  subManager: MockSubscriptionManager | undefined;
159
160
  constructor(clientOptions?: MockClientOptions);
160
161
  clear(): void;
161
162
  getProfile(): ProfileResource | undefined;
162
163
  getUserConfiguration(): UserConfiguration | undefined;
163
164
  setActiveLoginOverride(activeLoginOverride: LoginState): void;
165
+ setProfile(profile: ProfileResource | undefined): void;
164
166
  getActiveLogin(): LoginState | undefined;
165
167
  getLogins(): LoginState[];
166
168
  createBinary(data: string | File | Blob | Uint8Array, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void): Promise<Binary>;
167
- pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device> | string, body: any, contentType?: string | undefined, _waitForResponse?: boolean | undefined, _options?: RequestInit | undefined): Promise<any>;
169
+ pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device> | string, body: any, contentType?: string | undefined, _waitForResponse?: boolean | undefined, _options?: MedplumRequestOptions | undefined): Promise<any>;
168
170
  setAgentAvailable(value: boolean): void;
169
171
  getSubscriptionManager(): MockSubscriptionManager;
170
172
  subscribeToCriteria(criteria: string): SubscriptionEmitter;
@@ -205,11 +207,15 @@ export declare class MockFetchClient {
205
207
  private mockFhirHandler;
206
208
  }
207
209
 
210
+ export declare interface MockSubManagerOptions {
211
+ mockRobustWebSocket?: boolean;
212
+ }
213
+
208
214
  export declare class MockSubscriptionManager extends SubscriptionManager {
209
215
  emitters: Map<string, SubscriptionEmitter>;
210
216
  counts: Map<string, number>;
211
217
  masterEmitter: SubscriptionEmitter;
212
- constructor(medplum: MedplumClient, _wsOrUrl: WebSocket | string);
218
+ constructor(medplum: MedplumClient, _wsUrl: string, options?: MockSubManagerOptions);
213
219
  addCriteria(criteria: string): SubscriptionEmitter;
214
220
  removeCriteria(criteria: string): void;
215
221
  closeWebSocket(): void;
@@ -15,6 +15,7 @@ import { LoginState } from '@medplum/core';
15
15
  import { Media } from '@medplum/fhirtypes';
16
16
  import { MedplumClient } from '@medplum/core';
17
17
  import { MedplumClientOptions } from '@medplum/core';
18
+ import { MedplumRequestOptions } from '@medplum/core';
18
19
  import { MemoryRepository } from '@medplum/fhir-router';
19
20
  import { Observation } from '@medplum/fhirtypes';
20
21
  import { Organization } from '@medplum/fhirtypes';
@@ -154,17 +155,18 @@ export declare class MockClient extends MedplumClient {
154
155
  readonly debug: boolean;
155
156
  activeLoginOverride?: LoginState;
156
157
  private agentAvailable;
157
- private readonly profile;
158
+ private profile;
158
159
  subManager: MockSubscriptionManager | undefined;
159
160
  constructor(clientOptions?: MockClientOptions);
160
161
  clear(): void;
161
162
  getProfile(): ProfileResource | undefined;
162
163
  getUserConfiguration(): UserConfiguration | undefined;
163
164
  setActiveLoginOverride(activeLoginOverride: LoginState): void;
165
+ setProfile(profile: ProfileResource | undefined): void;
164
166
  getActiveLogin(): LoginState | undefined;
165
167
  getLogins(): LoginState[];
166
168
  createBinary(data: string | File | Blob | Uint8Array, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void): Promise<Binary>;
167
- pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device> | string, body: any, contentType?: string | undefined, _waitForResponse?: boolean | undefined, _options?: RequestInit | undefined): Promise<any>;
169
+ pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device> | string, body: any, contentType?: string | undefined, _waitForResponse?: boolean | undefined, _options?: MedplumRequestOptions | undefined): Promise<any>;
168
170
  setAgentAvailable(value: boolean): void;
169
171
  getSubscriptionManager(): MockSubscriptionManager;
170
172
  subscribeToCriteria(criteria: string): SubscriptionEmitter;
@@ -205,11 +207,15 @@ export declare class MockFetchClient {
205
207
  private mockFhirHandler;
206
208
  }
207
209
 
210
+ export declare interface MockSubManagerOptions {
211
+ mockRobustWebSocket?: boolean;
212
+ }
213
+
208
214
  export declare class MockSubscriptionManager extends SubscriptionManager {
209
215
  emitters: Map<string, SubscriptionEmitter>;
210
216
  counts: Map<string, number>;
211
217
  masterEmitter: SubscriptionEmitter;
212
- constructor(medplum: MedplumClient, _wsOrUrl: WebSocket | string);
218
+ constructor(medplum: MedplumClient, _wsUrl: string, options?: MockSubManagerOptions);
213
219
  addCriteria(criteria: string): SubscriptionEmitter;
214
220
  removeCriteria(criteria: string): void;
215
221
  closeWebSocket(): void;