refactor(core): Move Logger to core (no-changelog) (#12310)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-12-23 13:46:13 +01:00
committed by GitHub
parent b4c77f27b6
commit 471d7b9420
142 changed files with 328 additions and 302 deletions

View File

@@ -56,7 +56,7 @@ void (async function start() {
if (config.sentryConfig.sentryDsn) { if (config.sentryConfig.sentryDsn) {
const { ErrorReporter } = await import('n8n-core'); const { ErrorReporter } = await import('n8n-core');
errorReporter = new ErrorReporter(); errorReporter = Container.get(ErrorReporter);
await errorReporter.init('task_runner', config.sentryConfig.sentryDsn); await errorReporter.init('task_runner', config.sentryConfig.sentryDsn);
} }

View File

@@ -104,7 +104,6 @@
"bcryptjs": "2.4.3", "bcryptjs": "2.4.3",
"bull": "4.12.1", "bull": "4.12.1",
"cache-manager": "5.2.3", "cache-manager": "5.2.3",
"callsites": "3.1.0",
"change-case": "4.1.2", "change-case": "4.1.2",
"class-transformer": "0.5.1", "class-transformer": "0.5.1",
"class-validator": "0.14.0", "class-validator": "0.14.0",
@@ -149,7 +148,7 @@
"p-cancelable": "2.1.1", "p-cancelable": "2.1.1",
"p-lazy": "3.1.0", "p-lazy": "3.1.0",
"pg": "8.12.0", "pg": "8.12.0",
"picocolors": "1.0.1", "picocolors": "catalog:",
"pkce-challenge": "3.0.0", "pkce-challenge": "3.0.0",
"posthog-node": "3.2.1", "posthog-node": "3.2.1",
"prom-client": "13.2.0", "prom-client": "13.2.0",
@@ -169,7 +168,6 @@
"typedi": "catalog:", "typedi": "catalog:",
"uuid": "catalog:", "uuid": "catalog:",
"validator": "13.7.0", "validator": "13.7.0",
"winston": "3.14.2",
"ws": "8.17.1", "ws": "8.17.1",
"xml2js": "catalog:", "xml2js": "catalog:",
"xmllint-wasm": "3.0.1", "xmllint-wasm": "3.0.1",

View File

@@ -5,6 +5,7 @@ import { engine as expressHandlebars } from 'express-handlebars';
import { readFile } from 'fs/promises'; import { readFile } from 'fs/promises';
import type { Server } from 'http'; import type { Server } from 'http';
import isbot from 'isbot'; import isbot from 'isbot';
import { Logger } from 'n8n-core';
import { Container, Service } from 'typedi'; import { Container, Service } from 'typedi';
import config from '@/config'; import config from '@/config';
@@ -12,7 +13,6 @@ import { N8N_VERSION, TEMPLATES_DIR, inDevelopment, inTest } from '@/constants';
import * as Db from '@/db'; import * as Db from '@/db';
import { OnShutdown } from '@/decorators/on-shutdown'; import { OnShutdown } from '@/decorators/on-shutdown';
import { ExternalHooks } from '@/external-hooks'; import { ExternalHooks } from '@/external-hooks';
import { Logger } from '@/logging/logger.service';
import { rawBodyReader, bodyParser, corsMiddleware } from '@/middlewares'; import { rawBodyReader, bodyParser, corsMiddleware } from '@/middlewares';
import { send, sendErrorResponse } from '@/response-helper'; import { send, sendErrorResponse } from '@/response-helper';
import { LiveWebhooks } from '@/webhooks/live-webhooks'; import { LiveWebhooks } from '@/webhooks/live-webhooks';

View File

@@ -1,3 +1,4 @@
import { Logger } from 'n8n-core';
import type { import type {
IDeferredPromise, IDeferredPromise,
IExecuteResponsePromiseData, IExecuteResponsePromiseData,
@@ -18,7 +19,6 @@ import type {
IExecutionDb, IExecutionDb,
IExecutionsCurrentSummary, IExecutionsCurrentSummary,
} from '@/interfaces'; } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import { isWorkflowIdValid } from '@/utils'; import { isWorkflowIdValid } from '@/utils';
import { ConcurrencyControlService } from './concurrency/concurrency-control.service'; import { ConcurrencyControlService } from './concurrency/concurrency-control.service';

View File

@@ -3,6 +3,7 @@ import {
ActiveWorkflows, ActiveWorkflows,
ErrorReporter, ErrorReporter,
InstanceSettings, InstanceSettings,
Logger,
PollContext, PollContext,
TriggerContext, TriggerContext,
} from 'n8n-core'; } from 'n8n-core';
@@ -42,7 +43,6 @@ import { OnShutdown } from '@/decorators/on-shutdown';
import { ExecutionService } from '@/executions/execution.service'; import { ExecutionService } from '@/executions/execution.service';
import { ExternalHooks } from '@/external-hooks'; import { ExternalHooks } from '@/external-hooks';
import type { IWorkflowDb } from '@/interfaces'; import type { IWorkflowDb } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import { NodeTypes } from '@/node-types'; import { NodeTypes } from '@/node-types';
import { Publisher } from '@/scaling/pubsub/publisher.service'; import { Publisher } from '@/scaling/pubsub/publisher.service';
import { ActiveWorkflowsService } from '@/services/active-workflows.service'; import { ActiveWorkflowsService } from '@/services/active-workflows.service';

View File

@@ -2,6 +2,7 @@ import { GlobalConfig } from '@n8n/config';
import { createHash } from 'crypto'; import { createHash } from 'crypto';
import type { NextFunction, Response } from 'express'; import type { NextFunction, Response } from 'express';
import { JsonWebTokenError, TokenExpiredError } from 'jsonwebtoken'; import { JsonWebTokenError, TokenExpiredError } from 'jsonwebtoken';
import { Logger } from 'n8n-core';
import Container, { Service } from 'typedi'; import Container, { Service } from 'typedi';
import config from '@/config'; import config from '@/config';
@@ -12,7 +13,6 @@ import { UserRepository } from '@/databases/repositories/user.repository';
import { AuthError } from '@/errors/response-errors/auth.error'; import { AuthError } from '@/errors/response-errors/auth.error';
import { ForbiddenError } from '@/errors/response-errors/forbidden.error'; import { ForbiddenError } from '@/errors/response-errors/forbidden.error';
import { License } from '@/license'; import { License } from '@/license';
import { Logger } from '@/logging/logger.service';
import type { AuthenticatedRequest } from '@/requests'; import type { AuthenticatedRequest } from '@/requests';
import { JwtService } from '@/services/jwt.service'; import { JwtService } from '@/services/jwt.service';
import { UrlService } from '@/services/url.service'; import { UrlService } from '@/services/url.service';

View File

@@ -4,6 +4,7 @@ import { Command, Errors } from '@oclif/core';
import { import {
BinaryDataService, BinaryDataService,
InstanceSettings, InstanceSettings,
Logger,
ObjectStoreService, ObjectStoreService,
DataDeduplicationService, DataDeduplicationService,
ErrorReporter, ErrorReporter,
@@ -25,7 +26,6 @@ import { ExternalHooks } from '@/external-hooks';
import { ExternalSecretsManager } from '@/external-secrets/external-secrets-manager.ee'; import { ExternalSecretsManager } from '@/external-secrets/external-secrets-manager.ee';
import { License } from '@/license'; import { License } from '@/license';
import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials'; import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials';
import { Logger } from '@/logging/logger.service';
import { NodeTypes } from '@/node-types'; import { NodeTypes } from '@/node-types';
import { PostHogClient } from '@/posthog'; import { PostHogClient } from '@/posthog';
import { ShutdownService } from '@/shutdown/shutdown.service'; import { ShutdownService } from '@/shutdown/shutdown.service';

View File

@@ -1,10 +1,10 @@
import type { Migration, MigrationExecutor } from '@n8n/typeorm'; import type { Migration, MigrationExecutor } from '@n8n/typeorm';
import { type DataSource } from '@n8n/typeorm'; import { type DataSource } from '@n8n/typeorm';
import { mock } from 'jest-mock-extended'; import { mock } from 'jest-mock-extended';
import { Logger } from 'n8n-core';
import { main } from '@/commands/db/revert'; import { main } from '@/commands/db/revert';
import type { IrreversibleMigration, ReversibleMigration } from '@/databases/types'; import type { IrreversibleMigration, ReversibleMigration } from '@/databases/types';
import { Logger } from '@/logging/logger.service';
import { mockInstance } from '@test/mocking'; import { mockInstance } from '@test/mocking';
const logger = mockInstance(Logger); const logger = mockInstance(Logger);

View File

@@ -3,12 +3,12 @@ import type { DataSourceOptions as ConnectionOptions } from '@n8n/typeorm';
// eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import
import { MigrationExecutor, DataSource as Connection } from '@n8n/typeorm'; import { MigrationExecutor, DataSource as Connection } from '@n8n/typeorm';
import { Command, Flags } from '@oclif/core'; import { Command, Flags } from '@oclif/core';
import { Logger } from 'n8n-core';
import { Container } from 'typedi'; import { Container } from 'typedi';
import { getConnectionOptions } from '@/databases/config'; import { getConnectionOptions } from '@/databases/config';
import type { Migration } from '@/databases/types'; import type { Migration } from '@/databases/types';
import { wrapMigration } from '@/databases/utils/migration-helpers'; import { wrapMigration } from '@/databases/utils/migration-helpers';
import { Logger } from '@/logging/logger.service';
// This function is extracted to make it easier to unit test it. // This function is extracted to make it easier to unit test it.
// Mocking turned into a mess due to this command using typeorm and the db // Mocking turned into a mess due to this command using typeorm and the db

View File

@@ -7,7 +7,6 @@ import { WorkerMissingEncryptionKey } from '@/errors/worker-missing-encryption-k
import { EventMessageGeneric } from '@/eventbus/event-message-classes/event-message-generic'; import { EventMessageGeneric } from '@/eventbus/event-message-classes/event-message-generic';
import { MessageEventBus } from '@/eventbus/message-event-bus/message-event-bus'; import { MessageEventBus } from '@/eventbus/message-event-bus/message-event-bus';
import { LogStreamingEventRelay } from '@/events/relays/log-streaming.event-relay'; import { LogStreamingEventRelay } from '@/events/relays/log-streaming.event-relay';
import { Logger } from '@/logging/logger.service';
import { PubSubHandler } from '@/scaling/pubsub/pubsub-handler'; import { PubSubHandler } from '@/scaling/pubsub/pubsub-handler';
import { Subscriber } from '@/scaling/pubsub/subscriber.service'; import { Subscriber } from '@/scaling/pubsub/subscriber.service';
import type { ScalingService } from '@/scaling/scaling.service'; import type { ScalingService } from '@/scaling/scaling.service';
@@ -67,7 +66,7 @@ export class Worker extends BaseCommand {
super(argv, cmdConfig); super(argv, cmdConfig);
this.logger = Container.get(Logger).scoped('scaling'); this.logger = this.logger.scoped('scaling');
} }
async init() { async init() {

View File

@@ -1,3 +1,4 @@
import { Logger } from 'n8n-core';
import type { WorkflowExecuteMode as ExecutionMode } from 'n8n-workflow'; import type { WorkflowExecuteMode as ExecutionMode } from 'n8n-workflow';
import { Service } from 'typedi'; import { Service } from 'typedi';
@@ -7,7 +8,6 @@ import { InvalidConcurrencyLimitError } from '@/errors/invalid-concurrency-limit
import { UnknownExecutionModeError } from '@/errors/unknown-execution-mode.error'; import { UnknownExecutionModeError } from '@/errors/unknown-execution-mode.error';
import { EventService } from '@/events/event.service'; import { EventService } from '@/events/event.service';
import type { IExecutingWorkflowData } from '@/interfaces'; import type { IExecutingWorkflowData } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import { Telemetry } from '@/telemetry'; import { Telemetry } from '@/telemetry';
import { ConcurrencyQueue } from './concurrency-queue'; import { ConcurrencyQueue } from './concurrency-queue';

View File

@@ -3,7 +3,9 @@ import convict from 'convict';
import { flatten } from 'flat'; import { flatten } from 'flat';
import { readFileSync } from 'fs'; import { readFileSync } from 'fs';
import merge from 'lodash/merge'; import merge from 'lodash/merge';
import { Logger } from 'n8n-core';
import { ApplicationError, setGlobalState } from 'n8n-workflow'; import { ApplicationError, setGlobalState } from 'n8n-workflow';
import assert from 'node:assert';
import colors from 'picocolors'; import colors from 'picocolors';
import { Container } from 'typedi'; import { Container } from 'typedi';
@@ -31,13 +33,15 @@ const config = convict(schema, { args: [] });
// eslint-disable-next-line @typescript-eslint/unbound-method // eslint-disable-next-line @typescript-eslint/unbound-method
config.getEnv = config.get; config.getEnv = config.get;
const logger = Container.get(Logger);
const globalConfig = Container.get(GlobalConfig);
// Load overwrites when not in tests // Load overwrites when not in tests
if (!inE2ETests && !inTest) { if (!inE2ETests && !inTest) {
// Overwrite default configuration with settings which got defined in // Overwrite default configuration with settings which got defined in
// optional configuration files // optional configuration files
const { N8N_CONFIG_FILES } = process.env; const { N8N_CONFIG_FILES } = process.env;
if (N8N_CONFIG_FILES !== undefined) { if (N8N_CONFIG_FILES !== undefined) {
const globalConfig = Container.get(GlobalConfig);
const configFiles = N8N_CONFIG_FILES.split(','); const configFiles = N8N_CONFIG_FILES.split(',');
for (const configFile of configFiles) { for (const configFile of configFiles) {
if (!configFile) continue; if (!configFile) continue;
@@ -58,9 +62,10 @@ if (!inE2ETests && !inTest) {
} }
} }
} }
console.debug('Loaded config overwrites from', configFile); logger.debug(`Loaded config overwrites from ${configFile}`);
} catch (error) { } catch (error) {
console.error('Error loading config file', configFile, error); assert(error instanceof Error);
logger.error(`Error loading config file ${configFile}`, { error });
} }
} }
} }
@@ -96,7 +101,7 @@ config.validate({
const userManagement = config.get('userManagement'); const userManagement = config.get('userManagement');
if (userManagement.jwtRefreshTimeoutHours >= userManagement.jwtSessionDurationHours) { if (userManagement.jwtRefreshTimeoutHours >= userManagement.jwtSessionDurationHours) {
if (!inTest) if (!inTest)
console.warn( logger.warn(
'N8N_USER_MANAGEMENT_JWT_REFRESH_TIMEOUT_HOURS needs to smaller than N8N_USER_MANAGEMENT_JWT_DURATION_HOURS. Setting N8N_USER_MANAGEMENT_JWT_REFRESH_TIMEOUT_HOURS to 0 for now.', 'N8N_USER_MANAGEMENT_JWT_REFRESH_TIMEOUT_HOURS needs to smaller than N8N_USER_MANAGEMENT_JWT_DURATION_HOURS. Setting N8N_USER_MANAGEMENT_JWT_REFRESH_TIMEOUT_HOURS to 0 for now.',
); );
@@ -105,16 +110,16 @@ if (userManagement.jwtRefreshTimeoutHours >= userManagement.jwtSessionDurationHo
const executionProcess = config.getEnv('executions.process'); const executionProcess = config.getEnv('executions.process');
if (executionProcess) { if (executionProcess) {
console.error( logger.error(
colors.yellow('Please unset the deprecated env variable'), colors.yellow('Please unset the deprecated env variable') +
colors.bold(colors.yellow('EXECUTIONS_PROCESS')), colors.bold(colors.yellow('EXECUTIONS_PROCESS')),
); );
} }
if (executionProcess === 'own') { if (executionProcess === 'own') {
console.error( logger.error(
colors.bold(colors.red('Application failed to start because "Own" mode has been removed.')), colors.bold(colors.red('Application failed to start because "Own" mode has been removed.')),
); );
console.error( logger.error(
colors.red( colors.red(
'If you need the isolation and performance gains, please consider using queue mode instead.\n\n', 'If you need the isolation and performance gains, please consider using queue mode instead.\n\n',
), ),
@@ -123,7 +128,7 @@ if (executionProcess === 'own') {
} }
setGlobalState({ setGlobalState({
defaultTimezone: Container.get(GlobalConfig).generic.timezone, defaultTimezone: globalConfig.generic.timezone,
}); });
// eslint-disable-next-line import/no-default-export // eslint-disable-next-line import/no-default-export

View File

@@ -1,4 +1,5 @@
import { Response } from 'express'; import { Response } from 'express';
import { Logger } from 'n8n-core';
import { ApplicationError } from 'n8n-workflow'; import { ApplicationError } from 'n8n-workflow';
import validator from 'validator'; import validator from 'validator';
@@ -14,7 +15,6 @@ import { ForbiddenError } from '@/errors/response-errors/forbidden.error';
import { EventService } from '@/events/event.service'; import { EventService } from '@/events/event.service';
import type { PublicUser } from '@/interfaces'; import type { PublicUser } from '@/interfaces';
import { License } from '@/license'; import { License } from '@/license';
import { Logger } from '@/logging/logger.service';
import { MfaService } from '@/mfa/mfa.service'; import { MfaService } from '@/mfa/mfa.service';
import { PostHogClient } from '@/posthog'; import { PostHogClient } from '@/posthog';
import { AuthenticatedRequest, LoginRequest, UserRequest } from '@/requests'; import { AuthenticatedRequest, LoginRequest, UserRequest } from '@/requests';

View File

@@ -1,5 +1,6 @@
import type { PushMessage } from '@n8n/api-types'; import type { PushMessage } from '@n8n/api-types';
import { Request } from 'express'; import { Request } from 'express';
import { Logger } from 'n8n-core';
import Container from 'typedi'; import Container from 'typedi';
import { v4 as uuid } from 'uuid'; import { v4 as uuid } from 'uuid';
@@ -14,7 +15,6 @@ import { MessageEventBus } from '@/eventbus/message-event-bus/message-event-bus'
import type { BooleanLicenseFeature, NumericLicenseFeature } from '@/interfaces'; import type { BooleanLicenseFeature, NumericLicenseFeature } from '@/interfaces';
import type { FeatureReturnType } from '@/license'; import type { FeatureReturnType } from '@/license';
import { License } from '@/license'; import { License } from '@/license';
import { Logger } from '@/logging/logger.service';
import { MfaService } from '@/mfa/mfa.service'; import { MfaService } from '@/mfa/mfa.service';
import { Push } from '@/push'; import { Push } from '@/push';
import type { UserSetupPayload } from '@/requests'; import type { UserSetupPayload } from '@/requests';

View File

@@ -1,4 +1,5 @@
import { Response } from 'express'; import { Response } from 'express';
import { Logger } from 'n8n-core';
import validator from 'validator'; import validator from 'validator';
import { AuthService } from '@/auth/auth.service'; import { AuthService } from '@/auth/auth.service';
@@ -12,7 +13,6 @@ import { ForbiddenError } from '@/errors/response-errors/forbidden.error';
import { EventService } from '@/events/event.service'; import { EventService } from '@/events/event.service';
import { ExternalHooks } from '@/external-hooks'; import { ExternalHooks } from '@/external-hooks';
import { License } from '@/license'; import { License } from '@/license';
import { Logger } from '@/logging/logger.service';
import { PostHogClient } from '@/posthog'; import { PostHogClient } from '@/posthog';
import { UserRequest } from '@/requests'; import { UserRequest } from '@/requests';
import { PasswordUtility } from '@/services/password.utility'; import { PasswordUtility } from '@/services/password.utility';

View File

@@ -5,6 +5,7 @@ import {
} from '@n8n/api-types'; } from '@n8n/api-types';
import { plainToInstance } from 'class-transformer'; import { plainToInstance } from 'class-transformer';
import { Response } from 'express'; import { Response } from 'express';
import { Logger } from 'n8n-core';
import { AuthService } from '@/auth/auth.service'; import { AuthService } from '@/auth/auth.service';
import type { User } from '@/databases/entities/user'; import type { User } from '@/databases/entities/user';
@@ -16,7 +17,6 @@ import { EventService } from '@/events/event.service';
import { ExternalHooks } from '@/external-hooks'; import { ExternalHooks } from '@/external-hooks';
import { validateEntity } from '@/generic-helpers'; import { validateEntity } from '@/generic-helpers';
import type { PublicUser } from '@/interfaces'; import type { PublicUser } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import { MfaService } from '@/mfa/mfa.service'; import { MfaService } from '@/mfa/mfa.service';
import { AuthenticatedRequest, MeRequest } from '@/requests'; import { AuthenticatedRequest, MeRequest } from '@/requests';
import { PasswordUtility } from '@/services/password.utility'; import { PasswordUtility } from '@/services/password.utility';

View File

@@ -2,6 +2,7 @@ import Csrf from 'csrf';
import type { Response } from 'express'; import type { Response } from 'express';
import { mock } from 'jest-mock-extended'; import { mock } from 'jest-mock-extended';
import { Cipher } from 'n8n-core'; import { Cipher } from 'n8n-core';
import { Logger } from 'n8n-core';
import nock from 'nock'; import nock from 'nock';
import Container from 'typedi'; import Container from 'typedi';
@@ -16,7 +17,6 @@ import { VariablesService } from '@/environments/variables/variables.service.ee'
import { BadRequestError } from '@/errors/response-errors/bad-request.error'; import { BadRequestError } from '@/errors/response-errors/bad-request.error';
import { NotFoundError } from '@/errors/response-errors/not-found.error'; import { NotFoundError } from '@/errors/response-errors/not-found.error';
import { ExternalHooks } from '@/external-hooks'; import { ExternalHooks } from '@/external-hooks';
import { Logger } from '@/logging/logger.service';
import type { OAuthRequest } from '@/requests'; import type { OAuthRequest } from '@/requests';
import { SecretsHelper } from '@/secrets-helpers'; import { SecretsHelper } from '@/secrets-helpers';
import { mockInstance } from '@test/mocking'; import { mockInstance } from '@test/mocking';

View File

@@ -2,6 +2,7 @@ import Csrf from 'csrf';
import { type Response } from 'express'; import { type Response } from 'express';
import { mock } from 'jest-mock-extended'; import { mock } from 'jest-mock-extended';
import { Cipher } from 'n8n-core'; import { Cipher } from 'n8n-core';
import { Logger } from 'n8n-core';
import nock from 'nock'; import nock from 'nock';
import Container from 'typedi'; import Container from 'typedi';
@@ -16,7 +17,6 @@ import { VariablesService } from '@/environments/variables/variables.service.ee'
import { BadRequestError } from '@/errors/response-errors/bad-request.error'; import { BadRequestError } from '@/errors/response-errors/bad-request.error';
import { NotFoundError } from '@/errors/response-errors/not-found.error'; import { NotFoundError } from '@/errors/response-errors/not-found.error';
import { ExternalHooks } from '@/external-hooks'; import { ExternalHooks } from '@/external-hooks';
import { Logger } from '@/logging/logger.service';
import type { OAuthRequest } from '@/requests'; import type { OAuthRequest } from '@/requests';
import { SecretsHelper } from '@/secrets-helpers'; import { SecretsHelper } from '@/secrets-helpers';
import { mockInstance } from '@test/mocking'; import { mockInstance } from '@test/mocking';

View File

@@ -1,7 +1,7 @@
import { GlobalConfig } from '@n8n/config'; import { GlobalConfig } from '@n8n/config';
import Csrf from 'csrf'; import Csrf from 'csrf';
import type { Response } from 'express'; import type { Response } from 'express';
import { Credentials } from 'n8n-core'; import { Credentials, Logger } from 'n8n-core';
import type { ICredentialDataDecryptedObject, IWorkflowExecuteAdditionalData } from 'n8n-workflow'; import type { ICredentialDataDecryptedObject, IWorkflowExecuteAdditionalData } from 'n8n-workflow';
import { jsonParse, ApplicationError } from 'n8n-workflow'; import { jsonParse, ApplicationError } from 'n8n-workflow';
import { Service } from 'typedi'; import { Service } from 'typedi';
@@ -16,7 +16,6 @@ import { BadRequestError } from '@/errors/response-errors/bad-request.error';
import { NotFoundError } from '@/errors/response-errors/not-found.error'; import { NotFoundError } from '@/errors/response-errors/not-found.error';
import { ExternalHooks } from '@/external-hooks'; import { ExternalHooks } from '@/external-hooks';
import type { ICredentialsDb } from '@/interfaces'; import type { ICredentialsDb } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import type { AuthenticatedRequest, OAuthRequest } from '@/requests'; import type { AuthenticatedRequest, OAuthRequest } from '@/requests';
import { UrlService } from '@/services/url.service'; import { UrlService } from '@/services/url.service';
import * as WorkflowExecuteAdditionalData from '@/workflow-execute-additional-data'; import * as WorkflowExecuteAdditionalData from '@/workflow-execute-additional-data';

View File

@@ -1,4 +1,5 @@
import { Response } from 'express'; import { Response } from 'express';
import { Logger } from 'n8n-core';
import validator from 'validator'; import validator from 'validator';
import { AuthService } from '@/auth/auth.service'; import { AuthService } from '@/auth/auth.service';
@@ -9,7 +10,6 @@ import { GlobalScope, Post, RestController } from '@/decorators';
import { BadRequestError } from '@/errors/response-errors/bad-request.error'; import { BadRequestError } from '@/errors/response-errors/bad-request.error';
import { EventService } from '@/events/event.service'; import { EventService } from '@/events/event.service';
import { validateEntity } from '@/generic-helpers'; import { validateEntity } from '@/generic-helpers';
import { Logger } from '@/logging/logger.service';
import { PostHogClient } from '@/posthog'; import { PostHogClient } from '@/posthog';
import { OwnerRequest } from '@/requests'; import { OwnerRequest } from '@/requests';
import { PasswordUtility } from '@/services/password.utility'; import { PasswordUtility } from '@/services/password.utility';

View File

@@ -1,4 +1,5 @@
import { Response } from 'express'; import { Response } from 'express';
import { Logger } from 'n8n-core';
import validator from 'validator'; import validator from 'validator';
import { AuthService } from '@/auth/auth.service'; import { AuthService } from '@/auth/auth.service';
@@ -13,7 +14,6 @@ import { UnprocessableRequestError } from '@/errors/response-errors/unprocessabl
import { EventService } from '@/events/event.service'; import { EventService } from '@/events/event.service';
import { ExternalHooks } from '@/external-hooks'; import { ExternalHooks } from '@/external-hooks';
import { License } from '@/license'; import { License } from '@/license';
import { Logger } from '@/logging/logger.service';
import { MfaService } from '@/mfa/mfa.service'; import { MfaService } from '@/mfa/mfa.service';
import { PasswordResetRequest } from '@/requests'; import { PasswordResetRequest } from '@/requests';
import { PasswordUtility } from '@/services/password.utility'; import { PasswordUtility } from '@/services/password.utility';

View File

@@ -1,5 +1,6 @@
import { RoleChangeRequestDto, SettingsUpdateRequestDto } from '@n8n/api-types'; import { RoleChangeRequestDto, SettingsUpdateRequestDto } from '@n8n/api-types';
import { Response } from 'express'; import { Response } from 'express';
import { Logger } from 'n8n-core';
import { AuthService } from '@/auth/auth.service'; import { AuthService } from '@/auth/auth.service';
import { CredentialsService } from '@/credentials/credentials.service'; import { CredentialsService } from '@/credentials/credentials.service';
@@ -18,7 +19,6 @@ import { NotFoundError } from '@/errors/response-errors/not-found.error';
import { EventService } from '@/events/event.service'; import { EventService } from '@/events/event.service';
import { ExternalHooks } from '@/external-hooks'; import { ExternalHooks } from '@/external-hooks';
import type { PublicUser } from '@/interfaces'; import type { PublicUser } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import { listQueryMiddleware } from '@/middlewares'; import { listQueryMiddleware } from '@/middlewares';
import { AuthenticatedRequest, ListQuery, UserRequest } from '@/requests'; import { AuthenticatedRequest, ListQuery, UserRequest } from '@/requests';
import { ProjectService } from '@/services/project.service'; import { ProjectService } from '@/services/project.service';

View File

@@ -1,4 +1,5 @@
import { Response, NextFunction } from 'express'; import { Response, NextFunction } from 'express';
import { Logger } from 'n8n-core';
import type { WorkflowStatistics } from '@/databases/entities/workflow-statistics'; import type { WorkflowStatistics } from '@/databases/entities/workflow-statistics';
import { StatisticsNames } from '@/databases/entities/workflow-statistics'; import { StatisticsNames } from '@/databases/entities/workflow-statistics';
@@ -7,7 +8,6 @@ import { WorkflowStatisticsRepository } from '@/databases/repositories/workflow-
import { Get, Middleware, RestController } from '@/decorators'; import { Get, Middleware, RestController } from '@/decorators';
import { NotFoundError } from '@/errors/response-errors/not-found.error'; import { NotFoundError } from '@/errors/response-errors/not-found.error';
import type { IWorkflowStatisticsDataLoaded } from '@/interfaces'; import type { IWorkflowStatisticsDataLoaded } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import { StatisticsRequest } from './workflow-statistics.types'; import { StatisticsRequest } from './workflow-statistics.types';

View File

@@ -1,12 +1,11 @@
import { existsSync } from 'fs'; import { existsSync } from 'fs';
import { mkdir, utimes, open, rm } from 'fs/promises'; import { mkdir, utimes, open, rm } from 'fs/promises';
import { InstanceSettings } from 'n8n-core'; import { InstanceSettings, Logger } from 'n8n-core';
import { sleep } from 'n8n-workflow'; import { sleep } from 'n8n-workflow';
import { join, dirname } from 'path'; import { join, dirname } from 'path';
import { Container } from 'typedi'; import { Container } from 'typedi';
import { inProduction } from '@/constants'; import { inProduction } from '@/constants';
import { Logger } from '@/logging/logger.service';
export const touchFile = async (filePath: string): Promise<void> => { export const touchFile = async (filePath: string): Promise<void> => {
await mkdir(dirname(filePath), { recursive: true }); await mkdir(dirname(filePath), { recursive: true });

View File

@@ -1,11 +1,11 @@
import { GlobalConfig } from '@n8n/config'; import { GlobalConfig } from '@n8n/config';
import { Logger } from 'n8n-core';
import type { ICredentialDataDecryptedObject } from 'n8n-workflow'; import type { ICredentialDataDecryptedObject } from 'n8n-workflow';
import { deepCopy, jsonParse } from 'n8n-workflow'; import { deepCopy, jsonParse } from 'n8n-workflow';
import { Service } from 'typedi'; import { Service } from 'typedi';
import { CredentialTypes } from '@/credential-types'; import { CredentialTypes } from '@/credential-types';
import type { ICredentialsOverwrite } from '@/interfaces'; import type { ICredentialsOverwrite } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
@Service() @Service()
export class CredentialsOverwrites { export class CredentialsOverwrites {

View File

@@ -1,6 +1,7 @@
import { GlobalConfig } from '@n8n/config'; import { GlobalConfig } from '@n8n/config';
// eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import
import { In } from '@n8n/typeorm'; import { In } from '@n8n/typeorm';
import { Logger } from 'n8n-core';
import { deepCopy } from 'n8n-workflow'; import { deepCopy } from 'n8n-workflow';
import { z } from 'zod'; import { z } from 'zod';
@@ -23,7 +24,6 @@ import { ForbiddenError } from '@/errors/response-errors/forbidden.error';
import { NotFoundError } from '@/errors/response-errors/not-found.error'; import { NotFoundError } from '@/errors/response-errors/not-found.error';
import { EventService } from '@/events/event.service'; import { EventService } from '@/events/event.service';
import { License } from '@/license'; import { License } from '@/license';
import { Logger } from '@/logging/logger.service';
import { listQueryMiddleware } from '@/middlewares'; import { listQueryMiddleware } from '@/middlewares';
import { CredentialRequest } from '@/requests'; import { CredentialRequest } from '@/requests';
import { NamingService } from '@/services/naming.service'; import { NamingService } from '@/services/naming.service';

View File

@@ -6,7 +6,7 @@ import {
type FindOptionsRelations, type FindOptionsRelations,
type FindOptionsWhere, type FindOptionsWhere,
} from '@n8n/typeorm'; } from '@n8n/typeorm';
import { Credentials } from 'n8n-core'; import { Credentials, Logger } from 'n8n-core';
import type { import type {
ICredentialDataDecryptedObject, ICredentialDataDecryptedObject,
ICredentialsDecrypted, ICredentialsDecrypted,
@@ -33,7 +33,6 @@ import { NotFoundError } from '@/errors/response-errors/not-found.error';
import { ExternalHooks } from '@/external-hooks'; import { ExternalHooks } from '@/external-hooks';
import { validateEntity } from '@/generic-helpers'; import { validateEntity } from '@/generic-helpers';
import type { ICredentialsDb } from '@/interfaces'; import type { ICredentialsDb } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import { userHasScopes } from '@/permissions/check-access'; import { userHasScopes } from '@/permissions/check-access';
import type { CredentialRequest, ListQuery } from '@/requests'; import type { CredentialRequest, ListQuery } from '@/requests';
import { CredentialsTester } from '@/services/credentials-tester.service'; import { CredentialsTester } from '@/services/credentials-tester.service';

View File

@@ -21,7 +21,7 @@ import {
import { DateUtils } from '@n8n/typeorm/util/DateUtils'; import { DateUtils } from '@n8n/typeorm/util/DateUtils';
import { parse, stringify } from 'flatted'; import { parse, stringify } from 'flatted';
import pick from 'lodash/pick'; import pick from 'lodash/pick';
import { BinaryDataService, ErrorReporter } from 'n8n-core'; import { BinaryDataService, ErrorReporter, Logger } from 'n8n-core';
import { ExecutionCancelledError, ApplicationError } from 'n8n-workflow'; import { ExecutionCancelledError, ApplicationError } from 'n8n-workflow';
import type { import type {
AnnotationVote, AnnotationVote,
@@ -42,7 +42,6 @@ import type {
IExecutionFlattedDb, IExecutionFlattedDb,
IExecutionResponse, IExecutionResponse,
} from '@/interfaces'; } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import { separate } from '@/utils'; import { separate } from '@/utils';
import { ExecutionDataRepository } from './execution-data.repository'; import { ExecutionDataRepository } from './execution-data.repository';

View File

@@ -1,11 +1,9 @@
import type { EntitySubscriberInterface, UpdateEvent } from '@n8n/typeorm'; import type { EntitySubscriberInterface, UpdateEvent } from '@n8n/typeorm';
import { EventSubscriber } from '@n8n/typeorm'; import { EventSubscriber } from '@n8n/typeorm';
import { ErrorReporter } from 'n8n-core'; import { ErrorReporter, Logger } from 'n8n-core';
import { ApplicationError } from 'n8n-workflow'; import { ApplicationError } from 'n8n-workflow';
import { Container } from 'typedi'; import { Container } from 'typedi';
import { Logger } from '@/logging/logger.service';
import { Project } from '../entities/project'; import { Project } from '../entities/project';
import { User } from '../entities/user'; import { User } from '../entities/user';
import { UserRepository } from '../repositories/user.repository'; import { UserRepository } from '../repositories/user.repository';

View File

@@ -1,8 +1,7 @@
import type { QueryRunner, ObjectLiteral } from '@n8n/typeorm'; import type { QueryRunner, ObjectLiteral } from '@n8n/typeorm';
import type { Logger } from 'n8n-core';
import type { INodeTypes } from 'n8n-workflow'; import type { INodeTypes } from 'n8n-workflow';
import type { Logger } from '@/logging/logger.service';
import type { createSchemaBuilder } from './dsl'; import type { createSchemaBuilder } from './dsl';
export type DatabaseType = 'mariadb' | 'postgresdb' | 'mysqldb' | 'sqlite'; export type DatabaseType = 'mariadb' | 'postgresdb' | 'mysqldb' | 'sqlite';

View File

@@ -2,14 +2,13 @@ import { GlobalConfig } from '@n8n/config';
import type { ObjectLiteral } from '@n8n/typeorm'; import type { ObjectLiteral } from '@n8n/typeorm';
import type { QueryRunner } from '@n8n/typeorm/query-runner/QueryRunner'; import type { QueryRunner } from '@n8n/typeorm/query-runner/QueryRunner';
import { readFileSync, rmSync } from 'fs'; import { readFileSync, rmSync } from 'fs';
import { InstanceSettings } from 'n8n-core'; import { InstanceSettings, Logger } from 'n8n-core';
import { ApplicationError, jsonParse } from 'n8n-workflow'; import { ApplicationError, jsonParse } from 'n8n-workflow';
import { Container } from 'typedi'; import { Container } from 'typedi';
import { inTest } from '@/constants'; import { inTest } from '@/constants';
import { createSchemaBuilder } from '@/databases/dsl'; import { createSchemaBuilder } from '@/databases/dsl';
import type { BaseMigration, Migration, MigrationContext, MigrationFn } from '@/databases/types'; import type { BaseMigration, Migration, MigrationContext, MigrationFn } from '@/databases/types';
import { Logger } from '@/logging/logger.service';
import { NodeTypes } from '@/node-types'; import { NodeTypes } from '@/node-types';
const PERSONALIZATION_SURVEY_FILENAME = 'personalizationSurvey.json'; const PERSONALIZATION_SURVEY_FILENAME = 'personalizationSurvey.json';

View File

@@ -1,8 +1,7 @@
import { Logger } from 'n8n-core';
import { ApplicationError } from 'n8n-workflow'; import { ApplicationError } from 'n8n-workflow';
import { Service } from 'typedi'; import { Service } from 'typedi';
import { Logger } from '@/logging/logger.service';
type EnvVarName = string; type EnvVarName = string;
type Deprecation = { type Deprecation = {

View File

@@ -1,12 +1,13 @@
import { mock } from 'jest-mock-extended'; import { mock } from 'jest-mock-extended';
import { InstanceSettings } from 'n8n-core'; import { InstanceSettings } from 'n8n-core';
import { Container } from 'typedi';
import { SourceControlPreferencesService } from '@/environments/source-control/source-control-preferences.service.ee'; import { SourceControlPreferencesService } from '@/environments/source-control/source-control-preferences.service.ee';
import { SourceControlService } from '@/environments/source-control/source-control.service.ee'; import { SourceControlService } from '@/environments/source-control/source-control.service.ee';
describe('SourceControlService', () => { describe('SourceControlService', () => {
const preferencesService = new SourceControlPreferencesService( const preferencesService = new SourceControlPreferencesService(
new InstanceSettings(mock()), Container.get(InstanceSettings),
mock(), mock(),
mock(), mock(),
); );

View File

@@ -1,5 +1,5 @@
import { rmSync } from 'fs'; import { rmSync } from 'fs';
import { Credentials, InstanceSettings } from 'n8n-core'; import { Credentials, InstanceSettings, Logger } from 'n8n-core';
import { ApplicationError, type ICredentialDataDecryptedObject } from 'n8n-workflow'; import { ApplicationError, type ICredentialDataDecryptedObject } from 'n8n-workflow';
import { writeFile as fsWriteFile, rm as fsRm } from 'node:fs/promises'; import { writeFile as fsWriteFile, rm as fsRm } from 'node:fs/promises';
import path from 'path'; import path from 'path';
@@ -11,7 +11,6 @@ import { SharedWorkflowRepository } from '@/databases/repositories/shared-workfl
import { TagRepository } from '@/databases/repositories/tag.repository'; import { TagRepository } from '@/databases/repositories/tag.repository';
import { WorkflowTagMappingRepository } from '@/databases/repositories/workflow-tag-mapping.repository'; import { WorkflowTagMappingRepository } from '@/databases/repositories/workflow-tag-mapping.repository';
import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository';
import { Logger } from '@/logging/logger.service';
import { import {
SOURCE_CONTROL_CREDENTIAL_EXPORT_FOLDER, SOURCE_CONTROL_CREDENTIAL_EXPORT_FOLDER,

View File

@@ -1,4 +1,5 @@
import { execSync } from 'child_process'; import { execSync } from 'child_process';
import { Logger } from 'n8n-core';
import { ApplicationError } from 'n8n-workflow'; import { ApplicationError } from 'n8n-workflow';
import path from 'path'; import path from 'path';
import type { import type {
@@ -14,7 +15,6 @@ import type {
import { Service } from 'typedi'; import { Service } from 'typedi';
import type { User } from '@/databases/entities/user'; import type { User } from '@/databases/entities/user';
import { Logger } from '@/logging/logger.service';
import { OwnershipService } from '@/services/ownership.service'; import { OwnershipService } from '@/services/ownership.service';
import { import {

View File

@@ -1,12 +1,12 @@
import { generateKeyPairSync } from 'crypto'; import { generateKeyPairSync } from 'crypto';
import { constants as fsConstants, mkdirSync, accessSync } from 'fs'; import { constants as fsConstants, mkdirSync, accessSync } from 'fs';
import { Logger } from 'n8n-core';
import { ApplicationError } from 'n8n-workflow'; import { ApplicationError } from 'n8n-workflow';
import { ok } from 'node:assert/strict'; import { ok } from 'node:assert/strict';
import path from 'path'; import path from 'path';
import { Container } from 'typedi'; import { Container } from 'typedi';
import { License } from '@/license'; import { License } from '@/license';
import { Logger } from '@/logging/logger.service';
import { isContainedWithin } from '@/utils/path-util'; import { isContainedWithin } from '@/utils/path-util';
import { import {

View File

@@ -1,7 +1,7 @@
// eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import
import { In } from '@n8n/typeorm'; import { In } from '@n8n/typeorm';
import glob from 'fast-glob'; import glob from 'fast-glob';
import { Credentials, ErrorReporter, InstanceSettings } from 'n8n-core'; import { Credentials, ErrorReporter, InstanceSettings, Logger } from 'n8n-core';
import { ApplicationError, jsonParse, ensureError } from 'n8n-workflow'; import { ApplicationError, jsonParse, ensureError } from 'n8n-workflow';
import { readFile as fsReadFile } from 'node:fs/promises'; import { readFile as fsReadFile } from 'node:fs/promises';
import path from 'path'; import path from 'path';
@@ -23,7 +23,6 @@ import { VariablesRepository } from '@/databases/repositories/variables.reposito
import { WorkflowTagMappingRepository } from '@/databases/repositories/workflow-tag-mapping.repository'; import { WorkflowTagMappingRepository } from '@/databases/repositories/workflow-tag-mapping.repository';
import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository';
import type { IWorkflowToImport } from '@/interfaces'; import type { IWorkflowToImport } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import { isUniqueConstraintError } from '@/response-helper'; import { isUniqueConstraintError } from '@/response-helper';
import { assertNever } from '@/utils'; import { assertNever } from '@/utils';

View File

@@ -1,7 +1,7 @@
import type { ValidationError } from 'class-validator'; import type { ValidationError } from 'class-validator';
import { validate } from 'class-validator'; import { validate } from 'class-validator';
import { rm as fsRm } from 'fs/promises'; import { rm as fsRm } from 'fs/promises';
import { Cipher, InstanceSettings } from 'n8n-core'; import { Cipher, InstanceSettings, Logger } from 'n8n-core';
import { ApplicationError, jsonParse } from 'n8n-workflow'; import { ApplicationError, jsonParse } from 'n8n-workflow';
import { writeFile, chmod, readFile } from 'node:fs/promises'; import { writeFile, chmod, readFile } from 'node:fs/promises';
import path from 'path'; import path from 'path';
@@ -9,7 +9,6 @@ import Container, { Service } from 'typedi';
import config from '@/config'; import config from '@/config';
import { SettingsRepository } from '@/databases/repositories/settings.repository'; import { SettingsRepository } from '@/databases/repositories/settings.repository';
import { Logger } from '@/logging/logger.service';
import { import {
SOURCE_CONTROL_SSH_FOLDER, SOURCE_CONTROL_SSH_FOLDER,

View File

@@ -1,4 +1,5 @@
import { writeFileSync } from 'fs'; import { writeFileSync } from 'fs';
import { Logger } from 'n8n-core';
import { ApplicationError } from 'n8n-workflow'; import { ApplicationError } from 'n8n-workflow';
import path from 'path'; import path from 'path';
import type { PushResult } from 'simple-git'; import type { PushResult } from 'simple-git';
@@ -10,7 +11,6 @@ import type { Variables } from '@/databases/entities/variables';
import { TagRepository } from '@/databases/repositories/tag.repository'; import { TagRepository } from '@/databases/repositories/tag.repository';
import { BadRequestError } from '@/errors/response-errors/bad-request.error'; import { BadRequestError } from '@/errors/response-errors/bad-request.error';
import { EventService } from '@/events/event.service'; import { EventService } from '@/events/event.service';
import { Logger } from '@/logging/logger.service';
import { import {
SOURCE_CONTROL_DEFAULT_EMAIL, SOURCE_CONTROL_DEFAULT_EMAIL,

View File

@@ -1,8 +1,8 @@
import { Logger } from 'n8n-core';
import { MessageEventBusDestinationTypeNames } from 'n8n-workflow'; import { MessageEventBusDestinationTypeNames } from 'n8n-workflow';
import { Container } from 'typedi'; import { Container } from 'typedi';
import type { EventDestinations } from '@/databases/entities/event-destinations'; import type { EventDestinations } from '@/databases/entities/event-destinations';
import { Logger } from '@/logging/logger.service';
import { MessageEventBusDestinationSentry } from './message-event-bus-destination-sentry.ee'; import { MessageEventBusDestinationSentry } from './message-event-bus-destination-sentry.ee';
import { MessageEventBusDestinationSyslog } from './message-event-bus-destination-syslog.ee'; import { MessageEventBusDestinationSyslog } from './message-event-bus-destination-syslog.ee';

View File

@@ -1,4 +1,5 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { Logger } from 'n8n-core';
import type { import type {
MessageEventBusDestinationOptions, MessageEventBusDestinationOptions,
MessageEventBusDestinationSyslogOptions, MessageEventBusDestinationSyslogOptions,
@@ -7,8 +8,6 @@ import { MessageEventBusDestinationTypeNames } from 'n8n-workflow';
import syslog from 'syslog-client'; import syslog from 'syslog-client';
import Container from 'typedi'; import Container from 'typedi';
import { Logger } from '@/logging/logger.service';
import { MessageEventBusDestination } from './message-event-bus-destination.ee'; import { MessageEventBusDestination } from './message-event-bus-destination.ee';
import { eventMessageGenericDestinationTestEvent } from '../event-message-classes/event-message-generic'; import { eventMessageGenericDestinationTestEvent } from '../event-message-classes/event-message-generic';
import type { MessageEventBus, MessageWithCallback } from '../message-event-bus/message-event-bus'; import type { MessageEventBus, MessageWithCallback } from '../message-event-bus/message-event-bus';

View File

@@ -1,3 +1,4 @@
import { Logger } from 'n8n-core';
import type { INodeCredentials, MessageEventBusDestinationOptions } from 'n8n-workflow'; import type { INodeCredentials, MessageEventBusDestinationOptions } from 'n8n-workflow';
import { MessageEventBusDestinationTypeNames } from 'n8n-workflow'; import { MessageEventBusDestinationTypeNames } from 'n8n-workflow';
import { Container } from 'typedi'; import { Container } from 'typedi';
@@ -5,7 +6,6 @@ import { v4 as uuid } from 'uuid';
import { EventDestinationsRepository } from '@/databases/repositories/event-destinations.repository'; import { EventDestinationsRepository } from '@/databases/repositories/event-destinations.repository';
import { License } from '@/license'; import { License } from '@/license';
import { Logger } from '@/logging/logger.service';
import type { EventMessageTypes } from '../event-message-classes'; import type { EventMessageTypes } from '../event-message-classes';
import type { AbstractEventMessage } from '../event-message-classes/abstract-event-message'; import type { AbstractEventMessage } from '../event-message-classes/abstract-event-message';

View File

@@ -4,7 +4,7 @@ import { GlobalConfig } from '@n8n/config';
import { once as eventOnce } from 'events'; import { once as eventOnce } from 'events';
import { createReadStream, existsSync, rmSync } from 'fs'; import { createReadStream, existsSync, rmSync } from 'fs';
import remove from 'lodash/remove'; import remove from 'lodash/remove';
import { InstanceSettings } from 'n8n-core'; import { InstanceSettings, Logger } from 'n8n-core';
import { EventMessageTypeNames, jsonParse } from 'n8n-workflow'; import { EventMessageTypeNames, jsonParse } from 'n8n-workflow';
import path, { parse } from 'path'; import path, { parse } from 'path';
import readline from 'readline'; import readline from 'readline';
@@ -12,7 +12,6 @@ import Container from 'typedi';
import { Worker } from 'worker_threads'; import { Worker } from 'worker_threads';
import { inTest } from '@/constants'; import { inTest } from '@/constants';
import { Logger } from '@/logging/logger.service';
import type { EventMessageTypes } from '../event-message-classes'; import type { EventMessageTypes } from '../event-message-classes';
import { isEventMessageOptions } from '../event-message-classes/abstract-event-message'; import { isEventMessageOptions } from '../event-message-classes/abstract-event-message';

View File

@@ -5,6 +5,7 @@ import type { DeleteResult } from '@n8n/typeorm';
import { In } from '@n8n/typeorm'; import { In } from '@n8n/typeorm';
import EventEmitter from 'events'; import EventEmitter from 'events';
import uniqby from 'lodash/uniqBy'; import uniqby from 'lodash/uniqBy';
import { Logger } from 'n8n-core';
import type { MessageEventBusDestinationOptions } from 'n8n-workflow'; import type { MessageEventBusDestinationOptions } from 'n8n-workflow';
import { Service } from 'typedi'; import { Service } from 'typedi';
@@ -13,7 +14,6 @@ import { EventDestinationsRepository } from '@/databases/repositories/event-dest
import { ExecutionRepository } from '@/databases/repositories/execution.repository'; import { ExecutionRepository } from '@/databases/repositories/execution.repository';
import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository';
import { License } from '@/license'; import { License } from '@/license';
import { Logger } from '@/logging/logger.service';
import { Publisher } from '@/scaling/pubsub/publisher.service'; import { Publisher } from '@/scaling/pubsub/publisher.service';
import { ExecutionRecoveryService } from '../../executions/execution-recovery.service'; import { ExecutionRecoveryService } from '../../executions/execution-recovery.service';

View File

@@ -1,11 +1,11 @@
import { ErrorReporter } from 'n8n-core'; import { ErrorReporter } from 'n8n-core';
import { Logger } from 'n8n-core';
import type { IRunExecutionData, ITaskData, IWorkflowBase } from 'n8n-workflow'; import type { IRunExecutionData, ITaskData, IWorkflowBase } from 'n8n-workflow';
import { ExecutionRepository } from '@/databases/repositories/execution.repository'; import { ExecutionRepository } from '@/databases/repositories/execution.repository';
import { saveExecutionProgress } from '@/execution-lifecycle-hooks/save-execution-progress'; import { saveExecutionProgress } from '@/execution-lifecycle-hooks/save-execution-progress';
import * as fnModule from '@/execution-lifecycle-hooks/to-save-settings'; import * as fnModule from '@/execution-lifecycle-hooks/to-save-settings';
import type { IExecutionResponse } from '@/interfaces'; import type { IExecutionResponse } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import { mockInstance } from '@test/mocking'; import { mockInstance } from '@test/mocking';
mockInstance(Logger); mockInstance(Logger);

View File

@@ -1,10 +1,9 @@
import { BinaryDataService } from 'n8n-core';
import type { BinaryData } from 'n8n-core'; import type { BinaryData } from 'n8n-core';
import { BinaryDataService, Logger } from 'n8n-core';
import type { IRun, WorkflowExecuteMode } from 'n8n-workflow'; import type { IRun, WorkflowExecuteMode } from 'n8n-workflow';
import Container from 'typedi'; import Container from 'typedi';
import config from '@/config'; import config from '@/config';
import { Logger } from '@/logging/logger.service';
/** /**
* Whenever the execution ID is not available to the binary data service at the * Whenever the execution ID is not available to the binary data service at the

View File

@@ -1,10 +1,9 @@
import { ErrorReporter } from 'n8n-core'; import { ErrorReporter, Logger } from 'n8n-core';
import type { IRunExecutionData, ITaskData, IWorkflowBase } from 'n8n-workflow'; import type { IRunExecutionData, ITaskData, IWorkflowBase } from 'n8n-workflow';
import { Container } from 'typedi'; import { Container } from 'typedi';
import { ExecutionRepository } from '@/databases/repositories/execution.repository'; import { ExecutionRepository } from '@/databases/repositories/execution.repository';
import { toSaveSettings } from '@/execution-lifecycle-hooks/to-save-settings'; import { toSaveSettings } from '@/execution-lifecycle-hooks/to-save-settings';
import { Logger } from '@/logging/logger.service';
export async function saveExecutionProgress( export async function saveExecutionProgress(
workflowData: IWorkflowBase, workflowData: IWorkflowBase,

View File

@@ -1,10 +1,10 @@
import pick from 'lodash/pick'; import pick from 'lodash/pick';
import { Logger } from 'n8n-core';
import { ensureError, type ExecutionStatus, type IRun, type IWorkflowBase } from 'n8n-workflow'; import { ensureError, type ExecutionStatus, type IRun, type IWorkflowBase } from 'n8n-workflow';
import { Container } from 'typedi'; import { Container } from 'typedi';
import { ExecutionRepository } from '@/databases/repositories/execution.repository'; import { ExecutionRepository } from '@/databases/repositories/execution.repository';
import type { IExecutionDb, UpdateExecutionPayload } from '@/interfaces'; import type { IExecutionDb, UpdateExecutionPayload } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import { ExecutionMetadataService } from '@/services/execution-metadata.service'; import { ExecutionMetadataService } from '@/services/execution-metadata.service';
import { isWorkflowIdValid } from '@/utils'; import { isWorkflowIdValid } from '@/utils';

View File

@@ -22,7 +22,7 @@ import { setupMessages } from './utils';
describe('ExecutionRecoveryService', () => { describe('ExecutionRecoveryService', () => {
const push = mockInstance(Push); const push = mockInstance(Push);
const instanceSettings = new InstanceSettings(mock()); const instanceSettings = Container.get(InstanceSettings);
let executionRecoveryService: ExecutionRecoveryService; let executionRecoveryService: ExecutionRecoveryService;
let executionRepository: ExecutionRepository; let executionRepository: ExecutionRepository;

View File

@@ -1,5 +1,5 @@
import type { DateTime } from 'luxon'; import type { DateTime } from 'luxon';
import { InstanceSettings } from 'n8n-core'; import { InstanceSettings, Logger } from 'n8n-core';
import { sleep } from 'n8n-workflow'; import { sleep } from 'n8n-workflow';
import type { IRun, ITaskData } from 'n8n-workflow'; import type { IRun, ITaskData } from 'n8n-workflow';
import { Service } from 'typedi'; import { Service } from 'typedi';
@@ -10,7 +10,6 @@ import { NodeCrashedError } from '@/errors/node-crashed.error';
import { WorkflowCrashedError } from '@/errors/workflow-crashed.error'; import { WorkflowCrashedError } from '@/errors/workflow-crashed.error';
import { EventService } from '@/events/event.service'; import { EventService } from '@/events/event.service';
import type { IExecutionResponse } from '@/interfaces'; import type { IExecutionResponse } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import { Push } from '@/push'; import { Push } from '@/push';
import { getWorkflowHooksMain } from '@/workflow-execute-additional-data'; // @TODO: Dependency cycle import { getWorkflowHooksMain } from '@/workflow-execute-additional-data'; // @TODO: Dependency cycle

View File

@@ -1,5 +1,6 @@
import { GlobalConfig } from '@n8n/config'; import { GlobalConfig } from '@n8n/config';
import { validate as jsonSchemaValidate } from 'jsonschema'; import { validate as jsonSchemaValidate } from 'jsonschema';
import { Logger } from 'n8n-core';
import type { import type {
ExecutionError, ExecutionError,
ExecutionStatus, ExecutionStatus,
@@ -38,7 +39,6 @@ import type {
IWorkflowDb, IWorkflowDb,
} from '@/interfaces'; } from '@/interfaces';
import { License } from '@/license'; import { License } from '@/license';
import { Logger } from '@/logging/logger.service';
import { NodeTypes } from '@/node-types'; import { NodeTypes } from '@/node-types';
import { WaitTracker } from '@/wait-tracker'; import { WaitTracker } from '@/wait-tracker';
import { WorkflowRunner } from '@/workflow-runner'; import { WorkflowRunner } from '@/workflow-runner';

View File

@@ -1,4 +1,4 @@
import { Cipher } from 'n8n-core'; import { Cipher, Logger } from 'n8n-core';
import { jsonParse, type IDataObject, ApplicationError, ensureError } from 'n8n-workflow'; import { jsonParse, type IDataObject, ApplicationError, ensureError } from 'n8n-workflow';
import { Service } from 'typedi'; import { Service } from 'typedi';
@@ -10,7 +10,6 @@ import type {
SecretsProviderSettings, SecretsProviderSettings,
} from '@/interfaces'; } from '@/interfaces';
import { License } from '@/license'; import { License } from '@/license';
import { Logger } from '@/logging/logger.service';
import { Publisher } from '@/scaling/pubsub/publisher.service'; import { Publisher } from '@/scaling/pubsub/publisher.service';
import { EXTERNAL_SECRETS_INITIAL_BACKOFF, EXTERNAL_SECRETS_MAX_BACKOFF } from './constants'; import { EXTERNAL_SECRETS_INITIAL_BACKOFF, EXTERNAL_SECRETS_MAX_BACKOFF } from './constants';

View File

@@ -1,10 +1,10 @@
import { Logger } from 'n8n-core';
import type { INodeProperties } from 'n8n-workflow'; import type { INodeProperties } from 'n8n-workflow';
import Container from 'typedi'; import Container from 'typedi';
import { UnknownAuthTypeError } from '@/errors/unknown-auth-type.error'; import { UnknownAuthTypeError } from '@/errors/unknown-auth-type.error';
import { DOCS_HELP_NOTICE, EXTERNAL_SECRETS_NAME_REGEX } from '@/external-secrets/constants'; import { DOCS_HELP_NOTICE, EXTERNAL_SECRETS_NAME_REGEX } from '@/external-secrets/constants';
import type { SecretsProvider, SecretsProviderState } from '@/interfaces'; import type { SecretsProvider, SecretsProviderState } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import { AwsSecretsClient } from './aws-secrets-client'; import { AwsSecretsClient } from './aws-secrets-client';
import type { AwsSecretsManagerContext } from './types'; import type { AwsSecretsManagerContext } from './types';

View File

@@ -1,11 +1,11 @@
import type { SecretClient } from '@azure/keyvault-secrets'; import type { SecretClient } from '@azure/keyvault-secrets';
import { Logger } from 'n8n-core';
import { ensureError } from 'n8n-workflow'; import { ensureError } from 'n8n-workflow';
import type { INodeProperties } from 'n8n-workflow'; import type { INodeProperties } from 'n8n-workflow';
import Container from 'typedi'; import Container from 'typedi';
import { DOCS_HELP_NOTICE, EXTERNAL_SECRETS_NAME_REGEX } from '@/external-secrets/constants'; import { DOCS_HELP_NOTICE, EXTERNAL_SECRETS_NAME_REGEX } from '@/external-secrets/constants';
import type { SecretsProvider, SecretsProviderState } from '@/interfaces'; import type { SecretsProvider, SecretsProviderState } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import type { AzureKeyVaultContext } from './types'; import type { AzureKeyVaultContext } from './types';

View File

@@ -1,10 +1,10 @@
import type { SecretManagerServiceClient as GcpClient } from '@google-cloud/secret-manager'; import type { SecretManagerServiceClient as GcpClient } from '@google-cloud/secret-manager';
import { Logger } from 'n8n-core';
import { ensureError, jsonParse, type INodeProperties } from 'n8n-workflow'; import { ensureError, jsonParse, type INodeProperties } from 'n8n-workflow';
import Container from 'typedi'; import Container from 'typedi';
import { DOCS_HELP_NOTICE, EXTERNAL_SECRETS_NAME_REGEX } from '@/external-secrets/constants'; import { DOCS_HELP_NOTICE, EXTERNAL_SECRETS_NAME_REGEX } from '@/external-secrets/constants';
import type { SecretsProvider, SecretsProviderState } from '@/interfaces'; import type { SecretsProvider, SecretsProviderState } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import type { import type {
GcpSecretsManagerContext, GcpSecretsManagerContext,

View File

@@ -1,11 +1,11 @@
import type { AxiosInstance, AxiosResponse } from 'axios'; import type { AxiosInstance, AxiosResponse } from 'axios';
import axios from 'axios'; import axios from 'axios';
import { Logger } from 'n8n-core';
import type { IDataObject, INodeProperties } from 'n8n-workflow'; import type { IDataObject, INodeProperties } from 'n8n-workflow';
import { Container } from 'typedi'; import { Container } from 'typedi';
import type { SecretsProviderSettings, SecretsProviderState } from '@/interfaces'; import type { SecretsProviderSettings, SecretsProviderState } from '@/interfaces';
import { SecretsProvider } from '@/interfaces'; import { SecretsProvider } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import { DOCS_HELP_NOTICE, EXTERNAL_SECRETS_NAME_REGEX } from '../constants'; import { DOCS_HELP_NOTICE, EXTERNAL_SECRETS_NAME_REGEX } from '../constants';
import { preferGet } from '../external-secrets-helper.ee'; import { preferGet } from '../external-secrets-helper.ee';

View File

@@ -1,6 +1,6 @@
import { Help } from '@oclif/core'; import { Help } from '@oclif/core';
import Container from 'typedi'; import { Logger } from 'n8n-core';
import { Logger } from 'winston'; import { Container } from 'typedi';
// oclif expects a default export // oclif expects a default export
// eslint-disable-next-line import/no-default-export // eslint-disable-next-line import/no-default-export

View File

@@ -2,7 +2,7 @@
import { QueryFailedError } from '@n8n/typeorm'; import { QueryFailedError } from '@n8n/typeorm';
import type { Entry as LdapUser, ClientOptions } from 'ldapts'; import type { Entry as LdapUser, ClientOptions } from 'ldapts';
import { Client } from 'ldapts'; import { Client } from 'ldapts';
import { Cipher } from 'n8n-core'; import { Cipher, Logger } from 'n8n-core';
import { ApplicationError, jsonParse } from 'n8n-workflow'; import { ApplicationError, jsonParse } from 'n8n-workflow';
import type { ConnectionOptions } from 'tls'; import type { ConnectionOptions } from 'tls';
import { Service } from 'typedi'; import { Service } from 'typedi';
@@ -14,7 +14,6 @@ import { SettingsRepository } from '@/databases/repositories/settings.repository
import { BadRequestError } from '@/errors/response-errors/bad-request.error'; import { BadRequestError } from '@/errors/response-errors/bad-request.error';
import { InternalServerError } from '@/errors/response-errors/internal-server.error'; import { InternalServerError } from '@/errors/response-errors/internal-server.error';
import { EventService } from '@/events/event.service'; import { EventService } from '@/events/event.service';
import { Logger } from '@/logging/logger.service';
import { import {
getCurrentAuthenticationMethod, getCurrentAuthenticationMethod,
isEmailCurrentAuthenticationMethod, isEmailCurrentAuthenticationMethod,

View File

@@ -1,13 +1,12 @@
import { GlobalConfig } from '@n8n/config'; import { GlobalConfig } from '@n8n/config';
import type { TEntitlement, TFeatures, TLicenseBlock } from '@n8n_io/license-sdk'; import type { TEntitlement, TFeatures, TLicenseBlock } from '@n8n_io/license-sdk';
import { LicenseManager } from '@n8n_io/license-sdk'; import { LicenseManager } from '@n8n_io/license-sdk';
import { InstanceSettings, ObjectStoreService } from 'n8n-core'; import { InstanceSettings, ObjectStoreService, Logger } from 'n8n-core';
import Container, { Service } from 'typedi'; import Container, { Service } from 'typedi';
import config from '@/config'; import config from '@/config';
import { SettingsRepository } from '@/databases/repositories/settings.repository'; import { SettingsRepository } from '@/databases/repositories/settings.repository';
import { OnShutdown } from '@/decorators/on-shutdown'; import { OnShutdown } from '@/decorators/on-shutdown';
import { Logger } from '@/logging/logger.service';
import { LicenseMetricsService } from '@/metrics/license-metrics.service'; import { LicenseMetricsService } from '@/metrics/license-metrics.service';
import { import {

View File

@@ -1,4 +1,5 @@
import axios, { AxiosError } from 'axios'; import axios, { AxiosError } from 'axios';
import { Logger } from 'n8n-core';
import { ensureError } from 'n8n-workflow'; import { ensureError } from 'n8n-workflow';
import { Service } from 'typedi'; import { Service } from 'typedi';
@@ -7,7 +8,6 @@ import { WorkflowRepository } from '@/databases/repositories/workflow.repository
import { BadRequestError } from '@/errors/response-errors/bad-request.error'; import { BadRequestError } from '@/errors/response-errors/bad-request.error';
import { EventService } from '@/events/event.service'; import { EventService } from '@/events/event.service';
import { License } from '@/license'; import { License } from '@/license';
import { Logger } from '@/logging/logger.service';
import { UrlService } from '@/services/url.service'; import { UrlService } from '@/services/url.service';
type LicenseError = Error & { errorId?: keyof typeof LicenseErrors }; type LicenseError = Error & { errorId?: keyof typeof LicenseErrors };

View File

@@ -11,6 +11,7 @@ import {
LazyPackageDirectoryLoader, LazyPackageDirectoryLoader,
UnrecognizedCredentialTypeError, UnrecognizedCredentialTypeError,
UnrecognizedNodeTypeError, UnrecognizedNodeTypeError,
Logger,
} from 'n8n-core'; } from 'n8n-core';
import type { import type {
KnownNodesAndCredentials, KnownNodesAndCredentials,
@@ -36,7 +37,6 @@ import {
CLI_DIR, CLI_DIR,
inE2ETests, inE2ETests,
} from '@/constants'; } from '@/constants';
import { Logger } from '@/logging/logger.service';
import { isContainedWithin } from '@/utils/path-util'; import { isContainedWithin } from '@/utils/path-util';
interface LoadedNodesAndCredentials { interface LoadedNodesAndCredentials {

View File

@@ -1,3 +0,0 @@
export const noOp = () => {};
export const LOG_LEVELS = ['error', 'warn', 'info', 'debug', 'silent'] as const;

View File

@@ -1,14 +0,0 @@
import type { LogScope } from '@n8n/config';
import type { LOG_LEVELS } from './constants';
export type LogLevel = (typeof LOG_LEVELS)[number];
export type LogMetadata = {
[key: string]: unknown;
scopes?: LogScope[];
file?: string;
function?: string;
};
export type LogLocationMetadata = Pick<LogMetadata, 'file' | 'function'>;

View File

@@ -4,6 +4,7 @@ import {
filterDisabledNodes, filterDisabledNodes,
recreateNodeExecutionStack, recreateNodeExecutionStack,
WorkflowExecute, WorkflowExecute,
Logger,
} from 'n8n-core'; } from 'n8n-core';
import type { import type {
IPinData, IPinData,
@@ -16,8 +17,6 @@ import type {
import type PCancelable from 'p-cancelable'; import type PCancelable from 'p-cancelable';
import { Service } from 'typedi'; import { Service } from 'typedi';
import { Logger } from '@/logging/logger.service';
@Service() @Service()
export class ManualExecutionService { export class ManualExecutionService {
constructor(private readonly logger: Logger) {} constructor(private readonly logger: Logger) {}

View File

@@ -1,10 +1,10 @@
import type { PushMessage } from '@n8n/api-types'; import type { PushMessage } from '@n8n/api-types';
import { EventEmitter } from 'events'; import { EventEmitter } from 'events';
import { Logger } from 'n8n-core';
import { Container } from 'typedi'; import { Container } from 'typedi';
import type WebSocket from 'ws'; import type WebSocket from 'ws';
import type { User } from '@/databases/entities/user'; import type { User } from '@/databases/entities/user';
import { Logger } from '@/logging/logger.service';
import { WebSocketPush } from '@/push/websocket.push'; import { WebSocketPush } from '@/push/websocket.push';
import { mockInstance } from '@test/mocking'; import { mockInstance } from '@test/mocking';

View File

@@ -1,10 +1,9 @@
import type { PushMessage } from '@n8n/api-types'; import type { PushMessage } from '@n8n/api-types';
import { ErrorReporter } from 'n8n-core'; import { ErrorReporter, Logger } from 'n8n-core';
import { assert, jsonStringify } from 'n8n-workflow'; import { assert, jsonStringify } from 'n8n-workflow';
import { Service } from 'typedi'; import { Service } from 'typedi';
import type { User } from '@/databases/entities/user'; import type { User } from '@/databases/entities/user';
import { Logger } from '@/logging/logger.service';
import type { OnPushMessage } from '@/push/types'; import type { OnPushMessage } from '@/push/types';
import { TypedEmitter } from '@/typed-emitter'; import { TypedEmitter } from '@/typed-emitter';

View File

@@ -1,13 +1,12 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
import type { Request, Response } from 'express'; import type { Request, Response } from 'express';
import { ErrorReporter } from 'n8n-core'; import { ErrorReporter, Logger } from 'n8n-core';
import { FORM_TRIGGER_PATH_IDENTIFIER, NodeApiError } from 'n8n-workflow'; import { FORM_TRIGGER_PATH_IDENTIFIER, NodeApiError } from 'n8n-workflow';
import { Readable } from 'node:stream'; import { Readable } from 'node:stream';
import picocolors from 'picocolors'; import picocolors from 'picocolors';
import Container from 'typedi'; import Container from 'typedi';
import { inDevelopment } from '@/constants'; import { inDevelopment } from '@/constants';
import { Logger } from '@/logging/logger.service';
import { ResponseError } from './errors/response-errors/abstract/response.error'; import { ResponseError } from './errors/response-errors/abstract/response.error';

View File

@@ -1,7 +1,7 @@
import { TaskRunnersConfig } from '@n8n/config'; import { TaskRunnersConfig } from '@n8n/config';
import { mock } from 'jest-mock-extended'; import { mock } from 'jest-mock-extended';
import type { Logger } from 'n8n-core';
import type { Logger } from '@/logging/logger.service';
import type { TaskRunnerAuthService } from '@/runners/auth/task-runner-auth.service'; import type { TaskRunnerAuthService } from '@/runners/auth/task-runner-auth.service';
import { TaskRunnerRestartLoopError } from '@/runners/errors/task-runner-restart-loop-error'; import { TaskRunnerRestartLoopError } from '@/runners/errors/task-runner-restart-loop-error';
import { RunnerLifecycleEvents } from '@/runners/runner-lifecycle-events'; import { RunnerLifecycleEvents } from '@/runners/runner-lifecycle-events';

View File

@@ -1,8 +1,8 @@
import { TaskRunnersConfig } from '@n8n/config'; import { TaskRunnersConfig } from '@n8n/config';
import { mock } from 'jest-mock-extended'; import { mock } from 'jest-mock-extended';
import { Logger } from 'n8n-core';
import type { ChildProcess, SpawnOptions } from 'node:child_process'; import type { ChildProcess, SpawnOptions } from 'node:child_process';
import { Logger } from '@/logging/logger.service';
import type { TaskRunnerAuthService } from '@/runners/auth/task-runner-auth.service'; import type { TaskRunnerAuthService } from '@/runners/auth/task-runner-auth.service';
import { TaskRunnerProcess } from '@/runners/task-runner-process'; import { TaskRunnerProcess } from '@/runners/task-runner-process';
import { mockInstance } from '@test/mocking'; import { mockInstance } from '@test/mocking';

View File

@@ -1,11 +1,11 @@
import { TaskRunnersConfig } from '@n8n/config'; import { TaskRunnersConfig } from '@n8n/config';
import type { BrokerMessage, RunnerMessage } from '@n8n/task-runner'; import type { BrokerMessage, RunnerMessage } from '@n8n/task-runner';
import { Logger } from 'n8n-core';
import { ApplicationError, jsonStringify } from 'n8n-workflow'; import { ApplicationError, jsonStringify } from 'n8n-workflow';
import { Service } from 'typedi'; import { Service } from 'typedi';
import type WebSocket from 'ws'; import type WebSocket from 'ws';
import { Time, WsStatusCodes } from '@/constants'; import { Time, WsStatusCodes } from '@/constants';
import { Logger } from '@/logging/logger.service';
import { DefaultTaskRunnerDisconnectAnalyzer } from './default-task-runner-disconnect-analyzer'; import { DefaultTaskRunnerDisconnectAnalyzer } from './default-task-runner-disconnect-analyzer';
import { RunnerLifecycleEvents } from './runner-lifecycle-events'; import { RunnerLifecycleEvents } from './runner-lifecycle-events';

View File

@@ -5,13 +5,13 @@ import type {
RunnerMessage, RunnerMessage,
TaskResultData, TaskResultData,
} from '@n8n/task-runner'; } from '@n8n/task-runner';
import { Logger } from 'n8n-core';
import { ApplicationError } from 'n8n-workflow'; import { ApplicationError } from 'n8n-workflow';
import { nanoid } from 'nanoid'; import { nanoid } from 'nanoid';
import { Service } from 'typedi'; import { Service } from 'typedi';
import config from '@/config'; import config from '@/config';
import { Time } from '@/constants'; import { Time } from '@/constants';
import { Logger } from '@/logging/logger.service';
import { TaskDeferredError, TaskRejectError } from './errors'; import { TaskDeferredError, TaskRejectError } from './errors';
import { TaskRunnerTimeoutError } from './errors/task-runner-timeout.error'; import { TaskRunnerTimeoutError } from './errors/task-runner-timeout.error';

View File

@@ -1,11 +1,10 @@
import { TaskRunnersConfig } from '@n8n/config'; import { TaskRunnersConfig } from '@n8n/config';
import { ErrorReporter } from 'n8n-core'; import { ErrorReporter, Logger } from 'n8n-core';
import { sleep } from 'n8n-workflow'; import { sleep } from 'n8n-workflow';
import * as a from 'node:assert/strict'; import * as a from 'node:assert/strict';
import Container, { Service } from 'typedi'; import Container, { Service } from 'typedi';
import { OnShutdown } from '@/decorators/on-shutdown'; import { OnShutdown } from '@/decorators/on-shutdown';
import { Logger } from '@/logging/logger.service';
import type { TaskRunnerRestartLoopError } from '@/runners/errors/task-runner-restart-loop-error'; import type { TaskRunnerRestartLoopError } from '@/runners/errors/task-runner-restart-loop-error';
import type { TaskRunnerProcess } from '@/runners/task-runner-process'; import type { TaskRunnerProcess } from '@/runners/task-runner-process';
import { TaskRunnerProcessRestartLoopDetector } from '@/runners/task-runner-process-restart-loop-detector'; import { TaskRunnerProcessRestartLoopDetector } from '@/runners/task-runner-process-restart-loop-detector';

View File

@@ -1,11 +1,11 @@
import { TaskRunnersConfig } from '@n8n/config'; import { TaskRunnersConfig } from '@n8n/config';
import { Logger } from 'n8n-core';
import * as a from 'node:assert/strict'; import * as a from 'node:assert/strict';
import { spawn } from 'node:child_process'; import { spawn } from 'node:child_process';
import * as process from 'node:process'; import * as process from 'node:process';
import { Service } from 'typedi'; import { Service } from 'typedi';
import { OnShutdown } from '@/decorators/on-shutdown'; import { OnShutdown } from '@/decorators/on-shutdown';
import { Logger } from '@/logging/logger.service';
import { TaskRunnerAuthService } from './auth/task-runner-auth.service'; import { TaskRunnerAuthService } from './auth/task-runner-auth.service';
import { forwardToLogger } from './forward-to-logger'; import { forwardToLogger } from './forward-to-logger';

View File

@@ -1,6 +1,7 @@
import { GlobalConfig } from '@n8n/config'; import { GlobalConfig } from '@n8n/config';
import compression from 'compression'; import compression from 'compression';
import express from 'express'; import express from 'express';
import { Logger } from 'n8n-core';
import * as a from 'node:assert/strict'; import * as a from 'node:assert/strict';
import { randomBytes } from 'node:crypto'; import { randomBytes } from 'node:crypto';
import { ServerResponse, type Server, createServer as createHttpServer } from 'node:http'; import { ServerResponse, type Server, createServer as createHttpServer } from 'node:http';
@@ -10,7 +11,6 @@ import { Service } from 'typedi';
import { Server as WSServer } from 'ws'; import { Server as WSServer } from 'ws';
import { inTest } from '@/constants'; import { inTest } from '@/constants';
import { Logger } from '@/logging/logger.service';
import { bodyParser, rawBodyReader } from '@/middlewares'; import { bodyParser, rawBodyReader } from '@/middlewares';
import { send } from '@/response-helper'; import { send } from '@/response-helper';
import { TaskRunnerAuthController } from '@/runners/auth/task-runner-auth.controller'; import { TaskRunnerAuthController } from '@/runners/auth/task-runner-auth.controller';

View File

@@ -1,5 +1,5 @@
import type { RunningJobSummary } from '@n8n/api-types'; import type { RunningJobSummary } from '@n8n/api-types';
import { ErrorReporter, InstanceSettings, WorkflowExecute } from 'n8n-core'; import { ErrorReporter, InstanceSettings, WorkflowExecute, Logger } from 'n8n-core';
import type { ExecutionStatus, IExecuteResponsePromiseData, IRun } from 'n8n-workflow'; import type { ExecutionStatus, IExecuteResponsePromiseData, IRun } from 'n8n-workflow';
import { BINARY_ENCODING, ApplicationError, Workflow } from 'n8n-workflow'; import { BINARY_ENCODING, ApplicationError, Workflow } from 'n8n-workflow';
import type PCancelable from 'p-cancelable'; import type PCancelable from 'p-cancelable';
@@ -8,7 +8,6 @@ import { Service } from 'typedi';
import config from '@/config'; import config from '@/config';
import { ExecutionRepository } from '@/databases/repositories/execution.repository'; import { ExecutionRepository } from '@/databases/repositories/execution.repository';
import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository';
import { Logger } from '@/logging/logger.service';
import { NodeTypes } from '@/node-types'; import { NodeTypes } from '@/node-types';
import * as WorkflowExecuteAdditionalData from '@/workflow-execute-additional-data'; import * as WorkflowExecuteAdditionalData from '@/workflow-execute-additional-data';

View File

@@ -1,10 +1,9 @@
import { GlobalConfig } from '@n8n/config'; import { GlobalConfig } from '@n8n/config';
import { InstanceSettings } from 'n8n-core'; import { InstanceSettings, Logger } from 'n8n-core';
import { Service } from 'typedi'; import { Service } from 'typedi';
import config from '@/config'; import config from '@/config';
import { Time } from '@/constants'; import { Time } from '@/constants';
import { Logger } from '@/logging/logger.service';
import { Publisher } from '@/scaling/pubsub/publisher.service'; import { Publisher } from '@/scaling/pubsub/publisher.service';
import { RedisClientService } from '@/services/redis-client.service'; import { RedisClientService } from '@/services/redis-client.service';
import { TypedEmitter } from '@/typed-emitter'; import { TypedEmitter } from '@/typed-emitter';

View File

@@ -1,10 +1,9 @@
import type { Redis as SingleNodeClient, Cluster as MultiNodeClient } from 'ioredis'; import type { Redis as SingleNodeClient, Cluster as MultiNodeClient } from 'ioredis';
import { InstanceSettings } from 'n8n-core'; import { InstanceSettings, Logger } from 'n8n-core';
import type { LogMetadata } from 'n8n-workflow';
import { Service } from 'typedi'; import { Service } from 'typedi';
import config from '@/config'; import config from '@/config';
import { Logger } from '@/logging/logger.service';
import type { LogMetadata } from '@/logging/types';
import { RedisClientService } from '@/services/redis-client.service'; import { RedisClientService } from '@/services/redis-client.service';
import type { PubSub } from './pubsub.types'; import type { PubSub } from './pubsub.types';

View File

@@ -1,13 +1,12 @@
import type { Redis as SingleNodeClient, Cluster as MultiNodeClient } from 'ioredis'; import type { Redis as SingleNodeClient, Cluster as MultiNodeClient } from 'ioredis';
import debounce from 'lodash/debounce'; import debounce from 'lodash/debounce';
import { InstanceSettings } from 'n8n-core'; import { InstanceSettings, Logger } from 'n8n-core';
import { jsonParse } from 'n8n-workflow'; import { jsonParse } from 'n8n-workflow';
import type { LogMetadata } from 'n8n-workflow';
import { Service } from 'typedi'; import { Service } from 'typedi';
import config from '@/config'; import config from '@/config';
import { EventService } from '@/events/event.service'; import { EventService } from '@/events/event.service';
import { Logger } from '@/logging/logger.service';
import type { LogMetadata } from '@/logging/types';
import { RedisClientService } from '@/services/redis-client.service'; import { RedisClientService } from '@/services/redis-client.service';
import type { PubSub } from './pubsub.types'; import type { PubSub } from './pubsub.types';

View File

@@ -1,5 +1,5 @@
import { GlobalConfig } from '@n8n/config'; import { GlobalConfig } from '@n8n/config';
import { ErrorReporter, InstanceSettings } from 'n8n-core'; import { ErrorReporter, InstanceSettings, Logger } from 'n8n-core';
import { ApplicationError, BINARY_ENCODING, sleep, jsonStringify, ensureError } from 'n8n-workflow'; import { ApplicationError, BINARY_ENCODING, sleep, jsonStringify, ensureError } from 'n8n-workflow';
import type { IExecuteResponsePromiseData } from 'n8n-workflow'; import type { IExecuteResponsePromiseData } from 'n8n-workflow';
import { strict } from 'node:assert'; import { strict } from 'node:assert';
@@ -12,7 +12,6 @@ import { ExecutionRepository } from '@/databases/repositories/execution.reposito
import { OnShutdown } from '@/decorators/on-shutdown'; import { OnShutdown } from '@/decorators/on-shutdown';
import { MaxStalledCountError } from '@/errors/max-stalled-count.error'; import { MaxStalledCountError } from '@/errors/max-stalled-count.error';
import { EventService } from '@/events/event.service'; import { EventService } from '@/events/event.service';
import { Logger } from '@/logging/logger.service';
import { OrchestrationService } from '@/services/orchestration.service'; import { OrchestrationService } from '@/services/orchestration.service';
import { assertNever } from '@/utils'; import { assertNever } from '@/utils';

View File

@@ -1,7 +1,7 @@
import { GlobalConfig } from '@n8n/config'; import { GlobalConfig } from '@n8n/config';
import type { Application } from 'express'; import type { Application } from 'express';
import express from 'express'; import express from 'express';
import { InstanceSettings } from 'n8n-core'; import { InstanceSettings, Logger } from 'n8n-core';
import { strict as assert } from 'node:assert'; import { strict as assert } from 'node:assert';
import http from 'node:http'; import http from 'node:http';
import type { Server } from 'node:http'; import type { Server } from 'node:http';
@@ -13,7 +13,6 @@ import { CredentialsOverwritesAlreadySetError } from '@/errors/credentials-overw
import { NonJsonBodyError } from '@/errors/non-json-body.error'; import { NonJsonBodyError } from '@/errors/non-json-body.error';
import { ExternalHooks } from '@/external-hooks'; import { ExternalHooks } from '@/external-hooks';
import type { ICredentialsOverwrite } from '@/interfaces'; import type { ICredentialsOverwrite } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import { PrometheusMetricsService } from '@/metrics/prometheus-metrics.service'; import { PrometheusMetricsService } from '@/metrics/prometheus-metrics.service';
import { rawBodyReader, bodyParser } from '@/middlewares'; import { rawBodyReader, bodyParser } from '@/middlewares';
import * as ResponseHelper from '@/response-helper'; import * as ResponseHelper from '@/response-helper';

View File

@@ -1,12 +1,11 @@
import { GlobalConfig } from '@n8n/config'; import { GlobalConfig } from '@n8n/config';
import axios from 'axios'; import axios from 'axios';
import { InstanceSettings } from 'n8n-core'; import { InstanceSettings, Logger } from 'n8n-core';
import { Service } from 'typedi'; import { Service } from 'typedi';
import config from '@/config'; import config from '@/config';
import { getN8nPackageJson, inDevelopment } from '@/constants'; import { getN8nPackageJson, inDevelopment } from '@/constants';
import type { WorkflowEntity } from '@/databases/entities/workflow-entity'; import type { WorkflowEntity } from '@/databases/entities/workflow-entity';
import { Logger } from '@/logging/logger.service';
import { isApiEnabled } from '@/public-api'; import { isApiEnabled } from '@/public-api';
import { import {
ENV_VARS_DOCS_URL, ENV_VARS_DOCS_URL,

View File

@@ -1,3 +1,4 @@
import { Logger } from 'n8n-core';
import { Service } from 'typedi'; import { Service } from 'typedi';
import { ActivationErrorsService } from '@/activation-errors.service'; import { ActivationErrorsService } from '@/activation-errors.service';
@@ -5,7 +6,6 @@ import type { User } from '@/databases/entities/user';
import { SharedWorkflowRepository } from '@/databases/repositories/shared-workflow.repository'; import { SharedWorkflowRepository } from '@/databases/repositories/shared-workflow.repository';
import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository';
import { BadRequestError } from '@/errors/response-errors/bad-request.error'; import { BadRequestError } from '@/errors/response-errors/bad-request.error';
import { Logger } from '@/logging/logger.service';
@Service() @Service()
export class ActiveWorkflowsService { export class ActiveWorkflowsService {

View File

@@ -2,8 +2,8 @@ import { GlobalConfig } from '@n8n/config';
import axios from 'axios'; import axios from 'axios';
import { exec } from 'child_process'; import { exec } from 'child_process';
import { access as fsAccess, mkdir as fsMkdir } from 'fs/promises'; import { access as fsAccess, mkdir as fsMkdir } from 'fs/promises';
import { InstanceSettings } from 'n8n-core';
import type { PackageDirectoryLoader } from 'n8n-core'; import type { PackageDirectoryLoader } from 'n8n-core';
import { InstanceSettings, Logger } from 'n8n-core';
import { ApplicationError, type PublicInstalledPackage } from 'n8n-workflow'; import { ApplicationError, type PublicInstalledPackage } from 'n8n-workflow';
import { Service } from 'typedi'; import { Service } from 'typedi';
import { promisify } from 'util'; import { promisify } from 'util';
@@ -22,7 +22,6 @@ import { FeatureNotLicensedError } from '@/errors/feature-not-licensed.error';
import type { CommunityPackages } from '@/interfaces'; import type { CommunityPackages } from '@/interfaces';
import { License } from '@/license'; import { License } from '@/license';
import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials'; import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials';
import { Logger } from '@/logging/logger.service';
import { Publisher } from '@/scaling/pubsub/publisher.service'; import { Publisher } from '@/scaling/pubsub/publisher.service';
import { toError } from '@/utils'; import { toError } from '@/utils';

View File

@@ -4,7 +4,13 @@
/* eslint-disable @typescript-eslint/no-unsafe-return */ /* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-call */
import get from 'lodash/get'; import get from 'lodash/get';
import { ErrorReporter, NodeExecuteFunctions, RoutingNode, isObjectLiteral } from 'n8n-core'; import {
ErrorReporter,
Logger,
NodeExecuteFunctions,
RoutingNode,
isObjectLiteral,
} from 'n8n-core';
import type { import type {
ICredentialsDecrypted, ICredentialsDecrypted,
ICredentialTestFunction, ICredentialTestFunction,
@@ -28,7 +34,6 @@ import { Service } from 'typedi';
import { CredentialTypes } from '@/credential-types'; import { CredentialTypes } from '@/credential-types';
import type { User } from '@/databases/entities/user'; import type { User } from '@/databases/entities/user';
import { Logger } from '@/logging/logger.service';
import { NodeTypes } from '@/node-types'; import { NodeTypes } from '@/node-types';
import * as WorkflowExecuteAdditionalData from '@/workflow-execute-additional-data'; import * as WorkflowExecuteAdditionalData from '@/workflow-execute-additional-data';

View File

@@ -3,7 +3,7 @@ import { GlobalConfig, FrontendConfig, SecurityConfig } from '@n8n/config';
import { createWriteStream } from 'fs'; import { createWriteStream } from 'fs';
import { mkdir } from 'fs/promises'; import { mkdir } from 'fs/promises';
import uniq from 'lodash/uniq'; import uniq from 'lodash/uniq';
import { InstanceSettings } from 'n8n-core'; import { InstanceSettings, Logger } from 'n8n-core';
import type { ICredentialType, INodeTypeBaseDescription } from 'n8n-workflow'; import type { ICredentialType, INodeTypeBaseDescription } from 'n8n-workflow';
import path from 'path'; import path from 'path';
import { Container, Service } from 'typedi'; import { Container, Service } from 'typedi';
@@ -16,7 +16,6 @@ import { getVariablesLimit } from '@/environments/variables/environment-helpers'
import { getLdapLoginLabel } from '@/ldap/helpers.ee'; import { getLdapLoginLabel } from '@/ldap/helpers.ee';
import { License } from '@/license'; import { License } from '@/license';
import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials'; import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials';
import { Logger } from '@/logging/logger.service';
import { isApiEnabled } from '@/public-api'; import { isApiEnabled } from '@/public-api';
import type { CommunityPackagesService } from '@/services/community-packages.service'; import type { CommunityPackagesService } from '@/services/community-packages.service';
import { getSamlLoginLabel } from '@/sso/saml/saml-helpers'; import { getSamlLoginLabel } from '@/sso/saml/saml-helpers';

View File

@@ -1,3 +1,4 @@
import { Logger } from 'n8n-core';
import { type INode, type INodeCredentialsDetails } from 'n8n-workflow'; import { type INode, type INodeCredentialsDetails } from 'n8n-workflow';
import { Service } from 'typedi'; import { Service } from 'typedi';
import { v4 as uuid } from 'uuid'; import { v4 as uuid } from 'uuid';
@@ -11,7 +12,6 @@ import { CredentialsRepository } from '@/databases/repositories/credentials.repo
import { TagRepository } from '@/databases/repositories/tag.repository'; import { TagRepository } from '@/databases/repositories/tag.repository';
import * as Db from '@/db'; import * as Db from '@/db';
import type { ICredentialsDb } from '@/interfaces'; import type { ICredentialsDb } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import { replaceInvalidCredentials } from '@/workflow-helpers'; import { replaceInvalidCredentials } from '@/workflow-helpers';
@Service() @Service()

View File

@@ -1,5 +1,5 @@
import { ExecutionsConfig } from '@n8n/config'; import { ExecutionsConfig } from '@n8n/config';
import { BinaryDataService, InstanceSettings } from 'n8n-core'; import { BinaryDataService, InstanceSettings, Logger } from 'n8n-core';
import { ensureError } from 'n8n-workflow'; import { ensureError } from 'n8n-workflow';
import { strict } from 'node:assert'; import { strict } from 'node:assert';
import { Service } from 'typedi'; import { Service } from 'typedi';
@@ -8,7 +8,6 @@ import { Time } from '@/constants';
import { ExecutionRepository } from '@/databases/repositories/execution.repository'; import { ExecutionRepository } from '@/databases/repositories/execution.repository';
import { connectionState as dbConnectionState } from '@/db'; import { connectionState as dbConnectionState } from '@/db';
import { OnShutdown } from '@/decorators/on-shutdown'; import { OnShutdown } from '@/decorators/on-shutdown';
import { Logger } from '@/logging/logger.service';
import { OrchestrationService } from '../orchestration.service'; import { OrchestrationService } from '../orchestration.service';

View File

@@ -1,10 +1,10 @@
import { GlobalConfig } from '@n8n/config'; import { GlobalConfig } from '@n8n/config';
import ioRedis from 'ioredis'; import ioRedis from 'ioredis';
import type { Cluster, RedisOptions } from 'ioredis'; import type { Cluster, RedisOptions } from 'ioredis';
import { Logger } from 'n8n-core';
import { Service } from 'typedi'; import { Service } from 'typedi';
import { Debounce } from '@/decorators/debounce'; import { Debounce } from '@/decorators/debounce';
import { Logger } from '@/logging/logger.service';
import { TypedEmitter } from '@/typed-emitter'; import { TypedEmitter } from '@/typed-emitter';
import type { RedisClientType } from '../scaling/redis/redis.types'; import type { RedisClientType } from '../scaling/redis/redis.types';

View File

@@ -1,3 +1,4 @@
import { Logger } from 'n8n-core';
import type { IUserSettings } from 'n8n-workflow'; import type { IUserSettings } from 'n8n-workflow';
import { ApplicationError } from 'n8n-workflow'; import { ApplicationError } from 'n8n-workflow';
import { Service } from 'typedi'; import { Service } from 'typedi';
@@ -7,7 +8,6 @@ import { UserRepository } from '@/databases/repositories/user.repository';
import { InternalServerError } from '@/errors/response-errors/internal-server.error'; import { InternalServerError } from '@/errors/response-errors/internal-server.error';
import { EventService } from '@/events/event.service'; import { EventService } from '@/events/event.service';
import type { Invitation, PublicUser } from '@/interfaces'; import type { Invitation, PublicUser } from '@/interfaces';
import { Logger } from '@/logging/logger.service';
import type { PostHogClient } from '@/posthog'; import type { PostHogClient } from '@/posthog';
import type { UserRequest } from '@/requests'; import type { UserRequest } from '@/requests';
import { UrlService } from '@/services/url.service'; import { UrlService } from '@/services/url.service';

View File

@@ -1,10 +1,10 @@
import { Logger } from 'n8n-core';
import type { INode, IRun, IWorkflowBase } from 'n8n-workflow'; import type { INode, IRun, IWorkflowBase } from 'n8n-workflow';
import { Service } from 'typedi'; import { Service } from 'typedi';
import { StatisticsNames } from '@/databases/entities/workflow-statistics'; import { StatisticsNames } from '@/databases/entities/workflow-statistics';
import { WorkflowStatisticsRepository } from '@/databases/repositories/workflow-statistics.repository'; import { WorkflowStatisticsRepository } from '@/databases/repositories/workflow-statistics.repository';
import { EventService } from '@/events/event.service'; import { EventService } from '@/events/event.service';
import { Logger } from '@/logging/logger.service';
import { UserService } from '@/services/user.service'; import { UserService } from '@/services/user.service';
import { TypedEmitter } from '@/typed-emitter'; import { TypedEmitter } from '@/typed-emitter';

View File

@@ -1,9 +1,9 @@
import { type Class, ErrorReporter } from 'n8n-core'; import { type Class, ErrorReporter } from 'n8n-core';
import { Logger } from 'n8n-core';
import { ApplicationError, assert } from 'n8n-workflow'; import { ApplicationError, assert } from 'n8n-workflow';
import { Container, Service } from 'typedi'; import { Container, Service } from 'typedi';
import { LOWEST_SHUTDOWN_PRIORITY, HIGHEST_SHUTDOWN_PRIORITY } from '@/constants'; import { LOWEST_SHUTDOWN_PRIORITY, HIGHEST_SHUTDOWN_PRIORITY } from '@/constants';
import { Logger } from '@/logging/logger.service';
type HandlerFn = () => Promise<void> | void; type HandlerFn = () => Promise<void> | void;
export type ServiceClass = Class<Record<string, HandlerFn>>; export type ServiceClass = Class<Record<string, HandlerFn>>;

View File

@@ -1,4 +1,5 @@
import { Logger } from '@/logging/logger.service'; import { Logger } from 'n8n-core';
import { mockInstance } from '@test/mocking'; import { mockInstance } from '@test/mocking';
import { validateMetadata, validateResponse } from '../saml-validator'; import { validateMetadata, validateResponse } from '../saml-validator';

View File

@@ -1,9 +1,9 @@
import type express from 'express'; import type express from 'express';
import { mock } from 'jest-mock-extended'; import { mock } from 'jest-mock-extended';
import { Logger } from 'n8n-core';
import type { IdentityProviderInstance, ServiceProviderInstance } from 'samlify'; import type { IdentityProviderInstance, ServiceProviderInstance } from 'samlify';
import { SettingsRepository } from '@/databases/repositories/settings.repository'; import { SettingsRepository } from '@/databases/repositories/settings.repository';
import { Logger } from '@/logging/logger.service';
import { UrlService } from '@/services/url.service'; import { UrlService } from '@/services/url.service';
import * as samlHelpers from '@/sso/saml/saml-helpers'; import * as samlHelpers from '@/sso/saml/saml-helpers';
import { SamlService } from '@/sso/saml/saml.service.ee'; import { SamlService } from '@/sso/saml/saml.service.ee';

View File

@@ -1,8 +1,7 @@
import { Logger } from 'n8n-core';
import { Container } from 'typedi'; import { Container } from 'typedi';
import type { XMLFileInfo } from 'xmllint-wasm'; import type { XMLFileInfo } from 'xmllint-wasm';
import { Logger } from '@/logging/logger.service';
let xmlMetadata: XMLFileInfo; let xmlMetadata: XMLFileInfo;
let xmlProtocol: XMLFileInfo; let xmlProtocol: XMLFileInfo;

View File

@@ -1,6 +1,7 @@
import axios from 'axios'; import axios from 'axios';
import type express from 'express'; import type express from 'express';
import https from 'https'; import https from 'https';
import { Logger } from 'n8n-core';
import { ApplicationError, jsonParse } from 'n8n-workflow'; import { ApplicationError, jsonParse } from 'n8n-workflow';
import type { IdentityProviderInstance, ServiceProviderInstance } from 'samlify'; import type { IdentityProviderInstance, ServiceProviderInstance } from 'samlify';
import type { BindingContext, PostBindingContext } from 'samlify/types/src/entity'; import type { BindingContext, PostBindingContext } from 'samlify/types/src/entity';
@@ -12,7 +13,6 @@ import { SettingsRepository } from '@/databases/repositories/settings.repository
import { UserRepository } from '@/databases/repositories/user.repository'; import { UserRepository } from '@/databases/repositories/user.repository';
import { AuthError } from '@/errors/response-errors/auth.error'; import { AuthError } from '@/errors/response-errors/auth.error';
import { BadRequestError } from '@/errors/response-errors/bad-request.error'; import { BadRequestError } from '@/errors/response-errors/bad-request.error';
import { Logger } from '@/logging/logger.service';
import { UrlService } from '@/services/url.service'; import { UrlService } from '@/services/url.service';
import { SAML_PREFERENCES_DB_KEY } from './constants'; import { SAML_PREFERENCES_DB_KEY } from './constants';

View File

@@ -1,10 +1,10 @@
import { GlobalConfig } from '@n8n/config'; import { GlobalConfig } from '@n8n/config';
import { Logger } from 'n8n-core';
import { type Workflow, type INode, type WorkflowSettings } from 'n8n-workflow'; import { type Workflow, type INode, type WorkflowSettings } from 'n8n-workflow';
import { Service } from 'typedi'; import { Service } from 'typedi';
import type { Project } from '@/databases/entities/project'; import type { Project } from '@/databases/entities/project';
import { SubworkflowPolicyDenialError } from '@/errors/subworkflow-policy-denial.error'; import { SubworkflowPolicyDenialError } from '@/errors/subworkflow-policy-denial.error';
import { Logger } from '@/logging/logger.service';
import { AccessService } from '@/services/access.service'; import { AccessService } from '@/services/access.service';
import { OwnershipService } from '@/services/ownership.service'; import { OwnershipService } from '@/services/ownership.service';
import { UrlService } from '@/services/url.service'; import { UrlService } from '@/services/url.service';

View File

@@ -1,7 +1,7 @@
import { GlobalConfig } from '@n8n/config'; import { GlobalConfig } from '@n8n/config';
import type RudderStack from '@rudderstack/rudder-sdk-node'; import type RudderStack from '@rudderstack/rudder-sdk-node';
import axios from 'axios'; import axios from 'axios';
import { InstanceSettings } from 'n8n-core'; import { InstanceSettings, Logger } from 'n8n-core';
import type { ITelemetryTrackProperties } from 'n8n-workflow'; import type { ITelemetryTrackProperties } from 'n8n-workflow';
import { Container, Service } from 'typedi'; import { Container, Service } from 'typedi';
@@ -13,7 +13,6 @@ import { WorkflowRepository } from '@/databases/repositories/workflow.repository
import { OnShutdown } from '@/decorators/on-shutdown'; import { OnShutdown } from '@/decorators/on-shutdown';
import type { IExecutionTrackProperties } from '@/interfaces'; import type { IExecutionTrackProperties } from '@/interfaces';
import { License } from '@/license'; import { License } from '@/license';
import { Logger } from '@/logging/logger.service';
import { PostHogClient } from '@/posthog'; import { PostHogClient } from '@/posthog';
import { SourceControlPreferencesService } from '../environments/source-control/source-control-preferences.service.ee'; import { SourceControlPreferencesService } from '../environments/source-control/source-control-preferences.service.ee';

View File

@@ -1,14 +1,12 @@
import { GlobalConfig } from '@n8n/config'; import { GlobalConfig } from '@n8n/config';
import { pick } from 'lodash'; import { pick } from 'lodash';
import { ErrorReporter } from 'n8n-core'; import { ErrorReporter, Logger } from 'n8n-core';
import path from 'node:path'; import path from 'node:path';
import type { Transporter } from 'nodemailer'; import type { Transporter } from 'nodemailer';
import { createTransport } from 'nodemailer'; import { createTransport } from 'nodemailer';
import type SMTPConnection from 'nodemailer/lib/smtp-connection'; import type SMTPConnection from 'nodemailer/lib/smtp-connection';
import { Service } from 'typedi'; import { Service } from 'typedi';
import { Logger } from '@/logging/logger.service';
import type { MailData, SendEmailResult } from './interfaces'; import type { MailData, SendEmailResult } from './interfaces';
@Service() @Service()

View File

@@ -2,6 +2,7 @@ import { GlobalConfig } from '@n8n/config';
import { existsSync } from 'fs'; import { existsSync } from 'fs';
import { readFile } from 'fs/promises'; import { readFile } from 'fs/promises';
import Handlebars from 'handlebars'; import Handlebars from 'handlebars';
import { Logger } from 'n8n-core';
import { join as pathJoin } from 'path'; import { join as pathJoin } from 'path';
import { Container, Service } from 'typedi'; import { Container, Service } from 'typedi';
@@ -11,7 +12,6 @@ import type { WorkflowEntity } from '@/databases/entities/workflow-entity';
import { UserRepository } from '@/databases/repositories/user.repository'; import { UserRepository } from '@/databases/repositories/user.repository';
import { InternalServerError } from '@/errors/response-errors/internal-server.error'; import { InternalServerError } from '@/errors/response-errors/internal-server.error';
import { EventService } from '@/events/event.service'; import { EventService } from '@/events/event.service';
import { Logger } from '@/logging/logger.service';
import { UrlService } from '@/services/url.service'; import { UrlService } from '@/services/url.service';
import { toError } from '@/utils'; import { toError } from '@/utils';

View File

@@ -1,10 +1,9 @@
import { InstanceSettings } from 'n8n-core'; import { InstanceSettings, Logger } from 'n8n-core';
import { ApplicationError, type IWorkflowExecutionDataProcess } from 'n8n-workflow'; import { ApplicationError, type IWorkflowExecutionDataProcess } from 'n8n-workflow';
import { Service } from 'typedi'; import { Service } from 'typedi';
import { ActiveExecutions } from '@/active-executions'; import { ActiveExecutions } from '@/active-executions';
import { ExecutionRepository } from '@/databases/repositories/execution.repository'; import { ExecutionRepository } from '@/databases/repositories/execution.repository';
import { Logger } from '@/logging/logger.service';
import { OrchestrationService } from '@/services/orchestration.service'; import { OrchestrationService } from '@/services/orchestration.service';
import { OwnershipService } from '@/services/ownership.service'; import { OwnershipService } from '@/services/ownership.service';
import { WorkflowRunner } from '@/workflow-runner'; import { WorkflowRunner } from '@/workflow-runner';

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