diff --git a/packages/nodes-base/nodes/Affinity/Affinity.node.ts b/packages/nodes-base/nodes/Affinity/Affinity.node.ts index 2b024c7517..972c2e7ec3 100644 --- a/packages/nodes-base/nodes/Affinity/Affinity.node.ts +++ b/packages/nodes-base/nodes/Affinity/Affinity.node.ts @@ -101,7 +101,7 @@ export class Affinity implements INodeType { for (const person of persons) { let personName = `${person.first_name} ${person.last_name}`; if (person.primary_email !== null) { - personName+= ` (${person.primary_email})` + personName+= ` (${person.primary_email})`; } const personId = person.id; returnData.push({ diff --git a/packages/nodes-base/nodes/Affinity/AffinityTrigger.node.ts b/packages/nodes-base/nodes/Affinity/AffinityTrigger.node.ts index 230afba160..828b3ce1da 100644 --- a/packages/nodes-base/nodes/Affinity/AffinityTrigger.node.ts +++ b/packages/nodes-base/nodes/Affinity/AffinityTrigger.node.ts @@ -98,10 +98,6 @@ export class AffinityTrigger implements INodeType { name: 'list_entry.created', value: 'list_entry.created', }, - { - name: 'list_entry.updated', - value: 'list_entry.updated', - }, { name: 'list_entry.deleted', value: 'list_entry.deleted', @@ -159,13 +155,6 @@ export class AffinityTrigger implements INodeType { required: true, description: 'Webhook events that will be enabled for that endpoint.', }, - { - displayName: 'Resolve Data', - name: 'resolveData', - type: 'boolean', - default: true, - description: 'By default does the webhook-data only contain the ID of the object.
If this option gets activated it will resolve the data automatically.', - }, ], }; @@ -239,25 +228,15 @@ export class AffinityTrigger implements INodeType { async webhook(this: IWebhookFunctions): Promise { const bodyData = this.getBodyData(); - const resolveData = this.getNodeParameter('resolveData', false) as boolean; if (bodyData.type === 'sample.webhook') { - return {} - } - - if (resolveData === false) { - // Return the data as it got received - return { - workflowData: [ - this.helpers.returnJsonArray(bodyData), - ], - }; + return {}; } let responseData: IDataObject = {}; if (bodyData.type && bodyData.body) { - const resource = (bodyData.type as string).split('.')[0] + const resource = (bodyData.type as string).split('.')[0]; //@ts-ignore const id = bodyData.body.id; responseData = await affinityApiRequest.call(this, 'GET', `/${mapResource(resource)}/${id}`); diff --git a/packages/nodes-base/nodes/Affinity/GenericFunctions.ts b/packages/nodes-base/nodes/Affinity/GenericFunctions.ts index 76f73143ee..0c2f680613 100644 --- a/packages/nodes-base/nodes/Affinity/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Affinity/GenericFunctions.ts @@ -42,8 +42,8 @@ export async function affinityApiRequest(this: IExecuteFunctions | IWebhookFunct return await this.helpers.request!(options); } catch (error) { if (error.response) { - let errorMessage = error.response.body.message || error.response.body.description || error.message; - throw new Error(`Affinity error response [${error.statusCode}]: ${errorMessage}`); + const errorMessage = error.response.body.message || error.response.body.description || error.message; + throw new Error(`Affinity error response: ${errorMessage}`); } throw error; } @@ -57,10 +57,8 @@ export async function affinityApiRequestAllItems(this: IHookFunctions | ILoadOpt query.page_size = 500; - let uri: string | undefined; - do { - responseData = await affinityApiRequest.call(this, method, resource, body, query, uri); + responseData = await affinityApiRequest.call(this, method, resource, body, query); // @ts-ignore query.page_token = responseData.page_token; returnData.push.apply(returnData, responseData[propertyName]); @@ -75,7 +73,7 @@ export async function affinityApiRequestAllItems(this: IHookFunctions | ILoadOpt export function eventsExist(subscriptions: string[], currentSubsriptions: string[]) { for (const subscription of currentSubsriptions) { if (!subscriptions.includes(subscription)) { - return false + return false; } } return true; @@ -91,5 +89,5 @@ export function mapResource(key: string) { list_entry: 'list-entries', field: 'fields', file: 'files', - }[key] + }[key]; } diff --git a/packages/nodes-base/nodes/Affinity/OrganizationDescription.ts b/packages/nodes-base/nodes/Affinity/OrganizationDescription.ts index 047afba290..8e8a72f2bd 100644 --- a/packages/nodes-base/nodes/Affinity/OrganizationDescription.ts +++ b/packages/nodes-base/nodes/Affinity/OrganizationDescription.ts @@ -16,17 +16,17 @@ export const organizationOperations = [ { name: 'Create', value: 'create', - description: 'Create a organization', + description: 'Create an organization', }, { name: 'Delete', value: 'delete', - description: 'Delete a organization', + description: 'Delete an organization', }, { name: 'Get', value: 'get', - description: 'Get a organization', + description: 'Get an organization', }, { name: 'Get All', @@ -36,7 +36,7 @@ export const organizationOperations = [ { name: 'Update', value: 'update', - description: 'Update a organization', + description: 'Update an organization', }, ], default: 'create',