@slickteam/nestjs-cellar
Version:
Module for Cellar with Nestjs
17 lines (16 loc) • 1.02 kB
TypeScript
import { DeleteObjectCommandOutput, GetObjectCommandOutput, ObjectCannedACL, PutObjectCommandOutput, S3Client } from '@aws-sdk/client-s3';
import { ConfigService } from '@nestjs/config';
import { CellarBucketObjectListContentItem, CellarUploadFile } from './cellar.interface';
export declare class CellarService {
private configService;
readonly timeoutSignedUrl: number;
readonly s3EndPoint: string;
readonly s3Client: S3Client;
constructor(configService: ConfigService);
listObjectsByBucketName(bucketName: string): Promise<CellarBucketObjectListContentItem[]>;
uploadFile(bucketName: string, file: CellarUploadFile, acl?: ObjectCannedACL): Promise<PutObjectCommandOutput>;
getFile(bucketName: string, fileName: string): Promise<GetObjectCommandOutput>;
deleteFile(bucketName: string, fileName: string): Promise<DeleteObjectCommandOutput>;
fileExists(bucketName: string, fileName: string): Promise<boolean>;
getSignedUrl(bucketName: string, fileName: string): Promise<string>;
}