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:
@@ -1,37 +1,19 @@
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
} from 'n8n-core';
|
||||
import { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import {
|
||||
IDataObject,
|
||||
INodeExecutionData,
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
} from 'n8n-workflow';
|
||||
import { IDataObject, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
uptimeRobotApiRequest,
|
||||
} from './GenericFunctions';
|
||||
import { uptimeRobotApiRequest } from './GenericFunctions';
|
||||
|
||||
import {
|
||||
monitorFields,
|
||||
monitorOperations,
|
||||
} from './MonitorDescription';
|
||||
import { monitorFields, monitorOperations } from './MonitorDescription';
|
||||
|
||||
import {
|
||||
alertContactFields,
|
||||
alertContactOperations,
|
||||
} from './AlertContactDescription';
|
||||
import { alertContactFields, alertContactOperations } from './AlertContactDescription';
|
||||
|
||||
import {
|
||||
maintenanceWindowFields,
|
||||
maintenanceWindowOperations,
|
||||
} from './MaintenanceWindowDescription';
|
||||
|
||||
import {
|
||||
publicStatusPageFields,
|
||||
publicStatusPageOperations,
|
||||
} from './PublicStatusPageDescription';
|
||||
import { publicStatusPageFields, publicStatusPageOperations } from './PublicStatusPageDescription';
|
||||
|
||||
import moment from 'moment-timezone';
|
||||
|
||||
@@ -95,9 +77,7 @@ export class UptimeRobot implements INodeType {
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'account',
|
||||
],
|
||||
resource: ['account'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -165,7 +145,6 @@ export class UptimeRobot implements INodeType {
|
||||
}
|
||||
|
||||
if (operation === 'delete') {
|
||||
|
||||
body = {
|
||||
id: this.getNodeParameter('id', i) as string,
|
||||
};
|
||||
@@ -175,7 +154,9 @@ export class UptimeRobot implements INodeType {
|
||||
}
|
||||
if (operation === 'get') {
|
||||
const monitors = this.getNodeParameter('id', i) as string;
|
||||
responseData = await uptimeRobotApiRequest.call(this, 'POST', '/getMonitors', { monitors });
|
||||
responseData = await uptimeRobotApiRequest.call(this, 'POST', '/getMonitors', {
|
||||
monitors,
|
||||
});
|
||||
responseData = responseData.monitors;
|
||||
}
|
||||
|
||||
@@ -217,7 +198,6 @@ export class UptimeRobot implements INodeType {
|
||||
}
|
||||
|
||||
if (operation === 'reset') {
|
||||
|
||||
body = {
|
||||
id: this.getNodeParameter('id', i) as string,
|
||||
};
|
||||
@@ -227,10 +207,9 @@ export class UptimeRobot implements INodeType {
|
||||
}
|
||||
|
||||
if (operation === 'update') {
|
||||
|
||||
body = {
|
||||
id: this.getNodeParameter('id', i) as string,
|
||||
...this.getNodeParameter('updateFields', i) as IDataObject,
|
||||
...(this.getNodeParameter('updateFields', i) as IDataObject),
|
||||
};
|
||||
|
||||
responseData = await uptimeRobotApiRequest.call(this, 'POST', '/editMonitor', body);
|
||||
@@ -240,7 +219,6 @@ export class UptimeRobot implements INodeType {
|
||||
|
||||
if (resource === 'alertContact') {
|
||||
if (operation === 'create') {
|
||||
|
||||
body = {
|
||||
friendly_name: this.getNodeParameter('friendlyName', i) as string,
|
||||
value: this.getNodeParameter('value', i) as string,
|
||||
@@ -251,42 +229,57 @@ export class UptimeRobot implements INodeType {
|
||||
responseData = responseData.alertcontact;
|
||||
}
|
||||
if (operation === 'delete') {
|
||||
|
||||
body = {
|
||||
id: this.getNodeParameter('id', i) as string,
|
||||
};
|
||||
|
||||
responseData = await uptimeRobotApiRequest.call(this, 'POST', '/deleteAlertContact', body);
|
||||
responseData = await uptimeRobotApiRequest.call(
|
||||
this,
|
||||
'POST',
|
||||
'/deleteAlertContact',
|
||||
body,
|
||||
);
|
||||
responseData = responseData.alert_contact;
|
||||
}
|
||||
if (operation === 'get') {
|
||||
const id = this.getNodeParameter('id', i) as string;
|
||||
|
||||
responseData = await uptimeRobotApiRequest.call(this, 'POST', '/getAlertContacts', { alert_contacts: id });
|
||||
responseData = await uptimeRobotApiRequest.call(this, 'POST', '/getAlertContacts', {
|
||||
alert_contacts: id,
|
||||
});
|
||||
responseData = responseData.alert_contacts;
|
||||
}
|
||||
if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
|
||||
|
||||
body = {
|
||||
...this.getNodeParameter('filters', i) as IDataObject,
|
||||
...(this.getNodeParameter('filters', i) as IDataObject),
|
||||
};
|
||||
|
||||
if (!returnAll) {
|
||||
body.limit = this.getNodeParameter('limit', i) as number;
|
||||
}
|
||||
|
||||
responseData = await uptimeRobotApiRequest.call(this, 'POST', '/getAlertContacts', body);
|
||||
responseData = await uptimeRobotApiRequest.call(
|
||||
this,
|
||||
'POST',
|
||||
'/getAlertContacts',
|
||||
body,
|
||||
);
|
||||
responseData = responseData.alert_contacts;
|
||||
}
|
||||
if (operation === 'update') {
|
||||
|
||||
body = {
|
||||
id: this.getNodeParameter('id', i) as string,
|
||||
...this.getNodeParameter('updateFields', i) as IDataObject,
|
||||
...(this.getNodeParameter('updateFields', i) as IDataObject),
|
||||
};
|
||||
|
||||
responseData = await uptimeRobotApiRequest.call(this, 'POST', '/editAlertContact', body);
|
||||
responseData = await uptimeRobotApiRequest.call(
|
||||
this,
|
||||
'POST',
|
||||
'/editAlertContact',
|
||||
body,
|
||||
);
|
||||
responseData = responseData.alert_contact;
|
||||
}
|
||||
}
|
||||
@@ -295,9 +288,10 @@ export class UptimeRobot implements INodeType {
|
||||
const startTime = this.getNodeParameter('start_time', i) as string;
|
||||
const type = this.getNodeParameter('type', i) as number;
|
||||
|
||||
const parsedStartTime = type === 1
|
||||
? moment.tz(startTime, timezone).unix()
|
||||
: moment.tz(startTime, timezone).format('HH:mm');
|
||||
const parsedStartTime =
|
||||
type === 1
|
||||
? moment.tz(startTime, timezone).unix()
|
||||
: moment.tz(startTime, timezone).format('HH:mm');
|
||||
|
||||
body = {
|
||||
duration: this.getNodeParameter('duration', i) as number,
|
||||
@@ -315,30 +309,28 @@ export class UptimeRobot implements INodeType {
|
||||
|
||||
responseData = await uptimeRobotApiRequest.call(this, 'POST', '/newMWindow', body);
|
||||
responseData = responseData.mwindow;
|
||||
|
||||
}
|
||||
if (operation === 'delete') {
|
||||
|
||||
body = {
|
||||
id: this.getNodeParameter('id', i) as string,
|
||||
};
|
||||
|
||||
responseData = await uptimeRobotApiRequest.call(this, 'POST', '/deleteMWindow', body);
|
||||
responseData = { status: responseData.message };
|
||||
|
||||
}
|
||||
if (operation === 'get') {
|
||||
const mwindows = this.getNodeParameter('id', i) as string;
|
||||
|
||||
responseData = await uptimeRobotApiRequest.call(this, 'POST', '/getMWindows', { mwindows });
|
||||
responseData = await uptimeRobotApiRequest.call(this, 'POST', '/getMWindows', {
|
||||
mwindows,
|
||||
});
|
||||
responseData = responseData.mwindows;
|
||||
|
||||
}
|
||||
if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
|
||||
|
||||
body = {
|
||||
...this.getNodeParameter('filters', i) as IDataObject,
|
||||
...(this.getNodeParameter('filters', i) as IDataObject),
|
||||
};
|
||||
|
||||
if (!returnAll) {
|
||||
@@ -347,14 +339,12 @@ export class UptimeRobot implements INodeType {
|
||||
|
||||
responseData = await uptimeRobotApiRequest.call(this, 'POST', '/getMWindows', body);
|
||||
responseData = responseData.mwindows;
|
||||
|
||||
}
|
||||
if (operation === 'update') {
|
||||
|
||||
body = {
|
||||
id: this.getNodeParameter('id', i) as string,
|
||||
duration: this.getNodeParameter('duration', i) as string,
|
||||
...this.getNodeParameter('updateFields', i) as IDataObject,
|
||||
...(this.getNodeParameter('updateFields', i) as IDataObject),
|
||||
};
|
||||
|
||||
if (body.type === 1 && body.start_time) {
|
||||
@@ -373,44 +363,38 @@ export class UptimeRobot implements INodeType {
|
||||
}
|
||||
responseData = await uptimeRobotApiRequest.call(this, 'POST', '/editMWindow', body);
|
||||
responseData = responseData.mwindow;
|
||||
|
||||
}
|
||||
}
|
||||
if (resource === 'publicStatusPage') {
|
||||
if (operation === 'create') {
|
||||
|
||||
body = {
|
||||
friendly_name: this.getNodeParameter('friendlyName', i) as string,
|
||||
monitors: this.getNodeParameter('monitors', i) as string,
|
||||
...this.getNodeParameter('additionalFields', i) as IDataObject,
|
||||
...(this.getNodeParameter('additionalFields', i) as IDataObject),
|
||||
};
|
||||
|
||||
responseData = await uptimeRobotApiRequest.call(this, 'POST', '/newPSP', body);
|
||||
responseData = responseData.psp;
|
||||
|
||||
}
|
||||
if (operation === 'delete') {
|
||||
|
||||
body = {
|
||||
id: this.getNodeParameter('id', i) as string,
|
||||
};
|
||||
|
||||
responseData = await uptimeRobotApiRequest.call(this, 'POST', '/deletePSP', body);
|
||||
responseData = responseData.psp;
|
||||
|
||||
}
|
||||
if (operation === 'get') {
|
||||
const psps = this.getNodeParameter('id', i) as string;
|
||||
|
||||
responseData = await uptimeRobotApiRequest.call(this, 'POST', '/getPSPs', { psps });
|
||||
responseData = responseData.psps;
|
||||
|
||||
}
|
||||
if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
|
||||
|
||||
body = {
|
||||
...this.getNodeParameter('filters', i) as IDataObject,
|
||||
...(this.getNodeParameter('filters', i) as IDataObject),
|
||||
};
|
||||
|
||||
if (!returnAll) {
|
||||
@@ -419,13 +403,11 @@ export class UptimeRobot implements INodeType {
|
||||
|
||||
responseData = await uptimeRobotApiRequest.call(this, 'POST', '/getPSPs', body);
|
||||
responseData = responseData.psps;
|
||||
|
||||
}
|
||||
if (operation === 'update') {
|
||||
|
||||
body = {
|
||||
id: this.getNodeParameter('id', i) as string,
|
||||
...this.getNodeParameter('updateFields', i) as IDataObject,
|
||||
...(this.getNodeParameter('updateFields', i) as IDataObject),
|
||||
};
|
||||
responseData = await uptimeRobotApiRequest.call(this, 'POST', '/editPSP', body);
|
||||
responseData = responseData.psp;
|
||||
|
||||
Reference in New Issue
Block a user