cloud-agnostic-storage
Version:
A package which enables cloud agnostic storage for a NodeJS project.
58 lines (48 loc) • 1.52 kB
text/typescript
import CloudStorageService from "./CloudStorageService";
import {
CloudStorageConfig,
FileDeleteResponse,
FileDownloadResponse,
FileUploadResponse,
} from "../models/CloudStorageService.models";
class AzureCloudStorageService extends CloudStorageService {
constructor(config: CloudStorageConfig) {
super(config);
// NOTE: Will instantiate the Blob client here
// this.blobClient = BlobServiceClient.fromConnectionString(
// AZURE_STORAGE_CONNECTION_STRING
// );
}
async uploadFileAsync(
containerName: string,
objectName: string
): Promise<FileUploadResponse> {
// NOTE: Will be replaced with actual implementation.
const response: FileUploadResponse = {
message: "File uploaded to AZURE 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 AZURE 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 AZURE cloud.",
};
return response;
}
}
export default AzureCloudStorageService;