oro-sdk-apis 4.2.1 → 4.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -446,21 +446,19 @@ var AxiosService = /*#__PURE__*/function () {
446
446
  _proto.apiRequest = /*#__PURE__*/function () {
447
447
  var _apiRequest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(config, url, data) {
448
448
  return _regeneratorRuntime().wrap(function _callee$(_context) {
449
- while (1) {
450
- switch (_context.prev = _context.next) {
451
- case 0:
452
- if (!config.headers) config.headers = {};
453
- config.headers['Content-Type'] = 'application/json';
454
- return _context.abrupt("return", this.axios(_extends({}, config, {
455
- url: url,
456
- data: data
457
- })).then(function (res) {
458
- return res.data;
459
- }));
460
- case 3:
461
- case "end":
462
- return _context.stop();
463
- }
449
+ while (1) switch (_context.prev = _context.next) {
450
+ case 0:
451
+ if (!config.headers) config.headers = {};
452
+ config.headers['Content-Type'] = 'application/json';
453
+ return _context.abrupt("return", this.axios(_extends({}, config, {
454
+ url: url,
455
+ data: data
456
+ })).then(function (res) {
457
+ return res.data;
458
+ }));
459
+ case 3:
460
+ case "end":
461
+ return _context.stop();
464
462
  }
465
463
  }, _callee, this);
466
464
  }));
@@ -472,25 +470,23 @@ var AxiosService = /*#__PURE__*/function () {
472
470
  _proto.apiRequestHeader = /*#__PURE__*/function () {
473
471
  var _apiRequestHeader = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(config, url, headerToRetrieve, data) {
474
472
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
475
- while (1) {
476
- switch (_context2.prev = _context2.next) {
477
- case 0:
478
- if (!config.headers) config.headers = {};
479
- config.headers['Content-Type'] = 'application/json';
480
- return _context2.abrupt("return", this.axios(_extends({}, config, {
481
- url: url,
482
- data: data
483
- })).then(function (res) {
484
- if (headerToRetrieve) {
485
- var _res$headers$headerTo;
486
- return (_res$headers$headerTo = res.headers[headerToRetrieve]) != null ? _res$headers$headerTo : res.headers[headerToRetrieve.toLowerCase()];
487
- }
488
- return res.headers;
489
- }));
490
- case 3:
491
- case "end":
492
- return _context2.stop();
493
- }
473
+ while (1) switch (_context2.prev = _context2.next) {
474
+ case 0:
475
+ if (!config.headers) config.headers = {};
476
+ config.headers['Content-Type'] = 'application/json';
477
+ return _context2.abrupt("return", this.axios(_extends({}, config, {
478
+ url: url,
479
+ data: data
480
+ })).then(function (res) {
481
+ if (headerToRetrieve) {
482
+ var _res$headers$headerTo;
483
+ return (_res$headers$headerTo = res.headers[headerToRetrieve]) != null ? _res$headers$headerTo : res.headers[headerToRetrieve.toLowerCase()];
484
+ }
485
+ return res.headers;
486
+ }));
487
+ case 3:
488
+ case "end":
489
+ return _context2.stop();
494
490
  }
495
491
  }, _callee2, this);
496
492
  }));
@@ -560,37 +556,35 @@ var APIService = /*#__PURE__*/function (_AxiosService) {
560
556
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(failedRequest) {
561
557
  var tokenResp;
562
558
  return _regeneratorRuntime().wrap(function _callee$(_context) {
563
- while (1) {
564
- switch (_context.prev = _context.next) {
565
- case 0:
566
- if (!self.authRefreshFn) {
567
- _context.next = 15;
568
- break;
569
- }
570
- _context.prev = 1;
571
- _context.next = 4;
572
- return self.authRefreshFn(self.getTokens().refreshToken);
573
- case 4:
574
- tokenResp = _context.sent;
575
- self.setTokens({
576
- accessToken: tokenResp.accessToken,
577
- refreshToken: tokenResp.refreshToken
578
- });
579
- failedRequest.response.config.headers['Authorization'] = "Bearer " + self.getTokens().accessToken;
580
- return _context.abrupt("return", Promise.resolve());
581
- case 10:
582
- _context.prev = 10;
583
- _context.t0 = _context["catch"](1);
584
- console.error('an error occured while refreshing tokens (notifying callback)', _context.t0);
585
- if (self.tokenRefreshFailureCallback) self.tokenRefreshFailureCallback(failedRequest);
586
- return _context.abrupt("return", Promise.resolve());
587
- case 15:
588
- console.error('The request could not refresh the token (authRefreshFn was not set)', failedRequest);
589
- return _context.abrupt("return", Promise.resolve());
590
- case 17:
591
- case "end":
592
- return _context.stop();
593
- }
559
+ while (1) switch (_context.prev = _context.next) {
560
+ case 0:
561
+ if (!self.authRefreshFn) {
562
+ _context.next = 15;
563
+ break;
564
+ }
565
+ _context.prev = 1;
566
+ _context.next = 4;
567
+ return self.authRefreshFn(self.getTokens().refreshToken);
568
+ case 4:
569
+ tokenResp = _context.sent;
570
+ self.setTokens({
571
+ accessToken: tokenResp.accessToken,
572
+ refreshToken: tokenResp.refreshToken
573
+ });
574
+ failedRequest.response.config.headers['Authorization'] = "Bearer " + self.getTokens().accessToken;
575
+ return _context.abrupt("return", Promise.resolve());
576
+ case 10:
577
+ _context.prev = 10;
578
+ _context.t0 = _context["catch"](1);
579
+ console.error('an error occured while refreshing tokens (notifying callback)', _context.t0);
580
+ if (self.tokenRefreshFailureCallback) self.tokenRefreshFailureCallback(failedRequest);
581
+ return _context.abrupt("return", Promise.resolve());
582
+ case 15:
583
+ console.error('The request could not refresh the token (authRefreshFn was not set)', failedRequest);
584
+ return _context.abrupt("return", Promise.resolve());
585
+ case 17:
586
+ case "end":
587
+ return _context.stop();
594
588
  }
595
589
  }, _callee, null, [[1, 10]]);
596
590
  }));
