@aeriajs/builtins 0.0.115 → 0.0.117

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,9 +1,10 @@
1
1
  import type { Context, SchemaWithId, PackReferences } from '@aeriajs/types';
2
2
  import type { description } from './description';
3
3
  export declare const insert: (payload: {
4
- what: Omit<PackReferences<SchemaWithId<typeof description>>, 'roles'>;
4
+ what: Omit<PackReferences<SchemaWithId<typeof description>>, "roles">;
5
5
  }, context: Context<typeof description>) => Promise<import("@aeriajs/types").InsertReturnType<SchemaWithId<{
6
6
  readonly $id: "user";
7
+ readonly icon: "users";
7
8
  readonly required: readonly ["name", "roles", "email"];
8
9
  readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
9
10
  readonly indexes: readonly ["name"];
@@ -89,7 +90,6 @@ export declare const insert: (payload: {
89
90
  readonly translate: true;
90
91
  };
91
92
  };
92
- readonly icon: "users";
93
93
  readonly filters: readonly ["name", "roles", "email", "phone_number"];
94
94
  readonly table: readonly ["name", "roles", "picture_file", "active", "updated_at"];
95
95
  readonly tableMeta: readonly ["email"];
@@ -1,4 +1,6 @@
1
1
  import type { Description, RouteContext } from '@aeriajs/types';
2
+ import { Result } from '@aeriajs/types';
3
+ import { authenticate } from '../collections/user/authenticate.js';
2
4
  type Payload = {
3
5
  collections?: string[];
4
6
  noSerialize?: boolean;
@@ -27,126 +29,8 @@ export declare const describe: (contextOrPayload: RouteContext | Payload) => Pro
27
29
  readonly error: undefined;
28
30
  readonly result: {
29
31
  descriptions: Record<string, Description>;
30
- roles?: string[] | undefined;
31
- auth?: Partial<{
32
- user: Pick<import("@aeriajs/types").SchemaWithId<{
33
- readonly $id: "user";
34
- readonly required: readonly ["name", "roles", "email"];
35
- readonly form: readonly ["name", "active", "roles", "email", "phone_number", "picture_file"];
36
- readonly indexes: readonly ["name"];
37
- readonly properties: {
38
- readonly name: {
39
- readonly type: "string";
40
- };
41
- readonly given_name: {
42
- readonly getter: (document: any) => string;
43
- };
44
- readonly family_name: {
45
- readonly getter: (document: any) => string;
46
- };
47
- readonly active: {
48
- readonly type: "boolean";
49
- };
50
- readonly roles: {
51
- readonly type: "array";
52
- readonly items: {
53
- readonly type: "string";
54
- };
55
- readonly uniqueItems: true;
56
- };
57
- readonly email: {
58
- readonly type: "string";
59
- readonly inputType: "email";
60
- readonly unique: true;
61
- };
62
- readonly password: {
63
- readonly type: "string";
64
- readonly inputType: "password";
65
- readonly hidden: true;
66
- };
67
- readonly phone_number: {
68
- readonly type: "string";
69
- readonly mask: "(##) #####-####";
70
- };
71
- readonly picture_file: {
72
- readonly $ref: "file";
73
- readonly accept: readonly ["image/*"];
74
- };
75
- readonly picture: {
76
- readonly getter: (value: any) => any;
77
- };
78
- readonly group: {
79
- readonly type: "string";
80
- };
81
- readonly self_registered: {
82
- readonly type: "boolean";
83
- readonly readOnly: true;
84
- };
85
- readonly updated_at: {
86
- readonly type: "string";
87
- readonly format: "date-time";
88
- };
89
- };
90
- readonly presets: readonly ["crud", "view", "duplicate"];
91
- readonly layout: {
92
- readonly name: "grid";
93
- readonly options: {
94
- readonly title: "name";
95
- readonly badge: "roles";
96
- readonly picture: "picture_file";
97
- readonly information: "email";
98
- readonly active: "active";
99
- };
100
- };
101
- readonly individualActions: {
102
- readonly 'ui:spawnEdit': {
103
- readonly label: "action.edit";
104
- readonly icon: "pencil";
105
- readonly translate: true;
106
- };
107
- readonly 'route:/dashboard/user/changepass': {
108
- readonly label: "change_password";
109
- readonly icon: "key";
110
- readonly fetchItem: true;
111
- readonly translate: true;
112
- };
113
- readonly copyActivationLink: {
114
- readonly label: "copy_activation_link";
115
- readonly icon: "link";
116
- readonly translate: true;
117
- };
118
- };
119
- readonly icon: "users";
120
- readonly filters: readonly ["name", "roles", "email", "phone_number"];
121
- readonly table: readonly ["name", "roles", "picture_file", "active", "updated_at"];
122
- readonly tableMeta: readonly ["email"];
123
- readonly formLayout: {
124
- readonly fields: {
125
- readonly given_name: {
126
- readonly span: 3;
127
- };
128
- readonly family_name: {
129
- readonly span: 3;
130
- };
131
- };
132
- };
133
- }>, "name" | "roles" | "email" | "active"> & {
134
- _id: import("@aeriajs/core").ObjectId | null;
135
- };
136
- token: import("@aeriajs/types").TokenRecipient;
137
- } | {
138
- user: {
139
- _id: null;
140
- name: string;
141
- email: string;
142
- roles: string[];
143
- active: boolean;
144
- };
145
- token: {
146
- type: string;
147
- content: string;
148
- };
149
- }> | undefined;
32
+ roles?: string[];
33
+ auth?: Awaited<ReturnType<typeof authenticate>> extends Result.Either<unknown, infer Right> ? Partial<Right> : never;
150
34
  router?: any;
151
35
  };
152
36
  }>;