feat: adds FastEndpoints core infrastructure and contracts to the web project

This commit is contained in:
BinaryAlley committed 2026-08-17 11:52:20 -07:00
1 parent 394b33efd2
commit 733e174cac
137 files changed
+3139 -158

No files matched your search

@@ -0,0 +1,18 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.Authorization;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Authorization;
/// <summary>
/// Data transfer object for an authorization permission.
/// </summary>
/// <param name="Id">The unique identifier of the permission.</param>
/// <param name="PermissionName">The name of the permission.</param>
[DebuggerDisplay("Id: {Id}, PermissionName: {PermissionName}")]
public record PermissionDto(
Guid Id,
AuthorizationPermission PermissionName
);
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Authorization;
/// <summary>
/// Data transfer object for an authorization role.
/// </summary>
/// <param name="Id">The unique identifier of the role.</param>
/// <param name="RoleName">The name of the role.</param>
[DebuggerDisplay("Id: {Id}, RoleName: {RoleName}")]
public record RoleDto(
Guid Id,
string RoleName
);
@@ -0,0 +1,16 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Authorization;
/// <summary>
/// Data transfer object for a model for an authorization role with its permissions.
/// </summary>
/// <param name="Role">The authorization role.</param>
/// <param name="Permissions">The permissions of the authorization role.</param>
[DebuggerDisplay("Role: {Role}")]
public record RolePermissionsDto(
RoleDto Role,
PermissionDto[] Permissions
);
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.DTO.UsersManagement;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Authorization;
/// <summary>
/// Data transfer object for a user with its authorization permissions.
/// </summary>
/// <param name="User">The user.</param>
/// <param name="Permissions">The authorization permissions of the user.</param>
[DebuggerDisplay("User: {User}")]
public record UserPermissionsDto(
UserDto User,
PermissionDto[] Permissions
);
@@ -0,0 +1,20 @@
using System.Diagnostics;
namespace Lumina.Presentation.Web.Common.DTO.Common;
/// <summary>
/// Data transfer object for the data shown on the error page.
/// </summary>
[DebuggerDisplay("RequestId: {RequestId}, ShowRequestId: {ShowRequestId}")]
public class ErrorViewDto
{
/// <summary>
/// Gets or sets the request identifier to display.
/// </summary>
public string? RequestId { get; set; }
/// <summary>
/// Gets a value indicating whether the request identifier should be shown.
/// </summary>
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
}
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Common;
/// <summary>
/// Data transfer object for a request to get genre information.
/// </summary>
[DebuggerDisplay("{Name}")]
public class GenreDto
{
/// <summary>
/// Gets the name of the genre element of the media item.
/// </summary>
public string? Name { get; set; }
}
@@ -0,0 +1,27 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Common;
/// <summary>
/// Data transfer object for a request to get language information.
/// </summary>
[DebuggerDisplay("{LanguageName}")]
public class LanguageInfoDto
{
/// <summary>
/// Gets the ISO 639-1 two-letter language code.
/// </summary>
public string? LanguageCode { get; set; }
/// <summary>
/// Gets the full name of the language in English.
/// </summary>
public string? LanguageName { get; set; }
/// <summary>
/// Gets an optional native name of the language.
/// </summary>
public string? NativeName { get; set; }
}
@@ -0,0 +1,20 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.Notifications;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Common;
/// <summary>
/// Data transfer object for notifications.
/// </summary>
/// <param name="Id">The id of the notification.</param>
/// <param name="Message">The message of the notification.</param>
/// <param name="Type">The type of the notification.</param>
[DebuggerDisplay("Id: {Id}, Message: {Message}")]
public record struct NotificationDto(
Guid Id,
string Message,
NotificationType Type
);
@@ -0,0 +1,52 @@
#region ========================================================================= USING =====================================================================================
using System.Collections.Generic;
using System.Diagnostics;
using System.Text.Json;
using System.Text.Json.Serialization;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Common;
/// <summary>
/// Data transfer object that follows the RFC 7807 standard for problem details in HTTP APIs.
/// </summary>
[DebuggerDisplay("{Title} ({Status})")]
public class ProblemDetailsDto
{
/// <summary>
/// Gets or sets the URI reference that identifies the problem type.
/// </summary>
[JsonPropertyName("type")]
public string? Type { get; set; }
/// <summary>
/// Gets or sets a short, human-readable summary of the problem type.
/// </summary>
[JsonPropertyName("title")]
public string? Title { get; set; }
/// <summary>
/// Gets or sets the HTTP status code generated by the server for this occurrence of the problem.
/// </summary>
[JsonPropertyName("status")]
public int? Status { get; set; }
/// <summary>
/// Gets or sets a detailed explanation specific to this occurrence of the problem.
/// </summary>
[JsonPropertyName("detail")]
public string? Detail { get; set; }
/// <summary>
/// Gets or sets a URI reference that identifies the specific occurrence of the problem.
/// </summary>
[JsonPropertyName("instance")]
public string? Instance { get; set; }
/// <summary>
/// Gets or sets additional extension data that may be included with the problem details.
/// This allows for including extra, non-standard fields in the problem details.
/// </summary>
[JsonExtensionData]
public IDictionary<string, JsonElement>? Extensions { get; set; }
}
@@ -0,0 +1,27 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Common;
/// <summary>
/// Data transfer object for a rating.
/// </summary>
[DebuggerDisplay("Value: {Value}, MaxValue: {MaxValue}")]
public abstract class RatingDto
{
/// <summary>
/// Gets the numeric value of the rating.
/// </summary>
public decimal? Value { get; set; }
/// <summary>
/// Gets the maximum possible rating value.
/// </summary>
public decimal? MaxValue { get; set; }
/// <summary>
/// Gets the optional number of votes or reviews this rating is based on.
/// </summary>
public int? VoteCount { get; set; }
}
@@ -0,0 +1,44 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Common;
/// <summary>
/// Data transfer object for a request to get release information.
/// </summary>
[DebuggerDisplay("OriginalReleaseDate: {OriginalReleaseDate}")]
public class ReleaseInfoDto
{
/// <summary>
/// Gets the optional original release date of the media item.
/// </summary>
public DateOnly? OriginalReleaseDate { get; set; }
/// <summary>
/// Gets the optional original release year of the media item.
/// This is useful when only the year of original release is known.
/// </summary>
public int? OriginalReleaseYear { get; set; }
/// <summary>
/// Gets the optional re-release or reissue date of the media item.
/// </summary>
public DateOnly? ReReleaseDate { get; set; }
/// <summary>
/// Gets the optional re-release or reissue year of the media item.
/// </summary>
public int? ReReleaseYear { get; set; }
/// <summary>
/// Gets the optional country or region of release.
/// </summary>
public string? ReleaseCountry { get; set; }
/// <summary>
/// Gets the optional release version or edition. (e.g. "Original", "Director's Cut", "2.0")
/// </summary>
public string? ReleaseVersion { get; set; }
}
@@ -0,0 +1,13 @@
#region ========================================================================= USING =====================================================================================
using System.Text.Json.Serialization;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Common;
/// <summary>
/// Response data transfer object for the JSON responses of the web application that do not carry a payload.
/// </summary>
/// <param name="Success">Whether the operation succeeded or not.</param>
public record SuccessResponse(
[property: JsonPropertyName("success")] bool Success
);
@@ -0,0 +1,16 @@
#region ========================================================================= USING =====================================================================================
using System.Text.Json.Serialization;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Common;
/// <summary>
/// Response data transfer object for the JSON responses of the web application that carry a payload.
/// </summary>
/// <typeparam name="TData">The type of the payload of the response.</typeparam>
/// <param name="Success">Whether the operation succeeded or not.</param>
/// <param name="Data">The payload of the response.</param>
public record SuccessResponse<TData>(
[property: JsonPropertyName("success")] bool Success,
[property: JsonPropertyName("data")] TData? Data
);
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Common;
/// <summary>
/// Data transfer object for a request to get tag information.
/// </summary>
[DebuggerDisplay("Name: {Name}")]
public class TagDto
{
/// <summary>
/// Gets the name of the tag element of the media item.
/// </summary>
public string? Name { get; set; }
}
@@ -0,0 +1,19 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Configuration;
/// <summary>
/// Data transfer object for deserializing media settings.
/// </summary>
[DebuggerDisplay("Section name: {SECTION_NAME}")]
public class EncryptionSettingsDto
{
public const string SECTION_NAME = "EncryptionSettings";
/// <summary>
/// Gets or sets the root directory where media files are stored.
/// </summary>
public required string SecretKey { get; init; }
}
@@ -0,0 +1,29 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Configuration;
/// <summary>
/// Data transfer object for deserializing server configuration settings.
/// </summary>
[DebuggerDisplay("Section name: {SECTION_NAME}")]
public class ServerConfigurationDto
{
public const string SECTION_NAME = "ServerConfiguration";
/// <summary>
/// Gets or sets the remote API server path.
/// </summary>
public required char ApiVersion { get; init; }
/// <summary>
/// Gets or sets the remote API server path.
/// </summary>
public required string BaseAddress { get; init; }
/// <summary>
/// Gets or sets the remote API server port.
/// </summary>
public required ushort Port { get; init; }
}
@@ -0,0 +1,22 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.FileSystemManagement;
/// <summary>
/// Data transfer object for a model for storing binary data (blob).
/// </summary>
[DebuggerDisplay("ContentType: {ContentType} (Data.Length)")]
public class BlobDataDto
{
/// <summary>
/// Gets or sets the binary data as a byte array.
/// </summary>
public byte[] Data { get; set; } = null!;
/// <summary>
/// Gets or sets the content type (MIME type) of the blob data, such as "image/png" for an image or "application/pdf" for a PDF document.
/// </summary>
public string ContentType { get; set; } = null!;
}
@@ -0,0 +1,18 @@
#region ========================================================================= USING =====================================================================================
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.FileSystemManagement;
/// <summary>
/// Data transfer object for directories displayed in custom directory/file browser dialogs.
/// </summary>
[DebuggerDisplay("Path: {Path}")]
public class DirectoryDto : FileSystemItemDto
{
/// <summary>
/// Gets or sets the children items of the directory.
/// </summary>
public List<FileSystemItemDto> Items { get; set; } = [];
}
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.FileSystemManagement;
/// <summary>
/// Data transfer object for files displayed in custom directory/file browser dialogs.
/// </summary>
[DebuggerDisplay("Path: {Path}")]
public class FileDto : FileSystemItemDto
{
/// <summary>
/// Gets or sets the size of the file, in bytes
/// </summary>
public long Size { get; set; }
}
@@ -0,0 +1,33 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.FileSystemManagement;
/// <summary>
/// Base data transfer object for files and directories displayed in custom directory/file browser dialogs.
/// </summary>
[DebuggerDisplay("Path: {Path}")]
public abstract class FileSystemItemDto
{
/// <summary>
/// Gets or sets the full path to the file system item.
/// </summary>
public string? Path { get; set; }
/// <summary>
/// Gets or sets the name of the file system item.
/// </summary>
public string? Name { get; set; }
/// <summary>
/// Gets or sets the creation date of the file system item.
/// </summary>
public DateTime DateCreated { get; set; }
/// <summary>
/// Gets or sets the modification date of the file system item.
/// </summary>
public DateTime DateModified { get; set; }
}
@@ -0,0 +1,44 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.FileSystem;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.FileSystemManagement;
/// <summary>
/// Data transfer object for a file system node.
/// </summary>
[DebuggerDisplay("Path: {Path}")]
public class FileSystemTreeNodeDto
{
/// <summary>
/// Gets or sets the full path of the file or directory.
/// </summary>
public string Path { get; set; } = null!;
/// <summary>
/// Gets or sets the name of the file or directory.
/// </summary>
public string Name { get; set; } = null!;
/// <summary>
/// Gets or sets the type of the item, indicating whether it is a file, directory, or drive.
/// </summary>
public FileSystemItemType ItemType { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the node is expanded.
/// </summary>
public bool IsExpanded { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the child nodes have been loaded.
/// </summary>
public bool ChildrenLoaded { get; set; }
/// <summary>
/// Gets or sets the list of child nodes.
/// </summary>
public List<FileSystemTreeNodeDto> Children { get; set; } = [];
}
@@ -0,0 +1,18 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.FileSystem;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.FileSystemManagement;
/// <summary>
/// Data transfer object containing the file system platform type.
/// </summary>`
[DebuggerDisplay("PlatformType: {PlatformType}")]
public class FileSystemTypeDto
{
/// <summary>
/// Gets or sets the file system platform type.
/// </summary>
public PlatformType PlatformType { get; set; }
}
@@ -0,0 +1,14 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.FileSystemManagement;
/// <summary>
/// Data transfer object for a response to the inquiry about the existence of a file system path.
/// </summary>
/// <param name="Exists">Whether a file system path exists or not.</param>
[DebuggerDisplay("Exists: {Exists}")]
public record PathExistsDto(
bool Exists
);
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.FileSystemManagement;
/// <summary>
/// Data transfer object for a response containing a file system path.
/// </summary>
[DebuggerDisplay("Path: {Path}")]
public class PathSegmentDto
{
/// <summary>
/// Gets or sets the returned path.
/// </summary>
public string Path { get; set; } = null!;
}
@@ -0,0 +1,14 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.FileSystemManagement;
/// <summary>
/// Data transfer object for a file system path separator.
/// </summary>
/// <param name="Separator">The system's path separator.</param>
[DebuggerDisplay("Separator: {Separator}")]
public record PathSeparatorDto(
string Separator
);
@@ -0,0 +1,14 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.FileSystemManagement;
/// <summary>
/// Data transfer object for a response to the inquiry about the validity of a file system path.
/// </summary>
/// <param name="IsValid">Whether a file system path is valid or not.</param>
[DebuggerDisplay("IsValid: {IsValid}")]
public record PathValidDto(
bool IsValid
);
@@ -0,0 +1,33 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Libraries;
/// <summary>
/// Data transfer object for a lightweight book element, containing only the properties needed by the client for card-style navigation.
/// </summary>
[DebuggerDisplay("Title: {Title}")]
public class BookLiteDto
{
/// <summary>
/// Gets or sets the Id of the book.
/// </summary>
public Guid Id { get; set; }
/// <summary>
/// Gets or sets the title of the book.
/// </summary>
public string Title { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the release year of the book (re-release year, if available, or original release year), if known.
/// </summary>
public int? ReleaseYear { get; set; }
/// <summary>
/// Gets or sets the path of the image representing the cover of the book, if available.
/// </summary>
public string? CoverPath { get; set; }
}
@@ -0,0 +1,71 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.Library;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Libraries;
/// <summary>
/// Data transfer object for a library element.
/// </summary>
[DebuggerDisplay("Title: {Title}")]
public class LibraryDto
{
/// <summary>
/// Gets or sets the unique identifier of the media library.
/// </summary>
public Guid? Id { get; set; }
/// <summary>
/// Gets or sets the unique identifier of the user owning the media library.
/// </summary>
public Guid? UserId { get; set; }
/// <summary>
/// Gets or sets the title of the library.
/// </summary>
public string? Title { get; set; }
/// <summary>
/// Gets or sets the type of the library.
/// </summary>
public string? LibraryType { get; set; }
/// <summary>
/// Gets or sets the path of the image file used as the cover for the library.
/// </summary>
public string? CoverImage { get; set; }
/// <summary>
/// Gets or sets the collection of directories that contain the library files.
/// </summary>
public List<string> ContentLocations { get; set; } = [];
/// <summary>
/// Gets or sets whether this media library is enabled or not. A disabled media library is never shown or changed.
/// </summary>
public bool IsEnabled { get; set; } = true;
/// <summary>
/// Gets or sets whether this media library is locked or not. A locked media library is displayed, but is never changed or updated.
/// </summary>
public bool IsLocked { get; set; } = false;
/// <summary>
/// Gets or sets whether this media library should update the metadata of its elements from the web, or not.
/// </summary>
public bool DownloadMetadataFromWeb { get; set; } = true;
/// <summary>
/// Gets or sets whether this media library should copy the downloaded metadata into the media library content locations, or not.
/// </summary>
public bool ShouldSaveMetadataInMediaDirectories { get; set; } = false;
/// <summary>
/// Gets or sets whether this media library should skip the directories whose contents have not changed since the last scan, during the scan. This is an opt-in setting, because it relies on directory metadata,
/// which does not change when the contents of an existing file are edited, and such edits could be missed while this setting is enabled.
/// </summary>
public bool ShouldSkipUnchangedDirectoriesDuringScan { get; set; } = false;
}
@@ -0,0 +1,32 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Libraries;
/// <summary>
/// Data transfer object for a media library scan job progress model.
/// </summary>
[DebuggerDisplay("CompletedItems: {CompletedItems}; TotalItems: {TotalItems}")]
public class LibraryScanJobProgressDto
{
/// <summary>
/// Gets or sets the number of completed items of the media library scan job.
/// </summary>
public int CompletedItems { get; set; }
/// <summary>
/// Gets or sets the total number of items of the media library scan job.
/// </summary>
public int TotalItems { get; set; }
/// <summary>
/// Gets or sets the current operation being performed by the media library scan job.
/// </summary>
public string? CurrentOperation { get; set; }
/// <summary>
/// Gets or sets the ratio between the total number and the completed number of items, as a percentage.
/// </summary>
public decimal ProgressPercentage { get; set; }
}
@@ -0,0 +1,53 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Libraries;
/// <summary>
/// Data transfer object for a media library scan progress model.
/// </summary>
[DebuggerDisplay("ScanId: {ScanId}; UserId: {UserId}; LibraryId: {LibraryId}")]
public class LibraryScanProgressDto
{
/// <summary>
/// Gets or sets the unique identifier of the media library scan.
/// </summary>
public Guid ScanId { get; set; }
/// <summary>
/// Gets or sets the unique identifier of the user initiating this media library scan.
/// </summary>
public Guid UserId { get; set; }
/// <summary>
/// Gets or sets the unique identifier of the media library that is scanned.
/// </summary>
public Guid LibraryId { get; set; }
/// <summary>
/// Gets or sets the number of completed jobs of the media library scan job.
/// </summary>
public int CompletedJobs { get; set; }
/// <summary>
/// Gets or sets the total number of jobs of the media library scan job.
/// </summary>
public int TotalJobs { get; set; }
/// <summary>
/// Gets or sets the optional current job progress of the media library scan.
/// </summary>
public LibraryScanJobProgressDto? CurrentJobProgress { get; set; }
/// <summary>
/// Gets or sets the status of the media library scan.
/// </summary>
public string? Status { get; set; }
/// <summary>
/// Gets or sets the ratio between the total number and the completed number of jobs, as a percentage.
/// </summary>
public decimal OverallProgressPercentage { get; set; }
}
@@ -0,0 +1,38 @@
#region ========================================================================= USING =====================================================================================
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Libraries;
/// <summary>
/// Data transfer object for a paginated collection of lightweight book elements, together with pagination metadata.
/// </summary>
[DebuggerDisplay("CurrentPage: {CurrentPage}; Count: {Count}")]
public class PaginatedBookLiteDto
{
/// <summary>
/// Gets or sets the collection of lightweight book elements associated with this instance.
/// </summary>
public IReadOnlyList<BookLiteDto> Data { get; set; } = [];
/// <summary>
/// Gets or sets the current page number in a paginated collection.
/// </summary>
public int CurrentPage { get; set; }
/// <summary>
/// Gets or sets the number of items to include per page in paginated results.
/// </summary>
public int PerPage { get; set; }
/// <summary>
/// Gets or sets the total number of elements available in the paginated result set.
/// </summary>
public int Count { get; set; }
/// <summary>
/// Gets or sets the total number of pages based on elements available in the result set and per page.
/// </summary>
public int NumberOfPages { get; set; }
}
@@ -0,0 +1,23 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Libraries;
/// <summary>
/// Data transfer object for a media library scan response.
/// </summary>
[DebuggerDisplay("ScanId: {ScanId} LibraryId: {LibraryId}")]
public class ScanLibraryDto
{
/// <summary>
/// Gets or sets the Id of the media library scan.
/// </summary>
public Guid? ScanId { get; set; }
/// <summary>
/// Gets or sets the Id of the scanned media library.
/// </summary>
public Guid? LibraryId { get; set; }
}
@@ -0,0 +1,22 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.MediaContributors;
/// <summary>
/// Data transfer object for a media contributor.
/// </summary>
[DebuggerDisplay("Name: {Name}")]
public class MediaContributorDto
{
/// <summary>
/// Gets the name of the contributor.
/// </summary>
public MediaContributorNameDto? Name { get; set; }
/// <summary>
/// Gets the role of the contributor.
/// </summary>
public MediaContributorRoleDto? Role { get; set; }
}
@@ -0,0 +1,22 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.MediaContributors;
/// <summary>
/// Data transfer object for a media contributor name.
/// </summary>
[DebuggerDisplay("DisplayName: {DisplayName}")]
public class MediaContributorNameDto
{
/// <summary>
/// Gets the name by which the contributor is popularly known.
/// </summary>
public string? DisplayName { get; set; }
/// <summary>
/// Gets the legal name of the contributor.
/// </summary>
public string? LegalName { get; set; }
}
@@ -0,0 +1,22 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.MediaContributors;
/// <summary>
/// Data transfer object for a media contributor role.
/// </summary>
[DebuggerDisplay("Name: {Name}")]
public class MediaContributorRoleDto
{
/// <summary>
/// Gets the value representing this object.
/// </summary>
public string? Name { get; set; }
/// <summary>
/// Gets the category of this object.
/// </summary>
public string? Category { get; set; }
}
@@ -0,0 +1,33 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Plugins;
/// <summary>
/// Data transfer object for a metadata provider configured for a media library.
/// </summary>
[DebuggerDisplay("Name: {Name}")]
public class LibraryMetadataProviderDto
{
/// <summary>
/// Gets or sets the unique identifier of the plugin providing the metadata.
/// </summary>
public Guid PluginId { get; set; }
/// <summary>
/// Gets or sets the display name of the metadata provider.
/// </summary>
public string Name { get; set; } = string.Empty;
/// <summary>
/// Gets or sets whether the metadata provider is enabled for the media library.
/// </summary>
public bool IsEnabled { get; set; }
/// <summary>
/// Gets or sets the rank of the metadata provider, determining the order in which providers are tried.
/// </summary>
public int Rank { get; set; }
}
@@ -0,0 +1,55 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.Plugins;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Plugins;
/// <summary>
/// Data transfer object for a detected plugin.
/// </summary>
[DebuggerDisplay("Name: {Name}")]
public class PluginDto
{
/// <summary>
/// Gets or sets the unique identifier of the plugin.
/// </summary>
public Guid Id { get; set; }
/// <summary>
/// Gets or sets the display name of the plugin.
/// </summary>
public string Name { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the author of the plugin.
/// </summary>
public string Author { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the version of the plugin.
/// </summary>
public string Version { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the description of the plugin.
/// </summary>
public string Description { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the load status of the plugin.
/// </summary>
public PluginLoadStatus LoadStatus { get; set; }
/// <summary>
/// Gets or sets the error message when the plugin failed to load.
/// </summary>
public string? LoadError { get; set; }
/// <summary>
/// Gets or sets the settings of the plugin.
/// </summary>
public Dictionary<string, string>? Settings { get; set; }
}
@@ -0,0 +1,39 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.Plugins;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Plugins;
/// <summary>
/// Data transfer object for a single setting of a plugin.
/// </summary>
[DebuggerDisplay("Key: {Key}, Label: {Label}")]
public class PluginSettingDescriptorDto
{
/// <summary>
/// Gets or sets the unique key of the setting.
/// </summary>
public string Key { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the display label of the setting.
/// </summary>
public string Label { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the type of the setting.
/// </summary>
public PluginSettingType Type { get; set; }
/// <summary>
/// Gets or sets the default value of the setting.
/// </summary>
public string? DefaultValue { get; set; }
/// <summary>
/// Gets or sets the list of allowed values, when the setting is a selection.
/// </summary>
public IReadOnlyList<string>? AllowedValues { get; set; }
}
@@ -0,0 +1,29 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Plugins;
/// <summary>
/// Data transfer object for the settings of a plugin and their schema.
/// </summary>
[DebuggerDisplay("PluginId: {PluginId}")]
public class PluginSettingsDto
{
/// <summary>
/// Gets or sets the unique identifier of the plugin.
/// </summary>
public Guid PluginId { get; set; }
/// <summary>
/// Gets or sets the schema of the plugin settings.
/// </summary>
public List<PluginSettingDescriptorDto> Schema { get; set; } = [];
/// <summary>
/// Gets or sets the current values of the plugin settings.
/// </summary>
public Dictionary<string, string>? Settings { get; set; }
}
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.UsersManagement;
/// <summary>
/// Data transfer object for a user.
/// </summary>
/// <param name="Id">The unique identifier of the user.</param>
/// <param name="Username">The username of the user.</param>
[DebuggerDisplay("Id: {Id}, Username: {Username}")]
public record UserDto(
Guid Id,
string Username
);
@@ -0,0 +1,33 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.UsersManagement;
/// <summary>
/// Data transfer object for the settings of a user.
/// </summary>
[DebuggerDisplay("IsPaginationEnabled: {IsPaginationEnabled}; ItemsPerPage: {ItemsPerPage}")]
public class UserSettingsDto
{
/// <summary>
/// Gets or sets the unique identifier of the user that owns these settings.
/// </summary>
public Guid? UserId { get; set; }
/// <summary>
/// Gets or sets whether pagination is enabled for the user, or not.
/// </summary>
public bool IsPaginationEnabled { get; set; } = true;
/// <summary>
/// Gets or sets the number of library items displayed per page when pagination is enabled.
/// </summary>
public int ItemsPerPage { get; set; } = 48;
/// <summary>
/// Gets or sets whether the "The" prefix of library item titles is ignored by the alpha picker, or not.
/// </summary>
public bool IgnoreThePrefixForAlphaPicker { get; set; }
}
@@ -0,0 +1,216 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.DTO.Common;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary.BookLibrary;
/// <summary>
/// Data transfer object for a book.
/// </summary>
[DebuggerDisplay("Title: {Title}")]
public class BookDto
{
/// <summary>
/// Gets the Id of the media item.
/// </summary>
public Guid Id { get; init; }
/// <summary>
/// Gets the Id of the media library this book belongs to.
/// </summary>
public Guid LibraryId { get; init; }
/// <summary>
/// Gets the file system path of the book.
/// </summary>
public string Path { get; init; } = null!;
/// <summary>
/// Gets the title of the media item.
/// </summary>
public string Title { get; init; } = null!;
/// <summary>
/// Gets the original title of the media item.
/// </summary>
public string? OriginalTitle { get; init; }
/// <summary>
/// Gets the optional description of the media item.
/// </summary>
public string? Description { get; init; }
/// <summary>
/// Gets the optional original release date of the media item.
/// </summary>
public DateOnly? OriginalReleaseDate { get; init; }
/// <summary>
/// Gets the optional original release year of the media item.
/// This is useful when only the year of original release is known.
/// </summary>
public int? OriginalReleaseYear { get; init; }
/// <summary>
/// Gets the optional re-release or reissue date of the media item.
/// </summary>
public DateOnly? ReReleaseDate { get; init; }
/// <summary>
/// Gets the optional re-release or reissue year of the media item.
/// </summary>
public int? ReReleaseYear { get; init; }
/// <summary>
/// Gets the optional country or region of release.
/// </summary>
public string? ReleaseCountry { get; init; }
/// <summary>
/// Gets the optional release version or edition. (e.g. "Original", "Director's Cut", "2.0")
/// </summary>
public string? ReleaseVersion { get; init; }
/// <summary>
/// Gets the ISO 639-1 two-letter language code.
/// </summary>
public string? LanguageCode { get; init; }
/// <summary>
/// Gets the full name of the language in English.
/// </summary>
public string? LanguageName { get; init; }
/// <summary>
/// Gets an optional native name of the language.
/// </summary>
public string? LanguageNativeName { get; init; }
/// <summary>
/// Gets the optional ISO 639-1 two-letter original language code.
/// </summary>
public string? OriginalLanguageCode { get; init; }
/// <summary>
/// Gets the optional full name of the original language in English.
/// </summary>
public string? OriginalLanguageName { get; init; }
/// <summary>
/// Gets an optional native name of the original language.
/// </summary>
public string? OriginalLanguageNativeName { get; init; }
/// <summary>
/// Gets the list of tags associated with the media item.
/// </summary>
public HashSet<TagDto> Tags { get; set; } = [];
/// <summary>
/// Gets the list of genres associated with the media item.
/// </summary>
public HashSet<GenreDto> Genres { get; set; } = [];
/// <summary>
/// Gets the publisher of the written content.
/// </summary>
public string? Publisher { get; init; }
/// <summary>
/// Gets the number of pages in the written content.
/// </summary>
public int? PageCount { get; init; }
/// <summary>
/// Gets the format of the book (e.g., Hardcover, Paperback), if applicable.
/// </summary>
public string Format { get; init; } = null!;
/// <summary>
/// Gets the edition of the book, if applicable.
/// </summary>
public string? Edition { get; init; }
/// <summary>
/// Gets the volume or book number in the series, if applicable.
/// </summary>
public int? VolumeNumber { get; init; }
/// <summary>
/// Gets the series id, if the book is part of a series.
/// </summary>
//public Guid? BookSeriesId { get; init; } = null;
/// <summary>
/// Gets the ASIN (Amazon Standard Identification Number) of the book.
/// </summary>
public string? ASIN { get; init; } = null!;
/// <summary>
/// Gets the Goodreads ID of the book.
/// </summary>
public string? GoodreadsId { get; init; } = null!;
/// <summary>
/// Gets the Library of Congress Control Number (LCCN) of the book.
/// </summary>
public string? LCCN { get; init; } = null!;
/// <summary>
/// Gets the OCLC Number (WorldCat identifier) of the book.
/// </summary>
public string? OCLCNumber { get; init; } = null!;
/// <summary>
/// Gets the Open Library ID of the book.
/// </summary>
public string? OpenLibraryId { get; init; } = null!;
/// <summary>
/// Gets the LibraryThing ID of the book.
/// </summary>
public string? LibraryThingId { get; init; } = null!;
/// <summary>
/// Gets the Google Books ID of the book.
/// </summary>
public string? GoogleBooksId { get; init; } = null!;
/// <summary>
/// Gets the Barnes & Noble ID of the book.
/// </summary>
public string? BarnesAndNobleId { get; init; } = null!;
/// <summary>
/// Gets the Apple Books ID of the book.
/// </summary>
public string? AppleBooksId { get; init; } = null!;
/// <summary>
/// Gets the list of ISBN (International Standard Book Number) of the book.
/// </summary>
public List<IsbnDto> ISBNs { get; set; } = [];
/// <summary>
/// Gets the list of media contributors (actors, directors, etc) starring in this book.
/// </summary>
//public List<ContributorIdModel> ContributorIds { get; init; } = [];
/// <summary>
/// Gets the list of ratings for this book.
/// </summary>
public List<BookRatingDto> Ratings { get; init; } = [];
/// <summary>
/// Gets the time and date when the entity was added.
/// </summary>
public DateTime Created { get; set; }
/// <summary>
/// Gets the optional time and date when the entity was updated.
/// </summary>
public DateTime? Updated { get; set; }
}
@@ -0,0 +1,19 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.BookLibrary;
using System.Diagnostics;
using Lumina.Presentation.Web.Common.DTO.Common;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary.BookLibrary;
/// <summary>
/// Data transfer object for a book rating.
/// </summary>
[DebuggerDisplay("Value: {Value}, MaxValue: {MaxValue}")]
public class BookRatingDto : RatingDto
{
/// <summary>
/// Gets or sets the source of the book rating (e.g., a specific website or platform).
/// </summary>
public BookRatingSource? Source { get; set; }
}
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary.BookLibrary;
/// <summary>
/// Data transfer object for a request to get book series information.
/// </summary>
[DebuggerDisplay("Title: {Title}")]
public class BookSeriesDto
{
/// <summary>
/// Gets or sets the title of the book series.
/// </summary>
public string? Title { get; set; }
}
@@ -0,0 +1,23 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.BookLibrary;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary.BookLibrary;
/// <summary>
/// Data transfer object for a request to get ISBN information.
/// </summary>
[DebuggerDisplay("Value: {Value} ({Format})")]
public class IsbnDto
{
/// <summary>
/// Gets or sets the ISBN value.
/// </summary>
public string? Value { get; set; }
/// <summary>
/// Gets or sets the format of the ISBN (e.g., ISBN-10 or ISBN-13).
/// </summary>
public IsbnFormat? Format { get; set; }
}
@@ -0,0 +1,33 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary.BookLibrary;
/// <summary>
/// Data transfer object for a preview of important properties of a book.
/// </summary>
[DebuggerDisplay("Title: {Title}")]
public class LightBookDto
{
/// <summary>
/// Gets the Id of the media item.
/// </summary>
public required Guid Id { get; init; }
/// <summary>
/// Gets the title of the media item.
/// </summary>
public required string Title { get; init; }
/// <summary>
/// Gets the optional release year (either re-release year, if available, or original release year, if known) of the media item.
/// </summary>
public int? ReleaseYear { get; init; }
/// <summary>
/// Gets the optional path of the image representing the cover of this book.
/// </summary>
public string? CoverPath { get; init; }
}
@@ -0,0 +1,64 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.DTO.Common;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary;
/// <summary>
/// Data transfer object for written content metadata.
/// </summary>
[DebuggerDisplay("Title: {Title}")]
public class WrittenContentMetadataDto
{
/// <summary>
/// Gets or sets the title of the written content.
/// </summary>
public string? Title { get; set; }
/// <summary>
/// Gets or sets the original title of the written content, if different from the current title.
/// </summary>
public string? OriginalTitle { get; set; }
/// <summary>
/// Gets or sets a brief description or summary of the written content.
/// </summary>
public string? Description { get; set; }
/// <summary>
/// Gets or sets the release information, including release date and other relevant details.
/// </summary>
public ReleaseInfoDto? ReleaseInfo { get; set; }
/// <summary>
/// Gets or sets the list of genres associated with the written content.
/// </summary>
public List<GenreDto>? Genres { get; set; }
/// <summary>
/// Gets or sets the list of tags that further describe or categorize the written content.
/// </summary>
public List<TagDto>? Tags { get; set; }
/// <summary>
/// Gets or sets the language in which the written content is written.
/// </summary>
public LanguageInfoDto? Language { get; set; }
/// <summary>
/// Gets or sets the original language of the written content, if it has been translated.
/// </summary>
public LanguageInfoDto? OriginalLanguage { get; set; }
/// <summary>
/// Gets or sets the name of the publisher of the written content.
/// </summary>
public string? Publisher { get; set; }
/// <summary>
/// Gets or sets the number of pages in the written content.
/// </summary>
public int? PageCount { get; set; }
}