@medplum/core 2.1.9 → 2.1.11

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.
Files changed (52) hide show
  1. package/api-extractor.json +7 -0
  2. package/dist/cjs/index.cjs +4 -4
  3. package/dist/cjs/index.cjs.map +3 -3
  4. package/dist/esm/index.mjs +4 -4
  5. package/dist/esm/index.mjs.map +3 -3
  6. package/dist/types.d.ts +4592 -0
  7. package/package.json +33 -31
  8. package/test.setup.cjs +7 -0
  9. package/tsdoc.json +4 -0
  10. package/dist/types/access.d.ts +0 -77
  11. package/dist/types/base-schema.d.ts +0 -7
  12. package/dist/types/base64.d.ts +0 -14
  13. package/dist/types/bundle.d.ts +0 -32
  14. package/dist/types/cache.d.ts +0 -36
  15. package/dist/types/client.d.ts +0 -1728
  16. package/dist/types/config.d.ts +0 -127
  17. package/dist/types/constants.d.ts +0 -6
  18. package/dist/types/contenttype.d.ts +0 -18
  19. package/dist/types/crypto.d.ts +0 -19
  20. package/dist/types/eventtarget.d.ts +0 -18
  21. package/dist/types/fhircast/index.d.ts +0 -115
  22. package/dist/types/fhircast/test-utils.d.ts +0 -2
  23. package/dist/types/fhirlexer/parse.d.ts +0 -55
  24. package/dist/types/fhirlexer/tokenize.d.ts +0 -45
  25. package/dist/types/fhirmapper/parse.d.ts +0 -7
  26. package/dist/types/fhirmapper/tokenize.d.ts +0 -2
  27. package/dist/types/fhirpath/atoms.d.ts +0 -139
  28. package/dist/types/fhirpath/date.d.ts +0 -1
  29. package/dist/types/fhirpath/functions.d.ts +0 -4
  30. package/dist/types/fhirpath/parse.d.ts +0 -65
  31. package/dist/types/fhirpath/tokenize.d.ts +0 -4
  32. package/dist/types/fhirpath/utils.d.ts +0 -96
  33. package/dist/types/filter/parse.d.ts +0 -7
  34. package/dist/types/filter/tokenize.d.ts +0 -2
  35. package/dist/types/filter/types.d.ts +0 -32
  36. package/dist/types/format.d.ts +0 -120
  37. package/dist/types/hl7.d.ts +0 -242
  38. package/dist/types/index.d.ts +0 -34
  39. package/dist/types/jwt.d.ts +0 -18
  40. package/dist/types/outcomes.d.ts +0 -58
  41. package/dist/types/readablepromise.d.ts +0 -51
  42. package/dist/types/schema.d.ts +0 -43
  43. package/dist/types/search/details.d.ts +0 -37
  44. package/dist/types/search/match.d.ts +0 -9
  45. package/dist/types/search/search.d.ts +0 -102
  46. package/dist/types/sftp.d.ts +0 -9
  47. package/dist/types/storage.d.ts +0 -55
  48. package/dist/types/types.d.ts +0 -203
  49. package/dist/types/typeschema/crawler.d.ts +0 -12
  50. package/dist/types/typeschema/types.d.ts +0 -92
  51. package/dist/types/typeschema/validation.d.ts +0 -25
  52. package/dist/types/utils.d.ts +0 -326
