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,6 +1,4 @@
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
} from 'n8n-core';
|
||||
import { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import {
|
||||
IDataObject,
|
||||
@@ -10,9 +8,7 @@ import {
|
||||
NodeOperationError,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
messageBirdApiRequest,
|
||||
} from './GenericFunctions';
|
||||
import { messageBirdApiRequest } from './GenericFunctions';
|
||||
|
||||
export class MessageBird implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
@@ -59,9 +55,7 @@ export class MessageBird implements INodeType {
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'sms',
|
||||
],
|
||||
resource: ['sms'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -81,9 +75,7 @@ export class MessageBird implements INodeType {
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'balance',
|
||||
],
|
||||
resource: ['balance'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -109,12 +101,8 @@ export class MessageBird implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'send',
|
||||
],
|
||||
resource: [
|
||||
'sms',
|
||||
],
|
||||
operation: ['send'],
|
||||
resource: ['sms'],
|
||||
},
|
||||
},
|
||||
description: 'The number from which to send the message',
|
||||
@@ -128,12 +116,8 @@ export class MessageBird implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'send',
|
||||
],
|
||||
resource: [
|
||||
'sms',
|
||||
],
|
||||
operation: ['send'],
|
||||
resource: ['sms'],
|
||||
},
|
||||
},
|
||||
description: 'All recipients separated by commas',
|
||||
@@ -146,12 +130,8 @@ export class MessageBird implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'send',
|
||||
],
|
||||
resource: [
|
||||
'sms',
|
||||
],
|
||||
operation: ['send'],
|
||||
resource: ['sms'],
|
||||
},
|
||||
},
|
||||
description: 'The message to be send',
|
||||
@@ -162,12 +142,8 @@ export class MessageBird implements INodeType {
|
||||
type: 'collection',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'send',
|
||||
],
|
||||
resource: [
|
||||
'sms',
|
||||
],
|
||||
operation: ['send'],
|
||||
resource: ['sms'],
|
||||
},
|
||||
},
|
||||
placeholder: 'Add Fields',
|
||||
@@ -178,7 +154,8 @@ export class MessageBird implements INodeType {
|
||||
name: 'createdDatetime',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description: 'The date and time of the creation of the message in RFC3339 format (Y-m-dTH:i:sP)',
|
||||
description:
|
||||
'The date and time of the creation of the message in RFC3339 format (Y-m-dTH:i:sP)',
|
||||
},
|
||||
{
|
||||
displayName: 'Datacoding',
|
||||
@@ -199,7 +176,8 @@ export class MessageBird implements INodeType {
|
||||
},
|
||||
],
|
||||
default: '',
|
||||
description: 'Using unicode will limit the maximum number of characters to 70 instead of 160',
|
||||
description:
|
||||
'Using unicode will limit the maximum number of characters to 70 instead of 160',
|
||||
},
|
||||
{
|
||||
displayName: 'Gateway',
|
||||
@@ -246,14 +224,16 @@ export class MessageBird implements INodeType {
|
||||
name: 'reportUrl',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'The status report URL to be used on a per-message basis. Reference is required for a status report webhook to be sent.',
|
||||
description:
|
||||
'The status report URL to be used on a per-message basis. Reference is required for a status report webhook to be sent.',
|
||||
},
|
||||
{
|
||||
displayName: 'Scheduled Date-Time',
|
||||
name: 'scheduledDatetime',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description: 'The scheduled date and time of the message in RFC3339 format (Y-m-dTH:i:sP)',
|
||||
description:
|
||||
'The scheduled date and time of the message in RFC3339 format (Y-m-dTH:i:sP)',
|
||||
},
|
||||
{
|
||||
displayName: 'Type',
|
||||
@@ -281,7 +261,8 @@ export class MessageBird implements INodeType {
|
||||
name: 'typeDetails',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'A hash with extra information. Is only used when a binary message is sent.',
|
||||
description:
|
||||
'A hash with extra information. Is only used when a binary message is sent.',
|
||||
},
|
||||
{
|
||||
displayName: 'Validity',
|
||||
@@ -336,10 +317,7 @@ export class MessageBird implements INodeType {
|
||||
originator,
|
||||
body,
|
||||
};
|
||||
const additionalFields = this.getNodeParameter(
|
||||
'additionalFields',
|
||||
i,
|
||||
) as IDataObject;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
|
||||
if (additionalFields.groupIds) {
|
||||
bodyRequest.groupIds = additionalFields.groupIds as string;
|
||||
@@ -376,21 +354,23 @@ export class MessageBird implements INodeType {
|
||||
}
|
||||
|
||||
const receivers = this.getNodeParameter('recipients', i) as string;
|
||||
bodyRequest.recipients = receivers.split(',').map(item => {
|
||||
|
||||
bodyRequest.recipients = receivers.split(',').map((item) => {
|
||||
return parseInt(item, 10);
|
||||
});
|
||||
} else {
|
||||
throw new NodeOperationError(
|
||||
this.getNode(),
|
||||
`The operation "${operation}" is not known!`,
|
||||
{ itemIndex: i },
|
||||
);
|
||||
}
|
||||
else {
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known!`, { itemIndex: i });
|
||||
}
|
||||
|
||||
} else if (resource === 'balance') {
|
||||
requestMethod = 'GET';
|
||||
requestPath = '/balance';
|
||||
}
|
||||
else {
|
||||
throw new NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, { itemIndex: i });
|
||||
} else {
|
||||
throw new NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, {
|
||||
itemIndex: i,
|
||||
});
|
||||
}
|
||||
|
||||
const responseData = await messageBirdApiRequest.call(
|
||||
|
||||
Reference in New Issue
Block a user