@medplum/fhir-router 3.0.5 → 3.0.6

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.
@@ -1,4 +1,6 @@
1
1
  import { Bundle } from '@medplum/fhirtypes';
2
+ import { Event as Event_2 } from '@medplum/core';
3
+ import { EventTarget as EventTarget_2 } from '@medplum/core';
2
4
  import { Operation } from 'rfc6902';
3
5
  import { OperationOutcome } from '@medplum/fhirtypes';
4
6
  import { OperationOutcomeError } from '@medplum/core';
@@ -41,6 +43,13 @@ export declare abstract class BaseRepository {
41
43
  searchResources<T extends Resource>(searchRequest: SearchRequest<T>): Promise<T[]>;
42
44
  }
43
45
 
46
+ export declare interface BatchEvent extends Event_2 {
47
+ bundleType: Bundle['type'];
48
+ count: number;
49
+ errors: number;
50
+ size: number;
51
+ }
52
+
44
53
  export declare interface FhirOptions {
45
54
  introspectionEnabled?: boolean;
46
55
  }
@@ -185,7 +194,7 @@ export declare type FhirResponse = [OperationOutcome] | [OperationOutcome, Resou
185
194
 
186
195
  export declare type FhirRouteHandler = (req: FhirRequest, repo: FhirRepository, router: FhirRouter) => Promise<FhirResponse>;
187
196
 
188
- export declare class FhirRouter {
197
+ export declare class FhirRouter extends EventTarget_2 {
189
198
  readonly router: Router<FhirRouteHandler>;
190
199
  readonly options: FhirOptions;
191
200
  constructor(options?: {});
@@ -194,6 +203,10 @@ export declare class FhirRouter {
194
203
 
195
204
  export declare type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
196
205
 
206
+ export declare interface LogEvent extends Event_2 {
207
+ message: string;
208
+ }
209
+
197
210
  export declare class MemoryRepository extends BaseRepository implements FhirRepository {
198
211
  private readonly resources;
199
212
  private readonly history;
@@ -1,4 +1,6 @@
1
1
  import { Bundle } from '@medplum/fhirtypes';
2
+ import { Event as Event_2 } from '@medplum/core';
3
+ import { EventTarget as EventTarget_2 } from '@medplum/core';
2
4
  import { Operation } from 'rfc6902';
3
5
  import { OperationOutcome } from '@medplum/fhirtypes';
4
6
  import { OperationOutcomeError } from '@medplum/core';
@@ -41,6 +43,13 @@ export declare abstract class BaseRepository {
41
43
  searchResources<T extends Resource>(searchRequest: SearchRequest<T>): Promise<T[]>;
42
44
  }
43
45
 
46
+ export declare interface BatchEvent extends Event_2 {
47
+ bundleType: Bundle['type'];
48
+ count: number;
49
+ errors: number;
50
+ size: number;
51
+ }
52
+
44
53
  export declare interface FhirOptions {
45
54
  introspectionEnabled?: boolean;
46
55
  }
@@ -185,7 +194,7 @@ export declare type FhirResponse = [OperationOutcome] | [OperationOutcome, Resou
185
194
 
186
195
  export declare type FhirRouteHandler = (req: FhirRequest, repo: FhirRepository, router: FhirRouter) => Promise<FhirResponse>;
187
196
 
188
- export declare class FhirRouter {
197
+ export declare class FhirRouter extends EventTarget_2 {
189
198
  readonly router: Router<FhirRouteHandler>;
190
199
  readonly options: FhirOptions;
191
200
  constructor(options?: {});
@@ -194,6 +203,10 @@ export declare class FhirRouter {
194
203
 
195
204
  export declare type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
196
205
 
206
+ export declare interface LogEvent extends Event_2 {
207
+ message: string;
208
+ }
209
+
197
210
  export declare class MemoryRepository extends BaseRepository implements FhirRepository {
198
211
  private readonly resources;
199
212
  private readonly history;