n8n-nodes-vk-teams 0.1.0

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.
Files changed (55) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +156 -0
  3. package/dist/credentials/VkTeamsApi.credentials.d.ts +9 -0
  4. package/dist/credentials/VkTeamsApi.credentials.js +40 -0
  5. package/dist/credentials/VkTeamsApi.credentials.js.map +1 -0
  6. package/dist/nodes/VkTeams/VkTeams.node.d.ts +12 -0
  7. package/dist/nodes/VkTeams/VkTeams.node.js +122 -0
  8. package/dist/nodes/VkTeams/VkTeams.node.js.map +1 -0
  9. package/dist/nodes/VkTeams/VkTeams.node.json +18 -0
  10. package/dist/nodes/VkTeams/actions/descriptions.d.ts +2 -0
  11. package/dist/nodes/VkTeams/actions/descriptions.js +217 -0
  12. package/dist/nodes/VkTeams/actions/descriptions.js.map +1 -0
  13. package/dist/nodes/VkTeams/actions/execute.d.ts +38 -0
  14. package/dist/nodes/VkTeams/actions/execute.js +103 -0
  15. package/dist/nodes/VkTeams/actions/execute.js.map +1 -0
  16. package/dist/nodes/VkTeams/actions/requests.d.ts +50 -0
  17. package/dist/nodes/VkTeams/actions/requests.js +94 -0
  18. package/dist/nodes/VkTeams/actions/requests.js.map +1 -0
  19. package/dist/nodes/VkTeams/actions/router.d.ts +32 -0
  20. package/dist/nodes/VkTeams/actions/router.js +55 -0
  21. package/dist/nodes/VkTeams/actions/router.js.map +1 -0
  22. package/dist/nodes/VkTeams/shared/runtime.d.ts +29 -0
  23. package/dist/nodes/VkTeams/shared/runtime.js +75 -0
  24. package/dist/nodes/VkTeams/shared/runtime.js.map +1 -0
  25. package/dist/nodes/VkTeams/shared/transport.d.ts +20 -0
  26. package/dist/nodes/VkTeams/shared/transport.js +61 -0
  27. package/dist/nodes/VkTeams/shared/transport.js.map +1 -0
  28. package/dist/nodes/VkTeams/shared/types.d.ts +18 -0
  29. package/dist/nodes/VkTeams/shared/types.js +3 -0
  30. package/dist/nodes/VkTeams/shared/types.js.map +1 -0
  31. package/dist/nodes/VkTeams/shared/url.d.ts +2 -0
  32. package/dist/nodes/VkTeams/shared/url.js +11 -0
  33. package/dist/nodes/VkTeams/shared/url.js.map +1 -0
  34. package/dist/nodes/VkTeams/vkTeams.svg +7 -0
  35. package/dist/nodes/VkTeamsTrigger/VkTeamsTrigger.node.d.ts +5 -0
  36. package/dist/nodes/VkTeamsTrigger/VkTeamsTrigger.node.js +173 -0
  37. package/dist/nodes/VkTeamsTrigger/VkTeamsTrigger.node.js.map +1 -0
  38. package/dist/nodes/VkTeamsTrigger/VkTeamsTrigger.node.json +18 -0
  39. package/dist/nodes/VkTeamsTrigger/shared/filters.d.ts +26 -0
  40. package/dist/nodes/VkTeamsTrigger/shared/filters.js +42 -0
  41. package/dist/nodes/VkTeamsTrigger/shared/filters.js.map +1 -0
  42. package/dist/nodes/VkTeamsTrigger/shared/longPoll.d.ts +48 -0
  43. package/dist/nodes/VkTeamsTrigger/shared/longPoll.js +57 -0
  44. package/dist/nodes/VkTeamsTrigger/shared/longPoll.js.map +1 -0
  45. package/dist/nodes/VkTeamsTrigger/shared/loop.d.ts +11 -0
  46. package/dist/nodes/VkTeamsTrigger/shared/loop.js +43 -0
  47. package/dist/nodes/VkTeamsTrigger/shared/loop.js.map +1 -0
  48. package/dist/nodes/VkTeamsTrigger/shared/state.d.ts +7 -0
  49. package/dist/nodes/VkTeamsTrigger/shared/state.js +41 -0
  50. package/dist/nodes/VkTeamsTrigger/shared/state.js.map +1 -0
  51. package/dist/nodes/VkTeamsTrigger/vkTeamsTrigger.svg +7 -0
  52. package/dist/package.json +61 -0
  53. package/dist/tsconfig.tsbuildinfo +1 -0
  54. package/docs/vk-teams-bot-api.openapi.yaml +947 -0
  55. package/package.json +61 -0
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pavel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,156 @@
1
+ # n8n-nodes-vk-teams
2
+
3
+ `n8n-nodes-vk-teams` — community node package для [n8n](https://n8n.io), который подключает ботов **VK Teams / VK WorkSpace** через Bot API.
4
+
5
+ Пакет добавляет два узла:
6
+
7
+ | Узел | Для чего нужен |
8
+ | --- | --- |
9
+ | `VK Teams Trigger` | Запускает workflow по входящим событиям бота |
10
+ | `VK Teams` | Отправляет сообщения и выполняет Bot API операции |
11
+
12
+ ## Возможности
13
+
14
+ ### VK Teams Trigger
15
+
16
+ Поддерживаемые события:
17
+
18
+ - `message`
19
+ - `editedMessage`
20
+ - `deletedMessage`
21
+ - `callbackQuery`
22
+
23
+ Что доступно:
24
+
25
+ - long polling входящих событий
26
+ - фильтр по типу события
27
+ - фильтр по `chatId`
28
+ - фильтр по `userId`
29
+ - загрузка файлов из входящих событий в binary output
30
+
31
+ ### VK Teams
32
+
33
+ Поддерживаемые операции:
34
+
35
+ - `bot.getSelf`
36
+ - `message.sendText`
37
+ - `message.sendFile`
38
+ - `message.sendVoice`
39
+ - `message.editText`
40
+ - `message.deleteMessages`
41
+ - `callback.answerCallbackQuery`
42
+ - `chat.getInfo`
43
+ - `file.getInfo`
44
+ - `file.download`
45
+
46
+ ## Установка
47
+
48
+ Для self-hosted n8n:
49
+
50
+ ```bash
51
+ npm install n8n-nodes-vk-teams
52
+ ```
53
+
54
+ После установки перезапустите n8n.
55
+
56
+ Для локальной установки из репозитория:
57
+
58
+ ```bash
59
+ cd /path/to/n8n-nodes-vk-teams
60
+ npm install
61
+ npm run build
62
+ mkdir -p ~/.n8n/nodes
63
+ cd ~/.n8n/nodes
64
+ npm install /absolute/path/to/n8n-nodes-vk-teams
65
+ ```
66
+
67
+ После этого также перезапустите n8n.
68
+
69
+ ## Credentials
70
+
71
+ Используется один тип credentials: `VK Teams API`.
72
+
73
+ Поля:
74
+
75
+ - `Bot Token` — токен бота из Metabot
76
+ - `Base URL` — базовый адрес VK Teams API
77
+
78
+ Примеры `Base URL`:
79
+
80
+ - `https://api.internal.myteam.mail.ru`
81
+ - `https://teams.company.example`
82
+ - `https://teams.company.example/bot/v1`
83
+
84
+ Если указан только хост, пакет добавит `/bot/v1`. Если URL уже заканчивается на `/bot/v1`, путь не будет продублирован.
85
+
86
+ ## Быстрый старт
87
+
88
+ ### Получить входящее сообщение
89
+
90
+ 1. Добавьте `VK Teams Trigger`.
91
+ 2. Выберите событие `message`.
92
+ 3. Подключите credentials `VK Teams API`.
93
+ 4. Активируйте workflow.
94
+ 5. Напишите боту в VK Teams.
95
+
96
+ Для ограничения источников используйте поля:
97
+
98
+ - `Restrict To Chat IDs` — один или несколько `chatId` через запятую
99
+ - `Restrict To User IDs` — один или несколько `userId` через запятую
100
+
101
+ Чтобы получать вложения как binary data, включите `Download Files`.
102
+
103
+ ### Отправить сообщение
104
+
105
+ 1. Добавьте `VK Teams`.
106
+ 2. Выберите `Resource` → `Message`.
107
+ 3. Выберите `Operation` → `Send Text`.
108
+ 4. Заполните `Chat ID` и `Text`.
109
+ 5. Запустите workflow.
110
+
111
+ ## Работа с файлами
112
+
113
+ `message.sendFile` и `message.sendVoice` берут файл из binary input предыдущего узла. Укажите `Input Binary Field`, в котором лежит файл.
114
+
115
+ `file.download` сначала получает метаданные через `file.getInfo`, затем скачивает файл и возвращает JSON с метаданными вместе с binary output.
116
+
117
+ ## Схема API
118
+
119
+ OpenAPI-подобная схема поддерживаемого Bot API scope лежит в [`docs/vk-teams-bot-api.openapi.yaml`](docs/vk-teams-bot-api.openapi.yaml). В ней зафиксированы методы, параметры, multipart upload, типы ответов, raw-типы событий и live-наблюдения по реальному VK Teams endpoint.
120
+
121
+ ## Ограничения
122
+
123
+ - Это интеграция для VK Teams / VK WorkSpace, не для `vk.com`.
124
+ - Входящие события работают через long polling, не через webhook.
125
+ - `VK Teams Trigger` скачивает вложения только из верхнего уровня `payload.parts`.
126
+ - `message.sendFile` и `message.sendVoice` пока не переиспользуют существующий `fileId`.
127
+ - Административные on-premise методы чатов не входят в текущую версию.
128
+
129
+
130
+ ## Разработка
131
+
132
+ ```bash
133
+ npm install
134
+ npm test
135
+ npm run lint
136
+ npm run lint:types
137
+ npm run build
138
+ ```
139
+
140
+ Для запуска локального n8n с hot reload:
141
+
142
+ ```bash
143
+ npm run dev
144
+ ```
145
+
146
+ Для проверки схемы на живом API без сохранения токена в репозитории:
147
+
148
+ ```bash
149
+ VK_TEAMS_BASE_URL=https://api.example.com/bot/v1/ \
150
+ VK_TEAMS_BOT_TOKEN=... \
151
+ npm run lint:types:live
152
+ ```
153
+
154
+ ## Лицензия
155
+
156
+ MIT
@@ -0,0 +1,9 @@
1
+ import type { ICredentialTestRequest, ICredentialType, INodeProperties, Icon } from 'n8n-workflow';
2
+ export declare class VkTeamsApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ icon: Icon;
6
+ documentationUrl: string;
7
+ properties: INodeProperties[];
8
+ test: ICredentialTestRequest;
9
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VkTeamsApi = void 0;
4
+ class VkTeamsApi {
5
+ constructor() {
6
+ this.name = 'vkTeamsApi';
7
+ this.displayName = 'VK Teams API';
8
+ this.icon = 'file:../nodes/VkTeams/vkTeams.svg';
9
+ this.documentationUrl = 'https://teams.vk.com/botapi/';
10
+ this.properties = [
11
+ {
12
+ displayName: 'Bot Token',
13
+ name: 'accessToken',
14
+ type: 'string',
15
+ typeOptions: { password: true },
16
+ default: '',
17
+ description: 'Bot token received from Metabot',
18
+ },
19
+ {
20
+ displayName: 'Base URL',
21
+ name: 'baseUrl',
22
+ type: 'string',
23
+ default: 'https://api.internal.myteam.mail.ru',
24
+ description: 'Base URL for the VK Teams server',
25
+ },
26
+ ];
27
+ this.test = {
28
+ request: {
29
+ baseURL: '={{$credentials.baseUrl.replace(/\\/+$/, "").replace(/\\/bot\\/v1$/, "")}}/bot/v1',
30
+ url: '/self/get',
31
+ method: 'GET',
32
+ qs: {
33
+ token: '={{$credentials.accessToken}}',
34
+ },
35
+ },
36
+ };
37
+ }
38
+ }
39
+ exports.VkTeamsApi = VkTeamsApi;
40
+ //# sourceMappingURL=VkTeamsApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VkTeamsApi.credentials.js","sourceRoot":"","sources":["../../credentials/VkTeamsApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,UAAU;IAAvB;QACC,SAAI,GAAG,YAAY,CAAC;QAEpB,gBAAW,GAAG,cAAc,CAAC;QAE7B,SAAI,GAAS,mCAAmC,CAAC;QAEjD,qBAAgB,GAAG,8BAA8B,CAAC;QAElD,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,iCAAiC;aAC9C;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,qCAAqC;gBAC9C,WAAW,EAAE,kCAAkC;aAC/C;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,mFAAmF;gBAC5F,GAAG,EAAE,WAAW;gBAChB,MAAM,EAAE,KAAK;gBACb,EAAE,EAAE;oBACH,KAAK,EAAE,+BAA+B;iBACtC;aACD;SACD,CAAC;IACH,CAAC;CAAA;AArCD,gCAqCC"}
@@ -0,0 +1,12 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ type BinaryFile = {
3
+ data: Buffer | NodeJS.ReadableStream;
4
+ fileName: string;
5
+ mimeType: string;
6
+ };
7
+ export declare function readBinaryFile(context: IExecuteFunctions, itemIndex: number, binaryPropertyName: string): Promise<BinaryFile>;
8
+ export declare class VkTeams implements INodeType {
9
+ description: INodeTypeDescription;
10
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
11
+ }
12
+ export {};
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VkTeams = void 0;
4
+ exports.readBinaryFile = readBinaryFile;
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ const execute_1 = require("./actions/execute");
7
+ const descriptions_1 = require("./actions/descriptions");
8
+ const runtime_1 = require("./shared/runtime");
9
+ function requireFileName(fileName) {
10
+ if (!fileName) {
11
+ throw new n8n_workflow_1.ApplicationError('fileName is required for binary upload');
12
+ }
13
+ return fileName;
14
+ }
15
+ async function readBinaryFile(context, itemIndex, binaryPropertyName) {
16
+ var _a, _b;
17
+ const binaryData = context.helpers.assertBinaryData(itemIndex, binaryPropertyName);
18
+ if (binaryData.id) {
19
+ return {
20
+ data: await context.helpers.getBinaryStream(binaryData.id),
21
+ fileName: requireFileName(binaryData.fileName),
22
+ mimeType: (_a = binaryData.mimeType) !== null && _a !== void 0 ? _a : 'application/octet-stream',
23
+ };
24
+ }
25
+ return {
26
+ data: Buffer.from(binaryData.data, n8n_workflow_1.BINARY_ENCODING),
27
+ fileName: requireFileName(binaryData.fileName),
28
+ mimeType: (_b = binaryData.mimeType) !== null && _b !== void 0 ? _b : 'application/octet-stream',
29
+ };
30
+ }
31
+ class VkTeams {
32
+ constructor() {
33
+ this.description = {
34
+ displayName: 'VK Teams',
35
+ name: 'vkTeams',
36
+ icon: 'file:vkTeams.svg',
37
+ group: ['output'],
38
+ version: 1,
39
+ subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
40
+ description: 'Send and read data through the VK Teams Bot API',
41
+ defaults: {
42
+ name: 'VK Teams',
43
+ },
44
+ usableAsTool: true,
45
+ inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
46
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
47
+ credentials: [{ name: 'vkTeamsApi', required: true }],
48
+ properties: descriptions_1.vkTeamsProperties,
49
+ };
50
+ }
51
+ async execute() {
52
+ var _a;
53
+ const credentials = (await this.getCredentials('vkTeamsApi'));
54
+ const items = this.getInputData();
55
+ const returnData = [];
56
+ for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
57
+ try {
58
+ const resource = this.getNodeParameter('resource', itemIndex);
59
+ const operation = this.getNodeParameter('operation', itemIndex);
60
+ const actionKey = `${resource}.${operation}`;
61
+ const input = {};
62
+ if (actionKey === 'message.sendText') {
63
+ input.chatId = this.getNodeParameter('chatId', itemIndex);
64
+ input.text = this.getNodeParameter('text', itemIndex);
65
+ }
66
+ else if (actionKey === 'message.editText') {
67
+ input.chatId = this.getNodeParameter('chatId', itemIndex);
68
+ input.msgId = this.getNodeParameter('msgId', itemIndex);
69
+ input.text = this.getNodeParameter('text', itemIndex);
70
+ }
71
+ else if (actionKey === 'message.deleteMessages') {
72
+ input.chatId = this.getNodeParameter('chatId', itemIndex);
73
+ input.msgId = ((_a = this.getNodeParameter('messageIds', itemIndex).values) !== null && _a !== void 0 ? _a : []).map((item) => item.msgId);
74
+ }
75
+ else if (actionKey === 'message.sendFile' || actionKey === 'message.sendVoice') {
76
+ input.chatId = this.getNodeParameter('chatId', itemIndex);
77
+ input.binaryFile = await readBinaryFile(this, itemIndex, this.getNodeParameter('binaryPropertyName', itemIndex));
78
+ }
79
+ else if (actionKey === 'callback.answerCallbackQuery') {
80
+ input.queryId = this.getNodeParameter('queryId', itemIndex);
81
+ input.text = this.getNodeParameter('text', itemIndex, '');
82
+ }
83
+ else if (actionKey === 'chat.getInfo') {
84
+ input.chatId = this.getNodeParameter('chatId', itemIndex);
85
+ }
86
+ else if (actionKey === 'file.getInfo' || actionKey === 'file.download') {
87
+ input.fileId = this.getNodeParameter('fileId', itemIndex);
88
+ }
89
+ const result = await (0, execute_1.executeAction)({
90
+ requestJson: async (request) => await (0, runtime_1.sendJsonRequest)(this, credentials, request),
91
+ requestUpload: async (request, binaryFile) => await (0, runtime_1.sendUploadRequest)(this, credentials, request, binaryFile),
92
+ downloadBinary: async (url) => await (0, runtime_1.downloadBinary)(this, url),
93
+ }, actionKey, input);
94
+ const executionItem = {
95
+ json: result.json,
96
+ pairedItem: { item: itemIndex },
97
+ };
98
+ if (result.binaryFile !== undefined) {
99
+ executionItem.binary = {
100
+ data: await this.helpers.prepareBinaryData(result.binaryFile.data, result.binaryFile.fileName, result.binaryFile.mimeType),
101
+ };
102
+ }
103
+ returnData.push(executionItem);
104
+ }
105
+ catch (error) {
106
+ if (this.continueOnFail()) {
107
+ returnData.push({
108
+ json: {
109
+ error: error instanceof Error ? error.message : 'Unknown error',
110
+ },
111
+ pairedItem: { item: itemIndex },
112
+ });
113
+ continue;
114
+ }
115
+ throw error;
116
+ }
117
+ }
118
+ return [returnData];
119
+ }
120
+ }
121
+ exports.VkTeams = VkTeams;
122
+ //# sourceMappingURL=VkTeams.node.js.map
@@ -0,0 +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cAAc,EAAE,EAAE,CAAC;oBAC3B,UAAU,CAAC,IAAI,CAAC;wBACf,IAAI,EAAE;4BACL,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;yBAC/D;wBACD,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;qBAC/B,CAAC,CAAC;oBACH,SAAS;gBACV,CAAC;gBAED,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA7GD,0BA6GC"}
@@ -0,0 +1,18 @@
1
+ {
2
+ "node": "n8n-nodes-vk-teams",
3
+ "nodeVersion": "1.0",
4
+ "codexVersion": "1.0",
5
+ "categories": ["Communication"],
6
+ "resources": {
7
+ "credentialDocumentation": [
8
+ {
9
+ "url": "https://teams.vk.com/botapi/"
10
+ }
11
+ ],
12
+ "primaryDocumentation": [
13
+ {
14
+ "url": "https://workspace.vk.ru/docs/saas/vks-messenger/messenger/bot/"
15
+ }
16
+ ]
17
+ }
18
+ }
@@ -0,0 +1,2 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ export declare const vkTeamsProperties: INodeProperties[];
@@ -0,0 +1,217 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.vkTeamsProperties = void 0;
4
+ const showMessage = {
5
+ resource: ['message'],
6
+ };
7
+ const showCallback = {
8
+ resource: ['callback'],
9
+ };
10
+ const showChat = {
11
+ resource: ['chat'],
12
+ };
13
+ const showFile = {
14
+ resource: ['file'],
15
+ };
16
+ const showBot = {
17
+ resource: ['bot'],
18
+ };
19
+ exports.vkTeamsProperties = [
20
+ {
21
+ displayName: 'Resource',
22
+ name: 'resource',
23
+ type: 'options',
24
+ noDataExpression: true,
25
+ options: [
26
+ { name: 'Bot', value: 'bot' },
27
+ { name: 'Callback', value: 'callback' },
28
+ { name: 'Chat', value: 'chat' },
29
+ { name: 'File', value: 'file' },
30
+ { name: 'Message', value: 'message' },
31
+ ],
32
+ default: 'message',
33
+ },
34
+ {
35
+ displayName: 'Operation',
36
+ name: 'operation',
37
+ type: 'options',
38
+ noDataExpression: true,
39
+ displayOptions: { show: showBot },
40
+ options: [{ name: 'Get Self', value: 'getSelf', action: 'Get bot self info' }],
41
+ default: 'getSelf',
42
+ },
43
+ {
44
+ displayName: 'Operation',
45
+ name: 'operation',
46
+ type: 'options',
47
+ noDataExpression: true,
48
+ displayOptions: { show: showCallback },
49
+ options: [
50
+ {
51
+ name: 'Answer Callback Query',
52
+ value: 'answerCallbackQuery',
53
+ action: 'Answer a callback query',
54
+ },
55
+ ],
56
+ default: 'answerCallbackQuery',
57
+ },
58
+ {
59
+ displayName: 'Operation',
60
+ name: 'operation',
61
+ type: 'options',
62
+ noDataExpression: true,
63
+ displayOptions: { show: showChat },
64
+ options: [{ name: 'Get Info', value: 'getInfo', action: 'Get chat info' }],
65
+ default: 'getInfo',
66
+ },
67
+ {
68
+ displayName: 'Operation',
69
+ name: 'operation',
70
+ type: 'options',
71
+ noDataExpression: true,
72
+ displayOptions: { show: showFile },
73
+ options: [
74
+ { name: 'Download', value: 'download', action: 'Download a file' },
75
+ { name: 'Get Info', value: 'getInfo', action: 'Get file info' },
76
+ ],
77
+ default: 'getInfo',
78
+ },
79
+ {
80
+ displayName: 'Operation',
81
+ name: 'operation',
82
+ type: 'options',
83
+ noDataExpression: true,
84
+ displayOptions: { show: showMessage },
85
+ options: [
86
+ { name: 'Delete Messages', value: 'deleteMessages', action: 'Delete messages' },
87
+ { name: 'Edit Text', value: 'editText', action: 'Edit text in a message' },
88
+ { name: 'Send File', value: 'sendFile', action: 'Send a file' },
89
+ { name: 'Send Text', value: 'sendText', action: 'Send a text message' },
90
+ { name: 'Send Voice', value: 'sendVoice', action: 'Send a voice message' },
91
+ ],
92
+ default: 'sendText',
93
+ },
94
+ {
95
+ displayName: 'Chat ID',
96
+ name: 'chatId',
97
+ type: 'string',
98
+ default: '',
99
+ required: true,
100
+ displayOptions: {
101
+ show: {
102
+ operation: ['getInfo', 'sendText', 'sendFile', 'sendVoice', 'editText', 'deleteMessages'],
103
+ resource: ['chat', 'message'],
104
+ },
105
+ },
106
+ },
107
+ {
108
+ displayName: 'Text',
109
+ name: 'text',
110
+ type: 'string',
111
+ default: '',
112
+ required: true,
113
+ displayOptions: {
114
+ show: {
115
+ operation: ['sendText', 'editText'],
116
+ resource: ['message'],
117
+ },
118
+ },
119
+ },
120
+ {
121
+ displayName: 'Message ID',
122
+ name: 'msgId',
123
+ type: 'string',
124
+ default: '',
125
+ required: true,
126
+ displayOptions: {
127
+ show: {
128
+ operation: ['editText'],
129
+ resource: ['message'],
130
+ },
131
+ },
132
+ },
133
+ {
134
+ displayName: 'Message IDs',
135
+ name: 'messageIds',
136
+ type: 'fixedCollection',
137
+ typeOptions: {
138
+ multipleValues: true,
139
+ },
140
+ default: {
141
+ values: [{ msgId: '' }],
142
+ },
143
+ required: true,
144
+ displayOptions: {
145
+ show: {
146
+ operation: ['deleteMessages'],
147
+ resource: ['message'],
148
+ },
149
+ },
150
+ options: [
151
+ {
152
+ displayName: 'Message IDs',
153
+ name: 'values',
154
+ values: [
155
+ {
156
+ displayName: 'Message ID',
157
+ name: 'msgId',
158
+ type: 'string',
159
+ default: '',
160
+ },
161
+ ],
162
+ },
163
+ ],
164
+ },
165
+ {
166
+ displayName: 'Query ID',
167
+ name: 'queryId',
168
+ type: 'string',
169
+ default: '',
170
+ required: true,
171
+ displayOptions: {
172
+ show: {
173
+ operation: ['answerCallbackQuery'],
174
+ resource: ['callback'],
175
+ },
176
+ },
177
+ },
178
+ {
179
+ displayName: 'Text',
180
+ name: 'text',
181
+ type: 'string',
182
+ default: '',
183
+ displayOptions: {
184
+ show: {
185
+ operation: ['answerCallbackQuery'],
186
+ resource: ['callback'],
187
+ },
188
+ },
189
+ },
190
+ {
191
+ displayName: 'File ID',
192
+ name: 'fileId',
193
+ type: 'string',
194
+ default: '',
195
+ required: true,
196
+ displayOptions: {
197
+ show: {
198
+ operation: ['getInfo', 'download'],
199
+ resource: ['file'],
200
+ },
201
+ },
202
+ },
203
+ {
204
+ displayName: 'Input Binary Field',
205
+ name: 'binaryPropertyName',
206
+ type: 'string',
207
+ default: 'data',
208
+ required: true,
209
+ displayOptions: {
210
+ show: {
211
+ operation: ['sendFile', 'sendVoice'],
212
+ resource: ['message'],
213
+ },
214
+ },
215
+ },
216
+ ];
217
+ //# sourceMappingURL=descriptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptions.js","sourceRoot":"","sources":["../../../../nodes/VkTeams/actions/descriptions.ts"],"names":[],"mappings":";;;AAEA,MAAM,WAAW,GAAG;IACnB,QAAQ,EAAE,CAAC,SAAS,CAAC;CACrB,CAAC;AAEF,MAAM,YAAY,GAAG;IACpB,QAAQ,EAAE,CAAC,UAAU,CAAC;CACtB,CAAC;AAEF,MAAM,QAAQ,GAAG;IAChB,QAAQ,EAAE,CAAC,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,QAAQ,GAAG;IAChB,QAAQ,EAAE,CAAC,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,OAAO,GAAG;IACf,QAAQ,EAAE,CAAC,KAAK,CAAC;CACjB,CAAC;AAEW,QAAA,iBAAiB,GAAsB;IACnD;QACC,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE;YACR,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;YAC7B,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;YACvC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;YAC/B,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;YAC/B,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,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AAE,EAAE;QACX,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,SAAS,EAAE,CAAC,qBAAqB,CAAC;gBAClC,QAAQ,EAAE,CAAC,UAAU,CAAC;aACtB;SACD;KACD;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,SAAS,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;gBAClC,QAAQ,EAAE,CAAC,MAAM,CAAC;aAClB;SACD;KACD;IACD;QACC,WAAW,EAAE,oBAAoB;QACjC,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,SAAS,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC;gBACpC,QAAQ,EAAE,CAAC,SAAS,CAAC;aACrB;SACD;KACD;CACD,CAAC"}
@@ -0,0 +1,38 @@
1
+ type InputBinaryFile = {
2
+ data: Buffer | NodeJS.ReadableStream;
3
+ fileName: string;
4
+ mimeType: string;
5
+ };
6
+ type OutputBinaryFile = {
7
+ data: Buffer;
8
+ fileName: string;
9
+ mimeType: string;
10
+ };
11
+ type JsonRequest = {
12
+ requestType: 'json';
13
+ method: 'GET' | 'POST';
14
+ endpoint: string;
15
+ params: Record<string, unknown>;
16
+ };
17
+ type UploadRequest = {
18
+ requestType: 'upload';
19
+ method: 'POST';
20
+ endpoint: string;
21
+ params: Record<string, unknown>;
22
+ fileField: string;
23
+ fileName: string;
24
+ fileContentType: string;
25
+ };
26
+ type ActionDependencies = {
27
+ requestJson(request: JsonRequest): Promise<unknown>;
28
+ requestUpload(request: UploadRequest, binaryFile: InputBinaryFile): Promise<unknown>;
29
+ downloadBinary(url: string): Promise<Buffer>;
30
+ };
31
+ type ActionInput = Record<string, unknown> & {
32
+ binaryFile?: InputBinaryFile;
33
+ };
34
+ export declare function executeAction(deps: ActionDependencies, actionKey: string, input: ActionInput): Promise<{
35
+ json: unknown;
36
+ binaryFile?: OutputBinaryFile;
37
+ }>;
38
+ export {};