@drax/identity-back 0.12.5 → 0.12.7
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.
|
@@ -34,6 +34,7 @@ const UserSchema = UserBaseSchema
|
|
|
34
34
|
id: string().optional(),
|
|
35
35
|
name: string(),
|
|
36
36
|
}).nullable().optional(),
|
|
37
|
-
createdAt: date().optional()
|
|
37
|
+
createdAt: date().optional(),
|
|
38
|
+
avatar: string().optional()
|
|
38
39
|
});
|
|
39
40
|
export { UserBaseSchema, UserSchema, UserCreateSchema, UserUpdateSchema, };
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.12.
|
|
6
|
+
"version": "0.12.7",
|
|
7
7
|
"description": "Identity module for user management, authentication and authorization.",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"types": "types/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"license": "ISC",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@drax/common-back": "^0.12.1",
|
|
32
|
-
"@drax/crud-back": "^0.12.
|
|
32
|
+
"@drax/crud-back": "^0.12.7",
|
|
33
33
|
"@drax/crud-share": "^0.12.1",
|
|
34
34
|
"@drax/email-back": "^0.12.1",
|
|
35
35
|
"@drax/identity-share": "^0.12.1",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"debug": "0"
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "2a0174e7fff0e4778ff45b5e1f3752b06164e93a"
|
|
68
68
|
}
|
|
@@ -3,50 +3,49 @@ import {RoleSchema} from "./RoleSchema.js"
|
|
|
3
3
|
import {TenantSchema} from "./TenantSchema.js"
|
|
4
4
|
|
|
5
5
|
const UserBaseSchema = object({
|
|
6
|
-
name: string({
|
|
6
|
+
name: string({required_error: "validation.required"})
|
|
7
7
|
.min(1, "validation.required"),
|
|
8
|
-
username: string({
|
|
8
|
+
username: string({required_error: "validation.required"})
|
|
9
9
|
.min(1, "validation.required"),
|
|
10
|
-
email: string({
|
|
10
|
+
email: string({required_error: "validation.required"})
|
|
11
11
|
.email("validation.email.invalid"),
|
|
12
|
-
phone: string({
|
|
12
|
+
phone: string({required_error: "validation.required"}).optional(),
|
|
13
13
|
active: boolean().optional(),
|
|
14
|
-
role: string({
|
|
14
|
+
role: string({required_error: "validation.required"})
|
|
15
15
|
.min(1, "validation.required"),
|
|
16
|
-
tenant: string({
|
|
16
|
+
tenant: string({required_error: "validation.required"}).nullable().optional()
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
})
|
|
20
20
|
|
|
21
21
|
const UserCreateSchema = UserBaseSchema.extend({
|
|
22
|
-
password: string({
|
|
22
|
+
password: string({required_error: "validation.required"})
|
|
23
23
|
.min(1, "validation.required")
|
|
24
24
|
.min(8, "validation.password.min8")
|
|
25
25
|
.max(64, "validation.password.max64"),
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
const UserUpdateSchema = UserBaseSchema.extend({
|
|
30
|
-
|
|
31
|
-
});
|
|
29
|
+
const UserUpdateSchema = UserBaseSchema.extend({});
|
|
32
30
|
|
|
33
31
|
const UserSchema = UserBaseSchema
|
|
34
32
|
.extend({
|
|
35
|
-
_id: string(),
|
|
36
|
-
role: object({
|
|
37
33
|
_id: string(),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
})
|
|
34
|
+
role: object({
|
|
35
|
+
_id: string(),
|
|
36
|
+
id: string().optional(),
|
|
37
|
+
name: string(),
|
|
38
|
+
permissions: array(string())
|
|
39
|
+
}).optional(),
|
|
40
|
+
active: boolean(),
|
|
41
|
+
tenant: object({
|
|
42
|
+
_id: string(),
|
|
43
|
+
id: string().optional(),
|
|
44
|
+
name: string(),
|
|
45
|
+
}).nullable().optional(),
|
|
46
|
+
createdAt: date().optional(),
|
|
47
|
+
avatar: string().optional()
|
|
48
|
+
});
|
|
50
49
|
|
|
51
50
|
|
|
52
51
|
export {
|