n8n-nodes-highlevelv2
Version:
n8n community node for HighLevel v2 API integration - comprehensive CRM, marketing automation, and business management platform
641 lines • 18.9 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.taskFields = exports.taskOperations = void 0;
const GenericFunctions_1 = require("../GenericFunctions");
exports.taskOperations = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['task'],
},
},
options: [
{
name: 'Create',
value: 'create',
routing: {
request: {
method: 'POST',
url: '=/contacts/{{$parameter.contactId}}/tasks/',
},
output: {
postReceive: [GenericFunctions_1.taskPostReceiceAction],
},
},
action: 'Create a task',
},
{
name: 'Delete',
value: 'delete',
routing: {
request: {
method: 'DELETE',
url: '=/contacts/{{$parameter.contactId}}/tasks/{{$parameter.taskId}}/',
},
output: {
postReceive: [
{
type: 'set',
properties: {
value: '={{ { "success": true } }}',
},
},
],
},
},
action: 'Delete a task',
},
{
name: 'Get',
value: 'get',
routing: {
request: {
method: 'GET',
url: '=/contacts/{{$parameter.contactId}}/tasks/{{$parameter.taskId}}/',
},
output: {
postReceive: [GenericFunctions_1.taskPostReceiceAction],
},
},
action: 'Get a task',
},
{
name: 'Get Many',
value: 'getAll',
routing: {
request: {
method: 'GET',
url: '=/contacts/{{$parameter.contactId}}/tasks/',
},
output: {
postReceive: [
{
type: 'rootProperty',
properties: {
property: 'tasks',
},
},
GenericFunctions_1.taskPostReceiceAction,
],
},
},
action: 'Get many tasks',
},
{
name: 'Update',
value: 'update',
routing: {
request: {
method: 'PUT',
url: '=/contacts/{{$parameter.contactId}}/tasks/{{$parameter.taskId}}/',
},
send: {
preSend: [GenericFunctions_1.taskUpdatePreSendAction],
},
output: {
postReceive: [GenericFunctions_1.taskPostReceiceAction],
},
},
action: 'Update a task',
},
{
name: 'Search',
value: 'search',
routing: {
request: {
method: 'GET',
url: '/tasks/search',
},
output: {
postReceive: [
{
type: 'rootProperty',
properties: {
property: 'tasks',
},
},
GenericFunctions_1.taskPostReceiceAction,
],
},
},
action: 'Search tasks with filters',
},
],
default: 'create',
},
];
const createProperties = [
{
displayName: 'Contact Email or ID',
name: 'contactId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getContacts',
},
displayOptions: {
show: {
resource: ['task'],
operation: ['create'],
},
},
default: '',
required: true,
description: 'Contact the task belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Title',
name: 'title',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['task'],
operation: ['create'],
},
},
routing: {
send: {
type: 'body',
property: 'title',
},
},
},
{
displayName: 'Due Date',
name: 'dueDate',
type: 'dateTime',
required: true,
default: '',
displayOptions: {
show: {
resource: ['task'],
operation: ['create'],
},
},
routing: {
send: {
type: 'body',
property: 'dueDate',
preSend: [GenericFunctions_1.dueDatePreSendAction],
},
},
},
{
displayName: 'Completed',
name: 'completed',
type: 'boolean',
required: true,
default: false,
displayOptions: {
show: {
resource: ['task'],
operation: ['create'],
},
},
routing: {
send: {
type: 'body',
property: 'completed',
},
},
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['task'],
operation: ['create'],
},
},
options: [
{
displayName: 'Assigned To',
name: 'assignedTo',
type: 'options',
default: '',
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getUsers',
},
routing: {
send: {
type: 'body',
property: 'assignedTo',
},
},
},
{
displayName: 'Body',
name: 'body',
type: 'string',
default: '',
routing: {
send: {
type: 'body',
property: 'body',
},
},
},
],
},
];
const deleteProperties = [
{
displayName: 'Contact Email or ID',
name: 'contactId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getContacts',
},
displayOptions: {
show: {
resource: ['task'],
operation: ['delete'],
},
},
default: '',
required: true,
description: 'Contact the task belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Task ID',
name: 'taskId',
type: 'string',
required: true,
displayOptions: {
show: {
resource: ['task'],
operation: ['delete'],
},
},
default: '',
},
];
const getProperties = [
{
displayName: 'Contact Email or ID',
name: 'contactId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getContacts',
},
displayOptions: {
show: {
resource: ['task'],
operation: ['get'],
},
},
default: '',
required: true,
description: 'Contact the task belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Task ID',
name: 'taskId',
type: 'string',
required: true,
displayOptions: {
show: {
resource: ['task'],
operation: ['get'],
},
},
default: '',
},
];
const getAllProperties = [
{
displayName: 'Contact Email or ID',
name: 'contactId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getContacts',
},
displayOptions: {
show: {
resource: ['task'],
operation: ['getAll'],
},
},
default: '',
required: true,
description: 'Contact the task belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: ['task'],
operation: ['getAll'],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: ['task'],
operation: ['getAll'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
},
default: 50,
routing: {
send: {
type: 'query',
property: 'limit',
},
},
description: 'Max number of results to return',
},
];
const updateProperties = [
{
displayName: 'Contact Email or ID',
name: 'contactId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getContacts',
},
displayOptions: {
show: {
resource: ['task'],
operation: ['update'],
},
},
default: '',
required: true,
description: 'Contact the task belongs to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Task ID',
name: 'taskId',
type: 'string',
displayOptions: {
show: {
resource: ['task'],
operation: ['update'],
},
},
default: '',
required: true,
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['task'],
operation: ['update'],
},
},
options: [
{
displayName: 'Assigned To',
name: 'assignedTo',
type: 'options',
default: '',
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getUsers',
},
routing: {
send: {
type: 'body',
property: 'assignedTo',
},
},
},
{
displayName: 'Completed',
name: 'completed',
type: 'boolean',
default: false,
routing: {
send: {
type: 'body',
property: 'completed',
},
},
},
{
displayName: 'Body',
name: 'body',
type: 'string',
default: '',
routing: {
send: {
type: 'body',
property: 'body',
},
},
},
{
displayName: 'Due Date',
name: 'dueDate',
type: 'dateTime',
default: '',
routing: {
send: {
type: 'body',
property: 'dueDate',
preSend: [GenericFunctions_1.dueDatePreSendAction],
},
},
},
{
displayName: 'Title',
name: 'title',
type: 'string',
default: '',
routing: {
send: {
type: 'body',
property: 'title',
},
},
},
],
},
];
const searchProperties = [
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['task'],
operation: ['search'],
},
},
options: [
{
displayName: 'Location ID',
name: 'locationId',
type: 'string',
default: '',
description: 'Filter tasks by location ID',
routing: {
send: {
type: 'query',
property: 'locationId',
},
},
},
{
displayName: 'Contact ID',
name: 'contactId',
type: 'string',
default: '',
description: 'Filter tasks by contact ID',
routing: {
send: {
type: 'query',
property: 'contactId',
},
},
},
{
displayName: 'Assigned To',
name: 'assignedTo',
type: 'string',
default: '',
description: 'Filter tasks by assigned user ID',
routing: {
send: {
type: 'query',
property: 'assignedTo',
},
},
},
{
displayName: 'Status',
name: 'status',
type: 'options',
default: '',
description: 'Filter tasks by completion status',
options: [
{
name: 'All',
value: '',
},
{
name: 'Completed',
value: 'completed',
},
{
name: 'Pending',
value: 'pending',
},
],
routing: {
send: {
type: 'query',
property: 'status',
},
},
},
{
displayName: 'Due Date From',
name: 'dueDateFrom',
type: 'dateTime',
default: '',
description: 'Filter tasks with due date from this date',
routing: {
send: {
type: 'query',
property: 'dueDateFrom',
},
},
},
{
displayName: 'Due Date To',
name: 'dueDateTo',
type: 'dateTime',
default: '',
description: 'Filter tasks with due date up to this date',
routing: {
send: {
type: 'query',
property: 'dueDateTo',
},
},
},
{
displayName: 'Search Query',
name: 'query',
type: 'string',
default: '',
description: 'Search tasks by title or content',
routing: {
send: {
type: 'query',
property: 'query',
},
},
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
typeOptions: {
minValue: 1,
},
default: 50,
description: 'Max number of results to return',
routing: {
send: {
type: 'query',
property: 'limit',
},
},
},
{
displayName: 'Offset',
name: 'offset',
type: 'number',
default: 0,
description: 'Number of tasks to skip',
routing: {
send: {
type: 'query',
property: 'offset',
},
},
},
],
},
];
exports.taskFields = [
...createProperties,
...updateProperties,
...deleteProperties,
...getProperties,
...getAllProperties,
...searchProperties,
];
//# sourceMappingURL=TaskDescription.js.map