From 704d4cd8348e2180cfdeff1e79a3913d2cb1bd5a Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Fri, 29 Dec 2023 11:34:58 +0100 Subject: [PATCH] Remove ElsaClient and related interfaces Files ElsaClient.cs, IElsaClient.cs and IElsaClientFactory.cs have been deleted from the Elsa.Api.Client project. The commit also includes an update in the DependencyInjectionExtensions.cs file where IElsaClient service registration is removed, reflecting these changes. --- .../Elsa.Api.Client/Contracts/IElsaClient.cs | 37 ---------------- .../Contracts/IElsaClientFactory.cs | 14 ------ .../DependencyInjectionExtensions.cs | 3 -- .../Elsa.Api.Client/Services/ElsaClient.cs | 43 ------------------- 4 files changed, 97 deletions(-) delete mode 100644 src/clients/Elsa.Api.Client/Contracts/IElsaClient.cs delete mode 100644 src/clients/Elsa.Api.Client/Contracts/IElsaClientFactory.cs delete mode 100644 src/clients/Elsa.Api.Client/Services/ElsaClient.cs diff --git a/src/clients/Elsa.Api.Client/Contracts/IElsaClient.cs b/src/clients/Elsa.Api.Client/Contracts/IElsaClient.cs deleted file mode 100644 index 1530f9190..000000000 --- a/src/clients/Elsa.Api.Client/Contracts/IElsaClient.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Elsa.Api.Client.Resources.ActivityDescriptorOptions.Contracts; -using Elsa.Api.Client.Resources.ActivityDescriptors.Contracts; -using Elsa.Api.Client.Resources.Scripting.Contracts; -using Elsa.Api.Client.Resources.WorkflowDefinitions.Contracts; -using Elsa.Api.Client.Resources.WorkflowInstances.Contracts; - -namespace Elsa.Api.Client.Contracts; - -/// -/// Represents a client for the Elsa API. Each API is exposed as a property. -/// -public interface IElsaClient -{ - /// - /// Gets the workflow definitions API. - /// - IWorkflowDefinitionsApi WorkflowDefinitions { get; } - - /// - /// Gets the activity descriptors API. - /// - IActivityDescriptorsApi ActivityDescriptors { get; } - - /// - /// Get the activity descriptor Options API - /// - IActivityDescriptorOptionsApi ActivityDescriptorOptions { get; } - /// - /// Gets the workflow instances API. - /// - IWorkflowInstancesApi WorkflowInstances { get; } - - /// - /// Gets the javascript API. - /// - IJavaScriptApi JavaScript { get; } -} \ No newline at end of file diff --git a/src/clients/Elsa.Api.Client/Contracts/IElsaClientFactory.cs b/src/clients/Elsa.Api.Client/Contracts/IElsaClientFactory.cs deleted file mode 100644 index cf109850e..000000000 --- a/src/clients/Elsa.Api.Client/Contracts/IElsaClientFactory.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Elsa.Api.Client.Options; - -namespace Elsa.Api.Client.Contracts; - -/// -/// A factory for creating instances. -/// -public interface IElsaClientFactory -{ - /// - /// Creates a new instance. - /// - IElsaClient CreateClient(Action configureOptions, Action? configureHttpClientBuilder = default); -} \ No newline at end of file diff --git a/src/clients/Elsa.Api.Client/Extensions/DependencyInjectionExtensions.cs b/src/clients/Elsa.Api.Client/Extensions/DependencyInjectionExtensions.cs index 86168c4ab..ff389d9fc 100644 --- a/src/clients/Elsa.Api.Client/Extensions/DependencyInjectionExtensions.cs +++ b/src/clients/Elsa.Api.Client/Extensions/DependencyInjectionExtensions.cs @@ -1,6 +1,5 @@ using System.Text.Json; using System.Text.Json.Serialization; -using Elsa.Api.Client.Contracts; using Elsa.Api.Client.Converters; using Elsa.Api.Client.HttpMessageHandlers; using Elsa.Api.Client.Options; @@ -17,7 +16,6 @@ using Elsa.Api.Client.Resources.WorkflowActivationStrategies.Contracts; using Elsa.Api.Client.Resources.WorkflowDefinitions.Contracts; using Elsa.Api.Client.Resources.WorkflowExecutionContexts.Contracts; using Elsa.Api.Client.Resources.WorkflowInstances.Contracts; -using Elsa.Api.Client.Services; using JetBrains.Annotations; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; @@ -66,7 +64,6 @@ public static class DependencyInjectionExtensions configureBuilderOptions?.Invoke(builderOptions); services.Configure(configureOptions ?? (_ => { })); - services.AddScoped(); services.AddApi(builderOptions); services.AddApi(builderOptions); services.AddApi(builderOptions); diff --git a/src/clients/Elsa.Api.Client/Services/ElsaClient.cs b/src/clients/Elsa.Api.Client/Services/ElsaClient.cs deleted file mode 100644 index 3a0008512..000000000 --- a/src/clients/Elsa.Api.Client/Services/ElsaClient.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Elsa.Api.Client.Contracts; -using Elsa.Api.Client.Resources.ActivityDescriptorOptions.Contracts; -using Elsa.Api.Client.Resources.ActivityDescriptors.Contracts; -using Elsa.Api.Client.Resources.Scripting.Contracts; -using Elsa.Api.Client.Resources.WorkflowDefinitions.Contracts; -using Elsa.Api.Client.Resources.WorkflowInstances.Contracts; - -namespace Elsa.Api.Client.Services; - -/// -public class ElsaClient : IElsaClient -{ - /// - /// Initializes a new instance of the class. - /// - public ElsaClient(IWorkflowDefinitionsApi workflowDefinitions - , IWorkflowInstancesApi workflowInstances - , IActivityDescriptorsApi activityDescriptors - , IActivityDescriptorOptionsApi activityDescriptorOptions - , IJavaScriptApi javaScript) - { - WorkflowDefinitions = workflowDefinitions; - WorkflowInstances = workflowInstances; - ActivityDescriptors = activityDescriptors; - ActivityDescriptorOptions = activityDescriptorOptions; - JavaScript = javaScript; - } - - /// - public IWorkflowDefinitionsApi WorkflowDefinitions { get; } - - /// - public IActivityDescriptorsApi ActivityDescriptors { get; } - - /// - public IActivityDescriptorOptionsApi ActivityDescriptorOptions { get; } - - /// - public IWorkflowInstancesApi WorkflowInstances { get; } - - /// - public IJavaScriptApi JavaScript { get; } -} \ No newline at end of file