@@ -660,57 +654,53 @@ var ApisPracticeManager = /*#__PURE__*/function () {
660
654
  var _this = this;
661
655
  var cacheKey, practiceInstance, newPracticeInstance, authTokenFunc;
662
656
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
663
- while (1) {
664
- switch (_context2.prev = _context2.next) {
665
- case 0:
666
- cacheKey = practiceUuid != null ? practiceUuid : 'none';
667
- practiceInstance = this.practiceInstances.get(cacheKey);
668
- if (!practiceInstance) {
669
- _context2.next = 4;
670
- break;
671
- }
672
- return _context2.abrupt("return", practiceInstance);
673
- case 4:
674
- newPracticeInstance = init(this.serviceCollReq, undefined, this.useLocalStorage); // Create one auth token callback per practice since the practice uuid needs to change
675
- authTokenFunc = /*#__PURE__*/function () {
676
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
677
- return _regeneratorRuntime().wrap(function _callee$(_context) {
678
- while (1) {
679
- switch (_context.prev = _context.next) {
680
- case 0:
681
- if (!newPracticeInstance.guardService) {
682
- _context.next = 7;
683
- break;
684
- }
685
- console.log("\x1B[36m[Auth] Refresh auth called (practiceUuid: " + practiceUuid + ")\x1B[36m");
686
- _context.next = 4;
687
- return _this.getAuthTokenCbk(newPracticeInstance.guardService, practiceUuid);
688
- case 4:
689
- return _context.abrupt("return", _context.sent);
690
- case 7:
691
- throw Error('[Auth] Unable to refresh token guard service is undefined');
692
- case 8:
693
- case "end":
694
- return _context.stop();
657
+ while (1) switch (_context2.prev = _context2.next) {
658
+ case 0:
659
+ cacheKey = practiceUuid != null ? practiceUuid : 'none';
660
+ practiceInstance = this.practiceInstances.get(cacheKey);
661
+ if (!practiceInstance) {
662
+ _context2.next = 4;
663
+ break;
664
+ }
665
+ return _context2.abrupt("return", practiceInstance);
666
+ case 4:
667
+ newPracticeInstance = init(this.serviceCollReq, undefined, this.useLocalStorage); // Create one auth token callback per practice since the practice uuid needs to change
668
+ authTokenFunc = /*#__PURE__*/function () {
669
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
670
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
671
+ while (1) switch (_context.prev = _context.next) {
672
+ case 0:
673
+ if (!newPracticeInstance.guardService) {
674
+ _context.next = 7;
675
+ break;
695
676
  }
696
- }
697
- }, _callee);
698
- }));
699
- return function authTokenFunc() {
700
- return _ref.apply(this, arguments);
701
- };
702
- }(); // Initialize the M2M token
703
- _context2.next = 8;
704
- return authTokenFunc();
705
- case 8:
706
- // Set the refresh tokens callback
707
- newPracticeInstance.apiService.setAuthRefreshFn(authTokenFunc);
708
- this.practiceInstances.set(cacheKey, newPracticeInstance);
709
- return _context2.abrupt("return", newPracticeInstance);
710
- case 11:
711
- case "end":
712
- return _context2.stop();
713
- }
677
+ console.log("\x1B[36m[Auth] Refresh auth called (practiceUuid: " + practiceUuid + ")\x1B[36m");
678
+ _context.next = 4;
679
+ return _this.getAuthTokenCbk(newPracticeInstance.guardService, practiceUuid);
680
+ case 4:
681
+ return _context.abrupt("return", _context.sent);
682
+ case 7:
683
+ throw Error('[Auth] Unable to refresh token guard service is undefined');
684
+ case 8:
685
+ case "end":
686
+ return _context.stop();
687
+ }
688
+ }, _callee);
689
+ }));
690
+ return function authTokenFunc() {
691
+ return _ref.apply(this, arguments);
692
+ };
693
+ }(); // Initialize the M2M token
694
+ _context2.next = 8;
695
+ return authTokenFunc();
696
+ case 8:
697
+ // Set the refresh tokens callback
698
+ newPracticeInstance.apiService.setAuthRefreshFn(authTokenFunc);
699
+ this.practiceInstances.set(cacheKey, newPracticeInstance);
700
+ return _context2.abrupt("return", newPracticeInstance);
701
+ case 11:
702
+ case "end":
703
+ return _context2.stop();
714
704
  }
715
705
  }, _callee2, this);
716
706
  }));
@@ -1359,24 +1349,22 @@ var DiagnosisService = /*#__PURE__*/function () {
1359
1349
  var _getAllDrugs = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(uuidPractice) {
1360
1350
  var res;
1361
1351
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1362
- while (1) {
1363
- switch (_context.prev = _context.next) {
1364
- case 0:
1365
- _context.next = 2;
1366
- return this.api.get(this.baseURL + "/v1/drugs/practice/" + uuidPractice);
1367
- case 2:
1368
- res = _context.sent;
1369
- if (!(res && res.foundDrugs)) {
1370
- _context.next = 5;
1371
- break;
1372
- }
1373
- return _context.abrupt("return", res.foundDrugs);
1374
- case 5:
1375
- return _context.abrupt("return", undefined);
1376
- case 6:
1377
- case "end":
1378
- return _context.stop();
1379
- }
1352
+ while (1) switch (_context.prev = _context.next) {
1353
+ case 0:
1354
+ _context.next = 2;
1355
+ return this.api.get(this.baseURL + "/v1/drugs/practice/" + uuidPractice);
1356
+ case 2:
1357
+ res = _context.sent;
1358
+ if (!(res && res.foundDrugs)) {
1359
+ _context.next = 5;
1360
+ break;
1361
+ }
1362
+ return _context.abrupt("return", res.foundDrugs);
1363
+ case 5:
1364
+ return _context.abrupt("return", undefined);
1365
+ case 6:
1366
+ case "end":
1367
+ return _context.stop();
1380
1368
  }
1381
1369
  }, _callee, this);
1382
1370
  }));
