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.
- package/.eslintrc.js +40 -40
- package/build.js +266 -266
- package/index.js +240 -240
- package/lib/CfwObject.js +1629 -1626
- package/lib/Decorator.js +322 -322
- package/lib/ErrorCodes.js +111 -111
- package/lib/ErrorControl.js +50 -50
- package/lib/GeneralHandling.js +638 -638
- package/lib/Language.js +139 -139
- package/lib/MySql.js +141 -142
- package/lib/Observer.js +75 -75
- package/lib/Validator.js +536 -536
- package/lib/Wiki.js +409 -409
- package/lib/errors/CoreError.js +11 -11
- package/lib/errors/SQLError.js +125 -125
- package/objects/AclGroups.js +69 -69
- package/objects/AclObjects.js +46 -46
- package/objects/AclPrivilages.js +202 -202
- package/objects/EmailTemplates.js +108 -108
- package/objects/Session.js +317 -317
- package/objects/SiteProps.js +55 -55
- package/objects/TransLang.js +39 -39
- package/objects/Translator.js +345 -345
- package/objects/UserCompanies.js +46 -46
- package/objects/Users.js +409 -409
- package/objects/UsersData.js +85 -85
- package/objects/Wiki.js +425 -425
- package/objects/WikiCategory.js +40 -40
- package/objects/WikiTemplates.js +92 -92
- package/objects/index.js +47 -47
- package/package.json +31 -32
package/objects/WikiCategory.js
CHANGED
|
@@ -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
|
+
};
|
package/objects/WikiTemplates.js
CHANGED
|
@@ -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.
|
|
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
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"eslint": "^
|
|
29
|
-
"eslint-
|
|
30
|
-
|
|
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
|
+
}
|