oro-sdk 7.5.0 → 8.0.0

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