chore: move properties to their own files

This commit is contained in:
kolaente 2023-10-24 15:23:36 +02:00
parent d4f4f682fc
commit 78b5520cc8
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
4 changed files with 949 additions and 930 deletions

42
nodes/Vikunja/Label.ts Normal file
View File

@ -0,0 +1,42 @@
import {INodeProperties} from 'n8n-workflow'
export const labelProperties: INodeProperties[] = [
{
displayName: 'Label Title or ID',
name: 'label',
type: 'resourceLocator',
default: {mode: 'id', value: ''},
required: true,
modes: [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select a label…',
typeOptions: {
searchListMethod: 'searchLabels',
searchable: true,
},
},
{
displayName: 'ID',
name: 'id',
type: 'string',
placeholder: '1567890',
},
],
displayOptions: {
show: {
resource: ['task'],
operation: ['addLabel', 'removeLabel'],
},
},
routing: {
send: {
type: 'body',
property: 'label_id',
},
},
description: 'The label you want to operate on. Choose from the list, or specify an ID.',
},
]

287
nodes/Vikunja/Project.ts Normal file
View File

@ -0,0 +1,287 @@
import {INodeProperties} from 'n8n-workflow'
export const projectProperties: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
required: true,
displayOptions: {
show: {
resource: ['project'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a project',
action: 'Create a project',
routing: {
request: {
method: 'PUT',
url: '=/projects',
},
},
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a project',
action: 'Delete a project',
routing: {
request: {
method: 'DELETE',
url: '=/projects/{{$parameter.project}}',
},
},
},
{
name: 'Get',
value: 'get',
description: 'Get a project',
action: 'Get a project',
routing: {
request: {
method: 'GET',
url: '=/projects/{{$parameter.project}}',
},
},
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many projects',
action: 'Get many projects',
routing: {
request: {
method: 'GET',
url: '=/projects',
},
},
},
{
name: 'Update',
value: 'update',
description: 'Update a project',
action: 'Update a project',
routing: {
request: {
method: 'GET',
url: '=/projects/{{$parameter.project}}',
},
},
},
{
name: 'Duplicate',
value: 'duplicate',
description: 'Duplicate a project',
action: 'Duplicate a project',
routing: {
request: {
method: 'PUT',
url: '=/projects/{{$parameter.project}}/duplicate',
},
},
},
],
default: 'create',
},
{
displayName: 'Project Title or ID',
name: 'project',
type: 'resourceLocator',
default: {mode: 'id', value: ''},
required: true,
modes: [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select a project…',
typeOptions: {
searchListMethod: 'searchProjects',
searchable: true,
},
},
{
displayName: 'ID',
name: 'id',
type: 'string',
placeholder: '1567890',
},
],
displayOptions: {
show: {
resource: ['project'],
operation: ['get', 'delete', 'update', 'duplicate'],
},
},
description: 'The project you want to operate on. Choose from the list, or specify an ID.',
},
{
displayName: 'Parent Project Title or ID',
name: 'parentProject',
type: 'resourceLocator',
default: {mode: 'id', value: ''},
modes: [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select a project…',
typeOptions: {
searchListMethod: 'searchProjects',
searchable: true,
},
},
{
displayName: 'ID',
name: 'id',
type: 'string',
placeholder: '1567890',
},
],
displayOptions: {
show: {
resource: ['project'],
operation: ['create', 'duplicate'],
},
},
routing: {
send: {
type: 'body',
property: 'parent_project_id',
},
},
description: 'The parent project you want to use. Choose from the list, or specify an ID.',
},
{
displayName: 'Project Title',
name: 'projectTitle',
type: 'string',
displayOptions: {
show: {
resource: ['project'],
operation: ['create', 'update'],
},
},
routing: {
send: {
type: 'body',
property: 'title',
},
},
default: '',
required: true,
},
{
displayName: 'Additional Fields',
name: 'options',
type: 'collection',
placeholder: 'Add Option',
default: {},
displayOptions: {
show: {
resource: ['project'],
operation: ['create', 'update'],
},
},
options: [
{
displayName: 'Description',
name: 'description',
type: 'string',
default: '',
description: 'A description for the project',
typeOptions: {
rows: 4,
},
routing: {
send: {
type: 'body',
property: 'description',
},
},
},
{
displayName: 'Project Color',
name: 'hexColor',
type: 'color',
default: 'hex_color',
routing: {
send: {
type: 'body',
property: 'hex_color',
},
},
},
{
displayName: 'Archived',
name: 'isArchived',
type: 'boolean',
default: false,
description: 'Whether a project is archived',
routing: {
send: {
type: 'body',
property: 'is_archived',
},
},
},
{
displayName: 'Favorite',
name: 'isFavorite',
type: 'boolean',
default: false,
description: 'Whether this project is set as a favorite',
routing: {
send: {
type: 'body',
property: 'is_favorite',
},
},
},
{
displayName: 'Default Bucket ID',
name: 'defaultBucketId',
type: 'number',
default: 0,
description: 'The ID of the bucket where new tasks without a bucket are added to. By default, this is the leftmost bucket in a project.',
routing: {
send: {
type: 'body',
property: 'default_bucket_id',
},
},
},
{
displayName: 'Done Bucket ID',
name: 'doneBucketId',
type: 'number',
default: 0,
description: 'If tasks are moved to the done bucket, they are marked as done. If they are marked as done individually, they are moved into the done bucket.',
routing: {
send: {
type: 'body',
property: 'done_bucket_id',
},
},
},
{
displayName: 'Identifier',
name: 'identifier',
type: 'string',
default: '',
description: 'The unique project short identifier. Used to build task identifiers.',
routing: {
send: {
type: 'body',
property: 'identifier',
},
},
},
],
},
]

