Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 10 additions & 19 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.7'

services:

mongodb:
Expand All @@ -19,29 +17,16 @@ services:
volumes:
- pgdata:/var/lib/postgresql/data

mysql:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: 'elsa'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'password'
MYSQL_ROOT_PASSWORD: 'password'
ports:
- '3306:3306'
expose:
- '3306'

mysql-arm:
image: arm64v8/mysql:8
mysql-v8:
image: mysql:8
restart: always
environment:
MYSQL_DATABASE: 'Elsa'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'password'
MYSQL_ROOT_PASSWORD: 'password'
ports:
- '3306:3306'
- '3306:3306'
expose:
- '3306'

Expand All @@ -58,8 +43,14 @@ services:
ports:
- "1433:1433"

# Azurite (Official Microsoft Local Emulator)
azureblobstorage:
image: mcr.microsoft.com/azure-blob-storage
image: mcr.microsoft.com/azure-storage/azurite
restart: always
ports:
- "10000:10000" # Blob service port
- "10001:10001" # Queue service port
- "10002:10002" # Table service port

redis:
image: redis
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,22 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.3.0" />
<ProjectReference Include="..\Elsa.Activities.Http\Elsa.Activities.Http.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Elsa.Activities.Http\Elsa.Activities.Http.csproj" />
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.3.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.3.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net10.0'">
<PackageReference Include="System.Linq.Async" Version="6.0.1">
<ExcludeAssets>compile</ExcludeAssets>
</PackageReference>
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="10.1.7" />
<PackageReference Include="System.Linq.Async" Version="6.0.1">
<ExcludeAssets>compile</ExcludeAssets>
</PackageReference>
</ItemGroup>


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Runtime.CompilerServices;
using System.Runtime.CompilerServices;
using Elsa.Activities.Http.Bookmarks;
using Elsa.Activities.Http.Options;
using Elsa.Models;
Expand All @@ -7,7 +7,11 @@
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
#if NET10_0_OR_GREATER
using Microsoft.OpenApi;
#else
using Microsoft.OpenApi.Models;
#endif
using Open.Linq.AsyncExtensions;
using Swashbuckle.AspNetCore.SwaggerGen;

