@medplum/core 0.9.17 → 0.9.20

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.
@@ -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 googleResponse The Google credential response.
408
+ * @param loginRequest Login request including Google credential response.
399
409
  * @returns Promise to the authentication response.
400
410
  */
401
- startGoogleLogin(googleResponse: GoogleCredentialResponse): Promise<LoginAuthenticationResponse>;
411
+ startGoogleLogin(loginRequest: GoogleLoginRequest): Promise<LoginAuthenticationResponse>;
402
412
  /**
403
413
  * Signs out locally.
404
414
  * Does not invalidate tokens with the server.
@@ -844,7 +854,54 @@ export declare class MedplumClient extends EventTarget {
844
854
  * @returns Promise to the operation outcome.
845
855
  */
846
856
  sendEmail(email: MailOptions): Promise<OperationOutcome>;
847
- graphql(query: string, options?: RequestInit): Promise<any>;
857
+ /**
858
+ * Executes a GraphQL query.
859
+ *
860
+ * Example:
861
+ *
862
+ * ```typescript
863
+ * const result = await medplum.graphql(`{
864
+ * Patient(id: "123") {
865
+ * resourceType
866
+ * id
867
+ * name {
868
+ * given
869
+ * family
870
+ * }
871
+ * }
872
+ * }`);
873
+ * ```
874
+ *
875
+ * Advanced queries such as named operations and variable substitution are supported:
876
+ *
877
+ * ```typescript
878
+ * const result = await medplum.graphql(
879
+ * `query GetPatientById($patientId: ID!) {
880
+ * Patient(id: $patientId) {
881
+ * resourceType
882
+ * id
883
+ * name {
884
+ * given
885
+ * family
886
+ * }
887
+ * }
888
+ * }`,
889
+ * 'GetPatientById',
890
+ * { patientId: '123' }
891
+ * );
892
+ * ```
893
+ *
894
+ * See the GraphQL documentation for more details: https://graphql.org/learn/
895
+ *
896
+ * See the FHIR GraphQL documentation for FHIR specific details: https://www.hl7.org/fhir/graphql.html
897
+ *
898
+ * @param query The GraphQL query.
899
+ * @param operationName Optional GraphQL operation name.
900
+ * @param variables Optional GraphQL variables.
901
+ * @param options Optional fetch options.
902
+ * @returns The GraphQL result.
903
+ */
904
+ graphql(query: string, operationName?: string | null, variables?: any, options?: RequestInit): Promise<any>;
848
905
  getActiveLogin(): LoginState | undefined;
849
906
  setActiveLogin(login: LoginState): Promise<void>;
850
907
  getAccessToken(): string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medplum/core",
3
- "version": "0.9.17",
3
+ "version": "0.9.20",
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.17",
21
- "@medplum/fhirtypes": "0.9.17"
20
+ "@medplum/definitions": "0.9.20",
21
+ "@medplum/fhirtypes": "0.9.20"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "pdfmake": "0.2.5"