biz-a-cli 2.3.5 → 2.3.7
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/bin/hub.js +1 -1
- package/bin/watcher.js +2 -2
- package/package.json +4 -3
- package/scheduler/datalib.js +22 -0
package/bin/hub.js
CHANGED
|
@@ -4,6 +4,7 @@ import yargs from 'yargs';
|
|
|
4
4
|
import { io as ioc } from "socket.io-client";
|
|
5
5
|
import hubEvent from './hubEvent.js'
|
|
6
6
|
|
|
7
|
+
const port = 3002;
|
|
7
8
|
const argv = yargs(process.argv.slice(2))
|
|
8
9
|
.usage('Usage: $0 [options]')
|
|
9
10
|
.options('s', {
|
|
@@ -77,7 +78,6 @@ app.use(express.json());
|
|
|
77
78
|
app.set('args', argv);
|
|
78
79
|
|
|
79
80
|
app.use('/cb', runCliScript);
|
|
80
|
-
const port = 3002;
|
|
81
81
|
|
|
82
82
|
app.listen((argv.serverport || port), () => {
|
|
83
83
|
console.log(`Biz-A is listening at ${process.env.HOST || 'http://localhost'}:${argv.serverport || port} `);
|
package/bin/watcher.js
CHANGED
|
@@ -15,6 +15,8 @@ process.on('unhandledRejection', (err) => { //debug
|
|
|
15
15
|
console.log('Unhandled Rejection:', err);
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
+
const port = 3001;
|
|
19
|
+
|
|
18
20
|
const options = yargs(process.argv.slice(2))
|
|
19
21
|
.option('c', {
|
|
20
22
|
alias: 'company',
|
|
@@ -41,8 +43,6 @@ const options = yargs(process.argv.slice(2))
|
|
|
41
43
|
app.use(cors());
|
|
42
44
|
timer.runScheduler(options.company);
|
|
43
45
|
|
|
44
|
-
const port = 3001;
|
|
45
|
-
|
|
46
46
|
app.listen((options.port || port), () => {
|
|
47
47
|
console.log(`Biz-A CLI is listening at ${process.env.HOST || 'http://localhost'}:${options.port || port} `);
|
|
48
48
|
});
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "biz-a-cli",
|
|
3
3
|
"nameDev": "biz-a-cli-dev",
|
|
4
|
-
"version": "2.3.
|
|
5
|
-
"versionDev": "0.0.
|
|
4
|
+
"version": "2.3.7",
|
|
5
|
+
"versionDev": "0.0.25",
|
|
6
6
|
"description": "",
|
|
7
7
|
"main": "bin/index.js",
|
|
8
8
|
"type": "module",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"scripts": {
|
|
14
14
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --watch a",
|
|
15
15
|
"test1": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
16
|
-
"dev": "node --watch server.js"
|
|
16
|
+
"dev": "node --watch server.js",
|
|
17
|
+
"hub": "node bin/hub.js"
|
|
17
18
|
},
|
|
18
19
|
"author": "Imamatek",
|
|
19
20
|
"license": "ISC",
|
package/scheduler/datalib.js
CHANGED
|
@@ -63,6 +63,28 @@ function getUrlAndParam(config, method, obj, path) {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
function getTableObj(model, tableName) {
|
|
67
|
+
let obj = {};
|
|
68
|
+
obj[tableName] = model;
|
|
69
|
+
return obj;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function sendModel(model, apiConfig, tableName) {
|
|
73
|
+
const { url, params } = getUrlAndParam(
|
|
74
|
+
apiConfig,
|
|
75
|
+
'put',
|
|
76
|
+
getTableObj(model, tableName),
|
|
77
|
+
'orm'
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
const options = {
|
|
81
|
+
headers: { 'content-type': 'text/plain' },
|
|
82
|
+
params: { subdomain: apiConfig.subdomain }
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return Axios.post(url, params, options)
|
|
86
|
+
}
|
|
87
|
+
|
|
66
88
|
// export function getSelectedCompConfig(companyName) {
|
|
67
89
|
// const url = `${BIZA_SERVER_LINK}/config/%22getSelectedCompConfig%22`;
|
|
68
90
|
// const param = { companyName };
|