mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
n8n-3867-progressively-apply-prettier-to-all (#3873)
* 🔨 formatting nodes with prettier
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
import {
|
||||
IHookFunctions,
|
||||
IWebhookFunctions,
|
||||
} from 'n8n-core';
|
||||
import { IHookFunctions, IWebhookFunctions } from 'n8n-core';
|
||||
|
||||
import {
|
||||
IDataObject,
|
||||
@@ -12,13 +9,9 @@ import {
|
||||
IWebhookResponseData,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
keapApiRequest,
|
||||
} from './GenericFunctions';
|
||||
import { keapApiRequest } from './GenericFunctions';
|
||||
|
||||
import {
|
||||
capitalCase,
|
||||
} from 'change-case';
|
||||
import { capitalCase } from 'change-case';
|
||||
|
||||
export class KeapTrigger implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
@@ -54,7 +47,8 @@ export class KeapTrigger implements INodeType {
|
||||
displayName: 'Event Name or ID',
|
||||
name: 'eventId',
|
||||
type: 'options',
|
||||
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||
description:
|
||||
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getEvents',
|
||||
},
|
||||
@@ -102,9 +96,11 @@ export class KeapTrigger implements INodeType {
|
||||
const responseData = await keapApiRequest.call(this, 'GET', '/hooks', {});
|
||||
|
||||
for (const existingData of responseData) {
|
||||
if (existingData.hookUrl === webhookUrl
|
||||
&& existingData.eventKey === eventId
|
||||
&& existingData.status === 'Verified') {
|
||||
if (
|
||||
existingData.hookUrl === webhookUrl &&
|
||||
existingData.eventKey === eventId &&
|
||||
existingData.status === 'Verified'
|
||||
) {
|
||||
// The webhook exists already
|
||||
webhookData.webhookId = existingData.key;
|
||||
return true;
|
||||
@@ -138,7 +134,6 @@ export class KeapTrigger implements INodeType {
|
||||
const webhookData = this.getWorkflowStaticData('node');
|
||||
|
||||
if (webhookData.webhookId !== undefined) {
|
||||
|
||||
try {
|
||||
await keapApiRequest.call(this, 'DELETE', `/hooks/${webhookData.webhookId}`);
|
||||
} catch (error) {
|
||||
@@ -172,9 +167,7 @@ export class KeapTrigger implements INodeType {
|
||||
|
||||
if (rawData) {
|
||||
return {
|
||||
workflowData: [
|
||||
this.helpers.returnJsonArray(bodyData),
|
||||
],
|
||||
workflowData: [this.helpers.returnJsonArray(bodyData)],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -189,9 +182,7 @@ export class KeapTrigger implements INodeType {
|
||||
});
|
||||
}
|
||||
return {
|
||||
workflowData: [
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
],
|
||||
workflowData: [this.helpers.returnJsonArray(responseData)],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user