import { W as WebhookPayload, F as FirefliesClient } from './types-zVGqyFzP.cjs'; import { T as Transcript } from './action-items-CC9yUxHY.cjs'; /** * Context provided to webhook event handlers. */ interface WebhookHandlerContext { /** The parsed and validated webhook payload */ payload: WebhookPayload; /** The full transcript, if apiKey provided and autoFetch enabled */ transcript?: Transcript; /** FirefliesClient instance, available if apiKey provided */ client?: FirefliesClient; } /** * Handler function for webhook events. */ type WebhookEventHandler = (context: WebhookHandlerContext) => void | Promise; /** * Error handler function for webhook processing errors. */ type WebhookErrorHandler = (error: Error, payload?: WebhookPayload) => void | Promise; /** * Options for configuring webhook middleware. */ interface WebhookMiddlewareOptions { /** Webhook secret for signature verification (required) */ secret: string; /** API key for auto-fetching transcripts (optional) */ apiKey?: string; /** Auto-fetch transcript when apiKey is provided (default: true if apiKey provided) */ autoFetch?: boolean; /** Handler called for 'Transcription completed' events */ onTranscriptionCompleted?: WebhookEventHandler; /** Generic handler called for all events (runs before specific handlers) */ onEvent?: WebhookEventHandler; /** Handler called when an error occurs during processing */ onError?: WebhookErrorHandler; } export type { WebhookMiddlewareOptions as W };