2023-01-27 03:22:44 -08:00
import type { INodeProperties } from 'n8n-workflow' ;
2020-10-28 15:03:29 -07:00
2021-12-03 00:44:16 -08:00
export const subscriberOperations : INodeProperties [ ] = [
2020-10-28 15:03:29 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-10-28 15:03:29 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'subscriber' ] ,
2020-10-28 15:03:29 -07:00
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
description : 'Create a new subscriber' ,
2022-07-10 13:50:51 -07:00
action : 'Create a subscriber' ,
2020-10-28 15:03:29 -07:00
} ,
{
name : 'Get' ,
value : 'get' ,
description : 'Get an subscriber' ,
2022-07-10 13:50:51 -07:00
action : 'Get a subscriber' ,
2020-10-28 15:03:29 -07:00
} ,
{
2022-09-07 07:51:14 -07:00
name : 'Get Many' ,
2020-10-28 15:03:29 -07:00
value : 'getAll' ,
2022-09-13 03:36:36 -07:00
description : 'Get many subscribers' ,
2022-09-08 08:10:13 -07:00
action : 'Get many subscribers' ,
2020-10-28 15:03:29 -07:00
} ,
{
name : 'Update' ,
value : 'update' ,
description : 'Update an subscriber' ,
2022-07-10 13:50:51 -07:00
action : 'Update a subscriber' ,
2020-10-28 15:03:29 -07:00
} ,
] ,
default : 'create' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-10-28 15:03:29 -07:00
2021-12-03 00:44:16 -08:00
export const subscriberFields : INodeProperties [ ] = [
2020-10-28 15:04:12 -07:00
/* -------------------------------------------------------------------------- */
/* subscriber:create */
/* -------------------------------------------------------------------------- */
2020-10-28 15:03:29 -07:00
{
displayName : 'Email' ,
name : 'email' ,
type : 'string' ,
2022-06-20 07:54:01 -07:00
placeholder : 'name@email.com' ,
2020-10-28 15:03:29 -07:00
required : true ,
2021-12-03 00:44:16 -08:00
default : '' ,
2020-10-28 15:03:29 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'subscriber' ] ,
operation : [ 'create' ] ,
2020-10-28 15:03:29 -07:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Email of new subscriber' ,
2020-10-28 15:03:29 -07:00
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'subscriber' ] ,
operation : [ 'create' ] ,
2020-10-28 15:03:29 -07:00
} ,
} ,
options : [
{
displayName : 'Confirmation Timestamp' ,
name : 'confirmation_timestamp' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Confirmation IP' ,
name : 'confirmation_ip' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Custom Fields' ,
name : 'customFieldsUi' ,
placeholder : 'Add Custom Field' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Filter by custom fields' ,
2020-10-28 15:03:29 -07:00
default : { } ,
options : [
{
name : 'customFieldsValues' ,
displayName : 'Custom Field' ,
values : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Field Name or ID' ,
2020-10-28 15:03:29 -07:00
name : 'fieldId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getCustomFields' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The ID of the field to add custom field to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-10-28 15:03:29 -07:00
} ,
{
displayName : 'Value' ,
name : 'value' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The value to set on custom field' ,
2020-10-28 15:03:29 -07:00
} ,
] ,
} ,
] ,
} ,
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Resubscribe' ,
name : 'resubscribe' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether to reactivate subscriber' ,
2020-10-28 15:03:29 -07:00
} ,
{
displayName : 'Signup IP' ,
name : 'signup_ip' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Signup Timestamp' ,
name : 'signup_timestamp' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Type' ,
name : 'type' ,
type : 'options' ,
options : [
{
name : 'Active' ,
value : 'active' ,
} ,
{
name : 'Unsubscribed' ,
value : 'unsubscribed' ,
} ,
{
name : 'Unconfirmed' ,
value : 'unconfirmed' ,
} ,
] ,
default : '' ,
} ,
] ,
} ,
2020-10-28 15:04:12 -07:00
/* -------------------------------------------------------------------------- */
/* subscriber:update */
/* -------------------------------------------------------------------------- */
2020-10-28 15:03:29 -07:00
{
2020-10-28 15:04:12 -07:00
displayName : 'Subscriber Email' ,
2020-10-28 15:03:29 -07:00
name : 'subscriberId' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'subscriber' ] ,
operation : [ 'update' ] ,
2020-10-28 15:03:29 -07:00
} ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Email of subscriber' ,
2020-10-28 15:03:29 -07:00
} ,
{
displayName : 'Update Fields' ,
name : 'updateFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'subscriber' ] ,
operation : [ 'update' ] ,
2020-10-28 15:03:29 -07:00
} ,
} ,
options : [
{
displayName : 'Custom Fields' ,
name : 'customFieldsUi' ,
placeholder : 'Add Custom Field' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Filter by custom fields' ,
2020-10-28 15:03:29 -07:00
default : { } ,
options : [
{
name : 'customFieldsValues' ,
displayName : 'Custom Field' ,
values : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Field Name or ID' ,
2020-10-28 15:03:29 -07:00
name : 'fieldId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getCustomFields' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The ID of the field to add custom field to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-10-28 15:03:29 -07:00
} ,
{
displayName : 'Value' ,
name : 'value' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The value to set on custom field' ,
2020-10-28 15:03:29 -07:00
} ,
] ,
} ,
] ,
} ,
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Resend Autoresponders' ,
name : 'resend_autoresponders' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether it is needed to resend autoresponders' ,
2020-10-28 15:03:29 -07:00
} ,
{
displayName : 'Type' ,
name : 'type' ,
type : 'options' ,
options : [
{
name : 'Active' ,
value : 'active' ,
} ,
{
name : 'Unsubscribed' ,
value : 'unsubscribed' ,
} ,
{
name : 'Unconfirmed' ,
value : 'unconfirmed' ,
} ,
] ,
default : '' ,
} ,
] ,
} ,
2020-10-28 15:04:12 -07:00
/* -------------------------------------------------------------------------- */
/* subscriber:delete */
/* -------------------------------------------------------------------------- */
2020-10-28 15:03:29 -07:00
{
2020-10-28 15:04:12 -07:00
displayName : 'Subscriber Email' ,
2020-10-28 15:03:29 -07:00
name : 'subscriberId' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'subscriber' ] ,
operation : [ 'delete' ] ,
2020-10-28 15:03:29 -07:00
} ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Email of subscriber to delete' ,
2020-10-28 15:03:29 -07:00
} ,
2020-10-28 15:04:12 -07:00
/* -------------------------------------------------------------------------- */
/* subscriber:get */
/* -------------------------------------------------------------------------- */
2020-10-28 15:03:29 -07:00
{
2020-10-28 15:04:12 -07:00
displayName : 'Subscriber Email' ,
2020-10-28 15:03:29 -07:00
name : 'subscriberId' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'subscriber' ] ,
operation : [ 'get' ] ,
2020-10-28 15:03:29 -07:00
} ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Email of subscriber to get' ,
2020-10-28 15:03:29 -07:00
} ,
2020-10-28 15:04:12 -07:00
/* -------------------------------------------------------------------------- */
/* subscriber:getAll */
/* -------------------------------------------------------------------------- */
2020-10-28 15:03:29 -07:00
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'subscriber' ] ,
operation : [ 'getAll' ] ,
2020-10-28 15:03:29 -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-10-28 15:03:29 -07:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'subscriber' ] ,
operation : [ 'getAll' ] ,
returnAll : [ false ] ,
2020-10-28 15:03:29 -07:00
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 100 ,
} ,
default : 50 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-10-28 15:03:29 -07:00
} ,
{
displayName : 'Filters' ,
name : 'filters' ,
type : 'collection' ,
placeholder : 'Add Filter' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'getAll' ] ,
resource : [ 'subscriber' ] ,
2020-10-28 15:03:29 -07:00
} ,
} ,
default : { } ,
options : [
{
displayName : 'Type' ,
name : 'type' ,
type : 'options' ,
options : [
{
name : 'Active' ,
value : 'active' ,
} ,
{
name : 'Unsubscribed' ,
value : 'unsubscribed' ,
} ,
{
name : 'Unconfirmed' ,
value : 'unconfirmed' ,
} ,
] ,
default : '' ,
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;