/** * Schema Auto-Generation System * * Automatically generates Zod validation schemas from entity field definitions. * Supports create, update, and response schemas with child entities. */ import { z } from 'zod'; import type { EntityConfig } from './types'; export interface SchemaGenerationOptions { includeReadOnly?: boolean; includeChildEntities?: boolean; customValidation?: Record; strict?: boolean; } export interface GeneratedSchemas { create: z.ZodSchema; update: z.ZodSchema; response: z.ZodSchema; list: z.ZodSchema; childSchemas?: Record; } /** * Generate all schemas for an entity */ export declare function generateEntitySchemas(entityConfig: EntityConfig, options?: SchemaGenerationOptions): GeneratedSchemas; /** * Generate TypeScript types from schemas */ export declare function generateTypeScriptTypes(entityConfig: EntityConfig, schemas: GeneratedSchemas): string; /** * Validate data against entity schema */ export declare function validateEntityData(entityConfig: EntityConfig, data: unknown, schemaType?: 'create' | 'update' | 'response', options?: SchemaGenerationOptions): { success: true; data: unknown; } | { success: false; errors: z.ZodError; }; /** * Generate schema documentation in markdown format */ export declare function generateSchemaDocumentation(entityConfig: EntityConfig): string; export interface BuilderValidationResult { valid: boolean; errors: string[]; warnings: string[]; } /** * Validate an EntityConfig that has builder.enabled = true * Ensures required fields exist for page builder functionality */ export declare function validateBuilderEntityConfig(entityConfig: EntityConfig): BuilderValidationResult; /** * Validate TaxonomiesConfig */ export declare function validateTaxonomiesConfig(entityConfig: EntityConfig): BuilderValidationResult; /** * Get all entities with builder.enabled from a registry */ export declare function getBuilderEntities(registry: Record): EntityConfig[]; /** * Get the effective basePath for an entity * Reads from access.basePath (new) with fallback to builder.public.basePath (deprecated) */ export declare function getEntityBasePath(entity: EntityConfig): string | undefined; /** * Match a URL path to an entity based on access.basePath * Uses longest-match strategy to handle nested paths * * @param path - The URL path to match (e.g., '/blog/my-post', '/about') * @param registry - Entity registry to search * @returns Match result with entity, slug, and optional isArchive flag */ export declare function matchPathToEntity(path: string, registry: Record): { entity: EntityConfig; slug: string; isArchive?: boolean; } | null; //# sourceMappingURL=schema-generator.d.ts.map