hook-engine
Version:
Production-grade webhook engine with comprehensive adapter support, security, reliability, structured logging, and CLI tools.
24 lines (23 loc) • 1.1 kB
TypeScript
import { Request, Response, NextFunction } from 'express';
import { HookEngineConfig } from '../types/config';
/**
* Express middleware factory for webhook handling
*/
export declare function createWebhookMiddleware(config: Partial<HookEngineConfig>): (req: Request, res: Response, next: NextFunction) => Promise<void>;
/**
* Express middleware factory for webhook handling with custom business logic
*/
export declare function createWebhookMiddlewareWithRetry(config: Partial<HookEngineConfig>, businessLogic: (event: any) => Promise<void>): (req: Request, res: Response, next: NextFunction) => Promise<void>;
/**
* Express error handler for webhook errors
*/
export declare function webhookErrorHandler(error: any, req: Request, res: Response, next: NextFunction): void;
/**
* Express route factory for webhook endpoints
*/
export declare function createWebhookRoute(path: string, config: Partial<HookEngineConfig>): {
path: string;
method: string;
middleware: ((req: Request, res: Response, next: NextFunction) => Promise<void>)[];
errorHandler: typeof webhookErrorHandler;
};