mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 18:21:10 +00:00
Adds the plugins and metadata provider management API
This commit is contained in:
1 parent
6f501a51f3
commit
7d417c1710
51 files changed
+2294
No files matched your search
@@ -0,0 +1,19 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Responses.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a metadata provider configured for a media library.
|
||||
/// </summary>
|
||||
/// <param name="PluginId">The unique identifier of the plugin providing the metadata.</param>
|
||||
/// <param name="Name">The display name of the metadata provider.</param>
|
||||
/// <param name="IsEnabled">Whether the metadata provider is enabled for the media library.</param>
|
||||
/// <param name="Rank">The rank of the metadata provider, determining the order in which providers are tried.</param>
|
||||
public sealed record LibraryMetadataProviderResponse(
|
||||
Guid PluginId,
|
||||
string Name,
|
||||
bool IsEnabled,
|
||||
int Rank
|
||||
);
|
||||
@@ -0,0 +1,31 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.Plugins;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Responses.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a detected plugin.
|
||||
/// </summary>
|
||||
/// <param name="Id">The unique identifier of the plugin.</param>
|
||||
/// <param name="Name">The display name of the plugin.</param>
|
||||
/// <param name="Author">The author of the plugin.</param>
|
||||
/// <param name="Version">The version of the plugin.</param>
|
||||
/// <param name="Description">The description of the plugin.</param>
|
||||
/// <param name="LoadStatus">The load status of the plugin.</param>
|
||||
/// <param name="LoadError">The error message when the plugin failed to load, if applicable.</param>
|
||||
/// <param name="Settings">The settings of the plugin.</param>
|
||||
[DebuggerDisplay("Name: {Name}")]
|
||||
public sealed record PluginResponse(
|
||||
Guid Id,
|
||||
string Name,
|
||||
string Author,
|
||||
string Version,
|
||||
string Description,
|
||||
PluginLoadStatus LoadStatus,
|
||||
string? LoadError,
|
||||
IReadOnlyDictionary<string, string>? Settings
|
||||
);
|
||||
@@ -0,0 +1,21 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Collections.Generic;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Responses.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Describes a single setting of a plugin.
|
||||
/// </summary>
|
||||
/// <param name="Key">The unique key of the setting.</param>
|
||||
/// <param name="Label">The display label of the setting.</param>
|
||||
/// <param name="Type">The type of the setting.</param>
|
||||
/// <param name="DefaultValue">The optional default value of the setting.</param>
|
||||
/// <param name="AllowedValues">The list of allowed values, when the setting is a selection.</param>
|
||||
public sealed record PluginSettingDescriptorResponse(
|
||||
string Key,
|
||||
string Label,
|
||||
PluginSettingType Type,
|
||||
string? DefaultValue,
|
||||
IReadOnlyList<string>? AllowedValues
|
||||
);
|
||||
@@ -0,0 +1,27 @@
|
||||
namespace Lumina.Contracts.Responses.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Enumeration for the types of a plugin setting.
|
||||
/// </summary>
|
||||
public enum PluginSettingType
|
||||
{
|
||||
/// <summary>
|
||||
/// A free-form single line text value.
|
||||
/// </summary>
|
||||
Text,
|
||||
|
||||
/// <summary>
|
||||
/// A numeric value.
|
||||
/// </summary>
|
||||
Number,
|
||||
|
||||
/// <summary>
|
||||
/// A boolean (true/false) value.
|
||||
/// </summary>
|
||||
Boolean,
|
||||
|
||||
/// <summary>
|
||||
/// A value selected from a list of allowed values.
|
||||
/// </summary>
|
||||
Select
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Responses.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the settings of a plugin and their schema.
|
||||
/// </summary>
|
||||
/// <param name="PluginId">The unique identifier of the plugin.</param>
|
||||
/// <param name="Schema">The schema of the plugin settings.</param>
|
||||
/// <param name="Settings">The current values of the plugin settings.</param>
|
||||
public sealed record PluginSettingsResponse(
|
||||
Guid PluginId,
|
||||
IReadOnlyList<PluginSettingDescriptorResponse> Schema,
|
||||
IReadOnlyDictionary<string, string>? Settings
|
||||
);
|
||||
Reference in new issue
Block a user