UNPKG

@tuanltntu/n8n-nodes-bitrix24

Version:

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

241 lines 6.75 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.crmFields = void 0; const ModuleManager_1 = require("../ModuleManager"); // Create isolated fields for CRM operations const operationField = ModuleManager_1.ModuleManager.createSimpleField({ displayName: "Operation", name: "operation", type: "options", noDataExpression: true, required: true, default: "createContact", options: [ { name: "Create Contact", value: "createContact", description: "Create a new contact", action: "Create a contact", }, { name: "Create Deal", value: "createDeal", description: "Create a new deal", action: "Create a deal", }, { name: "Create Lead", value: "createLead", description: "Create a new lead", action: "Create a lead", }, { name: "Create Company", value: "createCompany", description: "Create a new company", action: "Create a company", }, { name: "Delete Contact", value: "deleteContact", description: "Delete a contact", action: "Delete a contact", }, { name: "Delete Deal", value: "deleteDeal", description: "Delete a deal", action: "Delete a deal", }, { name: "Delete Lead", value: "deleteLead", description: "Delete a lead", action: "Delete a lead", }, { name: "Delete Company", value: "deleteCompany", description: "Delete a company", action: "Delete a company", }, { name: "Get Contact", value: "getContact", description: "Get a contact by ID", action: "Get a contact", }, { name: "Get Deal", value: "getDeal", description: "Get a deal by ID", action: "Get a deal", }, { name: "Get Lead", value: "getLead", description: "Get a lead by ID", action: "Get a lead", }, { name: "Get Company", value: "getCompany", description: "Get a company by ID", action: "Get a company", }, { name: "Get All Contacts", value: "getAllContacts", description: "Get all contacts", action: "Get all contacts", }, { name: "Get All Deals", value: "getAllDeals", description: "Get all deals", action: "Get all deals", }, { name: "Get All Leads", value: "getAllLeads", description: "Get all leads", action: "Get all leads", }, { name: "Get All Companies", value: "getAllCompanies", description: "Get all companies", action: "Get all companies", }, { name: "Update Contact", value: "updateContact", description: "Update a contact", action: "Update a contact", }, { name: "Update Deal", value: "updateDeal", description: "Update a deal", action: "Update a deal", }, { name: "Update Lead", value: "updateLead", description: "Update a lead", action: "Update a lead", }, { name: "Update Company", value: "updateCompany", description: "Update a company", action: "Update a company", }, ], }, ModuleManager_1.BITRIX24_MODULES.CRM); const recordIdField = ModuleManager_1.ModuleManager.createSimpleField({ displayName: "Record ID", name: "recordId", type: "string", required: true, default: "", description: "ID of the record to operate on", }, ModuleManager_1.BITRIX24_MODULES.CRM, { operation: [ "deleteContact", "deleteDeal", "deleteLead", "deleteCompany", "getContact", "getDeal", "getLead", "getCompany", "updateContact", "updateDeal", "updateLead", "updateCompany", ], }); const returnAllField = ModuleManager_1.ModuleManager.createSimpleField({ displayName: "Return All", name: "returnAll", type: "boolean", default: false, description: "Whether to return all results or only up to a given limit", }, ModuleManager_1.BITRIX24_MODULES.CRM, { operation: [ "getAllContacts", "getAllDeals", "getAllLeads", "getAllCompanies", ], }); const limitField = ModuleManager_1.ModuleManager.createSimpleField({ displayName: "Limit", name: "limit", type: "number", typeOptions: { minValue: 1, }, default: 50, description: "Max number of results to return", }, ModuleManager_1.BITRIX24_MODULES.CRM, { operation: [ "getAllContacts", "getAllDeals", "getAllLeads", "getAllCompanies", ], returnAll: [false], }); const fieldsField = ModuleManager_1.ModuleManager.createSimpleField({ displayName: "Fields", name: "fields", type: "json", default: "{}", description: "Fields to create/update in JSON format", }, ModuleManager_1.BITRIX24_MODULES.CRM, { operation: [ "createContact", "createDeal", "createLead", "createCompany", "updateContact", "updateDeal", "updateLead", "updateCompany", ], }); // Create isolated collections for additional options const optionsCollection = ModuleManager_1.ModuleManager.createSimpleCollection("Additional Options", ModuleManager_1.BITRIX24_MODULES.CRM, {}, [ { displayName: "Select Fields", name: "select", type: "string", default: "", description: "List of fields to select (comma-separated)", }, { displayName: "Filter", name: "filter", type: "json", default: "{}", description: "Filter criteria in JSON format", }, { displayName: "Order", name: "order", type: "json", default: "{}", description: "Sort order in JSON format", }, ]); exports.crmFields = [ operationField, recordIdField, returnAllField, limitField, fieldsField, optionsCollection, ]; //# sourceMappingURL=CrmDescription.js.map