@aeriajs/core 0.0.163 → 0.0.165
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/assets.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare const getCollectionAsset: <TCollectionName extends string, TAsset
|
|
|
18
18
|
readonly error: undefined;
|
|
19
19
|
readonly result: NonNullable<Collection[TAssetName]>;
|
|
20
20
|
}>;
|
|
21
|
-
export declare const getFunction: <
|
|
21
|
+
export declare const getFunction: <TFunction extends (payload: any, context: Context) => unknown>(collectionName: string, functionName: string, token?: Token, options?: {
|
|
22
22
|
exposedOnly: boolean;
|
|
23
23
|
}) => Promise<{
|
|
24
24
|
readonly _tag: "Error";
|
|
@@ -39,5 +39,5 @@ export declare const getFunction: <TCollectionName extends string, TFunctionName
|
|
|
39
39
|
} | {
|
|
40
40
|
readonly _tag: "Result";
|
|
41
41
|
readonly error: undefined;
|
|
42
|
-
readonly result:
|
|
42
|
+
readonly result: TFunction;
|
|
43
43
|
}>;
|
|
@@ -15,9 +15,8 @@ const preferredRemove = async (targetId, reference, parentContext) => {
|
|
|
15
15
|
collectionName: reference.referencedCollection,
|
|
16
16
|
});
|
|
17
17
|
if (Array.isArray(targetId)) {
|
|
18
|
-
const { result } = await (0, assets_js_1.getFunction)(reference.referencedCollection, 'removeAll');
|
|
19
|
-
if (
|
|
20
|
-
const removeAll = result;
|
|
18
|
+
const { result: removeAll } = await (0, assets_js_1.getFunction)(reference.referencedCollection, 'removeAll');
|
|
19
|
+
if (removeAll) {
|
|
21
20
|
return removeAll({
|
|
22
21
|
filters: targetId,
|
|
23
22
|
}, context);
|
|
@@ -28,9 +27,8 @@ const preferredRemove = async (targetId, reference, parentContext) => {
|
|
|
28
27
|
},
|
|
29
28
|
});
|
|
30
29
|
}
|
|
31
|
-
const { result } = await (0, assets_js_1.getFunction)(reference.referencedCollection, 'remove');
|
|
32
|
-
if (
|
|
33
|
-
const remove = result;
|
|
30
|
+
const { result: remove } = await (0, assets_js_1.getFunction)(reference.referencedCollection, 'remove');
|
|
31
|
+
if (remove) {
|
|
34
32
|
return remove({
|
|
35
33
|
filters: {
|
|
36
34
|
_id: targetId,
|
|
@@ -13,9 +13,8 @@ const preferredRemove = async (targetId, reference, parentContext) => {
|
|
|
13
13
|
collectionName: reference.referencedCollection
|
|
14
14
|
});
|
|
15
15
|
if (Array.isArray(targetId)) {
|
|
16
|
-
const { result:
|
|
17
|
-
if (
|
|
18
|
-
const removeAll = result2;
|
|
16
|
+
const { result: removeAll } = await getFunction(reference.referencedCollection, "removeAll");
|
|
17
|
+
if (removeAll) {
|
|
19
18
|
return removeAll({
|
|
20
19
|
filters: targetId
|
|
21
20
|
}, context);
|
|
@@ -26,9 +25,8 @@ const preferredRemove = async (targetId, reference, parentContext) => {
|
|
|
26
25
|
}
|
|
27
26
|
});
|
|
28
27
|
}
|
|
29
|
-
const { result } = await getFunction(reference.referencedCollection, "remove");
|
|
30
|
-
if (
|
|
31
|
-
const remove = result;
|
|
28
|
+
const { result: remove } = await getFunction(reference.referencedCollection, "remove");
|
|
29
|
+
if (remove) {
|
|
32
30
|
return remove({
|
|
33
31
|
filters: {
|
|
34
32
|
_id: targetId
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.165",
|
|
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.
|
|
46
|
-
"@aeriajs/common": "^0.0.
|
|
47
|
-
"@aeriajs/entrypoint": "^0.0.
|
|
48
|
-
"@aeriajs/http": "^0.0.
|
|
49
|
-
"@aeriajs/security": "^0.0.
|
|
50
|
-
"@aeriajs/types": "^0.0.
|
|
51
|
-
"@aeriajs/validation": "^0.0.
|
|
45
|
+
"@aeriajs/builtins": "^0.0.165",
|
|
46
|
+
"@aeriajs/common": "^0.0.101",
|
|
47
|
+
"@aeriajs/entrypoint": "^0.0.103",
|
|
48
|
+
"@aeriajs/http": "^0.0.114",
|
|
49
|
+
"@aeriajs/security": "^0.0.165",
|
|
50
|
+
"@aeriajs/types": "^0.0.86",
|
|
51
|
+
"@aeriajs/validation": "^0.0.104"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"mongodb": "^6.5.0",
|