@aeriajs/security 0.0.10 → 0.0.12
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/dist/immutability.js +2 -2
- package/dist/immutability.mjs +1 -1
- package/package.json +8 -4
package/dist/immutability.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.checkImmutability = void 0;
|
|
4
4
|
const types_1 = require("@aeriajs/types");
|
|
5
|
-
const
|
|
5
|
+
const mongodb_1 = require("mongodb");
|
|
6
6
|
const common_1 = require("@aeriajs/common");
|
|
7
7
|
const internalCheckImmutability = async (props, context) => {
|
|
8
8
|
const { propertyName = '', parentId, childId, payload, } = props;
|
|
@@ -17,7 +17,7 @@ const internalCheckImmutability = async (props, context) => {
|
|
|
17
17
|
const immutable = parentId && (description.immutable === true
|
|
18
18
|
|| (Array.isArray(description.immutable) && description.immutable.includes(propertyName)));
|
|
19
19
|
const currentDocument = await context.collection.model.findOne({
|
|
20
|
-
_id: new
|
|
20
|
+
_id: new mongodb_1.ObjectId(parentId),
|
|
21
21
|
});
|
|
22
22
|
if (!currentDocument) {
|
|
23
23
|
return (0, common_1.left)(types_1.ACErrors.ImmutabilityParentNotFound);
|
package/dist/immutability.mjs
CHANGED
|
@@ -175,7 +175,7 @@ function _ts_generator(thisArg, body) {
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
import { ACErrors } from "@aeriajs/types";
|
|
178
|
-
import { ObjectId } from "
|
|
178
|
+
import { ObjectId } from "mongodb";
|
|
179
179
|
import { left, right, isLeft } from "@aeriajs/common";
|
|
180
180
|
var internalCheckImmutability = function() {
|
|
181
181
|
var _ref = _async_to_generator(function(props, context) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/security",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -22,9 +22,13 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@aeriajs/api": "^0.0.
|
|
26
|
-
"@aeriajs/common": "^0.0.
|
|
27
|
-
"@aeriajs/types": "^0.0.
|
|
25
|
+
"@aeriajs/api": "^0.0.12",
|
|
26
|
+
"@aeriajs/common": "^0.0.5",
|
|
27
|
+
"@aeriajs/types": "^0.0.4",
|
|
28
|
+
"mongodb": "^6.1.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"mongodb": "^6.1.0"
|
|
28
32
|
},
|
|
29
33
|
"scripts": {
|
|
30
34
|
"test": "echo skipping",
|