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.
@@ -452,21 +452,19 @@ var AxiosService = /*#__PURE__*/function () {
452
452
  _proto.apiRequest = /*#__PURE__*/function () {
453
453
  var _apiRequest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(config, url, data) {
454
454
  return _regeneratorRuntime().wrap(function _callee$(_context) {
455
- while (1) {
456
- switch (_context.prev = _context.next) {
457
- case 0:
458
- if (!config.headers) config.headers = {};
459
- config.headers['Content-Type'] = 'application/json';
460
- return _context.abrupt("return", this.axios(_extends({}, config, {
461
- url: url,
462
- data: data
463
- })).then(function (res) {
464
- return res.data;
465
- }));
466
- case 3:
467
- case "end":
468
- return _context.stop();
469
- }
455
+ while (1) switch (_context.prev = _context.next) {
456
+ case 0:
457
+ if (!config.headers) config.headers = {};
458
+ config.headers['Content-Type'] = 'application/json';
459
+ return _context.abrupt("return", this.axios(_extends({}, config, {
460
+ url: url,
461
+ data: data
462
+ })).then(function (res) {
463
+ return res.data;
464
+ }));
465
+ case 3:
466
+ case "end":
467
+ return _context.stop();
470
468
  }
471
469
  }, _callee, this);
472
470
  }));
@@ -478,25 +476,23 @@ var AxiosService = /*#__PURE__*/function () {
478
476
  _proto.apiRequestHeader = /*#__PURE__*/function () {
479
477
  var _apiRequestHeader = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(config, url, headerToRetrieve, data) {
480
478
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
481
- while (1) {
482
- switch (_context2.prev = _context2.next) {
483
- case 0:
484
- if (!config.headers) config.headers = {};
485
- config.headers['Content-Type'] = 'application/json';
486
- return _context2.abrupt("return", this.axios(_extends({}, config, {
487
- url: url,
488
- data: data
489
- })).then(function (res) {
490
- if (headerToRetrieve) {
491
- var _res$headers$headerTo;
492
- return (_res$headers$headerTo = res.headers[headerToRetrieve]) != null ? _res$headers$headerTo : res.headers[headerToRetrieve.toLowerCase()];
493
- }
494
- return res.headers;
495
- }));
496
- case 3:
497
- case "end":
498
- return _context2.stop();
499
- }
479
+ while (1) switch (_context2.prev = _context2.next) {
480
+ case 0:
481
+ if (!config.headers) config.headers = {};
482
+ config.headers['Content-Type'] = 'application/json';
483
+ return _context2.abrupt("return", this.axios(_extends({}, config, {
484
+ url: url,
485
+ data: data
486
+ })).then(function (res) {
487
+ if (headerToRetrieve) {
488
+ var _res$headers$headerTo;
489
+ return (_res$headers$headerTo = res.headers[headerToRetrieve]) != null ? _res$headers$headerTo : res.headers[headerToRetrieve.toLowerCase()];
490
+ }
491
+ return res.headers;
492
+ }));
493
+ case 3:
494
+ case "end":
495
+ return _context2.stop();
500
496
  }
501
497
  }, _callee2, this);
502
498
  }));
@@ -566,37 +562,35 @@ var APIService = /*#__PURE__*/function (_AxiosService) {
566
562
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(failedRequest) {
567
563
  var tokenResp;
568
564
  return _regeneratorRuntime().wrap(function _callee$(_context) {
569
- while (1) {
570
- switch (_context.prev = _context.next) {
571
- case 0:
572
- if (!self.authRefreshFn) {
573
- _context.next = 15;
574
- break;
575
- }
576
- _context.prev = 1;
577
- _context.next = 4;
578
- return self.authRefreshFn(self.getTokens().refreshToken);
579
- case 4:
580
- tokenResp = _context.sent;
581
- self.setTokens({
582
- accessToken: tokenResp.accessToken,
583
- refreshToken: tokenResp.refreshToken
584
- });
585
- failedRequest.response.config.headers['Authorization'] = "Bearer " + self.getTokens().accessToken;
586
- return _context.abrupt("return", Promise.resolve());
587
- case 10:
588
- _context.prev = 10;
589
- _context.t0 = _context["catch"](1);
590
- console.error('an error occured while refreshing tokens (notifying callback)', _context.t0);
591
- if (self.tokenRefreshFailureCallback) self.tokenRefreshFailureCallback(failedRequest);
592
- return _context.abrupt("return", Promise.resolve());
593
- case 15:
594
- console.error('The request could not refresh the token (authRefreshFn was not set)', failedRequest);
595
- return _context.abrupt("return", Promise.resolve());
596
- case 17:
597
- case "end":
598
- return _context.stop();
599
- }
565
+ while (1) switch (_context.prev = _context.next) {
566
+ case 0:
567
+ if (!self.authRefreshFn) {
568
+ _context.next = 15;
569
+ break;
570
+ }
571
+ _context.prev = 1;
572
+ _context.next = 4;
573
+ return self.authRefreshFn(self.getTokens().refreshToken);
574
+ case 4:
575
+ tokenResp = _context.sent;
576
+ self.setTokens({
577
+ accessToken: tokenResp.accessToken,
578
+ refreshToken: tokenResp.refreshToken
579
+ });
580
+ failedRequest.response.config.headers['Authorization'] = "Bearer " + self.getTokens().accessToken;
581
+ return _context.abrupt("return", Promise.resolve());
582
+ case 10:
583
+ _context.prev = 10;
584
+ _context.t0 = _context["catch"](1);
585
+ console.error('an error occured while refreshing tokens (notifying callback)', _context.t0);
586
+ if (self.tokenRefreshFailureCallback) self.tokenRefreshFailureCallback(failedRequest);
587
+ return _context.abrupt("return", Promise.resolve());
588
+ case 15:
589
+ console.error('The request could not refresh the token (authRefreshFn was not set)', failedRequest);
590
+ return _context.abrupt("return", Promise.resolve());
591
+ case 17:
592
+ case "end":
593
+ return _context.stop();
600
594
  }
601
595
  }, _callee, null, [[1, 10]]);
602
596
  }));
