@aeriajs/builtins 0.0.202 → 0.0.204

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,15 +1,35 @@
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
- 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
- };
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
+ }>;
13
33
  description: {
14
34
  readonly $id: "tempFile";
15
35
  readonly icon: "file";
@@ -46,21 +66,57 @@ export declare const tempFile: Omit<import("@aeriajs/types").Collection<never>,
46
66
  } | undefined;
47
67
  };
48
68
  export declare const file: Omit<import("@aeriajs/types").Collection<never>, "functions" | "description" | "item" | "exposedFunctions" | "security" | "middlewares"> & {
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
- };
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
+ }>;
64
120
  description: {
65
121
  readonly $id: "file";
66
122
  readonly icon: "paperclip";
@@ -113,110 +169,62 @@ export declare const file: Omit<import("@aeriajs/types").Collection<never>, "fun
113
169
  };
114
170
  };
115
171
  functions: {
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
- }>>;
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>>>;
201
173
  insert: (payload: {
202
174
  what: {
203
175
  content: string;
204
176
  } & Pick<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<typeof description>>, "_id" | "name" | "owner" | "absolute_path">;
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
- }>>;
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
+ }>>>;
220
228
  download: (payload: {
221
229
  fileId: string;
222
230
  options: readonly ("picture" | "download")[];
@@ -233,12 +241,7 @@ export declare const file: Omit<import("@aeriajs/types").Collection<never>, "fun
233
241
  remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<typeof description>>, context: import("@aeriajs/types").Context<typeof description>) => Promise<{
234
242
  readonly _tag: "Result";
235
243
  readonly error: undefined;
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;
244
+ readonly result: import("mongodb").WithId<Omit<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<import("@aeriajs/types").Description>>, "_id">> | null;
242
245
  } | import("@aeriajs/types").Result.Error<{
243
246
  readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
244
247
  } & {
@@ -249,12 +252,45 @@ export declare const file: Omit<import("@aeriajs/types").Collection<never>, "fun
249
252
  httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
250
253
  }> | {
251
254
  readonly _tag: "Error";
252
- readonly 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
+ }>> & {
253
270
  code: import("@aeriajs/types").ACError.OwnershipError | import("@aeriajs/types").ACError.ResourceNotFound | import("@aeriajs/types").ACError.InsecureOperator | import("@aeriajs/types").ACError.MalformedInput;
254
271
  httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest | import("@aeriajs/types").HTTPStatus.Forbidden | import("@aeriajs/types").HTTPStatus.NotFound;
255
- message?: string | undefined;
256
- details?: any;
257
- };
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>>;
258
294
  readonly result: undefined;
259
295
  }>;
260
296
  removeAll: (payload: import("@aeriajs/types").RemoveAllPayload<import("@aeriajs/types").SchemaWithId<typeof description>>, context: import("@aeriajs/types").Context<typeof description>) => Promise<{
@@ -4,18 +4,54 @@ 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
- 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
- }>>;
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
+ }>>>;
@@ -1,16 +1,10 @@
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';
5
4
  export declare const remove: (payload: RemovePayload<SchemaWithId<typeof description>>, context: Context<typeof description>) => Promise<{
6
5
  readonly _tag: "Result";
7
6
  readonly error: undefined;
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;
7
+ readonly result: import("mongodb").WithId<Omit<import("@aeriajs/types").PackReferences<SchemaWithId<import("@aeriajs/types").Description>>, "_id">> | null;
14
8
  } | Result.Error<{
15
9
  readonly code: import("@aeriajs/types").ACError.ResourceNotFound;
16
10
  } & {
@@ -21,11 +15,44 @@ export declare const remove: (payload: RemovePayload<SchemaWithId<typeof descrip
21
15
  httpStatus: import("@aeriajs/types").HTTPStatus.Forbidden;
22
16
  }> | {
23
17
  readonly _tag: "Error";
24
- readonly 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
+ }>> & {
25
33
  code: import("@aeriajs/types").ACError.OwnershipError | import("@aeriajs/types").ACError.ResourceNotFound | import("@aeriajs/types").ACError.InsecureOperator | import("@aeriajs/types").ACError.MalformedInput;
26
34
  httpStatus: import("@aeriajs/types").HTTPStatus.BadRequest | import("@aeriajs/types").HTTPStatus.Forbidden | import("@aeriajs/types").HTTPStatus.NotFound;
27
- message?: string | undefined;
28
- details?: any;
29
- };
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>>;
30
57
  readonly result: undefined;
31
58
  }>;