Fase 1c: canal Telegram (telegram-worker) — codigo migrado, inerte
Envio de alertas Telegram desde el servicio (docs/legacy-telegram.md): por alerta, texto Markdown (content + firelink i18n) + ubicacion, como node-red. - types: canal 'telegram', notif.type 'telegram', campo telegramNotified - telegram/message.ts: buildTelegramMessages (firelink es/en/gl + location) - telegram/client.ts: cliente Bot API (fetch), interpretResponse (429 retry_after, 403 blocked) - telegram/rate.ts: throttle por chat (1 msg/s) + computeWaitMs puro - handlers.processTelegramJob: idempotencia (notification_sends canal telegram), modos dry-run/shadow/canary/full, throttle, 429->retry, bloqueo->sub inactiva - poller/queue/index: canal telegram integrado; worker con rate limiter global BullMQ (25/s por bot); cliente por idioma (es/gl->ES, en->EN) - config: bloque telegram (tokens es/en, server, globalPerSec, perChatMinMs) 85 tests en verde, typecheck y build OK. Sin TELEGRAM_TOKEN_* configurados el worker no se activa (todo inerte). Falta: extraer tokens de bot de flows_cred + rollout con el usuario. Los flujos conversacionales de los bots siguen en node-red.
This commit is contained in:
parent
a1ed206985
commit
d1fc6798dc
14 changed files with 479 additions and 14 deletions
|
|
@ -46,7 +46,7 @@ describe('poller.runOnce', () => {
|
|||
|
||||
const res = await poller.runOnce();
|
||||
|
||||
expect(res).toEqual({ fcm: 1, email: 1 });
|
||||
expect(res).toEqual({ fcm: 1, email: 1, telegram: 0 });
|
||||
expect(added.fcm).toHaveLength(1);
|
||||
expect(added.email).toHaveLength(1);
|
||||
// claimedBy provenance set
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue