@aeriajs/core 0.0.187 → 0.0.189

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.
@@ -312,7 +312,7 @@ const recurse = async (target, ctx) => {
312
312
  if (!ctx.options.allowOperators) {
313
313
  return types_1.Result.error(types_1.ACError.InsecureOperator);
314
314
  }
315
- if (security_1.INSECURE_OPERATORS.includes(key)) {
315
+ if (!ctx.options.context?.config.security.allowInsecureOperators && security_1.INSECURE_OPERATORS.includes(key)) {
316
316
  return types_1.Result.error(types_1.ACError.InsecureOperator);
317
317
  }
318
318
  }
@@ -276,7 +276,7 @@ const recurse = async (target, ctx) => {
276
276
  if (!ctx.options.allowOperators) {
277
277
  return Result.error(ACError.InsecureOperator);
278
278
  }
279
- if (INSECURE_OPERATORS.includes(key)) {
279
+ if (!ctx.options.context?.config.security.allowInsecureOperators && INSECURE_OPERATORS.includes(key)) {
280
280
  return Result.error(ACError.InsecureOperator);
281
281
  }
282
282
  }
@@ -16,6 +16,7 @@ const internalCount = async (payload, context) => {
16
16
  const traversedFilters = (0, common_1.throwIfError)(await (0, index_js_1.traverseDocument)(filters, context.description, {
17
17
  autoCast: true,
18
18
  allowOperators: true,
19
+ context,
19
20
  }));
20
21
  if ($text) {
21
22
  const pipeline = [];
@@ -11,7 +11,8 @@ const internalCount = async (payload, context) => {
11
11
  }
12
12
  const traversedFilters = throwIfError(await traverseDocument(filters, context.description, {
13
13
  autoCast: true,
14
- allowOperators: true
14
+ allowOperators: true,
15
+ context
15
16
  }));
16
17
  if ($text) {
17
18
  const pipeline = [];
@@ -19,6 +19,7 @@ const internalGet = async (payload, context) => {
19
19
  const { error: filtersError, result: traversedFilters } = await (0, index_js_1.traverseDocument)(filters, context.description, {
20
20
  autoCast: true,
21
21
  allowOperators: true,
22
+ context,
22
23
  });
23
24
  if (filtersError) {
24
25
  switch (filtersError) {
@@ -24,7 +24,8 @@ const internalGet = async (payload, context) => {
24
24
  });
25
25
  const { error: filtersError, result: traversedFilters } = await traverseDocument(filters, context.description, {
26
26
  autoCast: true,
27
- allowOperators: true
27
+ allowOperators: true,
28
+ context
28
29
  });
29
30
  if (filtersError) {
30
31
  switch (filtersError) {
@@ -42,6 +42,7 @@ const internalGetAll = async (payload, context) => {
42
42
  const { error: filtersError, result: traversedFilters } = await (0, index_js_1.traverseDocument)(filters, context.description, {
43
43
  autoCast: true,
44
44
  allowOperators: true,
45
+ context,
45
46
  });
46
47
  if (filtersError) {
47
48
  switch (filtersError) {
@@ -41,7 +41,8 @@ const internalGetAll = async (payload, context) => {
41
41
  }
42
42
  const { error: filtersError, result: traversedFilters } = await traverseDocument(filters, context.description, {
43
43
  autoCast: true,
44
- allowOperators: true
44
+ allowOperators: true,
45
+ context
45
46
  });
46
47
  if (filtersError) {
47
48
  switch (filtersError) {
@@ -13,6 +13,7 @@ const internalRemove = async (payload, context) => {
13
13
  }
14
14
  const filters = (0, common_1.throwIfError)(await (0, index_js_1.traverseDocument)(payload.filters, context.description, {
15
15
  autoCast: true,
16
+ context,
16
17
  }));
17
18
  const target = await context.collection.model.findOne(filters);
18
19
  if (!target) {
@@ -10,7 +10,8 @@ const internalRemove = async (payload, context) => {
10
10
  });
11
11
  }
12
12
  const filters = throwIfError(await traverseDocument(payload.filters, context.description, {
13
- autoCast: true
13
+ autoCast: true,
14
+ context
14
15
  }));
15
16
  const target = await context.collection.model.findOne(filters);
16
17
  if (!target) {
@@ -12,6 +12,7 @@ const internalRemoveAll = async (payload, context) => {
12
12
  },
13
13
  }, context.description, {
14
14
  autoCast: true,
15
+ context,
15
16
  }));
16
17
  const it = context.collection.model.find(filters);
17
18
  let doc;
@@ -9,7 +9,8 @@ const internalRemoveAll = async (payload, context) => {
9
9
  $in: payload.filters
10
10
  }
11
11
  }, context.description, {
12
- autoCast: true
12
+ autoCast: true,
13
+ context
13
14
  }));
14
15
  const it = context.collection.model.find(filters);
15
16
  let doc;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/core",
3
- "version": "0.0.187",
3
+ "version": "0.0.189",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "aeriaMain": "tests/fixtures/aeriaMain.js",
@@ -42,13 +42,13 @@
42
42
  "mongodb-memory-server": "^9.2.0"
43
43
  },
44
44
  "peerDependencies": {
45
- "@aeriajs/builtins": "^0.0.187",
46
- "@aeriajs/common": "^0.0.114",
47
- "@aeriajs/entrypoint": "^0.0.117",
48
- "@aeriajs/http": "^0.0.128",
49
- "@aeriajs/security": "^0.0.187",
50
- "@aeriajs/types": "^0.0.97",
51
- "@aeriajs/validation": "^0.0.117"
45
+ "@aeriajs/builtins": "^0.0.189",
46
+ "@aeriajs/common": "^0.0.115",
47
+ "@aeriajs/entrypoint": "^0.0.118",
48
+ "@aeriajs/http": "^0.0.129",
49
+ "@aeriajs/security": "^0.0.189",
50
+ "@aeriajs/types": "^0.0.98",
51
+ "@aeriajs/validation": "^0.0.118"
52
52
  },
53
53
  "dependencies": {
54
54
  "mongodb": "^6.5.0",