@medplum/core 2.0.2 → 2.0.3

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/README.md CHANGED
@@ -58,7 +58,7 @@ Before you begin
58
58
  After that, you can use the `startLogin()` method:
59
59
 
60
60
  ```ts
61
- const loginResult = await medplum.startLogin(email, password, remember);
61
+ const loginResult = await medplum.startLogin({ email, password, remember });
62
62
  const profile = await medplum.processCode(loginResult.code);
63
63
  console.log(profile);
64
64
  ```
@@ -76,13 +76,17 @@ medplum.signInWithRedirect().then((user) => console.log(user));
76
76
  Search for any resource using a [FHIR search](https://www.hl7.org/fhir/search.html) string:
77
77
 
78
78
  ```ts
79
- search<T extends Resource>(query: string | SearchRequest, options: RequestInit = {}): ReadablePromise<Bundle<T>>
79
+ search<K extends ResourceType>(
80
+ resourceType: K,
81
+ query?: URLSearchParams | string,
82
+ options: RequestInit = {}
83
+ ): ReadablePromise<Bundle<ExtractResource<K>>>
80
84
  ```
81
85
 
82
86
  Example:
83
87
 
84
88
  ```ts
85
- const bundle = await medplum.search('Patient?given=eve');
89
+ const bundle = await medplum.search('Patient', 'given=eve');
86
90
  bundle.entry.forEach((entry) => console.log(entry.resource));
87
91
  ```
88
92
 
@@ -517,8 +517,19 @@ export declare class MedplumClient extends EventTarget {
517
517
  * @param clientId The external client ID.
518
518
  * @param redirectUri The external identity provider redirect URI.
519
519
  * @param baseLogin The Medplum login request.
520
+ * @category Authentication
520
521
  */
521
522
  signInWithExternalAuth(authorizeUrl: string, clientId: string, redirectUri: string, baseLogin: BaseLoginRequest): Promise<void>;
523
+ /**
524
+ * Builds the external identity provider redirect URI.
525
+ * @param authorizeUrl The external authorization URL.
526
+ * @param clientId The external client ID.
527
+ * @param redirectUri The external identity provider redirect URI.
528
+ * @param loginRequest The Medplum login request.
529
+ * @returns The external identity provider redirect URI.
530
+ * @category Authentication
531
+ */
532
+ getExternalAuthRedirectUri(authorizeUrl: string, clientId: string, redirectUri: string, loginRequest: BaseLoginRequest): string;
522
533
  /**
523
534
  * Builds a FHIR URL from a collection of URL path components.
524
535
  * For example, `buildUrl('/Patient', '123')` returns `fhir/R4/Patient/123`.