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