not-node 6.3.41 → 6.3.42
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
package/src/core/locales/ru.json
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"field_UUID_label": "UUID",
|
|
54
54
|
"field_UUID_placeholder": "UUID",
|
|
55
55
|
"crud_create_action_waiting": "Создание записи...",
|
|
56
|
-
"
|
|
56
|
+
"crud_create_action_form_title": "Добавление",
|
|
57
57
|
"crud_create_action_form_description": "Добавить новый документ",
|
|
58
58
|
"crud_read_action_waiting": "Чтение записи...",
|
|
59
59
|
"crud_read_action_form_title": "Детали",
|
|
@@ -1,29 +1,24 @@
|
|
|
1
|
+
const { MODULE_NAME } = require("../const");
|
|
2
|
+
const { firstLetterToLower } = require("not-node").Common;
|
|
1
3
|
const ACTION_SIGNATURES = require('not-node/src/auth/const').ACTION_SIGNATURES;
|
|
4
|
+
const MODEL_NAME = "<%- ModelName %>";
|
|
5
|
+
const modelName = firstLetterToLower(MODEL_NAME);
|
|
6
|
+
|
|
2
7
|
const FIELDS = [
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<% } %>
|
|
11
|
-
<% } %>
|
|
12
|
-
<% if (ownage){ %>
|
|
13
|
-
["owner", "not-node//owner"],
|
|
14
|
-
["ownerModel", "not-node//ownerModel"],
|
|
15
|
-
<% } %>
|
|
16
|
-
<% if (dates){ %>
|
|
17
|
-
["createdAt", "not-node//createdAt"],
|
|
18
|
-
["updatedAt", "not-node//updatedAt"],
|
|
19
|
-
<% } %>
|
|
8
|
+
["_id", "not-node//_id"],
|
|
9
|
+
<% if (increment){ %>["<%- modelName %>ID", "not-node//ID"],<% } %>
|
|
10
|
+
<% if (fields && Array.isArray(fields)) { %><% for(let field of fields){ %>"<%- field %>",<% } %><% } %>
|
|
11
|
+
<% if (ownage){ %>["owner", "not-node//owner"],
|
|
12
|
+
["ownerModel", "not-node//ownerModel"],<% } %>
|
|
13
|
+
<% if (dates){ %> ["createdAt", "not-node//createdAt"],
|
|
14
|
+
["updatedAt", "not-node//updatedAt"],<% } %>
|
|
20
15
|
];
|
|
21
16
|
|
|
22
17
|
const actionNamePath = "/:actionName";
|
|
23
18
|
const idActionPath = "/:record[_id]/:actionName";
|
|
24
19
|
|
|
25
20
|
module.exports = {
|
|
26
|
-
model:
|
|
21
|
+
model: modelName,
|
|
27
22
|
url: "/api/:modelName",
|
|
28
23
|
fields: FIELDS,
|
|
29
24
|
privateFields: [],
|