feat(user-avatar): add support for uploading, cropping, and displaying user avatars

This commit is contained in:
yiling
2026-06-03 19:56:07 +08:00
parent ee2a7d3281
commit e65b3edbee
19 changed files with 638 additions and 54 deletions
+1
View File
@@ -25,6 +25,7 @@ export type ChildPreview = z.infer<typeof childPreviewSchema>
export const assetUserInfoSchema = z.object({
id: z.string(),
name: z.string(),
image: z.string().optional(),
})
export type AssetUserInfo = z.infer<typeof assetUserInfoSchema>
+1
View File
@@ -47,6 +47,7 @@ export const projectUserInfoSchema = z.object({
id: z.string(),
name: z.string(),
role: z.string(),
image: z.string().optional(),
})
export type ProjectUserInfo = z.infer<typeof projectUserInfoSchema>
+8
View File
@@ -34,16 +34,24 @@ export const getMeResponseSchema = z.object({
name: z.string(),
email: z.string().optional(),
role: z.string(),
image: z.string().optional(),
unreadNotificationCount: z.number().optional(),
})
export type GetMeResponse = z.infer<typeof getMeResponseSchema>
export const updateMeRequestSchema = z.object({
name: z.string().optional(),
imageKey: z.string().nullable().optional(),
})
export type UpdateMeRequest = z.infer<typeof updateMeRequestSchema>
export const userInfoSchema = z.object({
id: z.string(),
name: z.string(),
role: z.string(),
email: z.string().optional(),
type: z.enum(['human', 'agent']).optional(),
image: z.string().optional(),
})
export type UserInfo = z.infer<typeof userInfoSchema>