@medplum/mock 2.1.14 → 2.1.16

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.
@@ -3,12 +3,14 @@ import { AuditEvent } from '@medplum/fhirtypes';
3
3
  import { Binary } from '@medplum/fhirtypes';
4
4
  import { Bot } from '@medplum/fhirtypes';
5
5
  import { ClientApplication } from '@medplum/fhirtypes';
6
+ import { ClientStorage } from '@medplum/core';
6
7
  import { Communication } from '@medplum/fhirtypes';
7
8
  import type { CustomTableLayout } from 'pdfmake/interfaces';
8
9
  import { DiagnosticReport } from '@medplum/fhirtypes';
9
10
  import { Encounter } from '@medplum/fhirtypes';
10
11
  import { FhirRouter } from '@medplum/fhir-router';
11
12
  import { Group } from '@medplum/fhirtypes';
13
+ import { IClientStorage } from '@medplum/core';
12
14
  import { LoginState } from '@medplum/core';
13
15
  import { Media } from '@medplum/fhirtypes';
14
16
  import { MedplumClient } from '@medplum/core';
@@ -127,6 +129,14 @@ export declare const LisaSimpson: Patient;
127
129
 
128
130
  export declare const MargeSimpson: Patient;
129
131
 
132
+ export declare class MockAsyncClientStorage extends ClientStorage implements IClientStorage {
133
+ #private;
134
+ constructor();
135
+ setInitialized(): void;
136
+ getInitPromise(): Promise<void>;
137
+ get isInitialized(): boolean;
138
+ }
139
+
130
140
  export declare class MockClient extends MedplumClient {
131
141
  readonly router: FhirRouter;
132
142
  readonly repo: MemoryRepository;
@@ -0,0 +1,194 @@
1
+ import { AccessPolicy } from '@medplum/fhirtypes';
2
+ import { AuditEvent } from '@medplum/fhirtypes';
3
+ import { Binary } from '@medplum/fhirtypes';
4
+ import { Bot } from '@medplum/fhirtypes';
5
+ import { ClientApplication } from '@medplum/fhirtypes';
6
+ import { ClientStorage } from '@medplum/core';
7
+ import { Communication } from '@medplum/fhirtypes';
8
+ import type { CustomTableLayout } from 'pdfmake/interfaces';
9
+ import { DiagnosticReport } from '@medplum/fhirtypes';
10
+ import { Encounter } from '@medplum/fhirtypes';
11
+ import { FhirRouter } from '@medplum/fhir-router';
12
+ import { Group } from '@medplum/fhirtypes';
13
+ import { IClientStorage } from '@medplum/core';
14
+ import { LoginState } from '@medplum/core';
15
+ import { Media } from '@medplum/fhirtypes';
16
+ import { MedplumClient } from '@medplum/core';
17
+ import { MedplumClientOptions } from '@medplum/core';
18
+ import { MemoryRepository } from '@medplum/fhir-router';
19
+ import { Observation } from '@medplum/fhirtypes';
20
+ import { Organization } from '@medplum/fhirtypes';
21
+ import { Patient } from '@medplum/fhirtypes';
22
+ import { PlanDefinition } from '@medplum/fhirtypes';
23
+ import { Practitioner } from '@medplum/fhirtypes';
24
+ import { ProfileResource } from '@medplum/core';
25
+ import { Questionnaire } from '@medplum/fhirtypes';
26
+ import { QuestionnaireResponse } from '@medplum/fhirtypes';
27
+ import { RelatedPerson } from '@medplum/fhirtypes';
28
+ import { RequestGroup } from '@medplum/fhirtypes';
29
+ import { Schedule } from '@medplum/fhirtypes';
30
+ import { ServiceRequest } from '@medplum/fhirtypes';
31
+ import { Slot } from '@medplum/fhirtypes';
32
+ import { Specimen } from '@medplum/fhirtypes';
33
+ import { Subscription } from '@medplum/fhirtypes';
34
+ import { Task } from '@medplum/fhirtypes';
35
+ import type { TDocumentDefinitions } from 'pdfmake/interfaces';
36
+ import type { TFontDictionary } from 'pdfmake/interfaces';
37
+ import { UserConfiguration } from '@medplum/fhirtypes';
38
+ import { ValueSet } from '@medplum/fhirtypes';
39
+
40
+ export declare const BartSimpson: Patient;
41
+
42
+ export declare const DifferentOrganization: Organization;
43
+
44
+ export declare const DrAliceSmith: Practitioner;
45
+
46
+ export declare const DrAliceSmithPreviousVersion: Practitioner;
47
+
48
+ export declare const DrAliceSmithSchedule: Schedule;
49
+
50
+ export declare const DrAliceSmithSlots: Slot[];
51
+
52
+ export declare const ExampleAccessPolicy: AccessPolicy;
53
+
54
+ export declare const ExampleAuditEvent: AuditEvent;
55
+
56
+ export declare const ExampleBot: Bot;
57
+
58
+ export declare const ExampleBotSourceCode: Binary;
59
+
60
+ export declare const ExampleClient: ClientApplication;
61
+
62
+ export declare const ExampleQuestionnaire: Questionnaire;
63
+
64
+ export declare const ExampleQuestionnaireResponse: QuestionnaireResponse;
65
+
66
+ export declare const ExampleStatusValueSet: ValueSet;
67
+
68
+ export declare const ExampleSubscription: Subscription;
69
+
70
+ export declare const ExampleUserConfiguration: UserConfiguration;
71
+
72
+ export declare const exampleValueSet: ValueSet;
73
+
74
+ export declare const ExampleWorkflowPlanDefinition: PlanDefinition;
75
+
76
+ export declare const ExampleWorkflowQuestionnaire1: Questionnaire;
77
+
78
+ export declare const ExampleWorkflowQuestionnaire2: Questionnaire;
79
+
80
+ export declare const ExampleWorkflowQuestionnaire3: Questionnaire;
81
+
82
+ export declare const ExampleWorkflowQuestionnaireResponse1: QuestionnaireResponse;
83
+
84
+ export declare const ExampleWorkflowRequestGroup: RequestGroup;
85
+
86
+ export declare const ExampleWorkflowTask1: Task;
87
+
88
+ export declare const ExampleWorkflowTask2: Task;
89
+
90
+ export declare const ExampleWorkflowTask3: Task;
91
+
92
+ export declare const HomerBartRelatedPerson: RelatedPerson;
93
+
94
+ export declare const HomerCommunication: Communication;
95
+
96
+ export declare const HomerDiagnosticReport: DiagnosticReport;
97
+
98
+ export declare const HomerEncounter: Encounter;
99
+
100
+ export declare const HomerLisaRelatedPerson: RelatedPerson;
101
+
102
+ export declare const HomerMedia: Media;
103
+
104
+ export declare const HomerObservation1: Observation;
105
+
106
+ export declare const HomerObservation2: Observation;
107
+
108
+ export declare const HomerObservation3: Observation;
109
+
110
+ export declare const HomerObservation4: Observation;
111
+
112
+ export declare const HomerObservation5: Observation;
113
+
114
+ export declare const HomerObservation6: Observation;
115
+
116
+ export declare const HomerObservation7: Observation;
117
+
118
+ export declare const HomerObservation8: Observation;
119
+
120
+ export declare const HomerServiceRequest: ServiceRequest;
121
+
122
+ export declare const HomerSimpson: Patient;
123
+
124
+ export declare const HomerSimpsonPreviousVersion: Patient;
125
+
126
+ export declare const HomerSimpsonSpecimen: Specimen;
127
+
128
+ export declare const LisaSimpson: Patient;
129
+
130
+ export declare const MargeSimpson: Patient;
131
+
132
+ export declare class MockAsyncClientStorage extends ClientStorage implements IClientStorage {
133
+ #private;
134
+ constructor();
135
+ setInitialized(): void;
136
+ getInitPromise(): Promise<void>;
137
+ get isInitialized(): boolean;
138
+ }
139
+
140
+ export declare class MockClient extends MedplumClient {
141
+ readonly router: FhirRouter;
142
+ readonly repo: MemoryRepository;
143
+ readonly client: MockFetchClient;
144
+ readonly debug: boolean;
145
+ activeLoginOverride?: LoginState;
146
+ private readonly profile;
147
+ constructor(clientOptions?: MockClientOptions);
148
+ clear(): void;
149
+ getProfile(): ProfileResource | undefined;
150
+ getUserConfiguration(): UserConfiguration | undefined;
151
+ setActiveLoginOverride(activeLoginOverride: LoginState): void;
152
+ getActiveLogin(): LoginState | undefined;
153
+ getLogins(): LoginState[];
154
+ createBinary(data: string | File | Blob | Uint8Array, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void): Promise<Binary>;
155
+ }
156
+
157
+ export declare interface MockClientOptions extends MedplumClientOptions {
158
+ readonly debug?: boolean;
159
+ /**
160
+ * Override currently logged in user. Specifying null results in
161
+ * MedplumContext.profile returning undefined as if no one were logged in.
162
+ */
163
+ readonly profile?: ReturnType<MedplumClient['getProfile']> | null;
164
+ }
165
+
166
+ export declare class MockFetchClient {
167
+ readonly router: FhirRouter;
168
+ readonly repo: MemoryRepository;
169
+ readonly debug: boolean;
170
+ initialized: boolean;
171
+ initPromise?: Promise<void>;
172
+ constructor(router: FhirRouter, repo: MemoryRepository, debug?: boolean);
173
+ mockFetch(url: string, options: any): Promise<Partial<Response>>;
174
+ mockCreatePdf(docDefinition: TDocumentDefinitions, tableLayouts?: {
175
+ [name: string]: CustomTableLayout;
176
+ }, fonts?: TFontDictionary | undefined): Promise<any>;
177
+ private mockHandler;
178
+ private mockAdminHandler;
179
+ private mockAuthHandler;
180
+ private mockChangePasswordHandler;
181
+ private mockLoginHandler;
182
+ private mockSetPasswordHandler;
183
+ private mockNewUserHandler;
184
+ private mockResetPasswordHandler;
185
+ private mockOAuthHandler;
186
+ private initMockRepo;
187
+ private mockFhirHandler;
188
+ }
189
+
190
+ export declare const SimpsonsFamily: Group;
191
+
192
+ export declare const TestOrganization: Organization;
193
+
194
+ export { }