Add file module for uploads and storage

- File model + migration: file metadata, content lives in object storage
- IFileStorage port with local disk and S3-compatible (RustFS/MinIO) adapters
- POST /files, GET /files/:id/download, DELETE /files/:id
- MIME sniffed from content; only safe images served inline, nosniff header
- FileOwnerRegistry: owner modules register to grant visibility and keep
  their files from GC; FileGcService removes orphaned files hourly
- TransformResponseInterceptor passes StreamableFile through

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
vadimandClaude Opus 5.5 committed 2026-10-02 09:17:55 +03:00
1 parent 5cfc8986d7
commit f32c6e348d
49 files changed
+1992 -2

No files matched your search

+4
View File
@@ -24,6 +24,7 @@
"dependencies": {
"@apollo/server": "^5.5.1",
"@as-integrations/express5": "^1.1.2",
"@aws-sdk/client-s3": "^3.1145.0",
"@better-auth/prisma-adapter": "^1.7.2",
"@nestjs/apollo": "^14.0.0",
"@nestjs/common": "^12.0.1",
@@ -32,6 +33,7 @@
"@nestjs/event-emitter": "^12.0.1",
"@nestjs/graphql": "^14.0.0",
"@nestjs/platform-express": "^12.0.1",
"@nestjs/schedule": "^12.0.2",
"@nestjs/typeorm": "^12.0.1",
"@prisma/adapter-pg": "^7.10.0",
"@prisma/client": "^7.10.0",
@@ -39,6 +41,7 @@
"better-auth": "^1.7.2",
"class-transformer": "^0.5.1",
"class-validator": "^0.15.1",
"file-type": "^22.1.1",
"graphql": "^16.14.2",
"nodemailer": "^10.0.0",
"pg": "^8.23.0",
@@ -53,6 +56,7 @@
"@nestjs/schematics": "^12.0.0",
"@nestjs/testing": "^12.0.1",
"@types/express": "^5.0.0",
"@types/multer": "^2.3.0",
"@types/node": "^24.0.0",
"@types/pg": "^8.23.1",
"@types/supertest": "^7.0.0",