n8n-3867-progressively-apply-prettier-to-all (#3873)

* 🔨 formatting nodes with prettier
This commit is contained in:
Michael Kret
2022-08-17 18:50:24 +03:00
committed by GitHub
parent f2d326c7f0
commit 91d7e16c81
1072 changed files with 42357 additions and 59109 deletions

View File

@@ -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 {
workableApiRequest,
} from './GenericFunctions';
import { workableApiRequest } from './GenericFunctions';
import {
snakeCase,
} from 'change-case';
import { snakeCase } from 'change-case';
export class WorkableTrigger implements INodeType {
description: INodeTypeDescription = {
@@ -82,7 +75,8 @@ export class WorkableTrigger implements INodeType {
loadOptionsMethod: 'getJobs',
},
default: '',
description: 'Get notifications only for one job. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
description:
'Get notifications only for one job. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
},
{
displayName: 'Stage Name or ID',
@@ -92,7 +86,8 @@ export class WorkableTrigger implements INodeType {
loadOptionsMethod: 'getStages',
},
default: '',
description: 'Get notifications for specific stages. e.g. \'hired\'. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
description:
'Get notifications for specific stages. e.g. \'hired\'. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
},
],
},
@@ -144,7 +139,10 @@ export class WorkableTrigger implements INodeType {
return false;
},
async create(this: IHookFunctions): Promise<boolean> {
const credentials = await this.getCredentials('workableApi') as { accessToken: string, subdomain: string };
const credentials = (await this.getCredentials('workableApi')) as {
accessToken: string;
subdomain: string;
};
const webhookData = this.getWorkflowStaticData('node');
const webhookUrl = this.getNodeWebhookUrl('default');
const triggerOn = this.getNodeParameter('triggerOn') as string;
@@ -155,8 +153,8 @@ export class WorkableTrigger implements INodeType {
event: snakeCase(triggerOn).toLowerCase(),
args: {
account_id: credentials.subdomain,
...(job) && { job_shortcode: job },
...(stage) && { stage_slug: stage },
...(job && { job_shortcode: job }),
...(stage && { stage_slug: stage }),
},
target: webhookUrl,
};
@@ -174,7 +172,6 @@ export class WorkableTrigger implements INodeType {
async delete(this: IHookFunctions): Promise<boolean> {
const webhookData = this.getWorkflowStaticData('node');
if (webhookData.webhookId !== undefined) {
const endpoint = `/subscriptions/${webhookData.webhookId}`;
try {
await workableApiRequest.call(this, 'DELETE', endpoint);
@@ -193,9 +190,7 @@ export class WorkableTrigger implements INodeType {
async webhook(this: IWebhookFunctions): Promise<IWebhookResponseData> {
const bodyData = this.getBodyData();
return {
workflowData: [
this.helpers.returnJsonArray(bodyData),
],
workflowData: [this.helpers.returnJsonArray(bodyData)],
};
}
}