A Backups section (for administrators, PrivaPub's /clientapi/admin/backups): the backups kept with their kind, size, media and the logins deleted since, what runs, the restore waiting and the last restore's report. Back up now; download for the password through a link good for ten minutes, which the browser saves to disk; upload a downloaded backup in pieces straight from the picked file (js/transfer.js PUTs file.slice at the offset PrivaPub has, never through .NET's memory, and carries on after a refused or lost piece); delete after asking; restore for the password and the host typed out, saying what it keeps and what it loses, then showing PrivaPub restarting until the ended session sends the page to sign in. e2e: a backup made, downloaded and uploaded again; and, only with --filter "Category=Restore", a real restore of the pasture, which signs the town in again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
70 lines
2.9 KiB
C#
70 lines
2.9 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
using decePubClient.Models;
|
|
|
|
using PrivaPub.ClientModels;
|
|
using PrivaPub.ClientModels.Admin;
|
|
using PrivaPub.ClientModels.Group;
|
|
using PrivaPub.ClientModels.Post;
|
|
using PrivaPub.ClientModels.User;
|
|
using PrivaPub.ClientModels.User.Avatar;
|
|
|
|
namespace decePubClient;
|
|
|
|
/// <summary>
|
|
/// Source-generated JSON metadata for the client's own types, used first by SUtility.DefaultSerializer (HTTP) and by
|
|
/// Blazored.LocalStorage (Program.cs). Register every type that crosses HTTP or is stored in localStorage here; types
|
|
/// missing from it still work through the reflection fallback. Names stay camelCase: wwwroot/js/theme.js reads
|
|
/// PublicCacheData.pageSettings straight from localStorage.
|
|
/// </summary>
|
|
[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
|
|
IgnoreReadOnlyProperties = true)]
|
|
[JsonSerializable(typeof(PublicCacheData))]
|
|
[JsonSerializable(typeof(PageSettings))]
|
|
[JsonSerializable(typeof(AuthData))]
|
|
[JsonSerializable(typeof(FeedFilter))]
|
|
[JsonSerializable(typeof(PublicActionNotices))]
|
|
[JsonSerializable(typeof(ServerInfo))]
|
|
[JsonSerializable(typeof(List<ServerInfo>))]
|
|
[JsonSerializable(typeof(UploadMedia))]
|
|
[JsonSerializable(typeof(ClientLogs))]
|
|
[JsonSerializable(typeof(ClientLogException))]
|
|
[JsonSerializable(typeof(ValidationErrors))]
|
|
[JsonSerializable(typeof(WebResult))]
|
|
[JsonSerializable(typeof(LoginForm))]
|
|
[JsonSerializable(typeof(UserPasswordForm))]
|
|
[JsonSerializable(typeof(RemoveSelfForm))]
|
|
[JsonSerializable(typeof(JwtUser))]
|
|
[JsonSerializable(typeof(ViewAvatar))]
|
|
[JsonSerializable(typeof(List<ViewAvatar>))]
|
|
[JsonSerializable(typeof(InsertAvatarForm))]
|
|
[JsonSerializable(typeof(ViewGroup))]
|
|
[JsonSerializable(typeof(List<ViewGroup>))]
|
|
[JsonSerializable(typeof(ViewGroupMember))]
|
|
[JsonSerializable(typeof(List<ViewGroupMember>))]
|
|
[JsonSerializable(typeof(InsertGroupForm))]
|
|
[JsonSerializable(typeof(UpdateGroupForm))]
|
|
[JsonSerializable(typeof(JoinGroupForm))]
|
|
[JsonSerializable(typeof(GroupMembershipForm))]
|
|
[JsonSerializable(typeof(ViewPost))]
|
|
[JsonSerializable(typeof(List<ViewPost>))]
|
|
[JsonSerializable(typeof(InsertPostForm))]
|
|
[JsonSerializable(typeof(DeletePostForm))]
|
|
[JsonSerializable(typeof(ViewReport))]
|
|
[JsonSerializable(typeof(List<ViewReport>))]
|
|
[JsonSerializable(typeof(DomainBlockForm))]
|
|
[JsonSerializable(typeof(ViewDomainBlock))]
|
|
[JsonSerializable(typeof(List<ViewDomainBlock>))]
|
|
[JsonSerializable(typeof(ViewStatisticsOverview))]
|
|
[JsonSerializable(typeof(ViewHostsPage))]
|
|
[JsonSerializable(typeof(ViewCrawler))]
|
|
[JsonSerializable(typeof(ViewBackups))]
|
|
[JsonSerializable(typeof(ViewBackup))]
|
|
[JsonSerializable(typeof(BackupPasswordForm))]
|
|
[JsonSerializable(typeof(RestoreBackupForm))]
|
|
[JsonSerializable(typeof(ViewBackupTicket))]
|
|
[JsonSerializable(typeof(ViewBackupUpload))]
|
|
public partial class ClientJsonContext : JsonSerializerContext
|
|
{
|
|
}
|