Member Junction
    Preparing search index...

    Interface IAttachmentBlobStore

    Blob operations an attachment needs, behind a seam so attachment policy does not depend on any particular storage implementation — or on there being one.

    Implementations are responsible for the MJ: Files record alongside the bytes, because the two must not diverge: a catalog row without content, or content without a row, is worse than a failed upload.

    interface IAttachmentBlobStore {
        Delete(
            fileId: string,
            contextUser: UserInfo,
            provider?: IMetadataProvider,
        ): Promise<boolean>;
        Download(
            fileId: string,
            contextUser: UserInfo,
            provider?: IMetadataProvider,
        ): Promise<string>;
        GetDownloadUrl(
            fileId: string,
            contextUser: UserInfo,
            provider?: IMetadataProvider,
        ): Promise<string>;
        Upload(
            input: AttachmentBlobUploadInput,
            contextUser: UserInfo,
            provider?: IMetadataProvider,
        ): Promise<AttachmentBlobUploadResult>;
    }
    Index

    Methods

    • Deletes both the stored bytes and the MJ: Files record.

      Parameters

      Returns Promise<boolean>

      true when the blob was deleted. A false here means the caller should leave the attachment row alone rather than orphan it.

    • Reads a stored file's content.

      Parameters

      Returns Promise<string>

      Base64-encoded content, or null when the file or its storage cannot be resolved.

    • Mints a pre-authenticated download URL for a stored file.

      Preferred over Download when the consumer can fetch the URL itself — it avoids moving the bytes through this process.

      Parameters

      Returns Promise<string>

      The URL, or null when one cannot be produced.