Files
SnapOtter/apps/api/package.json
T
Siddharth Kumar Sah ece341e8c4 feat(api): add multipart file upload, workspace management, and download routes
- Register @fastify/multipart plugin with size limits from env config
- Workspace manager: createWorkspace, getWorkspacePath, cleanupWorkspace
- File validation: magic byte detection, format check, megapixel limit
- POST /api/v1/upload: multipart upload with validation, returns jobId + file metadata
- GET /api/v1/download/:jobId/:filename: serve files with Content-Disposition
- Path traversal guards on all file-serving endpoints
- Add @stirling-image/image-engine and sharp as API dependencies
- Add apiUpload, getDownloadUrl, apiDownloadBlob to web client
2026-03-22 03:47:54 +08:00

37 lines
934 B
JSON

{
"name": "@stirling-image/api",
"version": "0.0.1",
"private": true,
"type": "module",
"scripts": {
"dev": "tsx watch src/index.ts",
"build": "tsc",
"start": "node dist/index.js",
"typecheck": "tsc --noEmit",
"clean": "rm -rf dist"
},
"dependencies": {
"@stirling-image/image-engine": "workspace:*",
"@stirling-image/shared": "workspace:*",
"sharp": "^0.33.0",
"fastify": "^5.2.0",
"@fastify/static": "^8.1.0",
"@fastify/multipart": "^9.0.0",
"@fastify/cors": "^11.0.0",
"@fastify/rate-limit": "^10.2.0",
"@fastify/swagger": "^9.4.0",
"@fastify/swagger-ui": "^5.2.0",
"dotenv": "^16.4.0",
"zod": "^3.24.0",
"drizzle-orm": "^0.38.0",
"better-sqlite3": "^11.7.0"
},
"devDependencies": {
"typescript": "^5.7.0",
"tsx": "^4.19.0",
"@types/node": "^22.0.0",
"drizzle-kit": "^0.30.0",
"@types/better-sqlite3": "^7.6.0"
}
}