@aeriajs/builtins 0.0.201 → 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.
@@ -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: import("@aeriajs/types").SchemaWithId<{
4
- readonly $id: "tempFile";
5
- readonly icon: "file";
6
- readonly hidden: true;
7
- readonly temporary: {
8
- readonly index: "created_at";
9
- readonly expireAfterSeconds: 3600;
10
- };
11
- readonly properties: {
12
- readonly created_at: {
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: import("@aeriajs/types").SchemaWithId<{
70
- readonly $id: "file";
71
- readonly icon: "paperclip";
72
- readonly owned: "always";
73
- readonly presets: readonly ["owned"];
74
- readonly indexes: readonly ["name", "link", "type", "size"];
75
- readonly properties: {
76
- readonly type: {
77
- readonly type: "string";
78
- };
79
- readonly size: {
80
- readonly type: "number";
81
- };
82
- readonly last_modified: {
83
- readonly type: "string";
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<import("@aeriajs/types").SchemaWithId<any>>, context: import("@aeriajs/types").StrictContext<any>, options?: import("@aeriajs/core").GetOptions) => Promise<import("@aeriajs/types").GetReturnType<import("@aeriajs/types").SchemaWithId<any>>>;
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<import("@aeriajs/types").SchemaWithId<{
178
- readonly $id: "file";
179
- readonly icon: "paperclip";
180
- readonly owned: "always";
181
- readonly presets: readonly ["owned"];
182
- readonly indexes: readonly ["name", "link", "type", "size"];
183
- readonly properties: {
184
- readonly type: {
185
- readonly type: "string";
186
- };
187
- readonly size: {
188
- readonly type: "number";
189
- };
190
- readonly last_modified: {
191
- readonly type: "string";
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<import("@aeriajs/types").SchemaWithId<import("@aeriajs/types").Description>>, "_id">> | null;
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,45 +249,12 @@ 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: Pick<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
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 additionalProperties: 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: string;
273
- details: any;
274
- }, never>, "code" | "httpStatus"> & Partial<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
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 additionalProperties: 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
260
  removeAll: (payload: import("@aeriajs/types").RemoveAllPayload<import("@aeriajs/types").SchemaWithId<typeof description>>, context: import("@aeriajs/types").Context<typeof description>) => Promise<{
@@ -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<SchemaWithId<{
8
- readonly $id: "file";
9
- readonly icon: "paperclip";
10
- readonly owned: "always";
11
- readonly presets: readonly ["owned"];
12
- readonly indexes: readonly ["name", "link", "type", "size"];
13
- readonly properties: {
14
- readonly type: {
15
- readonly type: "string";
16
- };
17
- readonly size: {
18
- readonly type: "number";
19
- };
20
- readonly last_modified: {
21
- readonly type: "string";
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<SchemaWithId<import("@aeriajs/types").Description>>, "_id">> | null;
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: Pick<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
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 additionalProperties: 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: string;
36
- details: any;
37
- }, never>, "code" | "httpStatus"> & Partial<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
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 additionalProperties: 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
  }>;