/** * Storage Categories & Bucket Organization * * Provider-agnostic storage organization by PURPOSE and CONTENT TYPE. * Adapters internally translate these purposes to their naming conventions. * * Universal approach: * - Define buckets by PURPOSE (compliance, media-images, backups, etc.) * - Paths are universal across all providers * - Adapters handle their own naming rules internally * * @module @plyaz/storage/utils */ import type { UploadParams, BucketConfiguration, StorageCategory } from '@plyaz/types/storage'; import { BUCKET_PURPOSE } from '@plyaz/types/storage'; /** * Storage Category Classifier * Determines bucket purpose from upload parameters */ export declare class StorageCategoryClassifier { /** * Classify upload into bucket purpose * Provider-agnostic classification by content type */ static classify(params: UploadParams): BUCKET_PURPOSE; /** * Classify media type from parameters */ private static classifyMediaType; /** * Check if params indicate an image */ private static isImageCategory; /** * Check if params indicate a video */ private static isVideoCategory; /** * Check if file is temporary (TTL less than 7 days) */ private static isTemporaryFile; /** * Get category metadata */ static getCategory(purpose: BUCKET_PURPOSE): StorageCategory; /** * Check if purpose requires compliance logging */ static requiresCompliance(purpose: BUCKET_PURPOSE): boolean; /** * Check if purpose supports public access */ static supportsPublicAccess(purpose: BUCKET_PURPOSE): boolean; /** * Get recommended retention period in days */ static getRecommendedRetention(purpose: BUCKET_PURPOSE): number | undefined; /** * Generate bucket configuration from upload params * Provider-agnostic configuration based on content */ static generateConfig(params: UploadParams): BucketConfiguration; } /** * Bucket identifier generator * Creates unique, human-readable bucket identifiers * NOT the final bucket name (adapters handle that) */ export declare class BucketIdentifier { /** * Generate unique bucket identifier * This is NOT the provider-specific name, just an identifier */ static generate(config: BucketConfiguration): string; /** * Parse bucket identifier back to configuration */ static parse(identifier: string): Partial; private static sanitize; } /** * Example adapter bucket name translation: * * Identifier: "compliance:enterprise:acme-corp:prod" * * CloudflareR2Adapter translates to: * → plyaz-prod-weur-enterprise-acme-corp-records-vault * * SupabaseStorageAdapter translates to: * → compliance-acme-corp (projects handle env) * * S3Adapter translates to: * → plyaz-compliance-enterprise-acme-corp-prod-us-east-1 * * All use the SAME paths internally! */