@alex_rexby/n8n-nodes-max 0.3.0 → 0.4.2

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
@@ -1,247 +1,245 @@
1
- ![Banner image](https://user-images.githubusercontent.com/10284570/173569848-c624317f-42b1-45a6-ab09-f0ea3c247648.png)
1
+ # n8n-nodes-max
2
2
 
3
- # n8n-nodes-starter
3
+ ![MAX Messenger](https://img.shields.io/badge/MAX-Messenger-blue?style=flat-square)
4
+ ![npm version](https://img.shields.io/npm/v/@alex_rexby/n8n-nodes-max?style=flat-square)
5
+ ![License](https://img.shields.io/npm/l/@alex_rexby/n8n-nodes-max?style=flat-square)
4
6
 
5
- This starter repository helps you build custom integrations for [n8n](https://n8n.io). It includes example nodes, credentials, the node linter, and all the tooling you need to get started.
7
+ Полная интеграция MAX мессенджера для n8n - создавайте ботов и автоматизируйте общение с максимальной простотой.
6
8
 
7
- ## Quick Start
9
+ [MAX](https://max.ru) - российский мессенджер с открытым API для бизнеса.
8
10
 
9
- > [!TIP]
10
- > **New to building n8n nodes?** The fastest way to get started is with `npm create @n8n/node`. This command scaffolds a complete node package for you using the [@n8n/node-cli](https://www.npmjs.com/package/@n8n/node-cli).
11
+ ## 🚀 Возможности
11
12
 
12
- **To create a new node package from scratch:**
13
+ ### 📨 Сообщения (Message)
14
+ - **Send Text** - отправка текстовых сообщений с форматированием (Markdown/HTML)
15
+ - **Send File** - отправка файлов (изображения, видео, аудио, документы) с автоопределением типа
16
+ - **Get** - получение сообщения по ID
17
+ - **Edit** - редактирование отправленных сообщений
18
+ - **Delete** - удаление сообщений (с опцией "для всех")
13
19
 
14
- ```bash
15
- npm create @n8n/node
16
- ```
20
+ ### ⌨️ Inline-клавиатуры
21
+ - **Simple Mode** - визуальный конструктор кнопок (без JSON!)
22
+ - **Advanced Mode** - полный контроль через JSON
23
+ - Типы кнопок: Callback (действие), Link (URL)
17
24
 
18
- **Already using this starter? Start developing with:**
25
+ ### 🤖 Бот (Bot)
26
+ - **Get Info** - информация о боте (ID, username, статус)
19
27
 
20
- ```bash
21
- npm run dev
22
- ```
28
+ ### 💬 Чаты (Chat)
29
+ - **Update** - изменение названия и описания чатов
23
30
 
24
- This starts n8n with your nodes loaded and hot reload enabled.
31
+ ### 🔘 Обработка Callback (Callback)
32
+ - **Answer** - ответ на нажатие inline-кнопки (уведомление)
33
+ - **Answer and Send** - ответ + отправка нового сообщения одной нодой
25
34
 
26
- ## What's Included
35
+ ### 🔔 Триггеры (MAX Trigger)
36
+ - Получение событий в реальном времени:
37
+ - `message_created` - новые сообщения
38
+ - `message_callback` - нажатия на inline-кнопки
39
+ - `bot_started` - запуск бота пользователем
40
+ - Автоматическая регистрация webhook
27
41
 
28
- This starter repository includes two example nodes to learn from:
42
+ ## 📦 Установка
29
43
 
30
- - **[Example Node](nodes/Example/)** - A simple starter node that shows the basic structure with a custom `execute` method
31
- - **[GitHub Issues Node](nodes/GithubIssues/)** - A complete, production-ready example built using the **declarative style**:
32
- - **Low-code approach** - Define operations declaratively without writing request logic
33
- - Multiple resources (Issues, Comments)
34
- - Multiple operations (Get, Get All, Create)
35
- - Two authentication methods (OAuth2 and Personal Access Token)
36
- - List search functionality for dynamic dropdowns
37
- - Proper error handling and typing
38
- - Ideal for HTTP API-based integrations
44
+ ### Через n8n Community Nodes (рекомендуется)
39
45
 
40
- > [!TIP]
41
- > The declarative/low-code style (used in GitHub Issues) is the recommended approach for building nodes that interact with HTTP APIs. It significantly reduces boilerplate code and handles requests automatically.
46
+ 1. Откройте n8n
47
+ 2. **Settings** **Community Nodes**
48
+ 3. Нажмите **Install**
49
+ 4. Введите: `@alex_rexby/n8n-nodes-max`
50
+ 5. **Install** → Перезапустите n8n
42
51
 
43
- Browse these examples to understand both approaches, then modify them or create your own.
52
+ ### Через npm
44
53
 
45
- ## Finding Inspiration
54
+ ```bash
55
+ npm install @alex_rexby/n8n-nodes-max
56
+ 🔑 Настройка
57
+ Создайте бота в MAX через @BotFather
46
58
 
47
- Looking for more examples? Check out these resources:
59
+ Получите API токен
48
60
 
49
- - **[npm Community Nodes](https://www.npmjs.com/search?q=keywords:n8n-community-node-package)** - Browse thousands of community-built nodes on npm using the `n8n-community-node-package` tag
50
- - **[n8n Built-in Nodes](https://github.com/n8n-io/n8n/tree/master/packages/nodes-base/nodes)** - Study the source code of n8n's official nodes for production-ready patterns and best practices
51
- - **[n8n Credentials](https://github.com/n8n-io/n8n/tree/master/packages/nodes-base/credentials)** - See how authentication is implemented for various services
61
+ В n8n: добавьте credentials MAX API
52
62
 
53
- These are excellent resources to understand how to structure your nodes, handle different API patterns, and implement advanced features.
63
+ Вставьте токен
54
64
 
55
- ## Prerequisites
65
+ 📖 Примеры
66
+ 1. Простой эхо-бот
67
+ Workflow:
56
68
 
57
- Before you begin, install the following on your development machine:
69
+ text
70
+ MAX Trigger → MAX (Send Text)
71
+ Настройки MAX Trigger:
58
72
 
59
- ### Required
73
+ Updates: message_created
60
74
 
61
- - **[Node.js](https://nodejs.org/)** (v22 or higher) and npm
62
- - Linux/Mac/WSL: Install via [nvm](https://github.com/nvm-sh/nvm)
63
- - Windows: Follow [Microsoft's NodeJS guide](https://learn.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-windows)
64
- - **[git](https://git-scm.com/downloads)**
75
+ Настройки MAX Send:
65
76
 
66
- ### Recommended
77
+ User ID: {{ $json.event.user_id }}
67
78
 
68
- - Follow n8n's [development environment setup guide](https://docs.n8n.io/integrations/creating-nodes/build/node-development-environment/)
79
+ Text: Вы написали: {{ $json.event.text }}
69
80
 
70
- > [!NOTE]
71
- > The `@n8n/node-cli` is included as a dev dependency and will be installed automatically when you run `npm install`. The CLI includes n8n for local development, so you don't need to install n8n globally.
81
+ 2. Бот с кнопками (Simple Mode)
82
+ MAX Send Text:
72
83
 
73
- ## Getting Started with this Starter
84
+ User ID: 12345
74
85
 
75
- Follow these steps to create your own n8n community node package:
86
+ Text: Выберите действие:
76
87
 
77
- ### 1. Create Your Repository
88
+ Add Buttons:
78
89
 
79
- [Generate a new repository](https://github.com/n8n-io/n8n-nodes-starter/generate) from this template, then clone it:
90
+ Button Mode: Simple
80
91
 
81
- ```bash
82
- git clone https://github.com/<your-organization>/<your-repo-name>.git
83
- cd <your-repo-name>
84
- ```
92
+ Add Button Row:
85
93
 
86
- ### 2. Install Dependencies
94
+ Button 1: Text=✅ Подтвердить, Type=Callback, Data=confirm
87
95
 
88
- ```bash
89
- npm install
90
- ```
96
+ Button 2: Text=❌ Отменить, Type=Callback, Data=cancel
91
97
 
92
- This installs all required dependencies including the `@n8n/node-cli`.
98
+ Add Button Row:
93
99
 
94
- ### 3. Explore the Examples
100
+ Button: Text=📞 Связаться, Type=Link, URL=https://example.com
95
101
 
96
- Browse the example nodes in [nodes/](nodes/) and [credentials/](credentials/) to understand the structure:
102
+ 3. Отправка изображения одной нодой
103
+ Workflow:
97
104
 
98
- - Start with [nodes/Example/](nodes/Example/) for a basic node
99
- - Study [nodes/GithubIssues/](nodes/GithubIssues/) for a real-world implementation
105
+ text
106
+ HTTP Request (download image) MAX (Send File)
107
+ MAX Send File:
100
108
 
101
- ### 4. Build Your Node
109
+ User ID: 12345
102
110
 
103
- Edit the example nodes to fit your use case, or create new node files by copying the structure from [nodes/Example/](nodes/Example/).
111
+ Input Data Field Name: data
104
112
 
105
- > [!TIP]
106
- > If you want to scaffold a completely new node package, use `npm create @n8n/node` to start fresh with the CLI's interactive generator.
113
+ Caption: Смотрите какая картинка! 🖼️
107
114
 
108
- ### 5. Configure Your Package
115
+ (Тип файла определяется автоматически!)
109
116
 
110
- Update `package.json` with your details:
117
+ 4. Обработка callback с ответом
118
+ Workflow:
111
119
 
112
- - `name` - Your package name (must start with `n8n-nodes-`)
113
- - `author` - Your name and email
114
- - `repository` - Your repository URL
115
- - `description` - What your node does
120
+ text
121
+ MAX Trigger MAX (Answer and Send Message)
122
+ MAX Trigger:
116
123
 
117
- Make sure your node is registered in the `n8n.nodes` array.
124
+ Updates: message_callback
118
125
 
119
- ### 6. Develop and Test Locally
126
+ MAX Answer and Send:
120
127
 
121
- Start n8n with your node loaded:
128
+ Callback Query ID: {{ $json.event.callback_query_id }} (по умолчанию)
122
129
 
123
- ```bash
124
- npm run dev
125
- ```
130
+ Notification Text: Обрабатываю...
126
131
 
127
- This command runs `n8n-node dev` which:
132
+ User ID: {{ $json.event.user_id }} (по умолчанию)
128
133
 
129
- - Builds your node with watch mode
130
- - Starts n8n with your node available
131
- - Automatically rebuilds when you make changes
132
- - Opens n8n in your browser (usually http://localhost:5678)
134
+ Message Text: Вы нажали на кнопку: {{ $json.event.callback_data }}
133
135
 
134
- You can now test your node in n8n workflows!
136
+ 5. Бот для получения User ID
137
+ Workflow:
135
138
 
136
- > [!NOTE]
137
- > Learn more about CLI commands in the [@n8n/node-cli documentation](https://www.npmjs.com/package/@n8n/node-cli).
139
+ text
140
+ MAX Trigger MAX (Send Text)
141
+ MAX Send:
138
142
 
139
- ### 7. Lint Your Code
143
+ User ID: {{ $json.event.user_id }}
140
144
 
141
- Check for errors:
145
+ Text:
142
146
 
143
- ```bash
144
- npm run lint
145
- ```
147
+ text
148
+ 🆔 Ваша информация:
146
149
 
147
- Auto-fix issues when possible:
150
+ User ID: {{ $json.event.user_id }}
151
+ Chat ID: {{ $json.event.chat_id }}
152
+ Username: @{{ $json.event.from.username }}
148
153
 
149
- ```bash
150
- npm run lint:fix
151
- ```
154
+ Сохраните User ID для отправки сообщений
155
+ 6. Тихие уведомления (Silent Mode)
156
+ MAX Send:
152
157
 
153
- ### 8. Build for Production
158
+ User ID: 12345
154
159
 
155
- When ready to publish:
160
+ Text: Это сообщение без звука
156
161
 
157
- ```bash
158
- npm run build
159
- ```
162
+ Additional Options → Silent Message: ✅
160
163
 
161
- This compiles your TypeScript code to the `dist/` folder.
164
+ 7. Интеграция с CRM
165
+ Workflow:
162
166
 
163
- ### 9. Prepare for Publishing
167
+ text
168
+ MAX Trigger → HTTP Request (CRM) → MAX (Send Text)
169
+ Автоматически создавайте заявки в CRM при получении сообщений.
164
170
 
165
- Before publishing:
171
+ Особенности
172
+ Упрощённая работа с файлами
173
+ Больше не нужно два запроса! Нода Send File автоматически:
166
174
 
167
- 1. **Update documentation**: Replace this README with your node's documentation. Use [README_TEMPLATE.md](README_TEMPLATE.md) as a starting point.
168
- 2. **Update the LICENSE**: Add your details to the [LICENSE](LICENSE.md) file.
169
- 3. **Test thoroughly**: Ensure your node works in different scenarios.
175
+ Загружает файл на сервер MAX
170
176
 
171
- ### 10. Publish to npm
177
+ Определяет тип файла (image/video/audio/file)
172
178
 
173
- Publish your package to make it available to the n8n community:
174
-
175
- ```bash
176
- npm publish
177
- ```
179
+ Отправляет сообщение с файлом
178
180
 
179
- Learn more about [publishing to npm](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry).
181
+ Визуальный конструктор кнопок
182
+ Забудьте про JSON! Simple Button Mode позволяет создавать кнопки визуально:
180
183
 
181
- ### 11. Submit for Verification (Optional)
184
+ Добавляйте ряды кнопок
182
185
 
183
- Get your node verified for n8n Cloud:
186
+ Выбирайте тип (Callback или Link)
184
187
 
185
- 1. Ensure your node meets the [requirements](https://docs.n8n.io/integrations/creating-nodes/deploy/submit-community-nodes/):
186
- - Uses MIT license ✅ (included in this starter)
187
- - No external package dependencies
188
- - Follows n8n's design guidelines
189
- - Passes quality and security review
188
+ Настраивайте текст и данные
190
189
 
191
- 2. Submit through the [n8n Creator Portal](https://creators.n8n.io/nodes)
190
+ Комбинированные операции
191
+ Answer and Send - одна нода вместо двух для обработки callback
192
192
 
193
- **Benefits of verification:**
193
+ 🔧 API Coverage
194
+ Метод MAX API Нода Операция
195
+ GET /me Bot Get Info
196
+ POST /messages Message Send Text, Send File
197
+ GET /messages/{id} Message Get
198
+ PUT /messages Message Edit
199
+ DELETE /messages Message Delete
200
+ POST /uploads Message Send File (auto)
201
+ PATCH /chats/{id} Chat Update
202
+ POST /answers Callback Answer, Answer and Send
203
+ POST /subscriptions Trigger (auto)
204
+ 📚 Документация
205
+ MAX API Docs
194
206
 
195
- - Available directly in n8n Cloud
196
- - Discoverable in the n8n nodes panel
197
- - Verified badge for quality assurance
198
- - Increased visibility in the n8n community
207
+ n8n Documentation
199
208
 
200
- ## Available Scripts
209
+ GitHub Repository
201
210
 
202
- This starter includes several npm scripts to streamline development:
211
+ 🐛 Поддержка
212
+ 💬 Telegram: @alex_rexby
203
213
 
204
- | Script | Description |
205
- | --------------------- | ---------------------------------------------------------------- |
206
- | `npm run dev` | Start n8n with your node and watch for changes (runs `n8n-node dev`) |
207
- | `npm run build` | Compile TypeScript to JavaScript for production (runs `n8n-node build`) |
208
- | `npm run build:watch` | Build in watch mode (auto-rebuild on changes) |
209
- | `npm run lint` | Check your code for errors and style issues (runs `n8n-node lint`) |
210
- | `npm run lint:fix` | Automatically fix linting issues when possible (runs `n8n-node lint --fix`) |
211
- | `npm run release` | Create a new release (runs `n8n-node release`) |
214
+ 📧 Email: alexrexby@gmail.com
212
215
 
213
- > [!TIP]
214
- > These scripts use the [@n8n/node-cli](https://www.npmjs.com/package/@n8n/node-cli) under the hood. You can also run CLI commands directly, e.g., `npx n8n-node dev`.
216
+ 🐛 Issues: GitHub Issues
215
217
 
216
- ## Troubleshooting
218
+ 📝 Лицензия
219
+ MIT License - используйте свободно в коммерческих и личных проектах.
217
220
 
218
- ### My node doesn't appear in n8n
221
+ 🎯 Roadmap
222
+ Отправка текстовых сообщений
219
223
 
220
- 1. Make sure you ran `npm install` to install dependencies
221
- 2. Check that your node is listed in `package.json` under `n8n.nodes`
222
- 3. Restart the dev server with `npm run dev`
223
- 4. Check the console for any error messages
224
+ Inline-клавиатуры (Simple + JSON)
224
225
 
225
- ### Linting errors
226
+ Отправка файлов (auto-upload)
226
227
 
227
- Run `npm run lint:fix` to automatically fix most common issues. For remaining errors, check the [n8n node development guidelines](https://docs.n8n.io/integrations/creating-nodes/).
228
+ Редактирование и удаление сообщений
228
229
 
229
- ### TypeScript errors
230
+ Обработка callback
230
231
 
231
- Make sure you're using Node.js v22 or higher and have run `npm install` to get all type definitions.
232
+ Webhook триггеры
232
233
 
233
- ## Resources
234
+ Массовая отправка
234
235
 
235
- - **[n8n Node Documentation](https://docs.n8n.io/integrations/creating-nodes/)** - Complete guide to building nodes
236
- - **[n8n Community Forum](https://community.n8n.io/)** - Get help and share your nodes
237
- - **[@n8n/node-cli Documentation](https://www.npmjs.com/package/@n8n/node-cli)** - CLI tool reference
238
- - **[n8n Creator Portal](https://creators.n8n.io/nodes)** - Submit your node for verification
239
- - **[Submit Community Nodes Guide](https://docs.n8n.io/integrations/creating-nodes/deploy/submit-community-nodes/)** - Verification requirements and process
236
+ Шаблоны сообщений
240
237
 
241
- ## Contributing
238
+ Reply keyboard (постоянные кнопки)
242
239
 
243
- Have suggestions for improving this starter? [Open an issue](https://github.com/n8n-io/n8n-nodes-starter/issues) or submit a pull request!
240
+ Работа с стикерами
244
241
 
245
- ## License
242
+ 🙏 Благодарности
243
+ Создано для сообщества n8n и пользователей MAX мессенджера.
246
244
 
247
- [MIT](https://github.com/n8n-io/n8n-nodes-starter/blob/master/LICENSE.md)
245
+ Made with ❤️ by Alex Rexby