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' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-12-22 23:19:10 -08:00
displayOptions : {
show : {
resource : [
'userList' ,
] ,
} ,
} ,
options : [
{
name : 'Add' ,
value : 'add' ,
description : 'Add user to list' ,
2022-07-10 13:50:51 -07:00
action : 'Add a user to a list' ,
2020-12-22 23:19:10 -08:00
} ,
{
name : 'Remove' ,
value : 'remove' ,
description : 'Remove a user from a list' ,
2022-07-10 13:50:51 -07:00
action : 'Remove a user from a list' ,
2020-12-22 23:19:10 -08:00
} ,
] ,
default : 'add' ,
} ,
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 */
/* -------------------------------------------------------------------------- */
{
2022-06-03 10:23:49 -07:00
displayName : 'List Name or ID' ,
2020-12-22 23:19:10 -08:00
name : 'listId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getLists' ,
} ,
required : true ,
displayOptions : {
show : {
resource : [
'userList' ,
] ,
operation : [
'add' ,
] ,
} ,
} ,
default : '' ,
2022-06-03 10:23:49 -07:00
description : 'Identifier to be used. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2020-12-22 23:19:10 -08:00
} ,
{
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 */
/* -------------------------------------------------------------------------- */
{
2022-06-03 10:23:49 -07:00
displayName : 'List Name or ID' ,
2020-12-22 23:19:10 -08:00
name : 'listId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getLists' ,
} ,
required : true ,
displayOptions : {
show : {
resource : [
'userList' ,
] ,
operation : [
'remove' ,
] ,
} ,
} ,
default : '' ,
2022-06-03 10:23:49 -07:00
description : 'Identifier to be used. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.' ,
2020-12-22 23:19:10 -08:00
} ,
{
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-06-20 07:54:01 -07:00
description : 'Whether to 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
] ;