oro-sdk 3.14.0 → 3.17.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.
@@ -784,38 +784,47 @@ var MissingGrant = /*#__PURE__*/function (_Error2) {
784
784
 
785
785
  return MissingGrant;
786
786
  }( /*#__PURE__*/_wrapNativeSuper(Error));
787
- var MissingLockbox = /*#__PURE__*/function (_Error3) {
788
- _inheritsLoose(MissingLockbox, _Error3);
787
+ var MissingGrantFilter = /*#__PURE__*/function (_Error3) {
788
+ _inheritsLoose(MissingGrantFilter, _Error3);
789
789
 
790
- function MissingLockbox() {
790
+ function MissingGrantFilter() {
791
791
  return _Error3.apply(this, arguments) || this;
792
792
  }
793
793
 
794
+ return MissingGrantFilter;
795
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
796
+ var MissingLockbox = /*#__PURE__*/function (_Error4) {
797
+ _inheritsLoose(MissingLockbox, _Error4);
798
+
799
+ function MissingLockbox() {
800
+ return _Error4.apply(this, arguments) || this;
801
+ }
802
+
794
803
  return MissingLockbox;
795
804
  }( /*#__PURE__*/_wrapNativeSuper(Error));
796
- var MissingLockboxOwner = /*#__PURE__*/function (_Error4) {
797
- _inheritsLoose(MissingLockboxOwner, _Error4);
805
+ var MissingLockboxOwner = /*#__PURE__*/function (_Error5) {
806
+ _inheritsLoose(MissingLockboxOwner, _Error5);
798
807
 
799
808
  function MissingLockboxOwner() {
800
- return _Error4.apply(this, arguments) || this;
809
+ return _Error5.apply(this, arguments) || this;
801
810
  }
802
811
 
803
812
  return MissingLockboxOwner;
804
813
  }( /*#__PURE__*/_wrapNativeSuper(Error));
805
- var AssociatedLockboxNotFound = /*#__PURE__*/function (_Error5) {
806
- _inheritsLoose(AssociatedLockboxNotFound, _Error5);
814
+ var AssociatedLockboxNotFound = /*#__PURE__*/function (_Error6) {
815
+ _inheritsLoose(AssociatedLockboxNotFound, _Error6);
807
816
 
808
817
  function AssociatedLockboxNotFound() {
809
- return _Error5.apply(this, arguments) || this;
818
+ return _Error6.apply(this, arguments) || this;
810
819
  }
811
820
 
812
821
  return AssociatedLockboxNotFound;
813
822
  }( /*#__PURE__*/_wrapNativeSuper(Error));
814
- var WorkflowAnswersMissingError = /*#__PURE__*/function (_Error6) {
815
- _inheritsLoose(WorkflowAnswersMissingError, _Error6);
823
+ var WorkflowAnswersMissingError = /*#__PURE__*/function (_Error7) {
824
+ _inheritsLoose(WorkflowAnswersMissingError, _Error7);
816
825
 
817
826
  function WorkflowAnswersMissingError() {
818
- return _Error6.apply(this, arguments) || this;
827
+ return _Error7.apply(this, arguments) || this;
819
828
  }
820
829
 
821
830
  return WorkflowAnswersMissingError;
@@ -1620,7 +1629,7 @@ function _getOrCreatePatientLockbox() {
1620
1629
  switch (_context6.prev = _context6.next) {
1621
1630
  case 0:
1622
1631
  _context6.next = 2;
1623
- return oroClient.getGrants(undefined, true);
1632
+ return oroClient.getGrants();
1624
1633
 
1625
1634
  case 2:
1626
1635
  grants = _context6.sent;
@@ -1949,151 +1958,65 @@ function decryptConsultLockboxGrants(encryptedConsultLockboxes, rsaKey) {
1949
1958
 
1950
1959
  /**
1951
1960
  * @name filterGrantsWithLockboxMetadata
1952
- * @description searches for the applied filters in the vault index
1961
+ * @description searches for the existance of a consult uuid in each granted lockbox
1953
1962
  * @param oroClient
1954
- * @param filter: the metadata filter applied to each the lockboxes
1955
- * @param vaultIndex: the index to which the filter will be applied
1956
- * @param forceRefresh
1957
- * @returns the filtered grants
1963
+ * @param filter: the consult uuid
1964
+ * @returns the grants containing the consult uuid
1958
1965
  */
1959
1966
 
1960
- function filterGrantsWithLockboxMetadata(_x, _x2, _x3, _x4) {
1967
+ function filterGrantsWithLockboxMetadata(_x, _x2) {
1961
1968
  return _filterGrantsWithLockboxMetadata.apply(this, arguments);
1962
1969
  }
1963
- /** Finds all grants for the logged user
1964
- * requests a list of unique consultation ids for each lockbox the user has access to
1965
- * builds and sets the index of consultations
1966
- * @param oroClient
1967
- * @returns the constructed vaultIndex
1968
- */
1969
1970
 
1970
1971
  function _filterGrantsWithLockboxMetadata() {
1971
- _filterGrantsWithLockboxMetadata = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(oroClient, filter, vaultIndex, forceRefresh) {
1972
- var _vaultIndex$IndexKey$, indexConsults;
1972
+ _filterGrantsWithLockboxMetadata = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(oroClient, filter) {
1973
+ var grants, filteredGrants, _iterator, _step, grant, consultationIdExistsInMetadata;
1973
1974
 
1974
1975
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1975
1976
  while (1) {
1976
1977
  switch (_context.prev = _context.next) {
1977
1978
  case 0:
1978
- if (forceRefresh === void 0) {
1979
- forceRefresh = false;
1980
- }
1981
-
1982
- if (!(!vaultIndex || forceRefresh)) {
1983
- _context.next = 5;
1984
- break;
1985
- }
1986
-
1987
- _context.next = 4;
1988
- return buildLegacyVaultIndex(oroClient);
1989
-
1990
- case 4:
1991
- vaultIndex = _context.sent;
1992
-
1993
- case 5:
1994
- if (!(vaultIndex[initApis.IndexKey.Consultation] && filter)) {
1995
- _context.next = 10;
1996
- break;
1997
- }
1998
-
1999
- indexConsults = ((_vaultIndex$IndexKey$ = vaultIndex[initApis.IndexKey.Consultation]) != null ? _vaultIndex$IndexKey$ : []).filter(function (consultGrant) {
2000
- return consultGrant.consultationId === filter.consultationId;
2001
- }).map(function (consultGrant) {
2002
- return consultGrant.grant;
2003
- });
2004
- return _context.abrupt("return", indexConsults);
2005
-
2006
- case 10:
2007
- return _context.abrupt("return", []);
2008
-
2009
- case 11:
2010
- case "end":
2011
- return _context.stop();
2012
- }
2013
- }
2014
- }, _callee);
2015
- }));
2016
- return _filterGrantsWithLockboxMetadata.apply(this, arguments);
2017
- }
2018
-
2019
- function buildLegacyVaultIndex(_x5) {
2020
- return _buildLegacyVaultIndex.apply(this, arguments);
2021
- }
2022
-
2023
- function _buildLegacyVaultIndex() {
2024
- _buildLegacyVaultIndex = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(oroClient) {
2025
- var _vaultIndex;
2026
-
2027
- var grants, consultGrants, _loop, _iterator, _step, vaultIndex;
2028
-
2029
- return _regeneratorRuntime().wrap(function _callee2$(_context3) {
2030
- while (1) {
2031
- switch (_context3.prev = _context3.next) {
2032
- case 0:
2033
- _context3.next = 2;
1979
+ _context.next = 2;
2034
1980
  return oroClient.getGrants();
2035
1981
 
2036
1982
  case 2:
2037
- grants = _context3.sent;
2038
- consultGrants = [];
2039
- _loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
2040
- var grant, consults;
2041
- return _regeneratorRuntime().wrap(function _loop$(_context2) {
2042
- while (1) {
2043
- switch (_context2.prev = _context2.next) {
2044
- case 0:
2045
- grant = _step.value;
2046
- _context2.next = 3;
2047
- return oroClient.vaultClient.lockboxMetadataGet(grant.lockboxUuid, ['consultationId'], [], {
2048
- category: initApis.MetadataCategory.Consultation
2049
- });
2050
-
2051
- case 3:
2052
- consults = _context2.sent[0];
2053
- consultGrants = [].concat(consultGrants, consults.map(function (consult) {
2054
- return _extends({}, consult, {
2055
- grant: {
2056
- lockboxOwnerUuid: grant.lockboxOwnerUuid,
2057
- lockboxUuid: grant.lockboxUuid
2058
- }
2059
- });
2060
- }));
2061
-
2062
- case 5:
2063
- case "end":
2064
- return _context2.stop();
2065
- }
2066
- }
2067
- }, _loop);
2068
- });
1983
+ grants = _context.sent;
1984
+ filteredGrants = [];
2069
1985
  _iterator = _createForOfIteratorHelperLoose(grants);
2070
1986
 
2071
- case 6:
1987
+ case 5:
2072
1988
  if ((_step = _iterator()).done) {
2073
- _context3.next = 10;
1989
+ _context.next = 13;
2074
1990
  break;
2075
1991
  }
2076
1992
 
2077
- return _context3.delegateYield(_loop(), "t0", 8);
1993
+ grant = _step.value;
1994
+ _context.next = 9;
1995
+ return oroClient.vaultClient.lockboxMetadataGet(grant.lockboxUuid, ['consultationId'], [], {
1996
+ category: initApis.MetadataCategory.Consultation,
1997
+ consultationId: filter.consultationId
1998
+ });
1999
+
2000
+ case 9:
2001
+ consultationIdExistsInMetadata = _context.sent;
2002
+ // If there are entries in the metadata, it means that the consult exists in the lockbox
2003
+ if (consultationIdExistsInMetadata[0].length >= 0) filteredGrants.push(grant);
2078
2004
 
2079
- case 8:
2080
- _context3.next = 6;
2005
+ case 11:
2006
+ _context.next = 5;
2081
2007
  break;
2082
2008
 
2083
- case 10:
2084
- vaultIndex = (_vaultIndex = {}, _vaultIndex[initApis.IndexKey.Consultation] = consultGrants, _vaultIndex);
2085
- oroClient.setVaultIndex(vaultIndex);
2086
- console.info('[sdk:index] Successfully Built Vault Index');
2087
- return _context3.abrupt("return", vaultIndex);
2009
+ case 13:
2010
+ return _context.abrupt("return", filteredGrants);
2088
2011
 
2089
2012
  case 14:
2090
2013
  case "end":
2091
- return _context3.stop();
2014
+ return _context.stop();
2092
2015
  }
2093
2016
  }
2094
- }, _callee2);
2017
+ }, _callee);
2095
2018
  }));
2096
- return _buildLegacyVaultIndex.apply(this, arguments);
2019
+ return _filterGrantsWithLockboxMetadata.apply(this, arguments);
2097
2020
  }
2098
2021
 
2099
2022
  var OroClient = /*#__PURE__*/function () {
@@ -2127,11 +2050,10 @@ var OroClient = /*#__PURE__*/function () {
2127
2050
  while (1) {
2128
2051
  switch (_context.prev = _context.next) {
2129
2052
  case 0:
2130
- this.vaultIndex = undefined;
2131
2053
  this.cachedMetadataGrants = {};
2132
2054
  this.cachedManifest = {};
2133
2055
 
2134
- case 3:
2056
+ case 2:
2135
2057
  case "end":
2136
2058
  return _context.stop();
2137
2059
  }
@@ -2511,61 +2433,6 @@ var OroClient = /*#__PURE__*/function () {
2511
2433
 
2512
2434
  return registerPatient$1;
2513
2435
  }()
2514
- /**
2515
- * Builds the vault index for the logged user
2516
- *
2517
- * Steps:
2518
- * 1. Retrieves, decrypts and sets the lockbox IndexSnapshot
2519
- * 2. Retrieves, decrypts and adds all other index entries starting at the snapshot timestamp
2520
- * 3. Updates the IndexSnapshot if changed
2521
- * @deprecated
2522
- * @returns the latest vault index
2523
- */
2524
- ;
2525
-
2526
- _proto.buildVaultIndex =
2527
- /*#__PURE__*/
2528
- function () {
2529
- var _buildVaultIndex = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(forceRefresh) {
2530
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
2531
- while (1) {
2532
- switch (_context8.prev = _context8.next) {
2533
- case 0:
2534
- if (forceRefresh === void 0) {
2535
- forceRefresh = false;
2536
- }
2537
-
2538
- if (!(!this.vaultIndex || forceRefresh)) {
2539
- _context8.next = 4;
2540
- break;
2541
- }
2542
-
2543
- _context8.next = 4;
2544
- return buildLegacyVaultIndex(this);
2545
-
2546
- case 4:
2547
- case "end":
2548
- return _context8.stop();
2549
- }
2550
- }
2551
- }, _callee8, this);
2552
- }));
2553
-
2554
- function buildVaultIndex(_x18) {
2555
- return _buildVaultIndex.apply(this, arguments);
2556
- }
2557
-
2558
- return buildVaultIndex;
2559
- }()
2560
- /**
2561
- * Setter for the vault index
2562
- * @param index
2563
- */
2564
- ;
2565
-
2566
- _proto.setVaultIndex = function setVaultIndex(index) {
2567
- this.vaultIndex = index;
2568
- }
2569
2436
  /**
2570
2437
  * Fetches all grants, and consultations that exist in each lockbox
2571
2438
  * Then updates the index for the current user with the lockbox consult relationship
@@ -2575,28 +2442,28 @@ var OroClient = /*#__PURE__*/function () {
2575
2442
  _proto.forceUpdateIndexEntries =
2576
2443
  /*#__PURE__*/
2577
2444
  function () {
2578
- var _forceUpdateIndexEntries = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
2445
+ var _forceUpdateIndexEntries = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
2579
2446
  var _this = this,
2580
2447
  _this$vaultIndexAdd;
2581
2448
 
2582
2449
  var grants, indexConsultLockbox;
2583
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
2450
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
2584
2451
  while (1) {
2585
- switch (_context10.prev = _context10.next) {
2452
+ switch (_context9.prev = _context9.next) {
2586
2453
  case 0:
2587
- _context10.next = 2;
2454
+ _context9.next = 2;
2588
2455
  return this.getGrants();
2589
2456
 
2590
2457
  case 2:
2591
- grants = _context10.sent;
2592
- _context10.next = 5;
2458
+ grants = _context9.sent;
2459
+ _context9.next = 5;
2593
2460
  return Promise.all(grants.map( /*#__PURE__*/function () {
2594
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(grant) {
2595
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
2461
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(grant) {
2462
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
2596
2463
  while (1) {
2597
- switch (_context9.prev = _context9.next) {
2464
+ switch (_context8.prev = _context8.next) {
2598
2465
  case 0:
2599
- _context9.next = 2;
2466
+ _context8.next = 2;
2600
2467
  return _this.vaultClient.lockboxMetadataGet(grant.lockboxUuid, ['consultationId'], [], {
2601
2468
  category: initApis.MetadataCategory.Consultation
2602
2469
  }, grant.lockboxOwnerUuid).then(function (consults) {
@@ -2618,17 +2485,17 @@ var OroClient = /*#__PURE__*/function () {
2618
2485
  });
2619
2486
 
2620
2487
  case 2:
2621
- return _context9.abrupt("return", _context9.sent);
2488
+ return _context8.abrupt("return", _context8.sent);
2622
2489
 
2623
2490
  case 3:
2624
2491
  case "end":
2625
- return _context9.stop();
2492
+ return _context8.stop();
2626
2493
  }
2627
2494
  }
2628
- }, _callee9);
2495
+ }, _callee8);
2629
2496
  }));
2630
2497
 
2631
- return function (_x19) {
2498
+ return function (_x18) {
2632
2499
  return _ref2.apply(this, arguments);
2633
2500
  };
2634
2501
  }())).then(function (consults) {
@@ -2636,7 +2503,7 @@ var OroClient = /*#__PURE__*/function () {
2636
2503
  });
2637
2504
 
2638
2505
  case 5:
2639
- indexConsultLockbox = _context10.sent;
2506
+ indexConsultLockbox = _context9.sent;
2640
2507
  this.vaultIndexAdd((_this$vaultIndexAdd = {}, _this$vaultIndexAdd[initApis.IndexKey.Consultation] = indexConsultLockbox, _this$vaultIndexAdd)).then(function () {
2641
2508
  return alert('The Index was successfully updated!');
2642
2509
  })["catch"](function () {
@@ -2645,10 +2512,10 @@ var OroClient = /*#__PURE__*/function () {
2645
2512
 
2646
2513
  case 7:
2647
2514
  case "end":
2648
- return _context10.stop();
2515
+ return _context9.stop();
2649
2516
  }
2650
2517
  }
2651
- }, _callee10, this);
2518
+ }, _callee9, this);
2652
2519
  }));
2653
2520
 
