@tuanltntu/n8n-nodes-bitrix24
Version:
Comprehensive n8n community node for Bitrix24 API integration with CRM, Tasks, Chat, Telephony, and more
947 lines • 29.6 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.chatbotDialogFields = exports.chatbotChatFields = exports.chatbotMessageFields = exports.chatbotCommandFields = exports.chatbotRegistrationFields = exports.chatbotOperationFields = void 0;
// Operation fields for Chatbot operations
exports.chatbotOperationFields = [
{
displayName: "Operation",
name: "operation",
type: "options",
noDataExpression: true,
displayOptions: {
show: {},
hide: {},
},
options: [
// Bot management operations
{
name: "Register Bot",
value: "registerBot",
description: "Register a new chat bot (imbot.register)",
action: "Register a new chat bot",
},
{
name: "Unregister Bot",
value: "unregisterBot",
description: "Unregister a chat bot (imbot.unregister)",
action: "Unregister a chat bot",
},
{
name: "Update Bot",
value: "updateBot",
description: "Update chat bot data (imbot.update)",
action: "Update chat bot data",
},
{
name: "Get Bot List",
value: "getBotList",
description: "Get list of available chatbots (imbot.bot.list)",
action: "Get list of available chatbots",
},
{
name: "Get Revision",
value: "getRevision",
description: "Get API revisions info (im.revision.get)",
action: "Get API revisions info",
},
// Command operations
{
name: "Register Command",
value: "registerCommand",
description: "Register a new command for the chatbot (imbot.command.register)",
action: "Register a new command for the chatbot",
},
{
name: "Unregister Command",
value: "unregisterCommand",
description: "Remove a registered command from the chatbot (imbot.command.unregister)",
action: "Remove a registered command from the chatbot",
},
{
name: "Update Command",
value: "updateCommand",
description: "Update information about a registered command (imbot.command.update)",
action: "Update a registered command",
},
{
name: "Answer Command",
value: "answerCommand",
description: "Send a response to the chatbot command (imbot.command.answer)",
action: "Send a response to a command",
},
// Message operations
{
name: "Add Message",
value: "addMessage",
description: "Add a new message from the chatbot (imbot.message.add)",
action: "Add a new message",
},
{
name: "Update Message",
value: "updateMessage",
description: "Update an existing message from the chatbot (imbot.message.update)",
action: "Update a message",
},
{
name: "Delete Message",
value: "deleteMessage",
description: "Delete a message from the chatbot (imbot.message.delete)",
action: "Delete a message",
},
{
name: "Like Message",
value: "likeMessage",
description: "Like a message from the chatbot (imbot.message.like)",
action: "Like a message",
},
{
name: "Send Typing",
value: "sendTyping",
description: "Send a typing indicator in the chat (imbot.chat.sendTyping)",
action: "Send typing indicator",
},
// Chat operations
{
name: "Chat Add",
value: "chatAdd",
description: "Create a new chat (imbot.chat.add)",
action: "Create a new chat",
},
{
name: "Chat Get",
value: "chatGet",
description: "Get chat details (imbot.chat.get)",
action: "Get chat details",
},
{
name: "Chat Leave",
value: "chatLeave",
description: "Make the chatbot leave the chat (imbot.chat.leave)",
action: "Make the chatbot leave the chat",
},
{
name: "Chat Set Owner",
value: "chatSetOwner",
description: "Set chat owner (imbot.chat.setOwner)",
action: "Set chat owner",
},
{
name: "Chat Update Avatar",
value: "chatUpdateAvatar",
description: "Update chat avatar (imbot.chat.updateAvatar)",
action: "Update chat avatar",
},
{
name: "Chat Update Color",
value: "chatUpdateColor",
description: "Update chat color (imbot.chat.updateColor)",
action: "Update chat color",
},
{
name: "Chat Update Title",
value: "chatUpdateTitle",
description: "Update chat title (imbot.chat.updateTitle)",
action: "Update chat title",
},
{
name: "Chat User Add",
value: "chatUserAdd",
description: "Add a user to a chat (imbot.chat.user.add)",
action: "Add a user to a chat",
},
{
name: "Chat User List",
value: "chatUserList",
description: "Get list of users in a chat (imbot.chat.user.list)",
action: "Get list of users in a chat",
},
{
name: "Chat User Delete",
value: "chatUserDelete",
description: "Remove a user from a chat (imbot.chat.user.delete)",
action: "Remove a user from a chat",
},
// Dialog operations
{
name: "Get Dialog",
value: "getDialog",
description: "Get dialog information (imbot.dialog.get)",
action: "Get dialog information",
},
],
default: "registerBot",
},
];
// Fields for bot registration operations
exports.chatbotRegistrationFields = [
// Registration fields
{
displayName: "Bot Type",
name: "botType",
type: "options",
required: true,
displayOptions: {
show: {
operation: ["registerBot"],
},
},
options: [
{
name: "Human",
value: "H",
},
{
name: "Chat Bot",
value: "B",
},
{
name: "Service",
value: "S",
},
{
name: "Network",
value: "N",
},
{
name: "Open Line",
value: "O",
},
],
default: "B",
description: "Type of the bot to register",
},
{
displayName: "Bot Name",
name: "botName",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["registerBot"],
},
},
default: "",
description: "Name of the bot",
},
{
displayName: "Bot Code",
name: "botCode",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["registerBot"],
},
},
default: "",
description: "Unique code for the bot",
},
{
displayName: "Event Handler URL",
name: "eventHandler",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["registerBot"],
},
},
default: "",
description: "URL for handling bot events (messages, commands, etc.)",
},
{
displayName: "Options",
name: "options",
type: "collection",
placeholder: "Add Option",
default: {},
options: [
{
displayName: "Access Token",
name: "accessToken",
type: "string",
default: "",
placeholder: "Enter the access token to use instead of credentials.",
description: "Access token to use for API requests. If provided, will take priority over token in credentials.",
},
{
displayName: "Open Line ID",
name: "openLineId",
type: "string",
default: "",
description: "ID for Open Line type bots",
},
{
displayName: "Client ID",
name: "clientId",
type: "string",
default: "",
description: "Client ID for Network type bots",
},
{
displayName: "Language ID",
name: "languageId",
type: "string",
default: "",
description: "Bot language (e.g., 'en', 'ru')",
},
{
displayName: "Bot Description",
name: "botDescription",
type: "string",
default: "",
description: "Description of the bot",
},
{
displayName: "Bot Avatar",
name: "botAvatar",
type: "string",
default: "",
description: "URL or file ID for the bot avatar",
},
],
},
{
displayName: "Bot ID",
name: "botId",
type: "string",
required: true,
displayOptions: {
show: {
operation: [
"unregisterBot",
"updateBot",
"chatAdd",
"chatGet",
"chatLeave",
"chatSetOwner",
"chatUpdateAvatar",
"chatUpdateColor",
"chatUpdateTitle",
"chatUserAdd",
"chatUserList",
"chatUserDelete",
"getDialog",
],
},
},
default: "",
description: "ID of the bot",
},
{
displayName: "Options",
name: "options",
type: "collection",
placeholder: "Add Option",
default: {},
options: [
{
displayName: "Access Token",
name: "accessToken",
type: "string",
default: "",
placeholder: "Enter the access token to use instead of credentials.",
description: "Access token to use for API requests. If provided, will take priority over token in credentials.",
},
{
displayName: "Bot Name",
name: "botName",
type: "string",
default: "",
description: "New name for the bot",
},
{
displayName: "Bot Description",
name: "botDescription",
type: "string",
default: "",
description: "New description for the bot",
},
{
displayName: "Bot Avatar",
name: "botAvatar",
type: "string",
default: "",
description: "New avatar URL or file ID for the bot",
},
],
},
];
// Fields for command operations
exports.chatbotCommandFields = [
// Command fields
{
displayName: "Bot ID",
name: "botId",
type: "string",
required: true,
displayOptions: {
show: {
operation: [
"registerCommand",
"unregisterCommand",
"updateCommand",
"answerCommand",
],
},
},
default: "",
description: "ID of the bot",
},
{
displayName: "Command",
name: "command",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["registerCommand"],
},
},
default: "",
description: "Command text (without slash)",
},
{
displayName: "Command Handler URL",
name: "commandHandler",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["registerCommand"],
},
},
default: "",
description: "URL that will process command events",
},
{
displayName: "Command ID",
name: "commandId",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["unregisterCommand", "updateCommand", "answerCommand"],
},
},
default: "",
description: "ID of the command",
},
{
displayName: "Message Text",
name: "messageText",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["answerCommand"],
},
},
default: "",
description: "Message text to send as a command response",
},
{
displayName: "Options",
name: "options",
type: "collection",
placeholder: "Add Option",
default: {},
options: [
{
displayName: "Access Token",
name: "accessToken",
type: "string",
default: "",
placeholder: "Enter the access token to use instead of credentials.",
description: "Access token to use for API requests. If provided, will take priority over token in credentials.",
},
{
displayName: "Command Description",
name: "commandDescription",
type: "string",
default: "",
description: "Description of the command",
},
{
displayName: "Is Common",
name: "isCommon",
type: "boolean",
default: false,
description: "Whether the command can be used in common chats",
},
{
displayName: "Is Hidden",
name: "isHidden",
type: "boolean",
default: false,
description: "Whether the command is hidden from command list",
},
{
displayName: "Allow Extranet",
name: "allowExtranet",
type: "boolean",
default: false,
description: "Whether the command is available for extranet users",
},
],
},
{
displayName: "Options",
name: "options",
type: "collection",
placeholder: "Add Option",
default: {},
options: [
{
displayName: "Access Token",
name: "accessToken",
type: "string",
default: "",
placeholder: "Enter the access token to use instead of credentials.",
description: "Access token to use for API requests. If provided, will take priority over token in credentials.",
},
{
displayName: "Command",
name: "command",
type: "string",
default: "",
description: "New command text (without slash)",
},
{
displayName: "Command Handler URL",
name: "commandHandler",
type: "string",
default: "",
description: "New URL that will process command events",
},
{
displayName: "Command Description",
name: "commandDescription",
type: "string",
default: "",
description: "New description of the command",
},
{
displayName: "Is Common",
name: "isCommon",
type: "boolean",
default: false,
description: "Whether the command can be used in common chats",
},
{
displayName: "Is Hidden",
name: "isHidden",
type: "boolean",
default: false,
description: "Whether the command is hidden from command list",
},
{
displayName: "Allow Extranet",
name: "allowExtranet",
type: "boolean",
default: false,
description: "Whether the command is available for extranet users",
},
],
},
{
displayName: "Options",
name: "options",
type: "collection",
placeholder: "Add Option",
default: {},
options: [
{
displayName: "Access Token",
name: "accessToken",
type: "string",
default: "",
placeholder: "Enter the access token to use instead of credentials.",
description: "Access token to use for API requests. If provided, will take priority over token in credentials.",
},
{
displayName: "Message Type",
name: "messageType",
type: "options",
options: [
{
name: "Regular",
value: "regular",
},
{
name: "System",
value: "system",
},
],
default: "regular",
description: "Type of message to send",
},
{
displayName: "Attachments",
name: "attachments",
type: "string",
default: "",
description: "JSON string with attachments",
},
{
displayName: "Keyboard Buttons",
name: "keyboardButtons",
type: "string",
default: "",
description: "JSON string with keyboard buttons",
},
],
},
];
// Fields for message operations
exports.chatbotMessageFields = [
// Message fields
{
displayName: "Bot ID",
name: "botId",
type: "string",
required: true,
displayOptions: {
show: {
operation: [
"addMessage",
"updateMessage",
"deleteMessage",
"likeMessage",
"sendTyping",
],
},
},
default: "",
description: "ID of the bot",
},
{
displayName: "Dialog ID",
name: "dialogId",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["addMessage", "sendTyping"],
},
},
default: "",
description: "ID of the dialog",
},
{
displayName: "Message Text",
name: "messageText",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["addMessage", "updateMessage"],
},
},
default: "",
description: "Message text to send",
},
{
displayName: "Message ID",
name: "messageId",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["updateMessage", "deleteMessage", "likeMessage"],
},
},
default: "",
description: "ID of the message",
},
{
displayName: "Action",
name: "action",
type: "options",
required: true,
displayOptions: {
show: {
operation: ["likeMessage"],
},
},
options: [
{
name: "Add",
value: "add",
},
{
name: "Remove",
value: "remove",
},
],
default: "add",
description: "Action to perform on the message like",
},
{
displayName: "Options",
name: "options",
type: "collection",
placeholder: "Add Option",
default: {},
options: [
{
displayName: "Access Token",
name: "accessToken",
type: "string",
default: "",
placeholder: "Enter the access token to use instead of credentials.",
description: "Access token to use for API requests. If provided, will take priority over token in credentials.",
},
{
displayName: "Message Type",
name: "messageType",
type: "options",
options: [
{
name: "Regular",
value: "regular",
},
{
name: "System",
value: "system",
},
],
default: "regular",
description: "Type of message to send",
},
{
displayName: "Attachments",
name: "attachments",
type: "string",
default: "",
description: "JSON string with attachments",
},
{
displayName: "Keyboard Buttons",
name: "keyboardButtons",
type: "string",
default: "",
description: "JSON string with keyboard buttons",
},
{
displayName: "URL Preview",
name: "urlPreview",
type: "boolean",
default: true,
description: "Whether to enable URL preview in the message",
},
],
},
{
displayName: "Options",
name: "options",
type: "collection",
placeholder: "Add Option",
default: {},
options: [
{
displayName: "Access Token",
name: "accessToken",
type: "string",
default: "",
placeholder: "Enter the access token to use instead of credentials.",
description: "Access token to use for API requests. If provided, will take priority over token in credentials.",
},
{
displayName: "Attachments",
name: "attachments",
type: "string",
default: "",
description: "JSON string with attachments",
},
{
displayName: "Keyboard Buttons",
name: "keyboardButtons",
type: "string",
default: "",
description: "JSON string with keyboard buttons",
},
{
displayName: "URL Preview",
name: "urlPreview",
type: "boolean",
default: true,
description: "Whether to enable URL preview in the message",
},
],
},
{
displayName: "Options",
name: "options",
type: "collection",
placeholder: "Add Option",
default: {},
options: [
{
displayName: "Access Token",
name: "accessToken",
type: "string",
default: "",
placeholder: "Enter the access token to use instead of credentials.",
description: "Access token to use for API requests. If provided, will take priority over token in credentials.",
},
{
displayName: "Message ID",
name: "messageId",
type: "string",
default: "",
description: "ID of the message to delete",
},
],
},
];
// Fields for chat operations
exports.chatbotChatFields = [
// Chat add fields
{
displayName: "Title",
name: "title",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["chatAdd", "chatUpdateTitle"],
},
},
default: "",
description: "Title of the chat",
},
{
displayName: "User IDs",
name: "userIds",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["chatAdd"],
},
},
default: "",
description: "Comma-separated list of user IDs to add to the chat",
},
{
displayName: "Chat ID",
name: "chatId",
type: "string",
required: true,
displayOptions: {
show: {
operation: [
"chatGet",
"chatLeave",
"chatSetOwner",
"chatUpdateAvatar",
"chatUpdateColor",
"chatUpdateTitle",
"chatUserAdd",
"chatUserList",
"chatUserDelete",
],
},
},
default: "",
description: "ID of the chat",
},
{
displayName: "User ID",
name: "userId",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["chatUserAdd", "chatUserDelete", "chatSetOwner"],
},
},
default: "",
description: "ID of the user",
},
{
displayName: "Color",
name: "color",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["chatUpdateColor"],
},
},
default: "",
description: "Color code for the chat (e.g., #FF0000 for red)",
},
{
displayName: "File ID",
name: "fileId",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["chatUpdateAvatar"],
},
},
default: "",
description: "ID of the file to use as avatar",
},
{
displayName: "Options",
name: "options",
type: "collection",
placeholder: "Add Option",
default: {},
options: [
{
displayName: "Access Token",
name: "accessToken",
type: "string",
default: "",
placeholder: "Enter the access token to use instead of credentials.",
description: "Access token to use for API requests. If provided, will take priority over token in credentials.",
},
{
displayName: "Chat ID",
name: "chatId",
type: "string",
default: "",
description: "ID of the chat",
},
],
},
];
// Fields for dialog operations
exports.chatbotDialogFields = [
{
displayName: "Dialog ID",
name: "dialogId",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["getDialog"],
},
},
default: "",
description: "ID of the dialog",
},
{
displayName: "Options",
name: "options",
type: "collection",
placeholder: "Add Option",
default: {},
options: [
{
displayName: "Access Token",
name: "accessToken",
type: "string",
default: "",
placeholder: "Enter the access token to use instead of credentials.",
description: "Access token to use for API requests. If provided, will take priority over token in credentials.",
},
],
},
];
//# sourceMappingURL=ChatbotDescription.js.map