@tuanltntu/n8n-nodes-bitrix24
Version:
Comprehensive n8n community node for Bitrix24 API integration with CRM, Tasks, Chat, Telephony, and more
516 lines • 17.1 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.timelineFields = exports.timelineOptionFields = exports.timelineOperations = exports.timelineOperationFields = void 0;
exports.timelineOperationFields = [
{
displayName: "Operation",
name: "operation",
type: "options",
noDataExpression: true,
displayOptions: {
show: {},
hide: {},
},
options: [
// Comment operations
{
name: "Get Comments",
value: "getComments",
description: "Get timeline comments (crm.timeline.comment.list)",
action: "Get timeline comments",
hint: "Requires 'crm' scope permission. Access may be restricted by your Bitrix24 plan.",
},
{
name: "Get Comment",
value: "getComment",
description: "Get a specific timeline comment (crm.timeline.comment.get)",
action: "Get a specific timeline comment",
hint: "Requires 'crm' scope permission. Access may be restricted by your Bitrix24 plan.",
},
{
name: "Add Comment",
value: "addComment",
description: "Add comment to timeline (crm.timeline.comment.add)",
action: "Add comment to timeline",
hint: "Requires 'crm' scope permission. Access may be restricted by your Bitrix24 plan.",
},
{
name: "Update Comment",
value: "updateComment",
description: "Update timeline comment (crm.timeline.comment.update)",
action: "Update timeline comment",
hint: "Requires 'crm' scope permission. Access may be restricted by your Bitrix24 plan.",
},
{
name: "Delete Comment",
value: "deleteComment",
description: "Delete timeline comment (crm.timeline.comment.delete)",
action: "Delete timeline comment",
hint: "Requires 'crm' scope permission. Access may be restricted by your Bitrix24 plan.",
},
{
name: "Get Comment Fields",
value: "getCommentFields",
description: "Get timeline comment fields (crm.timeline.comment.fields)",
action: "Get timeline comment fields",
hint: "Requires 'crm' scope permission. Access may be restricted by your Bitrix24 plan.",
},
// Note operations
{
name: "Get Note",
value: "getNote",
description: "Get a timeline note (crm.timeline.note.get)",
action: "Get a timeline note",
},
{
name: "Save Note",
value: "saveNote",
description: "Save a timeline note (crm.timeline.note.save)",
action: "Save a timeline note",
},
{
name: "Delete Note",
value: "deleteNote",
description: "Delete a timeline note (crm.timeline.note.delete)",
action: "Delete a timeline note",
},
// Bindings operations
{
name: "Bind",
value: "bind",
description: "Bind entity to timeline (crm.timeline.bindings.bind)",
action: "Bind entity to timeline",
},
{
name: "Get Bindings",
value: "getBindings",
description: "Get timeline bindings (crm.timeline.bindings.list)",
action: "Get timeline bindings",
},
{
name: "Unbind",
value: "unbind",
description: "Unbind entity from timeline (crm.timeline.bindings.unbind)",
action: "Unbind entity from timeline",
},
{
name: "Get Bindings Fields",
value: "getBindingsFields",
description: "Get timeline bindings fields (crm.timeline.bindings.fields)",
action: "Get timeline bindings fields",
},
// Layout blocks operations
{
name: "Set Layout Blocks",
value: "setLayoutBlocks",
description: "Set layout blocks for timeline (crm.timeline.layout.blocks.set)",
action: "Set layout blocks for timeline",
},
{
name: "Get Layout Blocks",
value: "getLayoutBlocks",
description: "Get layout blocks for timeline (crm.timeline.layout.blocks.get)",
action: "Get layout blocks for timeline",
},
{
name: "Delete Layout Blocks",
value: "deleteLayoutBlocks",
description: "Delete layout blocks from timeline (crm.timeline.layout.blocks.delete)",
action: "Delete layout blocks from timeline",
},
// Log message operations
{
name: "Add Log Message",
value: "addLogMessage",
description: "Add log message to timeline (crm.timeline.logmessage.add)",
action: "Add log message to timeline",
},
{
name: "Get Log Message",
value: "getLogMessage",
description: "Get a log message from timeline (crm.timeline.logmessage.get)",
action: "Get a log message from timeline",
},
{
name: "Get Log Messages",
value: "getLogMessages",
description: "Get log messages from timeline (crm.timeline.logmessage.list)",
action: "Get log messages from timeline",
},
{
name: "Delete Log Message",
value: "deleteLogMessage",
description: "Delete log message from timeline (crm.timeline.logmessage.delete)",
action: "Delete log message from timeline",
},
],
default: "getComments",
},
];
exports.timelineOperations = [
// Add option to use direct comment ID for getComments
{
displayName: "Query Mode",
name: "useDirectId",
type: "boolean",
required: true,
default: false,
displayOptions: {
show: {
operation: ["getComments"],
},
},
description: "Whether to query by direct Comment ID or Entity reference",
},
// Direct Comment ID for getComments
{
displayName: "Comment ID",
name: "commentId",
type: "string",
required: true,
default: "",
displayOptions: {
show: {
operation: ["getComments"],
useDirectId: [true],
},
},
description: "ID of the comment to retrieve",
},
// Entity Type ID for getComments and other operations
{
displayName: "Entity Type ID",
name: "entityTypeId",
type: "options",
required: true,
displayOptions: {
show: {
operation: ["getComments", "getLogMessages", "getTimeline"],
useDirectId: [false],
},
},
options: [
{ name: "Lead", value: "1" },
{ name: "Deal", value: "2" },
{ name: "Contact", value: "3" },
{ name: "Company", value: "4" },
{ name: "Quote", value: "7" },
{ name: "Smart Process", value: "31" },
{ name: "Invoice", value: "45" },
],
default: "2",
description: "Type of the entity to get comments for (deal, lead, etc.)",
},
// Entity ID for getComments and other operations
{
displayName: "Entity ID",
name: "entityId",
type: "string",
required: true,
default: "",
displayOptions: {
show: {
operation: ["getComments", "getLogMessages", "getTimeline"],
useDirectId: [false],
},
},
description: "ID of the entity to get comments for",
},
// Entity ID for getLogMessages operation (optional)
{
displayName: "Entity ID",
name: "entityId",
type: "string",
required: false,
displayOptions: {
show: {
operation: ["getLogMessages"],
},
},
default: "",
description: "ID of the entity. If not provided, will retrieve log messages for all entities of the specified type.",
},
// Fields for add/update comment operations
{
displayName: "Comment",
name: "comment",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["addComment", "updateComment"],
},
},
default: "",
description: "Text of the comment",
},
// Fields for bind/unbind operations
{
displayName: "Target Entity Type ID",
name: "targetEntityTypeId",
type: "options",
required: true,
displayOptions: {
show: {
operation: ["bind", "unbind"],
},
},
options: [
{ name: "Lead", value: "1" },
{ name: "Deal", value: "2" },
{ name: "Contact", value: "3" },
{ name: "Company", value: "4" },
{ name: "Quote", value: "7" },
{ name: "Invoice", value: "31" },
{ name: "Smart Process", value: "45" },
],
default: "2",
description: "Type of the target entity",
},
{
displayName: "Target Entity ID",
name: "targetEntityId",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["bind", "unbind"],
},
},
default: "",
description: "ID of the target entity",
},
// Fields for notes
{
displayName: "Note ID",
name: "noteId",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["getNote", "deleteNote"],
},
},
default: "",
description: "ID of the note to retrieve/delete",
},
// Add field for getComment operation
{
displayName: "Comment ID",
name: "commentId",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["getComment", "updateComment", "deleteComment"],
},
},
default: "",
description: "ID of the comment to retrieve/update/delete",
},
// Fields for log messages
{
displayName: "Log Message ID",
name: "logMessageId",
type: "string",
required: true,
displayOptions: {
show: {
operation: ["getLogMessage", "deleteLogMessage"],
},
},
default: "",
description: "ID of the log message to retrieve/delete",
},
// Add note fields for saveNote operation
{
displayName: "Content",
name: "COMMENT",
type: "string",
typeOptions: {
rows: 4,
},
required: true,
displayOptions: {
show: {
operation: ["saveNote"],
},
},
default: "",
description: "Text content of the note",
},
// Additional note fields
{
displayName: "Additional Fields",
name: "noteFields",
type: "collection",
placeholder: "Add Field",
default: {},
displayOptions: {
show: {
operation: ["saveNote"],
},
},
options: [
{
displayName: "Title",
name: "TITLE",
type: "string",
default: "",
description: "Title of the note",
},
{
displayName: "Author ID",
name: "AUTHOR_ID",
type: "string",
default: "",
description: "ID of the note author. If not specified, current user is used",
},
],
},
// Layout Blocks fields
{
displayName: "Blocks",
name: "blocks",
type: "json",
required: true,
displayOptions: {
show: {
operation: ["setLayoutBlocks"],
},
},
default: "[]",
description: "Layout blocks in JSON format",
},
// Log Message fields
{
displayName: "Message Text",
name: "messageText",
type: "string",
required: true,
typeOptions: {
rows: 4,
},
displayOptions: {
show: {
operation: ["addLogMessage"],
},
},
default: "",
description: "Text of the log message",
},
{
displayName: "Additional Fields",
name: "additionalFields",
type: "collection",
placeholder: "Add Field",
default: {},
options: [
{
displayName: "Title",
name: "title",
type: "string",
default: "",
description: "Title of the log message",
},
{
displayName: "Author ID",
name: "authorId",
type: "string",
default: "",
description: "ID of the log message author. If not specified, current user is used",
},
],
},
// Options for getLogMessages operation
{
displayName: "Options",
name: "logMessagesOptions",
type: "collection",
placeholder: "Add Option",
default: {},
options: [
{
displayName: "Filter",
name: "filter",
type: "json",
default: "{}",
description: "Filter for log messages",
placeholder: '{\n "CREATED": "2023-01-01T00:00:00+03:00"\n}',
},
{
displayName: "Order",
name: "order",
type: "options",
options: [
{ name: "Ascending by Date", value: "ASC" },
{ name: "Descending by Date", value: "DESC" },
],
default: "DESC",
description: "Order of the log messages",
},
],
},
];
exports.timelineOptionFields = [
{
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: "Select",
name: "select",
type: "string",
default: "",
placeholder: "ID,COMMENT,AUTHOR_ID",
description: "Comma-separated list of fields to return in the response",
},
{
displayName: "Order",
name: "order",
type: "options",
options: [
{
name: "Ascending",
value: "asc",
},
{
name: "Descending",
value: "desc",
},
],
default: "desc",
description: "Order of timeline items",
},
{
displayName: "Custom Parameters",
name: "rawParameters",
type: "string",
default: "",
typeOptions: {
rows: 4,
},
placeholder: '{"FILTER": {"AUTHOR_ID": 1}}',
description: "Additional parameters to send directly to the API endpoint as JSON",
},
],
},
];
// Export all fields for timeline resource
exports.timelineFields = [
...exports.timelineOperationFields,
...exports.timelineOperations,
...exports.timelineOptionFields,
];
//# sourceMappingURL=TimelineDescription.js.map