Introduce `getPublicUrl` in `S3Service` for generating public URLs. Replace custom file URL generation logic across services with the new method. Add media controller for file streaming and update related tests. Adjust frontend to display user roles instead of email in the sidebar. Update environment schema to include optional `API_URL`. Fix help page contact email.
39 lines
835 B
TypeScript
39 lines
835 B
TypeScript
import type { Readable } from "node:stream";
|
|
|
|
export interface IStorageService {
|
|
uploadFile(
|
|
fileName: string,
|
|
file: Buffer,
|
|
mimeType: string,
|
|
metaData?: Record<string, string>,
|
|
bucketName?: string,
|
|
): Promise<string>;
|
|
|
|
getFile(fileName: string, bucketName?: string): Promise<Readable>;
|
|
|
|
getFileUrl(
|
|
fileName: string,
|
|
expiry?: number,
|
|
bucketName?: string,
|
|
): Promise<string>;
|
|
|
|
getUploadUrl(
|
|
fileName: string,
|
|
expiry?: number,
|
|
bucketName?: string,
|
|
): Promise<string>;
|
|
|
|
deleteFile(fileName: string, bucketName?: string): Promise<void>;
|
|
|
|
getFileInfo(fileName: string, bucketName?: string): Promise<unknown>;
|
|
|
|
moveFile(
|
|
sourceFileName: string,
|
|
destinationFileName: string,
|
|
sourceBucketName?: string,
|
|
destinationBucketName?: string,
|
|
): Promise<string>;
|
|
|
|
getPublicUrl(storageKey: string): string;
|
|
}
|