@medplum/core 0.9.21 → 0.9.22
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 +81 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.min.js.map +1 -1
- package/dist/esm/index.js +81 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js.map +1 -1
- package/dist/types/client.d.ts +80 -2
- package/dist/types/utils.d.ts +3 -0
- package/package.json +3 -3
package/dist/esm/index.js
CHANGED
|
@@ -6184,6 +6184,7 @@ class MedplumClient extends EventTarget {
|
|
|
6184
6184
|
* Returns the current base URL for all API requests.
|
|
6185
6185
|
* By default, this is set to `https://api.medplum.com/`.
|
|
6186
6186
|
* This can be overridden by setting the `baseUrl` option when creating the client.
|
|
6187
|
+
* @category HTTP
|
|
6187
6188
|
* @returns The current base URL for all API requests.
|
|
6188
6189
|
*/
|
|
6189
6190
|
getBaseUrl() {
|
|
@@ -6191,6 +6192,7 @@ class MedplumClient extends EventTarget {
|
|
|
6191
6192
|
}
|
|
6192
6193
|
/**
|
|
6193
6194
|
* Clears all auth state including local storage and session storage.
|
|
6195
|
+
* @category Authentication
|
|
6194
6196
|
*/
|
|
6195
6197
|
clear() {
|
|
6196
6198
|
__classPrivateFieldGet(this, _MedplumClient_storage, "f").clear();
|
|
@@ -6203,6 +6205,7 @@ class MedplumClient extends EventTarget {
|
|
|
6203
6205
|
}
|
|
6204
6206
|
/**
|
|
6205
6207
|
* Invalidates any cached values or cached requests for the given URL.
|
|
6208
|
+
* @category Caching
|
|
6206
6209
|
* @param url The URL to invalidate.
|
|
6207
6210
|
*/
|
|
6208
6211
|
invalidateUrl(url) {
|
|
@@ -6211,6 +6214,7 @@ class MedplumClient extends EventTarget {
|
|
|
6211
6214
|
}
|
|
6212
6215
|
/**
|
|
6213
6216
|
* Invalidates all cached search results or cached requests for the given resourceType.
|
|
6217
|
+
* @category Caching
|
|
6214
6218
|
* @param resourceType The resource type to invalidate.
|
|
6215
6219
|
*/
|
|
6216
6220
|
invalidateSearches(resourceType) {
|
|
@@ -6228,6 +6232,7 @@ class MedplumClient extends EventTarget {
|
|
|
6228
6232
|
* For common operations, we recommend using higher level methods
|
|
6229
6233
|
* such as `readResource()`, `search()`, etc.
|
|
6230
6234
|
*
|
|
6235
|
+
* @category HTTP
|
|
6231
6236
|
* @param url The target URL.
|
|
6232
6237
|
* @param options Optional fetch options.
|
|
6233
6238
|
* @returns Promise to the response content.
|
|
@@ -6249,6 +6254,7 @@ class MedplumClient extends EventTarget {
|
|
|
6249
6254
|
* For common operations, we recommend using higher level methods
|
|
6250
6255
|
* such as `createResource()`.
|
|
6251
6256
|
*
|
|
6257
|
+
* @category HTTP
|
|
6252
6258
|
* @param url The target URL.
|
|
6253
6259
|
* @param body The content body. Strings and `File` objects are passed directly. Other objects are converted to JSON.
|
|
6254
6260
|
* @param contentType The content type to be included in the "Content-Type" header.
|
|
@@ -6273,6 +6279,7 @@ class MedplumClient extends EventTarget {
|
|
|
6273
6279
|
* For common operations, we recommend using higher level methods
|
|
6274
6280
|
* such as `updateResource()`.
|
|
6275
6281
|
*
|
|
6282
|
+
* @category HTTP
|
|
6276
6283
|
* @param url The target URL.
|
|
6277
6284
|
* @param body The content body. Strings and `File` objects are passed directly. Other objects are converted to JSON.
|
|
6278
6285
|
* @param contentType The content type to be included in the "Content-Type" header.
|
|
@@ -6297,6 +6304,7 @@ class MedplumClient extends EventTarget {
|
|
|
6297
6304
|
* For common operations, we recommend using higher level methods
|
|
6298
6305
|
* such as `patchResource()`.
|
|
6299
6306
|
*
|
|
6307
|
+
* @category HTTP
|
|
6300
6308
|
* @param url The target URL.
|
|
6301
6309
|
* @param operations Array of JSONPatch operations.
|
|
6302
6310
|
* @param options Optional fetch options.
|
|
@@ -6312,10 +6320,12 @@ class MedplumClient extends EventTarget {
|
|
|
6312
6320
|
/**
|
|
6313
6321
|
* Makes an HTTP DELETE request to the specified URL.
|
|
6314
6322
|
*
|
|
6323
|
+
*
|
|
6315
6324
|
* This is a lower level method for custom requests.
|
|
6316
6325
|
* For common operations, we recommend using higher level methods
|
|
6317
6326
|
* such as `deleteResource()`.
|
|
6318
6327
|
*
|
|
6328
|
+
* @category HTTP
|
|
6319
6329
|
* @param url The target URL.
|
|
6320
6330
|
* @param options Optional fetch options.
|
|
6321
6331
|
* @returns Promise to the response content.
|
|
@@ -6327,6 +6337,7 @@ class MedplumClient extends EventTarget {
|
|
|
6327
6337
|
}
|
|
6328
6338
|
/**
|
|
6329
6339
|
* Tries to register a new user.
|
|
6340
|
+
* @category Authentication
|
|
6330
6341
|
* @param request The registration request.
|
|
6331
6342
|
* @returns Promise to the authentication response.
|
|
6332
6343
|
*/
|
|
@@ -6338,6 +6349,7 @@ class MedplumClient extends EventTarget {
|
|
|
6338
6349
|
}
|
|
6339
6350
|
/**
|
|
6340
6351
|
* Initiates a user login flow.
|
|
6352
|
+
* @category Authentication
|
|
6341
6353
|
* @param loginRequest Login request including email and password.
|
|
6342
6354
|
* @returns Promise to the authentication response.
|
|
6343
6355
|
*/
|
|
@@ -6352,6 +6364,7 @@ class MedplumClient extends EventTarget {
|
|
|
6352
6364
|
* Tries to sign in with Google authentication.
|
|
6353
6365
|
* The response parameter is the result of a Google authentication.
|
|
6354
6366
|
* See: https://developers.google.com/identity/gsi/web/guides/handle-credential-responses-js-functions
|
|
6367
|
+
* @category Authentication
|
|
6355
6368
|
* @param loginRequest Login request including Google credential response.
|
|
6356
6369
|
* @returns Promise to the authentication response.
|
|
6357
6370
|
*/
|
|
@@ -6365,6 +6378,7 @@ class MedplumClient extends EventTarget {
|
|
|
6365
6378
|
/**
|
|
6366
6379
|
* Signs out locally.
|
|
6367
6380
|
* Does not invalidate tokens with the server.
|
|
6381
|
+
* @category Authentication
|
|
6368
6382
|
*/
|
|
6369
6383
|
signOut() {
|
|
6370
6384
|
this.clear();
|
|
@@ -6374,6 +6388,7 @@ class MedplumClient extends EventTarget {
|
|
|
6374
6388
|
* Tries to sign in the user.
|
|
6375
6389
|
* Returns true if the user is signed in.
|
|
6376
6390
|
* This may result in navigating away to the sign in page.
|
|
6391
|
+
* @category Authentication
|
|
6377
6392
|
*/
|
|
6378
6393
|
signInWithRedirect() {
|
|
6379
6394
|
const urlParams = new URLSearchParams(window.location.search);
|
|
@@ -6389,6 +6404,7 @@ class MedplumClient extends EventTarget {
|
|
|
6389
6404
|
/**
|
|
6390
6405
|
* Tries to sign out the user.
|
|
6391
6406
|
* See: https://docs.aws.amazon.com/cognito/latest/developerguide/logout-endpoint.html
|
|
6407
|
+
* @category Authentication
|
|
6392
6408
|
*/
|
|
6393
6409
|
signOutWithRedirect() {
|
|
6394
6410
|
window.location.assign(__classPrivateFieldGet(this, _MedplumClient_logoutUrl, "f"));
|
|
@@ -6396,6 +6412,7 @@ class MedplumClient extends EventTarget {
|
|
|
6396
6412
|
/**
|
|
6397
6413
|
* Builds a FHIR URL from a collection of URL path components.
|
|
6398
6414
|
* For example, `buildUrl('/Patient', '123')` returns `fhir/R4/Patient/123`.
|
|
6415
|
+
* @category HTTP
|
|
6399
6416
|
* @param path The path component of the URL.
|
|
6400
6417
|
* @returns The well-formed FHIR URL.
|
|
6401
6418
|
*/
|
|
@@ -6404,6 +6421,8 @@ class MedplumClient extends EventTarget {
|
|
|
6404
6421
|
}
|
|
6405
6422
|
/**
|
|
6406
6423
|
* Builds a FHIR search URL from a search query or structured query object.
|
|
6424
|
+
* @category HTTP
|
|
6425
|
+
* @category Search
|
|
6407
6426
|
* @param query The FHIR search query or structured query object.
|
|
6408
6427
|
* @returns The well-formed FHIR URL.
|
|
6409
6428
|
*/
|
|
@@ -6451,6 +6470,7 @@ class MedplumClient extends EventTarget {
|
|
|
6451
6470
|
*
|
|
6452
6471
|
* See FHIR search for full details: https://www.hl7.org/fhir/search.html
|
|
6453
6472
|
*
|
|
6473
|
+
* @category Search
|
|
6454
6474
|
* @param query The search query as either a string or a structured search object.
|
|
6455
6475
|
* @returns Promise to the search result bundle.
|
|
6456
6476
|
*/
|
|
@@ -6473,6 +6493,7 @@ class MedplumClient extends EventTarget {
|
|
|
6473
6493
|
*
|
|
6474
6494
|
* See FHIR search for full details: https://www.hl7.org/fhir/search.html
|
|
6475
6495
|
*
|
|
6496
|
+
* @category Search
|
|
6476
6497
|
* @param query The search query as either a string or a structured search object.
|
|
6477
6498
|
* @returns Promise to the search result bundle.
|
|
6478
6499
|
*/
|
|
@@ -6505,6 +6526,7 @@ class MedplumClient extends EventTarget {
|
|
|
6505
6526
|
*
|
|
6506
6527
|
* See FHIR search for full details: https://www.hl7.org/fhir/search.html
|
|
6507
6528
|
*
|
|
6529
|
+
* @category Search
|
|
6508
6530
|
* @param query The search query as either a string or a structured search object.
|
|
6509
6531
|
* @returns Promise to the search result bundle.
|
|
6510
6532
|
*/
|
|
@@ -6522,6 +6544,8 @@ class MedplumClient extends EventTarget {
|
|
|
6522
6544
|
/**
|
|
6523
6545
|
* Searches a ValueSet resource using the "expand" operation.
|
|
6524
6546
|
* See: https://www.hl7.org/fhir/operation-valueset-expand.html
|
|
6547
|
+
*
|
|
6548
|
+
* @category Search
|
|
6525
6549
|
* @param system The ValueSet system url.
|
|
6526
6550
|
* @param filter The search string.
|
|
6527
6551
|
* @returns Promise to expanded ValueSet.
|
|
@@ -6534,6 +6558,7 @@ class MedplumClient extends EventTarget {
|
|
|
6534
6558
|
}
|
|
6535
6559
|
/**
|
|
6536
6560
|
* Returns a cached resource if it is available.
|
|
6561
|
+
* @category Caching
|
|
6537
6562
|
* @param resourceType The FHIR resource type.
|
|
6538
6563
|
* @param id The FHIR resource ID.
|
|
6539
6564
|
* @returns The resource if it is available in the cache; undefined otherwise.
|
|
@@ -6545,6 +6570,7 @@ class MedplumClient extends EventTarget {
|
|
|
6545
6570
|
}
|
|
6546
6571
|
/**
|
|
6547
6572
|
* Returns a cached resource if it is available.
|
|
6573
|
+
* @category Caching
|
|
6548
6574
|
* @param resourceType The FHIR resource type.
|
|
6549
6575
|
* @param id The FHIR resource ID.
|
|
6550
6576
|
* @returns The resource if it is available in the cache; undefined otherwise.
|
|
@@ -6572,6 +6598,7 @@ class MedplumClient extends EventTarget {
|
|
|
6572
6598
|
*
|
|
6573
6599
|
* See the FHIR "read" operation for full details: https://www.hl7.org/fhir/http.html#read
|
|
6574
6600
|
*
|
|
6601
|
+
* @category Caching
|
|
6575
6602
|
* @param resourceType The FHIR resource type.
|
|
6576
6603
|
* @param id The resource ID.
|
|
6577
6604
|
* @returns The resource if available; undefined otherwise.
|
|
@@ -6594,6 +6621,7 @@ class MedplumClient extends EventTarget {
|
|
|
6594
6621
|
*
|
|
6595
6622
|
* See the FHIR "read" operation for full details: https://www.hl7.org/fhir/http.html#read
|
|
6596
6623
|
*
|
|
6624
|
+
* @category Read
|
|
6597
6625
|
* @param reference The FHIR reference object.
|
|
6598
6626
|
* @returns The resource if available; undefined otherwise.
|
|
6599
6627
|
*/
|
|
@@ -6612,6 +6640,7 @@ class MedplumClient extends EventTarget {
|
|
|
6612
6640
|
* Returns a cached schema for a resource type.
|
|
6613
6641
|
* If the schema is not cached, returns undefined.
|
|
6614
6642
|
* It is assumed that a client will call requestSchema before using this method.
|
|
6643
|
+
* @category Schema
|
|
6615
6644
|
* @param resourceType The FHIR resource type.
|
|
6616
6645
|
* @returns The schema if immediately available, undefined otherwise.
|
|
6617
6646
|
* @deprecated Use globalSchema instead.
|
|
@@ -6622,6 +6651,7 @@ class MedplumClient extends EventTarget {
|
|
|
6622
6651
|
/**
|
|
6623
6652
|
* Requests the schema for a resource type.
|
|
6624
6653
|
* If the schema is already cached, the promise is resolved immediately.
|
|
6654
|
+
* @category Schema
|
|
6625
6655
|
* @param resourceType The FHIR resource type.
|
|
6626
6656
|
* @returns Promise to a schema with the requested resource type.
|
|
6627
6657
|
*/
|
|
@@ -6683,6 +6713,7 @@ class MedplumClient extends EventTarget {
|
|
|
6683
6713
|
*
|
|
6684
6714
|
* See the FHIR "history" operation for full details: https://www.hl7.org/fhir/http.html#history
|
|
6685
6715
|
*
|
|
6716
|
+
* @category Read
|
|
6686
6717
|
* @param resourceType The FHIR resource type.
|
|
6687
6718
|
* @param id The resource ID.
|
|
6688
6719
|
* @returns Promise to the resource history.
|
|
@@ -6702,6 +6733,7 @@ class MedplumClient extends EventTarget {
|
|
|
6702
6733
|
*
|
|
6703
6734
|
* See the FHIR "vread" operation for full details: https://www.hl7.org/fhir/http.html#vread
|
|
6704
6735
|
*
|
|
6736
|
+
* @category Read
|
|
6705
6737
|
* @param resourceType The FHIR resource type.
|
|
6706
6738
|
* @param id The resource ID.
|
|
6707
6739
|
* @returns The resource if available; undefined otherwise.
|
|
@@ -6709,6 +6741,12 @@ class MedplumClient extends EventTarget {
|
|
|
6709
6741
|
readVersion(resourceType, id, vid) {
|
|
6710
6742
|
return this.get(this.fhirUrl(resourceType, id, '_history', vid));
|
|
6711
6743
|
}
|
|
6744
|
+
/**
|
|
6745
|
+
*
|
|
6746
|
+
* @category Read
|
|
6747
|
+
* @param id The Patient Id
|
|
6748
|
+
* @returns A Bundle of all Resources related to the Patient
|
|
6749
|
+
*/
|
|
6712
6750
|
readPatientEverything(id) {
|
|
6713
6751
|
return this.get(this.fhirUrl('Patient', id, '$everything'));
|
|
6714
6752
|
}
|
|
@@ -6732,6 +6770,7 @@ class MedplumClient extends EventTarget {
|
|
|
6732
6770
|
*
|
|
6733
6771
|
* See the FHIR "create" operation for full details: https://www.hl7.org/fhir/http.html#create
|
|
6734
6772
|
*
|
|
6773
|
+
* @category Create
|
|
6735
6774
|
* @param resource The FHIR resource to create.
|
|
6736
6775
|
* @returns The result of the create operation.
|
|
6737
6776
|
*/
|
|
@@ -6776,6 +6815,7 @@ class MedplumClient extends EventTarget {
|
|
|
6776
6815
|
*
|
|
6777
6816
|
* See the FHIR "conditional create" operation for full details: https://www.hl7.org/fhir/http.html#ccreate
|
|
6778
6817
|
*
|
|
6818
|
+
* @category Create
|
|
6779
6819
|
* @param resource The FHIR resource to create.
|
|
6780
6820
|
* @param query The search query for an equivalent resource.
|
|
6781
6821
|
* @returns The result of the create operation.
|
|
@@ -6804,6 +6844,7 @@ class MedplumClient extends EventTarget {
|
|
|
6804
6844
|
*
|
|
6805
6845
|
* See the FHIR "create" operation for full details: https://www.hl7.org/fhir/http.html#create
|
|
6806
6846
|
*
|
|
6847
|
+
* @category Create
|
|
6807
6848
|
* @param data The binary data to upload.
|
|
6808
6849
|
* @param filename Optional filename for the binary.
|
|
6809
6850
|
* @param contentType Content type for the binary.
|
|
@@ -6834,6 +6875,7 @@ class MedplumClient extends EventTarget {
|
|
|
6834
6875
|
*
|
|
6835
6876
|
* See the pdfmake document definition for full details: https://pdfmake.github.io/docs/0.1/document-definition-object/
|
|
6836
6877
|
*
|
|
6878
|
+
* @category Media
|
|
6837
6879
|
* @param docDefinition The PDF document definition.
|
|
6838
6880
|
* @returns The result of the create operation.
|
|
6839
6881
|
*/
|
|
@@ -6851,6 +6893,7 @@ class MedplumClient extends EventTarget {
|
|
|
6851
6893
|
*
|
|
6852
6894
|
* This is a convenience method to handle commmon cases where a `Communication` resource is created with a `payload`.
|
|
6853
6895
|
*
|
|
6896
|
+
* @category Create
|
|
6854
6897
|
* @param resource The FHIR resource to comment on.
|
|
6855
6898
|
* @param text The text of the comment.
|
|
6856
6899
|
* @returns The result of the create operation.
|
|
@@ -6901,6 +6944,7 @@ class MedplumClient extends EventTarget {
|
|
|
6901
6944
|
*
|
|
6902
6945
|
* See the FHIR "update" operation for full details: https://www.hl7.org/fhir/http.html#update
|
|
6903
6946
|
*
|
|
6947
|
+
* @category Write
|
|
6904
6948
|
* @param resource The FHIR resource to update.
|
|
6905
6949
|
* @returns The result of the update operation.
|
|
6906
6950
|
*/
|
|
@@ -6932,6 +6976,7 @@ class MedplumClient extends EventTarget {
|
|
|
6932
6976
|
*
|
|
6933
6977
|
* See the JSONPatch specification for full details: https://tools.ietf.org/html/rfc6902
|
|
6934
6978
|
*
|
|
6979
|
+
* @category Write
|
|
6935
6980
|
* @param resourceType The FHIR resource type.
|
|
6936
6981
|
* @param id The resource ID.
|
|
6937
6982
|
* @param operations The JSONPatch operations.
|
|
@@ -6952,6 +6997,7 @@ class MedplumClient extends EventTarget {
|
|
|
6952
6997
|
*
|
|
6953
6998
|
* See the FHIR "delete" operation for full details: https://www.hl7.org/fhir/http.html#delete
|
|
6954
6999
|
*
|
|
7000
|
+
* @category Delete
|
|
6955
7001
|
* @param resourceType The FHIR resource type.
|
|
6956
7002
|
* @param id The resource ID.
|
|
6957
7003
|
* @returns The result of the delete operation.
|
|
@@ -7003,7 +7049,7 @@ class MedplumClient extends EventTarget {
|
|
|
7003
7049
|
* ```
|
|
7004
7050
|
*
|
|
7005
7051
|
* See The FHIR "batch/transaction" section for full details: https://hl7.org/fhir/http.html#transaction
|
|
7006
|
-
*
|
|
7052
|
+
* @category Batch
|
|
7007
7053
|
* @param bundle The FHIR batch/transaction bundle.
|
|
7008
7054
|
* @returns The FHIR batch/transaction response bundle.
|
|
7009
7055
|
*/
|
|
@@ -7043,7 +7089,7 @@ class MedplumClient extends EventTarget {
|
|
|
7043
7089
|
* ```
|
|
7044
7090
|
*
|
|
7045
7091
|
* See options here: https://nodemailer.com/extras/mailcomposer/
|
|
7046
|
-
*
|
|
7092
|
+
* @category Media
|
|
7047
7093
|
* @param options The MailComposer options.
|
|
7048
7094
|
* @returns Promise to the operation outcome.
|
|
7049
7095
|
*/
|
|
@@ -7091,6 +7137,7 @@ class MedplumClient extends EventTarget {
|
|
|
7091
7137
|
*
|
|
7092
7138
|
* See the FHIR GraphQL documentation for FHIR specific details: https://www.hl7.org/fhir/graphql.html
|
|
7093
7139
|
*
|
|
7140
|
+
* @category Read
|
|
7094
7141
|
* @param query The GraphQL query.
|
|
7095
7142
|
* @param operationName Optional GraphQL operation name.
|
|
7096
7143
|
* @param variables Optional GraphQL variables.
|
|
@@ -7100,9 +7147,16 @@ class MedplumClient extends EventTarget {
|
|
|
7100
7147
|
graphql(query, operationName, variables, options) {
|
|
7101
7148
|
return this.post(this.fhirUrl('$graphql'), { query, operationName, variables }, JSON_CONTENT_TYPE, options);
|
|
7102
7149
|
}
|
|
7150
|
+
/**
|
|
7151
|
+
* @category Authentication
|
|
7152
|
+
* @returns The Login State
|
|
7153
|
+
*/
|
|
7103
7154
|
getActiveLogin() {
|
|
7104
7155
|
return __classPrivateFieldGet(this, _MedplumClient_storage, "f").getObject('activeLogin');
|
|
7105
7156
|
}
|
|
7157
|
+
/**
|
|
7158
|
+
* @category Authentication
|
|
7159
|
+
*/
|
|
7106
7160
|
setActiveLogin(login) {
|
|
7107
7161
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7108
7162
|
__classPrivateFieldSet(this, _MedplumClient_accessToken, login.accessToken, "f");
|
|
@@ -7116,25 +7170,43 @@ class MedplumClient extends EventTarget {
|
|
|
7116
7170
|
yield __classPrivateFieldGet(this, _MedplumClient_instances, "m", _MedplumClient_refreshProfile).call(this);
|
|
7117
7171
|
});
|
|
7118
7172
|
}
|
|
7173
|
+
/**
|
|
7174
|
+
* @category Authentication
|
|
7175
|
+
*/
|
|
7119
7176
|
getAccessToken() {
|
|
7120
7177
|
return __classPrivateFieldGet(this, _MedplumClient_accessToken, "f");
|
|
7121
7178
|
}
|
|
7179
|
+
/**
|
|
7180
|
+
* @category Authentication
|
|
7181
|
+
*/
|
|
7122
7182
|
setAccessToken(accessToken) {
|
|
7123
7183
|
__classPrivateFieldSet(this, _MedplumClient_accessToken, accessToken, "f");
|
|
7124
7184
|
__classPrivateFieldSet(this, _MedplumClient_refreshToken, undefined, "f");
|
|
7125
7185
|
__classPrivateFieldSet(this, _MedplumClient_profile, undefined, "f");
|
|
7126
7186
|
__classPrivateFieldSet(this, _MedplumClient_config, undefined, "f");
|
|
7127
7187
|
}
|
|
7188
|
+
/**
|
|
7189
|
+
* @category Authentication
|
|
7190
|
+
*/
|
|
7128
7191
|
getLogins() {
|
|
7129
7192
|
var _a;
|
|
7130
7193
|
return (_a = __classPrivateFieldGet(this, _MedplumClient_storage, "f").getObject('logins')) !== null && _a !== void 0 ? _a : [];
|
|
7131
7194
|
}
|
|
7195
|
+
/**
|
|
7196
|
+
* @category Authentication
|
|
7197
|
+
*/
|
|
7132
7198
|
isLoading() {
|
|
7133
7199
|
return !!__classPrivateFieldGet(this, _MedplumClient_profilePromise, "f");
|
|
7134
7200
|
}
|
|
7201
|
+
/**
|
|
7202
|
+
* @category User Profile
|
|
7203
|
+
*/
|
|
7135
7204
|
getProfile() {
|
|
7136
7205
|
return __classPrivateFieldGet(this, _MedplumClient_profile, "f");
|
|
7137
7206
|
}
|
|
7207
|
+
/**
|
|
7208
|
+
* @category User Profile
|
|
7209
|
+
*/
|
|
7138
7210
|
getProfileAsync() {
|
|
7139
7211
|
return __awaiter(this, void 0, void 0, function* () {
|
|
7140
7212
|
if (__classPrivateFieldGet(this, _MedplumClient_profilePromise, "f")) {
|
|
@@ -7143,11 +7215,16 @@ class MedplumClient extends EventTarget {
|
|
|
7143
7215
|
return this.getProfile();
|
|
7144
7216
|
});
|
|
7145
7217
|
}
|
|
7218
|
+
/**
|
|
7219
|
+
* @category User Profile
|
|
7220
|
+
*/
|
|
7146
7221
|
getUserConfiguration() {
|
|
7147
7222
|
return __classPrivateFieldGet(this, _MedplumClient_config, "f");
|
|
7148
7223
|
}
|
|
7149
7224
|
/**
|
|
7150
7225
|
* Downloads the URL as a blob.
|
|
7226
|
+
*
|
|
7227
|
+
* @category Read
|
|
7151
7228
|
* @param url The URL to request.
|
|
7152
7229
|
* @returns Promise to the response body as a blob.
|
|
7153
7230
|
*/
|
|
@@ -7188,6 +7265,7 @@ class MedplumClient extends EventTarget {
|
|
|
7188
7265
|
/**
|
|
7189
7266
|
* Starts a new OAuth2 client credentials flow.
|
|
7190
7267
|
* See: https://datatracker.ietf.org/doc/html/rfc6749#section-4.4
|
|
7268
|
+
* @category Authentication
|
|
7191
7269
|
* @param clientId The client ID.
|
|
7192
7270
|
* @param clientSecret The client secret.
|
|
7193
7271
|
* @returns Promise that resolves to the client profile.
|
|
@@ -7395,6 +7473,7 @@ _MedplumClient_fetch = new WeakMap(), _MedplumClient_createPdf = new WeakMap(),
|
|
|
7395
7473
|
};
|
|
7396
7474
|
/**
|
|
7397
7475
|
* Returns the base URL for the current page.
|
|
7476
|
+
* @category HTTP
|
|
7398
7477
|
*/
|
|
7399
7478
|
function getBaseUrl() {
|
|
7400
7479
|
return window.location.protocol + '//' + window.location.host + '/';
|