mirror of
https://git.meshkee.com/BaloutPastry/backend.git
synced 2026-08-11 22:31:00 +04:30
37 lines
909 B
TypeScript
37 lines
909 B
TypeScript
/**
|
|
* Parspack S3 object key layout (path-style public URLs):
|
|
*
|
|
* balout/
|
|
* products/main/{uuid}{ext}
|
|
* products/gallery/{uuid}{ext}
|
|
* categories/{uuid}{ext}
|
|
* branches/{uuid}{ext}
|
|
* users/{uuid}{ext}
|
|
* temp/{uuid}{ext}
|
|
*/
|
|
const ROOT = 'balout';
|
|
|
|
export function productMainKey(fileName: string): string {
|
|
return `${ROOT}/products/main/${fileName}`;
|
|
}
|
|
|
|
export function productGalleryKey(fileName: string): string {
|
|
return `${ROOT}/products/gallery/${fileName}`;
|
|
}
|
|
|
|
export function categoryMediaKey(fileName: string): string {
|
|
return `${ROOT}/categories/${fileName}`;
|
|
}
|
|
|
|
export function branchMediaKey(fileName: string): string {
|
|
return `${ROOT}/branches/${fileName}`;
|
|
}
|
|
|
|
export function userMediaKey(fileName: string): string {
|
|
return `${ROOT}/users/${fileName}`;
|
|
}
|
|
|
|
export function tempMediaKey(fileName: string): string {
|
|
return `${ROOT}/temp/${fileName}`;
|
|
}
|