@@ -666,57 +660,53 @@ var ApisPracticeManager = /*#__PURE__*/function () {
666
660
  var _this = this;
667
661
  var cacheKey, practiceInstance, newPracticeInstance, authTokenFunc;
668
662
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
669
- while (1) {
670
- switch (_context2.prev = _context2.next) {
671
- case 0:
672
- cacheKey = practiceUuid != null ? practiceUuid : 'none';
673
- practiceInstance = this.practiceInstances.get(cacheKey);
674
- if (!practiceInstance) {
675
- _context2.next = 4;
676
- break;
677
- }
678
- return _context2.abrupt("return", practiceInstance);
679
- case 4:
680
- newPracticeInstance = init(this.serviceCollReq, undefined, this.useLocalStorage); // Create one auth token callback per practice since the practice uuid needs to change
681
- authTokenFunc = /*#__PURE__*/function () {
682
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
683
- return _regeneratorRuntime().wrap(function _callee$(_context) {
684
- while (1) {
685
- switch (_context.prev = _context.next) {
686
- case 0:
687
- if (!newPracticeInstance.guardService) {
688
- _context.next = 7;
689
- break;
690
- }
691
- console.log("\x1B[36m[Auth] Refresh auth called (practiceUuid: " + practiceUuid + ")\x1B[36m");
692
- _context.next = 4;
693
- return _this.getAuthTokenCbk(newPracticeInstance.guardService, practiceUuid);
694
- case 4:
695
- return _context.abrupt("return", _context.sent);
696
- case 7:
697
- throw Error('[Auth] Unable to refresh token guard service is undefined');
698
- case 8:
699
- case "end":
700
- return _context.stop();
663
+ while (1) switch (_context2.prev = _context2.next) {
664
+ case 0:
665
+ cacheKey = practiceUuid != null ? practiceUuid : 'none';
666
+ practiceInstance = this.practiceInstances.get(cacheKey);
667
+ if (!practiceInstance) {
668
+ _context2.next = 4;
669
+ break;
670
+ }
671
+ return _context2.abrupt("return", practiceInstance);
672
+ case 4:
673
+ newPracticeInstance = init(this.serviceCollReq, undefined, this.useLocalStorage); // Create one auth token callback per practice since the practice uuid needs to change
674
+ authTokenFunc = /*#__PURE__*/function () {
675
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
676
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
677
+ while (1) switch (_context.prev = _context.next) {
678
+ case 0:
679
+ if (!newPracticeInstance.guardService) {
680
+ _context.next = 7;
681
+ break;
701
682
  }
702
- }
703
- }, _callee);
704
- }));
705
- return function authTokenFunc() {
706
- return _ref.apply(this, arguments);
707
- };
708
- }(); // Initialize the M2M token
709
- _context2.next = 8;
710
- return authTokenFunc();
711
- case 8:
712
- // Set the refresh tokens callback
713
- newPracticeInstance.apiService.setAuthRefreshFn(authTokenFunc);
714
- this.practiceInstances.set(cacheKey, newPracticeInstance);
715
- return _context2.abrupt("return", newPracticeInstance);
716
- case 11:
717
- case "end":
718
- return _context2.stop();
719
- }
683
+ console.log("\x1B[36m[Auth] Refresh auth called (practiceUuid: " + practiceUuid + ")\x1B[36m");
684
+ _context.next = 4;
685
+ return _this.getAuthTokenCbk(newPracticeInstance.guardService, practiceUuid);
686
+ case 4:
687
+ return _context.abrupt("return", _context.sent);
688
+ case 7:
689
+ throw Error('[Auth] Unable to refresh token guard service is undefined');
690
+ case 8:
691
+ case "end":
692
+ return _context.stop();
693
+ }
694
+ }, _callee);
695
+ }));
696
+ return function authTokenFunc() {
697
+ return _ref.apply(this, arguments);
698
+ };
699
+ }(); // Initialize the M2M token
700
+ _context2.next = 8;
701
+ return authTokenFunc();
702
+ case 8:
703
+ // Set the refresh tokens callback
704
+ newPracticeInstance.apiService.setAuthRefreshFn(authTokenFunc);
705
+ this.practiceInstances.set(cacheKey, newPracticeInstance);
706
+ return _context2.abrupt("return", newPracticeInstance);
707
+ case 11:
708
+ case "end":
709
+ return _context2.stop();
720
710
  }
721
711
  }, _callee2, this);
722
712
  }));
@@ -1315,24 +1305,22 @@ var DiagnosisService = /*#__PURE__*/function () {
1315
1305
  var _getAllDrugs = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(uuidPractice) {
1316
1306
  var res;
1317
1307
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1318
- while (1) {
1319
- switch (_context.prev = _context.next) {
1320
- case 0:
1321
- _context.next = 2;
1322
- return this.api.get(this.baseURL + "/v1/drugs/practice/" + uuidPractice);
1323
- case 2:
1324
- res = _context.sent;
1325
- if (!(res && res.foundDrugs)) {
1326
- _context.next = 5;
1327
- break;
1328
- }
1329
- return _context.abrupt("return", res.foundDrugs);
1330
- case 5:
1331
- return _context.abrupt("return", undefined);
1332
- case 6:
1333
- case "end":
1334
- return _context.stop();
1335
- }
1308
+ while (1) switch (_context.prev = _context.next) {
1309
+ case 0:
1310
+ _context.next = 2;
1311
+ return this.api.get(this.baseURL + "/v1/drugs/practice/" + uuidPractice);
1312
+ case 2:
1313
+ res = _context.sent;
1314
+ if (!(res && res.foundDrugs)) {
1315
+ _context.next = 5;
1316
+ break;
1317
+ }
1318
+ return _context.abrupt("return", res.foundDrugs);
1319
+ case 5:
1320
+ return _context.abrupt("return", undefined);
1321
+ case 6:
1322
+ case "end":
1323
+ return _context.stop();
1336
1324
  }
1337
1325
  }, _callee, this);
1338
1326
  }));
