navidocs/server
ggq-admin 19d90f50ca Add image retrieval API endpoints
Implemented three new REST endpoints for serving extracted images from documents:
- GET /api/documents/:id/images - Returns all images for a document
- GET /api/documents/:id/pages/:pageNum/images - Returns images for specific page
- GET /api/images/:imageId - Streams image file (PNG/JPEG) with proper headers

Features:
- Full access control verification using existing auth patterns
- Secure file serving with path traversal protection
- Proper Content-Type and caching headers
- Rate limiting for image endpoints
- Comprehensive error handling for invalid IDs and missing files
- JSON responses with image metadata including OCR text and positioning

Testing:
- Created comprehensive test suite (test-image-endpoints.sh)
- All endpoints tested with curl and verified working
- Error cases properly handled (404, 403, 400)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 19:57:49 +02:00
..
config chore(debug): log tenant token parent uid for troubleshooting 2025-10-19 17:11:05 +02:00
db feat: NaviDocs MVP - Complete codebase extraction from lilian1 2025-10-19 01:55:44 +02:00
examples feat: NaviDocs MVP - Complete codebase extraction from lilian1 2025-10-19 01:55:44 +02:00
middleware feat: NaviDocs MVP - Complete codebase extraction from lilian1 2025-10-19 01:55:44 +02:00
migrations feat: Add image extraction design, database schema, and migration 2025-10-19 19:47:30 +02:00
routes Add image retrieval API endpoints 2025-10-19 19:57:49 +02:00
scripts feat: NaviDocs MVP - Complete codebase extraction from lilian1 2025-10-19 01:55:44 +02:00
services feat: Add Google Cloud Vision API as primary OCR option 2025-10-19 09:08:38 +02:00
test/data chore: Local development environment setup 2025-10-19 04:42:55 +02:00
workers feat: Add dotenv loading to OCR worker for environment configuration 2025-10-19 09:00:16 +02:00
.env.example feat: Complete frontend UI polish with Meilisearch-inspired design 2025-10-19 16:40:48 +02:00
API_SUMMARY.md feat: NaviDocs MVP - Complete codebase extraction from lilian1 2025-10-19 01:55:44 +02:00
index.js Add image retrieval API endpoints 2025-10-19 19:57:49 +02:00
package.json feat: NaviDocs MVP - Complete codebase extraction from lilian1 2025-10-19 01:55:44 +02:00
run-migration.js feat: Add image extraction design, database schema, and migration 2025-10-19 19:47:30 +02:00
test-routes.js feat: NaviDocs MVP - Complete codebase extraction from lilian1 2025-10-19 01:55:44 +02:00