2020-06-17 14:15:54 -07:00
import {
INodeProperties ,
} from 'n8n-workflow' ;
2020-06-15 15:47:44 -07:00
2021-12-03 00:44:16 -08:00
export const taskOperations : INodeProperties [ ] = [
2020-06-15 15:47:44 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-06-15 15:47:44 -07:00
displayOptions : {
show : {
2020-06-17 12:49:37 -07:00
resource : [
'task' ,
] ,
} ,
2020-06-15 15:47:44 -07:00
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
2020-06-17 12:49:37 -07:00
description : 'Add a task to tasklist' ,
2020-06-15 15:47:44 -07:00
} ,
{
name : 'Delete' ,
value : 'delete' ,
2020-06-17 12:49:37 -07:00
description : 'Delete a task' ,
2020-06-15 15:47:44 -07:00
} ,
{
name : 'Get' ,
value : 'get' ,
2020-06-17 12:49:37 -07:00
description : 'Retrieve a task' ,
2020-06-15 15:47:44 -07:00
} ,
{
name : 'Get All' ,
value : 'getAll' ,
2020-06-17 12:49:37 -07:00
description : 'Retrieve all tasks from a tasklist' ,
2020-06-15 15:47:44 -07:00
} ,
{
name : 'Update' ,
value : 'update' ,
2020-06-17 12:49:37 -07:00
description : 'Update a task' ,
2020-10-22 06:46:03 -07:00
} ,
2020-06-15 15:47:44 -07:00
] ,
default : 'create' ,
2020-10-22 06:46:03 -07:00
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-06-15 15:47:44 -07:00
2021-12-03 00:44:16 -08:00
export const taskFields : INodeProperties [ ] = [
2020-06-15 15:47:44 -07:00
/* -------------------------------------------------------------------------- */
2020-06-17 14:15:54 -07:00
/* task:create */
2020-06-15 15:47:44 -07:00
/* -------------------------------------------------------------------------- */
{
displayName : 'TaskList' ,
name : 'task' ,
type : 'options' ,
typeOptions : {
2020-06-17 12:49:37 -07:00
loadOptionsMethod : 'getTasks' ,
2020-06-15 15:47:44 -07:00
} ,
required : true ,
displayOptions : {
show : {
2020-06-17 12:49:37 -07:00
operation : [
'create' ,
] ,
resource : [
'task' ,
] ,
2020-06-17 14:15:54 -07:00
} ,
2020-06-15 15:47:44 -07:00
} ,
2020-06-17 12:49:37 -07:00
default : '' ,
2020-06-15 15:47:44 -07:00
} ,
2020-07-05 02:33:05 -07:00
{
displayName : 'Title' ,
name : 'title' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Title of the task' ,
2022-03-31 23:32:41 -07:00
displayOptions : {
show : {
operation : [
'create' ,
] ,
resource : [
'task' ,
] ,
} ,
} ,
2020-07-05 02:33:05 -07:00
} ,
2020-06-15 15:47:44 -07:00
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2020-06-17 12:49:37 -07:00
operation : [
'create' ,
] ,
resource : [
'task' ,
] ,
2020-10-22 06:46:03 -07:00
} ,
2020-06-15 15:47:44 -07:00
} ,
options : [
{
2020-06-17 14:15:54 -07:00
displayName : 'Completion Date' ,
2020-06-15 15:47:44 -07:00
name : 'completed' ,
type : 'dateTime' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Completion date of the task (as a RFC 3339 timestamp). This field is omitted if the task has not been completed.' ,
2020-06-15 15:47:44 -07:00
} ,
{
2020-06-17 14:15:54 -07:00
displayName : 'Deleted' ,
2020-06-15 15:47:44 -07:00
name : 'deleted' ,
type : 'boolean' ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Flag indicating whether the task has been deleted' ,
2020-06-15 15:47:44 -07:00
} ,
{
2020-06-17 12:49:37 -07:00
displayName : 'Due Date' ,
name : 'dueDate' ,
type : 'dateTime' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Due date of the task' ,
2020-06-17 12:49:37 -07:00
} ,
{
displayName : 'Notes' ,
name : 'notes' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Additional Notes' ,
2020-06-15 15:47:44 -07:00
} ,
{
displayName : 'Parent' ,
name : 'parent' ,
type : 'string' ,
default : '' ,
2020-06-17 12:49:37 -07:00
description : 'Parent task identifier. If the task is created at the top level, this parameter is omitted.' ,
2020-06-15 15:47:44 -07:00
} ,
{
2020-06-17 12:49:37 -07:00
displayName : 'Previous' ,
name : 'previous' ,
2020-06-15 15:47:44 -07:00
type : 'string' ,
default : '' ,
2020-06-17 12:49:37 -07:00
description : 'Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted.' ,
2020-06-15 15:47:44 -07:00
} ,
{
2020-06-17 12:49:37 -07:00
displayName : 'Status' ,
name : 'status' ,
type : 'options' ,
options : [
{
2020-06-17 14:15:54 -07:00
name : 'Needs Action' ,
2020-06-17 12:49:37 -07:00
value : 'needsAction' ,
} ,
{
2020-06-17 14:15:54 -07:00
name : 'Completed' ,
2020-06-17 12:49:37 -07:00
value : 'completed' ,
2020-10-22 06:46:03 -07:00
} ,
2020-06-17 12:49:37 -07:00
] ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Current status of the task' ,
2020-06-17 12:49:37 -07:00
} ,
2020-07-05 02:33:05 -07:00
2020-06-17 14:15:54 -07:00
] ,
2020-06-15 15:47:44 -07:00
} ,
/* -------------------------------------------------------------------------- */
2020-06-17 14:15:54 -07:00
/* task:delete */
2020-06-15 15:47:44 -07:00
/* -------------------------------------------------------------------------- */
{
displayName : 'TaskList' ,
name : 'task' ,
type : 'options' ,
typeOptions : {
2020-06-17 12:49:37 -07:00
loadOptionsMethod : 'getTasks' ,
2020-06-15 15:47:44 -07:00
} ,
required : true ,
displayOptions : {
show : {
2020-06-17 12:49:37 -07:00
operation : [
'delete' ,
] ,
resource : [
'task' ,
] ,
2020-06-17 14:15:54 -07:00
} ,
2020-06-15 15:47:44 -07:00
} ,
2020-06-17 12:49:37 -07:00
default : '' ,
2020-06-15 15:47:44 -07:00
} ,
{
displayName : 'Task ID' ,
name : 'taskId' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
2020-06-17 12:49:37 -07:00
operation : [
'delete' ,
] ,
resource : [
'task' ,
] ,
2020-06-17 14:15:54 -07:00
} ,
2020-06-15 15:47:44 -07:00
} ,
2020-06-17 12:49:37 -07:00
default : '' ,
2020-06-15 15:47:44 -07:00
} ,
/* -------------------------------------------------------------------------- */
2020-06-17 14:15:54 -07:00
/* task:get */
2020-06-15 15:47:44 -07:00
/* -------------------------------------------------------------------------- */
{
displayName : 'TaskList' ,
name : 'task' ,
type : 'options' ,
typeOptions : {
2020-06-17 12:49:37 -07:00
loadOptionsMethod : 'getTasks' ,
2020-06-15 15:47:44 -07:00
} ,
required : true ,
displayOptions : {
show : {
2020-06-17 12:49:37 -07:00
operation : [
'get' ,
] ,
resource : [
'task' ,
] ,
2020-10-22 06:46:03 -07:00
} ,
2020-06-15 15:47:44 -07:00
} ,
2020-06-17 12:49:37 -07:00
default : '' ,
2020-06-15 15:47:44 -07:00
} ,
{
displayName : 'Task ID' ,
name : 'taskId' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
2020-06-17 12:49:37 -07:00
operation : [
'get' ,
] ,
resource : [
'task' ,
] ,
2020-06-17 14:15:54 -07:00
} ,
2020-06-15 15:47:44 -07:00
} ,
2020-06-17 12:49:37 -07:00
default : '' ,
2020-06-15 15:47:44 -07:00
} ,
/* -------------------------------------------------------------------------- */
2020-06-17 14:15:54 -07:00
/* task:getAll */
2020-06-15 15:47:44 -07:00
/* -------------------------------------------------------------------------- */
{
displayName : 'TaskList' ,
name : 'task' ,
type : 'options' ,
typeOptions : {
2020-06-17 12:49:37 -07:00
loadOptionsMethod : 'getTasks' ,
2020-06-15 15:47:44 -07:00
} ,
required : true ,
displayOptions : {
show : {
2020-06-17 12:49:37 -07:00
operation : [
'getAll' ,
] ,
resource : [
'task' ,
] ,
2020-06-17 14:15:54 -07:00
} ,
2020-06-15 15:47:44 -07:00
} ,
2020-06-17 12:49:37 -07:00
default : '' ,
2020-06-15 15:47:44 -07:00
} ,
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2020-06-17 12:49:37 -07:00
operation : [
'getAll' ,
] ,
resource : [
'task' ,
] ,
2020-06-17 14:15:54 -07:00
} ,
2020-06-15 15:47:44 -07:00
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2020-06-15 15:47:44 -07:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2020-06-17 12:49:37 -07:00
operation : [
'getAll' ,
] ,
resource : [
'task' ,
] ,
returnAll : [
false ,
] ,
2020-06-17 14:15:54 -07:00
} ,
2020-06-15 15:47:44 -07:00
} ,
typeOptions : {
minValue : 1 ,
2020-10-22 06:46:03 -07:00
maxValue : 100 ,
2020-06-15 15:47:44 -07:00
} ,
default : 20 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-06-15 15:47:44 -07:00
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2020-06-17 12:49:37 -07:00
operation : [
'getAll' ,
] ,
resource : [
'task' ,
] ,
2020-06-17 14:15:54 -07:00
} ,
2020-06-15 15:47:44 -07:00
} ,
options : [
{
displayName : 'Completed Max' ,
name : 'completedMax' ,
type : 'dateTime' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Upper bound for a task completion date (as a RFC 3339 timestamp) to filter by' ,
2020-06-15 15:47:44 -07:00
} ,
{
displayName : 'Completed Min' ,
name : 'completedMin' ,
type : 'dateTime' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Lower bound for a task completion date (as a RFC 3339 timestamp) to filter by' ,
2020-06-15 15:47:44 -07:00
} ,
{
displayName : 'Due Min' ,
name : 'dueMin' ,
type : 'dateTime' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Lower bound for a task due date (as a RFC 3339 timestamp) to filter by' ,
2020-06-15 15:47:44 -07:00
} ,
{
displayName : 'Due Max' ,
name : 'dueMax' ,
type : 'dateTime' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Upper bound for a task due date (as a RFC 3339 timestamp) to filter by' ,
2020-06-15 15:47:44 -07:00
} ,
{
displayName : 'Show Completed' ,
name : 'showCompleted' ,
type : 'boolean' ,
default : true ,
2022-05-06 14:01:25 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-description-unencoded-angle-brackets
2022-03-31 23:32:41 -07:00
description : 'Flag indicating whether completed tasks are returned in the result. <strong>Show Hidden</strong> must also be True to show tasks completed in first party clients such as the web UI or Google\'s mobile apps.' ,
2020-06-15 15:47:44 -07:00
} ,
{
displayName : 'Show Deleted' ,
name : 'showDeleted' ,
type : 'boolean' ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Flag indicating whether deleted tasks are returned in the result' ,
2020-06-15 15:47:44 -07:00
} ,
{
displayName : 'Show Hidden' ,
name : 'showHidden' ,
type : 'boolean' ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Flag indicating whether hidden tasks are returned in the result' ,
2020-06-15 15:47:44 -07:00
} ,
{
2020-06-16 10:28:22 -07:00
displayName : 'Updated Min' ,
2020-06-15 15:47:44 -07:00
name : 'updatedMin' ,
2020-06-17 14:15:54 -07:00
type : 'dateTime' ,
2020-06-17 12:49:37 -07:00
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Lower bound for a task last modification time (as a RFC 3339 timestamp) to filter by' ,
2020-06-17 12:49:37 -07:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-06-15 15:47:44 -07:00
} ,
/* -------------------------------------------------------------------------- */
2020-06-17 14:15:54 -07:00
/* task:update */
2020-06-15 15:47:44 -07:00
/* -------------------------------------------------------------------------- */
{
displayName : 'TaskList' ,
name : 'task' ,
type : 'options' ,
typeOptions : {
2020-06-17 12:49:37 -07:00
loadOptionsMethod : 'getTasks' ,
2020-06-15 15:47:44 -07:00
} ,
required : true ,
displayOptions : {
show : {
2020-06-17 12:49:37 -07:00
operation : [
'update' ,
] ,
resource : [
'task' ,
] ,
2020-06-17 14:15:54 -07:00
} ,
2020-06-15 15:47:44 -07:00
} ,
2020-06-17 12:49:37 -07:00
default : '' ,
2020-06-15 15:47:44 -07:00
} ,
{
displayName : 'Task ID' ,
name : 'taskId' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
2020-06-17 12:49:37 -07:00
operation : [
'update' ,
] ,
resource : [
'task' ,
] ,
2020-06-17 14:15:54 -07:00
} ,
2020-06-15 15:47:44 -07:00
} ,
2020-06-17 12:49:37 -07:00
default : '' ,
2020-06-15 15:47:44 -07:00
} ,
{
displayName : 'Update Fields' ,
name : 'updateFields' ,
type : 'collection' ,
placeholder : 'Update Field' ,
default : { } ,
displayOptions : {
show : {
2020-06-17 12:49:37 -07:00
operation : [
'update' ,
] ,
resource : [
'task' ,
] ,
2020-10-22 06:46:03 -07:00
} ,
2020-06-15 15:47:44 -07:00
} ,
options : [
{
2020-06-17 14:15:54 -07:00
displayName : 'Completion Date' ,
2020-06-15 15:47:44 -07:00
name : 'completed' ,
type : 'dateTime' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Completion date of the task (as a RFC 3339 timestamp). This field is omitted if the task has not been completed.' ,
2020-06-15 15:47:44 -07:00
} ,
{
2020-06-17 14:15:54 -07:00
displayName : 'Deleted' ,
2020-06-15 15:47:44 -07:00
name : 'deleted' ,
type : 'boolean' ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Flag indicating whether the task has been deleted' ,
2020-06-15 15:47:44 -07:00
} ,
2021-11-13 01:16:56 -08:00
{
displayName : 'Due Date' ,
name : 'dueDate' ,
type : 'dateTime' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Due date of the task' ,
2021-11-13 01:16:56 -08:00
} ,
2020-06-15 15:47:44 -07:00
{
2020-06-17 12:49:37 -07:00
displayName : 'Notes' ,
name : 'notes' ,
2020-06-15 15:47:44 -07:00
type : 'string' ,
2020-06-17 14:15:54 -07:00
typeOptions : {
alwaysOpenEditWindow : true ,
} ,
2020-06-15 15:47:44 -07:00
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Additional Notes' ,
2020-06-15 15:47:44 -07:00
} ,
{
2020-06-17 12:49:37 -07:00
displayName : 'Previous' ,
name : 'previous' ,
2020-06-15 15:47:44 -07:00
type : 'string' ,
default : '' ,
2020-06-17 12:49:37 -07:00
description : 'Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted.' ,
2020-06-15 15:47:44 -07:00
} ,
{
2020-06-17 12:49:37 -07:00
displayName : 'Status' ,
name : 'status' ,
type : 'options' ,
options : [
{
2020-06-17 14:15:54 -07:00
name : 'Needs Update' ,
2020-06-17 12:49:37 -07:00
value : 'needsAction' ,
} ,
{
2020-06-17 14:15:54 -07:00
name : 'Completed' ,
2020-06-17 12:49:37 -07:00
value : 'completed' ,
2020-10-22 06:46:03 -07:00
} ,
2020-06-17 12:49:37 -07:00
] ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Current status of the task' ,
2020-06-17 12:49:37 -07:00
} ,
{
displayName : 'Title' ,
name : 'title' ,
2020-06-15 15:47:44 -07:00
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Title of the task' ,
2020-06-17 12:49:37 -07:00
} ,
2020-06-17 14:15:54 -07:00
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;