n8n-nodes-gohighlevel
Version:
n8n node for GoHighLevel API v2
436 lines • 13.7 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.opportunityFields = exports.opportunityOperations = void 0;
const resource = 'opportunity';
var EOpportunityOperation;
(function (EOpportunityOperation) {
EOpportunityOperation["CREATE"] = "create";
EOpportunityOperation["DELETE"] = "delete";
EOpportunityOperation["FIND_OR_CREATE"] = "findOrCreate";
EOpportunityOperation["GET"] = "get";
EOpportunityOperation["GET_ALL"] = "getAll";
EOpportunityOperation["UPDATE"] = "update";
EOpportunityOperation["UPDATE_OR_CREATE"] = "updateOrCreate";
EOpportunityOperation["UPDATE_STATUS"] = "updateStatus";
EOpportunityOperation["UPDATE_STAGE"] = "updateStage";
})(EOpportunityOperation || (EOpportunityOperation = {}));
exports.opportunityOperations = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['opportunity'],
},
},
options: [
{
name: 'Create',
value: EOpportunityOperation.CREATE,
description: 'Create an opportunity',
action: 'Create an opportunity',
},
{
name: 'Delete',
value: EOpportunityOperation.DELETE,
description: 'Delete an opportunity',
action: 'Delete an opportunity',
},
{
name: 'Find or Create',
value: EOpportunityOperation.FIND_OR_CREATE,
description: 'Find or create an opportunity',
action: 'Find or create an opportunity',
},
{
name: 'Get',
value: EOpportunityOperation.GET,
description: 'Get an opportunity',
action: 'Get an opportunity',
},
{
name: 'Get Many',
value: EOpportunityOperation.GET_ALL,
description: 'Get many opportunities',
action: 'Get many opportunities',
},
{
name: 'Update',
value: EOpportunityOperation.UPDATE,
description: 'Update an opportunity',
action: 'Update an opportunity',
},
{
name: 'Update or Create',
value: EOpportunityOperation.UPDATE_OR_CREATE,
description: 'Update or create an opportunity',
action: 'Update or create an opportunity',
},
{
name: 'Update Stage',
value: EOpportunityOperation.UPDATE_STAGE,
description: 'Move opportunity to a different stage',
action: 'Move opportunity to a different stage',
},
{
name: 'Update Status',
value: EOpportunityOperation.UPDATE_STATUS,
description: 'Update opportunity status',
action: 'Update opportunity status',
},
],
default: 'getAll',
},
];
exports.opportunityFields = [
{
displayName: 'Opportunity ID',
name: 'opportunityId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: [resource],
operation: ['get', 'update', 'delete', 'updateStage', 'updateStatus'],
},
},
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: [resource],
operation: ['create'],
},
},
},
{
displayName: 'Pipeline ID',
name: 'pipelineId',
type: 'string',
default: '',
displayOptions: {
show: {
resource: [resource],
operation: ['create'],
},
},
},
{
displayName: 'Pipeline Stage ID',
name: 'pipelineStageId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: [resource],
operation: ['create', 'updateStage'],
},
},
},
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{
name: 'Open',
value: 'open',
},
{
name: 'Won',
value: 'won',
},
{
name: 'Lost',
value: 'lost',
},
],
default: 'open',
displayOptions: {
show: {
resource: [resource],
operation: ['create', 'updateStatus'],
},
},
},
{
displayName: 'Contact ID',
name: 'contactId',
type: 'string',
default: '',
displayOptions: {
show: {
resource: [resource],
operation: [EOpportunityOperation.CREATE, EOpportunityOperation.UPDATE_OR_CREATE, EOpportunityOperation.FIND_OR_CREATE],
},
},
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
typeOptions: {
minValue: 1,
},
default: 50,
description: 'Max number of results to return',
displayOptions: {
show: {
resource: [resource],
operation: ['getAll'],
},
},
},
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
default: false,
description: 'Whether to return all results or only up to a given limit',
displayOptions: {
show: {
resource: [resource],
operation: ['getAll'],
},
},
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: ['opportunity'],
operation: ['getAll'],
},
},
options: [
{
displayName: 'Assigned To',
name: 'assigned_to',
type: 'string',
default: '',
description: 'Filter by assigned user ID',
},
{
displayName: 'Campaign ID',
name: 'campaignId',
type: 'string',
default: '',
description: 'Filter by campaign ID',
},
{
displayName: 'Contact ID',
name: 'contact_id',
type: 'string',
default: '',
description: 'Filter by contact ID',
},
{
displayName: 'Country',
name: 'country',
type: 'string',
default: '',
},
{
displayName: 'End Date',
name: 'endDate',
type: 'string',
default: '',
description: 'Format: mm-dd-yyyy',
},
{
displayName: 'Include Calendar Events',
name: 'getCalendarEvents',
type: 'boolean',
default: false,
description: 'Whether to include calendar events in contact',
},
{
displayName: 'Include Notes',
name: 'getNotes',
type: 'boolean',
default: false,
description: 'Whether to include notes in contact',
},
{
displayName: 'Include Tasks',
name: 'getTasks',
type: 'boolean',
default: false,
description: 'Whether to include tasks in contact',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
typeOptions: {
minValue: 1,
},
default: 50,
description: 'Max number of results to return',
},
{
displayName: 'Page',
name: 'page',
type: 'number',
default: 1,
},
{
displayName: 'Pipeline ID',
name: 'pipeline_id',
type: 'string',
default: '',
},
{
displayName: 'Pipeline Stage ID',
name: 'pipeline_stage_id',
type: 'string',
default: '',
},
{
displayName: 'Search Query',
name: 'q',
type: 'string',
default: '',
description: 'Search term (e.g., email, name)',
},
{
displayName: 'Start Date',
name: 'date',
type: 'string',
default: '',
description: 'Format: mm-dd-yyyy',
},
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{
name: 'Abandoned',
value: 'abandoned',
},
{
name: 'All',
value: 'all',
},
{
name: 'Lost',
value: 'lost',
},
{
name: 'Open',
value: 'open',
},
{
name: 'Won',
value: 'won',
},
],
default: 'all',
},
],
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['opportunity'],
operation: [
EOpportunityOperation.CREATE,
EOpportunityOperation.UPDATE,
EOpportunityOperation.UPDATE_OR_CREATE,
EOpportunityOperation.FIND_OR_CREATE
],
},
},
options: [
{
displayName: 'Contact ID',
name: 'contactId',
type: 'string',
default: '',
},
{
displayName: 'Custom Fields',
name: 'customFields',
placeholder: 'Add Custom Field',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
default: {},
options: [
{
name: 'values',
displayName: 'Values',
values: [
{
displayName: 'Field Name or ID',
name: 'id',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getOpportunityCustomFields',
},
default: '',
description: 'Name or ID of the custom field. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Field Value',
name: 'field_value',
type: 'string',
default: '',
description: 'Value of the custom field',
},
],
},
],
},
{
displayName: 'Monetary Value',
name: 'monetaryValue',
type: 'number',
default: 0,
description: 'Monetary value of the opportunity',
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
description: 'Name of the opportunity',
},
{
displayName: 'Pipeline ID',
name: 'pipelineId',
type: 'string',
default: '',
description: 'ID of the pipeline this opportunity belongs to',
},
{
displayName: 'Pipeline Stage ID',
name: 'pipelineStageId',
type: 'string',
default: '',
description: 'ID of the pipeline stage this opportunity is in',
},
],
},
];
//# sourceMappingURL=opportunity.operations.js.map