@@ -1423,48 +1411,46 @@ var GuardService = /*#__PURE__*/function () {
1423
1411
  var _m2mToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(req) {
1424
1412
  var resp, config, _e$response, code;
1425
1413
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1426
- while (1) {
1427
- switch (_context.prev = _context.next) {
1428
- case 0:
1429
- _context.prev = 0;
1430
- config = {
1431
- skipAuthRefresh: true
1432
- };
1433
- _context.next = 4;
1434
- return this.api.post(this.baseURL + "/v1/m2m/token", req, config);
1435
- case 4:
1436
- resp = _context.sent;
1437
- this.api.setTokens({
1438
- accessToken: resp.accessToken
1439
- });
1440
- _context.next = 20;
1441
- break;
1442
- case 8:
1443
- _context.prev = 8;
1444
- _context.t0 = _context["catch"](0);
1445
- console.error('Error while posting m2m token:', _context.t0);
1446
- if (!_context.t0.isAxiosError) {
1447
- _context.next = 19;
1448
- break;
1449
- }
1450
- code = (_e$response = _context.t0.response) == null ? void 0 : _e$response.status;
1451
- _context.t1 = code;
1452
- _context.next = _context.t1 === 400 ? 16 : _context.t1 === 500 ? 17 : _context.t1 === 401 ? 18 : 18;
1414
+ while (1) switch (_context.prev = _context.next) {
1415
+ case 0:
1416
+ _context.prev = 0;
1417
+ config = {
1418
+ skipAuthRefresh: true
1419
+ };
1420
+ _context.next = 4;
1421
+ return this.api.post(this.baseURL + "/v1/m2m/token", req, config);
1422
+ case 4:
1423
+ resp = _context.sent;
1424
+ this.api.setTokens({
1425
+ accessToken: resp.accessToken
1426
+ });
1427
+ _context.next = 20;
1428
+ break;
1429
+ case 8:
1430
+ _context.prev = 8;
1431
+ _context.t0 = _context["catch"](0);
1432
+ console.error('Error while posting m2m token:', _context.t0);
1433
+ if (!_context.t0.isAxiosError) {
1434
+ _context.next = 19;
1453
1435
  break;
1454
- case 16:
1455
- throw new AuthenticationBadRequest();
1456
- case 17:
1457
- throw new AuthenticationServerError();
1458
- case 18:
1459
- throw new AuthenticationFailed();
1460
- case 19:
1461
- throw new AuthenticationFailed();
1462
- case 20:
1463
- return _context.abrupt("return", resp);
1464
- case 21:
1465
- case "end":
1466
- return _context.stop();
1467
- }
1436
+ }
1437
+ code = (_e$response = _context.t0.response) == null ? void 0 : _e$response.status;
1438
+ _context.t1 = code;
1439
+ _context.next = _context.t1 === 400 ? 16 : _context.t1 === 500 ? 17 : _context.t1 === 401 ? 18 : 18;
1440
+ break;
1441
+ case 16:
1442
+ throw new AuthenticationBadRequest();
1443
+ case 17:
1444
+ throw new AuthenticationServerError();
1445
+ case 18:
1446
+ throw new AuthenticationFailed();
1447
+ case 19:
1448
+ throw new AuthenticationFailed();
1449
+ case 20:
1450
+ return _context.abrupt("return", resp);
1451
+ case 21:
1452
+ case "end":
1453
+ return _context.stop();
1468
1454
  }
1469
1455
  }, _callee, this, [[0, 8]]);
1470
1456
  }));
@@ -1487,51 +1473,49 @@ var GuardService = /*#__PURE__*/function () {
1487
1473
  var _authToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(req) {
1488
1474
  var resp, config, _e$response2, code;
1489
1475
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1490
- while (1) {
1491
- switch (_context2.prev = _context2.next) {
1492
- case 0:
1493
- _context2.prev = 0;
1494
- config = {
1495
- skipAuthRefresh: true
1496
- };
1497
- _context2.next = 4;
1498
- return this.api.post(this.baseURL + "/v1/auth/token", req, config);
1499
- case 4:
1500
- resp = _context2.sent;
1501
- this.api.setTokens({
1502
- accessToken: resp.accessToken,
1503
- refreshToken: resp.refreshToken
1504
- });
1505
- _context2.next = 21;
1506
- break;
1507
- case 8:
1508
- _context2.prev = 8;
1509
- _context2.t0 = _context2["catch"](0);
1510
- console.error('Error while posting auth token:', _context2.t0);
1511
- if (!_context2.t0.isAxiosError) {
1512
- _context2.next = 20;
1513
- break;
1514
- }
1515
- code = (_e$response2 = _context2.t0.response) == null ? void 0 : _e$response2.status;
1516
- _context2.t1 = code;
1517
- _context2.next = _context2.t1 === 400 ? 16 : _context2.t1 === 424 ? 17 : _context2.t1 === 500 ? 18 : _context2.t1 === 401 ? 19 : 19;
1476
+ while (1) switch (_context2.prev = _context2.next) {
1477
+ case 0:
1478
+ _context2.prev = 0;
1479
+ config = {
1480
+ skipAuthRefresh: true
1481
+ };
1482
+ _context2.next = 4;
1483
+ return this.api.post(this.baseURL + "/v1/auth/token", req, config);
1484
+ case 4:
1485
+ resp = _context2.sent;
1486
+ this.api.setTokens({
1487
+ accessToken: resp.accessToken,
1488
+ refreshToken: resp.refreshToken
1489
+ });
1490
+ _context2.next = 21;
1491
+ break;
1492
+ case 8:
1493
+ _context2.prev = 8;
1494
+ _context2.t0 = _context2["catch"](0);
1495
+ console.error('Error while posting auth token:', _context2.t0);
1496
+ if (!_context2.t0.isAxiosError) {
1497
+ _context2.next = 20;
1518
1498
  break;
1519
- case 16:
1520
- throw new AuthenticationBadRequest();
1521
- case 17:
1522
- throw new AuthenticationUnconfirmedEmail();
1523
- case 18:
1524
- throw new AuthenticationServerError();
1525
- case 19:
1526
- throw new AuthenticationFailed();
1527
- case 20:
1528
- throw new AuthenticationFailed();
1529
- case 21:
1530
- return _context2.abrupt("return", resp);
1531
- case 22:
1532
- case "end":
1533
- return _context2.stop();
1534
- }
1499
+ }
1500
+ code = (_e$response2 = _context2.t0.response) == null ? void 0 : _e$response2.status;
1501
+ _context2.t1 = code;
1502
+ _context2.next = _context2.t1 === 400 ? 16 : _context2.t1 === 424 ? 17 : _context2.t1 === 500 ? 18 : _context2.t1 === 401 ? 19 : 19;
1503
+ break;
1504
+ case 16:
1505
+ throw new AuthenticationBadRequest();
1506
+ case 17:
1507
+ throw new AuthenticationUnconfirmedEmail();
1508
+ case 18:
1509
+ throw new AuthenticationServerError();
1510
+ case 19:
1511
+ throw new AuthenticationFailed();
1512
+ case 20:
1513
+ throw new AuthenticationFailed();
1514
+ case 21:
1515
+ return _context2.abrupt("return", resp);
1516
+ case 22:
1517
+ case "end":
1518
+ return _context2.stop();
1535
1519
  }
1536
1520
  }, _callee2, this, [[0, 8]]);
1537
1521
  }));
