UCD.js Docs

Schemas

Zod schemas for Unicode data files

Schemas

Zod schemas that define the shared data contracts across the UCD.js monorepo - API responses, store manifests, lockfiles, and Unicode metadata.

Installation

npm install @ucdjs/schemas

Overview

The @ucdjs/schemas package provides Zod schemas for validating Unicode data files, API responses, and internal configurations with full type safety. All schemas are exported from the package root.

Usage

import { LockfileSchema, UnicodeVersionSchema } from "@ucdjs/schemas";

// Parse a Unicode version object
const version = UnicodeVersionSchema.parse(rawVersion);

// Safely parse a lockfile
const result = LockfileSchema.safeParse(rawLockfile);
if (result.success) {
  console.log(result.data.versions);
}

Available Schemas

Schema FamilyKey ExportsDescription
APIApiErrorSchema, UCDWellKnownConfigSchemaContracts for HTTP API responses and service discovery.
File SystemFileEntrySchema, FileEntryListSchemaShapes for file entries and backend-facing filesystem entries.
Lockfile & SnapshotLockfileSchema, SnapshotSchemaState shapes used by the ucd CLI and the ucd-store app.
Version ManifestExpectedFileSchema, UCDStoreVersionManifestSchemaPer-version metadata served from /api/v1/versions/{version}/manifest with a deprecated well-known alias.
UnicodeUnicodeVersionSchema, UnicodeVersionDetailsSchema, UnicodeFileTreeNodeSchema, UnicodeFileTreeSchemaShapes for Unicode version metadata and file-tree responses.

On this page