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