feat: Add local file provider and wire everything up in the file module (#7134)

This commit is contained in:
Stevche Radevski
2024-04-24 10:59:58 +02:00
committed by GitHub
parent fe68b5c0f2
commit 614d659a59
35 changed files with 684 additions and 49 deletions
@@ -0,0 +1,24 @@
import { FileTypes, IFileProvider } from "@medusajs/types"
export class AbstractFileProviderService implements IFileProvider {
static identifier: string
getIdentifier() {
return (this.constructor as any).identifier
}
async upload(
file: FileTypes.ProviderUploadFileDTO
): Promise<FileTypes.ProviderFileResultDTO> {
throw Error("upload must be overridden by the child class")
}
async delete(file: FileTypes.ProviderDeleteFileDTO): Promise<void> {
throw Error("delete must be overridden by the child class")
}
async getPresignedDownloadUrl(
fileData: FileTypes.ProviderGetFileDTO
): Promise<string> {
throw Error("getPresignedDownloadUrl must be overridden by the child class")
}
}
+1
View File
@@ -0,0 +1 @@
export * from "./abstract-file-provider"