oro-sdk 7.0.0 → 7.1.1-dev

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.
@@ -1,4 +1,4 @@
1
- import initApis__default, { MetadataCategory, MedicalStatus, IndexKey, DocumentType, OtherRoleType, AxiosService } from 'oro-sdk-apis';
1
+ import initApis__default, { MetadataCategory, MedicalStatus, IndexKey, DocumentType, ConsultType, OtherRoleType, AxiosService } from 'oro-sdk-apis';
2
2
  export * from 'oro-sdk-apis';
3
3
  import { uuidParse, CryptoRSA } from 'oro-toolbox';
4
4
  import * as oroToolbox from 'oro-toolbox';
@@ -1273,7 +1273,7 @@ function _registerPatient() {
1273
1273
  }
1274
1274
  }, _callee);
1275
1275
  }));
1276
- return function (_x29) {
1276
+ return function (_x30) {
1277
1277
  return _ref.apply(this, arguments);
1278
1278
  };
1279
1279
  }());
@@ -1300,7 +1300,7 @@ function _registerPatient() {
1300
1300
  }
1301
1301
  }, _callee2);
1302
1302
  }));
1303
- return function (_x30) {
1303
+ return function (_x31) {
1304
1304
  return _ref2.apply(this, arguments);
1305
1305
  };
1306
1306
  }());
@@ -1318,7 +1318,7 @@ function _registerPatient() {
1318
1318
  ++currentStep;
1319
1319
  if (onProgress) onProgress(currentStep++ / stepsTotalNum, 'store_patient_data');
1320
1320
  _context3.next = 38;
1321
- return storePatientData(consult.uuid, consultRequest.isoLanguageRequired, lockboxUuid, workflow, oroClient)["catch"](function (err) {
1321
+ return storePatientData(consult.uuid, consultRequest.isoLanguageRequired, lockboxUuid, workflow, oroClient, consult.consultType)["catch"](function (err) {
1322
1322
  console.error('[SDK: registration] Some errors happened during patient data upload', err);
1323
1323
  errorsThrown.push(err);
1324
1324
  });
@@ -1512,15 +1512,17 @@ function _getOrCreatePatientLockbox() {
1512
1512
  }));
1513
1513
  return _getOrCreatePatientLockbox.apply(this, arguments);
1514
1514
  }
