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