2020-08-24 17:55:57 -07:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
2020-01-24 04:28:05 -08:00
|
|
|
|
|
|
|
export const listOperations = [
|
|
|
|
// ----------------------------------
|
|
|
|
// list
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2020-01-24 04:28:05 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2020-08-24 17:55:57 -07:00
|
|
|
resource: [
|
|
|
|
'list',
|
|
|
|
],
|
|
|
|
},
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
name: 'Archive',
|
|
|
|
value: 'archive',
|
|
|
|
description: 'Archive/Unarchive a list'
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
|
|
|
description: 'Create a new list'
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Get the data of a list'
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
name: 'Update',
|
|
|
|
value: 'update',
|
|
|
|
description: 'Update a list'
|
2020-01-24 04:28:05 -08:00
|
|
|
}
|
|
|
|
],
|
2020-08-24 17:55:57 -07:00
|
|
|
default: 'create',
|
|
|
|
description: 'The operation to perform.'
|
2020-01-24 04:28:05 -08:00
|
|
|
}
|
|
|
|
] as INodeProperties[];
|
|
|
|
|
|
|
|
export const listFields = [
|
|
|
|
// ----------------------------------
|
|
|
|
// list:archive
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
displayName: 'List ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2020-01-24 04:28:05 -08:00
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2020-08-24 17:55:57 -07:00
|
|
|
operation: [
|
|
|
|
'archive',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'list',
|
|
|
|
],
|
|
|
|
},
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
2020-08-24 17:55:57 -07:00
|
|
|
description: 'The ID of the list to archive or unarchive.'
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
displayName: 'Archive',
|
|
|
|
name: 'archive',
|
|
|
|
type: 'boolean',
|
2020-01-24 04:28:05 -08:00
|
|
|
default: false,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2020-08-24 17:55:57 -07:00
|
|
|
operation: [
|
|
|
|
'archive',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'list',
|
|
|
|
],
|
|
|
|
},
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
2020-08-24 17:55:57 -07:00
|
|
|
description: 'If the list should be archived or unarchived.'
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
// list:create
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
displayName: 'Board ID',
|
|
|
|
name: 'idBoard',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2020-01-24 04:28:05 -08:00
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2020-08-24 17:55:57 -07:00
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'list',
|
|
|
|
],
|
|
|
|
},
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
2020-08-24 17:55:57 -07:00
|
|
|
description: 'The ID of the board the list should be created in'
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
displayName: 'Name',
|
|
|
|
name: 'name',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
placeholder: 'My list',
|
2020-01-24 04:28:05 -08:00
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2020-08-24 17:55:57 -07:00
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'list',
|
|
|
|
],
|
|
|
|
},
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
2020-08-24 17:55:57 -07:00
|
|
|
description: 'The name of the list'
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
2020-01-24 04:28:05 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2020-08-24 17:55:57 -07:00
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'list',
|
|
|
|
],
|
|
|
|
},
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
default: {},
|
|
|
|
options: [
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
displayName: 'List Source',
|
|
|
|
name: 'idListSource',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
description: 'ID of the list to copy into the new list.'
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
displayName: 'Position',
|
|
|
|
name: 'pos',
|
|
|
|
type: 'string',
|
|
|
|
default: 'bottom',
|
2020-01-24 04:28:05 -08:00
|
|
|
description:
|
2020-08-24 17:55:57 -07:00
|
|
|
'The position of the new list. top, bottom, or a positive float.'
|
2020-01-24 04:28:05 -08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
// list:get
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
displayName: 'List ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2020-01-24 04:28:05 -08:00
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2020-08-24 17:55:57 -07:00
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'list',
|
|
|
|
],
|
|
|
|
},
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
2020-08-24 17:55:57 -07:00
|
|
|
description: 'The ID of the list to get.'
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
2020-01-24 04:28:05 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2020-08-24 17:55:57 -07:00
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'list',
|
|
|
|
],
|
|
|
|
},
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
default: {},
|
|
|
|
options: [
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
displayName: 'Fields',
|
|
|
|
name: 'fields',
|
|
|
|
type: 'string',
|
|
|
|
default: 'all',
|
|
|
|
description: 'Fields to return. Either "all" or a comma-separated list of fields.'
|
2020-01-24 04:28:05 -08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
// list:update
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
displayName: 'List ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2020-01-24 04:28:05 -08:00
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2020-08-24 17:55:57 -07:00
|
|
|
operation: [
|
|
|
|
'update',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'list',
|
|
|
|
],
|
|
|
|
},
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
2020-08-24 17:55:57 -07:00
|
|
|
description: 'The ID of the list to update.'
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
displayName: 'Update Fields',
|
|
|
|
name: 'updateFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
2020-01-24 04:28:05 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2020-08-24 17:55:57 -07:00
|
|
|
operation: [
|
|
|
|
'update',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'list',
|
|
|
|
],
|
|
|
|
},
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
default: {},
|
|
|
|
options: [
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
displayName: 'Board ID',
|
|
|
|
name: 'idBoard',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
description: 'ID of a board the list should be moved to.'
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
displayName: 'Closed',
|
|
|
|
name: 'closed',
|
|
|
|
type: 'boolean',
|
2020-01-24 04:28:05 -08:00
|
|
|
default: false,
|
2020-08-24 17:55:57 -07:00
|
|
|
description: 'Whether the list is closed.'
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
displayName: 'Name',
|
|
|
|
name: 'name',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
description: 'New name of the list'
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
displayName: 'Position',
|
|
|
|
name: 'pos',
|
|
|
|
type: 'string',
|
|
|
|
default: 'bottom',
|
2020-01-24 04:28:05 -08:00
|
|
|
description:
|
2020-08-24 17:55:57 -07:00
|
|
|
'The position of the list. top, bottom, or a positive float.'
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
2020-08-24 17:55:57 -07:00
|
|
|
displayName: 'Subscribed',
|
|
|
|
name: 'subscribed',
|
|
|
|
type: 'boolean',
|
2020-01-24 04:28:05 -08:00
|
|
|
default: false,
|
2020-08-24 17:55:57 -07:00
|
|
|
description: 'Whether the acting user is subscribed to the list.'
|
2020-01-24 04:28:05 -08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
] as INodeProperties[];
|