/** * Files Controller * * REST API endpoints for Files/Media operations. * Aligned with @plyaz/api endpoints in files.ts: * * - POST /files/upload - Upload single file * - POST /files/upload/bulk - Upload multiple files * - POST /files/generate-document - Generate document from template * - GET /files/:id - Get file metadata * - GET /files/:id/download - Download file content * - GET /files/:id/signed-url - Get signed URL for file * - DELETE /files/:id - Delete file * - GET /files/health - Health check */ import type { ReturnResponseType } from '@plyaz/types/errors'; import type { BackendFilesDomainService } from '../../domain/files'; import type { FilesEntity } from '@plyaz/types/core'; import { FILE_CATEGORY, ENTITY_TYPE, type UploadParams } from '@plyaz/types/storage'; import { type GenerateDocumentRequest } from '@plyaz/types/api'; /** Multer file type for uploaded files */ interface MulterFile { fieldname: string; originalname: string; encoding: string; mimetype: string; buffer: Buffer; size: number; } /** DTO for bulk file upload with proper enum types */ interface BulkUploadDto { files?: Array & { base64?: string; }>; category?: FILE_CATEGORY; entityType?: ENTITY_TYPE; entityId?: string; } export declare const BACKEND_FILES_DOMAIN_SERVICE = "BACKEND_FILES_DOMAIN_SERVICE"; /** * Files Controller * * Routes: * - GET /files/health - Health check * - POST /files/upload - Upload single file * - POST /files/upload/bulk - Upload multiple files * - POST /files/generate-document - Generate document from template * - GET /files/:id - Get file metadata * - GET /files/:id/download - Download file content * - GET /files/:id/signed-url - Get signed URL * - DELETE /files/:id - Delete file */ export declare class FilesController { private readonly filesService; constructor(filesService: BackendFilesDomainService); health(): ReturnResponseType<{ service: boolean; timestamp: string; }>; /** * Upload a single file (multipart/form-data) * POST /files/upload * * Supports both: * - multipart/form-data with 'file' field * - application/json with base64 encoded content */ uploadFile(file: MulterFile | undefined, dto: Partial & { base64?: string; }): Promise; }>>; /** * Upload multiple files (multipart/form-data) * POST /files/upload/bulk * * Supports both: * - multipart/form-data with 'files' field (multiple files) * - application/json with array of base64 encoded files */ uploadFiles(files: MulterFile[] | undefined, dto: BulkUploadDto & { category?: string; entityType?: string; }): Promise; }>>>; /** * Generate a document from template * POST /files/generate-document * * Uses SchemaValidationPipe for request validation via @plyaz/types schema. */ generateDocument(dto: GenerateDocumentRequest): Promise>; /** * Get file metadata * GET /files/:id */ getFile(id: string): Promise>; /** * Download file content * GET /files/:id/download */ downloadFile(id: string): Promise>; /** * Get signed URL for file * GET /files/:id/signed-url */ getSignedUrl(id: string): Promise>; /** * Delete file * DELETE /files/:id */ deleteFile(id: string): Promise>; } export {}; //# sourceMappingURL=files.controller.d.ts.map