import { z } from "zod"; export const RegisterDto = z.object({ name: z.string().min(1).max(100), email: z.string().email().max(254), password: z.string().min(8).max(72), workspaceName: z.string().min(1).max(50).optional() }); export type RegisterInput = z.infer; export const LoginDto = z.object({ email: z.string().email().max(254), password: z.string().min(1).max(72) }); export type LoginInput = z.infer; export const RefreshDto = z.object({ refreshToken: z.string().min(10).optional() }); export type RefreshInput = z.infer; /** TASK-0133 — complete a 2FA-challenged login (enforcement #1). */ export const TwoFactorVerifyDto = z.object({ verificationId: z.string().min(10).max(128), code: z.string().regex(/^\d{6}$/, { message: "code must be a 6-digit TOTP code" }) }); export type TwoFactorVerifyInput = z.infer; export const LogoutDto = z.object({ sessionId: z.string().min(1).optional() }); export type LogoutInput = z.infer; export const ResetPasswordDto = z.object({ email: z.string().email().max(254) }); export type ResetPasswordInput = z.infer; export const ResetPasswordConfirmDto = z.object({ email: z.string().email().max(254), code: z.string().regex(/^\d{6}$/), newPassword: z.string().min(8).max(72) }); export type ResetPasswordConfirmInput = z.infer;