2654
2521
  function forceUpdateIndexEntries() {
@@ -2668,17 +2535,15 @@ var OroClient = /*#__PURE__*/function () {
2668
2535
  _proto.vaultIndexAdd =
2669
2536
  /*#__PURE__*/
2670
2537
  function () {
2671
- var _vaultIndexAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(entries, indexOwnerUuid) {
2672
- var _this2 = this;
2673
-
2538
+ var _vaultIndexAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(entries, indexOwnerUuid) {
2674
2539
  var rsaPub, base64IndexOwnerPubKey, encryptedIndex, _i, _Object$keys, keyString, key;
2675
2540
 
2676
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
2541
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
2677
2542
  while (1) {
2678
- switch (_context11.prev = _context11.next) {
2543
+ switch (_context10.prev = _context10.next) {
2679
2544
  case 0:
2680
2545
  if (this.rsa) {
2681
- _context11.next = 2;
2546
+ _context10.next = 2;
2682
2547
  break;
2683
2548
  }
2684
2549
 
@@ -2686,17 +2551,17 @@ var OroClient = /*#__PURE__*/function () {
2686
2551
 
2687
2552
  case 2:
2688
2553
  if (!indexOwnerUuid) {
2689
- _context11.next = 9;
2554
+ _context10.next = 9;
2690
2555
  break;
2691
2556
  }
2692
2557
 
2693
- _context11.next = 5;
2558
+ _context10.next = 5;
2694
2559
  return this.guardClient.identityGet(indexOwnerUuid);
2695
2560
 
2696
2561
  case 5:
2697
- base64IndexOwnerPubKey = _context11.sent.publicKey;
2562
+ base64IndexOwnerPubKey = _context10.sent.publicKey;
2698
2563
  rsaPub = this.toolbox.decodeFromBase64(base64IndexOwnerPubKey);
2699
- _context11.next = 10;
2564
+ _context10.next = 10;
2700
2565
  break;
2701
2566
 
2702
2567
  case 9:
@@ -2708,14 +2573,14 @@ var OroClient = /*#__PURE__*/function () {
2708
2573
 
2709
2574
  case 12:
2710
2575
  if (!(_i < _Object$keys.length)) {
2711
- _context11.next = 25;
2576
+ _context10.next = 23;
2712
2577
  break;
2713
2578
  }
2714
2579
 
2715
2580
  keyString = _Object$keys[_i];
2716
2581
  key = keyString;
2717
- _context11.t0 = key;
2718
- _context11.next = _context11.t0 === initApis.IndexKey.ConsultationLockbox ? 18 : _context11.t0 === initApis.IndexKey.Consultation ? 20 : 22;
2582
+ _context10.t0 = key;
2583
+ _context10.next = _context10.t0 === initApis.IndexKey.ConsultationLockbox ? 18 : 20;
2719
2584
  break;
2720
2585
 
2721
2586
  case 18:
@@ -2734,117 +2599,31 @@ var OroClient = /*#__PURE__*/function () {
2734
2599
  }, rsaPub)
2735
2600
  };
2736
2601
  });
2737
- return _context11.abrupt("break", 22);
2602
+ return _context10.abrupt("break", 20);
2738
2603
 
2739
2604
  case 20:
2740
- encryptedIndex[key] = entries[key].map(function (e) {
2741
- return _extends({}, e, {
2742
- uniqueHash: _this2.toolbox.hashStringToBase64(JSON.stringify({
2743
- consultationId: e.consultationId,
2744
- grant: e.grant
2745
- }))
2746
- });
2747
- }).filter(function (e) {
2748
- var _this2$vaultIndex$Ind;
2749
-
2750
- return !_this2.vaultIndex || !((_this2$vaultIndex$Ind = _this2.vaultIndex[initApis.IndexKey.Consultation]) != null && _this2$vaultIndex$Ind.find(function (v) {
2751
- return v.uniqueHash === e.uniqueHash;
2752
- }));
2753
- }).map(function (e) {
2754
- return {
2755
- uuid: e.uuid,
2756
- timestamp: e.timestamp,
2757
- uniqueHash: e.uniqueHash,
2758
- encryptedIndexEntry: oroToolbox.CryptoRSA.jsonWithPubEncryptToBase64({
2759
- consultationId: e.consultationId,
2760
- grant: e.grant
2761
- }, rsaPub)
2762
- };
2763
- });
2764
- return _context11.abrupt("break", 22);
2765
-
2766
- case 22:
2767
2605
  _i++;
2768
- _context11.next = 12;
2606
+ _context10.next = 12;
2769
2607
  break;
2770
2608
 
2771
- case 25:
2772
- _context11.next = 27;
2609
+ case 23:
2610
+ _context10.next = 25;
2773
2611
  return this.vaultClient.vaultIndexPut(encryptedIndex, indexOwnerUuid);
2774
2612
 
2775
- case 27:
2613
+ case 25:
2776
2614
  case "end":
2777
- return _context11.stop();
2615
+ return _context10.stop();
2778
2616
  }
2779
2617
  }
2780
- }, _callee11, this);
2618
+ }, _callee10, this);
2781
2619
  }));
2782
2620
 
2783
- function vaultIndexAdd(_x20, _x21) {
2621
+ function vaultIndexAdd(_x19, _x20) {
2784
2622
  return _vaultIndexAdd.apply(this, arguments);
2785
2623
  }
2786
2624
 
2787
2625
  return vaultIndexAdd;
2788
2626
  }()
2789
- /**
2790
- * adds or updates the index snapshot for the logged user
2791
- * @param index
2792
- */
2793
- ;
2794
-
2795
- _proto.indexSnapshotAdd =
2796
- /*#__PURE__*/
2797
- function () {
2798
- var _indexSnapshotAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(index) {
2799
- var _index$IndexKey$Consu, _cleanedIndex;
2800
-
2801
- var rsaPub, cleanedIndex, encryptedIndexEntry, encryptedIndex;
2802
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
2803
- while (1) {
2804
- switch (_context12.prev = _context12.next) {
2805
- case 0:
2806
- if (this.rsa) {
2807
- _context12.next = 2;
2808
- break;
2809
- }
2810
-
2811
- throw IncompleteAuthentication;
2812
-
2813
- case 2:
2814
- rsaPub = this.rsa["public"]();
2815
- cleanedIndex = (_cleanedIndex = {}, _cleanedIndex[initApis.IndexKey.Consultation] = (_index$IndexKey$Consu = index[initApis.IndexKey.Consultation]) == null ? void 0 : _index$IndexKey$Consu.filter(function (c) {
2816
- return c;
2817
- }).map(function (c) {
2818
- return {
2819
- grant: c.grant,
2820
- consultationId: c.consultationId
2821
- };
2822
- }), _cleanedIndex); // the data of the snapshot should not contain the `IndexEntry` data
2823
- // (will create conflicts while updating)
2824
-
2825
- encryptedIndexEntry = oroToolbox.CryptoRSA.jsonWithPubEncryptToBase64(cleanedIndex, rsaPub); // The encryptedIndexEntry can have the uuid and timstamp (for updating)
2826
-
2827
- encryptedIndex = {
2828
- uuid: index.uuid,
2829
- timestamp: index.timestamp,
2830
- encryptedIndexEntry: encryptedIndexEntry
2831
- };
2832
- this.vaultClient.vaultIndexSnapshotPut(encryptedIndex);
2833
-
2834
- case 7:
2835
- case "end":
2836
- return _context12.stop();
2837
- }
2838
- }
2839
- }, _callee12, this);
2840
- }));
2841
-
2842
- function indexSnapshotAdd(_x22) {
2843
- return _indexSnapshotAdd.apply(this, arguments);
2844
- }
2845
-
2846
- return indexSnapshotAdd;
2847
- }()
2848
2627
  /**
2849
2628
  * @name grantLockbox
2850
2629
  * @description Grants a lockbox by retrieving the shared secret of the lockbox and encrypting it with the grantees public key
@@ -2857,48 +2636,48 @@ var OroClient = /*#__PURE__*/function () {
2857
2636
  _proto.grantLockbox =
2858
2637
  /*#__PURE__*/
2859
2638
  function () {
2860
- var _grantLockbox = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(granteeUuid, lockboxUuid, lockboxOwnerUuid) {
2639
+ var _grantLockbox = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(granteeUuid, lockboxUuid, lockboxOwnerUuid) {
2861
2640
  var secret, base64GranteePublicKey, granteePublicKey, granteeEncryptedSecret, request;
2862
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
2641
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
2863
2642
  while (1) {
2864
- switch (_context13.prev = _context13.next) {
2643
+ switch (_context11.prev = _context11.next) {
2865
2644
  case 0:
2866
2645
  if (this.rsa) {
2867
- _context13.next = 2;
2646
+ _context11.next = 2;
2868
2647
  break;
2869
2648
  }
2870
2649
 
2871
2650
  throw IncompleteAuthentication;
2872
2651
 
2873
2652
  case 2:
2874
- _context13.next = 4;
2653
+ _context11.next = 4;
2875
2654
  return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
2876
2655
 
2877
2656
  case 4:
2878
- secret = _context13.sent.key();
2879
- _context13.next = 7;
2657
+ secret = _context11.sent.key();
2658
+ _context11.next = 7;
2880
2659
  return this.guardClient.identityGet(granteeUuid);
2881
2660
 
2882
2661
  case 7:
2883
- base64GranteePublicKey = _context13.sent.publicKey;
2662
+ base64GranteePublicKey = _context11.sent.publicKey;
2884
2663
  granteePublicKey = this.toolbox.decodeFromBase64(base64GranteePublicKey);
2885
2664
  granteeEncryptedSecret = oroToolbox.CryptoRSA.bytesWithPubEncryptToBase64(secret, granteePublicKey);
2886
2665
  request = {
2887
2666
  encryptedSecret: granteeEncryptedSecret,
2888
2667
  granteeUuid: granteeUuid
2889
2668
  };
2890
- _context13.next = 13;
2669
+ _context11.next = 13;
2891
2670
  return this.vaultClient.lockboxGrant(lockboxUuid, request, lockboxOwnerUuid);
2892
2671
 
2893
2672
  case 13:
2894
2673
  case "end":
2895
- return _context13.stop();
2674
+ return _context11.stop();
2896
2675
  }
2897
2676
  }
2898
- }, _callee13, this);
2677
+ }, _callee11, this);
2899
2678
  }));
2900
2679
 
