miolo 0.0.21 → 0.0.22
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.
|
@@ -65,9 +65,16 @@ function _init_queries_router() {
|
|
|
65
65
|
|
|
66
66
|
function _route_callback() {
|
|
67
67
|
_route_callback = _asyncToGenerator(function* (ctx) {
|
|
68
|
-
|
|
68
|
+
ctx.miolo.logger.log("[queries] ".concat(route.path));
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
try {
|
|
71
|
+
var auth = _objectSpread(_objectSpread({}, global_auth), route.auth || {});
|
|
72
|
+
|
|
73
|
+
_check_auth(ctx, auth, route.method);
|
|
74
|
+
} catch (e) {
|
|
75
|
+
ctx.miolo.logger.error("[queries] error on ".concat(route.path));
|
|
76
|
+
ctx.miolo.logger.error(e);
|
|
77
|
+
}
|
|
71
78
|
|
|
72
79
|
var result = yield route.callback(ctx, conn);
|
|
73
80
|
return result;
|
package/package.json
CHANGED
|
@@ -45,11 +45,18 @@ async function init_queries_router (app, conn, queries) {
|
|
|
45
45
|
routes.map(route => {
|
|
46
46
|
|
|
47
47
|
async function route_callback(ctx) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
|
|
49
|
+
ctx.miolo.logger.log(`[queries] ${route.path}`)
|
|
50
|
+
try {
|
|
51
|
+
const auth= {
|
|
52
|
+
...global_auth,
|
|
53
|
+
...route.auth || {}
|
|
54
|
+
}
|
|
55
|
+
_check_auth(ctx, auth, route.method)
|
|
56
|
+
} catch(e) {
|
|
57
|
+
ctx.miolo.logger.error(`[queries] error on ${route.path}`)
|
|
58
|
+
ctx.miolo.logger.error(e)
|
|
51
59
|
}
|
|
52
|
-
_check_auth(ctx, auth, route.method)
|
|
53
60
|
|
|
54
61
|
const result= await route.callback(ctx, conn)
|
|
55
62
|
return result
|