Files
backend/src/storage/storage-keys.ts
T

51 lines
1.3 KiB
TypeScript

/**
* Parspack S3 object key layout (same bucket as Mado/Balout):
*
* mana-collection/
* products/main/{uuid}{ext}
* products/gallery/{uuid}{ext}
* blogs/{uuid}{ext}
* brands/{uuid}{ext}
* users/{uuid}{ext}
* stores/{uuid}{ext}
* partnership/{uuid}{ext}
* temp/{uuid}{ext}
*/
const ROOT = 'mana-collection';
export function productMainKey(fileName: string): string {
return `${ROOT}/products/main/${fileName}`;
}
export function productGalleryKey(fileName: string): string {
return `${ROOT}/products/gallery/${fileName}`;
}
export function blogMediaKey(fileName: string): string {
return `${ROOT}/blogs/${fileName}`;
}
export function brandMediaKey(fileName: string): string {
return `${ROOT}/brands/${fileName}`;
}
export function userMediaKey(fileName: string): string {
return `${ROOT}/users/${fileName}`;
}
export function storeMediaKey(fileName: string): string {
return `${ROOT}/stores/${fileName}`;
}
export function websiteMediaKey(fileName: string): string {
return `${ROOT}/website/${fileName}`;
}
export function partnershipMediaKey(fileName: string): string {
return `${ROOT}/partnership/${fileName}`;
}
export function tempMediaKey(fileName: string): string {
return `${ROOT}/temp/${fileName}`;
}