2901
- function grantLockbox(_x23, _x24, _x25) {
2680
+ function grantLockbox(_x21, _x22, _x23) {
2902
2681
  return _grantLockbox.apply(this, arguments);
2903
2682
  }
2904
2683
 
@@ -2919,36 +2698,36 @@ var OroClient = /*#__PURE__*/function () {
2919
2698
  _proto.createMessageData =
2920
2699
  /*#__PURE__*/
2921
2700
  function () {
2922
- var _createMessageData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(lockboxUuid, message, consultationId, lockboxOwnerUuid, previousDataUuid) {
2701
+ var _createMessageData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(lockboxUuid, message, consultationId, lockboxOwnerUuid, previousDataUuid) {
2923
2702
  var symmetricEncryptor, encryptedData, encryptedPrivateMeta, meta, request;
2924
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
2703
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
2925
2704
  while (1) {
2926
- switch (_context14.prev = _context14.next) {
2705
+ switch (_context12.prev = _context12.next) {
2927
2706
  case 0:
2928
2707
  if (this.rsa) {
2929
- _context14.next = 2;
2708
+ _context12.next = 2;
2930
2709
  break;
2931
2710
  }
2932
2711
 
2933
2712
  throw IncompleteAuthentication;
2934
2713
 
2935
2714
  case 2:
2936
- _context14.next = 4;
2715
+ _context12.next = 4;
2937
2716
  return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
2938
2717
 
2939
2718
  case 4:
2940
- symmetricEncryptor = _context14.sent;
2719
+ symmetricEncryptor = _context12.sent;
2941
2720
  encryptedData = symmetricEncryptor.jsonEncryptToBase64Payload(message);
2942
- _context14.t0 = symmetricEncryptor;
2943
- _context14.next = 9;
2721
+ _context12.t0 = symmetricEncryptor;
2722
+ _context12.next = 9;
2944
2723
  return this.guardClient.whoAmI();
2945
2724
 
2946
2725
  case 9:
2947
- _context14.t1 = _context14.sent.sub;
2948
- _context14.t2 = {
2949
- author: _context14.t1
2726
+ _context12.t1 = _context12.sent.sub;
2727
+ _context12.t2 = {
2728
+ author: _context12.t1
2950
2729
  };
2951
- encryptedPrivateMeta = _context14.t0.jsonEncryptToBase64Payload.call(_context14.t0, _context14.t2);
2730
+ encryptedPrivateMeta = _context12.t0.jsonEncryptToBase64Payload.call(_context12.t0, _context12.t2);
2952
2731
  meta = {
2953
2732
  consultationId: consultationId,
2954
2733
  category: initApis.MetadataCategory.Consultation,
@@ -2960,17 +2739,17 @@ var OroClient = /*#__PURE__*/function () {
2960
2739
  publicMetadata: meta,
2961
2740
  privateMetadata: encryptedPrivateMeta
2962
2741
  };
2963
- return _context14.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
2742
+ return _context12.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
2964
2743
 
2965
2744
  case 15:
2966
2745
  case "end":
2967
- return _context14.stop();
2746
+ return _context12.stop();
2968
2747
  }
2969
2748
  }
2970
- }, _callee14, this);
2749
+ }, _callee12, this);
2971
2750
  }));
2972
2751
 
2973
- function createMessageData(_x26, _x27, _x28, _x29, _x30) {
2752
+ function createMessageData(_x24, _x25, _x26, _x27, _x28) {
2974
2753
  return _createMessageData.apply(this, arguments);
2975
2754
  }
2976
2755
 
@@ -2991,50 +2770,50 @@ var OroClient = /*#__PURE__*/function () {
2991
2770
  _proto.createMessageAttachmentData =
2992
2771
  /*#__PURE__*/
2993
2772
  function () {
2994
- var _createMessageAttachmentData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(lockboxUuid, data, consultationId, lockboxOwnerUuid, previousDataUuid) {
2773
+ var _createMessageAttachmentData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(lockboxUuid, data, consultationId, lockboxOwnerUuid, previousDataUuid) {
2995
2774
  var symmetricEncryptor, encryptedData, encryptedPrivateMeta, meta, request;
2996
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
2775
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
2997
2776
  while (1) {
2998
- switch (_context15.prev = _context15.next) {
2777
+ switch (_context13.prev = _context13.next) {
2999
2778
  case 0:
3000
2779
  if (this.rsa) {
3001
- _context15.next = 2;
2780
+ _context13.next = 2;
3002
2781
  break;
3003
2782
  }
3004
2783
 
3005
2784
  throw IncompleteAuthentication;
3006
2785
 
3007
2786
  case 2:
3008
- _context15.next = 4;
2787
+ _context13.next = 4;
3009
2788
  return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
3010
2789
 
3011
2790
  case 4:
3012
- symmetricEncryptor = _context15.sent;
3013
- _context15.t0 = symmetricEncryptor;
3014
- _context15.t1 = Uint8Array;
3015
- _context15.next = 9;
2791
+ symmetricEncryptor = _context13.sent;
2792
+ _context13.t0 = symmetricEncryptor;
2793
+ _context13.t1 = Uint8Array;
2794
+ _context13.next = 9;
3016
2795
  return data.arrayBuffer();
3017
2796
 
3018
2797
  case 9:
3019
- _context15.t2 = _context15.sent;
3020
- _context15.t3 = new _context15.t1(_context15.t2);
3021
- encryptedData = _context15.t0.bytesEncryptToBase64Payload.call(_context15.t0, _context15.t3);
3022
- _context15.t4 = symmetricEncryptor;
3023
- _context15.next = 15;
2798
+ _context13.t2 = _context13.sent;
2799
+ _context13.t3 = new _context13.t1(_context13.t2);
2800
+ encryptedData = _context13.t0.bytesEncryptToBase64Payload.call(_context13.t0, _context13.t3);
2801
+ _context13.t4 = symmetricEncryptor;
2802
+ _context13.next = 15;
3024
2803
  return this.guardClient.whoAmI();
3025
2804
 
3026
2805
  case 15:
3027
- _context15.t5 = _context15.sent.sub;
3028
- _context15.t6 = data.name;
3029
- _context15.t7 = data.lastModified;
3030
- _context15.t8 = data.size;
3031
- _context15.t9 = {
3032
- author: _context15.t5,
3033
- fileName: _context15.t6,
3034
- lastModified: _context15.t7,
3035
- size: _context15.t8
2806
+ _context13.t5 = _context13.sent.sub;
2807
+ _context13.t6 = data.name;
2808
+ _context13.t7 = data.lastModified;
2809
+ _context13.t8 = data.size;
2810
+ _context13.t9 = {
2811
+ author: _context13.t5,
2812
+ fileName: _context13.t6,
2813
+ lastModified: _context13.t7,
2814
+ size: _context13.t8
3036
2815
  };
3037
- encryptedPrivateMeta = _context15.t4.jsonEncryptToBase64Payload.call(_context15.t4, _context15.t9);
2816
+ encryptedPrivateMeta = _context13.t4.jsonEncryptToBase64Payload.call(_context13.t4, _context13.t9);
3038
2817
  meta = {
3039
2818
  consultationId: consultationId,
3040
2819
  category: initApis.MetadataCategory.Consultation,
@@ -3046,17 +2825,17 @@ var OroClient = /*#__PURE__*/function () {
3046
2825
  publicMetadata: meta,
3047
2826
  privateMetadata: encryptedPrivateMeta
3048
2827
  };
3049
- return _context15.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
2828
+ return _context13.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
3050
2829
 
3051
2830
  case 24:
3052
2831
  case "end":
3053
- return _context15.stop();
2832
+ return _context13.stop();
3054
2833
  }
3055
2834
  }
3056
- }, _callee15, this);
2835
+ }, _callee13, this);
3057
2836
  }));
3058
2837
 
3059
- function createMessageAttachmentData(_x31, _x32, _x33, _x34, _x35) {
2838
+ function createMessageAttachmentData(_x29, _x30, _x31, _x32, _x33) {
3060
2839
  return _createMessageAttachmentData.apply(this, arguments);
3061
2840
  }
3062
2841
 
@@ -3078,57 +2857,57 @@ var OroClient = /*#__PURE__*/function () {
3078
2857
  _proto.createConsultationAttachmentData =
3079
2858
  /*#__PURE__*/
3080
2859
  function () {
3081
- var _createConsultationAttachmentData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(lockboxUuid, data, consultationId, documentType, lockboxOwnerUuid, previousDataUuid) {
3082
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
2860
+ var _createConsultationAttachmentData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(lockboxUuid, data, consultationId, documentType, lockboxOwnerUuid, previousDataUuid) {
2861
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
3083
2862
  while (1) {
3084
- switch (_context16.prev = _context16.next) {
2863
+ switch (_context14.prev = _context14.next) {
3085
2864
  case 0:
3086
2865
  if (this.rsa) {
3087
- _context16.next = 2;
2866
+ _context14.next = 2;
3088
2867
  break;
3089
2868
  }
3090
2869
 
3091
2870
  throw IncompleteAuthentication;
3092
2871
 
3093
2872
  case 2:
3094
- _context16.t0 = this;
3095
- _context16.t1 = lockboxUuid;
3096
- _context16.t2 = Uint8Array;
3097
- _context16.next = 7;
2873
+ _context14.t0 = this;
2874
+ _context14.t1 = lockboxUuid;
2875
+ _context14.t2 = Uint8Array;
2876
+ _context14.next = 7;
3098
2877
  return data.arrayBuffer();
3099
2878
 
3100
2879
  case 7:
3101
- _context16.t3 = _context16.sent;
3102
- _context16.t4 = new _context16.t2(_context16.t3);
3103
- _context16.t5 = {
2880
+ _context14.t3 = _context14.sent;
2881
+ _context14.t4 = new _context14.t2(_context14.t3);
2882
+ _context14.t5 = {
3104
2883
  consultationId: consultationId,
3105
2884
  category: initApis.MetadataCategory.Consultation,
3106
2885
  documentType: documentType,
3107
2886
  contentType: data.type
3108
2887
  };
3109
- _context16.next = 12;
2888
+ _context14.next = 12;
3110
2889
  return this.guardClient.whoAmI();
3111
2890
 
3112
2891
  case 12:
3113
- _context16.t6 = _context16.sent.sub;
3114
- _context16.t7 = data.name;
3115
- _context16.t8 = {
3116
- author: _context16.t6,
3117
- fileName: _context16.t7
2892
+ _context14.t6 = _context14.sent.sub;
2893
+ _context14.t7 = data.name;
2894
+ _context14.t8 = {
2895
+ author: _context14.t6,
2896
+ fileName: _context14.t7
3118
2897
  };
3119
- _context16.t9 = lockboxOwnerUuid;
3120
- _context16.t10 = previousDataUuid;
3121
- return _context16.abrupt("return", _context16.t0.createBytesData.call(_context16.t0, _context16.t1, _context16.t4, _context16.t5, _context16.t8, _context16.t9, _context16.t10));
2898
+ _context14.t9 = lockboxOwnerUuid;
2899
+ _context14.t10 = previousDataUuid;
2900
+ return _context14.abrupt("return", _context14.t0.createBytesData.call(_context14.t0, _context14.t1, _context14.t4, _context14.t5, _context14.t8, _context14.t9, _context14.t10));
3122
2901
 
3123
2902
  case 18:
3124
2903
  case "end":
3125
- return _context16.stop();
2904
+ return _context14.stop();
3126
2905
  }
3127
2906
  }
3128
- }, _callee16, this);
2907
+ }, _callee14, this);
3129
2908
  }));
3130
2909
 
3131
- function createConsultationAttachmentData(_x36, _x37, _x38, _x39, _x40, _x41) {
2910
+ function createConsultationAttachmentData(_x34, _x35, _x36, _x37, _x38, _x39) {
3132
2911
  return _createConsultationAttachmentData.apply(this, arguments);
3133
2912
  }
3134
2913
 
@@ -3150,25 +2929,25 @@ var OroClient = /*#__PURE__*/function () {
3150
2929
  _proto.createJsonData =
3151
2930
  /*#__PURE__*/
3152
2931
  function () {
3153
- var _createJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(lockboxUuid, data, meta, privateMeta, lockboxOwnerUuid, previousDataUuid) {
2932
+ var _createJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(lockboxUuid, data, meta, privateMeta, lockboxOwnerUuid, previousDataUuid) {
3154
2933
  var symmetricEncryptor, encryptedData, encryptedPrivateMeta, request;
3155
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
2934
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
3156
2935
  while (1) {
3157
- switch (_context17.prev = _context17.next) {
2936
+ switch (_context15.prev = _context15.next) {
3158
2937
  case 0:
3159
2938
  if (this.rsa) {
3160
- _context17.next = 2;
2939
+ _context15.next = 2;
3161
2940
  break;
3162
2941
  }
3163
2942
 
3164
2943
  throw IncompleteAuthentication;
3165
2944
 
3166
2945
  case 2:
3167
- _context17.next = 4;
2946
+ _context15.next = 4;
3168
2947
  return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
3169
2948
 
3170
2949
  case 4:
3171
- symmetricEncryptor = _context17.sent;
2950
+ symmetricEncryptor = _context15.sent;
3172
2951
  encryptedData = symmetricEncryptor.jsonEncryptToBase64Payload(data);
3173
2952
  encryptedPrivateMeta = symmetricEncryptor.jsonEncryptToBase64Payload(privateMeta);
3174
2953
  request = {
@@ -3176,17 +2955,17 @@ var OroClient = /*#__PURE__*/function () {
3176
2955
  publicMetadata: meta,
3177
2956
  privateMetadata: encryptedPrivateMeta
3178
2957
  };
3179
- return _context17.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
2958
+ return _context15.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
3180
2959
 
3181
2960
  case 9:
3182
2961
  case "end":
3183
- return _context17.stop();
2962
+ return _context15.stop();
3184
2963
  }
3185
2964
  }
3186
- }, _callee17, this);
2965
+ }, _callee15, this);
3187
2966
  }));
3188
2967
 
3189
- function createJsonData(_x42, _x43, _x44, _x45, _x46, _x47) {
2968
+ function createJsonData(_x40, _x41, _x42, _x43, _x44, _x45) {
3190
2969
  return _createJsonData.apply(this, arguments);
3191
2970
  }
3192
2971
 
@@ -3206,32 +2985,32 @@ var OroClient = /*#__PURE__*/function () {
3206
2985
  _proto.getOrInsertJsonData =
3207
2986
  /*#__PURE__*/
3208
2987
  function () {
3209
- var _getOrInsertJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(lockboxUuid, data, publicMetadata, privateMetadata, forceReplace) {
2988
+ var _getOrInsertJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(lockboxUuid, data, publicMetadata, privateMetadata, forceReplace) {
3210
2989
  var manifest;
3211
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
2990
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
3212
2991
  while (1) {
3213
- switch (_context18.prev = _context18.next) {
2992
+ switch (_context16.prev = _context16.next) {
3214
2993
  case 0:
3215
2994
  if (forceReplace === void 0) {
3216
2995
  forceReplace = false;
3217
2996
  }
3218
2997
 
3219
- _context18.next = 3;
2998
+ _context16.next = 3;
3220
2999
  return this.vaultClient.lockboxManifestGet(lockboxUuid, publicMetadata);
3221
3000
 
3222
3001
  case 3:
3223
- manifest = _context18.sent;
3002
+ manifest = _context16.sent;
3224
3003
 
3225
3004
  if (!(!forceReplace && manifest.length > 0)) {
3226
- _context18.next = 9;
3005
+ _context16.next = 9;
3227
3006
  break;
3228
3007
  }
3229
3008
 
3230
3009
  console.log("The data for " + JSON.stringify(publicMetadata) + " already exist");
3231
- return _context18.abrupt("return", manifest[0].dataUuid);
3010
+ return _context16.abrupt("return", manifest[0].dataUuid);
3232
3011
 
3233
3012
  case 9:
3234
- _context18.next = 11;
3013
+ _context16.next = 11;
3235
3014
  return this.createJsonData(lockboxUuid, data, publicMetadata, privateMetadata, undefined, forceReplace && manifest.length > 0 ? manifest[0].dataUuid : undefined // if forceReplace and data already exist, then replace data. Otherwise insert it
3236
3015
  )["catch"](function (err) {
3237
3016
  console.error("Error while upserting data " + JSON.stringify(publicMetadata) + " data", err);
@@ -3239,17 +3018,17 @@ var OroClient = /*#__PURE__*/function () {
3239
3018
  });
3240
3019
 
3241
3020
  case 11:
3242
- return _context18.abrupt("return", _context18.sent.dataUuid);
3021
+ return _context16.abrupt("return", _context16.sent.dataUuid);
3243
3022
 
3244
3023
  case 12:
3245
3024
  case "end":
3246
- return _context18.stop();
3025
+ return _context16.stop();
3247
3026
  }
3248
3027
  }
3249
- }, _callee18, this);
3028
+ }, _callee16, this);
3250
3029
  }));
3251
3030
 
3252
- function getOrInsertJsonData(_x48, _x49, _x50, _x51, _x52) {
3031
+ function getOrInsertJsonData(_x46, _x47, _x48, _x49, _x50) {
3253
3032
  return _getOrInsertJsonData.apply(this, arguments);
3254
3033
  }
3255
3034
 
@@ -3271,25 +3050,25 @@ var OroClient = /*#__PURE__*/function () {
3271
3050
  _proto.createBytesData =
3272
3051
  /*#__PURE__*/
3273
3052
  function () {
3274
- var _createBytesData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(lockboxUuid, data, meta, privateMeta, lockboxOwnerUuid, previousDataUuid) {
3053
+ var _createBytesData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(lockboxUuid, data, meta, privateMeta, lockboxOwnerUuid, previousDataUuid) {
3275
3054
  var symmetricEncryptor, encryptedData, encryptedPrivateMeta, request;
3276
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
3055
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
3277
3056
  while (1) {
3278
- switch (_context19.prev = _context19.next) {
3057
+ switch (_context17.prev = _context17.next) {
3279
3058
  case 0:
3280
3059
  if (this.rsa) {
3281
- _context19.next = 2;
3060
+ _context17.next = 2;
3282
3061
  break;
3283
3062
  }
3284
3063
 
3285
3064
  throw IncompleteAuthentication;
3286
3065
 
3287
3066
  case 2:
3288
- _context19.next = 4;
3067
+ _context17.next = 4;
3289
3068
  return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
3290
3069
 
3291
3070
  case 4:
3292
- symmetricEncryptor = _context19.sent;
3071
+ symmetricEncryptor = _context17.sent;
3293
3072
  encryptedData = symmetricEncryptor.bytesEncryptToBase64Payload(data);
3294
3073
  encryptedPrivateMeta = symmetricEncryptor.jsonEncryptToBase64Payload(privateMeta);
3295
3074
  request = {
@@ -3297,17 +3076,17 @@ var OroClient = /*#__PURE__*/function () {
3297
3076
  publicMetadata: meta,
3298
3077
  privateMetadata: encryptedPrivateMeta
3299
3078
  };
3300
- return _context19.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
3079
+ return _context17.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
3301
3080
 
3302
3081
  case 9:
3303
3082
  case "end":
3304
- return _context19.stop();
3083
+ return _context17.stop();
3305
3084
  }
3306
3085
  }
3307
- }, _callee19, this);
3086
+ }, _callee17, this);
3308
3087
  }));
3309
3088
 
3310
- function createBytesData(_x53, _x54, _x55, _x56, _x57, _x58) {
3089
+ function createBytesData(_x51, _x52, _x53, _x54, _x55, _x56) {
3311
3090
  return _createBytesData.apply(this, arguments);
3312
3091
  }
3313
3092
 
@@ -3329,39 +3108,39 @@ var OroClient = /*#__PURE__*/function () {
3329
3108
  _proto.getJsonData =
3330
3109
  /*#__PURE__*/
3331
3110
  function () {
3332
- var _getJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(lockboxUuid, dataUuid, lockboxOwnerUuid) {
3111
+ var _getJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(lockboxUuid, dataUuid, lockboxOwnerUuid) {
3333
3112
  var _yield$Promise$all, encryptedPayload, symmetricDecryptor;
3334
3113
 
3335
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
3114
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
3336
3115
  while (1) {
3337
- switch (_context20.prev = _context20.next) {
3116
+ switch (_context18.prev = _context18.next) {
3338
3117
  case 0:
3339
3118
  if (this.rsa) {
3340
- _context20.next = 2;
3119
+ _context18.next = 2;
3341
3120
  break;
3342
3121
  }
3343
3122
 
3344
3123
  throw IncompleteAuthentication;
3345
3124
 
3346
3125
  case 2:
3347
- _context20.next = 4;
3126
+ _context18.next = 4;
3348
3127
  return Promise.all([this.vaultClient.lockboxDataGet(lockboxUuid, dataUuid, lockboxOwnerUuid), this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid)]);
3349
3128
 
3350
3129
  case 4:
3351
- _yield$Promise$all = _context20.sent;
3130
+ _yield$Promise$all = _context18.sent;
3352
3131
  encryptedPayload = _yield$Promise$all[0];
3353
3132
  symmetricDecryptor = _yield$Promise$all[1];
3354
- return _context20.abrupt("return", symmetricDecryptor.base64PayloadDecryptToJson(encryptedPayload.data));
3133
+ return _context18.abrupt("return", symmetricDecryptor.base64PayloadDecryptToJson(encryptedPayload.data));
3355
3134
 
3356
3135
  case 8:
3357
3136
  case "end":
3358
- return _context20.stop();
3137
+ return _context18.stop();
3359
3138
  }
3360
3139
  }
3361
- }, _callee20, this);
3140
+ }, _callee18, this);
3362
3141
  }));
3363
3142
 
3364
- function getJsonData(_x59, _x60, _x61) {
3143
+ function getJsonData(_x57, _x58, _x59) {
3365
3144
  return _getJsonData.apply(this, arguments);
3366
3145
  }
3367
3146
 
@@ -3379,39 +3158,39 @@ var OroClient = /*#__PURE__*/function () {
3379
3158
  _proto.getBytesData =
3380
3159
  /*#__PURE__*/
3381
3160
  function () {
3382
- var _getBytesData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(lockboxUuid, dataUuid, lockboxOwnerUuid) {
3161
+ var _getBytesData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(lockboxUuid, dataUuid, lockboxOwnerUuid) {
3383
3162
  var _yield$Promise$all2, encryptedPayload, symmetricDecryptor;
3384
3163
 
3385
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
3164
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
3386
3165
  while (1) {
3387
- switch (_context21.prev = _context21.next) {
3166
+ switch (_context19.prev = _context19.next) {
3388
3167
  case 0:
3389
3168
  if (this.rsa) {
3390
- _context21.next = 2;
3169
+ _context19.next = 2;
3391
3170
  break;
3392
3171
  }
3393
3172
 
3394
3173
  throw IncompleteAuthentication;
3395
3174
 
3396
3175
  case 2:
3397
- _context21.next = 4;
3176
+ _context19.next = 4;
3398
3177
  return Promise.all([this.vaultClient.lockboxDataGet(lockboxUuid, dataUuid, lockboxOwnerUuid), this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid)]);
3399
3178
 
3400
3179
  case 4:
3401
- _yield$Promise$all2 = _context21.sent;
3180
+ _yield$Promise$all2 = _context19.sent;
3402
3181
  encryptedPayload = _yield$Promise$all2[0];
3403
3182
  symmetricDecryptor = _yield$Promise$all2[1];
3404
- return _context21.abrupt("return", symmetricDecryptor.base64PayloadDecryptToBytes(encryptedPayload.data));
3183
+ return _context19.abrupt("return", symmetricDecryptor.base64PayloadDecryptToBytes(encryptedPayload.data));
3405
3184
 
3406
3185
  case 8:
3407
3186
  case "end":
3408
- return _context21.stop();
3187
+ return _context19.stop();
3409
3188
  }
3410
3189
  }
3411
- }, _callee21, this);
3190
+ }, _callee19, this);
3412
3191
  }));
3413
3192
 