Expand All @@ -31,12 +35,16 @@ public HttpEndpointDocumentFilter(IServiceScopeFactory scopeFactory, ISchemaGene

public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
{
#if NET10_0_OR_GREATER
swaggerDoc.Tags ??= new HashSet<OpenApiTag>();
#else
swaggerDoc.Tags ??= new List<OpenApiTag>();
#endif

var tag = new OpenApiTag
{
Name = "Workflow Endpoints",
Description = "A collection of HTTP endpoints exposed by workflows",
Description = "A collection of HTTP endpoints exposed by workflows"
};

var schemaRepository = context.SchemaRepository;
Expand All @@ -55,17 +63,21 @@ public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
Description = first.Description,
Operations = grouping.ToDictionary(GetOperationType, httpEndpoint =>
{
var operation = new OpenApiOperation
{
Tags = { tag },
};
var operation = new OpenApiOperation();

#if NET10_0_OR_GREATER
operation.Tags ??= new HashSet<OpenApiTagReference>();
operation.Tags.Add(new OpenApiTagReference(tag.Name, swaggerDoc));
#else
operation.Tags.Add(tag);
#endif

if (httpEndpoint.TargetType != null || httpEndpoint.JsonSchema != null)
if (httpEndpoint.TargetType != null || !string.IsNullOrWhiteSpace(httpEndpoint.JsonSchema))
{
operation.RequestBody = new OpenApiRequestBody
{
Required = true,
Content =
Content = new Dictionary<string, OpenApiMediaType>
{
["Unspecified"] = new OpenApiMediaType
{
Expand Down Expand Up @@ -126,19 +138,35 @@ private async Task<HttpEndpointDescriptor> GetHttpEndpointDescriptor(
return new HttpEndpointDescriptor(activityId, path, method, displayName, description, targetType, schema);
}

#if NET10_0_OR_GREATER
private HttpMethod GetOperationType(HttpEndpointDescriptor httpEndpoint) =>
httpEndpoint.Method switch
{
{ } s when s.Equals(HttpMethods.Get, StringComparison.OrdinalIgnoreCase) => HttpMethod.Get,
{ } s when s.Equals(HttpMethods.Post, StringComparison.OrdinalIgnoreCase) => HttpMethod.Post,
{ } s when s.Equals(HttpMethods.Patch, StringComparison.OrdinalIgnoreCase) => HttpMethod.Patch,
{ } s when s.Equals(HttpMethods.Delete, StringComparison.OrdinalIgnoreCase) => HttpMethod.Delete,
{ } s when s.Equals(HttpMethods.Put, StringComparison.OrdinalIgnoreCase) => HttpMethod.Put,
{ } s when s.Equals(HttpMethods.Options, StringComparison.OrdinalIgnoreCase) => HttpMethod.Options,
{ } s when s.Equals(HttpMethods.Head, StringComparison.OrdinalIgnoreCase) => HttpMethod.Head,
{ } s when s.Equals(HttpMethods.Trace, StringComparison.OrdinalIgnoreCase) => HttpMethod.Trace,
_ => HttpMethod.Get
};
#else
private OperationType GetOperationType(HttpEndpointDescriptor httpEndpoint) =>
httpEndpoint.Method switch
{
{ } s when s.Equals(HttpMethods.Get, StringComparison.OrdinalIgnoreCase) => OperationType.Get,
{ } s when s.Equals(HttpMethods.Post, StringComparison.OrdinalIgnoreCase) => OperationType.Post,
{ } s when s.Equals(HttpMethods.Patch, StringComparison.OrdinalIgnoreCase) => OperationType.Patch,
{ } s when s.Equals(HttpMethods.Delete, StringComparison.OrdinalIgnoreCase) => OperationType.Delete,
{ } s when s.Equals(HttpMethods.Put, StringComparison.OrdinalIgnoreCase) => OperationType.Patch,
{ } s when s.Equals(HttpMethods.Put, StringComparison.OrdinalIgnoreCase) => OperationType.Put,
{ } s when s.Equals(HttpMethods.Options, StringComparison.OrdinalIgnoreCase) => OperationType.Options,
{ } s when s.Equals(HttpMethods.Head, StringComparison.OrdinalIgnoreCase) => OperationType.Head,
{ } s when s.Equals(HttpMethods.Trace, StringComparison.OrdinalIgnoreCase) => OperationType.Trace,
_ => OperationType.Get
};
#endif
}

internal record HttpEndpointDescriptor(string Id, string Path, string Method, string? DisplayName, string? Description, Type? TargetType, string? JsonSchema);
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<PackageReference Include="Refit" Version="8.0.0" />
<PackageReference Include="Refit.HttpClientFactory" Version="6.0.94" />
<PackageReference Include="Refit.Newtonsoft.Json" Version="6.0.94" />
<PackageReference Include="System.Text.Encodings.Web" Version="9.0.1" />
<PackageReference Include="System.Text.Encodings.Web" Version="10.0.8" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net10.0'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.16" />
<PackageReference Include="Quartz" Version="3.5.0" />
<PackageReference Include="Quartz.Extensions.DependencyInjection" Version="3.5.0" />
<PackageReference Include="Quartz.Extensions.Hosting" Version="3.5.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\..\..\common.props" />
<Import Project="..\..\..\..\configureawait.props" />
Expand All @@ -13,8 +13,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Text.Encodings.Web" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="System.Text.Encodings.Web" Version="10.0.8" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Import Project="..\..\..\..\configureawait.props" />

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<Description>
Elsa is a set of workflow libraries and tools that enable lean and mean workflowing capabilities in any .NET Core application.
This package provides the MySql EF Core provider for Webhook persistence.
Expand All @@ -17,23 +17,15 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.0-beta.2" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.3" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0-preview.2.efcore.9.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0-preview.2.efcore.9.0.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.0">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.0">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.0">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion src/clients/Elsa.Client/Elsa.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="NodaTime" Version="3.0.9" />
<PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.0.0" />
<PackageReference Include="Refit" Version="8.0.0" />
Expand Down
13 changes: 7 additions & 6 deletions src/core/Elsa.Abstractions/Elsa.Abstractions.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\..\common.props" />
<Import Project="..\..\..\configureawait.props" />
Expand All @@ -18,17 +18,18 @@
<PackageReference Include="LinqKit.Core" Version="1.2.5" />
<PackageReference Include="MediatR" Version="12.4.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.16" />
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Primitives" Version="6.0.0" />
<PackageReference Include="NodaTime" Version="3.0.9" />
<PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.0.0" />
<PackageReference Include="Open.Linq.AsyncExtensions" Version="1.2.0" />
<PackageReference Include="Rebus" Version="8.7.1" />
<PackageReference Include="Rebus" Version="8.9.2" />
<PackageReference Include="System.Linq.Async" Version="5.1.0" />
<PackageReference Include="System.Text.Json" Version="9.0.1" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageReference Include="System.Text.Encodings.Web" Version="10.0.8" />
<PackageReference Include="System.Text.Json" Version="10.0.8" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
</ItemGroup>

</Project>
7 changes: 3 additions & 4 deletions src/core/Elsa.Core/Elsa.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,20 @@
<PackageReference Include="MediatR" Version="12.4.1" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection" Version="9.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.1" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.16" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.0" />
<PackageReference Include="netbox" Version="2.5.3" />
<PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.0.0" />
<PackageReference Include="Open.Linq.AsyncExtensions" Version="1.2.0" />
<PackageReference Include="Rebus.Microsoft.Extensions.Logging" Version="5.1.0" />
<PackageReference Include="Rebus.ServiceProvider" Version="10.3.0" />
<PackageReference Include="Rebus.Microsoft.Extensions.Logging" Version="5.2.0" />
<PackageReference Include="Rebus.ServiceProvider" Version="10.7.2" />
<PackageReference Include="Scrutor" Version="3.3.0" />
<PackageReference Include="System.Linq.Async" Version="5.1.0" />
<PackageReference Include="System.Threading.Channels" Version="9.0.0" />
Expand Down
2 changes: 1 addition & 1 deletion src/core/Elsa/Elsa.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.16" />
</ItemGroup>

</Project>
Loading
Loading