not-node 6.3.83 → 6.3.85
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/package.json
CHANGED
|
@@ -6,7 +6,7 @@ async function renderEntityActionForm(createFileContent, SRC, DEST, data) {
|
|
|
6
6
|
await createFileContent(SRC, DEST, data);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
const COMMON_FORMS = ["listAll", "listAndCount", "delete", "get", "getRaw"];
|
|
9
|
+
//const COMMON_FORMS = ["listAll", "listAndCount", "delete", "get", "getRaw"];
|
|
10
10
|
|
|
11
11
|
export default async (
|
|
12
12
|
module_layer_dir,
|
|
@@ -17,7 +17,23 @@ export default async (
|
|
|
17
17
|
) => {
|
|
18
18
|
for (let actionName in data.actions) {
|
|
19
19
|
//if template is not depends on ModelName
|
|
20
|
-
if (
|
|
20
|
+
if (data.modelName) {
|
|
21
|
+
const TMPL_FILE_PATH = resolve(
|
|
22
|
+
PATH_TMPL,
|
|
23
|
+
TEMPLATES_DIR,
|
|
24
|
+
`${actionName}.ejs`
|
|
25
|
+
);
|
|
26
|
+
const DEST_FILE_PATH = resolve(
|
|
27
|
+
module_layer_dir,
|
|
28
|
+
`${data.modelName}.${actionName}.js`
|
|
29
|
+
);
|
|
30
|
+
await renderEntityActionForm(
|
|
31
|
+
createFileContent,
|
|
32
|
+
TMPL_FILE_PATH,
|
|
33
|
+
DEST_FILE_PATH,
|
|
34
|
+
{ ...config, ...data }
|
|
35
|
+
);
|
|
36
|
+
} else {
|
|
21
37
|
const DEST_FILE_PATH = resolve(
|
|
22
38
|
module_layer_dir,
|
|
23
39
|
`${actionName}.js`
|
|
@@ -35,22 +51,6 @@ export default async (
|
|
|
35
51
|
{ ...config, ...data }
|
|
36
52
|
);
|
|
37
53
|
}
|
|
38
|
-
} else {
|
|
39
|
-
const TMPL_FILE_PATH = resolve(
|
|
40
|
-
PATH_TMPL,
|
|
41
|
-
TEMPLATES_DIR,
|
|
42
|
-
`${actionName}.ejs`
|
|
43
|
-
);
|
|
44
|
-
const DEST_FILE_PATH = resolve(
|
|
45
|
-
module_layer_dir,
|
|
46
|
-
`${data.modelName}.${actionName}.js`
|
|
47
|
-
);
|
|
48
|
-
await renderEntityActionForm(
|
|
49
|
-
createFileContent,
|
|
50
|
-
TMPL_FILE_PATH,
|
|
51
|
-
DEST_FILE_PATH,
|
|
52
|
-
{ ...config, ...data }
|
|
53
|
-
);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
const TMPL_FILE_PATH_DATA = resolve(PATH_TMPL, TEMPLATES_DIR, `_data.ejs`);
|
package/src/const.js
CHANGED
|
@@ -4,7 +4,7 @@ const DEFAULT_PATH_MODULES = "./modules";
|
|
|
4
4
|
const DEFAULT_PATH_WS = "./ws";
|
|
5
5
|
const DEFAULT_PATH_DB_DUMPS = "../../db.dumps";
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const MANIFEST_CONSTS = require("./manifest/const");
|
|
8
8
|
|
|
9
9
|
module.exports = {
|
|
10
10
|
DEFAULT_PATH_WS,
|
|
@@ -12,5 +12,5 @@ module.exports = {
|
|
|
12
12
|
DEFAULT_PATH_STATIC,
|
|
13
13
|
DEFAULT_PATH_TMP,
|
|
14
14
|
DEFAULT_PATH_DB_DUMPS,
|
|
15
|
-
|
|
15
|
+
...MANIFEST_CONSTS,
|
|
16
16
|
};
|
package/src/manifest/const.js
CHANGED
|
@@ -41,7 +41,7 @@ module.exports = {
|
|
|
41
41
|
fields: [<% if (fields && Array.isArray(fields)) { %><% for(let field of fields){ %>"<%- field %>",<% } %><% } %>],
|
|
42
42
|
},
|
|
43
43
|
],
|
|
44
|
-
data: ["
|
|
44
|
+
data: ["data"],
|
|
45
45
|
postFix: actionNamePath,
|
|
46
46
|
},
|
|
47
47
|
<% } %>
|
|
@@ -83,7 +83,7 @@ module.exports = {
|
|
|
83
83
|
actionSignature: ACTION_SIGNATURES.READ,
|
|
84
84
|
title: "not-node:crud_read_action_form_title",
|
|
85
85
|
description: "not-node:crud_read_action_form_description",
|
|
86
|
-
rules: [
|
|
86
|
+
rules: [
|
|
87
87
|
{
|
|
88
88
|
auth: true,
|
|
89
89
|
role: "admin",
|
|
@@ -112,7 +112,7 @@ module.exports = {
|
|
|
112
112
|
update: {
|
|
113
113
|
title: "not-node:crud_update_action_form_title",
|
|
114
114
|
description: "not-node:crud_update_action_form_description",
|
|
115
|
-
actionSignature: ACTION_SIGNATURES.UPDATE,
|
|
115
|
+
actionSignature: ACTION_SIGNATURES.UPDATE,
|
|
116
116
|
method: "post",
|
|
117
117
|
rules: [
|
|
118
118
|
{
|
|
@@ -129,9 +129,9 @@ module.exports = {
|
|
|
129
129
|
fields: [<%- fields.map((entry) => `"${entry}"`).join(',') %>],
|
|
130
130
|
},
|
|
131
131
|
],
|
|
132
|
-
data: ["
|
|
132
|
+
data: ["data"],
|
|
133
133
|
postFix: idActionPath,
|
|
134
|
-
},
|
|
134
|
+
},
|
|
135
135
|
<% } %>
|
|
136
136
|
<% if (Object.hasOwn(actions,'delete')){ %>
|
|
137
137
|
delete: {
|
|
@@ -149,7 +149,7 @@ module.exports = {
|
|
|
149
149
|
role: ["client", "confirmed"],
|
|
150
150
|
},
|
|
151
151
|
],
|
|
152
|
-
data: ["
|
|
152
|
+
data: ["data"],
|
|
153
153
|
postFix: idActionPath,
|
|
154
154
|
},
|
|
155
155
|
<% } %>
|
|
@@ -160,13 +160,13 @@ module.exports = {
|
|
|
160
160
|
title: "not-node:crud_listAndCount_action_form_title",
|
|
161
161
|
description: "not-node:crud_listAndCount_action_form_description",
|
|
162
162
|
data: ["pager", "sorter", "filter", "search"],
|
|
163
|
-
rules: [
|
|
163
|
+
rules: [
|
|
164
164
|
{
|
|
165
165
|
auth: true,
|
|
166
166
|
role: ["admin"],
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
|
-
auth: true
|
|
169
|
+
auth: true
|
|
170
170
|
},
|
|
171
171
|
],
|
|
172
172
|
postFix: actionNamePath,
|
|
@@ -176,7 +176,7 @@ module.exports = {
|
|
|
176
176
|
listAll: {
|
|
177
177
|
method: "get",
|
|
178
178
|
actionSignature: ACTION_SIGNATURES.READ,
|
|
179
|
-
data: ["
|
|
179
|
+
data: ["data", "sorter"],
|
|
180
180
|
title: "not-node:crud_listAll_action_form_title",
|
|
181
181
|
description: "not-node:crud_listAll_action_form_description",
|
|
182
182
|
fields: [
|
|
@@ -184,7 +184,7 @@ module.exports = {
|
|
|
184
184
|
<% if (dates){ %>"createdAt","updatedAt",<% } %>
|
|
185
185
|
],
|
|
186
186
|
postFix: actionNamePath,
|
|
187
|
-
rules: [
|
|
187
|
+
rules: [
|
|
188
188
|
{
|
|
189
189
|
auth: true,
|
|
190
190
|
role: ["manager"],
|