@@ -1379,48 +1367,46 @@ var GuardService = /*#__PURE__*/function () {
1379
1367
  var _m2mToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(req) {
1380
1368
  var resp, config, _e$response, code;
1381
1369
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1382
- while (1) {
1383
- switch (_context.prev = _context.next) {
1384
- case 0:
1385
- _context.prev = 0;
1386
- config = {
1387
- skipAuthRefresh: true
1388
- };
1389
- _context.next = 4;
1390
- return this.api.post(this.baseURL + "/v1/m2m/token", req, config);
1391
- case 4:
1392
- resp = _context.sent;
1393
- this.api.setTokens({
1394
- accessToken: resp.accessToken
1395
- });
1396
- _context.next = 20;
1397
- break;
1398
- case 8:
1399
- _context.prev = 8;
1400
- _context.t0 = _context["catch"](0);
1401
- console.error('Error while posting m2m token:', _context.t0);
1402
- if (!_context.t0.isAxiosError) {
1403
- _context.next = 19;
1404
- break;
1405
- }
1406
- code = (_e$response = _context.t0.response) == null ? void 0 : _e$response.status;
1407
- _context.t1 = code;
1408
- _context.next = _context.t1 === 400 ? 16 : _context.t1 === 500 ? 17 : _context.t1 === 401 ? 18 : 18;
1370
+ while (1) switch (_context.prev = _context.next) {
1371
+ case 0:
1372
+ _context.prev = 0;
1373
+ config = {
1374
+ skipAuthRefresh: true
1375
+ };
1376
+ _context.next = 4;
1377
+ return this.api.post(this.baseURL + "/v1/m2m/token", req, config);
1378
+ case 4:
1379
+ resp = _context.sent;
1380
+ this.api.setTokens({
1381
+ accessToken: resp.accessToken
1382
+ });
1383
+ _context.next = 20;
1384
+ break;
1385
+ case 8:
1386
+ _context.prev = 8;
1387
+ _context.t0 = _context["catch"](0);
1388
+ console.error('Error while posting m2m token:', _context.t0);
1389
+ if (!_context.t0.isAxiosError) {
1390
+ _context.next = 19;
1409
1391
  break;
1410
- case 16:
1411
- throw new AuthenticationBadRequest();
1412
- case 17:
1413
- throw new AuthenticationServerError();
1414
- case 18:
1415
- throw new AuthenticationFailed();
1416
- case 19:
1417
- throw new AuthenticationFailed();
1418
- case 20:
1419
- return _context.abrupt("return", resp);
1420
- case 21:
1421
- case "end":
1422
- return _context.stop();
1423
- }
1392
+ }
1393
+ code = (_e$response = _context.t0.response) == null ? void 0 : _e$response.status;
1394
+ _context.t1 = code;
1395
+ _context.next = _context.t1 === 400 ? 16 : _context.t1 === 500 ? 17 : _context.t1 === 401 ? 18 : 18;
1396
+ break;
1397
+ case 16:
1398
+ throw new AuthenticationBadRequest();
1399
+ case 17:
1400
+ throw new AuthenticationServerError();
1401
+ case 18:
1402
+ throw new AuthenticationFailed();
1403
+ case 19:
1404
+ throw new AuthenticationFailed();
1405
+ case 20:
1406
+ return _context.abrupt("return", resp);
1407
+ case 21:
1408
+ case "end":
1409
+ return _context.stop();
1424
1410
  }
1425
1411
  }, _callee, this, [[0, 8]]);
1426
1412
  }));
@@ -1443,51 +1429,49 @@ var GuardService = /*#__PURE__*/function () {
1443
1429
  var _authToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(req) {
1444
1430
  var resp, config, _e$response2, code;
1445
1431
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1446
- while (1) {
1447
- switch (_context2.prev = _context2.next) {
1448
- case 0:
1449
- _context2.prev = 0;
1450
- config = {
1451
- skipAuthRefresh: true
1452
- };
1453
- _context2.next = 4;
1454
- return this.api.post(this.baseURL + "/v1/auth/token", req, config);
1455
- case 4:
1456
- resp = _context2.sent;
1457
- this.api.setTokens({
1458
- accessToken: resp.accessToken,
1459
- refreshToken: resp.refreshToken
1460
- });
1461
- _context2.next = 21;
1462
- break;
1463
- case 8:
1464
- _context2.prev = 8;
1465
- _context2.t0 = _context2["catch"](0);
1466
- console.error('Error while posting auth token:', _context2.t0);
1467
- if (!_context2.t0.isAxiosError) {
1468
- _context2.next = 20;
1469
- break;
1470
- }
1471
- code = (_e$response2 = _context2.t0.response) == null ? void 0 : _e$response2.status;
1472
- _context2.t1 = code;
1473
- _context2.next = _context2.t1 === 400 ? 16 : _context2.t1 === 424 ? 17 : _context2.t1 === 500 ? 18 : _context2.t1 === 401 ? 19 : 19;
1432
+ while (1) switch (_context2.prev = _context2.next) {
1433
+ case 0:
1434
+ _context2.prev = 0;
1435
+ config = {
1436
+ skipAuthRefresh: true
1437
+ };
1438
+ _context2.next = 4;
1439
+ return this.api.post(this.baseURL + "/v1/auth/token", req, config);
1440
+ case 4:
1441
+ resp = _context2.sent;
1442
+ this.api.setTokens({
1443
+ accessToken: resp.accessToken,
1444
+ refreshToken: resp.refreshToken
1445
+ });
1446
+ _context2.next = 21;
1447
+ break;
1448
+ case 8:
1449
+ _context2.prev = 8;
1450
+ _context2.t0 = _context2["catch"](0);
1451
+ console.error('Error while posting auth token:', _context2.t0);
1452
+ if (!_context2.t0.isAxiosError) {
1453
+ _context2.next = 20;
1474
1454
  break;
1475
- case 16:
1476
- throw new AuthenticationBadRequest();
1477
- case 17:
1478
- throw new AuthenticationUnconfirmedEmail();
1479
- case 18:
1480
- throw new AuthenticationServerError();
1481
- case 19:
1482
- throw new AuthenticationFailed();
1483
- case 20:
1484
- throw new AuthenticationFailed();
1485
- case 21:
1486
- return _context2.abrupt("return", resp);
1487
- case 22:
1488
- case "end":
1489
- return _context2.stop();
1490
- }
1455
+ }
1456
+ code = (_e$response2 = _context2.t0.response) == null ? void 0 : _e$response2.status;
1457
+ _context2.t1 = code;
1458
+ _context2.next = _context2.t1 === 400 ? 16 : _context2.t1 === 424 ? 17 : _context2.t1 === 500 ? 18 : _context2.t1 === 401 ? 19 : 19;
1459
+ break;
1460
+ case 16:
1461
+ throw new AuthenticationBadRequest();
1462
+ case 17:
1463
+ throw new AuthenticationUnconfirmedEmail();
1464
+ case 18:
1465
+ throw new AuthenticationServerError();
1466
+ case 19:
1467
+ throw new AuthenticationFailed();
1468
+ case 20:
1469
+ throw new AuthenticationFailed();
1470
+ case 21:
1471
+ return _context2.abrupt("return", resp);
1472
+ case 22:
1473
+ case "end":
1474
+ return _context2.stop();
1491
1475
  }
1492
1476
  }, _callee2, this, [[0, 8]]);
1493
1477
  }));
