fix(medusa-interfaces, medusa-file-*): flag for streaming to a private bucket (#4771)
* wip: unify file service api * fix: flag type * fix: update Spaces service * fix: S3/Spaces - default to private * fix: MinIO `isPrivate` for `getPresignedDownloadUrl`, add `isPrivate` to `GetUploadedFileType` * chore: changeset
This commit is contained in:
@@ -109,9 +109,11 @@ class S3Service extends AbstractFileService implements IFileService {
|
||||
const client = this.getClient()
|
||||
const pass = new stream.PassThrough()
|
||||
|
||||
const isPrivate = fileData.isPrivate ?? true // default to private
|
||||
|
||||
const fileKey = `${fileData.name}.${fileData.ext}`
|
||||
const params: PutObjectRequest = {
|
||||
ACL: fileData.acl ?? "private",
|
||||
ACL: isPrivate ? "private" : "public-read",
|
||||
Bucket: this.bucket_,
|
||||
Body: pass,
|
||||
Key: fileKey,
|
||||
|
||||
Reference in New Issue
Block a user