From 2ca959b383113bf1f2e99c7df9bec2fff7ae97d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Fri, 27 Jan 2023 14:56:56 +0100 Subject: [PATCH] refactor: Integrate `consistent-type-imports` in BE packages (no-changelog) (#5270) --- packages/cli/.eslintrc.js | 2 ++ packages/cli/src/AbstractServer.ts | 7 ++-- packages/cli/src/ActiveExecutions.ts | 12 +++---- packages/cli/src/ActiveWorkflowRunner.ts | 20 ++++++----- packages/cli/src/CommunityNodes/helpers.ts | 5 +-- .../cli/src/CommunityNodes/packageModel.ts | 3 +- packages/cli/src/CredentialsHelper.ts | 24 +++++++------- packages/cli/src/Db.ts | 8 ++--- packages/cli/src/ExternalHooks.ts | 6 +++- packages/cli/src/GenericHelpers.ts | 14 ++++---- packages/cli/src/InternalHooks.ts | 8 ++--- packages/cli/src/InternalHooksManager.ts | 2 +- packages/cli/src/Ldap/LdapService.ee.ts | 5 +-- packages/cli/src/Ldap/LdapSync.ee.ts | 2 +- packages/cli/src/Ldap/types.ts | 2 +- packages/cli/src/License.ts | 5 +-- packages/cli/src/LoadNodesAndCredentials.ts | 7 ++-- packages/cli/src/Logger.ts | 2 +- packages/cli/src/PublicApi/index.ts | 3 +- packages/cli/src/PublicApi/types.d.ts | 6 ++-- .../credentials/credentials.handler.ts | 8 ++--- .../credentials/credentials.middleware.ts | 4 +-- .../credentials/credentials.service.ts | 8 ++--- .../handlers/executions/executions.handler.ts | 4 +-- .../handlers/executions/executions.service.ts | 3 +- .../v1/handlers/users/users.service.ts | 4 +-- .../handlers/workflows/workflows.handler.ts | 7 ++-- .../handlers/workflows/workflows.service.ts | 7 ++-- .../shared/middlewares/global.middleware.ts | 4 +-- .../v1/shared/services/pagination.service.ts | 2 +- packages/cli/src/Queue.ts | 2 +- packages/cli/src/ResponseHelper.ts | 2 +- packages/cli/src/Server.ts | 19 ++++++----- packages/cli/src/TestWebhooks.ts | 6 ++-- packages/cli/src/TranslationHelpers.ts | 2 +- .../src/UserManagement/PermissionChecker.ts | 6 ++-- .../UserManagement/UserManagementHelper.ts | 9 ++--- .../src/UserManagement/email/NodeMailer.ts | 5 +-- .../email/UserManagementMailer.ts | 2 +- packages/cli/src/WaitTracker.ts | 5 +-- packages/cli/src/WaitingWebhooks.ts | 13 +++----- packages/cli/src/WebhookHelpers.ts | 20 ++++++----- packages/cli/src/WorkflowCredentials.ts | 2 +- .../cli/src/WorkflowExecuteAdditionalData.ts | 8 +++-- packages/cli/src/WorkflowHelpers.ts | 18 ++++++---- packages/cli/src/WorkflowRunner.ts | 15 +++++---- packages/cli/src/WorkflowRunnerProcess.ts | 18 ++++++---- packages/cli/src/api/e2e.api.ts | 2 +- packages/cli/src/api/nodes.api.ts | 4 +-- packages/cli/src/api/tags.api.ts | 4 +-- packages/cli/src/api/workflowStats.api.ts | 4 +-- .../cli/src/audit/risks/credentials.risk.ts | 3 +- packages/cli/src/auth/jwt.ts | 6 ++-- packages/cli/src/commands/BaseCommand.ts | 3 +- packages/cli/src/commands/audit.ts | 3 +- packages/cli/src/commands/db/revert.ts | 3 +- packages/cli/src/commands/execute.ts | 5 +-- packages/cli/src/commands/executeBatch.ts | 7 ++-- .../cli/src/commands/export/credentials.ts | 3 +- packages/cli/src/commands/export/workflow.ts | 3 +- .../cli/src/commands/import/credentials.ts | 4 +-- packages/cli/src/commands/import/workflow.ts | 7 ++-- packages/cli/src/commands/list/workflow.ts | 2 +- packages/cli/src/commands/start.ts | 2 +- packages/cli/src/commands/update/workflow.ts | 3 +- .../cli/src/commands/user-management/reset.ts | 2 +- packages/cli/src/commands/worker.ts | 13 ++------ packages/cli/src/config/types.d.ts | 4 +-- packages/cli/src/constants.ts | 7 ++-- .../cli/src/controllers/auth.controller.ts | 7 ++-- packages/cli/src/controllers/me.controller.ts | 4 +-- .../cli/src/controllers/owner.controller.ts | 4 +-- .../controllers/passwordReset.controller.ts | 7 ++-- .../cli/src/controllers/users.controller.ts | 10 +++--- .../credentials/credentials.controller.ee.ts | 3 +- .../src/credentials/credentials.controller.ts | 3 +- .../src/credentials/credentials.service.ee.ts | 5 +-- .../src/credentials/credentials.service.ts | 11 +++---- .../src/credentials/oauth2Credential.api.ts | 8 ++--- .../src/databases/entities/ExecutionEntity.ts | 5 +-- .../src/databases/entities/InstalledNodes.ts | 2 +- .../databases/entities/SharedCredentials.ts | 6 ++-- .../src/databases/entities/SharedWorkflow.ts | 6 ++-- packages/cli/src/databases/entities/User.ts | 2 +- .../src/databases/entities/WorkflowEntity.ts | 10 ++---- .../databases/entities/WorkflowStatistics.ts | 2 +- .../AbstractEventMessageOptions.ts | 2 +- .../EventMessageClasses/EventMessageAudit.ts | 7 ++-- .../EventMessageConfirm.ts | 3 +- .../EventMessageGeneric.ts | 3 +- .../EventMessageClasses/EventMessageNode.ts | 3 +- .../EventMessageWorkflow.ts | 5 +-- .../eventbus/EventMessageClasses/Helpers.ts | 12 ++++--- .../src/eventbus/EventMessageClasses/index.ts | 15 ++++----- .../MessageEventBus/MessageEventBus.ts | 22 ++++++------- .../MessageEventBusDestination.ee.ts | 12 +++---- .../MessageEventBusDestinationSentry.ee.ts | 6 ++-- .../MessageEventBusDestinationSyslog.ee.ts | 7 ++-- .../MessageEventBusDestinationWebhook.ee.ts | 11 +++---- .../MessageEventBusLogWriter.ts | 2 +- packages/cli/src/eventbus/eventBusRoutes.ts | 25 +++++++------- packages/cli/src/events/WorkflowStatistics.ts | 2 +- .../executions/executions.controller.ee.ts | 2 +- .../src/executions/executions.controller.ts | 2 +- .../src/executions/executions.service.ee.ts | 2 +- .../cli/src/executions/executions.service.ts | 18 ++++------ .../cli/src/license/license.controller.ts | 2 +- packages/cli/src/metrics/index.ts | 2 +- packages/cli/src/middlewares/auth.ts | 2 +- .../cli/src/{requests.d.ts => requests.ts} | 6 ++-- packages/cli/src/telemetry/index.ts | 5 +-- packages/cli/src/user/user.service.ts | 3 +- .../src/workflows/workflows.controller.ee.ts | 2 +- .../src/workflows/workflows.services.ee.ts | 7 ++-- .../cli/src/workflows/workflows.services.ts | 14 ++++---- packages/cli/src/workflows/workflows.types.ts | 4 +-- packages/core/.eslintrc.js | 2 ++ packages/core/src/ActiveWebhooks.ts | 2 +- packages/core/src/ActiveWorkflows.ts | 6 ++-- .../core/src/BinaryDataManager/FileSystem.ts | 5 +-- packages/core/src/Credentials.ts | 4 +-- packages/core/src/DirectoryLoader.ts | 3 +- packages/core/src/ExtractValue.ts | 6 ++-- packages/core/src/LoadNodeParameterOptions.ts | 4 +-- packages/core/src/NodeExecuteFunctions.ts | 33 +++++++++++-------- packages/core/src/OAuth2Helper.ts | 4 +-- packages/core/src/WorkflowExecute.ts | 5 ++- packages/node-dev/.eslintrc.js | 1 + packages/node-dev/commands/build.ts | 3 +- packages/node-dev/src/Create.ts | 3 +- packages/workflow/.eslintrc.js | 1 + packages/workflow/src/Expression.ts | 10 ++---- .../workflow/src/Extensions/DateExtensions.ts | 4 +-- .../src/Extensions/NumberExtensions.ts | 2 +- packages/workflow/src/Interfaces.ts | 2 +- packages/workflow/src/LoggerProxy.ts | 2 +- packages/workflow/src/MessageEventBus.ts | 4 +-- packages/workflow/src/NodeErrors.ts | 2 +- packages/workflow/src/NodeHelpers.ts | 2 +- packages/workflow/src/ObservableObject.ts | 2 +- packages/workflow/src/RoutingNode.ts | 2 +- packages/workflow/src/TelemetryHelpers.ts | 2 +- packages/workflow/src/Workflow.ts | 4 +-- .../workflow/src/WorkflowActivationError.ts | 2 +- packages/workflow/src/WorkflowDataProxy.ts | 2 +- packages/workflow/src/WorkflowHooks.ts | 2 +- packages/workflow/src/type-guards.ts | 2 +- packages/workflow/src/utils.ts | 2 +- 148 files changed, 452 insertions(+), 421 deletions(-) rename packages/cli/src/{requests.d.ts => requests.ts} (98%) diff --git a/packages/cli/.eslintrc.js b/packages/cli/.eslintrc.js index 2a24787f80..3da2d993a3 100644 --- a/packages/cli/.eslintrc.js +++ b/packages/cli/.eslintrc.js @@ -16,6 +16,8 @@ module.exports = { ], rules: { + '@typescript-eslint/consistent-type-imports': 'error', + // TODO: Remove this 'import/no-cycle': 'warn', 'import/order': 'off', diff --git a/packages/cli/src/AbstractServer.ts b/packages/cli/src/AbstractServer.ts index 1d7f02f8b9..cb7098848e 100644 --- a/packages/cli/src/AbstractServer.ts +++ b/packages/cli/src/AbstractServer.ts @@ -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'; diff --git a/packages/cli/src/ActiveExecutions.ts b/packages/cli/src/ActiveExecutions.ts index bb7e5a7448..681d5c1f21 100644 --- a/packages/cli/src/ActiveExecutions.ts +++ b/packages/cli/src/ActiveExecutions.ts @@ -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, diff --git a/packages/cli/src/ActiveWorkflowRunner.ts b/packages/cli/src/ActiveWorkflowRunner.ts index ec91c45268..4332fe1ada 100644 --- a/packages/cli/src/ActiveWorkflowRunner.ts +++ b/packages/cli/src/ActiveWorkflowRunner.ts @@ -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'; diff --git a/packages/cli/src/CommunityNodes/helpers.ts b/packages/cli/src/CommunityNodes/helpers.ts index 0c0770b88f..cd18a967b4 100644 --- a/packages/cli/src/CommunityNodes/helpers.ts +++ b/packages/cli/src/CommunityNodes/helpers.ts @@ -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'; diff --git a/packages/cli/src/CommunityNodes/packageModel.ts b/packages/cli/src/CommunityNodes/packageModel.ts index fe9ae1a4b2..947fc4364d 100644 --- a/packages/cli/src/CommunityNodes/packageModel.ts +++ b/packages/cli/src/CommunityNodes/packageModel.ts @@ -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'; diff --git a/packages/cli/src/CredentialsHelper.ts b/packages/cli/src/CredentialsHelper.ts index c04b4bf8ef..ea7f785566 100644 --- a/packages/cli/src/CredentialsHelper.ts +++ b/packages/cli/src/CredentialsHelper.ts @@ -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'; diff --git a/packages/cli/src/Db.ts b/packages/cli/src/Db.ts index d458138d5b..76bdd1e905 100644 --- a/packages/cli/src/Db.ts +++ b/packages/cli/src/Db.ts @@ -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'; diff --git a/packages/cli/src/ExternalHooks.ts b/packages/cli/src/ExternalHooks.ts index 21ccaa1fcb..70e14e54e0 100644 --- a/packages/cli/src/ExternalHooks.ts +++ b/packages/cli/src/ExternalHooks.ts @@ -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'; diff --git a/packages/cli/src/GenericHelpers.ts b/packages/cli/src/GenericHelpers.ts index bdb8eec5db..90810af1a5 100644 --- a/packages/cli/src/GenericHelpers.ts +++ b/packages/cli/src/GenericHelpers.ts @@ -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 diff --git a/packages/cli/src/InternalHooks.ts b/packages/cli/src/InternalHooks.ts index 665f4840c8..d97a5c98a3 100644 --- a/packages/cli/src/InternalHooks.ts +++ b/packages/cli/src/InternalHooks.ts @@ -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'; diff --git a/packages/cli/src/InternalHooksManager.ts b/packages/cli/src/InternalHooksManager.ts index f682a3a1b2..a30a12c65e 100644 --- a/packages/cli/src/InternalHooksManager.ts +++ b/packages/cli/src/InternalHooksManager.ts @@ -1,4 +1,4 @@ -import { INodeTypes } from 'n8n-workflow'; +import type { INodeTypes } from 'n8n-workflow'; import { InternalHooksClass } from '@/InternalHooks'; import { Telemetry } from '@/telemetry'; diff --git a/packages/cli/src/Ldap/LdapService.ee.ts b/packages/cli/src/Ldap/LdapService.ee.ts index 28384c1cb8..bc5432cbea 100644 --- a/packages/cli/src/Ldap/LdapService.ee.ts +++ b/packages/cli/src/Ldap/LdapService.ee.ts @@ -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; diff --git a/packages/cli/src/Ldap/LdapSync.ee.ts b/packages/cli/src/Ldap/LdapSync.ee.ts index 37188ce4be..2b4ffb91ce 100644 --- a/packages/cli/src/Ldap/LdapSync.ee.ts +++ b/packages/cli/src/Ldap/LdapSync.ee.ts @@ -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, diff --git a/packages/cli/src/Ldap/types.ts b/packages/cli/src/Ldap/types.ts index 46f4ff2285..4a897f4590 100644 --- a/packages/cli/src/Ldap/types.ts +++ b/packages/cli/src/Ldap/types.ts @@ -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'; diff --git a/packages/cli/src/License.ts b/packages/cli/src/License.ts index 11cfbcabb8..72c62eb993 100644 --- a/packages/cli/src/License.ts +++ b/packages/cli/src/License.ts @@ -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'; diff --git a/packages/cli/src/LoadNodesAndCredentials.ts b/packages/cli/src/LoadNodesAndCredentials.ts index 1d0c5262b9..6fc511f2a0 100644 --- a/packages/cli/src/LoadNodesAndCredentials.ts +++ b/packages/cli/src/LoadNodesAndCredentials.ts @@ -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 { diff --git a/packages/cli/src/Logger.ts b/packages/cli/src/Logger.ts index e413f70fef..bbfc2213fa 100644 --- a/packages/cli/src/Logger.ts +++ b/packages/cli/src/Logger.ts @@ -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'; diff --git a/packages/cli/src/PublicApi/index.ts b/packages/cli/src/PublicApi/index.ts index 029cade4c5..26f9757a21 100644 --- a/packages/cli/src/PublicApi/index.ts +++ b/packages/cli/src/PublicApi/index.ts @@ -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'; diff --git a/packages/cli/src/PublicApi/types.d.ts b/packages/cli/src/PublicApi/types.d.ts index f6353dea9e..481888d00d 100644 --- a/packages/cli/src/PublicApi/types.d.ts +++ b/packages/cli/src/PublicApi/types.d.ts @@ -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'; diff --git a/packages/cli/src/PublicApi/v1/handlers/credentials/credentials.handler.ts b/packages/cli/src/PublicApi/v1/handlers/credentials/credentials.handler.ts index 3bc402815a..6c7af614f1 100644 --- a/packages/cli/src/PublicApi/v1/handlers/credentials/credentials.handler.ts +++ b/packages/cli/src/PublicApi/v1/handlers/credentials/credentials.handler.ts @@ -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'; diff --git a/packages/cli/src/PublicApi/v1/handlers/credentials/credentials.middleware.ts b/packages/cli/src/PublicApi/v1/handlers/credentials/credentials.middleware.ts index c5b47a188f..52d928ddf9 100644 --- a/packages/cli/src/PublicApi/v1/handlers/credentials/credentials.middleware.ts +++ b/packages/cli/src/PublicApi/v1/handlers/credentials/credentials.middleware.ts @@ -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 = ( diff --git a/packages/cli/src/PublicApi/v1/handlers/credentials/credentials.service.ts b/packages/cli/src/PublicApi/v1/handlers/credentials/credentials.service.ts index cc66093bdf..cb5acbadda 100644 --- a/packages/cli/src/PublicApi/v1/handlers/credentials/credentials.service.ts +++ b/packages/cli/src/PublicApi/v1/handlers/credentials/credentials.service.ts @@ -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 { return Db.collections.Credentials.findOneBy({ id: credentialId }); diff --git a/packages/cli/src/PublicApi/v1/handlers/executions/executions.handler.ts b/packages/cli/src/PublicApi/v1/handlers/executions/executions.handler.ts index 272bed8ca5..ba1dcaf11d 100644 --- a/packages/cli/src/PublicApi/v1/handlers/executions/executions.handler.ts +++ b/packages/cli/src/PublicApi/v1/handlers/executions/executions.handler.ts @@ -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'; diff --git a/packages/cli/src/PublicApi/v1/handlers/executions/executions.service.ts b/packages/cli/src/PublicApi/v1/handlers/executions/executions.service.ts index 75289bd5db..fa0d5b0c61 100644 --- a/packages/cli/src/PublicApi/v1/handlers/executions/executions.service.ts +++ b/packages/cli/src/PublicApi/v1/handlers/executions/executions.service.ts @@ -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'; diff --git a/packages/cli/src/PublicApi/v1/handlers/users/users.service.ts b/packages/cli/src/PublicApi/v1/handlers/users/users.service.ts index befc4326cb..57ddb4b84a 100644 --- a/packages/cli/src/PublicApi/v1/handlers/users/users.service.ts +++ b/packages/cli/src/PublicApi/v1/handlers/users/users.service.ts @@ -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'; diff --git a/packages/cli/src/PublicApi/v1/handlers/workflows/workflows.handler.ts b/packages/cli/src/PublicApi/v1/handlers/workflows/workflows.handler.ts index f758b26097..c56c658c2b 100644 --- a/packages/cli/src/PublicApi/v1/handlers/workflows/workflows.handler.ts +++ b/packages/cli/src/PublicApi/v1/handlers/workflows/workflows.handler.ts @@ -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'; diff --git a/packages/cli/src/PublicApi/v1/handlers/workflows/workflows.service.ts b/packages/cli/src/PublicApi/v1/handlers/workflows/workflows.service.ts index d3fd74c470..26069da83e 100644 --- a/packages/cli/src/PublicApi/v1/handlers/workflows/workflows.service.ts +++ b/packages/cli/src/PublicApi/v1/handlers/workflows/workflows.service.ts @@ -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[] { diff --git a/packages/cli/src/PublicApi/v1/shared/middlewares/global.middleware.ts b/packages/cli/src/PublicApi/v1/shared/middlewares/global.middleware.ts index 7fad023d6b..5007c6ef99 100644 --- a/packages/cli/src/PublicApi/v1/shared/middlewares/global.middleware.ts +++ b/packages/cli/src/PublicApi/v1/shared/middlewares/global.middleware.ts @@ -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 = diff --git a/packages/cli/src/PublicApi/v1/shared/services/pagination.service.ts b/packages/cli/src/PublicApi/v1/shared/services/pagination.service.ts index 2df7029ce2..086a8676b9 100644 --- a/packages/cli/src/PublicApi/v1/shared/services/pagination.service.ts +++ b/packages/cli/src/PublicApi/v1/shared/services/pagination.service.ts @@ -1,5 +1,5 @@ import { jsonParse } from 'n8n-workflow'; -import { +import type { CursorPagination, OffsetPagination, PaginationCursorDecoded, diff --git a/packages/cli/src/Queue.ts b/packages/cli/src/Queue.ts index 5c9f74c40c..6f19626dea 100644 --- a/packages/cli/src/Queue.ts +++ b/packages/cli/src/Queue.ts @@ -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'; diff --git a/packages/cli/src/ResponseHelper.ts b/packages/cli/src/ResponseHelper.ts index 14a7c8ee69..7cf88b385c 100644 --- a/packages/cli/src/ResponseHelper.ts +++ b/packages/cli/src/ResponseHelper.ts @@ -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'; diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index bf8487cd57..257d6e2045 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -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'; diff --git a/packages/cli/src/TestWebhooks.ts b/packages/cli/src/TestWebhooks.ts index da9a1148db..fe3b454229 100644 --- a/packages/cli/src/TestWebhooks.ts +++ b/packages/cli/src/TestWebhooks.ts @@ -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'; diff --git a/packages/cli/src/TranslationHelpers.ts b/packages/cli/src/TranslationHelpers.ts index 04525368bd..cc4319b04f 100644 --- a/packages/cli/src/TranslationHelpers.ts +++ b/packages/cli/src/TranslationHelpers.ts @@ -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 diff --git a/packages/cli/src/UserManagement/PermissionChecker.ts b/packages/cli/src/UserManagement/PermissionChecker.ts index 7073eb5247..8949156587 100644 --- a/packages/cli/src/UserManagement/PermissionChecker.ts +++ b/packages/cli/src/UserManagement/PermissionChecker.ts @@ -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'; diff --git a/packages/cli/src/UserManagement/UserManagementHelper.ts b/packages/cli/src/UserManagement/UserManagementHelper.ts index 37cef89cb6..3660ed1374 100644 --- a/packages/cli/src/UserManagement/UserManagementHelper.ts +++ b/packages/cli/src/UserManagement/UserManagementHelper.ts @@ -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'; diff --git a/packages/cli/src/UserManagement/email/NodeMailer.ts b/packages/cli/src/UserManagement/email/NodeMailer.ts index 9913b9c4d6..98da46effe 100644 --- a/packages/cli/src/UserManagement/email/NodeMailer.ts +++ b/packages/cli/src/UserManagement/email/NodeMailer.ts @@ -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; diff --git a/packages/cli/src/UserManagement/email/UserManagementMailer.ts b/packages/cli/src/UserManagement/email/UserManagementMailer.ts index 3f245b4d07..67cc4ec6e2 100644 --- a/packages/cli/src/UserManagement/email/UserManagementMailer.ts +++ b/packages/cli/src/UserManagement/email/UserManagementMailer.ts @@ -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, diff --git a/packages/cli/src/WaitTracker.ts b/packages/cli/src/WaitTracker.ts index 63ee67a06d..c11e2d9feb 100644 --- a/packages/cli/src/WaitTracker.ts +++ b/packages/cli/src/WaitTracker.ts @@ -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, diff --git a/packages/cli/src/WaitingWebhooks.ts b/packages/cli/src/WaitingWebhooks.ts index 7f8cee74a9..29c7856b2c 100644 --- a/packages/cli/src/WaitingWebhooks.ts +++ b/packages/cli/src/WaitingWebhooks.ts @@ -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'; diff --git a/packages/cli/src/WebhookHelpers.ts b/packages/cli/src/WebhookHelpers.ts index 83b445318f..b4d7af5246 100644 --- a/packages/cli/src/WebhookHelpers.ts +++ b/packages/cli/src/WebhookHelpers.ts @@ -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']; diff --git a/packages/cli/src/WorkflowCredentials.ts b/packages/cli/src/WorkflowCredentials.ts index 228c7b9485..94d31f49a4 100644 --- a/packages/cli/src/WorkflowCredentials.ts +++ b/packages/cli/src/WorkflowCredentials.ts @@ -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 diff --git a/packages/cli/src/WorkflowExecuteAdditionalData.ts b/packages/cli/src/WorkflowExecuteAdditionalData.ts index 7fddf5432d..451cb68143 100644 --- a/packages/cli/src/WorkflowExecuteAdditionalData.ts +++ b/packages/cli/src/WorkflowExecuteAdditionalData.ts @@ -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, diff --git a/packages/cli/src/WorkflowHelpers.ts b/packages/cli/src/WorkflowHelpers.ts index 5d49cf70ae..5f6f2e0e7a 100644 --- a/packages/cli/src/WorkflowHelpers.ts +++ b/packages/cli/src/WorkflowHelpers.ts @@ -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'; diff --git a/packages/cli/src/WorkflowRunner.ts b/packages/cli/src/WorkflowRunner.ts index b8e97df541..30fa45970c 100644 --- a/packages/cli/src/WorkflowRunner.ts +++ b/packages/cli/src/WorkflowRunner.ts @@ -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, diff --git a/packages/cli/src/WorkflowRunnerProcess.ts b/packages/cli/src/WorkflowRunnerProcess.ts index bc1a5015e6..7f0e0d3a88 100644 --- a/packages/cli/src/WorkflowRunnerProcess.ts +++ b/packages/cli/src/WorkflowRunnerProcess.ts @@ -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'; diff --git a/packages/cli/src/api/e2e.api.ts b/packages/cli/src/api/e2e.api.ts index 13d7f79651..befd913114 100644 --- a/packages/cli/src/api/e2e.api.ts +++ b/packages/cli/src/api/e2e.api.ts @@ -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'; diff --git a/packages/cli/src/api/nodes.api.ts b/packages/cli/src/api/nodes.api.ts index 7fd35bf4af..b68480be44 100644 --- a/packages/cli/src/api/nodes.api.ts +++ b/packages/cli/src/api/nodes.api.ts @@ -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'; diff --git a/packages/cli/src/api/tags.api.ts b/packages/cli/src/api/tags.api.ts index ed01946000..c888673e68 100644 --- a/packages/cli/src/api/tags.api.ts +++ b/packages/cli/src/api/tags.api.ts @@ -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(); diff --git a/packages/cli/src/api/workflowStats.api.ts b/packages/cli/src/api/workflowStats.api.ts index 157741e0af..9831621742 100644 --- a/packages/cli/src/api/workflowStats.api.ts +++ b/packages/cli/src/api/workflowStats.api.ts @@ -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(); diff --git a/packages/cli/src/audit/risks/credentials.risk.ts b/packages/cli/src/audit/risks/credentials.risk.ts index 49684facfb..804e642a4f 100644 --- a/packages/cli/src/audit/risks/credentials.risk.ts +++ b/packages/cli/src/audit/risks/credentials.risk.ts @@ -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'; diff --git a/packages/cli/src/auth/jwt.ts b/packages/cli/src/auth/jwt.ts index 277b806136..5a1db63f03 100644 --- a/packages/cli/src/auth/jwt.ts +++ b/packages/cli/src/auth/jwt.ts @@ -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'; diff --git a/packages/cli/src/commands/BaseCommand.ts b/packages/cli/src/commands/BaseCommand.ts index 07467eea2c..445deadfbd 100644 --- a/packages/cli/src/commands/BaseCommand.ts +++ b/packages/cli/src/commands/BaseCommand.ts @@ -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'; diff --git a/packages/cli/src/commands/audit.ts b/packages/cli/src/commands/audit.ts index 7c3c8a5881..a9f402f01a 100644 --- a/packages/cli/src/commands/audit.ts +++ b/packages/cli/src/commands/audit.ts @@ -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'; diff --git a/packages/cli/src/commands/db/revert.ts b/packages/cli/src/commands/db/revert.ts index 856d04550a..858aefc405 100644 --- a/packages/cli/src/commands/db/revert.ts +++ b/packages/cli/src/commands/db/revert.ts @@ -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'; diff --git a/packages/cli/src/commands/execute.ts b/packages/cli/src/commands/execute.ts index 76d4da4297..7972b0925a 100644 --- a/packages/cli/src/commands/execute.ts +++ b/packages/cli/src/commands/execute.ts @@ -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'; diff --git a/packages/cli/src/commands/executeBatch.ts b/packages/cli/src/commands/executeBatch.ts index b012e022b8..6c99813af0 100644 --- a/packages/cli/src/commands/executeBatch.ts +++ b/packages/cli/src/commands/executeBatch.ts @@ -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'; diff --git a/packages/cli/src/commands/export/credentials.ts b/packages/cli/src/commands/export/credentials.ts index 4cd40dff40..22ce61aff5 100644 --- a/packages/cli/src/commands/export/credentials.ts +++ b/packages/cli/src/commands/export/credentials.ts @@ -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'; diff --git a/packages/cli/src/commands/export/workflow.ts b/packages/cli/src/commands/export/workflow.ts index 277c7a75e5..14b46cbcd9 100644 --- a/packages/cli/src/commands/export/workflow.ts +++ b/packages/cli/src/commands/export/workflow.ts @@ -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'; diff --git a/packages/cli/src/commands/import/credentials.ts b/packages/cli/src/commands/import/credentials.ts index 2132055dbf..be0e2de7bd 100644 --- a/packages/cli/src/commands/import/credentials.ts +++ b/packages/cli/src/commands/import/credentials.ts @@ -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'; diff --git a/packages/cli/src/commands/import/workflow.ts b/packages/cli/src/commands/import/workflow.ts index 17e1eee2fc..2828f04471 100644 --- a/packages/cli/src/commands/import/workflow.ts +++ b/packages/cli/src/commands/import/workflow.ts @@ -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'; diff --git a/packages/cli/src/commands/list/workflow.ts b/packages/cli/src/commands/list/workflow.ts index ec90436256..95ab06dfb8 100644 --- a/packages/cli/src/commands/list/workflow.ts +++ b/packages/cli/src/commands/list/workflow.ts @@ -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'; diff --git a/packages/cli/src/commands/start.ts b/packages/cli/src/commands/start.ts index f360e0c505..716e2e1156 100644 --- a/packages/cli/src/commands/start.ts +++ b/packages/cli/src/commands/start.ts @@ -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'; diff --git a/packages/cli/src/commands/update/workflow.ts b/packages/cli/src/commands/update/workflow.ts index eb2cbff7aa..94ef751e75 100644 --- a/packages/cli/src/commands/update/workflow.ts +++ b/packages/cli/src/commands/update/workflow.ts @@ -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'; diff --git a/packages/cli/src/commands/user-management/reset.ts b/packages/cli/src/commands/user-management/reset.ts index be0f715c47..36179b42dc 100644 --- a/packages/cli/src/commands/user-management/reset.ts +++ b/packages/cli/src/commands/user-management/reset.ts @@ -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 { diff --git a/packages/cli/src/commands/worker.ts b/packages/cli/src/commands/worker.ts index 5478543e74..231a1899e5 100644 --- a/packages/cli/src/commands/worker.ts +++ b/packages/cli/src/commands/worker.ts @@ -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'; diff --git a/packages/cli/src/config/types.d.ts b/packages/cli/src/config/types.d.ts index f5ce54726d..84ece88a3d 100644 --- a/packages/cli/src/config/types.d.ts +++ b/packages/cli/src/config/types.d.ts @@ -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 diff --git a/packages/cli/src/constants.ts b/packages/cli/src/constants.ts index 9adab3468a..4169b7c69a 100644 --- a/packages/cli/src/constants.ts +++ b/packages/cli/src/constants.ts @@ -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; diff --git a/packages/cli/src/controllers/auth.controller.ts b/packages/cli/src/controllers/auth.controller.ts index f7e0ef753e..05edd7f663 100644 --- a/packages/cli/src/controllers/auth.controller.ts +++ b/packages/cli/src/controllers/auth.controller.ts @@ -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'; diff --git a/packages/cli/src/controllers/me.controller.ts b/packages/cli/src/controllers/me.controller.ts index 62db2b7d6b..603140715b 100644 --- a/packages/cli/src/controllers/me.controller.ts +++ b/packages/cli/src/controllers/me.controller.ts @@ -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, diff --git a/packages/cli/src/controllers/owner.controller.ts b/packages/cli/src/controllers/owner.controller.ts index 9882d8cdd8..31779f92e0 100644 --- a/packages/cli/src/controllers/owner.controller.ts +++ b/packages/cli/src/controllers/owner.controller.ts @@ -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'; diff --git a/packages/cli/src/controllers/passwordReset.controller.ts b/packages/cli/src/controllers/passwordReset.controller.ts index 3d32d60512..b78a57620d 100644 --- a/packages/cli/src/controllers/passwordReset.controller.ts +++ b/packages/cli/src/controllers/passwordReset.controller.ts @@ -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'; diff --git a/packages/cli/src/controllers/users.controller.ts b/packages/cli/src/controllers/users.controller.ts index 5a7a0636d7..19893dd59e 100644 --- a/packages/cli/src/controllers/users.controller.ts +++ b/packages/cli/src/controllers/users.controller.ts @@ -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 { diff --git a/packages/cli/src/credentials/credentials.controller.ee.ts b/packages/cli/src/credentials/credentials.controller.ee.ts index 55db6109e0..8596f8ca51 100644 --- a/packages/cli/src/credentials/credentials.controller.ee.ts +++ b/packages/cli/src/credentials/credentials.controller.ee.ts @@ -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'; diff --git a/packages/cli/src/credentials/credentials.controller.ts b/packages/cli/src/credentials/credentials.controller.ts index aef54d10d1..db7774421d 100644 --- a/packages/cli/src/credentials/credentials.controller.ts +++ b/packages/cli/src/credentials/credentials.controller.ts @@ -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'; diff --git a/packages/cli/src/credentials/credentials.service.ee.ts b/packages/cli/src/credentials/credentials.service.ee.ts index 0d340f696f..2defaaaea9 100644 --- a/packages/cli/src/credentials/credentials.service.ee.ts +++ b/packages/cli/src/credentials/credentials.service.ee.ts @@ -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'; diff --git a/packages/cli/src/credentials/credentials.service.ts b/packages/cli/src/credentials/credentials.service.ts index c9749dcb4f..ea6926a5ca 100644 --- a/packages/cli/src/credentials/credentials.service.ts +++ b/packages/cli/src/credentials/credentials.service.ts @@ -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'; diff --git a/packages/cli/src/credentials/oauth2Credential.api.ts b/packages/cli/src/credentials/oauth2Credential.api.ts index a46018e659..8c6b758d4f 100644 --- a/packages/cli/src/credentials/oauth2Credential.api.ts +++ b/packages/cli/src/credentials/oauth2Credential.api.ts @@ -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'; diff --git a/packages/cli/src/databases/entities/ExecutionEntity.ts b/packages/cli/src/databases/entities/ExecutionEntity.ts index 60db88beb4..41891f375c 100644 --- a/packages/cli/src/databases/entities/ExecutionEntity.ts +++ b/packages/cli/src/databases/entities/ExecutionEntity.ts @@ -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() diff --git a/packages/cli/src/databases/entities/InstalledNodes.ts b/packages/cli/src/databases/entities/InstalledNodes.ts index 6aec662c78..7f2e94b6bc 100644 --- a/packages/cli/src/databases/entities/InstalledNodes.ts +++ b/packages/cli/src/databases/entities/InstalledNodes.ts @@ -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 { diff --git a/packages/cli/src/databases/entities/SharedCredentials.ts b/packages/cli/src/databases/entities/SharedCredentials.ts index f46b4ad078..d1c46fd8a3 100644 --- a/packages/cli/src/databases/entities/SharedCredentials.ts +++ b/packages/cli/src/databases/entities/SharedCredentials.ts @@ -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'; diff --git a/packages/cli/src/databases/entities/SharedWorkflow.ts b/packages/cli/src/databases/entities/SharedWorkflow.ts index 3294b25cec..57d8a8b506 100644 --- a/packages/cli/src/databases/entities/SharedWorkflow.ts +++ b/packages/cli/src/databases/entities/SharedWorkflow.ts @@ -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'; diff --git a/packages/cli/src/databases/entities/User.ts b/packages/cli/src/databases/entities/User.ts index 5896d22fa8..6cba438f79 100644 --- a/packages/cli/src/databases/entities/User.ts +++ b/packages/cli/src/databases/entities/User.ts @@ -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'; diff --git a/packages/cli/src/databases/entities/WorkflowEntity.ts b/packages/cli/src/databases/entities/WorkflowEntity.ts index 0e045e2fb9..84bb5fc2ff 100644 --- a/packages/cli/src/databases/entities/WorkflowEntity.ts +++ b/packages/cli/src/databases/entities/WorkflowEntity.ts @@ -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, diff --git a/packages/cli/src/databases/entities/WorkflowStatistics.ts b/packages/cli/src/databases/entities/WorkflowStatistics.ts index 6fad7b9b58..1d3de6316d 100644 --- a/packages/cli/src/databases/entities/WorkflowStatistics.ts +++ b/packages/cli/src/databases/entities/WorkflowStatistics.ts @@ -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', diff --git a/packages/cli/src/eventbus/EventMessageClasses/AbstractEventMessageOptions.ts b/packages/cli/src/eventbus/EventMessageClasses/AbstractEventMessageOptions.ts index ea4799c244..71842e4e30 100644 --- a/packages/cli/src/eventbus/EventMessageClasses/AbstractEventMessageOptions.ts +++ b/packages/cli/src/eventbus/EventMessageClasses/AbstractEventMessageOptions.ts @@ -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 { diff --git a/packages/cli/src/eventbus/EventMessageClasses/EventMessageAudit.ts b/packages/cli/src/eventbus/EventMessageClasses/EventMessageAudit.ts index 482b5dafb7..f349823382 100644 --- a/packages/cli/src/eventbus/EventMessageClasses/EventMessageAudit.ts +++ b/packages/cli/src/eventbus/EventMessageClasses/EventMessageAudit.ts @@ -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', diff --git a/packages/cli/src/eventbus/EventMessageClasses/EventMessageConfirm.ts b/packages/cli/src/eventbus/EventMessageClasses/EventMessageConfirm.ts index 96c58796a8..28dffec7e1 100644 --- a/packages/cli/src/eventbus/EventMessageClasses/EventMessageConfirm.ts +++ b/packages/cli/src/eventbus/EventMessageClasses/EventMessageConfirm.ts @@ -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; diff --git a/packages/cli/src/eventbus/EventMessageClasses/EventMessageGeneric.ts b/packages/cli/src/eventbus/EventMessageClasses/EventMessageGeneric.ts index a1a6be565c..0e49b33b4f 100644 --- a/packages/cli/src/eventbus/EventMessageClasses/EventMessageGeneric.ts +++ b/packages/cli/src/eventbus/EventMessageClasses/EventMessageGeneric.ts @@ -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'; diff --git a/packages/cli/src/eventbus/EventMessageClasses/EventMessageNode.ts b/packages/cli/src/eventbus/EventMessageClasses/EventMessageNode.ts index 2672d327b1..072aafaa43 100644 --- a/packages/cli/src/eventbus/EventMessageClasses/EventMessageNode.ts +++ b/packages/cli/src/eventbus/EventMessageClasses/EventMessageNode.ts @@ -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'; diff --git a/packages/cli/src/eventbus/EventMessageClasses/EventMessageWorkflow.ts b/packages/cli/src/eventbus/EventMessageClasses/EventMessageWorkflow.ts index 1d847a420d..71acfd85ab 100644 --- a/packages/cli/src/eventbus/EventMessageClasses/EventMessageWorkflow.ts +++ b/packages/cli/src/eventbus/EventMessageClasses/EventMessageWorkflow.ts @@ -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', diff --git a/packages/cli/src/eventbus/EventMessageClasses/Helpers.ts b/packages/cli/src/eventbus/EventMessageClasses/Helpers.ts index c482a0edc4..31f3e4d106 100644 --- a/packages/cli/src/eventbus/EventMessageClasses/Helpers.ts +++ b/packages/cli/src/eventbus/EventMessageClasses/Helpers.ts @@ -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, diff --git a/packages/cli/src/eventbus/EventMessageClasses/index.ts b/packages/cli/src/eventbus/EventMessageClasses/index.ts index 09caf45479..f49e1ae4f3 100644 --- a/packages/cli/src/eventbus/EventMessageClasses/index.ts +++ b/packages/cli/src/eventbus/EventMessageClasses/index.ts @@ -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]; diff --git a/packages/cli/src/eventbus/MessageEventBus/MessageEventBus.ts b/packages/cli/src/eventbus/MessageEventBus/MessageEventBus.ts index 2751dc0f91..3956c373af 100644 --- a/packages/cli/src/eventbus/MessageEventBus/MessageEventBus.ts +++ b/packages/cli/src/eventbus/MessageEventBus/MessageEventBus.ts @@ -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, diff --git a/packages/cli/src/eventbus/MessageEventBusDestination/MessageEventBusDestination.ee.ts b/packages/cli/src/eventbus/MessageEventBusDestination/MessageEventBusDestination.ee.ts index f87141b7f5..bd04cbedcd 100644 --- a/packages/cli/src/eventbus/MessageEventBusDestination/MessageEventBusDestination.ee.ts +++ b/packages/cli/src/eventbus/MessageEventBusDestination/MessageEventBusDestination.ee.ts @@ -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'; diff --git a/packages/cli/src/eventbus/MessageEventBusDestination/MessageEventBusDestinationSentry.ee.ts b/packages/cli/src/eventbus/MessageEventBusDestination/MessageEventBusDestinationSentry.ee.ts index 232ae982f7..4d515a83cc 100644 --- a/packages/cli/src/eventbus/MessageEventBusDestination/MessageEventBusDestinationSentry.ee.ts +++ b/packages/cli/src/eventbus/MessageEventBusDestination/MessageEventBusDestinationSentry.ee.ts @@ -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'; diff --git a/packages/cli/src/eventbus/MessageEventBusDestination/MessageEventBusDestinationSyslog.ee.ts b/packages/cli/src/eventbus/MessageEventBusDestination/MessageEventBusDestinationSyslog.ee.ts index 287b95ea5a..fe7983abc8 100644 --- a/packages/cli/src/eventbus/MessageEventBusDestination/MessageEventBusDestinationSyslog.ee.ts +++ b/packages/cli/src/eventbus/MessageEventBusDestination/MessageEventBusDestinationSyslog.ee.ts @@ -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 = ( diff --git a/packages/cli/src/eventbus/MessageEventBusDestination/MessageEventBusDestinationWebhook.ee.ts b/packages/cli/src/eventbus/MessageEventBusDestination/MessageEventBusDestinationWebhook.ee.ts index 0dc1e14185..7cfee04af6 100644 --- a/packages/cli/src/eventbus/MessageEventBusDestination/MessageEventBusDestinationWebhook.ee.ts +++ b/packages/cli/src/eventbus/MessageEventBusDestination/MessageEventBusDestinationWebhook.ee.ts @@ -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'; diff --git a/packages/cli/src/eventbus/MessageEventBusWriter/MessageEventBusLogWriter.ts b/packages/cli/src/eventbus/MessageEventBusWriter/MessageEventBusLogWriter.ts index 31dc42c40e..44e76339f2 100644 --- a/packages/cli/src/eventbus/MessageEventBusWriter/MessageEventBusLogWriter.ts +++ b/packages/cli/src/eventbus/MessageEventBusWriter/MessageEventBusLogWriter.ts @@ -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'; diff --git a/packages/cli/src/eventbus/eventBusRoutes.ts b/packages/cli/src/eventbus/eventBusRoutes.ts index ea1108d840..bf30e295f0 100644 --- a/packages/cli/src/eventbus/eventBusRoutes.ts +++ b/packages/cli/src/eventbus/eventBusRoutes.ts @@ -4,11 +4,10 @@ import express from 'express'; import { isEventMessageOptions } from './EventMessageClasses/AbstractEventMessage'; import { EventMessageGeneric } from './EventMessageClasses/EventMessageGeneric'; -import { - EventMessageWorkflow, - EventMessageWorkflowOptions, -} from './EventMessageClasses/EventMessageWorkflow'; -import { eventBus, EventMessageReturnMode } from './MessageEventBus/MessageEventBus'; +import type { EventMessageWorkflowOptions } from './EventMessageClasses/EventMessageWorkflow'; +import { EventMessageWorkflow } from './EventMessageClasses/EventMessageWorkflow'; +import type { EventMessageReturnMode } from './MessageEventBus/MessageEventBus'; +import { eventBus } from './MessageEventBus/MessageEventBus'; import { isMessageEventBusDestinationSentryOptions, MessageEventBusDestinationSentry, @@ -19,20 +18,18 @@ import { } from './MessageEventBusDestination/MessageEventBusDestinationSyslog.ee'; import { MessageEventBusDestinationWebhook } from './MessageEventBusDestination/MessageEventBusDestinationWebhook.ee'; import { eventNamesAll } from './EventMessageClasses'; -import { - EventMessageAudit, - EventMessageAuditOptions, -} from './EventMessageClasses/EventMessageAudit'; +import type { EventMessageAuditOptions } from './EventMessageClasses/EventMessageAudit'; +import { EventMessageAudit } from './EventMessageClasses/EventMessageAudit'; import { BadRequestError } from '../ResponseHelper'; -import { - MessageEventBusDestinationTypeNames, +import type { MessageEventBusDestinationWebhookOptions, - EventMessageTypeNames, MessageEventBusDestinationOptions, } from 'n8n-workflow'; -import { User } from '../databases/entities/User'; +import { MessageEventBusDestinationTypeNames, EventMessageTypeNames } from 'n8n-workflow'; +import type { User } from '../databases/entities/User'; import * as ResponseHelper from '@/ResponseHelper'; -import { EventMessageNode, EventMessageNodeOptions } from './EventMessageClasses/EventMessageNode'; +import type { EventMessageNodeOptions } from './EventMessageClasses/EventMessageNode'; +import { EventMessageNode } from './EventMessageClasses/EventMessageNode'; export const eventBusRouter = express.Router(); diff --git a/packages/cli/src/events/WorkflowStatistics.ts b/packages/cli/src/events/WorkflowStatistics.ts index a926211fc2..a3b09bbef4 100644 --- a/packages/cli/src/events/WorkflowStatistics.ts +++ b/packages/cli/src/events/WorkflowStatistics.ts @@ -1,4 +1,4 @@ -import { INode, IRun, IWorkflowBase } from 'n8n-workflow'; +import type { INode, IRun, IWorkflowBase } from 'n8n-workflow'; import * as Db from '@/Db'; import { InternalHooksManager } from '@/InternalHooksManager'; import { StatisticsNames } from '@db/entities/WorkflowStatistics'; diff --git a/packages/cli/src/executions/executions.controller.ee.ts b/packages/cli/src/executions/executions.controller.ee.ts index 8edfe24b0c..0a7a1c329d 100644 --- a/packages/cli/src/executions/executions.controller.ee.ts +++ b/packages/cli/src/executions/executions.controller.ee.ts @@ -1,5 +1,5 @@ import express from 'express'; -import { +import type { IExecutionFlattedResponse, IExecutionResponse, IExecutionsListResponse, diff --git a/packages/cli/src/executions/executions.controller.ts b/packages/cli/src/executions/executions.controller.ts index 3392405285..8df8638288 100644 --- a/packages/cli/src/executions/executions.controller.ts +++ b/packages/cli/src/executions/executions.controller.ts @@ -1,6 +1,6 @@ import express from 'express'; import { LoggerProxy } from 'n8n-workflow'; -import { +import type { IExecutionFlattedResponse, IExecutionResponse, IExecutionsListResponse, diff --git a/packages/cli/src/executions/executions.service.ee.ts b/packages/cli/src/executions/executions.service.ee.ts index 3e0ef04abc..60a7167ae8 100644 --- a/packages/cli/src/executions/executions.service.ee.ts +++ b/packages/cli/src/executions/executions.service.ee.ts @@ -1,4 +1,4 @@ -import { User } from '@db/entities/User'; +import type { User } from '@db/entities/User'; import { getSharedWorkflowIds } from '@/WorkflowHelpers'; import { ExecutionsService } from './executions.service'; diff --git a/packages/cli/src/executions/executions.service.ts b/packages/cli/src/executions/executions.service.ts index 8f1a90b16f..3ebda21d2b 100644 --- a/packages/cli/src/executions/executions.service.ts +++ b/packages/cli/src/executions/executions.service.ts @@ -3,21 +3,16 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import { validate as jsonSchemaValidate } from 'jsonschema'; import { BinaryDataManager } from 'n8n-core'; -import { - deepCopy, - IDataObject, - IWorkflowBase, - LoggerProxy, - JsonObject, - jsonParse, - Workflow, -} from 'n8n-workflow'; -import { FindOperator, FindOptionsWhere, In, IsNull, LessThanOrEqual, Not, Raw } from 'typeorm'; +import type { IDataObject, IWorkflowBase, JsonObject } from 'n8n-workflow'; +import { deepCopy, LoggerProxy, jsonParse, Workflow } from 'n8n-workflow'; +import type { FindOperator, FindOptionsWhere } from 'typeorm'; +import { In, IsNull, LessThanOrEqual, Not, Raw } from 'typeorm'; import * as ActiveExecutions from '@/ActiveExecutions'; import config from '@/config'; import type { User } from '@db/entities/User'; import type { ExecutionEntity } from '@db/entities/ExecutionEntity'; -import { +import type { + DatabaseType, IExecutionFlattedResponse, IExecutionResponse, IExecutionsListResponse, @@ -29,7 +24,6 @@ import type { ExecutionRequest } from '@/requests'; import * as ResponseHelper from '@/ResponseHelper'; import { getSharedWorkflowIds } from '@/WorkflowHelpers'; import { WorkflowRunner } from '@/WorkflowRunner'; -import type { DatabaseType } from '@/Interfaces'; import * as Db from '@/Db'; import * as GenericHelpers from '@/GenericHelpers'; diff --git a/packages/cli/src/license/license.controller.ts b/packages/cli/src/license/license.controller.ts index 47bd365769..dc59ad8445 100644 --- a/packages/cli/src/license/license.controller.ts +++ b/packages/cli/src/license/license.controller.ts @@ -9,7 +9,7 @@ import { InternalHooksManager } from '@/InternalHooksManager'; import type { ILicensePostResponse, ILicenseReadResponse } from '@/Interfaces'; import { LicenseService } from './License.service'; import { getLicense } from '@/License'; -import { AuthenticatedRequest, LicenseRequest } from '@/requests'; +import type { AuthenticatedRequest, LicenseRequest } from '@/requests'; import { isInstanceOwner } from '@/PublicApi/v1/handlers/users/users.service'; export const licenseController = express.Router(); diff --git a/packages/cli/src/metrics/index.ts b/packages/cli/src/metrics/index.ts index 80b211494d..c437ce230b 100644 --- a/packages/cli/src/metrics/index.ts +++ b/packages/cli/src/metrics/index.ts @@ -2,7 +2,7 @@ import config from '@/config'; import { N8N_VERSION } from '@/constants'; import * as ResponseHelper from '@/ResponseHelper'; -import express from 'express'; +import type express from 'express'; import promBundle from 'express-prom-bundle'; import promClient from 'prom-client'; import semverParse from 'semver/functions/parse'; diff --git a/packages/cli/src/middlewares/auth.ts b/packages/cli/src/middlewares/auth.ts index f8b271cbed..539b05a12d 100644 --- a/packages/cli/src/middlewares/auth.ts +++ b/packages/cli/src/middlewares/auth.ts @@ -4,7 +4,7 @@ import cookieParser from 'cookie-parser'; import passport from 'passport'; import { Strategy } from 'passport-jwt'; import { LoggerProxy as Logger } from 'n8n-workflow'; -import { JwtPayload } from '@/Interfaces'; +import type { JwtPayload } from '@/Interfaces'; import type { AuthenticatedRequest } from '@/requests'; import config from '@/config'; import { AUTH_COOKIE_NAME } from '@/constants'; diff --git a/packages/cli/src/requests.d.ts b/packages/cli/src/requests.ts similarity index 98% rename from packages/cli/src/requests.d.ts rename to packages/cli/src/requests.ts index 000af81840..e0636d7611 100644 --- a/packages/cli/src/requests.d.ts +++ b/packages/cli/src/requests.ts @@ -1,5 +1,5 @@ -import express from 'express'; -import { +import type express from 'express'; +import type { IConnections, ICredentialDataDecryptedObject, ICredentialNodeAccess, @@ -13,7 +13,7 @@ import { import type { PublicUser, IExecutionDeleteFilter, IWorkflowDb } from '@/Interfaces'; import type { Role } from '@db/entities/Role'; import type { User } from '@db/entities/User'; -import * as UserManagementMailer from '@/UserManagement/email/UserManagementMailer'; +import type * as UserManagementMailer from '@/UserManagement/email/UserManagementMailer'; export type AuthlessRequest< RouteParams = {}, diff --git a/packages/cli/src/telemetry/index.ts b/packages/cli/src/telemetry/index.ts index f14262dd66..24d59c7be9 100644 --- a/packages/cli/src/telemetry/index.ts +++ b/packages/cli/src/telemetry/index.ts @@ -2,9 +2,10 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import type RudderStack from '@rudderstack/rudder-sdk-node'; import type { PostHog } from 'posthog-node'; -import { ITelemetryTrackProperties, LoggerProxy } from 'n8n-workflow'; +import type { ITelemetryTrackProperties } from 'n8n-workflow'; +import { LoggerProxy } from 'n8n-workflow'; import config from '@/config'; -import { IExecutionTrackProperties } from '@/Interfaces'; +import type { IExecutionTrackProperties } from '@/Interfaces'; import { getLogger } from '@/Logger'; import { getLicense } from '@/License'; import { LicenseService } from '@/license/License.service'; diff --git a/packages/cli/src/user/user.service.ts b/packages/cli/src/user/user.service.ts index 045a6c18ba..b7f97f02d2 100644 --- a/packages/cli/src/user/user.service.ts +++ b/packages/cli/src/user/user.service.ts @@ -1,4 +1,5 @@ -import { EntityManager, FindOptionsWhere, In } from 'typeorm'; +import type { EntityManager, FindOptionsWhere } from 'typeorm'; +import { In } from 'typeorm'; import * as Db from '@/Db'; import { User } from '@db/entities/User'; diff --git a/packages/cli/src/workflows/workflows.controller.ee.ts b/packages/cli/src/workflows/workflows.controller.ee.ts index 5253bf0745..90de9dc93f 100644 --- a/packages/cli/src/workflows/workflows.controller.ee.ts +++ b/packages/cli/src/workflows/workflows.controller.ee.ts @@ -15,7 +15,7 @@ import { SharedWorkflow } from '@db/entities/SharedWorkflow'; import { LoggerProxy } from 'n8n-workflow'; import * as TagHelpers from '@/TagHelpers'; import { EECredentialsService as EECredentials } from '../credentials/credentials.service.ee'; -import { IExecutionPushResponse } from '@/Interfaces'; +import type { IExecutionPushResponse } from '@/Interfaces'; import * as GenericHelpers from '@/GenericHelpers'; import { In } from 'typeorm'; diff --git a/packages/cli/src/workflows/workflows.services.ee.ts b/packages/cli/src/workflows/workflows.services.ee.ts index 2b278b3a61..aa47acd2e7 100644 --- a/packages/cli/src/workflows/workflows.services.ee.ts +++ b/packages/cli/src/workflows/workflows.services.ee.ts @@ -1,10 +1,11 @@ -import { DeleteResult, EntityManager, In, Not } from 'typeorm'; +import type { DeleteResult, EntityManager } from 'typeorm'; +import { In, Not } from 'typeorm'; import * as Db from '@/Db'; import * as ResponseHelper from '@/ResponseHelper'; import * as WorkflowHelpers from '@/WorkflowHelpers'; -import { ICredentialsDb } from '@/Interfaces'; +import type { ICredentialsDb } from '@/Interfaces'; import { SharedWorkflow } from '@db/entities/SharedWorkflow'; -import { User } from '@db/entities/User'; +import type { User } from '@db/entities/User'; import { WorkflowEntity } from '@db/entities/WorkflowEntity'; import { RoleService } from '@/role/role.service'; import { UserService } from '@/user/user.service'; diff --git a/packages/cli/src/workflows/workflows.services.ts b/packages/cli/src/workflows/workflows.services.ts index 6e214fadbc..7bc0b38f93 100644 --- a/packages/cli/src/workflows/workflows.services.ts +++ b/packages/cli/src/workflows/workflows.services.ts @@ -1,6 +1,8 @@ import { validate as jsonSchemaValidate } from 'jsonschema'; -import { INode, IPinData, JsonObject, jsonParse, LoggerProxy, Workflow } from 'n8n-workflow'; -import { FindOptionsWhere, In } from 'typeorm'; +import type { INode, IPinData, JsonObject } from 'n8n-workflow'; +import { jsonParse, LoggerProxy, Workflow } from 'n8n-workflow'; +import type { FindOptionsWhere } from 'typeorm'; +import { In } from 'typeorm'; import pick from 'lodash.pick'; import { v4 as uuid } from 'uuid'; import * as ActiveWorkflowRunner from '@/ActiveWorkflowRunner'; @@ -9,13 +11,13 @@ import { InternalHooksManager } from '@/InternalHooksManager'; import * as ResponseHelper from '@/ResponseHelper'; import * as WorkflowHelpers from '@/WorkflowHelpers'; import config from '@/config'; -import { SharedWorkflow } from '@db/entities/SharedWorkflow'; -import { User } from '@db/entities/User'; -import { WorkflowEntity } from '@db/entities/WorkflowEntity'; +import type { SharedWorkflow } from '@db/entities/SharedWorkflow'; +import type { User } from '@db/entities/User'; +import type { WorkflowEntity } from '@db/entities/WorkflowEntity'; import { validateEntity } from '@/GenericHelpers'; import { ExternalHooks } from '@/ExternalHooks'; import * as TagHelpers from '@/TagHelpers'; -import { WorkflowRequest } from '@/requests'; +import type { WorkflowRequest } from '@/requests'; import type { IWorkflowDb, IWorkflowExecutionDataProcess } from '@/Interfaces'; import { NodeTypes } from '@/NodeTypes'; import { WorkflowRunner } from '@/WorkflowRunner'; diff --git a/packages/cli/src/workflows/workflows.types.ts b/packages/cli/src/workflows/workflows.types.ts index 38215fe778..ef30bb18c7 100644 --- a/packages/cli/src/workflows/workflows.types.ts +++ b/packages/cli/src/workflows/workflows.types.ts @@ -1,6 +1,6 @@ import type { IUser } from 'n8n-workflow'; -import { SharedWorkflow } from '@db/entities/SharedWorkflow'; -import { WorkflowEntity } from '@db/entities/WorkflowEntity'; +import type { SharedWorkflow } from '@db/entities/SharedWorkflow'; +import type { WorkflowEntity } from '@db/entities/WorkflowEntity'; export interface WorkflowWithSharingsAndCredentials extends Omit { ownedBy?: IUser | null; diff --git a/packages/core/.eslintrc.js b/packages/core/.eslintrc.js index 4d68086144..a1a1b8155d 100644 --- a/packages/core/.eslintrc.js +++ b/packages/core/.eslintrc.js @@ -11,6 +11,8 @@ module.exports = { ignorePatterns: ['bin/*.js'], rules: { + '@typescript-eslint/consistent-type-imports': 'error', + // TODO: Remove this 'import/order': 'off', '@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': true }], diff --git a/packages/core/src/ActiveWebhooks.ts b/packages/core/src/ActiveWebhooks.ts index 954868e7dc..e11adfb1e3 100644 --- a/packages/core/src/ActiveWebhooks.ts +++ b/packages/core/src/ActiveWebhooks.ts @@ -1,4 +1,4 @@ -import { +import type { IWebhookData, WebhookHttpMethod, Workflow, diff --git a/packages/core/src/ActiveWorkflows.ts b/packages/core/src/ActiveWorkflows.ts index c935ba8f24..31715c9e58 100644 --- a/packages/core/src/ActiveWorkflows.ts +++ b/packages/core/src/ActiveWorkflows.ts @@ -4,21 +4,19 @@ /* eslint-disable no-restricted-syntax */ import { CronJob } from 'cron'; -import { +import type { IGetExecutePollFunctions, IGetExecuteTriggerFunctions, INode, IPollResponse, ITriggerResponse, IWorkflowExecuteAdditionalData, - LoggerProxy as Logger, TriggerTime, - toCronExpression, Workflow, WorkflowActivateMode, - WorkflowActivationError, WorkflowExecuteMode, } from 'n8n-workflow'; +import { LoggerProxy as Logger, toCronExpression, WorkflowActivationError } from 'n8n-workflow'; import type { IWorkflowData } from './Interfaces'; diff --git a/packages/core/src/BinaryDataManager/FileSystem.ts b/packages/core/src/BinaryDataManager/FileSystem.ts index 5aeebec05b..b66093b3d2 100644 --- a/packages/core/src/BinaryDataManager/FileSystem.ts +++ b/packages/core/src/BinaryDataManager/FileSystem.ts @@ -3,9 +3,10 @@ import fs from 'fs/promises'; import path from 'path'; import { v4 as uuid } from 'uuid'; import type { Readable } from 'stream'; -import { BinaryMetadata, jsonParse } from 'n8n-workflow'; +import type { BinaryMetadata } from 'n8n-workflow'; +import { jsonParse } from 'n8n-workflow'; -import { IBinaryDataConfig, IBinaryDataManager } from '../Interfaces'; +import type { IBinaryDataConfig, IBinaryDataManager } from '../Interfaces'; const PREFIX_METAFILE = 'binarymeta'; const PREFIX_PERSISTED_METAFILE = 'persistedmeta'; diff --git a/packages/core/src/Credentials.ts b/packages/core/src/Credentials.ts index 0dab0a1c30..577f7fd700 100644 --- a/packages/core/src/Credentials.ts +++ b/packages/core/src/Credentials.ts @@ -1,9 +1,9 @@ -import { +import type { CredentialInformation, ICredentialDataDecryptedObject, - ICredentials, ICredentialsEncrypted, } from 'n8n-workflow'; +import { ICredentials } from 'n8n-workflow'; import { AES, enc } from 'crypto-js'; diff --git a/packages/core/src/DirectoryLoader.ts b/packages/core/src/DirectoryLoader.ts index 58c7826f3a..0682cfec7c 100644 --- a/packages/core/src/DirectoryLoader.ts +++ b/packages/core/src/DirectoryLoader.ts @@ -1,7 +1,7 @@ import * as path from 'path'; import { readFile } from 'fs/promises'; import glob from 'fast-glob'; -import { jsonParse, KnownNodesAndCredentials, LoggerProxy as Logger } from 'n8n-workflow'; +import { jsonParse, LoggerProxy as Logger } from 'n8n-workflow'; import type { CodexData, DocumentationLink, @@ -13,6 +13,7 @@ import type { INodeTypeData, INodeTypeNameVersion, IVersionedNodeType, + KnownNodesAndCredentials, } from 'n8n-workflow'; import { CUSTOM_NODES_CATEGORY } from './Constants'; import type { n8n } from './Interfaces'; diff --git a/packages/core/src/ExtractValue.ts b/packages/core/src/ExtractValue.ts index ffd31aee30..dcfadf4e2f 100644 --- a/packages/core/src/ExtractValue.ts +++ b/packages/core/src/ExtractValue.ts @@ -1,15 +1,13 @@ -import { +import type { INode, INodeParameters, INodeProperties, INodePropertyCollection, INodePropertyOptions, INodeType, - NodeOperationError, NodeParameterValueType, - NodeHelpers, - LoggerProxy, } from 'n8n-workflow'; +import { NodeOperationError, NodeHelpers, LoggerProxy } from 'n8n-workflow'; function findPropertyFromParameterName( parameterName: string, diff --git a/packages/core/src/LoadNodeParameterOptions.ts b/packages/core/src/LoadNodeParameterOptions.ts index 08bb862a0c..7bf39e1939 100644 --- a/packages/core/src/LoadNodeParameterOptions.ts +++ b/packages/core/src/LoadNodeParameterOptions.ts @@ -1,4 +1,4 @@ -import { +import type { ILoadOptions, INodeExecutionData, INodeProperties, @@ -7,8 +7,8 @@ import { IRunExecutionData, ITaskDataConnections, IWorkflowExecuteAdditionalData, - RoutingNode, } from 'n8n-workflow'; +import { RoutingNode } from 'n8n-workflow'; import * as NodeExecuteFunctions from './NodeExecuteFunctions'; import { LoadNodeDetails } from './LoadNodeDetails'; diff --git a/packages/core/src/NodeExecuteFunctions.ts b/packages/core/src/NodeExecuteFunctions.ts index 94a59290e4..c21da5fc2e 100644 --- a/packages/core/src/NodeExecuteFunctions.ts +++ b/packages/core/src/NodeExecuteFunctions.ts @@ -12,7 +12,7 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ /* eslint-disable @typescript-eslint/no-shadow */ /* eslint-disable no-param-reassign */ -import { +import type { GenericValue, IAdditionalCredentialOptions, IAllExecuteFunctions, @@ -39,22 +39,14 @@ import { IWorkflowDataProxyAdditionalKeys, IWorkflowDataProxyData, IWorkflowExecuteAdditionalData, - NodeApiError, - NodeHelpers, - NodeOperationError, Workflow, WorkflowActivateMode, - WorkflowDataProxy, WorkflowExecuteMode, - LoggerProxy as Logger, IExecuteData, - OAuth2GrantType, IGetNodeParameterOptions, NodeParameterValueType, NodeExecutionWithMetadata, IPairedItemData, - deepCopy, - fileTypeFromMimeType, ICredentialTestFunctions, BinaryHelperFunctions, RequestHelperFunctions, @@ -69,22 +61,34 @@ import { BinaryMetadata, FileSystemHelperFunctions, } from 'n8n-workflow'; +import { + NodeApiError, + NodeHelpers, + NodeOperationError, + WorkflowDataProxy, + LoggerProxy as Logger, + OAuth2GrantType, + deepCopy, + fileTypeFromMimeType, +} from 'n8n-workflow'; import { Agent } from 'https'; import { stringify } from 'qs'; -import clientOAuth1, { Token } from 'oauth-1.0a'; +import type { Token } from 'oauth-1.0a'; +import clientOAuth1 from 'oauth-1.0a'; import clientOAuth2 from 'client-oauth2'; import crypto, { createHmac } from 'crypto'; import get from 'lodash.get'; import type { Request, Response } from 'express'; import FormData from 'form-data'; import path from 'path'; -import { OptionsWithUri, OptionsWithUrl, RequestCallback, RequiredUriUrl } from 'request'; -import requestPromise, { RequestPromiseOptions } from 'request-promise-native'; +import type { OptionsWithUri, OptionsWithUrl, RequestCallback, RequiredUriUrl } from 'request'; +import type { RequestPromiseOptions } from 'request-promise-native'; +import requestPromise from 'request-promise-native'; import FileType from 'file-type'; import { lookup, extension } from 'mime-types'; -import { IncomingHttpHeaders } from 'http'; -import axios, { +import type { IncomingHttpHeaders } from 'http'; +import type { AxiosError, AxiosPromise, AxiosProxyConfig, @@ -92,6 +96,7 @@ import axios, { AxiosResponse, Method, } from 'axios'; +import axios from 'axios'; import url, { URL, URLSearchParams } from 'url'; import type { Readable } from 'stream'; import { access as fsAccess } from 'fs/promises'; diff --git a/packages/core/src/OAuth2Helper.ts b/packages/core/src/OAuth2Helper.ts index a3ade7036f..a66763505c 100644 --- a/packages/core/src/OAuth2Helper.ts +++ b/packages/core/src/OAuth2Helper.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { ICredentialDataDecryptedObject } from 'n8n-workflow'; -import clientOAuth2 from 'client-oauth2'; +import type { ICredentialDataDecryptedObject } from 'n8n-workflow'; +import type clientOAuth2 from 'client-oauth2'; export const getClientCredentialsToken = async ( oAuth2Client: clientOAuth2, diff --git a/packages/core/src/WorkflowExecute.ts b/packages/core/src/WorkflowExecute.ts index c5476629e0..5969504df1 100644 --- a/packages/core/src/WorkflowExecute.ts +++ b/packages/core/src/WorkflowExecute.ts @@ -11,7 +11,7 @@ /* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ import PCancelable from 'p-cancelable'; -import { +import type { ExecutionError, IConnection, IDataObject, @@ -30,13 +30,12 @@ import { IWaitingForExecution, IWaitingForExecutionSource, IWorkflowExecuteAdditionalData, - LoggerProxy as Logger, NodeApiError, NodeOperationError, Workflow, WorkflowExecuteMode, - WorkflowOperationError, } from 'n8n-workflow'; +import { LoggerProxy as Logger, WorkflowOperationError } from 'n8n-workflow'; import get from 'lodash.get'; import * as NodeExecuteFunctions from './NodeExecuteFunctions'; diff --git a/packages/node-dev/.eslintrc.js b/packages/node-dev/.eslintrc.js index 228cb3e921..8efac7bc90 100644 --- a/packages/node-dev/.eslintrc.js +++ b/packages/node-dev/.eslintrc.js @@ -10,6 +10,7 @@ module.exports = { 'templates/**', // TODO: remove this ], rules: { + '@typescript-eslint/consistent-type-imports': 'error', 'import/order': 'off', // TODO: remove this '@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': true }], }, diff --git a/packages/node-dev/commands/build.ts b/packages/node-dev/commands/build.ts index 9abd6c709c..8c9f10020d 100644 --- a/packages/node-dev/commands/build.ts +++ b/packages/node-dev/commands/build.ts @@ -1,7 +1,8 @@ import { UserSettings } from 'n8n-core'; import { Command, flags } from '@oclif/command'; -import { buildFiles, IBuildOptions } from '../src'; +import type { IBuildOptions } from '../src'; +import { buildFiles } from '../src'; export class Build extends Command { static description = 'Builds credentials and nodes and copies it to n8n custom extension folder'; diff --git a/packages/node-dev/src/Create.ts b/packages/node-dev/src/Create.ts index b88ad8d568..b24fd7a5bd 100644 --- a/packages/node-dev/src/Create.ts +++ b/packages/node-dev/src/Create.ts @@ -1,5 +1,6 @@ import * as fs from 'fs'; -import { replaceInFile, ReplaceInFileConfig } from 'replace-in-file'; +import type { ReplaceInFileConfig } from 'replace-in-file'; +import { replaceInFile } from 'replace-in-file'; // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires const { promisify } = require('util'); diff --git a/packages/workflow/.eslintrc.js b/packages/workflow/.eslintrc.js index 51b395f058..52e41e2d2d 100644 --- a/packages/workflow/.eslintrc.js +++ b/packages/workflow/.eslintrc.js @@ -9,6 +9,7 @@ module.exports = { ...sharedOptions(__dirname), rules: { + '@typescript-eslint/consistent-type-imports': 'error', 'import/order': 'off', // TODO: remove this }, }; diff --git a/packages/workflow/src/Expression.ts b/packages/workflow/src/Expression.ts index f1e6c18a0f..e1c1b0114e 100644 --- a/packages/workflow/src/Expression.ts +++ b/packages/workflow/src/Expression.ts @@ -1,7 +1,7 @@ import * as tmpl from '@n8n_io/riot-tmpl'; import { DateTime, Duration, Interval } from 'luxon'; -import { +import type { IExecuteData, INode, INodeExecutionData, @@ -20,12 +20,8 @@ import type { Workflow } from './Workflow'; // eslint-disable-next-line import/no-cycle import { extend, hasExpressionExtension, hasNativeMethod } from './Extensions'; -import { - ExpressionChunk, - ExpressionCode, - joinExpression, - splitExpression, -} from './Extensions/ExpressionParser'; +import type { ExpressionChunk, ExpressionCode } from './Extensions/ExpressionParser'; +import { joinExpression, splitExpression } from './Extensions/ExpressionParser'; import { extendTransform } from './Extensions/ExpressionExtension'; import { extendedFunctions } from './Extensions/ExtendedFunctions'; diff --git a/packages/workflow/src/Extensions/DateExtensions.ts b/packages/workflow/src/Extensions/DateExtensions.ts index 71571febed..a7c2d6cf62 100644 --- a/packages/workflow/src/Extensions/DateExtensions.ts +++ b/packages/workflow/src/Extensions/DateExtensions.ts @@ -1,7 +1,6 @@ /* eslint-disable @typescript-eslint/unbound-method */ /* eslint-disable @typescript-eslint/explicit-member-accessibility */ -import { - DateTime, +import type { DateTimeFormatOptions, DateTimeUnit, Duration, @@ -9,6 +8,7 @@ import { DurationObjectUnits, LocaleOptions, } from 'luxon'; +import { DateTime } from 'luxon'; import type { ExtensionMap } from './Extensions'; type DurationUnit = diff --git a/packages/workflow/src/Extensions/NumberExtensions.ts b/packages/workflow/src/Extensions/NumberExtensions.ts index afa20c0b65..b1c85fed44 100644 --- a/packages/workflow/src/Extensions/NumberExtensions.ts +++ b/packages/workflow/src/Extensions/NumberExtensions.ts @@ -2,7 +2,7 @@ * @jest-environment jsdom */ -import { ExtensionMap } from './Extensions'; +import type { ExtensionMap } from './Extensions'; function format(value: number, extraArgs: unknown[]): string { const [locales = 'en-US', config = {}] = extraArgs as [ diff --git a/packages/workflow/src/Interfaces.ts b/packages/workflow/src/Interfaces.ts index 7998728913..adb7ac8230 100644 --- a/packages/workflow/src/Interfaces.ts +++ b/packages/workflow/src/Interfaces.ts @@ -15,7 +15,7 @@ import type { WorkflowActivationError } from './WorkflowActivationError'; import type { WorkflowOperationError } from './WorkflowErrors'; import type { NodeApiError, NodeOperationError } from './NodeErrors'; import type { ExpressionError } from './ExpressionError'; -import { PathLike } from 'fs'; +import type { PathLike } from 'fs'; export interface IAdditionalCredentialOptions { oauth2?: IOAuth2Options; diff --git a/packages/workflow/src/LoggerProxy.ts b/packages/workflow/src/LoggerProxy.ts index 55d3219070..c056013ddb 100644 --- a/packages/workflow/src/LoggerProxy.ts +++ b/packages/workflow/src/LoggerProxy.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { ILogger, LogTypes } from './Interfaces'; +import type { ILogger, LogTypes } from './Interfaces'; let logger: ILogger | undefined; diff --git a/packages/workflow/src/MessageEventBus.ts b/packages/workflow/src/MessageEventBus.ts index e9bf3e8dfa..cf604ea655 100644 --- a/packages/workflow/src/MessageEventBus.ts +++ b/packages/workflow/src/MessageEventBus.ts @@ -1,5 +1,5 @@ -import { DateTime } from 'luxon'; -import { INodeCredentials } from './Interfaces'; +import type { DateTime } from 'luxon'; +import type { INodeCredentials } from './Interfaces'; // =============================== // General Enums And Interfaces diff --git a/packages/workflow/src/NodeErrors.ts b/packages/workflow/src/NodeErrors.ts index 694a9d18fc..983206408b 100644 --- a/packages/workflow/src/NodeErrors.ts +++ b/packages/workflow/src/NodeErrors.ts @@ -7,7 +7,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ // eslint-disable-next-line max-classes-per-file import { parseString } from 'xml2js'; -import { IDataObject, INode, IStatusCodeMessages, JsonObject } from './Interfaces'; +import type { IDataObject, INode, IStatusCodeMessages, JsonObject } from './Interfaces'; /** * Top-level properties where an error message can be found in an API response. diff --git a/packages/workflow/src/NodeHelpers.ts b/packages/workflow/src/NodeHelpers.ts index 4d52368e99..33ea1cf708 100644 --- a/packages/workflow/src/NodeHelpers.ts +++ b/packages/workflow/src/NodeHelpers.ts @@ -15,7 +15,7 @@ import get from 'lodash.get'; import isEqual from 'lodash.isequal'; -import { +import type { IContextObject, INode, INodeCredentialDescription, diff --git a/packages/workflow/src/ObservableObject.ts b/packages/workflow/src/ObservableObject.ts index a0b50608b5..4f97de1a19 100644 --- a/packages/workflow/src/ObservableObject.ts +++ b/packages/workflow/src/ObservableObject.ts @@ -2,7 +2,7 @@ /* eslint-disable @typescript-eslint/no-shadow */ /* eslint-disable no-param-reassign */ /* eslint-disable no-underscore-dangle */ -import { IDataObject, IObservableObject } from './Interfaces'; +import type { IDataObject, IObservableObject } from './Interfaces'; interface IObservableOptions { ignoreEmptyOnFirstChild?: boolean; diff --git a/packages/workflow/src/RoutingNode.ts b/packages/workflow/src/RoutingNode.ts index 068fb148be..932ef81e7d 100644 --- a/packages/workflow/src/RoutingNode.ts +++ b/packages/workflow/src/RoutingNode.ts @@ -13,7 +13,7 @@ import get from 'lodash.get'; import merge from 'lodash.merge'; import set from 'lodash.set'; -import { +import type { ICredentialDataDecryptedObject, ICredentialsDecrypted, IHttpRequestOptions, diff --git a/packages/workflow/src/TelemetryHelpers.ts b/packages/workflow/src/TelemetryHelpers.ts index b53e609aea..42a3c52981 100644 --- a/packages/workflow/src/TelemetryHelpers.ts +++ b/packages/workflow/src/TelemetryHelpers.ts @@ -1,4 +1,4 @@ -import { +import type { IConnection, INode, INodeNameIndex, diff --git a/packages/workflow/src/Workflow.ts b/packages/workflow/src/Workflow.ts index 375b56e339..0be3970582 100644 --- a/packages/workflow/src/Workflow.ts +++ b/packages/workflow/src/Workflow.ts @@ -14,7 +14,7 @@ /* eslint-disable no-continue */ /* eslint-disable no-restricted-syntax */ -import { +import type { IConnections, IExecuteResponsePromiseData, IGetExecuteTriggerFunctions, @@ -49,7 +49,7 @@ import { IRunNodeResponse, NodeParameterValueType, } from './Interfaces'; -import { IDeferredPromise } from './DeferredPromise'; +import type { IDeferredPromise } from './DeferredPromise'; import * as NodeHelpers from './NodeHelpers'; import * as ObservableObject from './ObservableObject'; diff --git a/packages/workflow/src/WorkflowActivationError.ts b/packages/workflow/src/WorkflowActivationError.ts index f2e182afe9..dd1ba2c422 100644 --- a/packages/workflow/src/WorkflowActivationError.ts +++ b/packages/workflow/src/WorkflowActivationError.ts @@ -1,4 +1,4 @@ -import { INode } from './Interfaces'; +import type { INode } from './Interfaces'; import { ExecutionBaseError } from './NodeErrors'; interface WorkflowActivationErrorOptions { diff --git a/packages/workflow/src/WorkflowDataProxy.ts b/packages/workflow/src/WorkflowDataProxy.ts index d8a8eafe47..d80966c995 100644 --- a/packages/workflow/src/WorkflowDataProxy.ts +++ b/packages/workflow/src/WorkflowDataProxy.ts @@ -10,7 +10,7 @@ import { DateTime, Duration, Interval, Settings } from 'luxon'; import * as jmespath from 'jmespath'; -import { +import type { IDataObject, IExecuteData, INodeExecutionData, diff --git a/packages/workflow/src/WorkflowHooks.ts b/packages/workflow/src/WorkflowHooks.ts index 3392d080da..cb7a15b8b3 100644 --- a/packages/workflow/src/WorkflowHooks.ts +++ b/packages/workflow/src/WorkflowHooks.ts @@ -1,4 +1,4 @@ -import { +import type { IWorkflowBase, IWorkflowExecuteHooks, IWorkflowHooksOptionalParameters, diff --git a/packages/workflow/src/type-guards.ts b/packages/workflow/src/type-guards.ts index a669c254ef..51b08b9e66 100644 --- a/packages/workflow/src/type-guards.ts +++ b/packages/workflow/src/type-guards.ts @@ -1,4 +1,4 @@ -import { +import type { INodeProperties, INodePropertyOptions, INodePropertyCollection, diff --git a/packages/workflow/src/utils.ts b/packages/workflow/src/utils.ts index d7fdbf26e6..9bb0444339 100644 --- a/packages/workflow/src/utils.ts +++ b/packages/workflow/src/utils.ts @@ -1,4 +1,4 @@ -import { BinaryFileType } from './Interfaces'; +import type { BinaryFileType } from './Interfaces'; export type Primitives = string | number | boolean | bigint | symbol | null | undefined;