@@ -1508,18 +1492,16 @@ var GuardService = /*#__PURE__*/function () {
1508
1492
  var _authRefresh = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(refreshToken) {
1509
1493
  var config;
1510
1494
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1511
- while (1) {
1512
- switch (_context3.prev = _context3.next) {
1513
- case 0:
1514
- config = {
1515
- skipAuthRefresh: true,
1516
- useRefreshToken: true
1517
- };
1518
- return _context3.abrupt("return", this.api.put(this.baseURL + "/v1/auth/token", null, config));
1519
- case 2:
1520
- case "end":
1521
- return _context3.stop();
1522
- }
1495
+ while (1) switch (_context3.prev = _context3.next) {
1496
+ case 0:
1497
+ config = {
1498
+ skipAuthRefresh: true,
1499
+ useRefreshToken: true
1500
+ };
1501
+ return _context3.abrupt("return", this.api.put(this.baseURL + "/v1/auth/token", null, config));
1502
+ case 2:
1503
+ case "end":
1504
+ return _context3.stop();
1523
1505
  }
1524
1506
  }, _callee3, this);
1525
1507
  }));
@@ -1539,14 +1521,12 @@ var GuardService = /*#__PURE__*/function () {
1539
1521
  function () {
1540
1522
  var _authLogout = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
1541
1523
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1542
- while (1) {
1543
- switch (_context4.prev = _context4.next) {
1544
- case 0:
1545
- return _context4.abrupt("return", this.api.get(this.baseURL + "/v1/auth/logout"));
1546
- case 1:
1547
- case "end":
1548
- return _context4.stop();
1549
- }
1524
+ while (1) switch (_context4.prev = _context4.next) {
1525
+ case 0:
1526
+ return _context4.abrupt("return", this.api.get(this.baseURL + "/v1/auth/logout"));
1527
+ case 1:
1528
+ case "end":
1529
+ return _context4.stop();
1550
1530
  }
1551
1531
  }, _callee4, this);
1552
1532
  }));
@@ -1567,14 +1547,12 @@ var GuardService = /*#__PURE__*/function () {
1567
1547
  function () {
1568
1548
  var _authRecover = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(req) {
1569
1549
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
1570
- while (1) {
1571
- switch (_context5.prev = _context5.next) {
1572
- case 0:
1573
- return _context5.abrupt("return", this.api.post(this.baseURL + "/v1/auth/recover", req));
1574
- case 1:
1575
- case "end":
1576
- return _context5.stop();
1577
- }
1550
+ while (1) switch (_context5.prev = _context5.next) {
1551
+ case 0:
1552
+ return _context5.abrupt("return", this.api.post(this.baseURL + "/v1/auth/recover", req));
1553
+ case 1:
1554
+ case "end":
1555
+ return _context5.stop();
1578
1556
  }
1579
1557
  }, _callee5, this);
1580
1558
  }));
@@ -1597,44 +1575,42 @@ var GuardService = /*#__PURE__*/function () {
1597
1575
  var _identityCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(req) {
1598
1576
  var resp, _e$response3, code;
1599
1577
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
1600
- while (1) {
1601
- switch (_context6.prev = _context6.next) {
1602
- case 0:
1603
- _context6.prev = 0;
1604
- _context6.next = 3;
1605
- return this.api.post(this.baseURL + "/v1/identities", req);
1606
- case 3:
1607
- resp = _context6.sent;
1608
- this.api.setTokens({
1609
- refreshToken: resp.refreshToken
1610
- });
1611
- _context6.next = 18;
1612
- break;
1613
- case 7:
1614
- _context6.prev = 7;
1615
- _context6.t0 = _context6["catch"](0);
1616
- if (!_context6.t0.isAxiosError) {
1617
- _context6.next = 17;
1618
- break;
1619
- }
1620
- code = (_e$response3 = _context6.t0.response) == null ? void 0 : _e$response3.status;
1621
- _context6.t1 = code;
1622
- _context6.next = _context6.t1 === 400 ? 14 : _context6.t1 === 409 ? 15 : _context6.t1 === 500 ? 16 : 16;
1578
+ while (1) switch (_context6.prev = _context6.next) {
1579
+ case 0:
1580
+ _context6.prev = 0;
1581
+ _context6.next = 3;
1582
+ return this.api.post(this.baseURL + "/v1/identities", req);
1583
+ case 3:
1584
+ resp = _context6.sent;
1585
+ this.api.setTokens({
1586
+ refreshToken: resp.refreshToken
1587
+ });
1588
+ _context6.next = 18;
1589
+ break;
1590
+ case 7:
1591
+ _context6.prev = 7;
1592
+ _context6.t0 = _context6["catch"](0);
1593
+ if (!_context6.t0.isAxiosError) {
1594
+ _context6.next = 17;
1623
1595
  break;
1624
- case 14:
1625
- throw new IdentityCreationBadRequest();
1626
- case 15:
1627
- throw new IdentityCreationConflict();
1628
- case 16:
1629
- throw new IdentityCreationFailed();
1630
- case 17:
1631
- throw new IdentityCreationFailed();
1632
- case 18:
1633
- return _context6.abrupt("return", resp);
1634
- case 19:
1635
- case "end":
1636
- return _context6.stop();
1637
- }
1596
+ }
1597
+ code = (_e$response3 = _context6.t0.response) == null ? void 0 : _e$response3.status;
1598
+ _context6.t1 = code;
1599
+ _context6.next = _context6.t1 === 400 ? 14 : _context6.t1 === 409 ? 15 : _context6.t1 === 500 ? 16 : 16;
1600
+ break;
1601
+ case 14:
1602
+ throw new IdentityCreationBadRequest();
1603
+ case 15:
1604
+ throw new IdentityCreationConflict();
1605
+ case 16:
1606
+ throw new IdentityCreationFailed();
1607
+ case 17:
1608
+ throw new IdentityCreationFailed();
1609
+ case 18:
1610
+ return _context6.abrupt("return", resp);
1611
+ case 19:
1612
+ case "end":
1613
+ return _context6.stop();
1638
1614
  }
1639
1615
  }, _callee6, this, [[0, 7]]);
1640
1616
  }));
