Writes a row inside the caller's transaction.
The caller's unit of work
The row to write
A promise that rejects with the adapter's DuplicateKeyError
for a duplicate id
Claims a pending row at the read version, incrementing that version by one.
The row id
The read version and the new lease expiry
ReadonlyclaimVersion: numberVersion read by the caller, in [0, Number.MAX_SAFE_INTEGER - 1].
ReadonlyleaseUntil: numberNew claim expiry in epoch milliseconds.
applied, missing, not-pending, or claim-lost
Reads the keys of failed rows, never their envelopes.
Maximum keys returned
The failed rows' tenant and ordering keys
Records a publish failure on a pending row at the held version, clearing its lease.
The row id
The held version, attempt count, error line, retry time and status
Readonlyattempts: numberReadonlyavailableAt: numberReadonlyclaimVersion: numberVersion held by the publishing relay.
ReadonlylastError: stringReadonlystatus: "failed" | "pending"applied, or why nothing was written
Poisons an invalid pending row without a claim, preserving its attempts.
Writes failed, invalid-row, availableAt: now, and leaseUntil: 0.
The row id
Epoch milliseconds
applied, missing, or not-pending
Marks a pending row as sent (or deletes it when deleteNow is set).
The row id
The held version, settlement time, sending sweep and deletion policy
ReadonlyclaimVersion: numberVersion held by the sending relay.
ReadonlydeleteNow: booleanDelete immediately instead of retaining the sent row.
ReadonlysentBy: stringSending instance and sweep origin, for operator diagnostics.
ReadonlysettledAt: numberSettlement time in epoch milliseconds.
applied, or why nothing was written
Deletes sent, then discarded, rows settled before before.
Epoch milliseconds; rows with settledAt < before are deleted
Maximum rows deleted per status
The number of rows deleted (a row already gone counts zero)
Releases a failed row: retry returns it to pending with
attempts: 0, availableAt: now, leaseUntil: 0 and no lastError, keeping its version;
discard makes it discarded with
settledAt: now.
The row id
retry or discard
Epoch milliseconds
applied, missing, or not-failed
Reads pending rows in ascending position order.
Applies NO availableAt filter: the relay decides what a row's backoff
means for its key.
Exclusive lower bound on position; undefined reads from the start
Maximum rows returned
The rows, in position order
Counts pending and failed rows and reads the oldest pending row's age.
The counts
Refuses, at startup, a backend that cannot serve the outbox.
A promise that rejects naming why the store cannot serve
The outbox store port.
Every method returns a promise that REJECTS on failure and never throws synchronously. Every transition atomically requires the expected status and
kindequal toOUTBOX_RECORD_KIND. Claims compare and increment the read version; settlement compares the held version. Every read requires that discriminator. A custom store must honour these rules.Since
0.9.0