mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-27 21:49:41 -08:00
88dea330b9
* ⚡ Update `lintfix` script * ⚡ Run baseline `lintfix` * 🔥 Remove unneeded exceptions (#3538) * 🔥 Remove exceptions for `node-param-default-wrong-for-simplify` * 🔥 Remove exceptions for `node-param-placeholder-miscased-id` * ⚡ Update version * 👕 Apply `node-param-placeholder-missing` (#3542) * 👕 Apply `filesystem-wrong-cred-filename` (#3543) * 👕 Apply `node-param-description-missing-from-dynamic-options` (#3545) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply `node-class-description-empty-string` (#3546) * 👕 Apply `node-class-description-icon-not-svg` (#3548) * 👕 Apply `filesystem-wrong-node-filename` (#3549) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Expand lintings to credentials (#3550) * 👕 Apply `node-param-multi-options-type-unsorted-items` (#3552) * ⚡ fix * ⚡ Minor fixes Co-authored-by: Michael Kret <michael.k@radency.com> * 👕 Apply `node-param-description-wrong-for-dynamic-multi-options` (#3541) * ⚡ Add new lint rule, node-param-description-wrong-for-dynamic-multi-options * ⚡ Fix with updated linting rules * ⚡ Minor fixes Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply `node-param-description-boolean-without-whether` (#3553) * ⚡ fix * Update packages/nodes-base/nodes/Clockify/ProjectDescription.ts Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply node-param-display-name-wrong-for-dynamic-multi-options (#3537) * 👕 Add exceptions * 👕 Add exception * ✏️ Alphabetize rules * ⚡ Restore `lintfix` command Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com> Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: Michael Kret <michael.k@radency.com> Co-authored-by: brianinoa <54530642+brianinoa@users.noreply.github.com> Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com>
658 lines
14 KiB
TypeScript
658 lines
14 KiB
TypeScript
import { INodeProperties } from 'n8n-workflow';
|
|
|
|
export const taskOpeations: INodeProperties[] = [
|
|
{
|
|
displayName: 'Operation',
|
|
name: 'operation',
|
|
type: 'options',
|
|
noDataExpression: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'task',
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: 'Create',
|
|
value: 'create',
|
|
description: 'Create a new task',
|
|
},
|
|
{
|
|
name: 'Update',
|
|
value: 'update',
|
|
description: 'Update a task',
|
|
},
|
|
{
|
|
name: 'Get',
|
|
value: 'get',
|
|
description: 'Get a task',
|
|
},
|
|
{
|
|
name: 'Get All',
|
|
value: 'getAll',
|
|
description: 'Get all the tasks',
|
|
},
|
|
],
|
|
default: 'create',
|
|
},
|
|
];
|
|
|
|
export const taskFields: INodeProperties[] = [
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
/* task:create */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Workspace ID',
|
|
name: 'workspaceId',
|
|
type: 'string',
|
|
default: '',
|
|
required: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'task',
|
|
],
|
|
operation: [
|
|
'create',
|
|
],
|
|
},
|
|
},
|
|
description: 'Create resources under the given workspace',
|
|
},
|
|
{
|
|
displayName: 'Name',
|
|
name: 'name',
|
|
type: 'string',
|
|
default: '',
|
|
required: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'task',
|
|
],
|
|
operation: [
|
|
'create',
|
|
],
|
|
},
|
|
},
|
|
description: 'The title of the task',
|
|
},
|
|
{
|
|
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',
|
|
},
|
|
{
|
|
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',
|
|
},
|
|
{
|
|
displayName: 'Due On',
|
|
name: 'dueOn',
|
|
type: 'dateTime',
|
|
default: '',
|
|
description: 'The date on which the task should be due',
|
|
},
|
|
{
|
|
displayName: 'Mirror Parent Subscribers',
|
|
name: 'mirrorParentSubscribers',
|
|
type: 'boolean',
|
|
default: false,
|
|
description: 'Whether this task will be a subtask, and this is true, the parent tasks\'s subscribers will be mirrored to this one',
|
|
},
|
|
{
|
|
displayName: 'Mirror Parent Tags',
|
|
name: 'mirrorParentTags',
|
|
type: 'boolean',
|
|
default: false,
|
|
description: 'Whether this task will be a subtask, and this is true, the parent tasks\'s tags will be mirrored to this one',
|
|
},
|
|
{
|
|
displayName: 'Note Content',
|
|
name: 'noteContent',
|
|
type: 'string',
|
|
typeOptions: {
|
|
alwaysOpenEditWindow: true,
|
|
},
|
|
default: '',
|
|
description: 'Provide the content for the task\'s note',
|
|
},
|
|
{
|
|
displayName: 'Note Mime Type',
|
|
name: 'noteMimeType',
|
|
type: 'options',
|
|
default: 'text/plain',
|
|
options: [
|
|
{
|
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
name: 'text/plain',
|
|
value: 'text/plain',
|
|
},
|
|
{
|
|
name: 'text/x-markdown',
|
|
value: 'text/x-markdown',
|
|
},
|
|
{
|
|
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
|
name: 'text/html',
|
|
value: 'text/html',
|
|
},
|
|
],
|
|
description: 'Identify which markup language is used to format the given note',
|
|
},
|
|
{
|
|
displayName: 'Parent ID',
|
|
name: 'parentId',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'If provided, this task will become a subtask of the given task',
|
|
},
|
|
{
|
|
displayName: 'Position List',
|
|
name: 'positionList',
|
|
type: 'number',
|
|
default: 0,
|
|
description: 'Determines the sort order when showing tasks in, or grouped by, a list',
|
|
},
|
|
{
|
|
displayName: 'Position Upcoming',
|
|
name: 'positionUpcoming',
|
|
type: 'number',
|
|
default: 0,
|
|
description: 'Determines the sort order when showing tasks grouped by their due_date',
|
|
},
|
|
{
|
|
displayName: 'Position',
|
|
name: 'position',
|
|
type: 'number',
|
|
default: 0,
|
|
description: 'Determines the sort order of tasks',
|
|
},
|
|
{
|
|
displayName: 'Section ID',
|
|
name: 'sectionId',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Specify which section under which to create this task',
|
|
},
|
|
{
|
|
displayName: 'Tags',
|
|
name: 'tags',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'A list of tag names to apply to the new task separated by a comma (,)',
|
|
},
|
|
],
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
/* task:update */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Workspace ID',
|
|
name: 'workspaceId',
|
|
type: 'string',
|
|
default: '',
|
|
required: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'task',
|
|
],
|
|
operation: [
|
|
'update',
|
|
],
|
|
},
|
|
},
|
|
description: 'Create resources under the given workspace',
|
|
},
|
|
{
|
|
displayName: 'Task ID',
|
|
name: 'taskId',
|
|
type: 'string',
|
|
default: '',
|
|
required: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'task',
|
|
],
|
|
operation: [
|
|
'update',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
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',
|
|
},
|
|
{
|
|
displayName: 'Completed',
|
|
name: 'completed',
|
|
type: 'boolean',
|
|
default: false,
|
|
description: 'Whether to complete the task',
|
|
},
|
|
{
|
|
displayName: 'Owner ID',
|
|
name: 'ownerid',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'The ID of the account to whom this task will be assigned',
|
|
},
|
|
{
|
|
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',
|
|
},
|
|
{
|
|
displayName: 'Due On',
|
|
name: 'dueOn',
|
|
type: 'dateTime',
|
|
default: '',
|
|
description: 'The date on which the task should be due',
|
|
},
|
|
{
|
|
displayName: 'Mirror Parent Subscribers',
|
|
name: 'mirrorParentSubscribers',
|
|
type: 'boolean',
|
|
default: false,
|
|
description: 'Whether this task will be a subtask, and this is true, the parent tasks\'s subscribers will be mirrored to this one',
|
|
},
|
|
{
|
|
displayName: 'Mirror Parent Tags',
|
|
name: 'mirrorParentTags',
|
|
type: 'boolean',
|
|
default: false,
|
|
description: 'Whether this task will be a subtask, and this is true, the parent tasks\'s tags will be mirrored to this one',
|
|
},
|
|
{
|
|
displayName: 'Note Content',
|
|
name: 'noteContent',
|
|
type: 'string',
|
|
typeOptions: {
|
|
alwaysOpenEditWindow: true,
|
|
},
|
|
default: '',
|
|
description: 'Provide the content for the task\'s note',
|
|
},
|
|
{
|
|
displayName: 'Note Mime Type',
|
|
name: 'noteMimeType',
|
|
type: 'options',
|
|
default: 'text/plain',
|
|
options: [
|
|
{
|
|
name: 'Text/plain',
|
|
value: 'text/plain',
|
|
},
|
|
{
|
|
name: 'text/x-markdown',
|
|
value: 'text/x-markdown',
|
|
},
|
|
{
|
|
name: 'Text/html',
|
|
value: 'text/html',
|
|
},
|
|
],
|
|
description: 'Identify which markup language is used to format the given note',
|
|
},
|
|
{
|
|
displayName: 'Parent ID',
|
|
name: 'parentId',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'If provided, this task will become a subtask of the given task',
|
|
},
|
|
{
|
|
displayName: 'Position List',
|
|
name: 'positionList',
|
|
type: 'number',
|
|
default: 0,
|
|
description: 'Determines the sort order when showing tasks in, or grouped by, a list',
|
|
},
|
|
{
|
|
displayName: 'Position Upcoming',
|
|
name: 'positionUpcoming',
|
|
type: 'number',
|
|
default: 0,
|
|
description: 'Determines the sort order when showing tasks grouped by their due_date',
|
|
},
|
|
{
|
|
displayName: 'Position',
|
|
name: 'position',
|
|
type: 'number',
|
|
default: 0,
|
|
description: 'Determines the sort order of tasks',
|
|
},
|
|
{
|
|
displayName: 'Section ID',
|
|
name: 'sectionId',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Specify which section under which to create this task',
|
|
},
|
|
{
|
|
displayName: 'Tags',
|
|
name: 'tags',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'A list of tag names to apply to the new task separated by a comma (,)',
|
|
},
|
|
],
|
|
},
|
|
/* -------------------------------------------------------------------------- */
|
|
/* task:get */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Task ID',
|
|
name: 'taskId',
|
|
type: 'string',
|
|
default: '',
|
|
required: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'task',
|
|
],
|
|
operation: [
|
|
'get',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
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',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
/* -------------------------------------------------------------------------- */
|
|
/* task:getAll */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Return All',
|
|
name: 'returnAll',
|
|
type: 'boolean',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'task',
|
|
],
|
|
operation: [
|
|
'getAll',
|
|
],
|
|
},
|
|
},
|
|
default: false,
|
|
description: 'Whether to return all results or only up to a given limit',
|
|
},
|
|
{
|
|
displayName: 'Limit',
|
|
name: 'limit',
|
|
type: 'number',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'task',
|
|
],
|
|
operation: [
|
|
'getAll',
|
|
],
|
|
returnAll: [
|
|
false,
|
|
],
|
|
},
|
|
},
|
|
typeOptions: {
|
|
minValue: 1,
|
|
maxValue: 100,
|
|
},
|
|
default: 50,
|
|
description: 'Max number of results to return',
|
|
},
|
|
{
|
|
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',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
displayName: 'Order',
|
|
name: 'order',
|
|
type: 'options',
|
|
default: 'created_at',
|
|
options: [
|
|
{
|
|
name: 'Account ID',
|
|
value: 'account_id',
|
|
},
|
|
{
|
|
name: 'Completed At',
|
|
value: 'completed_at',
|
|
},
|
|
{
|
|
name: 'Created At',
|
|
value: 'created_at',
|
|
},
|
|
{
|
|
name: 'Due On',
|
|
value: 'due_on',
|
|
},
|
|
{
|
|
name: 'List ID',
|
|
value: 'list_id',
|
|
},
|
|
{
|
|
name: 'Name',
|
|
value: 'name',
|
|
},
|
|
{
|
|
name: 'Owner ID',
|
|
value: 'owner_id',
|
|
},
|
|
{
|
|
name: 'Position',
|
|
value: 'position',
|
|
},
|
|
{
|
|
name: 'Section ID',
|
|
value: 'section_id',
|
|
},
|
|
{
|
|
name: 'Starts On',
|
|
value: 'starts_on',
|
|
},
|
|
{
|
|
name: 'Updated At',
|
|
value: 'updated_at',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
displayName: 'Workspace ID',
|
|
name: 'workspaceId',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Create resources under the given workspace',
|
|
},
|
|
{
|
|
displayName: 'Created Before',
|
|
name: 'createdBefore',
|
|
type: 'dateTime',
|
|
default: '',
|
|
description: 'Select resources created before a certain time',
|
|
},
|
|
{
|
|
displayName: 'Created After',
|
|
name: 'createdAfter',
|
|
type: 'dateTime',
|
|
default: '',
|
|
description: 'Select resources created after a certain time',
|
|
},
|
|
{
|
|
displayName: 'Update Before',
|
|
name: 'updateBefore',
|
|
type: 'dateTime',
|
|
default: '',
|
|
description: 'Select resources updated before a certain time',
|
|
},
|
|
{
|
|
displayName: 'Update After',
|
|
name: 'updateAfter',
|
|
type: 'dateTime',
|
|
default: '',
|
|
description: 'Select resources updated after a certain time',
|
|
},
|
|
{
|
|
displayName: 'Deleted',
|
|
name: 'deleted',
|
|
type: 'boolean',
|
|
default: false,
|
|
description: 'Whether to select deleted resources',
|
|
},
|
|
{
|
|
displayName: 'Cleared',
|
|
name: 'cleared',
|
|
type: 'boolean',
|
|
default: false,
|
|
description: 'Whether to select cleared resources',
|
|
},
|
|
],
|
|
},
|
|
];
|