mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(core): Remove linting exceptions in nodes-base (#4794)
* ⚡ enabled array-type * ⚡ await-thenable on * ⚡ ban-types on * ⚡ default-param-last on * ⚡ dot-notation on * ⚡ member-delimiter-style on * ⚡ no-duplicate-imports on * ⚡ no-empty-interface on * ⚡ no-floating-promises on * ⚡ no-for-in-array on * ⚡ no-invalid-void-type on * ⚡ no-loop-func on * ⚡ no-shadow on * ⚡ ban-ts-comment re enabled * ⚡ @typescript-eslint/lines-between-class-members on * address my own comment * @typescript-eslint/return-await on * @typescript-eslint/promise-function-async on * @typescript-eslint/no-unnecessary-boolean-literal-compare on * @typescript-eslint/no-unnecessary-type-assertion on * prefer-const on * @typescript-eslint/prefer-optional-chain on Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -159,7 +159,7 @@ export class SecurityScorecard implements INodeType {
|
||||
responseData = await scorecardApiRequest.call(this, 'GET', 'portfolios');
|
||||
responseData = responseData.entries;
|
||||
|
||||
if (returnAll === false) {
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', 0);
|
||||
responseData = responseData.splice(0, limit);
|
||||
}
|
||||
@@ -205,7 +205,7 @@ export class SecurityScorecard implements INodeType {
|
||||
|
||||
responseData = responseData.entries;
|
||||
|
||||
if (returnAll === false) {
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', 0);
|
||||
responseData = responseData.splice(0, limit);
|
||||
}
|
||||
@@ -259,18 +259,18 @@ export class SecurityScorecard implements INodeType {
|
||||
let body: IDataObject = {};
|
||||
|
||||
if (reportType !== 'portfolio') {
|
||||
body['scorecard_identifier'] = this.getNodeParameter('scorecardIdentifier', i);
|
||||
body.scorecard_identifier = this.getNodeParameter('scorecardIdentifier', i);
|
||||
} else {
|
||||
body['portfolio_id'] = this.getNodeParameter('portfolioId', i);
|
||||
body.portfolio_id = this.getNodeParameter('portfolioId', i);
|
||||
}
|
||||
if (reportType === 'events-json') {
|
||||
body['date'] = this.getNodeParameter('date', i);
|
||||
body.date = this.getNodeParameter('date', i);
|
||||
}
|
||||
if (['issues', 'portfolio'].indexOf(reportType) > -1) {
|
||||
body['format'] = this.getNodeParameter('options.format', i) || 'pdf';
|
||||
body.format = this.getNodeParameter('options.format', i) || 'pdf';
|
||||
}
|
||||
if (['detailed', 'summary'].indexOf(reportType) > -1) {
|
||||
body['branding'] = this.getNodeParameter('branding', i);
|
||||
body.branding = this.getNodeParameter('branding', i);
|
||||
}
|
||||
// json reports want the params differently
|
||||
if (['events-json', 'full-scorecard-json'].indexOf(reportType) > -1) {
|
||||
@@ -296,7 +296,7 @@ export class SecurityScorecard implements INodeType {
|
||||
responseData = await scorecardApiRequest.call(this, 'GET', 'reports/recent');
|
||||
responseData = responseData.entries;
|
||||
|
||||
if (returnAll === false) {
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
responseData = responseData.splice(0, limit);
|
||||
}
|
||||
@@ -342,12 +342,12 @@ export class SecurityScorecard implements INodeType {
|
||||
);
|
||||
responseData = responseData.entries;
|
||||
|
||||
if (returnAll === false) {
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
responseData = responseData.splice(0, limit);
|
||||
}
|
||||
|
||||
if (simple === true) {
|
||||
if (simple) {
|
||||
responseData = simplify(responseData);
|
||||
}
|
||||
|
||||
@@ -360,12 +360,12 @@ export class SecurityScorecard implements INodeType {
|
||||
const industry = this.getNodeParameter('industry', i);
|
||||
const options = this.getNodeParameter('options', i);
|
||||
// Convert to YYYY-MM-DD
|
||||
if (options['from']) {
|
||||
options['from'] = moment(options['from'] as Date).format('YYYY-MM-DD');
|
||||
if (options.from) {
|
||||
options.from = moment(options.from as Date).format('YYYY-MM-DD');
|
||||
}
|
||||
|
||||
if (options['to']) {
|
||||
options['to'] = moment(options['to'] as Date).format('YYYY-MM-DD');
|
||||
if (options.to) {
|
||||
options.to = moment(options.to as Date).format('YYYY-MM-DD');
|
||||
}
|
||||
responseData = await scorecardApiRequest.call(
|
||||
this,
|
||||
@@ -376,12 +376,12 @@ export class SecurityScorecard implements INodeType {
|
||||
);
|
||||
responseData = responseData.entries;
|
||||
|
||||
if (returnAll === false) {
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
responseData = responseData.splice(0, limit);
|
||||
}
|
||||
|
||||
if (simple === true) {
|
||||
if (simple) {
|
||||
responseData = simplify(responseData);
|
||||
}
|
||||
|
||||
@@ -414,7 +414,7 @@ export class SecurityScorecard implements INodeType {
|
||||
|
||||
responseData = responseData.entries;
|
||||
|
||||
if (returnAll === false) {
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
responseData = responseData.splice(0, limit);
|
||||
}
|
||||
@@ -428,12 +428,12 @@ export class SecurityScorecard implements INodeType {
|
||||
const scorecardIdentifier = this.getNodeParameter('scorecardIdentifier', i) as string;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
// Convert to YYYY-MM-DD
|
||||
if (options['date_from']) {
|
||||
options['date_from'] = moment(options['date_from'] as Date).format('YYYY-MM-DD');
|
||||
if (options.date_from) {
|
||||
options.date_from = moment(options.date_from as Date).format('YYYY-MM-DD');
|
||||
}
|
||||
|
||||
if (options['date_to']) {
|
||||
options['date_to'] = moment(options['date_to'] as Date).format('YYYY-MM-DD');
|
||||
if (options.date_to) {
|
||||
options.date_to = moment(options.date_to as Date).format('YYYY-MM-DD');
|
||||
}
|
||||
responseData = await scorecardApiRequest.call(
|
||||
this,
|
||||
@@ -445,12 +445,12 @@ export class SecurityScorecard implements INodeType {
|
||||
|
||||
responseData = responseData.entries;
|
||||
|
||||
if (returnAll === false) {
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
responseData = responseData.splice(0, limit);
|
||||
}
|
||||
|
||||
if (simple === true) {
|
||||
if (simple) {
|
||||
responseData = simplify(responseData);
|
||||
}
|
||||
|
||||
@@ -464,13 +464,13 @@ export class SecurityScorecard implements INodeType {
|
||||
const options = this.getNodeParameter('options', i);
|
||||
|
||||
// for some reason the params are different between these two APis :/
|
||||
if (options['date_from']) {
|
||||
options['from'] = moment(options['date_from'] as Date).format('YYYY-MM-DD');
|
||||
delete options['date_from'];
|
||||
if (options.date_from) {
|
||||
options.from = moment(options.date_from as Date).format('YYYY-MM-DD');
|
||||
delete options.date_from;
|
||||
}
|
||||
if (options['date_to']) {
|
||||
options['to'] = moment(options['date_to'] as Date).format('YYYY-MM-DD');
|
||||
delete options['date_to'];
|
||||
if (options.date_to) {
|
||||
options.to = moment(options.date_to as Date).format('YYYY-MM-DD');
|
||||
delete options.date_to;
|
||||
}
|
||||
responseData = await scorecardApiRequest.call(
|
||||
this,
|
||||
@@ -481,12 +481,12 @@ export class SecurityScorecard implements INodeType {
|
||||
);
|
||||
responseData = responseData.entries;
|
||||
|
||||
if (returnAll === false) {
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
responseData = responseData.splice(0, limit);
|
||||
}
|
||||
|
||||
if (simple === true) {
|
||||
if (simple) {
|
||||
responseData = simplify(responseData);
|
||||
}
|
||||
|
||||
@@ -505,7 +505,7 @@ export class SecurityScorecard implements INodeType {
|
||||
|
||||
responseData = responseData.entries;
|
||||
|
||||
if (returnAll === false) {
|
||||
if (!returnAll) {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
responseData = responseData.splice(0, limit);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user