@medplum/core 2.0.1 → 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 +7 -3
- package/dist/cjs/client.d.ts +13 -2
- package/dist/cjs/index.cjs +371 -231
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.min.cjs +1 -1
- package/dist/cjs/outcomes.d.ts +1 -0
- package/dist/esm/base-schema.json.mjs +7 -0
- package/dist/esm/base-schema.json.mjs.map +1 -1
- package/dist/esm/client.d.ts +13 -2
- package/dist/esm/client.mjs +135 -28
- package/dist/esm/client.mjs.map +1 -1
- package/dist/esm/index.min.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/outcomes.d.ts +1 -0
- package/dist/esm/outcomes.mjs +6 -4
- package/dist/esm/outcomes.mjs.map +1 -1
- package/dist/esm/types.mjs +24 -0
- package/dist/esm/types.mjs.map +1 -1
- package/package.json +1 -1
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<
|
|
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
|
|
89
|
+
const bundle = await medplum.search('Patient', 'given=eve');
|
|
86
90
|
bundle.entry.forEach((entry) => console.log(entry.resource));
|
|
87
91
|
```
|
|
88
92
|
|
package/dist/cjs/client.d.ts
CHANGED
|
@@ -224,7 +224,7 @@ export interface BotEvent<T = Resource | Hl7Message | string | Record<string, an
|
|
|
224
224
|
}
|
|
225
225
|
/**
|
|
226
226
|
* JSONPatch patch operation.
|
|
227
|
-
* Compatible with fast-json-patch Operation.
|
|
227
|
+
* Compatible with fast-json-patch and rfc6902 Operation.
|
|
228
228
|
*/
|
|
229
229
|
export interface PatchOperation {
|
|
230
230
|
readonly op: 'add' | 'remove' | 'replace' | 'copy' | 'move' | 'test';
|
|
@@ -496,7 +496,7 @@ export declare class MedplumClient extends EventTarget {
|
|
|
496
496
|
* Does not invalidate tokens with the server.
|
|
497
497
|
* @category Authentication
|
|
498
498
|
*/
|
|
499
|
-
signOut(): void
|
|
499
|
+
signOut(): Promise<void>;
|
|
500
500
|
/**
|
|
501
501
|
* Tries to sign in the user.
|
|
502
502
|
* Returns true if the user is signed in.
|
|
@@ -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`.
|