Refactor tools API to Fastify TypeScript adapter#76
Conversation
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
- Updated package.json to change main entry point and scripts for NestJS. - Removed legacy Fastify app structure from app.ts, config.ts, error-handler.ts, routes.ts, server.ts, and operation-id.ts. - Introduced ToolsApiService to handle API logic using NestJS. - Updated TypeScript configuration for compatibility with NestJS. - Modified tests to work with the new NestJS application structure.
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
- Changed the base URL in the OpenAPI specification from `https://api.don.projects.digilab.network/tools/v1` to `https://api.don.apps.digilab.network/tools/v1`. - Added custom operation handlers for various endpoints in the OpenAPI specification. - Introduced `api-implementations.ts` to define API implementations. - Created `api.module.ts` to manage dynamic module configuration for API implementations. - Implemented `ToolsApiService` to handle business logic for the Tools API. - Updated `ToolsApiController` to remove unnecessary HTTP code decorators. - Adjusted the main entry point in `package.json` and `tsconfig.json` to reflect the new structure. - Added tests to ensure the application works as expected with the new structure.
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
There was a problem hiding this comment.
Pull request overview
This PR migrates the Tools API v1 HTTP layer from the previous generated Express/JS implementation to a NestJS + Fastify + TypeScript adapter, delegating tool behavior to @developer-overheid-nl/don-tools-logic and introducing OpenAPI-driven request/response validation and mocking.
Changes:
- Replace the Express server + in-repo service implementations with a NestJS/Fastify app and a
ToolsApiServiceadapter that calls@developer-overheid-nl/don-tools-logic. - Add TypeScript + Vitest setup and new tests for HTTP behavior and OAS conversion.
- Update Docker build/runtime stages and GitHub Actions workflows for the new toolchain (Node 22, build step, pinned actions).
Reviewed changes
Copilot reviewed 56 out of 58 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.ts | Adds Vitest configuration for the new TypeScript test suite. |
| utils/openapiRouter.js | Removes legacy Express OpenAPI routing middleware. |
| utils/fileName.js | Removes legacy filename sanitization utility (previously used by in-repo services). |
| tsconfig.json | Adds TypeScript compiler configuration for the new NestJS/TS codebase. |
| test/OasConversionService.test.js | Removes legacy Node test suite for conversion service. |
| test/convert-oas.test.ts | Adds Vitest coverage for conversion behavior via the logic package. |
| test/app.test.ts | Adds integration-style tests using Fastify inject against the Nest app. |
| services/ZipService.js | Removes legacy in-repo Zip service implementation. |
| services/ToolsService.js | Removes legacy in-repo ToolsService implementation. |
| services/Service.js | Removes legacy service response/mocking utilities used by generated code. |
| services/RemoteSpecificationService.js | Removes legacy remote fetch helper used by old validators/converters. |
| services/PostmanConversionService.js | Removes legacy Postman conversion implementation. |
| services/OasValidatorService.js | Removes legacy ADR validation implementation. |
| services/OasInputService.js | Removes legacy OAS input resolver. |
| services/OasGeneratorService.js | Removes legacy OpenAPI generator implementation. |
| services/OasConversionService.js | Removes legacy OpenAPI convert implementation. |
| services/OasBundleService.js | Removes legacy OpenAPI bundle implementation. |
| services/KeycloakService.js | Removes legacy Keycloak admin client implementation. |
| services/index.js | Removes legacy service export barrel. |
| services/ArazzoVisualizationService.js | Removes legacy Arazzo visualization implementation. |
| README.md | Rewrites README to describe the new NestJS/Fastify/TS architecture and workflows. |
| README 2.md | Removes old generated-server README content. |
| publiccode.yml | Updates stack description from Express/JS to TypeScript/Fastify. |
| package.json | Updates scripts/deps for NestJS/Fastify/TS/Vitest and logic-package integration. |
| models/untrust-client-input.ts | Adds generated model interface for untrust client input. |
| models/oas-input.ts | Adds generated model interface for OAS input. |
| models/models-lint-result.ts | Adds generated model interface for lint results. |
| models/models-lint-message.ts | Adds generated model interface for lint messages. |
| models/models-lint-message-info.ts | Adds generated model interface for lint message info items. |
| models/models-keycloak-client-result.ts | Adds generated model interface for Keycloak client creation response. |
| models/index.ts | Adds models barrel + global type declarations for generated model types. |
| logger.js | Removes legacy Winston logger setup used by the Express app. |
| index.js | Removes legacy Express entrypoint. |
| implementation/tools-api.service.ts | Adds Nest injectable adapter that calls @developer-overheid-nl/don-tools-logic. |
| expressServer.js | Removes legacy Express server implementation. |
| Dockerfile | Switches to multi-stage build producing dist/ and runs Node 22 on port 1338. |
| decorators/index.ts | Adds decorator barrel exports. |
| decorators/headers-decorator.ts | Adds custom @Headers decorator workaround for Nest pipes on headers. |
| decorators/cookies-decorator.ts | Adds custom @Cookies decorator for cookie access (framework-dependent). |
| controllers/ToolsController.js | Removes legacy Express controller wrapper. |
| controllers/ToolsApi.controller.ts | Adds Nest controller mapping HTTP routes to the ToolsApi abstraction. |
| controllers/index.ts | Adds controllers barrel export for Nest module wiring. |
| controllers/index.js | Removes legacy controller export barrel (CommonJS). |
| controllers/Controller.js | Removes legacy generated controller request/response handler. |
| config.js | Removes legacy runtime config used by Express server. |
| biome.json | Updates Biome schema/version and includes TS/Nest directories in formatting/linting. |
| app/index.ts | Adds Nest/Fastify bootstrap with OpenAPIBackend validation, mocking, and optional response validation. |
| app/api.module.ts | Adds dynamic module to wire API implementations and default 501 proxies. |
| app/api-implementations.ts | Adds typing for API implementation injection. |
| api/ToolsApi.ts | Adds abstract Tools API contract used by controller + implementation. |
| api/openapi.yaml | Adds/updates OpenAPI spec file used at runtime for validation/mocking. |
| api/openapi.json | Updates OpenAPI JSON (server URL + operationId normalization metadata). |
| api/index.ts | Adds API barrel export. |
| .github/workflows/node-ci.yml | Updates CI to Node 22 and pins GitHub Actions by SHA. |
| .github/workflows/json-ci.yml | Pins actions by SHA for linting workflow. |
| .github/workflows/deploy-test.yml | Pins actions by SHA and updates yq install version/checksum. |
| .github/workflows/deploy-prod.yml | Pins actions by SHA and updates yq install version/checksum. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| "openapi": "3.0.1", | ||
| "info": { | ||
| "contact": { |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
…loy-test]" This reverts commit f602d1f.
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
|
@copilot resolve the merge conflicts in this pull request |
No description provided.