Skip to main content
Defined in: durability/types.ts:271 Persistence contract of the outbound journal.

Methods

put()

Defined in: durability/types.ts:276 Insert-if-absent by key; on conflict the existing record is returned unchanged ('exists'). With lease, a new record is created already begun (sending, token 1, 1 attempt).

Parameters

Returns

Promise<{ status: "created" | "exists"; record: OutboxRecord; }>

begin()

Defined in: durability/types.ts:281 pending/failed (due or not) → sending under a fresh token: the persisted “about to call the provider” marker. null when the record is missing or in another state.

Parameters

Returns

Promise<OutboxRecord | null>

markSent()

Defined in: durability/types.ts:283 sending → sent with the provider ref.

Parameters

Returns

Promise<void>

Throws


extend()

Defined in: durability/types.ts:285 Extend the lease of a sending record (heartbeat while the provider call runs).

Parameters

Returns

Promise<void>

Throws


markFailed()

Defined in: durability/types.ts:291 sending → failed (due at retryAt) or dead. With refund, the claim made no provider call (a split part deferred behind an earlier one): the attempt it counted is given back, so waiting never uses up the record’s retries.

Parameters

Returns

Promise<void>

Throws


claimDue()

Defined in: durability/types.ts:297 Lease due pending/failed records and sending records whose lease expired (returned with ambiguous: true), oldest createdAt first. Claimed records come back sending under a fresh token.

Parameters

Returns

Promise<ClaimedSend[]>

resolveAmbiguous()

Defined in: durability/types.ts:299 Settle an ambiguous claim: 'unknown' (terminal) or 'pending' (send again).

Parameters

Returns

Promise<void>

Throws


get()

Defined in: durability/types.ts:300

Parameters

Returns

Promise<OutboxRecord | undefined>

list()

Defined in: durability/types.ts:302 Records, optionally by state and chat, oldest createdAt first.

Parameters

Returns

Promise<OutboxRecord[]>

retry()

Defined in: durability/types.ts:304 Operator retry: failed/dead/unknown → pending, due now.

Parameters

Returns

Promise<void>

discard()

Defined in: durability/types.ts:306 Operator discard: delete the record (a later send with the same key goes out again).

Parameters

Returns

Promise<void>

purge()

Defined in: durability/types.ts:308 Delete terminal records completed before before. Returns the count.

Parameters

Returns

Promise<number>