feat(api): add resize, crop, rotate, convert, compress, metadata, and color tool routes

Seven tool route files using the createToolRoute factory, registering 10 API
endpoints total (color adjustments covers 4 tool IDs). Also fixes the tool
factory generic to properly infer Zod output types and clamps the compress
binary-search quality to 1-100.
This commit is contained in:
Siddharth Kumar Sah
2026-03-22 03:56:34 +08:00
parent d53f6733b8
commit 37112af779
10 changed files with 313 additions and 10 deletions
+16 -7
View File
@@ -1,15 +1,24 @@
import type { FastifyInstance } from "fastify";
import { registerResize } from "./resize.js";
import { registerCrop } from "./crop.js";
import { registerRotate } from "./rotate.js";
import { registerConvert } from "./convert.js";
import { registerCompress } from "./compress.js";
import { registerStripMetadata } from "./strip-metadata.js";
import { registerColorAdjustments } from "./color-adjustments.js";
/**
* Registry that imports and registers all tool routes.
* Each tool uses the createToolRoute factory from tool-factory.ts.
*
* Tools will be added here as they are implemented in Phase 2 Tasks 4-10.
*/
export async function registerToolRoutes(app: FastifyInstance): Promise<void> {
// Tool routes will be registered here as they are implemented.
// Example:
// const { registerResizeTool } = await import("./resize.js");
// registerResizeTool(app);
app.log.info("Tool routes registered");
registerResize(app);
registerCrop(app);
registerRotate(app);
registerConvert(app);
registerCompress(app);
registerStripMetadata(app);
registerColorAdjustments(app);
app.log.info("Tool routes registered (7 tools, 10 endpoints)");
}