Fixes to MailerLite Node

This commit is contained in:
Jan Oberhauser 2020-10-28 23:04:12 +01:00
parent b5bbe9a181
commit e9b49d78e1
2 changed files with 33 additions and 30 deletions

View file

@ -24,7 +24,7 @@ import {
export class MailerLite implements INodeType {
description: INodeTypeDescription = {
displayName: 'MailerLite',
name: 'marilerLite',
name: 'mailerLite',
icon: 'file:mailerLite.png',
group: ['input'],
version: 1,
@ -92,7 +92,7 @@ export class MailerLite implements INodeType {
if (resource === 'subscriber') {
//https://developers.mailerlite.com/reference#create-a-subscriber
if (operation === 'create') {
const email = this.getNodeParameter('email', i) as string;
const email = this.getNodeParameter('email', i) as string;
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
@ -123,13 +123,13 @@ export class MailerLite implements INodeType {
}
//https://developers.mailerlite.com/reference#single-subscriber
if (operation === 'get') {
const subscriberId = this.getNodeParameter('subscriberId', i) as string;
const subscriberId = this.getNodeParameter('subscriberId', i) as string;
responseData = await mailerliteApiRequest.call(this, 'GET', `/subscribers/${subscriberId}`);
}
//https://developers.mailerlite.com/reference#subscribers
if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
const filters = this.getNodeParameter('filters', i) as IDataObject;
@ -146,7 +146,7 @@ export class MailerLite implements INodeType {
}
//https://developers.mailerlite.com/reference#update-subscriber
if (operation === 'update') {
const subscriberId = this.getNodeParameter('subscriberId', i) as string;
const subscriberId = this.getNodeParameter('subscriberId', i) as string;
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;

View file

@ -1,6 +1,6 @@
import {
INodeProperties,
} from "n8n-workflow";
} from 'n8n-workflow';
export const subscriberOperations = [
{
@ -43,9 +43,9 @@ export const subscriberOperations = [
export const subscriberFields = [
/* -------------------------------------------------------------------------- */
/* subscriber:create */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* subscriber:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Email',
name: 'email',
@ -61,7 +61,7 @@ export const subscriberFields = [
]
},
},
description: 'email of new subscriber',
description: 'Email of new subscriber.',
},
{
displayName: 'Additional Fields',
@ -139,7 +139,7 @@ export const subscriberFields = [
name: 'resubscribe',
type: 'boolean',
default: false,
description: 'reactivate subscriber if value is true',
description: 'Reactivate subscriber if value is true.',
},
{
displayName: 'Signup IP',
@ -175,11 +175,12 @@ export const subscriberFields = [
},
],
},
/* -------------------------------------------------------------------------- */
/* subscriber:update */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* subscriber:update */
/* -------------------------------------------------------------------------- */
{
displayName: 'Subscriber ID',
displayName: 'Subscriber Email',
name: 'subscriberId',
type: 'string',
required: true,
@ -194,7 +195,7 @@ export const subscriberFields = [
},
},
default: '',
description: 'ID or email of subscriber',
description: 'Email of subscriber.',
},
{
displayName: 'Update Fields',
@ -260,7 +261,7 @@ export const subscriberFields = [
name: 'resend_autoresponders',
type: 'boolean',
default: false,
description: 'Defines if it is needed to resend autoresponders',
description: 'Defines if it is needed to resend autoresponders.',
},
{
displayName: 'Type',
@ -284,11 +285,12 @@ export const subscriberFields = [
},
],
},
/* -------------------------------------------------------------------------- */
/* subscriber:delete */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* subscriber:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Subscriber ID',
displayName: 'Subscriber Email',
name: 'subscriberId',
type: 'string',
required: true,
@ -303,13 +305,14 @@ export const subscriberFields = [
},
},
default: '',
description: 'ID or email of subscriber',
description: 'Email of subscriber to delete.',
},
/* -------------------------------------------------------------------------- */
/* subscriber:get */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* subscriber:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Subscriber ID',
displayName: 'Subscriber Email',
name: 'subscriberId',
type: 'string',
required: true,
@ -324,11 +327,11 @@ export const subscriberFields = [
},
},
default: '',
description: 'ID or email of subscriber',
description: 'Email of subscriber to get.',
},
/* -------------------------------------------------------------------------- */
/* subscriber:getAll */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* subscriber:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',