@@ -1552,18 +1536,16 @@ var GuardService = /*#__PURE__*/function () {
1552
1536
  var _authRefresh = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(refreshToken) {
1553
1537
  var config;
1554
1538
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1555
- while (1) {
1556
- switch (_context3.prev = _context3.next) {
1557
- case 0:
1558
- config = {
1559
- skipAuthRefresh: true,
1560
- useRefreshToken: true
1561
- };
1562
- return _context3.abrupt("return", this.api.put(this.baseURL + "/v1/auth/token", null, config));
1563
- case 2:
1564
- case "end":
1565
- return _context3.stop();
1566
- }
1539
+ while (1) switch (_context3.prev = _context3.next) {
1540
+ case 0:
1541
+ config = {
1542
+ skipAuthRefresh: true,
1543
+ useRefreshToken: true
1544
+ };
1545
+ return _context3.abrupt("return", this.api.put(this.baseURL + "/v1/auth/token", null, config));
1546
+ case 2:
1547
+ case "end":
1548
+ return _context3.stop();
1567
1549
  }
1568
1550
  }, _callee3, this);
1569
1551
  }));
@@ -1583,14 +1565,12 @@ var GuardService = /*#__PURE__*/function () {
1583
1565
  function () {
1584
1566
  var _authLogout = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
1585
1567
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1586
- while (1) {
1587
- switch (_context4.prev = _context4.next) {
1588
- case 0:
1589
- return _context4.abrupt("return", this.api.get(this.baseURL + "/v1/auth/logout"));
1590
- case 1:
1591
- case "end":
1592
- return _context4.stop();
1593
- }
1568
+ while (1) switch (_context4.prev = _context4.next) {
1569
+ case 0:
1570
+ return _context4.abrupt("return", this.api.get(this.baseURL + "/v1/auth/logout"));
1571
+ case 1:
1572
+ case "end":
1573
+ return _context4.stop();
1594
1574
  }
1595
1575
  }, _callee4, this);
1596
1576
  }));
@@ -1611,14 +1591,12 @@ var GuardService = /*#__PURE__*/function () {
1611
1591
  function () {
1612
1592
  var _authRecover = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(req) {
1613
1593
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
1614
- while (1) {
1615
- switch (_context5.prev = _context5.next) {
1616
- case 0:
1617
- return _context5.abrupt("return", this.api.post(this.baseURL + "/v1/auth/recover", req));
1618
- case 1:
1619
- case "end":
1620
- return _context5.stop();
1621
- }
1594
+ while (1) switch (_context5.prev = _context5.next) {
1595
+ case 0:
1596
+ return _context5.abrupt("return", this.api.post(this.baseURL + "/v1/auth/recover", req));
1597
+ case 1:
1598
+ case "end":
1599
+ return _context5.stop();
1622
1600
  }
1623
1601
  }, _callee5, this);
1624
1602
  }));
@@ -1641,44 +1619,42 @@ var GuardService = /*#__PURE__*/function () {
1641
1619
  var _identityCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(req) {
1642
1620
  var resp, _e$response3, code;
1643
1621
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
1644
- while (1) {
1645
- switch (_context6.prev = _context6.next) {
1646
- case 0:
1647
- _context6.prev = 0;
1648
- _context6.next = 3;
1649
- return this.api.post(this.baseURL + "/v1/identities", req);
1650
- case 3:
1651
- resp = _context6.sent;
1652
- this.api.setTokens({
1653
- refreshToken: resp.refreshToken
1654
- });
1655
- _context6.next = 18;
1656
- break;
1657
- case 7:
1658
- _context6.prev = 7;
1659
- _context6.t0 = _context6["catch"](0);
1660
- if (!_context6.t0.isAxiosError) {
1661
- _context6.next = 17;
1662
- break;
1663
- }
1664
- code = (_e$response3 = _context6.t0.response) == null ? void 0 : _e$response3.status;
1665
- _context6.t1 = code;
1666
- _context6.next = _context6.t1 === 400 ? 14 : _context6.t1 === 409 ? 15 : _context6.t1 === 500 ? 16 : 16;
1622
+ while (1) switch (_context6.prev = _context6.next) {
1623
+ case 0:
1624
+ _context6.prev = 0;
1625
+ _context6.next = 3;
1626
+ return this.api.post(this.baseURL + "/v1/identities", req);
1627
+ case 3:
1628
+ resp = _context6.sent;
1629
+ this.api.setTokens({
1630
+ refreshToken: resp.refreshToken
1631
+ });
1632
+ _context6.next = 18;
1633
+ break;
1634
+ case 7:
1635
+ _context6.prev = 7;
1636
+ _context6.t0 = _context6["catch"](0);
1637
+ if (!_context6.t0.isAxiosError) {
1638
+ _context6.next = 17;
1667
1639
  break;
1668
- case 14:
1669
- throw new IdentityCreationBadRequest();
1670
- case 15:
1671
- throw new IdentityCreationConflict();
1672
- case 16:
1673
- throw new IdentityCreationFailed();
1674
- case 17:
1675
- throw new IdentityCreationFailed();
1676
- case 18:
1677
- return _context6.abrupt("return", resp);
1678
- case 19:
1679
- case "end":
1680
- return _context6.stop();
1681
- }
1640
+ }
1641
+ code = (_e$response3 = _context6.t0.response) == null ? void 0 : _e$response3.status;
1642
+ _context6.t1 = code;
1643
+ _context6.next = _context6.t1 === 400 ? 14 : _context6.t1 === 409 ? 15 : _context6.t1 === 500 ? 16 : 16;
1644
+ break;
1645
+ case 14:
1646
+ throw new IdentityCreationBadRequest();
1647
+ case 15:
1648
+ throw new IdentityCreationConflict();
1649
+ case 16:
1650
+ throw new IdentityCreationFailed();
1651
+ case 17:
1652
+ throw new IdentityCreationFailed();
1653
+ case 18:
1654
+ return _context6.abrupt("return", resp);
1655
+ case 19:
1656
+ case "end":
1657
+ return _context6.stop();
1682
1658
  }
1683
1659
  }, _callee6, this, [[0, 7]]);
1684
1660
  }));
