oro-sdk-apis 4.2.2 → 4.2.4
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
@@ -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
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
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
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
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
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
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
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
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
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
return
|
716
|
-
|
717
|
-
|
718
|
-
|
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
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
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
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
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
|
-
|
1411
|
-
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
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
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
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
|
-
|
1476
|
-
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
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
|
-
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
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
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
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
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
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
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
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
|
-
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
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
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
-
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1685
|
-
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
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
|
-
|
1715
|
-
|
1716
|
-
|
1717
|
-
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1726
|
-
|
1727
|
-
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
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
|
-
|
1757
|
-
|
1758
|
-
|
1759
|
-
|
1760
|
-
|
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
|
-
|
1788
|
-
|
1789
|
-
|
1790
|
-
|
1791
|
-
|
1792
|
-
|
1793
|
-
|
1794
|
-
|
1795
|
-
|
1796
|
-
|
1797
|
-
|
1798
|
-
|
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
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1826
|
-
|
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
|
-
|
1851
|
-
|
1852
|
-
|
1853
|
-
|
1854
|
-
|
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
|
-
|
1879
|
-
|
1880
|
-
|
1881
|
-
|
1882
|
-
|
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
|
-
|
2233
|
-
|
2234
|
-
|
2235
|
-
|
2236
|
-
|
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
|
-
|
2240
|
-
|
2241
|
-
|
2242
|
-
|
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
|
-
|
2333
|
-
|
2334
|
-
|
2335
|
-
|
2336
|
-
|
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
|
-
|
2352
|
-
|
2353
|
-
|
2354
|
-
|
2355
|
-
|
2356
|
-
|
2357
|
-
|
2358
|
-
|
2359
|
-
|
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
|
-
|
2375
|
-
|
2376
|
-
|
2377
|
-
|
2378
|
-
|
2379
|
-
|
2380
|
-
|
2381
|
-
|
2382
|
-
|
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
|
-
|
2398
|
-
|
2399
|
-
|
2400
|
-
|
2401
|
-
|
2402
|
-
|
2403
|
-
|
2404
|
-
|
2405
|
-
|
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
|
-
|
2429
|
-
|
2430
|
-
|
2431
|
-
|
2432
|
-
|
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
|
-
|
2461
|
-
|
2462
|
-
|
2463
|
-
|
2464
|
-
|
2465
|
-
|
2466
|
-
|
2467
|
-
|
2468
|
-
|
2469
|
-
|
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
|
-
|
2486
|
-
|
2487
|
-
|
2488
|
-
|
2489
|
-
|
2490
|
-
|
2491
|
-
|
2492
|
-
|
2493
|
-
|
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
|
-
|
2504
|
-
|
2505
|
-
|
2506
|
-
|
2507
|
-
|
2508
|
-
|
2509
|
-
|
2510
|
-
|
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
|
-
|
2525
|
-
|
2526
|
-
|
2527
|
-
|
2528
|
-
|
2529
|
-
|
2530
|
-
|
2531
|
-
|
2532
|
-
|
2533
|
-
|
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
|
-
|
2549
|
-
|
2550
|
-
|
2551
|
-
|
2552
|
-
|
2553
|
-
|
2554
|
-
|
2555
|
-
|
2556
|
-
|
2557
|
-
|
2558
|
-
|
2559
|
-
|
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
|
-
|
2585
|
-
|
2586
|
-
|
2587
|
-
|
2588
|
-
|
2589
|
-
|
2590
|
-
|
2591
|
-
|
2592
|
-
|
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
|
-
|
2616
|
-
|
2617
|
-
|
2618
|
-
|
2619
|
-
|
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
|
-
|
2646
|
-
|
2647
|
-
|
2648
|
-
|
2649
|
-
|
2650
|
-
|
2651
|
-
|
2652
|
-
|
2653
|
-
|
2654
|
-
|
2655
|
-
|
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
|
}));
|