not-node 6.3.45 → 6.3.47

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "not-node",
3
- "version": "6.3.45",
3
+ "version": "6.3.47",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -7,7 +7,7 @@ const {
7
7
  const { getSafeFieldsForRoleAction } = require("../auth/fields");
8
8
  const { DEFAULT_USER_ROLE_FOR_GUEST } = require("../auth/const");
9
9
  /**
10
- * notFilterFilter.filter(fields, getApp().getModelSchema(MODEL_NAME), {action});
10
+ * notFieldsFilter.filter(fields, getApp().getModelSchema(MODEL_NAME), {action});
11
11
  *
12
12
  * usage:
13
13
  * manifest = {
@@ -17,7 +17,7 @@ const { DEFAULT_USER_ROLE_FOR_GUEST } = require("../auth/const");
17
17
  * list:{
18
18
  * rules:[{
19
19
  * root: true,
20
- * fields: notFilterFilter.filter(['@*'], getApp().getModelSchema(MODEL_NAME), {action:read});
20
+ * fields: notFieldsFilter.filter(['@*'], getApp().getModelSchema(MODEL_NAME), {action:read});
21
21
  * }]
22
22
  * },
23
23
  * profile:{
@@ -2,6 +2,7 @@ const merge = require("deepmerge");
2
2
  const Auth = require("../auth");
3
3
  const notFieldsFilter = require("../fields/filter");
4
4
  const getApp = require("../getApp");
5
+ const { firstLetterToUpper } = require("../common");
5
6
 
6
7
  const DIRTY_FIELDS = [
7
8
  "rules",
@@ -32,7 +33,7 @@ module.exports = class notManifestFilter {
32
33
  **/
33
34
  static filterRoute(route, auth, role, root, moduleName = "") {
34
35
  let result = JSON.parse(JSON.stringify(route));
35
- const modelName = result.modelName;
36
+ const modelName = result.model;
36
37
  result.actions = {};
37
38
  if (!route || !route.actions) {
38
39
  return result;
@@ -167,9 +168,9 @@ module.exports = class notManifestFilter {
167
168
  static composeFullModelName(moduleName, modelName) {
168
169
  if (modelName) {
169
170
  if (moduleName) {
170
- return `${moduleName}//${modelName}`;
171
+ return `${moduleName}//${firstLetterToUpper(modelName)}`;
171
172
  } else {
172
- return `${modelName}`;
173
+ return `${firstLetterToUpper(modelName)}`;
173
174
  }
174
175
  }
175
176
  return "";
@@ -228,7 +228,7 @@ class notRoute {
228
228
  }
229
229
  if (Array.isArray(result)) {
230
230
  result = result.map((itm) =>
231
- itm.toObject ? itm.toObject() : itm
231
+ itm && itm.toObject ? itm.toObject() : itm
232
232
  );
233
233
  }
234
234
  notManifestRouteResultFilter.filter(req.notRouteData, result);