oro-sdk 5.3.2 → 5.3.5
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 +38 -10
- package/dist/helpers/consult.d.ts +9 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/prescription-refill.d.ts +21 -0
- package/dist/oro-sdk.cjs.development.js +1001 -736
- 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 +1000 -737
- package/dist/oro-sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/client.ts +62 -42
- package/src/helpers/consult.ts +29 -0
- package/src/helpers/index.ts +1 -0
- package/src/helpers/patient-registration.ts +9 -32
- package/src/helpers/prescription-refill.ts +177 -0
package/dist/oro-sdk.esm.js
CHANGED
@@ -1198,6 +1198,59 @@ function fillWorkflowFromPopulatedWorkflow(workflow, populatedWorkflow) {
|
|
1198
1198
|
return filledWorkflow;
|
1199
1199
|
}
|
1200
1200
|
|
1201
|
+
/**
|
1202
|
+
* Creates a consultation if one has not been created and fails to be retrieved by the payment intent
|
1203
|
+
* @param consult
|
1204
|
+
* @param oroClient
|
1205
|
+
* @returns the consult Uuid
|
1206
|
+
*/
|
1207
|
+
function getOrCreatePatientConsultationUuid(_x, _x2) {
|
1208
|
+
return _getOrCreatePatientConsultationUuid.apply(this, arguments);
|
1209
|
+
}
|
1210
|
+
|
1211
|
+
function _getOrCreatePatientConsultationUuid() {
|
1212
|
+
_getOrCreatePatientConsultationUuid = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(consult, oroClient) {
|
1213
|
+
var payment;
|
1214
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
1215
|
+
while (1) {
|
1216
|
+
switch (_context.prev = _context.next) {
|
1217
|
+
case 0:
|
1218
|
+
_context.next = 2;
|
1219
|
+
return oroClient.practiceClient.practiceGetPayment(consult.uuidPractice, consult.idStripeInvoiceOrPaymentIntent);
|
1220
|
+
|
1221
|
+
case 2:
|
1222
|
+
payment = _context.sent;
|
1223
|
+
|
1224
|
+
if (!(payment && payment.uuidConsult)) {
|
1225
|
+
_context.next = 7;
|
1226
|
+
break;
|
1227
|
+
}
|
1228
|
+
|
1229
|
+
return _context.abrupt("return", oroClient.consultClient.getConsultByUUID(payment.uuidConsult)["catch"](function (err) {
|
1230
|
+
console.error('Error while retrieving consult', err);
|
1231
|
+
throw err;
|
1232
|
+
}));
|
1233
|
+
|
1234
|
+
case 7:
|
1235
|
+
_context.next = 9;
|
1236
|
+
return oroClient.consultClient.consultCreate(consult)["catch"](function (err) {
|
1237
|
+
console.error('Error while creating consult', err);
|
1238
|
+
throw err;
|
1239
|
+
});
|
1240
|
+
|
1241
|
+
case 9:
|
1242
|
+
return _context.abrupt("return", _context.sent);
|
1243
|
+
|
1244
|
+
case 10:
|
1245
|
+
case "end":
|
1246
|
+
return _context.stop();
|
1247
|
+
}
|
1248
|
+
}
|
1249
|
+
}, _callee);
|
1250
|
+
}));
|
1251
|
+
return _getOrCreatePatientConsultationUuid.apply(this, arguments);
|
1252
|
+
}
|
1253
|
+
|
1201
1254
|
var MAX_RETRIES = 15;
|
1202
1255
|
/**
|
1203
1256
|
* Completes a registration for a user retrying the complete flow a maximum of 15 times
|
@@ -1226,10 +1279,9 @@ function registerPatient(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8) {
|
|
1226
1279
|
return _registerPatient.apply(this, arguments);
|
1227
1280
|
}
|
1228
1281
|
/**
|
1229
|
-
* Creates a
|
1230
|
-
* @param consult
|
1282
|
+
* Creates a new lockbox for the patient if they do not have any, otherwise, use the first (and only one)
|
1231
1283
|
* @param oroClient
|
1232
|
-
* @returns the
|
1284
|
+
* @returns the lockbox Uuid
|
1233
1285
|
*/
|
1234
1286
|
|
1235
1287
|
function _registerPatient() {
|
@@ -1371,7 +1423,7 @@ function _registerPatient() {
|
|
1371
1423
|
}, _callee);
|
1372
1424
|
}));
|
1373
1425
|
|
1374
|
-
return function (
|
1426
|
+
return function (_x29) {
|
1375
1427
|
return _ref.apply(this, arguments);
|
1376
1428
|
};
|
1377
1429
|
}());
|
@@ -1403,7 +1455,7 @@ function _registerPatient() {
|
|
1403
1455
|
}, _callee2);
|
1404
1456
|
}));
|
1405
1457
|
|
1406
|
-
return function (
|
1458
|
+
return function (_x30) {
|
1407
1459
|
return _ref2.apply(this, arguments);
|
1408
1460
|
};
|
1409
1461
|
}());
|
@@ -1577,60 +1629,7 @@ function _registerPatient() {
|
|
1577
1629
|
return _registerPatient.apply(this, arguments);
|
1578
1630
|
}
|
1579
1631
|
|
1580
|
-
function
|
1581
|
-
return _getOrCreatePatientConsultationUuid.apply(this, arguments);
|
1582
|
-
}
|
1583
|
-
/**
|
1584
|
-
* Creates a new lockbox for the patient if they do not have any, otherwise, use the first (and only one)
|
1585
|
-
* @param oroClient
|
1586
|
-
* @returns the lockbox Uuid
|
1587
|
-
*/
|
1588
|
-
|
1589
|
-
|
1590
|
-
function _getOrCreatePatientConsultationUuid() {
|
1591
|
-
_getOrCreatePatientConsultationUuid = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(consult, oroClient) {
|
1592
|
-
var payment;
|
1593
|
-
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
1594
|
-
while (1) {
|
1595
|
-
switch (_context5.prev = _context5.next) {
|
1596
|
-
case 0:
|
1597
|
-
_context5.next = 2;
|
1598
|
-
return oroClient.practiceClient.practiceGetPayment(consult.uuidPractice, consult.idStripeInvoiceOrPaymentIntent);
|
1599
|
-
|
1600
|
-
case 2:
|
1601
|
-
payment = _context5.sent;
|
1602
|
-
|
1603
|
-
if (!(payment && payment.uuidConsult)) {
|
1604
|
-
_context5.next = 7;
|
1605
|
-
break;
|
1606
|
-
}
|
1607
|
-
|
1608
|
-
return _context5.abrupt("return", oroClient.consultClient.getConsultByUUID(payment.uuidConsult)["catch"](function (err) {
|
1609
|
-
console.error('Error while retrieving consult', err);
|
1610
|
-
throw err;
|
1611
|
-
}));
|
1612
|
-
|
1613
|
-
case 7:
|
1614
|
-
_context5.next = 9;
|
1615
|
-
return oroClient.consultClient.consultCreate(consult)["catch"](function (err) {
|
1616
|
-
console.error('Error while creating consult', err);
|
1617
|
-
throw err;
|
1618
|
-
});
|
1619
|
-
|
1620
|
-
case 9:
|
1621
|
-
return _context5.abrupt("return", _context5.sent);
|
1622
|
-
|
1623
|
-
case 10:
|
1624
|
-
case "end":
|
1625
|
-
return _context5.stop();
|
1626
|
-
}
|
1627
|
-
}
|
1628
|
-
}, _callee5);
|
1629
|
-
}));
|
1630
|
-
return _getOrCreatePatientConsultationUuid.apply(this, arguments);
|
1631
|
-
}
|
1632
|
-
|
1633
|
-
function getOrCreatePatientLockbox(_x11) {
|
1632
|
+
function getOrCreatePatientLockbox(_x9) {
|
1634
1633
|
return _getOrCreatePatientLockbox.apply(this, arguments);
|
1635
1634
|
}
|
1636
1635
|
/**
|
@@ -1645,74 +1644,74 @@ function getOrCreatePatientLockbox(_x11) {
|
|
1645
1644
|
|
1646
1645
|
|
1647
1646
|
function _getOrCreatePatientLockbox() {
|
1648
|
-
_getOrCreatePatientLockbox = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
1647
|
+
_getOrCreatePatientLockbox = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(oroClient) {
|
1649
1648
|
var grants, lockboxResponse, tokens;
|
1650
|
-
return _regeneratorRuntime().wrap(function
|
1649
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
1651
1650
|
while (1) {
|
1652
|
-
switch (
|
1651
|
+
switch (_context5.prev = _context5.next) {
|
1653
1652
|
case 0:
|
1654
|
-
|
1653
|
+
_context5.next = 2;
|
1655
1654
|
return oroClient.getGrants();
|
1656
1655
|
|
1657
1656
|
case 2:
|
1658
|
-
grants =
|
1657
|
+
grants = _context5.sent;
|
1659
1658
|
|
1660
1659
|
if (!(grants.length > 0)) {
|
1661
|
-
|
1660
|
+
_context5.next = 8;
|
1662
1661
|
break;
|
1663
1662
|
}
|
1664
1663
|
|
1665
1664
|
console.log('The grant has already been created, skipping lockbox create step');
|
1666
|
-
return
|
1665
|
+
return _context5.abrupt("return", grants[0].lockboxUuid);
|
1667
1666
|
|
1668
1667
|
case 8:
|
1669
|
-
|
1668
|
+
_context5.next = 10;
|
1670
1669
|
return oroClient.vaultClient.lockboxCreate()["catch"](function (err) {
|
1671
1670
|
console.error('Error while creating lockbox', err);
|
1672
1671
|
throw err;
|
1673
1672
|
});
|
1674
1673
|
|
1675
1674
|
case 10:
|
1676
|
-
lockboxResponse =
|
1677
|
-
|
1675
|
+
lockboxResponse = _context5.sent;
|
1676
|
+
_context5.next = 13;
|
1678
1677
|
return oroClient.guardClient.authRefresh();
|
1679
1678
|
|
1680
1679
|
case 13:
|
1681
|
-
tokens =
|
1682
|
-
|
1680
|
+
tokens = _context5.sent;
|
1681
|
+
_context5.next = 16;
|
1683
1682
|
return oroClient.guardClient.setTokens({
|
1684
1683
|
accessToken: tokens.accessToken,
|
1685
1684
|
refreshToken: tokens.refreshToken
|
1686
1685
|
});
|
1687
1686
|
|
1688
1687
|
case 16:
|
1689
|
-
|
1688
|
+
_context5.next = 18;
|
1690
1689
|
return oroClient.guardClient.whoAmI(true);
|
1691
1690
|
|
1692
1691
|
case 18:
|
1693
|
-
return
|
1692
|
+
return _context5.abrupt("return", lockboxResponse.lockboxUuid);
|
1694
1693
|
|
1695
1694
|
case 19:
|
1696
1695
|
case "end":
|
1697
|
-
return
|
1696
|
+
return _context5.stop();
|
1698
1697
|
}
|
1699
1698
|
}
|
1700
|
-
},
|
1699
|
+
}, _callee5);
|
1701
1700
|
}));
|
1702
1701
|
return _getOrCreatePatientLockbox.apply(this, arguments);
|
1703
1702
|
}
|
1704
1703
|
|
1705
|
-
function storePatientData(
|
1704
|
+
function storePatientData(_x10, _x11, _x12, _x13, _x14) {
|
1706
1705
|
return _storePatientData.apply(this, arguments);
|
1707
1706
|
}
|
1708
1707
|
|
1709
1708
|
function _storePatientData() {
|
1710
|
-
_storePatientData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
1711
|
-
return _regeneratorRuntime().wrap(function
|
1709
|
+
_storePatientData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(consultationId, isoLanguage, lockboxUuid, workflow, oroClient) {
|
1710
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
1712
1711
|
while (1) {
|
1713
|
-
switch (
|
1712
|
+
switch (_context6.prev = _context6.next) {
|
1714
1713
|
case 0:
|
1715
|
-
return
|
1714
|
+
return _context6.abrupt("return", Promise.all([// Storing Raw data first
|
1716
1715
|
oroClient.getOrInsertJsonData(lockboxUuid, workflow, {
|
1717
1716
|
category: MetadataCategory.Raw,
|
1718
1717
|
contentType: 'application/json',
|
@@ -1724,8 +1723,9 @@ function _storePatientData() {
|
|
1724
1723
|
consultationId: consultationId
|
1725
1724
|
}, {
|
1726
1725
|
consultationId: consultationId
|
1727
|
-
},
|
1728
|
-
|
1726
|
+
}, {
|
1727
|
+
withNotification: true
|
1728
|
+
});
|
1729
1729
|
}), getWorkflowDataByCategory(workflow, MetadataCategory.Medical).then(function (data) {
|
1730
1730
|
return oroClient.getOrInsertJsonData(lockboxUuid, data, {
|
1731
1731
|
category: MetadataCategory.Medical,
|
@@ -1743,15 +1743,15 @@ function _storePatientData() {
|
|
1743
1743
|
|
1744
1744
|
case 1:
|
1745
1745
|
case "end":
|
1746
|
-
return
|
1746
|
+
return _context6.stop();
|
1747
1747
|
}
|
1748
1748
|
}
|
1749
|
-
},
|
1749
|
+
}, _callee6);
|
1750
1750
|
}));
|
1751
1751
|
return _storePatientData.apply(this, arguments);
|
1752
1752
|
}
|
1753
1753
|
|
1754
|
-
function storeImageAliases(
|
1754
|
+
function storeImageAliases(_x15, _x16, _x17, _x18, _x19) {
|
1755
1755
|
return _storeImageAliases.apply(this, arguments);
|
1756
1756
|
}
|
1757
1757
|
/**
|
@@ -1766,23 +1766,23 @@ function storeImageAliases(_x17, _x18, _x19, _x20, _x21) {
|
|
1766
1766
|
|
1767
1767
|
|
1768
1768
|
function _storeImageAliases() {
|
1769
|
-
_storeImageAliases = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
1769
|
+
_storeImageAliases = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(consultationId, lockboxUuid, workflow, oroClient, progress) {
|
1770
1770
|
var images, nonNullImages, storedImagesNum, totalImagesNum, promises;
|
1771
|
-
return _regeneratorRuntime().wrap(function
|
1771
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
1772
1772
|
while (1) {
|
1773
|
-
switch (
|
1773
|
+
switch (_context7.prev = _context7.next) {
|
1774
1774
|
case 0:
|
1775
|
-
|
1776
|
-
|
1775
|
+
_context7.t0 = getImagesFromIndexDb;
|
1776
|
+
_context7.next = 3;
|
1777
1777
|
return filterTriggeredAnsweredWithKind(workflow, 'images-alias');
|
1778
1778
|
|
1779
1779
|
case 3:
|
1780
|
-
|
1781
|
-
|
1782
|
-
return (0,
|
1780
|
+
_context7.t1 = _context7.sent.flat();
|
1781
|
+
_context7.next = 6;
|
1782
|
+
return (0, _context7.t0)(_context7.t1);
|
1783
1783
|
|
1784
1784
|
case 6:
|
1785
|
-
images =
|
1785
|
+
images = _context7.sent;
|
1786
1786
|
nonNullImages = images.filter(function (img) {
|
1787
1787
|
return !!img;
|
1788
1788
|
});
|
@@ -1814,19 +1814,19 @@ function _storeImageAliases() {
|
|
1814
1814
|
}
|
1815
1815
|
});
|
1816
1816
|
});
|
1817
|
-
return
|
1817
|
+
return _context7.abrupt("return", Promise.all(promises));
|
1818
1818
|
|
1819
1819
|
case 14:
|
1820
1820
|
case "end":
|
1821
|
-
return
|
1821
|
+
return _context7.stop();
|
1822
1822
|
}
|
1823
1823
|
}
|
1824
|
-
},
|
1824
|
+
}, _callee7);
|
1825
1825
|
}));
|
1826
1826
|
return _storeImageAliases.apply(this, arguments);
|
1827
1827
|
}
|
1828
1828
|
|
1829
|
-
function extractAndStorePersonalWorkflowData(
|
1829
|
+
function extractAndStorePersonalWorkflowData(_x20, _x21, _x22, _x23, _x24) {
|
1830
1830
|
return _extractAndStorePersonalWorkflowData.apply(this, arguments);
|
1831
1831
|
}
|
1832
1832
|
/**
|
@@ -1835,12 +1835,12 @@ function extractAndStorePersonalWorkflowData(_x22, _x23, _x24, _x25, _x26) {
|
|
1835
1835
|
*/
|
1836
1836
|
|
1837
1837
|
function _extractAndStorePersonalWorkflowData() {
|
1838
|
-
_extractAndStorePersonalWorkflowData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
1839
|
-
return _regeneratorRuntime().wrap(function
|
1838
|
+
_extractAndStorePersonalWorkflowData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(workflow, lockboxUuid, consultationId, category, oroClient) {
|
1839
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
1840
1840
|
while (1) {
|
1841
|
-
switch (
|
1841
|
+
switch (_context8.prev = _context8.next) {
|
1842
1842
|
case 0:
|
1843
|
-
return
|
1843
|
+
return _context8.abrupt("return", getWorkflowDataByCategory(workflow, category).then(function (data) {
|
1844
1844
|
if (Object.keys(data.fields).length === 0) return;
|
1845
1845
|
return oroClient.getOrInsertJsonData(lockboxUuid, data, {
|
1846
1846
|
category: category,
|
@@ -1851,15 +1851,15 @@ function _extractAndStorePersonalWorkflowData() {
|
|
1851
1851
|
|
1852
1852
|
case 1:
|
1853
1853
|
case "end":
|
1854
|
-
return
|
1854
|
+
return _context8.stop();
|
1855
1855
|
}
|
1856
1856
|
}
|
1857
|
-
},
|
1857
|
+
}, _callee8);
|
1858
1858
|
}));
|
1859
1859
|
return _extractAndStorePersonalWorkflowData.apply(this, arguments);
|
1860
1860
|
}
|
1861
1861
|
|
1862
|
-
function extractPersonalInfoFromWorkflowData(
|
1862
|
+
function extractPersonalInfoFromWorkflowData(_x25) {
|
1863
1863
|
return _extractPersonalInfoFromWorkflowData.apply(this, arguments);
|
1864
1864
|
}
|
1865
1865
|
/**
|
@@ -1870,12 +1870,12 @@ function extractPersonalInfoFromWorkflowData(_x27) {
|
|
1870
1870
|
*/
|
1871
1871
|
|
1872
1872
|
function _extractPersonalInfoFromWorkflowData() {
|
1873
|
-
_extractPersonalInfoFromWorkflowData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
1874
|
-
return _regeneratorRuntime().wrap(function
|
1873
|
+
_extractPersonalInfoFromWorkflowData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(workflow) {
|
1874
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
1875
1875
|
while (1) {
|
1876
|
-
switch (
|
1876
|
+
switch (_context9.prev = _context9.next) {
|
1877
1877
|
case 0:
|
1878
|
-
return
|
1878
|
+
return _context9.abrupt("return", Promise.all([getWorkflowDataByCategory(workflow, MetadataCategory.Personal), getWorkflowDataByCategory(workflow, MetadataCategory.ChildPersonal), getWorkflowDataByCategory(workflow, MetadataCategory.OtherPersonal)]).then(function (_ref3) {
|
1879
1879
|
var personalInfoPopulatedWfData = _ref3[0],
|
1880
1880
|
childPersonalInfoPopulatedWfData = _ref3[1],
|
1881
1881
|
otherPersonalInfoPopulatedWfData = _ref3[2];
|
@@ -1888,35 +1888,35 @@ function _extractPersonalInfoFromWorkflowData() {
|
|
1888
1888
|
|
1889
1889
|
case 1:
|
1890
1890
|
case "end":
|
1891
|
-
return
|
1891
|
+
return _context9.stop();
|
1892
1892
|
}
|
1893
1893
|
}
|
1894
|
-
},
|
1894
|
+
}, _callee9);
|
1895
1895
|
}));
|
1896
1896
|
return _extractPersonalInfoFromWorkflowData.apply(this, arguments);
|
1897
1897
|
}
|
1898
1898
|
|
1899
|
-
function buildConsultSearchIndex(
|
1899
|
+
function buildConsultSearchIndex(_x26, _x27, _x28) {
|
1900
1900
|
return _buildConsultSearchIndex.apply(this, arguments);
|
1901
1901
|
}
|
1902
1902
|
|
1903
1903
|
function _buildConsultSearchIndex() {
|
1904
|
-
_buildConsultSearchIndex = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
1904
|
+
_buildConsultSearchIndex = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(consult, workflow, oroClient) {
|
1905
1905
|
var terms, _yield$extractPersona, personalInfoPopulatedWfData, childPersonalInfoPopulatedWfData, otherPersonalInfoPopulatedWfData, personalInfo, childPersonalInfo, otherPersonalInfo;
|
1906
1906
|
|
1907
|
-
return _regeneratorRuntime().wrap(function
|
1907
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
1908
1908
|
while (1) {
|
1909
|
-
switch (
|
1909
|
+
switch (_context10.prev = _context10.next) {
|
1910
1910
|
case 0:
|
1911
1911
|
terms = [{
|
1912
1912
|
kind: 'consult-shortid',
|
1913
1913
|
value: consult.shortId
|
1914
1914
|
}];
|
1915
|
-
|
1915
|
+
_context10.next = 3;
|
1916
1916
|
return extractPersonalInfoFromWorkflowData(workflow);
|
1917
1917
|
|
1918
1918
|
case 3:
|
1919
|
-
_yield$extractPersona =
|
1919
|
+
_yield$extractPersona = _context10.sent;
|
1920
1920
|
personalInfoPopulatedWfData = _yield$extractPersona.personalInfoPopulatedWfData;
|
1921
1921
|
childPersonalInfoPopulatedWfData = _yield$extractPersona.childPersonalInfoPopulatedWfData;
|
1922
1922
|
otherPersonalInfoPopulatedWfData = _yield$extractPersona.otherPersonalInfoPopulatedWfData;
|
@@ -1951,15 +1951,15 @@ function _buildConsultSearchIndex() {
|
|
1951
1951
|
});
|
1952
1952
|
}
|
1953
1953
|
|
1954
|
-
|
1954
|
+
_context10.next = 15;
|
1955
1955
|
return oroClient.searchClient.index(consult.uuid, terms);
|
1956
1956
|
|
1957
1957
|
case 15:
|
1958
1958
|
case "end":
|
1959
|
-
return
|
1959
|
+
return _context10.stop();
|
1960
1960
|
}
|
1961
1961
|
}
|
1962
|
-
},
|
1962
|
+
}, _callee10);
|
1963
1963
|
}));
|
1964
1964
|
return _buildConsultSearchIndex.apply(this, arguments);
|
1965
1965
|
}
|
@@ -2012,6 +2012,202 @@ function decryptConsultLockboxGrants(encryptedConsultLockboxes, rsaKey) {
|
|
2012
2012
|
});
|
2013
2013
|
}
|
2014
2014
|
|
2015
|
+
var MAX_RETRIES$1 = 15;
|
2016
|
+
/**
|
2017
|
+
* Placeholder while the workflow interpreter for the refill flows is complete
|
2018
|
+
*
|
2019
|
+
* Creates a fake workflow in which the workflow data will reside
|
2020
|
+
*
|
2021
|
+
* @param isTreatmentWorking the value from the `is treatment working` question
|
2022
|
+
* @param hasSideEffects the value from the `does the treatment have side effects` question
|
2023
|
+
* @param deliveryAddress the provided delivery address
|
2024
|
+
* @param pharmacy
|
2025
|
+
* @returns a workflow
|
2026
|
+
*/
|
2027
|
+
|
2028
|
+
function getRefillAnswersAsWorkflow(isTreatmentWorking, hasSideEffects, deliveryAddress, pharmacy) {
|
2029
|
+
var _ref, _ref2, _selectedAnswers$push, _selectedAnswers$push2;
|
2030
|
+
|
2031
|
+
var selectedAnswers = [(_ref = {}, _ref['isTreatmentWorking'] = isTreatmentWorking, _ref), (_ref2 = {}, _ref2['hasSideEffects'] = hasSideEffects, _ref2)];
|
2032
|
+
if (deliveryAddress) selectedAnswers.push((_selectedAnswers$push = {}, _selectedAnswers$push['deliveryAddress'] = deliveryAddress, _selectedAnswers$push));
|
2033
|
+
if (pharmacy) selectedAnswers.push((_selectedAnswers$push2 = {}, _selectedAnswers$push2['pharmacy'] = JSON.stringify(pharmacy), _selectedAnswers$push2));
|
2034
|
+
return {
|
2035
|
+
id: '32573a20-6f1d-49be-9ad3-b87c58074979',
|
2036
|
+
createdAt: '2022-10-03T00:00:00.000Z',
|
2037
|
+
culDeSacs: [],
|
2038
|
+
hidePlanRules: [],
|
2039
|
+
pages: [{
|
2040
|
+
title: 'Prescription Refill',
|
2041
|
+
groups: [{
|
2042
|
+
type: 'field-group',
|
2043
|
+
fieldsAndGroups: [{
|
2044
|
+
type: 'field',
|
2045
|
+
id: 'isTreatmentWorking'
|
2046
|
+
}, {
|
2047
|
+
type: 'field',
|
2048
|
+
id: 'hasSideEffects'
|
2049
|
+
}, {
|
2050
|
+
type: 'field',
|
2051
|
+
id: 'youPharmacy'
|
2052
|
+
}, {
|
2053
|
+
type: 'field',
|
2054
|
+
id: 'youAddress'
|
2055
|
+
}]
|
2056
|
+
}],
|
2057
|
+
questions: {
|
2058
|
+
isTreatmentWorking: {
|
2059
|
+
label: 'Is the treatment working for you?',
|
2060
|
+
kind: 'radio',
|
2061
|
+
inline: true,
|
2062
|
+
inlineLabel: false,
|
2063
|
+
metaCategory: MetadataCategory.Refill,
|
2064
|
+
answers: {
|
2065
|
+
'73bec6eb-0310-4787-af3c-ac9c291737b2': {
|
2066
|
+
text: 'Yes'
|
2067
|
+
},
|
2068
|
+
'e193951f-986f-4db3-bede-903045a1804a': {
|
2069
|
+
text: 'No'
|
2070
|
+
}
|
2071
|
+
}
|
2072
|
+
},
|
2073
|
+
hasSideEffects: {
|
2074
|
+
label: 'Are there any side effects',
|
2075
|
+
kind: 'radio',
|
2076
|
+
inline: true,
|
2077
|
+
inlineLabel: false,
|
2078
|
+
metaCategory: MetadataCategory.Refill,
|
2079
|
+
answers: {
|
2080
|
+
'1b87ad22-d316-4fac-9c7f-8f4ccb841aed': {
|
2081
|
+
text: 'Yes'
|
2082
|
+
},
|
2083
|
+
'ab7f5a41-c351-4f5d-a568-e38f9f200e9a': {
|
2084
|
+
text: 'No'
|
2085
|
+
}
|
2086
|
+
}
|
2087
|
+
},
|
2088
|
+
youPharmacy: {
|
2089
|
+
kind: 'online-pharmacy-picker',
|
2090
|
+
label: 'Which pharmacy do you want the prescription sent to?',
|
2091
|
+
metaCategory: MetadataCategory.Refill,
|
2092
|
+
minorLabel: ' (Optional)',
|
2093
|
+
summaryLabel: 'Your pharmacy'
|
2094
|
+
},
|
2095
|
+
youAddress: {
|
2096
|
+
kind: 'place-address',
|
2097
|
+
label: 'Address',
|
2098
|
+
metaCategory: MetadataCategory.Refill
|
2099
|
+
}
|
2100
|
+
}
|
2101
|
+
}],
|
2102
|
+
locale: 'en',
|
2103
|
+
selectedAnswers: selectedAnswers
|
2104
|
+
};
|
2105
|
+
}
|
2106
|
+
/**
|
2107
|
+
* Complete refill flow, creates a consult, stores refill data and updates consultation status
|
2108
|
+
* @param consultRequest
|
2109
|
+
* @param populatedRefillWorkflow the refill workflow data
|
2110
|
+
* @param oroClient
|
2111
|
+
*/
|
2112
|
+
|
2113
|
+
function createRefill(_x, _x2, _x3) {
|
2114
|
+
return _createRefill.apply(this, arguments);
|
2115
|
+
}
|
2116
|
+
|
2117
|
+
function _createRefill() {
|
2118
|
+
_createRefill = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(consultRequest, populatedRefillWorkflow, oroClient) {
|
2119
|
+
var retry, errorsThrown, newConsult, lockboxUuid;
|
2120
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
2121
|
+
while (1) {
|
2122
|
+
switch (_context.prev = _context.next) {
|
2123
|
+
case 0:
|
2124
|
+
retry = MAX_RETRIES$1;
|
2125
|
+
errorsThrown = [];
|
2126
|
+
|
2127
|
+
case 2:
|
2128
|
+
if (!(retry > 0)) {
|
2129
|
+
_context.next = 28;
|
2130
|
+
break;
|
2131
|
+
}
|
2132
|
+
|
2133
|
+
_context.prev = 3;
|
2134
|
+
|
2135
|
+
if (newConsult) {
|
2136
|
+
_context.next = 8;
|
2137
|
+
break;
|
2138
|
+
}
|
2139
|
+
|
2140
|
+
_context.next = 7;
|
2141
|
+
return getOrCreatePatientConsultationUuid(consultRequest, oroClient);
|
2142
|
+
|
2143
|
+
case 7:
|
2144
|
+
newConsult = _context.sent;
|
2145
|
+
|
2146
|
+
case 8:
|
2147
|
+
if (lockboxUuid) {
|
2148
|
+
_context.next = 12;
|
2149
|
+
break;
|
2150
|
+
}
|
2151
|
+
|
2152
|
+
_context.next = 11;
|
2153
|
+
return oroClient.getGrants();
|
2154
|
+
|
2155
|
+
case 11:
|
2156
|
+
lockboxUuid = _context.sent[0].lockboxUuid;
|
2157
|
+
|
2158
|
+
case 12:
|
2159
|
+
_context.next = 14;
|
2160
|
+
return oroClient.getOrInsertJsonData(lockboxUuid, populatedRefillWorkflow, {
|
2161
|
+
category: MetadataCategory.Refill,
|
2162
|
+
documentType: DocumentType.PopulatedWorkflowData,
|
2163
|
+
consultationIds: [newConsult.uuid]
|
2164
|
+
}, {}, {
|
2165
|
+
withNotification: true
|
2166
|
+
})["catch"](function (err) {
|
2167
|
+
console.error('[SDK: prescription refill] Some errors happened during refill data upload', err);
|
2168
|
+
errorsThrown.push(err);
|
2169
|
+
});
|
2170
|
+
|
2171
|
+
case 14:
|
2172
|
+
if (!(errorsThrown.length > 0)) {
|
2173
|
+
_context.next = 16;
|
2174
|
+
break;
|
2175
|
+
}
|
2176
|
+
|
2177
|
+
throw errorsThrown;
|
2178
|
+
|
2179
|
+
case 16:
|
2180
|
+
_context.next = 18;
|
2181
|
+
return oroClient.consultClient.updateConsultByUUID(newConsult.uuid, {
|
2182
|
+
statusMedical: MedicalStatus.New
|
2183
|
+
});
|
2184
|
+
|
2185
|
+
case 18:
|
2186
|
+
_context.next = 25;
|
2187
|
+
break;
|
2188
|
+
|
2189
|
+
case 20:
|
2190
|
+
_context.prev = 20;
|
2191
|
+
_context.t0 = _context["catch"](3);
|
2192
|
+
console.error("[SDK] Error occured during refill: " + _context.t0 + ", retrying... Retries remaining: " + retry);
|
2193
|
+
errorsThrown = [];
|
2194
|
+
return _context.abrupt("continue", 25);
|
2195
|
+
|
2196
|
+
case 25:
|
2197
|
+
retry--;
|
2198
|
+
_context.next = 2;
|
2199
|
+
break;
|
2200
|
+
|
2201
|
+
case 28:
|
2202
|
+
case "end":
|
2203
|
+
return _context.stop();
|
2204
|
+
}
|
2205
|
+
}
|
2206
|
+
}, _callee, null, [[3, 20]]);
|
2207
|
+
}));
|
2208
|
+
return _createRefill.apply(this, arguments);
|
2209
|
+
}
|
2210
|
+
|
2015
2211
|
/**
|
2016
2212
|
* @name filterGrantsWithLockboxMetadata
|
2017
2213
|
* @description searches for the existance of a consult uuid in each granted lockbox
|
@@ -2490,6 +2686,50 @@ var OroClient = /*#__PURE__*/function () {
|
|
2490
2686
|
|
2491
2687
|
return registerPatient$1;
|
2492
2688
|
}()
|
2689
|
+
/**
|
2690
|
+
* Creates and stores all relevant refill data
|
2691
|
+
* - New consultation is created
|
2692
|
+
* - Stores refill workflow data in the lockbox
|
2693
|
+
* - Updates the consult to new
|
2694
|
+
*
|
2695
|
+
* @param consult
|
2696
|
+
* @param populatedRefillWorkflow
|
2697
|
+
* @returns
|
2698
|
+
*/
|
2699
|
+
;
|
2700
|
+
|
2701
|
+
_proto.createRefill =
|
2702
|
+
/*#__PURE__*/
|
2703
|
+
function () {
|
2704
|
+
var _createRefill2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(consult, populatedRefillWorkflow) {
|
2705
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
2706
|
+
while (1) {
|
2707
|
+
switch (_context8.prev = _context8.next) {
|
2708
|
+
case 0:
|
2709
|
+
if (this.rsa) {
|
2710
|
+
_context8.next = 2;
|
2711
|
+
break;
|
2712
|
+
}
|
2713
|
+
|
2714
|
+
throw IncompleteAuthentication;
|
2715
|
+
|
2716
|
+
case 2:
|
2717
|
+
return _context8.abrupt("return", createRefill(consult, populatedRefillWorkflow, this));
|
2718
|
+
|
2719
|
+
case 3:
|
2720
|
+
case "end":
|
2721
|
+
return _context8.stop();
|
2722
|
+
}
|
2723
|
+
}
|
2724
|
+
}, _callee8, this);
|
2725
|
+
}));
|
2726
|
+
|
2727
|
+
function createRefill$1(_x19, _x20) {
|
2728
|
+
return _createRefill2.apply(this, arguments);
|
2729
|
+
}
|
2730
|
+
|
2731
|
+
return createRefill$1;
|
2732
|
+
}()
|
2493
2733
|
/**
|
2494
2734
|
* Fetches all grants, and consultations that exist in each lockbox
|
2495
2735
|
* Then updates the index for the current user with the lockbox consult relationship
|
@@ -2499,28 +2739,28 @@ var OroClient = /*#__PURE__*/function () {
|
|
2499
2739
|
_proto.forceUpdateIndexEntries =
|
2500
2740
|
/*#__PURE__*/
|
2501
2741
|
function () {
|
2502
|
-
var _forceUpdateIndexEntries = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
2742
|
+
var _forceUpdateIndexEntries = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
2503
2743
|
var _this = this,
|
2504
2744
|
_this$vaultIndexAdd;
|
2505
2745
|
|
2506
2746
|
var grants, indexConsultLockbox;
|
2507
|
-
return _regeneratorRuntime().wrap(function
|
2747
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
2508
2748
|
while (1) {
|
2509
|
-
switch (
|
2749
|
+
switch (_context10.prev = _context10.next) {
|
2510
2750
|
case 0:
|
2511
|
-
|
2751
|
+
_context10.next = 2;
|
2512
2752
|
return this.getGrants();
|
2513
2753
|
|
2514
2754
|
case 2:
|
2515
|
-
grants =
|
2516
|
-
|
2755
|
+
grants = _context10.sent;
|
2756
|
+
_context10.next = 5;
|
2517
2757
|
return Promise.all(grants.map( /*#__PURE__*/function () {
|
2518
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
2519
|
-
return _regeneratorRuntime().wrap(function
|
2758
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(grant) {
|
2759
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
2520
2760
|
while (1) {
|
2521
|
-
switch (
|
2761
|
+
switch (_context9.prev = _context9.next) {
|
2522
2762
|
case 0:
|
2523
|
-
|
2763
|
+
_context9.next = 2;
|
2524
2764
|
return _this.vaultClient.lockboxMetadataGet(grant.lockboxUuid, ['consultationId'], [], {
|
2525
2765
|
category: MetadataCategory.Consultation
|
2526
2766
|
}, grant.lockboxOwnerUuid).then(function (consults) {
|
@@ -2542,17 +2782,17 @@ var OroClient = /*#__PURE__*/function () {
|
|
2542
2782
|
});
|
2543
2783
|
|
2544
2784
|
case 2:
|
2545
|
-
return
|
2785
|
+
return _context9.abrupt("return", _context9.sent);
|
2546
2786
|
|
2547
2787
|
case 3:
|
2548
2788
|
case "end":
|
2549
|
-
return
|
2789
|
+
return _context9.stop();
|
2550
2790
|
}
|
2551
2791
|
}
|
2552
|
-
},
|
2792
|
+
}, _callee9);
|
2553
2793
|
}));
|
2554
2794
|
|
2555
|
-
return function (
|
2795
|
+
return function (_x21) {
|
2556
2796
|
return _ref2.apply(this, arguments);
|
2557
2797
|
};
|
2558
2798
|
}())).then(function (consults) {
|
@@ -2560,7 +2800,7 @@ var OroClient = /*#__PURE__*/function () {
|
|
2560
2800
|
});
|
2561
2801
|
|
2562
2802
|
case 5:
|
2563
|
-
indexConsultLockbox =
|
2803
|
+
indexConsultLockbox = _context10.sent;
|
2564
2804
|
this.vaultIndexAdd((_this$vaultIndexAdd = {}, _this$vaultIndexAdd[IndexKey.Consultation] = indexConsultLockbox, _this$vaultIndexAdd)).then(function () {
|
2565
2805
|
return alert('The Index was successfully updated!');
|
2566
2806
|
})["catch"](function () {
|
@@ -2569,10 +2809,10 @@ var OroClient = /*#__PURE__*/function () {
|
|
2569
2809
|
|
2570
2810
|
case 7:
|
2571
2811
|
case "end":
|
2572
|
-
return
|
2812
|
+
return _context10.stop();
|
2573
2813
|
}
|
2574
2814
|
}
|
2575
|
-
},
|
2815
|
+
}, _callee10, this);
|
2576
2816
|
}));
|
2577
2817
|
|
2578
2818
|
function forceUpdateIndexEntries() {
|
@@ -2592,15 +2832,15 @@ var OroClient = /*#__PURE__*/function () {
|
|
2592
2832
|
_proto.vaultIndexAdd =
|
2593
2833
|
/*#__PURE__*/
|
2594
2834
|
function () {
|
2595
|
-
var _vaultIndexAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
2835
|
+
var _vaultIndexAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(entries, indexOwnerUuid) {
|
2596
2836
|
var rsaPub, base64IndexOwnerPubKey, encryptedIndex, _i, _Object$keys, keyString, key;
|
2597
2837
|
|
2598
|
-
return _regeneratorRuntime().wrap(function
|
2838
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
2599
2839
|
while (1) {
|
2600
|
-
switch (
|
2840
|
+
switch (_context11.prev = _context11.next) {
|
2601
2841
|
case 0:
|
2602
2842
|
if (this.rsa) {
|
2603
|
-
|
2843
|
+
_context11.next = 2;
|
2604
2844
|
break;
|
2605
2845
|
}
|
2606
2846
|
|
@@ -2608,17 +2848,17 @@ var OroClient = /*#__PURE__*/function () {
|
|
2608
2848
|
|
2609
2849
|
case 2:
|
2610
2850
|
if (!indexOwnerUuid) {
|
2611
|
-
|
2851
|
+
_context11.next = 9;
|
2612
2852
|
break;
|
2613
2853
|
}
|
2614
2854
|
|
2615
|
-
|
2855
|
+
_context11.next = 5;
|
2616
2856
|
return this.guardClient.identityGet(indexOwnerUuid);
|
2617
2857
|
|
2618
2858
|
case 5:
|
2619
|
-
base64IndexOwnerPubKey =
|
2859
|
+
base64IndexOwnerPubKey = _context11.sent.publicKey;
|
2620
2860
|
rsaPub = this.toolbox.decodeFromBase64(base64IndexOwnerPubKey);
|
2621
|
-
|
2861
|
+
_context11.next = 10;
|
2622
2862
|
break;
|
2623
2863
|
|
2624
2864
|
case 9:
|
@@ -2630,14 +2870,14 @@ var OroClient = /*#__PURE__*/function () {
|
|
2630
2870
|
|
2631
2871
|
case 12:
|
2632
2872
|
if (!(_i < _Object$keys.length)) {
|
2633
|
-
|
2873
|
+
_context11.next = 23;
|
2634
2874
|
break;
|
2635
2875
|
}
|
2636
2876
|
|
2637
2877
|
keyString = _Object$keys[_i];
|
2638
2878
|
key = keyString;
|
2639
|
-
|
2640
|
-
|
2879
|
+
_context11.t0 = key;
|
2880
|
+
_context11.next = _context11.t0 === IndexKey.ConsultationLockbox ? 18 : 20;
|
2641
2881
|
break;
|
2642
2882
|
|
2643
2883
|
case 18:
|
@@ -2656,26 +2896,26 @@ var OroClient = /*#__PURE__*/function () {
|
|
2656
2896
|
}, rsaPub)
|
2657
2897
|
};
|
2658
2898
|
});
|
2659
|
-
return
|
2899
|
+
return _context11.abrupt("break", 20);
|
2660
2900
|
|
2661
2901
|
case 20:
|
2662
2902
|
_i++;
|
2663
|
-
|
2903
|
+
_context11.next = 12;
|
2664
2904
|
break;
|
2665
2905
|
|
2666
2906
|
case 23:
|
2667
|
-
|
2907
|
+
_context11.next = 25;
|
2668
2908
|
return this.vaultClient.vaultIndexPut(encryptedIndex, indexOwnerUuid);
|
2669
2909
|
|
2670
2910
|
case 25:
|
2671
2911
|
case "end":
|
2672
|
-
return
|
2912
|
+
return _context11.stop();
|
2673
2913
|
}
|
2674
2914
|
}
|
2675
|
-
},
|
2915
|
+
}, _callee11, this);
|
2676
2916
|
}));
|
2677
2917
|
|
2678
|
-
function vaultIndexAdd(
|
2918
|
+
function vaultIndexAdd(_x22, _x23) {
|
2679
2919
|
return _vaultIndexAdd.apply(this, arguments);
|
2680
2920
|
}
|
2681
2921
|
|
@@ -2693,48 +2933,48 @@ var OroClient = /*#__PURE__*/function () {
|
|
2693
2933
|
_proto.grantLockbox =
|
2694
2934
|
/*#__PURE__*/
|
2695
2935
|
function () {
|
2696
|
-
var _grantLockbox = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
2936
|
+
var _grantLockbox = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(granteeUuid, lockboxUuid, lockboxOwnerUuid) {
|
2697
2937
|
var secret, base64GranteePublicKey, granteePublicKey, granteeEncryptedSecret, request;
|
2698
|
-
return _regeneratorRuntime().wrap(function
|
2938
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
2699
2939
|
while (1) {
|
2700
|
-
switch (
|
2940
|
+
switch (_context12.prev = _context12.next) {
|
2701
2941
|
case 0:
|
2702
2942
|
if (this.rsa) {
|
2703
|
-
|
2943
|
+
_context12.next = 2;
|
2704
2944
|
break;
|
2705
2945
|
}
|
2706
2946
|
|
2707
2947
|
throw IncompleteAuthentication;
|
2708
2948
|
|
2709
2949
|
case 2:
|
2710
|
-
|
2950
|
+
_context12.next = 4;
|
2711
2951
|
return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
|
2712
2952
|
|
2713
2953
|
case 4:
|
2714
|
-
secret =
|
2715
|
-
|
2954
|
+
secret = _context12.sent.key();
|
2955
|
+
_context12.next = 7;
|
2716
2956
|
return this.guardClient.identityGet(granteeUuid);
|
2717
2957
|
|
2718
2958
|
case 7:
|
2719
|
-
base64GranteePublicKey =
|
2959
|
+
base64GranteePublicKey = _context12.sent.publicKey;
|
2720
2960
|
granteePublicKey = this.toolbox.decodeFromBase64(base64GranteePublicKey);
|
2721
2961
|
granteeEncryptedSecret = CryptoRSA.bytesWithPubEncryptToBase64(secret, granteePublicKey);
|
2722
2962
|
request = {
|
2723
2963
|
encryptedSecret: granteeEncryptedSecret,
|
2724
2964
|
granteeUuid: granteeUuid
|
2725
2965
|
};
|
2726
|
-
|
2966
|
+
_context12.next = 13;
|
2727
2967
|
return this.vaultClient.lockboxGrant(lockboxUuid, request, lockboxOwnerUuid);
|
2728
2968
|
|
2729
2969
|
case 13:
|
2730
2970
|
case "end":
|
2731
|
-
return
|
2971
|
+
return _context12.stop();
|
2732
2972
|
}
|
2733
2973
|
}
|
2734
|
-
},
|
2974
|
+
}, _callee12, this);
|
2735
2975
|
}));
|
2736
2976
|
|
2737
|
-
function grantLockbox(
|
2977
|
+
function grantLockbox(_x24, _x25, _x26) {
|
2738
2978
|
return _grantLockbox.apply(this, arguments);
|
2739
2979
|
}
|
2740
2980
|
|
@@ -2755,36 +2995,36 @@ var OroClient = /*#__PURE__*/function () {
|
|
2755
2995
|
_proto.createMessageData =
|
2756
2996
|
/*#__PURE__*/
|
2757
2997
|
function () {
|
2758
|
-
var _createMessageData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
2998
|
+
var _createMessageData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(lockboxUuid, message, consultationId, lockboxOwnerUuid, previousDataUuid) {
|
2759
2999
|
var symmetricEncryptor, encryptedData, encryptedPrivateMeta, meta, request;
|
2760
|
-
return _regeneratorRuntime().wrap(function
|
3000
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
2761
3001
|
while (1) {
|
2762
|
-
switch (
|
3002
|
+
switch (_context13.prev = _context13.next) {
|
2763
3003
|
case 0:
|
2764
3004
|
if (this.rsa) {
|
2765
|
-
|
3005
|
+
_context13.next = 2;
|
2766
3006
|
break;
|
2767
3007
|
}
|
2768
3008
|
|
2769
3009
|
throw IncompleteAuthentication;
|
2770
3010
|
|
2771
3011
|
case 2:
|
2772
|
-
|
3012
|
+
_context13.next = 4;
|
2773
3013
|
return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
|
2774
3014
|
|
2775
3015
|
case 4:
|
2776
|
-
symmetricEncryptor =
|
3016
|
+
symmetricEncryptor = _context13.sent;
|
2777
3017
|
encryptedData = symmetricEncryptor.jsonEncryptToBase64Payload(message);
|
2778
|
-
|
2779
|
-
|
3018
|
+
_context13.t0 = symmetricEncryptor;
|
3019
|
+
_context13.next = 9;
|
2780
3020
|
return this.guardClient.whoAmI();
|
2781
3021
|
|
2782
3022
|
case 9:
|
2783
|
-
|
2784
|
-
|
2785
|
-
author:
|
3023
|
+
_context13.t1 = _context13.sent.sub;
|
3024
|
+
_context13.t2 = {
|
3025
|
+
author: _context13.t1
|
2786
3026
|
};
|
2787
|
-
encryptedPrivateMeta =
|
3027
|
+
encryptedPrivateMeta = _context13.t0.jsonEncryptToBase64Payload.call(_context13.t0, _context13.t2);
|
2788
3028
|
meta = {
|
2789
3029
|
consultationId: consultationId,
|
2790
3030
|
category: MetadataCategory.Consultation,
|
@@ -2796,17 +3036,17 @@ var OroClient = /*#__PURE__*/function () {
|
|
2796
3036
|
publicMetadata: meta,
|
2797
3037
|
privateMetadata: encryptedPrivateMeta
|
2798
3038
|
};
|
2799
|
-
return
|
3039
|
+
return _context13.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
|
2800
3040
|
|
2801
3041
|
case 15:
|
2802
3042
|
case "end":
|
2803
|
-
return
|
3043
|
+
return _context13.stop();
|
2804
3044
|
}
|
2805
3045
|
}
|
2806
|
-
},
|
3046
|
+
}, _callee13, this);
|
2807
3047
|
}));
|
2808
3048
|
|
2809
|
-
function createMessageData(
|
3049
|
+
function createMessageData(_x27, _x28, _x29, _x30, _x31) {
|
2810
3050
|
return _createMessageData.apply(this, arguments);
|
2811
3051
|
}
|
2812
3052
|
|
@@ -2827,50 +3067,50 @@ var OroClient = /*#__PURE__*/function () {
|
|
2827
3067
|
_proto.createMessageAttachmentData =
|
2828
3068
|
/*#__PURE__*/
|
2829
3069
|
function () {
|
2830
|
-
var _createMessageAttachmentData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3070
|
+
var _createMessageAttachmentData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(lockboxUuid, data, consultationId, lockboxOwnerUuid, previousDataUuid) {
|
2831
3071
|
var symmetricEncryptor, encryptedData, encryptedPrivateMeta, meta, request;
|
2832
|
-
return _regeneratorRuntime().wrap(function
|
3072
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
2833
3073
|
while (1) {
|
2834
|
-
switch (
|
3074
|
+
switch (_context14.prev = _context14.next) {
|
2835
3075
|
case 0:
|
2836
3076
|
if (this.rsa) {
|
2837
|
-
|
3077
|
+
_context14.next = 2;
|
2838
3078
|
break;
|
2839
3079
|
}
|
2840
3080
|
|
2841
3081
|
throw IncompleteAuthentication;
|
2842
3082
|
|
2843
3083
|
case 2:
|
2844
|
-
|
3084
|
+
_context14.next = 4;
|
2845
3085
|
return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
|
2846
3086
|
|
2847
3087
|
case 4:
|
2848
|
-
symmetricEncryptor =
|
2849
|
-
|
2850
|
-
|
2851
|
-
|
3088
|
+
symmetricEncryptor = _context14.sent;
|
3089
|
+
_context14.t0 = symmetricEncryptor;
|
3090
|
+
_context14.t1 = Uint8Array;
|
3091
|
+
_context14.next = 9;
|
2852
3092
|
return data.arrayBuffer();
|
2853
3093
|
|
2854
3094
|
case 9:
|
2855
|
-
|
2856
|
-
|
2857
|
-
encryptedData =
|
2858
|
-
|
2859
|
-
|
3095
|
+
_context14.t2 = _context14.sent;
|
3096
|
+
_context14.t3 = new _context14.t1(_context14.t2);
|
3097
|
+
encryptedData = _context14.t0.bytesEncryptToBase64Payload.call(_context14.t0, _context14.t3);
|
3098
|
+
_context14.t4 = symmetricEncryptor;
|
3099
|
+
_context14.next = 15;
|
2860
3100
|
return this.guardClient.whoAmI();
|
2861
3101
|
|
2862
3102
|
case 15:
|
2863
|
-
|
2864
|
-
|
2865
|
-
|
2866
|
-
|
2867
|
-
|
2868
|
-
author:
|
2869
|
-
fileName:
|
2870
|
-
lastModified:
|
2871
|
-
size:
|
3103
|
+
_context14.t5 = _context14.sent.sub;
|
3104
|
+
_context14.t6 = data.name;
|
3105
|
+
_context14.t7 = data.lastModified;
|
3106
|
+
_context14.t8 = data.size;
|
3107
|
+
_context14.t9 = {
|
3108
|
+
author: _context14.t5,
|
3109
|
+
fileName: _context14.t6,
|
3110
|
+
lastModified: _context14.t7,
|
3111
|
+
size: _context14.t8
|
2872
3112
|
};
|
2873
|
-
encryptedPrivateMeta =
|
3113
|
+
encryptedPrivateMeta = _context14.t4.jsonEncryptToBase64Payload.call(_context14.t4, _context14.t9);
|
2874
3114
|
meta = {
|
2875
3115
|
consultationId: consultationId,
|
2876
3116
|
category: MetadataCategory.Consultation,
|
@@ -2882,17 +3122,17 @@ var OroClient = /*#__PURE__*/function () {
|
|
2882
3122
|
publicMetadata: meta,
|
2883
3123
|
privateMetadata: encryptedPrivateMeta
|
2884
3124
|
};
|
2885
|
-
return
|
3125
|
+
return _context14.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
|
2886
3126
|
|
2887
3127
|
case 24:
|
2888
3128
|
case "end":
|
2889
|
-
return
|
3129
|
+
return _context14.stop();
|
2890
3130
|
}
|
2891
3131
|
}
|
2892
|
-
},
|
3132
|
+
}, _callee14, this);
|
2893
3133
|
}));
|
2894
3134
|
|
2895
|
-
function createMessageAttachmentData(
|
3135
|
+
function createMessageAttachmentData(_x32, _x33, _x34, _x35, _x36) {
|
2896
3136
|
return _createMessageAttachmentData.apply(this, arguments);
|
2897
3137
|
}
|
2898
3138
|
|
@@ -2915,62 +3155,64 @@ var OroClient = /*#__PURE__*/function () {
|
|
2915
3155
|
_proto.createConsultationAttachmentData =
|
2916
3156
|
/*#__PURE__*/
|
2917
3157
|
function () {
|
2918
|
-
var _createConsultationAttachmentData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
2919
|
-
return _regeneratorRuntime().wrap(function
|
3158
|
+
var _createConsultationAttachmentData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(lockboxUuid, data, consultationId, documentType, lockboxOwnerUuid, previousDataUuid, options) {
|
3159
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
2920
3160
|
while (1) {
|
2921
|
-
switch (
|
3161
|
+
switch (_context15.prev = _context15.next) {
|
2922
3162
|
case 0:
|
2923
|
-
if (
|
2924
|
-
|
3163
|
+
if (options === void 0) {
|
3164
|
+
options = {
|
3165
|
+
withNotification: false
|
3166
|
+
};
|
2925
3167
|
}
|
2926
3168
|
|
2927
3169
|
if (this.rsa) {
|
2928
|
-
|
3170
|
+
_context15.next = 3;
|
2929
3171
|
break;
|
2930
3172
|
}
|
2931
3173
|
|
2932
3174
|
throw IncompleteAuthentication;
|
2933
3175
|
|
2934
3176
|
case 3:
|
2935
|
-
|
2936
|
-
|
2937
|
-
|
2938
|
-
|
3177
|
+
_context15.t0 = this;
|
3178
|
+
_context15.t1 = lockboxUuid;
|
3179
|
+
_context15.t2 = Uint8Array;
|
3180
|
+
_context15.next = 8;
|
2939
3181
|
return data.arrayBuffer();
|
2940
3182
|
|
2941
3183
|
case 8:
|
2942
|
-
|
2943
|
-
|
2944
|
-
|
3184
|
+
_context15.t3 = _context15.sent;
|
3185
|
+
_context15.t4 = new _context15.t2(_context15.t3);
|
3186
|
+
_context15.t5 = {
|
2945
3187
|
consultationId: consultationId,
|
2946
3188
|
category: MetadataCategory.Consultation,
|
2947
3189
|
documentType: documentType,
|
2948
3190
|
contentType: data.type
|
2949
3191
|
};
|
2950
|
-
|
3192
|
+
_context15.next = 13;
|
2951
3193
|
return this.guardClient.whoAmI();
|
2952
3194
|
|
2953
3195
|
case 13:
|
2954
|
-
|
2955
|
-
|
2956
|
-
|
2957
|
-
author:
|
2958
|
-
fileName:
|
3196
|
+
_context15.t6 = _context15.sent.sub;
|
3197
|
+
_context15.t7 = data.name;
|
3198
|
+
_context15.t8 = {
|
3199
|
+
author: _context15.t6,
|
3200
|
+
fileName: _context15.t7
|
2959
3201
|
};
|
2960
|
-
|
2961
|
-
|
2962
|
-
|
2963
|
-
return
|
3202
|
+
_context15.t9 = lockboxOwnerUuid;
|
3203
|
+
_context15.t10 = previousDataUuid;
|
3204
|
+
_context15.t11 = options;
|
3205
|
+
return _context15.abrupt("return", _context15.t0.createBytesData.call(_context15.t0, _context15.t1, _context15.t4, _context15.t5, _context15.t8, _context15.t9, _context15.t10, _context15.t11));
|
2964
3206
|
|
2965
3207
|
case 20:
|
2966
3208
|
case "end":
|
2967
|
-
return
|
3209
|
+
return _context15.stop();
|
2968
3210
|
}
|
2969
3211
|
}
|
2970
|
-
},
|
3212
|
+
}, _callee15, this);
|
2971
3213
|
}));
|
2972
3214
|
|
2973
|
-
function createConsultationAttachmentData(
|
3215
|
+
function createConsultationAttachmentData(_x37, _x38, _x39, _x40, _x41, _x42, _x43) {
|
2974
3216
|
return _createConsultationAttachmentData.apply(this, arguments);
|
2975
3217
|
}
|
2976
3218
|
|
@@ -2985,7 +3227,7 @@ var OroClient = /*#__PURE__*/function () {
|
|
2985
3227
|
* @param privateMeta the metadata that will be secured in the vault
|
2986
3228
|
* @param lockboxOwnerUuid the lockbox owner (ignored if lockbox is owned by self)
|
2987
3229
|
* @param previousDataUuid if it's a revision of existing data, specify the previous data uuid
|
2988
|
-
* @param
|
3230
|
+
* @param options if the insertion of data requires email notification
|
2989
3231
|
* @returns the data uuid
|
2990
3232
|
*/
|
2991
3233
|
;
|
@@ -2993,29 +3235,31 @@ var OroClient = /*#__PURE__*/function () {
|
|
2993
3235
|
_proto.createJsonData =
|
2994
3236
|
/*#__PURE__*/
|
2995
3237
|
function () {
|
2996
|
-
var _createJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3238
|
+
var _createJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(lockboxUuid, data, meta, privateMeta, lockboxOwnerUuid, previousDataUuid, options) {
|
2997
3239
|
var symmetricEncryptor, encryptedData, encryptedPrivateMeta, request;
|
2998
|
-
return _regeneratorRuntime().wrap(function
|
3240
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
2999
3241
|
while (1) {
|
3000
|
-
switch (
|
3242
|
+
switch (_context16.prev = _context16.next) {
|
3001
3243
|
case 0:
|
3002
|
-
if (
|
3003
|
-
|
3244
|
+
if (options === void 0) {
|
3245
|
+
options = {
|
3246
|
+
withNotification: false
|
3247
|
+
};
|
3004
3248
|
}
|
3005
3249
|
|
3006
3250
|
if (this.rsa) {
|
3007
|
-
|
3251
|
+
_context16.next = 3;
|
3008
3252
|
break;
|
3009
3253
|
}
|
3010
3254
|
|
3011
3255
|
throw IncompleteAuthentication;
|
3012
3256
|
|
3013
3257
|
case 3:
|
3014
|
-
|
3258
|
+
_context16.next = 5;
|
3015
3259
|
return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
|
3016
3260
|
|
3017
3261
|
case 5:
|
3018
|
-
symmetricEncryptor =
|
3262
|
+
symmetricEncryptor = _context16.sent;
|
3019
3263
|
encryptedData = symmetricEncryptor.jsonEncryptToBase64Payload(data);
|
3020
3264
|
encryptedPrivateMeta = symmetricEncryptor.jsonEncryptToBase64Payload(privateMeta);
|
3021
3265
|
request = {
|
@@ -3024,25 +3268,25 @@ var OroClient = /*#__PURE__*/function () {
|
|
3024
3268
|
privateMetadata: encryptedPrivateMeta
|
3025
3269
|
};
|
3026
3270
|
|
3027
|
-
if (!withNotification) {
|
3028
|
-
|
3271
|
+
if (!options.withNotification) {
|
3272
|
+
_context16.next = 13;
|
3029
3273
|
break;
|
3030
3274
|
}
|
3031
3275
|
|
3032
|
-
return
|
3276
|
+
return _context16.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
|
3033
3277
|
|
3034
3278
|
case 13:
|
3035
|
-
return
|
3279
|
+
return _context16.abrupt("return", this.vaultClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
|
3036
3280
|
|
3037
3281
|
case 14:
|
3038
3282
|
case "end":
|
3039
|
-
return
|
3283
|
+
return _context16.stop();
|
3040
3284
|
}
|
3041
3285
|
}
|
3042
|
-
},
|
3286
|
+
}, _callee16, this);
|
3043
3287
|
}));
|
3044
3288
|
|
3045
|
-
function createJsonData(
|
3289
|
+
function createJsonData(_x44, _x45, _x46, _x47, _x48, _x49, _x50) {
|
3046
3290
|
return _createJsonData.apply(this, arguments);
|
3047
3291
|
}
|
3048
3292
|
|
@@ -3055,7 +3299,7 @@ var OroClient = /*#__PURE__*/function () {
|
|
3055
3299
|
* @param publicMetadata the public Metadata
|
3056
3300
|
* @param privateMetadata the private Metadata
|
3057
3301
|
* @param forceReplace set true when the insertion of data requires to replace the data when it exists already
|
3058
|
-
* @param
|
3302
|
+
* @param options if the insertion of data requires email notification
|
3059
3303
|
* @returns the data uuid
|
3060
3304
|
*/
|
3061
3305
|
;
|
@@ -3063,54 +3307,55 @@ var OroClient = /*#__PURE__*/function () {
|
|
3063
3307
|
_proto.getOrInsertJsonData =
|
3064
3308
|
/*#__PURE__*/
|
3065
3309
|
function () {
|
3066
|
-
var _getOrInsertJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3310
|
+
var _getOrInsertJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(lockboxUuid, data, publicMetadata, privateMetadata, options) {
|
3067
3311
|
var manifest;
|
3068
|
-
return _regeneratorRuntime().wrap(function
|
3312
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
3069
3313
|
while (1) {
|
3070
|
-
switch (
|
3314
|
+
switch (_context17.prev = _context17.next) {
|
3071
3315
|
case 0:
|
3072
|
-
if (
|
3073
|
-
|
3074
|
-
|
3075
|
-
|
3076
|
-
|
3077
|
-
withNotification = false;
|
3316
|
+
if (options === void 0) {
|
3317
|
+
options = {
|
3318
|
+
withNotification: false,
|
3319
|
+
forceReplace: false
|
3320
|
+
};
|
3078
3321
|
}
|
3079
3322
|
|
3080
|
-
|
3323
|
+
_context17.next = 3;
|
3081
3324
|
return this.vaultClient.lockboxManifestGet(lockboxUuid, publicMetadata);
|
3082
3325
|
|
3083
|
-
case
|
3084
|
-
manifest =
|
3326
|
+
case 3:
|
3327
|
+
manifest = _context17.sent;
|
3085
3328
|
|
3086
|
-
if (!(!forceReplace && manifest.length > 0)) {
|
3087
|
-
|
3329
|
+
if (!(!options.forceReplace && manifest.length > 0)) {
|
3330
|
+
_context17.next = 9;
|
3088
3331
|
break;
|
3089
3332
|
}
|
3090
3333
|
|
3091
3334
|
console.log("The data for " + JSON.stringify(publicMetadata) + " already exist");
|
3092
|
-
return
|
3335
|
+
return _context17.abrupt("return", manifest[0].dataUuid);
|
3093
3336
|
|
3094
|
-
case
|
3095
|
-
|
3096
|
-
return this.createJsonData(lockboxUuid, data, publicMetadata, privateMetadata, undefined,
|
3097
|
-
|
3337
|
+
case 9:
|
3338
|
+
_context17.next = 11;
|
3339
|
+
return this.createJsonData(lockboxUuid, data, publicMetadata, privateMetadata, undefined, // if forceReplace and data already exist, then replace data. Otherwise insert it
|
3340
|
+
options.forceReplace && manifest.length > 0 ? manifest[0].dataUuid : undefined, {
|
3341
|
+
withNotification: options.withNotification
|
3342
|
+
})["catch"](function (err) {
|
3098
3343
|
console.error("Error while upserting data " + JSON.stringify(publicMetadata) + " data", err);
|
3099
3344
|
throw err;
|
3100
3345
|
});
|
3101
3346
|
|
3102
|
-
case
|
3103
|
-
return
|
3347
|
+
case 11:
|
3348
|
+
return _context17.abrupt("return", _context17.sent.dataUuid);
|
3104
3349
|
|
3105
|
-
case
|
3350
|
+
case 12:
|
3106
3351
|
case "end":
|
3107
|
-
return
|
3352
|
+
return _context17.stop();
|
3108
3353
|
}
|
3109
3354
|
}
|
3110
|
-
},
|
3355
|
+
}, _callee17, this);
|
3111
3356
|
}));
|
3112
3357
|
|
3113
|
-
function getOrInsertJsonData(
|
3358
|
+
function getOrInsertJsonData(_x51, _x52, _x53, _x54, _x55) {
|
3114
3359
|
return _getOrInsertJsonData.apply(this, arguments);
|
3115
3360
|
}
|
3116
3361
|
|
@@ -3133,29 +3378,31 @@ var OroClient = /*#__PURE__*/function () {
|
|
3133
3378
|
_proto.createBytesData =
|
3134
3379
|
/*#__PURE__*/
|
3135
3380
|
function () {
|
3136
|
-
var _createBytesData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3381
|
+
var _createBytesData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(lockboxUuid, data, meta, privateMeta, lockboxOwnerUuid, previousDataUuid, options) {
|
3137
3382
|
var symmetricEncryptor, encryptedData, encryptedPrivateMeta, request;
|
3138
|
-
return _regeneratorRuntime().wrap(function
|
3383
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
3139
3384
|
while (1) {
|
3140
|
-
switch (
|
3385
|
+
switch (_context18.prev = _context18.next) {
|
3141
3386
|
case 0:
|
3142
|
-
if (
|
3143
|
-
|
3387
|
+
if (options === void 0) {
|
3388
|
+
options = {
|
3389
|
+
withNotification: false
|
3390
|
+
};
|
3144
3391
|
}
|
3145
3392
|
|
3146
3393
|
if (this.rsa) {
|
3147
|
-
|
3394
|
+
_context18.next = 3;
|
3148
3395
|
break;
|
3149
3396
|
}
|
3150
3397
|
|
3151
3398
|
throw IncompleteAuthentication;
|
3152
3399
|
|
3153
3400
|
case 3:
|
3154
|
-
|
3401
|
+
_context18.next = 5;
|
3155
3402
|
return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
|
3156
3403
|
|
3157
3404
|
case 5:
|
3158
|
-
symmetricEncryptor =
|
3405
|
+
symmetricEncryptor = _context18.sent;
|
3159
3406
|
encryptedData = symmetricEncryptor.bytesEncryptToBase64Payload(data);
|
3160
3407
|
encryptedPrivateMeta = symmetricEncryptor.jsonEncryptToBase64Payload(privateMeta);
|
3161
3408
|
request = {
|
@@ -3164,25 +3411,25 @@ var OroClient = /*#__PURE__*/function () {
|
|
3164
3411
|
privateMetadata: encryptedPrivateMeta
|
3165
3412
|
};
|
3166
3413
|
|
3167
|
-
if (!withNotification) {
|
3168
|
-
|
3414
|
+
if (!options.withNotification) {
|
3415
|
+
_context18.next = 13;
|
3169
3416
|
break;
|
3170
3417
|
}
|
3171
3418
|
|
3172
|
-
return
|
3419
|
+
return _context18.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
|
3173
3420
|
|
3174
3421
|
case 13:
|
3175
|
-
return
|
3422
|
+
return _context18.abrupt("return", this.vaultClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
|
3176
3423
|
|
3177
3424
|
case 14:
|
3178
3425
|
case "end":
|
3179
|
-
return
|
3426
|
+
return _context18.stop();
|
3180
3427
|
}
|
3181
3428
|
}
|
3182
|
-
},
|
3429
|
+
}, _callee18, this);
|
3183
3430
|
}));
|
3184
3431
|
|
3185
|
-
function createBytesData(
|
3432
|
+
function createBytesData(_x56, _x57, _x58, _x59, _x60, _x61, _x62) {
|
3186
3433
|
return _createBytesData.apply(this, arguments);
|
3187
3434
|
}
|
3188
3435
|
|
@@ -3204,39 +3451,39 @@ var OroClient = /*#__PURE__*/function () {
|
|
3204
3451
|
_proto.getJsonData =
|
3205
3452
|
/*#__PURE__*/
|
3206
3453
|
function () {
|
3207
|
-
var _getJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3454
|
+
var _getJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(lockboxUuid, dataUuid, lockboxOwnerUuid) {
|
3208
3455
|
var _yield$Promise$all, encryptedPayload, symmetricDecryptor;
|
3209
3456
|
|
3210
|
-
return _regeneratorRuntime().wrap(function
|
3457
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
3211
3458
|
while (1) {
|
3212
|
-
switch (
|
3459
|
+
switch (_context19.prev = _context19.next) {
|
3213
3460
|
case 0:
|
3214
3461
|
if (this.rsa) {
|
3215
|
-
|
3462
|
+
_context19.next = 2;
|
3216
3463
|
break;
|
3217
3464
|
}
|
3218
3465
|
|
3219
3466
|
throw IncompleteAuthentication;
|
3220
3467
|
|
3221
3468
|
case 2:
|
3222
|
-
|
3469
|
+
_context19.next = 4;
|
3223
3470
|
return Promise.all([this.vaultClient.lockboxDataGet(lockboxUuid, dataUuid, lockboxOwnerUuid), this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid)]);
|
3224
3471
|
|
3225
3472
|
case 4:
|
3226
|
-
_yield$Promise$all =
|
3473
|
+
_yield$Promise$all = _context19.sent;
|
3227
3474
|
encryptedPayload = _yield$Promise$all[0];
|
3228
3475
|
symmetricDecryptor = _yield$Promise$all[1];
|
3229
|
-
return
|
3476
|
+
return _context19.abrupt("return", symmetricDecryptor.base64PayloadDecryptToJson(encryptedPayload.data));
|
3230
3477
|
|
3231
3478
|
case 8:
|
3232
3479
|
case "end":
|
3233
|
-
return
|
3480
|
+
return _context19.stop();
|
3234
3481
|
}
|
3235
3482
|
}
|
3236
|
-
},
|
3483
|
+
}, _callee19, this);
|
3237
3484
|
}));
|
3238
3485
|
|
3239
|
-
function getJsonData(
|
3486
|
+
function getJsonData(_x63, _x64, _x65) {
|
3240
3487
|
return _getJsonData.apply(this, arguments);
|
3241
3488
|
}
|
3242
3489
|
|
@@ -3254,39 +3501,39 @@ var OroClient = /*#__PURE__*/function () {
|
|
3254
3501
|
_proto.getBytesData =
|
3255
3502
|
/*#__PURE__*/
|
3256
3503
|
function () {
|
3257
|
-
var _getBytesData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3504
|
+
var _getBytesData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(lockboxUuid, dataUuid, lockboxOwnerUuid) {
|
3258
3505
|
var _yield$Promise$all2, encryptedPayload, symmetricDecryptor;
|
3259
3506
|
|
3260
|
-
return _regeneratorRuntime().wrap(function
|
3507
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
3261
3508
|
while (1) {
|
3262
|
-
switch (
|
3509
|
+
switch (_context20.prev = _context20.next) {
|
3263
3510
|
case 0:
|
3264
3511
|
if (this.rsa) {
|
3265
|
-
|
3512
|
+
_context20.next = 2;
|
3266
3513
|
break;
|
3267
3514
|
}
|
3268
3515
|
|
3269
3516
|
throw IncompleteAuthentication;
|
3270
3517
|
|
3271
3518
|
case 2:
|
3272
|
-
|
3519
|
+
_context20.next = 4;
|
3273
3520
|
return Promise.all([this.vaultClient.lockboxDataGet(lockboxUuid, dataUuid, lockboxOwnerUuid), this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid)]);
|
3274
3521
|
|
3275
3522
|
case 4:
|
3276
|
-
_yield$Promise$all2 =
|
3523
|
+
_yield$Promise$all2 = _context20.sent;
|
3277
3524
|
encryptedPayload = _yield$Promise$all2[0];
|
3278
3525
|
symmetricDecryptor = _yield$Promise$all2[1];
|
3279
|
-
return
|
3526
|
+
return _context20.abrupt("return", symmetricDecryptor.base64PayloadDecryptToBytes(encryptedPayload.data));
|
3280
3527
|
|
3281
3528
|
case 8:
|
3282
3529
|
case "end":
|
3283
|
-
return
|
3530
|
+
return _context20.stop();
|
3284
3531
|
}
|
3285
3532
|
}
|
3286
|
-
},
|
3533
|
+
}, _callee20, this);
|
3287
3534
|
}));
|
3288
3535
|
|
3289
|
-
function getBytesData(
|
3536
|
+
function getBytesData(_x66, _x67, _x68) {
|
3290
3537
|
return _getBytesData.apply(this, arguments);
|
3291
3538
|
}
|
3292
3539
|
|
@@ -3307,14 +3554,14 @@ var OroClient = /*#__PURE__*/function () {
|
|
3307
3554
|
_proto.getGrants =
|
3308
3555
|
/*#__PURE__*/
|
3309
3556
|
function () {
|
3310
|
-
var _getGrants = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3557
|
+
var _getGrants = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(filter) {
|
3311
3558
|
var filterString, currentAccountRole, encryptedGrants, decryptedGrants, grantsByConsultLockbox, decryptedConsults;
|
3312
|
-
return _regeneratorRuntime().wrap(function
|
3559
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
3313
3560
|
while (1) {
|
3314
|
-
switch (
|
3561
|
+
switch (_context21.prev = _context21.next) {
|
3315
3562
|
case 0:
|
3316
3563
|
if (this.rsa) {
|
3317
|
-
|
3564
|
+
_context21.next = 2;
|
3318
3565
|
break;
|
3319
3566
|
}
|
3320
3567
|
|
@@ -3324,75 +3571,75 @@ var OroClient = /*#__PURE__*/function () {
|
|
3324
3571
|
filterString = JSON.stringify(filter); // retrieves cached grants
|
3325
3572
|
|
3326
3573
|
if (!this.cachedMetadataGrants[filterString]) {
|
3327
|
-
|
3574
|
+
_context21.next = 5;
|
3328
3575
|
break;
|
3329
3576
|
}
|
3330
3577
|
|
3331
|
-
return
|
3578
|
+
return _context21.abrupt("return", this.cachedMetadataGrants[filterString]);
|
3332
3579
|
|
3333
3580
|
case 5:
|
3334
|
-
|
3581
|
+
_context21.next = 7;
|
3335
3582
|
return this.getAccountRole();
|
3336
3583
|
|
3337
3584
|
case 7:
|
3338
|
-
currentAccountRole =
|
3585
|
+
currentAccountRole = _context21.sent;
|
3339
3586
|
|
3340
3587
|
if (!(currentAccountRole.length === 1 && currentAccountRole[0] === OtherRoleType.User)) {
|
3341
|
-
|
3588
|
+
_context21.next = 10;
|
3342
3589
|
break;
|
3343
3590
|
}
|
3344
3591
|
|
3345
|
-
return
|
3592
|
+
return _context21.abrupt("return", []);
|
3346
3593
|
|
3347
3594
|
case 10:
|
3348
3595
|
if (![OtherRoleType.Patient, OtherRoleType.User].every(function (requiredRole) {
|
3349
3596
|
return currentAccountRole.includes(requiredRole);
|
3350
3597
|
})) {
|
3351
|
-
|
3598
|
+
_context21.next = 26;
|
3352
3599
|
break;
|
3353
3600
|
}
|
3354
3601
|
|
3355
3602
|
if (!filter) {
|
3356
|
-
|
3603
|
+
_context21.next = 17;
|
3357
3604
|
break;
|
3358
3605
|
}
|
3359
3606
|
|
3360
|
-
|
3607
|
+
_context21.next = 14;
|
3361
3608
|
return filterGrantsWithLockboxMetadata(this, filter);
|
3362
3609
|
|
3363
3610
|
case 14:
|
3364
|
-
encryptedGrants =
|
3365
|
-
|
3611
|
+
encryptedGrants = _context21.sent;
|
3612
|
+
_context21.next = 20;
|
3366
3613
|
break;
|
3367
3614
|
|
3368
3615
|
case 17:
|
3369
|
-
|
3616
|
+
_context21.next = 19;
|
3370
3617
|
return this.vaultClient.grantsGet();
|
3371
3618
|
|
3372
3619
|
case 19:
|
3373
|
-
encryptedGrants =
|
3620
|
+
encryptedGrants = _context21.sent.grants;
|
3374
3621
|
|
3375
3622
|
case 20:
|
3376
|
-
|
3623
|
+
_context21.next = 22;
|
3377
3624
|
return decryptGrants(encryptedGrants, this.rsa);
|
3378
3625
|
|
3379
3626
|
case 22:
|
3380
|
-
decryptedGrants =
|
3627
|
+
decryptedGrants = _context21.sent;
|
3381
3628
|
// sets the cached grant
|
3382
3629
|
this.cachedMetadataGrants[filterString] = decryptedGrants;
|
3383
3630
|
console.info('[sdk:grant] Found grant for patient');
|
3384
|
-
return
|
3631
|
+
return _context21.abrupt("return", decryptedGrants);
|
3385
3632
|
|
3386
3633
|
case 26:
|
3387
3634
|
if (filter) {
|
3388
|
-
|
3635
|
+
_context21.next = 28;
|
3389
3636
|
break;
|
3390
3637
|
}
|
3391
3638
|
|
3392
3639
|
throw MissingGrantFilter;
|
3393
3640
|
|
3394
3641
|
case 28:
|
3395
|
-
|
3642
|
+
_context21.next = 30;
|
3396
3643
|
return this.vaultClient.vaultIndexGet([IndexKey.ConsultationLockbox], [filter.consultationId]).then(function (res) {
|
3397
3644
|
return res[IndexKey.ConsultationLockbox];
|
3398
3645
|
})["catch"](function (e) {
|
@@ -3401,30 +3648,30 @@ var OroClient = /*#__PURE__*/function () {
|
|
3401
3648
|
});
|
3402
3649
|
|
3403
3650
|
case 30:
|
3404
|
-
grantsByConsultLockbox =
|
3651
|
+
grantsByConsultLockbox = _context21.sent;
|
3405
3652
|
decryptedConsults = decryptConsultLockboxGrants(grantsByConsultLockbox != null ? grantsByConsultLockbox : [], this.rsa);
|
3406
3653
|
|
3407
3654
|
if (!(decryptedConsults.length > 0)) {
|
3408
|
-
|
3655
|
+
_context21.next = 36;
|
3409
3656
|
break;
|
3410
3657
|
}
|
3411
3658
|
|
3412
3659
|
console.info('[sdk:index] Grants found in user`s constant time secure index');
|
3413
3660
|
this.cachedMetadataGrants[filterString] = decryptedConsults;
|
3414
|
-
return
|
3661
|
+
return _context21.abrupt("return", this.cachedMetadataGrants[filterString]);
|
3415
3662
|
|
3416
3663
|
case 36:
|
3417
|
-
return
|
3664
|
+
return _context21.abrupt("return", []);
|
3418
3665
|
|
3419
3666
|
case 37:
|
3420
3667
|
case "end":
|
3421
|
-
return
|
3668
|
+
return _context21.stop();
|
3422
3669
|
}
|
3423
3670
|
}
|
3424
|
-
},
|
3671
|
+
}, _callee21, this);
|
3425
3672
|
}));
|
3426
3673
|
|
3427
|
-
function getGrants(
|
3674
|
+
function getGrants(_x69) {
|
3428
3675
|
return _getGrants.apply(this, arguments);
|
3429
3676
|
}
|
3430
3677
|
|
@@ -3440,23 +3687,23 @@ var OroClient = /*#__PURE__*/function () {
|
|
3440
3687
|
_proto.getAccountRole =
|
3441
3688
|
/*#__PURE__*/
|
3442
3689
|
function () {
|
3443
|
-
var _getAccountRole = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3444
|
-
return _regeneratorRuntime().wrap(function
|
3690
|
+
var _getAccountRole = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
|
3691
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
3445
3692
|
while (1) {
|
3446
|
-
switch (
|
3693
|
+
switch (_context22.prev = _context22.next) {
|
3447
3694
|
case 0:
|
3448
|
-
|
3695
|
+
_context22.next = 2;
|
3449
3696
|
return this.guardClient.whoAmI();
|
3450
3697
|
|
3451
3698
|
case 2:
|
3452
|
-
return
|
3699
|
+
return _context22.abrupt("return", _context22.sent.scope.split(' '));
|
3453
3700
|
|
3454
3701
|
case 3:
|
3455
3702
|
case "end":
|
3456
|
-
return
|
3703
|
+
return _context22.stop();
|
3457
3704
|
}
|
3458
3705
|
}
|
3459
|
-
},
|
3706
|
+
}, _callee22, this);
|
3460
3707
|
}));
|
3461
3708
|
|
3462
3709
|
function getAccountRole() {
|
@@ -3477,14 +3724,14 @@ var OroClient = /*#__PURE__*/function () {
|
|
3477
3724
|
_proto.getCachedSecretCryptor =
|
3478
3725
|
/*#__PURE__*/
|
3479
3726
|
function () {
|
3480
|
-
var _getCachedSecretCryptor = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3727
|
+
var _getCachedSecretCryptor = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(lockboxUuid, lockboxOwnerUuid) {
|
3481
3728
|
var index, encryptedSecret, secret, cryptor;
|
3482
|
-
return _regeneratorRuntime().wrap(function
|
3729
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
3483
3730
|
while (1) {
|
3484
|
-
switch (
|
3731
|
+
switch (_context23.prev = _context23.next) {
|
3485
3732
|
case 0:
|
3486
3733
|
if (this.rsa) {
|
3487
|
-
|
3734
|
+
_context23.next = 2;
|
3488
3735
|
break;
|
3489
3736
|
}
|
3490
3737
|
|
@@ -3496,35 +3743,35 @@ var OroClient = /*#__PURE__*/function () {
|
|
3496
3743
|
});
|
3497
3744
|
|
3498
3745
|
if (!(index === -1)) {
|
3499
|
-
|
3746
|
+
_context23.next = 13;
|
3500
3747
|
break;
|
3501
3748
|
}
|
3502
3749
|
|
3503
|
-
|
3750
|
+
_context23.next = 6;
|
3504
3751
|
return this.vaultClient.lockboxSecretGet(lockboxUuid, lockboxOwnerUuid);
|
3505
3752
|
|
3506
3753
|
case 6:
|
3507
|
-
encryptedSecret =
|
3754
|
+
encryptedSecret = _context23.sent.sharedSecret;
|
3508
3755
|
secret = this.rsa.base64DecryptToBytes(encryptedSecret);
|
3509
3756
|
cryptor = this.toolbox.CryptoChaCha.fromKey(secret);
|
3510
3757
|
this.secrets.push({
|
3511
3758
|
lockboxUuid: lockboxUuid,
|
3512
3759
|
cryptor: cryptor
|
3513
3760
|
});
|
3514
|
-
return
|
3761
|
+
return _context23.abrupt("return", cryptor);
|
3515
3762
|
|
3516
3763
|
case 13:
|
3517
|
-
return
|
3764
|
+
return _context23.abrupt("return", this.secrets[index].cryptor);
|
3518
3765
|
|
3519
3766
|
case 14:
|
3520
3767
|
case "end":
|
3521
|
-
return
|
3768
|
+
return _context23.stop();
|
3522
3769
|
}
|
3523
3770
|
}
|
3524
|
-
},
|
3771
|
+
}, _callee23, this);
|
3525
3772
|
}));
|
3526
3773
|
|
3527
|
-
function getCachedSecretCryptor(
|
3774
|
+
function getCachedSecretCryptor(_x70, _x71) {
|
3528
3775
|
return _getCachedSecretCryptor.apply(this, arguments);
|
3529
3776
|
}
|
3530
3777
|
|
@@ -3544,26 +3791,28 @@ var OroClient = /*#__PURE__*/function () {
|
|
3544
3791
|
_proto.getPersonalInformationsFromConsultId =
|
3545
3792
|
/*#__PURE__*/
|
3546
3793
|
function () {
|
3547
|
-
var _getPersonalInformationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3548
|
-
return _regeneratorRuntime().wrap(function
|
3794
|
+
var _getPersonalInformationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(consultationId, category, options) {
|
3795
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
3549
3796
|
while (1) {
|
3550
|
-
switch (
|
3797
|
+
switch (_context24.prev = _context24.next) {
|
3551
3798
|
case 0:
|
3552
|
-
if (
|
3553
|
-
|
3799
|
+
if (options === void 0) {
|
3800
|
+
options = {
|
3801
|
+
forceRefresh: false
|
3802
|
+
};
|
3554
3803
|
}
|
3555
3804
|
|
3556
|
-
return
|
3805
|
+
return _context24.abrupt("return", this.getMetaCategoryFromConsultId(consultationId, category, options));
|
3557
3806
|
|
3558
3807
|
case 2:
|
3559
3808
|
case "end":
|
3560
|
-
return
|
3809
|
+
return _context24.stop();
|
3561
3810
|
}
|
3562
3811
|
}
|
3563
|
-
},
|
3812
|
+
}, _callee24, this);
|
3564
3813
|
}));
|
3565
3814
|
|
3566
|
-
function getPersonalInformationsFromConsultId(
|
3815
|
+
function getPersonalInformationsFromConsultId(_x72, _x73, _x74) {
|
3567
3816
|
return _getPersonalInformationsFromConsultId.apply(this, arguments);
|
3568
3817
|
}
|
3569
3818
|
|
@@ -3582,26 +3831,28 @@ var OroClient = /*#__PURE__*/function () {
|
|
3582
3831
|
_proto.getMedicalDataFromConsultId =
|
3583
3832
|
/*#__PURE__*/
|
3584
3833
|
function () {
|
3585
|
-
var _getMedicalDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3586
|
-
return _regeneratorRuntime().wrap(function
|
3834
|
+
var _getMedicalDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(consultationId, options) {
|
3835
|
+
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
3587
3836
|
while (1) {
|
3588
|
-
switch (
|
3837
|
+
switch (_context25.prev = _context25.next) {
|
3589
3838
|
case 0:
|
3590
|
-
if (
|
3591
|
-
|
3839
|
+
if (options === void 0) {
|
3840
|
+
options = {
|
3841
|
+
forceRefresh: false
|
3842
|
+
};
|
3592
3843
|
}
|
3593
3844
|
|
3594
|
-
return
|
3845
|
+
return _context25.abrupt("return", this.getMetaCategoryFromConsultId(consultationId, MetadataCategory.Medical, options));
|
3595
3846
|
|
3596
3847
|
case 2:
|
3597
3848
|
case "end":
|
3598
|
-
return
|
3849
|
+
return _context25.stop();
|
3599
3850
|
}
|
3600
3851
|
}
|
3601
|
-
},
|
3852
|
+
}, _callee25, this);
|
3602
3853
|
}));
|
3603
3854
|
|
3604
|
-
function getMedicalDataFromConsultId(
|
3855
|
+
function getMedicalDataFromConsultId(_x75, _x76) {
|
3605
3856
|
return _getMedicalDataFromConsultId.apply(this, arguments);
|
3606
3857
|
}
|
3607
3858
|
|
@@ -3609,103 +3860,105 @@ var OroClient = /*#__PURE__*/function () {
|
|
3609
3860
|
}();
|
3610
3861
|
|
3611
3862
|
_proto.getMetaCategoryFromConsultId = /*#__PURE__*/function () {
|
3612
|
-
var _getMetaCategoryFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3863
|
+
var _getMetaCategoryFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(consultationId, category, options) {
|
3613
3864
|
var _this2 = this;
|
3614
3865
|
|
3615
3866
|
var grants, workflowData, _loop, _iterator, _step;
|
3616
3867
|
|
3617
|
-
return _regeneratorRuntime().wrap(function
|
3868
|
+
return _regeneratorRuntime().wrap(function _callee27$(_context28) {
|
3618
3869
|
while (1) {
|
3619
|
-
switch (
|
3870
|
+
switch (_context28.prev = _context28.next) {
|
3620
3871
|
case 0:
|
3621
|
-
if (
|
3622
|
-
|
3872
|
+
if (options === void 0) {
|
3873
|
+
options = {
|
3874
|
+
forceRefresh: false
|
3875
|
+
};
|
3623
3876
|
}
|
3624
3877
|
|
3625
|
-
|
3878
|
+
_context28.next = 3;
|
3626
3879
|
return this.getGrants({
|
3627
3880
|
consultationId: consultationId
|
3628
3881
|
});
|
3629
3882
|
|
3630
3883
|
case 3:
|
3631
|
-
grants =
|
3884
|
+
grants = _context28.sent;
|
3632
3885
|
workflowData = [];
|
3633
3886
|
_loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
|
3634
3887
|
var grant, manifest, data;
|
3635
|
-
return _regeneratorRuntime().wrap(function _loop$(
|
3888
|
+
return _regeneratorRuntime().wrap(function _loop$(_context27) {
|
3636
3889
|
while (1) {
|
3637
|
-
switch (
|
3890
|
+
switch (_context27.prev = _context27.next) {
|
3638
3891
|
case 0:
|
3639
3892
|
grant = _step.value;
|
3640
|
-
|
3893
|
+
_context27.next = 3;
|
3641
3894
|
return _this2.getLockboxManifest(grant.lockboxUuid, {
|
3642
3895
|
category: category,
|
3643
3896
|
documentType: DocumentType.PopulatedWorkflowData,
|
3644
3897
|
consultationIds: [consultationId]
|
3645
|
-
}, true, grant.lockboxOwnerUuid,
|
3898
|
+
}, true, grant.lockboxOwnerUuid, options);
|
3646
3899
|
|
3647
3900
|
case 3:
|
3648
|
-
manifest =
|
3901
|
+
manifest = _context27.sent;
|
3649
3902
|
|
3650
3903
|
if (!(manifest.length === 0)) {
|
3651
|
-
|
3904
|
+
_context27.next = 8;
|
3652
3905
|
break;
|
3653
3906
|
}
|
3654
3907
|
|
3655
|
-
|
3908
|
+
_context27.next = 7;
|
3656
3909
|
return _this2.getLockboxManifest(grant.lockboxUuid, {
|
3657
3910
|
category: category,
|
3658
3911
|
documentType: DocumentType.PopulatedWorkflowData
|
3659
|
-
}, true, grant.lockboxOwnerUuid,
|
3912
|
+
}, true, grant.lockboxOwnerUuid, options);
|
3660
3913
|
|
3661
3914
|
case 7:
|
3662
|
-
manifest =
|
3915
|
+
manifest = _context27.sent.filter(function (entry) {
|
3663
3916
|
return !entry.metadata.consultationIds;
|
3664
3917
|
});
|
3665
3918
|
|
3666
3919
|
case 8:
|
3667
|
-
|
3920
|
+
_context27.next = 10;
|
3668
3921
|
return Promise.all(manifest.map( /*#__PURE__*/function () {
|
3669
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3670
|
-
return _regeneratorRuntime().wrap(function
|
3922
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(entry) {
|
3923
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
3671
3924
|
while (1) {
|
3672
|
-
switch (
|
3925
|
+
switch (_context26.prev = _context26.next) {
|
3673
3926
|
case 0:
|
3674
|
-
|
3675
|
-
|
3676
|
-
|
3677
|
-
|
3927
|
+
_context26.t0 = grant.lockboxOwnerUuid;
|
3928
|
+
_context26.t1 = grant.lockboxUuid;
|
3929
|
+
_context26.t2 = entry.dataUuid;
|
3930
|
+
_context26.next = 5;
|
3678
3931
|
return _this2.getJsonData(grant.lockboxUuid, entry.dataUuid);
|
3679
3932
|
|
3680
3933
|
case 5:
|
3681
|
-
|
3682
|
-
return
|
3683
|
-
lockboxOwnerUuid:
|
3684
|
-
lockboxUuid:
|
3685
|
-
dataUuid:
|
3686
|
-
data:
|
3934
|
+
_context26.t3 = _context26.sent;
|
3935
|
+
return _context26.abrupt("return", {
|
3936
|
+
lockboxOwnerUuid: _context26.t0,
|
3937
|
+
lockboxUuid: _context26.t1,
|
3938
|
+
dataUuid: _context26.t2,
|
3939
|
+
data: _context26.t3
|
3687
3940
|
});
|
3688
3941
|
|
3689
3942
|
case 7:
|
3690
3943
|
case "end":
|
3691
|
-
return
|
3944
|
+
return _context26.stop();
|
3692
3945
|
}
|
3693
3946
|
}
|
3694
|
-
},
|
3947
|
+
}, _callee26);
|
3695
3948
|
}));
|
3696
3949
|
|
3697
|
-
return function (
|
3950
|
+
return function (_x80) {
|
3698
3951
|
return _ref3.apply(this, arguments);
|
3699
3952
|
};
|
3700
3953
|
}()));
|
3701
3954
|
|
3702
3955
|
case 10:
|
3703
|
-
data =
|
3956
|
+
data = _context27.sent;
|
3704
3957
|
workflowData = _extends({}, workflowData, data);
|
3705
3958
|
|
3706
3959
|
case 12:
|
3707
3960
|
case "end":
|
3708
|
-
return
|
3961
|
+
return _context27.stop();
|
3709
3962
|
}
|
3710
3963
|
}
|
3711
3964
|
}, _loop);
|
@@ -3714,28 +3967,28 @@ var OroClient = /*#__PURE__*/function () {
|
|
3714
3967
|
|
3715
3968
|
case 7:
|
3716
3969
|
if ((_step = _iterator()).done) {
|
3717
|
-
|
3970
|
+
_context28.next = 11;
|
3718
3971
|
break;
|
3719
3972
|
}
|
3720
3973
|
|
3721
|
-
return
|
3974
|
+
return _context28.delegateYield(_loop(), "t0", 9);
|
3722
3975
|
|
3723
3976
|
case 9:
|
3724
|
-
|
3977
|
+
_context28.next = 7;
|
3725
3978
|
break;
|
3726
3979
|
|
3727
3980
|
case 11:
|
3728
|
-
return
|
3981
|
+
return _context28.abrupt("return", workflowData);
|
3729
3982
|
|
3730
3983
|
case 12:
|
3731
3984
|
case "end":
|
3732
|
-
return
|
3985
|
+
return _context28.stop();
|
3733
3986
|
}
|
3734
3987
|
}
|
3735
|
-
},
|
3988
|
+
}, _callee27, this);
|
3736
3989
|
}));
|
3737
3990
|
|
3738
|
-
function getMetaCategoryFromConsultId(
|
3991
|
+
function getMetaCategoryFromConsultId(_x77, _x78, _x79) {
|
3739
3992
|
return _getMetaCategoryFromConsultId.apply(this, arguments);
|
3740
3993
|
}
|
3741
3994
|
|
@@ -3751,22 +4004,22 @@ var OroClient = /*#__PURE__*/function () {
|
|
3751
4004
|
_proto.getPersonalInformations =
|
3752
4005
|
/*#__PURE__*/
|
3753
4006
|
function () {
|
3754
|
-
var _getPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4007
|
+
var _getPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(userId) {
|
3755
4008
|
var grant, lockboxUuid, lockboxOwnerUuid, identificationDataUuid;
|
3756
|
-
return _regeneratorRuntime().wrap(function
|
4009
|
+
return _regeneratorRuntime().wrap(function _callee28$(_context29) {
|
3757
4010
|
while (1) {
|
3758
|
-
switch (
|
4011
|
+
switch (_context29.prev = _context29.next) {
|
3759
4012
|
case 0:
|
3760
|
-
|
4013
|
+
_context29.next = 2;
|
3761
4014
|
return this.getGrants();
|
3762
4015
|
|
3763
4016
|
case 2:
|
3764
|
-
grant =
|
4017
|
+
grant = _context29.sent.find(function (lockbox) {
|
3765
4018
|
return lockbox.lockboxOwnerUuid === userId;
|
3766
4019
|
});
|
3767
4020
|
|
3768
4021
|
if (grant) {
|
3769
|
-
|
4022
|
+
_context29.next = 5;
|
3770
4023
|
break;
|
3771
4024
|
}
|
3772
4025
|
|
@@ -3776,7 +4029,7 @@ var OroClient = /*#__PURE__*/function () {
|
|
3776
4029
|
lockboxUuid = grant.lockboxUuid, lockboxOwnerUuid = grant.lockboxOwnerUuid;
|
3777
4030
|
|
3778
4031
|
if (lockboxUuid) {
|
3779
|
-
|
4032
|
+
_context29.next = 8;
|
3780
4033
|
break;
|
3781
4034
|
}
|
3782
4035
|
|
@@ -3784,45 +4037,45 @@ var OroClient = /*#__PURE__*/function () {
|
|
3784
4037
|
|
3785
4038
|
case 8:
|
3786
4039
|
if (lockboxOwnerUuid) {
|
3787
|
-
|
4040
|
+
_context29.next = 10;
|
3788
4041
|
break;
|
3789
4042
|
}
|
3790
4043
|
|
3791
4044
|
throw MissingLockboxOwner;
|
3792
4045
|
|
3793
4046
|
case 10:
|
3794
|
-
|
4047
|
+
_context29.next = 12;
|
3795
4048
|
return this.getLockboxManifest(lockboxUuid, {
|
3796
4049
|
category: MetadataCategory.Personal,
|
3797
4050
|
documentType: DocumentType.PopulatedWorkflowData
|
3798
4051
|
}, false, userId);
|
3799
4052
|
|
3800
4053
|
case 12:
|
3801
|
-
identificationDataUuid =
|
3802
|
-
|
3803
|
-
|
3804
|
-
|
3805
|
-
|
4054
|
+
identificationDataUuid = _context29.sent[0].dataUuid;
|
4055
|
+
_context29.t0 = lockboxOwnerUuid;
|
4056
|
+
_context29.t1 = lockboxUuid;
|
4057
|
+
_context29.t2 = identificationDataUuid;
|
4058
|
+
_context29.next = 18;
|
3806
4059
|
return this.getJsonData(lockboxUuid, identificationDataUuid);
|
3807
4060
|
|
3808
4061
|
case 18:
|
3809
|
-
|
3810
|
-
return
|
3811
|
-
lockboxOwnerUuid:
|
3812
|
-
lockboxUuid:
|
3813
|
-
dataUuid:
|
3814
|
-
data:
|
4062
|
+
_context29.t3 = _context29.sent;
|
4063
|
+
return _context29.abrupt("return", {
|
4064
|
+
lockboxOwnerUuid: _context29.t0,
|
4065
|
+
lockboxUuid: _context29.t1,
|
4066
|
+
dataUuid: _context29.t2,
|
4067
|
+
data: _context29.t3
|
3815
4068
|
});
|
3816
4069
|
|
3817
4070
|
case 20:
|
3818
4071
|
case "end":
|
3819
|
-
return
|
4072
|
+
return _context29.stop();
|
3820
4073
|
}
|
3821
4074
|
}
|
3822
|
-
},
|
4075
|
+
}, _callee28, this);
|
3823
4076
|
}));
|
3824
4077
|
|
3825
|
-
function getPersonalInformations(
|
4078
|
+
function getPersonalInformations(_x81) {
|
3826
4079
|
return _getPersonalInformations.apply(this, arguments);
|
3827
4080
|
}
|
3828
4081
|
|
@@ -3839,39 +4092,39 @@ var OroClient = /*#__PURE__*/function () {
|
|
3839
4092
|
_proto.getGrantFromConsultId =
|
3840
4093
|
/*#__PURE__*/
|
3841
4094
|
function () {
|
3842
|
-
var _getGrantFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4095
|
+
var _getGrantFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(consultationId) {
|
3843
4096
|
var grants;
|
3844
|
-
return _regeneratorRuntime().wrap(function
|
4097
|
+
return _regeneratorRuntime().wrap(function _callee29$(_context30) {
|
3845
4098
|
while (1) {
|
3846
|
-
switch (
|
4099
|
+
switch (_context30.prev = _context30.next) {
|
3847
4100
|
case 0:
|
3848
|
-
|
4101
|
+
_context30.next = 2;
|
3849
4102
|
return this.getGrants({
|
3850
4103
|
consultationId: consultationId
|
3851
4104
|
});
|
3852
4105
|
|
3853
4106
|
case 2:
|
3854
|
-
grants =
|
4107
|
+
grants = _context30.sent;
|
3855
4108
|
|
3856
4109
|
if (!(grants.length === 0)) {
|
3857
|
-
|
4110
|
+
_context30.next = 5;
|
3858
4111
|
break;
|
3859
4112
|
}
|
3860
4113
|
|
3861
4114
|
throw AssociatedLockboxNotFound;
|
3862
4115
|
|
3863
4116
|
case 5:
|
3864
|
-
return
|
4117
|
+
return _context30.abrupt("return", grants[0]);
|
3865
4118
|
|
3866
4119
|
case 6:
|
3867
4120
|
case "end":
|
3868
|
-
return
|
4121
|
+
return _context30.stop();
|
3869
4122
|
}
|
3870
4123
|
}
|
3871
|
-
},
|
4124
|
+
}, _callee29, this);
|
3872
4125
|
}));
|
3873
4126
|
|
3874
|
-
function getGrantFromConsultId(
|
4127
|
+
function getGrantFromConsultId(_x82) {
|
3875
4128
|
return _getGrantFromConsultId.apply(this, arguments);
|
3876
4129
|
}
|
3877
4130
|
|
@@ -3887,41 +4140,41 @@ var OroClient = /*#__PURE__*/function () {
|
|
3887
4140
|
_proto.getIdentityFromConsultId =
|
3888
4141
|
/*#__PURE__*/
|
3889
4142
|
function () {
|
3890
|
-
var _getIdentityFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4143
|
+
var _getIdentityFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(consultationId) {
|
3891
4144
|
var grant;
|
3892
|
-
return _regeneratorRuntime().wrap(function
|
4145
|
+
return _regeneratorRuntime().wrap(function _callee30$(_context31) {
|
3893
4146
|
while (1) {
|
3894
|
-
switch (
|
4147
|
+
switch (_context31.prev = _context31.next) {
|
3895
4148
|
case 0:
|
3896
|
-
|
4149
|
+
_context31.next = 2;
|
3897
4150
|
return this.getGrantFromConsultId(consultationId);
|
3898
4151
|
|
3899
4152
|
case 2:
|
3900
|
-
grant =
|
4153
|
+
grant = _context31.sent;
|
3901
4154
|
|
3902
4155
|
if (!(grant && grant.lockboxOwnerUuid)) {
|
3903
|
-
|
4156
|
+
_context31.next = 9;
|
3904
4157
|
break;
|
3905
4158
|
}
|
3906
4159
|
|
3907
|
-
|
4160
|
+
_context31.next = 6;
|
3908
4161
|
return this.guardClient.identityGet(grant.lockboxOwnerUuid);
|
3909
4162
|
|
3910
4163
|
case 6:
|
3911
|
-
return
|
4164
|
+
return _context31.abrupt("return", _context31.sent);
|
3912
4165
|
|
3913
4166
|
case 9:
|
3914
|
-
return
|
4167
|
+
return _context31.abrupt("return", undefined);
|
3915
4168
|
|
3916
4169
|
case 10:
|
3917
4170
|
case "end":
|
3918
|
-
return
|
4171
|
+
return _context31.stop();
|
3919
4172
|
}
|
3920
4173
|
}
|
3921
|
-
},
|
4174
|
+
}, _callee30, this);
|
3922
4175
|
}));
|
3923
4176
|
|
3924
|
-
function getIdentityFromConsultId(
|
4177
|
+
function getIdentityFromConsultId(_x83) {
|
3925
4178
|
return _getIdentityFromConsultId.apply(this, arguments);
|
3926
4179
|
}
|
3927
4180
|
|
@@ -3942,16 +4195,18 @@ var OroClient = /*#__PURE__*/function () {
|
|
3942
4195
|
_proto.getLockboxManifest =
|
3943
4196
|
/*#__PURE__*/
|
3944
4197
|
function () {
|
3945
|
-
var _getLockboxManifest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4198
|
+
var _getLockboxManifest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(lockboxUuid, filter, expandPrivateMetadata, lockboxOwnerUuid, options) {
|
3946
4199
|
var _this3 = this;
|
3947
4200
|
|
3948
4201
|
var manifestKey;
|
3949
|
-
return _regeneratorRuntime().wrap(function
|
4202
|
+
return _regeneratorRuntime().wrap(function _callee32$(_context33) {
|
3950
4203
|
while (1) {
|
3951
|
-
switch (
|
4204
|
+
switch (_context33.prev = _context33.next) {
|
3952
4205
|
case 0:
|
3953
|
-
if (
|
3954
|
-
|
4206
|
+
if (options === void 0) {
|
4207
|
+
options = {
|
4208
|
+
forceRefresh: false
|
4209
|
+
};
|
3955
4210
|
}
|
3956
4211
|
|
3957
4212
|
manifestKey = JSON.stringify({
|
@@ -3961,46 +4216,46 @@ var OroClient = /*#__PURE__*/function () {
|
|
3961
4216
|
lockboxOwnerUuid: lockboxOwnerUuid
|
3962
4217
|
});
|
3963
4218
|
|
3964
|
-
if (!(!forceRefresh && this.cachedManifest[manifestKey])) {
|
3965
|
-
|
4219
|
+
if (!(!options.forceRefresh && this.cachedManifest[manifestKey])) {
|
4220
|
+
_context33.next = 4;
|
3966
4221
|
break;
|
3967
4222
|
}
|
3968
4223
|
|
3969
|
-
return
|
4224
|
+
return _context33.abrupt("return", this.cachedManifest[manifestKey]);
|
3970
4225
|
|
3971
4226
|
case 4:
|
3972
|
-
return
|
4227
|
+
return _context33.abrupt("return", this.vaultClient.lockboxManifestGet(lockboxUuid, filter, lockboxOwnerUuid).then(function (manifest) {
|
3973
4228
|
return Promise.all(manifest.map( /*#__PURE__*/function () {
|
3974
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4229
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(entry) {
|
3975
4230
|
var privateMeta;
|
3976
|
-
return _regeneratorRuntime().wrap(function
|
4231
|
+
return _regeneratorRuntime().wrap(function _callee31$(_context32) {
|
3977
4232
|
while (1) {
|
3978
|
-
switch (
|
4233
|
+
switch (_context32.prev = _context32.next) {
|
3979
4234
|
case 0:
|
3980
4235
|
if (!(expandPrivateMetadata && entry.metadata.privateMetadata)) {
|
3981
|
-
|
4236
|
+
_context32.next = 5;
|
3982
4237
|
break;
|
3983
4238
|
}
|
3984
4239
|
|
3985
|
-
|
4240
|
+
_context32.next = 3;
|
3986
4241
|
return _this3.getJsonData(lockboxUuid, entry.metadata.privateMetadata, lockboxOwnerUuid);
|
3987
4242
|
|
3988
4243
|
case 3:
|
3989
|
-
privateMeta =
|
4244
|
+
privateMeta = _context32.sent;
|
3990
4245
|
entry.metadata = _extends({}, entry.metadata, privateMeta);
|
3991
4246
|
|
3992
4247
|
case 5:
|
3993
|
-
return
|
4248
|
+
return _context32.abrupt("return", entry);
|
3994
4249
|
|
3995
4250
|
case 6:
|
3996
4251
|
case "end":
|
3997
|
-
return
|
4252
|
+
return _context32.stop();
|
3998
4253
|
}
|
3999
4254
|
}
|
4000
|
-
},
|
4255
|
+
}, _callee31);
|
4001
4256
|
}));
|
4002
4257
|
|
4003
|
-
return function (
|
4258
|
+
return function (_x89) {
|
4004
4259
|
return _ref4.apply(this, arguments);
|
4005
4260
|
};
|
4006
4261
|
}())).then(function (manifest) {
|
@@ -4010,13 +4265,13 @@ var OroClient = /*#__PURE__*/function () {
|
|
4010
4265
|
|
4011
4266
|
case 5:
|
4012
4267
|
case "end":
|
4013
|
-
return
|
4268
|
+
return _context33.stop();
|
4014
4269
|
}
|
4015
4270
|
}
|
4016
|
-
},
|
4271
|
+
}, _callee32, this);
|
4017
4272
|
}));
|
4018
4273
|
|
4019
|
-
function getLockboxManifest(
|
4274
|
+
function getLockboxManifest(_x84, _x85, _x86, _x87, _x88) {
|
4020
4275
|
return _getLockboxManifest.apply(this, arguments);
|
4021
4276
|
}
|
4022
4277
|
|
@@ -4034,43 +4289,43 @@ var OroClient = /*#__PURE__*/function () {
|
|
4034
4289
|
_proto.createPersonalInformations =
|
4035
4290
|
/*#__PURE__*/
|
4036
4291
|
function () {
|
4037
|
-
var _createPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4292
|
+
var _createPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(identity, data, dataUuid) {
|
4038
4293
|
var _yield$this$getGrants;
|
4039
4294
|
|
4040
4295
|
var lockboxUuid;
|
4041
|
-
return _regeneratorRuntime().wrap(function
|
4296
|
+
return _regeneratorRuntime().wrap(function _callee33$(_context34) {
|
4042
4297
|
while (1) {
|
4043
|
-
switch (
|
4298
|
+
switch (_context34.prev = _context34.next) {
|
4044
4299
|
case 0:
|
4045
|
-
|
4300
|
+
_context34.next = 2;
|
4046
4301
|
return this.getGrants();
|
4047
4302
|
|
4048
4303
|
case 2:
|
4049
|
-
|
4304
|
+
_context34.t0 = _yield$this$getGrants = _context34.sent.find(function (lockbox) {
|
4050
4305
|
return lockbox.lockboxOwnerUuid === identity.id;
|
4051
4306
|
});
|
4052
4307
|
|
4053
|
-
if (!(
|
4054
|
-
|
4308
|
+
if (!(_context34.t0 == null)) {
|
4309
|
+
_context34.next = 7;
|
4055
4310
|
break;
|
4056
4311
|
}
|
4057
4312
|
|
4058
|
-
|
4059
|
-
|
4313
|
+
_context34.t1 = void 0;
|
4314
|
+
_context34.next = 8;
|
4060
4315
|
break;
|
4061
4316
|
|
4062
4317
|
case 7:
|
4063
|
-
|
4318
|
+
_context34.t1 = _yield$this$getGrants.lockboxUuid;
|
4064
4319
|
|
4065
4320
|
case 8:
|
4066
|
-
lockboxUuid =
|
4321
|
+
lockboxUuid = _context34.t1;
|
4067
4322
|
|
4068
4323
|
if (!lockboxUuid) {
|
4069
|
-
|
4324
|
+
_context34.next = 13;
|
4070
4325
|
break;
|
4071
4326
|
}
|
4072
4327
|
|
4073
|
-
return
|
4328
|
+
return _context34.abrupt("return", this.createJsonData(lockboxUuid, data, {
|
4074
4329
|
category: MetadataCategory.Personal,
|
4075
4330
|
documentType: DocumentType.PopulatedWorkflowData
|
4076
4331
|
}, {}, undefined, dataUuid));
|
@@ -4080,13 +4335,13 @@ var OroClient = /*#__PURE__*/function () {
|
|
4080
4335
|
|
4081
4336
|
case 14:
|
4082
4337
|
case "end":
|
4083
|
-
return
|
4338
|
+
return _context34.stop();
|
4084
4339
|
}
|
4085
4340
|
}
|
4086
|
-
},
|
4341
|
+
}, _callee33, this);
|
4087
4342
|
}));
|
4088
4343
|
|
4089
|
-
function createPersonalInformations(
|
4344
|
+
function createPersonalInformations(_x90, _x91, _x92) {
|
4090
4345
|
return _createPersonalInformations.apply(this, arguments);
|
4091
4346
|
}
|
4092
4347
|
|
@@ -4104,43 +4359,43 @@ var OroClient = /*#__PURE__*/function () {
|
|
4104
4359
|
_proto.createUserPreference =
|
4105
4360
|
/*#__PURE__*/
|
4106
4361
|
function () {
|
4107
|
-
var _createUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4362
|
+
var _createUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(identity, preference, dataUuid) {
|
4108
4363
|
var _yield$this$getGrants2;
|
4109
4364
|
|
4110
4365
|
var lockboxUuid;
|
4111
|
-
return _regeneratorRuntime().wrap(function
|
4366
|
+
return _regeneratorRuntime().wrap(function _callee34$(_context35) {
|
4112
4367
|
while (1) {
|
4113
|
-
switch (
|
4368
|
+
switch (_context35.prev = _context35.next) {
|
4114
4369
|
case 0:
|
4115
|
-
|
4370
|
+
_context35.next = 2;
|
4116
4371
|
return this.getGrants();
|
4117
4372
|
|
4118
4373
|
case 2:
|
4119
|
-
|
4374
|
+
_context35.t0 = _yield$this$getGrants2 = _context35.sent.find(function (lockbox) {
|
4120
4375
|
return lockbox.lockboxOwnerUuid === identity.id;
|
4121
4376
|
});
|
4122
4377
|
|
4123
|
-
if (!(
|
4124
|
-
|
4378
|
+
if (!(_context35.t0 == null)) {
|
4379
|
+
_context35.next = 7;
|
4125
4380
|
break;
|
4126
4381
|
}
|
4127
4382
|
|
4128
|
-
|
4129
|
-
|
4383
|
+
_context35.t1 = void 0;
|
4384
|
+
_context35.next = 8;
|
4130
4385
|
break;
|
4131
4386
|
|
4132
4387
|
case 7:
|
4133
|
-
|
4388
|
+
_context35.t1 = _yield$this$getGrants2.lockboxUuid;
|
4134
4389
|
|
4135
4390
|
case 8:
|
4136
|
-
lockboxUuid =
|
4391
|
+
lockboxUuid = _context35.t1;
|
4137
4392
|
|
4138
4393
|
if (!lockboxUuid) {
|
4139
|
-
|
4394
|
+
_context35.next = 13;
|
4140
4395
|
break;
|
4141
4396
|
}
|
4142
4397
|
|
4143
|
-
return
|
4398
|
+
return _context35.abrupt("return", this.createJsonData(lockboxUuid, preference, {
|
4144
4399
|
category: MetadataCategory.Preference,
|
4145
4400
|
contentType: 'application/json'
|
4146
4401
|
}, {}, undefined, dataUuid));
|
@@ -4150,13 +4405,13 @@ var OroClient = /*#__PURE__*/function () {
|
|
4150
4405
|
|
4151
4406
|
case 14:
|
4152
4407
|
case "end":
|
4153
|
-
return
|
4408
|
+
return _context35.stop();
|
4154
4409
|
}
|
4155
4410
|
}
|
4156
|
-
},
|
4411
|
+
}, _callee34, this);
|
4157
4412
|
}));
|
4158
4413
|
|
4159
|
-
function createUserPreference(
|
4414
|
+
function createUserPreference(_x93, _x94, _x95) {
|
4160
4415
|
return _createUserPreference.apply(this, arguments);
|
4161
4416
|
}
|
4162
4417
|
|
@@ -4172,16 +4427,16 @@ var OroClient = /*#__PURE__*/function () {
|
|
4172
4427
|
_proto.getDataFromGrant =
|
4173
4428
|
/*#__PURE__*/
|
4174
4429
|
function () {
|
4175
|
-
var _getDataFromGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4430
|
+
var _getDataFromGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(grant, filter) {
|
4176
4431
|
var lockboxUuid, lockboxOwnerUuid, identificationDataUuid;
|
4177
|
-
return _regeneratorRuntime().wrap(function
|
4432
|
+
return _regeneratorRuntime().wrap(function _callee35$(_context36) {
|
4178
4433
|
while (1) {
|
4179
|
-
switch (
|
4434
|
+
switch (_context36.prev = _context36.next) {
|
4180
4435
|
case 0:
|
4181
4436
|
lockboxUuid = grant.lockboxUuid, lockboxOwnerUuid = grant.lockboxOwnerUuid;
|
4182
4437
|
|
4183
4438
|
if (lockboxUuid) {
|
4184
|
-
|
4439
|
+
_context36.next = 3;
|
4185
4440
|
break;
|
4186
4441
|
}
|
4187
4442
|
|
@@ -4189,42 +4444,44 @@ var OroClient = /*#__PURE__*/function () {
|
|
4189
4444
|
|
4190
4445
|
case 3:
|
4191
4446
|
if (lockboxOwnerUuid) {
|
4192
|
-
|
4447
|
+
_context36.next = 5;
|
4193
4448
|
break;
|
4194
4449
|
}
|
4195
4450
|
|
4196
4451
|
throw MissingLockboxOwner;
|
4197
4452
|
|
4198
4453
|
case 5:
|
4199
|
-
|
4200
|
-
return this.getLockboxManifest(lockboxUuid, filter, false, grant.lockboxOwnerUuid,
|
4454
|
+
_context36.next = 7;
|
4455
|
+
return this.getLockboxManifest(lockboxUuid, filter, false, grant.lockboxOwnerUuid, {
|
4456
|
+
forceRefresh: true
|
4457
|
+
});
|
4201
4458
|
|
4202
4459
|
case 7:
|
4203
|
-
identificationDataUuid =
|
4204
|
-
|
4205
|
-
|
4206
|
-
|
4207
|
-
|
4460
|
+
identificationDataUuid = _context36.sent[0].dataUuid;
|
4461
|
+
_context36.t0 = lockboxOwnerUuid;
|
4462
|
+
_context36.t1 = lockboxUuid;
|
4463
|
+
_context36.t2 = identificationDataUuid;
|
4464
|
+
_context36.next = 13;
|
4208
4465
|
return this.getJsonData(lockboxUuid, identificationDataUuid);
|
4209
4466
|
|
4210
4467
|
case 13:
|
4211
|
-
|
4212
|
-
return
|
4213
|
-
lockboxOwnerUuid:
|
4214
|
-
lockboxUuid:
|
4215
|
-
dataUuid:
|
4216
|
-
data:
|
4468
|
+
_context36.t3 = _context36.sent;
|
4469
|
+
return _context36.abrupt("return", {
|
4470
|
+
lockboxOwnerUuid: _context36.t0,
|
4471
|
+
lockboxUuid: _context36.t1,
|
4472
|
+
dataUuid: _context36.t2,
|
4473
|
+
data: _context36.t3
|
4217
4474
|
});
|
4218
4475
|
|
4219
4476
|
case 15:
|
4220
4477
|
case "end":
|
4221
|
-
return
|
4478
|
+
return _context36.stop();
|
4222
4479
|
}
|
4223
4480
|
}
|
4224
|
-
},
|
4481
|
+
}, _callee35, this);
|
4225
4482
|
}));
|
4226
4483
|
|
4227
|
-
function getDataFromGrant(
|
4484
|
+
function getDataFromGrant(_x96, _x97) {
|
4228
4485
|
return _getDataFromGrant.apply(this, arguments);
|
4229
4486
|
}
|
4230
4487
|
|
@@ -4240,40 +4497,40 @@ var OroClient = /*#__PURE__*/function () {
|
|
4240
4497
|
_proto.getUserPreferenceFromConsultId =
|
4241
4498
|
/*#__PURE__*/
|
4242
4499
|
function () {
|
4243
|
-
var _getUserPreferenceFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4500
|
+
var _getUserPreferenceFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(consultationId) {
|
4244
4501
|
var grant;
|
4245
|
-
return _regeneratorRuntime().wrap(function
|
4502
|
+
return _regeneratorRuntime().wrap(function _callee36$(_context37) {
|
4246
4503
|
while (1) {
|
4247
|
-
switch (
|
4504
|
+
switch (_context37.prev = _context37.next) {
|
4248
4505
|
case 0:
|
4249
|
-
|
4506
|
+
_context37.next = 2;
|
4250
4507
|
return this.getGrantFromConsultId(consultationId);
|
4251
4508
|
|
4252
4509
|
case 2:
|
4253
|
-
grant =
|
4510
|
+
grant = _context37.sent;
|
4254
4511
|
|
4255
4512
|
if (grant) {
|
4256
|
-
|
4513
|
+
_context37.next = 5;
|
4257
4514
|
break;
|
4258
4515
|
}
|
4259
4516
|
|
4260
4517
|
throw MissingGrant;
|
4261
4518
|
|
4262
4519
|
case 5:
|
4263
|
-
return
|
4520
|
+
return _context37.abrupt("return", this.getDataFromGrant(grant, {
|
4264
4521
|
category: MetadataCategory.Preference,
|
4265
4522
|
contentType: 'application/json'
|
4266
4523
|
}));
|
4267
4524
|
|
4268
4525
|
case 6:
|
4269
4526
|
case "end":
|
4270
|
-
return
|
4527
|
+
return _context37.stop();
|
4271
4528
|
}
|
4272
4529
|
}
|
4273
|
-
},
|
4530
|
+
}, _callee36, this);
|
4274
4531
|
}));
|
4275
4532
|
|
4276
|
-
function getUserPreferenceFromConsultId(
|
4533
|
+
function getUserPreferenceFromConsultId(_x98) {
|
4277
4534
|
return _getUserPreferenceFromConsultId.apply(this, arguments);
|
4278
4535
|
}
|
4279
4536
|
|
@@ -4289,42 +4546,42 @@ var OroClient = /*#__PURE__*/function () {
|
|
4289
4546
|
_proto.getUserPreference =
|
4290
4547
|
/*#__PURE__*/
|
4291
4548
|
function () {
|
4292
|
-
var _getUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4549
|
+
var _getUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(identity) {
|
4293
4550
|
var grant;
|
4294
|
-
return _regeneratorRuntime().wrap(function
|
4551
|
+
return _regeneratorRuntime().wrap(function _callee37$(_context38) {
|
4295
4552
|
while (1) {
|
4296
|
-
switch (
|
4553
|
+
switch (_context38.prev = _context38.next) {
|
4297
4554
|
case 0:
|
4298
|
-
|
4555
|
+
_context38.next = 2;
|
4299
4556
|
return this.getGrants();
|
4300
4557
|
|
4301
4558
|
case 2:
|
4302
|
-
grant =
|
4559
|
+
grant = _context38.sent.find(function (lockbox) {
|
4303
4560
|
return lockbox.lockboxOwnerUuid === identity.id;
|
4304
4561
|
});
|
4305
4562
|
|
4306
4563
|
if (grant) {
|
4307
|
-
|
4564
|
+
_context38.next = 5;
|
4308
4565
|
break;
|
4309
4566
|
}
|
4310
4567
|
|
4311
4568
|
throw MissingGrant;
|
4312
4569
|
|
4313
4570
|
case 5:
|
4314
|
-
return
|
4571
|
+
return _context38.abrupt("return", this.getDataFromGrant(grant, {
|
4315
4572
|
category: MetadataCategory.Preference,
|
4316
4573
|
contentType: 'application/json'
|
4317
4574
|
}));
|
4318
4575
|
|
4319
4576
|
case 6:
|
4320
4577
|
case "end":
|
4321
|
-
return
|
4578
|
+
return _context38.stop();
|
4322
4579
|
}
|
4323
4580
|
}
|
4324
|
-
},
|
4581
|
+
}, _callee37, this);
|
4325
4582
|
}));
|
4326
4583
|
|
4327
|
-
function getUserPreference(
|
4584
|
+
function getUserPreference(_x99) {
|
4328
4585
|
return _getUserPreference.apply(this, arguments);
|
4329
4586
|
}
|
4330
4587
|
|
@@ -4340,40 +4597,40 @@ var OroClient = /*#__PURE__*/function () {
|
|
4340
4597
|
_proto.getRecoveryDataFromConsultId =
|
4341
4598
|
/*#__PURE__*/
|
4342
4599
|
function () {
|
4343
|
-
var _getRecoveryDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4600
|
+
var _getRecoveryDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(consultationId) {
|
4344
4601
|
var grant;
|
4345
|
-
return _regeneratorRuntime().wrap(function
|
4602
|
+
return _regeneratorRuntime().wrap(function _callee38$(_context39) {
|
4346
4603
|
while (1) {
|
4347
|
-
switch (
|
4604
|
+
switch (_context39.prev = _context39.next) {
|
4348
4605
|
case 0:
|
4349
|
-
|
4606
|
+
_context39.next = 2;
|
4350
4607
|
return this.getGrantFromConsultId(consultationId);
|
4351
4608
|
|
4352
4609
|
case 2:
|
4353
|
-
grant =
|
4610
|
+
grant = _context39.sent;
|
4354
4611
|
|
4355
4612
|
if (grant) {
|
4356
|
-
|
4613
|
+
_context39.next = 5;
|
4357
4614
|
break;
|
4358
4615
|
}
|
4359
4616
|
|
4360
4617
|
throw MissingGrant;
|
4361
4618
|
|
4362
4619
|
case 5:
|
4363
|
-
return
|
4620
|
+
return _context39.abrupt("return", this.getDataFromGrant(grant, {
|
4364
4621
|
category: MetadataCategory.Recovery,
|
4365
4622
|
contentType: 'application/json'
|
4366
4623
|
}));
|
4367
4624
|
|
4368
4625
|
case 6:
|
4369
4626
|
case "end":
|
4370
|
-
return
|
4627
|
+
return _context39.stop();
|
4371
4628
|
}
|
4372
4629
|
}
|
4373
|
-
},
|
4630
|
+
}, _callee38, this);
|
4374
4631
|
}));
|
4375
4632
|
|
4376
|
-
function getRecoveryDataFromConsultId(
|
4633
|
+
function getRecoveryDataFromConsultId(_x100) {
|
4377
4634
|
return _getRecoveryDataFromConsultId.apply(this, arguments);
|
4378
4635
|
}
|
4379
4636
|
|
@@ -4389,42 +4646,42 @@ var OroClient = /*#__PURE__*/function () {
|
|
4389
4646
|
_proto.getRecoveryData =
|
4390
4647
|
/*#__PURE__*/
|
4391
4648
|
function () {
|
4392
|
-
var _getRecoveryData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4649
|
+
var _getRecoveryData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(identity) {
|
4393
4650
|
var grant;
|
4394
|
-
return _regeneratorRuntime().wrap(function
|
4651
|
+
return _regeneratorRuntime().wrap(function _callee39$(_context40) {
|
4395
4652
|
while (1) {
|
4396
|
-
switch (
|
4653
|
+
switch (_context40.prev = _context40.next) {
|
4397
4654
|
case 0:
|
4398
|
-
|
4655
|
+
_context40.next = 2;
|
4399
4656
|
return this.getGrants();
|
4400
4657
|
|
4401
4658
|
case 2:
|
4402
|
-
grant =
|
4659
|
+
grant = _context40.sent.find(function (lockbox) {
|
4403
4660
|
return lockbox.lockboxOwnerUuid === identity.id;
|
4404
4661
|
});
|
4405
4662
|
|
4406
4663
|
if (grant) {
|
4407
|
-
|
4664
|
+
_context40.next = 5;
|
4408
4665
|
break;
|
4409
4666
|
}
|
4410
4667
|
|
4411
4668
|
throw MissingGrant;
|
4412
4669
|
|
4413
4670
|
case 5:
|
4414
|
-
return
|
4671
|
+
return _context40.abrupt("return", this.getDataFromGrant(grant, {
|
4415
4672
|
category: MetadataCategory.Recovery,
|
4416
4673
|
contentType: 'application/json'
|
4417
4674
|
}));
|
4418
4675
|
|
4419
4676
|
case 6:
|
4420
4677
|
case "end":
|
4421
|
-
return
|
4678
|
+
return _context40.stop();
|
4422
4679
|
}
|
4423
4680
|
}
|
4424
|
-
},
|
4681
|
+
}, _callee39, this);
|
4425
4682
|
}));
|
4426
4683
|
|
4427
|
-
function getRecoveryData(
|
4684
|
+
function getRecoveryData(_x101) {
|
4428
4685
|
return _getRecoveryData.apply(this, arguments);
|
4429
4686
|
}
|
4430
4687
|
|
@@ -4445,44 +4702,44 @@ var OroClient = /*#__PURE__*/function () {
|
|
4445
4702
|
_proto.getAssignedConsultations =
|
4446
4703
|
/*#__PURE__*/
|
4447
4704
|
function () {
|
4448
|
-
var _getAssignedConsultations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4705
|
+
var _getAssignedConsultations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(practiceUuid) {
|
4449
4706
|
var _this4 = this;
|
4450
4707
|
|
4451
|
-
return _regeneratorRuntime().wrap(function
|
4708
|
+
return _regeneratorRuntime().wrap(function _callee41$(_context42) {
|
4452
4709
|
while (1) {
|
4453
|
-
switch (
|
4710
|
+
switch (_context42.prev = _context42.next) {
|
4454
4711
|
case 0:
|
4455
|
-
|
4456
|
-
|
4712
|
+
_context42.t0 = Promise;
|
4713
|
+
_context42.next = 3;
|
4457
4714
|
return this.getGrants();
|
4458
4715
|
|
4459
4716
|
case 3:
|
4460
|
-
|
4717
|
+
_context42.t1 = _context42.sent.map(function (grant) {
|
4461
4718
|
return _this4.getLockboxManifest(grant.lockboxUuid, {
|
4462
4719
|
category: MetadataCategory.Consultation,
|
4463
4720
|
documentType: DocumentType.PopulatedWorkflowData
|
4464
4721
|
}, true, undefined).then(function (manifest) {
|
4465
4722
|
return Promise.all(manifest.map( /*#__PURE__*/function () {
|
4466
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4467
|
-
return _regeneratorRuntime().wrap(function
|
4723
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(entry) {
|
4724
|
+
return _regeneratorRuntime().wrap(function _callee40$(_context41) {
|
4468
4725
|
while (1) {
|
4469
|
-
switch (
|
4726
|
+
switch (_context41.prev = _context41.next) {
|
4470
4727
|
case 0:
|
4471
|
-
|
4728
|
+
_context41.next = 2;
|
4472
4729
|
return _this4.consultClient.getConsultByUUID(entry.metadata.consultationId, practiceUuid);
|
4473
4730
|
|
4474
4731
|
case 2:
|
4475
|
-
return
|
4732
|
+
return _context41.abrupt("return", _context41.sent);
|
4476
4733
|
|
4477
4734
|
case 3:
|
4478
4735
|
case "end":
|
4479
|
-
return
|
4736
|
+
return _context41.stop();
|
4480
4737
|
}
|
4481
4738
|
}
|
4482
|
-
},
|
4739
|
+
}, _callee40);
|
4483
4740
|
}));
|
4484
4741
|
|
4485
|
-
return function (
|
4742
|
+
return function (_x103) {
|
4486
4743
|
return _ref5.apply(this, arguments);
|
4487
4744
|
};
|
4488
4745
|
}())).then(function (promise) {
|
@@ -4490,19 +4747,19 @@ var OroClient = /*#__PURE__*/function () {
|
|
4490
4747
|
});
|
4491
4748
|
});
|
4492
4749
|
});
|
4493
|
-
return
|
4750
|
+
return _context42.abrupt("return", _context42.t0.all.call(_context42.t0, _context42.t1).then(function (consults) {
|
4494
4751
|
return consults.flat();
|
4495
4752
|
}));
|
4496
4753
|
|
4497
4754
|
case 5:
|
4498
4755
|
case "end":
|
4499
|
-
return
|
4756
|
+
return _context42.stop();
|
4500
4757
|
}
|
4501
4758
|
}
|
4502
|
-
},
|
4759
|
+
}, _callee41, this);
|
4503
4760
|
}));
|
4504
4761
|
|
4505
|
-
function getAssignedConsultations(
|
4762
|
+
function getAssignedConsultations(_x102) {
|
4506
4763
|
return _getAssignedConsultations.apply(this, arguments);
|
4507
4764
|
}
|
4508
4765
|
|
@@ -4518,85 +4775,85 @@ var OroClient = /*#__PURE__*/function () {
|
|
4518
4775
|
_proto.getPastConsultationsFromConsultId =
|
4519
4776
|
/*#__PURE__*/
|
4520
4777
|
function () {
|
4521
|
-
var _getPastConsultationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4778
|
+
var _getPastConsultationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(consultationId, practiceUuid) {
|
4522
4779
|
var _this5 = this;
|
4523
4780
|
|
4524
4781
|
var grant, consultationsInLockbox;
|
4525
|
-
return _regeneratorRuntime().wrap(function
|
4782
|
+
return _regeneratorRuntime().wrap(function _callee43$(_context44) {
|
4526
4783
|
while (1) {
|
4527
|
-
switch (
|
4784
|
+
switch (_context44.prev = _context44.next) {
|
4528
4785
|
case 0:
|
4529
|
-
|
4786
|
+
_context44.next = 2;
|
4530
4787
|
return this.getGrantFromConsultId(consultationId);
|
4531
4788
|
|
4532
4789
|
case 2:
|
4533
|
-
grant =
|
4790
|
+
grant = _context44.sent;
|
4534
4791
|
|
4535
4792
|
if (grant) {
|
4536
|
-
|
4793
|
+
_context44.next = 5;
|
4537
4794
|
break;
|
4538
4795
|
}
|
4539
4796
|
|
4540
|
-
return
|
4797
|
+
return _context44.abrupt("return", undefined);
|
4541
4798
|
|
4542
4799
|
case 5:
|
4543
|
-
|
4800
|
+
_context44.next = 7;
|
4544
4801
|
return this.vaultClient.lockboxMetadataGet(grant.lockboxUuid, ['consultationId'], ['consultationId'], {
|
4545
4802
|
category: MetadataCategory.Consultation,
|
4546
4803
|
documentType: DocumentType.PopulatedWorkflowData
|
4547
4804
|
}, grant.lockboxOwnerUuid);
|
4548
4805
|
|
4549
4806
|
case 7:
|
4550
|
-
consultationsInLockbox =
|
4807
|
+
consultationsInLockbox = _context44.sent.flat().map(function (metadata) {
|
4551
4808
|
return metadata.consultationId;
|
4552
4809
|
});
|
4553
4810
|
|
4554
4811
|
if (!(consultationsInLockbox.length == 0)) {
|
4555
|
-
|
4812
|
+
_context44.next = 10;
|
4556
4813
|
break;
|
4557
4814
|
}
|
4558
4815
|
|
4559
|
-
return
|
4816
|
+
return _context44.abrupt("return", []);
|
4560
4817
|
|
4561
4818
|
case 10:
|
4562
|
-
|
4819
|
+
_context44.next = 12;
|
4563
4820
|
return Promise.all(consultationsInLockbox.map( /*#__PURE__*/function () {
|
4564
|
-
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4565
|
-
return _regeneratorRuntime().wrap(function
|
4821
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(consultId) {
|
4822
|
+
return _regeneratorRuntime().wrap(function _callee42$(_context43) {
|
4566
4823
|
while (1) {
|
4567
|
-
switch (
|
4824
|
+
switch (_context43.prev = _context43.next) {
|
4568
4825
|
case 0:
|
4569
|
-
|
4826
|
+
_context43.next = 2;
|
4570
4827
|
return _this5.consultClient.getConsultByUUID(consultId, practiceUuid);
|
4571
4828
|
|
4572
4829
|
case 2:
|
4573
|
-
return
|
4830
|
+
return _context43.abrupt("return", _context43.sent);
|
4574
4831
|
|
4575
4832
|
case 3:
|
4576
4833
|
case "end":
|
4577
|
-
return
|
4834
|
+
return _context43.stop();
|
4578
4835
|
}
|
4579
4836
|
}
|
4580
|
-
},
|
4837
|
+
}, _callee42);
|
4581
4838
|
}));
|
4582
4839
|
|
4583
|
-
return function (
|
4840
|
+
return function (_x106) {
|
4584
4841
|
return _ref6.apply(this, arguments);
|
4585
4842
|
};
|
4586
4843
|
}()));
|
4587
4844
|
|
4588
4845
|
case 12:
|
4589
|
-
return
|
4846
|
+
return _context44.abrupt("return", _context44.sent);
|
4590
4847
|
|
4591
4848
|
case 13:
|
4592
4849
|
case "end":
|
4593
|
-
return
|
4850
|
+
return _context44.stop();
|
4594
4851
|
}
|
4595
4852
|
}
|
4596
|
-
},
|
4853
|
+
}, _callee43, this);
|
4597
4854
|
}));
|
4598
4855
|
|
4599
|
-
function getPastConsultationsFromConsultId(
|
4856
|
+
function getPastConsultationsFromConsultId(_x104, _x105) {
|
4600
4857
|
return _getPastConsultationsFromConsultId.apply(this, arguments);
|
4601
4858
|
}
|
4602
4859
|
|
@@ -4613,48 +4870,50 @@ var OroClient = /*#__PURE__*/function () {
|
|
4613
4870
|
_proto.getPatientConsultationData =
|
4614
4871
|
/*#__PURE__*/
|
4615
4872
|
function () {
|
4616
|
-
var _getPatientConsultationData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4873
|
+
var _getPatientConsultationData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(consultationId, options) {
|
4617
4874
|
var _this6 = this;
|
4618
4875
|
|
4619
|
-
return _regeneratorRuntime().wrap(function
|
4876
|
+
return _regeneratorRuntime().wrap(function _callee44$(_context45) {
|
4620
4877
|
while (1) {
|
4621
|
-
switch (
|
4878
|
+
switch (_context45.prev = _context45.next) {
|
4622
4879
|
case 0:
|
4623
|
-
if (
|
4624
|
-
|
4880
|
+
if (options === void 0) {
|
4881
|
+
options = {
|
4882
|
+
forceRefresh: false
|
4883
|
+
};
|
4625
4884
|
}
|
4626
4885
|
|
4627
|
-
|
4628
|
-
|
4886
|
+
_context45.t0 = Promise;
|
4887
|
+
_context45.next = 4;
|
4629
4888
|
return this.getGrants({
|
4630
4889
|
consultationId: consultationId
|
4631
4890
|
});
|
4632
4891
|
|
4633
4892
|
case 4:
|
4634
|
-
|
4893
|
+
_context45.t1 = _context45.sent.map(function (grant) {
|
4635
4894
|
return _this6.getLockboxManifest(grant.lockboxUuid, {
|
4636
4895
|
category: MetadataCategory.Consultation,
|
4637
4896
|
documentType: DocumentType.PopulatedWorkflowData,
|
4638
4897
|
consultationId: consultationId
|
4639
|
-
}, true, grant.lockboxOwnerUuid,
|
4898
|
+
}, true, grant.lockboxOwnerUuid, options).then(function (manifest) {
|
4640
4899
|
return Promise.all(manifest.map(function (e) {
|
4641
4900
|
return _this6.getJsonData(grant.lockboxUuid, e.dataUuid, grant.lockboxOwnerUuid);
|
4642
4901
|
}));
|
4643
4902
|
});
|
4644
4903
|
}).flat();
|
4645
|
-
return
|
4904
|
+
return _context45.abrupt("return", _context45.t0.all.call(_context45.t0, _context45.t1).then(function (data) {
|
4646
4905
|
return data.flat();
|
4647
4906
|
}));
|
4648
4907
|
|
4649
4908
|
case 6:
|
4650
4909
|
case "end":
|
4651
|
-
return
|
4910
|
+
return _context45.stop();
|
4652
4911
|
}
|
4653
4912
|
}
|
4654
|
-
},
|
4913
|
+
}, _callee44, this);
|
4655
4914
|
}));
|
4656
4915
|
|
4657
|
-
function getPatientConsultationData(
|
4916
|
+
function getPatientConsultationData(_x107, _x108) {
|
4658
4917
|
return _getPatientConsultationData.apply(this, arguments);
|
4659
4918
|
}
|
4660
4919
|
|
@@ -4670,25 +4929,25 @@ var OroClient = /*#__PURE__*/function () {
|
|
4670
4929
|
_proto.getPatientPrescriptionsList =
|
4671
4930
|
/*#__PURE__*/
|
4672
4931
|
function () {
|
4673
|
-
var _getPatientPrescriptionsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4674
|
-
return _regeneratorRuntime().wrap(function
|
4932
|
+
var _getPatientPrescriptionsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(consultationId) {
|
4933
|
+
return _regeneratorRuntime().wrap(function _callee45$(_context46) {
|
4675
4934
|
while (1) {
|
4676
|
-
switch (
|
4935
|
+
switch (_context46.prev = _context46.next) {
|
4677
4936
|
case 0:
|
4678
|
-
return
|
4937
|
+
return _context46.abrupt("return", this.getPatientDocumentsList({
|
4679
4938
|
category: MetadataCategory.Consultation,
|
4680
4939
|
documentType: DocumentType.Prescription
|
4681
4940
|
}, true, consultationId));
|
4682
4941
|
|
4683
4942
|
case 1:
|
4684
4943
|
case "end":
|
4685
|
-
return
|
4944
|
+
return _context46.stop();
|
4686
4945
|
}
|
4687
4946
|
}
|
4688
|
-
},
|
4947
|
+
}, _callee45, this);
|
4689
4948
|
}));
|
4690
4949
|
|
4691
|
-
function getPatientPrescriptionsList(
|
4950
|
+
function getPatientPrescriptionsList(_x109) {
|
4692
4951
|
return _getPatientPrescriptionsList.apply(this, arguments);
|
4693
4952
|
}
|
4694
4953
|
|
@@ -4704,25 +4963,25 @@ var OroClient = /*#__PURE__*/function () {
|
|
4704
4963
|
_proto.getPatientResultsList =
|
4705
4964
|
/*#__PURE__*/
|
4706
4965
|
function () {
|
4707
|
-
var _getPatientResultsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4708
|
-
return _regeneratorRuntime().wrap(function
|
4966
|
+
var _getPatientResultsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(consultationId) {
|
4967
|
+
return _regeneratorRuntime().wrap(function _callee46$(_context47) {
|
4709
4968
|
while (1) {
|
4710
|
-
switch (
|
4969
|
+
switch (_context47.prev = _context47.next) {
|
4711
4970
|
case 0:
|
4712
|
-
return
|
4971
|
+
return _context47.abrupt("return", this.getPatientDocumentsList({
|
4713
4972
|
category: MetadataCategory.Consultation,
|
4714
4973
|
documentType: DocumentType.Result
|
4715
4974
|
}, true, consultationId));
|
4716
4975
|
|
4717
4976
|
case 1:
|
4718
4977
|
case "end":
|
4719
|
-
return
|
4978
|
+
return _context47.stop();
|
4720
4979
|
}
|
4721
4980
|
}
|
4722
|
-
},
|
4981
|
+
}, _callee46, this);
|
4723
4982
|
}));
|
4724
4983
|
|
4725
|
-
function getPatientResultsList(
|
4984
|
+
function getPatientResultsList(_x110) {
|
4726
4985
|
return _getPatientResultsList.apply(this, arguments);
|
4727
4986
|
}
|
4728
4987
|
|
@@ -4738,25 +4997,25 @@ var OroClient = /*#__PURE__*/function () {
|
|
4738
4997
|
_proto.getPatientTreatmentPlans =
|
4739
4998
|
/*#__PURE__*/
|
4740
4999
|
function () {
|
4741
|
-
var _getPatientTreatmentPlans = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4742
|
-
return _regeneratorRuntime().wrap(function
|
5000
|
+
var _getPatientTreatmentPlans = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(consultationId) {
|
5001
|
+
return _regeneratorRuntime().wrap(function _callee47$(_context48) {
|
4743
5002
|
while (1) {
|
4744
|
-
switch (
|
5003
|
+
switch (_context48.prev = _context48.next) {
|
4745
5004
|
case 0:
|
4746
|
-
return
|
5005
|
+
return _context48.abrupt("return", this.getPatientDocumentsList({
|
4747
5006
|
category: MetadataCategory.Consultation,
|
4748
5007
|
documentType: DocumentType.TreatmentPlan
|
4749
5008
|
}, true, consultationId));
|
4750
5009
|
|
4751
5010
|
case 1:
|
4752
5011
|
case "end":
|
4753
|
-
return
|
5012
|
+
return _context48.stop();
|
4754
5013
|
}
|
4755
5014
|
}
|
4756
|
-
},
|
5015
|
+
}, _callee47, this);
|
4757
5016
|
}));
|
4758
5017
|
|
4759
|
-
function getPatientTreatmentPlans(
|
5018
|
+
function getPatientTreatmentPlans(_x111) {
|
4760
5019
|
return _getPatientTreatmentPlans.apply(this, arguments);
|
4761
5020
|
}
|
4762
5021
|
|
@@ -4773,12 +5032,12 @@ var OroClient = /*#__PURE__*/function () {
|
|
4773
5032
|
_proto.getPatientTreatmentPlanByUuid =
|
4774
5033
|
/*#__PURE__*/
|
4775
5034
|
function () {
|
4776
|
-
var _getPatientTreatmentPlanByUuid = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4777
|
-
return _regeneratorRuntime().wrap(function
|
5035
|
+
var _getPatientTreatmentPlanByUuid = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(consultationId, treatmentPlanId) {
|
5036
|
+
return _regeneratorRuntime().wrap(function _callee48$(_context49) {
|
4778
5037
|
while (1) {
|
4779
|
-
switch (
|
5038
|
+
switch (_context49.prev = _context49.next) {
|
4780
5039
|
case 0:
|
4781
|
-
return
|
5040
|
+
return _context49.abrupt("return", this.getPatientDocumentsList({
|
4782
5041
|
category: MetadataCategory.Consultation,
|
4783
5042
|
documentType: DocumentType.TreatmentPlan,
|
4784
5043
|
treatmentPlanId: treatmentPlanId
|
@@ -4786,13 +5045,13 @@ var OroClient = /*#__PURE__*/function () {
|
|
4786
5045
|
|
4787
5046
|
case 1:
|
4788
5047
|
case "end":
|
4789
|
-
return
|
5048
|
+
return _context49.stop();
|
4790
5049
|
}
|
4791
5050
|
}
|
4792
|
-
},
|
5051
|
+
}, _callee48, this);
|
4793
5052
|
}));
|
4794
5053
|
|
4795
|
-
function getPatientTreatmentPlanByUuid(
|
5054
|
+
function getPatientTreatmentPlanByUuid(_x112, _x113) {
|
4796
5055
|
return _getPatientTreatmentPlanByUuid.apply(this, arguments);
|
4797
5056
|
}
|
4798
5057
|
|
@@ -4812,62 +5071,64 @@ var OroClient = /*#__PURE__*/function () {
|
|
4812
5071
|
_proto.getPatientDocumentsList =
|
4813
5072
|
/*#__PURE__*/
|
4814
5073
|
function () {
|
4815
|
-
var _getPatientDocumentsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
5074
|
+
var _getPatientDocumentsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(filters, expandPrivateMetadata, consultationId) {
|
4816
5075
|
var _this7 = this;
|
4817
5076
|
|
4818
|
-
return _regeneratorRuntime().wrap(function
|
5077
|
+
return _regeneratorRuntime().wrap(function _callee50$(_context51) {
|
4819
5078
|
while (1) {
|
4820
|
-
switch (
|
5079
|
+
switch (_context51.prev = _context51.next) {
|
4821
5080
|
case 0:
|
4822
|
-
|
4823
|
-
|
5081
|
+
_context51.t0 = Promise;
|
5082
|
+
_context51.next = 3;
|
4824
5083
|
return this.getGrants({
|
4825
5084
|
consultationId: consultationId
|
4826
5085
|
});
|
4827
5086
|
|
4828
5087
|
case 3:
|
4829
|
-
|
5088
|
+
_context51.t1 = _context51.sent.map(function (grant) {
|
4830
5089
|
return _this7.getLockboxManifest(grant.lockboxUuid, _extends({}, filters, {
|
4831
5090
|
consultationId: consultationId
|
4832
|
-
}), expandPrivateMetadata, grant.lockboxOwnerUuid,
|
5091
|
+
}), expandPrivateMetadata, grant.lockboxOwnerUuid, {
|
5092
|
+
forceRefresh: true
|
5093
|
+
}).then(function (manifest) {
|
4833
5094
|
return Promise.all(manifest.map( /*#__PURE__*/function () {
|
4834
|
-
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4835
|
-
return _regeneratorRuntime().wrap(function
|
5095
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(entry) {
|
5096
|
+
return _regeneratorRuntime().wrap(function _callee49$(_context50) {
|
4836
5097
|
while (1) {
|
4837
|
-
switch (
|
5098
|
+
switch (_context50.prev = _context50.next) {
|
4838
5099
|
case 0:
|
4839
|
-
return
|
5100
|
+
return _context50.abrupt("return", _extends({
|
4840
5101
|
lockboxOwnerUuid: grant.lockboxOwnerUuid,
|
4841
5102
|
lockboxUuid: grant.lockboxUuid
|
4842
5103
|
}, entry));
|
4843
5104
|
|
4844
5105
|
case 1:
|
4845
5106
|
case "end":
|
4846
|
-
return
|
5107
|
+
return _context50.stop();
|
4847
5108
|
}
|
4848
5109
|
}
|
4849
|
-
},
|
5110
|
+
}, _callee49);
|
4850
5111
|
}));
|
4851
5112
|
|
4852
|
-
return function (
|
5113
|
+
return function (_x117) {
|
4853
5114
|
return _ref7.apply(this, arguments);
|
4854
5115
|
};
|
4855
5116
|
}()));
|
4856
5117
|
});
|
4857
5118
|
}).flat();
|
4858
|
-
return
|
5119
|
+
return _context51.abrupt("return", _context51.t0.all.call(_context51.t0, _context51.t1).then(function (data) {
|
4859
5120
|
return data.flat();
|
4860
5121
|
}));
|
4861
5122
|
|
4862
5123
|
case 5:
|
4863
5124
|
case "end":
|
4864
|
-
return
|
5125
|
+
return _context51.stop();
|
4865
5126
|
}
|
4866
5127
|
}
|
4867
|
-
},
|
5128
|
+
}, _callee50, this);
|
4868
5129
|
}));
|
4869
5130
|
|
4870
|
-
function getPatientDocumentsList(
|
5131
|
+
function getPatientDocumentsList(_x114, _x115, _x116) {
|
4871
5132
|
return _getPatientDocumentsList.apply(this, arguments);
|
4872
5133
|
}
|
4873
5134
|
|
@@ -4890,17 +5151,17 @@ var OroClient = /*#__PURE__*/function () {
|
|
4890
5151
|
_proto.recoverPrivateKeyFromSecurityQuestions =
|
4891
5152
|
/*#__PURE__*/
|
4892
5153
|
function () {
|
4893
|
-
var _recoverPrivateKeyFromSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
5154
|
+
var _recoverPrivateKeyFromSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
|
4894
5155
|
var shards, answeredShards, privateKey;
|
4895
|
-
return _regeneratorRuntime().wrap(function
|
5156
|
+
return _regeneratorRuntime().wrap(function _callee51$(_context52) {
|
4896
5157
|
while (1) {
|
4897
|
-
switch (
|
5158
|
+
switch (_context52.prev = _context52.next) {
|
4898
5159
|
case 0:
|
4899
|
-
|
5160
|
+
_context52.next = 2;
|
4900
5161
|
return this.guardClient.identityGet(id);
|
4901
5162
|
|
4902
5163
|
case 2:
|
4903
|
-
shards =
|
5164
|
+
shards = _context52.sent.recoverySecurityQuestions;
|
4904
5165
|
answeredShards = shards.filter(function (shard) {
|
4905
5166
|
// filters all answered security questions
|
4906
5167
|
var indexOfQuestion = recoverySecurityQuestions.indexOf(shard.securityQuestion);
|
@@ -4923,13 +5184,13 @@ var OroClient = /*#__PURE__*/function () {
|
|
4923
5184
|
|
4924
5185
|
case 5:
|
4925
5186
|
case "end":
|
4926
|
-
return
|
5187
|
+
return _context52.stop();
|
4927
5188
|
}
|
4928
5189
|
}
|
4929
|
-
},
|
5190
|
+
}, _callee51, this);
|
4930
5191
|
}));
|
4931
5192
|
|
4932
|
-
function recoverPrivateKeyFromSecurityQuestions(
|
5193
|
+
function recoverPrivateKeyFromSecurityQuestions(_x118, _x119, _x120, _x121) {
|
4933
5194
|
return _recoverPrivateKeyFromSecurityQuestions.apply(this, arguments);
|
4934
5195
|
}
|
4935
5196
|
|
@@ -4946,17 +5207,17 @@ var OroClient = /*#__PURE__*/function () {
|
|
4946
5207
|
_proto.recoverPrivateKeyFromPassword =
|
4947
5208
|
/*#__PURE__*/
|
4948
5209
|
function () {
|
4949
|
-
var _recoverPrivateKeyFromPassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
5210
|
+
var _recoverPrivateKeyFromPassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(id, password) {
|
4950
5211
|
var identity, recoveryPayload, symmetricDecryptor, privateKey, symetricEncryptor;
|
4951
|
-
return _regeneratorRuntime().wrap(function
|
5212
|
+
return _regeneratorRuntime().wrap(function _callee52$(_context53) {
|
4952
5213
|
while (1) {
|
4953
|
-
switch (
|
5214
|
+
switch (_context53.prev = _context53.next) {
|
4954
5215
|
case 0:
|
4955
|
-
|
5216
|
+
_context53.next = 2;
|
4956
5217
|
return this.guardClient.identityGet(id);
|
4957
5218
|
|
4958
5219
|
case 2:
|
4959
|
-
identity =
|
5220
|
+
identity = _context53.sent;
|
4960
5221
|
recoveryPayload = identity.recoveryPassword;
|
4961
5222
|
symmetricDecryptor = this.toolbox.CryptoChaCha.fromPassphrase(password);
|
4962
5223
|
privateKey = symmetricDecryptor.base64PayloadDecryptToBytes(recoveryPayload);
|
@@ -4971,13 +5232,13 @@ var OroClient = /*#__PURE__*/function () {
|
|
4971
5232
|
|
4972
5233
|
case 8:
|
4973
5234
|
case "end":
|
4974
|
-
return
|
5235
|
+
return _context53.stop();
|
4975
5236
|
}
|
4976
5237
|
}
|
4977
|
-
},
|
5238
|
+
}, _callee52, this);
|
4978
5239
|
}));
|
4979
5240
|
|
4980
|
-
function recoverPrivateKeyFromPassword(
|
5241
|
+
function recoverPrivateKeyFromPassword(_x122, _x123) {
|
4981
5242
|
return _recoverPrivateKeyFromPassword.apply(this, arguments);
|
4982
5243
|
}
|
4983
5244
|
|
@@ -4994,30 +5255,30 @@ var OroClient = /*#__PURE__*/function () {
|
|
4994
5255
|
_proto.recoverPrivateKeyFromMasterKey =
|
4995
5256
|
/*#__PURE__*/
|
4996
5257
|
function () {
|
4997
|
-
var _recoverPrivateKeyFromMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
5258
|
+
var _recoverPrivateKeyFromMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(id, masterKey) {
|
4998
5259
|
var recoveryPayload, symmetricDecryptor, privateKey;
|
4999
|
-
return _regeneratorRuntime().wrap(function
|
5260
|
+
return _regeneratorRuntime().wrap(function _callee53$(_context54) {
|
5000
5261
|
while (1) {
|
5001
|
-
switch (
|
5262
|
+
switch (_context54.prev = _context54.next) {
|
5002
5263
|
case 0:
|
5003
|
-
|
5264
|
+
_context54.next = 2;
|
5004
5265
|
return this.guardClient.identityGet(id);
|
5005
5266
|
|
5006
5267
|
case 2:
|
5007
|
-
recoveryPayload =
|
5268
|
+
recoveryPayload = _context54.sent.recoveryMasterKey;
|
5008
5269
|
symmetricDecryptor = this.toolbox.CryptoChaCha.fromPassphrase(masterKey);
|
5009
5270
|
privateKey = symmetricDecryptor.base64PayloadDecryptToBytes(recoveryPayload);
|
5010
5271
|
this.rsa = this.toolbox.CryptoRSA.fromKey(privateKey);
|
5011
5272
|
|
5012
5273
|
case 6:
|
5013
5274
|
case "end":
|
5014
|
-
return
|
5275
|
+
return _context54.stop();
|
5015
5276
|
}
|
5016
5277
|
}
|
5017
|
-
},
|
5278
|
+
}, _callee53, this);
|
5018
5279
|
}));
|
5019
5280
|
|
5020
|
-
function recoverPrivateKeyFromMasterKey(
|
5281
|
+
function recoverPrivateKeyFromMasterKey(_x124, _x125) {
|
5021
5282
|
return _recoverPrivateKeyFromMasterKey.apply(this, arguments);
|
5022
5283
|
}
|
5023
5284
|
|
@@ -5036,14 +5297,14 @@ var OroClient = /*#__PURE__*/function () {
|
|
5036
5297
|
_proto.updateSecurityQuestions =
|
5037
5298
|
/*#__PURE__*/
|
5038
5299
|
function () {
|
5039
|
-
var _updateSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
5300
|
+
var _updateSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
|
5040
5301
|
var securityQuestionPayload, updateRequest;
|
5041
|
-
return _regeneratorRuntime().wrap(function
|
5302
|
+
return _regeneratorRuntime().wrap(function _callee54$(_context55) {
|
5042
5303
|
while (1) {
|
5043
|
-
switch (
|
5304
|
+
switch (_context55.prev = _context55.next) {
|
5044
5305
|
case 0:
|
5045
5306
|
if (this.rsa) {
|
5046
|
-
|
5307
|
+
_context55.next = 2;
|
5047
5308
|
break;
|
5048
5309
|
}
|
5049
5310
|
|
@@ -5054,21 +5315,21 @@ var OroClient = /*#__PURE__*/function () {
|
|
5054
5315
|
updateRequest = {
|
5055
5316
|
recoverySecurityQuestions: securityQuestionPayload
|
5056
5317
|
};
|
5057
|
-
|
5318
|
+
_context55.next = 6;
|
5058
5319
|
return this.guardClient.identityUpdate(id, updateRequest);
|
5059
5320
|
|
5060
5321
|
case 6:
|
5061
|
-
return
|
5322
|
+
return _context55.abrupt("return", _context55.sent);
|
5062
5323
|
|
5063
5324
|
case 7:
|
5064
5325
|
case "end":
|
5065
|
-
return
|
5326
|
+
return _context55.stop();
|
5066
5327
|
}
|
5067
5328
|
}
|
5068
|
-
},
|
5329
|
+
}, _callee54, this);
|
5069
5330
|
}));
|
5070
5331
|
|
5071
|
-
function updateSecurityQuestions(
|
5332
|
+
function updateSecurityQuestions(_x126, _x127, _x128, _x129) {
|
5072
5333
|
return _updateSecurityQuestions.apply(this, arguments);
|
5073
5334
|
}
|
5074
5335
|
|
@@ -5090,14 +5351,14 @@ var OroClient = /*#__PURE__*/function () {
|
|
5090
5351
|
_proto.updatePassword =
|
5091
5352
|
/*#__PURE__*/
|
5092
5353
|
function () {
|
5093
|
-
var _updatePassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
5354
|
+
var _updatePassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55(id, newPassword, oldPassword) {
|
5094
5355
|
var symmetricEncryptor, passwordPayload, updateRequest;
|
5095
|
-
return _regeneratorRuntime().wrap(function
|
5356
|
+
return _regeneratorRuntime().wrap(function _callee55$(_context56) {
|
5096
5357
|
while (1) {
|
5097
|
-
switch (
|
5358
|
+
switch (_context56.prev = _context56.next) {
|
5098
5359
|
case 0:
|
5099
5360
|
if (this.rsa) {
|
5100
|
-
|
5361
|
+
_context56.next = 2;
|
5101
5362
|
break;
|
5102
5363
|
}
|
5103
5364
|
|
@@ -5119,21 +5380,21 @@ var OroClient = /*#__PURE__*/function () {
|
|
5119
5380
|
},
|
5120
5381
|
recoveryPassword: passwordPayload
|
5121
5382
|
};
|
5122
|
-
|
5383
|
+
_context56.next = 9;
|
5123
5384
|
return this.guardClient.identityUpdate(id, updateRequest);
|
5124
5385
|
|
5125
5386
|
case 9:
|
5126
|
-
return
|
5387
|
+
return _context56.abrupt("return", _context56.sent);
|
5127
5388
|
|
5128
5389
|
case 10:
|
5129
5390
|
case "end":
|
5130
|
-
return
|
5391
|
+
return _context56.stop();
|
5131
5392
|
}
|
5132
5393
|
}
|
5133
|
-
},
|
5394
|
+
}, _callee55, this);
|
5134
5395
|
}));
|
5135
5396
|
|
5136
|
-
function updatePassword(
|
5397
|
+
function updatePassword(_x130, _x131, _x132) {
|
5137
5398
|
return _updatePassword.apply(this, arguments);
|
5138
5399
|
}
|
5139
5400
|
|
@@ -5152,14 +5413,14 @@ var OroClient = /*#__PURE__*/function () {
|
|
5152
5413
|
_proto.updateMasterKey =
|
5153
5414
|
/*#__PURE__*/
|
5154
5415
|
function () {
|
5155
|
-
var _updateMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
5416
|
+
var _updateMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56(id, masterKey, lockboxUuid) {
|
5156
5417
|
var symmetricEncryptor, masterKeyPayload, updateRequest, updatedIdentity;
|
5157
|
-
return _regeneratorRuntime().wrap(function
|
5418
|
+
return _regeneratorRuntime().wrap(function _callee56$(_context57) {
|
5158
5419
|
while (1) {
|
5159
|
-
switch (
|
5420
|
+
switch (_context57.prev = _context57.next) {
|
5160
5421
|
case 0:
|
5161
5422
|
if (this.rsa) {
|
5162
|
-
|
5423
|
+
_context57.next = 2;
|
5163
5424
|
break;
|
5164
5425
|
}
|
5165
5426
|
|
@@ -5171,31 +5432,33 @@ var OroClient = /*#__PURE__*/function () {
|
|
5171
5432
|
updateRequest = {
|
5172
5433
|
recoveryMasterKey: masterKeyPayload
|
5173
5434
|
};
|
5174
|
-
|
5435
|
+
_context57.next = 7;
|
5175
5436
|
return this.guardClient.identityUpdate(id, updateRequest);
|
5176
5437
|
|
5177
5438
|
case 7:
|
5178
|
-
updatedIdentity =
|
5179
|
-
|
5439
|
+
updatedIdentity = _context57.sent;
|
5440
|
+
_context57.next = 10;
|
5180
5441
|
return this.getOrInsertJsonData(lockboxUuid, {
|
5181
5442
|
masterKey: masterKey
|
5182
5443
|
}, {
|
5183
5444
|
category: MetadataCategory.Recovery,
|
5184
5445
|
contentType: 'application/json'
|
5185
|
-
}, {},
|
5446
|
+
}, {}, {
|
5447
|
+
forceReplace: true
|
5448
|
+
});
|
5186
5449
|
|
5187
5450
|
case 10:
|
5188
|
-
return
|
5451
|
+
return _context57.abrupt("return", updatedIdentity);
|
5189
5452
|
|
5190
5453
|
case 11:
|
5191
5454
|
case "end":
|
5192
|
-
return
|
5455
|
+
return _context57.stop();
|
5193
5456
|
}
|
5194
5457
|
}
|
5195
|
-
},
|
5458
|
+
}, _callee56, this);
|
5196
5459
|
}));
|
5197
5460
|
|
5198
|
-
function updateMasterKey(
|
5461
|
+
function updateMasterKey(_x133, _x134, _x135) {
|
5199
5462
|
return _updateMasterKey.apply(this, arguments);
|
5200
5463
|
}
|
5201
5464
|
|
@@ -5296,5 +5559,5 @@ var init = function init(toolbox, tellerBaseURL, vaultBaseURL, guardBaseURL, sea
|
|
5296
5559
|
};
|
5297
5560
|
|
5298
5561
|
export default init;
|
5299
|
-
export { AssociatedLockboxNotFound, CliniaService, IncompleteAuthentication, MissingGrant, MissingGrantFilter, MissingLockbox, MissingLockboxOwner, OroClient, WorkflowAnswersMissingError, buildConsultSearchIndex, decryptConsultLockboxGrants, decryptGrants, extractAndStorePersonalWorkflowData, extractISOLocalityForConsult, extractPersonalInfoFromWorkflowData, fillWorkflowFromPopulatedWorkflow, filterTriggeredAnsweredWithKind, flattenSelectedAnswers, getImagesFromIndexDb, getInitialisedSelectedAnswers, getWorkflowDataByCategory, identificationToPersonalInformations, isTriggered, registerPatient, sessionStorePrivateKeyName, toActualObject, updatePersonalIntoPopulatedWorkflowData, wasmPath };
|
5562
|
+
export { AssociatedLockboxNotFound, CliniaService, IncompleteAuthentication, MissingGrant, MissingGrantFilter, MissingLockbox, MissingLockboxOwner, OroClient, WorkflowAnswersMissingError, buildConsultSearchIndex, createRefill, decryptConsultLockboxGrants, decryptGrants, extractAndStorePersonalWorkflowData, extractISOLocalityForConsult, extractPersonalInfoFromWorkflowData, fillWorkflowFromPopulatedWorkflow, filterTriggeredAnsweredWithKind, flattenSelectedAnswers, getImagesFromIndexDb, getInitialisedSelectedAnswers, getRefillAnswersAsWorkflow, getWorkflowDataByCategory, identificationToPersonalInformations, isTriggered, registerPatient, sessionStorePrivateKeyName, toActualObject, updatePersonalIntoPopulatedWorkflowData, wasmPath };
|
5300
5563
|
//# sourceMappingURL=oro-sdk.esm.js.map
|