@notato/schema
v0.2.0
Published
The wire format every Notato SDK and server share: Zod schemas for annotations and bundles, and schema.json made from them.
Maintainers
Readme
@notato/schema
The wire format of Notato: what an annotation and a bundle of annotations look like, shared by every SDK, the server and the board. It is the one contract between them, so a change here is a change for every platform.
import { Annotation, Bundle, SCHEMA_VERSION } from "@notato/schema";
const note = Annotation.parse(JSON.parse(body)); // throws on anything malformed- Zod schemas and their types:
Annotation,Bundle,Reply,ElementIdentity,AssetRef,Environment,Target,Variants, and the enumerationsMode,Severity,IntentandStatus. Each is both a schema (Annotation.parse) and a type (Annotation). The comments insrc/index.tssay what each field means. SCHEMA_VERSION: bundles carry it, so an importer can refuse one it does not understand.schema.json(@notato/schema/schema.json): the same definitions as JSON Schema, for languages without Zod (the .NET SDK's contract test reads it; the other native SDKs run what they write through the Zod schemas, as sdks/README.md describes). It is generated: after changingsrc/index.ts, runbun run build:schemafrom the repository root.sampleAnnotationandsampleBundle: fully populated examples, for tests and for the samples Notato sends.
Read leniently: ignore fields you do not know, and keep enumerations as strings, so a newer server never breaks an older app. A change that an older reader would reject needs a new SCHEMA_VERSION.