613
nodes/Vikunja/Task.ts Normal file
View File

@ -0,0 +1,613 @@
import {INodeProperties} from 'n8n-workflow'
export const taskProperties: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
required: true,
displayOptions: {
show: {
resource: ['task'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a task',
action: 'Create a task',
routing: {
request: {
method: 'PUT',
url: '=/projects/{{$parameter.taskProject}}/tasks',
},
},
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a task',
action: 'Delete a task',
routing: {
request: {
method: 'DELETE',
url: '=/tasks/{{$parameter.taskId}}',
},
},
},
{
name: 'Get',
value: 'get',
description: 'Get a task',
action: 'Get a task',
routing: {
request: {
method: 'GET',
url: '=/tasks/{{$parameter.taskId}}',
},
},
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many tasks',
action: 'Get many tasks',
routing: {
request: {
method: 'GET',
url: '=/projects/{{$parameter.taskProject}}/tasks',
},
},
},
{
name: 'Update',
value: 'update',
description: 'Update a task',
action: 'Update a task',
routing: {
request: {
method: 'GET',
url: '=/tasks/{{$parameter.taskId}}',
},
},
},
{
name: 'Assign a User to a Task',
value: 'assignUser',
action: 'Assign a user',
routing: {
request: {
method: 'PUT',
url: '=/tasks/{{$parameter.taskId}}/assignees',
},
},
},
{
name: 'Remove an Assigned User From a Task',
value: 'unassignUser',
action: 'Unassign a user',
routing: {
request: {
method: 'DELETE',
url: '=/tasks/{{$parameter.taskId}}/assignees/{{$parameter.userId}}',
},
},
},
{
name: 'Get All Comments',
description: 'Fetch all comments on a task',
value: 'getAllComments',
action: 'Get all comments',
routing: {
request: {
method: 'GET',
url: '=/tasks/{{$parameter.taskId}}/comments',
},
},
},
{
name: 'Add a Comment',
description: 'Add a comment to a task',
value: 'addComment',
action: 'Add a comment',
routing: {
request: {
method: 'PUT',
url: '=/tasks/{{$parameter.taskId}}/comments',
},
},
},
{
name: 'Update a Comment',
description: 'Update an existing comment on a task',
value: 'updateComment',
action: 'Update a comment',
routing: {
request: {
method: 'POST',
url: '=/tasks/{{$parameter.taskId}}/comments/{{$parameter.commentId}}',
},
},
},
{
name: 'Delete a Comment',
description: 'Delete an existing comment on a task',
value: 'deleteComment',
action: 'Delete a comment',
routing: {
request: {
method: 'DELETE',
url: '=/tasks/{{$parameter.taskId}}/comments/{{$parameter.commentId}}',
},
},
},
{
name: 'Get All Labels',
description: 'Fetch all labels on a task',
value: 'getAllLabelsOnTask',
action: 'Get all labels',
routing: {
request: {
method: 'GET',
url: '=/tasks/{{$parameter.taskId}}/labels',
},
},
},
{
name: 'Add a Label',
description: 'Add a label to a task',
value: 'addLabel',
action: 'Add a label',
routing: {
request: {
method: 'PUT',
url: '=/tasks/{{$parameter.taskId}}/labels',
},
},
},
{
name: 'Remove a Label From a Task',
value: 'removeLabel',
action: 'Remove a label',
routing: {
request: {
method: 'DELETE',
url: '=/tasks/{{$parameter.taskId}}/labels/{{$parameter.label}}',
},
},
},
{
name: 'Add a Relation',
description: 'Add a relation to a task',
value: 'addRelation',
action: 'Add a relation',
routing: {
request: {
method: 'PUT',
url: '=/tasks/{{$parameter.taskId}}/relations',
},
},
},
{
name: 'Remove a Relation',
description: 'Remove an existing relation on a task',
value: 'removeRelation',
action: 'Remove a relation',
routing: {
request: {
method: 'DELETE',
url: '=/tasks/{{$parameter.taskId}}/relations/{{$parameter.relationKind}}/{{$parameter.otherTaskId}}',
},
},
},
],
default: 'create',
},
{
displayName: 'Task ID',
name: 'taskId',
type: 'number',
default: '',
required: true,
displayOptions: {
show: {
resource: ['task'],
operation: [
'delete',
'get',
'update',
'assignUser',
'unassignUser',
'addComment',
'updateComment',
'deleteComment',
'getAllComments',
'getAllLabelsOnTask',
'addLabel',
'removeLabel',
'addRelation',
'removeRelation',
],
},
},
},
{
displayName: 'Project Title or ID',
name: 'taskProject',
type: 'resourceLocator',
default: {mode: 'id', value: ''},
required: true,
modes: [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select a project…',
typeOptions: {
searchListMethod: 'searchProjects',
searchable: true,
},
},
{
displayName: 'ID',
name: 'id',
type: 'string',
placeholder: '1567890',
},
],
displayOptions: {
show: {
resource: ['task'],
operation: ['create', 'getAll'],
},
},
description: 'The project you want to operate on. Choose from the list, or specify an ID.',
},
{
displayName: 'Task Title',
name: 'taskTitle',
type: 'string',
displayOptions: {
show: {
resource: ['task'],
operation: ['create', 'update'],
},
},
routing: {
send: {
type: 'body',
property: 'title',
},
},
default: '',
required: true,
},
{
displayName: 'Additional Fields',
name: 'options',
type: 'collection',
placeholder: 'Add Option',
default: {},
displayOptions: {
show: {
resource: ['task'],
operation: ['create', 'update'],
},
},
options: [
{
displayName: 'Description',
name: 'description',
type: 'string',
default: '',
description: 'A description for the task',
typeOptions: {
rows: 4,
},
routing: {
send: {
type: 'body',
property: 'description',
},
},
},
{
displayName: 'Done',
name: 'done',
type: 'boolean',
default: false,
description: 'Whether this task is done',
routing: {
send: {
type: 'body',
property: 'done',
},
},
},
{
displayName: 'Due Date Time',
name: 'dueDateTime',
type: 'dateTime',
default: '',
description: 'Specific date and time in RFC3339 format',
routing: {
send: {
type: 'body',
property: 'due_date',
},
},
},
{
displayName: 'Start Date Time',
name: 'startDateTime',
type: 'dateTime',
default: '',
description: 'Specific date and time in RFC3339 format',
routing: {
send: {
type: 'body',
property: 'start_date',
},
},
},
{
displayName: 'End Date Time',
name: 'endDateTime',
type: 'dateTime',
default: '',
description: 'Specific date and time in RFC3339 format',
routing: {
send: {
type: 'body',
property: 'end_date',
},
},
},
{
displayName: 'Task Color',
name: 'hexColor',
type: 'color',
default: 'hex_color',
routing: {
send: {
type: 'body',
property: 'hex_color',
},
},
},
{
displayName: 'Favorite',
name: 'isFavorite',
type: 'boolean',
default: false,
description: 'Whether this task is set as a favorite task',
routing: {
send: {
type: 'body',
property: 'is_favorite',
},
},
},
{
displayName: 'Priority',
name: 'priority',
type: 'number',
typeOptions: {
maxValue: 5,
minValue: 1,
},
default: 1,
description: 'Task priority from 1 (normal) to 5 (DO NOW)',
routing: {
send: {
type: 'body',
property: 'priority',
},
},
},
{
displayName: 'Percent Done',
name: 'percentDone',
type: 'number',
typeOptions: {
maxValue: 1,
minValue: 0,
},
default: 0,
description: 'The progress of the task in percent',
routing: {
send: {
type: 'body',
property: 'percent_done',
},
},
},
{
displayName: 'Repeat After',
name: 'repeatAfter',
type: 'number',
default: 0,
description: 'The amount in seconds after this task will repeat',
routing: {
send: {
type: 'body',
property: 'repeat_after',
},
},
},
{
displayName: 'Repeat Mode',
name: 'repeatMode',
type: 'options',
options: [
{
name: 'Repeat After Amount',
description: 'Repeat after the amount specified in repeat_after',
value: 0,
},
{
name: 'Repeat Monthly',
description: 'Repeat all dates each months (ignoring repeat_after)',
value: 1,
},
{
name: 'Repeat From Current Date',
description: 'Repeat from the current date rather than the last set date',
value: 2,
},
],
default: 0,
description: 'How a repeating task will repeat itself. Will be triggered when a task is marked done.',
routing: {
send: {
type: 'body',
property: 'repeat_mode',
},
},
},
// Reminders
],
},
{
displayName: 'User ID',
name: 'userId',
type: 'number',
default: '',
required: true,
displayOptions: {
show: {
resource: ['task'],
operation: ['assignUser', 'unassignUser'],
},
},
routing: {
send: {
type: 'body',
property: 'user_id',
},
},
},
{
displayName: 'Comment ID',
name: 'commentId',
type: 'number',
default: '',
required: true,
displayOptions: {
show: {
resource: ['task'],
operation: ['updateComment', 'deleteComment'],
},
},
},
{
displayName: 'Comment Text',
name: 'commentText',
type: 'string',
typeOptions: {
rows: 4,
},
displayOptions: {
show: {
resource: ['task'],
operation: ['addComment', 'updateComment'],
},
},
routing: {
send: {
type: 'body',
property: 'comment',
},
},
default: '',
required: true,
},
{
displayName: 'Other Task ID',
description: 'The ID of the other task you want to relate the current one with',
name: 'otherTaskId',
type: 'number',
default: '',
required: true,
displayOptions: {
show: {
resource: ['task'],
operation: ['addRelation', 'removeRelation'],
},
},
routing: {
send: {
type: 'body',
property: 'other_task_id',
},
},
},
{
displayName: 'Relation Kind',
name: 'relationKind',
type: 'options',
options: [
{
name: 'Sub Task',
value: 'subtask',
},
{
name: 'Parent Task',
value: 'parenttask',
},
{
name: 'Related Task',
value: 'related',
},
{
name: 'Duplicate Of',
value: 'duplicateof',
},
{
name: 'Duplicates',
value: 'duplicates',
},
{
name: 'Blocking',
value: 'blocking',
},
{
name: 'Blocked',
value: 'blocked',
},
{
name: 'Precedes',
value: 'precedes',
},
{
name: 'Follows',
value: 'follows',
},
{
name: 'Copied From',
value: 'copiedfrom',
},
{
name: 'Coped To',
value: 'copiedto',
},
],
default: 'related',
description: 'The kind of relation between tasks',
displayOptions: {
show: {
resource: ['task'],
operation: ['addRelation', 'removeRelation'],
},
},
routing: {
send: {
type: 'body',
property: 'relation_kind',
},
},
},
]

