oro-sdk 2.19.3 → 2.22.0
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 +1 -0
- package/dist/oro-sdk.cjs.development.js +35 -18
- 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 +35 -18
- package/dist/oro-sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/client.ts +34 -32
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"version": "2.
|
2
|
+
"version": "2.22.0",
|
3
3
|
"main": "dist/index.js",
|
4
4
|
"typings": "dist/index.d.ts",
|
5
5
|
"files": [
|
@@ -54,7 +54,7 @@
|
|
54
54
|
"form-data": "^4.0.0",
|
55
55
|
"formdata-node": "^4.3.1",
|
56
56
|
"idb-keyval": "^5.0.6",
|
57
|
-
"oro-sdk-apis": "1.
|
57
|
+
"oro-sdk-apis": "1.26.0",
|
58
58
|
"oro-toolbox": "0.0.6",
|
59
59
|
"uuid": "^8.3.2"
|
60
60
|
}
|
package/src/client.ts
CHANGED
@@ -81,7 +81,7 @@ export class OroClient {
|
|
81
81
|
public workflowClient: WorkflowService,
|
82
82
|
public diagnosisClient: DiagnosisService,
|
83
83
|
private authenticationCallback?: (err: Error) => void
|
84
|
-
) {}
|
84
|
+
) { }
|
85
85
|
|
86
86
|
/**
|
87
87
|
* clears the vaultIndex and cached metadata grants
|
@@ -389,18 +389,18 @@ export class OroClient {
|
|
389
389
|
}))
|
390
390
|
.map(
|
391
391
|
(e: IndexConsultLockbox) =>
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
392
|
+
({
|
393
|
+
uuid: e.uuid,
|
394
|
+
timestamp: e.timestamp,
|
395
|
+
uniqueHash: e.uniqueHash,
|
396
|
+
encryptedIndexEntry: CryptoRSA.jsonWithPubEncryptToBase64(
|
397
|
+
{
|
398
|
+
consultationId: e.consultationId,
|
399
|
+
grant: e.grant,
|
400
|
+
},
|
401
|
+
rsaPub
|
402
|
+
),
|
403
|
+
} as EncryptedIndexEntry)
|
404
404
|
)
|
405
405
|
break
|
406
406
|
//// DEPRECATED : REMOVE ME : BEGIN ///////////////////////////////////////////
|
@@ -422,18 +422,18 @@ export class OroClient {
|
|
422
422
|
)
|
423
423
|
.map(
|
424
424
|
(e: IndexConsultLockbox) =>
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
425
|
+
({
|
426
|
+
uuid: e.uuid,
|
427
|
+
timestamp: e.timestamp,
|
428
|
+
uniqueHash: e.uniqueHash,
|
429
|
+
encryptedIndexEntry: CryptoRSA.jsonWithPubEncryptToBase64(
|
430
|
+
{
|
431
|
+
consultationId: e.consultationId,
|
432
|
+
grant: e.grant,
|
433
|
+
},
|
434
|
+
rsaPub
|
435
|
+
),
|
436
|
+
} as EncryptedIndexEntry)
|
437
437
|
)
|
438
438
|
break
|
439
439
|
//// DEPRECATED : REMOVE ME : END ///////////////////////////////////////////
|
@@ -781,14 +781,16 @@ export class OroClient {
|
|
781
781
|
// Note: if filters is set to empty, it will be stored in the `undefined` key
|
782
782
|
if (!forceRefresh && this.cachedMetadataGrants[filterString]) return this.cachedMetadataGrants[filterString]
|
783
783
|
|
784
|
-
//
|
784
|
+
// if there is a filter to apply, then the grant can be retrieved from the vault index, otherwise, all grants are fetched
|
785
785
|
// Note: will work only if the filter being applied is exclusively a consult id
|
786
|
-
const grantsByConsultLockbox = (
|
787
|
-
await this.vaultClient.vaultIndexGet(
|
788
|
-
[IndexKey.ConsultationLockbox]
|
789
|
-
|
790
|
-
|
791
|
-
|
786
|
+
const grantsByConsultLockbox = filter ? (
|
787
|
+
await this.vaultClient.vaultIndexGet([IndexKey.ConsultationLockbox], [filter.consultationId])
|
788
|
+
.then((res) => res[IndexKey.ConsultationLockbox])
|
789
|
+
.catch((e) => {
|
790
|
+
console.error(e)
|
791
|
+
return []
|
792
|
+
})
|
793
|
+
) : undefined
|
792
794
|
const decryptedConsults = decryptConsultLockboxGrants(grantsByConsultLockbox ?? [], this.rsa)
|
793
795
|
if (decryptedConsults.length > 0) {
|
794
796
|
console.info('[sdk:index] Grants found in user`s constant time secure index')
|