@@ -1659,35 +1635,33 @@ var GuardService = /*#__PURE__*/function () {
1659
1635
  var _tokens$accessToken, _tokens$refreshToken;
1660
1636
  var tokens, cacheKey, identity;
1661
1637
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
1662
- while (1) {
1663
- switch (_context7.prev = _context7.next) {
1664
- case 0:
1665
- if (skipCache === void 0) {
1666
- skipCache = false;
1667
- }
1668
- tokens = this.api.getTokens();
1669
- cacheKey = ((_tokens$accessToken = tokens.accessToken) != null ? _tokens$accessToken : '') + ((_tokens$refreshToken = tokens.refreshToken) != null ? _tokens$refreshToken : '') + identityID;
1670
- if (!(skipCache || !tokens.accessToken || !this.identityCache[cacheKey])) {
1671
- _context7.next = 10;
1672
- break;
1673
- }
1674
- _context7.next = 6;
1675
- return this.api.get(this.baseURL + "/v1/identities/" + identityID);
1676
- case 6:
1677
- identity = _context7.sent;
1678
- if (!skipCache) {
1679
- _context7.next = 9;
1680
- break;
1681
- }
1682
- return _context7.abrupt("return", identity);
1683
- case 9:
1684
- this.identityCache[cacheKey] = identity;
1685
- case 10:
1686
- return _context7.abrupt("return", this.identityCache[cacheKey]);
1687
- case 11:
1688
- case "end":
1689
- return _context7.stop();
1690
- }
1638
+ while (1) switch (_context7.prev = _context7.next) {
1639
+ case 0:
1640
+ if (skipCache === void 0) {
1641
+ skipCache = false;
1642
+ }
1643
+ tokens = this.api.getTokens();
1644
+ cacheKey = ((_tokens$accessToken = tokens.accessToken) != null ? _tokens$accessToken : '') + ((_tokens$refreshToken = tokens.refreshToken) != null ? _tokens$refreshToken : '') + identityID;
1645
+ if (!(skipCache || !tokens.accessToken || !this.identityCache[cacheKey])) {
1646
+ _context7.next = 10;
1647
+ break;
1648
+ }
1649
+ _context7.next = 6;
1650
+ return this.api.get(this.baseURL + "/v1/identities/" + identityID);
1651
+ case 6:
1652
+ identity = _context7.sent;
1653
+ if (!skipCache) {
1654
+ _context7.next = 9;
1655
+ break;
1656
+ }
1657
+ return _context7.abrupt("return", identity);
1658
+ case 9:
1659
+ this.identityCache[cacheKey] = identity;
1660
+ case 10:
1661
+ return _context7.abrupt("return", this.identityCache[cacheKey]);
1662
+ case 11:
1663
+ case "end":
1664
+ return _context7.stop();
1691
1665
  }
1692
1666
  }, _callee7, this);
1693
1667
  }));
@@ -1710,27 +1684,25 @@ var GuardService = /*#__PURE__*/function () {
1710
1684
  var _this$api$getTokens$a;
1711
1685
  var cacheKey;
1712
1686
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
1713
- while (1) {
1714
- switch (_context8.prev = _context8.next) {
1715
- case 0:
1716
- if (refreshCache === void 0) {
1717
- refreshCache = false;
1718
- }
1719
- cacheKey = (_this$api$getTokens$a = this.api.getTokens().accessToken) != null ? _this$api$getTokens$a : '';
1720
- if (!(!this.whoAmICache[cacheKey] || refreshCache)) {
1721
- _context8.next = 6;
1722
- break;
1723
- }
1724
- _context8.next = 5;
1725
- return this.api.get(this.baseURL + "/v1/auth/whoami");
1726
- case 5:
1727
- this.whoAmICache[cacheKey] = _context8.sent;
1728
- case 6:
1729
- return _context8.abrupt("return", this.whoAmICache[cacheKey]);
1730
- case 7:
1731
- case "end":
1732
- return _context8.stop();
1733
- }
1687
+ while (1) switch (_context8.prev = _context8.next) {
1688
+ case 0:
1689
+ if (refreshCache === void 0) {
1690
+ refreshCache = false;
1691
+ }
1692
+ cacheKey = (_this$api$getTokens$a = this.api.getTokens().accessToken) != null ? _this$api$getTokens$a : '';
1693
+ if (!(!this.whoAmICache[cacheKey] || refreshCache)) {
1694
+ _context8.next = 6;
1695
+ break;
1696
+ }
1697
+ _context8.next = 5;
1698
+ return this.api.get(this.baseURL + "/v1/auth/whoami");
1699
+ case 5:
1700
+ this.whoAmICache[cacheKey] = _context8.sent;
1701
+ case 6:
1702
+ return _context8.abrupt("return", this.whoAmICache[cacheKey]);
1703
+ case 7:
1704
+ case "end":
1705
+ return _context8.stop();
1734
1706
  }
1735
1707
  }, _callee8, this);
1736
1708
  }));
@@ -1752,14 +1724,12 @@ var GuardService = /*#__PURE__*/function () {
1752
1724
  function () {
1753
1725
  var _identityUpdate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(identityID, req) {
1754
1726
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
1755
- while (1) {
1756
- switch (_context9.prev = _context9.next) {
1757
- case 0:
1758
- return _context9.abrupt("return", this.api.put(this.baseURL + "/v1/identities/" + identityID, req));
1759
- case 1:
1760
- case "end":
1761
- return _context9.stop();
1762
- }
1727
+ while (1) switch (_context9.prev = _context9.next) {
1728
+ case 0:
1729
+ return _context9.abrupt("return", this.api.put(this.baseURL + "/v1/identities/" + identityID, req));
1730
+ case 1:
1731
+ case "end":
1732
+ return _context9.stop();
1763
1733
  }
1764
1734
  }, _callee9, this);
1765
1735
  }));
