@niledatabase/server 3.0.0-alpha.36 → 3.0.0-alpha.38
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.
- package/dist/api/routes/auth/index.d.ts +1 -0
- package/dist/api/routes/auth/verify-request.d.ts +4 -0
- package/dist/api/types.d.ts +1 -0
- package/dist/api/utils/routes/proxyRoutes.d.ts +1 -0
- package/dist/server.cjs.development.js +178 -132
- package/dist/server.cjs.development.js.map +1 -1
- package/dist/server.cjs.production.min.js +1 -1
- package/dist/server.cjs.production.min.js.map +1 -1
- package/dist/server.esm.js +178 -132
- package/dist/server.esm.js.map +1 -1
- package/dist/users/types.d.ts +1 -0
- package/package.json +2 -2
|
@@ -501,6 +501,12 @@ var getUsername = function getUsername(cfg) {
|
|
|
501
501
|
logger && info(logger + "[config] " + config.user);
|
|
502
502
|
return String(config == null ? void 0 : config.user);
|
|
503
503
|
}
|
|
504
|
+
if (process.env.NILEDB_POSTGRES_URL) {
|
|
505
|
+
var url = new URL(process.env.NILEDB_POSTGRES_URL);
|
|
506
|
+
if (url.username) {
|
|
507
|
+
return url.username;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
504
510
|
logger && info(logger + "[NILEDB_USER] " + process.env.NILEDB_USER);
|
|
505
511
|
return process.env.NILEDB_USER;
|
|
506
512
|
};
|
|
@@ -514,6 +520,12 @@ var getPassword = function getPassword(cfg) {
|
|
|
514
520
|
log && info(logger + "[config] " + config.password);
|
|
515
521
|
return String(config.password);
|
|
516
522
|
}
|
|
523
|
+
if (process.env.NILEDB_POSTGRES_URL) {
|
|
524
|
+
var url = new URL(process.env.NILEDB_POSTGRES_URL);
|
|
525
|
+
if (url.password) {
|
|
526
|
+
return url.password;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
517
529
|
logger && info(logger + "[NILEDB_PASSWORD] " + process.env.NILEDB_PASSWORD);
|
|
518
530
|
return process.env.NILEDB_PASSWORD;
|
|
519
531
|
};
|
|
@@ -1389,7 +1401,7 @@ function _request() {
|
|
|
1389
1401
|
return _request.apply(this, arguments);
|
|
1390
1402
|
}
|
|
1391
1403
|
|
|
1392
|
-
var key$
|
|
1404
|
+
var key$9 = 'ME';
|
|
1393
1405
|
/**
|
|
1394
1406
|
* @swagger
|
|
1395
1407
|
* /api/me:
|
|
@@ -1440,16 +1452,16 @@ function _GET$4() {
|
|
|
1440
1452
|
}));
|
|
1441
1453
|
return _GET$4.apply(this, arguments);
|
|
1442
1454
|
}
|
|
1443
|
-
function route$
|
|
1444
|
-
return _route$
|
|
1455
|
+
function route$c(_x4, _x5) {
|
|
1456
|
+
return _route$c.apply(this, arguments);
|
|
1445
1457
|
}
|
|
1446
|
-
function _route$
|
|
1447
|
-
_route$
|
|
1458
|
+
function _route$c() {
|
|
1459
|
+
_route$c = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(request, config) {
|
|
1448
1460
|
var url;
|
|
1449
1461
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1450
1462
|
while (1) switch (_context2.prev = _context2.next) {
|
|
1451
1463
|
case 0:
|
|
1452
|
-
url = apiRoutes(config)[key$
|
|
1464
|
+
url = apiRoutes(config)[key$9];
|
|
1453
1465
|
_context2.t0 = request.method;
|
|
1454
1466
|
_context2.next = _context2.t0 === 'GET' ? 4 : 7;
|
|
1455
1467
|
break;
|
|
@@ -1470,10 +1482,10 @@ function _route$b() {
|
|
|
1470
1482
|
}
|
|
1471
1483
|
}, _callee2);
|
|
1472
1484
|
}));
|
|
1473
|
-
return _route$
|
|
1485
|
+
return _route$c.apply(this, arguments);
|
|
1474
1486
|
}
|
|
1475
|
-
function matches$
|
|
1476
|
-
return urlMatches(request.url, configRoutes[key$
|
|
1487
|
+
function matches$c(configRoutes, request) {
|
|
1488
|
+
return urlMatches(request.url, configRoutes[key$9]);
|
|
1477
1489
|
}
|
|
1478
1490
|
|
|
1479
1491
|
function auth(_x, _x2) {
|
|
@@ -2011,19 +2023,19 @@ function _PUT$2() {
|
|
|
2011
2023
|
return _PUT$2.apply(this, arguments);
|
|
2012
2024
|
}
|
|
2013
2025
|
|
|
2014
|
-
var key$
|
|
2015
|
-
function route$
|
|
2016
|
-
return _route$
|
|
2026
|
+
var key$8 = 'USERS';
|
|
2027
|
+
function route$b(_x, _x2) {
|
|
2028
|
+
return _route$b.apply(this, arguments);
|
|
2017
2029
|
}
|
|
2018
|
-
function _route$
|
|
2019
|
-
_route$
|
|
2030
|
+
function _route$b() {
|
|
2031
|
+
_route$b = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(request, config) {
|
|
2020
2032
|
var _Logger, info, session;
|
|
2021
2033
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2022
2034
|
while (1) switch (_context.prev = _context.next) {
|
|
2023
2035
|
case 0:
|
|
2024
2036
|
_Logger = Logger(_extends({}, config, {
|
|
2025
2037
|
debug: config.debug
|
|
2026
|
-
}), "[ROUTES][" + key$
|
|
2038
|
+
}), "[ROUTES][" + key$8 + "]"), info = _Logger.info;
|
|
2027
2039
|
_context.next = 3;
|
|
2028
2040
|
return auth(request, config);
|
|
2029
2041
|
case 3:
|
|
@@ -2062,10 +2074,10 @@ function _route$a() {
|
|
|
2062
2074
|
}
|
|
2063
2075
|
}, _callee);
|
|
2064
2076
|
}));
|
|
2065
|
-
return _route$
|
|
2077
|
+
return _route$b.apply(this, arguments);
|
|
2066
2078
|
}
|
|
2067
|
-
function matches$
|
|
2068
|
-
return urlMatches(request.url, configRoutes[key$
|
|
2079
|
+
function matches$b(configRoutes, request) {
|
|
2080
|
+
return urlMatches(request.url, configRoutes[key$8]);
|
|
2069
2081
|
}
|
|
2070
2082
|
|
|
2071
2083
|
/**
|
|
@@ -2300,19 +2312,19 @@ function _PUT$1() {
|
|
|
2300
2312
|
return _PUT$1.apply(this, arguments);
|
|
2301
2313
|
}
|
|
2302
2314
|
|
|
2303
|
-
var key$
|
|
2304
|
-
function route$
|
|
2305
|
-
return _route$
|
|
2315
|
+
var key$7 = 'TENANT_USERS';
|
|
2316
|
+
function route$a(_x, _x2) {
|
|
2317
|
+
return _route$a.apply(this, arguments);
|
|
2306
2318
|
}
|
|
2307
|
-
function _route$
|
|
2308
|
-
_route$
|
|
2319
|
+
function _route$a() {
|
|
2320
|
+
_route$a = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(request, config) {
|
|
2309
2321
|
var _Logger, info, session, yurl, _yurl$pathname$split$, tenantId;
|
|
2310
2322
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2311
2323
|
while (1) switch (_context.prev = _context.next) {
|
|
2312
2324
|
case 0:
|
|
2313
2325
|
_Logger = Logger(_extends({}, config, {
|
|
2314
2326
|
debug: config.debug
|
|
2315
|
-
}), "[ROUTES][" + key$
|
|
2327
|
+
}), "[ROUTES][" + key$7 + "]"), info = _Logger.info;
|
|
2316
2328
|
_context.next = 3;
|
|
2317
2329
|
return auth(request, config);
|
|
2318
2330
|
case 3:
|
|
@@ -2378,17 +2390,17 @@ function _route$9() {
|
|
|
2378
2390
|
}
|
|
2379
2391
|
}, _callee);
|
|
2380
2392
|
}));
|
|
2381
|
-
return _route$
|
|
2393
|
+
return _route$a.apply(this, arguments);
|
|
2382
2394
|
}
|
|
2383
|
-
function matches$
|
|
2395
|
+
function matches$a(configRoutes, request) {
|
|
2384
2396
|
var url = new URL(request.url);
|
|
2385
2397
|
var _url$pathname$split$r = url.pathname.split('/').reverse(),
|
|
2386
2398
|
userId = _url$pathname$split$r[0],
|
|
2387
2399
|
possibleTenantId = _url$pathname$split$r[1],
|
|
2388
2400
|
tenantId = _url$pathname$split$r[2];
|
|
2389
|
-
var route = configRoutes[key$
|
|
2401
|
+
var route = configRoutes[key$7].replace('{tenantId}', tenantId).replace('{userId}', userId);
|
|
2390
2402
|
if (userId === 'users') {
|
|
2391
|
-
route = configRoutes[key$
|
|
2403
|
+
route = configRoutes[key$7].replace('{tenantId}', possibleTenantId);
|
|
2392
2404
|
}
|
|
2393
2405
|
return urlMatches(request.url, route);
|
|
2394
2406
|
}
|
|
@@ -2723,19 +2735,19 @@ function isUUID(value) {
|
|
|
2723
2735
|
var regex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5|7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
|
2724
2736
|
return regex.test(value);
|
|
2725
2737
|
}
|
|
2726
|
-
var key$
|
|
2727
|
-
function route$
|
|
2728
|
-
return _route$
|
|
2738
|
+
var key$6 = 'TENANTS';
|
|
2739
|
+
function route$9(_x, _x2) {
|
|
2740
|
+
return _route$9.apply(this, arguments);
|
|
2729
2741
|
}
|
|
2730
|
-
function _route$
|
|
2731
|
-
_route$
|
|
2742
|
+
function _route$9() {
|
|
2743
|
+
_route$9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(request, config) {
|
|
2732
2744
|
var _Logger, info, session, _request$url$split$re, possibleTenantId;
|
|
2733
2745
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2734
2746
|
while (1) switch (_context.prev = _context.next) {
|
|
2735
2747
|
case 0:
|
|
2736
2748
|
_Logger = Logger(_extends({}, config, {
|
|
2737
2749
|
debug: config.debug
|
|
2738
|
-
}), "[ROUTES][" + key$
|
|
2750
|
+
}), "[ROUTES][" + key$6 + "]"), info = _Logger.info;
|
|
2739
2751
|
_context.next = 3;
|
|
2740
2752
|
return auth(request, config);
|
|
2741
2753
|
case 3:
|
|
@@ -2802,10 +2814,10 @@ function _route$8() {
|
|
|
2802
2814
|
}
|
|
2803
2815
|
}, _callee);
|
|
2804
2816
|
}));
|
|
2805
|
-
return _route$
|
|
2817
|
+
return _route$9.apply(this, arguments);
|
|
2806
2818
|
}
|
|
2807
|
-
function matches$
|
|
2808
|
-
return urlMatches(request.url, configRoutes[key$
|
|
2819
|
+
function matches$9(configRoutes, request) {
|
|
2820
|
+
return urlMatches(request.url, configRoutes[key$6]);
|
|
2809
2821
|
}
|
|
2810
2822
|
|
|
2811
2823
|
var proxyRoutes = function proxyRoutes(config) {
|
|
@@ -2816,21 +2828,22 @@ var proxyRoutes = function proxyRoutes(config) {
|
|
|
2816
2828
|
CSRF: makeRestUrl(config, '/auth/csrf'),
|
|
2817
2829
|
CALLBACK: makeRestUrl(config, '/auth/callback'),
|
|
2818
2830
|
SIGNOUT: makeRestUrl(config, '/auth/signout'),
|
|
2819
|
-
ERROR: makeRestUrl(config, '/auth/error')
|
|
2831
|
+
ERROR: makeRestUrl(config, '/auth/error'),
|
|
2832
|
+
VERIFY_REQUEST: makeRestUrl(config, '/auth/verify-request')
|
|
2820
2833
|
};
|
|
2821
2834
|
};
|
|
2822
2835
|
|
|
2823
|
-
var key$
|
|
2824
|
-
function route$
|
|
2825
|
-
return _route$
|
|
2836
|
+
var key$5 = 'SIGNIN';
|
|
2837
|
+
function route$8(_x, _x2) {
|
|
2838
|
+
return _route$8.apply(this, arguments);
|
|
2826
2839
|
}
|
|
2827
|
-
function _route$
|
|
2828
|
-
_route$
|
|
2840
|
+
function _route$8() {
|
|
2841
|
+
_route$8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, config) {
|
|
2829
2842
|
var url, init, _URL$pathname$split$r, provider, passThroughUrl, params, res;
|
|
2830
2843
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2831
2844
|
while (1) switch (_context.prev = _context.next) {
|
|
2832
2845
|
case 0:
|
|
2833
|
-
url = proxyRoutes(config)[key$
|
|
2846
|
+
url = proxyRoutes(config)[key$5];
|
|
2834
2847
|
init = {
|
|
2835
2848
|
method: req.method,
|
|
2836
2849
|
headers: req.headers
|
|
@@ -2840,7 +2853,7 @@ function _route$7() {
|
|
|
2840
2853
|
init.body = req.clone().body;
|
|
2841
2854
|
}
|
|
2842
2855
|
_URL$pathname$split$r = new URL(req.url).pathname.split('/').reverse(), provider = _URL$pathname$split$r[0];
|
|
2843
|
-
url = proxyRoutes(config)[key$
|
|
2856
|
+
url = proxyRoutes(config)[key$5] + "/" + provider;
|
|
2844
2857
|
}
|
|
2845
2858
|
passThroughUrl = new URL(req.url);
|
|
2846
2859
|
params = new URLSearchParams(passThroughUrl.search);
|
|
@@ -2858,17 +2871,17 @@ function _route$7() {
|
|
|
2858
2871
|
}
|
|
2859
2872
|
}, _callee);
|
|
2860
2873
|
}));
|
|
2861
|
-
return _route$
|
|
2874
|
+
return _route$8.apply(this, arguments);
|
|
2862
2875
|
}
|
|
2863
|
-
function matches$
|
|
2864
|
-
return urlMatches(request.url, configRoutes[key$
|
|
2876
|
+
function matches$8(configRoutes, request) {
|
|
2877
|
+
return urlMatches(request.url, configRoutes[key$5]);
|
|
2865
2878
|
}
|
|
2866
2879
|
|
|
2867
|
-
function route$
|
|
2868
|
-
return _route$
|
|
2880
|
+
function route$7(_x, _x2) {
|
|
2881
|
+
return _route$7.apply(this, arguments);
|
|
2869
2882
|
}
|
|
2870
|
-
function _route$
|
|
2871
|
-
_route$
|
|
2883
|
+
function _route$7() {
|
|
2884
|
+
_route$7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, config) {
|
|
2872
2885
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2873
2886
|
while (1) switch (_context.prev = _context.next) {
|
|
2874
2887
|
case 0:
|
|
@@ -2882,17 +2895,17 @@ function _route$6() {
|
|
|
2882
2895
|
}
|
|
2883
2896
|
}, _callee);
|
|
2884
2897
|
}));
|
|
2885
|
-
return _route$
|
|
2898
|
+
return _route$7.apply(this, arguments);
|
|
2886
2899
|
}
|
|
2887
|
-
function matches$
|
|
2900
|
+
function matches$7(configRoutes, request) {
|
|
2888
2901
|
return urlMatches(request.url, configRoutes.SESSION);
|
|
2889
2902
|
}
|
|
2890
2903
|
|
|
2891
|
-
function route$
|
|
2892
|
-
return _route$
|
|
2904
|
+
function route$6(_x, _x2) {
|
|
2905
|
+
return _route$6.apply(this, arguments);
|
|
2893
2906
|
}
|
|
2894
|
-
function _route$
|
|
2895
|
-
_route$
|
|
2907
|
+
function _route$6() {
|
|
2908
|
+
_route$6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, config) {
|
|
2896
2909
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2897
2910
|
while (1) switch (_context.prev = _context.next) {
|
|
2898
2911
|
case 0:
|
|
@@ -2906,17 +2919,17 @@ function _route$5() {
|
|
|
2906
2919
|
}
|
|
2907
2920
|
}, _callee);
|
|
2908
2921
|
}));
|
|
2909
|
-
return _route$
|
|
2922
|
+
return _route$6.apply(this, arguments);
|
|
2910
2923
|
}
|
|
2911
|
-
function matches$
|
|
2924
|
+
function matches$6(configRoutes, request) {
|
|
2912
2925
|
return urlMatches(request.url, configRoutes.PROVIDERS);
|
|
2913
2926
|
}
|
|
2914
2927
|
|
|
2915
|
-
function route$
|
|
2916
|
-
return _route$
|
|
2928
|
+
function route$5(_x, _x2) {
|
|
2929
|
+
return _route$5.apply(this, arguments);
|
|
2917
2930
|
}
|
|
2918
|
-
function _route$
|
|
2919
|
-
_route$
|
|
2931
|
+
function _route$5() {
|
|
2932
|
+
_route$5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, config) {
|
|
2920
2933
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2921
2934
|
while (1) switch (_context.prev = _context.next) {
|
|
2922
2935
|
case 0:
|
|
@@ -2930,25 +2943,25 @@ function _route$4() {
|
|
|
2930
2943
|
}
|
|
2931
2944
|
}, _callee);
|
|
2932
2945
|
}));
|
|
2933
|
-
return _route$
|
|
2946
|
+
return _route$5.apply(this, arguments);
|
|
2934
2947
|
}
|
|
2935
|
-
function matches$
|
|
2948
|
+
function matches$5(configRoutes, request) {
|
|
2936
2949
|
return urlMatches(request.url, configRoutes.CSRF);
|
|
2937
2950
|
}
|
|
2938
2951
|
|
|
2939
|
-
var key$
|
|
2940
|
-
function route$
|
|
2941
|
-
return _route$
|
|
2952
|
+
var key$4 = 'CALLBACK';
|
|
2953
|
+
function route$4(_x, _x2) {
|
|
2954
|
+
return _route$4.apply(this, arguments);
|
|
2942
2955
|
}
|
|
2943
|
-
function _route$
|
|
2944
|
-
_route$
|
|
2956
|
+
function _route$4() {
|
|
2957
|
+
_route$4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(request$1, config) {
|
|
2945
2958
|
var _Logger, error, _URL$pathname$split$r, provider, passThroughUrl, params, url, res, location;
|
|
2946
2959
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2947
2960
|
while (1) switch (_context.prev = _context.next) {
|
|
2948
2961
|
case 0:
|
|
2949
2962
|
_Logger = Logger(_extends({}, config, {
|
|
2950
2963
|
debug: config.debug
|
|
2951
|
-
}), "[ROUTES][" + key$
|
|
2964
|
+
}), "[ROUTES][" + key$4 + "]"), error = _Logger.error;
|
|
2952
2965
|
_URL$pathname$split$r = new URL(request$1.url).pathname.split('/').reverse(), provider = _URL$pathname$split$r[0];
|
|
2953
2966
|
passThroughUrl = new URL(request$1.url);
|
|
2954
2967
|
params = new URLSearchParams(passThroughUrl.search);
|
|
@@ -2982,30 +2995,30 @@ function _route$3() {
|
|
|
2982
2995
|
}
|
|
2983
2996
|
}, _callee);
|
|
2984
2997
|
}));
|
|
2985
|
-
return _route$
|
|
2998
|
+
return _route$4.apply(this, arguments);
|
|
2986
2999
|
}
|
|
2987
|
-
function matches$
|
|
3000
|
+
function matches$4(configRoutes, request) {
|
|
2988
3001
|
return urlMatches(request.url, configRoutes.CALLBACK);
|
|
2989
3002
|
}
|
|
2990
3003
|
|
|
2991
|
-
var key$
|
|
2992
|
-
function route$
|
|
2993
|
-
return _route$
|
|
3004
|
+
var key$3 = 'SIGNOUT';
|
|
3005
|
+
function route$3(_x, _x2) {
|
|
3006
|
+
return _route$3.apply(this, arguments);
|
|
2994
3007
|
}
|
|
2995
|
-
function _route$
|
|
2996
|
-
_route$
|
|
3008
|
+
function _route$3() {
|
|
3009
|
+
_route$3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(request$1, config) {
|
|
2997
3010
|
var url, init, _URL$pathname$split$r, provider, res;
|
|
2998
3011
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2999
3012
|
while (1) switch (_context.prev = _context.next) {
|
|
3000
3013
|
case 0:
|
|
3001
|
-
url = proxyRoutes(config)[key$
|
|
3014
|
+
url = proxyRoutes(config)[key$3];
|
|
3002
3015
|
init = {
|
|
3003
3016
|
method: request$1.method
|
|
3004
3017
|
};
|
|
3005
3018
|
if (request$1.method === 'POST') {
|
|
3006
3019
|
init.body = request$1.body;
|
|
3007
3020
|
_URL$pathname$split$r = new URL(request$1.url).pathname.split('/').reverse(), provider = _URL$pathname$split$r[0];
|
|
3008
|
-
url = proxyRoutes(config)[key$
|
|
3021
|
+
url = proxyRoutes(config)[key$3] + "/" + provider;
|
|
3009
3022
|
}
|
|
3010
3023
|
_context.next = 5;
|
|
3011
3024
|
return request(url, _extends({}, init, {
|
|
@@ -3020,13 +3033,38 @@ function _route$2() {
|
|
|
3020
3033
|
}
|
|
3021
3034
|
}, _callee);
|
|
3022
3035
|
}));
|
|
3036
|
+
return _route$3.apply(this, arguments);
|
|
3037
|
+
}
|
|
3038
|
+
function matches$3(configRoutes, request) {
|
|
3039
|
+
return urlMatches(request.url, configRoutes[key$3]);
|
|
3040
|
+
}
|
|
3041
|
+
|
|
3042
|
+
var key$2 = 'ERROR';
|
|
3043
|
+
function route$2(_x, _x2) {
|
|
3044
|
+
return _route$2.apply(this, arguments);
|
|
3045
|
+
}
|
|
3046
|
+
function _route$2() {
|
|
3047
|
+
_route$2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(req, config) {
|
|
3048
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3049
|
+
while (1) switch (_context.prev = _context.next) {
|
|
3050
|
+
case 0:
|
|
3051
|
+
return _context.abrupt("return", request(proxyRoutes(config)[key$2], {
|
|
3052
|
+
method: req.method,
|
|
3053
|
+
request: req
|
|
3054
|
+
}, config));
|
|
3055
|
+
case 1:
|
|
3056
|
+
case "end":
|
|
3057
|
+
return _context.stop();
|
|
3058
|
+
}
|
|
3059
|
+
}, _callee);
|
|
3060
|
+
}));
|
|
3023
3061
|
return _route$2.apply(this, arguments);
|
|
3024
3062
|
}
|
|
3025
3063
|
function matches$2(configRoutes, request) {
|
|
3026
3064
|
return urlMatches(request.url, configRoutes[key$2]);
|
|
3027
3065
|
}
|
|
3028
3066
|
|
|
3029
|
-
var key$1 = '
|
|
3067
|
+
var key$1 = 'VERIFY_REQUEST';
|
|
3030
3068
|
function route$1(_x, _x2) {
|
|
3031
3069
|
return _route$1.apply(this, arguments);
|
|
3032
3070
|
}
|
|
@@ -3060,88 +3098,95 @@ function GETTER(configRoutes, config) {
|
|
|
3060
3098
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3061
3099
|
while (1) switch (_context.prev = _context.next) {
|
|
3062
3100
|
case 0:
|
|
3063
|
-
if (!matches$
|
|
3101
|
+
if (!matches$c(configRoutes, req)) {
|
|
3064
3102
|
_context.next = 3;
|
|
3065
3103
|
break;
|
|
3066
3104
|
}
|
|
3067
3105
|
info('matches me');
|
|
3068
|
-
return _context.abrupt("return", route$
|
|
3106
|
+
return _context.abrupt("return", route$c(req, config));
|
|
3069
3107
|
case 3:
|
|
3070
|
-
if (!matches$
|
|
3108
|
+
if (!matches$a(configRoutes, req)) {
|
|
3071
3109
|
_context.next = 6;
|
|
3072
3110
|
break;
|
|
3073
3111
|
}
|
|
3074
3112
|
info('matches tenant users');
|
|
3075
|
-
return _context.abrupt("return", route$
|
|
3113
|
+
return _context.abrupt("return", route$a(req, config));
|
|
3076
3114
|
case 6:
|
|
3077
|
-
if (!matches$
|
|
3115
|
+
if (!matches$b(configRoutes, req)) {
|
|
3078
3116
|
_context.next = 9;
|
|
3079
3117
|
break;
|
|
3080
3118
|
}
|
|
3081
3119
|
info('matches users');
|
|
3082
|
-
return _context.abrupt("return", route$
|
|
3120
|
+
return _context.abrupt("return", route$b(req, config));
|
|
3083
3121
|
case 9:
|
|
3084
|
-
if (!matches$
|
|
3122
|
+
if (!matches$9(configRoutes, req)) {
|
|
3085
3123
|
_context.next = 12;
|
|
3086
3124
|
break;
|
|
3087
3125
|
}
|
|
3088
3126
|
info('matches tenants');
|
|
3089
|
-
return _context.abrupt("return", route$
|
|
3127
|
+
return _context.abrupt("return", route$9(req, config));
|
|
3090
3128
|
case 12:
|
|
3091
|
-
if (!matches$
|
|
3129
|
+
if (!matches$7(configRoutes, req)) {
|
|
3092
3130
|
_context.next = 15;
|
|
3093
3131
|
break;
|
|
3094
3132
|
}
|
|
3095
3133
|
info('matches session');
|
|
3096
|
-
return _context.abrupt("return", route$
|
|
3134
|
+
return _context.abrupt("return", route$7(req, config));
|
|
3097
3135
|
case 15:
|
|
3098
|
-
if (!matches$
|
|
3136
|
+
if (!matches$8(configRoutes, req)) {
|
|
3099
3137
|
_context.next = 18;
|
|
3100
3138
|
break;
|
|
3101
3139
|
}
|
|
3102
3140
|
info('matches signin');
|
|
3103
|
-
return _context.abrupt("return", route$
|
|
3141
|
+
return _context.abrupt("return", route$8(req, config));
|
|
3104
3142
|
case 18:
|
|
3105
|
-
if (!matches$
|
|
3143
|
+
if (!matches$6(configRoutes, req)) {
|
|
3106
3144
|
_context.next = 21;
|
|
3107
3145
|
break;
|
|
3108
3146
|
}
|
|
3109
3147
|
info('matches providers');
|
|
3110
|
-
return _context.abrupt("return", route$
|
|
3148
|
+
return _context.abrupt("return", route$6(req, config));
|
|
3111
3149
|
case 21:
|
|
3112
|
-
if (!matches$
|
|
3150
|
+
if (!matches$5(configRoutes, req)) {
|
|
3113
3151
|
_context.next = 24;
|
|
3114
3152
|
break;
|
|
3115
3153
|
}
|
|
3116
3154
|
info('matches csrf');
|
|
3117
|
-
return _context.abrupt("return", route$
|
|
3155
|
+
return _context.abrupt("return", route$5(req, config));
|
|
3118
3156
|
case 24:
|
|
3119
|
-
if (!matches$
|
|
3157
|
+
if (!matches$4(configRoutes, req)) {
|
|
3120
3158
|
_context.next = 27;
|
|
3121
3159
|
break;
|
|
3122
3160
|
}
|
|
3123
3161
|
info('matches callback');
|
|
3124
|
-
return _context.abrupt("return", route$
|
|
3162
|
+
return _context.abrupt("return", route$4(req, config));
|
|
3125
3163
|
case 27:
|
|
3126
|
-
if (!matches$
|
|
3164
|
+
if (!matches$3(configRoutes, req)) {
|
|
3127
3165
|
_context.next = 30;
|
|
3128
3166
|
break;
|
|
3129
3167
|
}
|
|
3130
3168
|
info('matches signout');
|
|
3131
|
-
return _context.abrupt("return", route$
|
|
3169
|
+
return _context.abrupt("return", route$3(req, config));
|
|
3132
3170
|
case 30:
|
|
3133
3171
|
if (!matches$1(configRoutes, req)) {
|
|
3134
3172
|
_context.next = 33;
|
|
3135
3173
|
break;
|
|
3136
3174
|
}
|
|
3137
|
-
info('matches
|
|
3175
|
+
info('matches verify-request');
|
|
3138
3176
|
return _context.abrupt("return", route$1(req, config));
|
|
3139
3177
|
case 33:
|
|
3178
|
+
if (!matches$2(configRoutes, req)) {
|
|
3179
|
+
_context.next = 36;
|
|
3180
|
+
break;
|
|
3181
|
+
}
|
|
3182
|
+
info('matches error');
|
|
3183
|
+
return _context.abrupt("return", route$2(req, config));
|
|
3184
|
+
case 36:
|
|
3140
3185
|
warn('No GET routes matched');
|
|
3141
3186
|
return _context.abrupt("return", new Response(null, {
|
|
3142
3187
|
status: 404
|
|
3143
3188
|
}));
|
|
3144
|
-
case
|
|
3189
|
+
case 38:
|
|
3145
3190
|
case "end":
|
|
3146
3191
|
return _context.stop();
|
|
3147
3192
|
}
|
|
@@ -3285,12 +3330,12 @@ function POSTER(configRoutes, config) {
|
|
|
3285
3330
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3286
3331
|
while (1) switch (_context.prev = _context.next) {
|
|
3287
3332
|
case 0:
|
|
3288
|
-
if (!matches$
|
|
3333
|
+
if (!matches$a(configRoutes, req)) {
|
|
3289
3334
|
_context.next = 3;
|
|
3290
3335
|
break;
|
|
3291
3336
|
}
|
|
3292
3337
|
info('matches tenant users');
|
|
3293
|
-
return _context.abrupt("return", route$
|
|
3338
|
+
return _context.abrupt("return", route$a(req, config));
|
|
3294
3339
|
case 3:
|
|
3295
3340
|
if (!matches(configRoutes, req)) {
|
|
3296
3341
|
_context.next = 6;
|
|
@@ -3299,61 +3344,61 @@ function POSTER(configRoutes, config) {
|
|
|
3299
3344
|
info('matches signup');
|
|
3300
3345
|
return _context.abrupt("return", route(req, config));
|
|
3301
3346
|
case 6:
|
|
3302
|
-
if (!matches$
|
|
3347
|
+
if (!matches$b(configRoutes, req)) {
|
|
3303
3348
|
_context.next = 9;
|
|
3304
3349
|
break;
|
|
3305
3350
|
}
|
|
3306
3351
|
info('matches users');
|
|
3307
|
-
return _context.abrupt("return", route$
|
|
3352
|
+
return _context.abrupt("return", route$b(req, config));
|
|
3308
3353
|
case 9:
|
|
3309
|
-
if (!matches$
|
|
3354
|
+
if (!matches$9(configRoutes, req)) {
|
|
3310
3355
|
_context.next = 12;
|
|
3311
3356
|
break;
|
|
3312
3357
|
}
|
|
3313
3358
|
info('matches tenants');
|
|
3314
|
-
return _context.abrupt("return", route$
|
|
3359
|
+
return _context.abrupt("return", route$9(req, config));
|
|
3315
3360
|
case 12:
|
|
3316
|
-
if (!matches$
|
|
3361
|
+
if (!matches$7(configRoutes, req)) {
|
|
3317
3362
|
_context.next = 15;
|
|
3318
3363
|
break;
|
|
3319
3364
|
}
|
|
3320
3365
|
info('matches session');
|
|
3321
|
-
return _context.abrupt("return", route$
|
|
3366
|
+
return _context.abrupt("return", route$7(req, config));
|
|
3322
3367
|
case 15:
|
|
3323
|
-
if (!matches$
|
|
3368
|
+
if (!matches$8(configRoutes, req)) {
|
|
3324
3369
|
_context.next = 18;
|
|
3325
3370
|
break;
|
|
3326
3371
|
}
|
|
3327
3372
|
info('matches signin');
|
|
3328
|
-
return _context.abrupt("return", route$
|
|
3373
|
+
return _context.abrupt("return", route$8(req, config));
|
|
3329
3374
|
case 18:
|
|
3330
|
-
if (!matches$
|
|
3375
|
+
if (!matches$6(configRoutes, req)) {
|
|
3331
3376
|
_context.next = 21;
|
|
3332
3377
|
break;
|
|
3333
3378
|
}
|
|
3334
3379
|
info('matches providers');
|
|
3335
|
-
return _context.abrupt("return", route$
|
|
3380
|
+
return _context.abrupt("return", route$6(req, config));
|
|
3336
3381
|
case 21:
|
|
3337
|
-
if (!matches$
|
|
3382
|
+
if (!matches$5(configRoutes, req)) {
|
|
3338
3383
|
_context.next = 24;
|
|
3339
3384
|
break;
|
|
3340
3385
|
}
|
|
3341
3386
|
info('matches csrf');
|
|
3342
|
-
return _context.abrupt("return", route$
|
|
3387
|
+
return _context.abrupt("return", route$5(req, config));
|
|
3343
3388
|
case 24:
|
|
3344
|
-
if (!matches$
|
|
3389
|
+
if (!matches$4(configRoutes, req)) {
|
|
3345
3390
|
_context.next = 27;
|
|
3346
3391
|
break;
|
|
3347
3392
|
}
|
|
3348
3393
|
info('matches callback');
|
|
3349
|
-
return _context.abrupt("return", route$
|
|
3394
|
+
return _context.abrupt("return", route$4(req, config));
|
|
3350
3395
|
case 27:
|
|
3351
|
-
if (!matches$
|
|
3396
|
+
if (!matches$3(configRoutes, req)) {
|
|
3352
3397
|
_context.next = 30;
|
|
3353
3398
|
break;
|
|
3354
3399
|
}
|
|
3355
3400
|
info('matches signout');
|
|
3356
|
-
return _context.abrupt("return", route$
|
|
3401
|
+
return _context.abrupt("return", route$3(req, config));
|
|
3357
3402
|
case 30:
|
|
3358
3403
|
warn('No POST routes matched');
|
|
3359
3404
|
return _context.abrupt("return", new Response(null, {
|
|
@@ -3381,19 +3426,19 @@ function DELETER(configRoutes, config) {
|
|
|
3381
3426
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3382
3427
|
while (1) switch (_context.prev = _context.next) {
|
|
3383
3428
|
case 0:
|
|
3384
|
-
if (!matches$
|
|
3429
|
+
if (!matches$a(configRoutes, req)) {
|
|
3385
3430
|
_context.next = 3;
|
|
3386
3431
|
break;
|
|
3387
3432
|
}
|
|
3388
3433
|
info('matches tenant users');
|
|
3389
|
-
return _context.abrupt("return", route$
|
|
3434
|
+
return _context.abrupt("return", route$a(req, config));
|
|
3390
3435
|
case 3:
|
|
3391
|
-
if (!matches$
|
|
3436
|
+
if (!matches$9(configRoutes, req)) {
|
|
3392
3437
|
_context.next = 6;
|
|
3393
3438
|
break;
|
|
3394
3439
|
}
|
|
3395
3440
|
info('matches tenants');
|
|
3396
|
-
return _context.abrupt("return", route$
|
|
3441
|
+
return _context.abrupt("return", route$9(req, config));
|
|
3397
3442
|
case 6:
|
|
3398
3443
|
warn('No DELETE routes matched');
|
|
3399
3444
|
return _context.abrupt("return", new Response(null, {
|
|
@@ -3421,26 +3466,26 @@ function PUTER(configRoutes, config) {
|
|
|
3421
3466
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3422
3467
|
while (1) switch (_context.prev = _context.next) {
|
|
3423
3468
|
case 0:
|
|
3424
|
-
if (!matches$
|
|
3469
|
+
if (!matches$a(configRoutes, req)) {
|
|
3425
3470
|
_context.next = 3;
|
|
3426
3471
|
break;
|
|
3427
3472
|
}
|
|
3428
3473
|
info('matches tenant users');
|
|
3429
|
-
return _context.abrupt("return", route$
|
|
3474
|
+
return _context.abrupt("return", route$a(req, config));
|
|
3430
3475
|
case 3:
|
|
3431
|
-
if (!matches$
|
|
3476
|
+
if (!matches$b(configRoutes, req)) {
|
|
3432
3477
|
_context.next = 6;
|
|
3433
3478
|
break;
|
|
3434
3479
|
}
|
|
3435
3480
|
info('matches users');
|
|
3436
|
-
return _context.abrupt("return", route$
|
|
3481
|
+
return _context.abrupt("return", route$b(req, config));
|
|
3437
3482
|
case 6:
|
|
3438
|
-
if (!matches$
|
|
3483
|
+
if (!matches$9(configRoutes, req)) {
|
|
3439
3484
|
_context.next = 9;
|
|
3440
3485
|
break;
|
|
3441
3486
|
}
|
|
3442
3487
|
info('matches tenants');
|
|
3443
|
-
return _context.abrupt("return", route$
|
|
3488
|
+
return _context.abrupt("return", route$9(req, config));
|
|
3444
3489
|
case 9:
|
|
3445
3490
|
warn('No PUT routes matched');
|
|
3446
3491
|
return _context.abrupt("return", new Response(null, {
|
|
@@ -3484,6 +3529,7 @@ var appRoutes = function appRoutes(prefix) {
|
|
|
3484
3529
|
CALLBACK: prefix + "/auth/callback",
|
|
3485
3530
|
SIGNOUT: prefix + "/auth/signout",
|
|
3486
3531
|
ERROR: prefix + "/auth/error",
|
|
3532
|
+
VERIFY_REQUEST: prefix + "/auth/verify-request",
|
|
3487
3533
|
ME: prefix + "/me",
|
|
3488
3534
|
USERS: prefix + "/users",
|
|
3489
3535
|
TENANTS: prefix + "/tenants",
|