2020-03-27 12:17:10 -07:00
import {
INodeProperties ,
2020-03-27 16:34:39 -07:00
} from 'n8n-workflow' ;
2020-03-27 12:17:10 -07:00
2021-12-03 00:44:16 -08:00
export const boardItemOperations : INodeProperties [ ] = [
2020-03-27 12:17:10 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-03-27 12:17:10 -07:00
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
} ,
} ,
options : [
2020-06-07 22:57:39 -07:00
{
name : 'Add Update' ,
value : 'addUpdate' ,
2022-05-06 14:01:25 -07:00
description : 'Add an update to an item' ,
2020-06-07 22:57:39 -07:00
} ,
2020-06-07 22:34:10 -07:00
{
name : 'Change Column Value' ,
value : 'changeColumnValue' ,
description : 'Change a column value for a board item' ,
} ,
{
name : 'Change Multiple Column Values' ,
value : 'changeMultipleColumnValues' ,
description : 'Change multiple column values for a board item' ,
} ,
2020-03-27 12:17:10 -07:00
{
name : 'Create' ,
value : 'create' ,
2022-05-06 14:01:25 -07:00
description : 'Create an item in a board\'s group' ,
2020-03-27 12:17:10 -07:00
} ,
{
name : 'Delete' ,
value : 'delete' ,
2022-05-06 14:01:25 -07:00
description : 'Delete an item' ,
2020-03-27 12:17:10 -07:00
} ,
{
name : 'Get' ,
value : 'get' ,
description : 'Get an item' ,
} ,
{
name : 'Get All' ,
value : 'getAll' ,
2020-09-14 00:58:01 -07:00
description : 'Get all items' ,
2020-03-27 12:17:10 -07:00
} ,
{
name : 'Get By Column Value' ,
value : 'getByColumnValue' ,
description : 'Get items by column value' ,
} ,
2021-03-12 02:32:04 -08:00
{
name : 'Move' ,
value : 'move' ,
description : 'Move item to group' ,
} ,
2020-03-27 12:17:10 -07:00
] ,
default : 'create' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-03-27 12:17:10 -07:00
2021-12-03 00:44:16 -08:00
export const boardItemFields : INodeProperties [ ] = [
2020-03-27 12:17:10 -07:00
2021-03-12 02:32:04 -08:00
/* -------------------------------------------------------------------------- */
/* boardItem:addUpdate */
/* -------------------------------------------------------------------------- */
2020-06-07 22:57:39 -07:00
{
displayName : 'Item ID' ,
name : 'itemId' ,
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'addUpdate' ,
] ,
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The unique identifier of the item to add update to' ,
2020-06-07 22:57:39 -07:00
} ,
{
2020-06-13 08:46:13 -07:00
displayName : 'Update Text' ,
2020-06-07 22:57:39 -07:00
name : 'value' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'addUpdate' ,
] ,
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The update text to add' ,
2020-06-07 22:57:39 -07:00
} ,
2021-03-12 02:32:04 -08:00
/* -------------------------------------------------------------------------- */
/* boardItem:changeColumnValue */
/* -------------------------------------------------------------------------- */
2020-06-07 22:57:39 -07:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Board Name or ID' ,
2020-06-07 22:57:39 -07:00
name : 'boardId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getBoards' ,
} ,
default : '' ,
required : true ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'changeColumnValue' ,
] ,
} ,
} ,
2022-06-03 10:23:49 -07:00
description : 'The unique identifier of the board. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2020-06-07 22:57:39 -07:00
} ,
{
displayName : 'Item ID' ,
name : 'itemId' ,
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'changeColumnValue' ,
] ,
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The unique identifier of the item to to change column of' ,
2020-06-07 22:57:39 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Column Name or ID' ,
2020-06-07 22:57:39 -07:00
name : 'columnId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getColumns' ,
loadOptionsDependsOn : [
2020-10-22 06:46:03 -07:00
'boardId' ,
2020-06-07 22:57:39 -07:00
] ,
} ,
default : '' ,
required : true ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'changeColumnValue' ,
] ,
} ,
} ,
2022-06-03 10:23:49 -07:00
description : 'The column\'s unique identifier. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2020-06-07 22:57:39 -07:00
} ,
{
displayName : 'Value' ,
name : 'value' ,
type : 'json' ,
required : true ,
default : '' ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'changeColumnValue' ,
] ,
} ,
} ,
2021-08-26 10:42:38 -07:00
description : 'The column value in JSON format. Documentation can be found <a href="https://monday.com/developers/v2#mutations-section-columns-change-column-value">here</a>.' ,
2020-06-07 22:57:39 -07:00
} ,
2021-03-12 02:32:04 -08:00
/* -------------------------------------------------------------------------- */
/* boardItem:changeMultipleColumnValues */
/* -------------------------------------------------------------------------- */
2020-06-07 22:57:39 -07:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Board Name or ID' ,
2020-06-07 22:57:39 -07:00
name : 'boardId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getBoards' ,
} ,
default : '' ,
required : true ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'changeMultipleColumnValues' ,
] ,
} ,
} ,
2022-06-03 10:23:49 -07:00
description : 'The unique identifier of the board. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2020-06-07 22:57:39 -07:00
} ,
{
displayName : 'Item ID' ,
name : 'itemId' ,
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'changeMultipleColumnValues' ,
] ,
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Item\'s ID' ,
2020-06-07 22:57:39 -07:00
} ,
{
displayName : 'Column Values' ,
name : 'columnValues' ,
type : 'json' ,
required : true ,
default : '' ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'changeMultipleColumnValues' ,
] ,
} ,
} ,
2021-08-26 10:42:38 -07:00
description : 'The column fields and values in JSON format. Documentation can be found <a href="https://monday.com/developers/v2#mutations-section-columns-change-multiple-column-values">here</a>.' ,
2020-06-07 22:57:39 -07:00
typeOptions : {
alwaysOpenEditWindow : true ,
} ,
} ,
2021-03-12 02:32:04 -08:00
/* -------------------------------------------------------------------------- */
/* boardItem:create */
/* -------------------------------------------------------------------------- */
2020-03-27 12:17:10 -07:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Board Name or ID' ,
2020-03-27 12:17:10 -07:00
name : 'boardId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getBoards' ,
} ,
default : '' ,
required : true ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Group Name or ID' ,
2020-03-27 12:17:10 -07:00
name : 'groupId' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getGroups' ,
loadOptionsDependsOn : [
2020-10-22 06:46:03 -07:00
'boardId' ,
2020-03-27 12:17:10 -07:00
] ,
} ,
required : true ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
} ,
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
operation : [
'create' ,
] ,
resource : [
'boardItem' ,
] ,
} ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The new item\'s name' ,
2020-03-27 12:17:10 -07:00
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
displayOptions : {
show : {
operation : [
'create' ,
] ,
resource : [
'boardItem' ,
] ,
} ,
} ,
default : { } ,
options : [
{
displayName : 'Column Values' ,
name : 'columnValues' ,
type : 'json' ,
typeOptions : {
alwaysOpenEditWindow : true ,
} ,
default : '' ,
description : 'The column values of the new item' ,
} ,
] ,
} ,
2021-03-12 02:32:04 -08:00
/* -------------------------------------------------------------------------- */
/* boardItem:delete */
/* -------------------------------------------------------------------------- */
2020-03-27 12:17:10 -07:00
{
displayName : 'Item ID' ,
name : 'itemId' ,
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'delete' ,
] ,
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Item\'s ID' ,
2020-03-27 12:17:10 -07:00
} ,
2021-03-12 02:32:04 -08:00
/* -------------------------------------------------------------------------- */
/* boardItem:get */
/* -------------------------------------------------------------------------- */
2020-03-27 12:17:10 -07:00
{
displayName : 'Item ID' ,
name : 'itemId' ,
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'get' ,
] ,
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Item\'s ID (Multiple can be added separated by comma)' ,
2020-03-27 12:17:10 -07:00
} ,
2021-03-12 02:32:04 -08:00
/* -------------------------------------------------------------------------- */
/* boardItem:getAll */
/* -------------------------------------------------------------------------- */
2020-03-27 12:17:10 -07:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Board Name or ID' ,
2020-03-27 12:17:10 -07:00
name : 'boardId' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getBoards' ,
} ,
required : true ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'getAll' ,
] ,
} ,
} ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Group Name or ID' ,
2020-03-27 12:17:10 -07:00
name : 'groupId' ,
default : '' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getGroups' ,
loadOptionsDependsOn : [
'boardId' ,
] ,
} ,
required : true ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'getAll' ,
] ,
} ,
} ,
} ,
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'getAll' ,
] ,
} ,
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2020-03-27 12:17:10 -07:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'getAll' ,
] ,
returnAll : [
false ,
] ,
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 100 ,
} ,
default : 50 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-03-27 12:17:10 -07:00
} ,
2021-03-12 02:32:04 -08:00
/* -------------------------------------------------------------------------- */
/* boardItem:getByColumnValue */
/* -------------------------------------------------------------------------- */
2020-03-27 12:17:10 -07:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Board Name or ID' ,
2020-03-27 12:17:10 -07:00
name : 'boardId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getBoards' ,
} ,
default : '' ,
required : true ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'getByColumnValue' ,
] ,
} ,
} ,
2022-06-03 10:23:49 -07:00
description : 'The unique identifier of the board. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2020-03-27 12:17:10 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Column Name or ID' ,
2020-03-27 12:17:10 -07:00
name : 'columnId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getColumns' ,
loadOptionsDependsOn : [
2020-10-22 06:46:03 -07:00
'boardId' ,
2020-03-27 12:17:10 -07:00
] ,
} ,
default : '' ,
required : true ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'getByColumnValue' ,
] ,
} ,
} ,
2022-06-03 10:23:49 -07:00
description : 'The column\'s unique identifier. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2020-03-27 12:17:10 -07:00
} ,
{
displayName : 'Column Value' ,
name : 'columnValue' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'getByColumnValue' ,
] ,
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The column value to search items by' ,
2020-03-27 12:17:10 -07:00
} ,
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'getByColumnValue' ,
] ,
} ,
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2020-03-27 12:17:10 -07:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'getByColumnValue' ,
] ,
returnAll : [
false ,
] ,
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 100 ,
} ,
default : 50 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-03-27 12:17:10 -07:00
} ,
2021-03-12 02:32:04 -08:00
/* -------------------------------------------------------------------------- */
/* boardItem:move */
/* -------------------------------------------------------------------------- */
{
2022-06-03 10:23:49 -07:00
displayName : 'Board Name or ID' ,
2021-03-12 02:32:04 -08:00
name : 'boardId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getBoards' ,
} ,
default : '' ,
required : true ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'move' ,
] ,
} ,
} ,
} ,
{
displayName : 'Item ID' ,
name : 'itemId' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
operation : [
'move' ,
] ,
resource : [
'boardItem' ,
] ,
} ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The item\'s ID' ,
2021-03-12 02:32:04 -08:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Group Name or ID' ,
2021-03-12 02:32:04 -08:00
name : 'groupId' ,
type : 'options' ,
default : '' ,
typeOptions : {
loadOptionsMethod : 'getGroups' ,
loadOptionsDependsOn : [
'boardId' ,
] ,
} ,
required : true ,
displayOptions : {
show : {
resource : [
'boardItem' ,
] ,
operation : [
'move' ,
] ,
} ,
} ,
} ,
2021-12-03 00:44:16 -08:00
] ;