Files
docmost/apps/server/src/integrations/storage/interfaces/storage-driver.interface.ts
T
Philipinho f413720e15 - sync
- reinstantiate S3 client to fix file upload errors during import
- delete import zip file after use
2025-09-14 03:00:23 +01:00

28 lines
680 B
TypeScript

import { Readable } from 'stream';
export interface StorageDriver {
upload(filePath: string, file: Buffer): Promise<void>;
uploadStream(filePath: string, file: Readable, options?: { recreateClient?: boolean }): Promise<void>;
copy(fromFilePath: string, toFilePath: string): Promise<void>;
read(filePath: string): Promise<Buffer>;
readStream(filePath: string): Promise<Readable>;
exists(filePath: string): Promise<boolean>;
getUrl(filePath: string): string;
getSignedUrl(filePath: string, expireIn: number): Promise<string>;
delete(filePath: string): Promise<void>;
getDriver(): any;
getDriverName(): string;
getConfig(): Record<string, any>;
}