3414
- function getBytesData(_x62, _x63, _x64) {
3193
+ function getBytesData(_x60, _x61, _x62) {
3415
3194
  return _getBytesData.apply(this, arguments);
3416
3195
  }
3417
3196
 
@@ -3432,41 +3211,84 @@ var OroClient = /*#__PURE__*/function () {
3432
3211
  _proto.getGrants =
3433
3212
  /*#__PURE__*/
3434
3213
  function () {
3435
- var _getGrants = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(filter, forceRefresh) {
3436
- var filterString, grantsByConsultLockbox, decryptedConsults, encryptedGrants, decryptedGrants;
3437
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
3214
+ var _getGrants = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(filter) {
3215
+ var filterString, currentAccountRole, encryptedGrants, decryptedGrants, grantsByConsultLockbox, decryptedConsults;
3216
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
3438
3217
  while (1) {
3439
- switch (_context22.prev = _context22.next) {
3218
+ switch (_context20.prev = _context20.next) {
3440
3219
  case 0:
3441
- if (forceRefresh === void 0) {
3442
- forceRefresh = false;
3443
- }
3444
-
3445
3220
  if (this.rsa) {
3446
- _context22.next = 3;
3221
+ _context20.next = 2;
3447
3222
  break;
3448
3223
  }
3449
3224
 
3450
3225
  throw IncompleteAuthentication;
3451
3226
 
3452
- case 3:
3227
+ case 2:
3453
3228
  filterString = JSON.stringify(filter); // retrieves cached grants
3454
- // Note: if filters is set to empty, it will be stored in the `undefined` key
3455
3229
 
3456
- if (!(!forceRefresh && this.cachedMetadataGrants[filterString])) {
3457
- _context22.next = 6;
3230
+ if (!this.cachedMetadataGrants[filterString]) {
3231
+ _context20.next = 5;
3458
3232
  break;
3459
3233
  }
3460
3234
 
3461
- return _context22.abrupt("return", this.cachedMetadataGrants[filterString]);
3235
+ return _context20.abrupt("return", this.cachedMetadataGrants[filterString]);
3236
+
3237
+ case 5:
3238
+ _context20.next = 7;
3239
+ return this.getAccountRole();
3240
+
3241
+ case 7:
3242
+ currentAccountRole = _context20.sent;
3243
+
3244
+ if (![initApis.OtherRoleType.Patient, initApis.OtherRoleType.User].every(function (requiredRole) {
3245
+ return currentAccountRole.includes(requiredRole);
3246
+ })) {
3247
+ _context20.next = 24;
3248
+ break;
3249
+ }
3462
3250
 
3463
- case 6:
3464
3251
  if (!filter) {
3465
- _context22.next = 12;
3252
+ _context20.next = 15;
3466
3253
  break;
3467
3254
  }
3468
3255
 
3469
- _context22.next = 9;
3256
+ _context20.next = 12;
3257
+ return filterGrantsWithLockboxMetadata(this, filter);
3258
+
3259
+ case 12:
3260
+ encryptedGrants = _context20.sent;
3261
+ _context20.next = 18;
3262
+ break;
3263
+
3264
+ case 15:
3265
+ _context20.next = 17;
3266
+ return this.vaultClient.grantsGet();
3267
+
3268
+ case 17:
3269
+ encryptedGrants = _context20.sent.grants;
3270
+
3271
+ case 18:
3272
+ _context20.next = 20;
3273
+ return decryptGrants(encryptedGrants, this.rsa);
3274
+
3275
+ case 20:
3276
+ decryptedGrants = _context20.sent;
3277
+ // sets the cached grant
3278
+ this.cachedMetadataGrants[filterString] = decryptedGrants;
3279
+ console.info('[sdk:grant] Found grant for patient');
3280
+ return _context20.abrupt("return", decryptedGrants);
3281
+
3282
+ case 24:
3283
+ if (filter) {
3284
+ _context20.next = 26;
3285
+ break;
3286
+ }
3287
+
3288
+ throw MissingGrantFilter;
3289
+
3290
+ case 26:
3291
+ _context20.next = 28;
3470
3292
  return this.vaultClient.vaultIndexGet([initApis.IndexKey.ConsultationLockbox], [filter.consultationId]).then(function (res) {
3471
3293
  return res[initApis.IndexKey.ConsultationLockbox];
3472
3294
  })["catch"](function (e) {
@@ -3474,71 +3296,70 @@ var OroClient = /*#__PURE__*/function () {
3474
3296
  return [];
3475
3297
  });
3476
3298
 
3477
- case 9:
3478
- _context22.t0 = _context22.sent;
3479
- _context22.next = 13;
3480
- break;
3481
-
3482
- case 12:
3483
- _context22.t0 = undefined;
3484
-
3485
- case 13:
3486
- grantsByConsultLockbox = _context22.t0;
3299
+ case 28:
3300
+ grantsByConsultLockbox = _context20.sent;
3487
3301
  decryptedConsults = decryptConsultLockboxGrants(grantsByConsultLockbox != null ? grantsByConsultLockbox : [], this.rsa);
3488
3302
 
3489
3303
  if (!(decryptedConsults.length > 0)) {
3490
- _context22.next = 19;
3304
+ _context20.next = 34;
3491
3305
  break;
3492
3306
  }
3493
3307
 
3494
3308
  console.info('[sdk:index] Grants found in user`s constant time secure index');
3495
- this.cachedMetadataGrants[JSON.stringify(filter)] = decryptedConsults;
3496
- return _context22.abrupt("return", this.cachedMetadataGrants[filterString]);
3497
-
3498
- case 19:
3499
- if (!filter) {
3500
- _context22.next = 25;
3501
- break;
3502
- }
3309
+ this.cachedMetadataGrants[filterString] = decryptedConsults;
3310
+ return _context20.abrupt("return", this.cachedMetadataGrants[filterString]);
3503
3311
 
3504
- _context22.next = 22;
3505
- return filterGrantsWithLockboxMetadata(this, filter, this.vaultIndex, forceRefresh);
3312
+ case 34:
3313
+ return _context20.abrupt("return", []);
3506
3314
 
3507
- case 22:
3508
- encryptedGrants = _context22.sent;
3509
- _context22.next = 28;
3510
- break;
3315
+ case 35:
3316
+ case "end":
3317
+ return _context20.stop();
3318
+ }
3319
+ }
3320
+ }, _callee20, this);
3321
+ }));
3511
3322
 
3512
- case 25:
3513
- _context22.next = 27;
3514
- return this.vaultClient.grantsGet();
3323
+ function getGrants(_x63) {
3324
+ return _getGrants.apply(this, arguments);
3325
+ }
3515
3326
 
3516
- case 27:
3517
- encryptedGrants = _context22.sent.grants;
3327
+ return getGrants;
3328
+ }()
3329
+ /**
3330
+ * Fetches the role of the account that is logged in
3331
+ *
3332
+ * @returns the role based scopes defined by the whoami
3333
+ */
3334
+ ;
3518
3335
 
3519
- case 28:
3520
- _context22.next = 30;
3521
- return decryptGrants(encryptedGrants, this.rsa);
3336
+ _proto.getAccountRole =
3337
+ /*#__PURE__*/
3338
+ function () {
3339
+ var _getAccountRole = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
3340
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
3341
+ while (1) {
3342
+ switch (_context21.prev = _context21.next) {
3343
+ case 0:
3344
+ _context21.next = 2;
3345
+ return this.guardClient.whoAmI();
3522
3346
 
3523
- case 30:
3524
- decryptedGrants = _context22.sent;
3525
- // sets the cached grant
3526
- this.cachedMetadataGrants[filterString] = decryptedGrants;
3527
- return _context22.abrupt("return", decryptedGrants);
3347
+ case 2:
3348
+ return _context21.abrupt("return", _context21.sent.scope.split(' '));
3528
3349
 
3529
- case 33:
3350
+ case 3:
3530
3351
  case "end":
3531
- return _context22.stop();
3352
+ return _context21.stop();
3532
3353
  }
3533
3354
  }
3534
- }, _callee22, this);
3355
+ }, _callee21, this);
3535
3356
  }));
3536
3357
 
3537
- function getGrants(_x65, _x66) {
3538
- return _getGrants.apply(this, arguments);
3358
+ function getAccountRole() {
3359
+ return _getAccountRole.apply(this, arguments);
3539
3360
  }
3540
3361
 
3541
- return getGrants;
3362
+ return getAccountRole;
3542
3363
  }()
3543
3364
  /**
3544
3365
  * @name getCachedSecretCryptor
@@ -3552,14 +3373,14 @@ var OroClient = /*#__PURE__*/function () {
3552
3373
  _proto.getCachedSecretCryptor =
3553
3374
  /*#__PURE__*/
3554
3375
  function () {
3555
- var _getCachedSecretCryptor = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(lockboxUuid, lockboxOwnerUuid) {
3376
+ var _getCachedSecretCryptor = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(lockboxUuid, lockboxOwnerUuid) {
3556
3377
  var index, encryptedSecret, secret, cryptor;
3557
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
3378
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
3558
3379
  while (1) {
3559
- switch (_context23.prev = _context23.next) {
3380
+ switch (_context22.prev = _context22.next) {
3560
3381
  case 0:
3561
3382
  if (this.rsa) {
3562
- _context23.next = 2;
3383
+ _context22.next = 2;
3563
3384
  break;
3564
3385
  }
3565
3386
 
@@ -3571,35 +3392,35 @@ var OroClient = /*#__PURE__*/function () {
3571
3392
  });
3572
3393
 
3573
3394
  if (!(index === -1)) {
3574
- _context23.next = 13;
3395
+ _context22.next = 13;
3575
3396
  break;
3576
3397
  }
3577
3398
 
3578
- _context23.next = 6;
3399
+ _context22.next = 6;
3579
3400
  return this.vaultClient.lockboxSecretGet(lockboxUuid, lockboxOwnerUuid);
3580
3401
 
3581
3402
  case 6:
3582
- encryptedSecret = _context23.sent.sharedSecret;
3403
+ encryptedSecret = _context22.sent.sharedSecret;
3583
3404
  secret = this.rsa.base64DecryptToBytes(encryptedSecret);
3584
3405
  cryptor = this.toolbox.CryptoChaCha.fromKey(secret);
3585
3406
  this.secrets.push({
3586
3407
  lockboxUuid: lockboxUuid,
3587
3408
  cryptor: cryptor
3588
3409
  });
3589
- return _context23.abrupt("return", cryptor);
3410
+ return _context22.abrupt("return", cryptor);
3590
3411
 
3591
3412
  case 13:
3592
- return _context23.abrupt("return", this.secrets[index].cryptor);
3413
+ return _context22.abrupt("return", this.secrets[index].cryptor);
3593
3414
 
3594
3415
  case 14:
3595
3416
  case "end":
3596
- return _context23.stop();
3417
+ return _context22.stop();
3597
3418
  }
3598
3419
  }
3599
- }, _callee23, this);
3420
+ }, _callee22, this);
3600
3421
  }));
3601
3422
 
3602
- function getCachedSecretCryptor(_x67, _x68) {
3423
+ function getCachedSecretCryptor(_x64, _x65) {
3603
3424
  return _getCachedSecretCryptor.apply(this, arguments);
3604
3425
  }
3605
3426
 
@@ -3619,26 +3440,26 @@ var OroClient = /*#__PURE__*/function () {
3619
3440
  _proto.getPersonalInformationsFromConsultId =
3620
3441
  /*#__PURE__*/
3621
3442
  function () {
3622
- var _getPersonalInformationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(consultationId, category, forceRefresh) {
3623
- return _regeneratorRuntime().wrap(function _callee24$(_context24) {
3443
+ var _getPersonalInformationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(consultationId, category, forceRefresh) {
3444
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
3624
3445
  while (1) {
3625
- switch (_context24.prev = _context24.next) {
3446
+ switch (_context23.prev = _context23.next) {
3626
3447
  case 0:
3627
3448
  if (forceRefresh === void 0) {
3628
3449
  forceRefresh = false;
3629
3450
  }
3630
3451
 
3631
- return _context24.abrupt("return", this.getMetaCategoryFromConsultId(consultationId, category, forceRefresh));
3452
+ return _context23.abrupt("return", this.getMetaCategoryFromConsultId(consultationId, category, forceRefresh));
3632
3453
 
3633
3454
  case 2:
3634
3455
  case "end":
3635
- return _context24.stop();
3456
+ return _context23.stop();
3636
3457
  }
3637
3458
  }
3638
- }, _callee24, this);
3459
+ }, _callee23, this);
3639
3460
  }));
3640
3461
 
3641
- function getPersonalInformationsFromConsultId(_x69, _x70, _x71) {
3462
+ function getPersonalInformationsFromConsultId(_x66, _x67, _x68) {
3642
3463
  return _getPersonalInformationsFromConsultId.apply(this, arguments);
3643
3464
  }
3644
3465
 
@@ -3657,26 +3478,26 @@ var OroClient = /*#__PURE__*/function () {
3657
3478
  _proto.getMedicalDataFromConsultId =
3658
3479
  /*#__PURE__*/
3659
3480
  function () {
3660
- var _getMedicalDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(consultationId, forceRefresh) {
3661
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
3481
+ var _getMedicalDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(consultationId, forceRefresh) {
3482
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
3662
3483
  while (1) {
3663
- switch (_context25.prev = _context25.next) {
3484
+ switch (_context24.prev = _context24.next) {
3664
3485
  case 0:
3665
3486
  if (forceRefresh === void 0) {
3666
3487
  forceRefresh = false;
3667
3488
  }
3668
3489
 
3669
- return _context25.abrupt("return", this.getMetaCategoryFromConsultId(consultationId, initApis.MetadataCategory.Medical, forceRefresh));
3490
+ return _context24.abrupt("return", this.getMetaCategoryFromConsultId(consultationId, initApis.MetadataCategory.Medical, forceRefresh));
3670
3491
 
3671
3492
  case 2:
3672
3493
  case "end":
3673
- return _context25.stop();
3494
+ return _context24.stop();
3674
3495
  }
3675
3496
  }
3676
- }, _callee25, this);
3497
+ }, _callee24, this);
3677
3498
  }));
3678
3499
 
