@aeriajs/security 0.0.133 → 0.0.135
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/use.js +0 -7
- package/dist/use.mjs +0 -8
- package/package.json +4 -4
package/dist/use.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useSecurity = void 0;
|
|
4
4
|
const types_1 = require("@aeriajs/types");
|
|
5
|
-
const common_1 = require("@aeriajs/common");
|
|
6
5
|
const index_js_1 = require("./index.js");
|
|
7
6
|
const chainFunctions = async (_props, context, functions) => {
|
|
8
7
|
const props = Object.assign({
|
|
@@ -21,15 +20,9 @@ const chainFunctions = async (_props, context, functions) => {
|
|
|
21
20
|
return types_1.Result.result(props.payload);
|
|
22
21
|
};
|
|
23
22
|
const useSecurity = (context) => {
|
|
24
|
-
const options = context.description.options
|
|
25
|
-
? Object.assign({}, context.description.options)
|
|
26
|
-
: {};
|
|
27
23
|
const beforeRead = async (payload) => {
|
|
28
24
|
const newPayload = Object.assign({}, payload);
|
|
29
25
|
newPayload.filters ??= {};
|
|
30
|
-
if (options.queryPreset) {
|
|
31
|
-
Object.assign(newPayload, (0, common_1.deepMerge)(newPayload, options.queryPreset));
|
|
32
|
-
}
|
|
33
26
|
const props = {
|
|
34
27
|
payload: newPayload,
|
|
35
28
|
};
|
package/dist/use.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { Result } from "@aeriajs/types";
|
|
3
|
-
import { deepMerge } from "@aeriajs/common";
|
|
4
3
|
import {
|
|
5
4
|
checkImmutability,
|
|
6
5
|
checkOwnershipRead,
|
|
@@ -24,16 +23,9 @@ const chainFunctions = async (_props, context, functions) => {
|
|
|
24
23
|
return Result.result(props.payload);
|
|
25
24
|
};
|
|
26
25
|
export const useSecurity = (context) => {
|
|
27
|
-
const options = context.description.options ? Object.assign({}, context.description.options) : {};
|
|
28
26
|
const beforeRead = async (payload) => {
|
|
29
27
|
const newPayload = Object.assign({}, payload);
|
|
30
28
|
newPayload.filters ??= {};
|
|
31
|
-
if (options.queryPreset) {
|
|
32
|
-
Object.assign(newPayload, deepMerge(
|
|
33
|
-
newPayload,
|
|
34
|
-
options.queryPreset
|
|
35
|
-
));
|
|
36
|
-
}
|
|
37
29
|
const props = {
|
|
38
30
|
payload: newPayload
|
|
39
31
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/security",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.135",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"mongodb": "^6.5.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@aeriajs/core": "^0.0.
|
|
32
|
-
"@aeriajs/common": "^0.0.
|
|
33
|
-
"@aeriajs/types": "^0.0.
|
|
31
|
+
"@aeriajs/core": "^0.0.135",
|
|
32
|
+
"@aeriajs/common": "^0.0.85",
|
|
33
|
+
"@aeriajs/types": "^0.0.73",
|
|
34
34
|
"mongodb": "^6.5.0"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|