refactor: Integrate consistent-type-imports in BE packages (no-changelog) (#5270)

This commit is contained in:
Iván Ovejero 2023-01-27 14:56:56 +01:00 committed by GitHub
parent 7d7418140e
commit 2ca959b383
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
148 changed files with 452 additions and 421 deletions

View file

@ -16,6 +16,8 @@ module.exports = {
],
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
// TODO: Remove this
'import/no-cycle': 'warn',
'import/order': 'off',

View file

@ -8,11 +8,8 @@ import compression from 'compression';
import parseUrl from 'parseurl';
import type { RedisOptions } from 'ioredis';
import {
ErrorReporterProxy as ErrorReporter,
LoggerProxy as Logger,
WebhookHttpMethod,
} from 'n8n-workflow';
import type { WebhookHttpMethod } from 'n8n-workflow';
import { ErrorReporterProxy as ErrorReporter, LoggerProxy as Logger } from 'n8n-workflow';
import config from '@/config';
import { N8N_VERSION, inDevelopment } from '@/constants';
import * as ActiveWorkflowRunner from '@/ActiveWorkflowRunner';

View file

@ -5,18 +5,14 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import {
createDeferredPromise,
IDeferredPromise,
IExecuteResponsePromiseData,
IRun,
} from 'n8n-workflow';
import type { IDeferredPromise, IExecuteResponsePromiseData, IRun } from 'n8n-workflow';
import { createDeferredPromise } from 'n8n-workflow';
import type { ChildProcess } from 'child_process';
import { stringify } from 'flatted';
import PCancelable from 'p-cancelable';
import type PCancelable from 'p-cancelable';
import * as Db from '@/Db';
import {
import type {
IExecutingWorkflowData,
IExecutionDb,
IExecutionFlattedDb,

View file

@ -11,7 +11,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { ActiveWorkflows, NodeExecuteFunctions } from 'n8n-core';
import {
import type {
ExecutionError,
IDeferredPromise,
IExecuteData,
@ -24,21 +24,23 @@ import {
IRunExecutionData,
IWorkflowBase,
IWorkflowExecuteAdditionalData as IWorkflowExecuteAdditionalDataWorkflow,
NodeHelpers,
WebhookHttpMethod,
Workflow,
WorkflowActivateMode,
WorkflowActivationError,
WorkflowExecuteMode,
LoggerProxy as Logger,
ErrorReporterProxy as ErrorReporter,
INodeType,
} from 'n8n-workflow';
import {
NodeHelpers,
Workflow,
WorkflowActivationError,
LoggerProxy as Logger,
ErrorReporterProxy as ErrorReporter,
} from 'n8n-workflow';
import express from 'express';
import type express from 'express';
import * as Db from '@/Db';
import {
import type {
IActivationError,
IQueuedWorkflowActivations,
IResponseCallbackData,
@ -51,7 +53,7 @@ import * as WorkflowHelpers from '@/WorkflowHelpers';
import * as WorkflowExecuteAdditionalData from '@/WorkflowExecuteAdditionalData';
import config from '@/config';
import { User } from '@db/entities/User';
import type { User } from '@db/entities/User';
import type { WorkflowEntity } from '@db/entities/WorkflowEntity';
import type { WebhookEntity } from '@db/entities/WebhookEntity';
import * as ActiveExecutions from '@/ActiveExecutions';

View file

@ -5,7 +5,8 @@ import { exec } from 'child_process';
import { access as fsAccess, mkdir as fsMkdir } from 'fs/promises';
import axios from 'axios';
import { UserSettings } from 'n8n-core';
import { LoggerProxy, PublicInstalledPackage } from 'n8n-workflow';
import type { PublicInstalledPackage } from 'n8n-workflow';
import { LoggerProxy } from 'n8n-workflow';
import {
NODE_PACKAGE_PREFIX,
@ -14,7 +15,7 @@ import {
RESPONSE_ERROR_MESSAGES,
UNKNOWN_FAILURE_REASON,
} from '@/constants';
import { InstalledPackages } from '@db/entities/InstalledPackages';
import type { InstalledPackages } from '@db/entities/InstalledPackages';
import config from '@/config';
import type { CommunityPackages } from '@/Interfaces';

View file

@ -1,4 +1,5 @@
import { INodeTypeData, INodeTypeNameVersion, LoggerProxy } from 'n8n-workflow';
import type { INodeTypeData, INodeTypeNameVersion } from 'n8n-workflow';
import { LoggerProxy } from 'n8n-workflow';
import * as Db from '@/Db';
import { InstalledNodes } from '@db/entities/InstalledNodes';
import { InstalledPackages } from '@db/entities/InstalledPackages';

View file

@ -9,11 +9,10 @@
import { Credentials, NodeExecuteFunctions } from 'n8n-core';
import get from 'lodash.get';
import {
import type {
ICredentialDataDecryptedObject,
ICredentialsDecrypted,
ICredentialsExpressionResolveValues,
ICredentialsHelper,
ICredentialTestFunction,
ICredentialTestRequestData,
IHttpRequestOptions,
@ -25,28 +24,31 @@ import {
INodeProperties,
INodeType,
IVersionedNodeType,
VersionedNodeType,
IRequestOptionsSimplified,
IRunExecutionData,
IWorkflowDataProxyAdditionalKeys,
NodeHelpers,
RoutingNode,
Workflow,
WorkflowExecuteMode,
ITaskDataConnections,
LoggerProxy as Logger,
ErrorReporterProxy as ErrorReporter,
IHttpRequestHelper,
INodeTypeData,
INodeTypes,
ICredentialTypes,
} from 'n8n-workflow';
import {
ICredentialsHelper,
VersionedNodeType,
NodeHelpers,
RoutingNode,
Workflow,
LoggerProxy as Logger,
ErrorReporterProxy as ErrorReporter,
} from 'n8n-workflow';
import * as Db from '@/Db';
import { ICredentialsDb } from '@/Interfaces';
import type { ICredentialsDb } from '@/Interfaces';
import * as WorkflowExecuteAdditionalData from '@/WorkflowExecuteAdditionalData';
import { User } from '@db/entities/User';
import { CredentialsEntity } from '@db/entities/CredentialsEntity';
import type { User } from '@db/entities/User';
import type { CredentialsEntity } from '@db/entities/CredentialsEntity';
import { NodeTypes } from '@/NodeTypes';
import { CredentialTypes } from '@/CredentialTypes';
import { CredentialsOverwrites } from '@/CredentialsOverwrites';

View file

@ -3,8 +3,7 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable no-case-declarations */
/* eslint-disable @typescript-eslint/naming-convention */
import {
DataSource as Connection,
import type {
DataSourceOptions as ConnectionOptions,
EntityManager,
EntityTarget,
@ -12,8 +11,9 @@ import {
ObjectLiteral,
Repository,
} from 'typeorm';
import { TlsOptions } from 'tls';
import { DatabaseType, IDatabaseCollections } from '@/Interfaces';
import { DataSource as Connection } from 'typeorm';
import type { TlsOptions } from 'tls';
import type { DatabaseType, IDatabaseCollections } from '@/Interfaces';
import * as GenericHelpers from '@/GenericHelpers';
import config from '@/config';

View file

@ -2,7 +2,11 @@
/* eslint-disable import/no-dynamic-require */
/* eslint-disable no-restricted-syntax */
import * as Db from '@/Db';
import { IExternalHooksClass, IExternalHooksFileData, IExternalHooksFunctions } from '@/Interfaces';
import type {
IExternalHooksClass,
IExternalHooksFileData,
IExternalHooksFunctions,
} from '@/Interfaces';
import config from '@/config';

View file

@ -4,9 +4,9 @@
/* eslint-disable no-param-reassign */
/* eslint-disable no-underscore-dangle */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import express from 'express';
import type express from 'express';
import { readFile as fsReadFile } from 'fs/promises';
import {
import type {
ExecutionError,
IDataObject,
INode,
@ -17,14 +17,14 @@ import {
import { validate } from 'class-validator';
import config from '@/config';
import * as Db from '@/Db';
import { ICredentialsDb, IExecutionDb, IExecutionFlattedDb, IWorkflowDb } from '@/Interfaces';
import type { ICredentialsDb, IExecutionDb, IExecutionFlattedDb, IWorkflowDb } from '@/Interfaces';
import * as ResponseHelper from '@/ResponseHelper';
// eslint-disable-next-line import/order
import { Like } from 'typeorm';
import { WorkflowEntity } from '@db/entities/WorkflowEntity';
import { CredentialsEntity } from '@db/entities/CredentialsEntity';
import { TagEntity } from '@db/entities/TagEntity';
import { User } from '@db/entities/User';
import type { WorkflowEntity } from '@db/entities/WorkflowEntity';
import type { CredentialsEntity } from '@db/entities/CredentialsEntity';
import type { TagEntity } from '@db/entities/TagEntity';
import type { User } from '@db/entities/User';
/**
* Returns the base URL n8n is reachable from

View file

@ -3,16 +3,16 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { snakeCase } from 'change-case';
import { BinaryDataManager } from 'n8n-core';
import {
import type {
INodesGraphResult,
INodeTypes,
IRun,
ITelemetryTrackProperties,
IWorkflowBase,
TelemetryHelpers,
} from 'n8n-workflow';
import { TelemetryHelpers } from 'n8n-workflow';
import { get as pslGet } from 'psl';
import {
import type {
IDiagnosticInfo,
IInternalHooksClass,
ITelemetryUserDeletionData,
@ -20,7 +20,7 @@ import {
IExecutionTrackProperties,
IWorkflowExecutionDataProcess,
} from '@/Interfaces';
import { Telemetry } from '@/telemetry';
import type { Telemetry } from '@/telemetry';
import type { AuthProviderType } from '@db/entities/AuthIdentity';
import { RoleService } from './role/role.service';
import { eventBus } from './eventbus';

View file

@ -1,4 +1,4 @@
import { INodeTypes } from 'n8n-workflow';
import type { INodeTypes } from 'n8n-workflow';
import { InternalHooksClass } from '@/InternalHooks';
import { Telemetry } from '@/telemetry';

View file

@ -1,9 +1,10 @@
/* eslint-disable no-underscore-dangle */
import { Client, Entry as LdapUser, ClientOptions } from 'ldapts';
import type { Entry as LdapUser, ClientOptions } from 'ldapts';
import { Client } from 'ldapts';
import type { LdapConfig } from './types';
import { formatUrl, getMappingAttributes } from './helpers';
import { BINARY_AD_ATTRIBUTES } from './constants';
import { ConnectionOptions } from 'tls';
import type { ConnectionOptions } from 'tls';
export class LdapService {
private client: Client | undefined;

View file

@ -1,7 +1,7 @@
import type { Entry as LdapUser } from 'ldapts';
import { LoggerProxy as Logger } from 'n8n-workflow';
import { QueryFailedError } from 'typeorm/error/QueryFailedError';
import { LdapService } from './LdapService.ee';
import type { LdapService } from './LdapService.ee';
import type { LdapConfig } from './types';
import {
getLdapUserRole,

View file

@ -1,5 +1,5 @@
import type { RunningMode } from '@db/entities/AuthProviderSyncHistory';
import { AuthenticatedRequest } from '@/requests';
import type { AuthenticatedRequest } from '@/requests';
export type ConnectionSecurity = 'none' | 'tls' | 'startTls';

View file

@ -1,5 +1,6 @@
import { LicenseManager, TEntitlement, TLicenseContainerStr } from '@n8n_io/license-sdk';
import { ILogger } from 'n8n-workflow';
import type { TEntitlement, TLicenseContainerStr } from '@n8n_io/license-sdk';
import { LicenseManager } from '@n8n_io/license-sdk';
import type { ILogger } from 'n8n-workflow';
import { getLogger } from './Logger';
import config from '@/config';
import * as Db from '@/Db';

View file

@ -1,12 +1,11 @@
import uniq from 'lodash.uniq';
import type { DirectoryLoader, Types } from 'n8n-core';
import {
CUSTOM_EXTENSION_ENV,
UserSettings,
CustomDirectoryLoader,
DirectoryLoader,
PackageDirectoryLoader,
LazyPackageDirectoryLoader,
Types,
} from 'n8n-core';
import type {
ICredentialTypes,
@ -27,8 +26,8 @@ import {
} from 'fs/promises';
import path from 'path';
import config from '@/config';
import { InstalledPackages } from '@db/entities/InstalledPackages';
import { InstalledNodes } from '@db/entities/InstalledNodes';
import type { InstalledPackages } from '@db/entities/InstalledPackages';
import type { InstalledNodes } from '@db/entities/InstalledNodes';
import { executeCommand } from '@/CommunityNodes/helpers';
import { CLI_DIR, GENERATED_STATIC_DIR, RESPONSE_ERROR_MESSAGES } from '@/constants';
import {

View file

@ -6,7 +6,7 @@
import { inspect } from 'util';
import winston from 'winston';
import { IDataObject, ILogger, LogTypes } from 'n8n-workflow';
import type { IDataObject, ILogger, LogTypes } from 'n8n-workflow';
import callsites from 'callsites';
import { basename } from 'path';

View file

@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/naming-convention */
import express, { Router } from 'express';
import type { Router } from 'express';
import express from 'express';
import fs from 'fs/promises';
import path from 'path';

View file

@ -1,5 +1,5 @@
import express from 'express';
import { IDataObject } from 'n8n-workflow';
import type express from 'express';
import type { IDataObject } from 'n8n-workflow';
import type { User } from '@db/entities/User';
@ -7,7 +7,7 @@ import type { Role } from '@db/entities/Role';
import type { WorkflowEntity } from '@db/entities/WorkflowEntity';
import * as UserManagementMailer from '@/UserManagement/email/UserManagementMailer';
import type * as UserManagementMailer from '@/UserManagement/email/UserManagementMailer';
import type { Risk } from '@/audit/types';

View file

@ -1,11 +1,11 @@
/* eslint-disable @typescript-eslint/no-unsafe-argument */
import express from 'express';
import type express from 'express';
import { CredentialsHelper } from '@/CredentialsHelper';
import { CredentialTypes } from '@/CredentialTypes';
import { CredentialsEntity } from '@db/entities/CredentialsEntity';
import { CredentialRequest } from '@/requests';
import { CredentialTypeRequest } from '../../../types';
import type { CredentialsEntity } from '@db/entities/CredentialsEntity';
import type { CredentialRequest } from '@/requests';
import type { CredentialTypeRequest } from '../../../types';
import { authorize } from '../../shared/middlewares/global.middleware';
import { validCredentialsProperties, validCredentialType } from './credentials.middleware';

View file

@ -1,11 +1,11 @@
/* eslint-disable @typescript-eslint/no-invalid-void-type */
import express from 'express';
import type express from 'express';
import { validate } from 'jsonschema';
import { CredentialsHelper } from '@/CredentialsHelper';
import { CredentialTypes } from '@/CredentialTypes';
import { CredentialRequest } from '../../../types';
import type { CredentialRequest } from '../../../types';
import { toJsonSchema } from './credentials.service';
export const validCredentialType = (

View file

@ -1,13 +1,13 @@
import { UserSettings, Credentials } from 'n8n-core';
import { IDataObject, INodeProperties, INodePropertyOptions } from 'n8n-workflow';
import type { IDataObject, INodeProperties, INodePropertyOptions } from 'n8n-workflow';
import * as Db from '@/Db';
import type { ICredentialsDb } from '@/Interfaces';
import { CredentialsEntity } from '@db/entities/CredentialsEntity';
import { SharedCredentials } from '@db/entities/SharedCredentials';
import { User } from '@db/entities/User';
import type { User } from '@db/entities/User';
import { ExternalHooks } from '@/ExternalHooks';
import { IDependency, IJsonSchema } from '../../../types';
import { CredentialRequest } from '@/requests';
import type { IDependency, IJsonSchema } from '../../../types';
import type { CredentialRequest } from '@/requests';
export async function getCredentials(credentialId: string): Promise<ICredentialsDb | null> {
return Db.collections.Credentials.findOneBy({ id: credentialId });

View file

@ -1,4 +1,4 @@
import express from 'express';
import type express from 'express';
import { BinaryDataManager } from 'n8n-core';
@ -10,7 +10,7 @@ import {
} from './executions.service';
import * as ActiveExecutions from '@/ActiveExecutions';
import { authorize, validCursor } from '../../shared/middlewares/global.middleware';
import { ExecutionRequest } from '../../../types';
import type { ExecutionRequest } from '../../../types';
import { getSharedWorkflowIds } from '../workflows/workflows.service';
import { encodeNextCursor } from '../../shared/services/pagination.service';
import { InternalHooksManager } from '@/InternalHooksManager';

View file

@ -1,5 +1,6 @@
import { parse } from 'flatted';
import { In, Not, Raw, LessThan, IsNull, FindOptionsWhere } from 'typeorm';
import type { FindOptionsWhere } from 'typeorm';
import { In, Not, Raw, LessThan, IsNull } from 'typeorm';
import * as Db from '@/Db';
import type { IExecutionFlattedDb, IExecutionResponseApi } from '@/Interfaces';

View file

@ -1,6 +1,6 @@
import * as Db from '@/Db';
import { Role } from '@db/entities/Role';
import { User } from '@db/entities/User';
import type { Role } from '@db/entities/Role';
import type { User } from '@db/entities/User';
export function isInstanceOwner(user: User): boolean {
return user.globalRole.name === 'owner';

View file

@ -1,6 +1,7 @@
import express from 'express';
import type express from 'express';
import { FindManyOptions, FindOptionsWhere, In } from 'typeorm';
import type { FindManyOptions, FindOptionsWhere } from 'typeorm';
import { In } from 'typeorm';
import * as ActiveWorkflowRunner from '@/ActiveWorkflowRunner';
import config from '@/config';
@ -8,7 +9,7 @@ import { WorkflowEntity } from '@db/entities/WorkflowEntity';
import { InternalHooksManager } from '@/InternalHooksManager';
import { ExternalHooks } from '@/ExternalHooks';
import { addNodeIds, replaceInvalidCredentials } from '@/WorkflowHelpers';
import { WorkflowRequest } from '../../../types';
import type { WorkflowRequest } from '../../../types';
import { authorize, validCursor } from '../../shared/middlewares/global.middleware';
import { encodeNextCursor } from '../../shared/services/pagination.service';
import { getWorkflowOwnerRole, isInstanceOwner } from '../users/users.service';

View file

@ -1,14 +1,15 @@
import { FindManyOptions, In, UpdateResult } from 'typeorm';
import type { FindManyOptions, UpdateResult } from 'typeorm';
import { In } from 'typeorm';
import intersection from 'lodash.intersection';
import type { INode } from 'n8n-workflow';
import { v4 as uuid } from 'uuid';
import * as Db from '@/Db';
import { User } from '@db/entities/User';
import type { User } from '@db/entities/User';
import { WorkflowEntity } from '@db/entities/WorkflowEntity';
import { SharedWorkflow } from '@db/entities/SharedWorkflow';
import { isInstanceOwner } from '../users/users.service';
import { Role } from '@db/entities/Role';
import type { Role } from '@db/entities/Role';
import config from '@/config';
function insertIf(condition: boolean, elements: string[]): string[] {

View file

@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/no-invalid-void-type */
import express from 'express';
import type express from 'express';
import { AuthenticatedRequest, PaginatatedRequest } from '../../../types';
import type { AuthenticatedRequest, PaginatatedRequest } from '../../../types';
import { decodeCursor } from '../services/pagination.service';
export const authorize =

View file

@ -1,5 +1,5 @@
import { jsonParse } from 'n8n-workflow';
import {
import type {
CursorPagination,
OffsetPagination,
PaginationCursorDecoded,

View file

@ -1,6 +1,6 @@
import type Bull from 'bull';
import type { RedisOptions } from 'ioredis';
import { IExecuteResponsePromiseData } from 'n8n-workflow';
import type { IExecuteResponsePromiseData } from 'n8n-workflow';
import config from '@/config';
import * as ActiveExecutions from '@/ActiveExecutions';
import * as WebhookHelpers from '@/WebhookHelpers';

View file

@ -3,7 +3,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable no-param-reassign */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { Request, Response } from 'express';
import type { Request, Response } from 'express';
import { parse, stringify } from 'flatted';
import picocolors from 'picocolors';
import { ErrorReporterProxy as ErrorReporter, NodeApiError } from 'n8n-workflow';

View file

@ -35,9 +35,12 @@ import { createHmac } from 'crypto';
import { promisify } from 'util';
import cookieParser from 'cookie-parser';
import express from 'express';
import { FindManyOptions, In } from 'typeorm';
import axios, { AxiosRequestConfig } from 'axios';
import clientOAuth1, { RequestOptions } from 'oauth-1.0a';
import type { FindManyOptions } from 'typeorm';
import { In } from 'typeorm';
import type { AxiosRequestConfig } from 'axios';
import axios from 'axios';
import type { RequestOptions } from 'oauth-1.0a';
import clientOAuth1 from 'oauth-1.0a';
// IMPORTANT! Do not switch to anther bcrypt library unless really necessary and
// tested with all possible systems like Windows, Alpine on ARM, FreeBSD, ...
import { compare } from 'bcryptjs';
@ -50,7 +53,7 @@ import {
UserSettings,
} from 'n8n-core';
import {
import type {
INodeCredentials,
INodeCredentialsDetails,
INodeListSearchResult,
@ -58,12 +61,11 @@ import {
INodePropertyOptions,
INodeTypeNameVersion,
ITelemetrySettings,
LoggerProxy,
jsonParse,
WorkflowExecuteMode,
INodeTypes,
ICredentialTypes,
} from 'n8n-workflow';
import { LoggerProxy, jsonParse } from 'n8n-workflow';
import basicAuth from 'basic-auth';
import jwt from 'jsonwebtoken';
@ -124,7 +126,7 @@ import {
} from '@/UserManagement/UserManagementHelper';
import { getInstance as getMailerInstance } from '@/UserManagement/email';
import * as Db from '@/Db';
import {
import type {
DatabaseType,
ICredentialsDb,
ICredentialsOverwrite,
@ -147,7 +149,8 @@ import { NodeTypes } from '@/NodeTypes';
import * as Push from '@/Push';
import { LoadNodesAndCredentials } from '@/LoadNodesAndCredentials';
import * as ResponseHelper from '@/ResponseHelper';
import { WaitTracker, WaitTrackerClass } from '@/WaitTracker';
import type { WaitTrackerClass } from '@/WaitTracker';
import { WaitTracker } from '@/WaitTracker';
import * as WebhookHelpers from '@/WebhookHelpers';
import * as WorkflowExecuteAdditionalData from '@/WorkflowExecuteAdditionalData';
import { toHttpNodeParameters } from '@/CurlConverterHelper';

View file

@ -1,11 +1,11 @@
/* eslint-disable consistent-return */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable no-param-reassign */
import express from 'express';
import type express from 'express';
import { ActiveWebhooks } from 'n8n-core';
import {
import type {
IWebhookData,
IWorkflowExecuteAdditionalData,
WebhookHttpMethod,
@ -13,7 +13,7 @@ import {
WorkflowActivateMode,
WorkflowExecuteMode,
} from 'n8n-workflow';
import { IResponseCallbackData, IWorkflowDb } from '@/Interfaces';
import type { IResponseCallbackData, IWorkflowDb } from '@/Interfaces';
import * as Push from '@/Push';
import * as ResponseHelper from '@/ResponseHelper';
import * as WebhookHelpers from '@/WebhookHelpers';

View file

@ -1,6 +1,6 @@
import { join, dirname } from 'path';
import { readdir } from 'fs/promises';
import { Dirent } from 'fs';
import type { Dirent } from 'fs';
import { NODES_BASE_DIR } from '@/constants';
const ALLOWED_VERSIONED_DIRNAME_LENGTH = [2, 3]; // e.g. v1, v10

View file

@ -1,11 +1,11 @@
import type { INode, Workflow } from 'n8n-workflow';
import {
INode,
NodeOperationError,
SubworkflowOperationError,
Workflow,
WorkflowOperationError,
} from 'n8n-workflow';
import { FindOptionsWhere, In } from 'typeorm';
import type { FindOptionsWhere } from 'typeorm';
import { In } from 'typeorm';
import * as Db from '@/Db';
import config from '@/config';
import type { SharedCredentials } from '@db/entities/SharedCredentials';

View file

@ -1,15 +1,16 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { In } from 'typeorm';
import express from 'express';
import type express from 'express';
import { compare, genSaltSync, hash } from 'bcryptjs';
import * as Db from '@/Db';
import * as ResponseHelper from '@/ResponseHelper';
import type { PublicUser, WhereClause } from '@/Interfaces';
import { MAX_PASSWORD_LENGTH, MIN_PASSWORD_LENGTH, User } from '@db/entities/User';
import { Role } from '@db/entities/Role';
import { AuthenticatedRequest } from '@/requests';
import type { User } from '@db/entities/User';
import { MAX_PASSWORD_LENGTH, MIN_PASSWORD_LENGTH } from '@db/entities/User';
import type { Role } from '@db/entities/Role';
import type { AuthenticatedRequest } from '@/requests';
import config from '@/config';
import { getWebhookBaseUrl } from '@/WebhookHelpers';
import { getLicense } from '@/License';

View file

@ -1,8 +1,9 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { createTransport, Transporter } from 'nodemailer';
import type { Transporter } from 'nodemailer';
import { createTransport } from 'nodemailer';
import { ErrorReporterProxy as ErrorReporter, LoggerProxy as Logger } from 'n8n-workflow';
import config from '@/config';
import { MailData, SendEmailResult, UserManagementMailerImplementation } from './Interfaces';
import type { MailData, SendEmailResult, UserManagementMailerImplementation } from './Interfaces';
export class NodeMailer implements UserManagementMailerImplementation {
private transport?: Transporter;

View file

@ -4,7 +4,7 @@ import Handlebars from 'handlebars';
import { join as pathJoin } from 'path';
import * as GenericHelpers from '@/GenericHelpers';
import config from '@/config';
import {
import type {
InviteEmailData,
PasswordResetData,
SendEmailResult,

View file

@ -10,14 +10,15 @@ import {
LoggerProxy as Logger,
WorkflowOperationError,
} from 'n8n-workflow';
import { FindManyOptions, LessThanOrEqual, ObjectLiteral } from 'typeorm';
import type { FindManyOptions, ObjectLiteral } from 'typeorm';
import { LessThanOrEqual } from 'typeorm';
import { DateUtils } from 'typeorm/util/DateUtils';
import * as Db from '@/Db';
import * as ResponseHelper from '@/ResponseHelper';
import * as GenericHelpers from '@/GenericHelpers';
import * as ActiveExecutions from '@/ActiveExecutions';
import {
import type {
DatabaseType,
IExecutionFlattedDb,
IExecutionsStopData,

View file

@ -1,21 +1,16 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable no-param-reassign */
import {
INode,
NodeHelpers,
WebhookHttpMethod,
Workflow,
LoggerProxy as Logger,
} from 'n8n-workflow';
import type { INode, WebhookHttpMethod } from 'n8n-workflow';
import { NodeHelpers, Workflow, LoggerProxy as Logger } from 'n8n-workflow';
import express from 'express';
import type express from 'express';
import * as Db from '@/Db';
import * as ResponseHelper from '@/ResponseHelper';
import * as WebhookHelpers from '@/WebhookHelpers';
import { NodeTypes } from '@/NodeTypes';
import { IExecutionResponse, IResponseCallbackData, IWorkflowDb } from '@/Interfaces';
import type { IExecutionResponse, IResponseCallbackData, IWorkflowDb } from '@/Interfaces';
import * as WorkflowExecuteAdditionalData from '@/WorkflowExecuteAdditionalData';
import { getWorkflowOwner } from '@/UserManagement/UserManagementHelper';

View file

@ -13,13 +13,12 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable prefer-destructuring */
import express from 'express';
import type express from 'express';
import get from 'lodash.get';
import { BINARY_ENCODING, BinaryDataManager, NodeExecuteFunctions, eventEmitter } from 'n8n-core';
import {
createDeferredPromise,
import type {
IBinaryKeyData,
IDataObject,
IDeferredPromise,
@ -32,14 +31,17 @@ import {
IWebhookResponseData,
IWorkflowDataProxyAdditionalKeys,
IWorkflowExecuteAdditionalData,
ErrorReporterProxy as ErrorReporter,
LoggerProxy as Logger,
NodeHelpers,
Workflow,
WorkflowExecuteMode,
} from 'n8n-workflow';
import {
createDeferredPromise,
ErrorReporterProxy as ErrorReporter,
LoggerProxy as Logger,
NodeHelpers,
} from 'n8n-workflow';
import type {
IExecutionDb,
IResponseCallbackData,
IWorkflowDb,
@ -51,8 +53,8 @@ import * as WorkflowHelpers from '@/WorkflowHelpers';
import { WorkflowRunner } from '@/WorkflowRunner';
import * as WorkflowExecuteAdditionalData from '@/WorkflowExecuteAdditionalData';
import * as ActiveExecutions from '@/ActiveExecutions';
import { User } from '@db/entities/User';
import { WorkflowEntity } from '@db/entities/WorkflowEntity';
import type { User } from '@db/entities/User';
import type { WorkflowEntity } from '@db/entities/WorkflowEntity';
import { getWorkflowOwner } from '@/UserManagement/UserManagementHelper';
export const WEBHOOK_METHODS = ['DELETE', 'GET', 'HEAD', 'PATCH', 'POST', 'PUT'];

View file

@ -1,5 +1,5 @@
/* eslint-disable no-prototype-builtins */
import { INode, IWorkflowCredentials } from 'n8n-workflow';
import type { INode, IWorkflowCredentials } from 'n8n-workflow';
import * as Db from '@/Db';
// eslint-disable-next-line @typescript-eslint/naming-convention

View file

@ -17,7 +17,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { BinaryDataManager, eventEmitter, UserSettings, WorkflowExecute } from 'n8n-core';
import {
import type {
IDataObject,
IExecuteData,
IExecuteWorkflowInfo,
@ -32,10 +32,12 @@ import {
IWorkflowExecuteHooks,
IWorkflowHooksOptionalParameters,
IWorkflowSettings,
WorkflowExecuteMode,
} from 'n8n-workflow';
import {
ErrorReporterProxy as ErrorReporter,
LoggerProxy as Logger,
Workflow,
WorkflowExecuteMode,
WorkflowHooks,
} from 'n8n-workflow';
@ -46,7 +48,7 @@ import * as Db from '@/Db';
import * as ActiveExecutions from '@/ActiveExecutions';
import { CredentialsHelper } from '@/CredentialsHelper';
import { ExternalHooks } from '@/ExternalHooks';
import {
import type {
IExecutionDb,
IExecutionFlattedDb,
IExecutionResponse,

View file

@ -1,5 +1,5 @@
import { In } from 'typeorm';
import {
import type {
IDataObject,
IExecuteData,
INode,
@ -7,22 +7,28 @@ import {
IRun,
IRunExecutionData,
ITaskData,
NodeApiError,
WorkflowExecuteMode,
} from 'n8n-workflow';
import {
ErrorReporterProxy as ErrorReporter,
LoggerProxy as Logger,
NodeApiError,
NodeOperationError,
Workflow,
WorkflowExecuteMode,
} from 'n8n-workflow';
import { v4 as uuid } from 'uuid';
import * as Db from '@/Db';
import { ICredentialsDb, IWorkflowErrorData, IWorkflowExecutionDataProcess } from '@/Interfaces';
import type {
ICredentialsDb,
IWorkflowErrorData,
IWorkflowExecutionDataProcess,
} from '@/Interfaces';
import { NodeTypes } from '@/NodeTypes';
import { WorkflowRunner } from '@/WorkflowRunner';
import config from '@/config';
import { WorkflowEntity } from '@db/entities/WorkflowEntity';
import { User } from '@db/entities/User';
import type { WorkflowEntity } from '@db/entities/WorkflowEntity';
import type { User } from '@db/entities/User';
import { getWorkflowOwner, whereClause } from '@/UserManagement/UserManagementHelper';
import omit from 'lodash.omit';

View file

@ -11,18 +11,21 @@
/* eslint-disable no-param-reassign */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/no-unused-vars */
import { BinaryDataManager, IProcessMessage, WorkflowExecute } from 'n8n-core';
import type { IProcessMessage } from 'n8n-core';
import { BinaryDataManager, WorkflowExecute } from 'n8n-core';
import {
ErrorReporterProxy as ErrorReporter,
import type {
ExecutionError,
IDeferredPromise,
IExecuteResponsePromiseData,
IRun,
LoggerProxy as Logger,
Workflow,
WorkflowExecuteMode,
WorkflowHooks,
} from 'n8n-workflow';
import {
ErrorReporterProxy as ErrorReporter,
LoggerProxy as Logger,
Workflow,
WorkflowOperationError,
} from 'n8n-workflow';
@ -34,7 +37,7 @@ import * as ActiveExecutions from '@/ActiveExecutions';
import config from '@/config';
import * as Db from '@/Db';
import { ExternalHooks } from '@/ExternalHooks';
import {
import type {
IExecutionFlattedDb,
IProcessMessageDataHook,
IWorkflowExecutionDataProcess,

View file

@ -7,10 +7,10 @@
/* eslint-disable @typescript-eslint/no-use-before-define */
/* eslint-disable @typescript-eslint/unbound-method */
import 'source-map-support/register';
import { BinaryDataManager, IProcessMessage, UserSettings, WorkflowExecute } from 'n8n-core';
import type { IProcessMessage } from 'n8n-core';
import { BinaryDataManager, UserSettings, WorkflowExecute } from 'n8n-core';
import {
ErrorReporterProxy as ErrorReporter,
import type {
ExecutionError,
IDataObject,
IExecuteResponsePromiseData,
@ -23,10 +23,13 @@ import {
IWorkflowExecuteAdditionalData,
IWorkflowExecuteHooks,
IWorkflowSettings,
LoggerProxy,
NodeOperationError,
Workflow,
WorkflowExecuteMode,
} from 'n8n-workflow';
import {
ErrorReporterProxy as ErrorReporter,
LoggerProxy,
Workflow,
WorkflowHooks,
WorkflowOperationError,
} from 'n8n-workflow';
@ -34,7 +37,10 @@ import { CredentialTypes } from '@/CredentialTypes';
import { CredentialsOverwrites } from '@/CredentialsOverwrites';
import * as Db from '@/Db';
import { ExternalHooks } from '@/ExternalHooks';
import { IWorkflowExecuteProcess, IWorkflowExecutionDataProcessWithExecution } from '@/Interfaces';
import type {
IWorkflowExecuteProcess,
IWorkflowExecutionDataProcessWithExecution,
} from '@/Interfaces';
import { NodeTypes } from '@/NodeTypes';
import { LoadNodesAndCredentials } from '@/LoadNodesAndCredentials';
import * as WebhookHelpers from '@/WebhookHelpers';

View file

@ -9,7 +9,7 @@ import bodyParser from 'body-parser';
import { v4 as uuid } from 'uuid';
import config from '@/config';
import * as Db from '@/Db';
import { Role } from '@db/entities/Role';
import type { Role } from '@db/entities/Role';
import { hashPassword } from '@/UserManagement/UserManagementHelper';
import { eventBus } from '@/eventbus/MessageEventBus/MessageEventBus';

View file

@ -1,5 +1,5 @@
import express from 'express';
import { PublicInstalledPackage } from 'n8n-workflow';
import type { PublicInstalledPackage } from 'n8n-workflow';
import config from '@/config';
import { InternalHooksManager } from '@/InternalHooksManager';
@ -31,7 +31,7 @@ import {
} from '@/constants';
import { isAuthenticatedRequest } from '@/UserManagement/UserManagementHelper';
import { InstalledPackages } from '@db/entities/InstalledPackages';
import type { InstalledPackages } from '@db/entities/InstalledPackages';
import type { CommunityPackages } from '@/Interfaces';
import type { NodeRequest } from '@/requests';

View file

@ -9,13 +9,13 @@ import express from 'express';
import * as Db from '@/Db';
import { ExternalHooks } from '@/ExternalHooks';
import { IExternalHooksClass, ITagWithCountDb } from '@/Interfaces';
import type { IExternalHooksClass, ITagWithCountDb } from '@/Interfaces';
import * as ResponseHelper from '@/ResponseHelper';
import config from '@/config';
import * as TagHelpers from '@/TagHelpers';
import { validateEntity } from '@/GenericHelpers';
import { TagEntity } from '@db/entities/TagEntity';
import { TagsRequest } from '@/requests';
import type { TagsRequest } from '@/requests';
export const externalHooks: IExternalHooksClass = ExternalHooks();

View file

@ -1,4 +1,4 @@
import { User } from '@db/entities/User';
import type { User } from '@db/entities/User';
import { whereClause } from '@/UserManagement/UserManagementHelper';
import express from 'express';
import { LoggerProxy } from 'n8n-workflow';
@ -11,7 +11,7 @@ import type {
} from '@/Interfaces';
import { StatisticsNames } from '../databases/entities/WorkflowStatistics';
import { getLogger } from '../Logger';
import { ExecutionRequest } from '../requests';
import type { ExecutionRequest } from '../requests';
export const workflowStatsController = express.Router();

View file

@ -1,4 +1,5 @@
import { FindOperator, MoreThanOrEqual } from 'typeorm';
import type { FindOperator } from 'typeorm';
import { MoreThanOrEqual } from 'typeorm';
import { DateUtils } from 'typeorm/util/DateUtils';
import * as Db from '@/Db';
import config from '@/config';

View file

@ -1,12 +1,12 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import jwt from 'jsonwebtoken';
import { Response } from 'express';
import type { Response } from 'express';
import { createHash } from 'crypto';
import * as Db from '@/Db';
import { AUTH_COOKIE_NAME } from '@/constants';
import { JwtPayload, JwtToken } from '@/Interfaces';
import { User } from '@db/entities/User';
import type { JwtPayload, JwtToken } from '@/Interfaces';
import type { User } from '@db/entities/User';
import config from '@/config';
import * as ResponseHelper from '@/ResponseHelper';

View file

@ -1,6 +1,7 @@
import { Command } from '@oclif/core';
import { LoggerProxy } from 'n8n-workflow';
import { getLogger, Logger } from '@/Logger';
import type { Logger } from '@/Logger';
import { getLogger } from '@/Logger';
import { User } from '@db/entities/User';
import * as Db from '@/Db';
import { inTest } from '@/constants';

View file

@ -1,7 +1,8 @@
import Command, { flags } from '@oclif/command';
import { LoggerProxy } from 'n8n-workflow';
import { UserSettings } from 'n8n-core';
import { getLogger, Logger } from '@/Logger';
import type { Logger } from '@/Logger';
import { getLogger } from '@/Logger';
import { audit } from '@/audit';
import { RISK_CATEGORIES } from '@/audit/constants';
import { CredentialTypes } from '@/CredentialTypes';

View file

@ -1,7 +1,8 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable no-console */
import { Command, flags } from '@oclif/command';
import { DataSource as Connection, DataSourceOptions as ConnectionOptions } from 'typeorm';
import type { DataSourceOptions as ConnectionOptions } from 'typeorm';
import { DataSource as Connection } from 'typeorm';
import { LoggerProxy } from 'n8n-workflow';
import { getLogger } from '@/Logger';

View file

@ -4,7 +4,8 @@
import { promises as fs } from 'fs';
import { Command, flags } from '@oclif/command';
import { BinaryDataManager, UserSettings, PLACEHOLDER_EMPTY_WORKFLOW_ID } from 'n8n-core';
import { LoggerProxy, IWorkflowBase } from 'n8n-workflow';
import type { IWorkflowBase } from 'n8n-workflow';
import { LoggerProxy } from 'n8n-workflow';
import * as ActiveExecutions from '@/ActiveExecutions';
import { CredentialsOverwrites } from '@/CredentialsOverwrites';
@ -16,7 +17,7 @@ import { NodeTypes } from '@/NodeTypes';
import { InternalHooksManager } from '@/InternalHooksManager';
import * as WorkflowHelpers from '@/WorkflowHelpers';
import { WorkflowRunner } from '@/WorkflowRunner';
import { IWorkflowExecutionDataProcess } from '@/Interfaces';
import type { IWorkflowExecutionDataProcess } from '@/Interfaces';
import { getLogger } from '@/Logger';
import config from '@/config';
import { getInstanceOwner } from '@/UserManagement/UserManagementHelper';

View file

@ -11,7 +11,8 @@ import { Command, flags } from '@oclif/command';
import { BinaryDataManager, UserSettings } from 'n8n-core';
import { ITaskData, LoggerProxy, sleep } from 'n8n-workflow';
import type { ITaskData } from 'n8n-workflow';
import { LoggerProxy, sleep } from 'n8n-workflow';
import { sep } from 'path';
@ -29,9 +30,9 @@ import { LoadNodesAndCredentials } from '@/LoadNodesAndCredentials';
import { NodeTypes } from '@/NodeTypes';
import { InternalHooksManager } from '@/InternalHooksManager';
import { WorkflowRunner } from '@/WorkflowRunner';
import { IWorkflowDb, IWorkflowExecutionDataProcess } from '@/Interfaces';
import type { IWorkflowDb, IWorkflowExecutionDataProcess } from '@/Interfaces';
import config from '@/config';
import { User } from '@db/entities/User';
import type { User } from '@db/entities/User';
import { getInstanceOwner } from '@/UserManagement/UserManagementHelper';
import { findCliWorkflowStart } from '@/utils';
import { initEvents } from '@/events';

View file

@ -6,7 +6,8 @@ import { Command, flags } from '@oclif/command';
import { Credentials, UserSettings } from 'n8n-core';
import { IDataObject, LoggerProxy } from 'n8n-workflow';
import type { IDataObject } from 'n8n-workflow';
import { LoggerProxy } from 'n8n-workflow';
import fs from 'fs';
import path from 'path';

View file

@ -3,7 +3,8 @@
/* eslint-disable no-console */
import { Command, flags } from '@oclif/command';
import { IDataObject, LoggerProxy } from 'n8n-workflow';
import type { IDataObject } from 'n8n-workflow';
import { LoggerProxy } from 'n8n-workflow';
import fs from 'fs';
import path from 'path';

View file

@ -15,9 +15,9 @@ import type { EntityManager } from 'typeorm';
import { getLogger } from '@/Logger';
import config from '@/config';
import * as Db from '@/Db';
import { User } from '@db/entities/User';
import type { User } from '@db/entities/User';
import { SharedCredentials } from '@db/entities/SharedCredentials';
import { Role } from '@db/entities/Role';
import type { Role } from '@db/entities/Role';
import { CredentialsEntity } from '@db/entities/CredentialsEntity';
import { disableAutoGeneratedIds } from '@db/utils/commandHelpers';

View file

@ -10,7 +10,8 @@
/* eslint-disable no-console */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { Command, flags } from '@oclif/command';
import { INode, INodeCredentialsDetails, LoggerProxy } from 'n8n-workflow';
import type { INode, INodeCredentialsDetails } from 'n8n-workflow';
import { LoggerProxy } from 'n8n-workflow';
import fs from 'fs';
import glob from 'fast-glob';
import { UserSettings } from 'n8n-core';
@ -21,8 +22,8 @@ import config from '@/config';
import * as Db from '@/Db';
import { SharedWorkflow } from '@db/entities/SharedWorkflow';
import { WorkflowEntity } from '@db/entities/WorkflowEntity';
import { Role } from '@db/entities/Role';
import { User } from '@db/entities/User';
import type { Role } from '@db/entities/Role';
import type { User } from '@db/entities/User';
import { setTagsForImport } from '@/TagHelpers';
import type { ICredentialsDb, IWorkflowToImport } from '@/Interfaces';
import { disableAutoGeneratedIds } from '@db/utils/commandHelpers';

View file

@ -2,7 +2,7 @@
/* eslint-disable no-console */
import { Command, flags } from '@oclif/command';
import { IDataObject } from 'n8n-workflow';
import type { IDataObject } from 'n8n-workflow';
import * as Db from '@/Db';

View file

@ -28,7 +28,7 @@ import { LoadNodesAndCredentials } from '@/LoadNodesAndCredentials';
import { NodeTypes } from '@/NodeTypes';
import { InternalHooksManager } from '@/InternalHooksManager';
import * as Server from '@/Server';
import { DatabaseType } from '@/Interfaces';
import type { DatabaseType } from '@/Interfaces';
import * as TestWebhooks from '@/TestWebhooks';
import { WaitTracker } from '@/WaitTracker';

View file

@ -3,7 +3,8 @@
/* eslint-disable no-console */
import { Command, flags } from '@oclif/command';
import { IDataObject, LoggerProxy } from 'n8n-workflow';
import type { IDataObject } from 'n8n-workflow';
import { LoggerProxy } from 'n8n-workflow';
import * as Db from '@/Db';

View file

@ -1,6 +1,6 @@
import { Not } from 'typeorm';
import * as Db from '@/Db';
import { CredentialsEntity } from '@db/entities/CredentialsEntity';
import type { CredentialsEntity } from '@db/entities/CredentialsEntity';
import { BaseCommand } from '../BaseCommand';
export class Reset extends BaseCommand {

View file

@ -5,20 +5,13 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import express from 'express';
import http from 'http';
import PCancelable from 'p-cancelable';
import type PCancelable from 'p-cancelable';
import { Command, flags } from '@oclif/command';
import { BinaryDataManager, UserSettings, WorkflowExecute } from 'n8n-core';
import {
IExecuteResponsePromiseData,
INodeTypes,
IRun,
Workflow,
LoggerProxy,
ErrorReporterProxy as ErrorReporter,
sleep,
} from 'n8n-workflow';
import type { IExecuteResponsePromiseData, INodeTypes, IRun } from 'n8n-workflow';
import { Workflow, LoggerProxy, ErrorReporterProxy as ErrorReporter, sleep } from 'n8n-workflow';
import { CredentialsOverwrites } from '@/CredentialsOverwrites';
import { CredentialTypes } from '@/CredentialTypes';

View file

@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable @typescript-eslint/no-unused-vars */
import { IBinaryDataConfig } from 'n8n-core';
import { schema } from './schema';
import type { IBinaryDataConfig } from 'n8n-core';
import type { schema } from './schema';
// -----------------------------------
// transformers

View file

@ -3,11 +3,8 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { readFileSync } from 'fs';
import { resolve, join, dirname } from 'path';
import {
n8n,
RESPONSE_ERROR_MESSAGES as CORE_RESPONSE_ERROR_MESSAGES,
UserSettings,
} from 'n8n-core';
import type { n8n } from 'n8n-core';
import { RESPONSE_ERROR_MESSAGES as CORE_RESPONSE_ERROR_MESSAGES, UserSettings } from 'n8n-core';
import { jsonParse } from 'n8n-workflow';
const { NODE_ENV, E2E_TESTS } = process.env;

View file

@ -4,11 +4,12 @@ import { AuthError, BadRequestError, InternalServerError } from '@/ResponseHelpe
import { sanitizeUser } from '@/UserManagement/UserManagementHelper';
import { issueCookie, resolveJwt } from '@/auth/jwt';
import { AUTH_COOKIE_NAME } from '@/constants';
import type { Request, Response } from 'express';
import { Request, Response } from 'express';
import type { ILogger } from 'n8n-workflow';
import type { User } from '@db/entities/User';
import type { LoginRequest, UserRequest } from '@/requests';
import { In, Repository } from 'typeorm';
import { LoginRequest, UserRequest } from '@/requests';
import type { Repository } from 'typeorm';
import { In } from 'typeorm';
import type { Config } from '@/config';
import type { PublicUser, IDatabaseCollections, IInternalHooksClass } from '@/Interfaces';
import { handleEmailLogin, handleLdapLogin } from '@/auth';

View file

@ -10,10 +10,10 @@ import { BadRequestError } from '@/ResponseHelper';
import { User } from '@db/entities/User';
import { validateEntity } from '@/GenericHelpers';
import { issueCookie } from '@/auth/jwt';
import type { Response } from 'express';
import { Response } from 'express';
import type { Repository } from 'typeorm';
import type { ILogger } from 'n8n-workflow';
import type { AuthenticatedRequest, MeRequest } from '@/requests';
import { AuthenticatedRequest, MeRequest } from '@/requests';
import type {
PublicUser,
IDatabaseCollections,

View file

@ -8,11 +8,11 @@ import {
validatePassword,
} from '@/UserManagement/UserManagementHelper';
import { issueCookie } from '@/auth/jwt';
import type { Response } from 'express';
import { Response } from 'express';
import type { Repository } from 'typeorm';
import type { ILogger } from 'n8n-workflow';
import type { Config } from '@/config';
import type { OwnerRequest } from '@/requests';
import { OwnerRequest } from '@/requests';
import type { IDatabaseCollections, IInternalHooksClass } from '@/Interfaces';
import type { Settings } from '@db/entities/Settings';
import type { User } from '@db/entities/User';

View file

@ -1,4 +1,5 @@
import { IsNull, MoreThanOrEqual, Not, Repository } from 'typeorm';
import type { Repository } from 'typeorm';
import { IsNull, MoreThanOrEqual, Not } from 'typeorm';
import { v4 as uuid } from 'uuid';
import validator from 'validator';
import { Get, Post, RestController } from '@/decorators';
@ -15,11 +16,11 @@ import {
} from '@/UserManagement/UserManagementHelper';
import * as UserManagementMailer from '@/UserManagement/email';
import type { Response } from 'express';
import { Response } from 'express';
import type { ILogger } from 'n8n-workflow';
import type { Config } from '@/config';
import type { User } from '@db/entities/User';
import type { PasswordResetRequest } from '@/requests';
import { PasswordResetRequest } from '@/requests';
import type { IDatabaseCollections, IExternalHooksClass, IInternalHooksClass } from '@/Interfaces';
import { issueCookie } from '@/auth/jwt';
import { isLdapEnabled } from '@/Ldap/helpers';

View file

@ -1,6 +1,8 @@
import validator from 'validator';
import { In, Repository } from 'typeorm';
import { ErrorReporterProxy as ErrorReporter, ILogger } from 'n8n-workflow';
import type { Repository } from 'typeorm';
import { In } from 'typeorm';
import type { ILogger } from 'n8n-workflow';
import { ErrorReporterProxy as ErrorReporter } from 'n8n-workflow';
import { User } from '@db/entities/User';
import { SharedCredentials } from '@db/entities/SharedCredentials';
import { SharedWorkflow } from '@db/entities/SharedWorkflow';
@ -17,9 +19,9 @@ import {
} from '@/UserManagement/UserManagementHelper';
import { issueCookie } from '@/auth/jwt';
import { BadRequestError, InternalServerError, NotFoundError } from '@/ResponseHelper';
import type { Response } from 'express';
import { Response } from 'express';
import type { Config } from '@/config';
import type { UserRequest } from '@/requests';
import { UserRequest } from '@/requests';
import type { UserManagementMailer } from '@/UserManagement/email';
import type { Role } from '@db/entities/Role';
import type {

View file

@ -1,5 +1,6 @@
import express from 'express';
import { deepCopy, INodeCredentialTestResult, LoggerProxy } from 'n8n-workflow';
import type { INodeCredentialTestResult } from 'n8n-workflow';
import { deepCopy, LoggerProxy } from 'n8n-workflow';
import * as Db from '@/Db';
import { InternalHooksManager } from '@/InternalHooksManager';
import * as ResponseHelper from '@/ResponseHelper';

View file

@ -1,7 +1,8 @@
/* eslint-disable no-param-reassign */
/* eslint-disable @typescript-eslint/no-unused-vars */
import express from 'express';
import { deepCopy, INodeCredentialTestResult, LoggerProxy } from 'n8n-workflow';
import type { INodeCredentialTestResult } from 'n8n-workflow';
import { deepCopy, LoggerProxy } from 'n8n-workflow';
import * as GenericHelpers from '@/GenericHelpers';
import { InternalHooksManager } from '@/InternalHooksManager';

View file

@ -1,10 +1,11 @@
/* eslint-disable no-param-reassign */
import { DeleteResult, EntityManager, FindOptionsWhere, In, Not } from 'typeorm';
import type { DeleteResult, EntityManager, FindOptionsWhere } from 'typeorm';
import { In, Not } from 'typeorm';
import * as Db from '@/Db';
import { RoleService } from '@/role/role.service';
import { CredentialsEntity } from '@db/entities/CredentialsEntity';
import { SharedCredentials } from '@db/entities/SharedCredentials';
import { User } from '@db/entities/User';
import type { User } from '@db/entities/User';
import { UserService } from '@/user/user.service';
import { CredentialsService } from './credentials.service';
import type { CredentialWithSharings } from './credentials.types';

View file

@ -1,20 +1,19 @@
/* eslint-disable no-restricted-syntax */
import { Credentials, UserSettings } from 'n8n-core';
import {
deepCopy,
import type {
ICredentialDataDecryptedObject,
ICredentialsDecrypted,
ICredentialType,
INodeCredentialTestResult,
INodeProperties,
LoggerProxy,
NodeHelpers,
} from 'n8n-workflow';
import { FindManyOptions, FindOptionsWhere, In } from 'typeorm';
import { deepCopy, LoggerProxy, NodeHelpers } from 'n8n-workflow';
import type { FindManyOptions, FindOptionsWhere } from 'typeorm';
import { In } from 'typeorm';
import * as Db from '@/Db';
import * as ResponseHelper from '@/ResponseHelper';
import { ICredentialsDb } from '@/Interfaces';
import type { ICredentialsDb } from '@/Interfaces';
import { CredentialsHelper, createCredentialsFromCredentialsEntity } from '@/CredentialsHelper';
import { CREDENTIAL_BLANKING_VALUE, RESPONSE_ERROR_MESSAGES } from '@/constants';
import { CredentialsEntity } from '@db/entities/CredentialsEntity';

View file

@ -7,18 +7,18 @@ import set from 'lodash.set';
import split from 'lodash.split';
import unset from 'lodash.unset';
import { Credentials, UserSettings } from 'n8n-core';
import {
LoggerProxy,
import type {
WorkflowExecuteMode,
INodeCredentialsDetails,
ICredentialsEncrypted,
IDataObject,
} from 'n8n-workflow';
import { LoggerProxy } from 'n8n-workflow';
import { resolve as pathResolve } from 'path';
import * as Db from '@/Db';
import * as ResponseHelper from '@/ResponseHelper';
import { ICredentialsDb } from '@/Interfaces';
import type { ICredentialsDb } from '@/Interfaces';
import { RESPONSE_ERROR_MESSAGES, TEMPLATES_DIR } from '@/constants';
import {
CredentialsHelper,
@ -26,7 +26,7 @@ import {
getCredentialWithoutUser,
} from '@/CredentialsHelper';
import { getLogger } from '@/Logger';
import { OAuthRequest } from '@/requests';
import type { OAuthRequest } from '@/requests';
import { ExternalHooks } from '@/ExternalHooks';
import config from '@/config';
import { getInstanceBaseUrl } from '@/UserManagement/UserManagementHelper';

View file

@ -1,7 +1,8 @@
import type { WorkflowExecuteMode } from 'n8n-workflow';
import { WorkflowExecuteMode } from 'n8n-workflow';
import { Column, Entity, Generated, Index, PrimaryColumn } from 'typeorm';
import { datetimeColumnType, jsonColumnType } from './AbstractEntity';
import type { IExecutionFlattedDb, IWorkflowDb } from '@/Interfaces';
import { IWorkflowDb } from '@/Interfaces';
import type { IExecutionFlattedDb } from '@/Interfaces';
import { idStringifier } from '../utils/transformers';
@Entity()

View file

@ -1,5 +1,5 @@
import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn } from 'typeorm';
import type { InstalledPackages } from './InstalledPackages';
import { InstalledPackages } from './InstalledPackages';
@Entity()
export class InstalledNodes {

View file

@ -1,7 +1,7 @@
import { Column, Entity, ManyToOne, PrimaryColumn } from 'typeorm';
import type { CredentialsEntity } from './CredentialsEntity';
import type { User } from './User';
import type { Role } from './Role';
import { CredentialsEntity } from './CredentialsEntity';
import { User } from './User';
import { Role } from './Role';
import { AbstractEntity } from './AbstractEntity';
import { idStringifier } from '../utils/transformers';

View file

@ -1,7 +1,7 @@
import { Column, Entity, ManyToOne, PrimaryColumn } from 'typeorm';
import type { WorkflowEntity } from './WorkflowEntity';
import type { User } from './User';
import type { Role } from './Role';
import { WorkflowEntity } from './WorkflowEntity';
import { User } from './User';
import { Role } from './Role';
import { AbstractEntity } from './AbstractEntity';
import { idStringifier } from '../utils/transformers';

View file

@ -12,7 +12,7 @@ import {
} from 'typeorm';
import { IsEmail, IsString, Length } from 'class-validator';
import type { IUser } from 'n8n-workflow';
import type { Role } from './Role';
import { Role } from './Role';
import type { SharedWorkflow } from './SharedWorkflow';
import type { SharedCredentials } from './SharedCredentials';
import { NoXss } from '../utils/customValidators';

View file

@ -1,13 +1,7 @@
import { Length } from 'class-validator';
import type {
IBinaryKeyData,
IConnections,
IDataObject,
INode,
IPairedItemData,
IWorkflowSettings,
} from 'n8n-workflow';
import { IConnections, IDataObject, IWorkflowSettings } from 'n8n-workflow';
import type { IBinaryKeyData, INode, IPairedItemData } from 'n8n-workflow';
import {
Column,

View file

@ -1,7 +1,7 @@
import { Column, Entity, ManyToOne, PrimaryColumn } from 'typeorm';
import { idStringifier } from '../utils/transformers';
import { datetimeColumnType } from './AbstractEntity';
import type { WorkflowEntity } from './WorkflowEntity';
import { WorkflowEntity } from './WorkflowEntity';
export enum StatisticsNames {
productionSuccess = 'production_success',

View file

@ -1,5 +1,5 @@
import type { DateTime } from 'luxon';
import { EventMessageTypeNames } from 'n8n-workflow';
import type { EventMessageTypeNames } from 'n8n-workflow';
import type { AbstractEventPayload } from './AbstractEventPayload';
export interface AbstractEventMessageOptions {

View file

@ -1,7 +1,8 @@
import { AbstractEventMessage, isEventMessageOptionsWithType } from './AbstractEventMessage';
import { EventMessageTypeNames, JsonObject, JsonValue } from 'n8n-workflow';
import { AbstractEventPayload } from './AbstractEventPayload';
import { AbstractEventMessageOptions } from './AbstractEventMessageOptions';
import type { JsonObject, JsonValue } from 'n8n-workflow';
import { EventMessageTypeNames } from 'n8n-workflow';
import type { AbstractEventPayload } from './AbstractEventPayload';
import type { AbstractEventMessageOptions } from './AbstractEventMessageOptions';
export const eventNamesAudit = [
'n8n.audit.user.signedup',

View file

@ -1,5 +1,6 @@
import { DateTime } from 'luxon';
import { EventMessageTypeNames, JsonObject, JsonValue } from 'n8n-workflow';
import type { JsonObject, JsonValue } from 'n8n-workflow';
import { EventMessageTypeNames } from 'n8n-workflow';
export interface EventMessageConfirmSource extends JsonObject {
id: string;

View file

@ -1,4 +1,5 @@
import { EventMessageTypeNames, JsonObject } from 'n8n-workflow';
import type { JsonObject } from 'n8n-workflow';
import { EventMessageTypeNames } from 'n8n-workflow';
import { AbstractEventMessage, isEventMessageOptionsWithType } from './AbstractEventMessage';
import type { AbstractEventPayload } from './AbstractEventPayload';
import type { AbstractEventMessageOptions } from './AbstractEventMessageOptions';

View file

@ -1,5 +1,6 @@
import { AbstractEventMessage, isEventMessageOptionsWithType } from './AbstractEventMessage';
import { EventMessageTypeNames, JsonObject } from 'n8n-workflow';
import type { JsonObject } from 'n8n-workflow';
import { EventMessageTypeNames } from 'n8n-workflow';
import type { AbstractEventMessageOptions } from './AbstractEventMessageOptions';
import type { AbstractEventPayload } from './AbstractEventPayload';

View file

@ -1,8 +1,9 @@
import { AbstractEventMessage, isEventMessageOptionsWithType } from './AbstractEventMessage';
import { EventMessageTypeNames, IWorkflowBase, JsonObject } from 'n8n-workflow';
import type { IWorkflowBase, JsonObject } from 'n8n-workflow';
import { EventMessageTypeNames } from 'n8n-workflow';
import type { AbstractEventMessageOptions } from './AbstractEventMessageOptions';
import type { AbstractEventPayload } from './AbstractEventPayload';
import { IExecutionBase } from '@/Interfaces';
import type { IExecutionBase } from '@/Interfaces';
export const eventNamesWorkflow = [
'n8n.workflow.started',

View file

@ -1,10 +1,14 @@
import type { EventMessageTypes } from '.';
import { EventMessageGeneric, EventMessageGenericOptions } from './EventMessageGeneric';
import type { EventMessageGenericOptions } from './EventMessageGeneric';
import { EventMessageGeneric } from './EventMessageGeneric';
import type { AbstractEventMessageOptions } from './AbstractEventMessageOptions';
import { EventMessageWorkflow, EventMessageWorkflowOptions } from './EventMessageWorkflow';
import type { EventMessageWorkflowOptions } from './EventMessageWorkflow';
import { EventMessageWorkflow } from './EventMessageWorkflow';
import { EventMessageTypeNames } from 'n8n-workflow';
import { EventMessageAudit, EventMessageAuditOptions } from './EventMessageAudit';
import { EventMessageNode, EventMessageNodeOptions } from './EventMessageNode';
import type { EventMessageAuditOptions } from './EventMessageAudit';
import { EventMessageAudit } from './EventMessageAudit';
import type { EventMessageNodeOptions } from './EventMessageNode';
import { EventMessageNode } from './EventMessageNode';
export const getEventMessageObjectByType = (
message: AbstractEventMessageOptions,

View file

@ -1,11 +1,10 @@
import { EventMessageAudit, eventNamesAudit, EventNamesAuditType } from './EventMessageAudit';
import { EventMessageGeneric } from './EventMessageGeneric';
import { EventMessageNode, eventNamesNode, EventNamesNodeType } from './EventMessageNode';
import {
EventMessageWorkflow,
eventNamesWorkflow,
EventNamesWorkflowType,
} from './EventMessageWorkflow';
import type { EventMessageAudit, EventNamesAuditType } from './EventMessageAudit';
import { eventNamesAudit } from './EventMessageAudit';
import type { EventMessageGeneric } from './EventMessageGeneric';
import type { EventMessageNode, EventNamesNodeType } from './EventMessageNode';
import { eventNamesNode } from './EventMessageNode';
import type { EventMessageWorkflow, EventNamesWorkflowType } from './EventMessageWorkflow';
import { eventNamesWorkflow } from './EventMessageWorkflow';
export type EventNamesTypes = EventNamesAuditType | EventNamesWorkflowType | EventNamesNodeType;
export const eventNamesAll = [...eventNamesAudit, ...eventNamesWorkflow, ...eventNamesNode];

View file

@ -1,6 +1,7 @@
import { LoggerProxy, MessageEventBusDestinationOptions } from 'n8n-workflow';
import type { MessageEventBusDestinationOptions } from 'n8n-workflow';
import { LoggerProxy } from 'n8n-workflow';
import type { DeleteResult } from 'typeorm';
import { EventMessageTypes } from '../EventMessageClasses/';
import type { EventMessageTypes } from '../EventMessageClasses/';
import type { MessageEventBusDestination } from '../MessageEventBusDestination/MessageEventBusDestination.ee';
import { MessageEventBusLogWriter } from '../MessageEventBusWriter/MessageEventBusLogWriter';
import EventEmitter from 'events';
@ -11,17 +12,14 @@ import {
incrementPrometheusMetric,
} from '../MessageEventBusDestination/Helpers.ee';
import uniqby from 'lodash.uniqby';
import { EventMessageConfirmSource } from '../EventMessageClasses/EventMessageConfirm';
import {
EventMessageAuditOptions,
EventMessageAudit,
} from '../EventMessageClasses/EventMessageAudit';
import {
EventMessageWorkflowOptions,
EventMessageWorkflow,
} from '../EventMessageClasses/EventMessageWorkflow';
import type { EventMessageConfirmSource } from '../EventMessageClasses/EventMessageConfirm';
import type { EventMessageAuditOptions } from '../EventMessageClasses/EventMessageAudit';
import { EventMessageAudit } from '../EventMessageClasses/EventMessageAudit';
import type { EventMessageWorkflowOptions } from '../EventMessageClasses/EventMessageWorkflow';
import { EventMessageWorkflow } from '../EventMessageClasses/EventMessageWorkflow';
import { isLogStreamingEnabled } from './MessageEventBusHelper';
import { EventMessageNode, EventMessageNodeOptions } from '../EventMessageClasses/EventMessageNode';
import type { EventMessageNodeOptions } from '../EventMessageClasses/EventMessageNode';
import { EventMessageNode } from '../EventMessageClasses/EventMessageNode';
import {
EventMessageGeneric,
eventMessageGenericDestinationTestEvent,

View file

@ -1,13 +1,9 @@
import { v4 as uuid } from 'uuid';
import {
INodeCredentials,
LoggerProxy,
MessageEventBusDestinationOptions,
MessageEventBusDestinationTypeNames,
} from 'n8n-workflow';
import type { INodeCredentials, MessageEventBusDestinationOptions } from 'n8n-workflow';
import { LoggerProxy, MessageEventBusDestinationTypeNames } from 'n8n-workflow';
import * as Db from '@/Db';
import { AbstractEventMessage } from '../EventMessageClasses/AbstractEventMessage';
import { EventMessageTypes } from '../EventMessageClasses';
import type { AbstractEventMessage } from '../EventMessageClasses/AbstractEventMessage';
import type { EventMessageTypes } from '../EventMessageClasses';
import { eventBus } from '..';
import type { DeleteResult, InsertResult } from 'typeorm';

View file

@ -4,13 +4,13 @@
import { MessageEventBusDestination } from './MessageEventBusDestination.ee';
import * as Sentry from '@sentry/node';
import { eventBus } from '../MessageEventBus/MessageEventBus';
import {
import type {
MessageEventBusDestinationOptions,
MessageEventBusDestinationSentryOptions,
MessageEventBusDestinationTypeNames,
} from 'n8n-workflow';
import { MessageEventBusDestinationTypeNames } from 'n8n-workflow';
import { isLogStreamingEnabled } from '../MessageEventBus/MessageEventBusHelper';
import { EventMessageTypes } from '../EventMessageClasses';
import type { EventMessageTypes } from '../EventMessageClasses';
import { eventMessageGenericDestinationTestEvent } from '../EventMessageClasses/EventMessageGeneric';
import { N8N_VERSION } from '@/constants';

View file

@ -3,15 +3,14 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import syslog from 'syslog-client';
import { eventBus } from '../MessageEventBus/MessageEventBus';
import {
LoggerProxy,
import type {
MessageEventBusDestinationOptions,
MessageEventBusDestinationSyslogOptions,
MessageEventBusDestinationTypeNames,
} from 'n8n-workflow';
import { LoggerProxy, MessageEventBusDestinationTypeNames } from 'n8n-workflow';
import { MessageEventBusDestination } from './MessageEventBusDestination.ee';
import { isLogStreamingEnabled } from '../MessageEventBus/MessageEventBusHelper';
import { EventMessageTypes } from '../EventMessageClasses';
import type { EventMessageTypes } from '../EventMessageClasses';
import { eventMessageGenericDestinationTestEvent } from '../EventMessageClasses/EventMessageGeneric';
export const isMessageEventBusDestinationSyslogOptions = (

View file

@ -6,18 +6,17 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
import { MessageEventBusDestination } from './MessageEventBusDestination.ee';
import axios, { AxiosRequestConfig, Method } from 'axios';
import type { AxiosRequestConfig, Method } from 'axios';
import axios from 'axios';
import { eventBus } from '../MessageEventBus/MessageEventBus';
import { EventMessageTypes } from '../EventMessageClasses';
import {
jsonParse,
LoggerProxy,
import type { EventMessageTypes } from '../EventMessageClasses';
import type {
MessageEventBusDestinationOptions,
MessageEventBusDestinationTypeNames,
MessageEventBusDestinationWebhookOptions,
MessageEventBusDestinationWebhookParameterItem,
MessageEventBusDestinationWebhookParameterOptions,
} from 'n8n-workflow';
import { jsonParse, LoggerProxy, MessageEventBusDestinationTypeNames } from 'n8n-workflow';
import { CredentialsHelper } from '@/CredentialsHelper';
import { UserSettings } from 'n8n-core';
import { Agent as HTTPSAgent } from 'https';

View file

@ -12,9 +12,9 @@ import config from '@/config';
import { getEventMessageObjectByType } from '../EventMessageClasses/Helpers';
import type { EventMessageReturnMode } from '../MessageEventBus/MessageEventBus';
import type { EventMessageTypes } from '../EventMessageClasses';
import type { EventMessageConfirmSource } from '../EventMessageClasses/EventMessageConfirm';
import {
EventMessageConfirm,
EventMessageConfirmSource,
isEventMessageConfirm,
} from '../EventMessageClasses/EventMessageConfirm';
import { once as eventOnce } from 'events';

Some files were not shown because too many files have changed in this diff Show more