@roundtable-bb/sdk
v0.1.40
Published
Typed client SDK for the Roundtable API. Auto-generated from the live OpenAPI spec.
Readme
@roundtable-bb/sdk
Typed client SDK for the Roundtable API. Auto-generated from the live OpenAPI spec.
How the generation pipeline works
API routes (Fastify + Zod)
│
▼
codegen/extract-spec.ts → openapi.json ← generated, do not edit
│
▼
codegen/generate.ts → src/generated/client.ts ← generated, do not edit- extract-spec.ts — boots the Fastify app in memory (no real DB/Redis), calls
app.swagger(), and writes the result toopenapi.json. - generate.ts — reads
openapi.json, matches request/response schemas against Zod types exported from@roundtable-bb/types, and emits typedRoundtableClient(tenant-callable operations only) classes with one method peroperationId.
Updating the SDK
Run this after changing any API route, request body, or response shape:
npx nx run @roundtable-bb/sdk:codegenThis regenerates both openapi.json and src/generated/client.ts.
Building the browser bundle (optional)
For legacy frontends that need a browser IIFE (window.Roundtable):
npx nx run @roundtable-bb/sdk:bundleOutput: dist/roundtable.iife.js
Files
| Path | Description |
| ------------------------- | ------------------------------------------ |
| openapi.json | Generated OpenAPI spec — do not edit |
| src/generated/client.ts | Generated typed client — do not edit |
| codegen/extract-spec.ts | Step 1: extracts spec from the live app |
| codegen/generate.ts | Step 2: generates the client from the spec |
| codegen/bundle.mjs | Step 3 (optional): esbuild IIFE bundle |
