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