export type WebhookEvent = 'document.created' | 'document.updated' | 'document.published' | 'document.deleted' | 'media.uploaded' | 'media.deleted' | 'user.created' | 'user.updated' | 'form.submitted';
export interface WebhookEndpointInput {
    url: string;
    events: WebhookEvent[];
    secret: string;
    name?: string;
    active?: boolean;
}
export interface WebhookPayload {
    event: WebhookEvent;
    timestamp: string;
    data: Record<string, unknown>;
}
/** Sign a webhook payload using HMAC-SHA256. */
export declare function signPayload(payload: string, secret: string): Promise<string>;
/** Verify an incoming webhook signature. */
export declare function verifySignature(payload: string, signature: string, secret: string): Promise<boolean>;
/** Create a new webhook endpoint. Validates URL against SSRF rules. */
export declare function createEndpoint(input: WebhookEndpointInput): Promise<any>;
/** List all webhook endpoints. */
export declare function listEndpoints(): Promise<any>;
/** Update a webhook endpoint. Validates URL against SSRF rules if URL is changed. */
export declare function updateEndpoint(id: string, data: Partial<WebhookEndpointInput>): Promise<any>;
/** Delete a webhook endpoint and all its delivery logs. */
export declare function deleteEndpoint(id: string): Promise<any>;
/** Get recent deliveries for an endpoint. */
export declare function getDeliveries(endpointId: string, limit?: number): Promise<any>;
/**
 * Dispatch a webhook event: finds matching endpoints, creates delivery records,
 * and attempts immediate delivery. Failed deliveries are queued for retry.
 */
export declare function dispatch(event: WebhookEvent, data: Record<string, unknown>): Promise<{
    queued: number;
    delivered: number;
    failed: number;
}>;
/**
 * Process pending retries. Call this from a cron job (e.g. every 1-2 minutes).
 * Finds deliveries with status='retrying' and nextRetryAt <= now.
 */
export declare function processRetries(): Promise<{
    retried: number;
    succeeded: number;
    failed: number;
}>;
//# sourceMappingURL=index.d.ts.map