UNPKG

@tuanltntu/n8n-nodes-bitrix24

Version:

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

196 lines 6.53 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.telephonySipLineFields = exports.telephonyExternalLineFields = exports.telephonyExternalCallFields = exports.telephonyCallFields = exports.telephonyOperationFields = void 0; const ModuleManager_1 = require("../ModuleManager"); // Operation field for telephony const operationField = ModuleManager_1.ModuleManager.createSimpleField({ displayName: "Operation", name: "operation", type: "options", noDataExpression: true, options: [ { name: "Make Call", value: "makeCall", description: "Initiate a new call (telephony.externalcall.register)", action: "Make a call", }, { name: "Get Call Info", value: "getCallInfo", description: "Get information about a call (telephony.call.get)", action: "Get call information", }, { name: "Get Statistics", value: "getStatistics", description: "Get call statistics (telephony.stat.get)", action: "Get call statistics", }, { name: "Register Call", value: "registerCall", description: "Register an external call (telephony.externalcall.register)", action: "Register an external call", }, { name: "Finish Call", value: "finishCall", description: "Finish an active call (telephony.call.finish)", action: "Finish a call", }, ], default: "makeCall", }, ModuleManager_1.BITRIX24_MODULES.TELEPHONY); // Phone number field for make call const phoneNumberCallField = ModuleManager_1.ModuleManager.createSimpleField({ displayName: "Phone Number", name: "phoneNumber", type: "string", required: true, default: "", description: "The phone number to call", }, ModuleManager_1.BITRIX24_MODULES.TELEPHONY, { telephonyResource: ["call"], operation: ["makeCall"], }); // Call ID field const callIdField = ModuleManager_1.ModuleManager.createSimpleField({ displayName: "Call ID", name: "callId", type: "string", required: true, default: "", description: "The ID of the call", }, ModuleManager_1.BITRIX24_MODULES.TELEPHONY, { telephonyResource: ["call"], operation: ["getCallInfo", "finishCall"], }); // User ID field for make call const userIdCallField = ModuleManager_1.ModuleManager.createSimpleField({ displayName: "User ID", name: "userId", type: "string", default: "", description: "The ID of the user who initiates the call. If not specified, the current user will be used.", }, ModuleManager_1.BITRIX24_MODULES.TELEPHONY, { telephonyResource: ["call"], operation: ["makeCall"], }); // Phone number field for external call const phoneNumberExternalField = ModuleManager_1.ModuleManager.createSimpleField({ displayName: "Phone Number", name: "phoneNumber", type: "string", required: true, default: "", description: "The phone number of the caller/callee", }, ModuleManager_1.BITRIX24_MODULES.TELEPHONY, { telephonyResource: ["externalcall"], operation: ["registerCall"], }); // Call type field const callTypeField = ModuleManager_1.ModuleManager.createSimpleField({ displayName: "Call Type", name: "callType", type: "options", required: true, options: [ { name: "Incoming", value: "1" }, { name: "Outgoing", value: "2" }, ], default: "1", description: "The type of the call", }, ModuleManager_1.BITRIX24_MODULES.TELEPHONY, { telephonyResource: ["externalcall"], operation: ["registerCall"], }); // User ID field for external call const userIdExternalField = ModuleManager_1.ModuleManager.createSimpleField({ displayName: "User ID", name: "userId", type: "string", required: true, default: "", description: "The ID of the user associated with the call", }, ModuleManager_1.BITRIX24_MODULES.TELEPHONY, { telephonyResource: ["externalcall"], operation: ["registerCall"], }); // Line number field const lineNumberField = ModuleManager_1.ModuleManager.createSimpleField({ displayName: "Line Number", name: "lineNumber", type: "string", default: "", description: "The external line number", }, ModuleManager_1.BITRIX24_MODULES.TELEPHONY, { telephonyResource: ["externalcall"], operation: ["registerCall"], }); // External line ID field const externalLineIdField = ModuleManager_1.ModuleManager.createSimpleField({ displayName: "External Line ID", name: "lineId", type: "string", required: true, default: "", description: "The ID of the external line", }, ModuleManager_1.BITRIX24_MODULES.TELEPHONY, { telephonyResource: ["externalline"], operation: ["getCallInfo", "getStatistics"], }); // Date from field const dateFromField = ModuleManager_1.ModuleManager.createSimpleField({ displayName: "Date From", name: "dateFrom", type: "dateTime", default: "", description: "The start date for statistics", }, ModuleManager_1.BITRIX24_MODULES.TELEPHONY, { telephonyResource: ["externalline"], operation: ["getStatistics"], }); // Date to field const dateToField = ModuleManager_1.ModuleManager.createSimpleField({ displayName: "Date To", name: "dateTo", type: "dateTime", default: "", description: "The end date for statistics", }, ModuleManager_1.BITRIX24_MODULES.TELEPHONY, { telephonyResource: ["externalline"], operation: ["getStatistics"], }); // SIP line ID field const sipLineIdField = ModuleManager_1.ModuleManager.createSimpleField({ displayName: "SIP Line ID", name: "lineId", type: "string", required: true, default: "", description: "The ID of the SIP line", }, ModuleManager_1.BITRIX24_MODULES.TELEPHONY, { telephonyResource: ["sipline"], operation: ["getCallInfo", "getStatistics"], }); // Export fields using smart organization exports.telephonyOperationFields = [operationField]; exports.telephonyCallFields = [ phoneNumberCallField, callIdField, userIdCallField, ]; exports.telephonyExternalCallFields = [ phoneNumberExternalField, callTypeField, userIdExternalField, lineNumberField, ]; exports.telephonyExternalLineFields = [ externalLineIdField, dateFromField, dateToField, ]; exports.telephonySipLineFields = [sipLineIdField]; //# sourceMappingURL=TelephonyDescription.js.map