View File

@ -8,6 +8,10 @@ import {
} from 'n8n-workflow'
import {OptionsWithUri} from 'request'
import {taskProperties} from './Task'
import {projectProperties} from './Project'
import {labelProperties} from './Label'
export class Vikunja implements INodeType {
description: INodeTypeDescription = {
displayName: 'Vikunja',
@ -53,937 +57,10 @@ export class Vikunja implements INodeType {
],
default: 'task',
},
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
required: true,
displayOptions: {
show: {
resource: ['task'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a task',
action: 'Create a task',
routing: {
request: {
method: 'PUT',
url: '=/projects/{{$parameter.taskProject}}/tasks',
},
},
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a task',
action: 'Delete a task',
routing: {
request: {
method: 'DELETE',
url: '=/tasks/{{$parameter.taskId}}',
},
},
},
{
name: 'Get',
value: 'get',
description: 'Get a task',
action: 'Get a task',
routing: {
request: {
method: 'GET',
url: '=/tasks/{{$parameter.taskId}}',
},
},
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many tasks',
action: 'Get many tasks',
routing: {
request: {
method: 'GET',
url: '=/projects/{{$parameter.taskProject}}/tasks',
},
},
},
{
name: 'Update',
value: 'update',
description: 'Update a task',
action: 'Update a task',
routing: {
request: {
method: 'GET',
url: '=/tasks/{{$parameter.taskId}}',
},
},
},
{
name: 'Assign a User to a Task',
value: 'assignUser',
action: 'Assign a user',
routing: {
request: {
method: 'PUT',
url: '=/tasks/{{$parameter.taskId}}/assignees',
},
},
},
{
name: 'Remove an Assigned User From a Task',
value: 'unassignUser',
action: 'Unassign a user',
routing: {
request: {
method: 'DELETE',
url: '=/tasks/{{$parameter.taskId}}/assignees/{{$parameter.userId}}',
},
},
},
{
name: 'Get All Comments',
description: 'Fetch all comments on a task',
value: 'getAllComments',
action: 'Get all comments',
routing: {
request: {
method: 'GET',
url: '=/tasks/{{$parameter.taskId}}/comments',
},
},
},
{
name: 'Add a Comment',
description: 'Add a comment to a task',
value: 'addComment',
action: 'Add a comment',
routing: {
request: {
method: 'PUT',
url: '=/tasks/{{$parameter.taskId}}/comments',
},
},
},
{
name: 'Update a Comment',
description: 'Update an existing comment on a task',
value: 'updateComment',
action: 'Update a comment',
routing: {
request: {
method: 'POST',
url: '=/tasks/{{$parameter.taskId}}/comments/{{$parameter.commentId}}',
},
},
},
{
name: 'Delete a Comment',
description: 'Delete an existing comment on a task',
value: 'deleteComment',
action: 'Delete a comment',
routing: {
request: {
method: 'DELETE',
url: '=/tasks/{{$parameter.taskId}}/comments/{{$parameter.commentId}}',
},
},
},
{
name: 'Get All Labels',
description: 'Fetch all labels on a task',
value: 'getAllLabelsOnTask',
action: 'Get all labels',
routing: {
request: {
method: 'GET',
url: '=/tasks/{{$parameter.taskId}}/labels',
},
},
},
{
name: 'Add a Label',
description: 'Add a label to a task',
value: 'addLabel',
action: 'Add a label',
routing: {
request: {
method: 'PUT',
url: '=/tasks/{{$parameter.taskId}}/labels',
},
},
},
{
name: 'Remove a Label From a Task',
value: 'removeLabel',
action: 'Remove a label',
routing: {
request: {
method: 'DELETE',
url: '=/tasks/{{$parameter.taskId}}/labels/{{$parameter.label}}',
},
},
},
{
name: 'Add a Relation',
description: 'Add a relation to a task',
value: 'addRelation',
action: 'Add a relation',
routing: {
request: {
method: 'PUT',
url: '=/tasks/{{$parameter.taskId}}/relations',
},
},
},
{
name: 'Remove a Relation',
description: 'Remove an existing relation on a task',
value: 'removeRelation',
action: 'Remove a relation',
routing: {
request: {
method: 'DELETE',
url: '=/tasks/{{$parameter.taskId}}/relations/{{$parameter.relationKind}}/{{$parameter.otherTaskId}}',
},
},
},
],
default: 'create',
},
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
required: true,
displayOptions: {
show: {
resource: ['project'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a project',
action: 'Create a project',
routing: {
request: {
method: 'PUT',
url: '=/projects',
},
},
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a project',
action: 'Delete a project',
routing: {
request: {
method: 'DELETE',
url: '=/projects/{{$parameter.project}}',
},
},
},
{
name: 'Get',
value: 'get',
description: 'Get a project',
action: 'Get a project',
routing: {
request: {
method: 'GET',
url: '=/projects/{{$parameter.project}}',
},
},
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many projects',
action: 'Get many projects',
routing: {
request: {
method: 'GET',
url: '=/projects',
},
},
},
{
name: 'Update',
value: 'update',
description: 'Update a project',
action: 'Update a project',
routing: {
request: {
method: 'GET',
url: '=/projects/{{$parameter.project}}',
},
},
},
{
name: 'Duplicate',
value: 'duplicate',
description: 'Duplicate a project',
action: 'Duplicate a project',
routing: {
request: {
method: 'PUT',
url: '=/projects/{{$parameter.project}}/duplicate',
},
},
},
],
default: 'create',
},
{
displayName: 'Task ID',
name: 'taskId',
type: 'number',
default: '',
required: true,
displayOptions: {
show: {
resource: ['task'],
operation: [
'delete',
'get',
'update',
'assignUser',
'unassignUser',
'addComment',
'updateComment',
'deleteComment',
'getAllComments',
'getAllLabelsOnTask',
'addLabel',
'removeLabel',
'addRelation',
'removeRelation',
],
},
},
},
{
displayName: 'Project Title or ID',
name: 'taskProject',
type: 'resourceLocator',
default: {mode: 'id', value: ''},
required: true,
modes: [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select a project…',
typeOptions: {
searchListMethod: 'searchProjects',
searchable: true,
},
},
{
displayName: 'ID',
name: 'id',
type: 'string',
placeholder: '1567890',
},
],
displayOptions: {
show: {
resource: ['task'],
operation: ['create', 'getAll'],
},
},
description: 'The project you want to operate on. Choose from the list, or specify an ID.',
},
{
displayName: 'Project Title or ID',
name: 'project',
type: 'resourceLocator',
default: {mode: 'id', value: ''},
required: true,
modes: [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select a project…',
typeOptions: {
searchListMethod: 'searchProjects',
searchable: true,
},
},
{
displayName: 'ID',
name: 'id',
type: 'string',
placeholder: '1567890',
},
],
displayOptions: {
show: {
resource: ['project'],
operation: ['get', 'delete', 'update', 'duplicate'],
},
},
description: 'The project you want to operate on. Choose from the list, or specify an ID.',
},
{
displayName: 'Parent Project Title or ID',
name: 'parentProject',
type: 'resourceLocator',
default: {mode: 'id', value: ''},
modes: [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select a project…',
typeOptions: {
searchListMethod: 'searchProjects',
searchable: true,
},
},
{
displayName: 'ID',
name: 'id',
type: 'string',
placeholder: '1567890',
},
],
displayOptions: {
show: {
resource: ['project'],
operation: ['create', 'duplicate'],
},
},
routing: {
send: {
type: 'body',
property: 'parent_project_id',
},
},
description: 'The parent project you want to use. Choose from the list, or specify an ID.',
},
{
displayName: 'Label Title or ID',
name: 'label',
type: 'resourceLocator',
default: {mode: 'id', value: ''},
required: true,
modes: [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select a label…',
typeOptions: {
searchListMethod: 'searchLabels',
searchable: true,
},
},
{
displayName: 'ID',
name: 'id',
type: 'string',
placeholder: '1567890',
},
],
displayOptions: {
show: {
resource: ['task'],
operation: ['addLabel', 'removeLabel'],
},
},
routing: {
send: {
type: 'body',
property: 'label_id',
},
},
description: 'The label you want to operate on. Choose from the list, or specify an ID.',
},
{
displayName: 'Task Title',
name: 'taskTitle',
type: 'string',
displayOptions: {
show: {
resource: ['task'],
operation: ['create', 'update'],
},
},
routing: {
send: {
type: 'body',
property: 'title',
},
},
default: '',
required: true,
},
{
displayName: 'Additional Fields',
name: 'options',
type: 'collection',
placeholder: 'Add Option',
default: {},
displayOptions: {
show: {
resource: ['task'],
operation: ['create', 'update'],
},
},
options: [
{
displayName: 'Description',
name: 'description',
type: 'string',
default: '',
description: 'A description for the task',
typeOptions: {
rows: 4,
},
routing: {
send: {
type: 'body',
property: 'description',
},
},
},
{
displayName: 'Done',
name: 'done',
type: 'boolean',
default: false,
description: 'Whether this task is done',
routing: {
send: {
type: 'body',
property: 'done',
},
},
},
{
displayName: 'Due Date Time',
name: 'dueDateTime',
type: 'dateTime',
default: '',
description: 'Specific date and time in RFC3339 format',
routing: {
send: {
type: 'body',
property: 'due_date',
},
},
},
{
displayName: 'Start Date Time',
name: 'startDateTime',
type: 'dateTime',
default: '',
description: 'Specific date and time in RFC3339 format',
routing: {
send: {
type: 'body',
property: 'start_date',
},
},
},
{
displayName: 'End Date Time',
name: 'endDateTime',
type: 'dateTime',
default: '',
description: 'Specific date and time in RFC3339 format',
routing: {
send: {
type: 'body',
property: 'end_date',
},
},
},
{
displayName: 'Task Color',
name: 'hexColor',
type: 'color',
default: 'hex_color',
routing: {
send: {
type: 'body',
property: 'hex_color',
},
},
},
{
displayName: 'Favorite',
name: 'isFavorite',
type: 'boolean',
default: false,
description: 'Whether this task is set as a favorite task',
routing: {
send: {
type: 'body',
property: 'is_favorite',
},
},
},
{
displayName: 'Priority',
name: 'priority',
type: 'number',
typeOptions: {
maxValue: 5,
minValue: 1,
},
default: 1,
description: 'Task priority from 1 (normal) to 5 (DO NOW)',
routing: {
send: {
type: 'body',
property: 'priority',
},
},
},
{
displayName: 'Percent Done',
name: 'percentDone',
type: 'number',
typeOptions: {
maxValue: 1,
minValue: 0,
},
default: 0,
description: 'The progress of the task in percent',
routing: {
send: {
type: 'body',
property: 'percent_done',
},
},
},
{
displayName: 'Repeat After',
name: 'repeatAfter',
type: 'number',
default: 0,
description: 'The amount in seconds after this task will repeat',
routing: {
send: {
type: 'body',
property: 'repeat_after',
},
},
},
{
displayName: 'Repeat Mode',
name: 'repeatMode',
type: 'options',
options: [
{
name: 'Repeat After Amount',
description: 'Repeat after the amount specified in repeat_after',
value: 0,
},
{
name: 'Repeat Monthly',
description: 'Repeat all dates each months (ignoring repeat_after)',
value: 1,
},
{
name: 'Repeat From Current Date',
description: 'Repeat from the current date rather than the last set date',
value: 2,
},
],
default: 0,
description: 'How a repeating task will repeat itself. Will be triggered when a task is marked done.',
routing: {
send: {
type: 'body',
property: 'repeat_mode',
},
},
},
// Reminders
],
},
{
displayName: 'User ID',
name: 'userId',
type: 'number',
default: '',
required: true,
displayOptions: {
show: {
resource: ['task'],
operation: ['assignUser', 'unassignUser'],
},
},
routing: {
send: {
type: 'body',
property: 'user_id',
},
},
},
{
displayName: 'Comment ID',
name: 'commentId',
type: 'number',
default: '',
required: true,
displayOptions: {
show: {
resource: ['task'],
operation: ['updateComment', 'deleteComment'],
},
},
},
{
displayName: 'Comment Text',
name: 'commentText',
type: 'string',
typeOptions: {
rows: 4,
},
displayOptions: {
show: {
resource: ['task'],
operation: ['addComment', 'updateComment'],
},
},
routing: {
send: {
type: 'body',
property: 'comment',
},
},
default: '',
required: true,
},
{
displayName: 'Other Task ID',
description: 'The ID of the other task you want to relate the current one with',
name: 'otherTaskId',
type: 'number',
default: '',
required: true,
displayOptions: {
show: {
resource: ['task'],
operation: ['addRelation', 'removeRelation'],
},
},
routing: {
send: {
type: 'body',
property: 'other_task_id',
},
},
},
{
displayName: 'Relation Kind',
name: 'relationKind',
type: 'options',
options: [
{
name: 'Sub Task',
value: 'subtask',
},
{
name: 'Parent Task',
value: 'parenttask',
},
{
name: 'Related Task',
value: 'related',
},
{
name: 'Duplicate Of',
value: 'duplicateof',
},
{
name: 'Duplicates',
value: 'duplicates',
},
{
name: 'Blocking',
value: 'blocking',
},
{
name: 'Blocked',
value: 'blocked',
},
{
name: 'Precedes',
value: 'precedes',
},
{
name: 'Follows',
value: 'follows',
},
{
name: 'Copied From',
value: 'copiedfrom',
},
{
name: 'Coped To',
value: 'copiedto',
},
],
default: 'related',
description: 'The kind of relation between tasks',
displayOptions: {
show: {
resource: ['task'],
operation: ['addRelation', 'removeRelation'],
},
},
routing: {
send: {
type: 'body',
property: 'relation_kind',
},
},
},
{
displayName: 'Project Title',
name: 'projectTitle',
type: 'string',
displayOptions: {
show: {
resource: ['project'],
operation: ['create', 'update'],
},
},
routing: {
send: {
type: 'body',
property: 'title',
},
},
default: '',
required: true,
},
{
displayName: 'Additional Fields',
name: 'options',
type: 'collection',
placeholder: 'Add Option',
default: {},
displayOptions: {
show: {
resource: ['project'],
operation: ['create', 'update'],
},
},
options: [
{
displayName: 'Description',
name: 'description',
type: 'string',
default: '',
description: 'A description for the project',
typeOptions: {
rows: 4,
},
routing: {
send: {
type: 'body',
property: 'description',
},
},
},
{
displayName: 'Project Color',
name: 'hexColor',
type: 'color',
default: 'hex_color',
routing: {
send: {
type: 'body',
property: 'hex_color',
},
},
},
{
displayName: 'Archived',
name: 'isArchived',
type: 'boolean',
default: false,
description: 'Whether a project is archived',
routing: {
send: {
type: 'body',
property: 'is_archived',
},
},
},
{
displayName: 'Favorite',
name: 'isFavorite',
type: 'boolean',
default: false,
description: 'Whether this project is set as a favorite',
routing: {
send: {
type: 'body',
property: 'is_favorite',
},
},
},
{
displayName: 'Default Bucket ID',
name: 'defaultBucketId',
type: 'number',
default: 0,
description: 'The ID of the bucket where new tasks without a bucket are added to. By default, this is the leftmost bucket in a project.',
routing: {
send: {
type: 'body',
property: 'default_bucket_id',
},
},
},
{
displayName: 'Done Bucket ID',
name: 'doneBucketId',
type: 'number',
default: 0,
description: 'If tasks are moved to the done bucket, they are marked as done. If they are marked as done individually, they are moved into the done bucket.',
routing: {
send: {
type: 'body',
property: 'done_bucket_id',
},
},
},
{
displayName: 'Identifier',
name: 'identifier',
type: 'string',
default: '',
description: 'The unique project short identifier. Used to build task identifiers.',
routing: {
send: {
type: 'body',
property: 'identifier',
},
},
},
],
},
// More
...taskProperties,
...projectProperties,
...labelProperties,
],
}