import { z } from "zod"; import { pageAttributesSchema } from "./attributes"; export const pageSchema = z.object({ id: z .string() .describe("The unique ID of the page. Use a human readable url-safe slug") .regex(/^[a-z0-9-_]+$/, "ID must be a valid URL-safe slug"), label: z.string().describe("The label (name) of the page"), attributes: pageAttributesSchema, }); export type Page = z.infer; export const versionedPageSchema = pageSchema.extend({ version: z.string(), }); export type VersionedPage = z.infer; /** * Page context represents the page config PLUS: * - the pathParams of the actual request. * - the resolved data for the page. */ export type PageContext = VersionedPage & { pathParams?: Record; data?: Record; };