API @deepkit/filesystem-aws-s3
npm install @deepkit/filesystem-aws-s3
Classes
export class FilesystemAwsS3Adapter implements FilesystemAdapter {
client: S3Client;
constructor(public options: FilesystemAwsS3Options);
supportsVisibility();
supportsDirectory();
publicUrl(path: string): string;
async makeDirectory(path: string, visibility: FileVisibility): Promise<void>;
async files(path: string): Promise<FilesystemFile[]>;
async allFiles(path: string, reporter: Reporter): Promise<FilesystemFile[]>;
async copy(source: string, destination: string, reporter: Reporter): Promise<void>;
async delete(paths: string[]): Promise<void>;
async deleteDirectory(path: string, reporter: Reporter): Promise<void>;
async exists(paths: string[]): Promise<boolean>;
async get(path: string): Promise<FilesystemFile | undefined>;
async move(source: string, destination: string, reporter: Reporter): Promise<void>;
async read(path: string, reporter: Reporter): Promise<Uint8Array>;
async write(path: string, contents: Uint8Array, visibility: FileVisibility, reporter: Reporter): Promise<void>;
async getVisibility(path: string): Promise<FileVisibility>;
async setVisibility(path: string, visibility: FileVisibility): Promise<void>;
}
Types
interface FilesystemAwsS3Options extends S3ClientConfigType {
bucket: string;
path?: string;
region: string;
accessKeyId: string;
secretAccessKey: string;
endpoint?: string;
/**
* If enabled, the adapter will create directories when writing files.
*
* Default: true
*/
directoryEmulation?: boolean;
}