Files
backend/src/storage/storage-keys.ts
T
2026-08-02 17:21:34 +03:30

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}`;
}