diff --git a/src/apps/Elsa.Server.Web/Program.cs b/src/apps/Elsa.Server.Web/Program.cs index edc03cffd..3d9f61f27 100644 --- a/src/apps/Elsa.Server.Web/Program.cs +++ b/src/apps/Elsa.Server.Web/Program.cs @@ -2,6 +2,7 @@ using System.Text.Encodings.Web; using Elsa.Alterations.Extensions; using Elsa.Alterations.MassTransit.Extensions; using Elsa.Caching.Options; +using Elsa.Common.Codecs; using Elsa.Common.DistributedHosting.DistributedLocks; using Elsa.Common.RecurringTasks; using Elsa.Common.Serialization; @@ -51,7 +52,6 @@ using Elsa.Workflows.CommitStates.Strategies; using Elsa.Workflows.IncidentStrategies; using Elsa.Workflows.LogPersistence; using Elsa.Workflows.Management; -using Elsa.Workflows.Management.Compression; using Elsa.Workflows.Management.Stores; using Elsa.Workflows.Memory; using Elsa.Workflows.Options; diff --git a/src/modules/Elsa.Workflows.Management/Compression/GZip.cs b/src/modules/Elsa.Common/Codecs/GZip.cs similarity index 96% rename from src/modules/Elsa.Workflows.Management/Compression/GZip.cs rename to src/modules/Elsa.Common/Codecs/GZip.cs index d00b5b819..b7b3d1eda 100644 --- a/src/modules/Elsa.Workflows.Management/Compression/GZip.cs +++ b/src/modules/Elsa.Common/Codecs/GZip.cs @@ -1,7 +1,7 @@ using System.IO.Compression; using System.Text; -namespace Elsa.Workflows.Management.Compression; +namespace Elsa.Common.Codecs; /// /// Represents a GZip compression strategy. diff --git a/src/modules/Elsa.Workflows.Management/Compression/None.cs b/src/modules/Elsa.Common/Codecs/None.cs similarity index 91% rename from src/modules/Elsa.Workflows.Management/Compression/None.cs rename to src/modules/Elsa.Common/Codecs/None.cs index 48c41c8e9..5e2dc800b 100644 --- a/src/modules/Elsa.Workflows.Management/Compression/None.cs +++ b/src/modules/Elsa.Common/Codecs/None.cs @@ -1,4 +1,4 @@ -namespace Elsa.Workflows.Management.Compression; +namespace Elsa.Common.Codecs; /// /// Represents a compression strategy that does not compress or decompress the input. diff --git a/src/modules/Elsa.Workflows.Management/Compression/Zstd.cs b/src/modules/Elsa.Common/Codecs/Zstd.cs similarity index 95% rename from src/modules/Elsa.Workflows.Management/Compression/Zstd.cs rename to src/modules/Elsa.Common/Codecs/Zstd.cs index cb5fd9494..11a49c5d6 100644 --- a/src/modules/Elsa.Workflows.Management/Compression/Zstd.cs +++ b/src/modules/Elsa.Common/Codecs/Zstd.cs @@ -1,7 +1,7 @@ using System.Text; using IronCompress; -namespace Elsa.Workflows.Management.Compression; +namespace Elsa.Common.Codecs; /// /// Represents a ZSTD compression strategy. diff --git a/src/modules/Elsa.Workflows.Management/Contracts/ICompressionCodec.cs b/src/modules/Elsa.Common/Contracts/ICompressionCodec.cs similarity index 92% rename from src/modules/Elsa.Workflows.Management/Contracts/ICompressionCodec.cs rename to src/modules/Elsa.Common/Contracts/ICompressionCodec.cs index 82cb7e402..c34a0dc3d 100644 --- a/src/modules/Elsa.Workflows.Management/Contracts/ICompressionCodec.cs +++ b/src/modules/Elsa.Common/Contracts/ICompressionCodec.cs @@ -1,4 +1,4 @@ -namespace Elsa.Workflows.Management; +namespace Elsa.Common; /// /// Represents a compression strategy. diff --git a/src/modules/Elsa.Workflows.Management/Contracts/ICompressionCodecResolver.cs b/src/modules/Elsa.Common/Contracts/ICompressionCodecResolver.cs similarity index 88% rename from src/modules/Elsa.Workflows.Management/Contracts/ICompressionCodecResolver.cs rename to src/modules/Elsa.Common/Contracts/ICompressionCodecResolver.cs index 852b95ab0..86494155c 100644 --- a/src/modules/Elsa.Workflows.Management/Contracts/ICompressionCodecResolver.cs +++ b/src/modules/Elsa.Common/Contracts/ICompressionCodecResolver.cs @@ -1,4 +1,4 @@ -namespace Elsa.Workflows.Management; +namespace Elsa.Common; /// /// Resolves a from its name. diff --git a/src/modules/Elsa.Common/Elsa.Common.csproj b/src/modules/Elsa.Common/Elsa.Common.csproj index 654e988e5..9b5d15779 100644 --- a/src/modules/Elsa.Common/Elsa.Common.csproj +++ b/src/modules/Elsa.Common/Elsa.Common.csproj @@ -16,6 +16,7 @@ + diff --git a/src/modules/Elsa.Common/Features/CompressionFeature.cs b/src/modules/Elsa.Common/Features/CompressionFeature.cs new file mode 100644 index 000000000..f6b5955c1 --- /dev/null +++ b/src/modules/Elsa.Common/Features/CompressionFeature.cs @@ -0,0 +1,21 @@ +using Elsa.Common.Codecs; +using Elsa.Common.Services; +using Elsa.Features.Abstractions; +using Elsa.Features.Services; +using JetBrains.Annotations; +using Microsoft.Extensions.DependencyInjection; + +namespace Elsa.Common.Features; + +[UsedImplicitly] +public class CompressionFeature(IModule module) : FeatureBase(module) +{ + public override void Apply() + { + Services + .AddSingleton() + .AddSingleton() + .AddSingleton() + .AddSingleton(); + } +} \ No newline at end of file diff --git a/src/modules/Elsa.Workflows.Management/Services/CompressionCodecResolver.cs b/src/modules/Elsa.Common/Services/CompressionCodecResolver.cs similarity index 86% rename from src/modules/Elsa.Workflows.Management/Services/CompressionCodecResolver.cs rename to src/modules/Elsa.Common/Services/CompressionCodecResolver.cs index 77b7bc77e..1cd3a1156 100644 --- a/src/modules/Elsa.Workflows.Management/Services/CompressionCodecResolver.cs +++ b/src/modules/Elsa.Common/Services/CompressionCodecResolver.cs @@ -1,6 +1,6 @@ -using Elsa.Workflows.Management.Compression; +using Elsa.Common.Codecs; -namespace Elsa.Workflows.Management.Services; +namespace Elsa.Common.Services; /// public class CompressionCodecResolver : ICompressionCodecResolver diff --git a/src/modules/Elsa.EntityFrameworkCore/Modules/Management/WorkflowInstanceStore.cs b/src/modules/Elsa.EntityFrameworkCore/Modules/Management/WorkflowInstanceStore.cs index 79bee6bb7..69ca5afd5 100644 --- a/src/modules/Elsa.EntityFrameworkCore/Modules/Management/WorkflowInstanceStore.cs +++ b/src/modules/Elsa.EntityFrameworkCore/Modules/Management/WorkflowInstanceStore.cs @@ -1,10 +1,11 @@ using System.Diagnostics.CodeAnalysis; +using Elsa.Common; +using Elsa.Common.Codecs; using Elsa.Common.Entities; using Elsa.Common.Models; using Elsa.Extensions; using Elsa.Workflows; using Elsa.Workflows.Management; -using Elsa.Workflows.Management.Compression; using Elsa.Workflows.Management.Entities; using Elsa.Workflows.Management.Filters; using Elsa.Workflows.Management.Models; diff --git a/src/modules/Elsa.EntityFrameworkCore/Modules/Runtime/ActivityExecutionLogStore.cs b/src/modules/Elsa.EntityFrameworkCore/Modules/Runtime/ActivityExecutionLogStore.cs index 08229ccf9..43cb9fec6 100644 --- a/src/modules/Elsa.EntityFrameworkCore/Modules/Runtime/ActivityExecutionLogStore.cs +++ b/src/modules/Elsa.EntityFrameworkCore/Modules/Runtime/ActivityExecutionLogStore.cs @@ -1,9 +1,9 @@ using System.Diagnostics.CodeAnalysis; using System.Text.Json; +using Elsa.Common; +using Elsa.Common.Codecs; using Elsa.Extensions; using Elsa.Workflows; -using Elsa.Workflows.Management; -using Elsa.Workflows.Management.Compression; using Elsa.Workflows.Management.Options; using Elsa.Workflows.Runtime; using Elsa.Workflows.Runtime.Entities; diff --git a/src/modules/Elsa.Workflows.Management/Features/WorkflowManagementFeature.cs b/src/modules/Elsa.Workflows.Management/Features/WorkflowManagementFeature.cs index 71bf63fe0..76e53ea19 100644 --- a/src/modules/Elsa.Workflows.Management/Features/WorkflowManagementFeature.cs +++ b/src/modules/Elsa.Workflows.Management/Features/WorkflowManagementFeature.cs @@ -5,6 +5,7 @@ using System.Reflection; using System.Text.Json; using System.Text.Json.Nodes; using Elsa.Caching.Features; +using Elsa.Common.Codecs; using Elsa.Common.Features; using Elsa.Expressions.Contracts; using Elsa.Extensions; @@ -14,10 +15,8 @@ using Elsa.Features.Services; using Elsa.Workflows.Features; using Elsa.Workflows.LogPersistence; using Elsa.Workflows.Management.Activities.WorkflowDefinitionActivity; -using Elsa.Workflows.Management.Compression; using Elsa.Workflows.Management.Contracts; using Elsa.Workflows.Management.Entities; -using Elsa.Workflows.Management.Handlers; using Elsa.Workflows.Management.Handlers.Notifications; using Elsa.Workflows.Management.Mappers; using Elsa.Workflows.Management.Materializers; @@ -35,9 +34,10 @@ namespace Elsa.Workflows.Management.Features; /// /// Installs and configures the workflow management feature. /// +[DependsOn(typeof(CompressionFeature))] [DependsOn(typeof(MediatorFeature))] -[DependsOn(typeof(SystemClockFeature))] [DependsOn(typeof(MemoryCacheFeature))] +[DependsOn(typeof(SystemClockFeature))] [DependsOn(typeof(WorkflowsFeature))] [DependsOn(typeof(WorkflowDefinitionsFeature))] [DependsOn(typeof(WorkflowInstancesFeature))] @@ -234,10 +234,6 @@ public class WorkflowManagementFeature(IModule module) : FeatureBase(module) .AddScoped() .AddSingleton() .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddSingleton() ; Services