harden media
This commit is contained in:
@@ -27,8 +27,22 @@ export interface MediaStoragePort {
|
||||
uploadMedia(buffer: Buffer, options: UploadOptions): Promise<UploadResult>;
|
||||
|
||||
/**
|
||||
* Delete a media file by URL
|
||||
* @param url Media URL to delete
|
||||
* Delete a media file by storage key
|
||||
* @param storageKey Storage key to delete
|
||||
*/
|
||||
deleteMedia(url: string): Promise<void>;
|
||||
deleteMedia(storageKey: string): Promise<void>;
|
||||
|
||||
/**
|
||||
* Get file bytes as Buffer
|
||||
* @param storageKey Storage key
|
||||
* @returns Buffer or null if not found
|
||||
*/
|
||||
getBytes?(storageKey: string): Promise<Buffer | null>;
|
||||
|
||||
/**
|
||||
* Get file metadata
|
||||
* @param storageKey Storage key
|
||||
* @returns File metadata or null if not found
|
||||
*/
|
||||
getMetadata?(storageKey: string): Promise<{ size: number; contentType: string } | null>;
|
||||
}
|
||||
Reference in New Issue
Block a user