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