24 lines
806 B
JavaScript
24 lines
806 B
JavaScript
// Orval config — generate the frontend's API types from the backend's OpenAPI
|
|
// spec (frontend/openapi.json, itself dumped from the FastAPI app; see
|
|
// backend/schemas.py). Run `npm run gen:api` after changing a backend response
|
|
// model. The generated `src/generated/` tree is committed so the Docker build
|
|
// needs no backend to type-check.
|
|
module.exports = {
|
|
aiagent: {
|
|
input: "./openapi.json",
|
|
output: {
|
|
mode: "single",
|
|
target: "./src/generated/api.ts",
|
|
schemas: "./src/generated/model",
|
|
client: "fetch",
|
|
clean: true,
|
|
prettier: false,
|
|
override: {
|
|
// Emit string unions (e.g. `"http" | "tcp"`) instead of TS enums, to
|
|
// match the hand-written union types they replace.
|
|
enumGenerationType: "union",
|
|
},
|
|
},
|
|
},
|
|
};
|