From 5aec61bb18f6b5cb26a177d32d54c09d0f5a4bc7 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 4 Aug 2020 10:32:51 +0200 Subject: [PATCH] :zap: Fixes to CustomerIo-Node --- .../credentials/CustomerIoApi.credentials.ts | 2 +- .../nodes/CustomerIo/CustomerIoTrigger.node.ts | 13 +++++++------ .../nodes/CustomerIo/GenericFunctions.ts | 4 ++-- .../nodes-base/nodes/CustomerIo/customer.Io.png | Bin 1790 -> 0 bytes 4 files changed, 10 insertions(+), 9 deletions(-) delete mode 100644 packages/nodes-base/nodes/CustomerIo/customer.Io.png diff --git a/packages/nodes-base/credentials/CustomerIoApi.credentials.ts b/packages/nodes-base/credentials/CustomerIoApi.credentials.ts index 2cc92c81af..ece4f9d29d 100644 --- a/packages/nodes-base/credentials/CustomerIoApi.credentials.ts +++ b/packages/nodes-base/credentials/CustomerIoApi.credentials.ts @@ -9,7 +9,7 @@ export class CustomerIoApi implements ICredentialType { displayName = 'Customer.io API'; properties = [ { - displayName: 'API Key', + displayName: 'App API Key', name: 'apiKey', type: 'string' as NodePropertyTypes, default: '', diff --git a/packages/nodes-base/nodes/CustomerIo/CustomerIoTrigger.node.ts b/packages/nodes-base/nodes/CustomerIo/CustomerIoTrigger.node.ts index 5db8a4f899..875e77bd3e 100644 --- a/packages/nodes-base/nodes/CustomerIo/CustomerIoTrigger.node.ts +++ b/packages/nodes-base/nodes/CustomerIo/CustomerIoTrigger.node.ts @@ -15,7 +15,7 @@ import { eventExists, } from './GenericFunctions'; -interface IEvent{ +interface IEvent { customer?: IDataObject; email?: IDataObject; push?: IDataObject; @@ -27,14 +27,14 @@ interface IEvent{ export class CustomerIoTrigger implements INodeType { description: INodeTypeDescription = { displayName: 'Customer.io Trigger', - name: 'customerIo', + name: 'customerIoTrigger', group: ['trigger'], - icon: 'file:customer.Io.png', + icon: 'file:customerio.png', version: 1, description: 'Starts the workflow on a Customer.io update. (Beta)', defaults: { name: 'Customer.io Trigger', - color: '#00FF00', + color: '#7131ff', }, inputs: [], outputs: ['main'], @@ -57,6 +57,7 @@ export class CustomerIoTrigger implements INodeType { displayName: 'Events', name: 'events', type: 'multiOptions', + required: true, default: [], description: 'The events that can trigger the webhook and whether they are enabled.', options: [ @@ -245,8 +246,8 @@ export class CustomerIoTrigger implements INodeType { for (const webhook of webhooks) { if (webhook.endpoint === webhookUrl && eventExists(currentEvents, webhook.events)) { - webhookData.webhookId = webhook.id; - return true; + webhookData.webhookId = webhook.id; + return true; } } diff --git a/packages/nodes-base/nodes/CustomerIo/GenericFunctions.ts b/packages/nodes-base/nodes/CustomerIo/GenericFunctions.ts index 48e475f533..ba6a388acb 100644 --- a/packages/nodes-base/nodes/CustomerIo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/CustomerIo/GenericFunctions.ts @@ -55,9 +55,9 @@ export async function apiRequest(this: IHookFunctions | IExecuteFunctions | ILoa } } -export function eventExists (currentEvents : string[], webhookEvents: IDataObject) { +export function eventExists(currentEvents: string[], webhookEvents: IDataObject) { for (const currentEvent of currentEvents) { - if (get(webhookEvents, `${currentEvent.split('.')[0]}.${currentEvent.split('.')[1]}`) !== true) { + if (get(webhookEvents, `${currentEvent.split('.')[0]}.${currentEvent.split('.')[1]}`) !== true) { return false; } } diff --git a/packages/nodes-base/nodes/CustomerIo/customer.Io.png b/packages/nodes-base/nodes/CustomerIo/customer.Io.png deleted file mode 100644 index 7c5ae3010a4c7490ce71d9a7d3d611ad5de5c436..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1790 zcmZ{lX*Ao38pi*LBoai1s-#*(#Zt9|5=&JjmP$*hr4cC;yHqq8!MWNDA-L7UZE7cR z%d`e#X=bR=rg{}cV`=Cu%BWPemfGeprBvNG_tX7w&wHNtInQ&>@BRAb`dvJSRMAlZ z002q$a`#ub^MT+n#diAoCQ)IKSfURR0Dir#`ZXM?$k<3Pe;)w2ZVUjtECAS1RJ;WM zNX7%e5?w)+0RWmUdVJ~N5G>-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