2022-08-17 08:50:24 -07:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2021-06-04 20:39:39 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const listOperations: INodeProperties[] = [
|
2021-06-04 20:39:39 -07:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2021-06-04 20:39:39 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['list'],
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Create a list',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Delete',
|
|
|
|
value: 'delete',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Delete a list',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get a list',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
{
|
2022-09-07 07:51:14 -07:00
|
|
|
name: 'Get Many',
|
2021-06-04 20:39:39 -07:00
|
|
|
value: 'getAll',
|
2022-09-08 08:10:13 -07:00
|
|
|
action: 'Get many lists',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Update',
|
|
|
|
value: 'update',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Update a list',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'get',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2021-06-04 20:39:39 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const listFields: INodeProperties[] = [
|
2021-06-04 20:39:39 -07:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* list:create */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'List Name',
|
|
|
|
name: 'displayName',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['create'],
|
|
|
|
resource: ['list'],
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'List display name',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* list:get/delete/update */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'List ID',
|
|
|
|
name: 'listId',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['delete', 'get', 'update'],
|
|
|
|
resource: ['list'],
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
default: '',
|
2022-08-17 08:50:24 -07:00
|
|
|
description: "The identifier of the list, unique in the user's mailbox",
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* list:getAll */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['list'],
|
|
|
|
operation: ['getAll'],
|
2021-06-04 20:39:39 -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',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['list'],
|
|
|
|
operation: ['getAll'],
|
2021-06-04 20:39:39 -07:00
|
|
|
returnAll: [false],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 100,
|
|
|
|
},
|
|
|
|
default: 50,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* list:update */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'New List Name',
|
|
|
|
name: 'displayName',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['update'],
|
|
|
|
resource: ['list'],
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'List display name',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|