mirror of
https://github.com/docmost/docmost.git
synced 2026-05-08 15:23:07 +08:00
f413720e15
- reinstantiate S3 client to fix file upload errors during import - delete import zip file after use
28 lines
680 B
TypeScript
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>;
|
|
}
|