@medplum/core 0.9.35 → 0.9.36
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/client.d.ts +14 -5
- package/dist/cjs/fhirlexer/index.d.ts +2 -0
- package/dist/cjs/fhirlexer/parse.d.ts +31 -0
- package/dist/cjs/fhirlexer/tokenize.d.ts +14 -0
- package/dist/cjs/fhirmapper/atoms.d.ts +67 -0
- package/dist/cjs/fhirmapper/parse.d.ts +7 -0
- package/dist/cjs/fhirmapper/tokenize.d.ts +2 -0
- package/dist/cjs/fhirpath/atoms.d.ts +2 -7
- package/dist/cjs/fhirpath/functions.d.ts +2 -1
- package/dist/cjs/fhirpath/parse.d.ts +8 -5
- package/dist/cjs/fhirpath/tokenize.d.ts +3 -4
- package/dist/cjs/fhirpath/utils.d.ts +1 -1
- package/dist/cjs/index.js +310 -272
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.min.js +1 -1
- package/dist/cjs/index.min.js.map +1 -1
- package/dist/cjs/types.d.ts +4 -0
- package/dist/esm/client.d.ts +14 -5
- package/dist/esm/client.js +58 -45
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/fhirlexer/index.d.ts +2 -0
- package/dist/esm/fhirlexer/parse.d.ts +31 -0
- package/dist/esm/fhirlexer/parse.js +105 -0
- package/dist/esm/fhirlexer/parse.js.map +1 -0
- package/dist/esm/fhirlexer/tokenize.d.ts +14 -0
- package/dist/esm/fhirlexer/tokenize.js +212 -0
- package/dist/esm/fhirlexer/tokenize.js.map +1 -0
- package/dist/esm/fhirmapper/atoms.d.ts +67 -0
- package/dist/esm/fhirmapper/parse.d.ts +7 -0
- package/dist/esm/fhirmapper/tokenize.d.ts +2 -0
- package/dist/esm/fhirpath/atoms.d.ts +2 -7
- package/dist/esm/fhirpath/atoms.js.map +1 -1
- package/dist/esm/fhirpath/functions.d.ts +2 -1
- package/dist/esm/fhirpath/functions.js.map +1 -1
- package/dist/esm/fhirpath/parse.d.ts +8 -5
- package/dist/esm/fhirpath/parse.js +57 -169
- package/dist/esm/fhirpath/parse.js.map +1 -1
- package/dist/esm/fhirpath/tokenize.d.ts +3 -4
- package/dist/esm/fhirpath/tokenize.js +5 -180
- package/dist/esm/fhirpath/tokenize.js.map +1 -1
- package/dist/esm/fhirpath/utils.d.ts +1 -1
- package/dist/esm/fhirpath/utils.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.min.js +1 -1
- package/dist/esm/index.min.js.map +1 -1
- package/dist/esm/outcomes.js +1 -1
- package/dist/esm/outcomes.js.map +1 -1
- package/dist/esm/types.d.ts +4 -0
- package/dist/esm/types.js.map +1 -1
- package/package.json +3 -3
package/dist/cjs/client.d.ts
CHANGED
|
@@ -461,6 +461,10 @@ export declare class MedplumClient extends EventTarget {
|
|
|
461
461
|
* @returns Promise to the authentication response.
|
|
462
462
|
*/
|
|
463
463
|
startGoogleLogin(loginRequest: GoogleLoginRequest): Promise<LoginAuthenticationResponse>;
|
|
464
|
+
getCodeChallenge(loginRequest: LoginRequest | GoogleLoginRequest): {
|
|
465
|
+
codeChallenge?: string;
|
|
466
|
+
codeChallengeMethod?: string;
|
|
467
|
+
};
|
|
464
468
|
/**
|
|
465
469
|
* Signs out locally.
|
|
466
470
|
* Does not invalidate tokens with the server.
|
|
@@ -623,7 +627,7 @@ export declare class MedplumClient extends EventTarget {
|
|
|
623
627
|
* @param id The resource ID.
|
|
624
628
|
* @returns The resource if available; undefined otherwise.
|
|
625
629
|
*/
|
|
626
|
-
readResource<K extends ResourceType>(resourceType: K, id: string): ReadablePromise<ExtractResource<K>>;
|
|
630
|
+
readResource<K extends ResourceType>(resourceType: K, id: string, options?: RequestInit): ReadablePromise<ExtractResource<K>>;
|
|
627
631
|
/**
|
|
628
632
|
* Reads a resource by `Reference`.
|
|
629
633
|
*
|
|
@@ -643,7 +647,7 @@ export declare class MedplumClient extends EventTarget {
|
|
|
643
647
|
* @param reference The FHIR reference object.
|
|
644
648
|
* @returns The resource if available; undefined otherwise.
|
|
645
649
|
*/
|
|
646
|
-
readReference<T extends Resource>(reference: Reference<T
|
|
650
|
+
readReference<T extends Resource>(reference: Reference<T>, options?: RequestInit): ReadablePromise<T>;
|
|
647
651
|
/**
|
|
648
652
|
* Returns a cached schema for a resource type.
|
|
649
653
|
* If the schema is not cached, returns undefined.
|
|
@@ -681,7 +685,7 @@ export declare class MedplumClient extends EventTarget {
|
|
|
681
685
|
* @param id The resource ID.
|
|
682
686
|
* @returns Promise to the resource history.
|
|
683
687
|
*/
|
|
684
|
-
readHistory<K extends ResourceType>(resourceType: K, id: string): ReadablePromise<Bundle<ExtractResource<K>>>;
|
|
688
|
+
readHistory<K extends ResourceType>(resourceType: K, id: string, options?: RequestInit): ReadablePromise<Bundle<ExtractResource<K>>>;
|
|
685
689
|
/**
|
|
686
690
|
* Reads a specific version of a resource by resource type, ID, and version ID.
|
|
687
691
|
*
|
|
@@ -699,14 +703,14 @@ export declare class MedplumClient extends EventTarget {
|
|
|
699
703
|
* @param id The resource ID.
|
|
700
704
|
* @returns The resource if available; undefined otherwise.
|
|
701
705
|
*/
|
|
702
|
-
readVersion<K extends ResourceType>(resourceType: K, id: string, vid: string): ReadablePromise<ExtractResource<K>>;
|
|
706
|
+
readVersion<K extends ResourceType>(resourceType: K, id: string, vid: string, options?: RequestInit): ReadablePromise<ExtractResource<K>>;
|
|
703
707
|
/**
|
|
704
708
|
*
|
|
705
709
|
* @category Read
|
|
706
710
|
* @param id The Patient Id
|
|
707
711
|
* @returns A Bundle of all Resources related to the Patient
|
|
708
712
|
*/
|
|
709
|
-
readPatientEverything(id: string): ReadablePromise<Bundle>;
|
|
713
|
+
readPatientEverything(id: string, options?: RequestInit): ReadablePromise<Bundle>;
|
|
710
714
|
/**
|
|
711
715
|
* Creates a new FHIR resource.
|
|
712
716
|
*
|
|
@@ -1094,6 +1098,11 @@ export declare class MedplumClient extends EventTarget {
|
|
|
1094
1098
|
* @returns Promise to the response body as a blob.
|
|
1095
1099
|
*/
|
|
1096
1100
|
download(url: URL | string, options?: RequestInit): Promise<Blob>;
|
|
1101
|
+
/**
|
|
1102
|
+
* Starts a new PKCE flow.
|
|
1103
|
+
* These PKCE values are stateful, and must survive redirects and page refreshes.
|
|
1104
|
+
*/
|
|
1105
|
+
startPkce(): Promise<void>;
|
|
1097
1106
|
/**
|
|
1098
1107
|
* Processes an OAuth authorization code.
|
|
1099
1108
|
* See: https://openid.net/specs/openid-connect-core-1_0.html#TokenRequest
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TypedValue } from '../types';
|
|
2
|
+
import { Token } from './tokenize';
|
|
3
|
+
export interface Atom {
|
|
4
|
+
eval(context: TypedValue[]): TypedValue[];
|
|
5
|
+
}
|
|
6
|
+
export interface PrefixParselet {
|
|
7
|
+
parse(parser: Parser, token: Token): Atom;
|
|
8
|
+
}
|
|
9
|
+
export interface InfixParselet {
|
|
10
|
+
precedence: number;
|
|
11
|
+
parse(parser: Parser, left: Atom, token: Token): Atom;
|
|
12
|
+
}
|
|
13
|
+
export declare class ParserBuilder {
|
|
14
|
+
#private;
|
|
15
|
+
registerInfix(tokenType: string, parselet: InfixParselet): ParserBuilder;
|
|
16
|
+
registerPrefix(tokenType: string, parselet: PrefixParselet): ParserBuilder;
|
|
17
|
+
prefix(tokenType: string, precedence: number, builder: (token: Token, right: Atom) => Atom): ParserBuilder;
|
|
18
|
+
infixLeft(tokenType: string, precedence: number, builder: (left: Atom, token: Token, right: Atom) => Atom): ParserBuilder;
|
|
19
|
+
construct(input: Token[]): Parser;
|
|
20
|
+
}
|
|
21
|
+
export declare class Parser {
|
|
22
|
+
#private;
|
|
23
|
+
constructor(tokens: Token[], prefixParselets: Record<string, PrefixParselet>, infixParselets: Record<string, InfixParselet>);
|
|
24
|
+
hasMore(): boolean;
|
|
25
|
+
match(expected: string): boolean;
|
|
26
|
+
consumeAndParse(precedence?: number): Atom;
|
|
27
|
+
getPrecedence(): number;
|
|
28
|
+
consume(expected?: string): Token;
|
|
29
|
+
peek(): Token | undefined;
|
|
30
|
+
removeComments(): void;
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Marker {
|
|
2
|
+
index: number;
|
|
3
|
+
line: number;
|
|
4
|
+
column: number;
|
|
5
|
+
}
|
|
6
|
+
export interface Token extends Marker {
|
|
7
|
+
id: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class Tokenizer {
|
|
11
|
+
#private;
|
|
12
|
+
constructor(str: string, keywords: string[], operators: string[]);
|
|
13
|
+
tokenize(): Token[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Atom } from '../fhirlexer';
|
|
2
|
+
declare abstract class DefaultFhirMapperAtom implements Atom {
|
|
3
|
+
eval(): never;
|
|
4
|
+
}
|
|
5
|
+
export declare class MappingLanguageAtom extends DefaultFhirMapperAtom {
|
|
6
|
+
readonly original: string;
|
|
7
|
+
readonly child: Atom;
|
|
8
|
+
constructor(original: string, child: Atom);
|
|
9
|
+
}
|
|
10
|
+
export declare class MapAtom extends DefaultFhirMapperAtom {
|
|
11
|
+
readonly url: string;
|
|
12
|
+
readonly identifier: string;
|
|
13
|
+
constructor(url: string, identifier: string);
|
|
14
|
+
}
|
|
15
|
+
export declare class UsesAtom extends DefaultFhirMapperAtom {
|
|
16
|
+
readonly url: string;
|
|
17
|
+
readonly modelMode: string;
|
|
18
|
+
constructor(url: string, modelMode: string);
|
|
19
|
+
}
|
|
20
|
+
export declare class GroupAtom extends DefaultFhirMapperAtom {
|
|
21
|
+
readonly identifier: string;
|
|
22
|
+
readonly parameters: ParameterAtom[];
|
|
23
|
+
readonly rules: RuleAtom[];
|
|
24
|
+
constructor(identifier: string, parameters: ParameterAtom[], rules: RuleAtom[]);
|
|
25
|
+
}
|
|
26
|
+
export declare class ParameterAtom extends DefaultFhirMapperAtom {
|
|
27
|
+
readonly inputMode: string;
|
|
28
|
+
readonly identifier: string;
|
|
29
|
+
readonly type: string;
|
|
30
|
+
constructor(inputMode: string, identifier: string, type: string);
|
|
31
|
+
}
|
|
32
|
+
export declare class RuleAtom extends DefaultFhirMapperAtom {
|
|
33
|
+
readonly sources: RuleSourceAtom[];
|
|
34
|
+
readonly targets: RuleTargetAtom[] | undefined;
|
|
35
|
+
readonly dependent: RuleDependentAtom | undefined;
|
|
36
|
+
readonly name: string | undefined;
|
|
37
|
+
constructor(sources: RuleSourceAtom[], targets: RuleTargetAtom[] | undefined, dependent: RuleDependentAtom | undefined, name: string | undefined);
|
|
38
|
+
}
|
|
39
|
+
export declare class RuleSourceAtom extends DefaultFhirMapperAtom {
|
|
40
|
+
readonly context: string | undefined;
|
|
41
|
+
readonly sourceType: string | undefined;
|
|
42
|
+
readonly sourceDefault: Atom | undefined;
|
|
43
|
+
readonly sourceListMode: string | undefined;
|
|
44
|
+
readonly alias: string | undefined;
|
|
45
|
+
readonly whereClause: Atom | undefined;
|
|
46
|
+
readonly checkClause: Atom | undefined;
|
|
47
|
+
readonly log: Atom | undefined;
|
|
48
|
+
constructor(context: string | undefined, sourceType: string | undefined, sourceDefault: Atom | undefined, sourceListMode: string | undefined, alias: string | undefined, whereClause: Atom | undefined, checkClause: Atom | undefined, log: Atom | undefined);
|
|
49
|
+
}
|
|
50
|
+
export declare class RuleTargetAtom extends DefaultFhirMapperAtom {
|
|
51
|
+
readonly context: string;
|
|
52
|
+
readonly transform: Atom | undefined;
|
|
53
|
+
readonly alias: string | undefined;
|
|
54
|
+
readonly targetListMode: string | undefined;
|
|
55
|
+
constructor(context: string, transform: Atom | undefined, alias: string | undefined, targetListMode: string | undefined);
|
|
56
|
+
}
|
|
57
|
+
export declare class RuleInvocationAtom extends DefaultFhirMapperAtom {
|
|
58
|
+
readonly identifier: string;
|
|
59
|
+
readonly parameters: Atom[];
|
|
60
|
+
constructor(identifier: string, parameters: Atom[]);
|
|
61
|
+
}
|
|
62
|
+
export declare class RuleDependentAtom extends DefaultFhirMapperAtom {
|
|
63
|
+
readonly invocation: RuleInvocationAtom;
|
|
64
|
+
readonly rules: RuleAtom[];
|
|
65
|
+
constructor(invocation: RuleInvocationAtom, rules: RuleAtom[]);
|
|
66
|
+
}
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Atom } from '../fhirlexer';
|
|
2
|
+
/**
|
|
3
|
+
* Parses a FHIR Mapping Language document into an AST.
|
|
4
|
+
* @param input The FHIR Mapping Language document to parse.
|
|
5
|
+
* @returns The AST representing the document.
|
|
6
|
+
*/
|
|
7
|
+
export declare function parseMappingLanguage(input: string): Atom[];
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
+
import { Atom } from '../fhirlexer';
|
|
2
|
+
import { TypedValue } from '../types';
|
|
1
3
|
import { FhirPathFunction } from './functions';
|
|
2
|
-
export interface TypedValue {
|
|
3
|
-
readonly type: string;
|
|
4
|
-
readonly value: any;
|
|
5
|
-
}
|
|
6
|
-
export interface Atom {
|
|
7
|
-
eval(context: TypedValue[]): TypedValue[];
|
|
8
|
-
}
|
|
9
4
|
export declare class FhirPathAtom implements Atom {
|
|
10
5
|
readonly original: string;
|
|
11
6
|
readonly child: Atom;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ParserBuilder } from '../fhirlexer';
|
|
2
|
+
import { TypedValue } from '../types';
|
|
3
|
+
import { FhirPathAtom } from './atoms';
|
|
4
|
+
export declare function initFhirPathParserBuilder(): ParserBuilder;
|
|
2
5
|
/**
|
|
3
6
|
* Parses a FHIRPath expression into an AST.
|
|
4
7
|
* The result can be used to evaluate the expression against a resource or other object.
|
|
@@ -10,15 +13,15 @@ import { FhirPathAtom, TypedValue } from './atoms';
|
|
|
10
13
|
export declare function parseFhirPath(input: string): FhirPathAtom;
|
|
11
14
|
/**
|
|
12
15
|
* Evaluates a FHIRPath expression against a resource or other object.
|
|
13
|
-
* @param
|
|
14
|
-
* @param
|
|
16
|
+
* @param expression The FHIRPath expression to parse.
|
|
17
|
+
* @param input The resource or object to evaluate the expression against.
|
|
15
18
|
* @returns The result of the FHIRPath expression against the resource or object.
|
|
16
19
|
*/
|
|
17
20
|
export declare function evalFhirPath(expression: string, input: unknown): unknown[];
|
|
18
21
|
/**
|
|
19
22
|
* Evaluates a FHIRPath expression against a resource or other object.
|
|
20
|
-
* @param
|
|
21
|
-
* @param
|
|
23
|
+
* @param expression The FHIRPath expression to parse.
|
|
24
|
+
* @param input The resource or object to evaluate the expression against.
|
|
22
25
|
* @returns The result of the FHIRPath expression against the resource or object.
|
|
23
26
|
*/
|
|
24
27
|
export declare function evalFhirPathTyped(expression: string, input: TypedValue[]): TypedValue[];
|