2022-05-26 15:05:36 +00:00
|
|
|
using Elsa.Expressions.Extensions;
|
2022-05-27 10:36:39 +00:00
|
|
|
using Elsa.Expressions.Features;
|
2022-05-26 15:05:36 +00:00
|
|
|
using Elsa.Expressions.Services;
|
2022-05-27 10:36:39 +00:00
|
|
|
using Elsa.Features.Abstractions;
|
|
|
|
|
using Elsa.Features.Attributes;
|
|
|
|
|
using Elsa.Features.Services;
|
2022-05-26 15:05:36 +00:00
|
|
|
using Elsa.JavaScript.Expressions;
|
|
|
|
|
using Elsa.JavaScript.Handlers;
|
|
|
|
|
using Elsa.JavaScript.Implementations;
|
|
|
|
|
using Elsa.JavaScript.Providers;
|
|
|
|
|
using Elsa.JavaScript.Services;
|
|
|
|
|
using Elsa.Mediator.Extensions;
|
2022-05-27 10:36:39 +00:00
|
|
|
using Elsa.Mediator.Features;
|
2022-05-26 15:05:36 +00:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
2022-05-27 10:36:39 +00:00
|
|
|
namespace Elsa.JavaScript.Features;
|
2022-05-26 15:05:36 +00:00
|
|
|
|
2022-05-27 10:36:39 +00:00
|
|
|
[DependsOn(typeof(MediatorFeature))]
|
|
|
|
|
[DependsOn(typeof(ExpressionsFeature))]
|
|
|
|
|
public class JavaScriptFeature : FeatureBase
|
2022-05-26 15:05:36 +00:00
|
|
|
{
|
2022-05-27 10:36:39 +00:00
|
|
|
public JavaScriptFeature(IModule module) : base(module)
|
2022-05-26 15:05:36 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Configure()
|
|
|
|
|
{
|
|
|
|
|
Services
|
|
|
|
|
.AddSingleton<IExpressionSyntaxProvider, JavaScriptExpressionSyntaxProvider>()
|
|
|
|
|
.AddSingleton<IJavaScriptEvaluator, JintJavaScriptEvaluator>()
|
|
|
|
|
.AddNotificationHandlersFrom<ConfigureJavaScriptEngineWithActivityOutput>()
|
|
|
|
|
.AddExpressionHandler<JavaScriptExpressionHandler, JavaScriptExpression>();
|
|
|
|
|
}
|
|
|
|
|
}
|