mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 12:11:10 +00:00
Adds the server-side theme repository and reworks the web theme engine onto it
This commit is contained in:
1 parent
85928f7c3c
commit
bf8faba24d
136 files changed
+6942
-1197
No files matched your search
@@ -0,0 +1,15 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Requests.Themes;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to delete a theme.
|
||||
/// </summary>
|
||||
/// <param name="ThemeId">The manifest id of the theme to delete. Required.</param>
|
||||
[DebuggerDisplay("ThemeId: {ThemeId}")]
|
||||
public record DeleteThemeRequest(
|
||||
string? ThemeId
|
||||
);
|
||||
@@ -0,0 +1,15 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Requests.Themes;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to download the archive of a theme.
|
||||
/// </summary>
|
||||
/// <param name="ThemeId">The manifest id of the theme. Required.</param>
|
||||
[DebuggerDisplay("ThemeId: {ThemeId}")]
|
||||
public record GetThemeArchiveRequest(
|
||||
string? ThemeId
|
||||
);
|
||||
@@ -0,0 +1,17 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Requests.Themes;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to get an asset file of a theme.
|
||||
/// </summary>
|
||||
/// <param name="ThemeId">The manifest id of the theme. Required.</param>
|
||||
/// <param name="AssetPath">The asset path relative to the theme pack root. Required.</param>
|
||||
[DebuggerDisplay("ThemeId: {ThemeId}, AssetPath: {AssetPath}")]
|
||||
public record GetThemeAssetRequest(
|
||||
string? ThemeId,
|
||||
string? AssetPath
|
||||
);
|
||||
@@ -0,0 +1,17 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Requests.Themes;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to get the template of a theme selected by a page key.
|
||||
/// </summary>
|
||||
/// <param name="ThemeId">The manifest id of the theme. Required.</param>
|
||||
/// <param name="PageKey">The page key that selects the template. Required.</param>
|
||||
[DebuggerDisplay("ThemeId: {ThemeId}, PageKey: {PageKey}")]
|
||||
public record GetThemeTemplateRequest(
|
||||
string? ThemeId,
|
||||
string? PageKey
|
||||
);
|
||||
@@ -0,0 +1,12 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Requests.Themes;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to install a theme pack, sent as a multipart form whose single file field contains the theme archive.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("InstallThemeRequest")]
|
||||
public record InstallThemeRequest;
|
||||
@@ -0,0 +1,15 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Requests.Themes;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to set the currently active theme.
|
||||
/// </summary>
|
||||
/// <param name="ThemeId">The manifest id of the theme to activate. Required.</param>
|
||||
[DebuggerDisplay("ThemeId: {ThemeId}")]
|
||||
public record SetCurrentThemeRequest(
|
||||
string? ThemeId
|
||||
);
|
||||
@@ -0,0 +1,19 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Responses.Themes;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a theme archive response.
|
||||
/// </summary>
|
||||
/// <param name="Bytes">The bytes of the ZIP archive.</param>
|
||||
/// <param name="FileName">The file name to expose when downloading the archive.</param>
|
||||
/// <param name="ContentType">The MIME content type of the archive.</param>
|
||||
[DebuggerDisplay("FileName: {FileName}")]
|
||||
public record ThemeArchiveResponse(
|
||||
byte[] Bytes,
|
||||
string FileName,
|
||||
string ContentType
|
||||
);
|
||||
@@ -0,0 +1,17 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Responses.Themes;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a theme asset response.
|
||||
/// </summary>
|
||||
/// <param name="Bytes">The bytes of the asset file.</param>
|
||||
/// <param name="ContentType">The MIME content type of the asset file.</param>
|
||||
[DebuggerDisplay("ContentType: {ContentType}")]
|
||||
public record ThemeAssetResponse(
|
||||
byte[] Bytes,
|
||||
string ContentType
|
||||
);
|
||||
@@ -0,0 +1,34 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.Themes;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Responses.Themes;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a theme response.
|
||||
/// </summary>
|
||||
/// <param name="Id">The unique identifier of the theme.</param>
|
||||
/// <param name="ThemeId">The manifest id of the theme, used by clients to reference it.</param>
|
||||
/// <param name="Name">The display name of the theme.</param>
|
||||
/// <param name="Description">The description of the theme.</param>
|
||||
/// <param name="Author">The author of the theme.</param>
|
||||
/// <param name="Version">The version of the theme, using semantic version form.</param>
|
||||
/// <param name="PreviewPath">The path of the theme preview image, relative to the theme pack root, or <see langword="null"/> when the theme has no preview.</param>
|
||||
/// <param name="InstallSource">The source the theme was installed from.</param>
|
||||
/// <param name="IsCurrent">Whether the theme is the currently active one.</param>
|
||||
/// <param name="InstalledAtUtc">The UTC timestamp at which the theme was installed.</param>
|
||||
[DebuggerDisplay("ThemeId: {ThemeId}, Name: {Name}")]
|
||||
public record ThemeResponse(
|
||||
Guid Id,
|
||||
string ThemeId,
|
||||
string Name,
|
||||
string Description,
|
||||
string Author,
|
||||
string Version,
|
||||
string? PreviewPath,
|
||||
ThemeInstallSource InstallSource,
|
||||
bool? IsCurrent,
|
||||
DateTime InstalledAtUtc
|
||||
);
|
||||
@@ -0,0 +1,19 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Responses.Themes;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a theme settings response.
|
||||
/// </summary>
|
||||
/// <param name="MaxArchiveBytes">The maximum allowed size of a theme archive, in bytes.</param>
|
||||
/// <param name="AllowThemeScripts">Whether theme templates may contain script elements and theme assets may include script files.</param>
|
||||
/// <param name="DefaultThemeId">The identifier of the theme selected when no valid current theme is available.</param>
|
||||
[DebuggerDisplay("MaxArchiveBytes: {MaxArchiveBytes}")]
|
||||
public record ThemeSettingsResponse(
|
||||
long MaxArchiveBytes,
|
||||
bool AllowThemeScripts,
|
||||
string DefaultThemeId
|
||||
);
|
||||
@@ -0,0 +1,17 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Responses.Themes;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a theme template response.
|
||||
/// </summary>
|
||||
/// <param name="Theme">The theme the template belongs to.</param>
|
||||
/// <param name="Template">The sanitized content of the template.</param>
|
||||
[DebuggerDisplay("ThemeId: {Theme.ThemeId}")]
|
||||
public record ThemeTemplateResponse(
|
||||
ThemeResponse Theme,
|
||||
string Template
|
||||
);
|
||||
Reference in new issue
Block a user