corefwnode 3.0.2 → 3.0.3

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.
@@ -1,40 +1,40 @@
1
- const CfwObject = require('../lib/CfwObject.js');
2
- /**
3
- * WikiCategory object
4
- *
5
- * @version $Id$
6
- * @copyright 2008
7
- */
8
-
9
- module.exports = class WikiCategory extends CfwObject
10
- {
11
- constructor(session)
12
- {
13
- const proxy = super(session);
14
-
15
- return proxy;
16
- }
17
-
18
- // eslint-disable-next-line class-methods-use-this
19
- tableConf()
20
- {
21
- return {
22
- tableName: 'wiki_category',
23
- id: {
24
- categoryId: {
25
- fieldType: 'int',
26
- maxlength: 30,
27
- req: 0,
28
- },
29
- },
30
- fields: {
31
- categoryName: {
32
- fieldType: 'text',
33
- maxlength: 255,
34
- minlength: 1,
35
- req: 1,
36
- },
37
- },
38
- };
39
- }
40
- };
1
+ const CfwObject = require('../lib/CfwObject.js');
2
+ /**
3
+ * WikiCategory object
4
+ *
5
+ * @version $Id$
6
+ * @copyright 2008
7
+ */
8
+
9
+ module.exports = class WikiCategory extends CfwObject
10
+ {
11
+ constructor(session)
12
+ {
13
+ const proxy = super(session);
14
+
15
+ return proxy;
16
+ }
17
+
18
+ // eslint-disable-next-line class-methods-use-this
19
+ tableConf()
20
+ {
21
+ return {
22
+ tableName: 'wiki_category',
23
+ id: {
24
+ categoryId: {
25
+ fieldType: 'int',
26
+ maxlength: 30,
27
+ req: 0,
28
+ },
29
+ },
30
+ fields: {
31
+ categoryName: {
32
+ fieldType: 'text',
33
+ maxlength: 255,
34
+ minlength: 1,
35
+ req: 1,
36
+ },
37
+ },
38
+ };
39
+ }
40
+ };
@@ -1,92 +1,92 @@
1
- const CfwObject = require('../lib/CfwObject.js');
2
- /**
3
- * WikiTemplates object
4
- *
5
- * @version $Id$
6
- * @copyright 2013
7
- */
8
-
9
- module.exports = class WikiTemplates extends CfwObject
10
- {
11
- constructor(session)
12
- {
13
- const proxy = super(session);
14
-
15
- return proxy;
16
- }
17
-
18
- // eslint-disable-next-line class-methods-use-this
19
- tableConf()
20
- {
21
- return {
22
- tableName: 'wiki_templates',
23
- id: {
24
- templateId: {
25
- fieldType: 'int',
26
- maxlength: 20,
27
- req: 0,
28
- },
29
- },
30
- fields: {
31
- modular: {
32
- fieldType: 'int',
33
- maxlength: 1,
34
- req: 0,
35
- },
36
- name: {
37
- fieldType: 'text',
38
- maxlength: 255,
39
- req: 1,
40
- },
41
- content: {
42
- fieldType: 'text',
43
- decorators: ['leaveuntouched'],
44
- req: 1,
45
- },
46
- categoryId: {
47
- fieldType: 'int',
48
- maxlength: 20,
49
- req: 0,
50
- },
51
- },
52
- };
53
- }
54
-
55
- async insertRow(param)
56
- {
57
- if (param.modular !== undefined)
58
- {
59
- param.modular = 1;
60
- }
61
- else
62
- {
63
- param.modular = 0;
64
- }
65
-
66
- if (param.categoryId === '')
67
- {
68
- param.categoryId = null;
69
- }
70
-
71
- return super.insertRow(param);
72
- }
73
-
74
- updateRow(param)
75
- {
76
- if (param.modular !== undefined)
77
- {
78
- param.modular = 1;
79
- }
80
- else
81
- {
82
- param.modular = 0;
83
- }
84
-
85
- if (param.categoryId === '')
86
- {
87
- param.categoryId = null;
88
- }
89
-
90
- return super.updateRow(param);
91
- }
92
- };
1
+ const CfwObject = require('../lib/CfwObject.js');
2
+ /**
3
+ * WikiTemplates object
4
+ *
5
+ * @version $Id$
6
+ * @copyright 2013
7
+ */
8
+
9
+ module.exports = class WikiTemplates extends CfwObject
10
+ {
11
+ constructor(session)
12
+ {
13
+ const proxy = super(session);
14
+
15
+ return proxy;
16
+ }
17
+
18
+ // eslint-disable-next-line class-methods-use-this
19
+ tableConf()
20
+ {
21
+ return {
22
+ tableName: 'wiki_templates',
23
+ id: {
24
+ templateId: {
25
+ fieldType: 'int',
26
+ maxlength: 20,
27
+ req: 0,
28
+ },
29
+ },
30
+ fields: {
31
+ modular: {
32
+ fieldType: 'int',
33
+ maxlength: 1,
34
+ req: 0,
35
+ },
36
+ name: {
37
+ fieldType: 'text',
38
+ maxlength: 255,
39
+ req: 1,
40
+ },
41
+ content: {
42
+ fieldType: 'text',
43
+ decorators: ['leaveuntouched'],
44
+ req: 1,
45
+ },
46
+ categoryId: {
47
+ fieldType: 'int',
48
+ maxlength: 20,
49
+ req: 0,
50
+ },
51
+ },
52
+ };
53
+ }
54
+
55
+ async insertRow(param)
56
+ {
57
+ if (param.modular !== undefined)
58
+ {
59
+ param.modular = 1;
60
+ }
61
+ else
62
+ {
63
+ param.modular = 0;
64
+ }
65
+
66
+ if (param.categoryId === '')
67
+ {
68
+ param.categoryId = null;
69
+ }
70
+
71
+ return super.insertRow(param);
72
+ }
73
+
74
+ updateRow(param)
75
+ {
76
+ if (param.modular !== undefined)
77
+ {
78
+ param.modular = 1;
79
+ }
80
+ else
81
+ {
82
+ param.modular = 0;
83
+ }
84
+
85
+ if (param.categoryId === '')
86
+ {
87
+ param.categoryId = null;
88
+ }
89
+
90
+ return super.updateRow(param);
91
+ }
92
+ };
package/objects/index.js CHANGED
@@ -1,47 +1,47 @@
1
- const fs = require('fs');
2
-
3
- module.exports = (ObjClasses) =>
4
- {
5
- const classes = {};
6
- fs.readdirSync(__dirname).forEach((file) =>
7
- {
8
- if (file === 'index.js')
9
- {
10
- return;
11
- }
12
- const name = file.substr(0, file.indexOf('.'));
13
- try
14
- {
15
- // eslint-disable-next-line import/no-dynamic-require, global-require
16
- const classDat = require(`./${name}`);
17
- let obj = classDat.prototype;
18
- let methods = [];
19
- do
20
- {
21
- methods = methods.concat(Object.getOwnPropertyNames(obj));
22
- obj = Object.getPrototypeOf(obj);
23
- }
24
- while (obj);
25
-
26
- const methodsOut = {};
27
- for (let i = 0; i < methods.length; i += 1)
28
- {
29
- const method = methods[i];
30
- methodsOut[method.toLowerCase()] = method;
31
- }
32
-
33
- classes[name.toLowerCase()] = {
34
- origName: name,
35
- class: classDat,
36
- methods: methodsOut,
37
- };
38
- }
39
- catch (e)
40
- {
41
- // console.log(name)
42
- // throw(e);
43
- }
44
- });
45
-
46
- return classes;
47
- };
1
+ const fs = require('fs');
2
+
3
+ module.exports = (ObjClasses) =>
4
+ {
5
+ const classes = {};
6
+ fs.readdirSync(__dirname).forEach((file) =>
7
+ {
8
+ if (file === 'index.js')
9
+ {
10
+ return;
11
+ }
12
+ const name = file.substr(0, file.indexOf('.'));
13
+ try
14
+ {
15
+ // eslint-disable-next-line import/no-dynamic-require, global-require
16
+ const classDat = require(`./${name}`);
17
+ let obj = classDat.prototype;
18
+ let methods = [];
19
+ do
20
+ {
21
+ methods = methods.concat(Object.getOwnPropertyNames(obj));
22
+ obj = Object.getPrototypeOf(obj);
23
+ }
24
+ while (obj);
25
+
26
+ const methodsOut = {};
27
+ for (let i = 0; i < methods.length; i += 1)
28
+ {
29
+ const method = methods[i];
30
+ methodsOut[method.toLowerCase()] = method;
31
+ }
32
+
33
+ classes[name.toLowerCase()] = {
34
+ origName: name,
35
+ class: classDat,
36
+ methods: methodsOut,
37
+ };
38
+ }
39
+ catch (e)
40
+ {
41
+ // console.log(name)
42
+ // throw(e);
43
+ }
44
+ });
45
+
46
+ return classes;
47
+ };
package/package.json CHANGED
@@ -1,32 +1,31 @@
1
- {
2
- "name": "corefwnode",
3
- "version": "3.0.2",
4
- "description": "CoreFw for node applications",
5
- "main": "index.js",
6
- "directories": {
7
- "lib": "lib"
8
- },
9
- "scripts": {
10
- "test": "echo \"Error: no test specified\" && exit 1",
11
- "build": "node build.js"
12
- },
13
- "repository": {
14
- "type": "git",
15
- "url": "http://phabricator.coreaplikacije.hr/diffusion/14/corefwnode.git"
16
- },
17
- "author": "Dario Filkovic",
18
- "license": "ISC",
19
- "dependencies": {
20
- "inquirer": "^4.0.2",
21
- "md5": "^2.2.1",
22
- "moment": "^2.22.0",
23
- "mysql": "^2.15.0",
24
- "promise-mysql": "^4.1.3",
25
- "sqlstring": "^2.3.1"
26
- },
27
- "devDependencies": {
28
- "eslint": "^6.8.0",
29
- "eslint-config-airbnb-base": "^14.1.0",
30
- "eslint-plugin-import": "^2.20.1"
31
- }
32
- }
1
+ {
2
+ "name": "corefwnode",
3
+ "version": "3.0.3",
4
+ "description": "CoreFw for node applications",
5
+ "main": "index.js",
6
+ "directories": {
7
+ "lib": "lib"
8
+ },
9
+ "scripts": {
10
+ "test": "echo \"Error: no test specified\" && exit 1",
11
+ "build": "node build.js"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "http://phabricator.coreaplikacije.hr/diffusion/14/corefwnode.git"
16
+ },
17
+ "author": "Dario Filkovic",
18
+ "license": "ISC",
19
+ "dependencies": {
20
+ "inquirer": "^4.0.2",
21
+ "md5": "^2.2.1",
22
+ "moment": "^2.22.0",
23
+ "mysql2": "^3.14.1",
24
+ "sqlstring": "^2.3.1"
25
+ },
26
+ "devDependencies": {
27
+ "eslint": "^6.8.0",
28
+ "eslint-config-airbnb-base": "^14.1.0",
29
+ "eslint-plugin-import": "^2.20.1"
30
+ }
31
+ }