@@ -1703,35 +1679,33 @@ var GuardService = /*#__PURE__*/function () {
1703
1679
  var _tokens$accessToken, _tokens$refreshToken;
1704
1680
  var tokens, cacheKey, identity;
1705
1681
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
1706
- while (1) {
1707
- switch (_context7.prev = _context7.next) {
1708
- case 0:
1709
- if (skipCache === void 0) {
1710
- skipCache = false;
1711
- }
1712
- tokens = this.api.getTokens();
1713
- cacheKey = ((_tokens$accessToken = tokens.accessToken) != null ? _tokens$accessToken : '') + ((_tokens$refreshToken = tokens.refreshToken) != null ? _tokens$refreshToken : '') + identityID;
1714
- if (!(skipCache || !tokens.accessToken || !this.identityCache[cacheKey])) {
1715
- _context7.next = 10;
1716
- break;
1717
- }
1718
- _context7.next = 6;
1719
- return this.api.get(this.baseURL + "/v1/identities/" + identityID);
1720
- case 6:
1721
- identity = _context7.sent;
1722
- if (!skipCache) {
1723
- _context7.next = 9;
1724
- break;
1725
- }
1726
- return _context7.abrupt("return", identity);
1727
- case 9:
1728
- this.identityCache[cacheKey] = identity;
1729
- case 10:
1730
- return _context7.abrupt("return", this.identityCache[cacheKey]);
1731
- case 11:
1732
- case "end":
1733
- return _context7.stop();
1734
- }
1682
+ while (1) switch (_context7.prev = _context7.next) {
1683
+ case 0:
1684
+ if (skipCache === void 0) {
1685
+ skipCache = false;
1686
+ }
1687
+ tokens = this.api.getTokens();
1688
+ cacheKey = ((_tokens$accessToken = tokens.accessToken) != null ? _tokens$accessToken : '') + ((_tokens$refreshToken = tokens.refreshToken) != null ? _tokens$refreshToken : '') + identityID;
1689
+ if (!(skipCache || !tokens.accessToken || !this.identityCache[cacheKey])) {
1690
+ _context7.next = 10;
1691
+ break;
1692
+ }
1693
+ _context7.next = 6;
1694
+ return this.api.get(this.baseURL + "/v1/identities/" + identityID);
1695
+ case 6:
1696
+ identity = _context7.sent;
1697
+ if (!skipCache) {
1698
+ _context7.next = 9;
1699
+ break;
1700
+ }
1701
+ return _context7.abrupt("return", identity);
1702
+ case 9:
1703
+ this.identityCache[cacheKey] = identity;
1704
+ case 10:
1705
+ return _context7.abrupt("return", this.identityCache[cacheKey]);
1706
+ case 11:
1707
+ case "end":
1708
+ return _context7.stop();
1735
1709
  }
1736
1710
  }, _callee7, this);
1737
1711
  }));
@@ -1754,27 +1728,25 @@ var GuardService = /*#__PURE__*/function () {
1754
1728
  var _this$api$getTokens$a;
1755
1729
  var cacheKey;
1756
1730
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
1757
- while (1) {
1758
- switch (_context8.prev = _context8.next) {
1759
- case 0:
1760
- if (refreshCache === void 0) {
1761
- refreshCache = false;
1762
- }
1763
- cacheKey = (_this$api$getTokens$a = this.api.getTokens().accessToken) != null ? _this$api$getTokens$a : '';
1764
- if (!(!this.whoAmICache[cacheKey] || refreshCache)) {
1765
- _context8.next = 6;
1766
- break;
1767
- }
1768
- _context8.next = 5;
1769
- return this.api.get(this.baseURL + "/v1/auth/whoami");
1770
- case 5:
1771
- this.whoAmICache[cacheKey] = _context8.sent;
1772
- case 6:
1773
- return _context8.abrupt("return", this.whoAmICache[cacheKey]);
1774
- case 7:
1775
- case "end":
1776
- return _context8.stop();
1777
- }
1731
+ while (1) switch (_context8.prev = _context8.next) {
1732
+ case 0:
1733
+ if (refreshCache === void 0) {
1734
+ refreshCache = false;
1735
+ }
1736
+ cacheKey = (_this$api$getTokens$a = this.api.getTokens().accessToken) != null ? _this$api$getTokens$a : '';
1737
+ if (!(!this.whoAmICache[cacheKey] || refreshCache)) {
1738
+ _context8.next = 6;
1739
+ break;
1740
+ }
1741
+ _context8.next = 5;
1742
+ return this.api.get(this.baseURL + "/v1/auth/whoami");
1743
+ case 5:
1744
+ this.whoAmICache[cacheKey] = _context8.sent;
1745
+ case 6:
1746
+ return _context8.abrupt("return", this.whoAmICache[cacheKey]);
1747
+ case 7:
1748
+ case "end":
1749
+ return _context8.stop();
1778
1750
  }
1779
1751
  }, _callee8, this);
1780
1752
  }));
@@ -1796,14 +1768,12 @@ var GuardService = /*#__PURE__*/function () {
1796
1768
  function () {
1797
1769
  var _identityUpdate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(identityID, req) {
1798
1770
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
1799
- while (1) {
1800
- switch (_context9.prev = _context9.next) {
1801
- case 0:
1802
- return _context9.abrupt("return", this.api.put(this.baseURL + "/v1/identities/" + identityID, req));
1803
- case 1:
1804
- case "end":
1805
- return _context9.stop();
1806
- }
1771
+ while (1) switch (_context9.prev = _context9.next) {
1772
+ case 0:
1773
+ return _context9.abrupt("return", this.api.put(this.baseURL + "/v1/identities/" + identityID, req));
1774
+ case 1:
1775
+ case "end":
1776
+ return _context9.stop();
1807
1777
  }
1808
1778
  }, _callee9, this);
1809
1779
  }));
