oro-sdk 2.19.3 → 2.20.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.
@@ -3686,16 +3686,33 @@ var OroClient = /*#__PURE__*/function () {
3686
3686
  return _context22.abrupt("return", this.cachedMetadataGrants[filterString]);
3687
3687
 
3688
3688
  case 6:
3689
- _context22.next = 8;
3690
- return this.vaultClient.vaultIndexGet([IndexKey.ConsultationLockbox], filter ? [filter.consultationId] : undefined);
3689
+ if (!filter) {
3690
+ _context22.next = 12;
3691
+ break;
3692
+ }
3691
3693
 
3692
- case 8:
3693
- _context22.t0 = IndexKey.ConsultationLockbox;
3694
- grantsByConsultLockbox = _context22.sent[_context22.t0];
3694
+ _context22.next = 9;
3695
+ return this.vaultClient.vaultIndexGet([IndexKey.ConsultationLockbox], [filter.consultationId]).then(function (res) {
3696
+ return res[IndexKey.ConsultationLockbox];
3697
+ })["catch"](function (e) {
3698
+ console.error(e);
3699
+ return [];
3700
+ });
3701
+
3702
+ case 9:
3703
+ _context22.t0 = _context22.sent;
3704
+ _context22.next = 13;
3705
+ break;
3706
+
3707
+ case 12:
3708
+ _context22.t0 = undefined;
3709
+
3710
+ case 13:
3711
+ grantsByConsultLockbox = _context22.t0;
3695
3712
  decryptedConsults = decryptConsultLockboxGrants(grantsByConsultLockbox != null ? grantsByConsultLockbox : [], this.rsa);
3696
3713
 
3697
3714
  if (!(decryptedConsults.length > 0)) {
3698
- _context22.next = 15;
3715
+ _context22.next = 19;
3699
3716
  break;
3700
3717
  }
3701
3718
 
@@ -3703,38 +3720,38 @@ var OroClient = /*#__PURE__*/function () {
3703
3720
  this.cachedMetadataGrants[JSON.stringify(filter)] = decryptedConsults;
3704
3721
  return _context22.abrupt("return", this.cachedMetadataGrants[filterString]);
3705
3722
 
3706
- case 15:
3723
+ case 19:
3707
3724
  if (!filter) {
3708
- _context22.next = 21;
3725
+ _context22.next = 25;
3709
3726
  break;
3710
3727
  }
3711
3728
 
3712
- _context22.next = 18;
3729
+ _context22.next = 22;
3713
3730
  return filterGrantsWithLockboxMetadata(this, filter, this.vaultIndex, forceRefresh);
3714
3731
 
3715
- case 18:
3732
+ case 22:
3716
3733
  encryptedGrants = _context22.sent;
3717
- _context22.next = 24;
3734
+ _context22.next = 28;
3718
3735
  break;
3719
3736
 
3720
- case 21:
3721
- _context22.next = 23;
3737
+ case 25:
3738
+ _context22.next = 27;
3722
3739
  return this.vaultClient.grantsGet();
3723
3740
 
3724
- case 23:
3741
+ case 27:
3725
3742
  encryptedGrants = _context22.sent.grants;
3726
3743
 
3727
- case 24:
3728
- _context22.next = 26;
3744
+ case 28:
3745
+ _context22.next = 30;
3729
3746
  return decryptGrants(encryptedGrants, this.rsa);
3730
3747
 
3731
- case 26:
3748
+ case 30:
3732
3749
  decryptedGrants = _context22.sent;
3733
3750
  // sets the cached grant
3734
3751
  this.cachedMetadataGrants[filterString] = decryptedGrants;
3735
3752
  return _context22.abrupt("return", decryptedGrants);
3736
3753
 
3737
- case 29:
3754
+ case 33:
3738
3755
  case "end":
3739
3756
  return _context22.stop();
3740
3757
  }