n8n-nodes-gohighlevel
Version:
n8n node for GoHighLevel API v2
204 lines (200 loc) • 4.37 kB
text/typescript
import { INodeProperties } from 'n8n-workflow';
const resource = 'company';
export const companyOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: [resource],
},
},
options: [
// Crud operations
{
name: 'Create',
value: 'create',
description: 'Create a company',
action: 'Create a company',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a company',
action: 'Delete a company',
},
{
name: 'Get',
value: 'get',
description: 'Get a company',
action: 'Get a company',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many companies',
action: 'Get many companies',
},
{
name: 'Remove Tag',
value: 'removeTag',
description: 'Remove a tag from a company',
action: 'Remove a tag from a company',
},
{
name: 'Update',
value: 'update',
description: 'Update a company',
action: 'Update a company',
},
],
default: 'create',
},
];
export const companyFields: INodeProperties[] = [
{
displayName: `Company ID`,
name: `companyId`,
type: 'string',
required: true,
displayOptions: {
show: {
resource: [resource],
operation: ['update', 'delete', 'get'],
},
},
default: '',
description: 'The ID of the contact',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [resource],
operation: ['create', 'update'],
},
},
options: [
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
description: 'Name of the contact',
},
{
displayName: 'Description',
name: 'description',
type: 'string',
typeOptions: {
rows: 4,
},
default: '',
description: 'Description of the contact',
},
{
displayName: 'Custom Fields',
name: 'customFields',
placeholder: 'Add Custom Field',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
default: {},
options: [
{
name: 'field',
displayName: 'Field',
values: [
{
displayName: 'Field Name',
name: 'fieldName',
type: 'string',
default: '',
description: 'Name of the custom field',
},
{
displayName: 'Field Value',
name: 'fieldValue',
type: 'string',
default: '',
description: 'Value of the custom field',
},
],
},
],
},
],
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: [resource],
operation: ['create', 'update'],
},
},
},
{
displayName: 'Website',
name: 'website',
type: 'string',
default: '',
displayOptions: {
show: {
resource: [resource],
operation: ['create', 'update'],
},
},
},
{
displayName: 'Industry',
name: 'industry',
type: 'string',
default: '',
displayOptions: {
show: {
resource: [resource],
operation: ['create', 'update'],
},
},
},
{
displayName: 'Description',
name: 'description',
type: 'string',
typeOptions: {
rows: 4,
},
default: '',
displayOptions: {
show: {
resource: [resource],
operation: ['create', 'update'],
},
},
},
{
displayName: 'Tags',
name: 'tags',
type: 'string',
default: '',
displayOptions: {
show: {
resource: [resource],
operation: ['addTag', 'removeTag'],
},
},
description: 'Comma-separated list of tags',
},
];