@@ -1827,21 +1797,19 @@ var GuardService = /*#__PURE__*/function () {
1827
1797
  var _identityMFAQRCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(identityID, password) {
1828
1798
  var req;
1829
1799
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
1830
- while (1) {
1831
- switch (_context10.prev = _context10.next) {
1832
- case 0:
1833
- req = {
1834
- password: password
1835
- };
1836
- return _context10.abrupt("return", this.api.post(this.baseURL + "/v1/identities/" + identityID + "/mfa", req, {
1837
- headers: {
1838
- Accept: 'application/json'
1839
- }
1840
- }));
1841
- case 2:
1842
- case "end":
1843
- return _context10.stop();
1844
- }
1800
+ while (1) switch (_context10.prev = _context10.next) {
1801
+ case 0:
1802
+ req = {
1803
+ password: password
1804
+ };
1805
+ return _context10.abrupt("return", this.api.post(this.baseURL + "/v1/identities/" + identityID + "/mfa", req, {
1806
+ headers: {
1807
+ Accept: 'application/json'
1808
+ }
1809
+ }));
1810
+ case 2:
1811
+ case "end":
1812
+ return _context10.stop();
1845
1813
  }
1846
1814
  }, _callee10, this);
1847
1815
  }));
@@ -1862,14 +1830,12 @@ var GuardService = /*#__PURE__*/function () {
1862
1830
  function () {
1863
1831
  var _identitySendConfirmEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(req) {
1864
1832
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
1865
- while (1) {
1866
- switch (_context11.prev = _context11.next) {
1867
- case 0:
1868
- return _context11.abrupt("return", this.api.post(this.baseURL + "/v1/identity/confirm", req));
1869
- case 1:
1870
- case "end":
1871
- return _context11.stop();
1872
- }
1833
+ while (1) switch (_context11.prev = _context11.next) {
1834
+ case 0:
1835
+ return _context11.abrupt("return", this.api.post(this.baseURL + "/v1/identity/confirm", req));
1836
+ case 1:
1837
+ case "end":
1838
+ return _context11.stop();
1873
1839
  }
1874
1840
  }, _callee11, this);
1875
1841
  }));
@@ -1890,14 +1856,12 @@ var GuardService = /*#__PURE__*/function () {
1890
1856
  function () {
1891
1857
  var _identityGetByCustomerEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(email) {
1892
1858
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
1893
- while (1) {
1894
- switch (_context12.prev = _context12.next) {
1895
- case 0:
1896
- return _context12.abrupt("return", this.identityGetByHash(email.substring(email.indexOf('+') + 1, email.indexOf('@'))));
1897
- case 1:
1898
- case "end":
1899
- return _context12.stop();
1900
- }
1859
+ while (1) switch (_context12.prev = _context12.next) {
1860
+ case 0:
1861
+ return _context12.abrupt("return", this.identityGetByHash(email.substring(email.indexOf('+') + 1, email.indexOf('@'))));
1862
+ case 1:
1863
+ case "end":
1864
+ return _context12.stop();
1901
1865
  }
1902
1866
  }, _callee12, this);
1903
1867
  }));
@@ -1918,14 +1882,12 @@ var GuardService = /*#__PURE__*/function () {
1918
1882
  function () {
1919
1883
  var _identityGetByHash = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(b64Hash) {
1920
1884
  return _regeneratorRuntime().wrap(function _callee13$(_context13) {
1921
- while (1) {
1922
- switch (_context13.prev = _context13.next) {
1923
- case 0:
1924
- return _context13.abrupt("return", this.identityGet(b64Hash.replace(/\+/g, '-').replace(/\//g, '_')));
1925
- case 1:
1926
- case "end":
1927
- return _context13.stop();
1928
- }
1885
+ while (1) switch (_context13.prev = _context13.next) {
1886
+ case 0:
1887
+ return _context13.abrupt("return", this.identityGet(b64Hash.replace(/\+/g, '-').replace(/\//g, '_')));
1888
+ case 1:
1889
+ case "end":
1890
+ return _context13.stop();
1929
1891
  }
1930
1892
  }, _callee13, this);
1931
1893
  }));
@@ -2272,25 +2234,23 @@ var TellerService = /*#__PURE__*/function () {
2272
2234
  _proto.lockboxDataStore = /*#__PURE__*/function () {
2273
2235
  var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid, options) {
2274
2236
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2275
- while (1) {
2276
- switch (_context.prev = _context.next) {
2277
- case 0:
2278
- if (options === void 0) {
2279
- options = {
2280
- updateMedicalStatus: true
2281
- };
2237
+ while (1) switch (_context.prev = _context.next) {
2238
+ case 0:
2239
+ if (options === void 0) {
2240
+ options = {
2241
+ updateMedicalStatus: true
2242
+ };
2243
+ }
2244
+ return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
2245
+ params: {
2246
+ lockbox_owner_uuid: lockboxOwnerUuid,
2247
+ data_uuid: previousDataUuid,
2248
+ update_medical_status: options.updateMedicalStatus
2282
2249
  }
2283
- return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
2284
- params: {
2285
- lockbox_owner_uuid: lockboxOwnerUuid,
2286
- data_uuid: previousDataUuid,
2287
- update_medical_status: options.updateMedicalStatus
2288
- }
2289
- }));
2290
- case 2:
2291
- case "end":
2292
- return _context.stop();
2293
- }
2250
+ }));
2251
+ case 2:
2252
+ case "end":
2253
+ return _context.stop();
2294
2254
  }
2295
2255
  }, _callee, this);
2296
2256
  }));
@@ -2372,14 +2332,12 @@ var VaultService = /*#__PURE__*/function () {
2372
2332
  _proto.lockboxCreate = /*#__PURE__*/function () {
2373
2333
  var _lockboxCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(lockboxMetadata) {
2374
2334
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2375
- while (1) {
2376
- switch (_context.prev = _context.next) {
2377
- case 0:
2378
- return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockbox", lockboxMetadata));
2379
- case 1:
2380
- case "end":
2381
- return _context.stop();
2382
- }
2335
+ while (1) switch (_context.prev = _context.next) {
2336
+ case 0:
2337
+ return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockbox", lockboxMetadata));
2338
+ case 1:
2339
+ case "end":
2340
+ return _context.stop();
2383
2341
  }
2384
2342
  }, _callee, this);
2385
2343
  }));
