import { QueueWebhookService } from '@pikku/core/services'; import type { QueueService } from '@pikku/core/queue'; import { type SendWebhookInput, type SendWebhookResult, type WebhookAttemptResult, type WebhookDeliveryRecord, type WebhookDeliveryWithAttempts } from '@pikku/core/services'; import type { Kysely } from 'kysely'; import type { KyselyPikkuDB } from './kysely-tables.js'; /** * Durable {@link QueueWebhookService}: still delivers through the * `pikku-outgoing-webhooks` queue, but records a `webhook_delivery` row per * `send()` and one `webhook_delivery_attempt` row per try. Register it as the * `webhookService` singleton; the queue worker persists each attempt through * {@link recordAttempt}, overriding the base's throwing default. */ export declare class KyselyWebhookService extends QueueWebhookService { private db; private initialized; constructor(queueService: QueueService, db: Kysely); init(): Promise; send(input: SendWebhookInput): Promise>; recordAttempt(deliveryId: string, { statusCode, responseBody, error, delivered }: WebhookAttemptResult): Promise; /** List deliveries, most recent first — for the console webhooks view. */ listDeliveries(opts?: { organizationId?: string; limit?: number; }): Promise; /** A single delivery with its full attempt history, or null if unknown. */ getDelivery(deliveryId: string): Promise; }