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 c46fe7b586..0000000000 Binary files a/packages/nodes-base/nodes/ClickUp/clickup.png and /dev/null differ 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