@@ -1,96 +0,0 @@
1
- import { Period, Quantity } from '@medplum/fhirtypes';
2
- import { TypedValue } from '../types';
3
- /**
4
- * Returns a single element array with a typed boolean value.
5
- * @param value The primitive boolean value.
6
- * @returns Single element array with a typed boolean value.
7
- */
8
- export declare function booleanToTypedValue(value: boolean): [TypedValue];
9
- /**
10
- * Returns a "best guess" TypedValue for a given value.
11
- * @param value The unknown value to check.
12
- * @returns A "best guess" TypedValue for the given value.
13
- */
14
- export declare function toTypedValue(value: unknown): TypedValue;
15
- /**
16
- * Converts unknown object into a JavaScript boolean.
17
- * Note that this is different than the FHIRPath "toBoolean",
18
- * which has particular semantics around arrays, empty arrays, and type conversions.
19
- * @param obj Any value or array of values.
20
- * @returns The converted boolean value according to FHIRPath rules.
21
- */
22
- export declare function toJsBoolean(obj: TypedValue[]): boolean;
23
- export declare function singleton(collection: TypedValue[], type?: string): TypedValue | undefined;
24
- /**
25
- * Returns the value of the property and the property type.
26
- * Some property definitions support multiple types.
27
- * For example, "Observation.value[x]" can be "valueString", "valueInteger", "valueQuantity", etc.
28
- * According to the spec, there can only be one property for a given element definition.
29
- * This function returns the value and the type.
30
- * @param input The base context (FHIR resource or backbone element).
31
- * @param path The property path.
32
- * @returns The value of the property and the property type.
33
- */
34
- export declare function getTypedPropertyValue(input: TypedValue, path: string): TypedValue[] | TypedValue | undefined;
35
- /**
36
- * Removes duplicates in array using FHIRPath equality rules.
37
- * @param arr The input array.
38
- * @returns The result array with duplicates removed.
39
- */
40
- export declare function removeDuplicates(arr: TypedValue[]): TypedValue[];
41
- /**
42
- * Returns a negated FHIRPath boolean expression.
43
- * @param input The input array.
44
- * @returns The negated type value array.
45
- */
46
- export declare function fhirPathNot(input: TypedValue[]): TypedValue[];
47
- /**
48
- * Determines if two arrays are equal according to FHIRPath equality rules.
49
- * @param x The first array.
50
- * @param y The second array.
51
- * @returns FHIRPath true if the arrays are equal.
52
- */
53
- export declare function fhirPathArrayEquals(x: TypedValue[], y: TypedValue[]): TypedValue[];
54
- /**
55
- * Determines if two values are equal according to FHIRPath equality rules.
56
- * @param x The first value.
57
- * @param y The second value.
58
- * @returns True if equal.
59
- */
60
- export declare function fhirPathEquals(x: TypedValue, y: TypedValue): TypedValue[];
61
- /**
62
- * Determines if two arrays are equivalent according to FHIRPath equality rules.
63
- * @param x The first array.
64
- * @param y The second array.
65
- * @returns FHIRPath true if the arrays are equivalent.
66
- */
67
- export declare function fhirPathArrayEquivalent(x: TypedValue[], y: TypedValue[]): TypedValue[];
68
- /**
69
- * Determines if two values are equivalent according to FHIRPath equality rules.
70
- * @param x The first value.
71
- * @param y The second value.
72
- * @returns True if equivalent.
73
- */
74
- export declare function fhirPathEquivalent(x: TypedValue, y: TypedValue): TypedValue[];
75
- /**
76
- * Determines if the typed value is the desired type.
77
- * @param typedValue The typed value to check.
78
- * @param desiredType The desired type name.
79
- * @returns True if the typed value is of the desired type.
80
- */
81
- export declare function fhirPathIs(typedValue: TypedValue, desiredType: string): boolean;
82
- /**
83
- * Determines if the input is a Period object.
84
- * This is heuristic based, as we do not have strong typing at runtime.
85
- * @param input The input value.
86
- * @returns True if the input is a period.
87
- */
88
- export declare function isPeriod(input: unknown): input is Period;
89
- /**
90
- * Determines if the input is a Quantity object.
91
- * This is heuristic based, as we do not have strong typing at runtime.
92
- * @param input The input value.
93
- * @returns True if the input is a quantity.
94
- */
95
- export declare function isQuantity(input: unknown): input is Quantity;
96
- export declare function isQuantityEquivalent(x: Quantity, y: Quantity): boolean;
@@ -1,7 +0,0 @@
1
- import { FhirFilterExpression } from './types';
2
- /**
3
- * Parses a FHIR _filter parameter expression into an AST.
4
- * @param input The FHIR _filter parameter expression.
5
- * @returns The AST representing the filters.
6
- */
7
- export declare function parseFilterParameter(input: string): FhirFilterExpression;
@@ -1,2 +0,0 @@
1
- import { Token } from '../fhirlexer/tokenize';
2
- export declare function tokenize(str: string): Token[];
@@ -1,32 +0,0 @@
1
- import { Operator } from '../search/search';
2
- /**
3
- * The FhirFilterExpression type is the base type of all filter expressions.
4
- */
5
- export type FhirFilterExpression = FhirFilterComparison | FhirFilterNegation | FhirFilterConnective;
6
- /**
7
- * The FhirFilterComparison class represents a comparison expression.
8
- */
9
- export declare class FhirFilterComparison {
10
- readonly path: string;
11
- readonly operator: Operator;
12
- readonly value: string;
13
- constructor(path: string, operator: Operator, value: string);
14
- }
15
- /**
16
- * The FhirFilterNegation class represents a negation expression.
17
- * It contains a single child expression.
18
- */
19
- export declare class FhirFilterNegation {
20
- readonly child: FhirFilterExpression;
21
- constructor(child: FhirFilterExpression);
22
- }
23
- /**
24
- * The FhirFilterConnective class represents a connective expression.
25
- * It contains a list of child expressions.
26
- */
27
- export declare class FhirFilterConnective {
28
- readonly keyword: 'and' | 'or';
29
- readonly left: FhirFilterExpression;
30
- readonly right: FhirFilterExpression;
31
- constructor(keyword: 'and' | 'or', left: FhirFilterExpression, right: FhirFilterExpression);
32
- }
@@ -1,120 +0,0 @@
1
- import { Address, CodeableConcept, Coding, HumanName, Money, Observation, ObservationComponent, Period, Quantity, Range, Timing } from '@medplum/fhirtypes';
2
- export interface AddressFormatOptions {
3
- all?: boolean;
4
- use?: boolean;
5
- lineSeparator?: string;
6
- }
7
- export interface HumanNameFormatOptions {
8
- all?: boolean;
9
- prefix?: boolean;
10
- suffix?: boolean;
11
- use?: boolean;
12
- }
13
- /**
14
- * Formats a FHIR Address as a string.
15
- * @param address The address to format.
16
- * @param options Optional address format options.
17
- * @returns The formatted address string.
18
- */
19
- export declare function formatAddress(address: Address, options?: AddressFormatOptions): string;
20
- /**
21
- * Formats a FHIR HumanName as a string.
22
- * @param name The name to format.
23
- * @param options Optional name format options.
24
- * @returns The formatted name string.
25
- */
26
- export declare function formatHumanName(name: HumanName, options?: HumanNameFormatOptions): string;
27
- /**
28
- * Formats the given name portion of a FHIR HumanName element.
29
- * @param name The name to format.
30
- * @returns The formatted given name string.
31
- */
32
- export declare function formatGivenName(name: HumanName): string;
33
- /**
34
- * Formats the family name portion of a FHIR HumanName element.
35
- * @param name The name to format.
36
- * @returns The formatted family name string.
37
- */
38
- export declare function formatFamilyName(name: HumanName): string;
39
- /**
40
- * Returns true if the given date object is a valid date.
41
- * Dates can be invalid if created by parsing an invalid string.
42
- * @param date A date object.
43
- * @returns Returns true if the date is a valid date.
44
- */
45
- export declare function isValidDate(date: Date): boolean;
46
- /**
47
- * Formats a FHIR date string as a human readable string.
48
- * Handles missing values and invalid dates.
49
- * @param date The date to format.
50
- * @param locales Optional locales.
51
- * @param options Optional date format options.
52
- * @returns The formatted date string.
53
- */
54
- export declare function formatDate(date: string | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
55
- /**
56
- * Formats a FHIR time string as a human readable string.
57
- * Handles missing values and invalid dates.
58
- * @param time The date to format.
59
- * @param locales Optional locales.
60
- * @param options Optional time format options.
61
- * @returns The formatted time string.
62
- */
63
- export declare function formatTime(time: string | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
64
- /**
65
- * Formats a FHIR dateTime string as a human readable string.
66
- * Handles missing values and invalid dates.
67
- * @param dateTime The dateTime to format.
68
- * @param locales Optional locales.
69
- * @param options Optional dateTime format options.
70
- * @returns The formatted dateTime string.
71
- */
72
- export declare function formatDateTime(dateTime: string | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
73
- /**
74
- * Formats a FHIR Period as a human readable string.
75
- * @param period The period to format.
76
- * @param locales Optional locales.
77
- * @param options Optional period format options.
78
- * @returns The formatted period string.
79
- */
80
- export declare function formatPeriod(period: Period | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
81
- /**
82
- * Formats a FHIR Timing as a human readable string.
83
- * @param timing The timing to format.
84
- * @returns The formatted timing string.
85
- */
86
- export declare function formatTiming(timing: Timing | undefined): string;
87
- /**
88
- * Returns a human-readable string for a FHIR Range datatype, taking into account one-sided ranges
89
- * @param range A FHIR Range element
90
- * @param precision Number of decimal places to display in the rendered quantity values
91
- * @param exclusive If true, one-sided ranges will be rendered with the '>' or '<' bounds rather than '>=' or '<='
92
- * @returns A human-readable string representation of the Range
93
- */
94
- export declare function formatRange(range: Range | undefined, precision?: number, exclusive?: boolean): string;
95
- /**
96
- * Returns a human-readable string for a FHIR Quantity datatype, taking into account units and comparators
97
- * @param quantity A FHIR Quantity element
98
- * @param precision Number of decimal places to display in the rendered quantity values
99
- * @returns A human-readable string representation of the Quantity
100
- */
101
- export declare function formatQuantity(quantity: Quantity | undefined, precision?: number): string;
102
- export declare function formatMoney(money: Money | undefined): string;
103
- /**
104
- * Formats a CodeableConcept element as a string.
105
- * @param codeableConcept A FHIR CodeableConcept element
106
- * @returns The codeable concept as a string.
107
- */
108
- export declare function formatCodeableConcept(codeableConcept: CodeableConcept | undefined): string;
109
- /**
110
- * Formats a Coding element as a string.
111
- * @param coding A FHIR Coding element
112
- * @returns The coding as a string.
113
- */
114
- export declare function formatCoding(coding: Coding | undefined): string;
115
- /**
116
- * Formats a FHIR Observation resource value as a string.
117
- * @param obs A FHIR Observation resource.
118
- * @returns A human-readable string representation of the Observation.
119
- */
120
- export declare function formatObservationValue(obs: Observation | ObservationComponent | undefined): string;
@@ -1,242 +0,0 @@
1
- /**
2
- * The Hl7Context class represents the parsing context for an HL7 message.
3
- *
4
- * MSH-1:
5
- * https://hl7-definition.caristix.com/v2/HL7v2.6/Fields/MSH.1
6
- *
7
- * MSH-2:
8
- * https://hl7-definition.caristix.com/v2/HL7v2.6/Fields/MSH.2
9
- *
10
- * See this tutorial on MSH, and why it's a bad idea to use anything other than the default values:
11
- * https://www.hl7soup.com/HL7TutorialMSH.html
12
- */
13
- export declare class Hl7Context {
14
- readonly segmentSeparator: string;
15
- readonly fieldSeparator: string;
16
- readonly componentSeparator: string;
17
- readonly repetitionSeparator: string;
18
- readonly escapeCharacter: string;
19
- readonly subcomponentSeparator: string;
20
- constructor(segmentSeparator?: string, fieldSeparator?: string, componentSeparator?: string, repetitionSeparator?: string, escapeCharacter?: string, subcomponentSeparator?: string);
21
- /**
22
- * Returns the MSH-1 field value based on the configured separators.
23
- * @returns The HL7 MSH-1 field value.
24
- */
25
- getMsh1(): string;
26
- /**
27
- * Returns the MSH-2 field value based on the configured separators.
28
- * @returns The HL7 MSH-2 field value.
29
- */
30
- getMsh2(): string;
31
- }
32
- /**
33
- * The Hl7Message class represents one HL7 message.
34
- * A message is a collection of segments.
35
- */
36
- export declare class Hl7Message {
37
- readonly context: Hl7Context;
38
- readonly segments: Hl7Segment[];
39
- /**
40
- * Creates a new HL7 message.
41
- * @param segments The HL7 segments.
42
- * @param context Optional HL7 parsing context.
43
- */
44
- constructor(segments: Hl7Segment[], context?: Hl7Context);
45
- /**
46
- * Returns the HL7 message header.
47
- * @returns The HL7 message header.
48
- */
49
- get header(): Hl7Segment;
50
- /**
51
- * Returns an HL7 segment by index or by name.
52
- * @param index The HL7 segment index or name.
53
- * @returns The HL7 segment if found; otherwise, undefined.
54
- * @deprecated Use getSegment() instead. This method will be removed in a future release.
55
- */
56
- get(index: number | string): Hl7Segment | undefined;
57
- /**
58
- * Returns all HL7 segments of a given name.
59
- * @param name The HL7 segment name.
60
- * @returns An array of HL7 segments with the specified name.
61
- * @deprecated Use getAllSegments() instead. This method will be removed in a future release.
62
- */
63
- getAll(name: string): Hl7Segment[];
64
- /**
65
- * Returns an HL7 segment by index or by name.
66
- *
67
- * When using a numeric index, the first segment (usually the MSH header segment) is at index 0.
68
- *
69
- * When using a string index, this method returns the first segment with the specified name.
70
- *
71
- * @param index The HL7 segment index or name.
72
- * @returns The HL7 segment if found; otherwise, undefined.
73
- */
74
- getSegment(index: number | string): Hl7Segment | undefined;
75
- /**
76
- * Returns all HL7 segments of a given name.
77
- * @param name The HL7 segment name.
78
- * @returns An array of HL7 segments with the specified name.
79
- */
80
- getAllSegments(name: string): Hl7Segment[];
81
- /**
82
- * Returns the HL7 message as a string.
83
- * @returns The HL7 message as a string.
84
- */
85
- toString(): string;
86
- /**
87
- * Returns an HL7 "ACK" (acknowledgement) message for this message.
88
- * @returns The HL7 "ACK" message.
89
- */
90
- buildAck(): Hl7Message;
91
- private buildAckMessageType;
92
- /**
93
- * Parses an HL7 message string into an Hl7Message object.
94
- * @param text The HL7 message text.
95
- * @returns The parsed HL7 message.
96
- */
97
- static parse(text: string): Hl7Message;
98
- }
99
- /**
100
- * The Hl7Segment class represents one HL7 segment.
101
- * A segment is a collection of fields.
102
- * The name field is the first field.
103
- */
104
- export declare class Hl7Segment {
105
- readonly context: Hl7Context;
106
- readonly name: string;
107
- readonly fields: Hl7Field[];
108
- /**
109
- * Creates a new HL7 segment.
110
- * @param fields The HL7 fields. The first field is the segment name.
111
- * @param context Optional HL7 parsing context.
112
- */
113
- constructor(fields: Hl7Field[] | string[], context?: Hl7Context);
114
- /**
115
- * Returns an HL7 field by index.
116
- * @param index The HL7 field index.
117
- * @returns The HL7 field.
118
- * @deprecated Use getSegment() instead. This method includes the segment name in the index, which leads to confusing behavior. This method will be removed in a future release.
119
- */
120
- get(index: number): Hl7Field;
121
- /**
122
- * Returns an HL7 field by index.
123
- *
124
- * Note that the index is 1-based, not 0-based.
125
- *
126
- * For example, to get the first field, use `getField(1)`.
127
- *
128
- * This aligns with HL7 field names such as PID.1, PID.2, etc.
129
- *
130
- * Field zero is the segment name.
131
- *
132
- * @param index The HL7 field index.
133
- * @returns The HL7 field.
134
- */
135
- getField(index: number): Hl7Field;
136
- /**
137
- * Returns an HL7 component by field index and component index.
138
- *
139
- * This is a shortcut for `getField(field).getComponent(component)`.
140
- *
141
- * Note that both indexex are 1-based, not 0-based.
142
- *
143
- * For example, to get the first component, use `getComponent(1, 1)`.
144
- *
145
- * This aligns with HL7 component names such as MSH.9.2.
146
- *
147
- * @param fieldIndex The HL7 field index.
148
- * @param component The component index.
149
- * @param subcomponent Optional subcomponent index.
150
- * @param repetition Optional repetition index.
151
- * @returns The string value of the specified component.
152
- */
153
- getComponent(fieldIndex: number, component: number, subcomponent?: number, repetition?: number): string;
154
- /**
155
- * Returns the HL7 segment as a string.
156
- * @returns The HL7 segment as a string.
157
- */
158
- toString(): string;
159
- /**
160
- * Parses an HL7 segment string into an Hl7Segment object.
161
- * @param text The HL7 segment text.
162
- * @param context Optional HL7 parsing context.
163
- * @returns The parsed HL7 segment.
164
- */
165
- static parse(text: string, context?: Hl7Context): Hl7Segment;
166
- }
167
- /**
168
- * The Hl7Field class represents one HL7 field.
169
- * A field is a collection of components.
170
- */
171
- export declare class Hl7Field {
172
- readonly context: Hl7Context;
173
- readonly components: string[][];
174
- /**
175
- * Creates a new HL7 field.
176
- * @param components The HL7 components.
177
- * @param context Optional HL7 parsing context.
178
- */
179
- constructor(components: string[][], context?: Hl7Context);
180
- /**
181
- * Returns an HL7 component by index.
182
- * @param component The component index.
183
- * @param subcomponent Optional subcomponent index.
184
- * @param repetition Optional repetition index.
185
- * @returns The string value of the specified component.
186
- * @deprecated Use getComponent() instead. This method will be removed in a future release.
187
- */
188
- get(component: number, subcomponent?: number, repetition?: number): string;
189
- /**
190
- * Returns an HL7 component by index.
191
- *
192
- * Note that the index is 1-based, not 0-based.
193
- *
194
- * For example, to get the first component, use `getComponent(1)`.
195
- *
196
- * This aligns with HL7 component names such as MSH.9.2.
197
- *
198
- * @param component The component index.
199
- * @param subcomponent Optional subcomponent index.
200
- * @param repetition Optional repetition index.
201
- * @returns The string value of the specified component.
202
- */
203
- getComponent(component: number, subcomponent?: number, repetition?: number): string;
204
- /**
205
- * Returns the HL7 field as a string.
206
- * @returns The HL7 field as a string.
207
- */
208
- toString(): string;
209
- /**
210
- * Parses an HL7 field string into an Hl7Field object.
211
- * @param text The HL7 field text.
212
- * @param context Optional HL7 parsing context.
213
- * @returns The parsed HL7 field.
214
- */
215
- static parse(text: string, context?: Hl7Context): Hl7Field;
216
- }
217
- export interface Hl7DateParseOptions {
218
- /**
219
- * Default timezone offset.
220
- * Example: "-0500"
221
- */
222
- tzOffset?: string;
223
- }
224
- /**
225
- * Returns a formatted string representing the date in ISO-8601 format.
226
- *
227
- * HL7-Definition V2
228
- * Specifies a point in time using a 24-hour clock notation.
229
- *
230
- * Format: YYYY[MM[DD[HH[MM[SS[. S[S[S[S]]]]]]]]][+/-ZZZZ].
231
- *
232
- * @param hl7DateTime Date/time string.
233
- * @param options Optional parsing options.
234
- * @returns The date in ISO-8601 format.
235
- */
236
- export declare function parseHl7DateTime(hl7DateTime: string | undefined, options?: Hl7DateParseOptions): string | undefined;
237
- /**
238
- * Formats an ISO date/time string into an HL7 date/time string.
239
- * @param isoDate The ISO date/time string.
240
- * @returns The HL7 date/time string.
241
- */
242
- export declare function formatHl7DateTime(isoDate: Date | string): string;
@@ -1,34 +0,0 @@
1
- export * from './access';
2
- export * from './base64';
3
- export * from './base-schema';
4
- export * from './bundle';
5
- export * from './cache';
6
- export * from './client';
7
- export * from './config';
8
- export * from './constants';
9
- export * from './contenttype';
10
- export * from './crypto';
11
- export * from './eventtarget';
12
- export * from './fhircast';
13
- export * from './fhirlexer/parse';
14
- export * from './fhirmapper/parse';
15
- export * from './fhirpath/parse';
16
- export * from './fhirpath/utils';
17
- export * from './filter/parse';
18
- export * from './filter/types';
19
- export * from './format';
20
- export * from './hl7';
21
- export * from './jwt';
22
- export * from './outcomes';
23
- export * from './readablepromise';
24
- export * from './schema';
25
- export * from './search/details';
26
- export * from './search/match';
27
- export * from './search/search';
28
- export * from './sftp';
29
- export * from './storage';
30
- export * from './types';
31
- export * from './typeschema/crawler';
32
- export * from './typeschema/types';
33
- export * from './typeschema/validation';
34
- export * from './utils';
@@ -1,18 +0,0 @@
1
- /**
2
- * Returns true if the token is a JWT.
3
- * @param token The potential JWT token.
4
- * @returns True if the token is a JWT.
5
- */
6
- export declare function isJwt(token: string): boolean;
7
- /**
8
- * Parses the JWT payload.
9
- * @param token JWT token.
10
- * @returns Collection of key value claims in the JWT payload.
11
- */
12
- export declare function parseJWTPayload(token: string): Record<string, number | string>;
13
- /**
14
- * Returns true if the access token was issued by a Medplum server.
15
- * @param accessToken An access token of unknown origin.
16
- * @returns True if the access token was issued by a Medplum server.
17
- */
18
- export declare function isMedplumAccessToken(accessToken: string): boolean;
@@ -1,58 +0,0 @@
1
- import { OperationOutcome, OperationOutcomeIssue } from '@medplum/fhirtypes';
2
- import { Constraint } from './typeschema/types';
3
- export declare const allOk: OperationOutcome;
4
- export declare const created: OperationOutcome;
5
- export declare const notModified: OperationOutcome;
6
- export declare const notFound: OperationOutcome;
7
- export declare const unauthorized: OperationOutcome;
8
- export declare const forbidden: OperationOutcome;
9
- export declare const gone: OperationOutcome;
10
- export declare const tooManyRequests: OperationOutcome;
11
- export declare function accepted(location: string): OperationOutcome;
12
- export declare function badRequest(details: string, expression?: string): OperationOutcome;
13
- export declare function validationError(details: string): OperationOutcome;
14
- export declare function serverError(err: Error): OperationOutcome;
15
- export declare function isOperationOutcome(value: unknown): value is OperationOutcome;
16
- export declare function isOk(outcome: OperationOutcome): boolean;
17
- export declare function isCreated(outcome: OperationOutcome): boolean;
18
- export declare function isAccepted(outcome: OperationOutcome): boolean;
19
- export declare function isNotFound(outcome: OperationOutcome): boolean;
20
- export declare function isGone(outcome: OperationOutcome): boolean;
21
- export declare function getStatus(outcome: OperationOutcome): number;
22
- /**
23
- * Asserts that the operation completed successfully and that the resource is defined.
24
- * @param outcome The operation outcome.
25
- * @param resource The resource that may or may not have been returned.
26
- */
27
- export declare function assertOk<T>(outcome: OperationOutcome, resource: T | undefined): asserts resource is T;
28
- export declare class OperationOutcomeError extends Error {
29
- readonly outcome: OperationOutcome;
30
- constructor(outcome: OperationOutcome, cause?: unknown);
31
- }
32
- /**
33
- * Normalizes an error object into an OperationOutcome.
34
- * @param error The error value which could be a string, Error, OperationOutcome, or other unknown type.
35
- * @returns The normalized OperationOutcome.
36
- */
37
- export declare function normalizeOperationOutcome(error: unknown): OperationOutcome;
38
- /**
39
- * Normalizes an error object into a displayable error string.
40
- * @param error The error value which could be a string, Error, OperationOutcome, or other unknown type.
41
- * @returns A display string for the error.
42
- */
43
- export declare function normalizeErrorString(error: unknown): string;
44
- /**
45
- * Returns a string represenation of the operation outcome.
46
- * @param outcome The operation outcome.
47
- * @returns The string representation of the operation outcome.
48
- */
49
- export declare function operationOutcomeToString(outcome: OperationOutcome): string;
50
- /**
51
- * Returns a string represenation of the operation outcome issue.
52
- * @param issue The operation outcome issue.
53
- * @returns The string representation of the operation outcome issue.
54
- */
55
- export declare function operationOutcomeIssueToString(issue: OperationOutcomeIssue): string;
56
- export declare function createStructureIssue(expression: string, details: string): OperationOutcomeIssue;
57
- export declare function createConstraintIssue(expression: string, constraint: Constraint): OperationOutcomeIssue;
58
- export declare function createProcessingIssue(expression: string, message: string, err: Error, data?: Record<string, any>): OperationOutcomeIssue;
@@ -1,51 +0,0 @@
1
- /**
2
- * The ReadablePromise class wraps a request promise suitable for React Suspense.
3
- * See: https://blog.logrocket.com/react-suspense-data-fetching/#wrappromise-js
4
- * See: https://github.com/ovieokeh/suspense-data-fetching/blob/master/lib/api/wrapPromise.js
5
- */
6
- export declare class ReadablePromise<T> implements Promise<T> {
7
- readonly [Symbol.toStringTag]: string;
8
- private suspender;
9
- private status;
10
- private response;
11
- private error;
12
- constructor(requestPromise: Promise<T>);
13
- /**
14
- * Returns true if the promise is pending.
15
- * @returns True if the Promise is pending.
16
- */
17
- isPending(): boolean;
18
- /**
19
- * Returns true if the promise resolved successfully.
20
- * @returns True if the Promise resolved successfully.
21
- */
22
- isOk(): boolean;
23
- /**
24
- * Attempts to read the value of the promise.
25
- * If the promise is pending, this method will throw a promise.
26
- * If the promise rejected, this method will throw the rejection reason.
27
- * If the promise resolved, this method will return the resolved value.
28
- * @returns The resolved value of the Promise.
29
- */
30
- read(): T;
31
- /**
32
- * Attaches callbacks for the resolution and/or rejection of the Promise.
33
- * @param onfulfilled The callback to execute when the Promise is resolved.
34
- * @param onrejected The callback to execute when the Promise is rejected.
35
- * @returns A Promise for the completion of which ever callback is executed.
36
- */
37
- then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
38
- /**
39
- * Attaches a callback for only the rejection of the Promise.
40
- * @param onrejected The callback to execute when the Promise is rejected.
41
- * @returns A Promise for the completion of the callback.
42
- */
43
- catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
44
- /**
45
- * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
46
- * resolved value cannot be modified from the callback.
47
- * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
48
- * @returns A Promise for the completion of the callback.
49
- */
50
- finally(onfinally?: (() => void) | undefined | null): Promise<T>;
51
- }