@aeriajs/builtins 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/collections/file/index.d.ts +136 -172
- package/dist/collections/file/insert.d.ts +15 -51
- package/dist/collections/file/remove.d.ts +11 -38
- package/dist/collections/file/removeAll.d.ts +2 -2
- package/dist/collections/file/removeAll.js +1 -5
- package/dist/collections/file/removeAll.mjs +1 -5
- package/dist/collections/log/index.d.ts +295 -31
- package/dist/collections/log/index.js +1 -1
- package/dist/collections/log/index.mjs +1 -1
- package/dist/collections/resourceUsage/index.d.ts +44 -34
- package/dist/collections/user/createAccount.d.ts +31 -101
- package/dist/collections/user/getActivationLink.d.ts +4 -37
- package/dist/collections/user/getCurrentUser.d.ts +31 -101
- package/dist/collections/user/index.d.ts +160 -342
- package/dist/collections/user/insert.d.ts +57 -1
- package/dist/index.d.ts +635 -579
- package/package.json +6 -6
|
@@ -1,35 +1,15 @@
|
|
|
1
1
|
import { description } from './description.js';
|
|
2
2
|
export declare const tempFile: Omit<import("@aeriajs/types").Collection<never>, "functions" | "description" | "item" | "exposedFunctions" | "security" | "middlewares"> & {
|
|
3
|
-
item:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
readonly type: "string";
|
|
14
|
-
readonly format: "date-time";
|
|
15
|
-
};
|
|
16
|
-
readonly absolute_path: {
|
|
17
|
-
readonly type: "string";
|
|
18
|
-
};
|
|
19
|
-
readonly size: {
|
|
20
|
-
readonly type: "number";
|
|
21
|
-
};
|
|
22
|
-
readonly mime: {
|
|
23
|
-
readonly type: "number";
|
|
24
|
-
};
|
|
25
|
-
readonly collection: {
|
|
26
|
-
readonly type: "string";
|
|
27
|
-
};
|
|
28
|
-
readonly filename: {
|
|
29
|
-
readonly type: "string";
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
}>;
|
|
3
|
+
item: {
|
|
4
|
+
size: number;
|
|
5
|
+
absolute_path: string;
|
|
6
|
+
created_at: Date;
|
|
7
|
+
mime: number;
|
|
8
|
+
collection: string;
|
|
9
|
+
filename: string;
|
|
10
|
+
updated_at?: Date | undefined;
|
|
11
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
12
|
+
};
|
|
33
13
|
description: {
|
|
34
14
|
readonly $id: "tempFile";
|
|
35
15
|
readonly icon: "file";
|
|
@@ -66,57 +46,21 @@ export declare const tempFile: Omit<import("@aeriajs/types").Collection<never>,
|
|
|
66
46
|
} | undefined;
|
|
67
47
|
};
|
|
68
48
|
export declare const file: Omit<import("@aeriajs/types").Collection<never>, "functions" | "description" | "item" | "exposedFunctions" | "security" | "middlewares"> & {
|
|
69
|
-
item:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
readonly format: "date-time";
|
|
85
|
-
};
|
|
86
|
-
readonly name: {
|
|
87
|
-
readonly type: "string";
|
|
88
|
-
};
|
|
89
|
-
readonly absolute_path: {
|
|
90
|
-
readonly type: "string";
|
|
91
|
-
};
|
|
92
|
-
readonly relative_path: {
|
|
93
|
-
readonly type: "string";
|
|
94
|
-
};
|
|
95
|
-
readonly immutable: {
|
|
96
|
-
readonly type: "boolean";
|
|
97
|
-
};
|
|
98
|
-
readonly link: {
|
|
99
|
-
readonly getter: (doc: object) => Promise<string | undefined>;
|
|
100
|
-
};
|
|
101
|
-
readonly download_link: {
|
|
102
|
-
readonly getter: (doc: object) => Promise<string | undefined>;
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
readonly actions: {
|
|
106
|
-
readonly deleteAll: {
|
|
107
|
-
readonly label: "Remover";
|
|
108
|
-
readonly ask: true;
|
|
109
|
-
readonly selection: true;
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
readonly individualActions: {
|
|
113
|
-
readonly remove: {
|
|
114
|
-
readonly label: "Remover";
|
|
115
|
-
readonly icon: "trash";
|
|
116
|
-
readonly ask: true;
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
}>;
|
|
49
|
+
item: {
|
|
50
|
+
name: string;
|
|
51
|
+
link: never;
|
|
52
|
+
type: string;
|
|
53
|
+
size: number;
|
|
54
|
+
last_modified: Date;
|
|
55
|
+
absolute_path: string;
|
|
56
|
+
relative_path: string;
|
|
57
|
+
immutable: boolean;
|
|
58
|
+
download_link: never;
|
|
59
|
+
owner?: Collections["user"]["item"] | undefined;
|
|
60
|
+
updated_at?: Date | undefined;
|
|
61
|
+
created_at?: Date | undefined;
|
|
62
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
63
|
+
};
|
|
120
64
|
description: {
|
|
121
65
|
readonly $id: "file";
|
|
122
66
|
readonly icon: "paperclip";
|
|
@@ -169,62 +113,110 @@ export declare const file: Omit<import("@aeriajs/types").Collection<never>, "fun
|
|
|
169
113
|
};
|
|
170
114
|
};
|
|
171
115
|
functions: {
|
|
172
|
-
get: (payload: import("@aeriajs/types").GetPayload<
|
|
116
|
+
get: (payload: import("@aeriajs/types").GetPayload<{
|
|
117
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
118
|
+
} | {
|
|
119
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
120
|
+
} | {
|
|
121
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
122
|
+
} | {
|
|
123
|
+
owner?: Collections["user"]["item"] | undefined;
|
|
124
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
125
|
+
} | {
|
|
126
|
+
owner?: Collections["user"]["item"] | undefined;
|
|
127
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
128
|
+
} | {
|
|
129
|
+
owner?: Collections["user"]["item"] | undefined;
|
|
130
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
131
|
+
} | {
|
|
132
|
+
updated_at?: Date | undefined;
|
|
133
|
+
created_at?: Date | undefined;
|
|
134
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
135
|
+
} | {
|
|
136
|
+
updated_at?: Date | undefined;
|
|
137
|
+
created_at?: Date | undefined;
|
|
138
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
139
|
+
} | {
|
|
140
|
+
updated_at?: Date | undefined;
|
|
141
|
+
created_at?: Date | undefined;
|
|
142
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
143
|
+
} | {
|
|
144
|
+
owner?: Collections["user"]["item"] | undefined;
|
|
145
|
+
updated_at?: Date | undefined;
|
|
146
|
+
created_at?: Date | undefined;
|
|
147
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
148
|
+
} | {
|
|
149
|
+
owner?: Collections["user"]["item"] | undefined;
|
|
150
|
+
updated_at?: Date | undefined;
|
|
151
|
+
created_at?: Date | undefined;
|
|
152
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
153
|
+
} | {
|
|
154
|
+
owner?: Collections["user"]["item"] | undefined;
|
|
155
|
+
updated_at?: Date | undefined;
|
|
156
|
+
created_at?: Date | undefined;
|
|
157
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
158
|
+
}>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions) => Promise<import("@aeriajs/types").GetReturnType<{
|
|
159
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
160
|
+
} | {
|
|
161
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
162
|
+
} | {
|
|
163
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
164
|
+
} | {
|
|
165
|
+
owner?: Collections["user"]["item"] | undefined;
|
|
166
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
167
|
+
} | {
|
|
168
|
+
owner?: Collections["user"]["item"] | undefined;
|
|
169
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
170
|
+
} | {
|
|
171
|
+
owner?: Collections["user"]["item"] | undefined;
|
|
172
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
173
|
+
} | {
|
|
174
|
+
updated_at?: Date | undefined;
|
|
175
|
+
created_at?: Date | undefined;
|
|
176
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
177
|
+
} | {
|
|
178
|
+
updated_at?: Date | undefined;
|
|
179
|
+
created_at?: Date | undefined;
|
|
180
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
181
|
+
} | {
|
|
182
|
+
updated_at?: Date | undefined;
|
|
183
|
+
created_at?: Date | undefined;
|
|
184
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
185
|
+
} | {
|
|
186
|
+
owner?: Collections["user"]["item"] | undefined;
|
|
187
|
+
updated_at?: Date | undefined;
|
|
188
|
+
created_at?: Date | undefined;
|
|
189
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
190
|
+
} | {
|
|
191
|
+
owner?: Collections["user"]["item"] | undefined;
|
|
192
|
+
updated_at?: Date | undefined;
|
|
193
|
+
created_at?: Date | undefined;
|
|
194
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
195
|
+
} | {
|
|
196
|
+
owner?: Collections["user"]["item"] | undefined;
|
|
197
|
+
updated_at?: Date | undefined;
|
|
198
|
+
created_at?: Date | undefined;
|
|
199
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
200
|
+
}>>;
|
|
173
201
|
insert: (payload: {
|
|
174
202
|
what: {
|
|
175
203
|
content: string;
|
|
176
204
|
} & Pick<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<typeof description>>, "_id" | "name" | "owner" | "absolute_path">;
|
|
177
|
-
}, context: import("@aeriajs/types").Context<typeof description>) => Promise<import("@aeriajs/types").InsertReturnType<
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
readonly format: "date-time";
|
|
193
|
-
};
|
|
194
|
-
readonly name: {
|
|
195
|
-
readonly type: "string";
|
|
196
|
-
};
|
|
197
|
-
readonly absolute_path: {
|
|
198
|
-
readonly type: "string";
|
|
199
|
-
};
|
|
200
|
-
readonly relative_path: {
|
|
201
|
-
readonly type: "string";
|
|
202
|
-
};
|
|
203
|
-
readonly immutable: {
|
|
204
|
-
readonly type: "boolean";
|
|
205
|
-
};
|
|
206
|
-
readonly link: {
|
|
207
|
-
readonly getter: (doc: object) => Promise<string | undefined>;
|
|
208
|
-
};
|
|
209
|
-
readonly download_link: {
|
|
210
|
-
readonly getter: (doc: object) => Promise<string | undefined>;
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
|
-
readonly actions: {
|
|
214
|
-
readonly deleteAll: {
|
|
215
|
-
readonly label: "Remover";
|
|
216
|
-
readonly ask: true;
|
|
217
|
-
readonly selection: true;
|
|
218
|
-
};
|
|
219
|
-
};
|
|
220
|
-
readonly individualActions: {
|
|
221
|
-
readonly remove: {
|
|
222
|
-
readonly label: "Remover";
|
|
223
|
-
readonly icon: "trash";
|
|
224
|
-
readonly ask: true;
|
|
225
|
-
};
|
|
226
|
-
};
|
|
227
|
-
}>>>;
|
|
205
|
+
}, context: import("@aeriajs/types").Context<typeof description>) => Promise<import("@aeriajs/types").InsertReturnType<{
|
|
206
|
+
name: string;
|
|
207
|
+
link: never;
|
|
208
|
+
type: string;
|
|
209
|
+
size: number;
|
|
210
|
+
last_modified: Date;
|
|
211
|
+
absolute_path: string;
|
|
212
|
+
relative_path: string;
|
|
213
|
+
immutable: boolean;
|
|
214
|
+
download_link: never;
|
|
215
|
+
owner?: Collections["user"]["item"] | undefined;
|
|
216
|
+
updated_at?: Date | undefined;
|
|
217
|
+
created_at?: Date | undefined;
|
|
218
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
219
|
+
}>>;
|
|
228
220
|
download: (payload: {
|
|
229
221
|
fileId: string;
|
|
230
222
|
options: readonly ("picture" | "download")[];
|
|
@@ -241,7 +233,12 @@ export declare const file: Omit<import("@aeriajs/types").Collection<never>, "fun
|
|
|
241
233
|
remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<typeof description>>, context: import("@aeriajs/types").Context<typeof description>) => Promise<{
|
|
242
234
|
readonly _tag: "Result";
|
|
243
235
|
readonly error: undefined;
|
|
244
|
-
readonly result: import("mongodb").WithId<Omit<import("@aeriajs/types").PackReferences<
|
|
236
|
+
readonly result: import("mongodb").WithId<Omit<import("@aeriajs/types").PackReferences<{
|
|
237
|
+
[x: string]: unknown;
|
|
238
|
+
updated_at?: Date | undefined;
|
|
239
|
+
created_at?: Date | undefined;
|
|
240
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
241
|
+
}>, "_id">> | null;
|
|
245
242
|
} | import("@aeriajs/types").Result.Error<{
|
|
246
243
|
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
247
244
|
} & {
|
|
@@ -252,48 +249,15 @@ export declare const file: Omit<import("@aeriajs/types").Collection<never>, "fun
|
|
|
252
249
|
httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
|
|
253
250
|
}> | {
|
|
254
251
|
readonly _tag: "Error";
|
|
255
|
-
readonly error:
|
|
256
|
-
readonly httpStatus: {
|
|
257
|
-
readonly enum: [import("@aeriajs/types").HTTPStatus.Forbidden, import("@aeriajs/types").HTTPStatus.NotFound, import("@aeriajs/types").HTTPStatus.BadRequest];
|
|
258
|
-
};
|
|
259
|
-
readonly code: {
|
|
260
|
-
readonly enum: [import("@aeriajs/types").ACError.ResourceNotFound, import("@aeriajs/types").ACError.OwnershipError, import("@aeriajs/types").ACError.InsecureOperator, import("@aeriajs/types").ACError.MalformedInput];
|
|
261
|
-
};
|
|
262
|
-
readonly message: {
|
|
263
|
-
readonly type: "string";
|
|
264
|
-
};
|
|
265
|
-
readonly details: {
|
|
266
|
-
readonly type: "object";
|
|
267
|
-
readonly variable: true;
|
|
268
|
-
};
|
|
269
|
-
}>> & {
|
|
252
|
+
readonly error: {
|
|
270
253
|
code: import("@aeriajs/types").ACError.OwnershipError | import("@aeriajs/types").ACError.ResourceNotFound | import("@aeriajs/types").ACError.InsecureOperator | import("@aeriajs/types").ACError.MalformedInput;
|
|
271
254
|
httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest | import("@aeriajs/types").HTTPStatus.Forbidden | import("@aeriajs/types").HTTPStatus.NotFound;
|
|
272
|
-
message
|
|
273
|
-
details
|
|
274
|
-
}
|
|
275
|
-
readonly httpStatus: {
|
|
276
|
-
readonly enum: [import("@aeriajs/types").HTTPStatus.Forbidden, import("@aeriajs/types").HTTPStatus.NotFound, import("@aeriajs/types").HTTPStatus.BadRequest];
|
|
277
|
-
};
|
|
278
|
-
readonly code: {
|
|
279
|
-
readonly enum: [import("@aeriajs/types").ACError.ResourceNotFound, import("@aeriajs/types").ACError.OwnershipError, import("@aeriajs/types").ACError.InsecureOperator, import("@aeriajs/types").ACError.MalformedInput];
|
|
280
|
-
};
|
|
281
|
-
readonly message: {
|
|
282
|
-
readonly type: "string";
|
|
283
|
-
};
|
|
284
|
-
readonly details: {
|
|
285
|
-
readonly type: "object";
|
|
286
|
-
readonly variable: true;
|
|
287
|
-
};
|
|
288
|
-
}>> & {
|
|
289
|
-
code: import("@aeriajs/types").ACError.OwnershipError | import("@aeriajs/types").ACError.ResourceNotFound | import("@aeriajs/types").ACError.InsecureOperator | import("@aeriajs/types").ACError.MalformedInput;
|
|
290
|
-
httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest | import("@aeriajs/types").HTTPStatus.Forbidden | import("@aeriajs/types").HTTPStatus.NotFound;
|
|
291
|
-
message: string;
|
|
292
|
-
details: any;
|
|
293
|
-
}, never>>;
|
|
255
|
+
message?: string | undefined;
|
|
256
|
+
details?: any;
|
|
257
|
+
};
|
|
294
258
|
readonly result: undefined;
|
|
295
259
|
}>;
|
|
296
|
-
removeAll: (payload: import("@aeriajs/types").RemoveAllPayload
|
|
260
|
+
removeAll: (payload: import("@aeriajs/types").RemoveAllPayload<import("@aeriajs/types").SchemaWithId<typeof description>>, context: import("@aeriajs/types").Context<typeof description>) => Promise<{
|
|
297
261
|
readonly _tag: "Result";
|
|
298
262
|
readonly error: undefined;
|
|
299
263
|
readonly result: import("mongodb").DeleteResult;
|
|
@@ -4,54 +4,18 @@ export declare const insert: (payload: {
|
|
|
4
4
|
what: {
|
|
5
5
|
content: string;
|
|
6
6
|
} & Pick<PackReferences<SchemaWithId<typeof description>>, "_id" | "name" | "owner" | "absolute_path">;
|
|
7
|
-
}, context: Context<typeof description>) => Promise<import("@aeriajs/types").InsertReturnType<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
readonly format: "date-time";
|
|
23
|
-
};
|
|
24
|
-
readonly name: {
|
|
25
|
-
readonly type: "string";
|
|
26
|
-
};
|
|
27
|
-
readonly absolute_path: {
|
|
28
|
-
readonly type: "string";
|
|
29
|
-
};
|
|
30
|
-
readonly relative_path: {
|
|
31
|
-
readonly type: "string";
|
|
32
|
-
};
|
|
33
|
-
readonly immutable: {
|
|
34
|
-
readonly type: "boolean";
|
|
35
|
-
};
|
|
36
|
-
readonly link: {
|
|
37
|
-
readonly getter: (doc: object) => Promise<string | undefined>;
|
|
38
|
-
};
|
|
39
|
-
readonly download_link: {
|
|
40
|
-
readonly getter: (doc: object) => Promise<string | undefined>;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
readonly actions: {
|
|
44
|
-
readonly deleteAll: {
|
|
45
|
-
readonly label: "Remover";
|
|
46
|
-
readonly ask: true;
|
|
47
|
-
readonly selection: true;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
readonly individualActions: {
|
|
51
|
-
readonly remove: {
|
|
52
|
-
readonly label: "Remover";
|
|
53
|
-
readonly icon: "trash";
|
|
54
|
-
readonly ask: true;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
}>>>;
|
|
7
|
+
}, context: Context<typeof description>) => Promise<import("@aeriajs/types").InsertReturnType<{
|
|
8
|
+
name: string;
|
|
9
|
+
link: never;
|
|
10
|
+
type: string;
|
|
11
|
+
size: number;
|
|
12
|
+
last_modified: Date;
|
|
13
|
+
absolute_path: string;
|
|
14
|
+
relative_path: string;
|
|
15
|
+
immutable: boolean;
|
|
16
|
+
download_link: never;
|
|
17
|
+
owner?: Collections["user"]["item"] | undefined;
|
|
18
|
+
updated_at?: Date | undefined;
|
|
19
|
+
created_at?: Date | undefined;
|
|
20
|
+
_id: import("@aeriajs/core").ObjectId;
|
|
21
|
+
}>>;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import type { Context, SchemaWithId, RemovePayload } from '@aeriajs/types';
|
|
2
2
|
import type { description } from './description.js';
|
|
3
3
|
import { Result } from '@aeriajs/types';
|
|
4
|
+
import { type ObjectId } from '@aeriajs/core';
|
|
4
5
|
export declare const remove: (payload: RemovePayload<SchemaWithId<typeof description>>, context: Context<typeof description>) => Promise<{
|
|
5
6
|
readonly _tag: "Result";
|
|
6
7
|
readonly error: undefined;
|
|
7
|
-
readonly result: import("mongodb").WithId<Omit<import("@aeriajs/types").PackReferences<
|
|
8
|
+
readonly result: import("mongodb").WithId<Omit<import("@aeriajs/types").PackReferences<{
|
|
9
|
+
[x: string]: unknown;
|
|
10
|
+
updated_at?: Date | undefined;
|
|
11
|
+
created_at?: Date | undefined;
|
|
12
|
+
_id: import("mongodb").ObjectId;
|
|
13
|
+
}>, "_id">> | null;
|
|
8
14
|
} | Result.Error<{
|
|
9
15
|
readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
|
|
10
16
|
} & {
|
|
@@ -15,44 +21,11 @@ export declare const remove: (payload: RemovePayload<SchemaWithId<typeof descrip
|
|
|
15
21
|
httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
|
|
16
22
|
}> | {
|
|
17
23
|
readonly _tag: "Error";
|
|
18
|
-
readonly error:
|
|
19
|
-
readonly httpStatus: {
|
|
20
|
-
readonly enum: [import("@aeriajs/types").HTTPStatus.Forbidden, import("@aeriajs/types").HTTPStatus.NotFound, import("@aeriajs/types").HTTPStatus.BadRequest];
|
|
21
|
-
};
|
|
22
|
-
readonly code: {
|
|
23
|
-
readonly enum: [import("@aeriajs/types").ACError.ResourceNotFound, import("@aeriajs/types").ACError.OwnershipError, import("@aeriajs/types").ACError.InsecureOperator, import("@aeriajs/types").ACError.MalformedInput];
|
|
24
|
-
};
|
|
25
|
-
readonly message: {
|
|
26
|
-
readonly type: "string";
|
|
27
|
-
};
|
|
28
|
-
readonly details: {
|
|
29
|
-
readonly type: "object";
|
|
30
|
-
readonly variable: true;
|
|
31
|
-
};
|
|
32
|
-
}>> & {
|
|
24
|
+
readonly error: {
|
|
33
25
|
code: import("@aeriajs/types").ACError.OwnershipError | import("@aeriajs/types").ACError.ResourceNotFound | import("@aeriajs/types").ACError.InsecureOperator | import("@aeriajs/types").ACError.MalformedInput;
|
|
34
26
|
httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest | import("@aeriajs/types").HTTPStatus.Forbidden | import("@aeriajs/types").HTTPStatus.NotFound;
|
|
35
|
-
message
|
|
36
|
-
details
|
|
37
|
-
}
|
|
38
|
-
readonly httpStatus: {
|
|
39
|
-
readonly enum: [import("@aeriajs/types").HTTPStatus.Forbidden, import("@aeriajs/types").HTTPStatus.NotFound, import("@aeriajs/types").HTTPStatus.BadRequest];
|
|
40
|
-
};
|
|
41
|
-
readonly code: {
|
|
42
|
-
readonly enum: [import("@aeriajs/types").ACError.ResourceNotFound, import("@aeriajs/types").ACError.OwnershipError, import("@aeriajs/types").ACError.InsecureOperator, import("@aeriajs/types").ACError.MalformedInput];
|
|
43
|
-
};
|
|
44
|
-
readonly message: {
|
|
45
|
-
readonly type: "string";
|
|
46
|
-
};
|
|
47
|
-
readonly details: {
|
|
48
|
-
readonly type: "object";
|
|
49
|
-
readonly variable: true;
|
|
50
|
-
};
|
|
51
|
-
}>> & {
|
|
52
|
-
code: import("@aeriajs/types").ACError.OwnershipError | import("@aeriajs/types").ACError.ResourceNotFound | import("@aeriajs/types").ACError.InsecureOperator | import("@aeriajs/types").ACError.MalformedInput;
|
|
53
|
-
httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest | import("@aeriajs/types").HTTPStatus.Forbidden | import("@aeriajs/types").HTTPStatus.NotFound;
|
|
54
|
-
message: string;
|
|
55
|
-
details: any;
|
|
56
|
-
}, never>>;
|
|
27
|
+
message?: string | undefined;
|
|
28
|
+
details?: any;
|
|
29
|
+
};
|
|
57
30
|
readonly result: undefined;
|
|
58
31
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Context, RemoveAllPayload } from '@aeriajs/types';
|
|
1
|
+
import type { Context, SchemaWithId, RemoveAllPayload } from '@aeriajs/types';
|
|
2
2
|
import type { description } from './description.js';
|
|
3
|
-
export declare const removeAll: (payload: RemoveAllPayload
|
|
3
|
+
export declare const removeAll: (payload: RemoveAllPayload<SchemaWithId<typeof description>>, context: Context<typeof description>) => Promise<{
|
|
4
4
|
readonly _tag: "Result";
|
|
5
5
|
readonly error: undefined;
|
|
6
6
|
readonly result: import("mongodb").DeleteResult;
|
|
@@ -4,11 +4,7 @@ exports.removeAll = void 0;
|
|
|
4
4
|
const core_1 = require("@aeriajs/core");
|
|
5
5
|
const fs = require("fs/promises");
|
|
6
6
|
const removeAll = async (payload, context) => {
|
|
7
|
-
const files = context.collection.model.find({
|
|
8
|
-
_id: {
|
|
9
|
-
$in: payload.filters,
|
|
10
|
-
},
|
|
11
|
-
}, {
|
|
7
|
+
const files = context.collection.model.find(payload.filters, {
|
|
12
8
|
projection: {
|
|
13
9
|
absolute_path: 1,
|
|
14
10
|
},
|
|
@@ -2,11 +2,7 @@
|
|
|
2
2
|
import { removeAll as originalRemoveAll } from "@aeriajs/core";
|
|
3
3
|
import * as fs from "fs/promises";
|
|
4
4
|
export const removeAll = async (payload, context) => {
|
|
5
|
-
const files = context.collection.model.find({
|
|
6
|
-
_id: {
|
|
7
|
-
$in: payload.filters
|
|
8
|
-
}
|
|
9
|
-
}, {
|
|
5
|
+
const files = context.collection.model.find(payload.filters, {
|
|
10
6
|
projection: {
|
|
11
7
|
absolute_path: 1
|
|
12
8
|
}
|