import { RouteHandlerMethod, FastifyPluginCallback } from 'fastify'; import { W as WebhookMiddlewareOptions } from '../types-BMzVSd6w.js'; import '../types-D2XsCR5R.js'; import '../action-items-CC9yUxHY.js'; /** * Options for the Fastify webhook plugin. */ interface FastifyWebhookOptions extends WebhookMiddlewareOptions { /** Route path for the webhook endpoint (default: '/webhooks/fireflies') */ path?: string; } /** * Create a Fastify route handler for Fireflies webhooks. * * Requires a raw body content type parser to receive the raw body for signature verification. * * @param options - Webhook middleware options * @returns Fastify route handler * * @example * ```typescript * import Fastify from 'fastify'; * import { createWebhookHandler } from 'fireflies-api/fastify'; * * const fastify = Fastify(); * * // Add raw body content type parser * fastify.addContentTypeParser('application/json', { parseAs: 'buffer' }, (req, body, done) => { * done(null, body); * }); * * fastify.post('/webhooks/fireflies', createWebhookHandler({ * secret: process.env.WEBHOOK_SECRET!, * onTranscriptionCompleted: async ({ payload, transcript }) => { * console.log(`Transcript ready: ${transcript?.title}`); * }, * })); * ``` */ declare function createWebhookHandler(options: WebhookMiddlewareOptions): RouteHandlerMethod; /** * Fastify plugin for Fireflies webhooks. * * Automatically sets up the route and raw body parser. * * @example * ```typescript * import Fastify from 'fastify'; * import { firefliesWebhook } from 'fireflies-api/fastify'; * * const fastify = Fastify(); * * fastify.register(firefliesWebhook, { * path: '/webhooks/fireflies', * secret: process.env.WEBHOOK_SECRET!, * apiKey: process.env.FIREFLIES_API_KEY, * onTranscriptionCompleted: async ({ payload, transcript }) => { * console.log(`Transcript ready: ${transcript?.title}`); * }, * }); * ``` */ declare const firefliesWebhook: FastifyPluginCallback; export { type FastifyWebhookOptions, createWebhookHandler, firefliesWebhook };