@@ -2391,18 +2349,16 @@ var VaultService = /*#__PURE__*/function () {
2391
2349
  _proto.lockboxMetadataAdd = /*#__PURE__*/function () {
2392
2350
  var _lockboxMetadataAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(lockboxUuid, lockboxMetadata, lockboxOwnerUuid) {
2393
2351
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2394
- while (1) {
2395
- switch (_context2.prev = _context2.next) {
2396
- case 0:
2397
- return _context2.abrupt("return", this.api.put(this.baseURL + "/v1/lockbox/" + lockboxUuid, lockboxMetadata, {
2398
- params: {
2399
- lockbox_owner_uuid: lockboxOwnerUuid
2400
- }
2401
- }));
2402
- case 1:
2403
- case "end":
2404
- return _context2.stop();
2405
- }
2352
+ while (1) switch (_context2.prev = _context2.next) {
2353
+ case 0:
2354
+ return _context2.abrupt("return", this.api.put(this.baseURL + "/v1/lockbox/" + lockboxUuid, lockboxMetadata, {
2355
+ params: {
2356
+ lockbox_owner_uuid: lockboxOwnerUuid
2357
+ }
2358
+ }));
2359
+ case 1:
2360
+ case "end":
2361
+ return _context2.stop();
2406
2362
  }
2407
2363
  }, _callee2, this);
2408
2364
  }));
@@ -2414,18 +2370,16 @@ var VaultService = /*#__PURE__*/function () {
2414
2370
  _proto.lockboxSecretGet = /*#__PURE__*/function () {
2415
2371
  var _lockboxSecretGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(lockboxUuid, lockboxOwnerUuid) {
2416
2372
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2417
- while (1) {
2418
- switch (_context3.prev = _context3.next) {
2419
- case 0:
2420
- return _context3.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/secret", {
2421
- params: {
2422
- lockbox_owner_uuid: lockboxOwnerUuid
2423
- }
2424
- }));
2425
- case 1:
2426
- case "end":
2427
- return _context3.stop();
2428
- }
2373
+ while (1) switch (_context3.prev = _context3.next) {
2374
+ case 0:
2375
+ return _context3.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/secret", {
2376
+ params: {
2377
+ lockbox_owner_uuid: lockboxOwnerUuid
2378
+ }
2379
+ }));
2380
+ case 1:
2381
+ case "end":
2382
+ return _context3.stop();
2429
2383
  }
2430
2384
  }, _callee3, this);
2431
2385
  }));
@@ -2437,18 +2391,16 @@ var VaultService = /*#__PURE__*/function () {
2437
2391
  _proto.lockboxGrant = /*#__PURE__*/function () {
2438
2392
  var _lockboxGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(lockboxUuid, req, lockboxOwnerUuid) {
2439
2393
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2440
- while (1) {
2441
- switch (_context4.prev = _context4.next) {
2442
- case 0:
2443
- return _context4.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/grant", req, {
2444
- params: {
2445
- lockbox_owner_uuid: lockboxOwnerUuid
2446
- }
2447
- }));
2448
- case 1:
2449
- case "end":
2450
- return _context4.stop();
2451
- }
2394
+ while (1) switch (_context4.prev = _context4.next) {
2395
+ case 0:
2396
+ return _context4.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/grant", req, {
2397
+ params: {
2398
+ lockbox_owner_uuid: lockboxOwnerUuid
2399
+ }
2400
+ }));
2401
+ case 1:
2402
+ case "end":
2403
+ return _context4.stop();
2452
2404
  }
2453
2405
  }, _callee4, this);
2454
2406
  }));
@@ -2468,14 +2420,12 @@ var VaultService = /*#__PURE__*/function () {
2468
2420
  function () {
2469
2421
  var _grantsGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
2470
2422
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2471
- while (1) {
2472
- switch (_context5.prev = _context5.next) {
2473
- case 0:
2474
- return _context5.abrupt("return", this.api.get(this.baseURL + "/v1/grants"));
2475
- case 1:
2476
- case "end":
2477
- return _context5.stop();
2478
- }
2423
+ while (1) switch (_context5.prev = _context5.next) {
2424
+ case 0:
2425
+ return _context5.abrupt("return", this.api.get(this.baseURL + "/v1/grants"));
2426
+ case 1:
2427
+ case "end":
2428
+ return _context5.stop();
2479
2429
  }
2480
2430
  }, _callee5, this);
2481
2431
  }));
@@ -2500,19 +2450,17 @@ var VaultService = /*#__PURE__*/function () {
2500
2450
  function () {
2501
2451
  var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid) {
2502
2452
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
2503
- while (1) {
2504
- switch (_context6.prev = _context6.next) {
2505
- case 0:
2506
- return _context6.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
2507
- params: {
2508
- lockbox_owner_uuid: lockboxOwnerUuid,
2509
- data_uuid: previousDataUuid
2510
- }
2511
- }));
2512
- case 1:
2513
- case "end":
2514
- return _context6.stop();
2515
- }
2453
+ while (1) switch (_context6.prev = _context6.next) {
2454
+ case 0:
2455
+ return _context6.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
2456
+ params: {
2457
+ lockbox_owner_uuid: lockboxOwnerUuid,
2458
+ data_uuid: previousDataUuid
2459
+ }
2460
+ }));
2461
+ case 1:
2462
+ case "end":
2463
+ return _context6.stop();
2516
2464
  }
2517
2465
  }, _callee6, this);
2518
2466
  }));
@@ -2525,34 +2473,32 @@ var VaultService = /*#__PURE__*/function () {
2525
2473
  var _lockboxDataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(lockboxUuid, dataUuid, lockboxOwnerUuid, stream) {
2526
2474
  var data;
2527
2475
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
2528
- while (1) {
2529
- switch (_context7.prev = _context7.next) {
2530
- case 0:
2531
- if (stream === void 0) {
2532
- stream = true;
2533
- }
2534
- _context7.next = 3;
2535
- return this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data/" + dataUuid, {
2536
- params: {
2537
- lockbox_owner_uuid: lockboxOwnerUuid,
2538
- stream: stream
2539
- }
2540
- });
2541
- case 3:
2542
- data = _context7.sent;
2543
- if (!stream) {
2544
- _context7.next = 6;
2545
- break;
2476
+ while (1) switch (_context7.prev = _context7.next) {
2477
+ case 0:
2478
+ if (stream === void 0) {
2479
+ stream = true;
2480
+ }
2481
+ _context7.next = 3;
2482
+ return this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data/" + dataUuid, {
2483
+ params: {
2484
+ lockbox_owner_uuid: lockboxOwnerUuid,
2485
+ stream: stream
2546
2486
  }
2547
- return _context7.abrupt("return", {
2548
- data: data
2549
- });
2550
- case 6:
2551
- return _context7.abrupt("return", data);
2552
- case 7:
2553
- case "end":
2554
- return _context7.stop();
2555
- }
2487
+ });
2488
+ case 3:
2489
+ data = _context7.sent;
2490
+ if (!stream) {
2491
+ _context7.next = 6;
2492
+ break;
2493
+ }
2494
+ return _context7.abrupt("return", {
2495
+ data: data
2496
+ });
2497
+ case 6:
2498
+ return _context7.abrupt("return", data);
2499
+ case 7:
2500
+ case "end":
2501
+ return _context7.stop();
2556
2502
  }