@@ -1783,21 +1753,19 @@ var GuardService = /*#__PURE__*/function () {
1783
1753
  var _identityMFAQRCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(identityID, password) {
1784
1754
  var req;
1785
1755
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
1786
- while (1) {
1787
- switch (_context10.prev = _context10.next) {
1788
- case 0:
1789
- req = {
1790
- password: password
1791
- };
1792
- return _context10.abrupt("return", this.api.post(this.baseURL + "/v1/identities/" + identityID + "/mfa", req, {
1793
- headers: {
1794
- Accept: 'application/json'
1795
- }
1796
- }));
1797
- case 2:
1798
- case "end":
1799
- return _context10.stop();
1800
- }
1756
+ while (1) switch (_context10.prev = _context10.next) {
1757
+ case 0:
1758
+ req = {
1759
+ password: password
1760
+ };
1761
+ return _context10.abrupt("return", this.api.post(this.baseURL + "/v1/identities/" + identityID + "/mfa", req, {
1762
+ headers: {
1763
+ Accept: 'application/json'
1764
+ }
1765
+ }));
1766
+ case 2:
1767
+ case "end":
1768
+ return _context10.stop();
1801
1769
  }
1802
1770
  }, _callee10, this);
1803
1771
  }));
@@ -1818,14 +1786,12 @@ var GuardService = /*#__PURE__*/function () {
1818
1786
  function () {
1819
1787
  var _identitySendConfirmEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(req) {
1820
1788
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
1821
- while (1) {
1822
- switch (_context11.prev = _context11.next) {
1823
- case 0:
1824
- return _context11.abrupt("return", this.api.post(this.baseURL + "/v1/identity/confirm", req));
1825
- case 1:
1826
- case "end":
1827
- return _context11.stop();
1828
- }
1789
+ while (1) switch (_context11.prev = _context11.next) {
1790
+ case 0:
1791
+ return _context11.abrupt("return", this.api.post(this.baseURL + "/v1/identity/confirm", req));
1792
+ case 1:
1793
+ case "end":
1794
+ return _context11.stop();
1829
1795
  }
1830
1796
  }, _callee11, this);
1831
1797
  }));
@@ -1846,14 +1812,12 @@ var GuardService = /*#__PURE__*/function () {
1846
1812
  function () {
1847
1813
  var _identityGetByCustomerEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(email) {
1848
1814
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
1849
- while (1) {
1850
- switch (_context12.prev = _context12.next) {
1851
- case 0:
1852
- return _context12.abrupt("return", this.identityGetByHash(email.substring(email.indexOf('+') + 1, email.indexOf('@'))));
1853
- case 1:
1854
- case "end":
1855
- return _context12.stop();
1856
- }
1815
+ while (1) switch (_context12.prev = _context12.next) {
1816
+ case 0:
1817
+ return _context12.abrupt("return", this.identityGetByHash(email.substring(email.indexOf('+') + 1, email.indexOf('@'))));
1818
+ case 1:
1819
+ case "end":
1820
+ return _context12.stop();
1857
1821
  }
1858
1822
  }, _callee12, this);
1859
1823
  }));
@@ -1874,14 +1838,12 @@ var GuardService = /*#__PURE__*/function () {
1874
1838
  function () {
1875
1839
  var _identityGetByHash = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(b64Hash) {
1876
1840
  return _regeneratorRuntime().wrap(function _callee13$(_context13) {
1877
- while (1) {
1878
- switch (_context13.prev = _context13.next) {
1879
- case 0:
1880
- return _context13.abrupt("return", this.identityGet(b64Hash.replace(/\+/g, '-').replace(/\//g, '_')));
1881
- case 1:
1882
- case "end":
1883
- return _context13.stop();
1884
- }
1841
+ while (1) switch (_context13.prev = _context13.next) {
1842
+ case 0:
1843
+ return _context13.abrupt("return", this.identityGet(b64Hash.replace(/\+/g, '-').replace(/\//g, '_')));
1844
+ case 1:
1845
+ case "end":
1846
+ return _context13.stop();
1885
1847
  }
1886
1848
  }, _callee13, this);
1887
1849
  }));
@@ -2228,25 +2190,23 @@ var TellerService = /*#__PURE__*/function () {
2228
2190
  _proto.lockboxDataStore = /*#__PURE__*/function () {
2229
2191
  var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid, options) {
2230
2192
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2231
- while (1) {
2232
- switch (_context.prev = _context.next) {
2233
- case 0:
2234
- if (options === void 0) {
2235
- options = {
2236
- updateMedicalStatus: true
2237
- };
2193
+ while (1) switch (_context.prev = _context.next) {
2194
+ case 0:
2195
+ if (options === void 0) {
2196
+ options = {
2197
+ updateMedicalStatus: true
2198
+ };
2199
+ }
2200
+ return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
2201
+ params: {
2202
+ lockbox_owner_uuid: lockboxOwnerUuid,
2203
+ data_uuid: previousDataUuid,
2204
+ update_medical_status: options.updateMedicalStatus
2238
2205
  }
2239
- return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
2240
- params: {
2241
- lockbox_owner_uuid: lockboxOwnerUuid,
2242
- data_uuid: previousDataUuid,
2243
- update_medical_status: options.updateMedicalStatus
2244
- }
2245
- }));
2246
- case 2:
2247
- case "end":
2248
- return _context.stop();
2249
- }
2206
+ }));
2207
+ case 2:
2208
+ case "end":
2209
+ return _context.stop();
2250
2210
  }
2251
2211
  }, _callee, this);
2252
2212
  }));
@@ -2328,14 +2288,12 @@ var VaultService = /*#__PURE__*/function () {
2328
2288
  _proto.lockboxCreate = /*#__PURE__*/function () {
2329
2289
  var _lockboxCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(lockboxMetadata) {
2330
2290
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2331
- while (1) {
2332
- switch (_context.prev = _context.next) {
2333
- case 0:
2334
- return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockbox", lockboxMetadata));
2335
- case 1:
2336
- case "end":
2337
- return _context.stop();
2338
- }
2291
+ while (1) switch (_context.prev = _context.next) {
2292
+ case 0:
2293
+ return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockbox", lockboxMetadata));
2294
+ case 1:
2295
+ case "end":
2296
+ return _context.stop();
2339
2297
  }
2340
2298
  }, _callee, this);
2341
2299
  }));
