{
  "version": "1.0",
  "categories": [
    { "key": "forms", "name": "Формы и заявки" },
    { "key": "crm", "name": "CRM" },
    { "key": "tables", "name": "Таблицы" },
    { "key": "payments", "name": "Платежи" },
    { "key": "messengers", "name": "Мессенджеры" },
    { "key": "sms", "name": "SMS" },
    { "key": "tasks", "name": "Задачи" }
  ],
  "bundles": [
    {
      "slug": "tilda-to-telegram",
      "title": "Заявка Tilda → сообщение в Telegram",
      "description": "Каждая новая заявка с сайта на Tilda автоматически приходит в выбранный чат Telegram.",
      "category": "forms",
      "price_rub": 200,
      "popularity": 100,
      "status": "published",
      "source": {
        "service": "tilda",
        "trigger": "new_lead"
      },
      "target": {
        "service": "telegram",
        "action": "send_message"
      },
      "required_scopes": [],
      "mapping_template": {
        "chat_id": { "type": "user_input", "required": true },
        "text": {
          "type": "template",
          "value": "Новая заявка с сайта\n\nИмя: {{name}}\nТелефон: {{phone}}\nEmail: {{email}}\nКомментарий: {{message}}"
        },
        "parse_mode": { "type": "static", "value": "HTML" }
      },
      "filter_template": null,
      "examples": [
        {
          "input": {
            "Name": "Иван",
            "Phone": "+7 999 123-45-67",
            "Email": "ivan@example.com",
            "Comment": "Интересует курс"
          },
          "output": "Новая заявка с сайта\n\nИмя: Иван\nТелефон: +7 999 123-45-67\nEmail: ivan@example.com\nКомментарий: Интересует курс"
        }
      ]
    },
    {
      "slug": "tilda-to-amocrm",
      "title": "Заявка Tilda → сделка в amoCRM",
      "description": "Заявка с Tilda создаёт сделку и контакт в amoCRM. Менеджер видит лид сразу.",
      "category": "crm",
      "price_rub": 200,
      "popularity": 96,
      "status": "published",
      "source": { "service": "tilda", "trigger": "new_lead" },
      "target": { "service": "amocrm", "action": "create_lead" },
      "required_scopes": ["contacts", "leads"],
      "mapping_template": {
        "name": { "type": "field", "value": "{{name}}" },
        "phone": { "type": "transform", "value": "phone_e164", "from": "{{phone}}" },
        "email": { "type": "field", "value": "{{email}}" },
        "note": { "type": "field", "value": "{{message}}" },
        "pipeline_id": { "type": "user_input", "required": true }
      },
      "filter_template": null
    },
    {
      "slug": "yookassa-to-telegram",
      "title": "Оплата ЮKassa → уведомление в Telegram",
      "description": "Когда клиент успешно оплачивает заказ, в чат приходит сообщение с суммой и данными платежа.",
      "category": "payments",
      "price_rub": 200,
      "popularity": 92,
      "status": "published",
      "source": { "service": "yookassa", "trigger": "payment_succeeded" },
      "target": { "service": "telegram", "action": "send_message" },
      "required_scopes": [],
      "mapping_template": {
        "chat_id": { "type": "user_input", "required": true },
        "text": {
          "type": "template",
          "value": "Оплата получена\n\nСумма: {{amount}} ₽\nЗаказ: {{order_id}}\nКлиент: {{customer_email}}"
        }
      },
      "filter_template": {
        "operator": "and",
        "rules": [
          { "field": "status", "operator": "=", "value": "succeeded" }
        ]
      }
    },
    {
      "slug": "google-sheets-to-telegram",
      "title": "Новая строка Google Sheets → сообщение в Telegram",
      "description": "Новая строка в таблице отправляет уведомление в Telegram. Удобно для контент-планов и заказов.",
      "category": "tables",
      "price_rub": 200,
      "popularity": 88,
      "status": "published",
      "source": { "service": "google_sheets", "trigger": "new_row" },
      "target": { "service": "telegram", "action": "send_message" },
      "required_scopes": ["spreadsheets.readonly"],
      "mapping_template": {
        "chat_id": { "type": "user_input", "required": true },
        "text": {
          "type": "template",
          "value": "Новая строка в таблице\n\n{{row}}"
        }
      },
      "filter_template": {
        "operator": "and",
        "rules": [
          { "field": "row.status", "operator": "=", "value": "Готово" }
        ]
      }
    },
    {
      "slug": "webhook-to-google-sheets",
      "title": "Вебхук → строка в Google Sheets",
      "description": "Принимает JSON на секретный URL и добавляет строку в таблицу. Универсальная связка для любых сервисов.",
      "category": "tables",
      "price_rub": 200,
      "popularity": 85,
      "status": "published",
      "source": { "service": "webhook", "trigger": "incoming_json" },
      "target": { "service": "google_sheets", "action": "append_row" },
      "required_scopes": ["spreadsheets"],
      "mapping_template": {
        "spreadsheet_id": { "type": "user_input", "required": true },
        "sheet_name": { "type": "user_input", "required": true },
        "values": { "type": "auto", "value": "{{payload}}" }
      },
      "filter_template": null
    },
    {
      "slug": "tilda-to-smsru",
      "title": "Заявка Tilda → SMS через SMS.ru",
      "description": "Отправляет SMS клиенту или менеджеру при новой заявке с сайта.",
      "category": "sms",
      "price_rub": 200,
      "popularity": 74,
      "status": "published",
      "source": { "service": "tilda", "trigger": "new_lead" },
      "target": { "service": "sms_ru", "action": "send_sms" },
      "required_scopes": [],
      "mapping_template": {
        "to": { "type": "transform", "value": "phone_e164", "from": "{{phone}}" },
        "msg": { "type": "template", "value": "Здравствуйте, {{name}}! Мы получили вашу заявку и скоро свяжемся." }
      },
      "filter_template": null
    }
  ]
}
