not-node 5.0.22 → 5.1.2
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.json +1 -1
- package/bin/not-deploy.js +52 -0
- package/index.js +21 -19
- package/package.json +1 -1
- package/src/app.js +61 -58
- package/src/auth/abstract.js +17 -19
- package/src/auth/const.js +8 -12
- package/src/auth/fields.js +143 -124
- package/src/auth/index.js +14 -14
- package/src/auth/roles.js +64 -63
- package/src/auth/routes.js +89 -54
- package/src/auth/rules.js +63 -63
- package/src/auth/session.js +60 -62
- package/src/bootstrap/form.js +13 -13
- package/src/bootstrap/logic.js +45 -41
- package/src/bootstrap/model.js +14 -17
- package/src/bootstrap/route.js +132 -53
- package/src/common.js +86 -79
- package/src/core/fields/ID.js +6 -6
- package/src/core/fields/__closed.js +3 -3
- package/src/core/fields/__latest.js +3 -3
- package/src/core/fields/__version.js +3 -3
- package/src/core/fields/__versions.js +3 -3
- package/src/core/fields/_id.js +6 -6
- package/src/core/fields/active.js +9 -9
- package/src/core/fields/codeName.js +9 -9
- package/src/core/fields/createdAt.js +17 -17
- package/src/core/fields/default.js +9 -9
- package/src/core/fields/description.js +11 -11
- package/src/core/fields/email.js +9 -9
- package/src/core/fields/enabled.js +9 -9
- package/src/core/fields/expiredAt.js +16 -16
- package/src/core/fields/height.js +11 -11
- package/src/core/fields/ip.js +10 -10
- package/src/core/fields/objectId.js +10 -10
- package/src/core/fields/owner.js +13 -13
- package/src/core/fields/ownerModel.js +11 -11
- package/src/core/fields/price.js +11 -11
- package/src/core/fields/requiredObject.js +10 -10
- package/src/core/fields/session.js +10 -10
- package/src/core/fields/size.js +11 -11
- package/src/core/fields/telephone.js +9 -9
- package/src/core/fields/title.js +15 -15
- package/src/core/fields/updatedAt.js +17 -17
- package/src/core/fields/userId.js +11 -12
- package/src/core/fields/uuid.js +11 -11
- package/src/core/fields/validators/email.js +6 -4
- package/src/core/fields/validators/owner.js +6 -4
- package/src/core/fields/width.js +11 -11
- package/src/domain.js +435 -431
- package/src/env.js +23 -23
- package/src/error.js +20 -23
- package/src/exceptions/db.js +23 -0
- package/src/exceptions/http.js +43 -0
- package/src/fields/index.js +106 -111
- package/src/form/fabric.js +19 -24
- package/src/form/form.js +195 -186
- package/src/form/index.js +2 -2
- package/src/generic/index.js +2 -0
- package/src/generic/logic.js +595 -0
- package/src/generic/route.js +76 -0
- package/src/init/additional.js +7 -7
- package/src/init/app.js +75 -68
- package/src/init/bodyparser.js +14 -14
- package/src/init/compression.js +6 -7
- package/src/init/core.js +12 -12
- package/src/init/cors.js +22 -24
- package/src/init/db/index.js +41 -43
- package/src/init/db/ioredis.js +28 -20
- package/src/init/db/mongoose.js +42 -32
- package/src/init/db/redis.js +59 -48
- package/src/init/env.js +44 -36
- package/src/init/express.js +18 -21
- package/src/init/fileupload.js +8 -10
- package/src/init/http.js +65 -47
- package/src/init/index.js +141 -148
- package/src/init/informer.js +7 -9
- package/src/init/methodoverride.js +4 -6
- package/src/init/middleware.js +23 -26
- package/src/init/modules.js +4 -4
- package/src/init/monitoring.js +8 -8
- package/src/init/rateLimiter.js +53 -45
- package/src/init/routes.js +67 -69
- package/src/init/security.js +37 -33
- package/src/init/sequence.js +111 -107
- package/src/init/sequence.standart.js +54 -56
- package/src/init/sessions/index.js +21 -21
- package/src/init/sessions/mongoose.js +49 -36
- package/src/init/sessions/redis.js +28 -27
- package/src/init/static.js +53 -40
- package/src/init/template.js +17 -17
- package/src/lib.js +230 -200
- package/src/manifest/batchRunner.js +26 -25
- package/src/manifest/initializator/forms.js +24 -24
- package/src/manifest/initializator/index.js +8 -10
- package/src/manifest/initializator/manifests.js +45 -42
- package/src/manifest/initializator/models.js +37 -34
- package/src/manifest/manifest.filter.js +130 -97
- package/src/manifest/manifest.js +103 -77
- package/src/manifest/module.js +350 -360
- package/src/manifest/registrator/fields.js +90 -85
- package/src/manifest/registrator/forms.js +47 -47
- package/src/manifest/registrator/index.js +14 -16
- package/src/manifest/registrator/locales.js +17 -16
- package/src/manifest/registrator/logics.js +66 -64
- package/src/manifest/registrator/models.js +64 -62
- package/src/manifest/registrator/routes.js +171 -132
- package/src/manifest/registrator/routes.ws.js +109 -103
- package/src/manifest/route.js +216 -161
- package/src/model/buildValidator.js +53 -42
- package/src/model/default.js +304 -286
- package/src/model/enrich.js +69 -61
- package/src/model/increment.js +124 -137
- package/src/model/proto.js +179 -148
- package/src/model/routine.js +85 -76
- package/src/model/utils.js +33 -0
- package/src/model/versioning.js +148 -130
- package/src/obsolete.js +12 -8
- package/src/parser.js +29 -22
- package/src/repos.js +29 -31
- package/src/rollup.js +75 -65
- package/src/shell.helpers.js +28 -28
- package/static.js +31 -0
- package/src/generic/router.js +0 -16
- package/src/manifest/module.models.js +0 -0
- package/src/manifest/module.status.js +0 -0
package/src/common.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const fs = require(
|
|
2
|
-
const path = require(
|
|
3
|
-
const notPath = require(
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
const notPath = require("not-path");
|
|
4
4
|
|
|
5
5
|
/** @module Common */
|
|
6
6
|
/**
|
|
@@ -9,8 +9,8 @@ const notPath = require('not-path');
|
|
|
9
9
|
* @return {string} result
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
module.exports.firstLetterToLower = function(string) {
|
|
13
|
-
|
|
12
|
+
module.exports.firstLetterToLower = function (string) {
|
|
13
|
+
return string.charAt(0).toLowerCase() + string.slice(1);
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -19,8 +19,8 @@ module.exports.firstLetterToLower = function(string) {
|
|
|
19
19
|
* @return {string} result
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
module.exports.firstLetterToUpper = function(string) {
|
|
23
|
-
|
|
22
|
+
module.exports.firstLetterToUpper = function (string) {
|
|
23
|
+
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
/**
|
|
@@ -29,11 +29,11 @@ module.exports.firstLetterToUpper = function(string) {
|
|
|
29
29
|
* @return {booelean} true if check is not failed
|
|
30
30
|
*/
|
|
31
31
|
module.exports.validateObjectId = (id) => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
try {
|
|
33
|
+
return id.match(/^[0-9a-fA-F]{24}$/) ? true : false;
|
|
34
|
+
} catch (e) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
/**
|
|
@@ -43,25 +43,25 @@ module.exports.validateObjectId = (id) => {
|
|
|
43
43
|
* @return {booelean} true if equal
|
|
44
44
|
*/
|
|
45
45
|
module.exports.compareObjectIds = (firstId, secondId) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
46
|
+
try {
|
|
47
|
+
let a = firstId,
|
|
48
|
+
b = secondId;
|
|
49
|
+
if (typeof firstId !== "string") {
|
|
50
|
+
a = a.toString();
|
|
51
|
+
}
|
|
52
|
+
if (typeof secondId !== "string") {
|
|
53
|
+
b = b.toString();
|
|
54
|
+
}
|
|
55
|
+
if (
|
|
56
|
+
!module.exports.validateObjectId(a) ||
|
|
57
|
+
!module.exports.validateObjectId(b)
|
|
58
|
+
) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
return a === b;
|
|
62
|
+
} catch (e) {
|
|
63
|
+
return false;
|
|
60
64
|
}
|
|
61
|
-
return a === b;
|
|
62
|
-
} catch (e) {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
/**
|
|
@@ -69,11 +69,10 @@ module.exports.compareObjectIds = (firstId, secondId) => {
|
|
|
69
69
|
* @return {number} current date with 00:00:00 in ms of unix time
|
|
70
70
|
*/
|
|
71
71
|
module.exports.getTodayDate = () => {
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
let t = new Date();
|
|
73
|
+
return new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime();
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
-
|
|
77
76
|
/**
|
|
78
77
|
* Returns true if object has field of name
|
|
79
78
|
* @param {object} obj some object
|
|
@@ -81,20 +80,19 @@ module.exports.getTodayDate = () => {
|
|
|
81
80
|
* @return {boolean} if object contains field with name
|
|
82
81
|
**/
|
|
83
82
|
const objHas = (obj, name) => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
if (typeof obj === "undefined") return false;
|
|
84
|
+
if (obj === null) return false;
|
|
85
|
+
return Object.prototype.hasOwnProperty.call(obj, name);
|
|
87
86
|
};
|
|
88
87
|
module.exports.objHas = objHas;
|
|
89
88
|
|
|
90
|
-
|
|
91
89
|
/**
|
|
92
90
|
* Copies object to secure it from changes
|
|
93
91
|
* @param {object} obj original object
|
|
94
92
|
* @return {object} copy of object
|
|
95
93
|
**/
|
|
96
94
|
module.exports.copyObj = (obj) => {
|
|
97
|
-
|
|
95
|
+
return JSON.parse(JSON.stringify(obj));
|
|
98
96
|
};
|
|
99
97
|
|
|
100
98
|
/**
|
|
@@ -103,34 +101,51 @@ module.exports.copyObj = (obj) => {
|
|
|
103
101
|
* @return {object} copy of object
|
|
104
102
|
**/
|
|
105
103
|
module.exports.partCopyObj = (obj, list) => {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
104
|
+
let partObj = Object.keys(obj).reduce((prev, curr) => {
|
|
105
|
+
if (list.includes(curr)) {
|
|
106
|
+
prev[curr] = obj[curr];
|
|
107
|
+
}
|
|
108
|
+
return prev;
|
|
109
|
+
}, {});
|
|
110
|
+
return JSON.parse(JSON.stringify(partObj));
|
|
113
111
|
};
|
|
114
112
|
|
|
115
|
-
|
|
116
113
|
/**
|
|
117
114
|
* Test argument type to be 'function'
|
|
118
115
|
* @param {any} func possible function
|
|
119
116
|
* @return {boolean} if this is a function
|
|
120
117
|
**/
|
|
121
|
-
const isFunc = module.exports.isFunc = (func) => {
|
|
122
|
-
|
|
123
|
-
};
|
|
118
|
+
const isFunc = (module.exports.isFunc = (func) => {
|
|
119
|
+
return typeof func === "function";
|
|
120
|
+
});
|
|
124
121
|
|
|
125
122
|
/**
|
|
126
123
|
* Returns true if argument is Async function
|
|
127
124
|
* @param {function} func to test
|
|
128
125
|
* @return {boolean} if this function is constructed as AsyncFunction
|
|
129
126
|
**/
|
|
130
|
-
const isAsync = module.exports.isAsync = (func) => {
|
|
131
|
-
|
|
127
|
+
const isAsync = (module.exports.isAsync = (func) => {
|
|
128
|
+
return func.constructor.name === "AsyncFunction";
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Executes method in appropriate way inside Promise
|
|
133
|
+
* @param {function} proc function to execute
|
|
134
|
+
* @param {Array} params array of params
|
|
135
|
+
* @return {Promise} results of method execution
|
|
136
|
+
**/
|
|
137
|
+
const executeFunctionAsAsync = async (proc, params) => {
|
|
138
|
+
if (isFunc(proc)) {
|
|
139
|
+
if (isAsync(proc)) {
|
|
140
|
+
return await proc(...params);
|
|
141
|
+
} else {
|
|
142
|
+
return proc(...params);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
//throw new Error("Could not execute `proc` is not a function");
|
|
132
146
|
};
|
|
133
147
|
|
|
148
|
+
module.exports.executeFunctionAsAsync = executeFunctionAsAsync;
|
|
134
149
|
|
|
135
150
|
/**
|
|
136
151
|
* Executes method of object in appropriate way inside Promise
|
|
@@ -140,19 +155,12 @@ const isAsync = module.exports.isAsync = (func) => {
|
|
|
140
155
|
* @return {Promise} results of method execution
|
|
141
156
|
**/
|
|
142
157
|
module.exports.executeObjectFunction = async (obj, name, params) => {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
if (isAsync(proc)) {
|
|
147
|
-
return await proc(...params);
|
|
148
|
-
} else {
|
|
149
|
-
return proc(...params);
|
|
150
|
-
}
|
|
158
|
+
if (obj) {
|
|
159
|
+
const proc = notPath.get(":" + name, obj);
|
|
160
|
+
return await executeFunctionAsAsync(proc, params);
|
|
151
161
|
}
|
|
152
|
-
}
|
|
153
162
|
};
|
|
154
163
|
|
|
155
|
-
|
|
156
164
|
/**
|
|
157
165
|
* Executes method of object in apropriate way inside Promise
|
|
158
166
|
* @param {Object} from original object
|
|
@@ -161,26 +169,25 @@ module.exports.executeObjectFunction = async (obj, name, params) => {
|
|
|
161
169
|
* @return {Promise} results of method execution
|
|
162
170
|
**/
|
|
163
171
|
module.exports.mapBind = (from, to, list) => {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
172
|
+
list.forEach((item) => {
|
|
173
|
+
if (typeof from[item] === "function") {
|
|
174
|
+
to[item] = from[item].bind(from);
|
|
175
|
+
}
|
|
176
|
+
});
|
|
169
177
|
};
|
|
170
178
|
|
|
171
|
-
|
|
172
179
|
/**
|
|
173
180
|
* Synchronously check file existence and if it's really a file
|
|
174
181
|
* @param {string} filePath full path to file
|
|
175
182
|
* @return {boolean} true if path exists and it's a file
|
|
176
183
|
**/
|
|
177
184
|
module.exports.tryFile = (filePath) => {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
185
|
+
try {
|
|
186
|
+
const stat = fs.lstatSync(filePath);
|
|
187
|
+
return stat && stat.isFile();
|
|
188
|
+
} catch (e) {
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
184
191
|
};
|
|
185
192
|
|
|
186
193
|
/**
|
|
@@ -190,10 +197,10 @@ module.exports.tryFile = (filePath) => {
|
|
|
190
197
|
* @param {string} relative path to parent folder of components
|
|
191
198
|
* @param {Object} paths object for module/index.js
|
|
192
199
|
**/
|
|
193
|
-
module.exports.generatePaths = (content = [], relative =
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
200
|
+
module.exports.generatePaths = (content = [], relative = "src") => {
|
|
201
|
+
const toPath = (name) => path.join(relative, name);
|
|
202
|
+
return content.reduce((prev, cur) => {
|
|
203
|
+
prev[cur] = toPath(cur);
|
|
204
|
+
return prev;
|
|
205
|
+
}, {});
|
|
199
206
|
};
|
package/src/core/fields/ID.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
ui: {
|
|
3
|
+
component: "UITextfield",
|
|
4
|
+
placeholder: "not-node:field_ID_placeholder",
|
|
5
|
+
label: "not-node:field_ID_label",
|
|
6
|
+
readonly: true,
|
|
7
|
+
},
|
|
8
8
|
};
|
package/src/core/fields/_id.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
ui: {
|
|
3
|
+
component: "UISwitch",
|
|
4
|
+
label: "not-node:field_active_label",
|
|
5
|
+
},
|
|
6
|
+
model: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: false,
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
11
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
ui: {
|
|
3
|
+
component: "UITextfield",
|
|
4
|
+
placeholder: "not-node:field_codeName_placeholder",
|
|
5
|
+
label: "not-node:field_codeName_label",
|
|
6
|
+
},
|
|
7
|
+
model: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
11
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
ui: {
|
|
3
|
+
component: "UIDate",
|
|
4
|
+
label: "not-node:field_createdAt_label",
|
|
5
|
+
placeholder: "not-node:field_createdAt_placeholder",
|
|
6
|
+
readonly: true,
|
|
7
|
+
},
|
|
8
|
+
model: {
|
|
9
|
+
type: Date,
|
|
10
|
+
required: true,
|
|
11
|
+
default: Date.now,
|
|
12
|
+
searchable: true,
|
|
13
|
+
sortable: true,
|
|
14
|
+
safe: {
|
|
15
|
+
update: ["@owner", "root", "admin"],
|
|
16
|
+
read: ["@owner", "root", "admin"],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
19
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
ui: {
|
|
3
|
+
component: "UISwitch",
|
|
4
|
+
label: "not-node:field_default_label",
|
|
5
|
+
},
|
|
6
|
+
model: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: false,
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
11
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
ui: {
|
|
3
|
+
component: "UITextarea",
|
|
4
|
+
placeholder: "not-node:field_description_placeholder",
|
|
5
|
+
label: "not-node:field_description_label",
|
|
6
|
+
},
|
|
7
|
+
model: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: true,
|
|
10
|
+
searchable: true,
|
|
11
|
+
sortable: true,
|
|
12
|
+
},
|
|
13
13
|
};
|
package/src/core/fields/email.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
ui: {
|
|
3
|
+
component: "UIEmail",
|
|
4
|
+
placeholder: "not-node:field_email_placeholder",
|
|
5
|
+
label: "not-node:field_email_label",
|
|
6
|
+
},
|
|
7
|
+
model: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
11
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
ui: {
|
|
3
|
+
component: "UISwitch",
|
|
4
|
+
label: "not-node:field_enabled_label",
|
|
5
|
+
},
|
|
6
|
+
model: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: true,
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
11
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
ui: {
|
|
3
|
+
component: "UITextfield",
|
|
4
|
+
label: "not-node:field_expiredAt_label",
|
|
5
|
+
placeholder: "not-node:field_expiredAt_placeholder",
|
|
6
|
+
readonly: true,
|
|
7
|
+
},
|
|
8
|
+
model: {
|
|
9
|
+
type: Date,
|
|
10
|
+
required: false,
|
|
11
|
+
searchable: true,
|
|
12
|
+
sortable: true,
|
|
13
|
+
safe: {
|
|
14
|
+
update: ["@owner", "root", "admin"],
|
|
15
|
+
read: ["@owner", "root", "admin"],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
18
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
ui: {
|
|
3
|
+
component: "UITextfield",
|
|
4
|
+
label: "not-node:field_height_label",
|
|
5
|
+
placeholder: "not-node:field_height_placeholder",
|
|
6
|
+
},
|
|
7
|
+
model: {
|
|
8
|
+
type: Number,
|
|
9
|
+
required: true,
|
|
10
|
+
searchable: true,
|
|
11
|
+
sortable: true,
|
|
12
|
+
},
|
|
13
13
|
};
|
package/src/core/fields/ip.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
ui: {
|
|
3
|
+
component: "UITextfield",
|
|
4
|
+
label: "not-node:field_IP_label",
|
|
5
|
+
placeholder: "not-node:field_IP_placeholder",
|
|
6
|
+
},
|
|
7
|
+
model: {
|
|
8
|
+
type: String,
|
|
9
|
+
searchable: true,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
12
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const ObjectId = require(
|
|
1
|
+
const ObjectId = require("mongoose").Schema.Types.ObjectId;
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
model: {
|
|
5
|
+
type: ObjectId,
|
|
6
|
+
required: true,
|
|
7
|
+
default: {},
|
|
8
|
+
safe: {
|
|
9
|
+
update: ["@owner", "root", "admin"],
|
|
10
|
+
read: ["@owner", "root", "admin"],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
13
|
};
|
package/src/core/fields/owner.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const Schema = require(
|
|
1
|
+
const Schema = require("mongoose").Schema;
|
|
2
2
|
module.exports = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
model: {
|
|
4
|
+
type: Schema.Types.ObjectId,
|
|
5
|
+
refPath: "ownerModel",
|
|
6
|
+
required: false,
|
|
7
|
+
safe: {
|
|
8
|
+
update: ["root", "admin"],
|
|
9
|
+
read: ["@owner", "root", "admin"],
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
ui: {
|
|
13
|
+
component: "UIHidden",
|
|
14
|
+
},
|
|
15
15
|
};
|