Zod Schemas
Zod Schemas
Section titled “Zod Schemas”Stelo CMS uses Zod for runtime type validation and schema definition across the application.
Base Schemas
Section titled “Base Schemas”Localized Content
Section titled “Localized Content”export const localizedStringSchema = z.record( z.enum(['en', 'fr', 'es']), z.string().min(1));
export const localizedRichContentSchema = z.record( z.enum(['en', 'fr', 'es']), z.object({ body: z.string(), excerpt: z.string().optional(), featuredImage: z.string().url().optional() }));Entity Schemas
Section titled “Entity Schemas”Page Schema
Section titled “Page Schema”export const createPageSchema = z.object({ title: localizedStringSchema, content: localizedRichContentSchema, slug: localizedStringSchema, metadata: z.record(z.any()).optional(), published: z.boolean().default(false)});Validation Benefits
Section titled “Validation Benefits”- Runtime type safety
- Clear error messages
- Automatic TypeScript inference
- Input sanitization
This section will be expanded with detailed schema definitions.