feat: 添加设备注册 API 并重构安装横幅组件

This commit is contained in:
richarjiang
2026-03-24 09:18:51 +08:00
parent ab00443056
commit 71628d783d
13 changed files with 1524 additions and 150 deletions

View File

@@ -27,7 +27,26 @@ export const tokenSchema = z.object({
date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
});
export const deviceRegisterSchema = z.object({
deviceId: z.string().min(1).max(64),
name: z.string().min(1).max(100).optional(),
platform: z.string().max(50).optional(),
browser: z.string().max(100).optional(),
screen: z.string().max(20).optional(),
language: z.string().max(10).optional(),
});
export const updateNameSchema = z.object({
name: z
.string()
.min(1)
.max(30)
.regex(/^[A-Za-z0-9_-]+$/, "Only alphanumeric, hyphens, and underscores"),
});
export type RegisterInput = z.infer<typeof registerSchema>;
export type HeartbeatInput = z.infer<typeof heartbeatSchema>;
export type TaskInput = z.infer<typeof taskSchema>;
export type TokenInput = z.infer<typeof tokenSchema>;
export type DeviceRegisterInput = z.infer<typeof deviceRegisterSchema>;
export type UpdateNameInput = z.infer<typeof updateNameSchema>;