@medplum/core 0.9.18 → 0.9.21
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.js +105 -6
- 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/esm/index.js +105 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +1 -1
- package/dist/esm/index.min.js.map +1 -1
- package/dist/types/client.d.ts +108 -3
- package/package.json +3 -3
package/dist/types/client.d.ts
CHANGED
|
@@ -140,6 +140,9 @@ export interface LoginRequest {
|
|
|
140
140
|
readonly password: string;
|
|
141
141
|
readonly remember?: boolean;
|
|
142
142
|
readonly projectId?: string;
|
|
143
|
+
readonly clientId?: string;
|
|
144
|
+
readonly scope?: string;
|
|
145
|
+
readonly nonce?: string;
|
|
143
146
|
}
|
|
144
147
|
export interface RegisterRequest {
|
|
145
148
|
readonly firstName: string;
|
|
@@ -154,6 +157,13 @@ export interface GoogleCredentialResponse {
|
|
|
154
157
|
readonly clientId: string;
|
|
155
158
|
readonly credential: string;
|
|
156
159
|
}
|
|
160
|
+
export interface GoogleLoginRequest {
|
|
161
|
+
readonly googleClientId: string;
|
|
162
|
+
readonly googleCredential: string;
|
|
163
|
+
readonly clientId?: string;
|
|
164
|
+
readonly scope?: string;
|
|
165
|
+
readonly nonce?: string;
|
|
166
|
+
}
|
|
157
167
|
export interface LoginAuthenticationResponse {
|
|
158
168
|
readonly login: string;
|
|
159
169
|
readonly code?: string;
|
|
@@ -395,10 +405,10 @@ export declare class MedplumClient extends EventTarget {
|
|
|
395
405
|
* Tries to sign in with Google authentication.
|
|
396
406
|
* The response parameter is the result of a Google authentication.
|
|
397
407
|
* See: https://developers.google.com/identity/gsi/web/guides/handle-credential-responses-js-functions
|
|
398
|
-
* @param
|
|
408
|
+
* @param loginRequest Login request including Google credential response.
|
|
399
409
|
* @returns Promise to the authentication response.
|
|
400
410
|
*/
|
|
401
|
-
startGoogleLogin(
|
|
411
|
+
startGoogleLogin(loginRequest: GoogleLoginRequest): Promise<LoginAuthenticationResponse>;
|
|
402
412
|
/**
|
|
403
413
|
* Signs out locally.
|
|
404
414
|
* Does not invalidate tokens with the server.
|
|
@@ -806,6 +816,54 @@ export declare class MedplumClient extends EventTarget {
|
|
|
806
816
|
* @returns The result of the delete operation.
|
|
807
817
|
*/
|
|
808
818
|
deleteResource(resourceType: ResourceType, id: string): Promise<any>;
|
|
819
|
+
/**
|
|
820
|
+
* Executes a batch or transaction of FHIR operations.
|
|
821
|
+
*
|
|
822
|
+
* Example:
|
|
823
|
+
*
|
|
824
|
+
* ```typescript
|
|
825
|
+
* await medplum.executeBatch({
|
|
826
|
+
* "resourceType": "Bundle",
|
|
827
|
+
* "type": "transaction",
|
|
828
|
+
* "entry": [
|
|
829
|
+
* {
|
|
830
|
+
* "fullUrl": "urn:uuid:61ebe359-bfdc-4613-8bf2-c5e300945f0a",
|
|
831
|
+
* "resource": {
|
|
832
|
+
* "resourceType": "Patient",
|
|
833
|
+
* "name": [{ "use": "official", "given": ["Alice"], "family": "Smith" }],
|
|
834
|
+
* "gender": "female",
|
|
835
|
+
* "birthDate": "1974-12-25"
|
|
836
|
+
* },
|
|
837
|
+
* "request": {
|
|
838
|
+
* "method": "POST",
|
|
839
|
+
* "url": "Patient"
|
|
840
|
+
* }
|
|
841
|
+
* },
|
|
842
|
+
* {
|
|
843
|
+
* "fullUrl": "urn:uuid:88f151c0-a954-468a-88bd-5ae15c08e059",
|
|
844
|
+
* "resource": {
|
|
845
|
+
* "resourceType": "Patient",
|
|
846
|
+
* "identifier": [{ "system": "http:/example.org/fhir/ids", "value": "234234" }],
|
|
847
|
+
* "name": [{ "use": "official", "given": ["Bob"], "family": "Jones" }],
|
|
848
|
+
* "gender": "male",
|
|
849
|
+
* "birthDate": "1974-12-25"
|
|
850
|
+
* },
|
|
851
|
+
* "request": {
|
|
852
|
+
* "method": "POST",
|
|
853
|
+
* "url": "Patient",
|
|
854
|
+
* "ifNoneExist": "identifier=http:/example.org/fhir/ids|234234"
|
|
855
|
+
* }
|
|
856
|
+
* }
|
|
857
|
+
* ]
|
|
858
|
+
* });
|
|
859
|
+
* ```
|
|
860
|
+
*
|
|
861
|
+
* See The FHIR "batch/transaction" section for full details: https://hl7.org/fhir/http.html#transaction
|
|
862
|
+
*
|
|
863
|
+
* @param bundle The FHIR batch/transaction bundle.
|
|
864
|
+
* @returns The FHIR batch/transaction response bundle.
|
|
865
|
+
*/
|
|
866
|
+
executeBatch(bundle: Bundle): Promise<Bundle>;
|
|
809
867
|
/**
|
|
810
868
|
* Sends an email using the Medplum Email API.
|
|
811
869
|
*
|
|
@@ -844,7 +902,54 @@ export declare class MedplumClient extends EventTarget {
|
|
|
844
902
|
* @returns Promise to the operation outcome.
|
|
845
903
|
*/
|
|
846
904
|
sendEmail(email: MailOptions): Promise<OperationOutcome>;
|
|
847
|
-
|
|
905
|
+
/**
|
|
906
|
+
* Executes a GraphQL query.
|
|
907
|
+
*
|
|
908
|
+
* Example:
|
|
909
|
+
*
|
|
910
|
+
* ```typescript
|
|
911
|
+
* const result = await medplum.graphql(`{
|
|
912
|
+
* Patient(id: "123") {
|
|
913
|
+
* resourceType
|
|
914
|
+
* id
|
|
915
|
+
* name {
|
|
916
|
+
* given
|
|
917
|
+
* family
|
|
918
|
+
* }
|
|
919
|
+
* }
|
|
920
|
+
* }`);
|
|
921
|
+
* ```
|
|
922
|
+
*
|
|
923
|
+
* Advanced queries such as named operations and variable substitution are supported:
|
|
924
|
+
*
|
|
925
|
+
* ```typescript
|
|
926
|
+
* const result = await medplum.graphql(
|
|
927
|
+
* `query GetPatientById($patientId: ID!) {
|
|
928
|
+
* Patient(id: $patientId) {
|
|
929
|
+
* resourceType
|
|
930
|
+
* id
|
|
931
|
+
* name {
|
|
932
|
+
* given
|
|
933
|
+
* family
|
|
934
|
+
* }
|
|
935
|
+
* }
|
|
936
|
+
* }`,
|
|
937
|
+
* 'GetPatientById',
|
|
938
|
+
* { patientId: '123' }
|
|
939
|
+
* );
|
|
940
|
+
* ```
|
|
941
|
+
*
|
|
942
|
+
* See the GraphQL documentation for more details: https://graphql.org/learn/
|
|
943
|
+
*
|
|
944
|
+
* See the FHIR GraphQL documentation for FHIR specific details: https://www.hl7.org/fhir/graphql.html
|
|
945
|
+
*
|
|
946
|
+
* @param query The GraphQL query.
|
|
947
|
+
* @param operationName Optional GraphQL operation name.
|
|
948
|
+
* @param variables Optional GraphQL variables.
|
|
949
|
+
* @param options Optional fetch options.
|
|
950
|
+
* @returns The GraphQL result.
|
|
951
|
+
*/
|
|
952
|
+
graphql(query: string, operationName?: string | null, variables?: any, options?: RequestInit): Promise<any>;
|
|
848
953
|
getActiveLogin(): LoginState | undefined;
|
|
849
954
|
setActiveLogin(login: LoginState): Promise<void>;
|
|
850
955
|
getAccessToken(): string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medplum/core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.21",
|
|
4
4
|
"description": "Medplum TS/JS Library",
|
|
5
5
|
"author": "Medplum <hello@medplum.com>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"test": "jest"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@medplum/definitions": "0.9.
|
|
21
|
-
"@medplum/fhirtypes": "0.9.
|
|
20
|
+
"@medplum/definitions": "0.9.21",
|
|
21
|
+
"@medplum/fhirtypes": "0.9.21"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"pdfmake": "0.2.5"
|