< Summary

Information
Class: Chronicis.Api.Services.BlobMetadata
Assembly: Chronicis.Api
File(s): /home/runner/work/chronicis/chronicis/src/Chronicis.Api/Services/IBlobStorageService.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 2
Coverable lines: 2
Total lines: 62
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_SizeBytes()100%210%
get_ContentType()100%210%

File(s)

/home/runner/work/chronicis/chronicis/src/Chronicis.Api/Services/IBlobStorageService.cs

#LineLine coverage
 1namespace Chronicis.Api.Services;
 2
 3/// <summary>
 4/// Service for managing Azure Blob Storage operations for world documents.
 5/// </summary>
 6public interface IBlobStorageService
 7{
 8    /// <summary>
 9    /// Generate a SAS URL for uploading a file directly from the client.
 10    /// </summary>
 11    /// <param name="worldId">The world ID for scoping the blob path.</param>
 12    /// <param name="documentId">The document ID (pre-created).</param>
 13    /// <param name="fileName">The original filename.</param>
 14    /// <param name="contentType">The MIME type of the file.</param>
 15    /// <returns>SAS URL valid for 15 minutes with write-only permissions.</returns>
 16    Task<string> GenerateUploadSasUrlAsync(Guid worldId, Guid documentId, string fileName, string contentType);
 17
 18    /// <summary>
 19    /// Verify that a blob exists and get its metadata.
 20    /// </summary>
 21    /// <param name="blobPath">The blob path to verify.</param>
 22    /// <returns>Metadata including size and content type, or null if not found.</returns>
 23    Task<BlobMetadata?> GetBlobMetadataAsync(string blobPath);
 24
 25    /// <summary>
 26    /// Open a read-only stream for the blob content.
 27    /// </summary>
 28    /// <param name="blobPath">The blob path to read.</param>
 29    /// <returns>Stream for reading the blob content.</returns>
 30    Task<Stream> OpenReadAsync(string blobPath);
 31
 32    /// <summary>
 33    /// Delete a blob from storage.
 34    /// </summary>
 35    /// <param name="blobPath">The blob path to delete.</param>
 36    Task DeleteBlobAsync(string blobPath);
 37
 38    /// <summary>
 39    /// Generate a SAS URL for downloading a file directly from the client.
 40    /// </summary>
 41    /// <param name="blobPath">The blob path to generate download URL for.</param>
 42    /// <returns>SAS URL valid for 15 minutes with read-only permissions.</returns>
 43    Task<string> GenerateDownloadSasUrlAsync(string blobPath);
 44
 45    /// <summary>
 46    /// Build the blob path for a document.
 47    /// </summary>
 48    /// <param name="worldId">The world ID.</param>
 49    /// <param name="documentId">The document ID.</param>
 50    /// <param name="fileName">The sanitized filename.</param>
 51    /// <returns>The blob path.</returns>
 52    string BuildBlobPath(Guid worldId, Guid documentId, string fileName);
 53}
 54
 55/// <summary>
 56/// Metadata about a blob in storage.
 57/// </summary>
 58public class BlobMetadata
 59{
 060    public long SizeBytes { get; set; }
 061    public string ContentType { get; set; } = string.Empty;
 62}

Methods/Properties

get_SizeBytes()
get_ContentType()