oro-sdk 2.19.2 → 2.21.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 CHANGED
@@ -57,6 +57,7 @@ Two cases are possible:
57
57
  npm run link:watch:apis
58
58
  ```
59
59
 
60
+ Make sure that you are using the same version of node and npm in the SDK and in the service that you are trying to link.
60
61
  #### Then you need to link it locally to the app
61
62
 
62
63
  In **`oro-apps/web`**:
@@ -3690,16 +3690,33 @@ var OroClient = /*#__PURE__*/function () {
3690
3690
  return _context22.abrupt("return", this.cachedMetadataGrants[filterString]);
3691
3691
 
3692
3692
  case 6:
3693
- _context22.next = 8;
3694
- return this.vaultClient.vaultIndexGet([initApis.IndexKey.ConsultationLockbox], filter ? [filter.consultationId] : undefined);
3693
+ if (!filter) {
3694
+ _context22.next = 12;
3695
+ break;
3696
+ }
3695
3697
 
3696
- case 8:
3697
- _context22.t0 = initApis.IndexKey.ConsultationLockbox;
3698
- grantsByConsultLockbox = _context22.sent[_context22.t0];
3698
+ _context22.next = 9;
3699
+ return this.vaultClient.vaultIndexGet([initApis.IndexKey.ConsultationLockbox], [filter.consultationId]).then(function (res) {
3700
+ return res[initApis.IndexKey.ConsultationLockbox];
3701
+ })["catch"](function (e) {
3702
+ console.error(e);
3703
+ return [];
3704
+ });
3705
+
3706
+ case 9:
3707
+ _context22.t0 = _context22.sent;
3708
+ _context22.next = 13;
3709
+ break;
3710
+
3711
+ case 12:
3712
+ _context22.t0 = undefined;
3713
+
3714
+ case 13:
3715
+ grantsByConsultLockbox = _context22.t0;
3699
3716
  decryptedConsults = decryptConsultLockboxGrants(grantsByConsultLockbox != null ? grantsByConsultLockbox : [], this.rsa);
3700
3717
 
3701
3718
  if (!(decryptedConsults.length > 0)) {
3702
- _context22.next = 15;
3719
+ _context22.next = 19;
3703
3720
  break;
3704
3721
  }
3705
3722
 
@@ -3707,38 +3724,38 @@ var OroClient = /*#__PURE__*/function () {
3707
3724
  this.cachedMetadataGrants[JSON.stringify(filter)] = decryptedConsults;
3708
3725
  return _context22.abrupt("return", this.cachedMetadataGrants[filterString]);
3709
3726
 
3710
- case 15:
3727
+ case 19:
3711
3728
  if (!filter) {
3712
- _context22.next = 21;
3729
+ _context22.next = 25;
3713
3730
  break;
3714
3731
  }
3715
3732
 
3716
- _context22.next = 18;
3733
+ _context22.next = 22;
3717
3734
  return filterGrantsWithLockboxMetadata(this, filter, this.vaultIndex, forceRefresh);
3718
3735
 
3719
- case 18:
3736
+ case 22:
3720
3737
  encryptedGrants = _context22.sent;
3721
- _context22.next = 24;
3738
+ _context22.next = 28;
3722
3739
  break;
3723
3740
 
3724
- case 21:
3725
- _context22.next = 23;
3741
+ case 25:
3742
+ _context22.next = 27;
3726
3743
  return this.vaultClient.grantsGet();
3727
3744
 
3728
- case 23:
3745
+ case 27:
3729
3746
  encryptedGrants = _context22.sent.grants;
3730
3747
 
3731
- case 24:
3732
- _context22.next = 26;
3748
+ case 28:
3749
+ _context22.next = 30;
3733
3750
  return decryptGrants(encryptedGrants, this.rsa);
3734
3751
 
3735
- case 26:
3752
+ case 30:
3736
3753
  decryptedGrants = _context22.sent;
3737
3754
  // sets the cached grant
3738
3755
  this.cachedMetadataGrants[filterString] = decryptedGrants;
3739
3756
  return _context22.abrupt("return", decryptedGrants);
3740
3757
 
3741
- case 29:
3758
+ case 33:
3742
3759
  case "end":
3743
3760
  return _context22.stop();
3744
3761
  }