@nineup/protocol
v0.1.1
Published
Wire-format schemas for the Nineup SDK ↔ server contract. Shared between @nineup/node and the Nineup server.
Readme
@nineup/protocol
Wire-format schemas for the Nineup SDK ↔ server contract.
This package is the single source of truth for what @nineup/node posts and what the Nineup server accepts. Both sides import these Zod schemas; type drift between client and server is impossible by construction.
You do not normally install this directly — @nineup/node and friends depend on it transitively. Install it only if you're building a non-JS client and want the TypeScript types for reference.
Scope
Three payload shapes, intentionally tight:
- Deep health — one HTTP response with N subsystem results, posted to
/v1/ingest/health/:monitorIdor returned by SDK route helpers. - Heartbeat — push ping from a cron job / queue worker / ETL, posted to
/v1/heartbeat/:token. - Event — discrete annotation (deploy marker, custom event), posted to
/v1/events.
Anything outside those three shapes does not belong here. This is the Nineup SDK scope rule, encoded as a published artifact.
Usage
import {
PROTOCOL_VERSION,
healthPayloadSchema,
type HealthPayload,
} from "@nineup/protocol";
const payload: HealthPayload = {
protocolVersion: PROTOCOL_VERSION,
status: "pass",
checks: {
postgres: { status: "pass", latencyMs: 4 },
redis: { status: "pass", latencyMs: 1 },
},
};
const parsed = healthPayloadSchema.parse(payload);Versioning
PROTOCOL_VERSION bumps on backwards-incompatible changes only. Additive changes (new optional fields) do not bump.
License
MIT
