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

147 lines
2.6 KiB
TypeScript
Raw Normal View History

2020-01-28 07:50:15 -08:00
import { INodeProperties } from "n8n-workflow";
export const taskOperations = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'task',
],
},
},
options: [
{
name: 'Get',
value: 'get',
description: 'Get data of a task',
},
{
name: 'Get All',
value: 'getAll',
description: 'Get data of all tasks',
},
],
default: 'getAll',
2020-01-28 07:50:15 -08:00
description: 'The operation to perform.',
},
] as INodeProperties[];
export const taskFields = [
/* -------------------------------------------------------------------------- */
/* task:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: [
'task',
],
operation: [
'getAll',
],
},
},
default: false,
description: 'Returns a list of your tasks.',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: [
'task',
],
operation: [
'getAll',
],
returnAll: [
false,
],
},
},
typeOptions: {
minValue: 1,
maxValue: 100,
},
default: 100,
description: 'How many results to return.',
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: [
'task',
],
operation: [
'getAll',
],
},
},
options: [
{
displayName: 'Is Active',
name: 'is_active',
2020-01-29 15:51:14 -08:00
type: 'boolean',
default: true,
2020-01-28 07:50:15 -08:00
description: 'Pass true to only return active tasks and false to return inactive tasks.',
},
{
displayName: 'Updated Since',
name: 'updated_since',
2020-01-29 15:51:14 -08:00
type: 'dateTime',
2020-01-28 07:50:15 -08:00
default: '',
description: 'Only return tasks belonging to the task with the given ID.',
},
{
displayName: 'Page',
name: 'page',
2020-01-29 15:51:14 -08:00
type: 'number',
typeOptions: {
minValue: 1,
},
default: 1,
2020-01-28 07:50:15 -08:00
description: 'The page number to use in pagination.',
}
]
},
/* -------------------------------------------------------------------------- */
/* task:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Task Id',
2020-01-28 07:50:15 -08:00
name: 'id',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: [
'get',
],
resource: [
'task',
],
},
},
description: 'The ID of the task you are retrieving.',
}
] as INodeProperties[];