1515
- function storePatientData(_x10, _x11, _x12, _x13, _x14) {
1515
+ function storePatientData(_x10, _x11, _x12, _x13, _x14, _x15) {
1516
1516
  return _storePatientData.apply(this, arguments);
1517
1517
  }
1518
1518
  function _storePatientData() {
1519
- _storePatientData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(consultationId, isoLanguage, lockboxUuid, workflow, oroClient) {
1519
+ _storePatientData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(consultationId, isoLanguage, lockboxUuid, workflow, oroClient, consultType) {
1520
+ var patientDataPromises;
1520
1521
  return _regeneratorRuntime().wrap(function _callee5$(_context6) {
1521
1522
  while (1) switch (_context6.prev = _context6.next) {
1522
1523
  case 0:
1523
- return _context6.abrupt("return", Promise.all([
1524
+ // Create and store registration data
1525
+ patientDataPromises = [
1524
1526
  // Storing Raw data first
1525
1527
  oroClient.getOrInsertJsonData(lockboxUuid, workflow, {
1526
1528
  category: MetadataCategory.Raw,
@@ -1551,10 +1553,34 @@ function _storePatientData() {
1551
1553
  }, {
1552
1554
  category: MetadataCategory.Preference,
1553
1555
  contentType: 'application/json'
1554
- }, {})]).then(function (dataUuids) {
1556
+ }, {})];
1557
+ _context6.t0 = consultType;
1558
+ _context6.next = _context6.t0 === ConsultType.FollowUp ? 4 : _context6.t0 === ConsultType.Onboard ? 6 : _context6.t0 === ConsultType.Refill ? 6 : 6;
1559
+ break;
1560
+ case 4:
1561
+ patientDataPromises.push(getWorkflowDataByCategory(workflow, MetadataCategory.Followup).then(function (data) {
1562
+ return oroClient.getOrInsertJsonData(lockboxUuid, data, {
1563
+ category: MetadataCategory.Followup,
1564
+ documentType: DocumentType.PopulatedWorkflowData,
1565
+ consultationId: consultationId
1566
+ }, {
1567
+ consultationId: consultationId
1568
+ }, {
1569
+ withNotification: false,
1570
+ forceReplace: false,
1571
+ updateMedicalStatus: false
1572
+ }
1573
+ // the only data that needs to include an email notification
1574
+ );
1575
+ }));
1576
+ return _context6.abrupt("break", 7);
1577
+ case 6:
1578
+ return _context6.abrupt("break", 7);
1579
+ case 7:
1580
+ return _context6.abrupt("return", Promise.all(patientDataPromises).then(function (dataUuids) {
1555
1581
  return dataUuids.flat();
1556
1582
  }));
1557
- case 1:
1583
+ case 8:
1558
1584
  case "end":
1559
1585
  return _context6.stop();
1560
1586
  }
@@ -1562,7 +1588,7 @@ function _storePatientData() {
1562
1588
  }));
1563
1589
  return _storePatientData.apply(this, arguments);
1564
1590
  }
1565
- function storeImageAliases(_x15, _x16, _x17, _x18, _x19) {
1591
+ function storeImageAliases(_x16, _x17, _x18, _x19, _x20) {
1566
1592
  return _storeImageAliases.apply(this, arguments);
1567
1593
  }
1568
1594
  /**
@@ -1627,7 +1653,7 @@ function _storeImageAliases() {
1627
1653
  }));
1628
1654
  return _storeImageAliases.apply(this, arguments);
1629
1655
  }
1630
- function extractAndStorePersonalWorkflowData(_x20, _x21, _x22, _x23, _x24) {
1656
+ function extractAndStorePersonalWorkflowData(_x21, _x22, _x23, _x24, _x25) {
1631
1657
  return _extractAndStorePersonalWorkflowData.apply(this, arguments);
1632
1658
  }
1633
1659
  /**
@@ -1655,7 +1681,7 @@ function _extractAndStorePersonalWorkflowData() {
1655
1681
  }));
1656
1682
  return _extractAndStorePersonalWorkflowData.apply(this, arguments);
1657
1683
  }
1658
- function extractPersonalInfoFromWorkflowData(_x25) {
1684
+ function extractPersonalInfoFromWorkflowData(_x26) {
1659
1685
  return _extractPersonalInfoFromWorkflowData.apply(this, arguments);
1660
1686
  }
1661
1687
  /**
@@ -1687,7 +1713,7 @@ function _extractPersonalInfoFromWorkflowData() {
1687
1713
  }));
1688
1714
  return _extractPersonalInfoFromWorkflowData.apply(this, arguments);
1689
1715
  }
1690
- function buildConsultSearchIndex(_x26, _x27, _x28) {
1716
+ function buildConsultSearchIndex(_x27, _x28, _x29) {
1691
1717
  return _buildConsultSearchIndex.apply(this, arguments);
1692
1718
  }
1693
1719
  function _buildConsultSearchIndex() {
@@ -3423,111 +3449,144 @@ var OroClient = /*#__PURE__*/function () {
3423
3449
  return _getMedicalDataFromConsultId.apply(this, arguments);
3424
3450
  }
3425
3451
  return getMedicalDataFromConsultId;
3452
+ }()
3453
+ /**
3454
+ * Retrieves the patient follow up data associated to the `consultationId`
3455
+ * The `consultationId` only helps to retrieve the patient lockboxes
3456
+ * Note: it is possible to have several follow up data
3457
+ * @param consultationId The consultation Id
3458
+ * @param forceRefresh force data refresh (default to false)
3459
+ * @returns the medical data
3460
+ */
3461
+ ;
3462
+ _proto.getFollowupDataFromConsultId =
3463
+ /*#__PURE__*/
3464
+ function () {
3465
+ var _getFollowupDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(consultationId, options) {
3466
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
3467
+ while (1) switch (_context26.prev = _context26.next) {
3468
+ case 0:
3469
+ if (options === void 0) {
3470
+ options = {
3471
+ forceRefresh: false
3472
+ };
3473
+ }
3474
+ return _context26.abrupt("return", this.getMetaCategoryFromConsultId(consultationId, MetadataCategory.Followup, options));
3475
+ case 2:
3476
+ case "end":
3477
+ return _context26.stop();
3478
+ }
3479
+ }, _callee26, this);
3480
+ }));
3481
+ function getFollowupDataFromConsultId(_x81, _x82) {
3482
+ return _getFollowupDataFromConsultId.apply(this, arguments);
3483
+ }
3484
+ return getFollowupDataFromConsultId;
3426
3485
  }();
3427
3486
  _proto.getMetaCategoryFromConsultId = /*#__PURE__*/function () {
3428
- var _getMetaCategoryFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(consultationId, category, options) {
3487
+ var _getMetaCategoryFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(consultationId, category, options) {
3429
3488
  var _this2 = this;
3430
3489
  var grants, workflowData, _loop, _iterator, _step;
3431
- return _regeneratorRuntime().wrap(function _callee27$(_context28) {
3432
- while (1) switch (_context28.prev = _context28.next) {
3490
+ return _regeneratorRuntime().wrap(function _callee28$(_context29) {
3491
+ while (1) switch (_context29.prev = _context29.next) {
3433
3492
  case 0:
3434
3493
  if (options === void 0) {
3435
3494
  options = {
3436
3495
  forceRefresh: false
3437
3496
  };
3438
3497
  }
3439
- _context28.next = 3;
3498
+ _context29.next = 3;
3440
3499
  return this.getGrants({
3441
3500
  consultationId: consultationId
3442
3501
  });
3443
3502
  case 3:
3444
- grants = _context28.sent;
3503
+ grants = _context29.sent;
3445
3504
  workflowData = [];
3446
3505
  _loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
3447
3506
  var grant, manifest, data;
3448
- return _regeneratorRuntime().wrap(function _loop$(_context27) {
3449
- while (1) switch (_context27.prev = _context27.next) {
3507
+ return _regeneratorRuntime().wrap(function _loop$(_context28) {
3508
+ while (1) switch (_context28.prev = _context28.next) {
3450
3509
  case 0:
3451
3510
  grant = _step.value;
3452
- _context27.next = 3;
3511
+ _context28.next = 3;
3453
3512
  return _this2.getLockboxManifest(grant.lockboxUuid, {
3454
3513
  category: category,
3455
3514
  documentType: DocumentType.PopulatedWorkflowData,
3456
3515
  consultationIds: [consultationId]
3457
3516
  }, true, grant.lockboxOwnerUuid, options);
3458
3517
  case 3:
3459
- manifest = _context27.sent;
3518
+ manifest = _context28.sent;
3460
3519
  if (!(manifest.length === 0)) {
3461
- _context27.next = 8;
3520
+ _context28.next = 8;
3462
3521
  break;
3463
3522
  }
3464
- _context27.next = 7;
3523
+ _context28.next = 7;
3465
3524
  return _this2.getLockboxManifest(grant.lockboxUuid, {
3466
3525
  category: category,
3467
3526
  documentType: DocumentType.PopulatedWorkflowData
3468
3527
  }, true, grant.lockboxOwnerUuid, options);
3469
3528
  case 7:
3470
- manifest = _context27.sent.filter(function (entry) {
3529
+ manifest = _context28.sent.filter(function (entry) {
3471
3530
  return !entry.metadata.consultationIds;
3472
3531
  });
3473
3532
  case 8:
3474
- _context27.next = 10;
3533
+ _context28.next = 10;
3475
3534
  return Promise.all(manifest.map( /*#__PURE__*/function () {
3476
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(entry) {
3477
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
3478
- while (1) switch (_context26.prev = _context26.next) {
3535
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(entry) {
3536
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
3537
+ while (1) switch (_context27.prev = _context27.next) {
3479
3538
  case 0:
3480
- _context26.t0 = grant.lockboxOwnerUuid;
3481
- _context26.t1 = grant.lockboxUuid;
3482
- _context26.t2 = entry.dataUuid;
3483
- _context26.next = 5;
3539
+ _context27.t0 = grant.lockboxOwnerUuid;
3540
+ _context27.t1 = grant.lockboxUuid;
3541
+ _context27.t2 = entry.dataUuid;
3542
+ _context27.next = 5;
3484
3543
  return _this2.getJsonData(grant.lockboxUuid, entry.dataUuid);
3485
3544
  case 5:
3486
- _context26.t3 = _context26.sent;
3487
- return _context26.abrupt("return", {
3488
- lockboxOwnerUuid: _context26.t0,
3489
- lockboxUuid: _context26.t1,
3490
- dataUuid: _context26.t2,
3491
- data: _context26.t3
3545
+ _context27.t3 = _context27.sent;
3546
+ return _context27.abrupt("return", {
3547
+ lockboxOwnerUuid: _context27.t0,
3548
+ lockboxUuid: _context27.t1,
3549
+ dataUuid: _context27.t2,
3550
+ data: _context27.t3
3492
3551
  });
3493
3552
  case 7:
3494
3553
  case "end":
3495
- return _context26.stop();
3554
+ return _context27.stop();
3496
3555
  }
3497
- }, _callee26);
3556
+ }, _callee27);
3498
3557
  }));
3499
- return function (_x84) {
3558
+ return function (_x86) {
3500
3559
  return _ref3.apply(this, arguments);
3501
3560
  };
3502
3561
  }()));
3503
3562
  case 10:
3504
- data = _context27.sent;
3563
+ data = _context28.sent;
3505
3564
  workflowData = _extends({}, workflowData, data);
3506
3565
  case 12:
3507
3566
  case "end":
3508
- return _context27.stop();
3567
+ return _context28.stop();
3509
3568
  }
3510
3569
  }, _loop);
3511
3570
  });
3512
3571
  _iterator = _createForOfIteratorHelperLoose(grants);
3513
3572
  case 7:
3514
3573
  if ((_step = _iterator()).done) {
3515
- _context28.next = 11;
3574
+ _context29.next = 11;
3516
3575
  break;
3517
3576
  }
3518
- return _context28.delegateYield(_loop(), "t0", 9);
3577
+ return _context29.delegateYield(_loop(), "t0", 9);
3519
3578
  case 9:
3520
- _context28.next = 7;
3579
+ _context29.next = 7;
3521
3580
  break;
3522
3581
  case 11:
3523
- return _context28.abrupt("return", workflowData);
3582
+ return _context29.abrupt("return", workflowData);
3524
3583
  case 12:
3525
3584
  case "end":
3526
- return _context28.stop();
3585
+ return _context29.stop();
3527
3586
  }
3528
- }, _callee27, this);
3587
+ }, _callee28, this);
3529
3588
  }));
3530
- function getMetaCategoryFromConsultId(_x81, _x82, _x83) {
3589
+ function getMetaCategoryFromConsultId(_x83, _x84, _x85) {
3531
3590
  return _getMetaCategoryFromConsultId.apply(this, arguments);
3532
3591
  }
3533
3592
  return getMetaCategoryFromConsultId;
@@ -3541,63 +3600,63 @@ var OroClient = /*#__PURE__*/function () {
3541
3600
  _proto.getPersonalInformations =
3542
3601
  /*#__PURE__*/
3543
3602
  function () {
3544
- var _getPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(userId) {
3603
+ var _getPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(userId) {
3545
3604
  var grant, lockboxUuid, lockboxOwnerUuid, identificationDataUuid;
3546
- return _regeneratorRuntime().wrap(function _callee28$(_context29) {
3547
- while (1) switch (_context29.prev = _context29.next) {
3605
+ return _regeneratorRuntime().wrap(function _callee29$(_context30) {
3606
+ while (1) switch (_context30.prev = _context30.next) {
3548
3607
  case 0:
3549
- _context29.next = 2;
3608
+ _context30.next = 2;
3550
3609
  return this.getGrants();
3551
3610
  case 2:
3552
- grant = _context29.sent.find(function (lockbox) {
3611
+ grant = _context30.sent.find(function (lockbox) {
3553
3612
  return lockbox.lockboxOwnerUuid === userId;
3554
3613
  });
3555
3614
  if (grant) {
3556
- _context29.next = 5;
3615
+ _context30.next = 5;
3557
3616
  break;
3558
3617
  }
3559
3618
  throw MissingGrant;
3560
3619
  case 5:
3561
3620
  lockboxUuid = grant.lockboxUuid, lockboxOwnerUuid = grant.lockboxOwnerUuid;
3562
3621
  if (lockboxUuid) {
3563
- _context29.next = 8;
3622
+ _context30.next = 8;
3564
3623
  break;
3565
3624
  }
3566
3625
  throw MissingLockbox;
3567
3626
  case 8:
3568
3627
  if (lockboxOwnerUuid) {
3569
- _context29.next = 10;
3628
+ _context30.next = 10;
3570
3629
  break;
3571
3630
  }
3572
3631
  throw MissingLockboxOwner;
3573
3632
  case 10:
3574
- _context29.next = 12;
3633
+ _context30.next = 12;
3575
3634
  return this.getLockboxManifest(lockboxUuid, {
3576
3635
  category: MetadataCategory.Personal,
3577
3636
  documentType: DocumentType.PopulatedWorkflowData
3578
3637
  }, false, userId);
3579
3638
  case 12:
3580
- identificationDataUuid = _context29.sent[0].dataUuid;
3581
- _context29.t0 = lockboxOwnerUuid;
3582
- _context29.t1 = lockboxUuid;
3583
- _context29.t2 = identificationDataUuid;
3584
- _context29.next = 18;
3639
+ identificationDataUuid = _context30.sent[0].dataUuid;
3640
+ _context30.t0 = lockboxOwnerUuid;
3641
+ _context30.t1 = lockboxUuid;
3642
+ _context30.t2 = identificationDataUuid;
3643
+ _context30.next = 18;
3585
3644
  return this.getJsonData(lockboxUuid, identificationDataUuid);
3586
3645
  case 18:
3587
- _context29.t3 = _context29.sent;
3588
- return _context29.abrupt("return", {
3589
- lockboxOwnerUuid: _context29.t0,
3590
- lockboxUuid: _context29.t1,
3591
- dataUuid: _context29.t2,
3592
- data: _context29.t3
3646
+ _context30.t3 = _context30.sent;
3647
+ return _context30.abrupt("return", {
3648
+ lockboxOwnerUuid: _context30.t0,
3649
+ lockboxUuid: _context30.t1,
3650
+ dataUuid: _context30.t2,
3651
+ data: _context30.t3
3593
3652
  });
3594
3653
  case 20:
3595
3654
  case "end":
3596
- return _context29.stop();
3655
+ return _context30.stop();
3597
3656
  }
3598
- }, _callee28, this);
3657
+ }, _callee29, this);
3599
3658
  }));
3600
- function getPersonalInformations(_x85) {
3659
+ function getPersonalInformations(_x87) {
3601
3660
  return _getPersonalInformations.apply(this, arguments);
3602
3661
  }
3603
3662
  return getPersonalInformations;
@@ -3612,31 +3671,31 @@ var OroClient = /*#__PURE__*/function () {
3612
3671
  _proto.getGrantFromConsultId =
3613
3672
  /*#__PURE__*/
3614
3673
  function () {
3615
- var _getGrantFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(consultationId) {
3674
+ var _getGrantFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(consultationId) {
3616
3675
  var grants;
3617
- return _regeneratorRuntime().wrap(function _callee29$(_context30) {
3618
- while (1) switch (_context30.prev = _context30.next) {
3676
+ return _regeneratorRuntime().wrap(function _callee30$(_context31) {
3677
+ while (1) switch (_context31.prev = _context31.next) {
3619
3678
  case 0:
3620
- _context30.next = 2;
3679
+ _context31.next = 2;
3621
3680
  return this.getGrants({
3622
3681
  consultationId: consultationId
3623
3682
  });
3624
3683
  case 2:
3625
- grants = _context30.sent;
3684
+ grants = _context31.sent;
3626
3685
  if (!(grants.length === 0)) {
3627
- _context30.next = 5;
3686
+ _context31.next = 5;
3628
3687
  break;
3629
3688
  }
3630
3689
  throw AssociatedLockboxNotFound;
3631
3690
  case 5:
3632
- return _context30.abrupt("return", grants[0]);
3691
+ return _context31.abrupt("return", grants[0]);
3633
3692
  case 6:
3634
3693
  case "end":
3635
- return _context30.stop();
3694
+ return _context31.stop();
3636
3695
  }
3637
- }, _callee29, this);
3696
+ }, _callee30, this);
3638
3697
  }));
3639
- function getGrantFromConsultId(_x86) {
3698
+ function getGrantFromConsultId(_x88) {
3640
3699
  return _getGrantFromConsultId.apply(this, arguments);
3641
3700
  }
3642
3701
  return getGrantFromConsultId;
@@ -3650,32 +3709,32 @@ var OroClient = /*#__PURE__*/function () {
3650
3709
  _proto.getIdentityFromConsultId =
3651
3710
  /*#__PURE__*/
3652
3711
  function () {
3653
- var _getIdentityFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(consultationId) {
3712
+ var _getIdentityFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(consultationId) {
3654
3713
  var grant;
3655
- return _regeneratorRuntime().wrap(function _callee30$(_context31) {
3656
- while (1) switch (_context31.prev = _context31.next) {
3714
+ return _regeneratorRuntime().wrap(function _callee31$(_context32) {
3715
+ while (1) switch (_context32.prev = _context32.next) {
3657
3716
  case 0:
3658
- _context31.next = 2;
3717
+ _context32.next = 2;
3659
3718
  return this.getGrantFromConsultId(consultationId);
3660
3719
  case 2:
3661
- grant = _context31.sent;
3720
+ grant = _context32.sent;
3662
3721
  if (!(grant && grant.lockboxOwnerUuid)) {
3663
- _context31.next = 9;
3722
+ _context32.next = 9;
3664
3723
  break;
3665
3724
  }
3666
- _context31.next = 6;
3725
+ _context32.next = 6;
3667
3726
  return this.guardClient.identityGet(grant.lockboxOwnerUuid);
3668
3727
  case 6:
3669
- return _context31.abrupt("return", _context31.sent);
3728
+ return _context32.abrupt("return", _context32.sent);
3670
3729
  case 9:
3671
- return _context31.abrupt("return", undefined);
3730
+ return _context32.abrupt("return", undefined);
3672
3731
  case 10:
3673
3732
  case "end":
3674
- return _context31.stop();
3733
+ return _context32.stop();
3675
3734
  }
3676
- }, _callee30, this);
3735
+ }, _callee31, this);
3677
3736
  }));
3678
- function getIdentityFromConsultId(_x87) {
3737
+ function getIdentityFromConsultId(_x89) {
3679
3738
  return _getIdentityFromConsultId.apply(this, arguments);
3680
3739
  }
3681
3740
  return getIdentityFromConsultId;
@@ -3694,11 +3753,11 @@ var OroClient = /*#__PURE__*/function () {
3694
3753
  _proto.getLockboxManifest =
3695
3754
  /*#__PURE__*/
3696
3755
  function () {
3697
- var _getLockboxManifest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(lockboxUuid, filter, expandPrivateMetadata, lockboxOwnerUuid, options) {
3756
+ var _getLockboxManifest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(lockboxUuid, filter, expandPrivateMetadata, lockboxOwnerUuid, options) {
3698
3757
  var _this3 = this;
3699
3758
  var manifestKey;
3700
- return _regeneratorRuntime().wrap(function _callee32$(_context33) {
3701
- while (1) switch (_context33.prev = _context33.next) {
3759
+ return _regeneratorRuntime().wrap(function _callee33$(_context34) {
3760
+ while (1) switch (_context34.prev = _context34.next) {
3702
3761
  case 0:
3703
3762
  if (options === void 0) {
3704
3763
  options = {
@@ -3712,36 +3771,36 @@ var OroClient = /*#__PURE__*/function () {
3712
3771
  lockboxOwnerUuid: lockboxOwnerUuid
3713
3772
  });
3714
3773
  if (!(!options.forceRefresh && this.cachedManifest[manifestKey])) {
3715
- _context33.next = 4;
3774
+ _context34.next = 4;
3716
3775
  break;
3717
3776
  }
3718
- return _context33.abrupt("return", this.cachedManifest[manifestKey]);
3777
+ return _context34.abrupt("return", this.cachedManifest[manifestKey]);
3719
3778
  case 4:
3720
- return _context33.abrupt("return", this.vaultClient.lockboxManifestGet(lockboxUuid, filter, lockboxOwnerUuid).then(function (manifest) {
3779
+ return _context34.abrupt("return", this.vaultClient.lockboxManifestGet(lockboxUuid, filter, lockboxOwnerUuid).then(function (manifest) {
3721
3780
  return Promise.all(manifest.map( /*#__PURE__*/function () {
3722
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(entry) {
3781
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(entry) {
3723
3782
  var privateMeta;
3724
- return _regeneratorRuntime().wrap(function _callee31$(_context32) {
3725
- while (1) switch (_context32.prev = _context32.next) {
3783
+ return _regeneratorRuntime().wrap(function _callee32$(_context33) {
3784
+ while (1) switch (_context33.prev = _context33.next) {
3726
3785
  case 0:
3727
3786
  if (!(expandPrivateMetadata && entry.metadata.privateMetadata)) {
3728
- _context32.next = 5;
3787
+ _context33.next = 5;
3729
3788
  break;
3730
3789
  }
3731
- _context32.next = 3;
3790
+ _context33.next = 3;
3732
3791
  return _this3.getJsonData(lockboxUuid, entry.metadata.privateMetadata, lockboxOwnerUuid);
3733
3792
  case 3:
3734
- privateMeta = _context32.sent;
3793
+ privateMeta = _context33.sent;
3735
3794
  entry.metadata = _extends({}, entry.metadata, privateMeta);
3736
3795
  case 5:
3737
- return _context32.abrupt("return", entry);
3796
+ return _context33.abrupt("return", entry);
3738
3797
  case 6:
3739
3798
  case "end":
3740
- return _context32.stop();
3799
+ return _context33.stop();
3741
3800
  }
3742
- }, _callee31);
3801
+ }, _callee32);
3743
3802
  }));
3744
- return function (_x93) {
3803
+ return function (_x95) {
3745
3804
  return _ref4.apply(this, arguments);
3746
3805
  };
3747
3806
  }())).then(function (manifest) {
@@ -3750,11 +3809,11 @@ var OroClient = /*#__PURE__*/function () {
3750
3809
  }));
3751
3810
  case 5:
3752
3811
  case "end":
3753
- return _context33.stop();
3812
+ return _context34.stop();
3754
3813
  }
3755
- }, _callee32, this);
3814
+ }, _callee33, this);
3756
3815
  }));
3757
- function getLockboxManifest(_x88, _x89, _x90, _x91, _x92) {
3816
+ function getLockboxManifest(_x90, _x91, _x92, _x93, _x94) {
3758
3817
  return _getLockboxManifest.apply(this, arguments);
3759
3818
  }
3760
3819
  return getLockboxManifest;
@@ -3770,34 +3829,34 @@ var OroClient = /*#__PURE__*/function () {
3770
3829
  _proto.createPersonalInformations =
3771
3830
  /*#__PURE__*/
3772
3831
  function () {
3773
- var _createPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(identity, data, dataUuid) {
3832
+ var _createPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(identity, data, dataUuid) {
3774
3833
  var _yield$this$getGrants;
3775
3834
  var lockboxUuid;
3776
- return _regeneratorRuntime().wrap(function _callee33$(_context34) {
3777
- while (1) switch (_context34.prev = _context34.next) {
3835
+ return _regeneratorRuntime().wrap(function _callee34$(_context35) {
3836
+ while (1) switch (_context35.prev = _context35.next) {
3778
3837
  case 0:
3779
- _context34.next = 2;
3838
+ _context35.next = 2;
3780
3839
  return this.getGrants();
3781
3840
  case 2:
3782
- _context34.t0 = _yield$this$getGrants = _context34.sent.find(function (lockbox) {
3841
+ _context35.t0 = _yield$this$getGrants = _context35.sent.find(function (lockbox) {
3783
3842
  return lockbox.lockboxOwnerUuid === identity.id;
3784
3843
  });
3785
- if (!(_context34.t0 == null)) {
3786
- _context34.next = 7;
3844
+ if (!(_context35.t0 == null)) {
3845
+ _context35.next = 7;
3787
3846
  break;
3788
3847
  }
3789
- _context34.t1 = void 0;
3790
- _context34.next = 8;
3848
+ _context35.t1 = void 0;
3849
+ _context35.next = 8;
3791
3850
  break;
3792
3851
  case 7:
3793
- _context34.t1 = _yield$this$getGrants.lockboxUuid;
3852
+ _context35.t1 = _yield$this$getGrants.lockboxUuid;
3794
3853
  case 8:
3795
- lockboxUuid = _context34.t1;
3854
+ lockboxUuid = _context35.t1;
3796
3855
  if (!lockboxUuid) {
3797
- _context34.next = 13;
3856
+ _context35.next = 13;
3798
3857
  break;
3799
3858
  }
3800
- return _context34.abrupt("return", this.createJsonData(lockboxUuid, data, {
3859
+ return _context35.abrupt("return", this.createJsonData(lockboxUuid, data, {
3801
3860
  category: MetadataCategory.Personal,
3802
3861
  documentType: DocumentType.PopulatedWorkflowData
3803
3862
  }, {}, undefined, dataUuid));
@@ -3805,11 +3864,11 @@ var OroClient = /*#__PURE__*/function () {
3805
3864
  throw MissingLockbox;
3806
3865
  case 14:
3807
3866
  case "end":
3808
- return _context34.stop();
3867
+ return _context35.stop();
3809
3868
  }
3810
- }, _callee33, this);
3869
+ }, _callee34, this);
3811
3870
  }));
3812
- function createPersonalInformations(_x94, _x95, _x96) {
3871
+ function createPersonalInformations(_x96, _x97, _x98) {
3813
3872
  return _createPersonalInformations.apply(this, arguments);
3814
3873
  }
3815
3874
  return createPersonalInformations;
@@ -3825,34 +3884,34 @@ var OroClient = /*#__PURE__*/function () {
3825
3884
  _proto.createUserPreference =
3826
3885
  /*#__PURE__*/
3827
3886
  function () {
3828
- var _createUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(identity, preference, dataUuid) {
3887
+ var _createUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(identity, preference, dataUuid) {
3829
3888
  var _yield$this$getGrants2;
3830
3889
  var lockboxUuid;
3831
- return _regeneratorRuntime().wrap(function _callee34$(_context35) {
3832
- while (1) switch (_context35.prev = _context35.next) {
3890
+ return _regeneratorRuntime().wrap(function _callee35$(_context36) {
3891
+ while (1) switch (_context36.prev = _context36.next) {
3833
3892
  case 0:
3834
- _context35.next = 2;
3893
+ _context36.next = 2;
3835
3894
  return this.getGrants();
3836
3895
  case 2:
3837
- _context35.t0 = _yield$this$getGrants2 = _context35.sent.find(function (lockbox) {
3896
+ _context36.t0 = _yield$this$getGrants2 = _context36.sent.find(function (lockbox) {
3838
3897
  return lockbox.lockboxOwnerUuid === identity.id;
3839
3898
  });
3840
- if (!(_context35.t0 == null)) {
3841
- _context35.next = 7;
3899
+ if (!(_context36.t0 == null)) {
3900
+ _context36.next = 7;
3842
3901
  break;
3843
3902
  }
3844
- _context35.t1 = void 0;
3845
- _context35.next = 8;
3903
+ _context36.t1 = void 0;
3904
+ _context36.next = 8;
3846
3905
  break;
3847
3906
  case 7:
3848
- _context35.t1 = _yield$this$getGrants2.lockboxUuid;
3907
+ _context36.t1 = _yield$this$getGrants2.lockboxUuid;
3849
3908
  case 8:
3850
- lockboxUuid = _context35.t1;
3909
+ lockboxUuid = _context36.t1;
3851
3910
  if (!lockboxUuid) {
3852
- _context35.next = 13;
3911
+ _context36.next = 13;
3853
3912
  break;
3854
3913
  }
3855
- return _context35.abrupt("return", this.createJsonData(lockboxUuid, preference, {
3914
+ return _context36.abrupt("return", this.createJsonData(lockboxUuid, preference, {
3856
3915
  category: MetadataCategory.Preference,
3857
3916
  contentType: 'application/json'
3858
3917
  }, {}, undefined, dataUuid));
@@ -3860,11 +3919,11 @@ var OroClient = /*#__PURE__*/function () {
3860
3919
  throw MissingLockbox;
3861
3920
  case 14:
3862
3921
  case "end":
3863
- return _context35.stop();
3922
+ return _context36.stop();
3864
3923
  }
3865
- }, _callee34, this);
3924
+ }, _callee35, this);
3866
3925
  }));
3867
- function createUserPreference(_x97, _x98, _x99) {
3926
+ function createUserPreference(_x99, _x100, _x101) {
3868
3927
  return _createUserPreference.apply(this, arguments);
3869
3928
  }
3870
3929
  return createUserPreference;
@@ -3878,50 +3937,50 @@ var OroClient = /*#__PURE__*/function () {
3878
3937
  _proto.getDataFromGrant =
3879
3938
  /*#__PURE__*/
3880
3939
  function () {
3881
- var _getDataFromGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(grant, filter) {
3940
+ var _getDataFromGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(grant, filter) {
3882
3941
  var lockboxUuid, lockboxOwnerUuid, identificationDataUuid;
3883
- return _regeneratorRuntime().wrap(function _callee35$(_context36) {
3884
- while (1) switch (_context36.prev = _context36.next) {
3942
+ return _regeneratorRuntime().wrap(function _callee36$(_context37) {
3943
+ while (1) switch (_context37.prev = _context37.next) {
3885
3944
  case 0:
3886
3945
  lockboxUuid = grant.lockboxUuid, lockboxOwnerUuid = grant.lockboxOwnerUuid;
3887
3946
  if (lockboxUuid) {
3888
- _context36.next = 3;
3947
+ _context37.next = 3;
3889
3948
  break;
3890
3949
  }
3891
3950
  throw MissingLockbox;
3892
3951
  case 3:
3893
3952
  if (lockboxOwnerUuid) {
3894
- _context36.next = 5;
3953
+ _context37.next = 5;
3895
3954
  break;
3896
3955
  }
3897
3956
  throw MissingLockboxOwner;
3898
3957
  case 5:
3899
- _context36.next = 7;
3958
+ _context37.next = 7;
3900
3959
  return this.getLockboxManifest(lockboxUuid, filter, false, grant.lockboxOwnerUuid, {
3901
3960
  forceRefresh: true
3902
3961
  });
3903
3962
  case 7:
3904
- identificationDataUuid = _context36.sent[0].dataUuid;
3905
- _context36.t0 = lockboxOwnerUuid;
3906
- _context36.t1 = lockboxUuid;
3907
- _context36.t2 = identificationDataUuid;
3908
- _context36.next = 13;
3963
+ identificationDataUuid = _context37.sent[0].dataUuid;
3964
+ _context37.t0 = lockboxOwnerUuid;
3965
+ _context37.t1 = lockboxUuid;
3966
+ _context37.t2 = identificationDataUuid;
3967
+ _context37.next = 13;
3909
3968
  return this.getJsonData(lockboxUuid, identificationDataUuid);
3910
3969
  case 13:
3911
- _context36.t3 = _context36.sent;
3912
- return _context36.abrupt("return", {
3913
- lockboxOwnerUuid: _context36.t0,
3914
- lockboxUuid: _context36.t1,
3915
- dataUuid: _context36.t2,
3916
- data: _context36.t3
3970
+ _context37.t3 = _context37.sent;
3971
+ return _context37.abrupt("return", {
3972
+ lockboxOwnerUuid: _context37.t0,
3973
+ lockboxUuid: _context37.t1,
3974
+ dataUuid: _context37.t2,
3975
+ data: _context37.t3
3917
3976
  });
3918
3977
  case 15:
3919
3978
  case "end":
3920
- return _context36.stop();
3979
+ return _context37.stop();
3921
3980
  }
3922
- }, _callee35, this);
3981
+ }, _callee36, this);
3923
3982
  }));
3924
- function getDataFromGrant(_x100, _x101) {
3983
+ function getDataFromGrant(_x102, _x103) {
3925
3984
  return _getDataFromGrant.apply(this, arguments);
3926
3985
  }
3927
3986
  return getDataFromGrant;
@@ -3935,32 +3994,32 @@ var OroClient = /*#__PURE__*/function () {
3935
3994
  _proto.getUserPreferenceFromConsultId =
3936
3995
  /*#__PURE__*/
3937
3996
  function () {
3938
- var _getUserPreferenceFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(consultationId) {
3997
+ var _getUserPreferenceFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(consultationId) {
3939
3998
  var grant;
3940
- return _regeneratorRuntime().wrap(function _callee36$(_context37) {
3941
- while (1) switch (_context37.prev = _context37.next) {
3999
+ return _regeneratorRuntime().wrap(function _callee37$(_context38) {
4000
+ while (1) switch (_context38.prev = _context38.next) {
3942
4001
  case 0:
3943
- _context37.next = 2;
4002
+ _context38.next = 2;
3944
4003
  return this.getGrantFromConsultId(consultationId);
3945
4004
  case 2:
3946
- grant = _context37.sent;
4005
+ grant = _context38.sent;
3947
4006
  if (grant) {
3948
- _context37.next = 5;
4007
+ _context38.next = 5;
3949
4008
  break;
3950
4009
  }
3951
4010
  throw MissingGrant;
3952
4011
  case 5:
3953
- return _context37.abrupt("return", this.getDataFromGrant(grant, {
4012
+ return _context38.abrupt("return", this.getDataFromGrant(grant, {
3954
4013
  category: MetadataCategory.Preference,
3955
4014
  contentType: 'application/json'
3956
4015
  }));
3957
4016
  case 6:
3958
4017
  case "end":
3959
- return _context37.stop();
4018
+ return _context38.stop();
3960
4019
  }
3961
- }, _callee36, this);
4020
+ }, _callee37, this);
3962
4021
  }));
3963
- function getUserPreferenceFromConsultId(_x102) {
4022
+ function getUserPreferenceFromConsultId(_x104) {
3964
4023
  return _getUserPreferenceFromConsultId.apply(this, arguments);
3965
4024
  }
3966
4025
  return getUserPreferenceFromConsultId;
@@ -3974,34 +4033,34 @@ var OroClient = /*#__PURE__*/function () {
3974
4033
  _proto.getUserPreference =
3975
4034
  /*#__PURE__*/
3976
4035
  function () {
3977
- var _getUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(identity) {
4036
+ var _getUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(identity) {
3978
4037
  var grant;
3979
- return _regeneratorRuntime().wrap(function _callee37$(_context38) {
3980
- while (1) switch (_context38.prev = _context38.next) {
4038
+ return _regeneratorRuntime().wrap(function _callee38$(_context39) {
4039
+ while (1) switch (_context39.prev = _context39.next) {
3981
4040
  case 0:
3982
- _context38.next = 2;
4041
+ _context39.next = 2;
3983
4042
  return this.getGrants();
3984
4043
  case 2:
3985
- grant = _context38.sent.find(function (lockbox) {
4044
+ grant = _context39.sent.find(function (lockbox) {
3986
4045
  return lockbox.lockboxOwnerUuid === identity.id;
3987
4046
  });
3988
4047
  if (grant) {
3989
- _context38.next = 5;
4048
+ _context39.next = 5;
3990
4049
  break;
3991
4050
  }
3992
4051
  throw MissingGrant;
3993
4052
  case 5:
3994
- return _context38.abrupt("return", this.getDataFromGrant(grant, {
4053
+ return _context39.abrupt("return", this.getDataFromGrant(grant, {
3995
4054
  category: MetadataCategory.Preference,
3996
4055
  contentType: 'application/json'
3997
4056
  }));
3998
4057
  case 6:
3999
4058
  case "end":
4000
- return _context38.stop();
4059
+ return _context39.stop();
4001
4060
  }
4002
- }, _callee37, this);
4061
+ }, _callee38, this);
4003
4062
  }));
4004
- function getUserPreference(_x103) {
4063
+ function getUserPreference(_x105) {
4005
4064
  return _getUserPreference.apply(this, arguments);
4006
4065
  }
4007
4066
  return getUserPreference;
@@ -4015,32 +4074,32 @@ var OroClient = /*#__PURE__*/function () {
4015
4074
  _proto.getRecoveryDataFromConsultId =
4016
4075
  /*#__PURE__*/
4017
4076
  function () {
4018
- var _getRecoveryDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(consultationId) {
4077
+ var _getRecoveryDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(consultationId) {
4019
4078
  var grant;
4020
- return _regeneratorRuntime().wrap(function _callee38$(_context39) {
4021
- while (1) switch (_context39.prev = _context39.next) {
4079
+ return _regeneratorRuntime().wrap(function _callee39$(_context40) {
4080
+ while (1) switch (_context40.prev = _context40.next) {
4022
4081
  case 0:
4023
- _context39.next = 2;
4082
+ _context40.next = 2;
4024
4083
  return this.getGrantFromConsultId(consultationId);
4025
4084
  case 2:
4026
- grant = _context39.sent;
4085
+ grant = _context40.sent;
4027
4086
  if (grant) {
4028
- _context39.next = 5;
4087
+ _context40.next = 5;
4029
4088
  break;
4030
4089
  }
4031
4090
  throw MissingGrant;
4032
4091
  case 5:
4033
- return _context39.abrupt("return", this.getDataFromGrant(grant, {
4092
+ return _context40.abrupt("return", this.getDataFromGrant(grant, {
4034
4093
  category: MetadataCategory.Recovery,
4035
4094
  contentType: 'application/json'
4036
4095
  }));
4037
4096
  case 6:
4038
4097
  case "end":
4039
- return _context39.stop();
4098
+ return _context40.stop();
4040
4099
  }
4041
- }, _callee38, this);
4100
+ }, _callee39, this);
4042
4101
  }));
4043
- function getRecoveryDataFromConsultId(_x104) {
4102
+ function getRecoveryDataFromConsultId(_x106) {
4044
4103
  return _getRecoveryDataFromConsultId.apply(this, arguments);
4045
4104
  }
4046
4105
  return getRecoveryDataFromConsultId;
@@ -4054,34 +4113,34 @@ var OroClient = /*#__PURE__*/function () {
4054
4113
  _proto.getRecoveryData =
4055
4114
  /*#__PURE__*/
4056
4115
  function () {
4057
- var _getRecoveryData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(identity) {
4116
+ var _getRecoveryData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(identity) {
4058
4117
  var grant;
4059
- return _regeneratorRuntime().wrap(function _callee39$(_context40) {
4060
- while (1) switch (_context40.prev = _context40.next) {
4118
+ return _regeneratorRuntime().wrap(function _callee40$(_context41) {
4119
+ while (1) switch (_context41.prev = _context41.next) {
4061
4120
  case 0:
4062
- _context40.next = 2;
4121
+ _context41.next = 2;
4063
4122
  return this.getGrants();
4064
4123
  case 2:
4065
- grant = _context40.sent.find(function (lockbox) {
4124
+ grant = _context41.sent.find(function (lockbox) {
4066
4125
  return lockbox.lockboxOwnerUuid === identity.id;
4067
4126
  });
4068
4127
  if (grant) {
4069
- _context40.next = 5;
4128
+ _context41.next = 5;
4070
4129
  break;
4071
4130
  }
4072
4131
  throw MissingGrant;
4073
4132
  case 5:
4074
- return _context40.abrupt("return", this.getDataFromGrant(grant, {
4133
+ return _context41.abrupt("return", this.getDataFromGrant(grant, {
4075
4134
  category: MetadataCategory.Recovery,
4076
4135
  contentType: 'application/json'
4077
4136
  }));
4078
4137
  case 6:
4079
4138
  case "end":
4080
- return _context40.stop();
4139
+ return _context41.stop();
4081
4140
  }
4082
- }, _callee39, this);
4141
+ }, _callee40, this);
4083
4142
  }));
4084
- function getRecoveryData(_x105) {
4143
+ function getRecoveryData(_x107) {
4085
4144
  return _getRecoveryData.apply(this, arguments);
4086
4145
  }
4087
4146
  return getRecoveryData;
@@ -4100,36 +4159,36 @@ var OroClient = /*#__PURE__*/function () {
4100
4159
  _proto.getAssignedConsultations =
4101
4160
  /*#__PURE__*/
4102
4161
  function () {
4103
- var _getAssignedConsultations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(practiceUuid) {
4162
+ var _getAssignedConsultations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(practiceUuid) {
4104
4163
  var _this4 = this;
4105
- return _regeneratorRuntime().wrap(function _callee41$(_context42) {
4106
- while (1) switch (_context42.prev = _context42.next) {
4164
+ return _regeneratorRuntime().wrap(function _callee42$(_context43) {
4165
+ while (1) switch (_context43.prev = _context43.next) {
4107
4166
  case 0:
4108
- _context42.t0 = Promise;
4109
- _context42.next = 3;
4167
+ _context43.t0 = Promise;
4168
+ _context43.next = 3;
4110
4169
  return this.getGrants();
4111
4170
  case 3:
4112
- _context42.t1 = _context42.sent.map(function (grant) {
4171
+ _context43.t1 = _context43.sent.map(function (grant) {
4113
4172
  return _this4.getLockboxManifest(grant.lockboxUuid, {
4114
4173
  category: MetadataCategory.Consultation,
4115
4174
  documentType: DocumentType.PopulatedWorkflowData
4116
4175
  }, true, undefined).then(function (manifest) {
4117
4176
  return Promise.all(manifest.map( /*#__PURE__*/function () {
4118
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(entry) {
4119
- return _regeneratorRuntime().wrap(function _callee40$(_context41) {
4120
- while (1) switch (_context41.prev = _context41.next) {
4177
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(entry) {
4178
+ return _regeneratorRuntime().wrap(function _callee41$(_context42) {
4179
+ while (1) switch (_context42.prev = _context42.next) {
4121
4180
  case 0:
4122
- _context41.next = 2;
4181
+ _context42.next = 2;
4123
4182
  return _this4.consultClient.getConsultByUUID(entry.metadata.consultationId, practiceUuid);
4124
4183
  case 2:
4125
- return _context41.abrupt("return", _context41.sent);
4184
+ return _context42.abrupt("return", _context42.sent);
4126
4185
  case 3:
4127
4186
  case "end":
4128
- return _context41.stop();
4187
+ return _context42.stop();
4129
4188
  }
4130
- }, _callee40);
4189
+ }, _callee41);
4131
4190
  }));
4132
- return function (_x107) {
4191
+ return function (_x109) {
4133
4192
  return _ref5.apply(this, arguments);
4134
4193
  };
4135
4194
  }())).then(function (promise) {
@@ -4137,16 +4196,16 @@ var OroClient = /*#__PURE__*/function () {
4137
4196
  });
4138
4197
  });
4139
4198
  });
4140
- return _context42.abrupt("return", _context42.t0.all.call(_context42.t0, _context42.t1).then(function (consults) {
4199
+ return _context43.abrupt("return", _context43.t0.all.call(_context43.t0, _context43.t1).then(function (consults) {
4141
4200
  return consults.flat();
4142
4201
  }));
4143
4202
  case 5:
4144
4203
  case "end":
4145
- return _context42.stop();
4204
+ return _context43.stop();
4146
4205
  }
4147
- }, _callee41, this);
4206
+ }, _callee42, this);
4148
4207
  }));
4149
- function getAssignedConsultations(_x106) {
4208
+ function getAssignedConsultations(_x108) {
4150
4209
  return _getAssignedConsultations.apply(this, arguments);
4151
4210
  }
4152
4211
  return getAssignedConsultations;
@@ -4160,66 +4219,66 @@ var OroClient = /*#__PURE__*/function () {
4160
4219
  _proto.getPastConsultationsFromConsultId =
4161
4220
  /*#__PURE__*/
4162
4221
  function () {
4163
- var _getPastConsultationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(consultationId, practiceUuid) {
4222
+ var _getPastConsultationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(consultationId, practiceUuid) {
4164
4223
  var _this5 = this;
4165
4224
  var grant, consultationsInLockbox;
4166
- return _regeneratorRuntime().wrap(function _callee43$(_context44) {
4167
- while (1) switch (_context44.prev = _context44.next) {
4225
+ return _regeneratorRuntime().wrap(function _callee44$(_context45) {
4226
+ while (1) switch (_context45.prev = _context45.next) {
4168
4227
  case 0:
4169
- _context44.next = 2;
4228
+ _context45.next = 2;
4170
4229
  return this.getGrantFromConsultId(consultationId);
4171
4230
  case 2:
4172
- grant = _context44.sent;
4231
+ grant = _context45.sent;
4173
4232
  if (grant) {
4174
- _context44.next = 5;
4233
+ _context45.next = 5;
4175
4234
  break;
4176
4235
  }
4177
- return _context44.abrupt("return", undefined);
4236
+ return _context45.abrupt("return", undefined);
4178
4237
  case 5:
4179
- _context44.next = 7;
4238
+ _context45.next = 7;
4180
4239
  return this.vaultClient.lockboxMetadataGet(grant.lockboxUuid, ['consultationId'], ['consultationId'], {
4181
4240
  category: MetadataCategory.Consultation,
4182
4241
  documentType: DocumentType.PopulatedWorkflowData
4183
4242
  }, grant.lockboxOwnerUuid);
4184
4243
  case 7:
4185
- consultationsInLockbox = _context44.sent.flat().map(function (metadata) {
4244
+ consultationsInLockbox = _context45.sent.flat().map(function (metadata) {
4186
4245
  return metadata.consultationId;
4187
4246
  });
4188
4247
  if (!(consultationsInLockbox.length == 0)) {
4189
- _context44.next = 10;
4248
+ _context45.next = 10;
4190
4249
  break;
4191
4250
  }
4192
- return _context44.abrupt("return", []);
4251
+ return _context45.abrupt("return", []);
4193
4252
  case 10:
4194
- _context44.next = 12;
4253
+ _context45.next = 12;
4195
4254
  return Promise.all(consultationsInLockbox.map( /*#__PURE__*/function () {
4196
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(consultId) {
4197
- return _regeneratorRuntime().wrap(function _callee42$(_context43) {
4198
- while (1) switch (_context43.prev = _context43.next) {
4255
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(consultId) {
4256
+ return _regeneratorRuntime().wrap(function _callee43$(_context44) {
4257
+ while (1) switch (_context44.prev = _context44.next) {
4199
4258
  case 0:
4200
- _context43.next = 2;
4259
+ _context44.next = 2;
4201
4260
  return _this5.consultClient.getConsultByUUID(consultId, practiceUuid);
4202
4261
  case 2:
4203
- return _context43.abrupt("return", _context43.sent);
4262
+ return _context44.abrupt("return", _context44.sent);
4204
4263
  case 3:
4205
4264
  case "end":
4206
- return _context43.stop();
4265
+ return _context44.stop();
4207
4266
  }
4208
- }, _callee42);
4267
+ }, _callee43);
4209
4268
  }));
4210
- return function (_x110) {
4269
+ return function (_x112) {
4211
4270
  return _ref6.apply(this, arguments);
4212
4271
  };
4213
4272
  }()));
4214
4273
  case 12:
4215
- return _context44.abrupt("return", _context44.sent);
4274
+ return _context45.abrupt("return", _context45.sent);
4216
4275
  case 13:
4217
4276
  case "end":
4218
- return _context44.stop();
4277
+ return _context45.stop();
4219
4278
  }
4220
- }, _callee43, this);
4279
+ }, _callee44, this);
4221
4280
  }));
4222
- function getPastConsultationsFromConsultId(_x108, _x109) {
4281
+ function getPastConsultationsFromConsultId(_x110, _x111) {
4223
4282
  return _getPastConsultationsFromConsultId.apply(this, arguments);
4224
4283
  }
4225
4284
  return getPastConsultationsFromConsultId;
@@ -4234,23 +4293,23 @@ var OroClient = /*#__PURE__*/function () {
4234
4293
  _proto.getPatientConsultationData =
4235
4294
  /*#__PURE__*/
4236
4295
  function () {
4237
- var _getPatientConsultationData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(consultationId, options) {
4296
+ var _getPatientConsultationData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(consultationId, options) {
4238
4297
  var _this6 = this;
4239
- return _regeneratorRuntime().wrap(function _callee44$(_context45) {
4240
- while (1) switch (_context45.prev = _context45.next) {
4298
+ return _regeneratorRuntime().wrap(function _callee45$(_context46) {
4299
+ while (1) switch (_context46.prev = _context46.next) {
4241
4300
  case 0:
4242
4301
  if (options === void 0) {
4243
4302
  options = {
4244
4303
  forceRefresh: false
4245
4304
  };
4246
4305
  }
4247
- _context45.t0 = Promise;
4248
- _context45.next = 4;
4306
+ _context46.t0 = Promise;
4307
+ _context46.next = 4;
4249
4308
  return this.getGrants({
4250
4309
  consultationId: consultationId
4251
4310
  });
4252
4311
  case 4:
4253
- _context45.t1 = _context45.sent.map(function (grant) {
4312
+ _context46.t1 = _context46.sent.map(function (grant) {
4254
4313
  return _this6.getLockboxManifest(grant.lockboxUuid, {
4255
4314
  category: MetadataCategory.Consultation,
4256
4315
  documentType: DocumentType.PopulatedWorkflowData,
@@ -4261,16 +4320,16 @@ var OroClient = /*#__PURE__*/function () {
4261
4320
  }));
4262
4321
  });
4263
4322
  }).flat();
4264
- return _context45.abrupt("return", _context45.t0.all.call(_context45.t0, _context45.t1).then(function (data) {
4323
+ return _context46.abrupt("return", _context46.t0.all.call(_context46.t0, _context46.t1).then(function (data) {
4265
4324
  return data.flat();
4266
4325
  }));
4267
4326
  case 6:
4268
4327
  case "end":
4269
- return _context45.stop();
4328
+ return _context46.stop();
4270
4329
  }
4271
- }, _callee44, this);
4330
+ }, _callee45, this);
4272
4331
  }));
4273
- function getPatientConsultationData(_x111, _x112) {
4332
+ function getPatientConsultationData(_x113, _x114) {
4274
4333
  return _getPatientConsultationData.apply(this, arguments);
4275
4334
  }
4276
4335
  return getPatientConsultationData;
@@ -4284,21 +4343,21 @@ var OroClient = /*#__PURE__*/function () {
4284
4343
  _proto.getPatientPrescriptionsList =
4285
4344
  /*#__PURE__*/
4286
4345
  function () {
4287
- var _getPatientPrescriptionsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(consultationId) {
4288
- return _regeneratorRuntime().wrap(function _callee45$(_context46) {
4289
- while (1) switch (_context46.prev = _context46.next) {
4346
+ var _getPatientPrescriptionsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(consultationId) {
4347
+ return _regeneratorRuntime().wrap(function _callee46$(_context47) {
4348
+ while (1) switch (_context47.prev = _context47.next) {
4290
4349
  case 0:
4291
- return _context46.abrupt("return", this.getPatientDocumentsList({
4350
+ return _context47.abrupt("return", this.getPatientDocumentsList({
4292
4351
  category: MetadataCategory.Consultation,
4293
4352
  documentType: DocumentType.Prescription
4294
4353
  }, true, consultationId));
4295
4354
  case 1:
4296
4355
  case "end":
4297
- return _context46.stop();
4356
+ return _context47.stop();
4298
4357
  }
4299
- }, _callee45, this);
4358
+ }, _callee46, this);
4300
4359
  }));
4301
- function getPatientPrescriptionsList(_x113) {
4360
+ function getPatientPrescriptionsList(_x115) {
4302
4361
  return _getPatientPrescriptionsList.apply(this, arguments);
4303
4362
  }
4304
4363
  return getPatientPrescriptionsList;
@@ -4312,21 +4371,21 @@ var OroClient = /*#__PURE__*/function () {
4312
4371
  _proto.getPatientResultsList =
4313
4372
  /*#__PURE__*/
4314
4373
  function () {
4315
- var _getPatientResultsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(consultationId) {
4316
- return _regeneratorRuntime().wrap(function _callee46$(_context47) {
4317
- while (1) switch (_context47.prev = _context47.next) {
4374
+ var _getPatientResultsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(consultationId) {
4375
+ return _regeneratorRuntime().wrap(function _callee47$(_context48) {
4376
+ while (1) switch (_context48.prev = _context48.next) {
4318
4377
  case 0:
4319
- return _context47.abrupt("return", this.getPatientDocumentsList({
4378
+ return _context48.abrupt("return", this.getPatientDocumentsList({
4320
4379
  category: MetadataCategory.Consultation,
4321
4380
  documentType: DocumentType.Result
4322
4381
  }, true, consultationId));
4323
4382
  case 1:
4324
4383
  case "end":
4325
- return _context47.stop();
4384
+ return _context48.stop();
4326
4385
  }
4327
- }, _callee46, this);
4386
+ }, _callee47, this);
4328
4387
  }));
4329
- function getPatientResultsList(_x114) {
4388
+ function getPatientResultsList(_x116) {
4330
4389
  return _getPatientResultsList.apply(this, arguments);
4331
4390
  }
4332
4391
  return getPatientResultsList;
@@ -4340,21 +4399,21 @@ var OroClient = /*#__PURE__*/function () {
4340
4399
  _proto.getPatientTreatmentPlans =
4341
4400
  /*#__PURE__*/
4342
4401
  function () {
4343
- var _getPatientTreatmentPlans = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(consultationId) {
4344
- return _regeneratorRuntime().wrap(function _callee47$(_context48) {
4345
- while (1) switch (_context48.prev = _context48.next) {
4402
+ var _getPatientTreatmentPlans = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(consultationId) {
4403
+ return _regeneratorRuntime().wrap(function _callee48$(_context49) {
4404
+ while (1) switch (_context49.prev = _context49.next) {
4346
4405
  case 0:
4347
- return _context48.abrupt("return", this.getPatientDocumentsList({
4406
+ return _context49.abrupt("return", this.getPatientDocumentsList({
4348
4407
  category: MetadataCategory.Consultation,
4349
4408
  documentType: DocumentType.TreatmentPlan
4350
4409
  }, true, consultationId));
4351
4410
  case 1:
4352
4411
  case "end":
4353
- return _context48.stop();
4412
+ return _context49.stop();
4354
4413
  }
4355
- }, _callee47, this);
4414
+ }, _callee48, this);
4356
4415
  }));
4357
- function getPatientTreatmentPlans(_x115) {
4416
+ function getPatientTreatmentPlans(_x117) {
4358
4417
  return _getPatientTreatmentPlans.apply(this, arguments);
4359
4418
  }
4360
4419
  return getPatientTreatmentPlans;
@@ -4369,22 +4428,22 @@ var OroClient = /*#__PURE__*/function () {
4369
4428
  _proto.getPatientTreatmentPlanByUuid =
4370
4429
  /*#__PURE__*/
4371
4430
  function () {
4372
- var _getPatientTreatmentPlanByUuid = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(consultationId, treatmentPlanId) {
4373
- return _regeneratorRuntime().wrap(function _callee48$(_context49) {
4374
- while (1) switch (_context49.prev = _context49.next) {
4431
+ var _getPatientTreatmentPlanByUuid = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(consultationId, treatmentPlanId) {
4432
+ return _regeneratorRuntime().wrap(function _callee49$(_context50) {
4433
+ while (1) switch (_context50.prev = _context50.next) {
4375
4434
  case 0:
4376
- return _context49.abrupt("return", this.getPatientDocumentsList({
4435
+ return _context50.abrupt("return", this.getPatientDocumentsList({
4377
4436
  category: MetadataCategory.Consultation,
4378
4437
  documentType: DocumentType.TreatmentPlan,
4379
4438
  treatmentPlanId: treatmentPlanId
4380
4439
  }, true, consultationId));
4381
4440
  case 1:
4382
4441
  case "end":
4383
- return _context49.stop();
4442
+ return _context50.stop();
4384
4443
  }
4385
- }, _callee48, this);
4444
+ }, _callee49, this);
4386
4445
  }));
4387
- function getPatientTreatmentPlanByUuid(_x116, _x117) {
4446
+ function getPatientTreatmentPlanByUuid(_x118, _x119) {
4388
4447
  return _getPatientTreatmentPlanByUuid.apply(this, arguments);
4389
4448
  }
4390
4449
  return getPatientTreatmentPlanByUuid;
@@ -4402,54 +4461,54 @@ var OroClient = /*#__PURE__*/function () {
4402
4461
  _proto.getPatientDocumentsList =
4403
4462
  /*#__PURE__*/
4404
4463
  function () {
4405
- var _getPatientDocumentsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(filters, expandPrivateMetadata, consultationId) {
4464
+ var _getPatientDocumentsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(filters, expandPrivateMetadata, consultationId) {
4406
4465
  var _this7 = this;
4407
- return _regeneratorRuntime().wrap(function _callee50$(_context51) {
4408
- while (1) switch (_context51.prev = _context51.next) {
4466
+ return _regeneratorRuntime().wrap(function _callee51$(_context52) {
4467
+ while (1) switch (_context52.prev = _context52.next) {
4409
4468
  case 0:
4410
- _context51.t0 = Promise;
4411
- _context51.next = 3;
4469
+ _context52.t0 = Promise;
4470
+ _context52.next = 3;
4412
4471
  return this.getGrants({
4413
4472
  consultationId: consultationId
4414
4473
  });
4415
4474
  case 3:
4416
- _context51.t1 = _context51.sent.map(function (grant) {
4475
+ _context52.t1 = _context52.sent.map(function (grant) {
4417
4476
  return _this7.getLockboxManifest(grant.lockboxUuid, _extends({}, filters, {
4418
4477
  consultationId: consultationId
4419
4478
  }), expandPrivateMetadata, grant.lockboxOwnerUuid, {
4420
4479
  forceRefresh: true
4421
4480
  }).then(function (manifest) {
4422
4481
  return Promise.all(manifest.map( /*#__PURE__*/function () {
4423
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(entry) {
4424
- return _regeneratorRuntime().wrap(function _callee49$(_context50) {
4425
- while (1) switch (_context50.prev = _context50.next) {
4482
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(entry) {
4483
+ return _regeneratorRuntime().wrap(function _callee50$(_context51) {
4484
+ while (1) switch (_context51.prev = _context51.next) {
4426
4485
  case 0:
4427
- return _context50.abrupt("return", _extends({
4486
+ return _context51.abrupt("return", _extends({
4428
4487
  lockboxOwnerUuid: grant.lockboxOwnerUuid,
4429
4488
  lockboxUuid: grant.lockboxUuid
4430
4489
  }, entry));
4431
4490
  case 1:
4432
4491
  case "end":
4433
- return _context50.stop();
4492
+ return _context51.stop();
4434
4493
  }
4435
- }, _callee49);
4494
+ }, _callee50);
4436
4495
  }));
4437
- return function (_x121) {
4496
+ return function (_x123) {
4438
4497
  return _ref7.apply(this, arguments);
4439
4498
  };
4440
4499
  }()));
4441
4500
  });
4442
4501
  }).flat();
4443
- return _context51.abrupt("return", _context51.t0.all.call(_context51.t0, _context51.t1).then(function (data) {
4502
+ return _context52.abrupt("return", _context52.t0.all.call(_context52.t0, _context52.t1).then(function (data) {
4444
4503
  return data.flat();
4445
4504
  }));
4446
4505
  case 5:
4447
4506
  case "end":
4448
- return _context51.stop();
4507
+ return _context52.stop();
4449
4508
  }
4450
- }, _callee50, this);
4509
+ }, _callee51, this);
4451
4510
  }));
4452
- function getPatientDocumentsList(_x118, _x119, _x120) {
4511
+ function getPatientDocumentsList(_x120, _x121, _x122) {
4453
4512
  return _getPatientDocumentsList.apply(this, arguments);
4454
4513
  }
4455
4514
  return getPatientDocumentsList;
@@ -4469,15 +4528,15 @@ var OroClient = /*#__PURE__*/function () {
4469
4528
  _proto.recoverPrivateKeyFromSecurityQuestions =
4470
4529
  /*#__PURE__*/
4471
4530
  function () {
4472
- var _recoverPrivateKeyFromSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
4531
+ var _recoverPrivateKeyFromSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
4473
4532
  var shards, answeredShards, privateKey;
4474
- return _regeneratorRuntime().wrap(function _callee51$(_context52) {
4475
- while (1) switch (_context52.prev = _context52.next) {
4533
+ return _regeneratorRuntime().wrap(function _callee52$(_context53) {
4534
+ while (1) switch (_context53.prev = _context53.next) {
4476
4535
  case 0:
4477
- _context52.next = 2;
4536
+ _context53.next = 2;
4478
4537
  return this.guardClient.identityGet(id);
4479
4538
  case 2:
4480
- shards = _context52.sent.recoverySecurityQuestions;
4539
+ shards = _context53.sent.recoverySecurityQuestions;
4481
4540
  answeredShards = shards.filter(function (shard) {
4482
4541
  // filters all answered security questions
4483
4542
  var indexOfQuestion = recoverySecurityQuestions.indexOf(shard.securityQuestion);
@@ -4498,11 +4557,11 @@ var OroClient = /*#__PURE__*/function () {
4498
4557
  }
4499
4558
  case 5:
4500
4559
  case "end":
4501
- return _context52.stop();
4560
+ return _context53.stop();
4502
4561
  }
4503
- }, _callee51, this);
4562
+ }, _callee52, this);
4504
4563
  }));
4505
- function recoverPrivateKeyFromSecurityQuestions(_x122, _x123, _x124, _x125) {
4564
+ function recoverPrivateKeyFromSecurityQuestions(_x124, _x125, _x126, _x127) {
4506
4565
  return _recoverPrivateKeyFromSecurityQuestions.apply(this, arguments);
4507
4566
  }
4508
4567
  return recoverPrivateKeyFromSecurityQuestions;
@@ -4517,15 +4576,15 @@ var OroClient = /*#__PURE__*/function () {
4517
4576
  _proto.recoverPrivateKeyFromPassword =
4518
4577
  /*#__PURE__*/
4519
4578
  function () {
4520
- var _recoverPrivateKeyFromPassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(id, password) {
4579
+ var _recoverPrivateKeyFromPassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(id, password) {
4521
4580
  var identity, recoveryPayload, symmetricDecryptor, privateKey, symetricEncryptor;
4522
- return _regeneratorRuntime().wrap(function _callee52$(_context53) {
4523
- while (1) switch (_context53.prev = _context53.next) {
4581
+ return _regeneratorRuntime().wrap(function _callee53$(_context54) {
4582
+ while (1) switch (_context54.prev = _context54.next) {
4524
4583
  case 0:
4525
- _context53.next = 2;
4584
+ _context54.next = 2;
4526
4585
  return this.guardClient.identityGet(id);
4527
4586
  case 2:
4528
- identity = _context53.sent;
4587
+ identity = _context54.sent;
4529
4588
  recoveryPayload = identity.recoveryPassword;
4530
4589
  symmetricDecryptor = this.toolbox.CryptoChaCha.fromPassphrase(password);
4531
4590
  privateKey = symmetricDecryptor.base64PayloadDecryptToBytes(recoveryPayload);
@@ -4537,11 +4596,11 @@ var OroClient = /*#__PURE__*/function () {
4537
4596
  this.rsa = this.toolbox.CryptoRSA.fromKey(privateKey);
4538
4597
  case 8:
4539
4598
  case "end":
4540
- return _context53.stop();
4599
+ return _context54.stop();
4541
4600
  }
4542
- }, _callee52, this);
4601
+ }, _callee53, this);
4543
4602
  }));
4544
- function recoverPrivateKeyFromPassword(_x126, _x127) {
4603
+ function recoverPrivateKeyFromPassword(_x128, _x129) {
4545
4604
  return _recoverPrivateKeyFromPassword.apply(this, arguments);
4546
4605
  }
4547
4606
  return recoverPrivateKeyFromPassword;
@@ -4556,25 +4615,25 @@ var OroClient = /*#__PURE__*/function () {
4556
4615
  _proto.recoverPrivateKeyFromMasterKey =
4557
4616
  /*#__PURE__*/
4558
4617
  function () {
4559
- var _recoverPrivateKeyFromMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(id, masterKey) {
4618
+ var _recoverPrivateKeyFromMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(id, masterKey) {
4560
4619
  var recoveryPayload, symmetricDecryptor, privateKey;
4561
- return _regeneratorRuntime().wrap(function _callee53$(_context54) {
4562
- while (1) switch (_context54.prev = _context54.next) {
4620
+ return _regeneratorRuntime().wrap(function _callee54$(_context55) {
4621
+ while (1) switch (_context55.prev = _context55.next) {
4563
4622
  case 0:
4564
- _context54.next = 2;
4623
+ _context55.next = 2;
4565
4624
  return this.guardClient.identityGet(id);
4566
4625
  case 2:
4567
- recoveryPayload = _context54.sent.recoveryMasterKey;
4626
+ recoveryPayload = _context55.sent.recoveryMasterKey;
4568
4627
  symmetricDecryptor = this.toolbox.CryptoChaCha.fromPassphrase(masterKey);
4569
4628
  privateKey = symmetricDecryptor.base64PayloadDecryptToBytes(recoveryPayload);
4570
4629
  this.rsa = this.toolbox.CryptoRSA.fromKey(privateKey);
4571
4630
  case 6:
4572
4631
  case "end":
4573
- return _context54.stop();
4632
+ return _context55.stop();
4574
4633
  }
4575
- }, _callee53, this);
4634
+ }, _callee54, this);
4576
4635
  }));
4577
- function recoverPrivateKeyFromMasterKey(_x128, _x129) {
4636
+ function recoverPrivateKeyFromMasterKey(_x130, _x131) {
4578
4637
  return _recoverPrivateKeyFromMasterKey.apply(this, arguments);
4579
4638
  }
4580
4639
  return recoverPrivateKeyFromMasterKey;
@@ -4591,13 +4650,13 @@ var OroClient = /*#__PURE__*/function () {
4591
4650
  _proto.updateSecurityQuestions =
4592
4651
  /*#__PURE__*/
4593
4652
  function () {
4594
- var _updateSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
4653
+ var _updateSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
4595
4654
  var securityQuestionPayload, updateRequest;
4596
- return _regeneratorRuntime().wrap(function _callee54$(_context55) {
4597
- while (1) switch (_context55.prev = _context55.next) {
4655
+ return _regeneratorRuntime().wrap(function _callee55$(_context56) {
4656
+ while (1) switch (_context56.prev = _context56.next) {
4598
4657
  case 0:
4599
4658
  if (this.rsa) {
4600
- _context55.next = 2;
4659
+ _context56.next = 2;
4601
4660
  break;
4602
4661
  }
4603
4662
  throw IncompleteAuthentication;
@@ -4606,17 +4665,17 @@ var OroClient = /*#__PURE__*/function () {
4606
4665
  updateRequest = {
4607
4666
  recoverySecurityQuestions: securityQuestionPayload
4608
4667
  };
4609
- _context55.next = 6;
4668
+ _context56.next = 6;
4610
4669
  return this.guardClient.identityUpdate(id, updateRequest);
4611
4670
  case 6:
4612
- return _context55.abrupt("return", _context55.sent);
4671
+ return _context56.abrupt("return", _context56.sent);
4613
4672
  case 7:
4614
4673
  case "end":
4615
- return _context55.stop();
4674
+ return _context56.stop();
4616
4675
  }
4617
- }, _callee54, this);
4676
+ }, _callee55, this);
4618
4677
  }));
4619
- function updateSecurityQuestions(_x130, _x131, _x132, _x133) {
4678
+ function updateSecurityQuestions(_x132, _x133, _x134, _x135) {
4620
4679
  return _updateSecurityQuestions.apply(this, arguments);
4621
4680
  }
4622
4681
  return updateSecurityQuestions;
@@ -4636,13 +4695,13 @@ var OroClient = /*#__PURE__*/function () {
4636
4695
  _proto.updatePassword =
4637
4696
  /*#__PURE__*/
4638
4697
  function () {
4639
- var _updatePassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55(id, newPassword, oldPassword) {
4698
+ var _updatePassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56(id, newPassword, oldPassword) {
4640
4699
  var symmetricEncryptor, passwordPayload, updateRequest;
4641
- return _regeneratorRuntime().wrap(function _callee55$(_context56) {
4642
- while (1) switch (_context56.prev = _context56.next) {
4700
+ return _regeneratorRuntime().wrap(function _callee56$(_context57) {
4701
+ while (1) switch (_context57.prev = _context57.next) {
4643
4702
  case 0:
4644
4703
  if (this.rsa) {
4645
- _context56.next = 2;
4704
+ _context57.next = 2;
4646
4705
  break;
4647
4706
  }
4648
4707
  throw IncompleteAuthentication;
@@ -4660,17 +4719,17 @@ var OroClient = /*#__PURE__*/function () {
4660
4719
  },
4661
4720
  recoveryPassword: passwordPayload
4662
4721
  };
4663
- _context56.next = 9;
4722
+ _context57.next = 9;
4664
4723
  return this.guardClient.identityUpdate(id, updateRequest);
4665
4724
  case 9:
4666
- return _context56.abrupt("return", _context56.sent);
4725
+ return _context57.abrupt("return", _context57.sent);
4667
4726
  case 10:
4668
4727
  case "end":
4669
- return _context56.stop();
4728
+ return _context57.stop();
4670
4729
  }
4671
- }, _callee55, this);
4730
+ }, _callee56, this);
4672
4731
  }));
4673
- function updatePassword(_x134, _x135, _x136) {
4732
+ function updatePassword(_x136, _x137, _x138) {
4674
4733
  return _updatePassword.apply(this, arguments);
4675
4734
  }
4676
4735
  return updatePassword;
@@ -4687,13 +4746,13 @@ var OroClient = /*#__PURE__*/function () {
4687
4746
  _proto.updateMasterKey =
4688
4747
  /*#__PURE__*/
4689
4748
  function () {
4690
- var _updateMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56(id, masterKey, lockboxUuid) {
4749
+ var _updateMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee57(id, masterKey, lockboxUuid) {
4691
4750
  var symmetricEncryptor, masterKeyPayload, updateRequest, updatedIdentity;
4692
- return _regeneratorRuntime().wrap(function _callee56$(_context57) {
4693
- while (1) switch (_context57.prev = _context57.next) {
4751
+ return _regeneratorRuntime().wrap(function _callee57$(_context58) {
4752
+ while (1) switch (_context58.prev = _context58.next) {
4694
4753
  case 0:
4695
4754
  if (this.rsa) {
4696
- _context57.next = 2;
4755
+ _context58.next = 2;
4697
4756
  break;
4698
4757
  }
4699
4758
  throw IncompleteAuthentication;
@@ -4703,11 +4762,11 @@ var OroClient = /*#__PURE__*/function () {
4703
4762
  updateRequest = {
4704
4763
  recoveryMasterKey: masterKeyPayload
4705
4764
  };
4706
- _context57.next = 7;
4765
+ _context58.next = 7;
4707
4766
  return this.guardClient.identityUpdate(id, updateRequest);
4708
4767
  case 7:
4709
- updatedIdentity = _context57.sent;
4710
- _context57.next = 10;
4768
+ updatedIdentity = _context58.sent;
4769
+ _context58.next = 10;
4711
4770
  return this.getOrInsertJsonData(lockboxUuid, {
4712
4771
  masterKey: masterKey
4713
4772
  }, {
@@ -4719,14 +4778,14 @@ var OroClient = /*#__PURE__*/function () {
4719
4778
  updateMedicalStatus: false
4720
4779
  });
4721
4780
  case 10:
4722
- return _context57.abrupt("return", updatedIdentity);
4781
+ return _context58.abrupt("return", updatedIdentity);
4723
4782
  case 11:
4724
4783
  case "end":
4725
- return _context57.stop();
4784
+ return _context58.stop();
4726
4785
  }
4727
- }, _callee56, this);
4786
+ }, _callee57, this);
4728
4787
  }));
4729
- function updateMasterKey(_x137, _x138, _x139) {
4788
+ function updateMasterKey(_x139, _x140, _x141) {
4730
4789
  return _updateMasterKey.apply(this, arguments);
4731
4790
  }
4732
4791
  return updateMasterKey;