This commit is contained in:
2021-11-20 13:52:28 +01:00
parent be9ad9d335
commit 2d6d798771
367 changed files with 4840 additions and 7501 deletions
@@ -0,0 +1,12 @@
namespace zero.Configuration;
/// <summary>
/// An integration is an application part which has a public configuration per app.
/// It's up to the user to provide functionality.
/// </summary>
[RavenCollection("Integrations")]
public class Integration : ZeroEntity
{
/// <inheritdoc />
public string TypeAlias { get; set; }
}
@@ -0,0 +1,14 @@
using Microsoft.Extensions.Logging;
namespace zero.Configuration;
public class IntegrationService : IntegrationsCollection, IIntegrationService
{
public IntegrationService(ICollectionContext<Integration> context, ILogger<IntegrationsCollection> logger) : base(context, logger)
{
Options = new(false);
}
}
public interface IIntegrationService : IIntegrationsCollection { }
@@ -0,0 +1,51 @@
namespace zero.Configuration;
/// <summary>
/// An integration is an application part which has a public configuration per app.
/// It's up to the user to provide functionality.
/// </summary>
public class IntegrationType<T> : IntegrationType where T : Integration, new()
{
public IntegrationType() : base(typeof(T)) { }
}
/// <summary>
/// An integration is an application part which has a public configuration per app.
/// It's up to the user to provide functionality.
/// </summary>
public class IntegrationType : OptionsType
{
/// <summary>
/// Group integrations by tags
/// </summary>
public List<string> Tags { get; set; } = new();
/// <summary>
/// Optional description
/// </summary>
public string Description { get; set; }
/// <summary>
/// Image of the integration
/// </summary>
public string ImagePath { get; set; }
public IntegrationType(Type type)
{
ContentType = type;
}
public static IntegrationType Convert<T>(IntegrationType<T> model) where T : Integration, new()
{
return new(model.ContentType)
{
Alias = model.Alias,
Name = model.Name,
Description = model.Description,
ImagePath = model.ImagePath,
Tags = model.Tags,
Validator = model.Validator
};
}
}
@@ -0,0 +1,12 @@
namespace zero.Configuration;
public class IntegrationTypeWithStatus
{
public IntegrationType Type { get; set; }
public bool IsActive { get; set; }
public bool IsConfigured { get; set; }
public string Id { get; set; }
}