feat: add durable asset synchronization worker

This commit is contained in:
jb
2026-09-19 22:15:23 -04:00
parent 2675ea8114
commit fe7d218195
36 changed files with 2218 additions and 189 deletions
+16 -2
View File
@@ -18,12 +18,12 @@ export type Character = {
scopes: string[];
/** Exactly one active primary may authenticate while signed out. */
loginRole: 'primary' | 'data_only';
authorizationStatus: 'active' | 'revocation_pending' | 'quarantined' | 'revoked' | 'transferred';
authorizationStatus: 'active' | 'revocation_pending' | 'quarantined' | 'revoked' | 'transferred' | 'reconnect_required';
grantRevision: number;
credentialVersion: number;
authorizationEpoch: number;
datasets: CharacterDatasetStatus[];
assets: { status: 'never' | 'syncing' | 'ready' | 'error'; syncedAt?: number; expiresAt?: number; error?: string };
assets: { status: 'never' | 'queued' | 'syncing' | 'ready' | 'error'; syncedAt?: number; expiresAt?: number; error?: string };
};
export type Asset = {
itemId: string;
@@ -307,6 +307,20 @@ export type JobOwner =
export type JobAuthority = 'user' | 'system';
export type SyncJobStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled' | 'quarantined';
export type SyncJobDataset = 'assets';
export type SafeSyncJob = {
id: string;
dataset: SyncJobDataset;
characterId: number;
status: SyncJobStatus;
attempts: number;
dueAt: number;
createdAt: number;
updatedAt: number;
leaseExpiresAt: number | null;
cancelRequested: boolean;
error?: string;
};
export type PublicationOutcome = 'success' | 'failure';
export type PublicationResourceFence = SelectedResource & {
/** Monotonic revocation/quarantine epoch, distinct from grant and credential versions. */