oro-sdk-apis 4.2.2 → 4.2.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/models/diagnosis.d.ts +5 -0
- package/dist/oro-sdk-apis.cjs.development.js +488 -552
- package/dist/oro-sdk-apis.cjs.development.js.map +1 -1
- package/dist/oro-sdk-apis.cjs.production.min.js.map +1 -1
- package/dist/oro-sdk-apis.esm.js +488 -552
- package/dist/oro-sdk-apis.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/models/diagnosis.ts +7 -0
package/dist/oro-sdk-apis.esm.js
CHANGED
@@ -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
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
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
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
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
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
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
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
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
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
return
|
710
|
-
|
711
|
-
|
712
|
-
|
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
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
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
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
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
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
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
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
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
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
|
1533
|
-
|
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
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
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
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
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
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
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
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
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
|
-
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
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
|
-
|
1708
|
-
|
1709
|
-
|
1710
|
-
|
1711
|
-
|
1712
|
-
|
1713
|
-
|
1714
|
-
|
1715
|
-
|
1716
|
-
|
1717
|
-
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1726
|
-
|
1727
|
-
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1732
|
-
|
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
|
-
|
1759
|
-
|
1760
|
-
|
1761
|
-
|
1762
|
-
|
1763
|
-
|
1764
|
-
|
1765
|
-
|
1766
|
-
|
1767
|
-
|
1768
|
-
|
1769
|
-
|
1770
|
-
|
1771
|
-
|
1772
|
-
|
1773
|
-
|
1774
|
-
|
1775
|
-
|
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
|
-
|
1801
|
-
|
1802
|
-
|
1803
|
-
|
1804
|
-
|
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
|
-
|
1832
|
-
|
1833
|
-
|
1834
|
-
|
1835
|
-
|
1836
|
-
|
1837
|
-
|
1838
|
-
|
1839
|
-
|
1840
|
-
|
1841
|
-
|
1842
|
-
|
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
|
-
|
1867
|
-
|
1868
|
-
|
1869
|
-
|
1870
|
-
|
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
|
-
|
1895
|
-
|
1896
|
-
|
1897
|
-
|
1898
|
-
|
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
|
-
|
1923
|
-
|
1924
|
-
|
1925
|
-
|
1926
|
-
|
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
|
-
|
2277
|
-
|
2278
|
-
|
2279
|
-
|
2280
|
-
|
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
|
-
|
2284
|
-
|
2285
|
-
|
2286
|
-
|
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
|
-
|
2377
|
-
|
2378
|
-
|
2379
|
-
|
2380
|
-
|
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
|
-
|
2396
|
-
|
2397
|
-
|
2398
|
-
|
2399
|
-
|
2400
|
-
|
2401
|
-
|
2402
|
-
|
2403
|
-
|
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
|
-
|
2419
|
-
|
2420
|
-
|
2421
|
-
|
2422
|
-
|
2423
|
-
|
2424
|
-
|
2425
|
-
|
2426
|
-
|
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
|
-
|
2442
|
-
|
2443
|
-
|
2444
|
-
|
2445
|
-
|
2446
|
-
|
2447
|
-
|
2448
|
-
|
2449
|
-
|
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
|
-
|
2473
|
-
|
2474
|
-
|
2475
|
-
|
2476
|
-
|
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
|
-
|
2505
|
-
|
2506
|
-
|
2507
|
-
|
2508
|
-
|
2509
|
-
|
2510
|
-
|
2511
|
-
|
2512
|
-
|
2513
|
-
|
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
|
-
|
2530
|
-
|
2531
|
-
|
2532
|
-
|
2533
|
-
|
2534
|
-
|
2535
|
-
|
2536
|
-
|
2537
|
-
|
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
|
-
|
2548
|
-
|
2549
|
-
|
2550
|
-
|
2551
|
-
|
2552
|
-
|
2553
|
-
|
2554
|
-
|
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
|
-
|
2569
|
-
|
2570
|
-
|
2571
|
-
|
2572
|
-
|
2573
|
-
|
2574
|
-
|
2575
|
-
|
2576
|
-
|
2577
|
-
|
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
|
-
|
2593
|
-
|
2594
|
-
|
2595
|
-
|
2596
|
-
|
2597
|
-
|
2598
|
-
|
2599
|
-
|
2600
|
-
|
2601
|
-
|
2602
|
-
|
2603
|
-
|
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
|
-
|
2629
|
-
|
2630
|
-
|
2631
|
-
|
2632
|
-
|
2633
|
-
|
2634
|
-
|
2635
|
-
|
2636
|
-
|
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
|
-
|
2660
|
-
|
2661
|
-
|
2662
|
-
|
2663
|
-
|
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
|
-
|
2690
|
-
|
2691
|
-
|
2692
|
-
|
2693
|
-
|
2694
|
-
|
2695
|
-
|
2696
|
-
|
2697
|
-
|
2698
|
-
|
2699
|
-
|
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
|
}));
|