/** * Project-specific message types passed across binding boundaries. * * The Worker's `Env` type itself is generated by `wrangler types` into * `worker-configuration.d.ts` (committed alongside this file), exposed * globally as `Env` and via `Cloudflare.Env`. Re-running `wrangler types` * after editing `wrangler.jsonc` keeps it in sync. */ export interface RecordsJob { did: string; collection: string; rkey: string; operation: "create" | "update" | "delete"; cid: string; /** * The Jetstream-supplied (unverified) record bytes. Compared against the * verified PDS copy after fetch as a Jetstream-correctness signal; the * verified copy always wins. */ jetstreamRecord?: unknown; } /** * One unit of cold-start backfill work: walk every record under `collection` * for `did` via that DID's PDS, then enqueue each record onto the records * queue for the standard verify-and-write path. * * Granularity is (DID, collection) rather than per-DID because the per-DID * fan-out can exceed Cloudflare's 30s `ctx.waitUntil` wall-clock cap. One * collection's worth of pagination fits comfortably under that ceiling and * gets queue-level retry + concurrency for free. */ export interface BackfillJob { did: string; collection: string; }