Initial commit

This commit is contained in:
2026-03-27 19:35:14 +01:00
commit 38581b88a4
68 changed files with 12137 additions and 0 deletions

23
lib/validators/profile.ts Normal file
View File

@@ -0,0 +1,23 @@
import { z } from "zod";
export const profileSchema = z.object({
username: z
.string()
.trim()
.toLowerCase()
.regex(/^[a-z0-9_]{3,32}$/, "Username must be 3-32 chars (a-z, 0-9, _)")
.max(32),
displayName: z.string().trim().min(2).max(60),
bio: z.string().trim().max(280).optional().or(z.literal("")),
avatarUrl: z
.string()
.trim()
.url("Avatar URL must be a valid URL")
.max(500)
.optional()
.or(z.literal("")),
themeId: z.string().trim().min(1),
isPublic: z.boolean()
});
export type ProfileInput = z.infer<typeof profileSchema>;