@medplum/core 5.1.11 → 5.1.13

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.
@@ -159,6 +159,10 @@ export declare interface AddressFormatOptions {
159
159
  lineSeparator?: string;
160
160
  }
161
161
 
162
+ export declare type AgentChannelStats = {
163
+ rtt: AgentRttStats;
164
+ };
165
+
162
166
  export declare interface AgentConnectRequest extends BaseAgentRequestMessage {
163
167
  type: 'agent:connect:request';
164
168
  agentId: string;
@@ -204,9 +208,51 @@ export declare interface AgentReloadConfigResponse extends BaseAgentMessage {
204
208
  statusCode: number;
205
209
  }
206
210
 
207
- export declare type AgentRequestMessage = AgentConnectRequest | AgentHeartbeatRequest | AgentTransmitRequest | AgentReloadConfigRequest | AgentUpgradeRequest | AgentLogsRequest;
211
+ export declare type AgentRequestMessage = AgentConnectRequest | AgentHeartbeatRequest | AgentTransmitRequest | AgentReloadConfigRequest | AgentUpgradeRequest | AgentLogsRequest | AgentStatsRequest;
212
+
213
+ export declare type AgentResponseMessage = AgentConnectResponse | AgentHeartbeatResponse | AgentTransmitResponse | AgentReloadConfigResponse | AgentUpgradeResponse | AgentLogsResponse | AgentStatsResponse | AgentError;
214
+
215
+ export declare type AgentRttStats = {
216
+ count: number;
217
+ min: number;
218
+ max: number;
219
+ average: number;
220
+ p50: number;
221
+ p95: number;
222
+ p99: number;
223
+ pendingCount: number;
224
+ };
225
+
226
+ export declare type AgentStatPrimitiveValue = string | boolean | number;
208
227
 
209
- export declare type AgentResponseMessage = AgentConnectResponse | AgentHeartbeatResponse | AgentTransmitResponse | AgentReloadConfigResponse | AgentUpgradeResponse | AgentLogsResponse | AgentError;
228
+ /**
229
+ * Statistics about the running agent. Known fields are typed; additional
230
+ * fields may be present and are preserved as unknown values.
231
+ */
232
+ export declare interface AgentStats {
233
+ hl7ConnectionsOpen: number;
234
+ ping: number;
235
+ webSocketQueueDepth: number;
236
+ hl7QueueDepth: number;
237
+ hl7ClientCount: number;
238
+ live: boolean;
239
+ outstandingHeartbeats: number;
240
+ channelStats: Record<string, AgentChannelStats>;
241
+ clientStats: Record<string, AgentChannelStats>;
242
+ [key: string]: AgentStatValue;
243
+ }
244
+
245
+ export declare interface AgentStatsRequest extends BaseAgentRequestMessage {
246
+ type: 'agent:stats:request';
247
+ }
248
+
249
+ export declare interface AgentStatsResponse extends BaseAgentMessage {
250
+ type: 'agent:stats:response';
251
+ statusCode: number;
252
+ stats: AgentStats;
253
+ }
254
+
255
+ export declare type AgentStatValue = AgentStatPrimitiveValue | Record<string, AgentStatPrimitiveValue | Record<string, AgentStatPrimitiveValue | Record<string, AgentStatPrimitiveValue>>>;
210
256
 
211
257
  export declare interface AgentTransmitRequest extends BaseAgentRequestMessage {
212
258
  type: 'agent:transmit:request';
@@ -247,7 +293,7 @@ export declare type AnchorResourceOpenEvent<T extends FhircastAnchorResourceType
247
293
  * false if either operand evaluates to false,
248
294
  * and the empty collection otherwise.
249
295
  */
250
- export declare class AndAtom extends BooleanInfixOperatorAtom {
296
+ export declare class AndAtom extends InfixOperatorAtom {
251
297
  constructor(left: Atom, right: Atom);
252
298
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
253
299
  }
@@ -279,7 +325,7 @@ export declare function applyDefaultValuesToResource(resource: Resource, schema:
279
325
 
280
326
  export declare function applyFixedOrPatternValue(inputValue: any, key: string, element: InternalSchemaElement, elements: Record<string, InternalSchemaElement>): any;
281
327
 
282
- export declare class ArithemticOperatorAtom extends BooleanInfixOperatorAtom {
328
+ export declare class ArithmeticOperatorAtom extends InfixOperatorAtom {
283
329
  readonly impl: (x: number, y: number) => number | boolean;
284
330
  constructor(operator: string, left: Atom, right: Atom, impl: (x: number, y: number) => number | boolean);
285
331
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
@@ -352,7 +398,7 @@ export declare interface BackgroundJobContext {
352
398
 
353
399
  export declare type BackgroundJobInteraction = 'create' | 'update' | 'delete';
354
400
 
355
- export declare function badRequest(details: string, expression?: string): OperationOutcome;
401
+ export declare function badRequest(details: string, expression?: string | string[]): OperationOutcome;
356
402
 
357
403
  export declare interface BaseAgentMessage {
358
404
  type: string;
@@ -385,10 +431,6 @@ export declare type BaseSchema = Record<string, {
385
431
  */
386
432
  export declare type BinarySource = string | File | Blob | Uint8Array;
387
433
 
388
- export declare abstract class BooleanInfixOperatorAtom extends InfixOperatorAtom {
389
- abstract eval(context: AtomContext, input: TypedValue[]): TypedValue[];
390
- }
391
-
392
434
  /**
393
435
  * Returns a single element array with a typed boolean value.
394
436
  * @param value - The primitive boolean value.
@@ -804,11 +846,13 @@ export declare interface Constraint {
804
846
  description: string;
805
847
  }
806
848
 
807
- export declare class ContainsAtom extends BooleanInfixOperatorAtom {
849
+ export declare class ContainsAtom extends InfixOperatorAtom {
808
850
  constructor(left: Atom, right: Atom);
809
851
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
810
852
  }
811
853
 
854
+ export declare function contentTooLarge(text: string): OperationOutcome;
855
+
812
856
  /**
813
857
  * Content type constants.
814
858
  */
@@ -1180,7 +1224,7 @@ export declare interface ElementType {
1180
1224
  export declare interface EmailPasswordLoginRequest extends BaseLoginRequest {
1181
1225
  readonly email: string;
1182
1226
  readonly password: string;
1183
- /** @deprecated Use scope of "offline" or "offline_access" instead. */
1227
+ /** @deprecated Use "offline_access" scope instead. */
1184
1228
  readonly remember?: boolean;
1185
1229
  }
1186
1230
 
@@ -1230,12 +1274,12 @@ export declare function ensureNoLeadingSlash(url: string): string;
1230
1274
  */
1231
1275
  export declare function ensureTrailingSlash(url: string): string;
1232
1276
 
1233
- export declare class EqualsAtom extends BooleanInfixOperatorAtom {
1277
+ export declare class EqualsAtom extends InfixOperatorAtom {
1234
1278
  constructor(left: Atom, right: Atom);
1235
1279
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
1236
1280
  }
1237
1281
 
1238
- export declare class EquivalentAtom extends BooleanInfixOperatorAtom {
1282
+ export declare class EquivalentAtom extends InfixOperatorAtom {
1239
1283
  constructor(left: Atom, right: Atom);
1240
1284
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
1241
1285
  }
@@ -2138,6 +2182,8 @@ export declare function getNestedProperty(value: TypedValue | undefined, key: st
2138
2182
  withPath?: false;
2139
2183
  }): (TypedValue | TypedValue[] | undefined)[];
2140
2184
 
2185
+ export declare function getOutcomeRedirectUrl(outcome: OperationOutcome | undefined): string | undefined;
2186
+
2141
2187
  export declare function getParsedDerivedIdentifierExpression(originalExpression: string, atom: FhirPathAtom): FhirPathAtom;
2142
2188
 
2143
2189
  export declare function getParsedExpressionForResourceType(resourceType: string, expression: string): FhirPathAtom;
@@ -2434,15 +2480,15 @@ export declare class Hl7Message {
2434
2480
  readonly context: Hl7Context;
2435
2481
  /**
2436
2482
  * Internal lazy-parsed segment storage. Entries are `string` until they
2437
- * are accessed (via {@link getSegment}, {@link getAllSegments}, {@link header},
2438
- * or the public {@link segments} getter), at which point they are parsed in
2483
+ * are accessed (via {@link Hl7Message.getSegment}, {@link Hl7Message.getAllSegments}, {@link Hl7Message.header},
2484
+ * or the public {@link Hl7Message.segments} getter), at which point they are parsed in
2439
2485
  * place and replaced with their {@link Hl7Segment} form.
2440
2486
  */
2441
2487
  private readonly _segments;
2442
2488
  /**
2443
- * Maps segment name → indices into {@link _segments}. Storing indices (rather
2489
+ * Maps segment name → indices into {@link Hl7Message#_segments}. Storing indices (rather
2444
2490
  * than references to the segments themselves) keeps this map in sync with
2445
- * {@link _segments} without needing a per-parse update step, and is immune to
2491
+ * {@link Hl7Message#_segments} without needing a per-parse update step, and is immune to
2446
2492
  * collisions when two segments have identical raw text.
2447
2493
  */
2448
2494
  private segmentsByName;
@@ -2452,8 +2498,8 @@ export declare class Hl7Message {
2452
2498
  /**
2453
2499
  * Creates a new HL7 message.
2454
2500
  *
2455
- * Segment strings are not parsed until they are accessed via {@link getSegment},
2456
- * {@link getAllSegments}, {@link header}, or the {@link segments} getter.
2501
+ * Segment strings are not parsed until they are accessed via {@link Hl7Message.getSegment},
2502
+ * {@link Hl7Message.getAllSegments}, {@link Hl7Message.header}, or the {@link Hl7Message.segments} getter.
2457
2503
  *
2458
2504
  * @param segments - The HL7 segments.
2459
2505
  * @param context - Optional HL7 parsing context.
@@ -2462,7 +2508,7 @@ export declare class Hl7Message {
2462
2508
  /**
2463
2509
  * Returns all HL7 segments, parsing any unparsed segment strings on first access.
2464
2510
  *
2465
- * Prefer {@link getSegment} or {@link getAllSegments} when you only need a subset
2511
+ * Prefer {@link Hl7Message.getSegment} or {@link Hl7Message.getAllSegments} when you only need a subset
2466
2512
  * of segments; those methods avoid parsing unrelated segments.
2467
2513
  *
2468
2514
  * @returns The HL7 segments array.
@@ -2564,7 +2610,7 @@ export declare class Hl7Segment {
2564
2610
  readonly name: string;
2565
2611
  /**
2566
2612
  * Internal lazy-parsed field storage. Entries are `string` until they are
2567
- * accessed (via {@link getField} or the public {@link fields} getter), at
2613
+ * accessed (via {@link Hl7Segment.getField} or the public {@link Hl7Segment.fields} getter), at
2568
2614
  * which point they are parsed in place and replaced with their
2569
2615
  * {@link Hl7Field} form.
2570
2616
  */
@@ -2577,8 +2623,8 @@ export declare class Hl7Segment {
2577
2623
  /**
2578
2624
  * Creates a new HL7 segment.
2579
2625
  *
2580
- * Field strings are not parsed until they are accessed via {@link getField}
2581
- * or via the {@link fields} getter.
2626
+ * Field strings are not parsed until they are accessed via {@link Hl7Segment.getField}
2627
+ * or via the {@link Hl7Segment.fields} getter.
2582
2628
  *
2583
2629
  * @param fields - The HL7 fields. The first field is the segment name.
2584
2630
  * @param context - Optional HL7 parsing context.
@@ -2587,7 +2633,7 @@ export declare class Hl7Segment {
2587
2633
  /**
2588
2634
  * Returns all HL7 fields, parsing any unparsed field strings on first access.
2589
2635
  *
2590
- * Prefer {@link getField} when you only need a subset of fields; that method
2636
+ * Prefer {@link Hl7Segment.getField} when you only need a subset of fields; that method
2591
2637
  * avoids parsing unrelated fields.
2592
2638
  *
2593
2639
  * @returns The HL7 fields array.
@@ -2726,12 +2772,12 @@ export declare interface ILoggerConfig {
2726
2772
  * true left is false and right true, false or empty
2727
2773
  * true left is empty
2728
2774
  */
2729
- export declare class ImpliesAtom extends BooleanInfixOperatorAtom {
2775
+ export declare class ImpliesAtom extends InfixOperatorAtom {
2730
2776
  constructor(left: Atom, right: Atom);
2731
2777
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
2732
2778
  }
2733
2779
 
2734
- export declare class InAtom extends BooleanInfixOperatorAtom {
2780
+ export declare class InAtom extends InfixOperatorAtom {
2735
2781
  constructor(left: Atom, right: Atom);
2736
2782
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
2737
2783
  }
@@ -2901,7 +2947,7 @@ export declare function isAccepted(outcome: OperationOutcome): boolean;
2901
2947
  */
2902
2948
  export declare function isAddPharmacyResponse(value: unknown): value is AddPharmacyResponse;
2903
2949
 
2904
- export declare class IsAtom extends BooleanInfixOperatorAtom {
2950
+ export declare class IsAtom extends InfixOperatorAtom {
2905
2951
  constructor(left: Atom, right: Atom);
2906
2952
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
2907
2953
  }
@@ -3365,6 +3411,7 @@ export declare interface LoggerOptions {
3365
3411
 
3366
3412
  export declare interface LoginAuthenticationResponse {
3367
3413
  readonly login: string;
3414
+ readonly emailVerificationRequired?: boolean;
3368
3415
  readonly mfaEnrollRequired?: boolean;
3369
3416
  readonly mfaRequired?: boolean;
3370
3417
  readonly enrollQrCode?: string;
@@ -5643,8 +5690,12 @@ export declare interface MedplumInfraConfig {
5643
5690
  loadBalancerLoggingBucket?: string;
5644
5691
  loadBalancerLoggingPrefix?: string;
5645
5692
  loadBalancerAlgorithm?: 'round_robin' | 'least_outstanding_requests' | 'weighted_random';
5693
+ guardDutyMalwareProtectionEnabled?: boolean;
5694
+ /** @deprecated Use guardDutyMalwareProtectionEnabled instead */
5646
5695
  clamscanEnabled: boolean;
5696
+ /** @deprecated Use guardDutyMalwareProtectionEnabled instead */
5647
5697
  clamscanLoggingBucket: string;
5698
+ /** @deprecated Use guardDutyMalwareProtectionEnabled instead */
5648
5699
  clamscanLoggingPrefix: string;
5649
5700
  skipDns?: boolean;
5650
5701
  hostedZoneName?: string;
@@ -5869,9 +5920,13 @@ export declare interface MedplumSourceInfraConfig {
5869
5920
  loadBalancerLoggingBucket?: ValueOrExternalSecret<string>;
5870
5921
  loadBalancerLoggingPrefix?: ValueOrExternalSecret<string>;
5871
5922
  loadBalancerAlgorithm?: ValueOrExternalSecret<'round_robin' | 'least_outstanding_requests' | 'weighted_random'>;
5872
- clamscanEnabled: ValueOrExternalSecret<boolean>;
5873
- clamscanLoggingBucket: ValueOrExternalSecret<string>;
5874
- clamscanLoggingPrefix: ValueOrExternalSecret<string>;
5923
+ guardDutyMalwareProtectionEnabled?: ValueOrExternalSecret<boolean>;
5924
+ /** @deprecated Use guardDutyMalwareProtectionEnabled instead */
5925
+ clamscanEnabled?: ValueOrExternalSecret<boolean>;
5926
+ /** @deprecated Use guardDutyMalwareProtectionEnabled instead */
5927
+ clamscanLoggingBucket?: ValueOrExternalSecret<string>;
5928
+ /** @deprecated Use guardDutyMalwareProtectionEnabled instead */
5929
+ clamscanLoggingPrefix?: ValueOrExternalSecret<string>;
5875
5930
  skipDns?: ValueOrExternalSecret<boolean>;
5876
5931
  hostedZoneName?: ValueOrExternalSecret<string>;
5877
5932
  wafLogGroupName?: ValueOrExternalSecret<string>;
@@ -6034,7 +6089,7 @@ export declare interface NewUserRequest {
6034
6089
  readonly lastName: string;
6035
6090
  readonly email: string;
6036
6091
  readonly password: string;
6037
- readonly recaptchaToken: string;
6092
+ readonly recaptchaToken?: string;
6038
6093
  readonly recaptchaSiteKey?: string;
6039
6094
  readonly remember?: boolean;
6040
6095
  readonly projectId?: string;
@@ -6073,12 +6128,12 @@ export declare function normalizeErrorString(error: unknown): string;
6073
6128
  */
6074
6129
  export declare function normalizeOperationOutcome(error: unknown): OperationOutcome;
6075
6130
 
6076
- export declare class NotEqualsAtom extends BooleanInfixOperatorAtom {
6131
+ export declare class NotEqualsAtom extends InfixOperatorAtom {
6077
6132
  constructor(left: Atom, right: Atom);
6078
6133
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
6079
6134
  }
6080
6135
 
6081
- export declare class NotEquivalentAtom extends BooleanInfixOperatorAtom {
6136
+ export declare class NotEquivalentAtom extends InfixOperatorAtom {
6082
6137
  constructor(left: Atom, right: Atom);
6083
6138
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
6084
6139
  }
@@ -6103,6 +6158,7 @@ export declare type OAuthClientAssertionType = (typeof OAuthClientAssertionType)
6103
6158
  * Standard identifiers: {@link https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-07#name-grant-types}
6104
6159
  * JWT bearer extension: {@link https://datatracker.ietf.org/doc/html/rfc7523}
6105
6160
  * Token exchange extension: {@link https://datatracker.ietf.org/doc/html/rfc8693}
6161
+ * Pre-authorized code: {@link https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#name-urnietfparamsoauthgrant-typ}
6106
6162
  */
6107
6163
  export declare const OAuthGrantType: {
6108
6164
  readonly ClientCredentials: "client_credentials";
@@ -6110,6 +6166,7 @@ export declare const OAuthGrantType: {
6110
6166
  readonly RefreshToken: "refresh_token";
6111
6167
  readonly JwtBearer: "urn:ietf:params:oauth:grant-type:jwt-bearer";
6112
6168
  readonly TokenExchange: "urn:ietf:params:oauth:grant-type:token-exchange";
6169
+ readonly PreAuthorizedCode: "urn:ietf:params:oauth:grant-type:pre-authorized_code";
6113
6170
  };
6114
6171
 
6115
6172
  export declare type OAuthGrantType = (typeof OAuthGrantType)[keyof typeof OAuthGrantType];
@@ -6274,7 +6331,7 @@ export declare type Options<WS extends IWebSocket = WebSocket> = {
6274
6331
  * true if either operand evaluates to true,
6275
6332
  * and empty (`{ }`) otherwise:
6276
6333
  */
6277
- export declare class OrAtom extends BooleanInfixOperatorAtom {
6334
+ export declare class OrAtom extends InfixOperatorAtom {
6278
6335
  constructor(left: Atom, right: Atom);
6279
6336
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
6280
6337
  }
@@ -6819,6 +6876,8 @@ export declare class ParserBuilder {
6819
6876
 
6820
6877
  export declare function redirect(url: URL): OperationOutcome;
6821
6878
 
6879
+ export declare function redirectOk(url: URL): OperationOutcome;
6880
+
6822
6881
  export declare type ReleaseManifest = {
6823
6882
  tag_name: string;
6824
6883
  assets: {
@@ -7652,7 +7711,7 @@ export declare class ParserBuilder {
7652
7711
  * false if either both operands evaluate to true or both operands evaluate to false,
7653
7712
  * and the empty collection otherwise.
7654
7713
  */
7655
- export declare class XorAtom extends BooleanInfixOperatorAtom {
7714
+ export declare class XorAtom extends InfixOperatorAtom {
7656
7715
  constructor(left: Atom, right: Atom);
7657
7716
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
7658
7717
  }