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,19 +9,11 @@ import {
|
||||
IWebhookResponseData,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
wufooApiRequest,
|
||||
} from './GenericFunctions';
|
||||
import { wufooApiRequest } from './GenericFunctions';
|
||||
|
||||
import {
|
||||
IField,
|
||||
IFormQuery,
|
||||
IWebhook,
|
||||
} from './Interface';
|
||||
import { IField, IFormQuery, IWebhook } from './Interface';
|
||||
|
||||
import {
|
||||
randomBytes,
|
||||
} from 'crypto';
|
||||
import { randomBytes } from 'crypto';
|
||||
|
||||
export class WufooTrigger implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
@@ -64,7 +53,8 @@ export class WufooTrigger implements INodeType {
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'getForms',
|
||||
},
|
||||
description: 'The form upon which will trigger this node when a new entry is made. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
description:
|
||||
'The form upon which will trigger this node when a new entry is made. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Only Answers',
|
||||
@@ -166,14 +156,11 @@ export class WufooTrigger implements INodeType {
|
||||
const fieldsObject = JSON.parse(req.body.FieldStructure);
|
||||
|
||||
fieldsObject.Fields.map((field: IField) => {
|
||||
|
||||
// TODO
|
||||
// Handle docusign field
|
||||
|
||||
if (field.Type === 'file') {
|
||||
|
||||
entries[field.Title] = req.body[`${field.ID}-url`];
|
||||
|
||||
} else if (field.Type === 'address') {
|
||||
const address: IDataObject = {};
|
||||
|
||||
@@ -182,9 +169,7 @@ export class WufooTrigger implements INodeType {
|
||||
}
|
||||
|
||||
entries[field.Title] = address;
|
||||
|
||||
} else if (field.Type === 'checkbox') {
|
||||
|
||||
const responses: string[] = [];
|
||||
|
||||
for (const subfield of field.SubFields) {
|
||||
@@ -194,9 +179,7 @@ export class WufooTrigger implements INodeType {
|
||||
}
|
||||
|
||||
entries[field.Title] = responses;
|
||||
|
||||
} else if (field.Type === 'likert') {
|
||||
|
||||
const likert: IDataObject = {};
|
||||
|
||||
for (const subfield of field.SubFields) {
|
||||
@@ -204,9 +187,7 @@ export class WufooTrigger implements INodeType {
|
||||
}
|
||||
|
||||
entries[field.Title] = likert;
|
||||
|
||||
} else if (field.Type === 'shortname') {
|
||||
|
||||
const shortname: IDataObject = {};
|
||||
|
||||
for (const subfield of field.SubFields) {
|
||||
@@ -214,7 +195,6 @@ export class WufooTrigger implements INodeType {
|
||||
}
|
||||
|
||||
entries[field.Title] = shortname;
|
||||
|
||||
} else {
|
||||
entries[field.Title] = req.body[field.ID];
|
||||
}
|
||||
@@ -232,16 +212,11 @@ export class WufooTrigger implements INodeType {
|
||||
};
|
||||
|
||||
return {
|
||||
workflowData: [
|
||||
this.helpers.returnJsonArray([returnObject as unknown as IDataObject]),
|
||||
],
|
||||
workflowData: [this.helpers.returnJsonArray([returnObject as unknown as IDataObject])],
|
||||
};
|
||||
|
||||
} else {
|
||||
return {
|
||||
workflowData: [
|
||||
this.helpers.returnJsonArray(entries as unknown as IDataObject),
|
||||
],
|
||||
workflowData: [this.helpers.returnJsonArray(entries as unknown as IDataObject)],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user