Update packages and accommodate for breaking changes
This commit is contained in:
parent
74839211b8
commit
ae46e0e143
|
|
@ -1,7 +1,7 @@
|
|||
<Project>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ConfigureAwait.Fody" Version="3.3.1" PrivateAssets="All" />
|
||||
<PackageReference Include="Fody" Version="6.5.0">
|
||||
<PackageReference Include="Fody" Version="6.5.1">
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.DataProtection" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.DataProtection" Version="5.0.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ namespace Elsa.Activities.Telnyx.Liquid
|
|||
public Task Handle(EvaluatingLiquidExpression notification, CancellationToken cancellationToken)
|
||||
{
|
||||
var context = notification.TemplateContext;
|
||||
var memberAccessStrategy = context.MemberAccessStrategy;
|
||||
var options = context.Options;
|
||||
var memberAccessStrategy = options.MemberAccessStrategy;
|
||||
|
||||
memberAccessStrategy.Register<Extension>();
|
||||
memberAccessStrategy.Register<CallAnsweredPayload>();
|
||||
|
|
|
|||
|
|
@ -20,15 +20,15 @@
|
|||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Primitives" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="5.0.5" />
|
||||
<PackageReference Include="Microsoft.Extensions.Primitives" Version="5.0.1" />
|
||||
<PackageReference Include="NodaTime" Version="3.0.5" />
|
||||
<PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.0.0" />
|
||||
<PackageReference Include="Open.Linq.AsyncExtensions" Version="1.2.0" />
|
||||
<PackageReference Include="Rebus" Version="6.5.5" />
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||
<PackageReference Include="System.Linq.Async" Version="5.0.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="5.0.1" />
|
||||
<PackageReference Include="System.Text.Json" Version="5.0.2" />
|
||||
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -32,12 +32,15 @@ namespace Elsa.Decorators
|
|||
{
|
||||
var key = $"locking-workflow-runner:{workflowInstance.Id}";
|
||||
|
||||
await using var handle = await _distributedLockProvider.AcquireLockAsync(key, _elsaOptions.DistributedLockTimeout, cancellationToken);
|
||||
await using (var handle = await _distributedLockProvider.AcquireLockAsync(key, _elsaOptions.DistributedLockTimeout, cancellationToken))
|
||||
{
|
||||
if (handle == null)
|
||||
throw new LockAcquisitionException("Could not acquire a lock within the configured amount of time");
|
||||
|
||||
if (handle == null)
|
||||
throw new LockAcquisitionException("Could not acquire a lock within the configured amount of time");
|
||||
|
||||
return await _workflowRunner.RunWorkflowAsync(workflowBlueprint, workflowInstance, activityId, input, cancellationToken);
|
||||
workflowInstance = await _workflowRunner.RunWorkflowAsync(workflowBlueprint, workflowInstance, activityId, input, cancellationToken);
|
||||
await handle.DisposeAsync();
|
||||
return workflowInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -9,7 +9,7 @@ namespace Elsa
|
|||
{
|
||||
public DistributedLockingOptions()
|
||||
{
|
||||
DistributedLockProviderFactory = sp => name => new FileDistributedLock(new DirectoryInfo(Environment.CurrentDirectory), name);
|
||||
DistributedLockProviderFactory = sp => name => new FileDistributedLock(new DirectoryInfo(Path.GetTempPath()), name);
|
||||
}
|
||||
|
||||
public Func<IServiceProvider, Func<string, IDistributedLock>> DistributedLockProviderFactory { get; set; }
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Localization" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Localization" Version="5.0.5" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
<PackageReference Include="Storage.Net" Version="9.2.7" />
|
||||
<PackageReference Include="System.Linq.Async" Version="5.0.0" />
|
||||
<PackageReference Include="System.Threading.Channels" Version="5.0.0" />
|
||||
<PackageReference Include="YamlDotNet" Version="10.0.0" />
|
||||
<PackageReference Include="YamlDotNet" Version="11.0.1" />
|
||||
<PackageReference Include="Rebus.ServiceProvider" Version="6.4.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ using Elsa.Persistence;
|
|||
using Elsa.Persistence.Specifications.WorkflowInstances;
|
||||
using Elsa.Services;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using NodaTime;
|
||||
using Open.Linq.AsyncExtensions;
|
||||
|
||||
namespace Elsa.StartupTasks
|
||||
|
|
@ -40,7 +41,7 @@ namespace Elsa.StartupTasks
|
|||
{
|
||||
var lockKey = GetType().Name;
|
||||
|
||||
await using var handle = await _distributedLockProvider.AcquireLockAsync(lockKey, default, cancellationToken);
|
||||
await using var handle = await _distributedLockProvider.AcquireLockAsync(lockKey, Duration.FromSeconds(10), cancellationToken);
|
||||
|
||||
if (handle == null)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MediatR" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components" Version="5.0.5" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<PackageReference Include="Humanizer.Core" Version="2.8.26" />
|
||||
<PackageReference Include="MediatR" Version="9.0.0" />
|
||||
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="5.0.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Grpc.Net.Client.Web" Version="2.36.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components" Version="5.0.5" />
|
||||
<PackageReference Include="protobuf-net.NodaTime" Version="3.0.101" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="5.0.5" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -13,10 +13,8 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.4" />
|
||||
<PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="5.1.29">
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.5" />
|
||||
<PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="5.1.29" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.4">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.5">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.4">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.5">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.6" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.4">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.5">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.5" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="YesSql.Core" Version="2.0.0-beta-1637" />
|
||||
<PackageReference Include="YesSql.Provider.Sqlite" Version="1.0.0-beta-1637" />
|
||||
<PackageReference Include="YesSql.Core" Version="3.0.2" />
|
||||
<PackageReference Include="YesSql.Provider.Sqlite" Version="3.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- <ItemGroup>-->
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.Data;
|
||||
using Elsa.Persistence.YesSql.Data;
|
||||
using Elsa.Persistence.YesSql.Indexes;
|
||||
|
|
@ -29,12 +30,12 @@ namespace Elsa.Persistence.YesSql
|
|||
.Column<string?>(nameof(WorkflowInstanceIndex.ContextId))
|
||||
.Column<string?>(nameof(WorkflowInstanceIndex.ContextType))
|
||||
.Column<string?>(nameof(WorkflowInstanceIndex.Name))
|
||||
.Column(nameof(WorkflowInstanceIndex.WorkflowStatus), DbType.String)
|
||||
.Column(nameof(WorkflowInstanceIndex.CreatedAt), DbType.DateTime)
|
||||
.Column(nameof(WorkflowInstanceIndex.LastExecutedAt), DbType.DateTime)
|
||||
.Column(nameof(WorkflowInstanceIndex.FinishedAt), DbType.DateTime)
|
||||
.Column(nameof(WorkflowInstanceIndex.CancelledAt), DbType.DateTime)
|
||||
.Column(nameof(WorkflowInstanceIndex.FaultedAt), DbType.DateTime)
|
||||
.Column<string>(nameof(WorkflowInstanceIndex.WorkflowStatus))
|
||||
.Column<DateTime>(nameof(WorkflowInstanceIndex.CreatedAt))
|
||||
.Column<DateTime>(nameof(WorkflowInstanceIndex.LastExecutedAt))
|
||||
.Column<DateTime>(nameof(WorkflowInstanceIndex.FinishedAt))
|
||||
.Column<DateTime>(nameof(WorkflowInstanceIndex.CancelledAt))
|
||||
.Column<DateTime>(nameof(WorkflowInstanceIndex.FaultedAt))
|
||||
,
|
||||
CollectionNames.WorkflowInstances);
|
||||
|
||||
|
|
@ -44,8 +45,8 @@ namespace Elsa.Persistence.YesSql
|
|||
.Column<string>(nameof(WorkflowInstanceBlockingActivitiesIndex.ActivityId))
|
||||
.Column<string>(nameof(WorkflowInstanceBlockingActivitiesIndex.ActivityType))
|
||||
.Column<string?>(nameof(WorkflowInstanceBlockingActivitiesIndex.CorrelationId))
|
||||
.Column(nameof(WorkflowInstanceBlockingActivitiesIndex.WorkflowStatus), DbType.String)
|
||||
.Column(nameof(WorkflowInstanceBlockingActivitiesIndex.CreatedAt), DbType.DateTime),
|
||||
.Column<string>(nameof(WorkflowInstanceBlockingActivitiesIndex.WorkflowStatus))
|
||||
.Column<DateTime>(nameof(WorkflowInstanceBlockingActivitiesIndex.CreatedAt)),
|
||||
CollectionNames.WorkflowInstances);
|
||||
|
||||
SchemaBuilder.CreateMapIndexTable<WorkflowExecutionLogRecordIndex>(
|
||||
|
|
@ -53,7 +54,7 @@ namespace Elsa.Persistence.YesSql
|
|||
.Column<string?>(nameof(WorkflowExecutionLogRecordIndex.RecordId))
|
||||
.Column<string?>(nameof(WorkflowExecutionLogRecordIndex.TenantId))
|
||||
.Column<string>(nameof(WorkflowExecutionLogRecordIndex.WorkflowInstanceId))
|
||||
.Column(nameof(WorkflowExecutionLogRecordIndex.Timestamp), DbType.DateTime),
|
||||
.Column<DateTime>(nameof(WorkflowExecutionLogRecordIndex.Timestamp)),
|
||||
CollectionNames.WorkflowExecutionLog);
|
||||
|
||||
SchemaBuilder.CreateMapIndexTable<BookmarkIndex>(
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ namespace Elsa.Persistence.YesSql.Services
|
|||
|
||||
// Apply update methods to migration class.
|
||||
|
||||
var schemaBuilder = new SchemaBuilder(_store.Configuration, await _session.DemandAsync());
|
||||
var schemaBuilder = new SchemaBuilder(_store.Configuration, await _session.BeginTransactionAsync());
|
||||
dataMigration.SchemaBuilder = schemaBuilder;
|
||||
|
||||
// Copy the object for the Linq query.
|
||||
|
|
@ -131,7 +131,7 @@ namespace Elsa.Persistence.YesSql.Services
|
|||
while (lookupTable.TryGetValue(current, out var methodInfo))
|
||||
{
|
||||
_logger.LogInformation(
|
||||
"Applying migration '{MigrationName}' from version {Version}.",
|
||||
"Applying migration '{MigrationName}' from version {Version}",
|
||||
migrationName,
|
||||
current);
|
||||
|
||||
|
|
@ -152,11 +152,11 @@ namespace Elsa.Persistence.YesSql.Services
|
|||
{
|
||||
_logger.LogError(
|
||||
ex,
|
||||
"Error while running migration version {Version} for '{MigrationName}'.",
|
||||
"Error while running migration version {Version} for '{MigrationName}'",
|
||||
current,
|
||||
migrationName);
|
||||
|
||||
_session.Cancel();
|
||||
await _session.CancelAsync();
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ namespace Elsa.Persistence.YesSql.Stores
|
|||
var existingDocument = await FindDocumentAsync(entity, cancellationToken);
|
||||
var document = Mapper.Map(entity, existingDocument);
|
||||
Session.Save(document, CollectionName);
|
||||
await Session.CommitAsync();
|
||||
await Session.SaveChangesAsync();
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
@ -59,7 +59,7 @@ namespace Elsa.Persistence.YesSql.Stores
|
|||
{
|
||||
var document = Mapper.Map<TDocument>(entity);
|
||||
Session.Save(document, CollectionName);
|
||||
await Session.CommitAsync();
|
||||
await Session.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task AddManyAsync(IEnumerable<T> entities, CancellationToken cancellationToken = default)
|
||||
|
|
@ -69,14 +69,14 @@ namespace Elsa.Persistence.YesSql.Stores
|
|||
foreach (var document in documents)
|
||||
Session.Save(document, CollectionName);
|
||||
|
||||
await Session.CommitAsync();
|
||||
await Session.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task DeleteAsync(T entity, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var document = await FindDocumentAsync(entity, cancellationToken);
|
||||
Session.Delete(document, CollectionName);
|
||||
await Session.CommitAsync();
|
||||
await Session.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task<int> DeleteManyAsync(ISpecification<T> specification, CancellationToken cancellationToken = default)
|
||||
|
|
@ -95,7 +95,7 @@ namespace Elsa.Persistence.YesSql.Stores
|
|||
}
|
||||
|
||||
_stopwatch.Restart();
|
||||
await Session.CommitAsync();
|
||||
await Session.SaveChangesAsync();
|
||||
_stopwatch.Stop();
|
||||
_logger.LogDebug("Committing deleted documents took {TimeElapsed}", _stopwatch.Elapsed);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="YesSql.Provider.Sqlite" Version="1.0.0-beta-1637" />
|
||||
<PackageReference Include="YesSql.Provider.Sqlite" Version="3.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="5.0.5" />
|
||||
<PackageReference Include="protobuf-net.Grpc.AspNetCore" Version="1.0.152" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="5.0.5" />
|
||||
<PackageReference Include="protobuf-net.Grpc.AspNetCore" Version="1.0.152" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.4" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.5" PrivateAssets="all" />
|
||||
<PackageReference Include="System.Net.Http.Json" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.4">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.5">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="5.0.5" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Fluid.Core" Version="2.0.0-beta-1001" />
|
||||
<PackageReference Include="Fluid.Core" Version="2.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@ namespace Elsa.Scripting.Liquid.Extensions
|
|||
{
|
||||
public static class TemplateContextExtensions
|
||||
{
|
||||
internal static void AddAsyncFilters(this TemplateContext templateContext, LiquidOptions options, IServiceProvider services)
|
||||
internal static void AddFilters(this TemplateContext templateContext, LiquidOptions options, IServiceProvider services)
|
||||
{
|
||||
foreach (var registration in options.FilterRegistrations)
|
||||
{
|
||||
templateContext.Filters.AddAsyncFilter(registration.Key, (input, arguments, ctx) =>
|
||||
templateContext.Options.Filters.AddFilter(registration.Key, (input, arguments, ctx) =>
|
||||
{
|
||||
var filter = (ILiquidFilter) services.GetRequiredService(registration.Value);
|
||||
return filter.ProcessAsync(input, arguments, ctx);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ namespace Elsa.Scripting.Liquid.Filters
|
|||
return new ValueTask<FluidValue>(new StringValue(JsonConvert.SerializeObject(input.ToBooleanValue())));
|
||||
|
||||
case FluidValues.Nil:
|
||||
return new ValueTask<FluidValue>(FluidValue.Create("null"));
|
||||
return new ValueTask<FluidValue>(FluidValue.Create("null", context.Options));
|
||||
|
||||
case FluidValues.Number:
|
||||
return new ValueTask<FluidValue>(new StringValue(JsonConvert.SerializeObject(input.ToNumberValue())));
|
||||
|
|
|
|||
|
|
@ -15,33 +15,31 @@ namespace Elsa.Scripting.Liquid.Handlers
|
|||
{
|
||||
public class ConfigureLiquidEngine : INotificationHandler<EvaluatingLiquidExpression>
|
||||
{
|
||||
static ConfigureLiquidEngine()
|
||||
{
|
||||
FluidValue.SetTypeMapping<ExpandoObject>(x => new ObjectValue(x));
|
||||
FluidValue.SetTypeMapping<JObject>(o => new ObjectValue(o));
|
||||
FluidValue.SetTypeMapping<JValue>(o => FluidValue.Create(o.Value));
|
||||
}
|
||||
|
||||
public Task Handle(EvaluatingLiquidExpression notification, CancellationToken cancellationToken)
|
||||
{
|
||||
var context = notification.TemplateContext;
|
||||
var options = context.Options;
|
||||
|
||||
context.MemberAccessStrategy.Register<LiquidActivityModel>();
|
||||
context.MemberAccessStrategy.Register<LiquidPropertyAccessor, FluidValue>((x, name) => x.GetValueAsync(name));
|
||||
context.MemberAccessStrategy.Register<ActivityExecutionContext, FluidValue>("Input", x => ToFluidValue(x.Input));
|
||||
context.MemberAccessStrategy.Register<ActivityExecutionContext, FluidValue>("CorrelationId", x => ToFluidValue(x.CorrelationId));
|
||||
context.MemberAccessStrategy.Register<ActivityExecutionContext, LiquidPropertyAccessor>("Variables", x => new LiquidPropertyAccessor(name => ToFluidValue(x.WorkflowExecutionContext.GetMergedVariables(), name)));
|
||||
context.MemberAccessStrategy.Register<ActivityExecutionContext, LiquidPropertyAccessor>("Activities", x => new LiquidPropertyAccessor(name => ToFluidValue(GetActivityModelAsync(x, name))));
|
||||
context.MemberAccessStrategy.Register<LiquidActivityModel, object?>("Output", GetActivityOutput);
|
||||
context.MemberAccessStrategy.Register<LiquidObjectAccessor<object>, object>((x, name) => x.GetValueAsync(name));
|
||||
context.MemberAccessStrategy.Register<ExpandoObject, object>((x, name) => ((IDictionary<string, object>) x)[name]);
|
||||
context.MemberAccessStrategy.Register<JObject, object?>((source, name) => source[name]);
|
||||
options.MemberAccessStrategy.Register<ExpandoObject>();
|
||||
options.MemberAccessStrategy.Register<JObject>();
|
||||
options.MemberAccessStrategy.Register<JValue>(o => FluidValue.Create(o.Value, options));
|
||||
|
||||
options.MemberAccessStrategy.Register<LiquidActivityModel>();
|
||||
options.MemberAccessStrategy.Register<LiquidPropertyAccessor, FluidValue>((x, name) => x.GetValueAsync(name));
|
||||
options.MemberAccessStrategy.Register<ActivityExecutionContext, FluidValue>("Input", x => ToFluidValue(x.Input, options));
|
||||
options.MemberAccessStrategy.Register<ActivityExecutionContext, FluidValue>("CorrelationId", x => ToFluidValue(x.CorrelationId, options));
|
||||
options.MemberAccessStrategy.Register<ActivityExecutionContext, LiquidPropertyAccessor>("Variables", x => new LiquidPropertyAccessor(name => ToFluidValue(x.WorkflowExecutionContext.GetMergedVariables(), name, options)));
|
||||
options.MemberAccessStrategy.Register<ActivityExecutionContext, LiquidPropertyAccessor>("Activities", x => new LiquidPropertyAccessor(name => ToFluidValue(GetActivityModelAsync(x, name), options)!));
|
||||
options.MemberAccessStrategy.Register<LiquidActivityModel, object?>("Output", GetActivityOutput);
|
||||
options.MemberAccessStrategy.Register<LiquidObjectAccessor<object>, object>((x, name) => x.GetValueAsync(name));
|
||||
options.MemberAccessStrategy.Register<ExpandoObject, object>((x, name) => ((IDictionary<string, object>) x)[name]);
|
||||
options.MemberAccessStrategy.Register<JObject, object?>((source, name) => source[name]);
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private Task<FluidValue> ToFluidValue(object? input) => Task.FromResult(FluidValue.Create(input));
|
||||
private Task<FluidValue?> ToFluidValue(Variables dictionary, string key) => Task.FromResult(!dictionary.Has(key) ? default : FluidValue.Create(dictionary.Get(key)));
|
||||
private Task<FluidValue> ToFluidValue(object? input, TemplateOptions options) => Task.FromResult(FluidValue.Create(input, options));
|
||||
private Task<FluidValue?> ToFluidValue(Variables dictionary, string key, TemplateOptions options) => Task.FromResult(!dictionary.Has(key) ? default : FluidValue.Create(dictionary.Get(key), options));
|
||||
private LiquidActivityModel GetActivityModelAsync(ActivityExecutionContext context, string name) => new(context, name);
|
||||
|
||||
private Task<object?> GetActivityOutput(LiquidActivityModel activityModel)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ namespace Elsa.Scripting.Liquid.Services
|
|||
if (string.IsNullOrWhiteSpace(source))
|
||||
return default!;
|
||||
|
||||
context.AddAsyncFilters(_options, _serviceProvider);
|
||||
context.AddFilters(_options, _serviceProvider);
|
||||
var result = GetCachedTemplate(source);
|
||||
|
||||
return await result.RenderAsync(context, encoder);
|
||||
|
|
|
|||
|
|
@ -15,12 +15,13 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="5.0.0" />
|
||||
<PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.0.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.1.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="6.1.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.1.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="7.0.2" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.1.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Import Project="..\..\..\common.props"/>
|
||||
<Import Project="..\..\..\configureawait.props"/>
|
||||
<Import Project="..\..\..\common.props" />
|
||||
<Import Project="..\..\..\configureawait.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Import Project="..\..\..\common.props"/>
|
||||
<Import Project="..\..\..\configureawait.props"/>
|
||||
<Import Project="..\..\..\common.props" />
|
||||
<Import Project="..\..\..\configureawait.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
|
|
@ -13,15 +13,15 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Orleans.Server" Version="3.4.1"/>
|
||||
<PackageReference Include="Microsoft.Orleans.Core.Abstractions" Version="3.4.1"/>
|
||||
<PackageReference Include="Microsoft.Orleans.CodeGenerator.MSBuild" Version="3.4.1" PrivateAssets="all">
|
||||
<PackageReference Include="Microsoft.Orleans.Server" Version="3.4.2" />
|
||||
<PackageReference Include="Microsoft.Orleans.Core.Abstractions" Version="3.4.2" />
|
||||
<PackageReference Include="Microsoft.Orleans.CodeGenerator.MSBuild" Version="3.4.2" PrivateAssets="all">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\core\Elsa.Core\Elsa.Core.csproj"/>
|
||||
<ProjectReference Include="..\..\core\Elsa.Core\Elsa.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoFixture" Version="4.15.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.1" />
|
||||
<PackageReference Include="AutoFixture" Version="4.16.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="5.0.5" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="XunitXml.TestLogger" Version="3.0.66" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Autofixture" Version="4.15.0" />
|
||||
<PackageReference Include="Autofixture.AutoMoq" Version="4.15.0" />
|
||||
<PackageReference Include="autofixture.xunit2" Version="4.15.0" />
|
||||
<PackageReference Include="Autofixture" Version="4.16.0" />
|
||||
<PackageReference Include="Autofixture.AutoMoq" Version="4.16.0" />
|
||||
<PackageReference Include="autofixture.xunit2" Version="4.16.0" />
|
||||
<PackageReference Include="Moq" Version="4.16.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
|
||||
<PackageReference Include="NodaTime.Testing" Version="3.0.5" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="XunitXml.TestLogger" Version="3.0.66" />
|
||||
|
|
@ -23,12 +23,12 @@
|
|||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="YesSql.Core" Version="2.0.0-beta-1637" />
|
||||
<PackageReference Include="YesSql.Provider.Sqlite" Version="1.0.0-beta-1637" />
|
||||
<PackageReference Include="YesSql.Core" Version="3.0.2" />
|
||||
<PackageReference Include="YesSql.Provider.Sqlite" Version="3.0.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
|
||||
<PackageReference Include="Hangfire.AspNetCore" Version="1.7.20" />
|
||||
<PackageReference Include="Hangfire.InMemory" Version="0.3.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.5" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -12,15 +12,15 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoFixture" Version="4.15.0" />
|
||||
<PackageReference Include="Autofixture.AutoMoq" Version="4.15.0" />
|
||||
<PackageReference Include="autofixture.xunit2" Version="4.15.0" />
|
||||
<PackageReference Include="AutoFixture" Version="4.16.0" />
|
||||
<PackageReference Include="Autofixture.AutoMoq" Version="4.16.0" />
|
||||
<PackageReference Include="autofixture.xunit2" Version="4.16.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0" />
|
||||
<PackageReference Include="NodaTime" Version="3.0.5" />
|
||||
<PackageReference Include="xunit.extensibility.core" Version="2.4.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.5" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Autofixture" Version="4.15.0" />
|
||||
<PackageReference Include="Autofixture.AutoMoq" Version="4.15.0" />
|
||||
<PackageReference Include="autofixture.xunit2" Version="4.15.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.1" />
|
||||
<PackageReference Include="Autofixture" Version="4.16.0" />
|
||||
<PackageReference Include="Autofixture.AutoMoq" Version="4.16.0" />
|
||||
<PackageReference Include="autofixture.xunit2" Version="4.16.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
|
||||
<PackageReference Include="Moq" Version="4.16.1" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="XunitXml.TestLogger" Version="3.0.66" />
|
||||
|
|
|
|||
Loading…
Reference in a new issue