lz-schema v0.35.1 provides TypeScript type definitions and Zod validation schemas for the LayerZ API entities. It is part of the LayerZ project and is co-released with the API. Key differentiator: tightly coupled with LayerZ API contracts, ensuring schema consistency. Schemas include campaign, workspace, and other domain models. Release cadence follows LayerZ backend updates. Requires Zod as a peer dependency.
npm install lz-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Validates a campaign object using the createCampaignSchema and handles success/error.
Update to v0.30.0+ and change imports to use Zod schemas.
Use workspaceCreateSchema or workspaceUpdateSchema as appropriate.
Convert Date objects to getTime() before validation.
Install zod as a dependency: npm install zod
npm install lz-schema and use ESM import syntax.
Convert ISO strings to numeric timestamps: new Date('...').getTime().