@@ -2347,18 +2305,16 @@ var VaultService = /*#__PURE__*/function () {
2347
2305
  _proto.lockboxMetadataAdd = /*#__PURE__*/function () {
2348
2306
  var _lockboxMetadataAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(lockboxUuid, lockboxMetadata, lockboxOwnerUuid) {
2349
2307
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2350
- while (1) {
2351
- switch (_context2.prev = _context2.next) {
2352
- case 0:
2353
- return _context2.abrupt("return", this.api.put(this.baseURL + "/v1/lockbox/" + lockboxUuid, lockboxMetadata, {
2354
- params: {
2355
- lockbox_owner_uuid: lockboxOwnerUuid
2356
- }
2357
- }));
2358
- case 1:
2359
- case "end":
2360
- return _context2.stop();
2361
- }
2308
+ while (1) switch (_context2.prev = _context2.next) {
2309
+ case 0:
2310
+ return _context2.abrupt("return", this.api.put(this.baseURL + "/v1/lockbox/" + lockboxUuid, lockboxMetadata, {
2311
+ params: {
2312
+ lockbox_owner_uuid: lockboxOwnerUuid
2313
+ }
2314
+ }));
2315
+ case 1:
2316
+ case "end":
2317
+ return _context2.stop();
2362
2318
  }
2363
2319
  }, _callee2, this);
2364
2320
  }));
@@ -2370,18 +2326,16 @@ var VaultService = /*#__PURE__*/function () {
2370
2326
  _proto.lockboxSecretGet = /*#__PURE__*/function () {
2371
2327
  var _lockboxSecretGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(lockboxUuid, lockboxOwnerUuid) {
2372
2328
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2373
- while (1) {
2374
- switch (_context3.prev = _context3.next) {
2375
- case 0:
2376
- return _context3.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/secret", {
2377
- params: {
2378
- lockbox_owner_uuid: lockboxOwnerUuid
2379
- }
2380
- }));
2381
- case 1:
2382
- case "end":
2383
- return _context3.stop();
2384
- }
2329
+ while (1) switch (_context3.prev = _context3.next) {
2330
+ case 0:
2331
+ return _context3.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/secret", {
2332
+ params: {
2333
+ lockbox_owner_uuid: lockboxOwnerUuid
2334
+ }
2335
+ }));
2336
+ case 1:
2337
+ case "end":
2338
+ return _context3.stop();
2385
2339
  }
2386
2340
  }, _callee3, this);
2387
2341
  }));
@@ -2393,18 +2347,16 @@ var VaultService = /*#__PURE__*/function () {
2393
2347
  _proto.lockboxGrant = /*#__PURE__*/function () {
2394
2348
  var _lockboxGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(lockboxUuid, req, lockboxOwnerUuid) {
2395
2349
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2396
- while (1) {
2397
- switch (_context4.prev = _context4.next) {
2398
- case 0:
2399
- return _context4.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/grant", req, {
2400
- params: {
2401
- lockbox_owner_uuid: lockboxOwnerUuid
2402
- }
2403
- }));
2404
- case 1:
2405
- case "end":
2406
- return _context4.stop();
2407
- }
2350
+ while (1) switch (_context4.prev = _context4.next) {
2351
+ case 0:
2352
+ return _context4.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/grant", req, {
2353
+ params: {
2354
+ lockbox_owner_uuid: lockboxOwnerUuid
2355
+ }
2356
+ }));
2357
+ case 1:
2358
+ case "end":
2359
+ return _context4.stop();
2408
2360
  }
2409
2361
  }, _callee4, this);
2410
2362
  }));
@@ -2424,14 +2376,12 @@ var VaultService = /*#__PURE__*/function () {
2424
2376
  function () {
2425
2377
  var _grantsGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
2426
2378
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2427
- while (1) {
2428
- switch (_context5.prev = _context5.next) {
2429
- case 0:
2430
- return _context5.abrupt("return", this.api.get(this.baseURL + "/v1/grants"));
2431
- case 1:
2432
- case "end":
2433
- return _context5.stop();
2434
- }
2379
+ while (1) switch (_context5.prev = _context5.next) {
2380
+ case 0:
2381
+ return _context5.abrupt("return", this.api.get(this.baseURL + "/v1/grants"));
2382
+ case 1:
2383
+ case "end":
2384
+ return _context5.stop();
2435
2385
  }
2436
2386
  }, _callee5, this);
2437
2387
  }));
@@ -2456,19 +2406,17 @@ var VaultService = /*#__PURE__*/function () {
2456
2406
  function () {
2457
2407
  var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid) {
2458
2408
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
2459
- while (1) {
2460
- switch (_context6.prev = _context6.next) {
2461
- case 0:
2462
- return _context6.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
2463
- params: {
2464
- lockbox_owner_uuid: lockboxOwnerUuid,
2465
- data_uuid: previousDataUuid
2466
- }
2467
- }));
2468
- case 1:
2469
- case "end":
2470
- return _context6.stop();
2471
- }
2409
+ while (1) switch (_context6.prev = _context6.next) {
2410
+ case 0:
2411
+ return _context6.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
2412
+ params: {
2413
+ lockbox_owner_uuid: lockboxOwnerUuid,
2414
+ data_uuid: previousDataUuid
2415
+ }
2416
+ }));
2417
+ case 1:
2418
+ case "end":
2419
+ return _context6.stop();
2472
2420
  }
2473
2421
  }, _callee6, this);
2474
2422
  }));
@@ -2481,34 +2429,32 @@ var VaultService = /*#__PURE__*/function () {
2481
2429
  var _lockboxDataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(lockboxUuid, dataUuid, lockboxOwnerUuid, stream) {
2482
2430
  var data;
2483
2431
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
2484
- while (1) {
2485
- switch (_context7.prev = _context7.next) {
2486
- case 0:
2487
- if (stream === void 0) {
2488
- stream = true;
2489
- }
2490
- _context7.next = 3;
2491
- return this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data/" + dataUuid, {
2492
- params: {
2493
- lockbox_owner_uuid: lockboxOwnerUuid,
2494
- stream: stream
2495
- }
2496
- });
2497
- case 3:
2498
- data = _context7.sent;
2499
- if (!stream) {
2500
- _context7.next = 6;
2501
- break;
2432
+ while (1) switch (_context7.prev = _context7.next) {
2433
+ case 0:
2434
+ if (stream === void 0) {
2435
+ stream = true;
2436
+ }
2437
+ _context7.next = 3;
2438
+ return this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data/" + dataUuid, {
2439
+ params: {
2440
+ lockbox_owner_uuid: lockboxOwnerUuid,
2441
+ stream: stream
2502
2442
  }
2503
- return _context7.abrupt("return", {
2504
- data: data
2505
- });
2506
- case 6:
2507
- return _context7.abrupt("return", data);
2508
- case 7:
2509
- case "end":
2510
- return _context7.stop();
2511
- }
2443
+ });
2444
+ case 3:
2445
+ data = _context7.sent;
2446
+ if (!stream) {
2447
+ _context7.next = 6;
2448
+ break;
2449
+ }
2450
+ return _context7.abrupt("return", {
2451
+ data: data
2452
+ });
2453
+ case 6:
2454
+ return _context7.abrupt("return", data);
2455
+ case 7:
2456
+ case "end":
2457
+ return _context7.stop();
2512
2458
  }
