@medplum/core 3.1.0 → 3.1.2

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.
@@ -6,6 +6,7 @@ import { Address } from '@medplum/fhirtypes';
6
6
  import { Agent } from '@medplum/fhirtypes';
7
7
  import { Attachment } from '@medplum/fhirtypes';
8
8
  import { Binary } from '@medplum/fhirtypes';
9
+ import { Bot } from '@medplum/fhirtypes';
9
10
  import { BulkDataExport } from '@medplum/fhirtypes';
10
11
  import { Bundle } from '@medplum/fhirtypes';
11
12
  import { CodeableConcept } from '@medplum/fhirtypes';
@@ -261,6 +262,7 @@ export declare abstract class BooleanInfixOperatorAtom extends InfixOperatorAtom
261
262
  export declare function booleanToTypedValue(value: boolean): [TypedValue];
262
263
 
263
264
  export declare interface BotEvent<T = Resource | Hl7Message | string | Record<string, any>> {
265
+ readonly bot: Reference<Bot>;
264
266
  readonly contentType: string;
265
267
  readonly input: T;
266
268
  readonly secrets: Record<string, ProjectSecret>;
@@ -390,10 +392,10 @@ export declare class ConcatAtom extends InfixOperatorAtom {
390
392
  * If the URL is absolute, it is returned as-is.
391
393
  *
392
394
  * @param baseUrl - The base URL.
393
- * @param url - The URL to concat. Can be relative or absolute.
395
+ * @param path - The URL to concat. Can be relative or absolute.
394
396
  * @returns The concatenated URL.
395
397
  */
396
- export declare function concatUrls(baseUrl: string, url: string): string;
398
+ export declare function concatUrls(baseUrl: string | URL, path: string): string;
397
399
 
398
400
  export declare function conceptMapTranslate(map: ConceptMap, params: ConceptMapTranslateParameters): ConceptMapTranslateOutput;
399
401
 
@@ -686,6 +688,20 @@ export declare function encodeBase64(data: string): string;
686
688
  */
687
689
  export declare function encryptSHA256(str: string): Promise<ArrayBuffer>;
688
690
 
691
+ /**
692
+ * Ensures the given URL has no leading slash.
693
+ * @param url - The URL to ensure has no leading slash.
694
+ * @returns The URL string with no slash.
695
+ */
696
+ export declare function ensureNoLeadingSlash(url: string): string;
697
+
698
+ /**
699
+ * Ensures the given URL has a trailing slash.
700
+ * @param url - The URL to ensure has a trailing slash.
701
+ * @returns The URL with a trailing slash.
702
+ */
703
+ export declare function ensureTrailingSlash(url: string): string;
704
+
689
705
  export declare class EqualsAtom extends BooleanInfixOperatorAtom {
690
706
  constructor(left: Atom, right: Atom);
691
707
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
@@ -1513,7 +1529,7 @@ export declare function getTypedPropertyValueWithSchema(typedValue: TypedValue,
1513
1529
 
1514
1530
  export declare function getValueSliceName(value: any, slices: SliceDefinitionWithTypes[], discriminators: SliceDiscriminator[], profileUrl: string | undefined): string | undefined;
1515
1531
 
1516
- export declare function getWebSocketUrl(path: string, baseUrl: URL | string): string;
1532
+ export declare function getWebSocketUrl(baseUrl: URL | string, path: string): string;
1517
1533
 
1518
1534
  /**
1519
1535
  * Global schema singleton.
@@ -5056,6 +5072,16 @@ export declare interface SortRule {
5056
5072
  descending?: boolean;
5057
5073
  }
5058
5074
 
5075
+ /**
5076
+ * Sorts an array of strings in place using the localeCompare method.
5077
+ *
5078
+ * This method will mutate the input array.
5079
+ *
5080
+ * @param array - The array of strings to sort.
5081
+ * @returns The sorted array of strings.
5082
+ */
5083
+ export declare function sortStringArray(array: string[]): string[];
5084
+
5059
5085
  /**
5060
5086
  * Splits a string into an array of strings using the specified delimiter.
5061
5087
  * Unlike the built-in split function, this function will split the string into a maximum of exactly n parts.
@@ -5123,6 +5149,7 @@ export declare interface SubManagerOptions {
5123
5149
  * - `disconnect` - The specified subscription is no longer being monitored by the `SubscriptionManager`.
5124
5150
  * - `error` - An error has occurred.
5125
5151
  * - `message` - A message containing a notification `Bundle` has been received.
5152
+ * - `open` - The WebSocket has been opened.
5126
5153
  * - `close` - The WebSocket has been closed.
5127
5154
  * - `heartbeat` - A `heartbeat` message has been received.
5128
5155
  */
@@ -5163,6 +5190,9 @@ export declare type SubscriptionEventMap = {
5163
5190
  type: 'message';
5164
5191
  payload: Bundle;
5165
5192
  };
5193
+ open: {
5194
+ type: 'open';
5195
+ };
5166
5196
  close: {
5167
5197
  type: 'close';
5168
5198
  };
@@ -6,6 +6,7 @@ import { Address } from '@medplum/fhirtypes';
6
6
  import { Agent } from '@medplum/fhirtypes';
7
7
  import { Attachment } from '@medplum/fhirtypes';
8
8
  import { Binary } from '@medplum/fhirtypes';
9
+ import { Bot } from '@medplum/fhirtypes';
9
10
  import { BulkDataExport } from '@medplum/fhirtypes';
10
11
  import { Bundle } from '@medplum/fhirtypes';
11
12
  import { CodeableConcept } from '@medplum/fhirtypes';
@@ -261,6 +262,7 @@ export declare abstract class BooleanInfixOperatorAtom extends InfixOperatorAtom
261
262
  export declare function booleanToTypedValue(value: boolean): [TypedValue];
262
263
 
263
264
  export declare interface BotEvent<T = Resource | Hl7Message | string | Record<string, any>> {
265
+ readonly bot: Reference<Bot>;
264
266
  readonly contentType: string;
265
267
  readonly input: T;
266
268
  readonly secrets: Record<string, ProjectSecret>;
@@ -390,10 +392,10 @@ export declare class ConcatAtom extends InfixOperatorAtom {
390
392
  * If the URL is absolute, it is returned as-is.
391
393
  *
392
394
  * @param baseUrl - The base URL.
393
- * @param url - The URL to concat. Can be relative or absolute.
395
+ * @param path - The URL to concat. Can be relative or absolute.
394
396
  * @returns The concatenated URL.
395
397
  */
396
- export declare function concatUrls(baseUrl: string, url: string): string;
398
+ export declare function concatUrls(baseUrl: string | URL, path: string): string;
397
399
 
398
400
  export declare function conceptMapTranslate(map: ConceptMap, params: ConceptMapTranslateParameters): ConceptMapTranslateOutput;
399
401
 
@@ -686,6 +688,20 @@ export declare function encodeBase64(data: string): string;
686
688
  */
687
689
  export declare function encryptSHA256(str: string): Promise<ArrayBuffer>;
688
690
 
691
+ /**
692
+ * Ensures the given URL has no leading slash.
693
+ * @param url - The URL to ensure has no leading slash.
694
+ * @returns The URL string with no slash.
695
+ */
696
+ export declare function ensureNoLeadingSlash(url: string): string;
697
+
698
+ /**
699
+ * Ensures the given URL has a trailing slash.
700
+ * @param url - The URL to ensure has a trailing slash.
701
+ * @returns The URL with a trailing slash.
702
+ */
703
+ export declare function ensureTrailingSlash(url: string): string;
704
+
689
705
  export declare class EqualsAtom extends BooleanInfixOperatorAtom {
690
706
  constructor(left: Atom, right: Atom);
691
707
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
@@ -1513,7 +1529,7 @@ export declare function getTypedPropertyValueWithSchema(typedValue: TypedValue,
1513
1529
 
1514
1530
  export declare function getValueSliceName(value: any, slices: SliceDefinitionWithTypes[], discriminators: SliceDiscriminator[], profileUrl: string | undefined): string | undefined;
1515
1531
 
1516
- export declare function getWebSocketUrl(path: string, baseUrl: URL | string): string;
1532
+ export declare function getWebSocketUrl(baseUrl: URL | string, path: string): string;
1517
1533
 
1518
1534
  /**
1519
1535
  * Global schema singleton.
@@ -5056,6 +5072,16 @@ export declare interface SortRule {
5056
5072
  descending?: boolean;
5057
5073
  }
5058
5074
 
5075
+ /**
5076
+ * Sorts an array of strings in place using the localeCompare method.
5077
+ *
5078
+ * This method will mutate the input array.
5079
+ *
5080
+ * @param array - The array of strings to sort.
5081
+ * @returns The sorted array of strings.
5082
+ */
5083
+ export declare function sortStringArray(array: string[]): string[];
5084
+
5059
5085
  /**
5060
5086
  * Splits a string into an array of strings using the specified delimiter.
5061
5087
  * Unlike the built-in split function, this function will split the string into a maximum of exactly n parts.
@@ -5123,6 +5149,7 @@ export declare interface SubManagerOptions {
5123
5149
  * - `disconnect` - The specified subscription is no longer being monitored by the `SubscriptionManager`.
5124
5150
  * - `error` - An error has occurred.
5125
5151
  * - `message` - A message containing a notification `Bundle` has been received.
5152
+ * - `open` - The WebSocket has been opened.
5126
5153
  * - `close` - The WebSocket has been closed.
5127
5154
  * - `heartbeat` - A `heartbeat` message has been received.
5128
5155
  */
@@ -5163,6 +5190,9 @@ export declare type SubscriptionEventMap = {
5163
5190
  type: 'message';
5164
5191
  payload: Bundle;
5165
5192
  };
5193
+ open: {
5194
+ type: 'open';
5195
+ };
5166
5196
  close: {
5167
5197
  type: 'close';
5168
5198
  };