oro-sdk 3.6.0 → 3.6.1
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/client.d.ts +2 -1
- package/dist/oro-sdk.cjs.development.js +59 -54
- package/dist/oro-sdk.cjs.development.js.map +1 -1
- package/dist/oro-sdk.cjs.production.min.js +1 -1
- package/dist/oro-sdk.cjs.production.min.js.map +1 -1
- package/dist/oro-sdk.esm.js +59 -54
- package/dist/oro-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +38 -35
package/package.json
CHANGED
package/src/client.ts
CHANGED
@@ -83,7 +83,7 @@ export class OroClient {
|
|
83
83
|
public workflowClient: WorkflowService,
|
84
84
|
public diagnosisClient: DiagnosisService,
|
85
85
|
private authenticationCallback?: (err: Error) => void
|
86
|
-
) {
|
86
|
+
) {}
|
87
87
|
|
88
88
|
/**
|
89
89
|
* clears the vaultIndex and cached metadata grants
|
@@ -280,6 +280,7 @@ export class OroClient {
|
|
280
280
|
* @param consult
|
281
281
|
* @param workflow
|
282
282
|
* @param recoveryQA
|
283
|
+
* @param indexSearch create search index for the consultation if true
|
283
284
|
* @returns
|
284
285
|
*/
|
285
286
|
public async registerPatient(
|
@@ -289,10 +290,11 @@ export class OroClient {
|
|
289
290
|
recoveryQA?: {
|
290
291
|
recoverySecurityQuestions: string[]
|
291
292
|
recoverySecurityAnswers: string[]
|
292
|
-
}
|
293
|
+
},
|
294
|
+
indexSearch: boolean = true
|
293
295
|
): Promise<RegisterPatientOutput> {
|
294
296
|
if (!this.rsa) throw IncompleteAuthentication
|
295
|
-
return registerPatient(patientUuid, consult, workflow, this, this.toolbox.uuid(), recoveryQA)
|
297
|
+
return registerPatient(patientUuid, consult, workflow, this, this.toolbox.uuid(), recoveryQA, indexSearch)
|
296
298
|
}
|
297
299
|
|
298
300
|
/**
|
@@ -391,18 +393,18 @@ export class OroClient {
|
|
391
393
|
}))
|
392
394
|
.map(
|
393
395
|
(e: IndexConsultLockbox) =>
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
396
|
+
({
|
397
|
+
uuid: e.uuid,
|
398
|
+
timestamp: e.timestamp,
|
399
|
+
uniqueHash: e.uniqueHash,
|
400
|
+
encryptedIndexEntry: CryptoRSA.jsonWithPubEncryptToBase64(
|
401
|
+
{
|
402
|
+
consultationId: e.consultationId,
|
403
|
+
grant: e.grant,
|
404
|
+
},
|
405
|
+
rsaPub
|
406
|
+
),
|
407
|
+
} as EncryptedIndexEntry)
|
406
408
|
)
|
407
409
|
break
|
408
410
|
//// DEPRECATED : REMOVE ME : BEGIN ///////////////////////////////////////////
|
@@ -424,18 +426,18 @@ export class OroClient {
|
|
424
426
|
)
|
425
427
|
.map(
|
426
428
|
(e: IndexConsultLockbox) =>
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
429
|
+
({
|
430
|
+
uuid: e.uuid,
|
431
|
+
timestamp: e.timestamp,
|
432
|
+
uniqueHash: e.uniqueHash,
|
433
|
+
encryptedIndexEntry: CryptoRSA.jsonWithPubEncryptToBase64(
|
434
|
+
{
|
435
|
+
consultationId: e.consultationId,
|
436
|
+
grant: e.grant,
|
437
|
+
},
|
438
|
+
rsaPub
|
439
|
+
),
|
440
|
+
} as EncryptedIndexEntry)
|
439
441
|
)
|
440
442
|
break
|
441
443
|
//// DEPRECATED : REMOVE ME : END ///////////////////////////////////////////
|
@@ -785,14 +787,15 @@ export class OroClient {
|
|
785
787
|
|
786
788
|
// if there is a filter to apply, then the grant can be retrieved from the vault index, otherwise, all grants are fetched
|
787
789
|
// Note: will work only if the filter being applied is exclusively a consult id
|
788
|
-
const grantsByConsultLockbox = filter
|
789
|
-
await this.vaultClient
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
790
|
+
const grantsByConsultLockbox = filter
|
791
|
+
? await this.vaultClient
|
792
|
+
.vaultIndexGet([IndexKey.ConsultationLockbox], [filter.consultationId])
|
793
|
+
.then((res) => res[IndexKey.ConsultationLockbox])
|
794
|
+
.catch((e) => {
|
795
|
+
console.error(e)
|
796
|
+
return []
|
797
|
+
})
|
798
|
+
: undefined
|
796
799
|
const decryptedConsults = decryptConsultLockboxGrants(grantsByConsultLockbox ?? [], this.rsa)
|
797
800
|
if (decryptedConsults.length > 0) {
|
798
801
|
console.info('[sdk:index] Grants found in user`s constant time secure index')
|