3679
- function getMedicalDataFromConsultId(_x72, _x73) {
3500
+ function getMedicalDataFromConsultId(_x69, _x70) {
3680
3501
  return _getMedicalDataFromConsultId.apply(this, arguments);
3681
3502
  }
3682
3503
 
@@ -3684,103 +3505,103 @@ var OroClient = /*#__PURE__*/function () {
3684
3505
  }();
3685
3506
 
3686
3507
  _proto.getMetaCategoryFromConsultId = /*#__PURE__*/function () {
3687
- var _getMetaCategoryFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(consultationId, category, forceRefresh) {
3688
- var _this3 = this;
3508
+ var _getMetaCategoryFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(consultationId, category, forceRefresh) {
3509
+ var _this2 = this;
3689
3510
 
3690
3511
  var grants, workflowData, _loop, _iterator, _step;
3691
3512
 
3692
- return _regeneratorRuntime().wrap(function _callee27$(_context28) {
3513
+ return _regeneratorRuntime().wrap(function _callee26$(_context27) {
3693
3514
  while (1) {
3694
- switch (_context28.prev = _context28.next) {
3515
+ switch (_context27.prev = _context27.next) {
3695
3516
  case 0:
3696
3517
  if (forceRefresh === void 0) {
3697
3518
  forceRefresh = false;
3698
3519
  }
3699
3520
 
3700
- _context28.next = 3;
3521
+ _context27.next = 3;
3701
3522
  return this.getGrants({
3702
3523
  consultationId: consultationId
3703
3524
  });
3704
3525
 
3705
3526
  case 3:
3706
- grants = _context28.sent;
3527
+ grants = _context27.sent;
3707
3528
  workflowData = [];
3708
3529
  _loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
3709
3530
  var grant, manifest, data;
3710
- return _regeneratorRuntime().wrap(function _loop$(_context27) {
3531
+ return _regeneratorRuntime().wrap(function _loop$(_context26) {
3711
3532
  while (1) {
3712
- switch (_context27.prev = _context27.next) {
3533
+ switch (_context26.prev = _context26.next) {
3713
3534
  case 0:
3714
3535
  grant = _step.value;
3715
- _context27.next = 3;
3716
- return _this3.getLockboxManifest(grant.lockboxUuid, {
3536
+ _context26.next = 3;
3537
+ return _this2.getLockboxManifest(grant.lockboxUuid, {
3717
3538
  category: category,
3718
3539
  documentType: initApis.DocumentType.PopulatedWorkflowData,
3719
3540
  consultationIds: [consultationId]
3720
3541
  }, true, grant.lockboxOwnerUuid, forceRefresh);
3721
3542
 
3722
3543
  case 3:
3723
- manifest = _context27.sent;
3544
+ manifest = _context26.sent;
3724
3545
 
3725
3546
  if (!(manifest.length === 0)) {
3726
- _context27.next = 8;
3547
+ _context26.next = 8;
3727
3548
  break;
3728
3549
  }
3729
3550
 
3730
- _context27.next = 7;
3731
- return _this3.getLockboxManifest(grant.lockboxUuid, {
3551
+ _context26.next = 7;
3552
+ return _this2.getLockboxManifest(grant.lockboxUuid, {
3732
3553
  category: category,
3733
3554
  documentType: initApis.DocumentType.PopulatedWorkflowData
3734
3555
  }, true, grant.lockboxOwnerUuid, forceRefresh);
3735
3556
 
3736
3557
  case 7:
3737
- manifest = _context27.sent.filter(function (entry) {
3558
+ manifest = _context26.sent.filter(function (entry) {
3738
3559
  return !entry.metadata.consultationIds;
3739
3560
  });
3740
3561
 
3741
3562
  case 8:
3742
- _context27.next = 10;
3563
+ _context26.next = 10;
3743
3564
  return Promise.all(manifest.map( /*#__PURE__*/function () {
3744
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(entry) {
3745
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
3565
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(entry) {
3566
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
3746
3567
  while (1) {
3747
- switch (_context26.prev = _context26.next) {
3568
+ switch (_context25.prev = _context25.next) {
3748
3569
  case 0:
3749
- _context26.t0 = grant.lockboxOwnerUuid;
3750
- _context26.t1 = grant.lockboxUuid;
3751
- _context26.t2 = entry.dataUuid;
3752
- _context26.next = 5;
3753
- return _this3.getJsonData(grant.lockboxUuid, entry.dataUuid);
3570
+ _context25.t0 = grant.lockboxOwnerUuid;
3571
+ _context25.t1 = grant.lockboxUuid;
3572
+ _context25.t2 = entry.dataUuid;
3573
+ _context25.next = 5;
3574
+ return _this2.getJsonData(grant.lockboxUuid, entry.dataUuid);
3754
3575
 
3755
3576
  case 5:
3756
- _context26.t3 = _context26.sent;
3757
- return _context26.abrupt("return", {
3758
- lockboxOwnerUuid: _context26.t0,
3759
- lockboxUuid: _context26.t1,
3760
- dataUuid: _context26.t2,
3761
- data: _context26.t3
3577
+ _context25.t3 = _context25.sent;
3578
+ return _context25.abrupt("return", {
3579
+ lockboxOwnerUuid: _context25.t0,
3580
+ lockboxUuid: _context25.t1,
3581
+ dataUuid: _context25.t2,
3582
+ data: _context25.t3
3762
3583
  });
3763
3584
 
3764
3585
  case 7:
3765
3586
  case "end":
3766
- return _context26.stop();
3587
+ return _context25.stop();
3767
3588
  }
3768
3589
  }
3769
- }, _callee26);
3590
+ }, _callee25);
3770
3591
  }));
3771
3592
 
3772
- return function (_x77) {
3593
+ return function (_x74) {
3773
3594
  return _ref3.apply(this, arguments);
3774
3595
  };
3775
3596
  }()));
3776
3597
 
3777
3598
  case 10:
3778
- data = _context27.sent;
3599
+ data = _context26.sent;
3779
3600
  workflowData = _extends({}, workflowData, data);
3780
3601
 
3781
3602
  case 12:
3782
3603
  case "end":
3783
- return _context27.stop();
3604
+ return _context26.stop();
3784
3605
  }
3785
3606
  }
3786
3607
  }, _loop);
@@ -3789,28 +3610,28 @@ var OroClient = /*#__PURE__*/function () {
3789
3610
 
3790
3611
  case 7:
3791
3612
  if ((_step = _iterator()).done) {
3792
- _context28.next = 11;
3613
+ _context27.next = 11;
3793
3614
  break;
3794
3615
  }
3795
3616
 
3796
- return _context28.delegateYield(_loop(), "t0", 9);
3617
+ return _context27.delegateYield(_loop(), "t0", 9);
3797
3618
 
3798
3619
  case 9:
3799
- _context28.next = 7;
3620
+ _context27.next = 7;
3800
3621
  break;
3801
3622
 
3802
3623
  case 11:
3803
- return _context28.abrupt("return", workflowData);
3624
+ return _context27.abrupt("return", workflowData);
3804
3625
 
3805
3626
  case 12:
3806
3627
  case "end":
3807
- return _context28.stop();
3628
+ return _context27.stop();
3808
3629
  }
3809
3630
  }
3810
- }, _callee27, this);
3631
+ }, _callee26, this);
3811
3632
  }));
3812
3633
 
3813
- function getMetaCategoryFromConsultId(_x74, _x75, _x76) {
3634
+ function getMetaCategoryFromConsultId(_x71, _x72, _x73) {
3814
3635
  return _getMetaCategoryFromConsultId.apply(this, arguments);
3815
3636
  }
3816
3637
 
@@ -3826,22 +3647,22 @@ var OroClient = /*#__PURE__*/function () {
3826
3647
  _proto.getPersonalInformations =
3827
3648
  /*#__PURE__*/
3828
3649
  function () {
3829
- var _getPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(userId) {
3650
+ var _getPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(userId) {
3830
3651
  var grant, lockboxUuid, lockboxOwnerUuid, identificationDataUuid;
3831
- return _regeneratorRuntime().wrap(function _callee28$(_context29) {
3652
+ return _regeneratorRuntime().wrap(function _callee27$(_context28) {
3832
3653
  while (1) {
3833
- switch (_context29.prev = _context29.next) {
3654
+ switch (_context28.prev = _context28.next) {
3834
3655
  case 0:
3835
- _context29.next = 2;
3656
+ _context28.next = 2;
3836
3657
  return this.getGrants();
3837
3658
 
3838
3659
  case 2:
3839
- grant = _context29.sent.find(function (lockbox) {
3660
+ grant = _context28.sent.find(function (lockbox) {
3840
3661
  return lockbox.lockboxOwnerUuid === userId;
3841
3662
  });
3842
3663
 
3843
3664
  if (grant) {
3844
- _context29.next = 5;
3665
+ _context28.next = 5;
3845
3666
  break;
3846
3667
  }
3847
3668
 
@@ -3851,7 +3672,7 @@ var OroClient = /*#__PURE__*/function () {
3851
3672
  lockboxUuid = grant.lockboxUuid, lockboxOwnerUuid = grant.lockboxOwnerUuid;
3852
3673
 
3853
3674
  if (lockboxUuid) {
3854
- _context29.next = 8;
3675
+ _context28.next = 8;
3855
3676
  break;
3856
3677
  }
3857
3678
 
@@ -3859,45 +3680,45 @@ var OroClient = /*#__PURE__*/function () {
3859
3680
 
3860
3681
  case 8:
3861
3682
  if (lockboxOwnerUuid) {
3862
- _context29.next = 10;
3683
+ _context28.next = 10;
3863
3684
  break;
3864
3685
  }
3865
3686
 
3866
3687
  throw MissingLockboxOwner;
3867
3688
 
3868
3689
  case 10:
3869
- _context29.next = 12;
3690
+ _context28.next = 12;
3870
3691
  return this.getLockboxManifest(lockboxUuid, {
3871
3692
  category: initApis.MetadataCategory.Personal,
3872
3693
  documentType: initApis.DocumentType.PopulatedWorkflowData
3873
3694
  }, false, userId);
3874
3695
 
3875
3696
  case 12:
3876
- identificationDataUuid = _context29.sent[0].dataUuid;
3877
- _context29.t0 = lockboxOwnerUuid;
3878
- _context29.t1 = lockboxUuid;
3879
- _context29.t2 = identificationDataUuid;
3880
- _context29.next = 18;
3697
+ identificationDataUuid = _context28.sent[0].dataUuid;
3698
+ _context28.t0 = lockboxOwnerUuid;
3699
+ _context28.t1 = lockboxUuid;
3700
+ _context28.t2 = identificationDataUuid;
3701
+ _context28.next = 18;
3881
3702
  return this.getJsonData(lockboxUuid, identificationDataUuid);
3882
3703
 
3883
3704
  case 18:
3884
- _context29.t3 = _context29.sent;
3885
- return _context29.abrupt("return", {
3886
- lockboxOwnerUuid: _context29.t0,
3887
- lockboxUuid: _context29.t1,
3888
- dataUuid: _context29.t2,
3889
- data: _context29.t3
3705
+ _context28.t3 = _context28.sent;
3706
+ return _context28.abrupt("return", {
3707
+ lockboxOwnerUuid: _context28.t0,
3708
+ lockboxUuid: _context28.t1,
3709
+ dataUuid: _context28.t2,
3710
+ data: _context28.t3
3890
3711
  });
3891
3712
 
3892
3713
  case 20:
3893
3714
  case "end":
3894
- return _context29.stop();
3715
+ return _context28.stop();
3895
3716
  }
3896
3717
  }
3897
- }, _callee28, this);
3718
+ }, _callee27, this);
3898
3719
  }));
3899
3720
 
3900
- function getPersonalInformations(_x78) {
3721
+ function getPersonalInformations(_x75) {
3901
3722
  return _getPersonalInformations.apply(this, arguments);
3902
3723
  }
3903
3724
 
@@ -3914,39 +3735,39 @@ var OroClient = /*#__PURE__*/function () {
3914
3735
  _proto.getGrantFromConsultId =
3915
3736
  /*#__PURE__*/
3916
3737
  function () {
3917
- var _getGrantFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(consultationId) {
3738
+ var _getGrantFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(consultationId) {
3918
3739
  var grants;
3919
- return _regeneratorRuntime().wrap(function _callee29$(_context30) {
3740
+ return _regeneratorRuntime().wrap(function _callee28$(_context29) {
3920
3741
  while (1) {
3921
- switch (_context30.prev = _context30.next) {
3742
+ switch (_context29.prev = _context29.next) {
3922
3743
  case 0:
3923
- _context30.next = 2;
3744
+ _context29.next = 2;
3924
3745
  return this.getGrants({
3925
3746
  consultationId: consultationId
3926
3747
  });
3927
3748
 
3928
3749
  case 2:
3929
- grants = _context30.sent;
3750
+ grants = _context29.sent;
3930
3751
 
3931
3752
  if (!(grants.length === 0)) {
3932
- _context30.next = 5;
3753
+ _context29.next = 5;
3933
3754
  break;
3934
3755
  }
3935
3756
 
3936
3757
  throw AssociatedLockboxNotFound;
3937
3758
 
3938
3759
  case 5:
3939
- return _context30.abrupt("return", grants[0]);
3760
+ return _context29.abrupt("return", grants[0]);
3940
3761
 
3941
3762
  case 6:
3942
3763
  case "end":
3943
- return _context30.stop();
3764
+ return _context29.stop();
3944
3765
  }
3945
3766
  }
3946
- }, _callee29, this);
3767
+ }, _callee28, this);
3947
3768
  }));
3948
3769
 
3949
- function getGrantFromConsultId(_x79) {
3770
+ function getGrantFromConsultId(_x76) {
3950
3771
  return _getGrantFromConsultId.apply(this, arguments);
3951
3772
  }
3952
3773
 
@@ -3962,41 +3783,41 @@ var OroClient = /*#__PURE__*/function () {
3962
3783
  _proto.getIdentityFromConsultId =
3963
3784
  /*#__PURE__*/
3964
3785
  function () {
3965
- var _getIdentityFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(consultationId) {
3786
+ var _getIdentityFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(consultationId) {
3966
3787
  var grant;
3967
- return _regeneratorRuntime().wrap(function _callee30$(_context31) {
3788
+ return _regeneratorRuntime().wrap(function _callee29$(_context30) {
3968
3789
  while (1) {
3969
- switch (_context31.prev = _context31.next) {
3790
+ switch (_context30.prev = _context30.next) {
3970
3791
  case 0:
3971
- _context31.next = 2;
3792
+ _context30.next = 2;
3972
3793
  return this.getGrantFromConsultId(consultationId);
3973
3794
 
3974
3795
  case 2:
3975
- grant = _context31.sent;
3796
+ grant = _context30.sent;
3976
3797
 
3977
3798
  if (!(grant && grant.lockboxOwnerUuid)) {
3978
- _context31.next = 9;
3799
+ _context30.next = 9;
3979
3800
  break;
3980
3801
  }
3981
3802
 
3982
- _context31.next = 6;
3803
+ _context30.next = 6;
3983
3804
  return this.guardClient.identityGet(grant.lockboxOwnerUuid);
3984
3805
 
3985
3806
  case 6:
3986
- return _context31.abrupt("return", _context31.sent);
3807
+ return _context30.abrupt("return", _context30.sent);
3987
3808
 
3988
3809
  case 9:
3989
- return _context31.abrupt("return", undefined);
3810
+ return _context30.abrupt("return", undefined);
3990
3811
 
3991
3812
  case 10:
3992
3813
  case "end":
3993
- return _context31.stop();
3814
+ return _context30.stop();
3994
3815
  }
3995
3816
  }
3996
- }, _callee30, this);
3817
+ }, _callee29, this);
3997
3818
  }));
3998
3819
 
3999
- function getIdentityFromConsultId(_x80) {
3820
+ function getIdentityFromConsultId(_x77) {
4000
3821
  return _getIdentityFromConsultId.apply(this, arguments);
4001
3822
  }
4002
3823
 
@@ -4017,13 +3838,13 @@ var OroClient = /*#__PURE__*/function () {
4017
3838
  _proto.getLockboxManifest =
4018
3839
  /*#__PURE__*/
4019
3840
  function () {
4020
- var _getLockboxManifest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(lockboxUuid, filter, expandPrivateMetadata, lockboxOwnerUuid, forceRefresh) {
4021
- var _this4 = this;
3841
+ var _getLockboxManifest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(lockboxUuid, filter, expandPrivateMetadata, lockboxOwnerUuid, forceRefresh) {
3842
+ var _this3 = this;
4022
3843
 
4023
3844
  var manifestKey;
4024
- return _regeneratorRuntime().wrap(function _callee32$(_context33) {
3845
+ return _regeneratorRuntime().wrap(function _callee31$(_context32) {
4025
3846
  while (1) {
4026
- switch (_context33.prev = _context33.next) {
3847
+ switch (_context32.prev = _context32.next) {
4027
3848
  case 0:
4028
3849
  if (forceRefresh === void 0) {
4029
3850
  forceRefresh = false;
@@ -4037,61 +3858,61 @@ var OroClient = /*#__PURE__*/function () {
4037
3858
  });
4038
3859
 
4039
3860
  if (!(!forceRefresh && this.cachedManifest[manifestKey])) {
4040
- _context33.next = 4;
3861
+ _context32.next = 4;
4041
3862
  break;
4042
3863
  }
4043
3864
 
4044
- return _context33.abrupt("return", this.cachedManifest[manifestKey]);
3865
+ return _context32.abrupt("return", this.cachedManifest[manifestKey]);
4045
3866
 
4046
3867
  case 4:
4047
- return _context33.abrupt("return", this.vaultClient.lockboxManifestGet(lockboxUuid, filter, lockboxOwnerUuid).then(function (manifest) {
3868
+ return _context32.abrupt("return", this.vaultClient.lockboxManifestGet(lockboxUuid, filter, lockboxOwnerUuid).then(function (manifest) {
4048
3869
  return Promise.all(manifest.map( /*#__PURE__*/function () {
4049
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(entry) {
3870
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(entry) {
4050
3871
  var privateMeta;
4051
- return _regeneratorRuntime().wrap(function _callee31$(_context32) {
3872
+ return _regeneratorRuntime().wrap(function _callee30$(_context31) {
4052
3873
  while (1) {
4053
- switch (_context32.prev = _context32.next) {
3874
+ switch (_context31.prev = _context31.next) {
4054
3875
  case 0:
4055
3876
  if (!(expandPrivateMetadata && entry.metadata.privateMetadata)) {
4056
- _context32.next = 5;
3877
+ _context31.next = 5;
4057
3878
  break;
4058
3879
  }
4059
3880
 
4060
- _context32.next = 3;
4061
- return _this4.getJsonData(lockboxUuid, entry.metadata.privateMetadata, lockboxOwnerUuid);
3881
+ _context31.next = 3;
3882
+ return _this3.getJsonData(lockboxUuid, entry.metadata.privateMetadata, lockboxOwnerUuid);
4062
3883
 
4063
3884
  case 3:
4064
- privateMeta = _context32.sent;
3885
+ privateMeta = _context31.sent;
4065
3886
  entry.metadata = _extends({}, entry.metadata, privateMeta);
4066
3887
 
4067
3888
  case 5:
4068
- return _context32.abrupt("return", entry);
3889
+ return _context31.abrupt("return", entry);
4069
3890
 
4070
3891
  case 6:
4071
3892
  case "end":
4072
- return _context32.stop();
3893
+ return _context31.stop();
4073
3894
  }
4074
3895
  }
4075
- }, _callee31);
3896
+ }, _callee30);
4076
3897
  }));
4077
3898
 
4078
- return function (_x86) {
3899
+ return function (_x83) {
4079
3900
  return _ref4.apply(this, arguments);
4080
3901
  };
4081
3902
  }())).then(function (manifest) {
4082
- return _this4.cachedManifest[manifestKey] = manifest;
3903
+ return _this3.cachedManifest[manifestKey] = manifest;
4083
3904
  });
4084
3905
  }));
4085
3906
 
4086
3907
  case 5:
4087
3908
  case "end":
4088
- return _context33.stop();
3909
+ return _context32.stop();
4089
3910
  }
4090
3911
  }
4091
- }, _callee32, this);
3912
+ }, _callee31, this);
4092
3913
  }));
4093
3914
 
4094
- function getLockboxManifest(_x81, _x82, _x83, _x84, _x85) {
3915
+ function getLockboxManifest(_x78, _x79, _x80, _x81, _x82) {
4095
3916
  return _getLockboxManifest.apply(this, arguments);
4096
3917
  }
4097
3918
 
@@ -4109,43 +3930,43 @@ var OroClient = /*#__PURE__*/function () {
4109
3930
  _proto.createPersonalInformations =
4110
3931
  /*#__PURE__*/
4111
3932
  function () {
4112
- var _createPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(identity, data, dataUuid) {
3933
+ var _createPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(identity, data, dataUuid) {
4113
3934
  var _yield$this$getGrants;
4114
3935
 
4115
3936
  var lockboxUuid;
4116
- return _regeneratorRuntime().wrap(function _callee33$(_context34) {
3937
+ return _regeneratorRuntime().wrap(function _callee32$(_context33) {
4117
3938
  while (1) {
4118
- switch (_context34.prev = _context34.next) {
3939
+ switch (_context33.prev = _context33.next) {
4119
3940
  case 0:
4120
- _context34.next = 2;
3941
+ _context33.next = 2;
4121
3942
  return this.getGrants();
4122
3943
 
4123
3944
  case 2:
4124
- _context34.t0 = _yield$this$getGrants = _context34.sent.find(function (lockbox) {
3945
+ _context33.t0 = _yield$this$getGrants = _context33.sent.find(function (lockbox) {
4125
3946
  return lockbox.lockboxOwnerUuid === identity.id;
4126
3947
  });
4127
3948
 
4128
- if (!(_context34.t0 == null)) {
4129
- _context34.next = 7;
3949
+ if (!(_context33.t0 == null)) {
3950
+ _context33.next = 7;
4130
3951
  break;
4131
3952
  }
4132
3953
 
4133
- _context34.t1 = void 0;
4134
- _context34.next = 8;
3954
+ _context33.t1 = void 0;
3955
+ _context33.next = 8;
4135
3956
  break;
4136
3957
 
4137
3958
  case 7:
4138
- _context34.t1 = _yield$this$getGrants.lockboxUuid;
3959
+ _context33.t1 = _yield$this$getGrants.lockboxUuid;
4139
3960
 
4140
3961
  case 8:
4141
- lockboxUuid = _context34.t1;
3962
+ lockboxUuid = _context33.t1;
4142
3963
 
4143
3964
  if (!lockboxUuid) {
4144
- _context34.next = 13;
3965
+ _context33.next = 13;
4145
3966
  break;
4146
3967
  }
4147
3968
 
4148
- return _context34.abrupt("return", this.createJsonData(lockboxUuid, data, {
3969
+ return _context33.abrupt("return", this.createJsonData(lockboxUuid, data, {
4149
3970
  category: initApis.MetadataCategory.Personal,
4150
3971
  documentType: initApis.DocumentType.PopulatedWorkflowData
4151
3972
  }, {}, undefined, dataUuid));
@@ -4155,13 +3976,13 @@ var OroClient = /*#__PURE__*/function () {
4155
3976
 
4156
3977
  case 14:
4157
3978
  case "end":
4158
- return _context34.stop();
3979
+ return _context33.stop();
4159
3980
  }
4160
3981
  }
4161
- }, _callee33, this);
3982
+ }, _callee32, this);
4162
3983
  }));
4163
3984
 
4164
- function createPersonalInformations(_x87, _x88, _x89) {
3985
+ function createPersonalInformations(_x84, _x85, _x86) {
4165
3986
  return _createPersonalInformations.apply(this, arguments);
4166
3987
  }
4167
3988
 
@@ -4179,43 +4000,43 @@ var OroClient = /*#__PURE__*/function () {
4179
4000
  _proto.createUserPreference =
4180
4001
  /*#__PURE__*/
4181
4002
  function () {
4182
- var _createUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(identity, preference, dataUuid) {
4003
+ var _createUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(identity, preference, dataUuid) {
4183
4004
  var _yield$this$getGrants2;
4184
4005
 
4185
4006
  var lockboxUuid;
4186
- return _regeneratorRuntime().wrap(function _callee34$(_context35) {
4007
+ return _regeneratorRuntime().wrap(function _callee33$(_context34) {
4187
4008
  while (1) {
4188
- switch (_context35.prev = _context35.next) {
4009
+ switch (_context34.prev = _context34.next) {
4189
4010
  case 0:
4190
- _context35.next = 2;
4011
+ _context34.next = 2;
4191
4012
  return this.getGrants();
4192
4013
 
4193
4014
  case 2:
4194
- _context35.t0 = _yield$this$getGrants2 = _context35.sent.find(function (lockbox) {
4015
+ _context34.t0 = _yield$this$getGrants2 = _context34.sent.find(function (lockbox) {
4195
4016
  return lockbox.lockboxOwnerUuid === identity.id;
4196
4017
  });
4197
4018
 
4198
- if (!(_context35.t0 == null)) {
4199
- _context35.next = 7;
4019
+ if (!(_context34.t0 == null)) {
4020
+ _context34.next = 7;
4200
4021
  break;
4201
4022
  }
4202
4023
 
4203
- _context35.t1 = void 0;
4204
- _context35.next = 8;
4024
+ _context34.t1 = void 0;
4025
+ _context34.next = 8;
4205
4026
  break;
4206
4027
 
4207
4028
  case 7:
4208
- _context35.t1 = _yield$this$getGrants2.lockboxUuid;
4029
+ _context34.t1 = _yield$this$getGrants2.lockboxUuid;
4209
4030
 
4210
4031
  case 8:
4211
- lockboxUuid = _context35.t1;
4032
+ lockboxUuid = _context34.t1;
4212
4033
 
4213
4034
  if (!lockboxUuid) {
4214
- _context35.next = 13;
4035
+ _context34.next = 13;
4215
4036
  break;
4216
4037
  }
4217
4038
 
4218
- return _context35.abrupt("return", this.createJsonData(lockboxUuid, preference, {
4039
+ return _context34.abrupt("return", this.createJsonData(lockboxUuid, preference, {
4219
4040
  category: initApis.MetadataCategory.Preference,
4220
4041
  contentType: 'application/json'
4221
4042
  }, {}, undefined, dataUuid));
@@ -4225,13 +4046,13 @@ var OroClient = /*#__PURE__*/function () {
4225
4046
 
4226
4047
  case 14:
4227
4048
  case "end":
4228
- return _context35.stop();
4049
+ return _context34.stop();
4229
4050
  }
4230
4051
  }
4231
- }, _callee34, this);
4052
+ }, _callee33, this);
4232
4053
  }));
4233
4054
 
4234
- function createUserPreference(_x90, _x91, _x92) {
4055
+ function createUserPreference(_x87, _x88, _x89) {
4235
4056
  return _createUserPreference.apply(this, arguments);
4236
4057
  }
4237
4058
 
@@ -4247,16 +4068,16 @@ var OroClient = /*#__PURE__*/function () {
4247
4068
  _proto.getDataFromGrant =
4248
4069
  /*#__PURE__*/
4249
4070
  function () {
4250
- var _getDataFromGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(grant, filter) {
4071
+ var _getDataFromGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(grant, filter) {
4251
4072
  var lockboxUuid, lockboxOwnerUuid, identificationDataUuid;
4252
- return _regeneratorRuntime().wrap(function _callee35$(_context36) {
4073
+ return _regeneratorRuntime().wrap(function _callee34$(_context35) {
4253
4074
  while (1) {
4254
- switch (_context36.prev = _context36.next) {
4075
+ switch (_context35.prev = _context35.next) {
4255
4076
  case 0:
4256
4077
  lockboxUuid = grant.lockboxUuid, lockboxOwnerUuid = grant.lockboxOwnerUuid;
4257
4078
 
4258
4079
  if (lockboxUuid) {
4259
- _context36.next = 3;
4080
+ _context35.next = 3;
4260
4081
  break;
4261
4082
  }
4262
4083
 
@@ -4264,42 +4085,42 @@ var OroClient = /*#__PURE__*/function () {
4264
4085
 
4265
4086
  case 3:
4266
4087
  if (lockboxOwnerUuid) {
4267
- _context36.next = 5;
4088
+ _context35.next = 5;
4268
4089
  break;
4269
4090
  }
4270
4091
 
4271
4092
  throw MissingLockboxOwner;
4272
4093
 
4273
4094
  case 5:
4274
- _context36.next = 7;
4095
+ _context35.next = 7;
4275
4096
  return this.getLockboxManifest(lockboxUuid, filter, false, grant.lockboxOwnerUuid, true);
4276
4097
 
4277
4098
  case 7:
4278
- identificationDataUuid = _context36.sent[0].dataUuid;
4279
- _context36.t0 = lockboxOwnerUuid;
4280
- _context36.t1 = lockboxUuid;
4281
- _context36.t2 = identificationDataUuid;
4282
- _context36.next = 13;
4099
+ identificationDataUuid = _context35.sent[0].dataUuid;
4100
+ _context35.t0 = lockboxOwnerUuid;
4101
+ _context35.t1 = lockboxUuid;
4102
+ _context35.t2 = identificationDataUuid;
4103
+ _context35.next = 13;
4283
4104
  return this.getJsonData(lockboxUuid, identificationDataUuid);
4284
4105
 
4285
4106
  case 13:
4286
- _context36.t3 = _context36.sent;
4287
- return _context36.abrupt("return", {
4288
- lockboxOwnerUuid: _context36.t0,
4289
- lockboxUuid: _context36.t1,
4290
- dataUuid: _context36.t2,
4291
- data: _context36.t3
4107
+ _context35.t3 = _context35.sent;
4108
+ return _context35.abrupt("return", {
4109
+ lockboxOwnerUuid: _context35.t0,
4110
+ lockboxUuid: _context35.t1,
4111
+ dataUuid: _context35.t2,
4112
+ data: _context35.t3
4292
4113
  });
4293
4114
 
4294
4115
  case 15:
4295
4116
  case "end":
4296
- return _context36.stop();
4117
+ return _context35.stop();
4297
4118
  }
4298
4119
  }
4299
- }, _callee35, this);
4120
+ }, _callee34, this);
4300
4121
  }));
4301
4122
 
4302
- function getDataFromGrant(_x93, _x94) {
4123
+ function getDataFromGrant(_x90, _x91) {
4303
4124
  return _getDataFromGrant.apply(this, arguments);
4304
4125
  }
4305
4126
 
@@ -4315,40 +4136,40 @@ var OroClient = /*#__PURE__*/function () {
4315
4136
  _proto.getUserPreferenceFromConsultId =
4316
4137
  /*#__PURE__*/
4317
4138
  function () {
4318
- var _getUserPreferenceFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(consultationId) {
4139
+ var _getUserPreferenceFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(consultationId) {
4319
4140
  var grant;
4320
- return _regeneratorRuntime().wrap(function _callee36$(_context37) {
4141
+ return _regeneratorRuntime().wrap(function _callee35$(_context36) {
4321
4142
  while (1) {
4322
- switch (_context37.prev = _context37.next) {
4143
+ switch (_context36.prev = _context36.next) {
4323
4144
  case 0:
4324
- _context37.next = 2;
4145
+ _context36.next = 2;
4325
4146
  return this.getGrantFromConsultId(consultationId);
4326
4147
 
4327
4148
  case 2:
4328
- grant = _context37.sent;
4149
+ grant = _context36.sent;
4329
4150
 
4330
4151
  if (grant) {
4331
- _context37.next = 5;
4152
+ _context36.next = 5;
4332
4153
  break;
4333
4154
  }
4334
4155
 
4335
4156
  throw MissingGrant;
4336
4157
 
4337
4158
  case 5:
4338
- return _context37.abrupt("return", this.getDataFromGrant(grant, {
4159
+ return _context36.abrupt("return", this.getDataFromGrant(grant, {
4339
4160
  category: initApis.MetadataCategory.Preference,
4340
4161
  contentType: 'application/json'
4341
4162
  }));
4342
4163
 
4343
4164
  case 6:
4344
4165
  case "end":
4345
- return _context37.stop();
4166
+ return _context36.stop();
4346
4167
  }
4347
4168
  }
4348
- }, _callee36, this);
4169
+ }, _callee35, this);
4349
4170
  }));
4350
4171
 
4351
- function getUserPreferenceFromConsultId(_x95) {
4172
+ function getUserPreferenceFromConsultId(_x92) {
4352
4173
  return _getUserPreferenceFromConsultId.apply(this, arguments);
4353
4174
  }
4354
4175
 
@@ -4364,42 +4185,42 @@ var OroClient = /*#__PURE__*/function () {
4364
4185
  _proto.getUserPreference =
4365
4186
  /*#__PURE__*/
4366
4187
  function () {
4367
- var _getUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(identity) {
4188
+ var _getUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(identity) {
4368
4189
  var grant;
4369
- return _regeneratorRuntime().wrap(function _callee37$(_context38) {
4190
+ return _regeneratorRuntime().wrap(function _callee36$(_context37) {
4370
4191
  while (1) {
4371
- switch (_context38.prev = _context38.next) {
4192
+ switch (_context37.prev = _context37.next) {
4372
4193
  case 0:
4373
- _context38.next = 2;
4194
+ _context37.next = 2;
4374
4195
  return this.getGrants();
4375
4196
 
4376
4197
  case 2:
4377
- grant = _context38.sent.find(function (lockbox) {
4198
+ grant = _context37.sent.find(function (lockbox) {
4378
4199
  return lockbox.lockboxOwnerUuid === identity.id;
4379
4200
  });
4380
4201
 
4381
4202
  if (grant) {
4382
- _context38.next = 5;
4203
+ _context37.next = 5;
4383
4204
  break;
4384
4205
  }
4385
4206
 
4386
4207
  throw MissingGrant;
4387
4208
 
4388
4209
  case 5:
4389
- return _context38.abrupt("return", this.getDataFromGrant(grant, {
4210
+ return _context37.abrupt("return", this.getDataFromGrant(grant, {
4390
4211
  category: initApis.MetadataCategory.Preference,
4391
4212
  contentType: 'application/json'
4392
4213
  }));
4393
4214
 
4394
4215
  case 6:
4395
4216
  case "end":
4396
- return _context38.stop();
4217
+ return _context37.stop();
4397
4218
  }
4398
4219
  }
4399
- }, _callee37, this);
4220
+ }, _callee36, this);
4400
4221
  }));
4401
4222
 
4402
- function getUserPreference(_x96) {
4223
+ function getUserPreference(_x93) {
4403
4224
  return _getUserPreference.apply(this, arguments);
4404
4225
  }
4405
4226
 
@@ -4415,40 +4236,40 @@ var OroClient = /*#__PURE__*/function () {
4415
4236
  _proto.getRecoveryDataFromConsultId =
4416
4237
  /*#__PURE__*/
4417
4238
  function () {
4418
- var _getRecoveryDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(consultationId) {
4239
+ var _getRecoveryDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(consultationId) {
4419
4240
  var grant;
4420
- return _regeneratorRuntime().wrap(function _callee38$(_context39) {
4241
+ return _regeneratorRuntime().wrap(function _callee37$(_context38) {
4421
4242
  while (1) {
4422
- switch (_context39.prev = _context39.next) {
4243
+ switch (_context38.prev = _context38.next) {
4423
4244
  case 0:
4424
- _context39.next = 2;
4245
+ _context38.next = 2;
4425
4246
  return this.getGrantFromConsultId(consultationId);
4426
4247
 
4427
4248
  case 2:
4428
- grant = _context39.sent;
4249
+ grant = _context38.sent;
4429
4250
 
4430
4251
  if (grant) {
4431
- _context39.next = 5;
4252
+ _context38.next = 5;
4432
4253
  break;
4433
4254
  }
4434
4255
 
4435
4256
  throw MissingGrant;
4436
4257
 
4437
4258
  case 5:
4438
- return _context39.abrupt("return", this.getDataFromGrant(grant, {
4259
+ return _context38.abrupt("return", this.getDataFromGrant(grant, {
4439
4260
  category: initApis.MetadataCategory.Recovery,
4440
4261
  contentType: 'application/json'
4441
4262
  }));
4442
4263
 
4443
4264
  case 6:
4444
4265
  case "end":
4445
- return _context39.stop();
4266
+ return _context38.stop();
4446
4267
  }
4447
4268
  }
4448
- }, _callee38, this);
4269
+ }, _callee37, this);
4449
4270
  }));
4450
4271
 
4451
- function getRecoveryDataFromConsultId(_x97) {
4272
+ function getRecoveryDataFromConsultId(_x94) {
4452
4273
  return _getRecoveryDataFromConsultId.apply(this, arguments);
4453
4274
  }
4454
4275
 
@@ -4464,42 +4285,42 @@ var OroClient = /*#__PURE__*/function () {
4464
4285
  _proto.getRecoveryData =
4465
4286
  /*#__PURE__*/
4466
4287
  function () {
4467
- var _getRecoveryData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(identity) {
4288
+ var _getRecoveryData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(identity) {
4468
4289
  var grant;
4469
- return _regeneratorRuntime().wrap(function _callee39$(_context40) {
4290
+ return _regeneratorRuntime().wrap(function _callee38$(_context39) {
4470
4291
  while (1) {
4471
- switch (_context40.prev = _context40.next) {
4292
+ switch (_context39.prev = _context39.next) {
4472
4293
  case 0:
4473
- _context40.next = 2;
4294
+ _context39.next = 2;
4474
4295
  return this.getGrants();
4475
4296
 
4476
4297
  case 2:
4477
- grant = _context40.sent.find(function (lockbox) {
4298
+ grant = _context39.sent.find(function (lockbox) {
4478
4299
  return lockbox.lockboxOwnerUuid === identity.id;
4479
4300
  });
4480
4301
 
4481
4302
  if (grant) {
4482
- _context40.next = 5;
4303
+ _context39.next = 5;
4483
4304
  break;
4484
4305
  }
4485
4306
 
4486
4307
  throw MissingGrant;
4487
4308
 
4488
4309
  case 5:
4489
- return _context40.abrupt("return", this.getDataFromGrant(grant, {
4310
+ return _context39.abrupt("return", this.getDataFromGrant(grant, {
4490
4311
  category: initApis.MetadataCategory.Recovery,
4491
4312
  contentType: 'application/json'
4492
4313
  }));
4493
4314
 
4494
4315
  case 6:
4495
4316
  case "end":
4496
- return _context40.stop();
4317
+ return _context39.stop();
4497
4318
  }
4498
4319
  }
4499
- }, _callee39, this);
4320
+ }, _callee38, this);
4500
4321
  }));
4501
4322
 
4502
- function getRecoveryData(_x98) {
4323
+ function getRecoveryData(_x95) {
4503
4324
  return _getRecoveryData.apply(this, arguments);
4504
4325
  }
4505
4326
 
@@ -4520,48 +4341,44 @@ var OroClient = /*#__PURE__*/function () {
4520
4341
  _proto.getAssignedConsultations =
4521
4342
  /*#__PURE__*/
4522
4343
  function () {
4523
- var _getAssignedConsultations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(practiceUuid, forceRefresh) {
4524
- var _this5 = this;
4344
+ var _getAssignedConsultations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(practiceUuid) {
4345
+ var _this4 = this;
4525
4346
 
4526
- return _regeneratorRuntime().wrap(function _callee41$(_context42) {
4347
+ return _regeneratorRuntime().wrap(function _callee40$(_context41) {
4527
4348
  while (1) {
4528
- switch (_context42.prev = _context42.next) {
4349
+ switch (_context41.prev = _context41.next) {
4529
4350
  case 0:
4530
- if (forceRefresh === void 0) {
4531
- forceRefresh = false;
4532
- }
4533
-
4534
- _context42.t0 = Promise;
4535
- _context42.next = 4;
4536
- return this.getGrants(undefined, forceRefresh);
4351
+ _context41.t0 = Promise;
4352
+ _context41.next = 3;
4353
+ return this.getGrants();
4537
4354
 
4538
- case 4:
4539
- _context42.t1 = _context42.sent.map(function (grant) {
4540
- return _this5.getLockboxManifest(grant.lockboxUuid, {
4355
+ case 3:
4356
+ _context41.t1 = _context41.sent.map(function (grant) {
4357
+ return _this4.getLockboxManifest(grant.lockboxUuid, {
4541
4358
  category: initApis.MetadataCategory.Consultation,
4542
4359
  documentType: initApis.DocumentType.PopulatedWorkflowData
4543
- }, true, undefined, forceRefresh).then(function (manifest) {
4360
+ }, true, undefined).then(function (manifest) {
4544
4361
  return Promise.all(manifest.map( /*#__PURE__*/function () {
4545
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(entry) {
4546
- return _regeneratorRuntime().wrap(function _callee40$(_context41) {
4362
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(entry) {
4363
+ return _regeneratorRuntime().wrap(function _callee39$(_context40) {
4547
4364
  while (1) {
4548
- switch (_context41.prev = _context41.next) {
4365
+ switch (_context40.prev = _context40.next) {
4549
4366
  case 0:
4550
- _context41.next = 2;
4551
- return _this5.consultClient.getConsultByUUID(entry.metadata.consultationId, practiceUuid);
4367
+ _context40.next = 2;
4368
+ return _this4.consultClient.getConsultByUUID(entry.metadata.consultationId, practiceUuid);
4552
4369
 
4553
4370
  case 2:
4554
- return _context41.abrupt("return", _context41.sent);
4371
+ return _context40.abrupt("return", _context40.sent);
4555
4372
 
4556
4373
  case 3:
4557
4374
  case "end":
4558
- return _context41.stop();
4375
+ return _context40.stop();
4559
4376
  }
4560
4377
  }
4561
- }, _callee40);
4378
+ }, _callee39);
4562
4379
  }));
4563
4380
 
4564
- return function (_x101) {
4381
+ return function (_x97) {
4565
4382
  return _ref5.apply(this, arguments);
4566
4383
  };
4567
4384
  }())).then(function (promise) {
@@ -4569,19 +4386,19 @@ var OroClient = /*#__PURE__*/function () {
4569
4386
  });
4570
4387
  });
4571
4388
  });
4572
- return _context42.abrupt("return", _context42.t0.all.call(_context42.t0, _context42.t1).then(function (consults) {
4389
+ return _context41.abrupt("return", _context41.t0.all.call(_context41.t0, _context41.t1).then(function (consults) {
4573
4390
  return consults.flat();
4574
4391
  }));
4575
4392
 
4576
- case 6:
4393
+ case 5:
4577
4394
  case "end":
4578
- return _context42.stop();
4395
+ return _context41.stop();
4579
4396
  }
4580
4397
  }
4581
- }, _callee41, this);
4398
+ }, _callee40, this);
4582
4399
  }));
4583
4400
 
4584
- function getAssignedConsultations(_x99, _x100) {
4401
+ function getAssignedConsultations(_x96) {
4585
4402
  return _getAssignedConsultations.apply(this, arguments);
4586
4403
  }
4587
4404
 
@@ -4597,85 +4414,85 @@ var OroClient = /*#__PURE__*/function () {
4597
4414
  _proto.getPastConsultationsFromConsultId =
4598
4415
  /*#__PURE__*/
4599
4416
  function () {
4600
- var _getPastConsultationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(consultationId, practiceUuid) {
4601
- var _this6 = this;
4417
+ var _getPastConsultationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(consultationId, practiceUuid) {
4418
+ var _this5 = this;
4602
4419
 
4603
4420
  var grant, consultationsInLockbox;
4604
- return _regeneratorRuntime().wrap(function _callee43$(_context44) {
4421
+ return _regeneratorRuntime().wrap(function _callee42$(_context43) {
4605
4422
  while (1) {
4606
- switch (_context44.prev = _context44.next) {
4423
+ switch (_context43.prev = _context43.next) {
4607
4424
  case 0:
4608
- _context44.next = 2;
4425
+ _context43.next = 2;
4609
4426
  return this.getGrantFromConsultId(consultationId);
4610
4427
 
4611
4428
  case 2:
4612
- grant = _context44.sent;
4429
+ grant = _context43.sent;
4613
4430
 
4614
4431
  if (grant) {
4615
- _context44.next = 5;
4432
+ _context43.next = 5;
4616
4433
  break;
4617
4434
  }
4618
4435
 
4619
- return _context44.abrupt("return", undefined);
4436
+ return _context43.abrupt("return", undefined);
4620
4437
 
4621
4438
  case 5:
4622
- _context44.next = 7;
4439
+ _context43.next = 7;
4623
4440
  return this.vaultClient.lockboxMetadataGet(grant.lockboxUuid, ['consultationId'], ['consultationId'], {
4624
4441
  category: initApis.MetadataCategory.Consultation,
4625
4442
  documentType: initApis.DocumentType.PopulatedWorkflowData
4626
4443
  }, grant.lockboxOwnerUuid);
4627
4444
 
4628
4445
  case 7:
4629
- consultationsInLockbox = _context44.sent.flat().map(function (metadata) {
4446
+ consultationsInLockbox = _context43.sent.flat().map(function (metadata) {
4630
4447
  return metadata.consultationId;
4631
4448
  });
4632
4449
 
4633
4450
  if (!(consultationsInLockbox.length == 0)) {
4634
- _context44.next = 10;
4451
+ _context43.next = 10;
4635
4452
  break;
4636
4453
  }
4637
4454
 
4638
- return _context44.abrupt("return", []);
4455
+ return _context43.abrupt("return", []);
4639
4456
 
4640
4457
  case 10:
4641
- _context44.next = 12;
4458
+ _context43.next = 12;
4642
4459
  return Promise.all(consultationsInLockbox.map( /*#__PURE__*/function () {
4643
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(consultId) {
4644
- return _regeneratorRuntime().wrap(function _callee42$(_context43) {
4460
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(consultId) {
4461
+ return _regeneratorRuntime().wrap(function _callee41$(_context42) {
4645
4462
  while (1) {
4646
- switch (_context43.prev = _context43.next) {
4463
+ switch (_context42.prev = _context42.next) {
4647
4464
  case 0:
4648
- _context43.next = 2;
4649
- return _this6.consultClient.getConsultByUUID(consultId, practiceUuid);
4465
+ _context42.next = 2;
4466
+ return _this5.consultClient.getConsultByUUID(consultId, practiceUuid);
4650
4467
 
4651
4468
  case 2:
4652
- return _context43.abrupt("return", _context43.sent);
4469
+ return _context42.abrupt("return", _context42.sent);
4653
4470
 
4654
4471
  case 3:
4655
4472
  case "end":
4656
- return _context43.stop();
4473
+ return _context42.stop();
4657
4474
  }
4658
4475
  }
4659
- }, _callee42);
4476
+ }, _callee41);
4660
4477
  }));
4661
4478
 
4662
- return function (_x104) {
4479
+ return function (_x100) {
4663
4480
  return _ref6.apply(this, arguments);
4664
4481
  };
4665
4482
  }()));
4666
4483
 
4667
4484
  case 12:
4668
- return _context44.abrupt("return", _context44.sent);
4485
+ return _context43.abrupt("return", _context43.sent);
4669
4486
 
4670
4487
  case 13:
4671
4488
  case "end":
4672
- return _context44.stop();
4489
+ return _context43.stop();
4673
4490
  }
4674
4491
  }
4675
- }, _callee43, this);
4492
+ }, _callee42, this);
4676
4493
  }));
4677
4494
 
4678
- function getPastConsultationsFromConsultId(_x102, _x103) {
4495
+ function getPastConsultationsFromConsultId(_x98, _x99) {
4679
4496
  return _getPastConsultationsFromConsultId.apply(this, arguments);
4680
4497
  }
4681
4498
 
@@ -4692,48 +4509,48 @@ var OroClient = /*#__PURE__*/function () {
4692
4509
  _proto.getPatientConsultationData =
4693
4510
  /*#__PURE__*/
4694
4511
  function () {
4695
- var _getPatientConsultationData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(consultationId, forceRefresh) {
4696
- var _this7 = this;
4512
+ var _getPatientConsultationData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(consultationId, forceRefresh) {
4513
+ var _this6 = this;
4697
4514
 
4698
- return _regeneratorRuntime().wrap(function _callee44$(_context45) {
4515
+ return _regeneratorRuntime().wrap(function _callee43$(_context44) {
4699
4516
  while (1) {
4700
- switch (_context45.prev = _context45.next) {
4517
+ switch (_context44.prev = _context44.next) {
4701
4518
  case 0:
4702
4519
  if (forceRefresh === void 0) {
4703
4520
  forceRefresh = false;
4704
4521
  }
4705
4522
 
4706
- _context45.t0 = Promise;
4707
- _context45.next = 4;
4523
+ _context44.t0 = Promise;
4524
+ _context44.next = 4;
4708
4525
  return this.getGrants({
4709
4526
  consultationId: consultationId
4710
- }, forceRefresh);
4527
+ });
4711
4528
 
4712
4529
  case 4:
4713
- _context45.t1 = _context45.sent.map(function (grant) {
4714
- return _this7.getLockboxManifest(grant.lockboxUuid, {
4530
+ _context44.t1 = _context44.sent.map(function (grant) {
4531
+ return _this6.getLockboxManifest(grant.lockboxUuid, {
4715
4532
  category: initApis.MetadataCategory.Consultation,
4716
4533
  documentType: initApis.DocumentType.PopulatedWorkflowData,
4717
4534
  consultationId: consultationId
4718
4535
  }, true, grant.lockboxOwnerUuid, forceRefresh).then(function (manifest) {
4719
4536
  return Promise.all(manifest.map(function (e) {
4720
- return _this7.getJsonData(grant.lockboxUuid, e.dataUuid, grant.lockboxOwnerUuid);
4537
+ return _this6.getJsonData(grant.lockboxUuid, e.dataUuid, grant.lockboxOwnerUuid);
4721
4538
  }));
4722
4539
  });
4723
4540
  }).flat();
4724
- return _context45.abrupt("return", _context45.t0.all.call(_context45.t0, _context45.t1).then(function (data) {
4541
+ return _context44.abrupt("return", _context44.t0.all.call(_context44.t0, _context44.t1).then(function (data) {
4725
4542
  return data.flat();
4726
4543
  }));
4727
4544
 
4728
4545
  case 6:
4729
4546
  case "end":
4730
- return _context45.stop();
4547
+ return _context44.stop();
4731
4548
  }
4732
4549
  }
4733
- }, _callee44, this);
4550
+ }, _callee43, this);
4734
4551
  }));
4735
4552
 
4736
- function getPatientConsultationData(_x105, _x106) {
4553
+ function getPatientConsultationData(_x101, _x102) {
4737
4554
  return _getPatientConsultationData.apply(this, arguments);
4738
4555
  }
4739
4556
 
@@ -4749,25 +4566,25 @@ var OroClient = /*#__PURE__*/function () {
4749
4566
  _proto.getPatientPrescriptionsList =
4750
4567
  /*#__PURE__*/
4751
4568
  function () {
4752
- var _getPatientPrescriptionsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(consultationId) {
4753
- return _regeneratorRuntime().wrap(function _callee45$(_context46) {
4569
+ var _getPatientPrescriptionsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(consultationId) {
4570
+ return _regeneratorRuntime().wrap(function _callee44$(_context45) {
4754
4571
  while (1) {
4755
- switch (_context46.prev = _context46.next) {
4572
+ switch (_context45.prev = _context45.next) {
4756
4573
  case 0:
4757
- return _context46.abrupt("return", this.getPatientDocumentsList({
4574
+ return _context45.abrupt("return", this.getPatientDocumentsList({
4758
4575
  category: initApis.MetadataCategory.Consultation,
4759
4576
  documentType: initApis.DocumentType.Prescription
4760
4577
  }, true, consultationId));
4761
4578
 
4762
4579
  case 1:
4763
4580
  case "end":
4764
- return _context46.stop();
4581
+ return _context45.stop();
4765
4582
  }
4766
4583
  }
4767
- }, _callee45, this);
4584
+ }, _callee44, this);
4768
4585
  }));
4769
4586
 
4770
- function getPatientPrescriptionsList(_x107) {
4587
+ function getPatientPrescriptionsList(_x103) {
4771
4588
  return _getPatientPrescriptionsList.apply(this, arguments);
4772
4589
  }
4773
4590
 
@@ -4783,25 +4600,25 @@ var OroClient = /*#__PURE__*/function () {
4783
4600
  _proto.getPatientResultsList =
4784
4601
  /*#__PURE__*/
4785
4602
  function () {
4786
- var _getPatientResultsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(consultationId) {
4787
- return _regeneratorRuntime().wrap(function _callee46$(_context47) {
4603
+ var _getPatientResultsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(consultationId) {
4604
+ return _regeneratorRuntime().wrap(function _callee45$(_context46) {
4788
4605
  while (1) {
4789
- switch (_context47.prev = _context47.next) {
4606
+ switch (_context46.prev = _context46.next) {
4790
4607
  case 0:
4791
- return _context47.abrupt("return", this.getPatientDocumentsList({
4608
+ return _context46.abrupt("return", this.getPatientDocumentsList({
4792
4609
  category: initApis.MetadataCategory.Consultation,
4793
4610
  documentType: initApis.DocumentType.Result
4794
4611
  }, true, consultationId));
4795
4612
 
4796
4613
  case 1:
4797
4614
  case "end":
4798
- return _context47.stop();
4615
+ return _context46.stop();
4799
4616
  }
4800
4617
  }
4801
- }, _callee46, this);
4618
+ }, _callee45, this);
4802
4619
  }));
4803
4620
 
4804
- function getPatientResultsList(_x108) {
4621
+ function getPatientResultsList(_x104) {
4805
4622
  return _getPatientResultsList.apply(this, arguments);
4806
4623
  }
4807
4624
 
@@ -4817,25 +4634,25 @@ var OroClient = /*#__PURE__*/function () {
4817
4634
  _proto.getPatientTreatmentPlans =
4818
4635
  /*#__PURE__*/
4819
4636
  function () {
4820
- var _getPatientTreatmentPlans = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(consultationId) {
4821
- return _regeneratorRuntime().wrap(function _callee47$(_context48) {
4637
+ var _getPatientTreatmentPlans = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(consultationId) {
4638
+ return _regeneratorRuntime().wrap(function _callee46$(_context47) {
4822
4639
  while (1) {
4823
- switch (_context48.prev = _context48.next) {
4640
+ switch (_context47.prev = _context47.next) {
4824
4641
  case 0:
4825
- return _context48.abrupt("return", this.getPatientDocumentsList({
4642
+ return _context47.abrupt("return", this.getPatientDocumentsList({
4826
4643
  category: initApis.MetadataCategory.Consultation,
4827
4644
  documentType: initApis.DocumentType.TreatmentPlan
4828
4645
  }, true, consultationId));
4829
4646
 
4830
4647
  case 1:
4831
4648
  case "end":
4832
- return _context48.stop();
4649
+ return _context47.stop();
4833
4650
  }
4834
4651
  }
4835
- }, _callee47, this);
4652
+ }, _callee46, this);
4836
4653
  }));
4837
4654
 
4838
- function getPatientTreatmentPlans(_x109) {
4655
+ function getPatientTreatmentPlans(_x105) {
4839
4656
  return _getPatientTreatmentPlans.apply(this, arguments);
4840
4657
  }
4841
4658
 
@@ -4852,12 +4669,12 @@ var OroClient = /*#__PURE__*/function () {
4852
4669
  _proto.getPatientTreatmentPlanByUuid =
4853
4670
  /*#__PURE__*/
4854
4671
  function () {
4855
- var _getPatientTreatmentPlanByUuid = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(consultationId, treatmentPlanId) {
4856
- return _regeneratorRuntime().wrap(function _callee48$(_context49) {
4672
+ var _getPatientTreatmentPlanByUuid = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(consultationId, treatmentPlanId) {
4673
+ return _regeneratorRuntime().wrap(function _callee47$(_context48) {
4857
4674
  while (1) {
4858
- switch (_context49.prev = _context49.next) {
4675
+ switch (_context48.prev = _context48.next) {
4859
4676
  case 0:
4860
- return _context49.abrupt("return", this.getPatientDocumentsList({
4677
+ return _context48.abrupt("return", this.getPatientDocumentsList({
4861
4678
  category: initApis.MetadataCategory.Consultation,
4862
4679
  documentType: initApis.DocumentType.TreatmentPlan,
4863
4680
  treatmentPlanId: treatmentPlanId
@@ -4865,13 +4682,13 @@ var OroClient = /*#__PURE__*/function () {
4865
4682
 
4866
4683
  case 1:
4867
4684
  case "end":
4868
- return _context49.stop();
4685
+ return _context48.stop();
4869
4686
  }
4870
4687
  }
4871
- }, _callee48, this);
4688
+ }, _callee47, this);
4872
4689
  }));
4873
4690
 
4874
- function getPatientTreatmentPlanByUuid(_x110, _x111) {
4691
+ function getPatientTreatmentPlanByUuid(_x106, _x107) {
4875
4692
  return _getPatientTreatmentPlanByUuid.apply(this, arguments);
4876
4693
  }
4877
4694
 
@@ -4891,62 +4708,62 @@ var OroClient = /*#__PURE__*/function () {
4891
4708
  _proto.getPatientDocumentsList =
4892
4709
  /*#__PURE__*/
4893
4710
  function () {
4894
- var _getPatientDocumentsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(filters, expandPrivateMetadata, consultationId) {
4895
- var _this8 = this;
4711
+ var _getPatientDocumentsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(filters, expandPrivateMetadata, consultationId) {
4712
+ var _this7 = this;
4896
4713
 
4897
- return _regeneratorRuntime().wrap(function _callee50$(_context51) {
4714
+ return _regeneratorRuntime().wrap(function _callee49$(_context50) {
4898
4715
  while (1) {
4899
- switch (_context51.prev = _context51.next) {
4716
+ switch (_context50.prev = _context50.next) {
4900
4717
  case 0:
4901
- _context51.t0 = Promise;
4902
- _context51.next = 3;
4718
+ _context50.t0 = Promise;
4719
+ _context50.next = 3;
4903
4720
  return this.getGrants({
4904
4721
  consultationId: consultationId
4905
4722
  });
4906
4723
 
4907
4724
  case 3:
4908
- _context51.t1 = _context51.sent.map(function (grant) {
4909
- return _this8.getLockboxManifest(grant.lockboxUuid, _extends({}, filters, {
4725
+ _context50.t1 = _context50.sent.map(function (grant) {
4726
+ return _this7.getLockboxManifest(grant.lockboxUuid, _extends({}, filters, {
4910
4727
  consultationId: consultationId
4911
4728
  }), expandPrivateMetadata, grant.lockboxOwnerUuid, true).then(function (manifest) {
4912
4729
  return Promise.all(manifest.map( /*#__PURE__*/function () {
4913
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(entry) {
4914
- return _regeneratorRuntime().wrap(function _callee49$(_context50) {
4730
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(entry) {
4731
+ return _regeneratorRuntime().wrap(function _callee48$(_context49) {
4915
4732
  while (1) {
4916
- switch (_context50.prev = _context50.next) {
4733
+ switch (_context49.prev = _context49.next) {
4917
4734
  case 0:
4918
- return _context50.abrupt("return", _extends({
4735
+ return _context49.abrupt("return", _extends({
4919
4736
  lockboxOwnerUuid: grant.lockboxOwnerUuid,
4920
4737
  lockboxUuid: grant.lockboxUuid
4921
4738
  }, entry));
4922
4739
 
4923
4740
  case 1:
4924
4741
  case "end":
4925
- return _context50.stop();
4742
+ return _context49.stop();
4926
4743
  }
4927
4744
  }
4928
- }, _callee49);
4745
+ }, _callee48);
4929
4746
  }));
4930
4747
 
4931
- return function (_x115) {
4748
+ return function (_x111) {
4932
4749
  return _ref7.apply(this, arguments);
4933
4750
  };
4934
4751
  }()));
4935
4752
  });
4936
4753
  }).flat();
4937
- return _context51.abrupt("return", _context51.t0.all.call(_context51.t0, _context51.t1).then(function (data) {
4754
+ return _context50.abrupt("return", _context50.t0.all.call(_context50.t0, _context50.t1).then(function (data) {
4938
4755
  return data.flat();
4939
4756
  }));
4940
4757
 
4941
4758
  case 5:
4942
4759
  case "end":
4943
- return _context51.stop();
4760
+ return _context50.stop();
4944
4761
  }
4945
4762
  }
4946
- }, _callee50, this);
4763
+ }, _callee49, this);
4947
4764
  }));
4948
4765
 
4949
- function getPatientDocumentsList(_x112, _x113, _x114) {
4766
+ function getPatientDocumentsList(_x108, _x109, _x110) {
4950
4767
  return _getPatientDocumentsList.apply(this, arguments);
4951
4768
  }
4952
4769
 
@@ -4969,17 +4786,17 @@ var OroClient = /*#__PURE__*/function () {
4969
4786
  _proto.recoverPrivateKeyFromSecurityQuestions =
4970
4787
  /*#__PURE__*/
4971
4788
  function () {
4972
- var _recoverPrivateKeyFromSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
4789
+ var _recoverPrivateKeyFromSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
4973
4790
  var shards, answeredShards, privateKey;
4974
- return _regeneratorRuntime().wrap(function _callee51$(_context52) {
4791
+ return _regeneratorRuntime().wrap(function _callee50$(_context51) {
4975
4792
  while (1) {
4976
- switch (_context52.prev = _context52.next) {
4793
+ switch (_context51.prev = _context51.next) {
4977
4794
  case 0:
4978
- _context52.next = 2;
4795
+ _context51.next = 2;
4979
4796
  return this.guardClient.identityGet(id);
4980
4797
 
4981
4798
  case 2:
4982
- shards = _context52.sent.recoverySecurityQuestions;
4799
+ shards = _context51.sent.recoverySecurityQuestions;
4983
4800
  answeredShards = shards.filter(function (shard) {
4984
4801
  // filters all answered security questions
4985
4802
  var indexOfQuestion = recoverySecurityQuestions.indexOf(shard.securityQuestion);
@@ -5002,13 +4819,13 @@ var OroClient = /*#__PURE__*/function () {
5002
4819
 
5003
4820
  case 5:
5004
4821
  case "end":
5005
- return _context52.stop();
4822
+ return _context51.stop();
5006
4823
  }
5007
4824
  }
5008
- }, _callee51, this);
4825
+ }, _callee50, this);
5009
4826
  }));
5010
4827
 
5011
- function recoverPrivateKeyFromSecurityQuestions(_x116, _x117, _x118, _x119) {
4828
+ function recoverPrivateKeyFromSecurityQuestions(_x112, _x113, _x114, _x115) {
5012
4829
  return _recoverPrivateKeyFromSecurityQuestions.apply(this, arguments);
5013
4830
  }
5014
4831
 
@@ -5025,17 +4842,17 @@ var OroClient = /*#__PURE__*/function () {
5025
4842
  _proto.recoverPrivateKeyFromPassword =
5026
4843
  /*#__PURE__*/
5027
4844
  function () {
5028
- var _recoverPrivateKeyFromPassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(id, password) {
4845
+ var _recoverPrivateKeyFromPassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(id, password) {
5029
4846
  var identity, recoveryPayload, symmetricDecryptor, privateKey, symetricEncryptor;
5030
- return _regeneratorRuntime().wrap(function _callee52$(_context53) {
4847
+ return _regeneratorRuntime().wrap(function _callee51$(_context52) {
5031
4848
  while (1) {
5032
- switch (_context53.prev = _context53.next) {
4849
+ switch (_context52.prev = _context52.next) {
5033
4850
  case 0:
5034
- _context53.next = 2;
4851
+ _context52.next = 2;
5035
4852
  return this.guardClient.identityGet(id);
5036
4853
 
5037
4854
  case 2:
5038
- identity = _context53.sent;
4855
+ identity = _context52.sent;
5039
4856
  recoveryPayload = identity.recoveryPassword;
5040
4857
  symmetricDecryptor = this.toolbox.CryptoChaCha.fromPassphrase(password);
5041
4858
  privateKey = symmetricDecryptor.base64PayloadDecryptToBytes(recoveryPayload);
@@ -5050,13 +4867,13 @@ var OroClient = /*#__PURE__*/function () {
5050
4867
 
5051
4868
  case 8:
5052
4869
  case "end":
5053
- return _context53.stop();
4870
+ return _context52.stop();
5054
4871
  }
5055
4872
  }
5056
- }, _callee52, this);
4873
+ }, _callee51, this);
5057
4874
  }));
5058
4875
 
5059
- function recoverPrivateKeyFromPassword(_x120, _x121) {
4876
+ function recoverPrivateKeyFromPassword(_x116, _x117) {
5060
4877
  return _recoverPrivateKeyFromPassword.apply(this, arguments);
5061
4878
  }
5062
4879
 
@@ -5073,30 +4890,30 @@ var OroClient = /*#__PURE__*/function () {
5073
4890
  _proto.recoverPrivateKeyFromMasterKey =
5074
4891
  /*#__PURE__*/
5075
4892
  function () {
5076
- var _recoverPrivateKeyFromMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(id, masterKey) {
4893
+ var _recoverPrivateKeyFromMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(id, masterKey) {
5077
4894
  var recoveryPayload, symmetricDecryptor, privateKey;
5078
- return _regeneratorRuntime().wrap(function _callee53$(_context54) {
4895
+ return _regeneratorRuntime().wrap(function _callee52$(_context53) {
5079
4896
  while (1) {
5080
- switch (_context54.prev = _context54.next) {
4897
+ switch (_context53.prev = _context53.next) {
5081
4898
  case 0:
5082
- _context54.next = 2;
4899
+ _context53.next = 2;
5083
4900
  return this.guardClient.identityGet(id);
5084
4901
 
5085
4902
  case 2:
5086
- recoveryPayload = _context54.sent.recoveryMasterKey;
4903
+ recoveryPayload = _context53.sent.recoveryMasterKey;
5087
4904
  symmetricDecryptor = this.toolbox.CryptoChaCha.fromPassphrase(masterKey);
5088
4905
  privateKey = symmetricDecryptor.base64PayloadDecryptToBytes(recoveryPayload);
5089
4906
  this.rsa = this.toolbox.CryptoRSA.fromKey(privateKey);
5090
4907
 
5091
4908
  case 6:
5092
4909
  case "end":
5093
- return _context54.stop();
4910
+ return _context53.stop();
5094
4911
  }
5095
4912
  }
5096
- }, _callee53, this);
4913
+ }, _callee52, this);
5097
4914
  }));
5098
4915
 
5099
- function recoverPrivateKeyFromMasterKey(_x122, _x123) {
4916
+ function recoverPrivateKeyFromMasterKey(_x118, _x119) {
5100
4917
  return _recoverPrivateKeyFromMasterKey.apply(this, arguments);
5101
4918
  }
5102
4919
 
@@ -5115,14 +4932,14 @@ var OroClient = /*#__PURE__*/function () {
5115
4932
  _proto.updateSecurityQuestions =
5116
4933
  /*#__PURE__*/
5117
4934
  function () {
5118
- var _updateSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
4935
+ var _updateSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
5119
4936
  var securityQuestionPayload, updateRequest;
5120
- return _regeneratorRuntime().wrap(function _callee54$(_context55) {
4937
+ return _regeneratorRuntime().wrap(function _callee53$(_context54) {
5121
4938
  while (1) {
5122
- switch (_context55.prev = _context55.next) {
4939
+ switch (_context54.prev = _context54.next) {
5123
4940
  case 0:
5124
4941
  if (this.rsa) {
5125
- _context55.next = 2;
4942
+ _context54.next = 2;
5126
4943
  break;
5127
4944
  }
5128
4945
 
@@ -5133,21 +4950,21 @@ var OroClient = /*#__PURE__*/function () {
5133
4950
  updateRequest = {
5134
4951
  recoverySecurityQuestions: securityQuestionPayload
5135
4952
  };
5136
- _context55.next = 6;
4953
+ _context54.next = 6;
5137
4954
  return this.guardClient.identityUpdate(id, updateRequest);
5138
4955
 
5139
4956
  case 6:
5140
- return _context55.abrupt("return", _context55.sent);
4957
+ return _context54.abrupt("return", _context54.sent);
5141
4958
 
5142
4959
  case 7:
5143
4960
  case "end":
5144
- return _context55.stop();
4961
+ return _context54.stop();
5145
4962
  }
5146
4963
  }
5147
- }, _callee54, this);
4964
+ }, _callee53, this);
5148
4965
  }));
5149
4966
 
5150
- function updateSecurityQuestions(_x124, _x125, _x126, _x127) {
4967
+ function updateSecurityQuestions(_x120, _x121, _x122, _x123) {
5151
4968
  return _updateSecurityQuestions.apply(this, arguments);
5152
4969
  }
5153
4970
 
@@ -5169,14 +4986,14 @@ var OroClient = /*#__PURE__*/function () {
5169
4986
  _proto.updatePassword =
5170
4987
  /*#__PURE__*/
5171
4988
  function () {
5172
- var _updatePassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55(id, newPassword, oldPassword) {
4989
+ var _updatePassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(id, newPassword, oldPassword) {
5173
4990
  var symmetricEncryptor, passwordPayload, updateRequest;
5174
- return _regeneratorRuntime().wrap(function _callee55$(_context56) {
4991
+ return _regeneratorRuntime().wrap(function _callee54$(_context55) {
5175
4992
  while (1) {
5176
- switch (_context56.prev = _context56.next) {
4993
+ switch (_context55.prev = _context55.next) {
5177
4994
  case 0:
5178
4995
  if (this.rsa) {
5179
- _context56.next = 2;
4996
+ _context55.next = 2;
5180
4997
  break;
5181
4998
  }
5182
4999
 
@@ -5198,21 +5015,21 @@ var OroClient = /*#__PURE__*/function () {
5198
5015
  },
5199
5016
  recoveryPassword: passwordPayload
5200
5017
  };
5201
- _context56.next = 9;
5018
+ _context55.next = 9;
5202
5019
  return this.guardClient.identityUpdate(id, updateRequest);
5203
5020
 
5204
5021
  case 9:
5205
- return _context56.abrupt("return", _context56.sent);
5022
+ return _context55.abrupt("return", _context55.sent);
5206
5023
 
5207
5024
  case 10:
5208
5025
  case "end":
5209
- return _context56.stop();
5026
+ return _context55.stop();
5210
5027
  }
5211
5028
  }
5212
- }, _callee55, this);
5029
+ }, _callee54, this);
5213
5030
  }));
5214
5031
 
5215
- function updatePassword(_x128, _x129, _x130) {
5032
+ function updatePassword(_x124, _x125, _x126) {
5216
5033
  return _updatePassword.apply(this, arguments);
5217
5034
  }
5218
5035
 
@@ -5231,14 +5048,14 @@ var OroClient = /*#__PURE__*/function () {
5231
5048
  _proto.updateMasterKey =
5232
5049
  /*#__PURE__*/
5233
5050
  function () {
5234
- var _updateMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56(id, masterKey, lockboxUuid) {
5051
+ var _updateMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55(id, masterKey, lockboxUuid) {
5235
5052
  var symmetricEncryptor, masterKeyPayload, updateRequest, updatedIdentity;
5236
- return _regeneratorRuntime().wrap(function _callee56$(_context57) {
5053
+ return _regeneratorRuntime().wrap(function _callee55$(_context56) {
5237
5054
  while (1) {
5238
- switch (_context57.prev = _context57.next) {
5055
+ switch (_context56.prev = _context56.next) {
5239
5056
  case 0:
5240
5057
  if (this.rsa) {
5241
- _context57.next = 2;
5058
+ _context56.next = 2;
5242
5059
  break;
5243
5060
  }
5244
5061
 
@@ -5250,12 +5067,12 @@ var OroClient = /*#__PURE__*/function () {
5250
5067
  updateRequest = {
5251
5068
  recoveryMasterKey: masterKeyPayload
5252
5069
  };
5253
- _context57.next = 7;
5070
+ _context56.next = 7;
5254
5071
  return this.guardClient.identityUpdate(id, updateRequest);
5255
5072
 
5256
5073
  case 7:
5257
- updatedIdentity = _context57.sent;
5258
- _context57.next = 10;
5074
+ updatedIdentity = _context56.sent;
5075
+ _context56.next = 10;
5259
5076
  return this.getOrInsertJsonData(lockboxUuid, {
5260
5077
  masterKey: masterKey
5261
5078
  }, {
@@ -5264,17 +5081,17 @@ var OroClient = /*#__PURE__*/function () {
5264
5081
  }, {}, true);
5265
5082
 
5266
5083
  case 10:
5267
- return _context57.abrupt("return", updatedIdentity);
5084
+ return _context56.abrupt("return", updatedIdentity);
5268
5085
 
5269
5086
  case 11:
5270
5087
  case "end":
5271
- return _context57.stop();
5088
+ return _context56.stop();
5272
5089
  }
5273
5090
  }
5274
- }, _callee56, this);
5091
+ }, _callee55, this);
5275
5092
  }));
5276
5093
 
5277
- function updateMasterKey(_x131, _x132, _x133) {
5094
+ function updateMasterKey(_x127, _x128, _x129) {
5278
5095
  return _updateMasterKey.apply(this, arguments);
5279
5096
  }
5280
5097
 
@@ -5387,6 +5204,7 @@ exports.AssociatedLockboxNotFound = AssociatedLockboxNotFound;
5387
5204
  exports.CliniaService = CliniaService;
5388
5205
  exports.IncompleteAuthentication = IncompleteAuthentication;
5389
5206
  exports.MissingGrant = MissingGrant;
5207
+ exports.MissingGrantFilter = MissingGrantFilter;
5390
5208
  exports.MissingLockbox = MissingLockbox;
5391
5209
  exports.MissingLockboxOwner = MissingLockboxOwner;
5392
5210
  exports.OroClient = OroClient;