n8n-nodes-chat-data
Version:
Chatdata integration for n8n. Manage chatbots, send messages, and retrieve leads from your Chatdata account.
211 lines • 6.27 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.triggerFields = exports.onNewMessageOperation = exports.onLiveChatEscalationOperation = exports.onLeadSubmissionOperation = exports.triggerOperations = exports.triggerResource = void 0;
exports.triggerResource = {
displayName: 'Resource',
name: 'resource',
type: 'hidden',
default: 'trigger',
};
exports.triggerOperations = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['trigger'],
},
},
options: [
{
name: 'On Lead Submission',
value: 'onLeadSubmission',
description: 'Trigger when a lead submission occurs',
action: 'Triggers when a lead submission occurs',
},
{
name: 'On Live Chat Escalation',
value: 'onLiveChatEscalation',
description: 'Trigger when a chat is escalated to a live agent',
action: 'Triggers when a chat is escalated to a live agent',
},
{
name: 'On New Message',
value: 'onNewMessage',
description: 'Trigger when a new chat message is received',
action: 'Triggers when a new chat message is received',
},
],
default: 'onNewMessage',
},
];
exports.onLeadSubmissionOperation = [
{
displayName: 'Chatbot Name or ID',
name: 'chatbot_id',
type: 'options',
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getChatbots',
},
default: '',
required: true,
noDataExpression: true,
displayOptions: {
show: {
resource: ['trigger'],
operation: ['onLeadSubmission'],
},
},
},
{
displayName: 'Webhook',
name: 'webhook',
type: 'hidden',
default: 'default',
displayOptions: {
show: {
resource: ['trigger'],
operation: ['onLeadSubmission'],
},
},
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Options',
default: {},
options: [
{
displayName: 'Enable Webhook Debug',
name: 'webhookDebug',
type: 'boolean',
default: false,
description: 'Whether to turn on additional logging for webhook debugging',
},
],
displayOptions: {
show: {
resource: ['trigger'],
operation: ['onLeadSubmission'],
},
},
},
];
exports.onLiveChatEscalationOperation = [
{
displayName: 'Chatbot Name or ID',
name: 'chatbot_id',
type: 'options',
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getChatbots',
},
default: '',
required: true,
noDataExpression: true,
displayOptions: {
show: {
resource: ['trigger'],
operation: ['onLiveChatEscalation'],
},
},
},
{
displayName: 'Webhook',
name: 'webhook',
type: 'hidden',
default: 'default',
displayOptions: {
show: {
resource: ['trigger'],
operation: ['onLiveChatEscalation'],
},
},
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Options',
default: {},
options: [
{
displayName: 'Enable Webhook Debug',
name: 'webhookDebug',
type: 'boolean',
default: false,
description: 'Whether to turn on additional logging for webhook debugging',
},
],
displayOptions: {
show: {
resource: ['trigger'],
operation: ['onLiveChatEscalation'],
},
},
},
];
exports.onNewMessageOperation = [
{
displayName: 'Chatbot Name or ID',
name: 'chatbot_id',
type: 'options',
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getChatbots',
},
default: '',
required: true,
noDataExpression: true,
displayOptions: {
show: {
resource: ['trigger'],
operation: ['onNewMessage'],
},
},
},
{
displayName: 'Webhook',
name: 'webhook',
type: 'hidden',
default: 'default',
displayOptions: {
show: {
resource: ['trigger'],
operation: ['onNewMessage'],
},
},
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Options',
default: {},
options: [
{
displayName: 'Enable Webhook Debug',
name: 'webhookDebug',
type: 'boolean',
default: false,
description: 'Whether to turn on additional logging for webhook debugging',
},
],
displayOptions: {
show: {
resource: ['trigger'],
operation: ['onNewMessage'],
},
},
},
];
exports.triggerFields = [
...exports.onLeadSubmissionOperation,
...exports.onLiveChatEscalationOperation,
...exports.onNewMessageOperation,
];
//# sourceMappingURL=TriggerDescription.js.map