oro-sdk 7.4.2 → 8.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/client.d.ts +5 -0
- package/dist/oro-sdk.cjs.development.js +624 -585
- 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 +624 -585
- package/dist/oro-sdk.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/client.ts +20 -0
- package/src/helpers/patient-registration.ts +1 -1
package/dist/oro-sdk.esm.js
CHANGED
@@ -2302,6 +2302,45 @@ var OroClient = /*#__PURE__*/function () {
|
|
2302
2302
|
}
|
2303
2303
|
return signIn;
|
2304
2304
|
}()
|
2305
|
+
/**
|
2306
|
+
* Creates a lockbox and decrypts the created grant for that lockbox
|
2307
|
+
* @returns the grant to the created lockbox
|
2308
|
+
*/
|
2309
|
+
;
|
2310
|
+
_proto.lockboxCreate =
|
2311
|
+
/*#__PURE__*/
|
2312
|
+
function () {
|
2313
|
+
var _lockboxCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
2314
|
+
var _this = this;
|
2315
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
2316
|
+
while (1) switch (_context5.prev = _context5.next) {
|
2317
|
+
case 0:
|
2318
|
+
if (this.rsa) {
|
2319
|
+
_context5.next = 3;
|
2320
|
+
break;
|
2321
|
+
}
|
2322
|
+
if (this.authenticationCallback) {
|
2323
|
+
this.authenticationCallback(new IncompleteAuthentication());
|
2324
|
+
}
|
2325
|
+
throw new IncompleteAuthentication();
|
2326
|
+
case 3:
|
2327
|
+
return _context5.abrupt("return", this.vaultClient.lockboxCreate().then(function (grant) {
|
2328
|
+
return decryptGrants([grant], _this.rsa);
|
2329
|
+
}).then(function (grants) {
|
2330
|
+
if (grants.length <= 0 || !grants[0].lockboxUuid) throw new MissingGrant();
|
2331
|
+
return grants[0];
|
2332
|
+
}));
|
2333
|
+
case 4:
|
2334
|
+
case "end":
|
2335
|
+
return _context5.stop();
|
2336
|
+
}
|
2337
|
+
}, _callee5, this);
|
2338
|
+
}));
|
2339
|
+
function lockboxCreate() {
|
2340
|
+
return _lockboxCreate.apply(this, arguments);
|
2341
|
+
}
|
2342
|
+
return lockboxCreate;
|
2343
|
+
}()
|
2305
2344
|
/**
|
2306
2345
|
* Will attempt to recover an existing login session and set back
|
2307
2346
|
* the private key in scope
|
@@ -2310,22 +2349,22 @@ var OroClient = /*#__PURE__*/function () {
|
|
2310
2349
|
_proto.resumeSession =
|
2311
2350
|
/*#__PURE__*/
|
2312
2351
|
function () {
|
2313
|
-
var _resumeSession = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
2352
|
+
var _resumeSession = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
2314
2353
|
var id, recoveryPayload, recoveryKey, symmetricDecryptor, privateKey;
|
2315
|
-
return _regeneratorRuntime().wrap(function
|
2316
|
-
while (1) switch (
|
2354
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
2355
|
+
while (1) switch (_context6.prev = _context6.next) {
|
2317
2356
|
case 0:
|
2318
|
-
|
2357
|
+
_context6.next = 2;
|
2319
2358
|
return this.guardClient.whoAmI();
|
2320
2359
|
case 2:
|
2321
|
-
id =
|
2360
|
+
id = _context6.sent.sub;
|
2322
2361
|
recoveryPayload = sessionStorage.getItem(sessionStorePrivateKeyName(id));
|
2323
|
-
|
2362
|
+
_context6.next = 6;
|
2324
2363
|
return this.guardClient.identityGet(id);
|
2325
2364
|
case 6:
|
2326
|
-
recoveryKey =
|
2365
|
+
recoveryKey = _context6.sent.recoveryLogin;
|
2327
2366
|
if (!(!recoveryKey || !recoveryPayload)) {
|
2328
|
-
|
2367
|
+
_context6.next = 9;
|
2329
2368
|
break;
|
2330
2369
|
}
|
2331
2370
|
throw IncompleteAuthentication;
|
@@ -2335,9 +2374,9 @@ var OroClient = /*#__PURE__*/function () {
|
|
2335
2374
|
this.rsa = this.toolbox.CryptoRSA.fromKey(privateKey);
|
2336
2375
|
case 12:
|
2337
2376
|
case "end":
|
2338
|
-
return
|
2377
|
+
return _context6.stop();
|
2339
2378
|
}
|
2340
|
-
},
|
2379
|
+
}, _callee6, this);
|
2341
2380
|
}));
|
2342
2381
|
function resumeSession() {
|
2343
2382
|
return _resumeSession.apply(this, arguments);
|
@@ -2393,9 +2432,9 @@ var OroClient = /*#__PURE__*/function () {
|
|
2393
2432
|
_proto.signOut =
|
2394
2433
|
/*#__PURE__*/
|
2395
2434
|
function () {
|
2396
|
-
var _signOut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
2397
|
-
return _regeneratorRuntime().wrap(function
|
2398
|
-
while (1) switch (
|
2435
|
+
var _signOut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
2436
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
2437
|
+
while (1) switch (_context7.prev = _context7.next) {
|
2399
2438
|
case 0:
|
2400
2439
|
this.rsa = undefined;
|
2401
2440
|
this.secrets = [];
|
@@ -2403,13 +2442,13 @@ var OroClient = /*#__PURE__*/function () {
|
|
2403
2442
|
accessToken: undefined,
|
2404
2443
|
refreshToken: undefined
|
2405
2444
|
});
|
2406
|
-
|
2445
|
+
_context7.next = 5;
|
2407
2446
|
return this.guardClient.authLogout();
|
2408
2447
|
case 5:
|
2409
2448
|
case "end":
|
2410
|
-
return
|
2449
|
+
return _context7.stop();
|
2411
2450
|
}
|
2412
|
-
},
|
2451
|
+
}, _callee7, this);
|
2413
2452
|
}));
|
2414
2453
|
function signOut() {
|
2415
2454
|
return _signOut.apply(this, arguments);
|
@@ -2439,25 +2478,25 @@ var OroClient = /*#__PURE__*/function () {
|
|
2439
2478
|
_proto.registerPatient =
|
2440
2479
|
/*#__PURE__*/
|
2441
2480
|
function () {
|
2442
|
-
var _registerPatient2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
2443
|
-
return _regeneratorRuntime().wrap(function
|
2444
|
-
while (1) switch (
|
2481
|
+
var _registerPatient2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(patientUuid, consult, workflow, recoveryQA, indexSearch, onProgress) {
|
2482
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
2483
|
+
while (1) switch (_context8.prev = _context8.next) {
|
2445
2484
|
case 0:
|
2446
2485
|
if (indexSearch === void 0) {
|
2447
2486
|
indexSearch = true;
|
2448
2487
|
}
|
2449
2488
|
if (this.rsa) {
|
2450
|
-
|
2489
|
+
_context8.next = 3;
|
2451
2490
|
break;
|
2452
2491
|
}
|
2453
2492
|
throw IncompleteAuthentication;
|
2454
2493
|
case 3:
|
2455
|
-
return
|
2494
|
+
return _context8.abrupt("return", registerPatient(patientUuid, consult, workflow, this, this.toolbox.uuid(), recoveryQA, indexSearch, onProgress));
|
2456
2495
|
case 4:
|
2457
2496
|
case "end":
|
2458
|
-
return
|
2497
|
+
return _context8.stop();
|
2459
2498
|
}
|
2460
|
-
},
|
2499
|
+
}, _callee8, this);
|
2461
2500
|
}));
|
2462
2501
|
function registerPatient$1(_x13, _x14, _x15, _x16, _x17, _x18) {
|
2463
2502
|
return _registerPatient2.apply(this, arguments);
|
@@ -2478,25 +2517,25 @@ var OroClient = /*#__PURE__*/function () {
|
|
2478
2517
|
_proto.createRefill =
|
2479
2518
|
/*#__PURE__*/
|
2480
2519
|
function () {
|
2481
|
-
var _createRefill2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
2482
|
-
return _regeneratorRuntime().wrap(function
|
2483
|
-
while (1) switch (
|
2520
|
+
var _createRefill2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(consult, populatedRefillWorkflow, indexSearch, onProgress) {
|
2521
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
2522
|
+
while (1) switch (_context9.prev = _context9.next) {
|
2484
2523
|
case 0:
|
2485
2524
|
if (indexSearch === void 0) {
|
2486
2525
|
indexSearch = true;
|
2487
2526
|
}
|
2488
2527
|
if (this.rsa) {
|
2489
|
-
|
2528
|
+
_context9.next = 3;
|
2490
2529
|
break;
|
2491
2530
|
}
|
2492
2531
|
throw IncompleteAuthentication;
|
2493
2532
|
case 3:
|
2494
|
-
return
|
2533
|
+
return _context9.abrupt("return", createRefill(consult, populatedRefillWorkflow, this, indexSearch, onProgress));
|
2495
2534
|
case 4:
|
2496
2535
|
case "end":
|
2497
|
-
return
|
2536
|
+
return _context9.stop();
|
2498
2537
|
}
|
2499
|
-
},
|
2538
|
+
}, _callee9, this);
|
2500
2539
|
}));
|
2501
2540
|
function createRefill$1(_x19, _x20, _x21, _x22) {
|
2502
2541
|
return _createRefill2.apply(this, arguments);
|
@@ -2511,25 +2550,25 @@ var OroClient = /*#__PURE__*/function () {
|
|
2511
2550
|
_proto.forceUpdateIndexEntries =
|
2512
2551
|
/*#__PURE__*/
|
2513
2552
|
function () {
|
2514
|
-
var _forceUpdateIndexEntries = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
2515
|
-
var
|
2553
|
+
var _forceUpdateIndexEntries = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
2554
|
+
var _this2 = this,
|
2516
2555
|
_this$vaultIndexAdd;
|
2517
2556
|
var grants, indexConsultLockbox;
|
2518
|
-
return _regeneratorRuntime().wrap(function
|
2519
|
-
while (1) switch (
|
2557
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
2558
|
+
while (1) switch (_context11.prev = _context11.next) {
|
2520
2559
|
case 0:
|
2521
|
-
|
2560
|
+
_context11.next = 2;
|
2522
2561
|
return this.getGrants();
|
2523
2562
|
case 2:
|
2524
|
-
grants =
|
2525
|
-
|
2563
|
+
grants = _context11.sent;
|
2564
|
+
_context11.next = 5;
|
2526
2565
|
return Promise.all(grants.map( /*#__PURE__*/function () {
|
2527
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
2528
|
-
return _regeneratorRuntime().wrap(function
|
2529
|
-
while (1) switch (
|
2566
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(grant) {
|
2567
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
2568
|
+
while (1) switch (_context10.prev = _context10.next) {
|
2530
2569
|
case 0:
|
2531
|
-
|
2532
|
-
return
|
2570
|
+
_context10.next = 2;
|
2571
|
+
return _this2.vaultClient.lockboxMetadataGet(grant.lockboxUuid, ['consultationId'], [], {
|
2533
2572
|
category: MetadataCategory.Consultation
|
2534
2573
|
}, grant.lockboxOwnerUuid).then(function (consults) {
|
2535
2574
|
try {
|
@@ -2549,12 +2588,12 @@ var OroClient = /*#__PURE__*/function () {
|
|
2549
2588
|
return [];
|
2550
2589
|
});
|
2551
2590
|
case 2:
|
2552
|
-
return
|
2591
|
+
return _context10.abrupt("return", _context10.sent);
|
2553
2592
|
case 3:
|
2554
2593
|
case "end":
|
2555
|
-
return
|
2594
|
+
return _context10.stop();
|
2556
2595
|
}
|
2557
|
-
},
|
2596
|
+
}, _callee10);
|
2558
2597
|
}));
|
2559
2598
|
return function (_x23) {
|
2560
2599
|
return _ref2.apply(this, arguments);
|
@@ -2563,7 +2602,7 @@ var OroClient = /*#__PURE__*/function () {
|
|
2563
2602
|
return consults.flat();
|
2564
2603
|
});
|
2565
2604
|
case 5:
|
2566
|
-
indexConsultLockbox =
|
2605
|
+
indexConsultLockbox = _context11.sent;
|
2567
2606
|
this.vaultIndexAdd((_this$vaultIndexAdd = {}, _this$vaultIndexAdd[IndexKey.Consultation] = indexConsultLockbox, _this$vaultIndexAdd)).then(function () {
|
2568
2607
|
return alert('The Index was successfully updated!');
|
2569
2608
|
})["catch"](function () {
|
@@ -2571,9 +2610,9 @@ var OroClient = /*#__PURE__*/function () {
|
|
2571
2610
|
});
|
2572
2611
|
case 7:
|
2573
2612
|
case "end":
|
2574
|
-
return
|
2613
|
+
return _context11.stop();
|
2575
2614
|
}
|
2576
|
-
},
|
2615
|
+
}, _callee11, this);
|
2577
2616
|
}));
|
2578
2617
|
function forceUpdateIndexEntries() {
|
2579
2618
|
return _forceUpdateIndexEntries.apply(this, arguments);
|
@@ -2590,27 +2629,27 @@ var OroClient = /*#__PURE__*/function () {
|
|
2590
2629
|
_proto.vaultIndexAdd =
|
2591
2630
|
/*#__PURE__*/
|
2592
2631
|
function () {
|
2593
|
-
var _vaultIndexAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
2632
|
+
var _vaultIndexAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(entries, indexOwnerUuid) {
|
2594
2633
|
var rsaPub, base64IndexOwnerPubKey, encryptedIndex, _i, _Object$keys, keyString, key;
|
2595
|
-
return _regeneratorRuntime().wrap(function
|
2596
|
-
while (1) switch (
|
2634
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
2635
|
+
while (1) switch (_context12.prev = _context12.next) {
|
2597
2636
|
case 0:
|
2598
2637
|
if (this.rsa) {
|
2599
|
-
|
2638
|
+
_context12.next = 2;
|
2600
2639
|
break;
|
2601
2640
|
}
|
2602
2641
|
throw IncompleteAuthentication;
|
2603
2642
|
case 2:
|
2604
2643
|
if (!indexOwnerUuid) {
|
2605
|
-
|
2644
|
+
_context12.next = 9;
|
2606
2645
|
break;
|
2607
2646
|
}
|
2608
|
-
|
2647
|
+
_context12.next = 5;
|
2609
2648
|
return this.guardClient.identityGet(indexOwnerUuid);
|
2610
2649
|
case 5:
|
2611
|
-
base64IndexOwnerPubKey =
|
2650
|
+
base64IndexOwnerPubKey = _context12.sent.publicKey;
|
2612
2651
|
rsaPub = this.toolbox.decodeFromBase64(base64IndexOwnerPubKey);
|
2613
|
-
|
2652
|
+
_context12.next = 10;
|
2614
2653
|
break;
|
2615
2654
|
case 9:
|
2616
2655
|
rsaPub = this.rsa["public"]();
|
@@ -2619,13 +2658,13 @@ var OroClient = /*#__PURE__*/function () {
|
|
2619
2658
|
_i = 0, _Object$keys = Object.keys(entries);
|
2620
2659
|
case 12:
|
2621
2660
|
if (!(_i < _Object$keys.length)) {
|
2622
|
-
|
2661
|
+
_context12.next = 23;
|
2623
2662
|
break;
|
2624
2663
|
}
|
2625
2664
|
keyString = _Object$keys[_i];
|
2626
2665
|
key = keyString;
|
2627
|
-
|
2628
|
-
|
2666
|
+
_context12.t0 = key;
|
2667
|
+
_context12.next = _context12.t0 === IndexKey.ConsultationLockbox ? 18 : 20;
|
2629
2668
|
break;
|
2630
2669
|
case 18:
|
2631
2670
|
encryptedIndex[key] = entries[key].map(function (e) {
|
@@ -2643,19 +2682,19 @@ var OroClient = /*#__PURE__*/function () {
|
|
2643
2682
|
}, rsaPub)
|
2644
2683
|
};
|
2645
2684
|
});
|
2646
|
-
return
|
2685
|
+
return _context12.abrupt("break", 20);
|
2647
2686
|
case 20:
|
2648
2687
|
_i++;
|
2649
|
-
|
2688
|
+
_context12.next = 12;
|
2650
2689
|
break;
|
2651
2690
|
case 23:
|
2652
|
-
|
2691
|
+
_context12.next = 25;
|
2653
2692
|
return this.vaultClient.vaultIndexPut(encryptedIndex, indexOwnerUuid);
|
2654
2693
|
case 25:
|
2655
2694
|
case "end":
|
2656
|
-
return
|
2695
|
+
return _context12.stop();
|
2657
2696
|
}
|
2658
|
-
},
|
2697
|
+
}, _callee12, this);
|
2659
2698
|
}));
|
2660
2699
|
function vaultIndexAdd(_x24, _x25) {
|
2661
2700
|
return _vaultIndexAdd.apply(this, arguments);
|
@@ -2673,38 +2712,38 @@ var OroClient = /*#__PURE__*/function () {
|
|
2673
2712
|
_proto.grantLockbox =
|
2674
2713
|
/*#__PURE__*/
|
2675
2714
|
function () {
|
2676
|
-
var _grantLockbox = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
2715
|
+
var _grantLockbox = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(granteeUuid, lockboxUuid, lockboxOwnerUuid) {
|
2677
2716
|
var secret, base64GranteePublicKey, granteePublicKey, granteeEncryptedSecret, request;
|
2678
|
-
return _regeneratorRuntime().wrap(function
|
2679
|
-
while (1) switch (
|
2717
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
2718
|
+
while (1) switch (_context13.prev = _context13.next) {
|
2680
2719
|
case 0:
|
2681
2720
|
if (this.rsa) {
|
2682
|
-
|
2721
|
+
_context13.next = 2;
|
2683
2722
|
break;
|
2684
2723
|
}
|
2685
2724
|
throw IncompleteAuthentication;
|
2686
2725
|
case 2:
|
2687
|
-
|
2726
|
+
_context13.next = 4;
|
2688
2727
|
return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
|
2689
2728
|
case 4:
|
2690
|
-
secret =
|
2691
|
-
|
2729
|
+
secret = _context13.sent.key();
|
2730
|
+
_context13.next = 7;
|
2692
2731
|
return this.guardClient.identityGet(granteeUuid);
|
2693
2732
|
case 7:
|
2694
|
-
base64GranteePublicKey =
|
2733
|
+
base64GranteePublicKey = _context13.sent.publicKey;
|
2695
2734
|
granteePublicKey = this.toolbox.decodeFromBase64(base64GranteePublicKey);
|
2696
2735
|
granteeEncryptedSecret = CryptoRSA.bytesWithPubEncryptToBase64(secret, granteePublicKey);
|
2697
2736
|
request = {
|
2698
2737
|
encryptedSecret: granteeEncryptedSecret,
|
2699
2738
|
granteeUuid: granteeUuid
|
2700
2739
|
};
|
2701
|
-
|
2740
|
+
_context13.next = 13;
|
2702
2741
|
return this.vaultClient.lockboxGrant(lockboxUuid, request, lockboxOwnerUuid);
|
2703
2742
|
case 13:
|
2704
2743
|
case "end":
|
2705
|
-
return
|
2744
|
+
return _context13.stop();
|
2706
2745
|
}
|
2707
|
-
},
|
2746
|
+
}, _callee13, this);
|
2708
2747
|
}));
|
2709
2748
|
function grantLockbox(_x26, _x27, _x28) {
|
2710
2749
|
return _grantLockbox.apply(this, arguments);
|
@@ -2725,10 +2764,10 @@ var OroClient = /*#__PURE__*/function () {
|
|
2725
2764
|
_proto.createMessageData =
|
2726
2765
|
/*#__PURE__*/
|
2727
2766
|
function () {
|
2728
|
-
var _createMessageData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
2767
|
+
var _createMessageData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(lockboxUuid, message, consultationId, lockboxOwnerUuid, previousDataUuid, options) {
|
2729
2768
|
var symmetricEncryptor, encryptedData, encryptedPrivateMeta, meta, request;
|
2730
|
-
return _regeneratorRuntime().wrap(function
|
2731
|
-
while (1) switch (
|
2769
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
2770
|
+
while (1) switch (_context14.prev = _context14.next) {
|
2732
2771
|
case 0:
|
2733
2772
|
if (options === void 0) {
|
2734
2773
|
options = {
|
@@ -2736,25 +2775,25 @@ var OroClient = /*#__PURE__*/function () {
|
|
2736
2775
|
};
|
2737
2776
|
}
|
2738
2777
|
if (this.rsa) {
|
2739
|
-
|
2778
|
+
_context14.next = 3;
|
2740
2779
|
break;
|
2741
2780
|
}
|
2742
2781
|
throw IncompleteAuthentication;
|
2743
2782
|
case 3:
|
2744
|
-
|
2783
|
+
_context14.next = 5;
|
2745
2784
|
return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
|
2746
2785
|
case 5:
|
2747
|
-
symmetricEncryptor =
|
2786
|
+
symmetricEncryptor = _context14.sent;
|
2748
2787
|
encryptedData = symmetricEncryptor.jsonEncryptToBase64Payload(message);
|
2749
|
-
|
2750
|
-
|
2788
|
+
_context14.t0 = symmetricEncryptor;
|
2789
|
+
_context14.next = 10;
|
2751
2790
|
return this.guardClient.whoAmI();
|
2752
2791
|
case 10:
|
2753
|
-
|
2754
|
-
|
2755
|
-
author:
|
2792
|
+
_context14.t1 = _context14.sent.sub;
|
2793
|
+
_context14.t2 = {
|
2794
|
+
author: _context14.t1
|
2756
2795
|
};
|
2757
|
-
encryptedPrivateMeta =
|
2796
|
+
encryptedPrivateMeta = _context14.t0.jsonEncryptToBase64Payload.call(_context14.t0, _context14.t2);
|
2758
2797
|
meta = {
|
2759
2798
|
consultationId: consultationId,
|
2760
2799
|
category: MetadataCategory.Consultation,
|
@@ -2766,12 +2805,12 @@ var OroClient = /*#__PURE__*/function () {
|
|
2766
2805
|
publicMetadata: meta,
|
2767
2806
|
privateMetadata: encryptedPrivateMeta
|
2768
2807
|
};
|
2769
|
-
return
|
2808
|
+
return _context14.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid, options));
|
2770
2809
|
case 16:
|
2771
2810
|
case "end":
|
2772
|
-
return
|
2811
|
+
return _context14.stop();
|
2773
2812
|
}
|
2774
|
-
},
|
2813
|
+
}, _callee14, this);
|
2775
2814
|
}));
|
2776
2815
|
function createMessageData(_x29, _x30, _x31, _x32, _x33, _x34) {
|
2777
2816
|
return _createMessageData.apply(this, arguments);
|
@@ -2792,10 +2831,10 @@ var OroClient = /*#__PURE__*/function () {
|
|
2792
2831
|
_proto.createMessageAttachmentData =
|
2793
2832
|
/*#__PURE__*/
|
2794
2833
|
function () {
|
2795
|
-
var _createMessageAttachmentData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
2834
|
+
var _createMessageAttachmentData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(lockboxUuid, data, consultationId, lockboxOwnerUuid, previousDataUuid, options) {
|
2796
2835
|
var symmetricEncryptor, encryptedData, encryptedPrivateMeta, meta, request;
|
2797
|
-
return _regeneratorRuntime().wrap(function
|
2798
|
-
while (1) switch (
|
2836
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
2837
|
+
while (1) switch (_context15.prev = _context15.next) {
|
2799
2838
|
case 0:
|
2800
2839
|
if (options === void 0) {
|
2801
2840
|
options = {
|
@@ -2803,38 +2842,38 @@ var OroClient = /*#__PURE__*/function () {
|
|
2803
2842
|
};
|
2804
2843
|
}
|
2805
2844
|
if (this.rsa) {
|
2806
|
-
|
2845
|
+
_context15.next = 3;
|
2807
2846
|
break;
|
2808
2847
|
}
|
2809
2848
|
throw IncompleteAuthentication;
|
2810
2849
|
case 3:
|
2811
|
-
|
2850
|
+
_context15.next = 5;
|
2812
2851
|
return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
|
2813
2852
|
case 5:
|
2814
|
-
symmetricEncryptor =
|
2815
|
-
|
2816
|
-
|
2817
|
-
|
2853
|
+
symmetricEncryptor = _context15.sent;
|
2854
|
+
_context15.t0 = symmetricEncryptor;
|
2855
|
+
_context15.t1 = Uint8Array;
|
2856
|
+
_context15.next = 10;
|
2818
2857
|
return data.arrayBuffer();
|
2819
2858
|
case 10:
|
2820
|
-
|
2821
|
-
|
2822
|
-
encryptedData =
|
2823
|
-
|
2824
|
-
|
2859
|
+
_context15.t2 = _context15.sent;
|
2860
|
+
_context15.t3 = new _context15.t1(_context15.t2);
|
2861
|
+
encryptedData = _context15.t0.bytesEncryptToBase64Payload.call(_context15.t0, _context15.t3);
|
2862
|
+
_context15.t4 = symmetricEncryptor;
|
2863
|
+
_context15.next = 16;
|
2825
2864
|
return this.guardClient.whoAmI();
|
2826
2865
|
case 16:
|
2827
|
-
|
2828
|
-
|
2829
|
-
|
2830
|
-
|
2831
|
-
|
2832
|
-
author:
|
2833
|
-
fileName:
|
2834
|
-
lastModified:
|
2835
|
-
size:
|
2866
|
+
_context15.t5 = _context15.sent.sub;
|
2867
|
+
_context15.t6 = data.name;
|
2868
|
+
_context15.t7 = data.lastModified;
|
2869
|
+
_context15.t8 = data.size;
|
2870
|
+
_context15.t9 = {
|
2871
|
+
author: _context15.t5,
|
2872
|
+
fileName: _context15.t6,
|
2873
|
+
lastModified: _context15.t7,
|
2874
|
+
size: _context15.t8
|
2836
2875
|
};
|
2837
|
-
encryptedPrivateMeta =
|
2876
|
+
encryptedPrivateMeta = _context15.t4.jsonEncryptToBase64Payload.call(_context15.t4, _context15.t9);
|
2838
2877
|
meta = {
|
2839
2878
|
consultationId: consultationId,
|
2840
2879
|
category: MetadataCategory.Consultation,
|
@@ -2846,12 +2885,12 @@ var OroClient = /*#__PURE__*/function () {
|
|
2846
2885
|
publicMetadata: meta,
|
2847
2886
|
privateMetadata: encryptedPrivateMeta
|
2848
2887
|
};
|
2849
|
-
return
|
2888
|
+
return _context15.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid, options));
|
2850
2889
|
case 25:
|
2851
2890
|
case "end":
|
2852
|
-
return
|
2891
|
+
return _context15.stop();
|
2853
2892
|
}
|
2854
|
-
},
|
2893
|
+
}, _callee15, this);
|
2855
2894
|
}));
|
2856
2895
|
function createMessageAttachmentData(_x35, _x36, _x37, _x38, _x39, _x40) {
|
2857
2896
|
return _createMessageAttachmentData.apply(this, arguments);
|
@@ -2874,9 +2913,9 @@ var OroClient = /*#__PURE__*/function () {
|
|
2874
2913
|
_proto.createConsultationAttachmentData =
|
2875
2914
|
/*#__PURE__*/
|
2876
2915
|
function () {
|
2877
|
-
var _createConsultationAttachmentData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
2878
|
-
return _regeneratorRuntime().wrap(function
|
2879
|
-
while (1) switch (
|
2916
|
+
var _createConsultationAttachmentData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(lockboxUuid, data, consultationId, documentType, lockboxOwnerUuid, previousDataUuid, options) {
|
2917
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
2918
|
+
while (1) switch (_context16.prev = _context16.next) {
|
2880
2919
|
case 0:
|
2881
2920
|
if (options === void 0) {
|
2882
2921
|
options = {
|
@@ -2885,43 +2924,43 @@ var OroClient = /*#__PURE__*/function () {
|
|
2885
2924
|
};
|
2886
2925
|
}
|
2887
2926
|
if (this.rsa) {
|
2888
|
-
|
2927
|
+
_context16.next = 3;
|
2889
2928
|
break;
|
2890
2929
|
}
|
2891
2930
|
throw IncompleteAuthentication;
|
2892
2931
|
case 3:
|
2893
|
-
|
2894
|
-
|
2895
|
-
|
2896
|
-
|
2932
|
+
_context16.t0 = this;
|
2933
|
+
_context16.t1 = lockboxUuid;
|
2934
|
+
_context16.t2 = Uint8Array;
|
2935
|
+
_context16.next = 8;
|
2897
2936
|
return data.arrayBuffer();
|
2898
2937
|
case 8:
|
2899
|
-
|
2900
|
-
|
2901
|
-
|
2938
|
+
_context16.t3 = _context16.sent;
|
2939
|
+
_context16.t4 = new _context16.t2(_context16.t3);
|
2940
|
+
_context16.t5 = {
|
2902
2941
|
consultationId: consultationId,
|
2903
2942
|
category: MetadataCategory.Consultation,
|
2904
2943
|
documentType: documentType,
|
2905
2944
|
contentType: data.type
|
2906
2945
|
};
|
2907
|
-
|
2946
|
+
_context16.next = 13;
|
2908
2947
|
return this.guardClient.whoAmI();
|
2909
2948
|
case 13:
|
2910
|
-
|
2911
|
-
|
2912
|
-
|
2913
|
-
author:
|
2914
|
-
fileName:
|
2949
|
+
_context16.t6 = _context16.sent.sub;
|
2950
|
+
_context16.t7 = data.name;
|
2951
|
+
_context16.t8 = {
|
2952
|
+
author: _context16.t6,
|
2953
|
+
fileName: _context16.t7
|
2915
2954
|
};
|
2916
|
-
|
2917
|
-
|
2918
|
-
|
2919
|
-
return
|
2955
|
+
_context16.t9 = lockboxOwnerUuid;
|
2956
|
+
_context16.t10 = previousDataUuid;
|
2957
|
+
_context16.t11 = options;
|
2958
|
+
return _context16.abrupt("return", _context16.t0.createBytesData.call(_context16.t0, _context16.t1, _context16.t4, _context16.t5, _context16.t8, _context16.t9, _context16.t10, _context16.t11));
|
2920
2959
|
case 20:
|
2921
2960
|
case "end":
|
2922
|
-
return
|
2961
|
+
return _context16.stop();
|
2923
2962
|
}
|
2924
|
-
},
|
2963
|
+
}, _callee16, this);
|
2925
2964
|
}));
|
2926
2965
|
function createConsultationAttachmentData(_x41, _x42, _x43, _x44, _x45, _x46, _x47) {
|
2927
2966
|
return _createConsultationAttachmentData.apply(this, arguments);
|
@@ -2944,10 +2983,10 @@ var OroClient = /*#__PURE__*/function () {
|
|
2944
2983
|
_proto.createJsonData =
|
2945
2984
|
/*#__PURE__*/
|
2946
2985
|
function () {
|
2947
|
-
var _createJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
2986
|
+
var _createJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(lockboxUuid, data, meta, privateMeta, lockboxOwnerUuid, previousDataUuid, options) {
|
2948
2987
|
var symmetricEncryptor, encryptedData, encryptedPrivateMeta, request;
|
2949
|
-
return _regeneratorRuntime().wrap(function
|
2950
|
-
while (1) switch (
|
2988
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
2989
|
+
while (1) switch (_context17.prev = _context17.next) {
|
2951
2990
|
case 0:
|
2952
2991
|
if (options === void 0) {
|
2953
2992
|
options = {
|
@@ -2956,15 +2995,15 @@ var OroClient = /*#__PURE__*/function () {
|
|
2956
2995
|
};
|
2957
2996
|
}
|
2958
2997
|
if (this.rsa) {
|
2959
|
-
|
2998
|
+
_context17.next = 3;
|
2960
2999
|
break;
|
2961
3000
|
}
|
2962
3001
|
throw IncompleteAuthentication;
|
2963
3002
|
case 3:
|
2964
|
-
|
3003
|
+
_context17.next = 5;
|
2965
3004
|
return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
|
2966
3005
|
case 5:
|
2967
|
-
symmetricEncryptor =
|
3006
|
+
symmetricEncryptor = _context17.sent;
|
2968
3007
|
encryptedData = symmetricEncryptor.jsonEncryptToBase64Payload(data);
|
2969
3008
|
encryptedPrivateMeta = symmetricEncryptor.jsonEncryptToBase64Payload(privateMeta);
|
2970
3009
|
request = {
|
@@ -2973,17 +3012,17 @@ var OroClient = /*#__PURE__*/function () {
|
|
2973
3012
|
privateMetadata: encryptedPrivateMeta
|
2974
3013
|
};
|
2975
3014
|
if (!options.withNotification) {
|
2976
|
-
|
3015
|
+
_context17.next = 13;
|
2977
3016
|
break;
|
2978
3017
|
}
|
2979
|
-
return
|
3018
|
+
return _context17.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid, options));
|
2980
3019
|
case 13:
|
2981
|
-
return
|
3020
|
+
return _context17.abrupt("return", this.vaultClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
|
2982
3021
|
case 14:
|
2983
3022
|
case "end":
|
2984
|
-
return
|
3023
|
+
return _context17.stop();
|
2985
3024
|
}
|
2986
|
-
},
|
3025
|
+
}, _callee17, this);
|
2987
3026
|
}));
|
2988
3027
|
function createJsonData(_x48, _x49, _x50, _x51, _x52, _x53, _x54) {
|
2989
3028
|
return _createJsonData.apply(this, arguments);
|
@@ -3004,10 +3043,10 @@ var OroClient = /*#__PURE__*/function () {
|
|
3004
3043
|
_proto.getOrInsertJsonData =
|
3005
3044
|
/*#__PURE__*/
|
3006
3045
|
function () {
|
3007
|
-
var _getOrInsertJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3046
|
+
var _getOrInsertJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(lockboxUuid, data, publicMetadata, privateMetadata, options) {
|
3008
3047
|
var manifest;
|
3009
|
-
return _regeneratorRuntime().wrap(function
|
3010
|
-
while (1) switch (
|
3048
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
3049
|
+
while (1) switch (_context18.prev = _context18.next) {
|
3011
3050
|
case 0:
|
3012
3051
|
if (options === void 0) {
|
3013
3052
|
options = {
|
@@ -3016,18 +3055,18 @@ var OroClient = /*#__PURE__*/function () {
|
|
3016
3055
|
updateMedicalStatus: false
|
3017
3056
|
};
|
3018
3057
|
}
|
3019
|
-
|
3058
|
+
_context18.next = 3;
|
3020
3059
|
return this.vaultClient.lockboxManifestGet(lockboxUuid, publicMetadata);
|
3021
3060
|
case 3:
|
3022
|
-
manifest =
|
3061
|
+
manifest = _context18.sent;
|
3023
3062
|
if (!(!options.forceReplace && manifest.length > 0)) {
|
3024
|
-
|
3063
|
+
_context18.next = 9;
|
3025
3064
|
break;
|
3026
3065
|
}
|
3027
3066
|
console.log("The data for " + JSON.stringify(publicMetadata) + " already exist");
|
3028
|
-
return
|
3067
|
+
return _context18.abrupt("return", manifest[0].dataUuid);
|
3029
3068
|
case 9:
|
3030
|
-
|
3069
|
+
_context18.next = 11;
|
3031
3070
|
return this.createJsonData(lockboxUuid, data, publicMetadata, privateMetadata, undefined,
|
3032
3071
|
// if forceReplace and data already exist, then replace data. Otherwise insert it
|
3033
3072
|
options.forceReplace && manifest.length > 0 ? manifest[0].dataUuid : undefined, options)["catch"](function (err) {
|
@@ -3035,12 +3074,12 @@ var OroClient = /*#__PURE__*/function () {
|
|
3035
3074
|
throw err;
|
3036
3075
|
});
|
3037
3076
|
case 11:
|
3038
|
-
return
|
3077
|
+
return _context18.abrupt("return", _context18.sent.dataUuid);
|
3039
3078
|
case 12:
|
3040
3079
|
case "end":
|
3041
|
-
return
|
3080
|
+
return _context18.stop();
|
3042
3081
|
}
|
3043
|
-
},
|
3082
|
+
}, _callee18, this);
|
3044
3083
|
}));
|
3045
3084
|
function getOrInsertJsonData(_x55, _x56, _x57, _x58, _x59) {
|
3046
3085
|
return _getOrInsertJsonData.apply(this, arguments);
|
@@ -3063,10 +3102,10 @@ var OroClient = /*#__PURE__*/function () {
|
|
3063
3102
|
_proto.createBytesData =
|
3064
3103
|
/*#__PURE__*/
|
3065
3104
|
function () {
|
3066
|
-
var _createBytesData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3105
|
+
var _createBytesData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(lockboxUuid, data, meta, privateMeta, lockboxOwnerUuid, previousDataUuid, options) {
|
3067
3106
|
var symmetricEncryptor, encryptedData, encryptedPrivateMeta, request;
|
3068
|
-
return _regeneratorRuntime().wrap(function
|
3069
|
-
while (1) switch (
|
3107
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
3108
|
+
while (1) switch (_context19.prev = _context19.next) {
|
3070
3109
|
case 0:
|
3071
3110
|
if (options === void 0) {
|
3072
3111
|
options = {
|
@@ -3075,15 +3114,15 @@ var OroClient = /*#__PURE__*/function () {
|
|
3075
3114
|
};
|
3076
3115
|
}
|
3077
3116
|
if (this.rsa) {
|
3078
|
-
|
3117
|
+
_context19.next = 3;
|
3079
3118
|
break;
|
3080
3119
|
}
|
3081
3120
|
throw IncompleteAuthentication;
|
3082
3121
|
case 3:
|
3083
|
-
|
3122
|
+
_context19.next = 5;
|
3084
3123
|
return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
|
3085
3124
|
case 5:
|
3086
|
-
symmetricEncryptor =
|
3125
|
+
symmetricEncryptor = _context19.sent;
|
3087
3126
|
encryptedData = symmetricEncryptor.bytesEncryptToBase64Payload(data);
|
3088
3127
|
encryptedPrivateMeta = symmetricEncryptor.jsonEncryptToBase64Payload(privateMeta);
|
3089
3128
|
request = {
|
@@ -3092,17 +3131,17 @@ var OroClient = /*#__PURE__*/function () {
|
|
3092
3131
|
privateMetadata: encryptedPrivateMeta
|
3093
3132
|
};
|
3094
3133
|
if (!options.withNotification) {
|
3095
|
-
|
3134
|
+
_context19.next = 13;
|
3096
3135
|
break;
|
3097
3136
|
}
|
3098
|
-
return
|
3137
|
+
return _context19.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid, options));
|
3099
3138
|
case 13:
|
3100
|
-
return
|
3139
|
+
return _context19.abrupt("return", this.vaultClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
|
3101
3140
|
case 14:
|
3102
3141
|
case "end":
|
3103
|
-
return
|
3142
|
+
return _context19.stop();
|
3104
3143
|
}
|
3105
|
-
},
|
3144
|
+
}, _callee19, this);
|
3106
3145
|
}));
|
3107
3146
|
function createBytesData(_x60, _x61, _x62, _x63, _x64, _x65, _x66) {
|
3108
3147
|
return _createBytesData.apply(this, arguments);
|
@@ -3124,29 +3163,29 @@ var OroClient = /*#__PURE__*/function () {
|
|
3124
3163
|
_proto.getJsonData =
|
3125
3164
|
/*#__PURE__*/
|
3126
3165
|
function () {
|
3127
|
-
var _getJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3166
|
+
var _getJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(lockboxUuid, dataUuid, lockboxOwnerUuid) {
|
3128
3167
|
var _yield$Promise$all, encryptedPayload, symmetricDecryptor;
|
3129
|
-
return _regeneratorRuntime().wrap(function
|
3130
|
-
while (1) switch (
|
3168
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
3169
|
+
while (1) switch (_context20.prev = _context20.next) {
|
3131
3170
|
case 0:
|
3132
3171
|
if (this.rsa) {
|
3133
|
-
|
3172
|
+
_context20.next = 2;
|
3134
3173
|
break;
|
3135
3174
|
}
|
3136
3175
|
throw IncompleteAuthentication;
|
3137
3176
|
case 2:
|
3138
|
-
|
3177
|
+
_context20.next = 4;
|
3139
3178
|
return Promise.all([this.vaultClient.lockboxDataGet(lockboxUuid, dataUuid, lockboxOwnerUuid), this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid)]);
|
3140
3179
|
case 4:
|
3141
|
-
_yield$Promise$all =
|
3180
|
+
_yield$Promise$all = _context20.sent;
|
3142
3181
|
encryptedPayload = _yield$Promise$all[0];
|
3143
3182
|
symmetricDecryptor = _yield$Promise$all[1];
|
3144
|
-
return
|
3183
|
+
return _context20.abrupt("return", symmetricDecryptor.base64PayloadDecryptToJson(encryptedPayload.data));
|
3145
3184
|
case 8:
|
3146
3185
|
case "end":
|
3147
|
-
return
|
3186
|
+
return _context20.stop();
|
3148
3187
|
}
|
3149
|
-
},
|
3188
|
+
}, _callee20, this);
|
3150
3189
|
}));
|
3151
3190
|
function getJsonData(_x67, _x68, _x69) {
|
3152
3191
|
return _getJsonData.apply(this, arguments);
|
@@ -3164,29 +3203,29 @@ var OroClient = /*#__PURE__*/function () {
|
|
3164
3203
|
_proto.getBytesData =
|
3165
3204
|
/*#__PURE__*/
|
3166
3205
|
function () {
|
3167
|
-
var _getBytesData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3206
|
+
var _getBytesData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(lockboxUuid, dataUuid, lockboxOwnerUuid) {
|
3168
3207
|
var _yield$Promise$all2, encryptedPayload, symmetricDecryptor;
|
3169
|
-
return _regeneratorRuntime().wrap(function
|
3170
|
-
while (1) switch (
|
3208
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
3209
|
+
while (1) switch (_context21.prev = _context21.next) {
|
3171
3210
|
case 0:
|
3172
3211
|
if (this.rsa) {
|
3173
|
-
|
3212
|
+
_context21.next = 2;
|
3174
3213
|
break;
|
3175
3214
|
}
|
3176
3215
|
throw IncompleteAuthentication;
|
3177
3216
|
case 2:
|
3178
|
-
|
3217
|
+
_context21.next = 4;
|
3179
3218
|
return Promise.all([this.vaultClient.lockboxDataGet(lockboxUuid, dataUuid, lockboxOwnerUuid), this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid)]);
|
3180
3219
|
case 4:
|
3181
|
-
_yield$Promise$all2 =
|
3220
|
+
_yield$Promise$all2 = _context21.sent;
|
3182
3221
|
encryptedPayload = _yield$Promise$all2[0];
|
3183
3222
|
symmetricDecryptor = _yield$Promise$all2[1];
|
3184
|
-
return
|
3223
|
+
return _context21.abrupt("return", symmetricDecryptor.base64PayloadDecryptToBytes(encryptedPayload.data));
|
3185
3224
|
case 8:
|
3186
3225
|
case "end":
|
3187
|
-
return
|
3226
|
+
return _context21.stop();
|
3188
3227
|
}
|
3189
|
-
},
|
3228
|
+
}, _callee21, this);
|
3190
3229
|
}));
|
3191
3230
|
function getBytesData(_x70, _x71, _x72) {
|
3192
3231
|
return _getBytesData.apply(this, arguments);
|
@@ -3207,72 +3246,72 @@ var OroClient = /*#__PURE__*/function () {
|
|
3207
3246
|
_proto.getGrants =
|
3208
3247
|
/*#__PURE__*/
|
3209
3248
|
function () {
|
3210
|
-
var _getGrants = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3249
|
+
var _getGrants = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(filter) {
|
3211
3250
|
var filterString, currentAccountRole, encryptedGrants, decryptedGrants, grantsByConsultLockbox, decryptedConsults;
|
3212
|
-
return _regeneratorRuntime().wrap(function
|
3213
|
-
while (1) switch (
|
3251
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
3252
|
+
while (1) switch (_context22.prev = _context22.next) {
|
3214
3253
|
case 0:
|
3215
3254
|
if (this.rsa) {
|
3216
|
-
|
3255
|
+
_context22.next = 2;
|
3217
3256
|
break;
|
3218
3257
|
}
|
3219
3258
|
throw IncompleteAuthentication;
|
3220
3259
|
case 2:
|
3221
3260
|
filterString = JSON.stringify(filter); // retrieves cached grants
|
3222
3261
|
if (!this.cachedMetadataGrants[filterString]) {
|
3223
|
-
|
3262
|
+
_context22.next = 5;
|
3224
3263
|
break;
|
3225
3264
|
}
|
3226
|
-
return
|
3265
|
+
return _context22.abrupt("return", this.cachedMetadataGrants[filterString]);
|
3227
3266
|
case 5:
|
3228
|
-
|
3267
|
+
_context22.next = 7;
|
3229
3268
|
return this.getAccountRole();
|
3230
3269
|
case 7:
|
3231
|
-
currentAccountRole =
|
3270
|
+
currentAccountRole = _context22.sent;
|
3232
3271
|
if (!(currentAccountRole.length === 1 && currentAccountRole[0] === OtherRoleType.User)) {
|
3233
|
-
|
3272
|
+
_context22.next = 10;
|
3234
3273
|
break;
|
3235
3274
|
}
|
3236
|
-
return
|
3275
|
+
return _context22.abrupt("return", []);
|
3237
3276
|
case 10:
|
3238
3277
|
if (![OtherRoleType.Patient, OtherRoleType.User].every(function (requiredRole) {
|
3239
3278
|
return currentAccountRole.includes(requiredRole);
|
3240
3279
|
})) {
|
3241
|
-
|
3280
|
+
_context22.next = 26;
|
3242
3281
|
break;
|
3243
3282
|
}
|
3244
3283
|
if (!filter) {
|
3245
|
-
|
3284
|
+
_context22.next = 17;
|
3246
3285
|
break;
|
3247
3286
|
}
|
3248
|
-
|
3287
|
+
_context22.next = 14;
|
3249
3288
|
return filterGrantsWithLockboxMetadata(this, filter);
|
3250
3289
|
case 14:
|
3251
|
-
encryptedGrants =
|
3252
|
-
|
3290
|
+
encryptedGrants = _context22.sent;
|
3291
|
+
_context22.next = 20;
|
3253
3292
|
break;
|
3254
3293
|
case 17:
|
3255
|
-
|
3294
|
+
_context22.next = 19;
|
3256
3295
|
return this.vaultClient.grantsGet();
|
3257
3296
|
case 19:
|
3258
|
-
encryptedGrants =
|
3297
|
+
encryptedGrants = _context22.sent.grants;
|
3259
3298
|
case 20:
|
3260
|
-
|
3299
|
+
_context22.next = 22;
|
3261
3300
|
return decryptGrants(encryptedGrants, this.rsa);
|
3262
3301
|
case 22:
|
3263
|
-
decryptedGrants =
|
3302
|
+
decryptedGrants = _context22.sent;
|
3264
3303
|
// sets the cached grant
|
3265
3304
|
this.cachedMetadataGrants[filterString] = decryptedGrants;
|
3266
3305
|
console.info('[sdk:grant] Found grant for patient');
|
3267
|
-
return
|
3306
|
+
return _context22.abrupt("return", decryptedGrants);
|
3268
3307
|
case 26:
|
3269
3308
|
if (filter) {
|
3270
|
-
|
3309
|
+
_context22.next = 28;
|
3271
3310
|
break;
|
3272
3311
|
}
|
3273
3312
|
throw MissingGrantFilter;
|
3274
3313
|
case 28:
|
3275
|
-
|
3314
|
+
_context22.next = 30;
|
3276
3315
|
return this.vaultClient.vaultIndexGet([IndexKey.ConsultationLockbox], [filter.consultationId]).then(function (res) {
|
3277
3316
|
return res[IndexKey.ConsultationLockbox];
|
3278
3317
|
})["catch"](function (e) {
|
@@ -3280,22 +3319,22 @@ var OroClient = /*#__PURE__*/function () {
|
|
3280
3319
|
return [];
|
3281
3320
|
});
|
3282
3321
|
case 30:
|
3283
|
-
grantsByConsultLockbox =
|
3322
|
+
grantsByConsultLockbox = _context22.sent;
|
3284
3323
|
decryptedConsults = decryptConsultLockboxGrants(grantsByConsultLockbox != null ? grantsByConsultLockbox : [], this.rsa);
|
3285
3324
|
if (!(decryptedConsults.length > 0)) {
|
3286
|
-
|
3325
|
+
_context22.next = 36;
|
3287
3326
|
break;
|
3288
3327
|
}
|
3289
3328
|
console.info('[sdk:index] Grants found in user`s constant time secure index');
|
3290
3329
|
this.cachedMetadataGrants[filterString] = decryptedConsults;
|
3291
|
-
return
|
3330
|
+
return _context22.abrupt("return", this.cachedMetadataGrants[filterString]);
|
3292
3331
|
case 36:
|
3293
|
-
return
|
3332
|
+
return _context22.abrupt("return", []);
|
3294
3333
|
case 37:
|
3295
3334
|
case "end":
|
3296
|
-
return
|
3335
|
+
return _context22.stop();
|
3297
3336
|
}
|
3298
|
-
},
|
3337
|
+
}, _callee22, this);
|
3299
3338
|
}));
|
3300
3339
|
function getGrants(_x73) {
|
3301
3340
|
return _getGrants.apply(this, arguments);
|
@@ -3311,19 +3350,19 @@ var OroClient = /*#__PURE__*/function () {
|
|
3311
3350
|
_proto.getAccountRole =
|
3312
3351
|
/*#__PURE__*/
|
3313
3352
|
function () {
|
3314
|
-
var _getAccountRole = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3315
|
-
return _regeneratorRuntime().wrap(function
|
3316
|
-
while (1) switch (
|
3353
|
+
var _getAccountRole = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
|
3354
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
3355
|
+
while (1) switch (_context23.prev = _context23.next) {
|
3317
3356
|
case 0:
|
3318
|
-
|
3357
|
+
_context23.next = 2;
|
3319
3358
|
return this.guardClient.whoAmI();
|
3320
3359
|
case 2:
|
3321
|
-
return
|
3360
|
+
return _context23.abrupt("return", _context23.sent.scope.split(' '));
|
3322
3361
|
case 3:
|
3323
3362
|
case "end":
|
3324
|
-
return
|
3363
|
+
return _context23.stop();
|
3325
3364
|
}
|
3326
|
-
},
|
3365
|
+
}, _callee23, this);
|
3327
3366
|
}));
|
3328
3367
|
function getAccountRole() {
|
3329
3368
|
return _getAccountRole.apply(this, arguments);
|
@@ -3341,13 +3380,13 @@ var OroClient = /*#__PURE__*/function () {
|
|
3341
3380
|
_proto.getCachedSecretCryptor =
|
3342
3381
|
/*#__PURE__*/
|
3343
3382
|
function () {
|
3344
|
-
var _getCachedSecretCryptor = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3383
|
+
var _getCachedSecretCryptor = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(lockboxUuid, lockboxOwnerUuid) {
|
3345
3384
|
var index, encryptedSecret, secret, cryptor;
|
3346
|
-
return _regeneratorRuntime().wrap(function
|
3347
|
-
while (1) switch (
|
3385
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
3386
|
+
while (1) switch (_context24.prev = _context24.next) {
|
3348
3387
|
case 0:
|
3349
3388
|
if (this.rsa) {
|
3350
|
-
|
3389
|
+
_context24.next = 2;
|
3351
3390
|
break;
|
3352
3391
|
}
|
3353
3392
|
throw IncompleteAuthentication;
|
@@ -3356,27 +3395,27 @@ var OroClient = /*#__PURE__*/function () {
|
|
3356
3395
|
return secret.lockboxUuid === lockboxUuid;
|
3357
3396
|
});
|
3358
3397
|
if (!(index === -1)) {
|
3359
|
-
|
3398
|
+
_context24.next = 13;
|
3360
3399
|
break;
|
3361
3400
|
}
|
3362
|
-
|
3401
|
+
_context24.next = 6;
|
3363
3402
|
return this.vaultClient.lockboxSecretGet(lockboxUuid, lockboxOwnerUuid);
|
3364
3403
|
case 6:
|
3365
|
-
encryptedSecret =
|
3404
|
+
encryptedSecret = _context24.sent.sharedSecret;
|
3366
3405
|
secret = this.rsa.base64DecryptToBytes(encryptedSecret);
|
3367
3406
|
cryptor = this.toolbox.CryptoChaCha.fromKey(secret);
|
3368
3407
|
this.secrets.push({
|
3369
3408
|
lockboxUuid: lockboxUuid,
|
3370
3409
|
cryptor: cryptor
|
3371
3410
|
});
|
3372
|
-
return
|
3411
|
+
return _context24.abrupt("return", cryptor);
|
3373
3412
|
case 13:
|
3374
|
-
return
|
3413
|
+
return _context24.abrupt("return", this.secrets[index].cryptor);
|
3375
3414
|
case 14:
|
3376
3415
|
case "end":
|
3377
|
-
return
|
3416
|
+
return _context24.stop();
|
3378
3417
|
}
|
3379
|
-
},
|
3418
|
+
}, _callee24, this);
|
3380
3419
|
}));
|
3381
3420
|
function getCachedSecretCryptor(_x74, _x75) {
|
3382
3421
|
return _getCachedSecretCryptor.apply(this, arguments);
|
@@ -3396,21 +3435,21 @@ var OroClient = /*#__PURE__*/function () {
|
|
3396
3435
|
_proto.getPersonalInformationsFromConsultId =
|
3397
3436
|
/*#__PURE__*/
|
3398
3437
|
function () {
|
3399
|
-
var _getPersonalInformationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3400
|
-
return _regeneratorRuntime().wrap(function
|
3401
|
-
while (1) switch (
|
3438
|
+
var _getPersonalInformationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(consultationId, category, options) {
|
3439
|
+
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
3440
|
+
while (1) switch (_context25.prev = _context25.next) {
|
3402
3441
|
case 0:
|
3403
3442
|
if (options === void 0) {
|
3404
3443
|
options = {
|
3405
3444
|
forceRefresh: false
|
3406
3445
|
};
|
3407
3446
|
}
|
3408
|
-
return
|
3447
|
+
return _context25.abrupt("return", this.getMetaCategoryFromConsultId(consultationId, category, options));
|
3409
3448
|
case 2:
|
3410
3449
|
case "end":
|
3411
|
-
return
|
3450
|
+
return _context25.stop();
|
3412
3451
|
}
|
3413
|
-
},
|
3452
|
+
}, _callee25, this);
|
3414
3453
|
}));
|
3415
3454
|
function getPersonalInformationsFromConsultId(_x76, _x77, _x78) {
|
3416
3455
|
return _getPersonalInformationsFromConsultId.apply(this, arguments);
|
@@ -3429,21 +3468,21 @@ var OroClient = /*#__PURE__*/function () {
|
|
3429
3468
|
_proto.getMedicalDataFromConsultId =
|
3430
3469
|
/*#__PURE__*/
|
3431
3470
|
function () {
|
3432
|
-
var _getMedicalDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3433
|
-
return _regeneratorRuntime().wrap(function
|
3434
|
-
while (1) switch (
|
3471
|
+
var _getMedicalDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(consultationId, options) {
|
3472
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
3473
|
+
while (1) switch (_context26.prev = _context26.next) {
|
3435
3474
|
case 0:
|
3436
3475
|
if (options === void 0) {
|
3437
3476
|
options = {
|
3438
3477
|
forceRefresh: false
|
3439
3478
|
};
|
3440
3479
|
}
|
3441
|
-
return
|
3480
|
+
return _context26.abrupt("return", this.getMetaCategoryFromConsultId(consultationId, MetadataCategory.Medical, options));
|
3442
3481
|
case 2:
|
3443
3482
|
case "end":
|
3444
|
-
return
|
3483
|
+
return _context26.stop();
|
3445
3484
|
}
|
3446
|
-
},
|
3485
|
+
}, _callee26, this);
|
3447
3486
|
}));
|
3448
3487
|
function getMedicalDataFromConsultId(_x79, _x80) {
|
3449
3488
|
return _getMedicalDataFromConsultId.apply(this, arguments);
|
@@ -3462,21 +3501,21 @@ var OroClient = /*#__PURE__*/function () {
|
|
3462
3501
|
_proto.getFollowupDataFromConsultId =
|
3463
3502
|
/*#__PURE__*/
|
3464
3503
|
function () {
|
3465
|
-
var _getFollowupDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3466
|
-
return _regeneratorRuntime().wrap(function
|
3467
|
-
while (1) switch (
|
3504
|
+
var _getFollowupDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(consultationId, options) {
|
3505
|
+
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
3506
|
+
while (1) switch (_context27.prev = _context27.next) {
|
3468
3507
|
case 0:
|
3469
3508
|
if (options === void 0) {
|
3470
3509
|
options = {
|
3471
3510
|
forceRefresh: false
|
3472
3511
|
};
|
3473
3512
|
}
|
3474
|
-
return
|
3513
|
+
return _context27.abrupt("return", this.getMetaCategoryFromConsultId(consultationId, MetadataCategory.Followup, options));
|
3475
3514
|
case 2:
|
3476
3515
|
case "end":
|
3477
|
-
return
|
3516
|
+
return _context27.stop();
|
3478
3517
|
}
|
3479
|
-
},
|
3518
|
+
}, _callee27, this);
|
3480
3519
|
}));
|
3481
3520
|
function getFollowupDataFromConsultId(_x81, _x82) {
|
3482
3521
|
return _getFollowupDataFromConsultId.apply(this, arguments);
|
@@ -3484,107 +3523,107 @@ var OroClient = /*#__PURE__*/function () {
|
|
3484
3523
|
return getFollowupDataFromConsultId;
|
3485
3524
|
}();
|
3486
3525
|
_proto.getMetaCategoryFromConsultId = /*#__PURE__*/function () {
|
3487
|
-
var _getMetaCategoryFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3488
|
-
var
|
3526
|
+
var _getMetaCategoryFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(consultationId, category, options) {
|
3527
|
+
var _this3 = this;
|
3489
3528
|
var grants, workflowData, _loop, _iterator, _step;
|
3490
|
-
return _regeneratorRuntime().wrap(function
|
3491
|
-
while (1) switch (
|
3529
|
+
return _regeneratorRuntime().wrap(function _callee29$(_context30) {
|
3530
|
+
while (1) switch (_context30.prev = _context30.next) {
|
3492
3531
|
case 0:
|
3493
3532
|
if (options === void 0) {
|
3494
3533
|
options = {
|
3495
3534
|
forceRefresh: false
|
3496
3535
|
};
|
3497
3536
|
}
|
3498
|
-
|
3537
|
+
_context30.next = 3;
|
3499
3538
|
return this.getGrants({
|
3500
3539
|
consultationId: consultationId
|
3501
3540
|
});
|
3502
3541
|
case 3:
|
3503
|
-
grants =
|
3542
|
+
grants = _context30.sent;
|
3504
3543
|
workflowData = [];
|
3505
3544
|
_loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
|
3506
3545
|
var grant, manifest, data;
|
3507
|
-
return _regeneratorRuntime().wrap(function _loop$(
|
3508
|
-
while (1) switch (
|
3546
|
+
return _regeneratorRuntime().wrap(function _loop$(_context29) {
|
3547
|
+
while (1) switch (_context29.prev = _context29.next) {
|
3509
3548
|
case 0:
|
3510
3549
|
grant = _step.value;
|
3511
|
-
|
3512
|
-
return
|
3550
|
+
_context29.next = 3;
|
3551
|
+
return _this3.getLockboxManifest(grant.lockboxUuid, {
|
3513
3552
|
category: category,
|
3514
3553
|
documentType: DocumentType.PopulatedWorkflowData,
|
3515
3554
|
consultationIds: [consultationId]
|
3516
3555
|
}, true, grant.lockboxOwnerUuid, options);
|
3517
3556
|
case 3:
|
3518
|
-
manifest =
|
3557
|
+
manifest = _context29.sent;
|
3519
3558
|
if (!(manifest.length === 0)) {
|
3520
|
-
|
3559
|
+
_context29.next = 8;
|
3521
3560
|
break;
|
3522
3561
|
}
|
3523
|
-
|
3524
|
-
return
|
3562
|
+
_context29.next = 7;
|
3563
|
+
return _this3.getLockboxManifest(grant.lockboxUuid, {
|
3525
3564
|
category: category,
|
3526
3565
|
documentType: DocumentType.PopulatedWorkflowData
|
3527
3566
|
}, true, grant.lockboxOwnerUuid, options);
|
3528
3567
|
case 7:
|
3529
|
-
manifest =
|
3568
|
+
manifest = _context29.sent.filter(function (entry) {
|
3530
3569
|
return !entry.metadata.consultationIds;
|
3531
3570
|
});
|
3532
3571
|
case 8:
|
3533
|
-
|
3572
|
+
_context29.next = 10;
|
3534
3573
|
return Promise.all(manifest.map( /*#__PURE__*/function () {
|
3535
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3536
|
-
return _regeneratorRuntime().wrap(function
|
3537
|
-
while (1) switch (
|
3574
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(entry) {
|
3575
|
+
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
3576
|
+
while (1) switch (_context28.prev = _context28.next) {
|
3538
3577
|
case 0:
|
3539
|
-
|
3540
|
-
|
3541
|
-
|
3542
|
-
|
3543
|
-
return
|
3578
|
+
_context28.t0 = grant.lockboxOwnerUuid;
|
3579
|
+
_context28.t1 = grant.lockboxUuid;
|
3580
|
+
_context28.t2 = entry.dataUuid;
|
3581
|
+
_context28.next = 5;
|
3582
|
+
return _this3.getJsonData(grant.lockboxUuid, entry.dataUuid);
|
3544
3583
|
case 5:
|
3545
|
-
|
3546
|
-
return
|
3547
|
-
lockboxOwnerUuid:
|
3548
|
-
lockboxUuid:
|
3549
|
-
dataUuid:
|
3550
|
-
data:
|
3584
|
+
_context28.t3 = _context28.sent;
|
3585
|
+
return _context28.abrupt("return", {
|
3586
|
+
lockboxOwnerUuid: _context28.t0,
|
3587
|
+
lockboxUuid: _context28.t1,
|
3588
|
+
dataUuid: _context28.t2,
|
3589
|
+
data: _context28.t3
|
3551
3590
|
});
|
3552
3591
|
case 7:
|
3553
3592
|
case "end":
|
3554
|
-
return
|
3593
|
+
return _context28.stop();
|
3555
3594
|
}
|
3556
|
-
},
|
3595
|
+
}, _callee28);
|
3557
3596
|
}));
|
3558
3597
|
return function (_x86) {
|
3559
3598
|
return _ref3.apply(this, arguments);
|
3560
3599
|
};
|
3561
3600
|
}()));
|
3562
3601
|
case 10:
|
3563
|
-
data =
|
3602
|
+
data = _context29.sent;
|
3564
3603
|
workflowData = _extends({}, workflowData, data);
|
3565
3604
|
case 12:
|
3566
3605
|
case "end":
|
3567
|
-
return
|
3606
|
+
return _context29.stop();
|
3568
3607
|
}
|
3569
3608
|
}, _loop);
|
3570
3609
|
});
|
3571
3610
|
_iterator = _createForOfIteratorHelperLoose(grants);
|
3572
3611
|
case 7:
|
3573
3612
|
if ((_step = _iterator()).done) {
|
3574
|
-
|
3613
|
+
_context30.next = 11;
|
3575
3614
|
break;
|
3576
3615
|
}
|
3577
|
-
return
|
3616
|
+
return _context30.delegateYield(_loop(), "t0", 9);
|
3578
3617
|
case 9:
|
3579
|
-
|
3618
|
+
_context30.next = 7;
|
3580
3619
|
break;
|
3581
3620
|
case 11:
|
3582
|
-
return
|
3621
|
+
return _context30.abrupt("return", workflowData);
|
3583
3622
|
case 12:
|
3584
3623
|
case "end":
|
3585
|
-
return
|
3624
|
+
return _context30.stop();
|
3586
3625
|
}
|
3587
|
-
},
|
3626
|
+
}, _callee29, this);
|
3588
3627
|
}));
|
3589
3628
|
function getMetaCategoryFromConsultId(_x83, _x84, _x85) {
|
3590
3629
|
return _getMetaCategoryFromConsultId.apply(this, arguments);
|
@@ -3600,61 +3639,61 @@ var OroClient = /*#__PURE__*/function () {
|
|
3600
3639
|
_proto.getPersonalInformations =
|
3601
3640
|
/*#__PURE__*/
|
3602
3641
|
function () {
|
3603
|
-
var _getPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3642
|
+
var _getPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(userId) {
|
3604
3643
|
var grant, lockboxUuid, lockboxOwnerUuid, identificationDataUuid;
|
3605
|
-
return _regeneratorRuntime().wrap(function
|
3606
|
-
while (1) switch (
|
3644
|
+
return _regeneratorRuntime().wrap(function _callee30$(_context31) {
|
3645
|
+
while (1) switch (_context31.prev = _context31.next) {
|
3607
3646
|
case 0:
|
3608
|
-
|
3647
|
+
_context31.next = 2;
|
3609
3648
|
return this.getGrants();
|
3610
3649
|
case 2:
|
3611
|
-
grant =
|
3650
|
+
grant = _context31.sent.find(function (lockbox) {
|
3612
3651
|
return lockbox.lockboxOwnerUuid === userId;
|
3613
3652
|
});
|
3614
3653
|
if (grant) {
|
3615
|
-
|
3654
|
+
_context31.next = 5;
|
3616
3655
|
break;
|
3617
3656
|
}
|
3618
3657
|
throw MissingGrant;
|
3619
3658
|
case 5:
|
3620
3659
|
lockboxUuid = grant.lockboxUuid, lockboxOwnerUuid = grant.lockboxOwnerUuid;
|
3621
3660
|
if (lockboxUuid) {
|
3622
|
-
|
3661
|
+
_context31.next = 8;
|
3623
3662
|
break;
|
3624
3663
|
}
|
3625
3664
|
throw MissingLockbox;
|
3626
3665
|
case 8:
|
3627
3666
|
if (lockboxOwnerUuid) {
|
3628
|
-
|
3667
|
+
_context31.next = 10;
|
3629
3668
|
break;
|
3630
3669
|
}
|
3631
3670
|
throw MissingLockboxOwner;
|
3632
3671
|
case 10:
|
3633
|
-
|
3672
|
+
_context31.next = 12;
|
3634
3673
|
return this.getLockboxManifest(lockboxUuid, {
|
3635
3674
|
category: MetadataCategory.Personal,
|
3636
3675
|
documentType: DocumentType.PopulatedWorkflowData
|
3637
3676
|
}, false, userId);
|
3638
3677
|
case 12:
|
3639
|
-
identificationDataUuid =
|
3640
|
-
|
3641
|
-
|
3642
|
-
|
3643
|
-
|
3678
|
+
identificationDataUuid = _context31.sent[0].dataUuid;
|
3679
|
+
_context31.t0 = lockboxOwnerUuid;
|
3680
|
+
_context31.t1 = lockboxUuid;
|
3681
|
+
_context31.t2 = identificationDataUuid;
|
3682
|
+
_context31.next = 18;
|
3644
3683
|
return this.getJsonData(lockboxUuid, identificationDataUuid);
|
3645
3684
|
case 18:
|
3646
|
-
|
3647
|
-
return
|
3648
|
-
lockboxOwnerUuid:
|
3649
|
-
lockboxUuid:
|
3650
|
-
dataUuid:
|
3651
|
-
data:
|
3685
|
+
_context31.t3 = _context31.sent;
|
3686
|
+
return _context31.abrupt("return", {
|
3687
|
+
lockboxOwnerUuid: _context31.t0,
|
3688
|
+
lockboxUuid: _context31.t1,
|
3689
|
+
dataUuid: _context31.t2,
|
3690
|
+
data: _context31.t3
|
3652
3691
|
});
|
3653
3692
|
case 20:
|
3654
3693
|
case "end":
|
3655
|
-
return
|
3694
|
+
return _context31.stop();
|
3656
3695
|
}
|
3657
|
-
},
|
3696
|
+
}, _callee30, this);
|
3658
3697
|
}));
|
3659
3698
|
function getPersonalInformations(_x87) {
|
3660
3699
|
return _getPersonalInformations.apply(this, arguments);
|
@@ -3671,29 +3710,29 @@ var OroClient = /*#__PURE__*/function () {
|
|
3671
3710
|
_proto.getGrantFromConsultId =
|
3672
3711
|
/*#__PURE__*/
|
3673
3712
|
function () {
|
3674
|
-
var _getGrantFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3713
|
+
var _getGrantFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(consultationId) {
|
3675
3714
|
var grants;
|
3676
|
-
return _regeneratorRuntime().wrap(function
|
3677
|
-
while (1) switch (
|
3715
|
+
return _regeneratorRuntime().wrap(function _callee31$(_context32) {
|
3716
|
+
while (1) switch (_context32.prev = _context32.next) {
|
3678
3717
|
case 0:
|
3679
|
-
|
3718
|
+
_context32.next = 2;
|
3680
3719
|
return this.getGrants({
|
3681
3720
|
consultationId: consultationId
|
3682
3721
|
});
|
3683
3722
|
case 2:
|
3684
|
-
grants =
|
3723
|
+
grants = _context32.sent;
|
3685
3724
|
if (!(grants.length === 0)) {
|
3686
|
-
|
3725
|
+
_context32.next = 5;
|
3687
3726
|
break;
|
3688
3727
|
}
|
3689
3728
|
throw AssociatedLockboxNotFound;
|
3690
3729
|
case 5:
|
3691
|
-
return
|
3730
|
+
return _context32.abrupt("return", grants[0]);
|
3692
3731
|
case 6:
|
3693
3732
|
case "end":
|
3694
|
-
return
|
3733
|
+
return _context32.stop();
|
3695
3734
|
}
|
3696
|
-
},
|
3735
|
+
}, _callee31, this);
|
3697
3736
|
}));
|
3698
3737
|
function getGrantFromConsultId(_x88) {
|
3699
3738
|
return _getGrantFromConsultId.apply(this, arguments);
|
@@ -3709,30 +3748,30 @@ var OroClient = /*#__PURE__*/function () {
|
|
3709
3748
|
_proto.getIdentityFromConsultId =
|
3710
3749
|
/*#__PURE__*/
|
3711
3750
|
function () {
|
3712
|
-
var _getIdentityFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3751
|
+
var _getIdentityFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(consultationId) {
|
3713
3752
|
var grant;
|
3714
|
-
return _regeneratorRuntime().wrap(function
|
3715
|
-
while (1) switch (
|
3753
|
+
return _regeneratorRuntime().wrap(function _callee32$(_context33) {
|
3754
|
+
while (1) switch (_context33.prev = _context33.next) {
|
3716
3755
|
case 0:
|
3717
|
-
|
3756
|
+
_context33.next = 2;
|
3718
3757
|
return this.getGrantFromConsultId(consultationId);
|
3719
3758
|
case 2:
|
3720
|
-
grant =
|
3759
|
+
grant = _context33.sent;
|
3721
3760
|
if (!(grant && grant.lockboxOwnerUuid)) {
|
3722
|
-
|
3761
|
+
_context33.next = 9;
|
3723
3762
|
break;
|
3724
3763
|
}
|
3725
|
-
|
3764
|
+
_context33.next = 6;
|
3726
3765
|
return this.guardClient.identityGet(grant.lockboxOwnerUuid);
|
3727
3766
|
case 6:
|
3728
|
-
return
|
3767
|
+
return _context33.abrupt("return", _context33.sent);
|
3729
3768
|
case 9:
|
3730
|
-
return
|
3769
|
+
return _context33.abrupt("return", undefined);
|
3731
3770
|
case 10:
|
3732
3771
|
case "end":
|
3733
|
-
return
|
3772
|
+
return _context33.stop();
|
3734
3773
|
}
|
3735
|
-
},
|
3774
|
+
}, _callee32, this);
|
3736
3775
|
}));
|
3737
3776
|
function getIdentityFromConsultId(_x89) {
|
3738
3777
|
return _getIdentityFromConsultId.apply(this, arguments);
|
@@ -3753,11 +3792,11 @@ var OroClient = /*#__PURE__*/function () {
|
|
3753
3792
|
_proto.getLockboxManifest =
|
3754
3793
|
/*#__PURE__*/
|
3755
3794
|
function () {
|
3756
|
-
var _getLockboxManifest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3757
|
-
var
|
3795
|
+
var _getLockboxManifest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(lockboxUuid, filter, expandPrivateMetadata, lockboxOwnerUuid, options) {
|
3796
|
+
var _this4 = this;
|
3758
3797
|
var manifestKey;
|
3759
|
-
return _regeneratorRuntime().wrap(function
|
3760
|
-
while (1) switch (
|
3798
|
+
return _regeneratorRuntime().wrap(function _callee34$(_context35) {
|
3799
|
+
while (1) switch (_context35.prev = _context35.next) {
|
3761
3800
|
case 0:
|
3762
3801
|
if (options === void 0) {
|
3763
3802
|
options = {
|
@@ -3771,47 +3810,47 @@ var OroClient = /*#__PURE__*/function () {
|
|
3771
3810
|
lockboxOwnerUuid: lockboxOwnerUuid
|
3772
3811
|
});
|
3773
3812
|
if (!(!options.forceRefresh && this.cachedManifest[manifestKey])) {
|
3774
|
-
|
3813
|
+
_context35.next = 4;
|
3775
3814
|
break;
|
3776
3815
|
}
|
3777
|
-
return
|
3816
|
+
return _context35.abrupt("return", this.cachedManifest[manifestKey]);
|
3778
3817
|
case 4:
|
3779
|
-
return
|
3818
|
+
return _context35.abrupt("return", this.vaultClient.lockboxManifestGet(lockboxUuid, filter, lockboxOwnerUuid).then(function (manifest) {
|
3780
3819
|
return Promise.all(manifest.map( /*#__PURE__*/function () {
|
3781
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3820
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(entry) {
|
3782
3821
|
var privateMeta;
|
3783
|
-
return _regeneratorRuntime().wrap(function
|
3784
|
-
while (1) switch (
|
3822
|
+
return _regeneratorRuntime().wrap(function _callee33$(_context34) {
|
3823
|
+
while (1) switch (_context34.prev = _context34.next) {
|
3785
3824
|
case 0:
|
3786
3825
|
if (!(expandPrivateMetadata && entry.metadata.privateMetadata)) {
|
3787
|
-
|
3826
|
+
_context34.next = 5;
|
3788
3827
|
break;
|
3789
3828
|
}
|
3790
|
-
|
3791
|
-
return
|
3829
|
+
_context34.next = 3;
|
3830
|
+
return _this4.getJsonData(lockboxUuid, entry.metadata.privateMetadata, lockboxOwnerUuid);
|
3792
3831
|
case 3:
|
3793
|
-
privateMeta =
|
3832
|
+
privateMeta = _context34.sent;
|
3794
3833
|
entry.metadata = _extends({}, entry.metadata, privateMeta);
|
3795
3834
|
case 5:
|
3796
|
-
return
|
3835
|
+
return _context34.abrupt("return", entry);
|
3797
3836
|
case 6:
|
3798
3837
|
case "end":
|
3799
|
-
return
|
3838
|
+
return _context34.stop();
|
3800
3839
|
}
|
3801
|
-
},
|
3840
|
+
}, _callee33);
|
3802
3841
|
}));
|
3803
3842
|
return function (_x95) {
|
3804
3843
|
return _ref4.apply(this, arguments);
|
3805
3844
|
};
|
3806
3845
|
}())).then(function (manifest) {
|
3807
|
-
return
|
3846
|
+
return _this4.cachedManifest[manifestKey] = manifest;
|
3808
3847
|
});
|
3809
3848
|
}));
|
3810
3849
|
case 5:
|
3811
3850
|
case "end":
|
3812
|
-
return
|
3851
|
+
return _context35.stop();
|
3813
3852
|
}
|
3814
|
-
},
|
3853
|
+
}, _callee34, this);
|
3815
3854
|
}));
|
3816
3855
|
function getLockboxManifest(_x90, _x91, _x92, _x93, _x94) {
|
3817
3856
|
return _getLockboxManifest.apply(this, arguments);
|
@@ -3829,34 +3868,34 @@ var OroClient = /*#__PURE__*/function () {
|
|
3829
3868
|
_proto.createPersonalInformations =
|
3830
3869
|
/*#__PURE__*/
|
3831
3870
|
function () {
|
3832
|
-
var _createPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3871
|
+
var _createPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(identity, data, dataUuid) {
|
3833
3872
|
var _yield$this$getGrants;
|
3834
3873
|
var lockboxUuid;
|
3835
|
-
return _regeneratorRuntime().wrap(function
|
3836
|
-
while (1) switch (
|
3874
|
+
return _regeneratorRuntime().wrap(function _callee35$(_context36) {
|
3875
|
+
while (1) switch (_context36.prev = _context36.next) {
|
3837
3876
|
case 0:
|
3838
|
-
|
3877
|
+
_context36.next = 2;
|
3839
3878
|
return this.getGrants();
|
3840
3879
|
case 2:
|
3841
|
-
|
3880
|
+
_context36.t0 = _yield$this$getGrants = _context36.sent.find(function (lockbox) {
|
3842
3881
|
return lockbox.lockboxOwnerUuid === identity.id;
|
3843
3882
|
});
|
3844
|
-
if (!(
|
3845
|
-
|
3883
|
+
if (!(_context36.t0 == null)) {
|
3884
|
+
_context36.next = 7;
|
3846
3885
|
break;
|
3847
3886
|
}
|
3848
|
-
|
3849
|
-
|
3887
|
+
_context36.t1 = void 0;
|
3888
|
+
_context36.next = 8;
|
3850
3889
|
break;
|
3851
3890
|
case 7:
|
3852
|
-
|
3891
|
+
_context36.t1 = _yield$this$getGrants.lockboxUuid;
|
3853
3892
|
case 8:
|
3854
|
-
lockboxUuid =
|
3893
|
+
lockboxUuid = _context36.t1;
|
3855
3894
|
if (!lockboxUuid) {
|
3856
|
-
|
3895
|
+
_context36.next = 13;
|
3857
3896
|
break;
|
3858
3897
|
}
|
3859
|
-
return
|
3898
|
+
return _context36.abrupt("return", this.createJsonData(lockboxUuid, data, {
|
3860
3899
|
category: MetadataCategory.Personal,
|
3861
3900
|
documentType: DocumentType.PopulatedWorkflowData
|
3862
3901
|
}, {}, undefined, dataUuid));
|
@@ -3864,9 +3903,9 @@ var OroClient = /*#__PURE__*/function () {
|
|
3864
3903
|
throw MissingLockbox;
|
3865
3904
|
case 14:
|
3866
3905
|
case "end":
|
3867
|
-
return
|
3906
|
+
return _context36.stop();
|
3868
3907
|
}
|
3869
|
-
},
|
3908
|
+
}, _callee35, this);
|
3870
3909
|
}));
|
3871
3910
|
function createPersonalInformations(_x96, _x97, _x98) {
|
3872
3911
|
return _createPersonalInformations.apply(this, arguments);
|
@@ -3884,34 +3923,34 @@ var OroClient = /*#__PURE__*/function () {
|
|
3884
3923
|
_proto.createUserPreference =
|
3885
3924
|
/*#__PURE__*/
|
3886
3925
|
function () {
|
3887
|
-
var _createUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3926
|
+
var _createUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(identity, preference, dataUuid) {
|
3888
3927
|
var _yield$this$getGrants2;
|
3889
3928
|
var lockboxUuid;
|
3890
|
-
return _regeneratorRuntime().wrap(function
|
3891
|
-
while (1) switch (
|
3929
|
+
return _regeneratorRuntime().wrap(function _callee36$(_context37) {
|
3930
|
+
while (1) switch (_context37.prev = _context37.next) {
|
3892
3931
|
case 0:
|
3893
|
-
|
3932
|
+
_context37.next = 2;
|
3894
3933
|
return this.getGrants();
|
3895
3934
|
case 2:
|
3896
|
-
|
3935
|
+
_context37.t0 = _yield$this$getGrants2 = _context37.sent.find(function (lockbox) {
|
3897
3936
|
return lockbox.lockboxOwnerUuid === identity.id;
|
3898
3937
|
});
|
3899
|
-
if (!(
|
3900
|
-
|
3938
|
+
if (!(_context37.t0 == null)) {
|
3939
|
+
_context37.next = 7;
|
3901
3940
|
break;
|
3902
3941
|
}
|
3903
|
-
|
3904
|
-
|
3942
|
+
_context37.t1 = void 0;
|
3943
|
+
_context37.next = 8;
|
3905
3944
|
break;
|
3906
3945
|
case 7:
|
3907
|
-
|
3946
|
+
_context37.t1 = _yield$this$getGrants2.lockboxUuid;
|
3908
3947
|
case 8:
|
3909
|
-
lockboxUuid =
|
3948
|
+
lockboxUuid = _context37.t1;
|
3910
3949
|
if (!lockboxUuid) {
|
3911
|
-
|
3950
|
+
_context37.next = 13;
|
3912
3951
|
break;
|
3913
3952
|
}
|
3914
|
-
return
|
3953
|
+
return _context37.abrupt("return", this.createJsonData(lockboxUuid, preference, {
|
3915
3954
|
category: MetadataCategory.Preference,
|
3916
3955
|
contentType: 'application/json'
|
3917
3956
|
}, {}, undefined, dataUuid));
|
@@ -3919,9 +3958,9 @@ var OroClient = /*#__PURE__*/function () {
|
|
3919
3958
|
throw MissingLockbox;
|
3920
3959
|
case 14:
|
3921
3960
|
case "end":
|
3922
|
-
return
|
3961
|
+
return _context37.stop();
|
3923
3962
|
}
|
3924
|
-
},
|
3963
|
+
}, _callee36, this);
|
3925
3964
|
}));
|
3926
3965
|
function createUserPreference(_x99, _x100, _x101) {
|
3927
3966
|
return _createUserPreference.apply(this, arguments);
|
@@ -3937,48 +3976,48 @@ var OroClient = /*#__PURE__*/function () {
|
|
3937
3976
|
_proto.getDataFromGrant =
|
3938
3977
|
/*#__PURE__*/
|
3939
3978
|
function () {
|
3940
|
-
var _getDataFromGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3979
|
+
var _getDataFromGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(grant, filter) {
|
3941
3980
|
var lockboxUuid, lockboxOwnerUuid, identificationDataUuid;
|
3942
|
-
return _regeneratorRuntime().wrap(function
|
3943
|
-
while (1) switch (
|
3981
|
+
return _regeneratorRuntime().wrap(function _callee37$(_context38) {
|
3982
|
+
while (1) switch (_context38.prev = _context38.next) {
|
3944
3983
|
case 0:
|
3945
3984
|
lockboxUuid = grant.lockboxUuid, lockboxOwnerUuid = grant.lockboxOwnerUuid;
|
3946
3985
|
if (lockboxUuid) {
|
3947
|
-
|
3986
|
+
_context38.next = 3;
|
3948
3987
|
break;
|
3949
3988
|
}
|
3950
3989
|
throw MissingLockbox;
|
3951
3990
|
case 3:
|
3952
3991
|
if (lockboxOwnerUuid) {
|
3953
|
-
|
3992
|
+
_context38.next = 5;
|
3954
3993
|
break;
|
3955
3994
|
}
|
3956
3995
|
throw MissingLockboxOwner;
|
3957
3996
|
case 5:
|
3958
|
-
|
3997
|
+
_context38.next = 7;
|
3959
3998
|
return this.getLockboxManifest(lockboxUuid, filter, false, grant.lockboxOwnerUuid, {
|
3960
3999
|
forceRefresh: true
|
3961
4000
|
});
|
3962
4001
|
case 7:
|
3963
|
-
identificationDataUuid =
|
3964
|
-
|
3965
|
-
|
3966
|
-
|
3967
|
-
|
4002
|
+
identificationDataUuid = _context38.sent[0].dataUuid;
|
4003
|
+
_context38.t0 = lockboxOwnerUuid;
|
4004
|
+
_context38.t1 = lockboxUuid;
|
4005
|
+
_context38.t2 = identificationDataUuid;
|
4006
|
+
_context38.next = 13;
|
3968
4007
|
return this.getJsonData(lockboxUuid, identificationDataUuid);
|
3969
4008
|
case 13:
|
3970
|
-
|
3971
|
-
return
|
3972
|
-
lockboxOwnerUuid:
|
3973
|
-
lockboxUuid:
|
3974
|
-
dataUuid:
|
3975
|
-
data:
|
4009
|
+
_context38.t3 = _context38.sent;
|
4010
|
+
return _context38.abrupt("return", {
|
4011
|
+
lockboxOwnerUuid: _context38.t0,
|
4012
|
+
lockboxUuid: _context38.t1,
|
4013
|
+
dataUuid: _context38.t2,
|
4014
|
+
data: _context38.t3
|
3976
4015
|
});
|
3977
4016
|
case 15:
|
3978
4017
|
case "end":
|
3979
|
-
return
|
4018
|
+
return _context38.stop();
|
3980
4019
|
}
|
3981
|
-
},
|
4020
|
+
}, _callee37, this);
|
3982
4021
|
}));
|
3983
4022
|
function getDataFromGrant(_x102, _x103) {
|
3984
4023
|
return _getDataFromGrant.apply(this, arguments);
|
@@ -3994,30 +4033,30 @@ var OroClient = /*#__PURE__*/function () {
|
|
3994
4033
|
_proto.getUserPreferenceFromConsultId =
|
3995
4034
|
/*#__PURE__*/
|
3996
4035
|
function () {
|
3997
|
-
var _getUserPreferenceFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4036
|
+
var _getUserPreferenceFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(consultationId) {
|
3998
4037
|
var grant;
|
3999
|
-
return _regeneratorRuntime().wrap(function
|
4000
|
-
while (1) switch (
|
4038
|
+
return _regeneratorRuntime().wrap(function _callee38$(_context39) {
|
4039
|
+
while (1) switch (_context39.prev = _context39.next) {
|
4001
4040
|
case 0:
|
4002
|
-
|
4041
|
+
_context39.next = 2;
|
4003
4042
|
return this.getGrantFromConsultId(consultationId);
|
4004
4043
|
case 2:
|
4005
|
-
grant =
|
4044
|
+
grant = _context39.sent;
|
4006
4045
|
if (grant) {
|
4007
|
-
|
4046
|
+
_context39.next = 5;
|
4008
4047
|
break;
|
4009
4048
|
}
|
4010
4049
|
throw MissingGrant;
|
4011
4050
|
case 5:
|
4012
|
-
return
|
4051
|
+
return _context39.abrupt("return", this.getDataFromGrant(grant, {
|
4013
4052
|
category: MetadataCategory.Preference,
|
4014
4053
|
contentType: 'application/json'
|
4015
4054
|
}));
|
4016
4055
|
case 6:
|
4017
4056
|
case "end":
|
4018
|
-
return
|
4057
|
+
return _context39.stop();
|
4019
4058
|
}
|
4020
|
-
},
|
4059
|
+
}, _callee38, this);
|
4021
4060
|
}));
|
4022
4061
|
function getUserPreferenceFromConsultId(_x104) {
|
4023
4062
|
return _getUserPreferenceFromConsultId.apply(this, arguments);
|
@@ -4033,32 +4072,32 @@ var OroClient = /*#__PURE__*/function () {
|
|
4033
4072
|
_proto.getUserPreference =
|
4034
4073
|
/*#__PURE__*/
|
4035
4074
|
function () {
|
4036
|
-
var _getUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4075
|
+
var _getUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(identity) {
|
4037
4076
|
var grant;
|
4038
|
-
return _regeneratorRuntime().wrap(function
|
4039
|
-
while (1) switch (
|
4077
|
+
return _regeneratorRuntime().wrap(function _callee39$(_context40) {
|
4078
|
+
while (1) switch (_context40.prev = _context40.next) {
|
4040
4079
|
case 0:
|
4041
|
-
|
4080
|
+
_context40.next = 2;
|
4042
4081
|
return this.getGrants();
|
4043
4082
|
case 2:
|
4044
|
-
grant =
|
4083
|
+
grant = _context40.sent.find(function (lockbox) {
|
4045
4084
|
return lockbox.lockboxOwnerUuid === identity.id;
|
4046
4085
|
});
|
4047
4086
|
if (grant) {
|
4048
|
-
|
4087
|
+
_context40.next = 5;
|
4049
4088
|
break;
|
4050
4089
|
}
|
4051
4090
|
throw MissingGrant;
|
4052
4091
|
case 5:
|
4053
|
-
return
|
4092
|
+
return _context40.abrupt("return", this.getDataFromGrant(grant, {
|
4054
4093
|
category: MetadataCategory.Preference,
|
4055
4094
|
contentType: 'application/json'
|
4056
4095
|
}));
|
4057
4096
|
case 6:
|
4058
4097
|
case "end":
|
4059
|
-
return
|
4098
|
+
return _context40.stop();
|
4060
4099
|
}
|
4061
|
-
},
|
4100
|
+
}, _callee39, this);
|
4062
4101
|
}));
|
4063
4102
|
function getUserPreference(_x105) {
|
4064
4103
|
return _getUserPreference.apply(this, arguments);
|
@@ -4074,30 +4113,30 @@ var OroClient = /*#__PURE__*/function () {
|
|
4074
4113
|
_proto.getRecoveryDataFromConsultId =
|
4075
4114
|
/*#__PURE__*/
|
4076
4115
|
function () {
|
4077
|
-
var _getRecoveryDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4116
|
+
var _getRecoveryDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(consultationId) {
|
4078
4117
|
var grant;
|
4079
|
-
return _regeneratorRuntime().wrap(function
|
4080
|
-
while (1) switch (
|
4118
|
+
return _regeneratorRuntime().wrap(function _callee40$(_context41) {
|
4119
|
+
while (1) switch (_context41.prev = _context41.next) {
|
4081
4120
|
case 0:
|
4082
|
-
|
4121
|
+
_context41.next = 2;
|
4083
4122
|
return this.getGrantFromConsultId(consultationId);
|
4084
4123
|
case 2:
|
4085
|
-
grant =
|
4124
|
+
grant = _context41.sent;
|
4086
4125
|
if (grant) {
|
4087
|
-
|
4126
|
+
_context41.next = 5;
|
4088
4127
|
break;
|
4089
4128
|
}
|
4090
4129
|
throw MissingGrant;
|
4091
4130
|
case 5:
|
4092
|
-
return
|
4131
|
+
return _context41.abrupt("return", this.getDataFromGrant(grant, {
|
4093
4132
|
category: MetadataCategory.Recovery,
|
4094
4133
|
contentType: 'application/json'
|
4095
4134
|
}));
|
4096
4135
|
case 6:
|
4097
4136
|
case "end":
|
4098
|
-
return
|
4137
|
+
return _context41.stop();
|
4099
4138
|
}
|
4100
|
-
},
|
4139
|
+
}, _callee40, this);
|
4101
4140
|
}));
|
4102
4141
|
function getRecoveryDataFromConsultId(_x106) {
|
4103
4142
|
return _getRecoveryDataFromConsultId.apply(this, arguments);
|
@@ -4113,32 +4152,32 @@ var OroClient = /*#__PURE__*/function () {
|
|
4113
4152
|
_proto.getRecoveryData =
|
4114
4153
|
/*#__PURE__*/
|
4115
4154
|
function () {
|
4116
|
-
var _getRecoveryData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4155
|
+
var _getRecoveryData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(identity) {
|
4117
4156
|
var grant;
|
4118
|
-
return _regeneratorRuntime().wrap(function
|
4119
|
-
while (1) switch (
|
4157
|
+
return _regeneratorRuntime().wrap(function _callee41$(_context42) {
|
4158
|
+
while (1) switch (_context42.prev = _context42.next) {
|
4120
4159
|
case 0:
|
4121
|
-
|
4160
|
+
_context42.next = 2;
|
4122
4161
|
return this.getGrants();
|
4123
4162
|
case 2:
|
4124
|
-
grant =
|
4163
|
+
grant = _context42.sent.find(function (lockbox) {
|
4125
4164
|
return lockbox.lockboxOwnerUuid === identity.id;
|
4126
4165
|
});
|
4127
4166
|
if (grant) {
|
4128
|
-
|
4167
|
+
_context42.next = 5;
|
4129
4168
|
break;
|
4130
4169
|
}
|
4131
4170
|
throw MissingGrant;
|
4132
4171
|
case 5:
|
4133
|
-
return
|
4172
|
+
return _context42.abrupt("return", this.getDataFromGrant(grant, {
|
4134
4173
|
category: MetadataCategory.Recovery,
|
4135
4174
|
contentType: 'application/json'
|
4136
4175
|
}));
|
4137
4176
|
case 6:
|
4138
4177
|
case "end":
|
4139
|
-
return
|
4178
|
+
return _context42.stop();
|
4140
4179
|
}
|
4141
|
-
},
|
4180
|
+
}, _callee41, this);
|
4142
4181
|
}));
|
4143
4182
|
function getRecoveryData(_x107) {
|
4144
4183
|
return _getRecoveryData.apply(this, arguments);
|
@@ -4159,34 +4198,34 @@ var OroClient = /*#__PURE__*/function () {
|
|
4159
4198
|
_proto.getAssignedConsultations =
|
4160
4199
|
/*#__PURE__*/
|
4161
4200
|
function () {
|
4162
|
-
var _getAssignedConsultations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4163
|
-
var
|
4164
|
-
return _regeneratorRuntime().wrap(function
|
4165
|
-
while (1) switch (
|
4201
|
+
var _getAssignedConsultations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(practiceUuid) {
|
4202
|
+
var _this5 = this;
|
4203
|
+
return _regeneratorRuntime().wrap(function _callee43$(_context44) {
|
4204
|
+
while (1) switch (_context44.prev = _context44.next) {
|
4166
4205
|
case 0:
|
4167
|
-
|
4168
|
-
|
4206
|
+
_context44.t0 = Promise;
|
4207
|
+
_context44.next = 3;
|
4169
4208
|
return this.getGrants();
|
4170
4209
|
case 3:
|
4171
|
-
|
4172
|
-
return
|
4210
|
+
_context44.t1 = _context44.sent.map(function (grant) {
|
4211
|
+
return _this5.getLockboxManifest(grant.lockboxUuid, {
|
4173
4212
|
category: MetadataCategory.Consultation,
|
4174
4213
|
documentType: DocumentType.PopulatedWorkflowData
|
4175
4214
|
}, true, undefined).then(function (manifest) {
|
4176
4215
|
return Promise.all(manifest.map( /*#__PURE__*/function () {
|
4177
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4178
|
-
return _regeneratorRuntime().wrap(function
|
4179
|
-
while (1) switch (
|
4216
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(entry) {
|
4217
|
+
return _regeneratorRuntime().wrap(function _callee42$(_context43) {
|
4218
|
+
while (1) switch (_context43.prev = _context43.next) {
|
4180
4219
|
case 0:
|
4181
|
-
|
4182
|
-
return
|
4220
|
+
_context43.next = 2;
|
4221
|
+
return _this5.consultClient.getConsultByUUID(entry.metadata.consultationId, practiceUuid);
|
4183
4222
|
case 2:
|
4184
|
-
return
|
4223
|
+
return _context43.abrupt("return", _context43.sent);
|
4185
4224
|
case 3:
|
4186
4225
|
case "end":
|
4187
|
-
return
|
4226
|
+
return _context43.stop();
|
4188
4227
|
}
|
4189
|
-
},
|
4228
|
+
}, _callee42);
|
4190
4229
|
}));
|
4191
4230
|
return function (_x109) {
|
4192
4231
|
return _ref5.apply(this, arguments);
|
@@ -4196,14 +4235,14 @@ var OroClient = /*#__PURE__*/function () {
|
|
4196
4235
|
});
|
4197
4236
|
});
|
4198
4237
|
});
|
4199
|
-
return
|
4238
|
+
return _context44.abrupt("return", _context44.t0.all.call(_context44.t0, _context44.t1).then(function (consults) {
|
4200
4239
|
return consults.flat();
|
4201
4240
|
}));
|
4202
4241
|
case 5:
|
4203
4242
|
case "end":
|
4204
|
-
return
|
4243
|
+
return _context44.stop();
|
4205
4244
|
}
|
4206
|
-
},
|
4245
|
+
}, _callee43, this);
|
4207
4246
|
}));
|
4208
4247
|
function getAssignedConsultations(_x108) {
|
4209
4248
|
return _getAssignedConsultations.apply(this, arguments);
|
@@ -4219,64 +4258,64 @@ var OroClient = /*#__PURE__*/function () {
|
|
4219
4258
|
_proto.getPastConsultationsFromConsultId =
|
4220
4259
|
/*#__PURE__*/
|
4221
4260
|
function () {
|
4222
|
-
var _getPastConsultationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4223
|
-
var
|
4261
|
+
var _getPastConsultationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(consultationId, practiceUuid) {
|
4262
|
+
var _this6 = this;
|
4224
4263
|
var grant, consultationsInLockbox;
|
4225
|
-
return _regeneratorRuntime().wrap(function
|
4226
|
-
while (1) switch (
|
4264
|
+
return _regeneratorRuntime().wrap(function _callee45$(_context46) {
|
4265
|
+
while (1) switch (_context46.prev = _context46.next) {
|
4227
4266
|
case 0:
|
4228
|
-
|
4267
|
+
_context46.next = 2;
|
4229
4268
|
return this.getGrantFromConsultId(consultationId);
|
4230
4269
|
case 2:
|
4231
|
-
grant =
|
4270
|
+
grant = _context46.sent;
|
4232
4271
|
if (grant) {
|
4233
|
-
|
4272
|
+
_context46.next = 5;
|
4234
4273
|
break;
|
4235
4274
|
}
|
4236
|
-
return
|
4275
|
+
return _context46.abrupt("return", undefined);
|
4237
4276
|
case 5:
|
4238
|
-
|
4277
|
+
_context46.next = 7;
|
4239
4278
|
return this.vaultClient.lockboxMetadataGet(grant.lockboxUuid, ['consultationId'], ['consultationId'], {
|
4240
4279
|
category: MetadataCategory.Consultation,
|
4241
4280
|
documentType: DocumentType.PopulatedWorkflowData
|
4242
4281
|
}, grant.lockboxOwnerUuid);
|
4243
4282
|
case 7:
|
4244
|
-
consultationsInLockbox =
|
4283
|
+
consultationsInLockbox = _context46.sent.flat().map(function (metadata) {
|
4245
4284
|
return metadata.consultationId;
|
4246
4285
|
});
|
4247
4286
|
if (!(consultationsInLockbox.length == 0)) {
|
4248
|
-
|
4287
|
+
_context46.next = 10;
|
4249
4288
|
break;
|
4250
4289
|
}
|
4251
|
-
return
|
4290
|
+
return _context46.abrupt("return", []);
|
4252
4291
|
case 10:
|
4253
|
-
|
4292
|
+
_context46.next = 12;
|
4254
4293
|
return Promise.all(consultationsInLockbox.map( /*#__PURE__*/function () {
|
4255
|
-
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4256
|
-
return _regeneratorRuntime().wrap(function
|
4257
|
-
while (1) switch (
|
4294
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(consultId) {
|
4295
|
+
return _regeneratorRuntime().wrap(function _callee44$(_context45) {
|
4296
|
+
while (1) switch (_context45.prev = _context45.next) {
|
4258
4297
|
case 0:
|
4259
|
-
|
4260
|
-
return
|
4298
|
+
_context45.next = 2;
|
4299
|
+
return _this6.consultClient.getConsultByUUID(consultId, practiceUuid);
|
4261
4300
|
case 2:
|
4262
|
-
return
|
4301
|
+
return _context45.abrupt("return", _context45.sent);
|
4263
4302
|
case 3:
|
4264
4303
|
case "end":
|
4265
|
-
return
|
4304
|
+
return _context45.stop();
|
4266
4305
|
}
|
4267
|
-
},
|
4306
|
+
}, _callee44);
|
4268
4307
|
}));
|
4269
4308
|
return function (_x112) {
|
4270
4309
|
return _ref6.apply(this, arguments);
|
4271
4310
|
};
|
4272
4311
|
}()));
|
4273
4312
|
case 12:
|
4274
|
-
return
|
4313
|
+
return _context46.abrupt("return", _context46.sent);
|
4275
4314
|
case 13:
|
4276
4315
|
case "end":
|
4277
|
-
return
|
4316
|
+
return _context46.stop();
|
4278
4317
|
}
|
4279
|
-
},
|
4318
|
+
}, _callee45, this);
|
4280
4319
|
}));
|
4281
4320
|
function getPastConsultationsFromConsultId(_x110, _x111) {
|
4282
4321
|
return _getPastConsultationsFromConsultId.apply(this, arguments);
|
@@ -4293,41 +4332,41 @@ var OroClient = /*#__PURE__*/function () {
|
|
4293
4332
|
_proto.getPatientConsultationData =
|
4294
4333
|
/*#__PURE__*/
|
4295
4334
|
function () {
|
4296
|
-
var _getPatientConsultationData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4297
|
-
var
|
4298
|
-
return _regeneratorRuntime().wrap(function
|
4299
|
-
while (1) switch (
|
4335
|
+
var _getPatientConsultationData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(consultationId, options) {
|
4336
|
+
var _this7 = this;
|
4337
|
+
return _regeneratorRuntime().wrap(function _callee46$(_context47) {
|
4338
|
+
while (1) switch (_context47.prev = _context47.next) {
|
4300
4339
|
case 0:
|
4301
4340
|
if (options === void 0) {
|
4302
4341
|
options = {
|
4303
4342
|
forceRefresh: false
|
4304
4343
|
};
|
4305
4344
|
}
|
4306
|
-
|
4307
|
-
|
4345
|
+
_context47.t0 = Promise;
|
4346
|
+
_context47.next = 4;
|
4308
4347
|
return this.getGrants({
|
4309
4348
|
consultationId: consultationId
|
4310
4349
|
});
|
4311
4350
|
case 4:
|
4312
|
-
|
4313
|
-
return
|
4351
|
+
_context47.t1 = _context47.sent.map(function (grant) {
|
4352
|
+
return _this7.getLockboxManifest(grant.lockboxUuid, {
|
4314
4353
|
category: MetadataCategory.Consultation,
|
4315
4354
|
documentType: DocumentType.PopulatedWorkflowData,
|
4316
4355
|
consultationId: consultationId
|
4317
4356
|
}, true, grant.lockboxOwnerUuid, options).then(function (manifest) {
|
4318
4357
|
return Promise.all(manifest.map(function (e) {
|
4319
|
-
return
|
4358
|
+
return _this7.getJsonData(grant.lockboxUuid, e.dataUuid, grant.lockboxOwnerUuid);
|
4320
4359
|
}));
|
4321
4360
|
});
|
4322
4361
|
}).flat();
|
4323
|
-
return
|
4362
|
+
return _context47.abrupt("return", _context47.t0.all.call(_context47.t0, _context47.t1).then(function (data) {
|
4324
4363
|
return data.flat();
|
4325
4364
|
}));
|
4326
4365
|
case 6:
|
4327
4366
|
case "end":
|
4328
|
-
return
|
4367
|
+
return _context47.stop();
|
4329
4368
|
}
|
4330
|
-
},
|
4369
|
+
}, _callee46, this);
|
4331
4370
|
}));
|
4332
4371
|
function getPatientConsultationData(_x113, _x114) {
|
4333
4372
|
return _getPatientConsultationData.apply(this, arguments);
|
@@ -4343,19 +4382,19 @@ var OroClient = /*#__PURE__*/function () {
|
|
4343
4382
|
_proto.getPatientPrescriptionsList =
|
4344
4383
|
/*#__PURE__*/
|
4345
4384
|
function () {
|
4346
|
-
var _getPatientPrescriptionsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4347
|
-
return _regeneratorRuntime().wrap(function
|
4348
|
-
while (1) switch (
|
4385
|
+
var _getPatientPrescriptionsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(consultationId) {
|
4386
|
+
return _regeneratorRuntime().wrap(function _callee47$(_context48) {
|
4387
|
+
while (1) switch (_context48.prev = _context48.next) {
|
4349
4388
|
case 0:
|
4350
|
-
return
|
4389
|
+
return _context48.abrupt("return", this.getPatientDocumentsList({
|
4351
4390
|
category: MetadataCategory.Consultation,
|
4352
4391
|
documentType: DocumentType.Prescription
|
4353
4392
|
}, true, consultationId));
|
4354
4393
|
case 1:
|
4355
4394
|
case "end":
|
4356
|
-
return
|
4395
|
+
return _context48.stop();
|
4357
4396
|
}
|
4358
|
-
},
|
4397
|
+
}, _callee47, this);
|
4359
4398
|
}));
|
4360
4399
|
function getPatientPrescriptionsList(_x115) {
|
4361
4400
|
return _getPatientPrescriptionsList.apply(this, arguments);
|
@@ -4371,19 +4410,19 @@ var OroClient = /*#__PURE__*/function () {
|
|
4371
4410
|
_proto.getPatientResultsList =
|
4372
4411
|
/*#__PURE__*/
|
4373
4412
|
function () {
|
4374
|
-
var _getPatientResultsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4375
|
-
return _regeneratorRuntime().wrap(function
|
4376
|
-
while (1) switch (
|
4413
|
+
var _getPatientResultsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(consultationId) {
|
4414
|
+
return _regeneratorRuntime().wrap(function _callee48$(_context49) {
|
4415
|
+
while (1) switch (_context49.prev = _context49.next) {
|
4377
4416
|
case 0:
|
4378
|
-
return
|
4417
|
+
return _context49.abrupt("return", this.getPatientDocumentsList({
|
4379
4418
|
category: MetadataCategory.Consultation,
|
4380
4419
|
documentType: DocumentType.Result
|
4381
4420
|
}, true, consultationId));
|
4382
4421
|
case 1:
|
4383
4422
|
case "end":
|
4384
|
-
return
|
4423
|
+
return _context49.stop();
|
4385
4424
|
}
|
4386
|
-
},
|
4425
|
+
}, _callee48, this);
|
4387
4426
|
}));
|
4388
4427
|
function getPatientResultsList(_x116) {
|
4389
4428
|
return _getPatientResultsList.apply(this, arguments);
|
@@ -4399,19 +4438,19 @@ var OroClient = /*#__PURE__*/function () {
|
|
4399
4438
|
_proto.getPatientTreatmentPlans =
|
4400
4439
|
/*#__PURE__*/
|
4401
4440
|
function () {
|
4402
|
-
var _getPatientTreatmentPlans = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4403
|
-
return _regeneratorRuntime().wrap(function
|
4404
|
-
while (1) switch (
|
4441
|
+
var _getPatientTreatmentPlans = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(consultationId) {
|
4442
|
+
return _regeneratorRuntime().wrap(function _callee49$(_context50) {
|
4443
|
+
while (1) switch (_context50.prev = _context50.next) {
|
4405
4444
|
case 0:
|
4406
|
-
return
|
4445
|
+
return _context50.abrupt("return", this.getPatientDocumentsList({
|
4407
4446
|
category: MetadataCategory.Consultation,
|
4408
4447
|
documentType: DocumentType.TreatmentPlan
|
4409
4448
|
}, true, consultationId));
|
4410
4449
|
case 1:
|
4411
4450
|
case "end":
|
4412
|
-
return
|
4451
|
+
return _context50.stop();
|
4413
4452
|
}
|
4414
|
-
},
|
4453
|
+
}, _callee49, this);
|
4415
4454
|
}));
|
4416
4455
|
function getPatientTreatmentPlans(_x117) {
|
4417
4456
|
return _getPatientTreatmentPlans.apply(this, arguments);
|
@@ -4428,20 +4467,20 @@ var OroClient = /*#__PURE__*/function () {
|
|
4428
4467
|
_proto.getPatientTreatmentPlanByUuid =
|
4429
4468
|
/*#__PURE__*/
|
4430
4469
|
function () {
|
4431
|
-
var _getPatientTreatmentPlanByUuid = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4432
|
-
return _regeneratorRuntime().wrap(function
|
4433
|
-
while (1) switch (
|
4470
|
+
var _getPatientTreatmentPlanByUuid = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(consultationId, treatmentPlanId) {
|
4471
|
+
return _regeneratorRuntime().wrap(function _callee50$(_context51) {
|
4472
|
+
while (1) switch (_context51.prev = _context51.next) {
|
4434
4473
|
case 0:
|
4435
|
-
return
|
4474
|
+
return _context51.abrupt("return", this.getPatientDocumentsList({
|
4436
4475
|
category: MetadataCategory.Consultation,
|
4437
4476
|
documentType: DocumentType.TreatmentPlan,
|
4438
4477
|
treatmentPlanId: treatmentPlanId
|
4439
4478
|
}, true, consultationId));
|
4440
4479
|
case 1:
|
4441
4480
|
case "end":
|
4442
|
-
return
|
4481
|
+
return _context51.stop();
|
4443
4482
|
}
|
4444
|
-
},
|
4483
|
+
}, _callee50, this);
|
4445
4484
|
}));
|
4446
4485
|
function getPatientTreatmentPlanByUuid(_x118, _x119) {
|
4447
4486
|
return _getPatientTreatmentPlanByUuid.apply(this, arguments);
|
@@ -4461,37 +4500,37 @@ var OroClient = /*#__PURE__*/function () {
|
|
4461
4500
|
_proto.getPatientDocumentsList =
|
4462
4501
|
/*#__PURE__*/
|
4463
4502
|
function () {
|
4464
|
-
var _getPatientDocumentsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4465
|
-
var
|
4466
|
-
return _regeneratorRuntime().wrap(function
|
4467
|
-
while (1) switch (
|
4503
|
+
var _getPatientDocumentsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(filters, expandPrivateMetadata, consultationId) {
|
4504
|
+
var _this8 = this;
|
4505
|
+
return _regeneratorRuntime().wrap(function _callee52$(_context53) {
|
4506
|
+
while (1) switch (_context53.prev = _context53.next) {
|
4468
4507
|
case 0:
|
4469
|
-
|
4470
|
-
|
4508
|
+
_context53.t0 = Promise;
|
4509
|
+
_context53.next = 3;
|
4471
4510
|
return this.getGrants({
|
4472
4511
|
consultationId: consultationId
|
4473
4512
|
});
|
4474
4513
|
case 3:
|
4475
|
-
|
4476
|
-
return
|
4514
|
+
_context53.t1 = _context53.sent.map(function (grant) {
|
4515
|
+
return _this8.getLockboxManifest(grant.lockboxUuid, _extends({}, filters, {
|
4477
4516
|
consultationId: consultationId
|
4478
4517
|
}), expandPrivateMetadata, grant.lockboxOwnerUuid, {
|
4479
4518
|
forceRefresh: true
|
4480
4519
|
}).then(function (manifest) {
|
4481
4520
|
return Promise.all(manifest.map( /*#__PURE__*/function () {
|
4482
|
-
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4483
|
-
return _regeneratorRuntime().wrap(function
|
4484
|
-
while (1) switch (
|
4521
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(entry) {
|
4522
|
+
return _regeneratorRuntime().wrap(function _callee51$(_context52) {
|
4523
|
+
while (1) switch (_context52.prev = _context52.next) {
|
4485
4524
|
case 0:
|
4486
|
-
return
|
4525
|
+
return _context52.abrupt("return", _extends({
|
4487
4526
|
lockboxOwnerUuid: grant.lockboxOwnerUuid,
|
4488
4527
|
lockboxUuid: grant.lockboxUuid
|
4489
4528
|
}, entry));
|
4490
4529
|
case 1:
|
4491
4530
|
case "end":
|
4492
|
-
return
|
4531
|
+
return _context52.stop();
|
4493
4532
|
}
|
4494
|
-
},
|
4533
|
+
}, _callee51);
|
4495
4534
|
}));
|
4496
4535
|
return function (_x123) {
|
4497
4536
|
return _ref7.apply(this, arguments);
|
@@ -4499,14 +4538,14 @@ var OroClient = /*#__PURE__*/function () {
|
|
4499
4538
|
}()));
|
4500
4539
|
});
|
4501
4540
|
}).flat();
|
4502
|
-
return
|
4541
|
+
return _context53.abrupt("return", _context53.t0.all.call(_context53.t0, _context53.t1).then(function (data) {
|
4503
4542
|
return data.flat();
|
4504
4543
|
}));
|
4505
4544
|
case 5:
|
4506
4545
|
case "end":
|
4507
|
-
return
|
4546
|
+
return _context53.stop();
|
4508
4547
|
}
|
4509
|
-
},
|
4548
|
+
}, _callee52, this);
|
4510
4549
|
}));
|
4511
4550
|
function getPatientDocumentsList(_x120, _x121, _x122) {
|
4512
4551
|
return _getPatientDocumentsList.apply(this, arguments);
|
@@ -4528,15 +4567,15 @@ var OroClient = /*#__PURE__*/function () {
|
|
4528
4567
|
_proto.recoverPrivateKeyFromSecurityQuestions =
|
4529
4568
|
/*#__PURE__*/
|
4530
4569
|
function () {
|
4531
|
-
var _recoverPrivateKeyFromSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4570
|
+
var _recoverPrivateKeyFromSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
|
4532
4571
|
var shards, answeredShards, privateKey;
|
4533
|
-
return _regeneratorRuntime().wrap(function
|
4534
|
-
while (1) switch (
|
4572
|
+
return _regeneratorRuntime().wrap(function _callee53$(_context54) {
|
4573
|
+
while (1) switch (_context54.prev = _context54.next) {
|
4535
4574
|
case 0:
|
4536
|
-
|
4575
|
+
_context54.next = 2;
|
4537
4576
|
return this.guardClient.identityGet(id);
|
4538
4577
|
case 2:
|
4539
|
-
shards =
|
4578
|
+
shards = _context54.sent.recoverySecurityQuestions;
|
4540
4579
|
answeredShards = shards.filter(function (shard) {
|
4541
4580
|
// filters all answered security questions
|
4542
4581
|
var indexOfQuestion = recoverySecurityQuestions.indexOf(shard.securityQuestion);
|
@@ -4557,9 +4596,9 @@ var OroClient = /*#__PURE__*/function () {
|
|
4557
4596
|
}
|
4558
4597
|
case 5:
|
4559
4598
|
case "end":
|
4560
|
-
return
|
4599
|
+
return _context54.stop();
|
4561
4600
|
}
|
4562
|
-
},
|
4601
|
+
}, _callee53, this);
|
4563
4602
|
}));
|
4564
4603
|
function recoverPrivateKeyFromSecurityQuestions(_x124, _x125, _x126, _x127) {
|
4565
4604
|
return _recoverPrivateKeyFromSecurityQuestions.apply(this, arguments);
|
@@ -4576,15 +4615,15 @@ var OroClient = /*#__PURE__*/function () {
|
|
4576
4615
|
_proto.recoverPrivateKeyFromPassword =
|
4577
4616
|
/*#__PURE__*/
|
4578
4617
|
function () {
|
4579
|
-
var _recoverPrivateKeyFromPassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4618
|
+
var _recoverPrivateKeyFromPassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(id, password) {
|
4580
4619
|
var identity, recoveryPayload, symmetricDecryptor, privateKey, symetricEncryptor;
|
4581
|
-
return _regeneratorRuntime().wrap(function
|
4582
|
-
while (1) switch (
|
4620
|
+
return _regeneratorRuntime().wrap(function _callee54$(_context55) {
|
4621
|
+
while (1) switch (_context55.prev = _context55.next) {
|
4583
4622
|
case 0:
|
4584
|
-
|
4623
|
+
_context55.next = 2;
|
4585
4624
|
return this.guardClient.identityGet(id);
|
4586
4625
|
case 2:
|
4587
|
-
identity =
|
4626
|
+
identity = _context55.sent;
|
4588
4627
|
recoveryPayload = identity.recoveryPassword;
|
4589
4628
|
symmetricDecryptor = this.toolbox.CryptoChaCha.fromPassphrase(password);
|
4590
4629
|
privateKey = symmetricDecryptor.base64PayloadDecryptToBytes(recoveryPayload);
|
@@ -4596,9 +4635,9 @@ var OroClient = /*#__PURE__*/function () {
|
|
4596
4635
|
this.rsa = this.toolbox.CryptoRSA.fromKey(privateKey);
|
4597
4636
|
case 8:
|
4598
4637
|
case "end":
|
4599
|
-
return
|
4638
|
+
return _context55.stop();
|
4600
4639
|
}
|
4601
|
-
},
|
4640
|
+
}, _callee54, this);
|
4602
4641
|
}));
|
4603
4642
|
function recoverPrivateKeyFromPassword(_x128, _x129) {
|
4604
4643
|
return _recoverPrivateKeyFromPassword.apply(this, arguments);
|
@@ -4615,23 +4654,23 @@ var OroClient = /*#__PURE__*/function () {
|
|
4615
4654
|
_proto.recoverPrivateKeyFromMasterKey =
|
4616
4655
|
/*#__PURE__*/
|
4617
4656
|
function () {
|
4618
|
-
var _recoverPrivateKeyFromMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4657
|
+
var _recoverPrivateKeyFromMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55(id, masterKey) {
|
4619
4658
|
var recoveryPayload, symmetricDecryptor, privateKey;
|
4620
|
-
return _regeneratorRuntime().wrap(function
|
4621
|
-
while (1) switch (
|
4659
|
+
return _regeneratorRuntime().wrap(function _callee55$(_context56) {
|
4660
|
+
while (1) switch (_context56.prev = _context56.next) {
|
4622
4661
|
case 0:
|
4623
|
-
|
4662
|
+
_context56.next = 2;
|
4624
4663
|
return this.guardClient.identityGet(id);
|
4625
4664
|
case 2:
|
4626
|
-
recoveryPayload =
|
4665
|
+
recoveryPayload = _context56.sent.recoveryMasterKey;
|
4627
4666
|
symmetricDecryptor = this.toolbox.CryptoChaCha.fromPassphrase(masterKey);
|
4628
4667
|
privateKey = symmetricDecryptor.base64PayloadDecryptToBytes(recoveryPayload);
|
4629
4668
|
this.rsa = this.toolbox.CryptoRSA.fromKey(privateKey);
|
4630
4669
|
case 6:
|
4631
4670
|
case "end":
|
4632
|
-
return
|
4671
|
+
return _context56.stop();
|
4633
4672
|
}
|
4634
|
-
},
|
4673
|
+
}, _callee55, this);
|
4635
4674
|
}));
|
4636
4675
|
function recoverPrivateKeyFromMasterKey(_x130, _x131) {
|
4637
4676
|
return _recoverPrivateKeyFromMasterKey.apply(this, arguments);
|
@@ -4650,13 +4689,13 @@ var OroClient = /*#__PURE__*/function () {
|
|
4650
4689
|
_proto.updateSecurityQuestions =
|
4651
4690
|
/*#__PURE__*/
|
4652
4691
|
function () {
|
4653
|
-
var _updateSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4692
|
+
var _updateSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
|
4654
4693
|
var securityQuestionPayload, updateRequest;
|
4655
|
-
return _regeneratorRuntime().wrap(function
|
4656
|
-
while (1) switch (
|
4694
|
+
return _regeneratorRuntime().wrap(function _callee56$(_context57) {
|
4695
|
+
while (1) switch (_context57.prev = _context57.next) {
|
4657
4696
|
case 0:
|
4658
4697
|
if (this.rsa) {
|
4659
|
-
|
4698
|
+
_context57.next = 2;
|
4660
4699
|
break;
|
4661
4700
|
}
|
4662
4701
|
throw IncompleteAuthentication;
|
@@ -4665,15 +4704,15 @@ var OroClient = /*#__PURE__*/function () {
|
|
4665
4704
|
updateRequest = {
|
4666
4705
|
recoverySecurityQuestions: securityQuestionPayload
|
4667
4706
|
};
|
4668
|
-
|
4707
|
+
_context57.next = 6;
|
4669
4708
|
return this.guardClient.identityUpdate(id, updateRequest);
|
4670
4709
|
case 6:
|
4671
|
-
return
|
4710
|
+
return _context57.abrupt("return", _context57.sent);
|
4672
4711
|
case 7:
|
4673
4712
|
case "end":
|
4674
|
-
return
|
4713
|
+
return _context57.stop();
|
4675
4714
|
}
|
4676
|
-
},
|
4715
|
+
}, _callee56, this);
|
4677
4716
|
}));
|
4678
4717
|
function updateSecurityQuestions(_x132, _x133, _x134, _x135) {
|
4679
4718
|
return _updateSecurityQuestions.apply(this, arguments);
|
@@ -4695,13 +4734,13 @@ var OroClient = /*#__PURE__*/function () {
|
|
4695
4734
|
_proto.updatePassword =
|
4696
4735
|
/*#__PURE__*/
|
4697
4736
|
function () {
|
4698
|
-
var _updatePassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4737
|
+
var _updatePassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee57(id, newPassword, oldPassword) {
|
4699
4738
|
var symmetricEncryptor, passwordPayload, updateRequest;
|
4700
|
-
return _regeneratorRuntime().wrap(function
|
4701
|
-
while (1) switch (
|
4739
|
+
return _regeneratorRuntime().wrap(function _callee57$(_context58) {
|
4740
|
+
while (1) switch (_context58.prev = _context58.next) {
|
4702
4741
|
case 0:
|
4703
4742
|
if (this.rsa) {
|
4704
|
-
|
4743
|
+
_context58.next = 2;
|
4705
4744
|
break;
|
4706
4745
|
}
|
4707
4746
|
throw IncompleteAuthentication;
|
@@ -4719,15 +4758,15 @@ var OroClient = /*#__PURE__*/function () {
|
|
4719
4758
|
},
|
4720
4759
|
recoveryPassword: passwordPayload
|
4721
4760
|
};
|
4722
|
-
|
4761
|
+
_context58.next = 9;
|
4723
4762
|
return this.guardClient.identityUpdate(id, updateRequest);
|
4724
4763
|
case 9:
|
4725
|
-
return
|
4764
|
+
return _context58.abrupt("return", _context58.sent);
|
4726
4765
|
case 10:
|
4727
4766
|
case "end":
|
4728
|
-
return
|
4767
|
+
return _context58.stop();
|
4729
4768
|
}
|
4730
|
-
},
|
4769
|
+
}, _callee57, this);
|
4731
4770
|
}));
|
4732
4771
|
function updatePassword(_x136, _x137, _x138) {
|
4733
4772
|
return _updatePassword.apply(this, arguments);
|
@@ -4746,13 +4785,13 @@ var OroClient = /*#__PURE__*/function () {
|
|
4746
4785
|
_proto.updateMasterKey =
|
4747
4786
|
/*#__PURE__*/
|
4748
4787
|
function () {
|
4749
|
-
var _updateMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
4788
|
+
var _updateMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee58(id, masterKey, lockboxUuid) {
|
4750
4789
|
var symmetricEncryptor, masterKeyPayload, updateRequest, updatedIdentity;
|
4751
|
-
return _regeneratorRuntime().wrap(function
|
4752
|
-
while (1) switch (
|
4790
|
+
return _regeneratorRuntime().wrap(function _callee58$(_context59) {
|
4791
|
+
while (1) switch (_context59.prev = _context59.next) {
|
4753
4792
|
case 0:
|
4754
4793
|
if (this.rsa) {
|
4755
|
-
|
4794
|
+
_context59.next = 2;
|
4756
4795
|
break;
|
4757
4796
|
}
|
4758
4797
|
throw IncompleteAuthentication;
|
@@ -4762,11 +4801,11 @@ var OroClient = /*#__PURE__*/function () {
|
|
4762
4801
|
updateRequest = {
|
4763
4802
|
recoveryMasterKey: masterKeyPayload
|
4764
4803
|
};
|
4765
|
-
|
4804
|
+
_context59.next = 7;
|
4766
4805
|
return this.guardClient.identityUpdate(id, updateRequest);
|
4767
4806
|
case 7:
|
4768
|
-
updatedIdentity =
|
4769
|
-
|
4807
|
+
updatedIdentity = _context59.sent;
|
4808
|
+
_context59.next = 10;
|
4770
4809
|
return this.getOrInsertJsonData(lockboxUuid, {
|
4771
4810
|
masterKey: masterKey
|
4772
4811
|
}, {
|
@@ -4778,12 +4817,12 @@ var OroClient = /*#__PURE__*/function () {
|
|
4778
4817
|
updateMedicalStatus: false
|
4779
4818
|
});
|
4780
4819
|
case 10:
|
4781
|
-
return
|
4820
|
+
return _context59.abrupt("return", updatedIdentity);
|
4782
4821
|
case 11:
|
4783
4822
|
case "end":
|
4784
|
-
return
|
4823
|
+
return _context59.stop();
|
4785
4824
|
}
|
4786
|
-
},
|
4825
|
+
}, _callee58, this);
|
4787
4826
|
}));
|
4788
4827
|
function updateMasterKey(_x139, _x140, _x141) {
|
4789
4828
|
return _updateMasterKey.apply(this, arguments);
|