zet-lib 1.3.41 → 1.3.43
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/LICENSE +21 -21
- package/README.md +15 -15
- package/lib/ErrorWithCode.js +6 -6
- package/lib/Form.js +1020 -1020
- package/lib/Mail.js +68 -68
- package/lib/Modal.js +95 -95
- package/lib/Pool.js +437 -437
- package/lib/UI.js +7 -7
- package/lib/Util.js +1571 -1384
- package/lib/access.js +6 -6
- package/lib/cache.js +3 -3
- package/lib/connection.js +409 -409
- package/lib/debug.js +22 -22
- package/lib/index.js +36 -36
- package/lib/io.js +44 -44
- package/lib/languages/lang_en.js +125 -125
- package/lib/languages/lang_fr.js +125 -125
- package/lib/languages/lang_id.js +126 -126
- package/lib/languages/lang_jp.js +125 -125
- package/lib/moduleLib.js +661 -661
- package/lib/tableForm.js +10 -10
- package/lib/views/generator.ejs +598 -598
- package/lib/views/generator_layout.ejs +224 -224
- package/lib/views/generatorjs.ejs +927 -927
- package/lib/zAppRouter.js +1637 -1637
- package/lib/zCache.js +301 -301
- package/lib/zComponent.js +27 -27
- package/lib/zFn.js +58 -58
- package/lib/zFunction.js +20 -20
- package/lib/zGeneratorRouter.js +1641 -1641
- package/lib/zMenuRouter.js +556 -556
- package/lib/zPage.js +188 -188
- package/lib/zReport.js +982 -982
- package/lib/zRole.js +256 -256
- package/lib/zRoleRouter.js +609 -609
- package/lib/zRoute.js +5787 -5025
- package/lib/zTester.js +93 -93
- package/lib/zapp.js +65 -65
- package/lib/zdataTable.js +330 -330
- package/package.json +56 -56
package/lib/zFn.js
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
const moment = require('moment')
|
|
2
|
-
const zRoute = require('./zRoute')
|
|
3
|
-
const io = require('./io')
|
|
4
|
-
const qs = require('qs')
|
|
5
|
-
const axios = require('axios')
|
|
6
|
-
const myCache = require('./cache')
|
|
7
|
-
const connection = require('./connection')
|
|
8
|
-
const Util = require('./Util')
|
|
9
|
-
const moduleLib = require('./moduleLib')
|
|
10
|
-
const zCache = require('./zCache')
|
|
11
|
-
|
|
12
|
-
const running = (scripts = '', params = {}, obj = {}) => {
|
|
13
|
-
const MYMODELS = zRoute.MYMODELS()
|
|
14
|
-
let stringParams = ''
|
|
15
|
-
const defaultCall = {
|
|
16
|
-
Util: Util,
|
|
17
|
-
connection: connection,
|
|
18
|
-
io: io,
|
|
19
|
-
qs: qs,
|
|
20
|
-
moment: moment,
|
|
21
|
-
axios: axios,
|
|
22
|
-
myCache: myCache,
|
|
23
|
-
zCache: zCache,
|
|
24
|
-
params: params,
|
|
25
|
-
MYMODELS: MYMODELS,
|
|
26
|
-
moduleLib: moduleLib,
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const CALL = Object.assign(defaultCall, obj)
|
|
30
|
-
|
|
31
|
-
stringParams = ''
|
|
32
|
-
for (const keys in CALL) {
|
|
33
|
-
stringParams += `var ${keys} = this.${keys};`
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const AsyncFunction = Object.getPrototypeOf(async function () {}).constructor
|
|
37
|
-
|
|
38
|
-
try {
|
|
39
|
-
return AsyncFunction(`
|
|
40
|
-
try {
|
|
41
|
-
${stringParams};
|
|
42
|
-
${scripts};
|
|
43
|
-
} catch(error) {
|
|
44
|
-
console.log('error in zfn', error.toString());
|
|
45
|
-
return {
|
|
46
|
-
error:true,
|
|
47
|
-
status : 0,
|
|
48
|
-
message:error.toString()
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
`).call(CALL)
|
|
52
|
-
} catch (e) {
|
|
53
|
-
throw new Error(e)
|
|
54
|
-
return
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
module.exports = running
|
|
1
|
+
const moment = require('moment')
|
|
2
|
+
const zRoute = require('./zRoute')
|
|
3
|
+
const io = require('./io')
|
|
4
|
+
const qs = require('qs')
|
|
5
|
+
const axios = require('axios')
|
|
6
|
+
const myCache = require('./cache')
|
|
7
|
+
const connection = require('./connection')
|
|
8
|
+
const Util = require('./Util')
|
|
9
|
+
const moduleLib = require('./moduleLib')
|
|
10
|
+
const zCache = require('./zCache')
|
|
11
|
+
|
|
12
|
+
const running = (scripts = '', params = {}, obj = {}) => {
|
|
13
|
+
const MYMODELS = zRoute.MYMODELS()
|
|
14
|
+
let stringParams = ''
|
|
15
|
+
const defaultCall = {
|
|
16
|
+
Util: Util,
|
|
17
|
+
connection: connection,
|
|
18
|
+
io: io,
|
|
19
|
+
qs: qs,
|
|
20
|
+
moment: moment,
|
|
21
|
+
axios: axios,
|
|
22
|
+
myCache: myCache,
|
|
23
|
+
zCache: zCache,
|
|
24
|
+
params: params,
|
|
25
|
+
MYMODELS: MYMODELS,
|
|
26
|
+
moduleLib: moduleLib,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const CALL = Object.assign(defaultCall, obj)
|
|
30
|
+
|
|
31
|
+
stringParams = ''
|
|
32
|
+
for (const keys in CALL) {
|
|
33
|
+
stringParams += `var ${keys} = this.${keys};`
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const AsyncFunction = Object.getPrototypeOf(async function () {}).constructor
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
return AsyncFunction(`
|
|
40
|
+
try {
|
|
41
|
+
${stringParams};
|
|
42
|
+
${scripts};
|
|
43
|
+
} catch(error) {
|
|
44
|
+
console.log('error in zfn', error.toString());
|
|
45
|
+
return {
|
|
46
|
+
error:true,
|
|
47
|
+
status : 0,
|
|
48
|
+
message:error.toString()
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
`).call(CALL)
|
|
52
|
+
} catch (e) {
|
|
53
|
+
throw new Error(e)
|
|
54
|
+
return
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
module.exports = running
|
package/lib/zFunction.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
const zFn = require('./zFn');
|
|
2
|
-
const myCache = require("./cache");
|
|
3
|
-
|
|
4
|
-
module.exports = (...args) => {
|
|
5
|
-
let title = "", params = [];
|
|
6
|
-
for (let i = 0; i < args.length; i++) {
|
|
7
|
-
if(i == 0) {
|
|
8
|
-
title = args[i];
|
|
9
|
-
} else {
|
|
10
|
-
params.push(args[i])
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
let results = myCache.get('ZFUNCTIONS');
|
|
14
|
-
let result = results[title];
|
|
15
|
-
if(result.id) {
|
|
16
|
-
return zFn(result.code, params);
|
|
17
|
-
} else {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
1
|
+
const zFn = require('./zFn');
|
|
2
|
+
const myCache = require("./cache");
|
|
3
|
+
|
|
4
|
+
module.exports = (...args) => {
|
|
5
|
+
let title = "", params = [];
|
|
6
|
+
for (let i = 0; i < args.length; i++) {
|
|
7
|
+
if(i == 0) {
|
|
8
|
+
title = args[i];
|
|
9
|
+
} else {
|
|
10
|
+
params.push(args[i])
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
let results = myCache.get('ZFUNCTIONS');
|
|
14
|
+
let result = results[title];
|
|
15
|
+
if(result.id) {
|
|
16
|
+
return zFn(result.code, params);
|
|
17
|
+
} else {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
};
|