n8n/packages/nodes-base/nodes/MondayCom/BoardDescription.ts

221 lines
4.1 KiB
TypeScript
Raw Normal View History

2020-03-27 12:17:10 -07:00
import {
INodeProperties,
} from 'n8n-workflow';
2020-03-26 12:39:31 -07:00
export const boardOperations = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'board',
],
},
},
options: [
{
name: 'Archive',
value: 'archive',
description: 'Archive a board',
},
{
name: 'Create',
value: 'create',
description: 'Create a new board',
},
{
name: 'Get',
value: 'get',
description: 'Get a board',
},
{
name: 'Get All',
value: 'getAll',
description: 'Get all boards',
},
],
default: 'create',
description: 'The operation to perform.',
},
] as INodeProperties[];
export const boardFields = [
2020-03-27 12:17:10 -07:00
2020-03-26 12:39:31 -07:00
/* -------------------------------------------------------------------------- */
/* board:archive */
/* -------------------------------------------------------------------------- */
{
displayName: 'Board ID',
name: 'boardId',
type: 'options',
2020-03-27 12:17:10 -07:00
default: '',
2020-03-26 12:39:31 -07:00
typeOptions: {
loadOptionsMethod: 'getBoards',
},
required: true,
displayOptions: {
show: {
resource: [
'board',
],
operation: [
'archive',
],
},
},
2020-03-27 12:17:10 -07:00
description: 'Board unique identifiers.',
2020-03-26 12:39:31 -07:00
},
/* -------------------------------------------------------------------------- */
/* board:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Name',
name: 'name',
type: 'string',
required: true,
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'board',
],
},
},
default: '',
description: `The board's name`,
},
{
displayName: 'Kind',
name: 'kind',
type: 'options',
options: [
{
name: 'Share',
value: 'share',
},
{
name: 'Public',
value: 'public',
},
{
name: 'Private',
value: 'private',
},
],
required: true,
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'board',
],
},
},
default: '',
description: `The board's kind (public / private / share)`,
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'board',
],
},
},
default: {},
options: [
{
displayName: 'Template ID',
name: 'templateId',
type: 'number',
typeOptions: {
minValue: 0,
},
default: 0,
description: 'Optional board template id',
},
],
},
/* -------------------------------------------------------------------------- */
/* board:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Board ID',
name: 'boardId',
type: 'options',
2020-03-27 12:17:10 -07:00
default: '',
typeOptions: {
loadOptionsMethod: 'getBoards',
},
2020-03-26 12:39:31 -07:00
required: true,
displayOptions: {
show: {
resource: [
'board',
],
operation: [
'get',
],
},
},
2020-03-27 12:17:10 -07:00
description: 'Board unique identifiers.',
2020-03-26 12:39:31 -07:00
},
/* -------------------------------------------------------------------------- */
/* board:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: [
'board',
],
operation: [
'getAll',
],
},
},
default: false,
description: 'If all results should be returned or only up to a given limit.',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: [
'board',
],
operation: [
'getAll',
],
returnAll: [
false,
],
},
},
typeOptions: {
minValue: 1,
maxValue: 100,
},
default: 50,
description: 'How many results to return.',
},
] as INodeProperties[];