(auth: AuthContext | null, id: string)
| 54 | } |
| 55 | |
| 56 | async getFileById(auth: AuthContext | null, id: string): Promise<UploadedFile> { |
| 57 | const organizationId = this.requireOrganizationId(auth); |
| 58 | const file = await this.filesRepository.findById(id, { organizationId }); |
| 59 | if (!file) { |
| 60 | throw new NotFoundException(`File with id ${id} not found`); |
| 61 | } |
| 62 | |
| 63 | return { |
| 64 | id: file.id, |
| 65 | fileName: file.fileName, |
| 66 | mimeType: file.mimeType, |
| 67 | size: file.size, |
| 68 | storageKey: file.storageKey, |
| 69 | uploadedAt: file.uploadedAt, |
| 70 | }; |
| 71 | } |
| 72 | |
| 73 | async downloadFile( |
| 74 | auth: AuthContext | null, |
no test coverage detected