@dolfinai/api-schema
v0.4.0
Published
TypeScript types and enum value arrays generated from the Dolfin public API OpenAPI document.
Maintainers
Readme
@dolfinai/api-schema
TypeScript types for the Dolfin public API, generated with
openapi-typescript from the OpenAPI snapshot in
openapi/v1.json.
Most apps do not install this package: @dolfinai/react and @dolfinai/sdk-core depend on it and
install it for you. Import it directly when you need a schema type by name. Docs: https://docs.dolfinai.co.
npm install @dolfinai/api-schemaimport type { paths, components, Schemas, Schema } from "@dolfinai/api-schema";
import { accountingSyncStatusValues } from "@dolfinai/api-schema";
type AuthResponse = Schema<"AuthResponse">; // same as Schemas["AuthResponse"]Besides paths, components and operations, every enum also ships as a
runtime array named <enumName>Values (--enum-values).
Scripts (in the dolfin-sdk repository)
| Script | What |
|---|---|
| bun run gen | Generate src/schema.gen.ts from openapi/v1.json (offline, idempotent) |
| bun run refresh | Download /openapi/v1.json from --url, $LOCAL_API_URL or $STAGING_API_URL (first that answers), overwrite the snapshot, then generate |
src/schema.gen.ts is generated and not committed; never edit it by hand.
ESM only. See CHANGELOG.md and LICENSE.
