@aeriajs/builtins 0.0.14 → 0.0.16

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,4 +1,4 @@
1
- export declare const user: {
1
+ export declare const user: Omit<import("@aeriajs/types").Collection<{
2
2
  description: {
3
3
  readonly $id: "user";
4
4
  readonly required: readonly ["name", "roles", "email"];
@@ -99,7 +99,120 @@ export declare const user: {
99
99
  };
100
100
  };
101
101
  functions: {
102
- readonly get: (payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<{
102
+ readonly get: <TContext extends import("@aeriajs/types").Context, TDocument = import("@aeriajs/types").SchemaWithId<TContext["description"]>>(payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<TContext["description"]>>, context: TContext extends import("@aeriajs/types").Context<any> ? TContext : never, options?: import("@aeriajs/api").GetOptions | undefined) => Promise<TDocument | null>;
103
+ readonly getAll: <TContext_1 extends import("@aeriajs/types").Context, TDocument_1 = import("@aeriajs/types").SchemaWithId<TContext_1["description"]>>(_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: TContext_1, options?: import("@aeriajs/api").GetAllOptions | undefined) => Promise<TDocument_1[]>;
104
+ readonly remove: <TContext_2 extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<TContext_2["description"]>>, context: TContext_2) => Promise<any>;
105
+ readonly upload: <TContext_3 extends import("@aeriajs/types").Context>(_props: unknown, context: TContext_3) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError> | {
106
+ tempId: any;
107
+ }>;
108
+ readonly removeFile: <TContext_4 extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").RemoveFilePayload, context: TContext_4) => Promise<any>;
109
+ readonly insert: (payload: {
110
+ what: Omit<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<{
111
+ readonly $id: "user";
112
+ readonly required: readonly ["name", "roles", "email"];
113
+ readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
114
+ readonly indexes: readonly ["name"];
115
+ readonly freshItem: {
116
+ readonly active: true;
117
+ };
118
+ readonly properties: {
119
+ readonly name: {
120
+ readonly type: "string";
121
+ };
122
+ readonly given_name: {
123
+ readonly getter: (document: any) => string;
124
+ };
125
+ readonly family_name: {
126
+ readonly getter: (document: any) => string;
127
+ };
128
+ readonly active: {
129
+ readonly type: "boolean";
130
+ };
131
+ readonly roles: {
132
+ readonly type: "array";
133
+ readonly items: {
134
+ readonly type: "string";
135
+ };
136
+ readonly uniqueItems: true;
137
+ };
138
+ readonly email: {
139
+ readonly type: "string";
140
+ readonly inputType: "email";
141
+ readonly unique: true;
142
+ };
143
+ readonly password: {
144
+ readonly type: "string";
145
+ readonly inputType: "password";
146
+ readonly hidden: true;
147
+ };
148
+ readonly phone_number: {
149
+ readonly type: "string";
150
+ readonly mask: "(##) #####-####";
151
+ };
152
+ readonly picture_file: {
153
+ readonly $ref: "file";
154
+ readonly accept: readonly ["image/*"];
155
+ };
156
+ readonly picture: {
157
+ readonly getter: (value: any) => any;
158
+ };
159
+ readonly group: {
160
+ readonly type: "string";
161
+ };
162
+ readonly self_registered: {
163
+ readonly type: "boolean";
164
+ readonly readOnly: true;
165
+ };
166
+ readonly updated_at: {
167
+ readonly type: "string";
168
+ readonly format: "date-time";
169
+ };
170
+ };
171
+ readonly presets: readonly ["crud", "view", "duplicate"];
172
+ readonly layout: {
173
+ readonly name: "grid";
174
+ readonly options: {
175
+ readonly title: "name";
176
+ readonly badge: "roles";
177
+ readonly picture: "picture_file";
178
+ readonly information: "email";
179
+ readonly active: "active";
180
+ readonly translateBadge: true;
181
+ };
182
+ };
183
+ readonly individualActions: {
184
+ readonly 'ui:spawnEdit': {
185
+ readonly name: "Editar";
186
+ readonly icon: "pencil";
187
+ };
188
+ readonly 'route:/dashboard/user/changepass': {
189
+ readonly name: "Mudar senha";
190
+ readonly icon: "key";
191
+ readonly fetchItem: true;
192
+ };
193
+ };
194
+ readonly icon: "users";
195
+ readonly filters: readonly ["name", "roles", "email", "phone_number"];
196
+ readonly table: readonly ["name", "roles", "picture_file", "active", "updated_at"];
197
+ readonly tableMeta: readonly ["email"];
198
+ readonly formLayout: {
199
+ readonly fields: {
200
+ readonly given_name: {
201
+ readonly span: 3;
202
+ };
203
+ readonly family_name: {
204
+ readonly span: 3;
205
+ };
206
+ };
207
+ };
208
+ }>>, "roles">;
209
+ }, context: import("@aeriajs/types").Context) => Promise<import("@aeriajs/types").Right<any> | import("@aeriajs/types").Left<import("@aeriajs/types").ACErrors | import("@aeriajs/types").ValidationError>>;
210
+ readonly authenticate: (props: {
211
+ email: string;
212
+ password: string;
213
+ } | {
214
+ revalidate: true;
215
+ }, context: import("@aeriajs/types").Context<{
103
216
  readonly $id: "user";
104
217
  readonly required: readonly ["name", "roles", "email"];
105
218
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
@@ -197,7 +310,116 @@ export declare const user: {
197
310
  };
198
311
  };
199
312
  };
200
- }>>, context: import("@aeriajs/types").Context<{
313
+ }>) => Promise<import("@aeriajs/types").Right<{
314
+ user: Pick<import("@aeriajs/types").SchemaWithId<{
315
+ readonly $id: "user";
316
+ readonly required: readonly ["name", "roles", "email"];
317
+ readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
318
+ readonly indexes: readonly ["name"];
319
+ readonly freshItem: {
320
+ readonly active: true;
321
+ };
322
+ readonly properties: {
323
+ readonly name: {
324
+ readonly type: "string";
325
+ };
326
+ readonly given_name: {
327
+ readonly getter: (document: any) => string;
328
+ };
329
+ readonly family_name: {
330
+ readonly getter: (document: any) => string;
331
+ };
332
+ readonly active: {
333
+ readonly type: "boolean";
334
+ };
335
+ readonly roles: {
336
+ readonly type: "array";
337
+ readonly items: {
338
+ readonly type: "string";
339
+ };
340
+ readonly uniqueItems: true;
341
+ };
342
+ readonly email: {
343
+ readonly type: "string";
344
+ readonly inputType: "email";
345
+ readonly unique: true;
346
+ };
347
+ readonly password: {
348
+ readonly type: "string";
349
+ readonly inputType: "password";
350
+ readonly hidden: true;
351
+ };
352
+ readonly phone_number: {
353
+ readonly type: "string";
354
+ readonly mask: "(##) #####-####";
355
+ };
356
+ readonly picture_file: {
357
+ readonly $ref: "file";
358
+ readonly accept: readonly ["image/*"];
359
+ };
360
+ readonly picture: {
361
+ readonly getter: (value: any) => any;
362
+ };
363
+ readonly group: {
364
+ readonly type: "string";
365
+ };
366
+ readonly self_registered: {
367
+ readonly type: "boolean";
368
+ readonly readOnly: true;
369
+ };
370
+ readonly updated_at: {
371
+ readonly type: "string";
372
+ readonly format: "date-time";
373
+ };
374
+ };
375
+ readonly presets: readonly ["crud", "view", "duplicate"];
376
+ readonly layout: {
377
+ readonly name: "grid";
378
+ readonly options: {
379
+ readonly title: "name";
380
+ readonly badge: "roles";
381
+ readonly picture: "picture_file";
382
+ readonly information: "email";
383
+ readonly active: "active";
384
+ readonly translateBadge: true;
385
+ };
386
+ };
387
+ readonly individualActions: {
388
+ readonly 'ui:spawnEdit': {
389
+ readonly name: "Editar";
390
+ readonly icon: "pencil";
391
+ };
392
+ readonly 'route:/dashboard/user/changepass': {
393
+ readonly name: "Mudar senha";
394
+ readonly icon: "key";
395
+ readonly fetchItem: true;
396
+ };
397
+ };
398
+ readonly icon: "users";
399
+ readonly filters: readonly ["name", "roles", "email", "phone_number"];
400
+ readonly table: readonly ["name", "roles", "picture_file", "active", "updated_at"];
401
+ readonly tableMeta: readonly ["email"];
402
+ readonly formLayout: {
403
+ readonly fields: {
404
+ readonly given_name: {
405
+ readonly span: 3;
406
+ };
407
+ readonly family_name: {
408
+ readonly span: 3;
409
+ };
410
+ };
411
+ };
412
+ }>, "name" | "roles" | "email" | "active"> & {
413
+ _id: import("bson").ObjectId | null;
414
+ };
415
+ token: {
416
+ type: "bearer";
417
+ content: string;
418
+ };
419
+ }> | import("@aeriajs/types").Left<import("./authenticate.js").AuthenticationErrors.Unauthenticated> | import("@aeriajs/types").Left<import("./authenticate.js").AuthenticationErrors.InvalidCredentials> | import("@aeriajs/types").Left<import("./authenticate.js").AuthenticationErrors.InactiveUser>>;
420
+ readonly activate: (payload: {
421
+ password: string;
422
+ }, context: import("@aeriajs/types").Context<{
201
423
  readonly $id: "user";
202
424
  readonly required: readonly ["name", "roles", "email"];
203
425
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
@@ -295,204 +517,243 @@ export declare const user: {
295
517
  };
296
518
  };
297
519
  };
298
- }, any>, options?: import("@aeriajs/api").GetOptions | undefined) => Promise<import("@aeriajs/types").SchemaWithId<{
299
- readonly $id: "user";
300
- readonly required: readonly ["name", "roles", "email"];
301
- readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
302
- readonly indexes: readonly ["name"];
303
- readonly freshItem: {
304
- readonly active: true;
305
- };
306
- readonly properties: {
307
- readonly name: {
308
- readonly type: "string";
309
- };
310
- readonly given_name: {
311
- readonly getter: (document: any) => string;
312
- };
313
- readonly family_name: {
314
- readonly getter: (document: any) => string;
315
- };
316
- readonly active: {
317
- readonly type: "boolean";
318
- };
319
- readonly roles: {
320
- readonly type: "array";
321
- readonly items: {
520
+ }>) => Promise<import("@aeriajs/types").GenericResponse | import("@aeriajs/types").Left<import("./activate.js").ActivationErrors.InvalidLink> | import("@aeriajs/types").Left<import("./activate.js").ActivationErrors.UserNotFound> | import("@aeriajs/types").Left<import("./activate.js").ActivationErrors.AlreadyActiveUser> | import("@aeriajs/types").Right<true>>;
521
+ readonly createAccount: (payload: Omit<Pick<{
522
+ picture_file: import("@aeriajs/types").SchemaWithId<{
523
+ readonly $id: "file";
524
+ readonly owned: "always";
525
+ readonly presets: readonly ["owned"];
526
+ readonly indexes: readonly ["filename", "link", "mime"];
527
+ readonly properties: {
528
+ readonly mime: {
322
529
  readonly type: "string";
323
530
  };
324
- readonly uniqueItems: true;
325
- };
326
- readonly email: {
327
- readonly type: "string";
328
- readonly inputType: "email";
329
- readonly unique: true;
330
- };
331
- readonly password: {
332
- readonly type: "string";
333
- readonly inputType: "password";
334
- readonly hidden: true;
335
- };
336
- readonly phone_number: {
337
- readonly type: "string";
338
- readonly mask: "(##) #####-####";
339
- };
340
- readonly picture_file: {
341
- readonly $ref: "file";
342
- readonly accept: readonly ["image/*"];
343
- };
344
- readonly picture: {
345
- readonly getter: (value: any) => any;
531
+ readonly size: {
532
+ readonly type: "number";
533
+ };
534
+ readonly last_modified: {
535
+ readonly type: "string";
536
+ readonly format: "date-time";
537
+ };
538
+ readonly filename: {
539
+ readonly type: "string";
540
+ };
541
+ readonly absolute_path: {
542
+ readonly type: "string";
543
+ };
544
+ readonly relative_path: {
545
+ readonly type: "string";
546
+ };
547
+ readonly immutable: {
548
+ readonly type: "boolean";
549
+ };
550
+ readonly link: {
551
+ readonly getter: (value: any) => Promise<string>;
552
+ };
553
+ readonly download_link: {
554
+ readonly getter: (value: any) => Promise<string>;
555
+ };
346
556
  };
347
- readonly group: {
348
- readonly type: "string";
557
+ readonly actions: {
558
+ readonly deleteAll: {
559
+ readonly name: "Remover";
560
+ readonly ask: true;
561
+ readonly selection: true;
562
+ };
349
563
  };
350
- readonly self_registered: {
351
- readonly type: "boolean";
352
- readonly readOnly: true;
564
+ readonly individualActions: {
565
+ readonly remove: {
566
+ readonly name: "Remover";
567
+ readonly icon: "trash";
568
+ readonly ask: true;
569
+ };
353
570
  };
354
- readonly updated_at: {
571
+ }>;
572
+ } & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
573
+ readonly name: {
574
+ readonly type: "string";
575
+ };
576
+ readonly given_name: {
577
+ readonly getter: (document: any) => string;
578
+ };
579
+ readonly family_name: {
580
+ readonly getter: (document: any) => string;
581
+ };
582
+ readonly active: {
583
+ readonly type: "boolean";
584
+ };
585
+ readonly roles: {
586
+ readonly type: "array";
587
+ readonly items: {
355
588
  readonly type: "string";
356
- readonly format: "date-time";
357
589
  };
590
+ readonly uniqueItems: true;
358
591
  };
359
- readonly presets: readonly ["crud", "view", "duplicate"];
360
- readonly layout: {
361
- readonly name: "grid";
362
- readonly options: {
363
- readonly title: "name";
364
- readonly badge: "roles";
365
- readonly picture: "picture_file";
366
- readonly information: "email";
367
- readonly active: "active";
368
- readonly translateBadge: true;
369
- };
592
+ readonly email: {
593
+ readonly type: "string";
594
+ readonly inputType: "email";
595
+ readonly unique: true;
370
596
  };
371
- readonly individualActions: {
372
- readonly 'ui:spawnEdit': {
373
- readonly name: "Editar";
374
- readonly icon: "pencil";
375
- };
376
- readonly 'route:/dashboard/user/changepass': {
377
- readonly name: "Mudar senha";
378
- readonly icon: "key";
379
- readonly fetchItem: true;
380
- };
597
+ readonly password: {
598
+ readonly type: "string";
599
+ readonly inputType: "password";
600
+ readonly hidden: true;
381
601
  };
382
- readonly icon: "users";
383
- readonly filters: readonly ["name", "roles", "email", "phone_number"];
384
- readonly table: readonly ["name", "roles", "picture_file", "active", "updated_at"];
385
- readonly tableMeta: readonly ["email"];
386
- readonly formLayout: {
387
- readonly fields: {
388
- readonly given_name: {
389
- readonly span: 3;
390
- };
391
- readonly family_name: {
392
- readonly span: 3;
393
- };
394
- };
602
+ readonly phone_number: {
603
+ readonly type: "string";
604
+ readonly mask: "(##) #####-####";
395
605
  };
396
- }> | null>;
397
- readonly getAll: (_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: import("@aeriajs/types").Context<{
398
- readonly $id: "user";
399
- readonly required: readonly ["name", "roles", "email"];
400
- readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
401
- readonly indexes: readonly ["name"];
402
- readonly freshItem: {
403
- readonly active: true;
606
+ readonly picture_file: {
607
+ readonly $ref: "file";
608
+ readonly accept: readonly ["image/*"];
404
609
  };
405
- readonly properties: {
406
- readonly name: {
407
- readonly type: "string";
408
- };
409
- readonly given_name: {
410
- readonly getter: (document: any) => string;
411
- };
412
- readonly family_name: {
413
- readonly getter: (document: any) => string;
414
- };
415
- readonly active: {
416
- readonly type: "boolean";
417
- };
418
- readonly roles: {
419
- readonly type: "array";
420
- readonly items: {
610
+ readonly picture: {
611
+ readonly getter: (value: any) => any;
612
+ };
613
+ readonly group: {
614
+ readonly type: "string";
615
+ };
616
+ readonly self_registered: {
617
+ readonly type: "boolean";
618
+ readonly readOnly: true;
619
+ };
620
+ readonly updated_at: {
621
+ readonly type: "string";
622
+ readonly format: "date-time";
623
+ };
624
+ }>> & {
625
+ name: string;
626
+ password: string;
627
+ updated_at: Date;
628
+ roles: string[];
629
+ email: string;
630
+ active: boolean;
631
+ phone_number: string;
632
+ picture_file: never;
633
+ given_name: string;
634
+ family_name: string;
635
+ picture: any;
636
+ group: string;
637
+ }, "picture_file">, "name" | "roles" | "email"> & Partial<{
638
+ picture_file: import("@aeriajs/types").SchemaWithId<{
639
+ readonly $id: "file";
640
+ readonly owned: "always";
641
+ readonly presets: readonly ["owned"];
642
+ readonly indexes: readonly ["filename", "link", "mime"];
643
+ readonly properties: {
644
+ readonly mime: {
421
645
  readonly type: "string";
422
646
  };
423
- readonly uniqueItems: true;
424
- };
425
- readonly email: {
426
- readonly type: "string";
427
- readonly inputType: "email";
428
- readonly unique: true;
429
- };
430
- readonly password: {
431
- readonly type: "string";
432
- readonly inputType: "password";
433
- readonly hidden: true;
434
- };
435
- readonly phone_number: {
436
- readonly type: "string";
437
- readonly mask: "(##) #####-####";
438
- };
439
- readonly picture_file: {
440
- readonly $ref: "file";
441
- readonly accept: readonly ["image/*"];
442
- };
443
- readonly picture: {
444
- readonly getter: (value: any) => any;
647
+ readonly size: {
648
+ readonly type: "number";
649
+ };
650
+ readonly last_modified: {
651
+ readonly type: "string";
652
+ readonly format: "date-time";
653
+ };
654
+ readonly filename: {
655
+ readonly type: "string";
656
+ };
657
+ readonly absolute_path: {
658
+ readonly type: "string";
659
+ };
660
+ readonly relative_path: {
661
+ readonly type: "string";
662
+ };
663
+ readonly immutable: {
664
+ readonly type: "boolean";
665
+ };
666
+ readonly link: {
667
+ readonly getter: (value: any) => Promise<string>;
668
+ };
669
+ readonly download_link: {
670
+ readonly getter: (value: any) => Promise<string>;
671
+ };
445
672
  };
446
- readonly group: {
447
- readonly type: "string";
673
+ readonly actions: {
674
+ readonly deleteAll: {
675
+ readonly name: "Remover";
676
+ readonly ask: true;
677
+ readonly selection: true;
678
+ };
448
679
  };
449
- readonly self_registered: {
450
- readonly type: "boolean";
451
- readonly readOnly: true;
680
+ readonly individualActions: {
681
+ readonly remove: {
682
+ readonly name: "Remover";
683
+ readonly icon: "trash";
684
+ readonly ask: true;
685
+ };
452
686
  };
453
- readonly updated_at: {
687
+ }>;
688
+ } & Omit<Readonly<import("@aeriajs/types").FilterReadonlyProperties<{
689
+ readonly name: {
690
+ readonly type: "string";
691
+ };
692
+ readonly given_name: {
693
+ readonly getter: (document: any) => string;
694
+ };
695
+ readonly family_name: {
696
+ readonly getter: (document: any) => string;
697
+ };
698
+ readonly active: {
699
+ readonly type: "boolean";
700
+ };
701
+ readonly roles: {
702
+ readonly type: "array";
703
+ readonly items: {
454
704
  readonly type: "string";
455
- readonly format: "date-time";
456
705
  };
706
+ readonly uniqueItems: true;
457
707
  };
458
- readonly presets: readonly ["crud", "view", "duplicate"];
459
- readonly layout: {
460
- readonly name: "grid";
461
- readonly options: {
462
- readonly title: "name";
463
- readonly badge: "roles";
464
- readonly picture: "picture_file";
465
- readonly information: "email";
466
- readonly active: "active";
467
- readonly translateBadge: true;
468
- };
708
+ readonly email: {
709
+ readonly type: "string";
710
+ readonly inputType: "email";
711
+ readonly unique: true;
469
712
  };
470
- readonly individualActions: {
471
- readonly 'ui:spawnEdit': {
472
- readonly name: "Editar";
473
- readonly icon: "pencil";
474
- };
475
- readonly 'route:/dashboard/user/changepass': {
476
- readonly name: "Mudar senha";
477
- readonly icon: "key";
478
- readonly fetchItem: true;
479
- };
713
+ readonly password: {
714
+ readonly type: "string";
715
+ readonly inputType: "password";
716
+ readonly hidden: true;
480
717
  };
481
- readonly icon: "users";
482
- readonly filters: readonly ["name", "roles", "email", "phone_number"];
483
- readonly table: readonly ["name", "roles", "picture_file", "active", "updated_at"];
484
- readonly tableMeta: readonly ["email"];
485
- readonly formLayout: {
486
- readonly fields: {
487
- readonly given_name: {
488
- readonly span: 3;
489
- };
490
- readonly family_name: {
491
- readonly span: 3;
492
- };
493
- };
718
+ readonly phone_number: {
719
+ readonly type: "string";
720
+ readonly mask: "(##) #####-####";
721
+ };
722
+ readonly picture_file: {
723
+ readonly $ref: "file";
724
+ readonly accept: readonly ["image/*"];
494
725
  };
495
- }, any>, options?: import("@aeriajs/api").GetAllOptions | undefined) => Promise<import("@aeriajs/types").SchemaWithId<{
726
+ readonly picture: {
727
+ readonly getter: (value: any) => any;
728
+ };
729
+ readonly group: {
730
+ readonly type: "string";
731
+ };
732
+ readonly self_registered: {
733
+ readonly type: "boolean";
734
+ readonly readOnly: true;
735
+ };
736
+ readonly updated_at: {
737
+ readonly type: "string";
738
+ readonly format: "date-time";
739
+ };
740
+ }>> & {
741
+ name: string;
742
+ password: string;
743
+ updated_at: Date;
744
+ roles: string[];
745
+ email: string;
746
+ active: boolean;
747
+ phone_number: string;
748
+ picture_file: never;
749
+ given_name: string;
750
+ family_name: string;
751
+ picture: any;
752
+ group: string;
753
+ }, "picture_file">> & {
754
+ updated_at?: Date | undefined;
755
+ created_at?: Date | undefined;
756
+ }, "roles">, context: import("@aeriajs/types").Context<{
496
757
  readonly $id: "user";
497
758
  readonly required: readonly ["name", "roles", "email"];
498
759
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
@@ -590,8 +851,7 @@ export declare const user: {
590
851
  };
591
852
  };
592
853
  };
593
- }>[]>;
594
- readonly remove: (payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<{
854
+ }>) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError> | import("@aeriajs/types").Right<import("mongodb").WithId<Omit<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<{
595
855
  readonly $id: "user";
596
856
  readonly required: readonly ["name", "roles", "email"];
597
857
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
@@ -689,7 +949,11 @@ export declare const user: {
689
949
  };
690
950
  };
691
951
  };
692
- }>>, context: import("@aeriajs/types").Context<{
952
+ }>>, "_id">>>>;
953
+ readonly getInfo: (payload: {
954
+ userId: string;
955
+ token: string;
956
+ }, context: import("@aeriajs/types").Context<{
693
957
  readonly $id: "user";
694
958
  readonly required: readonly ["name", "roles", "email"];
695
959
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
@@ -787,109 +1051,229 @@ export declare const user: {
787
1051
  };
788
1052
  };
789
1053
  };
790
- }, any>) => Promise<any>;
791
- readonly upload: <TContext extends import("@aeriajs/types").Context>(_props: unknown, context: TContext) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError> | {
792
- tempId: any;
793
- }>;
794
- readonly removeFile: (payload: import("@aeriajs/types").RemoveFilePayload, context: import("@aeriajs/types").Context<{
795
- readonly $id: "user";
796
- readonly required: readonly ["name", "roles", "email"];
797
- readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
798
- readonly indexes: readonly ["name"];
799
- readonly freshItem: {
800
- readonly active: true;
1054
+ }>) => Promise<import("@aeriajs/types").Left<import("./getInfo.js").ActivationErrors.InvalidLink> | import("@aeriajs/types").Left<import("./getInfo.js").ActivationErrors.UserNotFound> | import("@aeriajs/types").Left<import("./getInfo.js").ActivationErrors.AlreadyActiveUser> | import("@aeriajs/types").Right<{
1055
+ readonly name: string;
1056
+ readonly email: string;
1057
+ }>>;
1058
+ readonly getActivationLink: (userId: import("bson").ObjectId) => Promise<string>;
1059
+ };
1060
+ accessControl: {
1061
+ roles: {
1062
+ root: {
1063
+ grantEverything: true;
801
1064
  };
802
- readonly properties: {
803
- readonly name: {
1065
+ guest: {
1066
+ grant: "authenticate"[];
1067
+ };
1068
+ };
1069
+ };
1070
+ }>, "description" | "functions" | "item" | "accessControl" | "functionContracts"> & {
1071
+ item: import("@aeriajs/types").SchemaWithId<{
1072
+ readonly $id: "user";
1073
+ readonly required: readonly ["name", "roles", "email"];
1074
+ readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
1075
+ readonly indexes: readonly ["name"];
1076
+ readonly freshItem: {
1077
+ readonly active: true;
1078
+ };
1079
+ readonly properties: {
1080
+ readonly name: {
1081
+ readonly type: "string";
1082
+ };
1083
+ readonly given_name: {
1084
+ readonly getter: (document: any) => string;
1085
+ };
1086
+ readonly family_name: {
1087
+ readonly getter: (document: any) => string;
1088
+ };
1089
+ readonly active: {
1090
+ readonly type: "boolean";
1091
+ };
1092
+ readonly roles: {
1093
+ readonly type: "array";
1094
+ readonly items: {
804
1095
  readonly type: "string";
805
1096
  };
1097
+ readonly uniqueItems: true;
1098
+ };
1099
+ readonly email: {
1100
+ readonly type: "string";
1101
+ readonly inputType: "email";
1102
+ readonly unique: true;
1103
+ };
1104
+ readonly password: {
1105
+ readonly type: "string";
1106
+ readonly inputType: "password";
1107
+ readonly hidden: true;
1108
+ };
1109
+ readonly phone_number: {
1110
+ readonly type: "string";
1111
+ readonly mask: "(##) #####-####";
1112
+ };
1113
+ readonly picture_file: {
1114
+ readonly $ref: "file";
1115
+ readonly accept: readonly ["image/*"];
1116
+ };
1117
+ readonly picture: {
1118
+ readonly getter: (value: any) => any;
1119
+ };
1120
+ readonly group: {
1121
+ readonly type: "string";
1122
+ };
1123
+ readonly self_registered: {
1124
+ readonly type: "boolean";
1125
+ readonly readOnly: true;
1126
+ };
1127
+ readonly updated_at: {
1128
+ readonly type: "string";
1129
+ readonly format: "date-time";
1130
+ };
1131
+ };
1132
+ readonly presets: readonly ["crud", "view", "duplicate"];
1133
+ readonly layout: {
1134
+ readonly name: "grid";
1135
+ readonly options: {
1136
+ readonly title: "name";
1137
+ readonly badge: "roles";
1138
+ readonly picture: "picture_file";
1139
+ readonly information: "email";
1140
+ readonly active: "active";
1141
+ readonly translateBadge: true;
1142
+ };
1143
+ };
1144
+ readonly individualActions: {
1145
+ readonly 'ui:spawnEdit': {
1146
+ readonly name: "Editar";
1147
+ readonly icon: "pencil";
1148
+ };
1149
+ readonly 'route:/dashboard/user/changepass': {
1150
+ readonly name: "Mudar senha";
1151
+ readonly icon: "key";
1152
+ readonly fetchItem: true;
1153
+ };
1154
+ };
1155
+ readonly icon: "users";
1156
+ readonly filters: readonly ["name", "roles", "email", "phone_number"];
1157
+ readonly table: readonly ["name", "roles", "picture_file", "active", "updated_at"];
1158
+ readonly tableMeta: readonly ["email"];
1159
+ readonly formLayout: {
1160
+ readonly fields: {
806
1161
  readonly given_name: {
807
- readonly getter: (document: any) => string;
1162
+ readonly span: 3;
808
1163
  };
809
1164
  readonly family_name: {
810
- readonly getter: (document: any) => string;
811
- };
812
- readonly active: {
813
- readonly type: "boolean";
814
- };
815
- readonly roles: {
816
- readonly type: "array";
817
- readonly items: {
818
- readonly type: "string";
819
- };
820
- readonly uniqueItems: true;
821
- };
822
- readonly email: {
823
- readonly type: "string";
824
- readonly inputType: "email";
825
- readonly unique: true;
826
- };
827
- readonly password: {
828
- readonly type: "string";
829
- readonly inputType: "password";
830
- readonly hidden: true;
831
- };
832
- readonly phone_number: {
833
- readonly type: "string";
834
- readonly mask: "(##) #####-####";
835
- };
836
- readonly picture_file: {
837
- readonly $ref: "file";
838
- readonly accept: readonly ["image/*"];
839
- };
840
- readonly picture: {
841
- readonly getter: (value: any) => any;
842
- };
843
- readonly group: {
844
- readonly type: "string";
845
- };
846
- readonly self_registered: {
847
- readonly type: "boolean";
848
- readonly readOnly: true;
1165
+ readonly span: 3;
849
1166
  };
850
- readonly updated_at: {
1167
+ };
1168
+ };
1169
+ }>;
1170
+ description: {
1171
+ readonly $id: "user";
1172
+ readonly required: readonly ["name", "roles", "email"];
1173
+ readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
1174
+ readonly indexes: readonly ["name"];
1175
+ readonly freshItem: {
1176
+ readonly active: true;
1177
+ };
1178
+ readonly properties: {
1179
+ readonly name: {
1180
+ readonly type: "string";
1181
+ };
1182
+ readonly given_name: {
1183
+ readonly getter: (document: any) => string;
1184
+ };
1185
+ readonly family_name: {
1186
+ readonly getter: (document: any) => string;
1187
+ };
1188
+ readonly active: {
1189
+ readonly type: "boolean";
1190
+ };
1191
+ readonly roles: {
1192
+ readonly type: "array";
1193
+ readonly items: {
851
1194
  readonly type: "string";
852
- readonly format: "date-time";
853
1195
  };
1196
+ readonly uniqueItems: true;
854
1197
  };
855
- readonly presets: readonly ["crud", "view", "duplicate"];
856
- readonly layout: {
857
- readonly name: "grid";
858
- readonly options: {
859
- readonly title: "name";
860
- readonly badge: "roles";
861
- readonly picture: "picture_file";
862
- readonly information: "email";
863
- readonly active: "active";
864
- readonly translateBadge: true;
865
- };
1198
+ readonly email: {
1199
+ readonly type: "string";
1200
+ readonly inputType: "email";
1201
+ readonly unique: true;
1202
+ };
1203
+ readonly password: {
1204
+ readonly type: "string";
1205
+ readonly inputType: "password";
1206
+ readonly hidden: true;
1207
+ };
1208
+ readonly phone_number: {
1209
+ readonly type: "string";
1210
+ readonly mask: "(##) #####-####";
1211
+ };
1212
+ readonly picture_file: {
1213
+ readonly $ref: "file";
1214
+ readonly accept: readonly ["image/*"];
1215
+ };
1216
+ readonly picture: {
1217
+ readonly getter: (value: any) => any;
1218
+ };
1219
+ readonly group: {
1220
+ readonly type: "string";
1221
+ };
1222
+ readonly self_registered: {
1223
+ readonly type: "boolean";
1224
+ readonly readOnly: true;
1225
+ };
1226
+ readonly updated_at: {
1227
+ readonly type: "string";
1228
+ readonly format: "date-time";
1229
+ };
1230
+ };
1231
+ readonly presets: readonly ["crud", "view", "duplicate"];
1232
+ readonly layout: {
1233
+ readonly name: "grid";
1234
+ readonly options: {
1235
+ readonly title: "name";
1236
+ readonly badge: "roles";
1237
+ readonly picture: "picture_file";
1238
+ readonly information: "email";
1239
+ readonly active: "active";
1240
+ readonly translateBadge: true;
1241
+ };
1242
+ };
1243
+ readonly individualActions: {
1244
+ readonly 'ui:spawnEdit': {
1245
+ readonly name: "Editar";
1246
+ readonly icon: "pencil";
866
1247
  };
867
- readonly individualActions: {
868
- readonly 'ui:spawnEdit': {
869
- readonly name: "Editar";
870
- readonly icon: "pencil";
871
- };
872
- readonly 'route:/dashboard/user/changepass': {
873
- readonly name: "Mudar senha";
874
- readonly icon: "key";
875
- readonly fetchItem: true;
876
- };
1248
+ readonly 'route:/dashboard/user/changepass': {
1249
+ readonly name: "Mudar senha";
1250
+ readonly icon: "key";
1251
+ readonly fetchItem: true;
877
1252
  };
878
- readonly icon: "users";
879
- readonly filters: readonly ["name", "roles", "email", "phone_number"];
880
- readonly table: readonly ["name", "roles", "picture_file", "active", "updated_at"];
881
- readonly tableMeta: readonly ["email"];
882
- readonly formLayout: {
883
- readonly fields: {
884
- readonly given_name: {
885
- readonly span: 3;
886
- };
887
- readonly family_name: {
888
- readonly span: 3;
889
- };
1253
+ };
1254
+ readonly icon: "users";
1255
+ readonly filters: readonly ["name", "roles", "email", "phone_number"];
1256
+ readonly table: readonly ["name", "roles", "picture_file", "active", "updated_at"];
1257
+ readonly tableMeta: readonly ["email"];
1258
+ readonly formLayout: {
1259
+ readonly fields: {
1260
+ readonly given_name: {
1261
+ readonly span: 3;
1262
+ };
1263
+ readonly family_name: {
1264
+ readonly span: 3;
890
1265
  };
891
1266
  };
892
- }, any>) => Promise<any>;
1267
+ };
1268
+ };
1269
+ functions: {
1270
+ readonly get: <TContext extends import("@aeriajs/types").Context, TDocument = import("@aeriajs/types").SchemaWithId<TContext["description"]>>(payload: import("@aeriajs/types").GetPayload<import("@aeriajs/types").SchemaWithId<TContext["description"]>>, context: TContext extends import("@aeriajs/types").Context<any> ? TContext : never, options?: import("@aeriajs/api").GetOptions | undefined) => Promise<TDocument | null>;
1271
+ readonly getAll: <TContext_1 extends import("@aeriajs/types").Context, TDocument_1 = import("@aeriajs/types").SchemaWithId<TContext_1["description"]>>(_payload: import("@aeriajs/types").GetAllPayload<import("@aeriajs/types").SchemaWithId<any>> | undefined, context: TContext_1, options?: import("@aeriajs/api").GetAllOptions | undefined) => Promise<TDocument_1[]>;
1272
+ readonly remove: <TContext_2 extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").RemovePayload<import("@aeriajs/types").SchemaWithId<TContext_2["description"]>>, context: TContext_2) => Promise<any>;
1273
+ readonly upload: <TContext_3 extends import("@aeriajs/types").Context>(_props: unknown, context: TContext_3) => Promise<import("@aeriajs/types").Left<import("@aeriajs/types").ValidationError | import("@aeriajs/types").PropertyValidationError> | {
1274
+ tempId: any;
1275
+ }>;
1276
+ readonly removeFile: <TContext_4 extends import("@aeriajs/types").Context>(payload: import("@aeriajs/types").RemoveFilePayload, context: TContext_4) => Promise<any>;
893
1277
  readonly insert: (payload: {
894
1278
  what: Omit<import("@aeriajs/types").PackReferences<import("@aeriajs/types").SchemaWithId<{
895
1279
  readonly $id: "user";
@@ -1841,217 +2225,18 @@ export declare const user: {
1841
2225
  }>>;
1842
2226
  readonly getActivationLink: (userId: import("bson").ObjectId) => Promise<string>;
1843
2227
  };
1844
- accessControl: {
1845
- roles: {
1846
- root: {
1847
- grantEverything: true;
1848
- };
1849
- guest: {
1850
- grant: "authenticate"[];
1851
- };
1852
- };
1853
- };
1854
- } & {
1855
- item: import("@aeriajs/types").SchemaWithId<{
1856
- readonly $id: "user";
1857
- readonly required: readonly ["name", "roles", "email"];
1858
- readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
1859
- readonly indexes: readonly ["name"];
1860
- readonly freshItem: {
1861
- readonly active: true;
1862
- };
1863
- readonly properties: {
1864
- readonly name: {
1865
- readonly type: "string";
1866
- };
1867
- readonly given_name: {
1868
- readonly getter: (document: any) => string;
1869
- };
1870
- readonly family_name: {
1871
- readonly getter: (document: any) => string;
1872
- };
1873
- readonly active: {
1874
- readonly type: "boolean";
1875
- };
1876
- readonly roles: {
1877
- readonly type: "array";
1878
- readonly items: {
1879
- readonly type: "string";
1880
- };
1881
- readonly uniqueItems: true;
1882
- };
1883
- readonly email: {
1884
- readonly type: "string";
1885
- readonly inputType: "email";
1886
- readonly unique: true;
1887
- };
1888
- readonly password: {
1889
- readonly type: "string";
1890
- readonly inputType: "password";
1891
- readonly hidden: true;
1892
- };
1893
- readonly phone_number: {
1894
- readonly type: "string";
1895
- readonly mask: "(##) #####-####";
1896
- };
1897
- readonly picture_file: {
1898
- readonly $ref: "file";
1899
- readonly accept: readonly ["image/*"];
1900
- };
1901
- readonly picture: {
1902
- readonly getter: (value: any) => any;
1903
- };
1904
- readonly group: {
1905
- readonly type: "string";
1906
- };
1907
- readonly self_registered: {
1908
- readonly type: "boolean";
1909
- readonly readOnly: true;
1910
- };
1911
- readonly updated_at: {
1912
- readonly type: "string";
1913
- readonly format: "date-time";
1914
- };
1915
- };
1916
- readonly presets: readonly ["crud", "view", "duplicate"];
1917
- readonly layout: {
1918
- readonly name: "grid";
1919
- readonly options: {
1920
- readonly title: "name";
1921
- readonly badge: "roles";
1922
- readonly picture: "picture_file";
1923
- readonly information: "email";
1924
- readonly active: "active";
1925
- readonly translateBadge: true;
1926
- };
1927
- };
1928
- readonly individualActions: {
1929
- readonly 'ui:spawnEdit': {
1930
- readonly name: "Editar";
1931
- readonly icon: "pencil";
1932
- };
1933
- readonly 'route:/dashboard/user/changepass': {
1934
- readonly name: "Mudar senha";
1935
- readonly icon: "key";
1936
- readonly fetchItem: true;
1937
- };
1938
- };
1939
- readonly icon: "users";
1940
- readonly filters: readonly ["name", "roles", "email", "phone_number"];
1941
- readonly table: readonly ["name", "roles", "picture_file", "active", "updated_at"];
1942
- readonly tableMeta: readonly ["email"];
1943
- readonly formLayout: {
1944
- readonly fields: {
1945
- readonly given_name: {
1946
- readonly span: 3;
1947
- };
1948
- readonly family_name: {
1949
- readonly span: 3;
1950
- };
1951
- };
1952
- };
2228
+ functionContracts: Partial<{
2229
+ readonly get: import("@aeriajs/types").Contract;
2230
+ readonly getAll: import("@aeriajs/types").Contract;
2231
+ readonly remove: import("@aeriajs/types").Contract;
2232
+ readonly upload: import("@aeriajs/types").Contract;
2233
+ readonly removeFile: import("@aeriajs/types").Contract;
2234
+ readonly insert: import("@aeriajs/types").Contract;
2235
+ readonly authenticate: import("@aeriajs/types").Contract;
2236
+ readonly activate: import("@aeriajs/types").Contract;
2237
+ readonly createAccount: import("@aeriajs/types").Contract;
2238
+ readonly getInfo: import("@aeriajs/types").Contract;
2239
+ readonly getActivationLink: import("@aeriajs/types").Contract;
1953
2240
  }>;
1954
- description: {
1955
- readonly $id: "user";
1956
- readonly required: readonly ["name", "roles", "email"];
1957
- readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
1958
- readonly indexes: readonly ["name"];
1959
- readonly freshItem: {
1960
- readonly active: true;
1961
- };
1962
- readonly properties: {
1963
- readonly name: {
1964
- readonly type: "string";
1965
- };
1966
- readonly given_name: {
1967
- readonly getter: (document: any) => string;
1968
- };
1969
- readonly family_name: {
1970
- readonly getter: (document: any) => string;
1971
- };
1972
- readonly active: {
1973
- readonly type: "boolean";
1974
- };
1975
- readonly roles: {
1976
- readonly type: "array";
1977
- readonly items: {
1978
- readonly type: "string";
1979
- };
1980
- readonly uniqueItems: true;
1981
- };
1982
- readonly email: {
1983
- readonly type: "string";
1984
- readonly inputType: "email";
1985
- readonly unique: true;
1986
- };
1987
- readonly password: {
1988
- readonly type: "string";
1989
- readonly inputType: "password";
1990
- readonly hidden: true;
1991
- };
1992
- readonly phone_number: {
1993
- readonly type: "string";
1994
- readonly mask: "(##) #####-####";
1995
- };
1996
- readonly picture_file: {
1997
- readonly $ref: "file";
1998
- readonly accept: readonly ["image/*"];
1999
- };
2000
- readonly picture: {
2001
- readonly getter: (value: any) => any;
2002
- };
2003
- readonly group: {
2004
- readonly type: "string";
2005
- };
2006
- readonly self_registered: {
2007
- readonly type: "boolean";
2008
- readonly readOnly: true;
2009
- };
2010
- readonly updated_at: {
2011
- readonly type: "string";
2012
- readonly format: "date-time";
2013
- };
2014
- };
2015
- readonly presets: readonly ["crud", "view", "duplicate"];
2016
- readonly layout: {
2017
- readonly name: "grid";
2018
- readonly options: {
2019
- readonly title: "name";
2020
- readonly badge: "roles";
2021
- readonly picture: "picture_file";
2022
- readonly information: "email";
2023
- readonly active: "active";
2024
- readonly translateBadge: true;
2025
- };
2026
- };
2027
- readonly individualActions: {
2028
- readonly 'ui:spawnEdit': {
2029
- readonly name: "Editar";
2030
- readonly icon: "pencil";
2031
- };
2032
- readonly 'route:/dashboard/user/changepass': {
2033
- readonly name: "Mudar senha";
2034
- readonly icon: "key";
2035
- readonly fetchItem: true;
2036
- };
2037
- };
2038
- readonly icon: "users";
2039
- readonly filters: readonly ["name", "roles", "email", "phone_number"];
2040
- readonly table: readonly ["name", "roles", "picture_file", "active", "updated_at"];
2041
- readonly tableMeta: readonly ["email"];
2042
- readonly formLayout: {
2043
- readonly fields: {
2044
- readonly given_name: {
2045
- readonly span: 3;
2046
- };
2047
- readonly family_name: {
2048
- readonly span: 3;
2049
- };
2050
- };
2051
- };
2052
- };
2053
- functions: any;
2054
- functionContracts: {
2055
- [x: string]: import("@aeriajs/types").Contract;
2056
- };
2241
+ accessControl: import("@aeriajs/types").AccessControl;
2057
2242
  };