@aeriajs/core 0.0.200 → 0.0.202
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/collection/cascadingRemove.d.ts +6 -1
- package/dist/collection/cascadingRemove.js +5 -1
- package/dist/collection/cascadingRemove.mjs +5 -1
- package/dist/collection/traverseDocument.d.ts +1 -1
- package/dist/functions/remove.d.ts +6 -1
- package/dist/functions/removeAll.d.ts +2 -2
- package/package.json +8 -8
|
@@ -12,7 +12,12 @@ export declare const preferredRemove: (targetId: ObjectId | (ObjectId | null)[],
|
|
|
12
12
|
}> | {
|
|
13
13
|
readonly _tag: "Result";
|
|
14
14
|
readonly error: undefined;
|
|
15
|
-
readonly result: import("mongodb").WithId<Omit<import("@aeriajs/types").PackReferences<
|
|
15
|
+
readonly result: import("mongodb").WithId<Omit<import("@aeriajs/types").PackReferences<{
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
updated_at?: Date | undefined;
|
|
18
|
+
created_at?: Date | undefined;
|
|
19
|
+
_id: ObjectId;
|
|
20
|
+
}>, "_id">> | null;
|
|
16
21
|
} | import("@aeriajs/types").Result.Error<{
|
|
17
22
|
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
18
23
|
} & {
|
|
@@ -47,7 +47,11 @@ const preferredRemove = async (targetId, reference, parentContext) => {
|
|
|
47
47
|
const { result: removeAll } = await (0, assets_js_1.getFunction)(reference.referencedCollection, 'removeAll');
|
|
48
48
|
if (removeAll) {
|
|
49
49
|
return removeAll({
|
|
50
|
-
filters:
|
|
50
|
+
filters: {
|
|
51
|
+
_id: {
|
|
52
|
+
$in: nonNullable,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
51
55
|
}, context);
|
|
52
56
|
}
|
|
53
57
|
return coll.deleteMany({
|
|
@@ -44,7 +44,11 @@ export const preferredRemove = async (targetId, reference, parentContext) => {
|
|
|
44
44
|
const { result: removeAll } = await getFunction(reference.referencedCollection, "removeAll");
|
|
45
45
|
if (removeAll) {
|
|
46
46
|
return removeAll({
|
|
47
|
-
filters:
|
|
47
|
+
filters: {
|
|
48
|
+
_id: {
|
|
49
|
+
$in: nonNullable
|
|
50
|
+
}
|
|
51
|
+
}
|
|
48
52
|
}, context);
|
|
49
53
|
}
|
|
50
54
|
return coll.deleteMany({
|
|
@@ -47,7 +47,7 @@ export declare const traverseDocument: <TWhat>(what: TWhat, description: Descrip
|
|
|
47
47
|
readonly result: TWhat;
|
|
48
48
|
} | {
|
|
49
49
|
readonly _tag: "Error";
|
|
50
|
-
readonly error: ACError.InsecureOperator |
|
|
50
|
+
readonly error: ACError.InsecureOperator | TraverseError | ValidationError;
|
|
51
51
|
readonly result: undefined;
|
|
52
52
|
}>;
|
|
53
53
|
export {};
|
|
@@ -6,7 +6,12 @@ export type RemoveOptions = {
|
|
|
6
6
|
export declare const remove: <TContext extends Context>(payload: RemovePayload<SchemaWithId<TContext["description"]>>, context: TContext, options?: RemoveOptions) => Promise<{
|
|
7
7
|
readonly _tag: "Result";
|
|
8
8
|
readonly error: undefined;
|
|
9
|
-
readonly result: import("mongodb").WithId<Omit<import("@aeriajs/types").PackReferences<
|
|
9
|
+
readonly result: import("mongodb").WithId<Omit<import("@aeriajs/types").PackReferences<{
|
|
10
|
+
[x: string]: unknown;
|
|
11
|
+
updated_at?: Date | undefined;
|
|
12
|
+
created_at?: Date | undefined;
|
|
13
|
+
_id: import("mongodb").ObjectId;
|
|
14
|
+
}>, "_id">> | null;
|
|
10
15
|
} | Result.Error<{
|
|
11
16
|
readonly code: ACError.ResourceNotFound;
|
|
12
17
|
} & {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Context, RemoveAllPayload } from '@aeriajs/types';
|
|
1
|
+
import type { Context, SchemaWithId, RemoveAllPayload } from '@aeriajs/types';
|
|
2
2
|
import { Result, ACError, HTTPStatus } from '@aeriajs/types';
|
|
3
3
|
export type RemoveAllOptions = {
|
|
4
4
|
bypassSecurity?: boolean;
|
|
5
5
|
};
|
|
6
|
-
export declare const removeAll: <TContext extends Context>(payload: RemoveAllPayload
|
|
6
|
+
export declare const removeAll: <TContext extends Context>(payload: RemoveAllPayload<SchemaWithId<TContext["description"]>>, context: TContext, options?: RemoveAllOptions) => Promise<{
|
|
7
7
|
readonly _tag: "Result";
|
|
8
8
|
readonly error: undefined;
|
|
9
9
|
readonly result: import("mongodb").DeleteResult;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeriajs/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.202",
|
|
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.202",
|
|
46
|
+
"@aeriajs/common": "^0.0.123",
|
|
47
|
+
"@aeriajs/entrypoint": "^0.0.126",
|
|
48
|
+
"@aeriajs/http": "^0.0.142",
|
|
49
|
+
"@aeriajs/security": "^0.0.202",
|
|
50
|
+
"@aeriajs/types": "^0.0.105",
|
|
51
|
+
"@aeriajs/validation": "^0.0.131"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"mongodb": "^6.5.0",
|