@medplum/mock 3.0.10 → 3.0.12

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.
@@ -2,9 +2,11 @@ import { AccessPolicy } from '@medplum/fhirtypes';
2
2
  import { Agent } from '@medplum/fhirtypes';
3
3
  import { AuditEvent } from '@medplum/fhirtypes';
4
4
  import { Binary } from '@medplum/fhirtypes';
5
+ import { BinarySource } from '@medplum/core';
5
6
  import { Bot } from '@medplum/fhirtypes';
6
7
  import { ClientApplication } from '@medplum/fhirtypes';
7
8
  import { Communication } from '@medplum/fhirtypes';
9
+ import { CreateBinaryOptions } from '@medplum/core';
8
10
  import type { CustomTableLayout } from 'pdfmake/interfaces';
9
11
  import { Device } from '@medplum/fhirtypes';
10
12
  import { DiagnosticReport } from '@medplum/fhirtypes';
@@ -155,16 +157,17 @@ export declare class MockClient extends MedplumClient {
155
157
  readonly debug: boolean;
156
158
  activeLoginOverride?: LoginState;
157
159
  private agentAvailable;
158
- private readonly profile;
160
+ private profile;
159
161
  subManager: MockSubscriptionManager | undefined;
160
162
  constructor(clientOptions?: MockClientOptions);
161
163
  clear(): void;
162
164
  getProfile(): ProfileResource | undefined;
163
165
  getUserConfiguration(): UserConfiguration | undefined;
164
166
  setActiveLoginOverride(activeLoginOverride: LoginState): void;
167
+ setProfile(profile: ProfileResource | undefined): void;
165
168
  getActiveLogin(): LoginState | undefined;
166
169
  getLogins(): LoginState[];
167
- createBinary(data: string | File | Blob | Uint8Array, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void): Promise<Binary>;
170
+ createBinary(arg1: BinarySource | CreateBinaryOptions, arg2: string | undefined | MedplumRequestOptions, arg3?: string, arg4?: (e: ProgressEvent) => void): Promise<Binary>;
168
171
  pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device> | string, body: any, contentType?: string | undefined, _waitForResponse?: boolean | undefined, _options?: MedplumRequestOptions | undefined): Promise<any>;
169
172
  setAgentAvailable(value: boolean): void;
170
173
  getSubscriptionManager(): MockSubscriptionManager;
@@ -206,11 +209,15 @@ export declare class MockFetchClient {
206
209
  private mockFhirHandler;
207
210
  }
208
211
 
212
+ export declare interface MockSubManagerOptions {
213
+ mockRobustWebSocket?: boolean;
214
+ }
215
+
209
216
  export declare class MockSubscriptionManager extends SubscriptionManager {
210
217
  emitters: Map<string, SubscriptionEmitter>;
211
218
  counts: Map<string, number>;
212
219
  masterEmitter: SubscriptionEmitter;
213
- constructor(medplum: MedplumClient, _wsOrUrl: WebSocket | string);
220
+ constructor(medplum: MedplumClient, _wsUrl: string, options?: MockSubManagerOptions);
214
221
  addCriteria(criteria: string): SubscriptionEmitter;
215
222
  removeCriteria(criteria: string): void;
216
223
  closeWebSocket(): void;
@@ -2,9 +2,11 @@ import { AccessPolicy } from '@medplum/fhirtypes';
2
2
  import { Agent } from '@medplum/fhirtypes';
3
3
  import { AuditEvent } from '@medplum/fhirtypes';
4
4
  import { Binary } from '@medplum/fhirtypes';
5
+ import { BinarySource } from '@medplum/core';
5
6
  import { Bot } from '@medplum/fhirtypes';
6
7
  import { ClientApplication } from '@medplum/fhirtypes';
7
8
  import { Communication } from '@medplum/fhirtypes';
9
+ import { CreateBinaryOptions } from '@medplum/core';
8
10
  import type { CustomTableLayout } from 'pdfmake/interfaces';
9
11
  import { Device } from '@medplum/fhirtypes';
10
12
  import { DiagnosticReport } from '@medplum/fhirtypes';
@@ -155,16 +157,17 @@ export declare class MockClient extends MedplumClient {
155
157
  readonly debug: boolean;
156
158
  activeLoginOverride?: LoginState;
157
159
  private agentAvailable;
158
- private readonly profile;
160
+ private profile;
159
161
  subManager: MockSubscriptionManager | undefined;
160
162
  constructor(clientOptions?: MockClientOptions);
161
163
  clear(): void;
162
164
  getProfile(): ProfileResource | undefined;
163
165
  getUserConfiguration(): UserConfiguration | undefined;
164
166
  setActiveLoginOverride(activeLoginOverride: LoginState): void;
167
+ setProfile(profile: ProfileResource | undefined): void;
165
168
  getActiveLogin(): LoginState | undefined;
166
169
  getLogins(): LoginState[];
167
- createBinary(data: string | File | Blob | Uint8Array, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void): Promise<Binary>;
170
+ createBinary(arg1: BinarySource | CreateBinaryOptions, arg2: string | undefined | MedplumRequestOptions, arg3?: string, arg4?: (e: ProgressEvent) => void): Promise<Binary>;
168
171
  pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device> | string, body: any, contentType?: string | undefined, _waitForResponse?: boolean | undefined, _options?: MedplumRequestOptions | undefined): Promise<any>;
169
172
  setAgentAvailable(value: boolean): void;
170
173
  getSubscriptionManager(): MockSubscriptionManager;
@@ -206,11 +209,15 @@ export declare class MockFetchClient {
206
209
  private mockFhirHandler;
207
210
  }
208
211
 
212
+ export declare interface MockSubManagerOptions {
213
+ mockRobustWebSocket?: boolean;
214
+ }
215
+
209
216
  export declare class MockSubscriptionManager extends SubscriptionManager {
210
217
  emitters: Map<string, SubscriptionEmitter>;
211
218
  counts: Map<string, number>;
212
219
  masterEmitter: SubscriptionEmitter;
213
- constructor(medplum: MedplumClient, _wsOrUrl: WebSocket | string);
220
+ constructor(medplum: MedplumClient, _wsUrl: string, options?: MockSubManagerOptions);
214
221
  addCriteria(criteria: string): SubscriptionEmitter;
215
222
  removeCriteria(criteria: string): void;
216
223
  closeWebSocket(): void;