Insert-if-absent by id. 'duplicate' means the id is already known (any state);
the existing record is returned unchanged. With lease, a new record is created
already claimed (processing, token 1, 1 attempt), so no other claimer can take it
between the append and the claim.
Optionallease: LeaseOptionsLease due records: pending/failed whose nextAttemptAt <= now, plus processing
records whose lease expired. Oldest receivedAt first. Each claimed record comes back
processing with a fresh fencingToken and attempts + 1.
Lease one specific record when it is claimable (as claim); null when it is not.
Operator replay: any record → pending, due now, attempts reset. No-op for an unknown id.
Records, optionally by state, oldest receivedAt first.
Optionalfilter: { state?: InboxState; limit?: number }Delete done records completed before doneBefore (and dead ones when includeDead). Returns the count.
Persistence contract of the inbound journal.