Implement complete image management system with file upload, listing, retrieval, updates, alias assignment, and soft deletion. **v1 API Routes:** - `POST /api/v1/images/upload` - Upload single image file with database record - `GET /api/v1/images` - List images with filters and pagination - `GET /api/v1/images/:id` - Get single image by ID - `PUT /api/v1/images/:id` - Update image metadata (alias, focal point, meta) - `PUT /api/v1/images/:id/alias` - Assign project-scoped alias to image - `DELETE /api/v1/images/:id` - Soft delete image **Upload Endpoint Features:** - Uses uploadSingleImage middleware for file handling - Creates database record with image metadata - Stores file in MinIO storage (uploads category) - Supports optional alias and flowId parameters - Returns ImageResponse with all metadata **Route Features:** - Authentication via validateApiKey middleware - Project key requirement - Rate limiting on upload endpoint - Request validation with pagination - Error handling with proper status codes - Response transformation with toImageResponse converter - Project ownership verification for all operations **ImageService Integration:** - Uses existing ImageService methods - Supports filtering by flowId, source, alias - Soft delete with deletedAt timestamp - Alias validation and conflict detection **Type Updates:** - Updated ImageFilters with explicit | undefined for optional properties - All response types already defined in responses.ts **Technical Notes:** - Upload creates both storage record and database entry atomically - Focal point stored as JSON with x/y coordinates - Meta field for flexible metadata storage - File hash set to null (TODO: implement hashing) - All Phase 4 code is fully type-safe with zero TypeScript errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| _tests | ||
| src | ||
| .env | ||
| .prettier.config.js | ||
| Dockerfile | ||
| NETWORK_ERROR_DETECTION.md | ||
| docker-compose.yml | ||
| eslint.config.js | ||
| package.json | ||
| secrets.env.example | ||
| test-network-error-detector.ts | ||
| tsconfig.json | ||