Skip to main content
Deterministic ledger test double; production wiring must provide persistent storage. Constructors Constructor
new InMemoryChannelLedger(options?): InMemoryChannelLedger
Parameters Returns InMemoryChannelLedger Methods acceptInbound()
acceptInbound(channel, externalMessageId, conversationId, accept): Promise<Readonly<{ duplicate: boolean; runId: string; }>>
Atomically claims an inbound provider message and persists its run mapping as one recovery unit. Persistent implementations must share this claim across router processes and must not release a claim after accept succeeds. Parameters Returns Promise<Readonly<{ duplicate: boolean; runId: string; }>> Implementation of ChannelLedger.acceptInbound findOutbound()
findOutbound(channel, providerRequestId): Promise<string | undefined>
Parameters Returns Promise<string | undefined> Implementation of ChannelLedger.findOutbound findRun()
findRun(runId): Promise<Readonly<{ channel: string; conversationId: string; }> | undefined>
Parameters Returns Promise<Readonly<{ channel: string; conversationId: string; }> | undefined> Implementation of ChannelLedger.findRun recoverOutbound()
recoverOutbound(channel, runId, idempotencyKey): Promise<{ providerRequestId: string; } | undefined>
Reconciles a previous provider success without authorizing or sending again. Parameters Returns Promise<{ providerRequestId: string; } | undefined> Implementation of ChannelLedger.recoverOutbound sendOutbound()
sendOutbound(channel, runId, idempotencyKey, send): Promise<{ providerRequestId: string; }>
Reserves and completes one correlated outbound attempt. Implementations must retain the stable idempotency key through retries/recovery so a provider never observes an unkeyed resend after persistence uncertainty. Parameters Returns Promise<{ providerRequestId: string; }> Implementation of ChannelLedger.sendOutbound

InMemoryChannelLedgerOptions

Properties failAfterInboundAcceptOnce?
readonly optional failAfterInboundAcceptOnce?: boolean
Test-only fault injection for recovery-path verification. failAfterOutboundSendOnce?
readonly optional failAfterOutboundSendOnce?: boolean
Test-only fault injection for recovery-path verification.