feat(api): add user files CRUD routes at /api/v1/files/*

Implements all 7 routes for the persistent file library:
list with pagination/search, upload (multi-file), details with recursive
version chain CTE, download stream, on-the-fly Sharp thumbnail, bulk delete
of entire version chains, and save-result for tool output versioning.
Registered in index.ts after fileRoutes.
This commit is contained in:
Siddharth Kumar Sah
2026-03-26 01:10:50 +08:00
parent fbca20d78c
commit 4e2aa58767
2 changed files with 562 additions and 0 deletions
+4
View File
@@ -15,6 +15,7 @@ import { registerPipelineRoutes } from "./routes/pipeline.js";
import { registerProgressRoutes } from "./routes/progress.js";
import { apiKeyRoutes } from "./routes/api-keys.js";
import { settingsRoutes } from "./routes/settings.js";
import { userFileRoutes } from "./routes/user-files.js";
import { db, schema } from "./db/index.js";
// Run before anything else
@@ -69,6 +70,9 @@ await authRoutes(app);
// File upload/download routes
await fileRoutes(app);
// User file library routes (persistent file management with versioning)
await userFileRoutes(app);
// Tool routes (generic factory-based)
await registerToolRoutes(app);