oro-sdk 3.6.0 → 3.6.1

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.6.0",
2
+ "version": "3.6.1",
3
3
  "main": "dist/index.js",
4
4
  "typings": "dist/index.d.ts",
5
5
  "files": [
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
- uuid: e.uuid,
396
- timestamp: e.timestamp,
397
- uniqueHash: e.uniqueHash,
398
- encryptedIndexEntry: CryptoRSA.jsonWithPubEncryptToBase64(
399
- {
400
- consultationId: e.consultationId,
401
- grant: e.grant,
402
- },
403
- rsaPub
404
- ),
405
- } as EncryptedIndexEntry)
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
- uuid: e.uuid,
429
- timestamp: e.timestamp,
430
- uniqueHash: e.uniqueHash,
431
- encryptedIndexEntry: CryptoRSA.jsonWithPubEncryptToBase64(
432
- {
433
- consultationId: e.consultationId,
434
- grant: e.grant,
435
- },
436
- rsaPub
437
- ),
438
- } as EncryptedIndexEntry)
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.vaultIndexGet([IndexKey.ConsultationLockbox], [filter.consultationId])
790
- .then((res) => res[IndexKey.ConsultationLockbox])
791
- .catch((e) => {
792
- console.error(e)
793
- return []
794
- })
795
- ) : undefined
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')