mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +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,14 +9,9 @@ import {
|
||||
IWebhookResponseData,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { netlifyApiRequest } from './GenericFunctions';
|
||||
|
||||
import {
|
||||
netlifyApiRequest,
|
||||
} from './GenericFunctions';
|
||||
|
||||
import {
|
||||
snakeCase,
|
||||
} from 'change-case';
|
||||
import { snakeCase } from 'change-case';
|
||||
|
||||
export class NetlifyTrigger implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
@@ -59,7 +51,8 @@ export class NetlifyTrigger implements INodeType {
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getSites',
|
||||
},
|
||||
description: 'Select the Site ID. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
description:
|
||||
'Select the Site ID. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Event',
|
||||
@@ -93,16 +86,15 @@ export class NetlifyTrigger implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
event: [
|
||||
'submissionCreated',
|
||||
],
|
||||
event: ['submissionCreated'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getForms',
|
||||
},
|
||||
description: 'Select a form. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
description:
|
||||
'Select a form. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Simplify',
|
||||
@@ -110,13 +102,12 @@ export class NetlifyTrigger implements INodeType {
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
event: [
|
||||
'submissionCreated',
|
||||
],
|
||||
event: ['submissionCreated'],
|
||||
},
|
||||
},
|
||||
default: true,
|
||||
description: 'Whether to return a simplified version of the response instead of the raw data',
|
||||
description:
|
||||
'Whether to return a simplified version of the response instead of the raw data',
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -179,11 +170,7 @@ export class NetlifyTrigger implements INodeType {
|
||||
loadOptions: {
|
||||
async getSites(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
const sites = await netlifyApiRequest.call(
|
||||
this,
|
||||
'GET',
|
||||
'/sites',
|
||||
);
|
||||
const sites = await netlifyApiRequest.call(this, 'GET', '/sites');
|
||||
for (const site of sites) {
|
||||
returnData.push({
|
||||
name: site.name,
|
||||
@@ -196,11 +183,7 @@ export class NetlifyTrigger implements INodeType {
|
||||
async getForms(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
const siteId = this.getNodeParameter('siteId');
|
||||
const forms = await netlifyApiRequest.call(
|
||||
this,
|
||||
'GET',
|
||||
`/sites/${siteId}/forms`,
|
||||
);
|
||||
const forms = await netlifyApiRequest.call(this, 'GET', `/sites/${siteId}/forms`);
|
||||
for (const form of forms) {
|
||||
returnData.push({
|
||||
name: form.name,
|
||||
@@ -224,9 +207,7 @@ export class NetlifyTrigger implements INodeType {
|
||||
}
|
||||
|
||||
return {
|
||||
workflowData: [
|
||||
this.helpers.returnJsonArray(response),
|
||||
],
|
||||
workflowData: [this.helpers.returnJsonArray(response)],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user