using System.Text.Json.Serialization;
namespace Chronos.Protocol;
/// Error body of every failed API call: { code, message, details } (BRIEF ยง14.3).
public sealed record ApiError(string Code, string Message, string? Details = null);
/// Upload and account limits announced by the server.
public sealed record ServerLimits(long MaxUploadBytes, int ChunkSizeBytes, int PasswordMinLength = 10);
/// GET /api/v1/server/info.
///
/// File extensions the archive files as photos (lower case, no dot): the admin panel's upload dialog offers and sends only
/// these (owner review 2, R3). Null from servers that do not announce them.
///
///
/// The highest project settings format the server reads and renders (ProjectSettings.CurrentVersion, owner review 1,
/// phase 4); null from an older server, which reads format 1 only. The desktop holds back a push or a render that needs more.
///
public sealed record ServerInfo(
string Name,
string Version,
int ApiVersion,
IReadOnlyList Capabilities,
string? TlsFingerprint,
IReadOnlyList Formats,
ServerLimits Limits,
IReadOnlyList? Extensions = null,
int? SettingsFormat = null);
/// Names of that clients act on.
public static class ServerCapabilities
{
///
/// The server keeps its sequences' projects (owner review 2, R8): /api/v1/sequences/{sid}/projects, the
/// projectChanged event, renders of a project version. A server without it knows only the sequence's settings.
///
public const string Projects = "projects";
///
/// The server keeps a videos library (owner review 1, R9): /api/v1/videos lists, deletes into the trash and copies
/// its renders into its videos folder. Without it a client lists only its own videos.
///
public const string Videos = "videos";
}
/// GET /health.
public sealed record HealthStatus(string Status, string Version, IReadOnlyDictionary Checks);