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