A type-safe HTTP client and generator for Appweaver APIs.
Description
@appweaver/client has two parts:
- Generator – the
weaver-clientbinary reads an OpenAPI v3 schema (JSON or YAML, from a file or a URL) and emits the TypeScript types and a client class with a typed module per resource, plus the auth, account, health, and files routes. - Runtime – the
FetchClientbase class (andAngularClientfrom@appweaver/client/angular) with JWT Bearer, API key, and HTTP Basic authentication, refresh tokens, timeouts, and middleware.
Installation
npm install @appweaver/client
Usage
weaver openapi --output-path ./openapi.json
weaver-client generate ./openapi.json --output-path ./src/generated/client.ts
import { createClient } from './src/generated/client';
const client = createClient({ baseUrl: 'http://localhost:5000', auth: { apiKey: 'myApiKey' } });
const posts = await client.post.query({ filter: { published: true }, sort: '-createdAt' });
See the client reference for every generator option and client module.
Documentation
- Appweaver README – getting started, configuration, and the overview of every package
- Agent skill – the complete framework reference shipped to every scaffolded project
License
Appweaver is MIT licensed.