feat(events): add isLatest and progress to messages.set event

- Add extra field to EmitData type for additional payload properties
- Update EventManager and sendDataWebhook to support extra parameters
- Update all event controllers (webhook, rabbitmq, sqs, websocket, pusher, kafka, nats) to include extra fields in payload
- Pass isLatest and progress from Baileys messaging-history.set to messages.set webhook

This allows consumers to know when the history sync is complete (isLatest=true) and track sync progress percentage.
This commit is contained in:
Alexandre Martins
2025-11-26 15:44:18 -03:00
parent df20c5fc93
commit fa6b5c28a6
11 changed files with 23 additions and 3 deletions

View File

@@ -115,6 +115,7 @@ export class WebsocketController extends EventController implements EventControl
sender,
apiKey,
integration,
extra,
}: EmitData): Promise<void> {
if (integration && !integration.includes('websocket')) {
return;
@@ -134,6 +135,7 @@ export class WebsocketController extends EventController implements EventControl
date_time: dateTime,
sender,
apikey: apiKey,
...extra,
};
if (configService.get<Websocket>('WEBSOCKET')?.GLOBAL_EVENTS) {