feat: Add support for exporting products in backend (#8214)

CLOSES CC-221
CLOSES CC-223
CLOSES CC-224
This commit is contained in:
Stevche Radevski
2024-07-22 13:40:04 +00:00
committed by GitHub
parent e9f1aafbb1
commit 0d2e7befbd
29 changed files with 615 additions and 690 deletions
@@ -38,9 +38,9 @@ export class LocalFileService extends AbstractFileProviderService {
const fileKey = path.join(
parsedFilename.dir,
// We append "private" to the file key so deletions and presigned URLs can know which folder to look into
`${Date.now()}-${parsedFilename.base}${
file.access === "public" ? "" : "-private"
// We prepend "private" to the file key so deletions and presigned URLs can know which folder to look into
`${file.access === "public" ? "" : "private-"}${Date.now()}-${
parsedFilename.base
}`
)
@@ -57,7 +57,7 @@ export class LocalFileService extends AbstractFileProviderService {
}
async delete(file: FileTypes.ProviderDeleteFileDTO): Promise<void> {
const baseDir = file.fileKey.endsWith("-private")
const baseDir = file.fileKey.startsWith("private-")
? this.privateUploadDir_
: this.uploadDir_
@@ -77,7 +77,7 @@ export class LocalFileService extends AbstractFileProviderService {
async getPresignedDownloadUrl(
file: FileTypes.ProviderGetFileDTO
): Promise<string> {
const isPrivate = file.fileKey.endsWith("-private")
const isPrivate = file.fileKey.startsWith("private-")
const baseDir = isPrivate ? this.privateUploadDir_ : this.uploadDir_
const filePath = this.getUploadFilePath(baseDir, file.fileKey)