import fs from 'node:fs'; export interface FileInfo { name: string; path: string; size: number; } export interface StorageResult { path: string; totalSize: number; } export interface StorageSizeResult { totalSize: number; } export interface IStorageProvider { /** * Get the storage type (e.g., 'local', 's3', 'gcs', 'azure') */ getStorageType(): string; /** * Get the provider configuration */ getConfig(): any; /** * Add files provided as base64 strings to storage */ addBase64FilesToStorage(fileBase64: string, chatflowid: string, fileNames: string[], orgId: string): Promise; /** * Add file buffer to storage as part of an array */ addArrayFilesToStorage(mime: string, bf: Buffer, fileName: string, fileNames: string[], ...paths: string[]): Promise; /** * Add a single file buffer to storage */ addSingleFileToStorage(mime: string, bf: Buffer, fileName: string, ...paths: string[]): Promise; /** * Retrieve a file from the upload directory */ getFileFromUpload(filePath: string): Promise; /** * Retrieve a file from generic storage */ getFileFromStorage(file: string, ...paths: string[]): Promise; /** * List files in a storage path */ getFilesListFromStorage(...paths: string[]): Promise; /** * Stream a file from storage */ streamStorageFile(chatflowId: string, chatId: string, fileName: string, orgId: string): Promise; /** * Remove multiple files from storage */ removeFilesFromStorage(...paths: string[]): Promise; /** * Remove a specific file from the upload directory */ removeSpecificFileFromUpload(filePath: string): Promise; /** * Remove a specific file from storage */ removeSpecificFileFromStorage(...paths: string[]): Promise; /** * Remove a complete folder and its contents from storage */ removeFolderFromStorage(...paths: string[]): Promise; /** * Calculate the total storage size for an organization */ getStorageSize(orgId: string): Promise; /** * Get the Multer storage engine for this provider */ getMulterStorage(): any; /** * Get the Winston logger transports for this provider */ getLoggerTransports(logType: 'server' | 'error' | 'requests' | 'audit', config?: any): any[]; }