n8n-nodes-close-crm
Version:
N8N community node for Close CRM integration with comprehensive lead, opportunity, task, note, call management, and enhanced triggers for workflow automation
449 lines (448 loc) • 14.1 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.opportunityFields = exports.opportunityOperations = void 0;
exports.opportunityOperations = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['opportunity'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a new opportunity',
action: 'Create an opportunity',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete an opportunity',
action: 'Delete an opportunity',
},
{
name: 'Find',
value: 'find',
description: 'Find opportunities',
action: 'Find opportunities',
},
{
name: 'Update',
value: 'update',
description: 'Update an opportunity',
action: 'Update an opportunity',
},
],
default: 'find',
},
];
exports.opportunityFields = [
// Fields for Create operation
{
displayName: 'Lead ID',
name: 'leadId',
type: 'string',
displayOptions: {
show: {
resource: ['opportunity'],
operation: ['create'],
},
},
default: '',
required: true,
description: 'The ID of the lead to create the opportunity for',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['opportunity'],
operation: ['create'],
},
},
options: [
{
displayName: 'Status Name ',
name: 'statusId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getOpportunityStatuses',
},
default: '',
description: 'The status of the opportunity. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
},
{
displayName: 'Assigned to User',
name: 'assignedTo',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getUsers',
},
default: '',
description: 'The user assigned to this opportunity. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
},
{
displayName: 'Confidence',
name: 'confidence',
type: 'number',
default: 0,
description: 'The confidence percentage for this opportunity (0-100)',
typeOptions: {
minValue: 0,
maxValue: 100,
},
},
{
displayName: 'Value',
name: 'value',
type: 'number',
default: 0,
description: 'The value of the opportunity in cents',
},
{
displayName: 'Value Period',
name: 'valuePeriod',
type: 'options',
options: [
{
name: 'One Time',
value: 'one_time',
description: 'One-time value',
},
{
name: 'Monthly',
value: 'monthly',
description: 'Monthly recurring value',
},
{
name: 'Annual',
value: 'annual',
description: 'Annual recurring value',
},
],
default: 'one_time',
description: 'The period for the opportunity value',
},
{
displayName: 'Close Date',
name: 'closeDate',
type: 'dateTime',
default: '',
description: 'The expected close date for this opportunity',
},
{
displayName: 'Note',
name: 'note',
type: 'string',
default: '',
description: 'Note about the opportunity',
},
],
},
// Fields for Delete operation
{
displayName: 'Opportunity ID',
name: 'opportunityId',
type: 'string',
displayOptions: {
show: {
resource: ['opportunity'],
operation: ['delete'],
},
},
default: '',
required: true,
description: 'The ID of the opportunity to delete',
},
// Fields for Find operation
{
displayName: 'Opportunity ID',
name: 'opportunityId',
type: 'string',
displayOptions: {
show: {
resource: ['opportunity'],
operation: ['find'],
},
},
default: '',
description: 'Find a specific opportunity by ID',
},
{
displayName: 'Lead ID',
name: 'leadId',
type: 'string',
displayOptions: {
show: {
resource: ['opportunity'],
operation: ['find'],
},
},
default: '',
description: 'Filter opportunities by lead ID',
},
{
displayName: 'Status Name ',
name: 'statusId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getOpportunityStatuses',
},
displayOptions: {
show: {
resource: ['opportunity'],
operation: ['find'],
},
},
default: '',
description: 'Filter opportunities by status. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
},
{
displayName: 'Status Type',
name: 'statusType',
type: 'options',
options: [
{
name: 'Active',
value: 'active',
description: 'Active opportunities',
},
{
name: 'Lost',
value: 'lost',
description: 'Lost opportunities',
},
{
name: 'Won',
value: 'won',
description: 'Won opportunities',
},
],
displayOptions: {
show: {
resource: ['opportunity'],
operation: ['find'],
},
},
default: '',
description: 'Filter opportunities by status type',
},
{
displayName: 'Assigned to User',
name: 'assignedTo',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getUsers',
},
displayOptions: {
show: {
resource: ['opportunity'],
operation: ['find'],
},
},
default: '',
description: 'Filter by user assigned to opportunities. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
},
{
displayName: 'Additional Filters',
name: 'additionalFilters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: ['opportunity'],
operation: ['find'],
},
},
options: [
{
displayName: 'Confidence',
name: 'confidence',
type: 'number',
default: '',
description: 'Filter by confidence percentage (0-100)',
typeOptions: {
minValue: 0,
maxValue: 100,
},
},
{
displayName: 'Value Period',
name: 'valuePeriod',
type: 'options',
options: [
{
name: 'One Time',
value: 'one_time',
description: 'One-time value',
},
{
name: 'Monthly',
value: 'monthly',
description: 'Monthly recurring value',
},
{
name: 'Annual',
value: 'annual',
description: 'Annual recurring value',
},
],
default: '',
description: 'Filter by value period',
},
{
displayName: 'Close Date',
name: 'closeDate',
type: 'dateTime',
default: '',
description: 'Filter by close date',
},
],
},
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: ['opportunity'],
operation: ['find'],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: ['opportunity'],
operation: ['find'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
},
default: 50,
description: 'Max number of results to return',
},
// Fields for Update operation
{
displayName: 'Opportunity ID',
name: 'opportunityId',
type: 'string',
displayOptions: {
show: {
resource: ['opportunity'],
operation: ['update'],
},
},
default: '',
required: true,
description: 'The ID of the opportunity to update',
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['opportunity'],
operation: ['update'],
},
},
options: [
{
displayName: 'Status Name ',
name: 'statusId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getOpportunityStatuses',
},
default: '',
description: 'The status of the opportunity. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
},
{
displayName: 'Assigned to User',
name: 'assignedTo',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getUsers',
},
default: '',
description: 'The user assigned to this opportunity. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
},
{
displayName: 'Confidence',
name: 'confidence',
type: 'number',
default: 0,
description: 'The confidence percentage for this opportunity (0-100)',
typeOptions: {
minValue: 0,
maxValue: 100,
},
},
{
displayName: 'Value',
name: 'value',
type: 'number',
default: 0,
description: 'The value of the opportunity in cents',
},
{
displayName: 'Value Period',
name: 'valuePeriod',
type: 'options',
options: [
{
name: 'One Time',
value: 'one_time',
description: 'One-time value',
},
{
name: 'Monthly',
value: 'monthly',
description: 'Monthly recurring value',
},
{
name: 'Annual',
value: 'annual',
description: 'Annual recurring value',
},
],
default: 'one_time',
description: 'The period for the opportunity value',
},
{
displayName: 'Close Date',
name: 'closeDate',
type: 'dateTime',
default: '',
description: 'The expected close date for this opportunity',
},
{
displayName: 'Note',
name: 'note',
type: 'string',
default: '',
description: 'Note about the opportunity',
},
],
},
];