From 0c3a191859d3aaec7914902a40b2e4486ce78ec3 Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Wed, 24 Mar 2021 18:01:12 -0400 Subject: [PATCH] :zap: Add resources Task Tag, Space Tag & Task List to ClickUp Node (#1539) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * :zap: Add resources Task Tag and Space Tag to ClickUp Node * :zap: Add Task List resource * :zap: Fix spaceTag:update * :zap: Fix icon and formatting Co-authored-by: Iván Ovejero Co-authored-by: Jan Oberhauser --- .../nodes/ClickUp/ChecklistDescription.ts | 20 +- .../nodes/ClickUp/ChecklistItemDescription.ts | 22 +- .../nodes-base/nodes/ClickUp/ClickUp.node.ts | 121 ++++++++++- .../nodes/ClickUp/ClickUpTrigger.node.ts | 16 +- .../nodes/ClickUp/CommentDescription.ts | 29 +-- .../nodes/ClickUp/FolderDescription.ts | 36 ++-- .../nodes/ClickUp/GenericFunctions.ts | 10 +- .../nodes/ClickUp/GoalDescription.ts | 36 ++-- .../nodes/ClickUp/GoalKeyResultDescription.ts | 22 +- .../nodes/ClickUp/GuestDescription.ts | 29 +-- .../nodes/ClickUp/ListDescription.ts | 49 +++-- .../nodes/ClickUp/SpaceTagDescription.ts | 204 ++++++++++++++++++ .../ClickUp/TaskDependencyDescription.ts | 15 +- .../nodes/ClickUp/TaskDescription.ts | 50 +++-- .../nodes/ClickUp/TaskListDescription.ts | 74 +++++++ .../nodes/ClickUp/TaskTagDescription.ts | 111 ++++++++++ .../nodes/ClickUp/TimeEntryTagDescription.ts | 24 ++- packages/nodes-base/nodes/ClickUp/clickup.png | Bin 1788 -> 0 bytes packages/nodes-base/nodes/ClickUp/clickup.svg | 1 + 19 files changed, 706 insertions(+), 163 deletions(-) create mode 100644 packages/nodes-base/nodes/ClickUp/SpaceTagDescription.ts create mode 100644 packages/nodes-base/nodes/ClickUp/TaskListDescription.ts create mode 100644 packages/nodes-base/nodes/ClickUp/TaskTagDescription.ts delete mode 100644 packages/nodes-base/nodes/ClickUp/clickup.png create mode 100644 packages/nodes-base/nodes/ClickUp/clickup.svg diff --git a/packages/nodes-base/nodes/ClickUp/ChecklistDescription.ts b/packages/nodes-base/nodes/ClickUp/ChecklistDescription.ts index 517d2946b5..c4c40a4885 100644 --- a/packages/nodes-base/nodes/ClickUp/ChecklistDescription.ts +++ b/packages/nodes-base/nodes/ClickUp/ChecklistDescription.ts @@ -1,6 +1,6 @@ import { INodeProperties, - } from 'n8n-workflow'; +} from 'n8n-workflow'; export const checklistOperations = [ { @@ -38,9 +38,9 @@ export const checklistOperations = [ export const checklistFields = [ -/* -------------------------------------------------------------------------- */ -/* checklist:create */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* checklist:create */ + /* -------------------------------------------------------------------------- */ { displayName: 'Task ID', name: 'task', @@ -75,9 +75,9 @@ export const checklistFields = [ }, required: true, }, -/* -------------------------------------------------------------------------- */ -/* checklist:delete */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* checklist:delete */ + /* -------------------------------------------------------------------------- */ { displayName: 'Checklist ID', name: 'checklist', @@ -95,9 +95,9 @@ export const checklistFields = [ }, required: true, }, -/* -------------------------------------------------------------------------- */ -/* checklist:update */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* checklist:update */ + /* -------------------------------------------------------------------------- */ { displayName: 'Checklist ID', name: 'checklist', diff --git a/packages/nodes-base/nodes/ClickUp/ChecklistItemDescription.ts b/packages/nodes-base/nodes/ClickUp/ChecklistItemDescription.ts index e15fb52919..83704a947a 100644 --- a/packages/nodes-base/nodes/ClickUp/ChecklistItemDescription.ts +++ b/packages/nodes-base/nodes/ClickUp/ChecklistItemDescription.ts @@ -1,6 +1,6 @@ import { INodeProperties, - } from 'n8n-workflow'; +} from 'n8n-workflow'; export const checklistItemOperations = [ { @@ -38,9 +38,9 @@ export const checklistItemOperations = [ export const checklistItemFields = [ -/* -------------------------------------------------------------------------- */ -/* checklistItem:create */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* checklistItem:create */ + /* -------------------------------------------------------------------------- */ { displayName: 'Checklist ID', name: 'checklist', @@ -100,9 +100,10 @@ export const checklistItemFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* checklistItem:delete */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* checklistItem:delete */ + /* -------------------------------------------------------------------------- */ { displayName: 'Checklist ID', name: 'checklist', @@ -137,9 +138,10 @@ export const checklistItemFields = [ }, required: true, }, -/* -------------------------------------------------------------------------- */ -/* checklistItem:update */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* checklistItem:update */ + /* -------------------------------------------------------------------------- */ { displayName: 'Checklist ID', name: 'checklist', diff --git a/packages/nodes-base/nodes/ClickUp/ClickUp.node.ts b/packages/nodes-base/nodes/ClickUp/ClickUp.node.ts index 6be02f5230..14628f6c5d 100644 --- a/packages/nodes-base/nodes/ClickUp/ClickUp.node.ts +++ b/packages/nodes-base/nodes/ClickUp/ClickUp.node.ts @@ -57,6 +57,21 @@ import { taskOperations, } from './TaskDescription'; +import { + taskListFields, + taskListOperations, +} from './TaskListDescription'; + +import { + taskTagFields, + taskTagOperations, +} from './TaskTagDescription'; + +import { + spaceTagFields, + spaceTagOperations, +} from './SpaceTagDescription'; + import { taskDependencyFields, taskDependencyOperations, @@ -91,7 +106,7 @@ export class ClickUp implements INodeType { description: INodeTypeDescription = { displayName: 'ClickUp', name: 'clickUp', - icon: 'file:clickup.png', + icon: 'file:clickup.svg', group: ['output'], version: 1, subtitle: '={{$parameter["operation"] + ":" + $parameter["resource"]}}', @@ -180,10 +195,22 @@ export class ClickUp implements INodeType { name: 'List', value: 'list', }, + { + name: 'Space Tag', + value: 'spaceTag', + }, { name: 'Task', value: 'task', }, + { + name: 'Task List', + value: 'taskList', + }, + { + name: 'Task Tag', + value: 'taskTag', + }, { name: 'Task Dependency', value: 'taskDependency', @@ -221,6 +248,15 @@ export class ClickUp implements INodeType { // GUEST // ...guestOperations, // ...guestFields, + // TASK TAG + ...taskTagOperations, + ...taskTagFields, + // TASK LIST + ...taskListOperations, + ...taskListFields, + // SPACE TAG + ...spaceTagOperations, + ...spaceTagFields, // TASK ...taskOperations, ...taskFields, @@ -1022,6 +1058,40 @@ export class ClickUp implements INodeType { responseData = { success: true }; } } + if (resource === 'taskTag') { + if (operation === 'add') { + const taskId = this.getNodeParameter('taskId', i) as string; + const name = this.getNodeParameter('tagName', i) as string; + const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; + const qs: IDataObject = {}; + Object.assign(qs, additionalFields); + responseData = await clickupApiRequest.call(this, 'POST', `/task/${taskId}/tag/${name}`, {}, qs); + responseData = { success: true }; + } + if (operation === 'remove') { + const taskId = this.getNodeParameter('taskId', i) as string; + const name = this.getNodeParameter('tagName', i) as string; + const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; + const qs: IDataObject = {}; + Object.assign(qs, additionalFields); + responseData = await clickupApiRequest.call(this, 'DELETE', `/task/${taskId}/tag/${name}`, {}, qs); + responseData = { success: true }; + } + } + if (resource === 'taskList') { + if (operation === 'add') { + const taskId = this.getNodeParameter('taskId', i) as string; + const listId = this.getNodeParameter('listId', i) as string; + responseData = await clickupApiRequest.call(this, 'POST', `/list/${listId}/task/${taskId}`); + responseData = { success: true }; + } + if (operation === 'remove') { + const taskId = this.getNodeParameter('taskId', i) as string; + const listId = this.getNodeParameter('listId', i) as string; + responseData = await clickupApiRequest.call(this, 'DELETE', `/list/${listId}/task/${taskId}`); + responseData = { success: true }; + } + } if (resource === 'taskDependency') { if (operation === 'create') { const taskId = this.getNodeParameter('task', i) as string; @@ -1195,6 +1265,55 @@ export class ClickUp implements INodeType { } } + if (resource === 'spaceTag') { + if (operation === 'create') { + const spaceId = this.getNodeParameter('space', i) as string; + const name = this.getNodeParameter('name', i) as string; + const foregroundColor = this.getNodeParameter('foregroundColor', i) as string; + const backgroundColor = this.getNodeParameter('backgroundColor', i) as string; + const body: IDataObject = { + tag: { + name, + tag_bg: backgroundColor, + tag_fg: foregroundColor, + }, + }; + responseData = await clickupApiRequest.call(this, 'POST', `/space/${spaceId}/tag`, body); + responseData = { success: true }; + } + if (operation === 'delete') { + const spaceId = this.getNodeParameter('space', i) as string; + const name = this.getNodeParameter('name', i) as string; + responseData = await clickupApiRequest.call(this, 'DELETE', `/space/${spaceId}/tag/${name}`); + responseData = { success: true }; + } + if (operation === 'getAll') { + const spaceId = this.getNodeParameter('space', i) as string; + const returnAll = this.getNodeParameter('returnAll', i) as boolean; + responseData = await clickupApiRequest.call(this, 'GET', `/space/${spaceId}/tag`); + responseData = responseData.tags; + if (returnAll === false) { + const limit = this.getNodeParameter('limit', i) as number; + responseData = responseData.splice(0, limit); + } + } + if (operation === 'update') { + const spaceId = this.getNodeParameter('space', i) as string; + const tagName = this.getNodeParameter('name', i) as string; + const newTagName = this.getNodeParameter('newName', i) as string; + const foregroundColor = this.getNodeParameter('foregroundColor', i) as string; + const backgroundColor = this.getNodeParameter('backgroundColor', i) as string; + const body: IDataObject = { + tag: { + name: newTagName, + tag_bg: backgroundColor, + tag_fg: foregroundColor, + }, + }; + await clickupApiRequest.call(this, 'PUT', `/space/${spaceId}/tag/${tagName}`, body); + responseData = { success: true }; + } + } if (resource === 'list') { if (operation === 'create') { const spaceId = this.getNodeParameter('space', i) as string; diff --git a/packages/nodes-base/nodes/ClickUp/ClickUpTrigger.node.ts b/packages/nodes-base/nodes/ClickUp/ClickUpTrigger.node.ts index 2e9bb24ebf..bf00cbe81a 100644 --- a/packages/nodes-base/nodes/ClickUp/ClickUpTrigger.node.ts +++ b/packages/nodes-base/nodes/ClickUp/ClickUpTrigger.node.ts @@ -16,13 +16,15 @@ import { clickupApiRequest, } from './GenericFunctions'; -import { createHmac } from 'crypto'; +import { + createHmac, +} from 'crypto'; export class ClickUpTrigger implements INodeType { description: INodeTypeDescription = { displayName: 'ClickUp Trigger', name: 'clickUpTrigger', - icon: 'file:clickup.png', + icon: 'file:clickup.svg', group: ['trigger'], version: 1, description: 'Handle ClickUp events via webhooks (Beta)', @@ -302,16 +304,16 @@ export class ClickUpTrigger implements INodeType { body.events = '*'; } if (filters.listId) { - body.list_id = (filters.listId as string).replace('#',''); + body.list_id = (filters.listId as string).replace('#', ''); } if (filters.taskId) { - body.task_id = (filters.taskId as string).replace('#',''); + body.task_id = (filters.taskId as string).replace('#', ''); } if (filters.spaceId) { - body.space_id = (filters.spaceId as string).replace('#',''); + body.space_id = (filters.spaceId as string).replace('#', ''); } if (filters.folderId) { - body.folder_id = (filters.folderId as string).replace('#',''); + body.folder_id = (filters.folderId as string).replace('#', ''); } const { webhook } = await clickupApiRequest.call(this, 'POST', endpoint, body); webhookData.webhookId = webhook.id; @@ -323,7 +325,7 @@ export class ClickUpTrigger implements INodeType { const endpoint = `/webhook/${webhookData.webhookId}`; try { await clickupApiRequest.call(this, 'DELETE', endpoint); - } catch(error) { + } catch (error) { return false; } delete webhookData.webhookId; diff --git a/packages/nodes-base/nodes/ClickUp/CommentDescription.ts b/packages/nodes-base/nodes/ClickUp/CommentDescription.ts index a8ef00d2f4..715c7da148 100644 --- a/packages/nodes-base/nodes/ClickUp/CommentDescription.ts +++ b/packages/nodes-base/nodes/ClickUp/CommentDescription.ts @@ -1,6 +1,6 @@ import { INodeProperties, - } from 'n8n-workflow'; +} from 'n8n-workflow'; export const commentOperations = [ { @@ -43,9 +43,9 @@ export const commentOperations = [ export const commentFields = [ -/* -------------------------------------------------------------------------- */ -/* comment:create */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* comment:create */ + /* -------------------------------------------------------------------------- */ { displayName: 'Comment On', name: 'commentOn', @@ -141,9 +141,10 @@ export const commentFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* comment:delete */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* comment:delete */ + /* -------------------------------------------------------------------------- */ { displayName: 'Comment ID', name: 'comment', @@ -161,9 +162,10 @@ export const commentFields = [ }, required: true, }, -/* -------------------------------------------------------------------------- */ -/* comment:getAll */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* comment:getAll */ + /* -------------------------------------------------------------------------- */ { displayName: 'Comments On', name: 'commentsOn', @@ -232,9 +234,10 @@ export const commentFields = [ default: 50, description: 'How many results to return.', }, -/* -------------------------------------------------------------------------- */ -/* comment:update */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* comment:update */ + /* -------------------------------------------------------------------------- */ { displayName: 'Comment ID', name: 'comment', diff --git a/packages/nodes-base/nodes/ClickUp/FolderDescription.ts b/packages/nodes-base/nodes/ClickUp/FolderDescription.ts index 327ae830e0..cd97ac3af6 100644 --- a/packages/nodes-base/nodes/ClickUp/FolderDescription.ts +++ b/packages/nodes-base/nodes/ClickUp/FolderDescription.ts @@ -1,6 +1,6 @@ import { INodeProperties, - } from 'n8n-workflow'; +} from 'n8n-workflow'; export const folderOperations = [ { @@ -48,9 +48,9 @@ export const folderOperations = [ export const folderFields = [ -/* -------------------------------------------------------------------------- */ -/* folder:create */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* folder:create */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', @@ -111,9 +111,10 @@ export const folderFields = [ }, required: true, }, -/* -------------------------------------------------------------------------- */ -/* folder:delete */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* folder:delete */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', @@ -180,9 +181,10 @@ export const folderFields = [ }, required: true, }, -/* -------------------------------------------------------------------------- */ -/* folder:get */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* folder:get */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', @@ -249,9 +251,10 @@ export const folderFields = [ }, required: true, }, -/* -------------------------------------------------------------------------- */ -/* folder:getAll */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* folder:getAll */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', @@ -341,9 +344,10 @@ export const folderFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* folder:update */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* folder:update */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', diff --git a/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts b/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts index 79409e69c3..0de73a430b 100644 --- a/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts @@ -1,6 +1,6 @@ import { OptionsWithUri, - } from 'request'; +} from 'request'; import { IExecuteFunctions, @@ -13,7 +13,7 @@ import { import { IDataObject, IOAuth2Options, - } from 'n8n-workflow'; +} from 'n8n-workflow'; export async function clickupApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IWebhookFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise { // tslint:disable-line:no-any const options: OptionsWithUri = { @@ -23,7 +23,7 @@ export async function clickupApiRequest(this: IHookFunctions | IExecuteFunctions method, qs, body, - uri: uri ||`https://api.clickup.com/api/v2${resource}`, + uri: uri || `https://api.clickup.com/api/v2${resource}`, json: true, }; @@ -51,7 +51,7 @@ export async function clickupApiRequest(this: IHookFunctions | IExecuteFunctions return await this.helpers.requestOAuth2!.call(this, 'clickUpOAuth2Api', options, oAuth2Options); } - } catch(error) { + } catch (error) { let errorMessage = error; if (error.err) { errorMessage = error.err; @@ -61,7 +61,7 @@ export async function clickupApiRequest(this: IHookFunctions | IExecuteFunctions } -export async function clickupApiRequestAllItems(this: IHookFunctions | IExecuteFunctions| ILoadOptionsFunctions, propertyName: string ,method: string, resource: string, body: any = {}, query: IDataObject = {}): Promise { // tslint:disable-line:no-any +export async function clickupApiRequestAllItems(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, propertyName: string, method: string, resource: string, body: any = {}, query: IDataObject = {}): Promise { // tslint:disable-line:no-any const returnData: IDataObject[] = []; diff --git a/packages/nodes-base/nodes/ClickUp/GoalDescription.ts b/packages/nodes-base/nodes/ClickUp/GoalDescription.ts index 06e0463f6c..aba11b4654 100644 --- a/packages/nodes-base/nodes/ClickUp/GoalDescription.ts +++ b/packages/nodes-base/nodes/ClickUp/GoalDescription.ts @@ -1,6 +1,6 @@ import { INodeProperties, - } from 'n8n-workflow'; +} from 'n8n-workflow'; export const goalOperations = [ { @@ -48,9 +48,9 @@ export const goalOperations = [ export const goalFields = [ -/* -------------------------------------------------------------------------- */ -/* goal:create */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* goal:create */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', @@ -140,9 +140,10 @@ export const goalFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* goal:delete */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* goal:delete */ + /* -------------------------------------------------------------------------- */ { displayName: 'Goal ID', name: 'goal', @@ -160,9 +161,10 @@ export const goalFields = [ }, required: true, }, -/* -------------------------------------------------------------------------- */ -/* goal:get */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* goal:get */ + /* -------------------------------------------------------------------------- */ { displayName: 'Goal ID', name: 'goal', @@ -180,9 +182,10 @@ export const goalFields = [ }, required: true, }, -/* -------------------------------------------------------------------------- */ -/* goal:getAll */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* goal:getAll */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', @@ -224,9 +227,10 @@ export const goalFields = [ default: 50, description: 'How many results to return.', }, -/* -------------------------------------------------------------------------- */ -/* goal:update */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* goal:update */ + /* -------------------------------------------------------------------------- */ { displayName: 'Goal ID', name: 'goal', diff --git a/packages/nodes-base/nodes/ClickUp/GoalKeyResultDescription.ts b/packages/nodes-base/nodes/ClickUp/GoalKeyResultDescription.ts index 657731ac4f..fd4ff685e3 100644 --- a/packages/nodes-base/nodes/ClickUp/GoalKeyResultDescription.ts +++ b/packages/nodes-base/nodes/ClickUp/GoalKeyResultDescription.ts @@ -1,6 +1,6 @@ import { INodeProperties, - } from 'n8n-workflow'; +} from 'n8n-workflow'; export const goalKeyResultOperations = [ { @@ -38,9 +38,9 @@ export const goalKeyResultOperations = [ export const goalKeyResultFields = [ -/* -------------------------------------------------------------------------- */ -/* goalKeyResult:create */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* goalKeyResult:create */ + /* -------------------------------------------------------------------------- */ { displayName: 'Goal ID', name: 'goal', @@ -178,9 +178,10 @@ export const goalKeyResultFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* goalKeyResult:delete */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* goalKeyResult:delete */ + /* -------------------------------------------------------------------------- */ { displayName: 'Key Result ID', name: 'keyResult', @@ -198,9 +199,10 @@ export const goalKeyResultFields = [ }, required: true, }, -/* -------------------------------------------------------------------------- */ -/* goalKeyResult:update */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* goalKeyResult:update */ + /* -------------------------------------------------------------------------- */ { displayName: 'Key Result ID', name: 'keyResult', diff --git a/packages/nodes-base/nodes/ClickUp/GuestDescription.ts b/packages/nodes-base/nodes/ClickUp/GuestDescription.ts index 2f6ebd6da1..f25a1b6c30 100644 --- a/packages/nodes-base/nodes/ClickUp/GuestDescription.ts +++ b/packages/nodes-base/nodes/ClickUp/GuestDescription.ts @@ -1,6 +1,6 @@ import { INodeProperties, - } from 'n8n-workflow'; +} from 'n8n-workflow'; export const guestOperations = [ { @@ -43,9 +43,9 @@ export const guestOperations = [ export const guestFields = [ -/* -------------------------------------------------------------------------- */ -/* guest:create */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* guest:create */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', @@ -119,9 +119,10 @@ export const guestFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* guest:delete */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* guest:delete */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', @@ -159,9 +160,10 @@ export const guestFields = [ }, required: true, }, -/* -------------------------------------------------------------------------- */ -/* guest:get */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* guest:get */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', @@ -199,9 +201,10 @@ export const guestFields = [ }, required: true, }, -/* -------------------------------------------------------------------------- */ -/* guest:update */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* guest:update */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', diff --git a/packages/nodes-base/nodes/ClickUp/ListDescription.ts b/packages/nodes-base/nodes/ClickUp/ListDescription.ts index 0c28a1d90d..f5183478e5 100644 --- a/packages/nodes-base/nodes/ClickUp/ListDescription.ts +++ b/packages/nodes-base/nodes/ClickUp/ListDescription.ts @@ -1,6 +1,6 @@ import { INodeProperties, - } from 'n8n-workflow'; +} from 'n8n-workflow'; export const listOperations = [ { @@ -58,9 +58,9 @@ export const listOperations = [ export const listFields = [ -/* -------------------------------------------------------------------------- */ -/* list:create */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* list:create */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', @@ -233,9 +233,10 @@ export const listFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* list:member */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* list:member */ + /* -------------------------------------------------------------------------- */ { displayName: 'List ID', name: 'id', @@ -295,9 +296,9 @@ export const listFields = [ default: 50, description: 'How many results to return.', }, -/* -------------------------------------------------------------------------- */ -/* list:customFields */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* list:customFields */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team', name: 'team', @@ -436,9 +437,10 @@ export const listFields = [ }, required: true, }, -/* -------------------------------------------------------------------------- */ -/* list:delete */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* list:delete */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', @@ -542,9 +544,10 @@ export const listFields = [ }, required: true, }, -/* -------------------------------------------------------------------------- */ -/* list:get */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* list:get */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', @@ -648,9 +651,10 @@ export const listFields = [ }, required: true, }, -/* -------------------------------------------------------------------------- */ -/* list:getAll */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* list:getAll */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', @@ -783,9 +787,10 @@ export const listFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* list:update */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* list:update */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', diff --git a/packages/nodes-base/nodes/ClickUp/SpaceTagDescription.ts b/packages/nodes-base/nodes/ClickUp/SpaceTagDescription.ts new file mode 100644 index 0000000000..9d8384775a --- /dev/null +++ b/packages/nodes-base/nodes/ClickUp/SpaceTagDescription.ts @@ -0,0 +1,204 @@ +import { + INodeProperties, +} from 'n8n-workflow'; + +export const spaceTagOperations = [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'spaceTag', + ], + }, + }, + options: [ + { + name: 'Create', + value: 'create', + description: 'Create a space tag', + }, + { + name: 'Delete', + value: 'delete', + description: 'Delete a space tag', + }, + { + name: 'Get All', + value: 'getAll', + description: 'Get all space tags', + }, + { + name: 'Update', + value: 'update', + description: 'Update a space tag', + }, + ], + default: 'create', + description: 'The operation to perform.', + }, +] as INodeProperties[]; + +export const spaceTagFields = [ + /* -------------------------------------------------------------------------- */ + /* spaceTag:create */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Space ID', + name: 'space', + type: 'string', + default: '', + displayOptions: { + show: { + resource: [ + 'spaceTag', + ], + operation: [ + 'create', + 'delete', + 'getAll', + 'update', + ], + }, + }, + required: true, + }, + { + displayName: 'Name', + name: 'name', + type: 'string', + default: '', + displayOptions: { + show: { + resource: [ + 'spaceTag', + ], + operation: [ + 'create', + ], + }, + }, + required: true, + }, + { + displayName: 'Name', + name: 'name', + type: 'options', + typeOptions: { + loadOptionsDependsOn: [ + 'space', + ], + loadOptionsMethod: 'getTags', + }, + default: '', + displayOptions: { + show: { + resource: [ + 'spaceTag', + ], + operation: [ + 'delete', + 'update', + ], + }, + }, + required: true, + }, + { + displayName: 'New Name', + name: 'newName', + type: 'string', + description: 'New name to set for the tag.', + default: '', + displayOptions: { + show: { + resource: [ + 'spaceTag', + ], + operation: [ + 'update', + ], + }, + }, + required: true, + }, + { + displayName: 'Foreground Color', + name: 'foregroundColor', + type: 'color', + default: '#000000', + displayOptions: { + show: { + resource: [ + 'spaceTag', + ], + operation: [ + 'create', + 'update', + ], + }, + }, + required: true, + }, + { + displayName: 'Background Color', + name: 'backgroundColor', + type: 'color', + default: '#000000', + displayOptions: { + show: { + resource: [ + 'spaceTag', + ], + operation: [ + 'create', + 'update', + ], + }, + }, + required: true, + }, + { + displayName: 'Return All', + name: 'returnAll', + type: 'boolean', + displayOptions: { + show: { + resource: [ + 'spaceTag', + ], + operation: [ + 'getAll', + ], + }, + }, + default: true, + description: 'If all results should be returned or only up to a given limit.', + }, + { + displayName: 'Limit', + name: 'limit', + type: 'number', + displayOptions: { + show: { + resource: [ + 'spaceTag', + ], + operation: [ + 'getAll', + ], + returnAll: [ + false, + ], + }, + }, + typeOptions: { + minValue: 1, + maxValue: 100, + }, + default: 50, + description: 'How many results to return.', + }, +] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/ClickUp/TaskDependencyDescription.ts b/packages/nodes-base/nodes/ClickUp/TaskDependencyDescription.ts index 2f5d19ba0a..c778a437e7 100644 --- a/packages/nodes-base/nodes/ClickUp/TaskDependencyDescription.ts +++ b/packages/nodes-base/nodes/ClickUp/TaskDependencyDescription.ts @@ -1,6 +1,6 @@ import { INodeProperties, - } from 'n8n-workflow'; +} from 'n8n-workflow'; export const taskDependencyOperations = [ { @@ -33,9 +33,9 @@ export const taskDependencyOperations = [ export const taskDependencyFields = [ -/* -------------------------------------------------------------------------- */ -/* taskDependency:create */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* taskDependency:create */ + /* -------------------------------------------------------------------------- */ { displayName: 'Task ID', name: 'task', @@ -69,9 +69,10 @@ export const taskDependencyFields = [ }, required: true, }, -/* -------------------------------------------------------------------------- */ -/* taskDependency:delete */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* taskDependency:delete */ + /* -------------------------------------------------------------------------- */ { displayName: 'Task ID', name: 'task', diff --git a/packages/nodes-base/nodes/ClickUp/TaskDescription.ts b/packages/nodes-base/nodes/ClickUp/TaskDescription.ts index ef80c95656..687084cc72 100644 --- a/packages/nodes-base/nodes/ClickUp/TaskDescription.ts +++ b/packages/nodes-base/nodes/ClickUp/TaskDescription.ts @@ -1,6 +1,6 @@ import { INodeProperties, - } from 'n8n-workflow'; +} from 'n8n-workflow'; export const taskOperations = [ { @@ -58,9 +58,9 @@ export const taskOperations = [ export const taskFields = [ -/* -------------------------------------------------------------------------- */ -/* task:create */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* task:create */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', @@ -352,9 +352,10 @@ export const taskFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* task:update */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* task:update */ + /* -------------------------------------------------------------------------- */ { displayName: 'Task ID', name: 'id', @@ -489,9 +490,10 @@ export const taskFields = [ ], }, -/* -------------------------------------------------------------------------- */ -/* task:get */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* task:get */ + /* -------------------------------------------------------------------------- */ { displayName: 'Task ID', name: 'id', @@ -510,9 +512,10 @@ export const taskFields = [ }, description: 'Task ID', }, -/* -------------------------------------------------------------------------- */ -/* task:getAll */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* task:getAll */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', @@ -920,9 +923,10 @@ export const taskFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* task:delete */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* task:delete */ + /* -------------------------------------------------------------------------- */ { displayName: 'Task ID', name: 'id', @@ -941,9 +945,10 @@ export const taskFields = [ }, description: 'task ID', }, -/* -------------------------------------------------------------------------- */ -/* task:member */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* task:member */ + /* -------------------------------------------------------------------------- */ { displayName: 'Task ID', name: 'id', @@ -1003,9 +1008,10 @@ export const taskFields = [ default: 50, description: 'How many results to return.', }, -/* -------------------------------------------------------------------------- */ -/* task:setCustomField */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* task:setCustomField */ + /* -------------------------------------------------------------------------- */ { displayName: 'Task ID', name: 'task', diff --git a/packages/nodes-base/nodes/ClickUp/TaskListDescription.ts b/packages/nodes-base/nodes/ClickUp/TaskListDescription.ts new file mode 100644 index 0000000000..c1e25a0170 --- /dev/null +++ b/packages/nodes-base/nodes/ClickUp/TaskListDescription.ts @@ -0,0 +1,74 @@ +import { + INodeProperties, +} from 'n8n-workflow'; + +export const taskListOperations = [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'taskList', + ], + }, + }, + options: [ + { + name: 'Add', + value: 'add', + description: 'Add a task to a list', + }, + { + name: 'Remove', + value: 'remove', + description: 'Remove a task from a list', + }, + ], + default: 'add', + description: 'The operation to perform.', + }, +] as INodeProperties[]; + +export const taskListFields = [ + /* -------------------------------------------------------------------------- */ + /* taskList:add */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Task ID', + name: 'taskId', + type: 'string', + default: '', + displayOptions: { + show: { + resource: [ + 'taskList', + ], + operation: [ + 'remove', + 'add', + ], + }, + }, + required: true, + }, + { + displayName: 'List ID', + name: 'listId', + type: 'string', + default: '', + displayOptions: { + show: { + resource: [ + 'taskList', + ], + operation: [ + 'remove', + 'add', + ], + }, + }, + required: true, + }, +] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/ClickUp/TaskTagDescription.ts b/packages/nodes-base/nodes/ClickUp/TaskTagDescription.ts new file mode 100644 index 0000000000..70ba1796aa --- /dev/null +++ b/packages/nodes-base/nodes/ClickUp/TaskTagDescription.ts @@ -0,0 +1,111 @@ +import { + INodeProperties, +} from 'n8n-workflow'; + +export const taskTagOperations = [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'taskTag', + ], + }, + }, + options: [ + { + name: 'Add', + value: 'add', + description: 'Add a tag to a task', + }, + { + name: 'Remove', + value: 'remove', + description: 'Remove a tag from a task', + }, + ], + default: 'add', + description: 'The operation to perform.', + }, +] as INodeProperties[]; + +export const taskTagFields = [ + /* -------------------------------------------------------------------------- */ + /* taskTag:add */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Task ID', + name: 'taskId', + type: 'string', + default: '', + displayOptions: { + show: { + resource: [ + 'taskTag', + ], + operation: [ + 'remove', + 'add', + ], + }, + }, + required: true, + }, + { + displayName: 'Tag Name', + name: 'tagName', + type: 'string', + default: '', + displayOptions: { + show: { + resource: [ + 'taskTag', + ], + operation: [ + 'remove', + 'add', + ], + }, + }, + required: true, + }, + { + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + resource: [ + 'taskTag', + ], + operation: [ + 'remove', + 'add', + ], + }, + }, + options: [ + { + displayName: 'Custom Task IDs', + name: 'custom_task_ids', + type: 'boolean', + default: false, + description: `If you want to reference a task by it's custom task id, this value must be true`, + }, + { + displayName: 'Team ID', + name: 'team_id', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTeams', + }, + default: '', + description: `Only used when the parameter is set to custom_task_ids=true`, + }, + ], + }, +] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/ClickUp/TimeEntryTagDescription.ts b/packages/nodes-base/nodes/ClickUp/TimeEntryTagDescription.ts index 1375a53a34..ff6508cc31 100644 --- a/packages/nodes-base/nodes/ClickUp/TimeEntryTagDescription.ts +++ b/packages/nodes-base/nodes/ClickUp/TimeEntryTagDescription.ts @@ -1,6 +1,6 @@ import { INodeProperties, - } from 'n8n-workflow'; +} from 'n8n-workflow'; export const timeEntryTagOperations = [ { @@ -28,7 +28,7 @@ export const timeEntryTagOperations = [ { name: 'Remove', value: 'remove', - description:'Remove tag from time entry', + description: 'Remove tag from time entry', }, ], default: 'add', @@ -38,9 +38,9 @@ export const timeEntryTagOperations = [ export const timeEntryTagFields = [ -/* -------------------------------------------------------------------------- */ -/* timeEntryTag:getAll */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* timeEntryTag:getAll */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', @@ -102,9 +102,10 @@ export const timeEntryTagFields = [ default: 5, description: 'How many results to return.', }, -/* -------------------------------------------------------------------------- */ -/* timeEntryTag:add */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* timeEntryTag:add */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', @@ -188,9 +189,10 @@ export const timeEntryTagFields = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* timeEntryTag:remove */ -/* -------------------------------------------------------------------------- */ + + /* -------------------------------------------------------------------------- */ + /* timeEntryTag:remove */ + /* -------------------------------------------------------------------------- */ { displayName: 'Team ID', name: 'team', diff --git a/packages/nodes-base/nodes/ClickUp/clickup.png b/packages/nodes-base/nodes/ClickUp/clickup.png deleted file mode 100644 index c46fe7b58662587a132c154e409034b89189a1f4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1788 zcmYL|XIRtc8pfl5A`}ISiVzPKs|*oom2r#=849u@B#bZ;5|jvp5o4eUBL-w8$_PV2 zpe%uw8f2b=A_#(1)GAe>14OLU9`T619Q;R~{?jk#zOMIrujl^s+`s#M3#k4_^mL4M zNFp1*k$x&7MAOX$7NwT&MIJMfL&L>5RwsqWqaUY z-^nUNq0)sgfg=Y0N*K}$uS3A(QEDU(Sxo5sJiHemS`2J4?Cl52w@~B>RrbIYB=Rvv zBLY%7oIak$z=TXp>V`+uqTpQ(S4<&50pthiR2;;S#2N{yXh=K4yodmKDmE7dr75(T z!;U-Y$5hZ}K}6tlQE{*;T7kl*8Htw)dW@iPuR4)?6IkAaq(mqT@Eb*fdXd;%EFl$v z0e#S)hf5BjEl9o{e!LKY;={=TJd#*oSO;_#AtoKlorNsica#X|qy{xY_%DGi;S?kE zE-cdzgF$^Tn9p+t$fE*35iCaF@)!PtC}=G+njyyxBy<4%IS9{zd_N*GkrXc3r!jCM z7o!1Hqca}?$~Wpg2`mjZ!R?5;Cbvdlr>n`7J42gg=n#Z=0)b0JR~HJ~e^B>G@JZqk zaE{#vP7QF&;iMdrB_N6gNjT*Cs@o^3B)Ea`udwqcHGG?XaP0tECG_q9r5W7V$Z7*# z9-QVw9u4H~knN_5A_(g)!}{l7@(^rCz~LJB)Wh*JAYnm;H`E@2iBIU`5LFLC5hRHq zl?Q1oI8T9d6rc{{>c_Tu5u)XgBnIIr5XV6Q14@G6^1rQmypIwepj8m)A4FQcN>f8a zQ$vNT{x3`m$8i)zI@zXV<4<+9i3!L45n&QqS^2o|Gt;f z_gL>XTd%@ULdb{re=WaRdilp6i!TpRNn?$-$03^6 z_|nvAs^Ky6+Bb8r`D^pE*O0v`kLI^}$po^`gsJ~XW>FiOPcHOqly*y``-O`iXZMI~ zZ3j{v7P3B6&wLoKUU`KM&Z#y(-??{V`DAeS?S#I5jpXB3bx5x_%~iZ9sTi)Z#(w@5 zQe!zU?My$})^-24gGv=AA-}AOCK)oA>D6}8R+0spj!m@3%$94vZ8CVRzwO1^&yN%a zuf%wU&5nmUVfFOTNA{%iqmLV{0~cqR117Fx9g_*=-BC_%XX{PS>~NL|^W{ zeWJOqQ?&Z`jrAe7e3w>52!F{Cd|0i*wx73pZ&Y;haI4d*YsH~wni;=Vd-n+F*MDRtII z+@CJY-JD(tVaiY0y^S+cC_0*r7JOyxp1ZVHKmN6ue!?uGYpd4_ic-ZspL}ucy)(LX zJ@v-p_rkU0M%mxDMmIZ?JZcrHY}3$6 zxK*V)9^0{DUCqW8C6kPlxN?4>PK8a|jl9U(<5rRoqbQwx)>7gpW%U)3W{0`og&1ls zx$TaRadc89_gj8<%U&Q&{>p-?=~K61gHMpvC7zC9*m#w&V97$@xXRU*k#u+Q;LatQ zxyDasrLLY03-aP~L1WGb~f)^$MtVM+n)85v12*y>iNE5q51Dphl$qc zf&ytlwg3DViVm;Q2^M~CcVuKp``nhC2%Iz1CG)X5dP>@$EsZ)9^|rJ}MRNahJM%u{ RiJ17sByUfDk1K90>EAVm*PH+V diff --git a/packages/nodes-base/nodes/ClickUp/clickup.svg b/packages/nodes-base/nodes/ClickUp/clickup.svg new file mode 100644 index 0000000000..18f875d5cc --- /dev/null +++ b/packages/nodes-base/nodes/ClickUp/clickup.svg @@ -0,0 +1 @@ + \ No newline at end of file