@aeriajs/builtins 0.0.255 → 0.0.257
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/download.d.ts +56 -16
- package/dist/collections/file/download.js +40 -1
- package/dist/collections/file/download.mjs +40 -1
- package/dist/collections/file/index.d.ts +461 -20
- package/dist/collections/file/index.js +3 -0
- package/dist/collections/file/index.mjs +4 -1
- package/dist/collections/file/remove.d.ts +2 -2
- package/dist/collections/user/activate.d.ts +67 -33
- package/dist/collections/user/activate.js +45 -1
- package/dist/collections/user/activate.mjs +45 -1
- package/dist/collections/user/authenticate.d.ts +136 -41
- package/dist/collections/user/authenticate.js +98 -2
- package/dist/collections/user/authenticate.mjs +98 -2
- package/dist/collections/user/createAccount.d.ts +124 -111
- package/dist/collections/user/createAccount.js +27 -1
- package/dist/collections/user/createAccount.mjs +27 -1
- package/dist/collections/user/editProfile.d.ts +95 -103
- package/dist/collections/user/editProfile.js +21 -1
- package/dist/collections/user/editProfile.mjs +21 -1
- package/dist/collections/user/getActivationLink.d.ts +92 -60
- package/dist/collections/user/getActivationLink.js +39 -4
- package/dist/collections/user/getActivationLink.mjs +39 -3
- package/dist/collections/user/getCurrentUser.d.ts +43 -113
- package/dist/collections/user/getCurrentUser.js +31 -1
- package/dist/collections/user/getCurrentUser.mjs +31 -1
- package/dist/collections/user/getInfo.d.ts +71 -26
- package/dist/collections/user/getInfo.js +47 -1
- package/dist/collections/user/getInfo.mjs +47 -1
- package/dist/collections/user/getRedefinePasswordLink.d.ts +91 -55
- package/dist/collections/user/getRedefinePasswordLink.js +32 -2
- package/dist/collections/user/getRedefinePasswordLink.mjs +33 -3
- package/dist/collections/user/index.d.ts +3480 -630
- package/dist/collections/user/index.js +9 -21
- package/dist/collections/user/index.mjs +18 -30
- package/dist/collections/user/redefinePassword.d.ts +93 -34
- package/dist/collections/user/redefinePassword.js +46 -6
- package/dist/collections/user/redefinePassword.mjs +46 -6
- package/dist/functions/describe.d.ts +38 -12
- package/dist/index.d.ts +4397 -1106
- package/package.json +7 -7
|
@@ -65,7 +65,328 @@ export declare const tempFile: Omit<import("@aeriajs/types").Collection<never>,
|
|
|
65
65
|
[x: string]: import("@aeriajs/types").Contract | undefined;
|
|
66
66
|
} | undefined;
|
|
67
67
|
};
|
|
68
|
-
export declare const file:
|
|
68
|
+
export declare const file: {
|
|
69
|
+
description: {
|
|
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
|
+
};
|
|
120
|
+
functions: {
|
|
121
|
+
get: <TContext extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<TContext["description"]>>, context: TContext, options?: import("@aeriajs/core").GetOptions) => Promise<import("@aeriajs/types").GetReturnType<import("@aeriajs/types").SchemaWithId<TContext["description"]>>>;
|
|
122
|
+
insert: (payload: {
|
|
123
|
+
what: {
|
|
124
|
+
content: string;
|
|
125
|
+
} & Pick<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<typeof description>>, "_id" | "name" | "owner" | "absolute_path">;
|
|
126
|
+
}, context: import("@aeriajs/types").Context<typeof description>) => Promise<import("@aeriajs/types").InsertReturnType<import("@aeriajs/types").SchemaWithId<{
|
|
127
|
+
readonly $id: "file";
|
|
128
|
+
readonly icon: "paperclip";
|
|
129
|
+
readonly owned: "always";
|
|
130
|
+
readonly presets: readonly ["owned"];
|
|
131
|
+
readonly indexes: readonly ["name", "link", "type", "size"];
|
|
132
|
+
readonly properties: {
|
|
133
|
+
readonly type: {
|
|
134
|
+
readonly type: "string";
|
|
135
|
+
};
|
|
136
|
+
readonly size: {
|
|
137
|
+
readonly type: "number";
|
|
138
|
+
};
|
|
139
|
+
readonly last_modified: {
|
|
140
|
+
readonly type: "string";
|
|
141
|
+
readonly format: "date-time";
|
|
142
|
+
};
|
|
143
|
+
readonly name: {
|
|
144
|
+
readonly type: "string";
|
|
145
|
+
};
|
|
146
|
+
readonly absolute_path: {
|
|
147
|
+
readonly type: "string";
|
|
148
|
+
};
|
|
149
|
+
readonly relative_path: {
|
|
150
|
+
readonly type: "string";
|
|
151
|
+
};
|
|
152
|
+
readonly immutable: {
|
|
153
|
+
readonly type: "boolean";
|
|
154
|
+
};
|
|
155
|
+
readonly link: {
|
|
156
|
+
readonly getter: (doc: object) => Promise<string | undefined>;
|
|
157
|
+
};
|
|
158
|
+
readonly download_link: {
|
|
159
|
+
readonly getter: (doc: object) => Promise<string | undefined>;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
readonly actions: {
|
|
163
|
+
readonly deleteAll: {
|
|
164
|
+
readonly label: "Remover";
|
|
165
|
+
readonly ask: true;
|
|
166
|
+
readonly selection: true;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
readonly individualActions: {
|
|
170
|
+
readonly remove: {
|
|
171
|
+
readonly label: "Remover";
|
|
172
|
+
readonly icon: "trash";
|
|
173
|
+
readonly ask: true;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
}>>>;
|
|
177
|
+
download: (payload: Pick<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
178
|
+
readonly fileId: {
|
|
179
|
+
readonly type: "string";
|
|
180
|
+
};
|
|
181
|
+
readonly options: {
|
|
182
|
+
readonly type: "array";
|
|
183
|
+
readonly items: {
|
|
184
|
+
readonly enum: readonly ["picture", "download"];
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
readonly noHeaders: {
|
|
188
|
+
readonly type: "boolean";
|
|
189
|
+
};
|
|
190
|
+
}>> & {
|
|
191
|
+
fileId: string;
|
|
192
|
+
options: ("download" | "picture")[];
|
|
193
|
+
noHeaders: boolean;
|
|
194
|
+
}, never>, "fileId"> & Partial<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
195
|
+
readonly fileId: {
|
|
196
|
+
readonly type: "string";
|
|
197
|
+
};
|
|
198
|
+
readonly options: {
|
|
199
|
+
readonly type: "array";
|
|
200
|
+
readonly items: {
|
|
201
|
+
readonly enum: readonly ["picture", "download"];
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
readonly noHeaders: {
|
|
205
|
+
readonly type: "boolean";
|
|
206
|
+
};
|
|
207
|
+
}>> & {
|
|
208
|
+
fileId: string;
|
|
209
|
+
options: ("download" | "picture")[];
|
|
210
|
+
noHeaders: boolean;
|
|
211
|
+
}, never>>, context: import("@aeriajs/types").Context<{
|
|
212
|
+
readonly $id: "file";
|
|
213
|
+
readonly icon: "paperclip";
|
|
214
|
+
readonly owned: "always";
|
|
215
|
+
readonly presets: readonly ["owned"];
|
|
216
|
+
readonly indexes: readonly ["name", "link", "type", "size"];
|
|
217
|
+
readonly properties: {
|
|
218
|
+
readonly type: {
|
|
219
|
+
readonly type: "string";
|
|
220
|
+
};
|
|
221
|
+
readonly size: {
|
|
222
|
+
readonly type: "number";
|
|
223
|
+
};
|
|
224
|
+
readonly last_modified: {
|
|
225
|
+
readonly type: "string";
|
|
226
|
+
readonly format: "date-time";
|
|
227
|
+
};
|
|
228
|
+
readonly name: {
|
|
229
|
+
readonly type: "string";
|
|
230
|
+
};
|
|
231
|
+
readonly absolute_path: {
|
|
232
|
+
readonly type: "string";
|
|
233
|
+
};
|
|
234
|
+
readonly relative_path: {
|
|
235
|
+
readonly type: "string";
|
|
236
|
+
};
|
|
237
|
+
readonly immutable: {
|
|
238
|
+
readonly type: "boolean";
|
|
239
|
+
};
|
|
240
|
+
readonly link: {
|
|
241
|
+
readonly getter: (doc: object) => Promise<string | undefined>;
|
|
242
|
+
};
|
|
243
|
+
readonly download_link: {
|
|
244
|
+
readonly getter: (doc: object) => Promise<string | undefined>;
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
readonly actions: {
|
|
248
|
+
readonly deleteAll: {
|
|
249
|
+
readonly label: "Remover";
|
|
250
|
+
readonly ask: true;
|
|
251
|
+
readonly selection: true;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
readonly individualActions: {
|
|
255
|
+
readonly remove: {
|
|
256
|
+
readonly label: "Remover";
|
|
257
|
+
readonly icon: "trash";
|
|
258
|
+
readonly ask: true;
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
}>) => any;
|
|
262
|
+
remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<typeof description>>, context: import("@aeriajs/types").Context<typeof description>) => Promise<{
|
|
263
|
+
readonly _tag: "Result";
|
|
264
|
+
readonly error: undefined;
|
|
265
|
+
readonly result: import("mongodb").WithId<Omit<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<import("@aeriajs/types").Description>>, "_id">> | null;
|
|
266
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
267
|
+
readonly code: "RESOURCE_NOT_FOUND";
|
|
268
|
+
} & {
|
|
269
|
+
httpStatus: 404;
|
|
270
|
+
}> | import("@aeriajs/types").Result.Error<{
|
|
271
|
+
readonly code: "OWNERSHIP_ERROR";
|
|
272
|
+
} & {
|
|
273
|
+
httpStatus: 403;
|
|
274
|
+
}> | {
|
|
275
|
+
readonly _tag: "Error";
|
|
276
|
+
readonly error: Pick<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
277
|
+
readonly httpStatus: {
|
|
278
|
+
readonly enum: [403, 404, 400];
|
|
279
|
+
};
|
|
280
|
+
readonly code: {
|
|
281
|
+
readonly enum: ["RESOURCE_NOT_FOUND", "OWNERSHIP_ERROR", "INSECURE_OPERATOR", "MALFORMED_INPUT"];
|
|
282
|
+
};
|
|
283
|
+
readonly message: {
|
|
284
|
+
readonly type: "string";
|
|
285
|
+
};
|
|
286
|
+
readonly details: {
|
|
287
|
+
readonly type: "object";
|
|
288
|
+
readonly additionalProperties: true;
|
|
289
|
+
};
|
|
290
|
+
}>> & {
|
|
291
|
+
code: "RESOURCE_NOT_FOUND" | "INSECURE_OPERATOR" | "OWNERSHIP_ERROR" | "MALFORMED_INPUT";
|
|
292
|
+
httpStatus: 400 | 403 | 404;
|
|
293
|
+
message: string;
|
|
294
|
+
details: any;
|
|
295
|
+
}, never>, "code" | "httpStatus"> & Partial<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
296
|
+
readonly httpStatus: {
|
|
297
|
+
readonly enum: [403, 404, 400];
|
|
298
|
+
};
|
|
299
|
+
readonly code: {
|
|
300
|
+
readonly enum: ["RESOURCE_NOT_FOUND", "OWNERSHIP_ERROR", "INSECURE_OPERATOR", "MALFORMED_INPUT"];
|
|
301
|
+
};
|
|
302
|
+
readonly message: {
|
|
303
|
+
readonly type: "string";
|
|
304
|
+
};
|
|
305
|
+
readonly details: {
|
|
306
|
+
readonly type: "object";
|
|
307
|
+
readonly additionalProperties: true;
|
|
308
|
+
};
|
|
309
|
+
}>> & {
|
|
310
|
+
code: "RESOURCE_NOT_FOUND" | "INSECURE_OPERATOR" | "OWNERSHIP_ERROR" | "MALFORMED_INPUT";
|
|
311
|
+
httpStatus: 400 | 403 | 404;
|
|
312
|
+
message: string;
|
|
313
|
+
details: any;
|
|
314
|
+
}, never>>;
|
|
315
|
+
readonly result: undefined;
|
|
316
|
+
}>;
|
|
317
|
+
removeAll: (payload: import("@aeriajs/types").RemoveAllPayload, context: import("@aeriajs/types").Context<typeof description>) => Promise<{
|
|
318
|
+
readonly _tag: "Result";
|
|
319
|
+
readonly error: undefined;
|
|
320
|
+
readonly result: import("mongodb").DeleteResult;
|
|
321
|
+
} | import("@aeriajs/types").Result.Error<{
|
|
322
|
+
readonly code: "OWNERSHIP_ERROR";
|
|
323
|
+
} & {
|
|
324
|
+
httpStatus: 403;
|
|
325
|
+
}>>;
|
|
326
|
+
};
|
|
327
|
+
exposedFunctions: {
|
|
328
|
+
get: "unauthenticated";
|
|
329
|
+
insert: true;
|
|
330
|
+
download: "unauthenticated";
|
|
331
|
+
remove: true;
|
|
332
|
+
removeAll: true;
|
|
333
|
+
};
|
|
334
|
+
contracts: {
|
|
335
|
+
readonly download: {
|
|
336
|
+
readonly payload: {
|
|
337
|
+
readonly type: "object";
|
|
338
|
+
readonly required: readonly ["fileId"];
|
|
339
|
+
readonly properties: {
|
|
340
|
+
readonly fileId: {
|
|
341
|
+
readonly type: "string";
|
|
342
|
+
};
|
|
343
|
+
readonly options: {
|
|
344
|
+
readonly type: "array";
|
|
345
|
+
readonly items: {
|
|
346
|
+
readonly enum: readonly ["picture", "download"];
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
readonly noHeaders: {
|
|
350
|
+
readonly type: "boolean";
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
readonly response: [{
|
|
355
|
+
readonly type: "object";
|
|
356
|
+
readonly properties: {
|
|
357
|
+
readonly _tag: {
|
|
358
|
+
readonly const: "Error";
|
|
359
|
+
};
|
|
360
|
+
readonly result: {
|
|
361
|
+
readonly const: undefined;
|
|
362
|
+
};
|
|
363
|
+
readonly error: {
|
|
364
|
+
readonly type: "object";
|
|
365
|
+
readonly required: readonly ["httpStatus", "code"];
|
|
366
|
+
readonly properties: {
|
|
367
|
+
readonly httpStatus: {
|
|
368
|
+
readonly enum: [404, 416];
|
|
369
|
+
};
|
|
370
|
+
readonly code: {
|
|
371
|
+
readonly enum: ["RESOURCE_NOT_FOUND", "RANGE_NOT_SATISFIABLE"];
|
|
372
|
+
};
|
|
373
|
+
readonly message: {
|
|
374
|
+
readonly type: "string";
|
|
375
|
+
};
|
|
376
|
+
readonly details: {
|
|
377
|
+
readonly type: "object";
|
|
378
|
+
readonly additionalProperties: true;
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
};
|
|
383
|
+
}, {
|
|
384
|
+
readonly type: "object";
|
|
385
|
+
readonly additionalProperties: true;
|
|
386
|
+
}];
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
} & {
|
|
69
390
|
item: import("@aeriajs/types").SchemaWithId<{
|
|
70
391
|
readonly $id: "file";
|
|
71
392
|
readonly icon: "paperclip";
|
|
@@ -225,19 +546,91 @@ export declare const file: Omit<import("@aeriajs/types").Collection<never>, "fun
|
|
|
225
546
|
};
|
|
226
547
|
};
|
|
227
548
|
}>>>;
|
|
228
|
-
download: (payload: {
|
|
549
|
+
download: (payload: Pick<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
550
|
+
readonly fileId: {
|
|
551
|
+
readonly type: "string";
|
|
552
|
+
};
|
|
553
|
+
readonly options: {
|
|
554
|
+
readonly type: "array";
|
|
555
|
+
readonly items: {
|
|
556
|
+
readonly enum: readonly ["picture", "download"];
|
|
557
|
+
};
|
|
558
|
+
};
|
|
559
|
+
readonly noHeaders: {
|
|
560
|
+
readonly type: "boolean";
|
|
561
|
+
};
|
|
562
|
+
}>> & {
|
|
229
563
|
fileId: string;
|
|
230
|
-
options:
|
|
231
|
-
noHeaders
|
|
232
|
-
},
|
|
233
|
-
readonly
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
564
|
+
options: ("download" | "picture")[];
|
|
565
|
+
noHeaders: boolean;
|
|
566
|
+
}, never>, "fileId"> & Partial<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
567
|
+
readonly fileId: {
|
|
568
|
+
readonly type: "string";
|
|
569
|
+
};
|
|
570
|
+
readonly options: {
|
|
571
|
+
readonly type: "array";
|
|
572
|
+
readonly items: {
|
|
573
|
+
readonly enum: readonly ["picture", "download"];
|
|
574
|
+
};
|
|
575
|
+
};
|
|
576
|
+
readonly noHeaders: {
|
|
577
|
+
readonly type: "boolean";
|
|
578
|
+
};
|
|
579
|
+
}>> & {
|
|
580
|
+
fileId: string;
|
|
581
|
+
options: ("download" | "picture")[];
|
|
582
|
+
noHeaders: boolean;
|
|
583
|
+
}, never>>, context: import("@aeriajs/types").Context<{
|
|
584
|
+
readonly $id: "file";
|
|
585
|
+
readonly icon: "paperclip";
|
|
586
|
+
readonly owned: "always";
|
|
587
|
+
readonly presets: readonly ["owned"];
|
|
588
|
+
readonly indexes: readonly ["name", "link", "type", "size"];
|
|
589
|
+
readonly properties: {
|
|
590
|
+
readonly type: {
|
|
591
|
+
readonly type: "string";
|
|
592
|
+
};
|
|
593
|
+
readonly size: {
|
|
594
|
+
readonly type: "number";
|
|
595
|
+
};
|
|
596
|
+
readonly last_modified: {
|
|
597
|
+
readonly type: "string";
|
|
598
|
+
readonly format: "date-time";
|
|
599
|
+
};
|
|
600
|
+
readonly name: {
|
|
601
|
+
readonly type: "string";
|
|
602
|
+
};
|
|
603
|
+
readonly absolute_path: {
|
|
604
|
+
readonly type: "string";
|
|
605
|
+
};
|
|
606
|
+
readonly relative_path: {
|
|
607
|
+
readonly type: "string";
|
|
608
|
+
};
|
|
609
|
+
readonly immutable: {
|
|
610
|
+
readonly type: "boolean";
|
|
611
|
+
};
|
|
612
|
+
readonly link: {
|
|
613
|
+
readonly getter: (doc: object) => Promise<string | undefined>;
|
|
614
|
+
};
|
|
615
|
+
readonly download_link: {
|
|
616
|
+
readonly getter: (doc: object) => Promise<string | undefined>;
|
|
617
|
+
};
|
|
618
|
+
};
|
|
619
|
+
readonly actions: {
|
|
620
|
+
readonly deleteAll: {
|
|
621
|
+
readonly label: "Remover";
|
|
622
|
+
readonly ask: true;
|
|
623
|
+
readonly selection: true;
|
|
624
|
+
};
|
|
625
|
+
};
|
|
626
|
+
readonly individualActions: {
|
|
627
|
+
readonly remove: {
|
|
628
|
+
readonly label: "Remover";
|
|
629
|
+
readonly icon: "trash";
|
|
630
|
+
readonly ask: true;
|
|
631
|
+
};
|
|
632
|
+
};
|
|
633
|
+
}>) => any;
|
|
241
634
|
remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<typeof description>>, context: import("@aeriajs/types").Context<typeof description>) => Promise<{
|
|
242
635
|
readonly _tag: "Result";
|
|
243
636
|
readonly error: undefined;
|
|
@@ -268,7 +661,7 @@ export declare const file: Omit<import("@aeriajs/types").Collection<never>, "fun
|
|
|
268
661
|
};
|
|
269
662
|
}>> & {
|
|
270
663
|
code: "RESOURCE_NOT_FOUND" | "INSECURE_OPERATOR" | "OWNERSHIP_ERROR" | "MALFORMED_INPUT";
|
|
271
|
-
httpStatus:
|
|
664
|
+
httpStatus: 400 | 403 | 404;
|
|
272
665
|
message: string;
|
|
273
666
|
details: any;
|
|
274
667
|
}, never>, "code" | "httpStatus"> & Partial<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
@@ -287,7 +680,7 @@ export declare const file: Omit<import("@aeriajs/types").Collection<never>, "fun
|
|
|
287
680
|
};
|
|
288
681
|
}>> & {
|
|
289
682
|
code: "RESOURCE_NOT_FOUND" | "INSECURE_OPERATOR" | "OWNERSHIP_ERROR" | "MALFORMED_INPUT";
|
|
290
|
-
httpStatus:
|
|
683
|
+
httpStatus: 400 | 403 | 404;
|
|
291
684
|
message: string;
|
|
292
685
|
details: any;
|
|
293
686
|
}, never>>;
|
|
@@ -304,10 +697,58 @@ export declare const file: Omit<import("@aeriajs/types").Collection<never>, "fun
|
|
|
304
697
|
}>>;
|
|
305
698
|
};
|
|
306
699
|
contracts: {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
700
|
+
readonly download: {
|
|
701
|
+
readonly payload: {
|
|
702
|
+
readonly type: "object";
|
|
703
|
+
readonly required: readonly ["fileId"];
|
|
704
|
+
readonly properties: {
|
|
705
|
+
readonly fileId: {
|
|
706
|
+
readonly type: "string";
|
|
707
|
+
};
|
|
708
|
+
readonly options: {
|
|
709
|
+
readonly type: "array";
|
|
710
|
+
readonly items: {
|
|
711
|
+
readonly enum: readonly ["picture", "download"];
|
|
712
|
+
};
|
|
713
|
+
};
|
|
714
|
+
readonly noHeaders: {
|
|
715
|
+
readonly type: "boolean";
|
|
716
|
+
};
|
|
717
|
+
};
|
|
718
|
+
};
|
|
719
|
+
readonly response: [{
|
|
720
|
+
readonly type: "object";
|
|
721
|
+
readonly properties: {
|
|
722
|
+
readonly _tag: {
|
|
723
|
+
readonly const: "Error";
|
|
724
|
+
};
|
|
725
|
+
readonly result: {
|
|
726
|
+
readonly const: undefined;
|
|
727
|
+
};
|
|
728
|
+
readonly error: {
|
|
729
|
+
readonly type: "object";
|
|
730
|
+
readonly required: readonly ["httpStatus", "code"];
|
|
731
|
+
readonly properties: {
|
|
732
|
+
readonly httpStatus: {
|
|
733
|
+
readonly enum: [404, 416];
|
|
734
|
+
};
|
|
735
|
+
readonly code: {
|
|
736
|
+
readonly enum: ["RESOURCE_NOT_FOUND", "RANGE_NOT_SATISFIABLE"];
|
|
737
|
+
};
|
|
738
|
+
readonly message: {
|
|
739
|
+
readonly type: "string";
|
|
740
|
+
};
|
|
741
|
+
readonly details: {
|
|
742
|
+
readonly type: "object";
|
|
743
|
+
readonly additionalProperties: true;
|
|
744
|
+
};
|
|
745
|
+
};
|
|
746
|
+
};
|
|
747
|
+
};
|
|
748
|
+
}, {
|
|
749
|
+
readonly type: "object";
|
|
750
|
+
readonly additionalProperties: true;
|
|
751
|
+
}];
|
|
752
|
+
};
|
|
312
753
|
};
|
|
313
754
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { defineCollection, get } from "@aeriajs/core";
|
|
3
3
|
import { description } from "./description.mjs";
|
|
4
4
|
import { insert } from "./insert.mjs";
|
|
5
|
-
import { download } from "./download.mjs";
|
|
5
|
+
import { download, downloadContract } from "./download.mjs";
|
|
6
6
|
import { remove } from "./remove.mjs";
|
|
7
7
|
import { removeAll } from "./removeAll.mjs";
|
|
8
8
|
export const tempFile = defineCollection({
|
|
@@ -52,5 +52,8 @@ export const file = defineCollection({
|
|
|
52
52
|
download: "unauthenticated",
|
|
53
53
|
remove: true,
|
|
54
54
|
removeAll: true
|
|
55
|
+
},
|
|
56
|
+
contracts: {
|
|
57
|
+
download: downloadContract
|
|
55
58
|
}
|
|
56
59
|
});
|
|
@@ -31,7 +31,7 @@ export declare const remove: (payload: RemovePayload<SchemaWithId<typeof descrip
|
|
|
31
31
|
};
|
|
32
32
|
}>> & {
|
|
33
33
|
code: "RESOURCE_NOT_FOUND" | "INSECURE_OPERATOR" | "OWNERSHIP_ERROR" | "MALFORMED_INPUT";
|
|
34
|
-
httpStatus:
|
|
34
|
+
httpStatus: 400 | 403 | 404;
|
|
35
35
|
message: string;
|
|
36
36
|
details: any;
|
|
37
37
|
}, never>, "code" | "httpStatus"> & Partial<{} & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
|
|
@@ -50,7 +50,7 @@ export declare const remove: (payload: RemovePayload<SchemaWithId<typeof descrip
|
|
|
50
50
|
};
|
|
51
51
|
}>> & {
|
|
52
52
|
code: "RESOURCE_NOT_FOUND" | "INSECURE_OPERATOR" | "OWNERSHIP_ERROR" | "MALFORMED_INPUT";
|
|
53
|
-
httpStatus:
|
|
53
|
+
httpStatus: 400 | 403 | 404;
|
|
54
54
|
message: string;
|
|
55
55
|
details: any;
|
|
56
56
|
}, never>>;
|
|
@@ -1,41 +1,75 @@
|
|
|
1
|
-
import type { Context } from '@aeriajs/types';
|
|
1
|
+
import type { Context, ContractToFunction } from '@aeriajs/types';
|
|
2
2
|
import type { description } from './description.js';
|
|
3
|
-
import { ObjectId } from '@aeriajs/core';
|
|
4
|
-
import { Result } from '@aeriajs/types';
|
|
5
3
|
export declare const ActivationError: {
|
|
6
4
|
readonly UserNotFound: "USER_NOT_FOUND";
|
|
7
5
|
readonly AlreadyActiveUser: "ALREADY_ACTIVE_USER";
|
|
8
6
|
readonly InvalidLink: "INVALID_LINK";
|
|
9
7
|
readonly InvalidToken: "INVALID_TOKEN";
|
|
10
8
|
};
|
|
11
|
-
export declare const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
httpStatus: 403;
|
|
27
|
-
}> | Result.Error<{
|
|
28
|
-
readonly code: "INVALID_TOKEN";
|
|
29
|
-
} & {
|
|
30
|
-
httpStatus: 401;
|
|
31
|
-
}> | Result.Error<{
|
|
32
|
-
readonly code: "MALFORMED_INPUT";
|
|
33
|
-
} & {
|
|
34
|
-
httpStatus: 422;
|
|
35
|
-
}> | {
|
|
36
|
-
readonly _tag: "Result";
|
|
37
|
-
readonly error: undefined;
|
|
38
|
-
readonly result: {
|
|
39
|
-
readonly userId: ObjectId;
|
|
9
|
+
export declare const activateContract: {
|
|
10
|
+
readonly payload: {
|
|
11
|
+
readonly type: "object";
|
|
12
|
+
readonly required: readonly [];
|
|
13
|
+
readonly properties: {
|
|
14
|
+
readonly password: {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
};
|
|
17
|
+
readonly userId: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
};
|
|
20
|
+
readonly token: {
|
|
21
|
+
readonly type: "string";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
40
24
|
};
|
|
41
|
-
|
|
25
|
+
readonly response: [{
|
|
26
|
+
readonly type: "object";
|
|
27
|
+
readonly properties: {
|
|
28
|
+
readonly _tag: {
|
|
29
|
+
readonly const: "Error";
|
|
30
|
+
};
|
|
31
|
+
readonly result: {
|
|
32
|
+
readonly const: undefined;
|
|
33
|
+
};
|
|
34
|
+
readonly error: {
|
|
35
|
+
readonly type: "object";
|
|
36
|
+
readonly required: readonly ["httpStatus", "code"];
|
|
37
|
+
readonly properties: {
|
|
38
|
+
readonly httpStatus: {
|
|
39
|
+
readonly enum: [404, 403, 401, 422];
|
|
40
|
+
};
|
|
41
|
+
readonly code: {
|
|
42
|
+
readonly enum: ["RESOURCE_NOT_FOUND", "MALFORMED_INPUT", "ALREADY_ACTIVE_USER", "INVALID_LINK", "INVALID_TOKEN", "USER_NOT_FOUND"];
|
|
43
|
+
};
|
|
44
|
+
readonly message: {
|
|
45
|
+
readonly type: "string";
|
|
46
|
+
};
|
|
47
|
+
readonly details: {
|
|
48
|
+
readonly type: "object";
|
|
49
|
+
readonly additionalProperties: true;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
}, {
|
|
55
|
+
readonly type: "object";
|
|
56
|
+
readonly properties: {
|
|
57
|
+
readonly _tag: {
|
|
58
|
+
readonly const: "Result";
|
|
59
|
+
};
|
|
60
|
+
readonly error: {
|
|
61
|
+
readonly const: undefined;
|
|
62
|
+
};
|
|
63
|
+
readonly result: {
|
|
64
|
+
readonly type: "object";
|
|
65
|
+
readonly properties: {
|
|
66
|
+
readonly userId: {
|
|
67
|
+
readonly type: "string";
|
|
68
|
+
readonly format: "objectid";
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
}];
|
|
74
|
+
};
|
|
75
|
+
export declare const activate: ContractToFunction<typeof activateContract, Context<typeof description>>;
|