Initial commit

This commit is contained in:
2026-02-10 01:25:57 +01:00
commit 7020a6a339
53 changed files with 1503 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import { z } from "zod"
export const postStatusSchema = z.enum(["draft", "published"])
export const postSchema = z.object({
id: z.string().uuid(),
title: z.string().min(3).max(180),
slug: z.string().min(3).max(180),
excerpt: z.string().max(320).optional(),
body: z.string().min(1),
status: postStatusSchema,
createdAt: z.date(),
updatedAt: z.date(),
})
export const upsertPostSchema = postSchema.omit({
id: true,
createdAt: true,
updatedAt: true,
})
export type Post = z.infer<typeof postSchema>
export type UpsertPostInput = z.infer<typeof upsertPostSchema>