@aeriajs/security 0.0.8 → 0.0.10

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.
@@ -2,6 +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 api_1 = require("@aeriajs/api");
5
6
  const common_1 = require("@aeriajs/common");
6
7
  const internalCheckImmutability = async (props, context) => {
7
8
  const { propertyName = '', parentId, childId, payload, } = props;
@@ -16,7 +17,7 @@ const internalCheckImmutability = async (props, context) => {
16
17
  const immutable = parentId && (description.immutable === true
17
18
  || (Array.isArray(description.immutable) && description.immutable.includes(propertyName)));
18
19
  const currentDocument = await context.collection.model.findOne({
19
- _id: new types_1.ObjectId(parentId),
20
+ _id: new api_1.ObjectId(parentId),
20
21
  });
21
22
  if (!currentDocument) {
22
23
  return (0, common_1.left)(types_1.ACErrors.ImmutabilityParentNotFound);
@@ -174,7 +174,8 @@ function _ts_generator(thisArg, body) {
174
174
  };
175
175
  }
176
176
  }
177
- import { ACErrors, ObjectId } from "@aeriajs/types";
177
+ import { ACErrors } from "@aeriajs/types";
178
+ import { ObjectId } from "@aeriajs/api";
178
179
  import { left, right, isLeft } from "@aeriajs/common";
179
180
  var internalCheckImmutability = function() {
180
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.8",
3
+ "version": "0.0.10",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -22,9 +22,9 @@
22
22
  "dist"
23
23
  ],
24
24
  "peerDependencies": {
25
- "@aeriajs/api": "^0.0.8",
26
- "@aeriajs/common": "^0.0.2",
27
- "@aeriajs/types": "^0.0.1"
25
+ "@aeriajs/api": "^0.0.10",
26
+ "@aeriajs/common": "^0.0.4",
27
+ "@aeriajs/types": "^0.0.3"
28
28
  },
29
29
  "scripts": {
30
30
  "test": "echo skipping",