@medplum/core 3.0.13 → 3.1.1
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 +5 -5
- package/dist/cjs/index.cjs.map +3 -3
- package/dist/cjs/index.d.ts +47 -9
- package/dist/esm/index.d.ts +47 -9
- package/dist/esm/index.mjs +5 -5
- package/dist/esm/index.mjs.map +3 -3
- package/package.json +3 -3
package/dist/cjs/index.d.ts
CHANGED
|
@@ -390,10 +390,10 @@ export declare class ConcatAtom extends InfixOperatorAtom {
|
|
|
390
390
|
* If the URL is absolute, it is returned as-is.
|
|
391
391
|
*
|
|
392
392
|
* @param baseUrl - The base URL.
|
|
393
|
-
* @param
|
|
393
|
+
* @param path - The URL to concat. Can be relative or absolute.
|
|
394
394
|
* @returns The concatenated URL.
|
|
395
395
|
*/
|
|
396
|
-
export declare function concatUrls(baseUrl: string,
|
|
396
|
+
export declare function concatUrls(baseUrl: string | URL, path: string): string;
|
|
397
397
|
|
|
398
398
|
export declare function conceptMapTranslate(map: ConceptMap, params: ConceptMapTranslateParameters): ConceptMapTranslateOutput;
|
|
399
399
|
|
|
@@ -686,6 +686,20 @@ export declare function encodeBase64(data: string): string;
|
|
|
686
686
|
*/
|
|
687
687
|
export declare function encryptSHA256(str: string): Promise<ArrayBuffer>;
|
|
688
688
|
|
|
689
|
+
/**
|
|
690
|
+
* Ensures the given URL has no leading slash.
|
|
691
|
+
* @param url - The URL to ensure has no leading slash.
|
|
692
|
+
* @returns The URL string with no slash.
|
|
693
|
+
*/
|
|
694
|
+
export declare function ensureNoLeadingSlash(url: string): string;
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* Ensures the given URL has a trailing slash.
|
|
698
|
+
* @param url - The URL to ensure has a trailing slash.
|
|
699
|
+
* @returns The URL with a trailing slash.
|
|
700
|
+
*/
|
|
701
|
+
export declare function ensureTrailingSlash(url: string): string;
|
|
702
|
+
|
|
689
703
|
export declare class EqualsAtom extends BooleanInfixOperatorAtom {
|
|
690
704
|
constructor(left: Atom, right: Atom);
|
|
691
705
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
@@ -1393,8 +1407,14 @@ export declare function getIdentifier(resource: Resource, system: string): strin
|
|
|
1393
1407
|
*/
|
|
1394
1408
|
export declare function getImageSrc(resource: Resource): string | undefined;
|
|
1395
1409
|
|
|
1396
|
-
export declare function getNestedProperty(value:
|
|
1410
|
+
export declare function getNestedProperty(value: TypedValueWithPath | undefined, key: string, options: {
|
|
1411
|
+
profileUrl?: string;
|
|
1412
|
+
withPath: true;
|
|
1413
|
+
}): (TypedValueWithPath | TypedValueWithPath[])[];
|
|
1414
|
+
|
|
1415
|
+
export declare function getNestedProperty(value: TypedValue | undefined, key: string, options?: {
|
|
1397
1416
|
profileUrl?: string;
|
|
1417
|
+
withPath?: false;
|
|
1398
1418
|
}): (TypedValue | TypedValue[] | undefined)[];
|
|
1399
1419
|
|
|
1400
1420
|
/**
|
|
@@ -1507,7 +1527,7 @@ export declare function getTypedPropertyValueWithSchema(typedValue: TypedValue,
|
|
|
1507
1527
|
|
|
1508
1528
|
export declare function getValueSliceName(value: any, slices: SliceDefinitionWithTypes[], discriminators: SliceDiscriminator[], profileUrl: string | undefined): string | undefined;
|
|
1509
1529
|
|
|
1510
|
-
export declare function getWebSocketUrl(
|
|
1530
|
+
export declare function getWebSocketUrl(baseUrl: URL | string, path: string): string;
|
|
1511
1531
|
|
|
1512
1532
|
/**
|
|
1513
1533
|
* Global schema singleton.
|
|
@@ -4892,11 +4912,11 @@ export declare type ResourceArray<T extends Resource = Resource> = T[] & {
|
|
|
4892
4912
|
};
|
|
4893
4913
|
|
|
4894
4914
|
export declare interface ResourceVisitor {
|
|
4895
|
-
onEnterObject?: (path: string, value:
|
|
4896
|
-
onExitObject?: (path: string, value:
|
|
4897
|
-
onEnterResource?: (path: string, value:
|
|
4898
|
-
onExitResource?: (path: string, value:
|
|
4899
|
-
visitProperty?: (parent:
|
|
4915
|
+
onEnterObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
|
|
4916
|
+
onExitObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
|
|
4917
|
+
onEnterResource?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
|
|
4918
|
+
onExitResource?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
|
|
4919
|
+
visitProperty?: (parent: TypedValueWithPath, key: string, path: string, propertyValues: (TypedValueWithPath | TypedValueWithPath[])[], schema: InternalTypeSchema) => void;
|
|
4900
4920
|
}
|
|
4901
4921
|
|
|
4902
4922
|
export declare type ResourceWithCode = Resource & Code;
|
|
@@ -5050,6 +5070,16 @@ export declare interface SortRule {
|
|
|
5050
5070
|
descending?: boolean;
|
|
5051
5071
|
}
|
|
5052
5072
|
|
|
5073
|
+
/**
|
|
5074
|
+
* Sorts an array of strings in place using the localeCompare method.
|
|
5075
|
+
*
|
|
5076
|
+
* This method will mutate the input array.
|
|
5077
|
+
*
|
|
5078
|
+
* @param array - The array of strings to sort.
|
|
5079
|
+
* @returns The sorted array of strings.
|
|
5080
|
+
*/
|
|
5081
|
+
export declare function sortStringArray(array: string[]): string[];
|
|
5082
|
+
|
|
5053
5083
|
/**
|
|
5054
5084
|
* Splits a string into an array of strings using the specified delimiter.
|
|
5055
5085
|
* Unlike the built-in split function, this function will split the string into a maximum of exactly n parts.
|
|
@@ -5117,6 +5147,7 @@ export declare interface SubManagerOptions {
|
|
|
5117
5147
|
* - `disconnect` - The specified subscription is no longer being monitored by the `SubscriptionManager`.
|
|
5118
5148
|
* - `error` - An error has occurred.
|
|
5119
5149
|
* - `message` - A message containing a notification `Bundle` has been received.
|
|
5150
|
+
* - `open` - The WebSocket has been opened.
|
|
5120
5151
|
* - `close` - The WebSocket has been closed.
|
|
5121
5152
|
* - `heartbeat` - A `heartbeat` message has been received.
|
|
5122
5153
|
*/
|
|
@@ -5157,6 +5188,9 @@ export declare type SubscriptionEventMap = {
|
|
|
5157
5188
|
type: 'message';
|
|
5158
5189
|
payload: Bundle;
|
|
5159
5190
|
};
|
|
5191
|
+
open: {
|
|
5192
|
+
type: 'open';
|
|
5193
|
+
};
|
|
5160
5194
|
close: {
|
|
5161
5195
|
type: 'close';
|
|
5162
5196
|
};
|
|
@@ -5319,6 +5353,10 @@ export declare interface TypedValue {
|
|
|
5319
5353
|
readonly value: any;
|
|
5320
5354
|
}
|
|
5321
5355
|
|
|
5356
|
+
export declare type TypedValueWithPath = TypedValue & {
|
|
5357
|
+
path: string;
|
|
5358
|
+
};
|
|
5359
|
+
|
|
5322
5360
|
/**
|
|
5323
5361
|
* An indexed TypeSchema.
|
|
5324
5362
|
*
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -390,10 +390,10 @@ export declare class ConcatAtom extends InfixOperatorAtom {
|
|
|
390
390
|
* If the URL is absolute, it is returned as-is.
|
|
391
391
|
*
|
|
392
392
|
* @param baseUrl - The base URL.
|
|
393
|
-
* @param
|
|
393
|
+
* @param path - The URL to concat. Can be relative or absolute.
|
|
394
394
|
* @returns The concatenated URL.
|
|
395
395
|
*/
|
|
396
|
-
export declare function concatUrls(baseUrl: string,
|
|
396
|
+
export declare function concatUrls(baseUrl: string | URL, path: string): string;
|
|
397
397
|
|
|
398
398
|
export declare function conceptMapTranslate(map: ConceptMap, params: ConceptMapTranslateParameters): ConceptMapTranslateOutput;
|
|
399
399
|
|
|
@@ -686,6 +686,20 @@ export declare function encodeBase64(data: string): string;
|
|
|
686
686
|
*/
|
|
687
687
|
export declare function encryptSHA256(str: string): Promise<ArrayBuffer>;
|
|
688
688
|
|
|
689
|
+
/**
|
|
690
|
+
* Ensures the given URL has no leading slash.
|
|
691
|
+
* @param url - The URL to ensure has no leading slash.
|
|
692
|
+
* @returns The URL string with no slash.
|
|
693
|
+
*/
|
|
694
|
+
export declare function ensureNoLeadingSlash(url: string): string;
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* Ensures the given URL has a trailing slash.
|
|
698
|
+
* @param url - The URL to ensure has a trailing slash.
|
|
699
|
+
* @returns The URL with a trailing slash.
|
|
700
|
+
*/
|
|
701
|
+
export declare function ensureTrailingSlash(url: string): string;
|
|
702
|
+
|
|
689
703
|
export declare class EqualsAtom extends BooleanInfixOperatorAtom {
|
|
690
704
|
constructor(left: Atom, right: Atom);
|
|
691
705
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
@@ -1393,8 +1407,14 @@ export declare function getIdentifier(resource: Resource, system: string): strin
|
|
|
1393
1407
|
*/
|
|
1394
1408
|
export declare function getImageSrc(resource: Resource): string | undefined;
|
|
1395
1409
|
|
|
1396
|
-
export declare function getNestedProperty(value:
|
|
1410
|
+
export declare function getNestedProperty(value: TypedValueWithPath | undefined, key: string, options: {
|
|
1411
|
+
profileUrl?: string;
|
|
1412
|
+
withPath: true;
|
|
1413
|
+
}): (TypedValueWithPath | TypedValueWithPath[])[];
|
|
1414
|
+
|
|
1415
|
+
export declare function getNestedProperty(value: TypedValue | undefined, key: string, options?: {
|
|
1397
1416
|
profileUrl?: string;
|
|
1417
|
+
withPath?: false;
|
|
1398
1418
|
}): (TypedValue | TypedValue[] | undefined)[];
|
|
1399
1419
|
|
|
1400
1420
|
/**
|
|
@@ -1507,7 +1527,7 @@ export declare function getTypedPropertyValueWithSchema(typedValue: TypedValue,
|
|
|
1507
1527
|
|
|
1508
1528
|
export declare function getValueSliceName(value: any, slices: SliceDefinitionWithTypes[], discriminators: SliceDiscriminator[], profileUrl: string | undefined): string | undefined;
|
|
1509
1529
|
|
|
1510
|
-
export declare function getWebSocketUrl(
|
|
1530
|
+
export declare function getWebSocketUrl(baseUrl: URL | string, path: string): string;
|
|
1511
1531
|
|
|
1512
1532
|
/**
|
|
1513
1533
|
* Global schema singleton.
|
|
@@ -4892,11 +4912,11 @@ export declare type ResourceArray<T extends Resource = Resource> = T[] & {
|
|
|
4892
4912
|
};
|
|
4893
4913
|
|
|
4894
4914
|
export declare interface ResourceVisitor {
|
|
4895
|
-
onEnterObject?: (path: string, value:
|
|
4896
|
-
onExitObject?: (path: string, value:
|
|
4897
|
-
onEnterResource?: (path: string, value:
|
|
4898
|
-
onExitResource?: (path: string, value:
|
|
4899
|
-
visitProperty?: (parent:
|
|
4915
|
+
onEnterObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
|
|
4916
|
+
onExitObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
|
|
4917
|
+
onEnterResource?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
|
|
4918
|
+
onExitResource?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
|
|
4919
|
+
visitProperty?: (parent: TypedValueWithPath, key: string, path: string, propertyValues: (TypedValueWithPath | TypedValueWithPath[])[], schema: InternalTypeSchema) => void;
|
|
4900
4920
|
}
|
|
4901
4921
|
|
|
4902
4922
|
export declare type ResourceWithCode = Resource & Code;
|
|
@@ -5050,6 +5070,16 @@ export declare interface SortRule {
|
|
|
5050
5070
|
descending?: boolean;
|
|
5051
5071
|
}
|
|
5052
5072
|
|
|
5073
|
+
/**
|
|
5074
|
+
* Sorts an array of strings in place using the localeCompare method.
|
|
5075
|
+
*
|
|
5076
|
+
* This method will mutate the input array.
|
|
5077
|
+
*
|
|
5078
|
+
* @param array - The array of strings to sort.
|
|
5079
|
+
* @returns The sorted array of strings.
|
|
5080
|
+
*/
|
|
5081
|
+
export declare function sortStringArray(array: string[]): string[];
|
|
5082
|
+
|
|
5053
5083
|
/**
|
|
5054
5084
|
* Splits a string into an array of strings using the specified delimiter.
|
|
5055
5085
|
* Unlike the built-in split function, this function will split the string into a maximum of exactly n parts.
|
|
@@ -5117,6 +5147,7 @@ export declare interface SubManagerOptions {
|
|
|
5117
5147
|
* - `disconnect` - The specified subscription is no longer being monitored by the `SubscriptionManager`.
|
|
5118
5148
|
* - `error` - An error has occurred.
|
|
5119
5149
|
* - `message` - A message containing a notification `Bundle` has been received.
|
|
5150
|
+
* - `open` - The WebSocket has been opened.
|
|
5120
5151
|
* - `close` - The WebSocket has been closed.
|
|
5121
5152
|
* - `heartbeat` - A `heartbeat` message has been received.
|
|
5122
5153
|
*/
|
|
@@ -5157,6 +5188,9 @@ export declare type SubscriptionEventMap = {
|
|
|
5157
5188
|
type: 'message';
|
|
5158
5189
|
payload: Bundle;
|
|
5159
5190
|
};
|
|
5191
|
+
open: {
|
|
5192
|
+
type: 'open';
|
|
5193
|
+
};
|
|
5160
5194
|
close: {
|
|
5161
5195
|
type: 'close';
|
|
5162
5196
|
};
|
|
@@ -5319,6 +5353,10 @@ export declare interface TypedValue {
|
|
|
5319
5353
|
readonly value: any;
|
|
5320
5354
|
}
|
|
5321
5355
|
|
|
5356
|
+
export declare type TypedValueWithPath = TypedValue & {
|
|
5357
|
+
path: string;
|
|
5358
|
+
};
|
|
5359
|
+
|
|
5322
5360
|
/**
|
|
5323
5361
|
* An indexed TypeSchema.
|
|
5324
5362
|
*
|