miolo 0.0.25 → 0.0.28
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/config/defaults.js +2 -4
- package/lib/index.js +16 -8
- package/lib/server/index.js +2 -2
- package/package.json +4 -3
- package/src/config/defaults.js +2 -4
- package/src/index.js +7 -5
- package/src/server/index.js +2 -2
- package/lib/db/conn.js +0 -15
- package/src/db/conn.js +0 -10
package/lib/config/defaults.js
CHANGED
|
@@ -50,7 +50,7 @@ module.exports = {
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
database: {
|
|
53
|
-
|
|
53
|
+
db: {
|
|
54
54
|
dialect: 'postgres',
|
|
55
55
|
host: 'localhost',
|
|
56
56
|
port: 5432,
|
|
@@ -64,9 +64,7 @@ module.exports = {
|
|
|
64
64
|
idleTimeoutMillis: 10000 // The maximum time, in milliseconds, that a connection can be idle before being released. Use with combination of evict for proper working, for more details read https://github.com/coopernurse/node-pool/issues/178#issuecomment-327110870,
|
|
65
65
|
|
|
66
66
|
},
|
|
67
|
-
|
|
68
|
-
log: 'info'
|
|
69
|
-
}
|
|
67
|
+
log: 'info'
|
|
70
68
|
},
|
|
71
69
|
routes: {
|
|
72
70
|
body_field: undefined,
|
package/lib/index.js
CHANGED
|
@@ -3,28 +3,34 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "getConnection", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _calustra.getConnection;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "getConnectionFromCache", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _calustraRouter.getConnectionFromCache;
|
|
10
16
|
}
|
|
11
17
|
});
|
|
12
18
|
Object.defineProperty(exports, "getModel", {
|
|
13
19
|
enumerable: true,
|
|
14
20
|
get: function get() {
|
|
15
|
-
return
|
|
21
|
+
return _calustraOrm.getModel;
|
|
16
22
|
}
|
|
17
23
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "getModelFromCache", {
|
|
19
25
|
enumerable: true,
|
|
20
26
|
get: function get() {
|
|
21
|
-
return
|
|
27
|
+
return _calustraRouter.getModelFromCache;
|
|
22
28
|
}
|
|
23
29
|
});
|
|
24
|
-
Object.defineProperty(exports, "
|
|
30
|
+
Object.defineProperty(exports, "init_cacher", {
|
|
25
31
|
enumerable: true,
|
|
26
32
|
get: function get() {
|
|
27
|
-
return
|
|
33
|
+
return _cacher.init_cacher;
|
|
28
34
|
}
|
|
29
35
|
});
|
|
30
36
|
Object.defineProperty(exports, "init_emailer", {
|
|
@@ -54,6 +60,8 @@ var _cacher = require("./cacher");
|
|
|
54
60
|
|
|
55
61
|
var _logger = require("./logger");
|
|
56
62
|
|
|
57
|
-
var
|
|
63
|
+
var _calustra = require("calustra");
|
|
64
|
+
|
|
65
|
+
var _calustraOrm = require("calustra-orm");
|
|
58
66
|
|
|
59
67
|
var _calustraRouter = require("calustra-router");
|
package/lib/server/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var _logger = require("../logger");
|
|
|
15
15
|
|
|
16
16
|
var _cron = require("./engines/cron");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _calustra = require("calustra");
|
|
19
19
|
|
|
20
20
|
var _context = require("./middleware/context");
|
|
21
21
|
|
|
@@ -58,7 +58,7 @@ function _miolo() {
|
|
|
58
58
|
var conn;
|
|
59
59
|
|
|
60
60
|
if (config.database) {
|
|
61
|
-
conn = (0,
|
|
61
|
+
conn = (0, _calustra.getConnection)(config.database);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
var app = new _koa.default(); // Assign miolo stuff to ctx
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "miolo",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"description": "miolo",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"author": "Afialapis <info@afialapis.com>",
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
"assign-deep": "^1.0.1",
|
|
15
15
|
"babel-plugin-module-resolver": "^4.1.0",
|
|
16
16
|
"basic-auth": "^2.0.1",
|
|
17
|
-
"calustra": "0.0.
|
|
18
|
-
"calustra-
|
|
17
|
+
"calustra": "0.0.34",
|
|
18
|
+
"calustra-orm": "0.0.34",
|
|
19
|
+
"calustra-router": "0.0.34",
|
|
19
20
|
"cron": "^1.8.2",
|
|
20
21
|
"diskspace": "^2.0.0",
|
|
21
22
|
"eslint": "^8.9.0",
|
package/src/config/defaults.js
CHANGED
|
@@ -47,7 +47,7 @@ module.exports= {
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
database: {
|
|
50
|
-
|
|
50
|
+
db: {
|
|
51
51
|
dialect: 'postgres',
|
|
52
52
|
host: 'localhost',
|
|
53
53
|
port: 5432,
|
|
@@ -58,9 +58,7 @@ module.exports= {
|
|
|
58
58
|
min: 0, // Minimum number of connection in pool
|
|
59
59
|
idleTimeoutMillis: 10000, // The maximum time, in milliseconds, that a connection can be idle before being released. Use with combination of evict for proper working, for more details read https://github.com/coopernurse/node-pool/issues/178#issuecomment-327110870,
|
|
60
60
|
},
|
|
61
|
-
|
|
62
|
-
log: 'info'
|
|
63
|
-
},
|
|
61
|
+
log: 'info'
|
|
64
62
|
},
|
|
65
63
|
routes: {
|
|
66
64
|
body_field: undefined,
|
package/src/index.js
CHANGED
|
@@ -2,15 +2,17 @@ import {miolo} from './server'
|
|
|
2
2
|
import { init_emailer } from './emailer'
|
|
3
3
|
import { init_cacher } from './cacher'
|
|
4
4
|
import { init_logger } from './logger'
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { getConnection } from 'calustra'
|
|
6
|
+
import { getModel } from 'calustra-orm'
|
|
7
|
+
import {getConnectionFromCache, getModelFromCache} from 'calustra-router'
|
|
7
8
|
|
|
8
9
|
export {
|
|
9
10
|
miolo,
|
|
10
11
|
init_emailer,
|
|
11
12
|
init_cacher,
|
|
12
13
|
init_logger,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
getConnection,
|
|
15
|
+
getModel,
|
|
16
|
+
getConnectionFromCache,
|
|
17
|
+
getModelFromCache
|
|
16
18
|
}
|
package/src/server/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { init_logger } from 'src/logger'
|
|
|
5
5
|
import { init_cron } from './engines/cron'
|
|
6
6
|
// import {init_socket} from './engines/socket'
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { getConnection } from 'calustra'
|
|
9
9
|
|
|
10
10
|
import { init_context_middleware } from './middleware/context'
|
|
11
11
|
import { init_body_middleware } from './middleware/body'
|
|
@@ -29,7 +29,7 @@ async function miolo(sconfig, render, callback) {
|
|
|
29
29
|
|
|
30
30
|
let conn
|
|
31
31
|
if (config.database) {
|
|
32
|
-
conn=
|
|
32
|
+
conn= getConnection(config.database)
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
const app = new Koa()
|
package/lib/db/conn.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.init_db_connection = init_db_connection;
|
|
7
|
-
|
|
8
|
-
var {
|
|
9
|
-
getConnection
|
|
10
|
-
} = require('calustra');
|
|
11
|
-
|
|
12
|
-
function init_db_connection(config) {
|
|
13
|
-
var conn = getConnection(config);
|
|
14
|
-
return conn;
|
|
15
|
-
}
|