R4 server pieces: typed admin statistics, DELETE media, accounts by ids, hashtag history in search
Build / Build (push) Successful in 32s

Completion program R4 (the client catching up), the server's part.

- /clientapi/admin/statistics/hosts/{host}, /events and /server answer typed views (ViewHostDetail, ViewHostInstance,
  ViewHostDay, ViewInteractionEvent, ViewServerDay in ClientModels) instead of an anonymous object and raw entities:
  the instance's public description, never its raw instance API document; the events without their actor hash. The
  JSON names stay, so lib/interop.sh's stats_check reads them as before.
- DELETE /api/v1/media/{id} (Mastodon 4.4): a persona's own upload goes to the trash while nothing holds it; a posted
  or scheduled one answers 422.
- GET /api/v1/accounts?id[]= (Mastodon 4.3): up to 40 accounts, those that exist.
- /api/v2/search's hashtags carry their week of use (TagsController.History), not an empty history.

Verified: dotnet build PrivaPub.sln -c Release; the pasture: gts 64/64 (statistics included); by hand, an unattached
upload deleted (then 404), a posted one refused (422), accounts by ids, a hashtag's history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpVCoDeM1qUTRp4fXQdfof
This commit is contained in:
thepraandClaude Opus 5.5 committed 2026-10-17 03:23:06 +02:00
1 parent 1f3bb27e17
commit f67e2ae35e
5 files changed
+155 -12

No files matched your search

@@ -96,4 +96,96 @@ namespace PrivaPub.ClientModels.Admin
public string CrawlError { get; set; }
public string Software { get; set; }
}
// /clientapi/admin/statistics/hosts/{host}: one server, what it says of itself, its days and its latest events
public class ViewHostDetail
{
public string Host { get; set; }
public ViewHostInstance Instance { get; set; }
public List<ViewHostDay> Days { get; set; } = [];
public List<ViewInteractionEvent> Events { get; set; } = [];
public string Attribution { get; set; }
}
public class ViewHostInstance
{
public string Software { get; set; }
public string SoftwareVersion { get; set; }
public string NodeName { get; set; }
public string Title { get; set; }
public string NodeDescription { get; set; }
public bool? OpenRegistrations { get; set; }
public string RegistrationMode { get; set; }
public long? UsersTotal { get; set; }
public long? UsersActiveMonth { get; set; }
public long? LocalPosts { get; set; }
public List<string> Languages { get; set; } = [];
public string Seen { get; set; }
public DateTime? FirstSeenAt { get; set; }
public DateTime? LastSeenAt { get; set; }
public DateTime? DescribedAt { get; set; }
public string DescriptionError { get; set; }
public DateTime? LastSuccessAt { get; set; }
public DateTime? LastFailureAt { get; set; }
public string LastError { get; set; }
public int ConsecutiveFailures { get; set; }
public DateTime? UnavailableUntil { get; set; }
public string Country { get; set; }
public string City { get; set; }
public int? Asn { get; set; }
public string AsnOrg { get; set; }
public string Cdn { get; set; }
public string InstanceApi { get; set; }
public string SourceUrl { get; set; }
}
public class ViewHostDay
{
public DateTime Day { get; set; }
public Dictionary<string, long> Counters { get; set; } = new();
public Dictionary<string, long> Latency { get; set; } = new();
public Dictionary<string, long> Bytes { get; set; } = new();
public Dictionary<string, long> Reads { get; set; } = new();
public int Accounts { get; set; }
public bool Live { get; set; }//today's or a day not rolled up yet, folded from its events
}
// one ledger entry: what was received, delivered or fetched, and how it ended; never who
public class ViewInteractionEvent
{
public DateTime At { get; set; }
public string Host { get; set; }
public string Channel { get; set; }
public string Activity { get; set; }
public string Object { get; set; }
public string Purpose { get; set; }
public string Trigger { get; set; }
public string Outcome { get; set; }
public string Reason { get; set; }
public int? Status { get; set; }
public int? LatencyMs { get; set; }
public int? WaitMs { get; set; }
public long? Bytes { get; set; }
public int? Attempt { get; set; }
public string Audience { get; set; }
public string LocalKind { get; set; }
public string Inbox { get; set; }
public string Signature { get; set; }
public List<string> Features { get; set; } = [];
public long? AgeSeconds { get; set; }
}
// /clientapi/admin/statistics/server: the server's own day, its client API and the documents it served
public class ViewServerDay
{
public DateTime Day { get; set; }
public Dictionary<string, long> Client { get; set; } = new();
public Dictionary<string, long> ClientLatency { get; set; } = new();
public Dictionary<string, long> Served { get; set; } = new();
public long LedgerWritten { get; set; }
public long LedgerDropped { get; set; }
public long LedgerFailed { get; set; }
public int Accounts { get; set; }
public int Hosts { get; set; }
}
}