Some checks failed
Release SharePoint Toolbox v2 / release (push) Failing after 14s
v1.1 shipped with 4 phases (25 plans), 10/10 requirements complete: - Global site selection (toolbar picker, all tabs consume) - User access audit (Graph people-picker, direct/group/inherited) - Simplified permissions (plain-language labels, risk levels, detail toggle) - Storage visualization (LiveCharts2 pie/donut + bar charts) Post-phase polish: centralized site selection (removed per-tab pickers), claims prefix stripping, StorageMetrics backfill, chart tooltip fix, summary stats in app + HTML exports. 205 tests passing, 10,484 LOC. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
42 lines
1.6 KiB
C#
42 lines
1.6 KiB
C#
using Microsoft.SharePoint.Client;
|
|
using SharepointToolbox.Core.Models;
|
|
|
|
namespace SharepointToolbox.Services;
|
|
|
|
public interface IStorageService
|
|
{
|
|
/// <summary>
|
|
/// Collects storage metrics per library/folder using SharePoint StorageMetrics API.
|
|
/// Returns a tree of StorageNode objects with aggregate size data.
|
|
/// </summary>
|
|
Task<IReadOnlyList<StorageNode>> CollectStorageAsync(
|
|
ClientContext ctx,
|
|
StorageScanOptions options,
|
|
IProgress<OperationProgress> progress,
|
|
CancellationToken ct);
|
|
|
|
/// <summary>
|
|
/// Enumerates files across all non-hidden document libraries in the site
|
|
/// and aggregates storage consumption grouped by file extension.
|
|
/// Uses CSOM CamlQuery to retrieve FileLeafRef and File_x0020_Size per file.
|
|
/// This is a separate operation from CollectStorageAsync -- it provides
|
|
/// file-type breakdown data for chart visualization.
|
|
/// </summary>
|
|
Task<IReadOnlyList<FileTypeMetric>> CollectFileTypeMetricsAsync(
|
|
ClientContext ctx,
|
|
IProgress<OperationProgress> progress,
|
|
CancellationToken ct);
|
|
|
|
/// <summary>
|
|
/// Backfills StorageNodes that have zero TotalFileCount/TotalSizeBytes
|
|
/// by enumerating files per library via CamlQuery.
|
|
/// This works around the StorageMetrics API returning zeros when the
|
|
/// caller lacks sufficient permissions or metrics haven't been calculated.
|
|
/// </summary>
|
|
Task BackfillZeroNodesAsync(
|
|
ClientContext ctx,
|
|
IReadOnlyList<StorageNode> nodes,
|
|
IProgress<OperationProgress> progress,
|
|
CancellationToken ct);
|
|
}
|