module cleanup
This commit is contained in:
34
core/media/application/ports/MediaStoragePort.ts
Normal file
34
core/media/application/ports/MediaStoragePort.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Port: MediaStoragePort
|
||||
*
|
||||
* Defines the contract for media file storage operations.
|
||||
*/
|
||||
|
||||
export interface UploadOptions {
|
||||
filename: string;
|
||||
mimeType: string;
|
||||
metadata?: Record<string, any>;
|
||||
}
|
||||
|
||||
export interface UploadResult {
|
||||
success: boolean;
|
||||
url?: string;
|
||||
filename?: string;
|
||||
errorMessage?: string;
|
||||
}
|
||||
|
||||
export interface MediaStoragePort {
|
||||
/**
|
||||
* Upload a media file
|
||||
* @param buffer File buffer
|
||||
* @param options Upload options
|
||||
* @returns Upload result with URL
|
||||
*/
|
||||
uploadMedia(buffer: Buffer, options: UploadOptions): Promise<UploadResult>;
|
||||
|
||||
/**
|
||||
* Delete a media file by URL
|
||||
* @param url Media URL to delete
|
||||
*/
|
||||
deleteMedia(url: string): Promise<void>;
|
||||
}
|
||||
Reference in New Issue
Block a user