2022-08-17 08:50:24 -07:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2020-08-18 03:40:19 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const labelOperations: INodeProperties[] = [
|
2020-08-18 03:40:19 -07:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2020-08-18 03:40:19 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['label'],
|
2020-08-18 03:40:19 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Create a label',
|
2020-08-18 03:40:19 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Delete',
|
|
|
|
value: 'delete',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Delete a label',
|
2020-08-18 03:40:19 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get a label',
|
2020-08-18 03:40:19 -07:00
|
|
|
},
|
|
|
|
{
|
2022-09-07 07:51:14 -07:00
|
|
|
name: 'Get Many',
|
2020-08-18 03:40:19 -07:00
|
|
|
value: 'getAll',
|
2022-09-08 08:10:13 -07:00
|
|
|
action: 'Get many labels',
|
2020-10-22 06:46:03 -07:00
|
|
|
},
|
2020-08-18 03:40:19 -07:00
|
|
|
],
|
|
|
|
default: 'create',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-08-18 03:40:19 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const labelFields: INodeProperties[] = [
|
2020-08-18 03:40:19 -07:00
|
|
|
{
|
|
|
|
displayName: 'Name',
|
|
|
|
name: 'name',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['label'],
|
|
|
|
operation: ['create'],
|
2020-08-18 03:40:19 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
placeholder: 'invoices',
|
|
|
|
description: 'Label Name',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Label ID',
|
|
|
|
name: 'labelId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['label'],
|
|
|
|
operation: ['get', 'delete'],
|
2020-08-18 03:40:19 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
description: 'The ID of the label',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Label List Visibility',
|
|
|
|
name: 'labelListVisibility',
|
|
|
|
type: 'options',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Hide',
|
|
|
|
value: 'labelHide',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Show',
|
|
|
|
value: 'labelShow',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Show If Unread',
|
|
|
|
value: 'labelShowIfUnread',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'labelShow',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['label'],
|
|
|
|
operation: ['create'],
|
2020-08-18 03:40:19 -07:00
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The visibility of the label in the label list in the Gmail web interface',
|
2020-08-18 03:40:19 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Message List Visibility',
|
|
|
|
name: 'messageListVisibility',
|
|
|
|
type: 'options',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Hide',
|
|
|
|
value: 'hide',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
name: 'Show',
|
2020-08-18 03:40:19 -07:00
|
|
|
value: 'show',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'show',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['label'],
|
|
|
|
operation: ['create'],
|
2020-08-18 03:40:19 -07:00
|
|
|
},
|
|
|
|
},
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'The visibility of messages with this label in the message list in the Gmail web interface',
|
2020-08-18 03:40:19 -07:00
|
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* label:getAll */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['getAll'],
|
|
|
|
resource: ['label'],
|
2020-08-18 03:40:19 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: false,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
2020-08-18 03:40:19 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['getAll'],
|
|
|
|
resource: ['label'],
|
|
|
|
returnAll: [false],
|
2020-08-18 03:40:19 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 500,
|
|
|
|
},
|
2022-09-08 05:44:34 -07:00
|
|
|
default: 50,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2020-08-18 03:40:19 -07:00
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|