Feature/extended active campaign (#928)

* feat: 🎸 node/activecampaign account, tag, account contact

* feat: 🎸 node/ActiveCampaign Update an accountContact assoc

* feat: 🎸 node/activecampaign Update an account

* feat: 🎸 node/activecampaign Get an account

* feat: 🎸 node/activecampaign GetAll & Delete an account

* feat: 🎸 node/activecampaign change ID's type to number

* refactor: 💡 node/activecampaign merge getAll properties

*  Improvements to #923

*  Improvements

*  Improvements

*  Add breaking change message

Co-authored-by: Ronald Diquélou <rdiquelou@opensafepro.com>
This commit is contained in:
Ricardo Espinoza
2020-09-18 03:42:01 -04:00
committed by GitHub
parent e18d7934ad
commit a552febab4
13 changed files with 1584 additions and 316 deletions

View File

@@ -1,4 +1,10 @@
import { INodeProperties } from "n8n-workflow";
import {
INodeProperties,
} from 'n8n-workflow';
import {
activeCampaignDefaultGetAllProperties,
} from './GenericFunctions';
export const contactOperations = [
{
@@ -100,6 +106,42 @@ export const contactFields = [
},
default: {},
options: [
{
displayName: 'Custom Fields',
name: 'fieldValues',
placeholder: 'Add Custom Fields',
description: 'Adds a custom fields to set also values which have not been predefined.',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
default: {},
options: [
{
name: 'property',
displayName: 'Custom Field',
values: [
{
displayName: 'Field ID',
name: 'field',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getContactCustomFields',
},
default: '',
description: 'ID of the field to set.',
},
{
displayName: 'Field Value',
name: 'value',
type: 'string',
default: '',
description: 'Value of the field to set.',
},
]
},
],
},
{
displayName: 'First Name',
name: 'firstName',
@@ -121,39 +163,6 @@ export const contactFields = [
default: '',
description: 'Phone number of the contact.',
},
{
displayName: 'Custom Properties',
name: 'customProperties',
placeholder: 'Add Custom Property',
description: 'Adds a custom property to set also values which have not been predefined.',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
default: {},
options: [
{
name: 'property',
displayName: 'Property',
values: [
{
displayName: 'Property Name',
name: 'name',
type: 'string',
default: '',
description: 'Name of the property to set.',
},
{
displayName: 'Property Value',
name: 'value',
type: 'string',
default: '',
description: 'Value of the property to set.',
},
]
},
],
},
],
},
@@ -196,6 +205,42 @@ export const contactFields = [
},
default: {},
options: [
{
displayName: 'Custom Fields',
name: 'fieldValues',
placeholder: 'Add Custom Fields',
description: 'Adds a custom fields to set also values which have not been predefined.',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
default: {},
options: [
{
name: 'property',
displayName: 'Custom Field',
values: [
{
displayName: 'Field ID',
name: 'field',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getContactCustomFields',
},
default: '',
description: 'ID of the field to set.',
},
{
displayName: 'Field Value',
name: 'value',
type: 'string',
default: '',
description: 'Value of the field to set.',
},
]
},
],
},
{
displayName: 'Email',
name: 'email',
@@ -224,39 +269,6 @@ export const contactFields = [
default: '',
description: 'Phone number of the contact.',
},
{
displayName: 'Custom Properties',
name: 'customProperties',
placeholder: 'Add Custom Property',
description: 'Adds a custom property to set also values which have not been predefined.',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
default: {},
options: [
{
name: 'property',
displayName: 'Property',
values: [
{
displayName: 'Property Name',
name: 'name',
type: 'string',
default: '',
description: 'Name of the property to set.',
},
{
displayName: 'Property Value',
name: 'value',
type: 'string',
default: '',
description: 'Value of the property to set.',
},
]
},
],
},
],
},
@@ -307,10 +319,12 @@ export const contactFields = [
// ----------------------------------
// contact:getAll
// ----------------------------------
...activeCampaignDefaultGetAllProperties('contact', 'getAll'),
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
operation: [
@@ -321,31 +335,179 @@ export const contactFields = [
],
},
},
default: false,
description: 'If all results should be returned or only up to a given limit.',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'contact',
],
returnAll: [
false,
],
default: {},
options: [
{
displayName: 'Datetime',
name: 'datetime',
type: 'dateTime',
default: '',
description: 'Contacts created on the specified date',
},
},
typeOptions: {
minValue: 1,
maxValue: 500,
},
default: 100,
description: 'How many results to return.',
{
displayName: 'Email',
name: 'email',
type: 'string',
default: '',
description: 'Email address of the contact you want to get',
},
{
displayName: 'Email Like',
name: 'email_like',
type: 'string',
default: '',
description: 'Filter contacts that contain the given value in the email address',
},
{
displayName: 'Exclude',
name: 'exclude',
type: 'string',
default: '',
description: 'Exclude from the response the contact with the given ID',
},
{
displayName: 'Form ID',
name: 'formid',
type: 'string',
default: '',
description: 'Filter contacts associated with the given form',
},
{
displayName: 'List ID',
name: 'listid',
type: 'string',
default: '',
description: 'Filter contacts associated with the given list',
},
{
displayName: 'Search',
name: 'search',
type: 'string',
default: '',
description: 'Filter contacts that match the given value in the contact names, organization, phone or email',
},
{
displayName: 'Segment ID',
name: 'segmentid',
type: 'string',
default: '',
description: 'Return only contacts that match a list segment',
},
{
displayName: 'Series ID',
name: 'seriesid',
type: 'string',
default: '',
description: 'Filter contacts associated with the given automation',
},
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{
name: 'Any',
value: -1,
},
{
name: 'Unconfirmed',
value: 0,
},
{
name: 'Active',
value: 1,
},
{
name: 'Unsubscribed',
value: 2,
},
{
name: 'Bounced',
value: 3,
},
],
default: '',
},
{
displayName: 'Tag ID',
name: 'tagid',
type: 'string',
default: '',
description: 'Filter contacts associated with the given tag',
},
{
displayName: 'Created Before',
name: 'filters[created_before]',
type: 'dateTime',
default: '',
description: 'Filter contacts that were created prior to this date',
},
{
displayName: 'Created After',
name: 'filters[created_after]',
type: 'dateTime',
default: '',
description: 'Filter contacts that were created after this date',
},
{
displayName: 'Updated Before',
name: 'filters[updated_before]',
type: 'dateTime',
default: '',
description: 'Filter contacts that were updated before this date',
},
{
displayName: 'Updated After',
name: 'filters[updated_after]',
type: 'dateTime',
default: '',
description: 'Filter contacts that were updated after this date',
},
{
displayName: 'Wait ID',
name: 'waitid',
type: 'string',
default: '',
description: 'Filter by contacts in the wait queue of an automation block',
},
{
displayName: 'Order By',
name: 'orderBy',
type: 'options',
options: [
{
name: 'Creation Date',
value: 'orders[cdate]',
description: 'Order contacts by creation date',
},
{
name: 'Email',
value: 'orders[email]',
description: 'Order contacts by email',
},
{
name: 'First Name',
value: 'orders[first_name]',
description: 'Order contacts by first name',
},
{
name: 'Last Name',
value: 'orders[last_name]',
description: 'Order contacts by last name',
},
{
name: 'Name',
value: 'orders[name]',
description: 'Order contacts by full name',
},
{
name: 'Score',
value: 'orders[score]',
description: 'Order contacts by score',
},
],
default: '',
},
],
},
] as INodeProperties[];