@medplum/fhir-router 3.2.16 → 3.2.17
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/dist/cjs/index.cjs +8 -8
- package/dist/cjs/index.cjs.map +3 -3
- package/dist/cjs/index.d.ts +7 -2
- package/dist/esm/index.d.ts +7 -2
- package/dist/esm/index.mjs +13 -13
- package/dist/esm/index.mjs.map +3 -3
- package/package.json +4 -4
package/dist/cjs/index.d.ts
CHANGED
|
@@ -188,10 +188,11 @@ export declare abstract class FhirRepository<TClient = unknown> {
|
|
|
188
188
|
|
|
189
189
|
export declare type FhirRequest = {
|
|
190
190
|
method: HttpMethod;
|
|
191
|
+
url: string;
|
|
191
192
|
pathname: string;
|
|
192
193
|
body: any;
|
|
193
194
|
params: Record<string, string>;
|
|
194
|
-
query: Record<string, string>;
|
|
195
|
+
query: Record<string, string | string[] | undefined>;
|
|
195
196
|
headers?: IncomingHttpHeaders;
|
|
196
197
|
config?: FhirRequestConfig;
|
|
197
198
|
};
|
|
@@ -221,7 +222,7 @@ export declare class FhirRouter extends EventTarget_2 {
|
|
|
221
222
|
readonly options: FhirOptions;
|
|
222
223
|
constructor(options?: {});
|
|
223
224
|
add(method: HttpMethod, path: string, handler: FhirRouteHandler, interaction?: RestInteraction): void;
|
|
224
|
-
find(method: HttpMethod,
|
|
225
|
+
find(method: HttpMethod, url: string): RouteResult<FhirRouteHandler, FhirRouteMetadata> | undefined;
|
|
225
226
|
handleRequest(req: FhirRequest, repo: FhirRepository): Promise<FhirResponse>;
|
|
226
227
|
log(level: string, message: string, data?: Record<string, any>): void;
|
|
227
228
|
}
|
|
@@ -233,6 +234,8 @@ export declare interface LogEvent extends Event_2 {
|
|
|
233
234
|
data?: Record<string, any>;
|
|
234
235
|
}
|
|
235
236
|
|
|
237
|
+
export declare function makeSimpleRequest(method: HttpMethod, path: string, body?: any): FhirRequest;
|
|
238
|
+
|
|
236
239
|
export declare class MemoryRepository extends FhirRepository<undefined> {
|
|
237
240
|
private readonly resources;
|
|
238
241
|
private readonly history;
|
|
@@ -282,7 +285,9 @@ export declare class Router<Handler, Metadata> {
|
|
|
282
285
|
|
|
283
286
|
export declare type RouteResult<Handler, Metadata> = {
|
|
284
287
|
handler: Handler;
|
|
288
|
+
path: string;
|
|
285
289
|
params: Record<string, string>;
|
|
290
|
+
query?: Record<string, string | string[]>;
|
|
286
291
|
data?: Metadata;
|
|
287
292
|
};
|
|
288
293
|
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -188,10 +188,11 @@ export declare abstract class FhirRepository<TClient = unknown> {
|
|
|
188
188
|
|
|
189
189
|
export declare type FhirRequest = {
|
|
190
190
|
method: HttpMethod;
|
|
191
|
+
url: string;
|
|
191
192
|
pathname: string;
|
|
192
193
|
body: any;
|
|
193
194
|
params: Record<string, string>;
|
|
194
|
-
query: Record<string, string>;
|
|
195
|
+
query: Record<string, string | string[] | undefined>;
|
|
195
196
|
headers?: IncomingHttpHeaders;
|
|
196
197
|
config?: FhirRequestConfig;
|
|
197
198
|
};
|
|
@@ -221,7 +222,7 @@ export declare class FhirRouter extends EventTarget_2 {
|
|
|
221
222
|
readonly options: FhirOptions;
|
|
222
223
|
constructor(options?: {});
|
|
223
224
|
add(method: HttpMethod, path: string, handler: FhirRouteHandler, interaction?: RestInteraction): void;
|
|
224
|
-
find(method: HttpMethod,
|
|
225
|
+
find(method: HttpMethod, url: string): RouteResult<FhirRouteHandler, FhirRouteMetadata> | undefined;
|
|
225
226
|
handleRequest(req: FhirRequest, repo: FhirRepository): Promise<FhirResponse>;
|
|
226
227
|
log(level: string, message: string, data?: Record<string, any>): void;
|
|
227
228
|
}
|
|
@@ -233,6 +234,8 @@ export declare interface LogEvent extends Event_2 {
|
|
|
233
234
|
data?: Record<string, any>;
|
|
234
235
|
}
|
|
235
236
|
|
|
237
|
+
export declare function makeSimpleRequest(method: HttpMethod, path: string, body?: any): FhirRequest;
|
|
238
|
+
|
|
236
239
|
export declare class MemoryRepository extends FhirRepository<undefined> {
|
|
237
240
|
private readonly resources;
|
|
238
241
|
private readonly history;
|
|
@@ -282,7 +285,9 @@ export declare class Router<Handler, Metadata> {
|
|
|
282
285
|
|
|
283
286
|
export declare type RouteResult<Handler, Metadata> = {
|
|
284
287
|
handler: Handler;
|
|
288
|
+
path: string;
|
|
285
289
|
params: Record<string, string>;
|
|
290
|
+
query?: Record<string, string | string[]>;
|
|
286
291
|
data?: Metadata;
|
|
287
292
|
};
|
|
288
293
|
|