2020-12-22 23:19:10 -08:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const userListOperations: INodeProperties[] = [
|
2020-12-22 23:19:10 -08:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'userList',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Add',
|
|
|
|
value: 'add',
|
|
|
|
description: 'Add user to list',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Remove',
|
|
|
|
value: 'remove',
|
|
|
|
description: 'Remove a user from a list',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'add',
|
|
|
|
description: 'The operation to perform.',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-12-22 23:19:10 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const userListFields: INodeProperties[] = [
|
2020-12-22 23:19:10 -08:00
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* userList:add */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'List ID',
|
|
|
|
name: 'listId',
|
|
|
|
type: 'options',
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getLists',
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'userList',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'add',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
description: 'Identifier to be used',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Identifier',
|
|
|
|
name: 'identifier',
|
|
|
|
type: 'options',
|
|
|
|
required: true,
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Email',
|
|
|
|
value: 'email',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'User ID',
|
|
|
|
value: 'userId',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'userList',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'add',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
description: 'Identifier to be used',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Value',
|
|
|
|
name: 'value',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'userList',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'add',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* userList:remove */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'List ID',
|
|
|
|
name: 'listId',
|
|
|
|
type: 'options',
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getLists',
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'userList',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'remove',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
description: 'Identifier to be used',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Identifier',
|
|
|
|
name: 'identifier',
|
|
|
|
type: 'options',
|
|
|
|
required: true,
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Email',
|
|
|
|
value: 'email',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'User ID',
|
|
|
|
value: 'userId',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'userList',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'remove',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
description: 'Identifier to be used',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Value',
|
|
|
|
name: 'value',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'userList',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'remove',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'userList',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'remove',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Campaign ID',
|
|
|
|
name: 'campaignId',
|
|
|
|
type: 'number',
|
|
|
|
default: 0,
|
|
|
|
description: 'Attribute unsubscribe to a campaign',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Channel Unsubscribe',
|
|
|
|
name: 'channelUnsubscribe',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Unsubscribe email from list\'s associated channel - essentially a global unsubscribe',
|
2020-12-22 23:19:10 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|