Add API client to get server version
This commit is contained in:
parent
06f92d8d7e
commit
e9249d6b1c
|
|
@ -17,5 +17,5 @@
|
|||
<PackageReference Include="Refit" Version="7.0.0" />
|
||||
<PackageReference Include="Refit.HttpClientFactory" Version="7.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ public interface IFeaturesApi
|
|||
/// <summary>
|
||||
/// Gets the specified feature.
|
||||
/// </summary>
|
||||
/// <param name="fullName"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns>The feature.</returns>
|
||||
/// <param name="fullName">The fully qualified name of the feature.</param>
|
||||
/// <param name="cancellationToken">An optional cancellation token.</param>
|
||||
/// <returns>Information about the feature.</returns>
|
||||
[Get("/features/installed/{fullName}")]
|
||||
Task<FeatureDescriptor> GetAsync(string fullName, CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
using Elsa.Api.Client.Resources.Package.Models;
|
||||
using Refit;
|
||||
|
||||
namespace Elsa.Api.Client.Resources.Package.Contracts;
|
||||
|
||||
/// <summary>
|
||||
/// A client for working with packages.
|
||||
/// </summary>
|
||||
public interface IPackageApi
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the installed package version of Elsa.
|
||||
/// </summary>
|
||||
[Get("/package/version")]
|
||||
Task<PackageVersionResponse> GetAsync(CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
namespace Elsa.Api.Client.Resources.Package.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Contains the installed package version of Elsa.
|
||||
/// </summary>
|
||||
/// <param name="PackageVersion">The installed package version of Elsa.</param>
|
||||
public record PackageVersionResponse(string PackageVersion);
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
using Elsa.Api.Client.Resources.WorkflowDefinitions.Requests;
|
||||
using Elsa.Api.Client.Resources.Scripting.Requests;
|
||||
using JetBrains.Annotations;
|
||||
using Refit;
|
||||
|
||||
|
|
@ -13,11 +13,11 @@ namespace Elsa.Api.Client.Resources.Scripting.Contracts
|
|||
/// <summary>
|
||||
/// Dispatches a request to retrieve the type definitions of the specified workflow definition.
|
||||
/// </summary>
|
||||
/// <param name="definitionId">The definition ID of the workflow definition to retrieve the type defintions for.</param>
|
||||
/// <param name="request">Required request containing properties to retrieve the correct type definitions</param>
|
||||
/// <param name="definitionId">The definition ID of the workflow definition to retrieve the type definitions for.</param>
|
||||
/// <param name="request">Required request containing properties to retrieve the correct type definitions.</param>
|
||||
/// <param name="cancellationToken">An optional cancellation token.</param>
|
||||
/// <returns>A response containing the type definition data which can be used to extend auto completion in Monaco.</returns>
|
||||
[Post("/scripting/javascript/type-definitions/{definitionId}")]
|
||||
Task<HttpResponseMessage> GetTypeDefinitions(string definitionId, GetWorkflowJavascriptDefinitionRequest request, CancellationToken cancellationToken);
|
||||
Task<HttpResponseMessage> GetTypeDefinitions(string definitionId, GetWorkflowJavaScriptDefinitionRequest request, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Requests;
|
||||
namespace Elsa.Api.Client.Resources.Scripting.Requests;
|
||||
|
||||
/// <summary>
|
||||
/// A request to retrieve the type definitions
|
||||
/// </summary>
|
||||
public class GetWorkflowJavascriptDefinitionRequest
|
||||
public class GetWorkflowJavaScriptDefinitionRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Initialize new type definition request.
|
||||
|
|
@ -11,7 +11,7 @@ public class GetWorkflowJavascriptDefinitionRequest
|
|||
/// <param name="workflowDefinitionId">Id of workflow definition to retrieve type definitions for.</param>
|
||||
/// <param name="activityTypeName">Type name of the activity to retrieve type definitions for.</param>
|
||||
/// <param name="propertyName">Name of the property to retrieve type definitions for.</param>
|
||||
public GetWorkflowJavascriptDefinitionRequest(string workflowDefinitionId, string activityTypeName, string propertyName)
|
||||
public GetWorkflowJavaScriptDefinitionRequest(string workflowDefinitionId, string activityTypeName, string propertyName)
|
||||
{
|
||||
WorkflowDefinitionId = workflowDefinitionId;
|
||||
ActivityTypeName = activityTypeName;
|
||||
|
|
|
|||
Loading…
Reference in a new issue