2023-01-27 03:22:44 -08:00
|
|
|
import type { INodeProperties } from 'n8n-workflow';
|
2020-12-02 04:25:13 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const contactListOperations: INodeProperties[] = [
|
2020-12-02 04:25:13 -08:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2020-12-02 04:25:13 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactList'],
|
2020-12-02 04:25:13 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Add',
|
|
|
|
value: 'add',
|
|
|
|
description: 'Add contact to a list',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Add a contact to a list',
|
2020-12-02 04:25:13 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Remove',
|
|
|
|
value: 'remove',
|
|
|
|
description: 'Remove a contact from a list',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Remove a contact from a list',
|
2020-12-02 04:25:13 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'add',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-12-02 04:25:13 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const contactListFields: INodeProperties[] = [
|
2020-12-02 04:25:13 -08:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* contactList:add */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'By',
|
|
|
|
name: 'by',
|
|
|
|
type: 'options',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Contact ID',
|
|
|
|
value: 'id',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Email',
|
|
|
|
value: 'email',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactList'],
|
|
|
|
operation: ['add'],
|
2020-12-02 04:25:13 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: 'email',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Email',
|
|
|
|
name: 'email',
|
|
|
|
type: 'string',
|
2022-06-20 07:54:01 -07:00
|
|
|
placeholder: 'name@email.com',
|
2020-12-02 04:25:13 -08:00
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactList'],
|
|
|
|
operation: ['add'],
|
|
|
|
by: ['email'],
|
2020-12-02 04:25:13 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Contact ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactList'],
|
|
|
|
operation: ['add'],
|
|
|
|
by: ['id'],
|
2020-12-02 04:25:13 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'List ID',
|
|
|
|
name: 'listId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactList'],
|
|
|
|
operation: ['add'],
|
2020-12-02 04:25:13 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
2021-01-31 23:31:40 -08:00
|
|
|
|
2020-12-02 04:25:13 -08:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* contactList:remove */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Contact ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactList'],
|
|
|
|
operation: ['remove'],
|
2020-12-02 04:25:13 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'List ID',
|
|
|
|
name: 'listId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['contactList'],
|
|
|
|
operation: ['remove'],
|
2020-12-02 04:25:13 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|