import type { CatalogNodeEntry } from '../workflow-node-catalog'

export const COMMUNICATION_NEW_NODES: CatalogNodeEntry[] = [
  {
    type: 'telegram_notify',
    label: 'Telegram Notify',
    description: 'Send a message to a Telegram chat or channel via Bot API.',
    category: 'communication',
    color: 'text-teal-500',
    iconName: 'Send',
    inputs: [{ name: 'message', type: 'text', description: 'Message content' }],
    outputs: [{ name: 'status', type: 'json', description: 'Send confirmation with message_id' }],
    requiredConfig: ['botToken', 'chatId'],
    optionalConfig: ['messageTemplate', 'parseMode', 'disableNotification'],
    exampleConfig: {
      botToken: '{{secrets.TELEGRAM_BOT_TOKEN}}',
      chatId: '-1001234567890',
      messageTemplate: '🏆 Battle completed: {{n1.battle.title}}\nWinner: {{n2.verdict.winner}}',
      parseMode: 'Markdown',
      disableNotification: false,
    },
    acceptsInputTypes: ['text', 'json', 'any'],
    producesOutputType: 'json',
    n8nEquivalent: 'n8n-nodes-base.telegram',
  },
  {
    type: 'push_notification',
    label: 'Push Notification',
    description: 'Send a push notification to a user via the LenserFight notification system.',
    category: 'communication',
    color: 'text-teal-500',
    iconName: 'Bell',
    inputs: [{ name: 'data', type: 'json', description: 'Notification payload context' }],
    outputs: [{ name: 'status', type: 'json', description: 'Delivery status' }],
    requiredConfig: ['recipientLenserId', 'title', 'body'],
    optionalConfig: ['actionUrl', 'icon', 'priority', 'ttlMs'],
    exampleConfig: {
      recipientLenserId: '{{n1.battle.creator_id}}',
      title: 'Battle Result Ready',
      body: 'Your battle "{{n1.battle.title}}" has been judged. Check the results!',
      actionUrl: '/battles/{{n1.battle.id}}',
      priority: 'high',
    },
    acceptsInputTypes: ['json', 'text', 'any'],
    producesOutputType: 'json',
  },
  {
    type: 'sms_send',
    label: 'SMS Send',
    description: 'Send an SMS message via Twilio or compatible provider.',
    category: 'communication',
    color: 'text-teal-500',
    iconName: 'Smartphone',
    inputs: [{ name: 'message', type: 'text', description: 'SMS body content' }],
    outputs: [{ name: 'status', type: 'json', description: 'Send confirmation with SID' }],
    requiredConfig: ['to', 'body'],
    optionalConfig: ['from', 'provider', 'messageTemplate'],
    exampleConfig: {
      to: '+905551234567',
      body: 'Your workflow "Weekly Digest" completed successfully. 12 items processed.',
      provider: 'twilio',
      from: '+14155551234',
    },
    acceptsInputTypes: ['text', 'json', 'any'],
    producesOutputType: 'json',
    n8nEquivalent: 'n8n-nodes-base.twilio',
  },
]