2513
2459
  }, _callee7, this);
2514
2460
  }));
@@ -2520,19 +2466,17 @@ var VaultService = /*#__PURE__*/function () {
2520
2466
  _proto.lockboxManifestGet = /*#__PURE__*/function () {
2521
2467
  var _lockboxManifestGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(lockboxUuid, filter, lockboxOwnerUuid) {
2522
2468
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
2523
- while (1) {
2524
- switch (_context8.prev = _context8.next) {
2525
- case 0:
2526
- return _context8.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid, {
2527
- params: {
2528
- lockbox_owner_uuid: lockboxOwnerUuid,
2529
- filter: filter
2530
- }
2531
- }));
2532
- case 1:
2533
- case "end":
2534
- return _context8.stop();
2535
- }
2469
+ while (1) switch (_context8.prev = _context8.next) {
2470
+ case 0:
2471
+ return _context8.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid, {
2472
+ params: {
2473
+ lockbox_owner_uuid: lockboxOwnerUuid,
2474
+ filter: filter
2475
+ }
2476
+ }));
2477
+ case 1:
2478
+ case "end":
2479
+ return _context8.stop();
2536
2480
  }
2537
2481
  }, _callee8, this);
2538
2482
  }));
@@ -2544,21 +2488,19 @@ var VaultService = /*#__PURE__*/function () {
2544
2488
  _proto.lockboxMetadataGet = /*#__PURE__*/function () {
2545
2489
  var _lockboxMetadataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(lockboxUuid, fields, groupby, filter, lockboxOwnerUuid) {
2546
2490
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
2547
- while (1) {
2548
- switch (_context9.prev = _context9.next) {
2549
- case 0:
2550
- return _context9.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/metadata", {
2551
- params: {
2552
- lockbox_owner_uuid: lockboxOwnerUuid,
2553
- fields: fields,
2554
- groupby: groupby,
2555
- filter: filter
2556
- }
2557
- }));
2558
- case 1:
2559
- case "end":
2560
- return _context9.stop();
2561
- }
2491
+ while (1) switch (_context9.prev = _context9.next) {
2492
+ case 0:
2493
+ return _context9.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/metadata", {
2494
+ params: {
2495
+ lockbox_owner_uuid: lockboxOwnerUuid,
2496
+ fields: fields,
2497
+ groupby: groupby,
2498
+ filter: filter
2499
+ }
2500
+ }));
2501
+ case 1:
2502
+ case "end":
2503
+ return _context9.stop();
2562
2504
  }
2563
2505
  }, _callee9, this);
2564
2506
  }));
@@ -2580,18 +2522,16 @@ var VaultService = /*#__PURE__*/function () {
2580
2522
  function () {
2581
2523
  var _vaultIndexPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(entries, indexOwnerUuid) {
2582
2524
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
2583
- while (1) {
2584
- switch (_context10.prev = _context10.next) {
2585
- case 0:
2586
- return _context10.abrupt("return", this.api.put(this.baseURL + "/v1/index", entries, {
2587
- params: {
2588
- index_owner_uuid: indexOwnerUuid
2589
- }
2590
- }));
2591
- case 1:
2592
- case "end":
2593
- return _context10.stop();
2594
- }
2525
+ while (1) switch (_context10.prev = _context10.next) {
2526
+ case 0:
2527
+ return _context10.abrupt("return", this.api.put(this.baseURL + "/v1/index", entries, {
2528
+ params: {
2529
+ index_owner_uuid: indexOwnerUuid
2530
+ }
2531
+ }));
2532
+ case 1:
2533
+ case "end":
2534
+ return _context10.stop();
2595
2535
  }
2596
2536
  }, _callee10, this);
2597
2537
  }));
@@ -2611,14 +2551,12 @@ var VaultService = /*#__PURE__*/function () {
2611
2551
  function () {
2612
2552
  var _vaultIndexSnapshotPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(entry) {
2613
2553
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
2614
- while (1) {
2615
- switch (_context11.prev = _context11.next) {
2616
- case 0:
2617
- return _context11.abrupt("return", this.api.put(this.baseURL + "/v1/index-snapshot", entry));
2618
- case 1:
2619
- case "end":
2620
- return _context11.stop();
2621
- }
2554
+ while (1) switch (_context11.prev = _context11.next) {
2555
+ case 0:
2556
+ return _context11.abrupt("return", this.api.put(this.baseURL + "/v1/index-snapshot", entry));
2557
+ case 1:
2558
+ case "end":
2559
+ return _context11.stop();
2622
2560
  }
2623
2561
  }, _callee11, this);
2624
2562
  }));
@@ -2641,20 +2579,18 @@ var VaultService = /*#__PURE__*/function () {
2641
2579
  function () {
2642
2580
  var _vaultIndexGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(indexKeys, identifiers, timestamp) {
2643
2581
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
2644
- while (1) {
2645
- switch (_context12.prev = _context12.next) {
2646
- case 0:
2647
- return _context12.abrupt("return", this.api.get(this.baseURL + "/v1/index", {
2648
- params: {
2649
- index_keys: indexKeys,
2650
- identifiers: identifiers,
2651
- timestamp: timestamp
2652
- }
2653
- }));
2654
- case 1:
2655
- case "end":
2656
- return _context12.stop();
2657
- }
2582
+ while (1) switch (_context12.prev = _context12.next) {
2583
+ case 0:
2584
+ return _context12.abrupt("return", this.api.get(this.baseURL + "/v1/index", {
2585
+ params: {
2586
+ index_keys: indexKeys,
2587
+ identifiers: identifiers,
2588
+ timestamp: timestamp
2589
+ }
2590
+ }));
2591
+ case 1:
2592
+ case "end":
2593
+ return _context12.stop();
2658
2594
  }
2659
2595
  }, _callee12, this);
2660
2596
  }));