Feature: Receptor de webhooks interno para debug
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m3s

- Endpoint POST /api/debug/webhook-receiver para recibir webhooks
- Almacenamiento en memoria de ultimos 100 eventos
- Endpoint GET/DELETE para consultar/limpiar eventos
- Nueva tab Webhooks en seccion Debug con polling cada 5s
This commit is contained in:
2025-12-02 21:14:39 -06:00
parent 371b5676fb
commit 71593b25e9
6 changed files with 298 additions and 1 deletions

View File

@@ -0,0 +1,41 @@
/**
* Debug Webhook Store
* Stores webhook events in memory for debugging
*/
interface WebhookEvent {
id: string
receivedAt: string
event: string
timestamp?: string
data: any
headers: Record<string, string | undefined>
}
class DebugWebhookStore {
private events: WebhookEvent[] = []
private maxEvents = 100
addEvent(event: WebhookEvent) {
this.events.unshift(event)
// Keep only the last N events
if (this.events.length > this.maxEvents) {
this.events = this.events.slice(0, this.maxEvents)
}
}
getEvents(limit: number = 50): WebhookEvent[] {
return this.events.slice(0, limit)
}
clear() {
this.events = []
}
getCount(): number {
return this.events.length
}
}
export const debugWebhookStore = new DebugWebhookStore()