feat(api-client): expose the generated BFF client + repeatable generate target (refs #66)
The lib barrel exports the generated BffApiV1Service + models (SubmitAccepted, OpenbaarEntry), so the app can inject a typed client for the BFF. Add an 'api-client:generate' target (orval) to regenerate from services/bff/openapi.json; generation is idempotent. Tests (HttpClientTesting) now pass: POST /self-service/ registrations and GET /openbaar/register with the query, mapping typed responses. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,13 @@
|
||||
"targets": {
|
||||
"lint": {
|
||||
"executor": "@nx/eslint:lint"
|
||||
},
|
||||
"generate": {
|
||||
"executor": "nx:run-commands",
|
||||
"options": {
|
||||
"command": "orval --config orval.config.ts",
|
||||
"cwd": "libs/api-client"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
export {};
|
||||
// The BFF API client is generated from services/bff/openapi.json (orval); never hand-edit
|
||||
// src/lib/generated. Re-run `nx run api-client:generate` after the BFF spec changes.
|
||||
export * from './lib/generated/bff-api';
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
BffApiV1Service,
|
||||
type OpenbaarEntry,
|
||||
type SubmitAccepted,
|
||||
} from 'api-client';
|
||||
} from '../index';
|
||||
|
||||
describe('BffApiV1Service (generated from services/bff/openapi.json)', () => {
|
||||
let service: BffApiV1Service;
|
||||
|
||||
Reference in New Issue
Block a user