chore(): start moving some packages to the core directory (#7215)
This commit is contained in:
committed by
GitHub
parent
fdee748eed
commit
bbccd6481d
24
packages/core/utils/src/file/abstract-file-provider.ts
Normal file
24
packages/core/utils/src/file/abstract-file-provider.ts
Normal file
@@ -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
packages/core/utils/src/file/index.ts
Normal file
1
packages/core/utils/src/file/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./abstract-file-provider"
|
||||
Reference in New Issue
Block a user