Skip to content

Dashboard API client

State: open/verified · Kind: module · Audience: system

  • A typed TypeScript client for the SDLC dashboard’s JSON API, giving in-process consumers compile-checked calls instead of hand-rolled fetch plumbing.
  • Request/response types are generated from the server’s shared zod contract, so client and server shapes stay in lockstep under a codegen-drift gate.

@sdlc/dashboard-client is the sole seam through which the dashboard SPA (and any other in-process consumer) talks to the SDLC dashboard server: state reads, refresh, per-type entity browsing (including the capability graph), sessions, and entity body writes all go through createDashboardClient()’s typed methods, never a caller-assembled fetch. It is a library, not a runnable unit — one importable package the SPA depends on, exporting no server or CLI surface of its own.

  • createDashboardClient(options) returning a typed client over GET /api/state, POST /api/refresh, GET /api/entities/:type[/:id], GET /api/capabilities/graph, GET /api/sessions, and PUT /api/entities/:type/:id/body.
  • Project-scoped reads/writes via an opaque ProjectId query param, resolved server-side — no caller ever assembles a checkout path.
  • A EntityBodySave result type that surfaces a lost compare-and-swap (409) or a contract-invalid edit (422) as typed values rather than thrown exceptions, distinct from genuine failures (4xx/5xx/dead server) which still throw.
  • Generated request/response types (src/types.ts) kept honest against the server’s zod contract by a codegen-drift check.
  • packages/ts/dashboard-client/src/index.ts#createDashboardClient
  • solutions/ontological/lib/services/dashboard/contract.ts (source-of-truth zod contract)
  • solutions/ontological/lib/services/dashboard/gen-client.ts (generates src/types.ts)
  • packages/ts/dashboard-client/

← Back to Capabilities