From 2d74ebb9ab7ec05d700bf44d64c5283fa1bc906a Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 10 Nov 2020 18:32:19 +0100 Subject: [PATCH] :zap: Minor improvement to GetResponse Node --- .../nodes/GetResponse/ContactDescription.ts | 4 ++-- .../nodes/GetResponse/GenericFunctions.ts | 5 ++--- .../nodes/GetResponse/GetResponse.node.ts | 10 +++++----- .../nodes/GetResponse/getResponse.png | Bin 2851 -> 750 bytes 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/nodes-base/nodes/GetResponse/ContactDescription.ts b/packages/nodes-base/nodes/GetResponse/ContactDescription.ts index ba173edde4..0a8e60cdfe 100644 --- a/packages/nodes-base/nodes/GetResponse/ContactDescription.ts +++ b/packages/nodes-base/nodes/GetResponse/ContactDescription.ts @@ -241,6 +241,7 @@ export const contactFields = [ }, ], }, + /* -------------------------------------------------------------------------- */ /* contact:get */ /* -------------------------------------------------------------------------- */ @@ -288,6 +289,7 @@ export const contactFields = [ }, ], }, + /* -------------------------------------------------------------------------- */ /* contact:getAll */ /* -------------------------------------------------------------------------- */ @@ -551,7 +553,6 @@ export const contactFields = [ loadOptionsMethod: 'getCampaigns', }, default: '', - description: '', }, { displayName: 'Custom Fields', @@ -600,7 +601,6 @@ export const contactFields = [ name: 'email', type: 'string', default: '', - description: '', }, { displayName: 'IP Address', diff --git a/packages/nodes-base/nodes/GetResponse/GenericFunctions.ts b/packages/nodes-base/nodes/GetResponse/GenericFunctions.ts index eaae8d4df1..f07d130da4 100644 --- a/packages/nodes-base/nodes/GetResponse/GenericFunctions.ts +++ b/packages/nodes-base/nodes/GetResponse/GenericFunctions.ts @@ -1,6 +1,6 @@ import { OptionsWithUri, - } from 'request'; +} from 'request'; import { IExecuteFunctions, @@ -41,7 +41,7 @@ export async function getresponseApiRequest(this: IWebhookFunctions | IHookFunct } else { //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'getResponseOAuth2Api', options); - } + } } catch (error) { if (error.response && error.response.body && error.response.body.message) { // Try to return the error prettier @@ -68,4 +68,3 @@ export async function getResponseApiRequestAllItems(this: IExecuteFunctions | IL return returnData; } - diff --git a/packages/nodes-base/nodes/GetResponse/GetResponse.node.ts b/packages/nodes-base/nodes/GetResponse/GetResponse.node.ts index 01b069b79c..09e772e1ac 100644 --- a/packages/nodes-base/nodes/GetResponse/GetResponse.node.ts +++ b/packages/nodes-base/nodes/GetResponse/GetResponse.node.ts @@ -47,7 +47,7 @@ export class GetResponse implements INodeType { authentication: [ 'apiKey', ], - }, + }, }, }, { @@ -97,7 +97,7 @@ export class GetResponse implements INodeType { ...contactFields, ], }; - + methods = { loadOptions: { // Get all the campaigns to display them to user so that he can @@ -252,7 +252,7 @@ export class GetResponse implements INodeType { 'changeOnTo', ]; - const dateMapToKey: { [key: string]: string; } = { + const dateMapToKey: { [key: string]: string; } = { 'createdOnFrom': '[createdOn][from]', 'createdOnTo': '[createdOn][to]', 'changeOnFrom': '[changeOn][from]', @@ -264,7 +264,7 @@ export class GetResponse implements INodeType { if (isDate.includes(key)) { qs[`query${dateMapToKey[key]}`] = moment.tz(qs[key], timezone).format('YYYY-MM-DDTHH:mm:ssZZ'); } else { - qs[`query[${key}]`] = qs[key]; + qs[`query[${key}]`] = qs[key]; } delete qs[key]; } @@ -310,7 +310,7 @@ export class GetResponse implements INodeType { } if (Array.isArray(responseData)) { returnData.push.apply(returnData, responseData as IDataObject[]); - + } else if (responseData !== undefined) { returnData.push(responseData as IDataObject); } diff --git a/packages/nodes-base/nodes/GetResponse/getResponse.png b/packages/nodes-base/nodes/GetResponse/getResponse.png index 78a1717949755d09a00ea979daf7b76bbb9ea65b..f533a87a64ce9a996f1928503f56eef39e3b1a8b 100644 GIT binary patch delta 737 zcmV<70v`RN7VZU*8Gi!+000dlDL?=K0H07yR7C)}r|ST!>j16nC$a1! zvFsqR>>04^6|n3bu-xpy__W>jvE25n+4Y#u^M8%Z@@K*DOSuU?3mgE;4UcaFV9-9* z@4JP=3!%-9^$v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