2557
2503
  }, _callee7, this);
2558
2504
  }));
@@ -2564,19 +2510,17 @@ var VaultService = /*#__PURE__*/function () {
2564
2510
  _proto.lockboxManifestGet = /*#__PURE__*/function () {
2565
2511
  var _lockboxManifestGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(lockboxUuid, filter, lockboxOwnerUuid) {
2566
2512
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
2567
- while (1) {
2568
- switch (_context8.prev = _context8.next) {
2569
- case 0:
2570
- return _context8.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid, {
2571
- params: {
2572
- lockbox_owner_uuid: lockboxOwnerUuid,
2573
- filter: filter
2574
- }
2575
- }));
2576
- case 1:
2577
- case "end":
2578
- return _context8.stop();
2579
- }
2513
+ while (1) switch (_context8.prev = _context8.next) {
2514
+ case 0:
2515
+ return _context8.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid, {
2516
+ params: {
2517
+ lockbox_owner_uuid: lockboxOwnerUuid,
2518
+ filter: filter
2519
+ }
2520
+ }));
2521
+ case 1:
2522
+ case "end":
2523
+ return _context8.stop();
2580
2524
  }
2581
2525
  }, _callee8, this);
2582
2526
  }));
@@ -2588,21 +2532,19 @@ var VaultService = /*#__PURE__*/function () {
2588
2532
  _proto.lockboxMetadataGet = /*#__PURE__*/function () {
2589
2533
  var _lockboxMetadataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(lockboxUuid, fields, groupby, filter, lockboxOwnerUuid) {
2590
2534
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
2591
- while (1) {
2592
- switch (_context9.prev = _context9.next) {
2593
- case 0:
2594
- return _context9.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/metadata", {
2595
- params: {
2596
- lockbox_owner_uuid: lockboxOwnerUuid,
2597
- fields: fields,
2598
- groupby: groupby,
2599
- filter: filter
2600
- }
2601
- }));
2602
- case 1:
2603
- case "end":
2604
- return _context9.stop();
2605
- }
2535
+ while (1) switch (_context9.prev = _context9.next) {
2536
+ case 0:
2537
+ return _context9.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/metadata", {
2538
+ params: {
2539
+ lockbox_owner_uuid: lockboxOwnerUuid,
2540
+ fields: fields,
2541
+ groupby: groupby,
2542
+ filter: filter
2543
+ }
2544
+ }));
2545
+ case 1:
2546
+ case "end":
2547
+ return _context9.stop();
2606
2548
  }
2607
2549
  }, _callee9, this);
2608
2550
  }));
@@ -2624,18 +2566,16 @@ var VaultService = /*#__PURE__*/function () {
2624
2566
  function () {
2625
2567
  var _vaultIndexPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(entries, indexOwnerUuid) {
2626
2568
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
2627
- while (1) {
2628
- switch (_context10.prev = _context10.next) {
2629
- case 0:
2630
- return _context10.abrupt("return", this.api.put(this.baseURL + "/v1/index", entries, {
2631
- params: {
2632
- index_owner_uuid: indexOwnerUuid
2633
- }
2634
- }));
2635
- case 1:
2636
- case "end":
2637
- return _context10.stop();
2638
- }
2569
+ while (1) switch (_context10.prev = _context10.next) {
2570
+ case 0:
2571
+ return _context10.abrupt("return", this.api.put(this.baseURL + "/v1/index", entries, {
2572
+ params: {
2573
+ index_owner_uuid: indexOwnerUuid
2574
+ }
2575
+ }));
2576
+ case 1:
2577
+ case "end":
2578
+ return _context10.stop();
2639
2579
  }
2640
2580
  }, _callee10, this);
2641
2581
  }));
@@ -2655,14 +2595,12 @@ var VaultService = /*#__PURE__*/function () {
2655
2595
  function () {
2656
2596
  var _vaultIndexSnapshotPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(entry) {
2657
2597
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
2658
- while (1) {
2659
- switch (_context11.prev = _context11.next) {
2660
- case 0:
2661
- return _context11.abrupt("return", this.api.put(this.baseURL + "/v1/index-snapshot", entry));
2662
- case 1:
2663
- case "end":
2664
- return _context11.stop();
2665
- }
2598
+ while (1) switch (_context11.prev = _context11.next) {
2599
+ case 0:
2600
+ return _context11.abrupt("return", this.api.put(this.baseURL + "/v1/index-snapshot", entry));
2601
+ case 1:
2602
+ case "end":
2603
+ return _context11.stop();
2666
2604
  }
2667
2605
  }, _callee11, this);
2668
2606
  }));
@@ -2685,20 +2623,18 @@ var VaultService = /*#__PURE__*/function () {
2685
2623
  function () {
2686
2624
  var _vaultIndexGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(indexKeys, identifiers, timestamp) {
2687
2625
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
2688
- while (1) {
2689
- switch (_context12.prev = _context12.next) {
2690
- case 0:
2691
- return _context12.abrupt("return", this.api.get(this.baseURL + "/v1/index", {
2692
- params: {
2693
- index_keys: indexKeys,
2694
- identifiers: identifiers,
2695
- timestamp: timestamp
2696
- }
2697
- }));
2698
- case 1:
2699
- case "end":
2700
- return _context12.stop();
2701
- }
2626
+ while (1) switch (_context12.prev = _context12.next) {
2627
+ case 0:
2628
+ return _context12.abrupt("return", this.api.get(this.baseURL + "/v1/index", {
2629
+ params: {
2630
+ index_keys: indexKeys,
2631
+ identifiers: identifiers,
2632
+ timestamp: timestamp
2633
+ }
2634
+ }));
2635
+ case 1:
2636
+ case "end":
2637
+ return _context12.stop();
2702
2638
  }
2703
2639
  }, _callee12, this);
2704
2640
  }));