import type { MigrationEntry } from "../db/migrations.js"; export declare const AUTOMATION_TRIGGER_EVENT_DEDUPE_RETENTION_MS: number; export declare const AUTOMATION_TRIGGER_EVENT_PURGE_BATCH_SIZE = 1000; export declare const AUTOMATION_TRIGGER_EVENT_EXPIRY_BATCH_SIZE = 1000; export declare const MAX_AUTOMATION_TRIGGER_EVENT_FAILURES = 8; declare const CLAIM_LEASE_MS: () => number; export declare const AUTOMATION_TRIGGER_EVENT_MIGRATIONS: MigrationEntry[]; export declare const automationTriggerEventsStore: import("../db/store-registry.js").Store; /** Kept for callers of the export; the store owns these migrations. */ export declare function runAutomationTriggerEventMigrations(_nitroApp?: unknown): Promise; export declare function ensureAutomationTriggerEventQueue(): Promise; export interface EnqueueAutomationTriggerEventInput { triggerId: string; triggerOwner: string; triggerPath: string; appId?: string | null; eventName: string; eventId: string; payload: unknown; eventOwner?: string; emittedAt: string; } export interface QueuedAutomationTriggerEvent { id: string; sequenceId: number; triggerId: string; triggerOwner: string; triggerPath: string; appId: string | null; eventName: string; eventId: string; payload: unknown; eventOwner?: string; emittedAt: string; attempts: number; failureAttempts: number; claimedAt: number; } export interface AutomationTriggerQueueQueryOptions { timeoutMs?: number; } export declare function enqueueAutomationTriggerEvent(input: EnqueueAutomationTriggerEventInput): Promise<{ id: string; inserted: boolean; }>; export declare function listReadyAutomationTriggerIds(appId?: string | null, limit?: number, cursor?: { afterTriggerId?: string; throughTriggerId?: string; }, options?: AutomationTriggerQueueQueryOptions & { excludeStaleEventBefore?: { eventName: string; emittedBefore: string; }; }): Promise; export declare function reserveAutomationTriggerEventPurge(appId?: string | null, now?: number): Promise; export declare function scheduleAutomationTriggerEventPurge(appId: string | null | undefined, nextAt: number): Promise; export declare function getAutomationTriggerSweepCursor(appId?: string | null, options?: AutomationTriggerQueueQueryOptions): Promise; export declare function setAutomationTriggerSweepCursor(appId: string | null | undefined, triggerId: string | null, options?: AutomationTriggerQueueQueryOptions): Promise; export declare function claimNextAutomationTriggerEvent(triggerId: string, appId?: string | null, options?: AutomationTriggerQueueQueryOptions): Promise; export declare function completeAutomationTriggerEvent(id: string, claimedAt: number, attempts: number, options?: AutomationTriggerQueueQueryOptions): Promise; export declare function expireAutomationTriggerEvent(id: string, claimedAt: number, attempts: number, reason: string, options?: AutomationTriggerQueueQueryOptions): Promise; export declare function expireStaleAutomationTriggerEvents(input: { appId: string; eventName: string; emittedBefore: string; reason: string; limit?: number; timeoutMs?: number; }): Promise; export declare function hasPendingStaleAutomationTriggerEvents(input: { appId: string; eventName: string; emittedBefore: string; timeoutMs?: number; }): Promise; export declare function retryAutomationTriggerEvent(id: string, claimedAt: number, attempts: number, failureAttempts: number, error: unknown, options?: AutomationTriggerQueueQueryOptions & { delayMs?: number; countFailure?: boolean; }): Promise; export declare function failAutomationTriggerEvent(id: string, claimedAt: number, attempts: number, failureAttempts: number, error: unknown, options?: AutomationTriggerQueueQueryOptions): Promise; export declare function purgeExpiredAutomationTriggerEvents(now?: number): Promise; export declare const __automationTriggerEventQueue: { table: string; sweepStateTable: string; claimLeaseMs: typeof CLAIM_LEASE_MS; }; export {};