@liberstudio/cloudflare-list 2.4.7 → 2.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -106,6 +106,7 @@ import { CloudflareAttacksModule } from "@liberstudio/cloudflare-list";
106
106
  telegramNotify: {
107
107
  chatId: config.getOrThrow<string>("TELEGRAM_NOTIFY_CHAT_ID"),
108
108
  },
109
+ notifyProvider: config.get<"whatsapp" | "telegram">("NOTIFY_PROVIDER"), // assente → scelta automatica
109
110
  }),
110
111
  }),
111
112
  ],
@@ -156,6 +157,7 @@ Per ricavare il `chatId`: scrivi un messaggio al bot (o aggiungilo al gruppo), p
156
157
  ```env
157
158
  TELEGRAM_BOT_TOKEN=123456:ABC-your-bot-token
158
159
  TELEGRAM_NOTIFY_CHAT_ID=123456789
160
+ NOTIFY_PROVIDER=telegram # opzionale: whatsapp | telegram
159
161
  ```
160
162
 
161
163
  ### `whatsappNotify` — notifiche ban su WhatsApp
@@ -83,7 +83,8 @@ let AttacksService = class AttacksService {
83
83
  }
84
84
  (0, rxjs_1.firstValueFrom)(this.httpService.post(`https://api.telegram.org/bot${token}/sendMessage`, { chat_id: tg.chatId, text: message })).catch((err) => {
85
85
  const msg = err instanceof Error ? err.message : "Errore sconosciuto";
86
- this.logger.warn(`Notifica Telegram fallita: ${msg}`);
86
+ const description = axios_2.default.isAxiosError(err) ? err.response?.data?.description : undefined;
87
+ this.logger.warn(`Notifica Telegram fallita: ${msg}${description ? ` (${description})` : ""}`);
87
88
  });
88
89
  }
89
90
  sendWhatsappNotification(message) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liberstudio/cloudflare-list",
3
- "version": "2.4.7",
3
+ "version": "2.4.8",
4
4
  "description": "Modulo NestJS per gestione IP List Cloudflare",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",