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,6 +1,4 @@
import {
IExecuteFunctions,
} from 'n8n-core';
import { IExecuteFunctions } from 'n8n-core';
import {
IDataObject,
INodeExecutionData,
@@ -9,10 +7,7 @@ import {
NodeOperationError,
} from 'n8n-workflow';
import {
escapeXml,
twilioApiRequest,
} from './GenericFunctions';
import { escapeXml, twilioApiRequest } from './GenericFunctions';
export class Twilio implements INodeType {
description: INodeTypeDescription = {
@@ -60,9 +55,7 @@ export class Twilio implements INodeType {
noDataExpression: true,
displayOptions: {
show: {
resource: [
'sms',
],
resource: ['sms'],
},
},
options: [
@@ -83,9 +76,7 @@ export class Twilio implements INodeType {
noDataExpression: true,
displayOptions: {
show: {
resource: [
'call',
],
resource: ['call'],
},
},
options: [
@@ -98,7 +89,6 @@ export class Twilio implements INodeType {
default: 'make',
},
// ----------------------------------
// sms / call
// ----------------------------------
@@ -115,14 +105,8 @@ export class Twilio implements INodeType {
required: true,
displayOptions: {
show: {
operation: [
'send',
'make',
],
resource: [
'sms',
'call',
],
operation: ['send', 'make'],
resource: ['sms', 'call'],
},
},
description: 'The number from which to send the message',
@@ -136,14 +120,8 @@ export class Twilio implements INodeType {
required: true,
displayOptions: {
show: {
operation: [
'send',
'make',
],
resource: [
'sms',
'call',
],
operation: ['send', 'make'],
resource: ['sms', 'call'],
},
},
description: 'The number to which to send the message',
@@ -155,12 +133,8 @@ export class Twilio implements INodeType {
default: false,
displayOptions: {
show: {
operation: [
'send',
],
resource: [
'sms',
],
operation: ['send'],
resource: ['sms'],
},
},
description: 'Whether the message should be sent to WhatsApp',
@@ -173,12 +147,8 @@ export class Twilio implements INodeType {
required: true,
displayOptions: {
show: {
operation: [
'send',
],
resource: [
'sms',
],
operation: ['send'],
resource: ['sms'],
},
},
description: 'The message to send',
@@ -190,15 +160,12 @@ export class Twilio implements INodeType {
default: false,
displayOptions: {
show: {
operation: [
'make',
],
resource: [
'call',
],
operation: ['make'],
resource: ['call'],
},
},
description: 'Whether to use the <a href="https://www.twilio.com/docs/voice/twiml">Twilio Markup Language</a> in the message',
description:
'Whether to use the <a href="https://www.twilio.com/docs/voice/twiml">Twilio Markup Language</a> in the message',
},
{
displayName: 'Message',
@@ -208,12 +175,8 @@ export class Twilio implements INodeType {
required: true,
displayOptions: {
show: {
operation: [
'make',
],
resource: [
'call',
],
operation: ['make'],
resource: ['call'],
},
},
},
@@ -229,7 +192,8 @@ export class Twilio implements INodeType {
name: 'statusCallback',
type: 'string',
default: '',
description: 'Status Callbacks allow you to receive events related to the REST resources managed by Twilio: Rooms, Recordings and Compositions',
description:
'Status Callbacks allow you to receive events related to the REST resources managed by Twilio: Rooms, Recordings and Compositions',
},
],
},
@@ -282,7 +246,11 @@ export class Twilio implements INodeType {
body.To = `whatsapp:${body.To}`;
}
} else {
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
throw new NodeOperationError(
this.getNode(),
`The operation "${operation}" is not known!`,
{ itemIndex: i },
);
}
} else if (resource === 'call') {
if (operation === 'make') {
@@ -306,10 +274,16 @@ export class Twilio implements INodeType {
body.StatusCallback = this.getNodeParameter('options.statusCallback', i, '') as string;
} else {
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
throw new NodeOperationError(
this.getNode(),
`The operation "${operation}" is not known!`,
{ itemIndex: i },
);
}
} else {
throw new NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, { itemIndex: i });
throw new NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
itemIndex: i,
});
}
const responseData = await twilioApiRequest.call(this, requestMethod, endpoint, body, qs);