/** * @pwngh/economy-lab * * Copyright (c) Preston Neal * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */ import type { Dispatcher, CallOptions, Ports, Store } from '../ports.js'; /** * Outcome of one relay run. * - `relayed`: delivered and marked done. * - `failed`: threw under the attempt cap; row stays 'pending' with `attempts` bumped, retried * next run. * - `deadLettered`: hit the attempt cap. Row set to 'dead' and never re-claimed, so a poison * event cannot block the events behind it. */ export type RelaySummary = { relayed: ReadonlyArray; failed: ReadonlyArray<{ id: string; code: string; retryable: boolean; }>; deadLettered: ReadonlyArray<{ id: string; reason: string; }>; }; /** * Delivers a batch of pending outbox events — each written in the same DB transaction as the * money move it describes. * * Delivery can happen more than once (delivery succeeded but marking done did not), so the * receiver must drop duplicates by event id. * * @see {@link https://economy-lab-docs.pages.dev/economy/reference/background-worker/ Background * worker} for outbox relay run semantics and retries. */ export declare function relayOutbox(store: Store, ports: Ports, input: { dispatcher: Dispatcher; limit: number; }, options?: CallOptions): Promise;