f6490f4c28
The file moves (docs/ → design/, docs/api/openapi.json → api/openapi.json) landed
in d01a8fd, but the matching reference updates did not — so mgmt.rs's drift-test
`include_str!("../../../docs/api/openapi.json")` pointed at a path that no longer
exists and the host failed to build. This restores it and updates every reference:
- mgmt.rs include_str! → ../../../api/openapi.json (fixes the build)
- web/orval.config.ts codegen target, web/Dockerfile, .dockerignore
- deb/rpm/Arch packaging install paths
- CLAUDE.md, the .gitea CI workflows, code doc-comments, design-doc cross-links
docs-site route URLs (/docs/...) untouched.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
33 lines
1019 B
TypeScript
33 lines
1019 B
TypeScript
import { defineConfig } from "orval";
|
|
|
|
// Generates a typed React Query client from the host's checked-in OpenAPI document.
|
|
// Regenerate after any management-API change: `pnpm api:gen` (the Rust side regenerates
|
|
// api/openapi.json via `cargo run -p punktfunk-host -- openapi`).
|
|
export default defineConfig({
|
|
punktfunk: {
|
|
input: {
|
|
target: "../api/openapi.json",
|
|
},
|
|
output: {
|
|
mode: "tags-split",
|
|
target: "./src/api/gen",
|
|
schemas: "./src/api/gen/model",
|
|
client: "react-query",
|
|
clean: true,
|
|
override: {
|
|
mutator: {
|
|
path: "./src/api/fetcher.ts",
|
|
name: "apiFetch",
|
|
},
|
|
// The mutator returns the response BODY (it throws on HTTP errors), not a
|
|
// `{status,data,headers}` envelope — so a query's `.data` is the typed payload.
|
|
fetch: {
|
|
includeHttpResponseReturnType: false,
|
|
},
|
|
// No global query/mutation override: orval picks `useQuery` for GET and
|
|
// `useMutation` for POST/DELETE by HTTP method, which is what the pages expect.
|
|
},
|
|
},
|
|
},
|
|
});
|