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 +1 -1
- package/src/generic/form.authorizedAction.js +1 -6
- package/src/generic/form.getByID.js +1 -3
- package/src/generic/form.getById.js +0 -3
- package/src/generic/form.list.js +0 -3
- package/src/generic/form.listAndCount.js +0 -3
- package/src/generic/logic.js +3 -2
- package/src/init/lib/security.js +1 -2
- package/src/manifest/route.js +0 -1
package/package.json
CHANGED
|
@@ -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
|
-
|
|
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
|
|
package/src/generic/form.list.js
CHANGED
|
@@ -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
|
|
package/src/generic/logic.js
CHANGED
|
@@ -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 }) {
|
package/src/init/lib/security.js
CHANGED
|
@@ -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(...
|
|
15
|
+
result[nm].push(...corsArr);
|
|
17
16
|
}
|
|
18
17
|
});
|
|
19
18
|
return result;
|