not-node 6.3.19 → 6.3.21

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.19",
3
+ "version": "6.3.21",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -2,12 +2,7 @@
2
2
  const Form = require("../form/form");
3
3
  const { firstLetterToUpper } = require("../common");
4
4
  //form
5
- const FIELDS = [
6
- ["activeUserId", { required: true }, "not-node//objectId"],
7
- ["activeUser", "not-node//requiredObject"],
8
- ["ip", "not-node//ip"],
9
- ["identity", "not-node//requiredObject"],
10
- ];
5
+ const FIELDS = [["identity", "not-node//requiredObject"]];
11
6
 
12
7
  module.exports = ({ MODULE_NAME, MODEL_NAME, actionName }) => {
13
8
  const FORM_NAME = `${MODULE_NAME}:${MODEL_NAME}:${firstLetterToUpper(
@@ -4,9 +4,7 @@ const { firstLetterToUpper } = require("../common");
4
4
  //form
5
5
  const FIELDS = [
6
6
  ["targetID", { required: true }, "not-node//ID"],
7
- ["activeUserId", { required: true }, "not-node//objectId"],
8
- ["activeUser", "not-node//requiredObject"],
9
- ["ip", "not-node//ip"],
7
+
10
8
  ["identity", "not-node//requiredObject"],
11
9
  ];
12
10
 
@@ -5,9 +5,6 @@ const { firstLetterToUpper } = require("../common");
5
5
  //form
6
6
  const FIELDS = [
7
7
  ["targetId", { required: true }, "not-node//objectId"],
8
- ["activeUserId", { required: true }, "not-node//objectId"],
9
- ["activeUser", "not-node//requiredObject"],
10
- ["ip", "not-node//ip"],
11
8
  ["identity", "not-node//requiredObject"],
12
9
  ];
13
10
 
@@ -5,9 +5,6 @@ const notAppIdentity = require("../identity");
5
5
 
6
6
  const FIELDS = [
7
7
  ["query", `not-filter//_filterQuery`],
8
- ["activeUserId", { required: true }, "not-node//objectId"],
9
- ["activeUser", "not-node//requiredObject"],
10
- ["ip", "not-node//ip"],
11
8
  ["identity", "not-node//requiredObject"],
12
9
  ];
13
10
 
@@ -5,9 +5,6 @@ const notAppIdentity = require("../identity");
5
5
 
6
6
  const FIELDS = [
7
7
  ["query", `not-filter//_filterQuery`],
8
- ["activeUserId", { required: true }, "not-node//objectId"],
9
- ["activeUser", "not-node//requiredObject"],
10
- ["ip", "not-node//ip"],
11
8
  ["identity", "not-node//requiredObject"],
12
9
  ];
13
10
 
@@ -417,7 +417,7 @@ module.exports = ({
417
417
  checkShouldOwn(filter, shouldOwn, identity);
418
418
  const result = await getModel().listAll(filter);
419
419
  LogAction(action, identity, { shouldOwn });
420
- return result;
420
+ return result.map((itm) => itm.toObject());
421
421
  }
422
422
 
423
423
  static async listAll({ identity }) {
@@ -460,6 +460,7 @@ module.exports = ({
460
460
  search,
461
461
  populate
462
462
  );
463
+ result.list = result.list.map((itm) => itm.toObject());
463
464
  LogAction(action, identity, { shouldOwn });
464
465
  return result;
465
466
  }
@@ -501,7 +502,7 @@ module.exports = ({
501
502
  populate
502
503
  );
503
504
  LogAction(action, identity, { shouldOwn });
504
- return result;
505
+ return result.map((itm) => itm.toObject());
505
506
  }
506
507
 
507
508
  static async list({ query, identity }) {
@@ -4,7 +4,6 @@ module.exports = class InitSecurity {
4
4
  getCSPDirectives({ config }) {
5
5
  try {
6
6
  let corsArr = config.get("cors");
7
- let corsLine = corsArr ? corsArr.join(" ") : "";
8
7
  let CSPDirectives = config.get("CSP");
9
8
  let result = {};
10
9
  Object.keys(CSPDirectives).forEach((nm) => {
@@ -13,7 +12,7 @@ module.exports = class InitSecurity {
13
12
  Array.isArray(corsArr) &&
14
13
  ["default-src", "connect-src"].includes(nm)
15
14
  ) {
16
- result[nm].push(...corsLine);
15
+ result[nm].push(...corsArr);
17
16
  }
18
17
  });
19
18
  return result;
@@ -132,7 +132,6 @@ class notRoute {
132
132
  )
133
133
  );
134
134
  }
135
- console.log(rule);
136
135
  obsoleteRuleFields(rule, req.originalUrl);
137
136
  let actionName = this.selectActionName(rule);
138
137
  let mod = this.notApp.getModule(this.moduleName);