@tuanltntu/n8n-nodes-bitrix24
Version:
Comprehensive n8n community node for Bitrix24 API integration with CRM, Tasks, Chat, Telephony, and more
610 lines • 18.6 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.imDiskFields = exports.imUserStatusFields = exports.imNotificationFields = exports.imMessageFields = exports.imChatFields = exports.imOperationFields = void 0;
// Operation fields for Im (Chat) operations
exports.imOperationFields = [
{
displayName: "Operation",
name: "operation",
type: "options",
noDataExpression: true,
displayOptions: {
show: {
resource: ["im"],
},
},
options: [
// Chat operations
{
name: "Get Recent Chats",
value: "getRecentChats",
description: "Get list of recent chats (im.recent.get)",
action: "Get list of recent chats",
},
{
name: "Create Chat",
value: "createChat",
description: "Create a new chat (im.chat.add)",
action: "Create a new chat",
},
{
name: "Get Chat Users",
value: "getChatUsers",
description: "Get users in a chat (im.chat.user.list)",
action: "Get users in a chat",
},
{
name: "Add User To Chat",
value: "addUserToChat",
description: "Add a user to a chat (im.chat.user.add)",
action: "Add a user to a chat",
},
{
name: "Delete User From Chat",
value: "deleteUserFromChat",
description: "Remove a user from a chat (im.chat.user.delete)",
action: "Remove a user from a chat",
},
{
name: "Get Chat",
value: "getChat",
description: "Get chat details (im.chat.get)",
action: "Get chat details",
},
{
name: "Set Chat Owner",
value: "setChatOwner",
description: "Set chat owner (im.chat.setOwner)",
action: "Set chat owner",
},
{
name: "Set Chat Title",
value: "setChatTitle",
description: "Set chat title (im.chat.setTitle)",
action: "Set chat title",
},
{
name: "Set Chat Avatar",
value: "setChatAvatar",
description: "Set chat avatar (im.chat.setAvatar)",
action: "Set chat avatar",
},
{
name: "Set Chat Description",
value: "setChatDescription",
description: "Set chat description (im.chat.setDescription)",
action: "Set chat description",
},
{
name: "Set Chat Color",
value: "setChatColor",
description: "Set chat color (im.chat.setColor)",
action: "Set chat color",
},
{
name: "Set Chat Background",
value: "setChatBackground",
description: "Set chat background (im.chat.setBackground)",
action: "Set chat background",
},
// Message operations
{
name: "Add Message",
value: "addMessage",
description: "Send a message (im.message.add)",
action: "Send a message",
},
{
name: "Update Message",
value: "updateMessage",
description: "Update a message (im.message.update)",
action: "Update a message",
},
{
name: "Delete Message",
value: "deleteMessage",
description: "Delete a message (im.message.delete)",
action: "Delete a message",
},
{
name: "Like Message",
value: "likeMessage",
description: "Like a message (im.message.like)",
action: "Like a message",
},
{
name: "Get Message History",
value: "getMessageHistory",
description: "Get message history (im.message.get.history)",
action: "Get message history",
},
{
name: "Get Message By Id",
value: "getMessageById",
description: "Get message by ID (im.message.get.message)",
action: "Get message by ID",
},
{
name: "Get Unread Messages",
value: "getUnreadMessages",
description: "Get unread messages (im.message.get.unread)",
action: "Get unread messages",
},
{
name: "Get Messages By Dialog",
value: "getMessagesByDialog",
description: "Get chat dialog messages (im.dialog.messages.get)",
action: "Get chat dialog messages",
},
{
name: "Get Dialog Users",
value: "getDialogUsers",
description: "Get dialog users (im.dialog.users.get)",
action: "Get dialog users",
},
{
name: "Read Dialog Messages",
value: "readDialogMessages",
description: "Mark dialog messages as read (im.dialog.read)",
action: "Mark dialog messages as read",
},
{
name: "Search Message History",
value: "searchMessageHistory",
description: "Search in message history (im.message.search)",
action: "Search in message history",
},
// Notification operations
{
name: "Send Notification",
value: "sendNotification",
description: "Send a notification (im.notify.personal.add)",
action: "Send a notification",
},
{
name: "Send System Message",
value: "sendSystemMessage",
description: "Send a system message (im.notify.system.add)",
action: "Send a system message",
},
// User status operations
{
name: "Get User Status",
value: "getUserStatus",
description: "Get user status (im.status.get)",
action: "Get user status",
},
{
name: "Set User Status",
value: "setUserStatus",
description: "Set user status (im.status.set)",
action: "Set user status",
},
// Disk operations
{
name: "Upload File",
value: "uploadFile",
description: "Upload a file to chat (im.disk.file.upload)",
action: "Upload a file to chat",
},
{
name: "Get Disk Folder",
value: "getDiskFolder",
description: "Get chat disk folder (im.disk.folder.get)",
action: "Get chat disk folder",
},
],
default: "getRecentChats",
},
];
// Fields for chat operations
exports.imChatFields = [
// Fields for create chat
{
displayName: "Title",
name: "title",
type: "string",
required: true,
displayOptions: {
show: {
resource: ["im"],
operation: ["createChat"],
},
},
default: "",
description: "The title of the chat",
},
{
displayName: "User IDs",
name: "userIds",
type: "string",
required: true,
displayOptions: {
show: {
resource: ["im"],
operation: ["createChat", "addUserToChat"],
},
},
default: "",
description: "Comma-separated list of user IDs to add to the chat",
},
{
displayName: "Chat ID",
name: "chatId",
type: "string",
required: true,
displayOptions: {
show: {
resource: ["im"],
operation: [
"getChatUsers",
"addUserToChat",
"deleteUserFromChat",
"getChat",
"setChatOwner",
"setChatTitle",
"setChatAvatar",
"setChatDescription",
"setChatColor",
"setChatBackground",
],
},
},
default: "",
description: "The ID of the chat",
},
{
displayName: "User ID",
name: "userId",
type: "string",
required: true,
displayOptions: {
show: {
resource: ["im"],
operation: ["deleteUserFromChat", "setChatOwner"],
},
},
default: "",
description: "The ID of the user",
},
{
displayName: "New Title",
name: "newTitle",
type: "string",
required: true,
displayOptions: {
show: {
resource: ["im"],
operation: ["setChatTitle"],
},
},
default: "",
description: "The new title for the chat",
},
{
displayName: "Description",
name: "description",
type: "string",
required: true,
displayOptions: {
show: {
resource: ["im"],
operation: ["setChatDescription"],
},
},
default: "",
description: "The new description for the chat",
},
{
displayName: "Color",
name: "color",
type: "string",
required: true,
displayOptions: {
show: {
resource: ["im"],
operation: ["setChatColor"],
},
},
default: "",
description: "The new color for the chat (e.g. #FF0000)",
},
{
displayName: "File ID",
name: "fileId",
type: "string",
required: true,
displayOptions: {
show: {
resource: ["im"],
operation: ["setChatAvatar", "setChatBackground"],
},
},
default: "",
description: "The ID of the file",
},
];
// Fields for message operations
exports.imMessageFields = [
{
displayName: "Dialog ID",
name: "dialogId",
type: "string",
required: true,
displayOptions: {
show: {
resource: ["im"],
operation: [
"addMessage",
"getMessageHistory",
"getUnreadMessages",
"getMessagesByDialog",
"getDialogUsers",
"readDialogMessages",
],
},
},
default: "",
description: "The ID of the dialog or chat",
},
{
displayName: "Message",
name: "message",
type: "string",
required: true,
displayOptions: {
show: {
resource: ["im"],
operation: ["addMessage", "updateMessage"],
},
},
default: "",
typeOptions: {
rows: 4,
},
description: "The message text to send",
},
{
displayName: "Message ID",
name: "messageId",
type: "string",
required: true,
displayOptions: {
show: {
resource: ["im"],
operation: [
"updateMessage",
"deleteMessage",
"likeMessage",
"getMessageById",
],
},
},
default: "",
description: "The ID of the message",
},
{
displayName: "Search Query",
name: "searchQuery",
type: "string",
required: true,
displayOptions: {
show: {
resource: ["im"],
operation: ["searchMessageHistory"],
},
},
default: "",
description: "The search query",
},
{
displayName: "Options",
name: "options",
type: "collection",
placeholder: "Add Option",
default: {},
displayOptions: {
show: {
resource: ["im"],
operation: [
"addMessage",
"updateMessage",
"getMessageHistory",
"getUnreadMessages",
"searchMessageHistory",
],
},
},
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: "System",
name: "system",
type: "boolean",
default: false,
description: "Whether the message is a system message",
},
{
displayName: "Limit",
name: "limit",
type: "number",
default: 50,
description: "Maximum number of messages to return",
},
{
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,
},
},
],
},
];
// Fields for notification operations
exports.imNotificationFields = [
{
displayName: "User ID",
name: "userId",
type: "string",
required: true,
displayOptions: {
show: {
resource: ["im"],
operation: ["sendNotification", "sendSystemMessage"],
},
},
default: "",
description: "The ID of the user to send the notification to",
},
{
displayName: "Message",
name: "message",
type: "string",
required: true,
displayOptions: {
show: {
resource: ["im"],
operation: ["sendNotification", "sendSystemMessage"],
},
},
default: "",
typeOptions: {
rows: 4,
},
description: "The notification message text",
},
{
displayName: "Tag",
name: "tag",
type: "string",
displayOptions: {
show: {
resource: ["im"],
operation: ["sendNotification"],
},
},
default: "",
description: "Tag to categorize the notification",
},
{
displayName: "Custom Parameters",
name: "customParameters",
type: "string",
displayOptions: {
show: {
resource: ["im"],
operation: ["sendNotification", "sendSystemMessage"],
},
},
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,
},
},
];
// Fields for user status operations
exports.imUserStatusFields = [
{
displayName: "User ID",
name: "userId",
type: "string",
displayOptions: {
show: {
resource: ["im"],
operation: ["getUserStatus"],
},
},
default: "",
description: "The ID of the user (leave empty for current user)",
},
{
displayName: "Status",
name: "status",
type: "options",
required: true,
displayOptions: {
show: {
resource: ["im"],
operation: ["setUserStatus"],
},
},
options: [
{
name: "Online",
value: "online",
},
{
name: "Offline",
value: "offline",
},
{
name: "Away",
value: "away",
},
{
name: "Do Not Disturb",
value: "dnd",
},
],
default: "online",
description: "The new status to set",
},
];
// Fields for disk operations
exports.imDiskFields = [
{
displayName: "Chat ID",
name: "chatId",
type: "string",
required: true,
displayOptions: {
show: {
resource: ["im"],
operation: ["uploadFile", "getDiskFolder"],
},
},
default: "",
description: "The ID of the chat",
},
{
displayName: "Binary Property",
name: "binaryPropertyName",
type: "string",
default: "data",
required: true,
displayOptions: {
show: {
resource: ["im"],
operation: ["uploadFile"],
},
},
description: "The name of the binary property which contains the file data",
},
];
//# sourceMappingURL=ImDescription.js.map