UNPKG

@tuanltntu/n8n-nodes-bitrix24

Version:

Comprehensive n8n community node for Bitrix24 API integration with CRM, Tasks, Chat, Telephony, and more

530 lines 15.9 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.botEventListenerFields = exports.botMessageFields = exports.botCommandFields = exports.botUnregistrationFields = exports.botRegistrationFields = exports.botOperationFields = void 0; // Common fields used in bot operations exports.botOperationFields = [ // Operation selector for bot operations { displayName: "Operation", name: "operation", type: "options", noDataExpression: true, displayOptions: { show: { resource: ["bot"], }, }, options: [ { name: "Register Bot", value: "registerBot", description: "Register a new bot", action: "Register a new bot", }, { name: "Unregister Bot", value: "unregisterBot", description: "Unregister an existing bot", action: "Unregister a bot", }, { name: "Add Command", value: "addCommand", description: "Add a command to a bot", action: "Add a command to a bot", }, { name: "Delete Command", value: "deleteCommand", description: "Delete a command from a bot", action: "Delete a command from a bot", }, { name: "Get Commands", value: "getCommands", description: "Get all commands of a bot", action: "Get all commands of a bot", }, { name: "Send Message", value: "sendMessage", description: "Send a message as a bot", action: "Send a message as a bot", }, { name: "Register Event Handler", value: "registerEventHandler", description: "Register a URL to handle bot events", action: "Register a URL to handle bot events", }, { name: "Unregister Event Handler", value: "unregisterEventHandler", description: "Unregister a bot event handler", action: "Unregister a bot event handler", }, ], default: "registerBot", }, ]; exports.botRegistrationFields = [ // Fields for bot registration { displayName: "Code", name: "code", type: "string", required: true, displayOptions: { show: { resource: ["bot"], operation: ["registerBot"], }, }, default: "", description: "Authorization code received in the redirect URL", }, { displayName: "Event Handler URL", name: "eventHandlerUrl", type: "string", required: true, displayOptions: { show: { resource: ["bot"], operation: ["registerBot"], }, }, default: "", description: "URL where bot events will be sent", }, { displayName: "Options", name: "options", type: "collection", placeholder: "Add Option", default: {}, displayOptions: { show: { resource: ["bot"], operation: ["registerBot"], }, }, options: [ { displayName: "Type", name: "type", type: "options", options: [ { name: "Human", value: "H", }, { name: "Chat Bot", value: "B", }, { name: "Open Channels", value: "O", }, { name: "Network Bot", value: "N", }, ], default: "B", description: "Type of the bot", }, { displayName: "Event Types", name: "eventTypes", type: "multiOptions", options: [ { name: "Message Add", value: "ONIMBOTMESSAGEADD", }, { name: "Chat Add", value: "ONIMBOTJOINCHAT", }, { name: "Delete Message", value: "ONIMBOTDELETE", }, { name: "Message Update", value: "ONIMBOTMESSAGEUPDATE", }, ], default: ["ONIMBOTMESSAGEADD"], description: "Types of events the bot will listen to", }, { displayName: "Bot Name", name: "botName", type: "string", default: "", description: "Name of the bot", }, { displayName: "Bot Description", name: "botDescription", type: "string", default: "", description: "Description of the bot", }, { displayName: "Bot Avatar", name: "botAvatar", type: "string", default: "", description: "URL to the bot avatar image", }, { displayName: "Custom Parameters", name: "customParameters", type: "string", default: "", description: "Additional parameters in JSON format to include in the request", hint: "Enter a JSON object with key-value pairs that will be merged with other parameters", typeOptions: { rows: 2, }, }, ], }, ]; exports.botUnregistrationFields = [ // Fields for bot unregistration { displayName: "Bot ID", name: "botId", type: "string", required: true, displayOptions: { show: { resource: ["bot"], operation: ["unregisterBot"], }, }, default: "", description: "ID of the bot to unregister", }, { displayName: "Options", name: "options", type: "collection", placeholder: "Add Option", default: {}, displayOptions: { show: { resource: ["bot"], operation: ["unregisterBot"], }, }, options: [ { displayName: "Custom Parameters", name: "customParameters", type: "string", default: "", description: "Additional parameters in JSON format to include in the request", hint: "Enter a JSON object with key-value pairs that will be merged with other parameters", typeOptions: { rows: 2, }, }, ], }, ]; exports.botCommandFields = [ // Fields for bot command operations { displayName: "Bot ID", name: "botId", type: "string", required: true, displayOptions: { show: { resource: ["bot"], operation: ["addCommand", "deleteCommand", "getCommands"], }, }, default: "", description: "ID of the bot", }, { displayName: "Command", name: "command", type: "string", required: true, displayOptions: { show: { resource: ["bot"], operation: ["addCommand", "deleteCommand"], }, }, default: "", description: "Command text (e.g., help, start)", }, { displayName: "Command Description", name: "commandDescription", type: "string", required: true, displayOptions: { show: { resource: ["bot"], operation: ["addCommand"], }, }, default: "", description: "Description of what the command does", }, { displayName: "Command Params", name: "commandParams", type: "string", displayOptions: { show: { resource: ["bot"], operation: ["addCommand"], }, }, default: "", description: "Additional parameters for the command", }, { displayName: "Options", name: "options", type: "collection", placeholder: "Add Option", default: {}, displayOptions: { show: { resource: ["bot"], operation: ["addCommand", "deleteCommand", "getCommands"], }, }, options: [ { displayName: "Custom Parameters", name: "customParameters", type: "string", default: "", description: "Additional parameters in JSON format to include in the request", hint: "Enter a JSON object with key-value pairs that will be merged with other parameters", typeOptions: { rows: 2, }, }, ], }, ]; exports.botMessageFields = [ // Fields for sending messages as a bot { displayName: "Bot ID", name: "botId", type: "string", required: true, displayOptions: { show: { resource: ["bot"], operation: ["sendMessage"], }, }, default: "", description: "ID of the bot sending the message", }, { displayName: "Dialog ID", name: "dialogId", type: "string", required: true, displayOptions: { show: { resource: ["bot"], operation: ["sendMessage"], }, }, default: "", description: "ID of the dialog to send the message to", }, { displayName: "Message", name: "message", type: "string", required: true, displayOptions: { show: { resource: ["bot"], operation: ["sendMessage"], }, }, default: "", typeOptions: { rows: 4, }, description: "The message text to send", }, { displayName: "Options", name: "options", type: "collection", placeholder: "Add Option", default: {}, displayOptions: { show: { resource: ["bot"], operation: ["sendMessage"], }, }, options: [ { displayName: "Attach Files", name: "attachFiles", type: "boolean", default: false, description: "Whether to attach files to the message", }, { displayName: "Binary Property", name: "binaryPropertyName", type: "string", default: "data", required: true, displayOptions: { show: { attachFiles: [true], }, }, description: "The name of the binary property which contains the file data for the attachment", }, { displayName: "Keyboard", name: "keyboard", type: "boolean", default: false, description: "Whether to add a keyboard to the message", }, { displayName: "Keyboard JSON", name: "keyboardJson", type: "string", default: "", typeOptions: { rows: 4, }, displayOptions: { show: { keyboard: [true], }, }, description: "JSON representation of the keyboard buttons", }, { displayName: "Custom Parameters", name: "customParameters", type: "string", default: "", description: "Additional parameters in JSON format to include in the request", hint: "Enter a JSON object with key-value pairs that will be merged with other parameters", typeOptions: { rows: 2, }, }, ], }, ]; exports.botEventListenerFields = [ // Fields for event listener operations { displayName: "Bot ID", name: "botId", type: "string", required: true, displayOptions: { show: { resource: ["bot"], operation: ["registerEventHandler", "unregisterEventHandler"], }, }, default: "", description: "ID of the bot", }, { displayName: "Event Type", name: "eventType", type: "options", required: true, displayOptions: { show: { resource: ["bot"], operation: ["registerEventHandler", "unregisterEventHandler"], }, }, options: [ { name: "Message Add", value: "ONIMBOTMESSAGEADD", }, { name: "Chat Add", value: "ONIMBOTJOINCHAT", }, { name: "Delete Message", value: "ONIMBOTDELETE", }, { name: "Message Update", value: "ONIMBOTMESSAGEUPDATE", }, ], default: "ONIMBOTMESSAGEADD", description: "Type of event to handle", }, { displayName: "Handler URL", name: "handlerUrl", type: "string", required: true, displayOptions: { show: { resource: ["bot"], operation: ["registerEventHandler"], }, }, default: "", description: "URL that will handle the event", }, { displayName: "Options", name: "options", type: "collection", placeholder: "Add Option", default: {}, displayOptions: { show: { resource: ["bot"], operation: ["registerEventHandler", "unregisterEventHandler"], }, }, options: [ { displayName: "Custom Parameters", name: "customParameters", type: "string", default: "", description: "Additional parameters in JSON format to include in the request", hint: "Enter a JSON object with key-value pairs that will be merged with other parameters", typeOptions: { rows: 2, }, }, ], }, ]; //# sourceMappingURL=BotDescription.js.map