mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
n8n-3867-progressively-apply-prettier-to-all (#3873)
* 🔨 formatting nodes with prettier
This commit is contained in:
@@ -9,9 +9,7 @@ import {
|
||||
NodeOperationError,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
SIGNL4ApiRequest,
|
||||
} from './GenericFunctions';
|
||||
import { SIGNL4ApiRequest } from './GenericFunctions';
|
||||
|
||||
export class Signl4 implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
@@ -55,9 +53,7 @@ export class Signl4 implements INodeType {
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'alert',
|
||||
],
|
||||
resource: ['alert'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -86,12 +82,8 @@ export class Signl4 implements INodeType {
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'send',
|
||||
],
|
||||
resource: [
|
||||
'alert',
|
||||
],
|
||||
operation: ['send'],
|
||||
resource: ['alert'],
|
||||
},
|
||||
},
|
||||
description: 'A more detailed description for the alert',
|
||||
@@ -103,12 +95,8 @@ export class Signl4 implements INodeType {
|
||||
placeholder: 'Add Field',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'send',
|
||||
],
|
||||
resource: [
|
||||
'alert',
|
||||
],
|
||||
operation: ['send'],
|
||||
resource: ['alert'],
|
||||
},
|
||||
},
|
||||
default: {},
|
||||
@@ -126,7 +114,8 @@ export class Signl4 implements INodeType {
|
||||
{
|
||||
name: 'Multi ACK',
|
||||
value: 'multi_ack',
|
||||
description: 'In case this alert must be confirmed by the number of people who are on duty at the time this Singl is raised',
|
||||
description:
|
||||
'In case this alert must be confirmed by the number of people who are on duty at the time this Singl is raised',
|
||||
},
|
||||
],
|
||||
default: 'single_ack',
|
||||
@@ -150,7 +139,8 @@ export class Signl4 implements INodeType {
|
||||
type: 'string',
|
||||
placeholder: 'data',
|
||||
default: '',
|
||||
description: 'Name of the binary properties which contain data which should be added as attachment',
|
||||
description:
|
||||
'Name of the binary properties which contain data which should be added as attachment',
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -162,14 +152,16 @@ export class Signl4 implements INodeType {
|
||||
name: 'externalId',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'If the event originates from a record in a 3rd party system, use this parameter to pass the unique ID of that record. That ID will be communicated in outbound webhook notifications from SIGNL4, which is great for correlation/synchronization of that record with the alert. If you resolve / close an alert you must use the same External ID as in the original alert.',
|
||||
description:
|
||||
'If the event originates from a record in a 3rd party system, use this parameter to pass the unique ID of that record. That ID will be communicated in outbound webhook notifications from SIGNL4, which is great for correlation/synchronization of that record with the alert. If you resolve / close an alert you must use the same External ID as in the original alert.',
|
||||
},
|
||||
{
|
||||
displayName: 'Filtering',
|
||||
name: 'filtering',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Whether to apply event filtering for this event, or not. If set to true, the event will only trigger a notification to the team, if it contains at least one keyword from one of your services and system categories (i.e. it is whitelisted)',
|
||||
description:
|
||||
'Whether to apply event filtering for this event, or not. If set to true, the event will only trigger a notification to the team, if it contains at least one keyword from one of your services and system categories (i.e. it is whitelisted)',
|
||||
},
|
||||
{
|
||||
displayName: 'Location',
|
||||
@@ -177,7 +169,8 @@ export class Signl4 implements INodeType {
|
||||
type: 'fixedCollection',
|
||||
placeholder: 'Add Location',
|
||||
default: {},
|
||||
description: 'Transmit location information (\'latitude, longitude\') with your event and display a map in the mobile app',
|
||||
description:
|
||||
"Transmit location information ('latitude, longitude') with your event and display a map in the mobile app",
|
||||
options: [
|
||||
{
|
||||
name: 'locationFieldsValues',
|
||||
@@ -226,15 +219,12 @@ export class Signl4 implements INodeType {
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'resolve',
|
||||
],
|
||||
resource: [
|
||||
'alert',
|
||||
],
|
||||
operation: ['resolve'],
|
||||
resource: ['alert'],
|
||||
},
|
||||
},
|
||||
description: 'If the event originates from a record in a 3rd party system, use this parameter to pass the unique ID of that record. That ID will be communicated in outbound webhook notifications from SIGNL4, which is great for correlation/synchronization of that record with the alert. If you resolve / close an alert you must use the same External ID as in the original alert.',
|
||||
description:
|
||||
'If the event originates from a record in a 3rd party system, use this parameter to pass the unique ID of that record. That ID will be communicated in outbound webhook notifications from SIGNL4, which is great for correlation/synchronization of that record with the alert. If you resolve / close an alert you must use the same External ID as in the original alert.',
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -268,7 +258,8 @@ export class Signl4 implements INodeType {
|
||||
data.service = additionalFields.service as string;
|
||||
}
|
||||
if (additionalFields.locationFieldsUi) {
|
||||
const locationUi = (additionalFields.locationFieldsUi as IDataObject).locationFieldsValues as IDataObject;
|
||||
const locationUi = (additionalFields.locationFieldsUi as IDataObject)
|
||||
.locationFieldsValues as IDataObject;
|
||||
if (locationUi) {
|
||||
data['X-S4-Location'] = `${locationUi.latitude},${locationUi.longitude}`;
|
||||
}
|
||||
@@ -294,18 +285,20 @@ export class Signl4 implements INodeType {
|
||||
const attachments = additionalFields.attachmentsUi as IDataObject;
|
||||
if (attachments) {
|
||||
if (attachments.attachmentsBinary && items[i].binary) {
|
||||
|
||||
const propertyName = (attachments.attachmentsBinary as IDataObject).property as string;
|
||||
const propertyName = (attachments.attachmentsBinary as IDataObject)
|
||||
.property as string;
|
||||
|
||||
const binaryProperty = (items[i].binary as IBinaryKeyData)[propertyName];
|
||||
|
||||
if (binaryProperty) {
|
||||
|
||||
const supportedFileExtension = ['png', 'jpg', 'jpeg', 'bmp', 'gif', 'mp3', 'wav'];
|
||||
|
||||
if (!supportedFileExtension.includes(binaryProperty.fileExtension as string)) {
|
||||
|
||||
throw new NodeOperationError(this.getNode(), `Invalid extension, just ${supportedFileExtension.join(',')} are supported}`, { itemIndex: i });
|
||||
throw new NodeOperationError(
|
||||
this.getNode(),
|
||||
`Invalid extension, just ${supportedFileExtension.join(',')} are supported}`,
|
||||
{ itemIndex: i },
|
||||
);
|
||||
}
|
||||
|
||||
const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, propertyName);
|
||||
@@ -316,9 +309,12 @@ export class Signl4 implements INodeType {
|
||||
contentType: binaryProperty.mimeType,
|
||||
},
|
||||
};
|
||||
|
||||
} else {
|
||||
throw new NodeOperationError(this.getNode(), `Binary property ${propertyName} does not exist on input`, { itemIndex: i });
|
||||
throw new NodeOperationError(
|
||||
this.getNode(),
|
||||
`Binary property ${propertyName} does not exist on input`,
|
||||
{ itemIndex: i },
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -335,7 +331,6 @@ export class Signl4 implements INodeType {
|
||||
}
|
||||
// Resolve alert
|
||||
if (operation === 'resolve') {
|
||||
|
||||
const data: IDataObject = {};
|
||||
|
||||
data['X-S4-ExternalID'] = this.getNodeParameter('externalId', i) as string;
|
||||
|
||||
Reference in New Issue
Block a user