feat(transport): add IBundleExporter / IBundleImporter interfaces

This commit is contained in:
Joseph Doherty
2026-05-24 03:47:27 -04:00
parent 7e89f2092f
commit 9442c9a92c
9 changed files with 107 additions and 0 deletions
@@ -0,0 +1,11 @@
namespace ScadaLink.Commons.Interfaces.Transport;
/// <summary>
/// Scoped service the bundle importer sets to thread a BundleImportId through to
/// the audit log entries emitted by the audited repository methods invoked during
/// ApplyAsync. AuditService reads this and stamps every AuditLogEntry it writes.
/// </summary>
public interface IAuditCorrelationContext
{
Guid? BundleImportId { get; set; }
}
@@ -0,0 +1,13 @@
using ScadaLink.Commons.Types.Transport;
namespace ScadaLink.Commons.Interfaces.Transport;
public interface IBundleExporter
{
Task<Stream> ExportAsync(
ExportSelection selection,
string user,
string sourceEnvironment,
string? passphrase,
CancellationToken cancellationToken = default);
}
@@ -0,0 +1,14 @@
using ScadaLink.Commons.Types.Transport;
namespace ScadaLink.Commons.Interfaces.Transport;
public interface IBundleImporter
{
Task<BundleSession> LoadAsync(Stream bundleStream, string? passphrase, CancellationToken ct = default);
Task<ImportPreview> PreviewAsync(Guid sessionId, CancellationToken ct = default);
Task<ImportResult> ApplyAsync(
Guid sessionId,
IReadOnlyList<ImportResolution> resolutions,
string user,
CancellationToken ct = default);
}
@@ -0,0 +1,11 @@
using ScadaLink.Commons.Types.Transport;
namespace ScadaLink.Commons.Interfaces.Transport;
public interface IBundleSessionStore
{
BundleSession Open(BundleSession session);
BundleSession? Get(Guid sessionId);
void Remove(Guid sessionId);
void EvictExpired();
}