feat(data): server queries for uploads, jobs, render nodes and sequence edits
Additive repository methods the server needs: upload state transitions, pending bytes, per-day and per-user upload counts, render-result uploads; job claim by id, node progress and completion, priority, queue counts and requeue of numbered workers; sequence edits with settings_version optimistic concurrency; audit filter by action; latest token per user. Migration 0005 adds session_key, job_id and render_json to uploads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
9 files changed
+282
-6
No files matched your search
@@ -17,11 +17,16 @@ public sealed class AuditRepository
|
||||
cancellationToken).ConfigureAwait(false);
|
||||
|
||||
/// <summary>Entries newest first, optionally of one user.</summary>
|
||||
public Task<Page<AuditEntry>> ListAsync(Guid? userId = null, int limit = 100, string? cursor = null, CancellationToken cancellationToken = default)
|
||||
public Task<Page<AuditEntry>> ListAsync(Guid? userId = null, int limit = 100, string? cursor = null, CancellationToken cancellationToken = default) =>
|
||||
ListAsync(userId, action: null, limit, cursor, cancellationToken);
|
||||
|
||||
/// <summary>Entries newest first, optionally of one user and one action (e.g. the sign-in log).</summary>
|
||||
public Task<Page<AuditEntry>> ListAsync(Guid? userId, string? action, int limit = 100, string? cursor = null, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var p = new SqlParameters();
|
||||
var where = new List<string>();
|
||||
if (userId is { } user) where.Add($"user_id = {p.Add(user)}");
|
||||
if (action is not null) where.Add($"action = {p.Add(action)}");
|
||||
if (cursor is not null)
|
||||
{
|
||||
var (value, id) = Cursor.Decode("audit", cursor);
|
||||
|
||||
Reference in new issue
Block a user