miolo 0.0.44 → 0.0.45
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/lib/index.js +10 -10
- package/lib/server/index.js +2 -2
- package/lib/server/middleware/context.js +2 -7
- package/package.json +1 -1
- package/src/index.js +6 -6
- package/src/server/index.js +2 -2
- package/src/server/middleware/context.js +2 -8
package/lib/index.js
CHANGED
|
@@ -3,34 +3,34 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "getCacher", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _cacher.init_cacher;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "getConnection", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function get() {
|
|
15
|
-
return _calustraRouter.
|
|
15
|
+
return _calustraRouter.getConnection;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
18
|
+
Object.defineProperty(exports, "getEmailer", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function get() {
|
|
21
|
-
return
|
|
21
|
+
return _emailer.init_emailer;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "getLogger", {
|
|
25
25
|
enumerable: true,
|
|
26
26
|
get: function get() {
|
|
27
|
-
return
|
|
27
|
+
return _logger.init_logger;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
Object.defineProperty(exports, "
|
|
30
|
+
Object.defineProperty(exports, "getModel", {
|
|
31
31
|
enumerable: true,
|
|
32
32
|
get: function get() {
|
|
33
|
-
return
|
|
33
|
+
return _calustraRouter.getModel;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "miolo", {
|
package/lib/server/index.js
CHANGED
|
@@ -58,8 +58,8 @@ function miolo(sconfig, render, callback) {
|
|
|
58
58
|
getModel: miolo_getModel
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
// Assign miolo stuff to ctx
|
|
62
|
-
(0, _context.init_context_middleware)(app,
|
|
61
|
+
// Assign this miolo stuff also to ctx
|
|
62
|
+
(0, _context.init_context_middleware)(app, app.miolo);
|
|
63
63
|
|
|
64
64
|
// Compress and body parser
|
|
65
65
|
(0, _body.init_body_middleware)(app);
|
|
@@ -6,19 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.init_context_middleware = void 0;
|
|
7
7
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
8
8
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
9
|
-
var init_context_middleware = (app,
|
|
9
|
+
var init_context_middleware = (app, miolo) => {
|
|
10
10
|
function context_middleware(_x, _x2) {
|
|
11
11
|
return _context_middleware.apply(this, arguments);
|
|
12
12
|
}
|
|
13
13
|
function _context_middleware() {
|
|
14
14
|
_context_middleware = _asyncToGenerator(function* (ctx, next) {
|
|
15
15
|
// Assign miolo stuff to ctx
|
|
16
|
-
ctx.miolo =
|
|
17
|
-
config,
|
|
18
|
-
logger,
|
|
19
|
-
emailer,
|
|
20
|
-
conn
|
|
21
|
-
};
|
|
16
|
+
ctx.miolo = miolo;
|
|
22
17
|
yield next();
|
|
23
18
|
});
|
|
24
19
|
return _context_middleware.apply(this, arguments);
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {miolo} from './server'
|
|
2
|
-
import { init_emailer } from './emailer'
|
|
3
|
-
import { init_cacher } from './cacher'
|
|
4
|
-
import { init_logger } from './logger'
|
|
2
|
+
import { init_emailer as getEmailer} from './emailer'
|
|
3
|
+
import { init_cacher as getCacher} from './cacher'
|
|
4
|
+
import { init_logger as getLogger } from './logger'
|
|
5
5
|
import { getConnection, getModel } from 'calustra-router'
|
|
6
6
|
|
|
7
7
|
export {
|
|
8
8
|
miolo,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
getEmailer,
|
|
10
|
+
getCacher,
|
|
11
|
+
getLogger,
|
|
12
12
|
getConnection,
|
|
13
13
|
getModel
|
|
14
14
|
}
|
package/src/server/index.js
CHANGED
|
@@ -56,8 +56,8 @@ function miolo(sconfig, render, callback) {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
// Assign miolo stuff to ctx
|
|
60
|
-
init_context_middleware(app,
|
|
59
|
+
// Assign this miolo stuff also to ctx
|
|
60
|
+
init_context_middleware(app, app.miolo)
|
|
61
61
|
|
|
62
62
|
// Compress and body parser
|
|
63
63
|
init_body_middleware(app)
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
const init_context_middleware = ( app,
|
|
2
|
+
const init_context_middleware = ( app, miolo ) => {
|
|
3
3
|
async function context_middleware(ctx, next) {
|
|
4
4
|
|
|
5
5
|
// Assign miolo stuff to ctx
|
|
6
|
-
ctx.miolo=
|
|
7
|
-
config,
|
|
8
|
-
logger,
|
|
9
|
-
emailer,
|
|
10
|
-
conn
|
|
11
|
-
}
|
|
12
|
-
|
|
6
|
+
ctx.miolo= miolo
|
|
13
7
|
await next()
|
|
14
8
|
|
|
15
9
|
}
|