feat: add Telegram notification provider support
- Updated API to support Telegram as a notification provider type. - Enhanced tests to cover Telegram provider creation, updates, and token handling. - Modified frontend forms to include Telegram-specific fields and validation. - Added localization strings for Telegram provider. - Implemented security measures to ensure bot tokens are not exposed in API responses.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import client from './client';
|
||||
|
||||
export const SUPPORTED_NOTIFICATION_PROVIDER_TYPES = ['discord', 'gotify', 'webhook', 'email'] as const;
|
||||
export const SUPPORTED_NOTIFICATION_PROVIDER_TYPES = ['discord', 'gotify', 'webhook', 'email', 'telegram'] as const;
|
||||
export type SupportedNotificationProviderType = (typeof SUPPORTED_NOTIFICATION_PROVIDER_TYPES)[number];
|
||||
const DEFAULT_PROVIDER_TYPE: SupportedNotificationProviderType = 'discord';
|
||||
|
||||
@@ -59,7 +59,7 @@ const sanitizeProviderForWriteAction = (data: Partial<NotificationProvider>): Pa
|
||||
|
||||
delete payload.gotify_token;
|
||||
|
||||
if (type !== 'gotify') {
|
||||
if (type !== 'gotify' && type !== 'telegram') {
|
||||
delete payload.token;
|
||||
return payload;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user