UNPKG

cloud-agnostic-storage

Version:

A package which enables cloud agnostic storage for a NodeJS project.

55 lines (46 loc) 1.43 kB
import CloudStorageService from "./CloudStorageService"; import { CloudStorageConfig, FileDeleteResponse, FileDownloadResponse, FileUploadResponse, } from "../models/CloudStorageService.models"; class AWSCloudStorageService extends CloudStorageService { constructor(config: CloudStorageConfig) { super(config); // NOTE: Will instantiate the S3 client here // this.s3Client = new AWS.S3(config); } async uploadFileAsync( containerName: string, objectName: string ): Promise<FileUploadResponse> { // NOTE: Will be replaced with actual implementation. const response: FileUploadResponse = { message: "File uploaded to AWS cloud.", }; return response; } async downloadFileAsync( containerName: string, objectName: string, versionId: string = "" ): Promise<FileDownloadResponse> { // NOTE: Will be replaced with actual implementation. const response: FileUploadResponse = { message: "File downloaded from AWS cloud.", }; return response; } async deleteFileAsync( containerName: string, objectName: string ): Promise<FileDeleteResponse> { // NOTE: Will be replaced with actual implementation. const response: FileUploadResponse = { message: "File deleted from AWS cloud.", }; return response; } } export default AWSCloudStorageService;