mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
refactor: Clear unused ESLint directives from BE packages (no-changelog) (#6798)
This commit is contained in:
parent
11567f946b
commit
72523462ea
|
@ -7,8 +7,8 @@
|
|||
"typecheck": "tsc",
|
||||
"build": "tsc -p tsconfig.build.json",
|
||||
"format": "prettier --write . --ignore-path ../../../.prettierignore",
|
||||
"lint": "eslint --quiet .",
|
||||
"lintfix": "eslint . --fix",
|
||||
"lint": "eslint . --quiet --report-unused-disable-directives",
|
||||
"lintfix": "eslint . --fix --report-unused-disable-directives",
|
||||
"watch": "tsc -p tsconfig.build.json --watch",
|
||||
"test": "jest",
|
||||
"test:dev": "jest --watch"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/restrict-plus-operands */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import * as qs from 'querystring';
|
||||
import { Agent } from 'https';
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import type { ClientOAuth2, ClientOAuth2Options, ClientOAuth2RequestObject } from './ClientOAuth2';
|
||||
import { auth, expects, getRequestOptions } from './utils';
|
||||
|
|
|
@ -69,7 +69,6 @@ export class CodeFlow {
|
|||
}
|
||||
|
||||
if (!url.search?.substring(1)) {
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
throw new TypeError(`Unable to process uri: ${urlString}`);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/restrict-plus-operands */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import type { ClientOAuth2Options, ClientOAuth2RequestObject } from './ClientOAuth2';
|
||||
import { ERROR_RESPONSES } from './constants';
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
"dev": "concurrently -k -n \"TypeScript,Node\" -c \"yellow.bold,cyan.bold\" \"npm run watch\" \"nodemon\"",
|
||||
"dev:worker": "concurrently -k -n \"TypeScript,Node\" -c \"yellow.bold,cyan.bold\" \"npm run watch\" \"nodemon worker\"",
|
||||
"format": "prettier --write . --ignore-path ../../.prettierignore",
|
||||
"lint": "eslint --quiet .",
|
||||
"lintfix": "eslint . --fix",
|
||||
"lint": "eslint . --quiet --report-unused-disable-directives",
|
||||
"lintfix": "eslint . --fix --report-unused-disable-directives",
|
||||
"postpack": "rm -f oclif.manifest.json",
|
||||
"prepack": "oclif-dev manifest",
|
||||
"start": "run-script-os",
|
||||
|
|
|
@ -95,7 +95,6 @@ export abstract class AbstractServer {
|
|||
|
||||
// Make sure that each request has the "parsedUrl" parameter
|
||||
app.use((req, res, next) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
req.parsedUrl = parseUrl(req)!;
|
||||
req.rawBody = emptyBuffer;
|
||||
next();
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
|
||||
import { Container, Service } from 'typedi';
|
||||
import type {
|
||||
IDeferredPromise,
|
||||
|
@ -94,7 +92,7 @@ export class ActiveExecutions {
|
|||
* Attaches an execution
|
||||
*
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
|
||||
attachWorkflowExecution(executionId: string, workflowExecution: PCancelable<IRun>) {
|
||||
if (this.activeExecutions[executionId] === undefined) {
|
||||
throw new Error(
|
||||
|
@ -123,7 +121,6 @@ export class ActiveExecutions {
|
|||
return;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
this.activeExecutions[executionId].responsePromise?.resolve(response);
|
||||
}
|
||||
|
||||
|
@ -137,7 +134,7 @@ export class ActiveExecutions {
|
|||
}
|
||||
|
||||
// Resolve all the waiting promises
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
|
||||
for (const promise of this.activeExecutions[executionId].postExecutePromises) {
|
||||
promise.resolve(fullRunData);
|
||||
}
|
||||
|
@ -176,7 +173,6 @@ export class ActiveExecutions {
|
|||
this.activeExecutions[executionId].workflowExecution!.cancel();
|
||||
}
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
return this.getPostExecutePromise(executionId);
|
||||
}
|
||||
|
||||
|
@ -196,7 +192,6 @@ export class ActiveExecutions {
|
|||
|
||||
this.activeExecutions[executionId].postExecutePromises.push(waitPromise);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access
|
||||
return waitPromise.promise();
|
||||
}
|
||||
|
||||
|
@ -208,7 +203,7 @@ export class ActiveExecutions {
|
|||
const returnData: IExecutionsCurrentSummary[] = [];
|
||||
|
||||
let data;
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
|
||||
for (const id of Object.keys(this.activeExecutions)) {
|
||||
data = this.activeExecutions[id];
|
||||
returnData.push({
|
||||
|
|
|
@ -35,7 +35,6 @@ export class ActiveWebhooks {
|
|||
throw new Error('Webhooks can only be added for saved workflows as an id is needed!');
|
||||
}
|
||||
if (webhookData.path.endsWith('/')) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
webhookData.path = webhookData.path.slice(0, -1);
|
||||
}
|
||||
|
||||
|
@ -139,7 +138,7 @@ export class ActiveWebhooks {
|
|||
|
||||
Object.keys(this.webhookUrls)
|
||||
.filter((key) => key.includes(path))
|
||||
// eslint-disable-next-line array-callback-return
|
||||
|
||||
.map((key) => {
|
||||
methods.push(key.split('|')[0]);
|
||||
});
|
||||
|
@ -164,7 +163,7 @@ export class ActiveWebhooks {
|
|||
if (webhookId) {
|
||||
if (path.startsWith(webhookId)) {
|
||||
const cutFromIndex = path.indexOf('/') + 1;
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
|
||||
path = path.slice(cutFromIndex);
|
||||
}
|
||||
return `${httpMethod}|${webhookId}|${path.split('/').length}`;
|
||||
|
@ -177,7 +176,6 @@ export class ActiveWebhooks {
|
|||
*
|
||||
*/
|
||||
async removeWorkflow(workflow: Workflow): Promise<boolean> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
const workflowId = workflow.id!.toString();
|
||||
|
||||
if (this.workflowWebhooks[workflowId] === undefined) {
|
||||
|
@ -190,9 +188,8 @@ export class ActiveWebhooks {
|
|||
const mode = 'internal';
|
||||
|
||||
// Go through all the registered webhooks of the workflow and remove them
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
|
||||
for (const webhookData of webhooks) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await workflow.runWebhookMethod(
|
||||
'delete',
|
||||
webhookData,
|
||||
|
@ -218,7 +215,7 @@ export class ActiveWebhooks {
|
|||
*/
|
||||
async removeAll(workflows: Workflow[]): Promise<void> {
|
||||
const removePromises = [];
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
|
||||
for (const workflow of workflows) {
|
||||
removePromises.push(this.removeWorkflow(workflow));
|
||||
}
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
/* eslint-disable prefer-spread */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable no-param-reassign */
|
||||
/* eslint-disable no-await-in-loop */
|
||||
/* eslint-disable no-restricted-syntax */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-shadow */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
|
@ -94,7 +91,6 @@ export class ActiveWorkflowRunner {
|
|||
private webhookRepository: WebhookRepository,
|
||||
) {}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
async init() {
|
||||
// Get the active workflows from database
|
||||
|
||||
|
@ -141,7 +137,7 @@ export class ActiveWorkflowRunner {
|
|||
Logger.info(
|
||||
' => ERROR: Workflow could not be activated on first try, keep on trying if not an auth issue',
|
||||
);
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
|
||||
Logger.info(` ${error.message}`);
|
||||
Logger.error(
|
||||
`Issue on initial workflow activation try "${workflowData.name}" (startup)`,
|
||||
|
@ -257,7 +253,7 @@ export class ActiveWorkflowRunner {
|
|||
}
|
||||
|
||||
// @ts-ignore
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
|
||||
path = webhook.webhookPath;
|
||||
// extracting params from path
|
||||
// @ts-ignore
|
||||
|
@ -323,7 +319,7 @@ export class ActiveWorkflowRunner {
|
|||
undefined,
|
||||
req,
|
||||
res,
|
||||
// eslint-disable-next-line consistent-return
|
||||
|
||||
(error: Error | null, data: object) => {
|
||||
if (error !== null) {
|
||||
return reject(error);
|
||||
|
@ -445,7 +441,6 @@ export class ActiveWorkflowRunner {
|
|||
}
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
// TODO: this should happen in a transaction, that way we don't need to manually remove this in `catch`
|
||||
await this.webhookRepository.insert(webhook);
|
||||
const webhookExists = await workflow.runWebhookMethod(
|
||||
|
@ -478,7 +473,7 @@ export class ActiveWorkflowRunner {
|
|||
// This means that further initializations will always fail
|
||||
// when inserting to database. This is why we ignore this error
|
||||
// as it's expected to happen.
|
||||
// eslint-disable-next-line no-continue
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -487,7 +482,6 @@ export class ActiveWorkflowRunner {
|
|||
} catch (error) {
|
||||
ErrorReporter.error(error);
|
||||
Logger.error(
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
`Could not remove webhooks of workflow "${workflow.id}" because of error: "${error.message}"`,
|
||||
);
|
||||
}
|
||||
|
@ -566,7 +560,7 @@ export class ActiveWorkflowRunner {
|
|||
* Runs the given workflow
|
||||
*
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
|
||||
async runWorkflow(
|
||||
workflowData: IWorkflowDb,
|
||||
node: INode,
|
||||
|
@ -634,7 +628,6 @@ export class ActiveWorkflowRunner {
|
|||
responsePromise?: IDeferredPromise<IExecuteResponsePromiseData>,
|
||||
donePromise?: IDeferredPromise<IRun | undefined>,
|
||||
): void => {
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
Logger.debug(`Received event to trigger execution for workflow "${workflow.name}"`);
|
||||
void WorkflowHelpers.saveStaticData(workflow);
|
||||
const executePromise = this.runWorkflow(
|
||||
|
@ -691,10 +684,9 @@ export class ActiveWorkflowRunner {
|
|||
responsePromise?: IDeferredPromise<IExecuteResponsePromiseData>,
|
||||
donePromise?: IDeferredPromise<IRun | undefined>,
|
||||
): void => {
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
Logger.debug(`Received trigger for workflow "${workflow.name}"`);
|
||||
void WorkflowHelpers.saveStaticData(workflow);
|
||||
// eslint-disable-next-line id-denylist
|
||||
|
||||
const executePromise = this.runWorkflow(
|
||||
workflowData,
|
||||
node,
|
||||
|
@ -983,7 +975,6 @@ export class ActiveWorkflowRunner {
|
|||
} catch (error) {
|
||||
ErrorReporter.error(error);
|
||||
Logger.error(
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
`Could not remove webhooks of workflow "${workflowId}" because of error: "${error.message}"`,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable no-restricted-syntax */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { promisify } from 'util';
|
||||
import { exec } from 'child_process';
|
||||
import { access as fsAccess, mkdir as fsMkdir } from 'fs/promises';
|
||||
|
@ -152,8 +150,6 @@ export function matchMissingPackages(
|
|||
try {
|
||||
const parsedPackageData = parseNpmPackageName(missingPackageName);
|
||||
return parsedPackageData.packageName;
|
||||
|
||||
// eslint-disable-next-line no-empty
|
||||
} catch {}
|
||||
return undefined;
|
||||
});
|
||||
|
|
|
@ -63,7 +63,7 @@ export async function persistInstalledPackageData(
|
|||
|
||||
return promises;
|
||||
});
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
|
||||
return installedPackage!;
|
||||
} catch (error) {
|
||||
LoggerProxy.error('Failed to save installed packages and nodes', {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable no-restricted-syntax */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
|
@ -110,7 +109,7 @@ export class CredentialsHelper extends ICredentialsHelper {
|
|||
if (credentialType.authenticate) {
|
||||
if (typeof credentialType.authenticate === 'function') {
|
||||
// Special authentication function is defined
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
|
||||
return credentialType.authenticate(credentials, requestOptions as IHttpRequestOptions);
|
||||
}
|
||||
|
||||
|
@ -411,7 +410,6 @@ export class CredentialsHelper extends ICredentialsHelper {
|
|||
decryptedData,
|
||||
) as ICredentialDataDecryptedObject;
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
e.message += ' [Error resolving credentials]';
|
||||
throw e;
|
||||
}
|
||||
|
@ -552,7 +550,7 @@ export class CredentialsHelper extends ICredentialsHelper {
|
|||
if (typeof credentialTestFunction === 'function') {
|
||||
// The credentials get tested via a function that is defined on the node
|
||||
const credentialTestFunctions = NodeExecuteFunctions.getCredentialTestFunctions();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
||||
|
||||
return credentialTestFunction.call(credentialTestFunctions, credentialsDecrypted);
|
||||
}
|
||||
|
||||
|
@ -687,9 +685,7 @@ export class CredentialsHelper extends ICredentialsHelper {
|
|||
return {
|
||||
status: 'Error',
|
||||
message:
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
errorResponseData.statusMessage ||
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
`Received HTTP status code: ${errorResponseData.statusCode}`,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
import curlconverter from 'curlconverter';
|
||||
import get from 'lodash/get';
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
/* eslint-disable import/no-mutable-exports */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
/* eslint-disable no-case-declarations */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
import { Container } from 'typedi';
|
||||
import type { DataSourceOptions as ConnectionOptions, EntityManager, LoggerOptions } from 'typeorm';
|
||||
import { DataSource as Connection } from 'typeorm';
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
/* eslint-disable import/no-dynamic-require */
|
||||
/* eslint-disable no-restricted-syntax */
|
||||
|
||||
import { Service } from 'typedi';
|
||||
import * as Db from '@/Db';
|
||||
import type {
|
||||
|
@ -51,13 +50,11 @@ export class ExternalHooks implements IExternalHooksClass {
|
|||
delete require.cache[require.resolve(hookFilePath)];
|
||||
}
|
||||
|
||||
// eslint-disable-next-line import/no-dynamic-require
|
||||
// eslint-disable-next-line global-require
|
||||
const hookFile = require(hookFilePath) as IExternalHooksFileData;
|
||||
this.loadHooks(hookFile);
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/restrict-template-expressions
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
`Problem loading external hook file "${hookFilePath}": ${error.message}`,
|
||||
{ cause: error as Error },
|
||||
);
|
||||
|
@ -96,7 +93,6 @@ export class ExternalHooks implements IExternalHooksClass {
|
|||
}
|
||||
|
||||
for (const externalHookFunction of this.externalHooks[hookName]) {
|
||||
// eslint-disable-next-line no-await-in-loop, @typescript-eslint/await-thenable
|
||||
await externalHookFunction.apply(externalHookFunctions, hookParameters);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
/* eslint-disable no-param-reassign */
|
||||
/* eslint-disable no-underscore-dangle */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
import type express from 'express';
|
||||
import type {
|
||||
ExecutionError,
|
||||
|
@ -56,7 +50,7 @@ export function getSessionId(req: express.Request): string | undefined {
|
|||
* - If the name already exists more than once with suffixes, it looks for the max suffix
|
||||
* and returns the requested name with max suffix + 1.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
|
||||
export async function generateUniqueName(
|
||||
requestedName: string,
|
||||
entityType: 'workflow' | 'credentials',
|
||||
|
@ -85,7 +79,6 @@ export async function generateUniqueName(
|
|||
|
||||
const suffix = Number(parts[1]);
|
||||
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
if (!isNaN(suffix) && Math.ceil(suffix) > acc) {
|
||||
acc = Math.ceil(suffix);
|
||||
}
|
||||
|
@ -129,7 +122,7 @@ export async function validateEntity(
|
|||
* @returns
|
||||
* @memberof ActiveWorkflowRunner
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
|
||||
export async function createErrorExecution(
|
||||
error: ExecutionError,
|
||||
node: INode,
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
import { Service } from 'typedi';
|
||||
import { snakeCase } from 'change-case';
|
||||
import { BinaryDataManager } from 'n8n-core';
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable no-underscore-dangle */
|
||||
import type { Entry as LdapUser, ClientOptions } from 'ldapts';
|
||||
import { Client } from 'ldapts';
|
||||
import type { LdapConfig } from './types';
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
/* eslint-disable @typescript-eslint/no-shadow */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
|
||||
import { inspect } from 'util';
|
||||
import winston from 'winston';
|
||||
|
@ -24,7 +21,6 @@ export class Logger implements ILogger {
|
|||
.map((output) => output.trim());
|
||||
|
||||
this.logger = winston.createLogger({
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
level,
|
||||
silent: level === 'silent',
|
||||
});
|
||||
|
@ -36,9 +32,8 @@ export class Logger implements ILogger {
|
|||
winston.format.metadata(),
|
||||
winston.format.timestamp(),
|
||||
winston.format.colorize({ all: true }),
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
|
||||
winston.format.printf(({ level, message, timestamp, metadata }) => {
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
return `${timestamp} | ${level.padEnd(18)} | ${message}${
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||
Object.keys(metadata).length ? ` ${JSON.stringify(inspect(metadata))}` : ''
|
||||
|
@ -118,7 +113,6 @@ export class Logger implements ILogger {
|
|||
|
||||
let activeLoggerInstance: Logger | undefined;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
export function getLogger() {
|
||||
if (activeLoggerInstance === undefined) {
|
||||
activeLoggerInstance = new Logger();
|
||||
|
|
|
@ -46,7 +46,6 @@ export async function createCredential(
|
|||
} else {
|
||||
// Add the added date for node access permissions
|
||||
newCredential.nodesAccess.forEach((nodeAccess) => {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
nodeAccess.date = new Date();
|
||||
});
|
||||
}
|
||||
|
@ -115,7 +114,6 @@ export function sanitizeCredentials(
|
|||
const credentialsList = argIsArray ? credentials : [credentials];
|
||||
|
||||
const sanitizedCredentials = credentialsList.map((credential) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { data, nodesAccess, shared, ...rest } = credential;
|
||||
return rest;
|
||||
});
|
||||
|
@ -191,7 +189,6 @@ export function toJsonSchema(properties: INodeProperties[]): IDataObject {
|
|||
let dependantValue: string | number | boolean = '';
|
||||
|
||||
if (displayOptionsValues && Array.isArray(displayOptionsValues) && displayOptionsValues[0]) {
|
||||
// eslint-disable-next-line prefer-destructuring
|
||||
dependantValue = displayOptionsValues[0];
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,6 @@ export class Queue {
|
|||
|
||||
this.jobQueue.on('global:progress', (jobId, progress: WebhookResponse) => {
|
||||
this.activeExecutions.resolveResponsePromise(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
progress.executionId,
|
||||
WebhookHelpers.decodeWebhookResponse(progress.response),
|
||||
);
|
||||
|
|
|
@ -10,7 +10,6 @@ export const reloadNodesAndCredentials = async (
|
|||
nodeTypes: NodeTypes,
|
||||
push: Push,
|
||||
) => {
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
const { default: debounce } = await import('lodash/debounce');
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
const { watch } = await import('chokidar');
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
/* eslint-disable no-console */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable no-param-reassign */
|
||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
|
||||
import type { Request, Response } from 'express';
|
||||
import { parse, stringify } from 'flatted';
|
||||
import picocolors from 'picocolors';
|
||||
|
@ -216,7 +215,7 @@ export function flattenExecutionData(fullExecutionData: IExecutionDb): IExecutio
|
|||
stoppedAt: fullExecutionData.stoppedAt,
|
||||
finished: fullExecutionData.finished ? fullExecutionData.finished : false,
|
||||
workflowId: fullExecutionData.workflowId,
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
|
||||
workflowData: fullExecutionData.workflowData!,
|
||||
status: fullExecutionData.status,
|
||||
};
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
||||
/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */
|
||||
/* eslint-disable prefer-const */
|
||||
/* eslint-disable @typescript-eslint/no-invalid-void-type */
|
||||
|
||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-shadow */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
|
@ -933,7 +933,6 @@ export class Server extends AbstractServer {
|
|||
|
||||
await this.externalHooks.run('oauth1.authenticate', [oAuthOptions, oauthRequestData]);
|
||||
|
||||
// eslint-disable-next-line new-cap
|
||||
const oauth = new clientOAuth1(oAuthOptions);
|
||||
|
||||
const options: RequestOptions = {
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
/* eslint-disable consistent-return */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable no-param-reassign */
|
||||
import type express from 'express';
|
||||
import { Service } from 'typedi';
|
||||
|
||||
|
@ -69,7 +66,7 @@ export class TestWebhooks {
|
|||
if (webhookData === undefined) {
|
||||
const pathElements = path.split('/');
|
||||
const webhookId = pathElements.shift();
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
|
||||
webhookData = activeWebhooks.get(httpMethod, pathElements.join('/'), webhookId);
|
||||
if (webhookData === undefined) {
|
||||
// The requested webhook is not registered
|
||||
|
@ -117,7 +114,6 @@ export class TestWebhooks {
|
|||
throw new ResponseHelper.NotFoundError('Could not find node to process webhook.');
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-async-promise-executor
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
const executionMode = 'manual';
|
||||
|
@ -211,7 +207,7 @@ export class TestWebhooks {
|
|||
|
||||
let key: string;
|
||||
const activatedKey: string[] = [];
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
|
||||
for (const webhookData of webhooks) {
|
||||
key = `${activeWebhooks.getWebhookKey(
|
||||
webhookData.httpMethod,
|
||||
|
@ -230,11 +226,10 @@ export class TestWebhooks {
|
|||
};
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await activeWebhooks.add(workflow, webhookData, mode, activation);
|
||||
} catch (error) {
|
||||
activatedKey.forEach((deleteKey) => delete testWebhookData[deleteKey]);
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
|
||||
await activeWebhooks.removeWorkflow(workflow);
|
||||
throw error;
|
||||
}
|
||||
|
@ -250,12 +245,11 @@ export class TestWebhooks {
|
|||
cancelTestWebhook(workflowId: string): boolean {
|
||||
let foundWebhook = false;
|
||||
const { activeWebhooks, push, testWebhookData } = this;
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
|
||||
for (const webhookKey of Object.keys(testWebhookData)) {
|
||||
const { sessionId, timeout, workflow, workflowData } = testWebhookData[webhookKey];
|
||||
|
||||
if (workflowData.id !== workflowId) {
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import { In } from 'typeorm';
|
||||
import { compare, genSaltSync, hash } from 'bcryptjs';
|
||||
import { Container } from 'typedi';
|
||||
|
@ -196,7 +194,6 @@ export function rightDiff<T1, T2>(
|
|||
): T2[] {
|
||||
// create map { itemKey => true } for fast lookup for diff
|
||||
const keyMap = arr1.reduce<{ [key: string]: true }>((map, item) => {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
map[keyExtractor1(item)] = true;
|
||||
return map;
|
||||
}, {});
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
import {
|
||||
ErrorReporterProxy as ErrorReporter,
|
||||
LoggerProxy as Logger,
|
||||
|
@ -46,7 +41,6 @@ export class WaitTracker {
|
|||
void this.getWaitingExecutions();
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
async getWaitingExecutions() {
|
||||
Logger.debug('Wait tracker querying database for waiting executions');
|
||||
// Find all the executions which should be triggered in the next 70 seconds
|
||||
|
@ -82,7 +76,7 @@ export class WaitTracker {
|
|||
);
|
||||
|
||||
// Add timers for each waiting execution that they get started at the correct time
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
|
||||
for (const execution of executions) {
|
||||
const executionId = execution.id;
|
||||
if (this.waitingExecutions[executionId] === undefined) {
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
/* eslint-disable no-param-reassign */
|
||||
import type { INode, WebhookHttpMethod } from 'n8n-workflow';
|
||||
import { NodeHelpers, Workflow, LoggerProxy as Logger } from 'n8n-workflow';
|
||||
import { Service } from 'typedi';
|
||||
|
@ -145,7 +142,7 @@ export class WaitingWebhooks {
|
|||
fullExecutionData.id,
|
||||
req,
|
||||
res,
|
||||
// eslint-disable-next-line consistent-return
|
||||
|
||||
(error: Error | null, data: object) => {
|
||||
if (error !== null) {
|
||||
return reject(error);
|
||||
|
|
|
@ -1,18 +1,16 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable no-param-reassign */
|
||||
|
||||
/* eslint-disable @typescript-eslint/prefer-optional-chain */
|
||||
/* eslint-disable @typescript-eslint/no-shadow */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable id-denylist */
|
||||
/* eslint-disable prefer-spread */
|
||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
|
||||
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable no-restricted-syntax */
|
||||
|
||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable prefer-destructuring */
|
||||
|
||||
import type express from 'express';
|
||||
import get from 'lodash/get';
|
||||
import stream from 'stream';
|
||||
|
@ -92,7 +90,7 @@ export function getWorkflowWebhooks(
|
|||
if (parentNodes !== undefined && !parentNodes.includes(node.name)) {
|
||||
// If parentNodes are given check only them if they have webhooks
|
||||
// and no other ones
|
||||
// eslint-disable-next-line no-continue
|
||||
|
||||
continue;
|
||||
}
|
||||
returnData.push.apply(
|
||||
|
@ -325,7 +323,7 @@ export async function executeWebhook(
|
|||
}
|
||||
} else {
|
||||
// Send default response
|
||||
// eslint-disable-next-line no-lonely-if
|
||||
|
||||
if (!didSendResponse) {
|
||||
responseCallback(null, {
|
||||
data: {
|
||||
|
@ -685,7 +683,6 @@ export async function executeWebhook(
|
|||
throw new ResponseHelper.InternalServerError(e.message);
|
||||
});
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
return executionId;
|
||||
} catch (e) {
|
||||
if (!didSendResponse) {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable no-prototype-builtins */
|
||||
import type { INode, IWorkflowCredentials } from 'n8n-workflow';
|
||||
import * as Db from '@/Db';
|
||||
|
||||
|
@ -11,14 +10,12 @@ export async function WorkflowCredentials(nodes: INode[]): Promise<IWorkflowCred
|
|||
let type;
|
||||
let nodeCredentials;
|
||||
let foundCredentials;
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
|
||||
for (node of nodes) {
|
||||
if (node.disabled === true || !node.credentials) {
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (type of Object.keys(node.credentials)) {
|
||||
if (!returnCredentials[type]) {
|
||||
returnCredentials[type] = {};
|
||||
|
@ -32,7 +29,6 @@ export async function WorkflowCredentials(nodes: INode[]): Promise<IWorkflowCred
|
|||
}
|
||||
|
||||
if (!returnCredentials[type][nodeCredentials.id]) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
foundCredentials = await Db.collections.Credentials.findOneBy({
|
||||
id: nodeCredentials.id,
|
||||
type,
|
||||
|
@ -42,7 +38,7 @@ export async function WorkflowCredentials(nodes: INode[]): Promise<IWorkflowCred
|
|||
`Could not find credentials for type "${type}" with ID "${nodeCredentials.id}".`,
|
||||
);
|
||||
}
|
||||
// eslint-disable-next-line prefer-destructuring
|
||||
|
||||
returnCredentials[type][nodeCredentials.id] = foundCredentials;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,13 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
/* eslint-disable no-restricted-syntax */
|
||||
/* eslint-disable @typescript-eslint/restrict-plus-operands */
|
||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
/* eslint-disable @typescript-eslint/await-thenable */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-use-before-define */
|
||||
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
|
||||
/* eslint-disable no-param-reassign */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/prefer-optional-chain */
|
||||
|
||||
/* eslint-disable id-denylist */
|
||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
/* eslint-disable func-names */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
import { BinaryDataManager, UserSettings, WorkflowExecute } from 'n8n-core';
|
||||
|
||||
|
@ -200,7 +194,7 @@ async function pruneExecutionData(this: WorkflowHooks): Promise<void> {
|
|||
date.setHours(date.getHours() - maxAge);
|
||||
|
||||
// date reformatting needed - see https://github.com/typeorm/typeorm/issues/2286
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
|
||||
const utcDate = DateUtils.mixedDateToUtcDatetimeString(date);
|
||||
|
||||
const toPrune: Array<FindOptionsWhere<IExecutionFlattedDb>> = [
|
||||
|
|
|
@ -96,7 +96,6 @@ export async function executeErrorWorkflow(
|
|||
if (workflowData === null) {
|
||||
// The error workflow could not be found
|
||||
Logger.error(
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
`Calling Error Workflow for "${workflowErrorData.workflow.id}". Could not find error workflow "${workflowId}"`,
|
||||
{ workflowId },
|
||||
);
|
||||
|
@ -142,7 +141,6 @@ export async function executeErrorWorkflow(
|
|||
|
||||
if (workflowStartNode === undefined) {
|
||||
Logger.error(
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
`Calling Error Workflow for "${workflowErrorData.workflow.id}". Could not find "${ERROR_TRIGGER_TYPE}" in workflow "${workflowId}"`,
|
||||
);
|
||||
return;
|
||||
|
@ -191,7 +189,7 @@ export async function executeErrorWorkflow(
|
|||
} catch (error) {
|
||||
ErrorReporter.error(error);
|
||||
Logger.error(
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-member-access
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
`Calling Error Workflow for "${workflowErrorData.workflow.id}": "${error.message}"`,
|
||||
{ workflowId: workflowErrorData.workflow.id },
|
||||
);
|
||||
|
@ -207,13 +205,13 @@ export async function saveStaticData(workflow: Workflow): Promise<void> {
|
|||
if (isWorkflowIdValid(workflow.id)) {
|
||||
// Workflow is saved so update in database
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define, @typescript-eslint/no-non-null-assertion
|
||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
||||
await saveStaticDataById(workflow.id!, workflow.staticData);
|
||||
workflow.staticData.__dataChanged = false;
|
||||
} catch (error) {
|
||||
ErrorReporter.error(error);
|
||||
Logger.error(
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-member-access
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
`There was a problem saving the workflow with id "${workflow.id}" to save changed staticData: "${error.message}"`,
|
||||
{ workflowId: workflow.id },
|
||||
);
|
||||
|
@ -273,7 +271,7 @@ export async function replaceInvalidCredentials(workflow: WorkflowEntity): Promi
|
|||
|
||||
// for loop to run DB fetches sequential and use cache to keep pressure off DB
|
||||
// trade-off: longer response time for less DB queries
|
||||
/* eslint-disable no-await-in-loop */
|
||||
|
||||
for (const node of nodes) {
|
||||
if (!node.credentials || node.disabled) {
|
||||
continue;
|
||||
|
|
|
@ -1,15 +1,10 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
/* eslint-disable no-restricted-syntax */
|
||||
/* eslint-disable no-console */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-shadow */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/prefer-optional-chain */
|
||||
/* eslint-disable no-param-reassign */
|
||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
|
||||
import type { IProcessMessage } from 'n8n-core';
|
||||
import { WorkflowExecute } from 'n8n-core';
|
||||
|
||||
|
@ -808,7 +803,7 @@ export class WorkflowRunner {
|
|||
// They will display as unknown to the user
|
||||
// Instead of pending forever as executing when it
|
||||
// actually isn't anymore.
|
||||
// eslint-disable-next-line @typescript-eslint/await-thenable, no-await-in-loop
|
||||
|
||||
this.activeExecutions.remove(executionId);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable consistent-return */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-shadow */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-use-before-define */
|
||||
/* eslint-disable @typescript-eslint/unbound-method */
|
||||
import 'source-map-support/register';
|
||||
|
@ -76,7 +76,6 @@ class WorkflowRunnerProcess {
|
|||
[key: string]: IWorkflowExecuteProcess;
|
||||
} = {};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
static async stopProcess() {
|
||||
setTimeout(() => {
|
||||
// Attempt a graceful shutdown, giving executions 30 seconds to finish
|
||||
|
@ -90,7 +89,6 @@ class WorkflowRunnerProcess {
|
|||
|
||||
await initErrorHandling();
|
||||
|
||||
// eslint-disable-next-line no-multi-assign
|
||||
const logger = (this.logger = getLogger());
|
||||
LoggerProxy.init(logger);
|
||||
|
||||
|
@ -193,12 +191,10 @@ class WorkflowRunnerProcess {
|
|||
}
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
await sendToParentProcess('sendMessageToUI', { source, message });
|
||||
} catch (error) {
|
||||
ErrorReporter.error(error);
|
||||
this.logger.error(
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-member-access
|
||||
`There was a problem sending UI data to parent process: "${error.message}"`,
|
||||
);
|
||||
}
|
||||
|
@ -328,7 +324,7 @@ class WorkflowRunnerProcess {
|
|||
* Sends hook data to the parent process that it executes them
|
||||
*
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
async sendHookToParentProcess(hook: string, parameters: any[]) {
|
||||
try {
|
||||
await sendToParentProcess('processHook', {
|
||||
|
@ -377,7 +373,7 @@ class WorkflowRunnerProcess {
|
|||
};
|
||||
|
||||
const preExecuteFunctions = WorkflowExecuteAdditionalData.hookFunctionsPreExecute();
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
|
||||
for (const key of Object.keys(preExecuteFunctions)) {
|
||||
if (hookFunctions[key] === undefined) {
|
||||
hookFunctions[key] = [];
|
||||
|
@ -444,7 +440,6 @@ process.on('message', async (message: IProcessMessage) => {
|
|||
if (workflowRunner.workflowExecute !== undefined) {
|
||||
const executionIds = Object.keys(workflowRunner.childExecutions);
|
||||
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (const executionId of executionIds) {
|
||||
const childWorkflowExecute = workflowRunner.childExecutions[executionId];
|
||||
runData = childWorkflowExecute.workflowExecute.getFullRunData(
|
||||
|
@ -456,7 +451,7 @@ process.on('message', async (message: IProcessMessage) => {
|
|||
: new WorkflowOperationError('Workflow-Execution has been canceled!');
|
||||
|
||||
// If there is any data send it to parent process, if execution timedout add the error
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
|
||||
await childWorkflowExecute.workflowExecute.processSuccessExecution(
|
||||
workflowRunner.childExecutions[executionId].startedAt,
|
||||
childWorkflowExecute.workflow,
|
||||
|
@ -507,7 +502,6 @@ process.on('message', async (message: IProcessMessage) => {
|
|||
// Stop process
|
||||
process.exit();
|
||||
} else if (message.type === 'executionId') {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
workflowRunner.executionIdCallback(message.data.executionId);
|
||||
}
|
||||
} catch (error) {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import jwt from 'jsonwebtoken';
|
||||
import type { Response } from 'express';
|
||||
import { createHash } from 'crypto';
|
||||
|
|
|
@ -518,7 +518,7 @@ export class ExecuteBatch extends BaseCommand {
|
|||
setOutput(key: string, value: any) {
|
||||
// Temporary hack until we move to the new action.
|
||||
const output = process.env.GITHUB_OUTPUT;
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
|
||||
fs.appendFileSync(output as unknown as fs.PathOrFileDescriptor, `${key}=${value}${os.EOL}`);
|
||||
}
|
||||
|
||||
|
@ -667,7 +667,6 @@ export class ExecuteBatch extends BaseCommand {
|
|||
|
||||
const resultError = data.data.resultData.error;
|
||||
if (resultError) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
executionResult.error =
|
||||
resultError.hasOwnProperty('description') && resultError.description !== null
|
||||
? resultError.description
|
||||
|
|
|
@ -134,7 +134,6 @@ export class ExportCredentialsCommand extends BaseCommand {
|
|||
for (i = 0; i < credentials.length; i++) {
|
||||
fileContents = JSON.stringify(credentials[i], null, flags.pretty ? 2 : undefined);
|
||||
const filename = `${
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/restrict-plus-operands
|
||||
(flags.output!.endsWith(path.sep) ? flags.output! : flags.output + path.sep) +
|
||||
credentials[i].id
|
||||
}.json`;
|
||||
|
|
|
@ -119,7 +119,6 @@ export class ExportWorkflowsCommand extends BaseCommand {
|
|||
for (i = 0; i < workflows.length; i++) {
|
||||
fileContents = JSON.stringify(workflows[i], null, flags.pretty ? 2 : undefined);
|
||||
const filename = `${
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands, @typescript-eslint/no-non-null-assertion
|
||||
(flags.output!.endsWith(path.sep) ? flags.output! : flags.output + path.sep) +
|
||||
workflows[i].id
|
||||
}.json`;
|
||||
|
|
|
@ -126,7 +126,6 @@ export class ImportWorkflowsCommand extends BaseCommand {
|
|||
this.transformCredentials(node, credentials);
|
||||
|
||||
if (!node.id) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
node.id = uuid();
|
||||
}
|
||||
});
|
||||
|
@ -168,7 +167,6 @@ export class ImportWorkflowsCommand extends BaseCommand {
|
|||
workflow.nodes.forEach((node: INode) => {
|
||||
this.transformCredentials(node, credentials);
|
||||
if (!node.id) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
node.id = uuid();
|
||||
}
|
||||
if (!node.credentials?.id) {
|
||||
|
@ -274,7 +272,6 @@ export class ImportWorkflowsCommand extends BaseCommand {
|
|||
nodeCredentials.id = matchingCredentials[0].id;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
node.credentials[type] = nodeCredentials;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,12 +123,12 @@ export class Start extends BaseCommand {
|
|||
while (executingWorkflows.length !== 0) {
|
||||
if (count++ % 4 === 0) {
|
||||
console.log(`Waiting for ${executingWorkflows.length} active executions to finish...`);
|
||||
// eslint-disable-next-line array-callback-return
|
||||
|
||||
executingWorkflows.map((execution) => {
|
||||
console.log(` - Execution ID ${execution.id}, workflow ID: ${execution.workflowId}`);
|
||||
});
|
||||
}
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
|
||||
await sleep(500);
|
||||
executingWorkflows = activeExecutionsInstance.getActiveExecutions();
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ export class Start extends BaseCommand {
|
|||
LoggerProxy.info('Attempting to reinstall missing packages', { missingPackages });
|
||||
try {
|
||||
// Optimistic approach - stop if any installation fails
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
|
||||
for (const missingPackage of missingPackages) {
|
||||
await this.loadNodesAndCredentials.installNpmModule(
|
||||
missingPackage.packageName,
|
||||
|
@ -360,7 +360,7 @@ export class Start extends BaseCommand {
|
|||
void this.stopProcess();
|
||||
} else {
|
||||
// When anything else got pressed, record it and send it on enter into the child process
|
||||
// eslint-disable-next-line no-lonely-if
|
||||
|
||||
if (key.charCodeAt(0) === 13) {
|
||||
// send to child process and print in terminal
|
||||
process.stdout.write('\n');
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable no-console */
|
||||
import { flags } from '@oclif/command';
|
||||
import type { FindOptionsWhere } from 'typeorm';
|
||||
import type { QueryDeepPartialEntity } from 'typeorm/query-builder/QueryPartialEntity';
|
||||
|
|
|
@ -46,7 +46,7 @@ export class Webhook extends BaseCommand {
|
|||
`Waiting for ${executingWorkflows.length} active executions to finish...`,
|
||||
);
|
||||
}
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
|
||||
await sleep(500);
|
||||
executingWorkflows = activeExecutionsInstance.getActiveExecutions();
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ export class Worker extends BaseCommand {
|
|||
} active executions to finish... (wait ${waitLeft} more seconds)`,
|
||||
);
|
||||
}
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
|
||||
await sleep(500);
|
||||
}
|
||||
} catch (error) {
|
||||
|
@ -238,7 +238,6 @@ export class Worker extends BaseCommand {
|
|||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
const { flags } = this.parse(Worker);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const redisConnectionTimeoutLimit = config.getEnv('queue.bull.redis.timeoutThreshold');
|
||||
|
||||
const queue = Container.get(Queue);
|
||||
|
@ -309,7 +308,7 @@ export class Worker extends BaseCommand {
|
|||
|
||||
app.get(
|
||||
'/healthz',
|
||||
// eslint-disable-next-line consistent-return
|
||||
|
||||
async (req: express.Request, res: express.Response) => {
|
||||
LoggerProxy.debug('Health check started!');
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable no-restricted-syntax */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
import path from 'path';
|
||||
import convict from 'convict';
|
||||
import { UserSettings } from 'n8n-core';
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { readFileSync } from 'fs';
|
||||
import { resolve, join, dirname } from 'path';
|
||||
import type { n8n } from 'n8n-core';
|
||||
|
|
|
@ -36,7 +36,6 @@ EECredentialsController.get(
|
|||
relations: ['shared', 'shared.role', 'shared.user'],
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
return allCredentials.map((credential: CredentialsEntity & CredentialWithSharings) =>
|
||||
EECredentials.addOwnerAndSharings(credential),
|
||||
);
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable no-param-reassign */
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
import express from 'express';
|
||||
import type { INodeCredentialTestResult } from 'n8n-workflow';
|
||||
import { deepCopy, LoggerProxy } from 'n8n-workflow';
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable no-param-reassign */
|
||||
import type { DeleteResult, EntityManager, FindOptionsWhere } from 'typeorm';
|
||||
import { In, Not } from 'typeorm';
|
||||
import * as Db from '@/Db';
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable no-restricted-syntax */
|
||||
import { Credentials, UserSettings } from 'n8n-core';
|
||||
import type {
|
||||
ICredentialDataDecryptedObject,
|
||||
|
@ -111,7 +110,6 @@ export class CredentialsService {
|
|||
static async prepareCreateData(
|
||||
data: CredentialRequest.CredentialProperties,
|
||||
): Promise<CredentialsEntity> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { id, ...rest } = data;
|
||||
|
||||
// This saves us a merge but requires some type casting. These
|
||||
|
@ -327,7 +325,6 @@ export class CredentialsService {
|
|||
private static unredactRestoreValues(unmerged: any, replacement: any) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||
for (const [key, value] of Object.entries(unmerged)) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
if (value === CREDENTIAL_BLANKING_VALUE || value === CREDENTIAL_EMPTY_VALUE) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
||||
unmerged[key] = replacement[key];
|
||||
|
@ -340,7 +337,7 @@ export class CredentialsService {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
replacement[key] !== null
|
||||
) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
this.unredactRestoreValues(value, replacement[key]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -317,7 +317,6 @@ oauth2CredentialController.get(
|
|||
decryptedDataOriginal.oauthTokenData = oauthToken.data;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
unset(decryptedDataOriginal, 'csrfSecret');
|
||||
|
||||
const credentials = new Credentials(
|
||||
|
|
2
packages/cli/src/curlconverter.d.ts
vendored
2
packages/cli/src/curlconverter.d.ts
vendored
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
/* eslint-disable import/no-default-export */
|
||||
declare module 'curlconverter' {
|
||||
export function toJsonString(data: string): string;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable n8n-local-rules/no-uncaught-json-parse */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
|
|
|
@ -11,7 +11,6 @@ export class MigrateIntegerKeysToString1690000000001 implements IrreversibleMigr
|
|||
if (databaseType === 'mariadb') {
|
||||
collation = COLLATION_57;
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const dbVersionQuery = (await queryRunner.query('SELECT @@version')) as // eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
| Array<{ '@@version': string }>
|
||||
| undefined;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable n8n-local-rules/no-uncaught-json-parse */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
import type { MigrationContext, ReversibleMigration } from '@db/types';
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable n8n-local-rules/no-unneeded-backticks */
|
||||
import type { MigrationContext, IrreversibleMigration } from '@db/types';
|
||||
|
||||
export class MigrateIntegerKeysToString1690000000000 implements IrreversibleMigration {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* eslint-disable n8n-local-rules/no-uncaught-json-parse */
|
||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
|
||||
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable n8n-local-rules/no-uncaught-json-parse */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
|
|
|
@ -165,7 +165,6 @@ export async function runInBatches(
|
|||
let batchedQuery: string;
|
||||
let batchedQueryResults: unknown[];
|
||||
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
if (query.trim().endsWith(';')) query = query.trim().slice(0, -1);
|
||||
|
||||
do {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { Router } from 'express';
|
||||
import type { Application, Request, Response, RequestHandler } from 'express';
|
||||
import type { Config } from '@/config';
|
||||
|
|
|
@ -42,7 +42,7 @@ export class EEVariablesService extends VariablesService {
|
|||
static async update(id: string, variable: Omit<Variables, 'id'>): Promise<Variables> {
|
||||
this.validateVariable(variable);
|
||||
await collections.Variables.update(id, variable);
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
|
||||
return (await this.get(id))!;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
|
||||
import { MessageEventBusDestination } from './MessageEventBusDestination.ee';
|
||||
import * as Sentry from '@sentry/node';
|
||||
import {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
import syslog from 'syslog-client';
|
||||
import type { MessageEventBusDestinationOptions } from 'n8n-workflow';
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
||||
|
||||
import { MessageEventBusDestination } from './MessageEventBusDestination.ee';
|
||||
import axios from 'axios';
|
||||
import type { AxiosRequestConfig, Method } from 'axios';
|
||||
import { jsonParse, LoggerProxy, MessageEventBusDestinationTypeNames } from 'n8n-workflow';
|
||||
import {
|
||||
jsonParse,
|
||||
LoggerProxy,
|
||||
MessageEventBusDestinationTypeNames,
|
||||
MessageEventBusDestinationWebhookOptions,
|
||||
} from 'n8n-workflow';
|
||||
import type {
|
||||
MessageEventBusDestinationOptions,
|
||||
MessageEventBusDestinationWebhookOptions,
|
||||
MessageEventBusDestinationWebhookParameterItem,
|
||||
MessageEventBusDestinationWebhookParameterOptions,
|
||||
} from 'n8n-workflow';
|
||||
|
@ -20,7 +22,8 @@ import { Agent as HTTPSAgent } from 'https';
|
|||
import config from '@/config';
|
||||
import { isLogStreamingEnabled } from '../MessageEventBus/MessageEventBusHelper';
|
||||
import { eventMessageGenericDestinationTestEvent } from '../EventMessageClasses/EventMessageGeneric';
|
||||
import type { MessageEventBus, MessageWithCallback } from '../MessageEventBus/MessageEventBus';
|
||||
import { MessageEventBus } from '../MessageEventBus/MessageEventBus';
|
||||
import type { MessageWithCallback } from '../MessageEventBus/MessageEventBus';
|
||||
|
||||
export const isMessageEventBusDestinationWebhookOptions = (
|
||||
candidate: unknown,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
|
||||
import { isEventMessageOptions } from '../EventMessageClasses/AbstractEventMessage';
|
||||
import { UserSettings } from 'n8n-core';
|
||||
import path, { parse } from 'path';
|
||||
|
@ -219,7 +219,6 @@ export class MessageEventBusLogWriter {
|
|||
}
|
||||
} catch (error) {
|
||||
LoggerProxy.error(
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
`Error reading line messages from file: ${logFileName}, line: ${line}, ${error.message}}`,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -90,7 +90,6 @@ if (!isMainThread) {
|
|||
clearInterval(fileStatTimer);
|
||||
break;
|
||||
case 'initialize':
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const settings: MessageEventBusLogWriterOptions = {
|
||||
logFullBasePath: (data as MessageEventBusLogWriterOptions).logFullBasePath ?? '',
|
||||
keepNumberOfFiles: (data as MessageEventBusLogWriterOptions).keepNumberOfFiles ?? 10,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import express from 'express';
|
||||
import { isEventMessageOptions } from './EventMessageClasses/AbstractEventMessage';
|
||||
|
@ -202,7 +200,6 @@ export class EventBusController {
|
|||
break;
|
||||
default:
|
||||
throw new BadRequestError(
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
`Body is missing ${req.body.__type} options or type ${req.body.__type} is unknown`,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
import { validate as jsonSchemaValidate } from 'jsonschema';
|
||||
import type { IWorkflowBase, JsonObject, ExecutionStatus } from 'n8n-workflow';
|
||||
import { LoggerProxy, jsonParse, Workflow } from 'n8n-workflow';
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable no-param-reassign */
|
||||
|
||||
import express from 'express';
|
||||
import { LoggerProxy } from 'n8n-workflow';
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ export class CacheService {
|
|||
backend === 'redis' ||
|
||||
(backend === 'auto' && config.getEnv('executions.mode') === 'queue')
|
||||
) {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const { redisInsStore } = await import('cache-manager-ioredis-yet');
|
||||
|
||||
// #region TEMPORARY Redis Client Code
|
||||
|
|
|
@ -313,7 +313,6 @@ export class SamlService {
|
|||
}
|
||||
} catch (error) {
|
||||
throw new BadRequestError(
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
`Error fetching SAML Metadata from ${this._samlPreferences.metadataUrl}: ${error}`,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
import type RudderStack from '@rudderstack/rudder-sdk-node';
|
||||
import { PostHogClient } from '@/posthog';
|
||||
import type { ITelemetryTrackProperties } from 'n8n-workflow';
|
||||
|
@ -148,7 +146,6 @@ export class Telemetry {
|
|||
first: execTime,
|
||||
};
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
this.executionCountsBuffer[workflowId][key]!.count++;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable no-param-reassign */
|
||||
|
||||
import express from 'express';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { LoggerProxy } from 'n8n-workflow';
|
||||
|
|
|
@ -219,7 +219,6 @@ export async function createManyUsers(
|
|||
amount: number,
|
||||
attributes: Partial<User> = {},
|
||||
): Promise<User[]> {
|
||||
// eslint-disable-next-line prefer-const
|
||||
let { email, password, firstName, lastName, globalRole, ...rest } = attributes;
|
||||
if (!globalRole) {
|
||||
globalRole = await getGlobalMemberRole();
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
"build": "tsc -p tsconfig.build.json",
|
||||
"dev": "pnpm watch",
|
||||
"format": "prettier --write . --ignore-path ../../.prettierignore",
|
||||
"lint": "eslint --quiet .",
|
||||
"lintfix": "eslint . --fix",
|
||||
"lint": "eslint . --quiet --report-unused-disable-directives",
|
||||
"lintfix": "eslint . --fix --report-unused-disable-directives",
|
||||
"watch": "tsc -p tsconfig.build.json --watch",
|
||||
"test": "jest"
|
||||
},
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
/* eslint-disable no-continue */
|
||||
/* eslint-disable no-await-in-loop */
|
||||
/* eslint-disable no-restricted-syntax */
|
||||
|
||||
import { CronJob } from 'cron';
|
||||
|
||||
import type {
|
||||
|
@ -31,7 +29,6 @@ export class ActiveWorkflows {
|
|||
* @param {string} id The id of the workflow to check
|
||||
*/
|
||||
isActive(id: string): boolean {
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
return this.workflowData.hasOwnProperty(id);
|
||||
}
|
||||
|
||||
|
@ -84,13 +81,12 @@ export class ActiveWorkflows {
|
|||
);
|
||||
if (triggerResponse !== undefined) {
|
||||
// If a response was given save it
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
|
||||
this.workflowData[id].triggerResponses!.push(triggerResponse);
|
||||
}
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
throw new WorkflowActivationError(
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-member-access
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
`There was a problem activating the workflow: "${error.message}"`,
|
||||
{ cause: error as Error, node: triggerNode },
|
||||
);
|
||||
|
@ -102,7 +98,6 @@ export class ActiveWorkflows {
|
|||
this.workflowData[id].pollResponses = [];
|
||||
for (const pollNode of pollNodes) {
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
this.workflowData[id].pollResponses!.push(
|
||||
await this.activatePolling(
|
||||
pollNode,
|
||||
|
@ -114,9 +109,8 @@ export class ActiveWorkflows {
|
|||
),
|
||||
);
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
throw new WorkflowActivationError(
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-member-access
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
`There was a problem activating the workflow: "${error.message}"`,
|
||||
{ cause: error as Error, node: pollNode },
|
||||
);
|
||||
|
@ -147,7 +141,6 @@ export class ActiveWorkflows {
|
|||
const cronTimes = (pollTimes.item || []).map(toCronExpression);
|
||||
// The trigger function to execute when the cron-time got reached
|
||||
const executeTrigger = async (testingTrigger = false) => {
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
Logger.debug(`Polling trigger initiated for workflow "${workflow.name}"`, {
|
||||
workflowName: workflow.name,
|
||||
workflowId: workflow.id,
|
||||
|
@ -177,7 +170,7 @@ export class ActiveWorkflows {
|
|||
|
||||
// Start the cron-jobs
|
||||
const cronJobs: CronJob[] = [];
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
|
||||
for (const cronTime of cronTimes) {
|
||||
const cronTimeParts = cronTime.split(' ');
|
||||
if (cronTimeParts.length > 0 && cronTimeParts[0].includes('*')) {
|
||||
|
@ -221,7 +214,7 @@ export class ActiveWorkflows {
|
|||
await triggerResponse.closeFunction();
|
||||
} catch (error) {
|
||||
Logger.error(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/restrict-template-expressions
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
`There was a problem deactivating trigger of workflow "${id}": "${error.message}"`,
|
||||
{
|
||||
workflowId: id,
|
||||
|
@ -239,7 +232,7 @@ export class ActiveWorkflows {
|
|||
await pollResponse.closeFunction();
|
||||
} catch (error) {
|
||||
Logger.error(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/restrict-template-expressions
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
`There was a problem deactivating polling trigger of workflow "${id}": "${error.message}"`,
|
||||
{
|
||||
workflowId: id,
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
export const CUSTOM_EXTENSION_ENV = 'N8N_CUSTOM_EXTENSIONS';
|
||||
export const DOWNLOADED_NODES_SUBDIRECTORY = 'nodes';
|
||||
export const ENCRYPTION_KEY_ENV_OVERWRITE = 'N8N_ENCRYPTION_KEY';
|
||||
|
|
|
@ -12,7 +12,6 @@ export class Credentials extends ICredentials {
|
|||
* Returns if the given nodeType has access to data
|
||||
*/
|
||||
hasNodeAccess(nodeType: string): boolean {
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (const accessData of this.nodesAccess) {
|
||||
if (accessData.nodeType === nodeType) {
|
||||
return true;
|
||||
|
@ -81,7 +80,6 @@ export class Credentials extends ICredentials {
|
|||
throw new Error('No data was set.');
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
if (!fullData.hasOwnProperty(key)) {
|
||||
throw new Error(`No data for key "${key}" exists.`);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@ function findPropertyFromParameterName(
|
|||
);
|
||||
};
|
||||
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (const p of paramParts) {
|
||||
const param = p.split('[')[0];
|
||||
if (!property) {
|
||||
|
|
|
@ -76,7 +76,6 @@ export abstract class LoadNodeDetails {
|
|||
}
|
||||
|
||||
protected getTempNode() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
return this.workflow.getNode(TEMP_NODE_NAME)!;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,15 +3,14 @@
|
|||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
/* eslint-disable new-cap */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-shadow */
|
||||
/* eslint-disable no-param-reassign */
|
||||
|
||||
import type {
|
||||
GenericValue,
|
||||
IAdditionalCredentialOptions,
|
||||
|
@ -2143,7 +2142,6 @@ export function getWebhookDescription(
|
|||
return undefined;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (const webhookDescription of nodeType.description.webhooks) {
|
||||
if (webhookDescription.name === name) {
|
||||
return webhookDescription;
|
||||
|
@ -2561,7 +2559,6 @@ export function getExecuteFunctions(
|
|||
additionalData.sendMessageToUI(node.name, args);
|
||||
}
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
Logger.warn(`There was a problem sending message to UI: ${error.message}`);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* eslint-disable no-param-reassign */
|
||||
/* eslint-disable @typescript-eslint/no-use-before-define */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
@ -58,7 +57,6 @@ export async function prepareUserSettings(): Promise<IUserSettings> {
|
|||
|
||||
userSettings.instanceId = await generateInstanceId(userSettings.encryptionKey);
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`UserSettings were generated and saved to: ${settingsPath}`);
|
||||
|
||||
return writeUserSettings(userSettings, settingsPath);
|
||||
|
@ -202,7 +200,6 @@ export async function getUserSettings(
|
|||
const settingsFile = await fsReadFile(settingsPath, 'utf8');
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||
settingsCache = JSON.parse(settingsFile);
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
/* eslint-disable @typescript-eslint/prefer-optional-chain */
|
||||
/* eslint-disable no-await-in-loop */
|
||||
/* eslint-disable no-labels */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable no-continue */
|
||||
/* eslint-disable no-prototype-builtins */
|
||||
/* eslint-disable no-restricted-syntax */
|
||||
/* eslint-disable no-param-reassign */
|
||||
|
||||
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
|
||||
import PCancelable from 'p-cancelable';
|
||||
|
||||
|
@ -308,7 +303,6 @@ export class WorkflowExecute {
|
|||
return;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
return this.additionalData.hooks.executeHookFunctions(hookName, parameters);
|
||||
}
|
||||
|
||||
|
@ -828,7 +822,7 @@ export class WorkflowExecute {
|
|||
};
|
||||
|
||||
// Set the incoming data of the node that it can be saved correctly
|
||||
// eslint-disable-next-line prefer-destructuring
|
||||
|
||||
executionData = this.runExecutionData.executionData!.nodeExecutionStack[0];
|
||||
this.runExecutionData.resultData = {
|
||||
runData: {
|
||||
|
@ -1033,7 +1027,7 @@ export class WorkflowExecute {
|
|||
|
||||
if (runNodeData.closeFunction) {
|
||||
// Explanation why we do this can be found in n8n-workflow/Workflow.ts -> runNode
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
|
||||
closeFunction = runNodeData.closeFunction();
|
||||
}
|
||||
}
|
||||
|
@ -1531,7 +1525,7 @@ export class WorkflowExecute {
|
|||
|
||||
// Check if static data changed
|
||||
let newStaticData: IDataObject | undefined;
|
||||
// eslint-disable-next-line no-underscore-dangle
|
||||
|
||||
if (workflow.staticData.__dataChanged === true) {
|
||||
// Static data of workflow changed
|
||||
newStaticData = workflow.staticData;
|
||||
|
@ -1539,7 +1533,6 @@ export class WorkflowExecute {
|
|||
await this.executeHook('workflowExecuteAfter', [fullRunData, newStaticData]).catch(
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
(error) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('There was a problem running hook "workflowExecuteAfter"', error);
|
||||
},
|
||||
);
|
||||
|
@ -1549,7 +1542,6 @@ export class WorkflowExecute {
|
|||
await closeFunction;
|
||||
} catch (errorClose) {
|
||||
Logger.error(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/restrict-template-expressions
|
||||
`There was a problem deactivating trigger of workflow "${workflow.id}": "${errorClose.message}"`,
|
||||
{
|
||||
workflowId: workflow.id,
|
||||
|
@ -1600,7 +1592,7 @@ export class WorkflowExecute {
|
|||
|
||||
// Check if static data changed
|
||||
let newStaticData: IDataObject | undefined;
|
||||
// eslint-disable-next-line no-underscore-dangle
|
||||
|
||||
if (workflow.staticData.__dataChanged === true) {
|
||||
// Static data of workflow changed
|
||||
newStaticData = workflow.staticData;
|
||||
|
@ -1612,7 +1604,6 @@ export class WorkflowExecute {
|
|||
await closeFunction;
|
||||
} catch (error) {
|
||||
Logger.error(
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
`There was a problem deactivating trigger of workflow "${workflow.id}": "${error.message}"`,
|
||||
{
|
||||
workflowId: workflow.id,
|
||||
|
|
|
@ -25,7 +25,6 @@ export class Build extends Command {
|
|||
}),
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
async run() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
const { flags } = this.parse(Build);
|
||||
|
@ -47,10 +46,10 @@ export class Build extends Command {
|
|||
|
||||
this.log(`The nodes got built and saved into the following folder:\n${outputDirectory}`);
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-member-access
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
this.log(`\nGOT ERROR: "${error.message}"`);
|
||||
this.log('====================================');
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
|
||||
this.log(error.stack);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ export class New extends Command {
|
|||
|
||||
static examples = ['$ n8n-node-dev new'];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
async run() {
|
||||
try {
|
||||
this.log('\nCreate new credentials/node');
|
||||
|
@ -105,7 +104,7 @@ export class New extends Command {
|
|||
// node file
|
||||
const destinationFilePath = join(
|
||||
process.cwd(),
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-member-access
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
`${changeCase.pascalCase(nodeName)}.${typeAnswers.type.toLowerCase()}.ts`,
|
||||
);
|
||||
|
||||
|
@ -152,10 +151,10 @@ export class New extends Command {
|
|||
|
||||
this.log(`Node got created: ${destinationFilePath}`);
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-member-access
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
this.log(`\nGOT ERROR: "${error.message}"`);
|
||||
this.log('====================================');
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-member-access
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
this.log(error.stack);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
"build": "tsc --noEmit",
|
||||
"build-node-dev": "tsc",
|
||||
"format": "prettier --write . --ignore-path ../../.prettierignore",
|
||||
"lint": "eslint --quiet .",
|
||||
"lintfix": "eslint . --fix",
|
||||
"lint": "eslint . --quiet --report-unused-disable-directives",
|
||||
"lintfix": "eslint . --fix --report-unused-disable-directives",
|
||||
"postpack": "rm -f oclif.manifest.json",
|
||||
"prepack": "echo \"Building project...\" && rm -rf dist && tsc -b && oclif-dev manifest",
|
||||
"watch": "tsc --watch"
|
||||
|
|
|
@ -15,19 +15,19 @@ import type { IBuildOptions } from './Interfaces';
|
|||
* directory:
|
||||
* https://github.com/Microsoft/TypeScript/issues/25430
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
|
||||
export async function createCustomTsconfig() {
|
||||
// Get path to simple tsconfig file which should be used for build
|
||||
const tsconfigPath = join(dirname(require.resolve('n8n-node-dev/src')), 'tsconfig-build.json');
|
||||
|
||||
// Read the tsconfig file
|
||||
const tsConfigString = await readFile(tsconfigPath, { encoding: 'utf8' });
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
|
||||
const tsConfig = jsonParse<{ include: string[] }>(tsConfigString);
|
||||
|
||||
// Set absolute include paths
|
||||
const newIncludeFiles = [];
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
|
||||
for (const includeFile of tsConfig.include) {
|
||||
newIncludeFiles.push(join(process.cwd(), includeFile));
|
||||
}
|
||||
|
@ -101,7 +101,6 @@ export async function buildFiles({
|
|||
let errorMessage = error.message;
|
||||
|
||||
if (error.stdout !== undefined) {
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
errorMessage = `${errorMessage}\nGot following output:\n${error.stdout}`;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
"typecheck": "tsc",
|
||||
"build": "tsc -p tsconfig.build.json",
|
||||
"format": "prettier --write . --ignore-path ../../.prettierignore",
|
||||
"lint": "eslint --quiet .",
|
||||
"lintfix": "eslint . --fix",
|
||||
"lint": "eslint . --quiet --report-unused-disable-directives",
|
||||
"lintfix": "eslint . --fix --report-unused-disable-directives",
|
||||
"watch": "tsc -p tsconfig.build.json --watch",
|
||||
"test": "jest",
|
||||
"test:dev": "jest --watch"
|
||||
|
|
|
@ -88,7 +88,6 @@ export function augmentObject<T extends object>(data: T): T {
|
|||
return newData[key];
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const value = Reflect.get(target, key, receiver);
|
||||
|
||||
if (typeof value !== 'object' || value === null) return value;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
export const BINARY_ENCODING = 'base64';
|
||||
export const WAIT_TIME_UNLIMITED = '3000-01-01T00:00:00.000Z';
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ const AsyncFunction = (async () => {}).constructor as FunctionConstructor;
|
|||
|
||||
const fnConstructors = {
|
||||
sync: Function.prototype.constructor,
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
|
||||
async: AsyncFunction.prototype.constructor,
|
||||
mock: () => {
|
||||
throw new ExpressionError('Arbitrary code execution detected');
|
||||
|
@ -130,7 +130,7 @@ export class Expression {
|
|||
// Is an expression
|
||||
|
||||
// Remove the equal sign
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
|
||||
parameterValue = parameterValue.substr(1);
|
||||
|
||||
// Generate a data proxy which allows to query workflow data
|
||||
|
@ -573,7 +573,7 @@ export class Expression {
|
|||
|
||||
// Data is an object
|
||||
const returnData: INodeParameters = {};
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
|
||||
for (const [key, value] of Object.entries(parameterValue)) {
|
||||
returnData[key] = resolveParameterValue(
|
||||
value as NodeParameterValueType,
|
||||
|
|
|
@ -182,7 +182,7 @@ function chunk(value: unknown[], extraArgs: number[]) {
|
|||
const chunks: unknown[][] = [];
|
||||
for (let i = 0; i < value.length; i += chunkSize) {
|
||||
// I have no clue why eslint thinks 2 numbers could be anything but that but here we are
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
||||
|
||||
chunks.push(value.slice(i, i + chunkSize));
|
||||
}
|
||||
return chunks;
|
||||
|
@ -275,7 +275,6 @@ function union(value: unknown[], extraArgs: unknown[][]): unknown[] {
|
|||
}
|
||||
const newArr: unknown[] = Array.from(value);
|
||||
for (const v of others) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
if (newArr.findIndex((w) => deepEqual(w, v, { strict: true })) === -1) {
|
||||
newArr.push(v);
|
||||
}
|
||||
|
@ -313,7 +312,6 @@ function intersection(value: unknown[], extraArgs: unknown[][]): unknown[] {
|
|||
}
|
||||
}
|
||||
for (const v of others) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
if (value.findIndex((w) => deepEqual(w, v, { strict: true })) !== -1) {
|
||||
newArr.push(v);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { ExpressionExtensionError } from './../ExpressionError';
|
||||
/* eslint-disable @typescript-eslint/unbound-method */
|
||||
/* eslint-disable @typescript-eslint/explicit-member-accessibility */
|
||||
|
||||
import { DateTime } from 'luxon';
|
||||
import type {
|
||||
DateTimeUnit,
|
||||
|
|
|
@ -88,7 +88,6 @@ export const hasNativeMethod = (method: string): boolean => {
|
|||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function parseWithEsprimaNext(source: string, options?: any): any {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||
const ast = esprimaParse(source, {
|
||||
loc: true,
|
||||
locations: true,
|
||||
|
@ -451,7 +450,6 @@ interface FoundFunction {
|
|||
function: Function;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
function findExtendedFunction(input: unknown, functionName: string): FoundFunction | undefined {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
let foundFunction: Function | undefined;
|
||||
|
@ -479,12 +477,7 @@ function findExtendedFunction(input: unknown, functionName: string): FoundFuncti
|
|||
const inputAny: any = input;
|
||||
// This is likely a builtin we're implementing for another type
|
||||
// (e.g. toLocaleString). We'll return that instead
|
||||
if (
|
||||
inputAny &&
|
||||
functionName &&
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
typeof inputAny[functionName] === 'function'
|
||||
) {
|
||||
if (inputAny && functionName && typeof inputAny[functionName] === 'function') {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
return { type: 'native', function: inputAny[functionName] };
|
||||
}
|
||||
|
@ -508,7 +501,6 @@ function findExtendedFunction(input: unknown, functionName: string): FoundFuncti
|
|||
* ```
|
||||
*/
|
||||
export function extend(input: unknown, functionName: string, args: unknown[]) {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
const foundFunction = findExtendedFunction(input, functionName);
|
||||
|
||||
// No type specific or generic function found. Check to see if
|
||||
|
@ -522,7 +514,6 @@ export function extend(input: unknown, functionName: string, args: unknown[]) {
|
|||
}
|
||||
|
||||
if (haveFunction.length > 1) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
const lastType = `"${haveFunction.pop()!.typeName}"`;
|
||||
const typeNames = `${haveFunction.map((v) => `"${v.typeName}"`).join(', ')}, and ${lastType}`;
|
||||
throw new ExpressionExtensionError(
|
||||
|
|
|
@ -64,7 +64,7 @@ export function compact(value: object): object {
|
|||
if (val !== null && val !== undefined && val !== 'nil' && val !== '') {
|
||||
if (typeof val === 'object') {
|
||||
if (Object.keys(val as object).length === 0) continue;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
|
||||
newObj[key] = compact(val);
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/unbound-method */
|
||||
// import { createHash } from 'crypto';
|
||||
import { titleCase } from 'title-case';
|
||||
import * as ExpressionError from '../ExpressionError';
|
||||
|
@ -295,7 +294,6 @@ function toSentenceCase(value: string) {
|
|||
const charIndex = current.search(CHAR_TEST_REGEXP);
|
||||
current =
|
||||
current.slice(0, charIndex) +
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
current[charIndex]!.toLocaleUpperCase() +
|
||||
current.slice(charIndex + 1).toLocaleLowerCase();
|
||||
const puncIndex = current.search(PUNC_TEST_REGEXP);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
// eslint-disable-next-line max-classes-per-file
|
||||
|
||||
import type * as express from 'express';
|
||||
import type FormData from 'form-data';
|
||||
import type { IncomingHttpHeaders } from 'http';
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
import type { ILogger, LogTypes } from './Interfaces';
|
||||
|
||||
let logger: ILogger | undefined;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue