import type { SupabaseClient } from '@supabase/supabase-js'; export interface ProjectWebhookConfig { project_id: string; url: string; signing_secret: string | null; created_at: string; updated_at: string; } export interface CaptureWebhookPayloadResult { url: string; lang: string; theme: 'light' | 'dark'; captureType?: 'fullpage' | 'element'; elementName?: string; targetId?: string; targetLabel?: string; deviceFrame?: string; success: boolean; assessment: string; iterations: number; finalScreenshotUrl?: string; } export interface CaptureWebhookPayload { event: 'capture.completed'; run_id: string; project_id: string; preset_id: string | null; completed_at: string; total_captures: number; success_count: number; results: CaptureWebhookPayloadResult[]; /** IDs of screenshot_endpoints affected by this capture run (for proxy cache invalidation). */ affected_endpoint_ids: string[]; } export interface EndpointChangedWebhookPayload { event: 'endpoint.changed'; project_id: string; preset_id: string | null; timestamp: string; created_endpoint_ids: string[]; deleted_endpoint_ids: string[]; /** Full list of currently active endpoint IDs for the project. */ current_endpoint_ids: string[]; } export type WebhookPayload = CaptureWebhookPayload | EndpointChangedWebhookPayload; export declare function getProjectWebhookConfig(supabase: SupabaseClient, projectId: string): Promise; export declare function buildCaptureWebhookPayload(params: { runId: string; projectId: string; presetId?: string | null; completedAt?: string; results: CaptureWebhookPayloadResult[]; affectedEndpointIds?: string[]; }): CaptureWebhookPayload; export declare function dispatchProjectCaptureWebhook(params: { config: ProjectWebhookConfig; payload: WebhookPayload; }): Promise; export declare function encryptProjectWebhookSigningSecret(plaintext: string): string;