2020-08-24 17:55:57 -07:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
2020-01-24 04:28:05 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const labelOperations: INodeProperties[] = [
|
2020-01-24 04:28:05 -08:00
|
|
|
// ----------------------------------
|
|
|
|
// label
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2020-01-24 04:28:05 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'label',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Add to Card',
|
|
|
|
value: 'addLabel',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Add a label to a card',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
|
|
|
description: 'Create a new label',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Delete',
|
|
|
|
value: 'delete',
|
|
|
|
description: 'Delete a label',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Get the data of a label',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get All',
|
|
|
|
value: 'getAll',
|
2020-07-09 05:33:05 -07:00
|
|
|
description: 'Returns all labels for the board',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Remove From Card',
|
|
|
|
value: 'removeLabel',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Remove a label from a card',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Update',
|
|
|
|
value: 'update',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Update a label',
|
2020-10-22 06:46:03 -07:00
|
|
|
},
|
2020-01-24 04:28:05 -08:00
|
|
|
|
|
|
|
],
|
|
|
|
default: 'getAll',
|
|
|
|
},
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-01-24 04:28:05 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const labelFields: INodeProperties[] = [
|
2020-01-24 04:28:05 -08:00
|
|
|
// ----------------------------------
|
|
|
|
// label:create
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Board ID',
|
|
|
|
name: 'boardId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'label',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of the board to create the label on',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Name',
|
|
|
|
name: 'name',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'label',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Name for the label',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Color',
|
|
|
|
name: 'color',
|
|
|
|
type: 'options',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'label',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Black',
|
2020-01-24 04:28:05 -08:00
|
|
|
value: 'black',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Blue',
|
2020-01-24 04:28:05 -08:00
|
|
|
value: 'blue',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Green',
|
2020-10-22 06:46:03 -07:00
|
|
|
value: 'green',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Lime',
|
2020-01-24 04:28:05 -08:00
|
|
|
value: 'lime',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Null',
|
2020-01-24 04:28:05 -08:00
|
|
|
value: 'null',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Orange',
|
|
|
|
value: 'orange',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Pink',
|
2020-01-24 04:28:05 -08:00
|
|
|
value: 'pink',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Purple',
|
2020-01-24 04:28:05 -08:00
|
|
|
value: 'purple',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Red',
|
2020-01-24 04:28:05 -08:00
|
|
|
value: 'red',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Sky',
|
2020-01-24 04:28:05 -08:00
|
|
|
value: 'sky',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Yellow',
|
2020-10-22 06:46:03 -07:00
|
|
|
value: 'yellow',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'null',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The color for the label',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
// label:delete
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Label ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'delete',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'label',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of the label to delete',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
// label:getAll
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Board ID',
|
|
|
|
name: 'boardId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'label',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of the board to get label',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'label',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: {},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Fields',
|
|
|
|
name: 'fields',
|
|
|
|
type: 'string',
|
|
|
|
default: 'all',
|
|
|
|
description: 'Fields to return. Either "all" or a comma-separated list of fields.',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
// label:get
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Label ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'label',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Get information about a label by ID',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'label',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: {},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Fields',
|
|
|
|
name: 'fields',
|
|
|
|
type: 'string',
|
|
|
|
default: 'all',
|
|
|
|
description: 'Fields to return. Either "all" or a comma-separated list of fields.',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
// label:addLabel
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Card ID',
|
|
|
|
name: 'cardId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'addLabel',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'label',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of the card to get label',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Label ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'addLabel',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'label',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of the label to add',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
// label:removeLabel
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Card ID',
|
|
|
|
name: 'cardId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'removeLabel',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'label',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of the card to remove label from',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Label ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'removeLabel',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'label',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of the label to remove',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
// ----------------------------------
|
|
|
|
// label:update
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Label ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'update',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'label',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of the label to update',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Update Fields',
|
|
|
|
name: 'updateFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
operation: [
|
|
|
|
'update',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'label',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: {},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Name',
|
|
|
|
name: 'name',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Name of the label',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Color',
|
|
|
|
name: 'color',
|
|
|
|
type: 'options',
|
|
|
|
options: [
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Black',
|
2020-01-24 04:28:05 -08:00
|
|
|
value: 'black',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Blue',
|
2020-01-24 04:28:05 -08:00
|
|
|
value: 'blue',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Green',
|
2020-10-22 06:46:03 -07:00
|
|
|
value: 'green',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Lime',
|
2020-01-24 04:28:05 -08:00
|
|
|
value: 'lime',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Null',
|
2020-01-24 04:28:05 -08:00
|
|
|
value: 'null',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Orange',
|
|
|
|
value: 'orange',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Pink',
|
2020-01-24 04:28:05 -08:00
|
|
|
value: 'pink',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Purple',
|
2020-01-24 04:28:05 -08:00
|
|
|
value: 'purple',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Red',
|
2020-01-24 04:28:05 -08:00
|
|
|
value: 'red',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Sky',
|
2020-01-24 04:28:05 -08:00
|
|
|
value: 'sky',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Yellow',
|
2020-10-22 06:46:03 -07:00
|
|
|
value: 'yellow',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'null',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The color for the label',
|
2020-01-24 04:28:05 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|