mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-26 21:19:43 -08:00
357 lines
6.5 KiB
TypeScript
357 lines
6.5 KiB
TypeScript
|
import {
|
||
|
INodeProperties,
|
||
|
} from 'n8n-workflow';
|
||
|
|
||
|
export const taskOperations = [
|
||
|
{
|
||
|
displayName: 'Operation',
|
||
|
name: 'operation',
|
||
|
type: 'options',
|
||
|
displayOptions: {
|
||
|
show: {
|
||
|
resource: [
|
||
|
'task',
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
options: [
|
||
|
{
|
||
|
name: 'Create',
|
||
|
value: 'create',
|
||
|
description: 'Create a task',
|
||
|
},
|
||
|
{
|
||
|
name: 'Delete',
|
||
|
value: 'delete',
|
||
|
description: 'Delete a task',
|
||
|
},
|
||
|
{
|
||
|
name: 'Get',
|
||
|
value: 'get',
|
||
|
description: 'Get a task',
|
||
|
},
|
||
|
{
|
||
|
name: 'Get All',
|
||
|
value: 'getAll',
|
||
|
description: 'Get all tasks',
|
||
|
},
|
||
|
{
|
||
|
name: 'Update',
|
||
|
value: 'update',
|
||
|
description: 'Update a task',
|
||
|
},
|
||
|
],
|
||
|
default: 'create',
|
||
|
description: 'The operation to perform.',
|
||
|
},
|
||
|
] as INodeProperties[];
|
||
|
|
||
|
export const taskFields = [
|
||
|
{
|
||
|
displayName: 'Project ID',
|
||
|
name: 'projectId',
|
||
|
type: 'options',
|
||
|
typeOptions: {
|
||
|
loadOptionsDependsOn: [
|
||
|
'workspaceId',
|
||
|
],
|
||
|
loadOptionsMethod: 'loadProjectsForWorkspace',
|
||
|
},
|
||
|
displayOptions: {
|
||
|
show: {
|
||
|
resource: [
|
||
|
'task',
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
required: true,
|
||
|
default: '',
|
||
|
},
|
||
|
/* -------------------------------------------------------------------------- */
|
||
|
/* task:create */
|
||
|
/* -------------------------------------------------------------------------- */
|
||
|
{
|
||
|
displayName: 'Task Name',
|
||
|
name: 'name',
|
||
|
type: 'string',
|
||
|
required: true,
|
||
|
default: '',
|
||
|
description: 'Name of task to create',
|
||
|
displayOptions: {
|
||
|
show: {
|
||
|
resource: [
|
||
|
'task',
|
||
|
],
|
||
|
operation: [
|
||
|
'create',
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
displayName: 'Additional Fields',
|
||
|
name: 'additionalFields',
|
||
|
type: 'collection',
|
||
|
placeholder: 'Add Field',
|
||
|
displayOptions: {
|
||
|
show: {
|
||
|
operation: [
|
||
|
'create',
|
||
|
],
|
||
|
resource: [
|
||
|
'task',
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
default: {},
|
||
|
options: [
|
||
|
{
|
||
|
displayName: 'Assignee IDs',
|
||
|
name: 'assigneeIds',
|
||
|
type: 'multiOptions',
|
||
|
default: [],
|
||
|
typeOptions: {
|
||
|
loadOptionsMethod: 'loadUsersForWorkspace',
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
displayName: 'Estimate',
|
||
|
name: 'estimate',
|
||
|
type: 'string',
|
||
|
default: '',
|
||
|
placeholder: '2:30',
|
||
|
description: 'Estimate time the task will take, e.x: 2:30 (2 hours and 30 minutes)',
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
|
||
|
/* -------------------------------------------------------------------------- */
|
||
|
/* task:delete */
|
||
|
/* -------------------------------------------------------------------------- */
|
||
|
{
|
||
|
displayName: 'Task ID',
|
||
|
name: 'taskId',
|
||
|
type: 'string',
|
||
|
required: true,
|
||
|
default: '',
|
||
|
displayOptions: {
|
||
|
show: {
|
||
|
resource: [
|
||
|
'task',
|
||
|
],
|
||
|
operation: [
|
||
|
'delete',
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
description: 'ID of task to delete',
|
||
|
},
|
||
|
|
||
|
/* -------------------------------------------------------------------------- */
|
||
|
/* task:get */
|
||
|
/* -------------------------------------------------------------------------- */
|
||
|
{
|
||
|
displayName: 'Task ID',
|
||
|
name: 'taskId',
|
||
|
type: 'string',
|
||
|
required: true,
|
||
|
default: '',
|
||
|
displayOptions: {
|
||
|
show: {
|
||
|
resource: [
|
||
|
'task',
|
||
|
],
|
||
|
operation: [
|
||
|
'get',
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
description: 'ID of task to get',
|
||
|
},
|
||
|
|
||
|
/* -------------------------------------------------------------------------- */
|
||
|
/* task:getAll */
|
||
|
/* -------------------------------------------------------------------------- */
|
||
|
{
|
||
|
displayName: 'Return All',
|
||
|
name: 'returnAll',
|
||
|
type: 'boolean',
|
||
|
displayOptions: {
|
||
|
show: {
|
||
|
operation: [
|
||
|
'getAll',
|
||
|
],
|
||
|
resource: [
|
||
|
'task',
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
default: false,
|
||
|
description: 'If all results should be returned or only up to a given limit.',
|
||
|
},
|
||
|
{
|
||
|
displayName: 'Limit',
|
||
|
name: 'limit',
|
||
|
type: 'number',
|
||
|
displayOptions: {
|
||
|
show: {
|
||
|
operation: [
|
||
|
'getAll',
|
||
|
],
|
||
|
resource: [
|
||
|
'task',
|
||
|
],
|
||
|
returnAll: [
|
||
|
false,
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
typeOptions: {
|
||
|
minValue: 1,
|
||
|
maxValue: 500,
|
||
|
},
|
||
|
default: 100,
|
||
|
description: 'How many results to return.',
|
||
|
},
|
||
|
{
|
||
|
displayName: 'Filters',
|
||
|
name: 'filters',
|
||
|
type: 'collection',
|
||
|
placeholder: 'Add Filter',
|
||
|
displayOptions: {
|
||
|
show: {
|
||
|
operation: [
|
||
|
'getAll',
|
||
|
],
|
||
|
resource: [
|
||
|
'task',
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
default: {},
|
||
|
options: [
|
||
|
{
|
||
|
displayName: 'Is Active',
|
||
|
name: 'is-active',
|
||
|
type: 'boolean',
|
||
|
default: false,
|
||
|
},
|
||
|
{
|
||
|
displayName: 'Name',
|
||
|
name: 'name',
|
||
|
type: 'string',
|
||
|
default: '',
|
||
|
description: 'Text to match in the task name',
|
||
|
},
|
||
|
{
|
||
|
displayName: 'Sort Column',
|
||
|
name: 'sort-column',
|
||
|
type: 'options',
|
||
|
options: [
|
||
|
{
|
||
|
name: 'Name',
|
||
|
value: 'NAME',
|
||
|
},
|
||
|
],
|
||
|
default: 'NAME',
|
||
|
},
|
||
|
{
|
||
|
displayName: 'Sort Order',
|
||
|
name: 'sort-order',
|
||
|
type: 'options',
|
||
|
options: [
|
||
|
{
|
||
|
name: 'Ascending',
|
||
|
value: 'ASCENDING',
|
||
|
},
|
||
|
{
|
||
|
name: 'Descending',
|
||
|
value: 'DESCENDING',
|
||
|
},
|
||
|
],
|
||
|
default: 'ASCENDING',
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
|
||
|
/* -------------------------------------------------------------------------- */
|
||
|
/* task:update */
|
||
|
/* -------------------------------------------------------------------------- */
|
||
|
{
|
||
|
displayName: 'Task ID',
|
||
|
name: 'taskId',
|
||
|
type: 'string',
|
||
|
required: true,
|
||
|
default: '',
|
||
|
displayOptions: {
|
||
|
show: {
|
||
|
resource: [
|
||
|
'task',
|
||
|
],
|
||
|
operation: [
|
||
|
'update',
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
description: 'ID of task to update',
|
||
|
},
|
||
|
{
|
||
|
displayName: 'Update Fields',
|
||
|
name: 'updateFields',
|
||
|
type: 'collection',
|
||
|
placeholder: 'Add Field',
|
||
|
displayOptions: {
|
||
|
show: {
|
||
|
operation: [
|
||
|
'update',
|
||
|
],
|
||
|
resource: [
|
||
|
'task',
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
default: {},
|
||
|
options: [
|
||
|
{
|
||
|
displayName: 'Assignee IDs',
|
||
|
name: 'assigneeIds',
|
||
|
type: 'multiOptions',
|
||
|
default: [],
|
||
|
typeOptions: {
|
||
|
loadOptionsMethod: 'loadUsersForWorkspace',
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
displayName: 'Estimate',
|
||
|
name: 'estimate',
|
||
|
type: 'string',
|
||
|
default: '',
|
||
|
placeholder: '2:30',
|
||
|
description: 'Estimate time the task will take, e.x: 2:30 (2 hours and 30 minutes)',
|
||
|
},
|
||
|
{
|
||
|
displayName: 'Name',
|
||
|
name: 'name',
|
||
|
type: 'string',
|
||
|
default: '',
|
||
|
},
|
||
|
{
|
||
|
displayName: 'Status',
|
||
|
name: 'status',
|
||
|
type: 'options',
|
||
|
options: [
|
||
|
{
|
||
|
name: 'Active',
|
||
|
value: 'ACTIVE',
|
||
|
},
|
||
|
{
|
||
|
name: 'Done',
|
||
|
value: 'DONE',
|
||
|
},
|
||
|
],
|
||
|
default: 'ACTIVE',
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
] as INodeProperties[];
|