import type { DB } from '../../data/db/index.js'; import { type WebhookSignatureOptions } from './sign.js'; export interface OutboundWebhookConfig { table?: string; deliveryTable?: string; signing?: WebhookSignatureOptions; retry?: { maxAttempts?: number; initialDelayMs?: number; maxDelayMs?: number; }; timeoutMs?: number; } export interface WebhookEndpoint { id: string; tenantId: string; url: string; secret: string; events: string[]; active: boolean; } export interface DeliveryAttempt { id: string; endpointId: string; tenantId: string; eventType: string; payload: unknown; statusCode: number | null; responseBody: string | null; attempt: number; maxAttempts: number; nextRetryAt: Date | null; createdAt: Date; } export interface OutboundWebhook { ensureTables(db: DB): Promise; send(db: DB, tenantId: string, eventType: string, payload: unknown): Promise; deliver(db: DB, deliveryId: string): Promise<{ success: boolean; statusCode: number | null; }>; processPending(db: DB): Promise; registerEndpoint(db: DB, endpoint: Omit): Promise; listEndpoints(db: DB, tenantId: string): Promise; removeEndpoint(db: DB, tenantId: string, endpointId: string): Promise; } export declare function createOutboundWebhook(config?: OutboundWebhookConfig): OutboundWebhook; //# sourceMappingURL=outbound.d.ts.map