@getkiara/fasttask-client
v0.1.0
Published
Typed HTTP client for the FastTask API — generated from docs/openapi.yaml.
Maintainers
Readme
@kiara/fasttask-client
Typed HTTP client for the FastTask API.
- Types (
src/schema.d.ts) are generated from../../docs/openapi.yaml— the single source of truth. Regenerate withnpm run generatewhenever the spec changes. - Runtime is
openapi-fetch— a tiny, fully-typed fetch wrapper. No hand-written endpoint code to drift.
Usage
import { createFastTaskClient } from '@kiara/fasttask-client';
const ft = createFastTaskClient({
baseUrl: 'https://fasttask.example.com',
token: '<session token from POST /api/auth/login>',
});
const { data, error } = await ft.GET('/api/boards');
if (data) console.log(data); // typed Board[]
await ft.POST('/api/boards/{id}/tickets', {
params: { path: { id: boardId } },
body: { title: 'Fix the login bug' },
});Scripts
| Command | What it does |
|---|---|
| npm run generate | Regenerate src/schema.d.ts from ../../docs/openapi.yaml |
| npm run build | Compile to dist/ |
| npm run typecheck | tsc --noEmit |
Keep the client in lockstep with the API: when docs/openapi.yaml changes, run
npm run generate and commit the updated src/schema.d.ts.
