n8n/packages/nodes-base/nodes/Flow/TaskDescription.ts

656 lines
13 KiB
TypeScript
Raw Normal View History

2021-01-13 11:20:30 -08:00
import { INodeProperties } from 'n8n-workflow';
2019-12-06 09:04:50 -08:00
export const taskOpeations: INodeProperties[] = [
2019-12-06 09:04:50 -08:00
{
displayName: 'Operation',
name: 'operation',
type: 'options',
refactor: Apply more nodelinting rules (#3324) * :pencil2: Alphabetize lint rules * :fire: Remove duplicates * :zap: Update `lintfix` script * :shirt: Apply `node-param-operation-without-no-data-expression` (#3329) * :shirt: Apply `node-param-operation-without-no-data-expression` * :shirt: Add exceptions * :shirt: Apply `node-param-description-weak` (#3328) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-option-value-duplicate` (#3331) * :shirt: Apply `node-param-description-miscased-json` (#3337) * :shirt: Apply `node-param-display-name-excess-inner-whitespace` (#3335) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-type-options-missing-from-limit` (#3336) * Rule workig as intended * :pencil2: Uncomment rules Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-option-name-duplicate` (#3338) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-description-wrong-for-simplify` (#3334) * :zap: fix * :zap: exceptions * :zap: changed rule ignoring from file to line * :shirt: Apply `node-param-resource-without-no-data-expression` (#3339) * :shirt: Apply `node-param-display-name-untrimmed` (#3341) * :shirt: Apply `node-param-display-name-miscased-id` (#3340) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-resource-with-plural-option` (#3342) * :shirt: Apply `node-param-description-wrong-for-upsert` (#3333) * :zap: fix * :zap: replaced record with contact in description * :zap: fix Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-option-description-identical-to-name` (#3343) * :shirt: Apply `node-param-option-name-containing-star` (#3347) * :shirt: Apply `node-param-display-name-wrong-for-update-fields` (#3348) * :shirt: Apply `node-param-option-name-wrong-for-get-all` (#3345) * :zap: fix * :zap: exceptions * :shirt: Apply node-param-display-name-wrong-for-simplify (#3344) * Rule working as intended * Uncomented other rules * :shirt: Undo and add exceptions Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :zap: Alphabetize lint rules * :zap: Restore `lintfix` script Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com> Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com>
2022-05-20 14:47:24 -07:00
noDataExpression: true,
2019-12-06 09:04:50 -08:00
displayOptions: {
show: {
resource: [
'task',
],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a new task',
},
{
name: 'Update',
value: 'update',
description: 'Update a task',
2019-12-06 09:04:50 -08:00
},
{
name: 'Get',
value: 'get',
description: 'Get a task',
2019-12-06 09:04:50 -08:00
},
{
name: 'Get All',
value: 'getAll',
description: 'Get all the tasks',
},
],
default: 'create',
},
];
2019-12-06 09:04:50 -08:00
export const taskFields: INodeProperties[] = [
2019-12-06 09:04:50 -08:00
/* -------------------------------------------------------------------------- */
/* task:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Workspace ID',
name: 'workspaceId',
type: 'string',
default: '',
2019-12-06 09:04:50 -08:00
required: true,
displayOptions: {
show: {
resource: [
'task',
],
operation: [
2020-10-22 06:46:03 -07:00
'create',
],
2019-12-06 09:04:50 -08:00
},
},
description: 'Create resources under the given workspace',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
2019-12-06 09:04:50 -08:00
required: true,
displayOptions: {
show: {
resource: [
'task',
],
operation: [
2020-10-22 06:46:03 -07:00
'create',
],
2019-12-06 09:04:50 -08:00
},
},
description: 'The title of the task',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
'task',
],
operation: [
'create',
],
},
},
options: [
{
displayName: 'Owner ID',
name: 'ownerid',
type: 'string',
default: '',
description: 'The ID of the account to whom this task will be assigned',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'List ID',
name: 'listID',
type: 'string',
2020-01-04 20:19:10 -08:00
default: '',
2019-12-06 09:04:50 -08:00
description: 'Put the new task in a list ("project"). Omit this param to have the task be private.',
},
{
displayName: 'Starts On',
name: 'startsOn',
type: 'dateTime',
default: '',
description: 'The date on which the task should start',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Due On',
name: 'dueOn',
type: 'dateTime',
default: '',
description: 'The date on which the task should be due',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Mirror Parent Subscribers',
name: 'mirrorParentSubscribers',
type: 'boolean',
default: false,
description: 'If this task will be a subtask, and this is true, the parent tasks\'s subscribers will be mirrored to this one',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Mirror Parent Tags',
name: 'mirrorParentTags',
type: 'boolean',
default: false,
description: 'If this task will be a subtask, and this is true, the parent tasks\'s tags will be mirrored to this one',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Note Content',
name: 'noteContent',
type: 'string',
typeOptions: {
alwaysOpenEditWindow: true,
},
default: '',
description: 'Provide the content for the task\'s note',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Note Mime Type',
name: 'noteMimeType',
type: 'options',
default: 'text/plain',
2019-12-06 09:04:50 -08:00
options: [
{
name: 'text/plain',
value: 'text/plain',
},
{
name: 'text/x-markdown',
value: 'text/x-markdown',
},
{
name: 'text/html',
value: 'text/html',
2020-10-22 06:46:03 -07:00
},
2019-12-06 09:04:50 -08:00
],
description: 'Identify which markup language is used to format the given note',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Parent ID',
name: 'parentId',
type: 'string',
default: '',
description: 'If provided, this task will become a subtask of the given task',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Position List',
name: 'positionList',
type: 'number',
default: 0,
description: 'Determines the sort order when showing tasks in, or grouped by, a list',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Position Upcoming',
name: 'positionUpcoming',
type: 'number',
default: 0,
description: 'Determines the sort order when showing tasks grouped by their due_date',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Position',
name: 'position',
type: 'number',
default: 0,
description: 'Determines the sort order of tasks',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Section ID',
name: 'sectionId',
type: 'string',
default: '',
description: 'Specify which section under which to create this task',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Tags',
name: 'tags',
type: 'string',
default: '',
description: 'A list of tag names to apply to the new task separated by a comma (,)',
2019-12-06 09:04:50 -08:00
},
],
},
/* -------------------------------------------------------------------------- */
/* task:update */
/* -------------------------------------------------------------------------- */
{
displayName: 'Workspace ID',
name: 'workspaceId',
type: 'string',
default: '',
2019-12-06 09:04:50 -08:00
required: true,
displayOptions: {
show: {
resource: [
'task',
],
operation: [
2020-10-22 06:46:03 -07:00
'update',
],
2019-12-06 09:04:50 -08:00
},
},
description: 'Create resources under the given workspace',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Task ID',
name: 'taskId',
type: 'string',
default: '',
2019-12-06 09:04:50 -08:00
required: true,
displayOptions: {
show: {
resource: [
'task',
],
operation: [
2020-10-22 06:46:03 -07:00
'update',
],
2019-12-06 09:04:50 -08:00
},
},
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Update Field',
default: {},
displayOptions: {
show: {
resource: [
'task',
],
operation: [
'update',
],
},
},
options: [
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
description: 'The title of the task',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Completed',
name: 'completed',
type: 'boolean',
default: false,
description: 'If set to true, will complete the task',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Owner ID',
name: 'ownerid',
type: 'string',
default: '',
description: 'The ID of the account to whom this task will be assigned',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'List ID',
name: 'listID',
type: 'string',
default: '',
description: 'Put the new task in a list ("project"). Omit this param to have the task be private.',
},
{
displayName: 'Starts On',
name: 'startsOn',
type: 'dateTime',
default: '',
description: 'The date on which the task should start',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Due On',
name: 'dueOn',
type: 'dateTime',
default: '',
description: 'The date on which the task should be due',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Mirror Parent Subscribers',
name: 'mirrorParentSubscribers',
type: 'boolean',
default: false,
description: 'If this task will be a subtask, and this is true, the parent tasks\'s subscribers will be mirrored to this one',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Mirror Parent Tags',
name: 'mirrorParentTags',
type: 'boolean',
default: false,
description: 'If this task will be a subtask, and this is true, the parent tasks\'s tags will be mirrored to this one',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Note Content',
name: 'noteContent',
type: 'string',
typeOptions: {
alwaysOpenEditWindow: true,
},
default: '',
description: 'Provide the content for the task\'s note',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Note Mime Type',
name: 'noteMimeType',
type: 'options',
default: 'text/plain',
2019-12-06 09:04:50 -08:00
options: [
{
name: 'text/plain',
value: 'text/plain',
},
{
name: 'text/x-markdown',
value: 'text/x-markdown',
},
{
name: 'text/html',
value: 'text/html',
2020-10-22 06:46:03 -07:00
},
2019-12-06 09:04:50 -08:00
],
description: 'Identify which markup language is used to format the given note',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Parent ID',
name: 'parentId',
type: 'string',
default: '',
description: 'If provided, this task will become a subtask of the given task',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Position List',
name: 'positionList',
type: 'number',
default: 0,
description: 'Determines the sort order when showing tasks in, or grouped by, a list',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Position Upcoming',
name: 'positionUpcoming',
type: 'number',
default: 0,
description: 'Determines the sort order when showing tasks grouped by their due_date',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Position',
name: 'position',
type: 'number',
default: 0,
description: 'Determines the sort order of tasks',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Section ID',
name: 'sectionId',
type: 'string',
default: '',
description: 'Specify which section under which to create this task',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Tags',
name: 'tags',
type: 'string',
default: '',
description: 'A list of tag names to apply to the new task separated by a comma (,)',
2019-12-06 09:04:50 -08:00
},
],
},
/* -------------------------------------------------------------------------- */
/* task:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Task ID',
name: 'taskId',
type: 'string',
default: '',
2019-12-06 09:04:50 -08:00
required: true,
displayOptions: {
show: {
resource: [
'task',
],
operation: [
2020-10-22 06:46:03 -07:00
'get',
],
2019-12-06 09:04:50 -08:00
},
},
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: [
'task',
],
operation: [
'get',
],
},
},
options: [
{
displayName: 'Include',
name: 'include',
type: 'multiOptions',
default: [],
options: [
{
name: 'schedule',
value: 'schedule',
},
{
name: 'files',
value: 'files',
},
{
name: 'file Associations',
value: 'file_associations',
},
{
name: 'Parent',
value: 'parent',
},
2020-10-22 06:46:03 -07:00
],
2019-12-06 09:04:50 -08:00
},
],
},
/* -------------------------------------------------------------------------- */
/* task:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: [
'task',
],
operation: [
2020-10-22 06:46:03 -07:00
'getAll',
],
2019-12-06 09:04:50 -08:00
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: [
'task',
],
operation: [
2020-10-22 06:46:03 -07:00
'getAll',
2019-12-06 09:04:50 -08:00
],
returnAll: [
false,
],
},
},
typeOptions: {
minValue: 1,
maxValue: 100,
},
default: 50,
description: 'Max number of results to return',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: [
'task',
],
operation: [
'getAll',
],
},
},
options: [
{
displayName: 'Include',
name: 'include',
type: 'multiOptions',
default: [],
options: [
{
name: 'schedule',
value: 'schedule',
},
{
name: 'files',
value: 'files',
},
{
name: 'file Associations',
value: 'file_associations',
},
{
name: 'Parent',
value: 'parent',
},
2020-10-22 06:46:03 -07:00
],
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Order',
name: 'order',
type: 'options',
default: 'created_at',
2019-12-06 09:04:50 -08:00
options: [
{
name: 'Due On',
value: 'due_on',
},
{
name: 'Starts On',
value: 'starts_on',
},
{
name: 'Created At',
value: 'created_at',
},
{
name: 'Position',
value: 'position',
},
{
name: 'Account ID',
value: 'account_id',
},
{
name: 'List ID',
value: 'list_id',
},
{
name: 'Section ID',
value: 'section_id',
},
{
name: 'Owner ID',
value: 'owner_id',
},
{
name: 'Name',
value: 'name',
},
{
name: 'Completed At',
value: 'completed_at',
},
{
name: 'Updated At',
value: 'updated_at',
},
2020-10-22 06:46:03 -07:00
],
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Workspace ID',
name: 'workspaceId',
type: 'string',
default: '',
description: 'Create resources under the given workspace',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Created Before',
name: 'createdBefore',
type: 'dateTime',
default: '',
description: 'Select resources created before a certain time',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Created After',
name: 'createdAfter',
type: 'dateTime',
default: '',
description: 'Select resources created after a certain time',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Update Before',
name: 'updateBefore',
type: 'dateTime',
default: '',
description: 'Select resources updated before a certain time',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Update After',
name: 'updateAfter',
type: 'dateTime',
default: '',
description: 'Select resources updated after a certain time',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Deleted',
name: 'deleted',
type: 'boolean',
default: false,
description: 'Select deleted resources',
2019-12-06 09:04:50 -08:00
},
{
displayName: 'Cleared',
name: 'cleared',
type: 'boolean',
default: false,
description: 'Select cleared resources',
2019-12-06 09:04:50 -08:00
},
],
},
];