refactor(core): Move finder services to backend services (no-changelog) (#40069)

This commit is contained in:
Charlie Kolb 2026-10-02 07:38:15 +00:00 committed by GitHub
parent 2d3e8140ce
commit b48bb1f899
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
82 changed files with 136 additions and 138 deletions

View File

@ -13,8 +13,8 @@ import {
} from '@n8n/db';
import type { Scope } from '@n8n/permissions';
import type { RoleService } from '@n8n/backend-services';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { RoleService } from '../../services/role.service';
import { CredentialsFinderService } from '../credentials-finder.service';
const member = mock<User>({ id: 'user-1', role: GLOBAL_MEMBER_ROLE });
const owner = mock<User>({ id: 'owner-1', role: GLOBAL_OWNER_ROLE });

View File

@ -9,7 +9,7 @@ import {
import { Service } from '@n8n/di';
import { hasGlobalScope } from '@n8n/permissions';
import type { CredentialSharingRole, ProjectRole, Scope } from '@n8n/permissions';
import { RoleService } from '@n8n/backend-services';
import { RoleService } from '../services/role.service';
/**
* The credential scopes an instance role can hold without being allowed to use a

View File

@ -1,4 +1,9 @@
export { EventService, type EventMap } from './events/event.service';
export {
CredentialsFinderService,
CREDENTIAL_USABILITY_SCOPES,
type UnusableCredential,
} from './credentials/credentials-finder.service';
export { UncacheableValueError } from './errors/cache-errors/uncacheable-value.error';
export { CacheService } from './services/cache/cache.service';
export { RedisClientService } from './services/redis-client.service';
@ -9,6 +14,7 @@ export {
type RoleDeletionChecker,
} from './services/role-deletion-check-proxy.service';
export { RoleService } from './services/role.service';
export { FolderFinderService } from './services/folder-finder.service';
export { UrlService } from './services/url.service';
export {
classifyRestError,

View File

@ -10,7 +10,7 @@ import type {
} from '@n8n/db';
import { FolderFinderService } from '../folder-finder.service';
import type { RoleService } from '@n8n/backend-services';
import type { RoleService } from '../role.service';
const member = mock<User>({
id: 'user-1',

View File

@ -2,7 +2,7 @@ import type { Folder, OperationContext, User } from '@n8n/db';
import { FolderAccessRepository } from '@n8n/db';
import { Service } from '@n8n/di';
import { hasGlobalScope, type Scope } from '@n8n/permissions';
import { RoleService } from '@n8n/backend-services';
import { RoleService } from './role.service';
/**
* Resolves folders by id for a user, enforcing access through the folder's home

View File

@ -26,7 +26,7 @@ import type { CredentialRequest } from '@/requests';
import { createNewCredentialsPayload, createdCredentialsWithScopes } from './credentials.test-data';
import type { CredentialDependencyService } from '../credential-dependency.service';
import type { CredentialsFinderService } from '../credentials-finder.service';
import type { CredentialsFinderService } from '@n8n/backend-services';
import { CredentialsController } from '../credentials.controller';
import { CredentialsService } from '../credentials.service';
import * as validation from '../validation';

View File

@ -9,14 +9,13 @@ import type {
import { mock } from 'vitest-mock-extended';
import type { CredentialConnectionStatusProxy } from '@/credentials/credential-connection-status-proxy';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { type CredentialsFinderService, type RoleService } from '@n8n/backend-services';
import type { CredentialsService } from '@/credentials/credentials.service';
import { EnterpriseCredentialsService } from '@/credentials/credentials.service.ee';
import type { ExternalSecretsConfig } from '@/modules/external-secrets.ee/external-secrets.config';
import type { SecretsProviderAccessCheckService } from '@/modules/external-secrets.ee/secret-provider-access-check.service.ee';
import type { OwnershipService } from '@/services/ownership.service';
import type { ProjectService } from '@/services/project.service.ee';
import type { RoleService } from '@n8n/backend-services';
describe('EnterpriseCredentialsService', () => {
const sharedCredentialsRepository = mock<SharedCredentialsRepository>();

View File

@ -2,7 +2,11 @@ import { CredentialDescriptionsService } from '@/credentials/credential-descript
import type { PostHogClient } from '@/posthog';
import { CREDENTIAL_DESCRIPTION_MAX_LENGTH } from '@n8n/api-types';
import type { Logger } from '@n8n/backend-common';
import { type EventService, type RoleService } from '@n8n/backend-services';
import {
type EventService,
type RoleService,
type CredentialsFinderService,
} from '@n8n/backend-services';
import type {
CredentialsRepository,
ICredentialsDb,
@ -44,7 +48,6 @@ import { mock } from 'vitest-mock-extended';
import type { CredentialTypes } from '@/credential-types';
import type { CredentialConnectionStatusProxy } from '@/credentials/credential-connection-status-proxy';
import type { CredentialDependencyService } from '@/credentials/credential-dependency.service';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsService } from '@/credentials/credentials.service';
import type { InstanceCredentialUseRegistry } from '@/credentials/instance-credential-use.registry';
import * as validation from '@/credentials/validation';

View File

@ -6,7 +6,7 @@ import {
TestCredentialRequestDto,
} from '@n8n/api-types';
import { LicenseState, Logger } from '@n8n/backend-common';
import { EventService } from '@n8n/backend-services';
import { EventService, CredentialsFinderService } from '@n8n/backend-services';
import { GlobalConfig } from '@n8n/config';
import {
SharedCredentials,
@ -36,7 +36,6 @@ import { z } from 'zod';
import { CredentialConnectionStatusProxy } from './credential-connection-status-proxy';
import { CredentialDescriptionsService } from './credential-descriptions.service';
import { CredentialsFinderService } from './credentials-finder.service';
import { CredentialsService } from './credentials.service';
import { EnterpriseCredentialsService } from './credentials.service.ee';
import { getExternalSecretExpressionPaths } from './external-secrets.utils';

View File

@ -18,10 +18,9 @@ import { ExternalSecretsConfig } from '@/modules/external-secrets.ee/external-se
import { SecretsProviderAccessCheckService } from '@/modules/external-secrets.ee/secret-provider-access-check.service.ee';
import { OwnershipService } from '@/services/ownership.service';
import { ProjectService } from '@/services/project.service.ee';
import { RoleService } from '@n8n/backend-services';
import { RoleService, CredentialsFinderService } from '@n8n/backend-services';
import { CredentialConnectionStatusProxy } from './credential-connection-status-proxy';
import { CredentialsFinderService } from './credentials-finder.service';
import { CredentialsService } from './credentials.service';
import { validateAccessToReferencedSecretProviders } from './validation';

View File

@ -1,6 +1,6 @@
import type { CreateCredentialDto, CredentialConnectionStatus } from '@n8n/api-types';
import { Logger } from '@n8n/backend-common';
import { EventService, RoleService } from '@n8n/backend-services';
import { EventService, RoleService, CredentialsFinderService } from '@n8n/backend-services';
import { Time } from '@n8n/constants';
import {
Project,
@ -83,7 +83,6 @@ import {
CredentialDependencyService,
type CredentialDependencyFilter,
} from './credential-dependency.service';
import { CredentialsFinderService } from './credentials-finder.service';
import { getExternalSecretExpressionPaths } from './external-secrets.utils';
import { InstanceCredentialUseRegistry } from './instance-credential-use.registry';
import {

View File

@ -4,7 +4,7 @@ import type { IConnections, INode, IWorkflowBase } from 'n8n-workflow';
import type { Mocked } from 'vitest';
import { mock } from 'vitest-mock-extended';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { CredentialsFinderService } from '@n8n/backend-services';
import type { DataTable as DataTableEntity } from '@/modules/data-table/data-table.entity';
import type { DataTableRepository } from '@/modules/data-table/data-table.repository';

View File

@ -14,7 +14,7 @@ import {
mapConnectionsByDestination,
} from 'n8n-workflow';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService } from '@n8n/backend-services';
import { DataTableRepository } from '@/modules/data-table/data-table.repository';
import { LlmJudgeProviderRegistry } from './llm-judge-provider-registry';

View File

@ -7,7 +7,7 @@ import type {
import type { Mocked } from 'vitest';
import { mock } from 'vitest-mock-extended';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { CredentialsFinderService } from '@n8n/backend-services';
import type { CredentialsService } from '@/credentials/credentials.service';
import { InsightsModelResolver } from '../insights-model-resolver';

View File

@ -3,7 +3,7 @@ import type { EvaluationConfig, User } from '@n8n/db';
import { EvaluationConfigRepository } from '@n8n/db';
import { Service } from '@n8n/di';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService } from '@n8n/backend-services';
import { CredentialsService } from '@/credentials/credentials.service';
// LLM-judge provider node types → `@n8n/agents` provider prefix. Only the

View File

@ -14,7 +14,7 @@ import { mock } from 'vitest-mock-extended';
import type { Logger } from '@n8n/backend-common';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { CredentialsFinderService } from '@n8n/backend-services';
import type { NodeTypes } from '@/node-types';
import type { OwnershipService } from '@/services/ownership.service';
import type { ProjectService } from '@/services/project.service.ee';

View File

@ -7,10 +7,7 @@ import type { INode, INodeTypeDescription } from 'n8n-workflow';
import { getActiveCredentialTypes, UserError } from 'n8n-workflow';
import { isCredSharingEnabled } from '@/constants/credential-sharing';
import {
CredentialsFinderService,
type UnusableCredential,
} from '@/credentials/credentials-finder.service';
import { CredentialsFinderService, type UnusableCredential } from '@n8n/backend-services';
import { NodeTypes } from '@/node-types';
import { OwnershipService } from '@/services/ownership.service';
import { ProjectService } from '@/services/project.service.ee';

View File

@ -1,4 +1,4 @@
import type { EventService } from '@n8n/backend-services';
import { type EventService, type CredentialsFinderService } from '@n8n/backend-services';
import type { AgentMessageSteeringService } from '../agent-message-steering.service';
import type { Mocked } from 'vitest';
import { type AgentJsonConfig } from '@n8n/api-types';
@ -16,7 +16,6 @@ import { Container } from '@n8n/di';
import { mock } from 'vitest-mock-extended';
import type { ActiveExecutions } from '@/active-executions';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { ExternalHooks } from '@/external-hooks';
import { CredentialsService } from '@/credentials/credentials.service';
import type { EphemeralNodeExecutor } from '@/node-execution';

View File

@ -6,7 +6,7 @@ import type { CustomFetch, HttpTransport, OutboundHttp } from '@n8n/backend-netw
import { mock } from 'vitest-mock-extended';
import type { ActiveExecutions } from '@/active-executions';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { CredentialsFinderService } from '@n8n/backend-services';
import type { EphemeralNodeExecutor } from '@/node-execution';
import type { OauthService } from '@/oauth/oauth.service';
import type { AiService } from '@/services/ai.service';

View File

@ -18,7 +18,7 @@ import { Container } from '@n8n/di';
import { mock } from 'vitest-mock-extended';
import type { ActiveExecutions } from '@/active-executions';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { CredentialsFinderService } from '@n8n/backend-services';
import { SubworkflowPolicyChecker } from '@/executions/pre-execution-checks';
import type { EphemeralNodeExecutor } from '@/node-execution';
import type { OauthService } from '@/oauth/oauth.service';

View File

@ -22,7 +22,7 @@ import { Container } from '@n8n/di';
import { mock } from 'vitest-mock-extended';
import type { ActiveExecutions } from '@/active-executions';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { CredentialsFinderService } from '@n8n/backend-services';
import type { EphemeralNodeExecutor } from '@/node-execution';
import type { OauthService } from '@/oauth/oauth.service';
import type { AiService } from '@/services/ai.service';

View File

@ -36,7 +36,7 @@ import { nanoid } from 'nanoid';
import { ActiveExecutions } from '@/active-executions';
import { N8N_VERSION } from '@/constants';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService } from '@n8n/backend-services';
import { SubworkflowPolicyChecker } from '@/executions/pre-execution-checks';
import type { AgentRunTelemetryType } from '@/interfaces';
import { EphemeralNodeExecutor } from '@/node-execution';

View File

@ -6,12 +6,14 @@ import { mock } from 'vitest-mock-extended';
import type { Cipher } from 'n8n-core';
import type { CredentialsService } from '@/credentials/credentials.service';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import {
type CredentialsFinderService,
type CacheService,
type UrlService,
} from '@n8n/backend-services';
import type { CredentialsOverwrites } from '@/credentials-overwrites';
import { BadRequestError } from '@n8n/errors';
import type { CacheService } from '@n8n/backend-services';
import type { ProjectService } from '@/services/project.service.ee';
import type { UrlService } from '@n8n/backend-services';
import type { AgentIntegrationManagementService } from '../../agent-integration-management.service';
import type { AgentRepository } from '../../repositories/agent.repository';

View File

@ -17,11 +17,10 @@ import { randomBytes } from 'node:crypto';
import { readFile } from 'node:fs/promises';
import { join } from 'node:path';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService, CacheService } from '@n8n/backend-services';
import { CredentialsService } from '@/credentials/credentials.service';
import { CredentialsOverwrites } from '@/credentials-overwrites';
import { BadRequestError, NotFoundError } from '@n8n/errors';
import { CacheService } from '@n8n/backend-services';
import { SlackMethodsService } from './slack-methods.service';
import {

View File

@ -9,7 +9,7 @@ import type { EntityManager } from '@n8n/typeorm';
import type { INodeCredentials } from 'n8n-workflow';
import { mock } from 'vitest-mock-extended';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { CredentialsFinderService } from '@n8n/backend-services';
import type { CredentialsService } from '@/credentials/credentials.service';
import { BadRequestError, ForbiddenError } from '@n8n/errors';

View File

@ -8,7 +8,7 @@ import { Service } from '@n8n/di';
import { EntityManager } from '@n8n/typeorm';
import type { INodeCredentials } from 'n8n-workflow';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService } from '@n8n/backend-services';
import { CredentialsService } from '@/credentials/credentials.service';
import { BadRequestError, ForbiddenError } from '@n8n/errors';

View File

@ -17,7 +17,7 @@ import {
type IWorkflowExecuteAdditionalData,
} from 'n8n-workflow';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService } from '@n8n/backend-services';
import { DynamicNodeParametersService } from '@/services/dynamic-node-parameters.service';
import { getBase } from '@/workflow-execute-additional-data';
import { WorkflowService } from '@/workflows/workflow.service';

View File

@ -1,5 +1,5 @@
import { Logger } from '@n8n/backend-common';
import { EventService, UrlService } from '@n8n/backend-services';
import { EventService, UrlService, CredentialsFinderService } from '@n8n/backend-services';
import { mockInstance } from '@n8n/backend-test-utils';
import { type AuthenticatedRequest, type CredentialsEntity } from '@n8n/db';
import { Container } from '@n8n/di';
@ -7,7 +7,6 @@ import type { Request, Response } from 'express';
import { Cipher } from 'n8n-core';
import { mock } from 'vitest-mock-extended';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { EnterpriseCredentialsService } from '@/credentials/credentials.service.ee';
import type { DynamicCredentialResolver } from '@/modules/dynamic-credentials.ee/database/entities/credential-resolver';
import { DynamicCredentialResolverRepository } from '@/modules/dynamic-credentials.ee/database/repositories/credential-resolver.repository';

View File

@ -1,4 +1,4 @@
import { EventService, UrlService } from '@n8n/backend-services';
import { EventService, UrlService, CredentialsFinderService } from '@n8n/backend-services';
import { Time } from '@n8n/constants';
import { CredentialsEntity, AuthenticatedRequest, isAuthenticatedRequest } from '@n8n/db';
import { Delete, Get, Options, Param, Post, RestController } from '@n8n/decorators';
@ -8,7 +8,6 @@ import { Request, Response } from 'express';
import { Cipher } from 'n8n-core';
import { type ICredentialContext, jsonParse } from 'n8n-workflow';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { EnterpriseCredentialsService } from '@/credentials/credentials.service.ee';
import { BadRequestError, NotFoundError } from '@n8n/errors';
import { CreateCsrfStateData, OauthService } from '@/oauth/oauth.service';

View File

@ -1,7 +1,7 @@
import { DEFAULT_INSTANCE_AI_PERMISSIONS } from '@n8n/api-types';
import type { InstanceAiPermissions } from '@n8n/api-types';
import { Logger } from '@n8n/backend-common';
import type { EventService } from '@n8n/backend-services';
import { type EventService, type CredentialsFinderService } from '@n8n/backend-services';
import type { InstanceAiConfig } from '@n8n/config';
import type {
CredentialsEntity,
@ -21,7 +21,6 @@ import {
type SandboxSettingsService,
} from '@/services/sandbox-settings.service';
import type { UserService } from '@/services/user.service';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { CredentialsService } from '@/credentials/credentials.service';
import type { InstanceCredentialBroker } from '@/credentials/instance-credential-broker';

View File

@ -29,7 +29,11 @@ vi.mock('@n8n/ai-utilities', () => ({
import type { Logger } from '@n8n/backend-common';
import { INSTANCE_AI_NODE_USAGE_FLAG } from '@n8n/api-types';
import type { OutboundHttp } from '@n8n/backend-network';
import { type EventService, type RoleService } from '@n8n/backend-services';
import {
type EventService,
type RoleService,
type CredentialsFinderService,
} from '@n8n/backend-services';
import type { GlobalConfig } from '@n8n/config';
import type {
AiBuilderTemporaryWorkflowRepository,
@ -46,7 +50,6 @@ import { mock } from 'vitest-mock-extended';
import type { ActiveExecutions } from '@/active-executions';
import type { CollaborationService } from '@/collaboration/collaboration.service';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { CredentialsService } from '@/credentials/credentials.service';
import type { ExecutionPersistence } from '@/executions/execution-persistence';
import type { License } from '@/license';

View File

@ -27,7 +27,11 @@ vi.mock('@n8n/instance-ai', async () => {
});
import type { Logger } from '@n8n/backend-common';
import { type EventService, type RoleService } from '@n8n/backend-services';
import {
type EventService,
type RoleService,
type CredentialsFinderService,
} from '@n8n/backend-services';
import type { GlobalConfig } from '@n8n/config';
import { GLOBAL_MEMBER_ROLE } from '@n8n/db';
import { Container } from '@n8n/di';
@ -44,7 +48,6 @@ import type { InstanceSettings } from 'n8n-core';
import { mock } from 'vitest-mock-extended';
import type { ActiveExecutions } from '@/active-executions';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { CredentialsService } from '@/credentials/credentials.service';
import type { WorkflowRunner } from '@/workflow-runner';
import type { DynamicNodeParametersService } from '@/services/dynamic-node-parameters.service';

View File

@ -1805,7 +1805,7 @@ import type {
} from '@n8n/db';
import { TELEMETRY_EVENT } from '@n8n/telemetry';
import { UserError, UnexpectedError } from 'n8n-workflow';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { type CredentialsFinderService, type RoleService } from '@n8n/backend-services';
import type { DataTableRepository } from '@/modules/data-table/data-table.repository';
import type { DataTableService } from '@/modules/data-table/data-table.service';
import type { InstanceWriteAccessService } from '@/services/instance-write-access.service';
@ -1827,7 +1827,6 @@ import {
} from '@n8n/errors';
import type { License } from '@/license';
import type { AiPreferenceService } from '@/services/ai-preference.service';
import type { RoleService } from '@n8n/backend-services';
import type { OutboundHttp } from '@n8n/backend-network';
import { ModuleRegistry } from '@n8n/backend-common';

View File

@ -1,4 +1,4 @@
import { EventService } from '@n8n/backend-services';
import { EventService, CredentialsFinderService } from '@n8n/backend-services';
import { isDeepStrictEqual } from 'node:util';
import {
@ -37,7 +37,6 @@ import { ensureError } from '@n8n/utils/errors/ensure-error';
import type { ICredentialDataDecryptedObject, IUserSettings } from 'n8n-workflow';
import { jsonParse, UnexpectedError } from 'n8n-workflow';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsService } from '@/credentials/credentials.service';
import {
InstanceCredentialBroker,

View File

@ -26,7 +26,12 @@ import {
import type { AiGatewayConfigDto } from '@n8n/api-types';
import { LicenseState, Logger, ModuleRegistry } from '@n8n/backend-common';
import { OutboundHttp } from '@n8n/backend-network';
import { EventService, RoleService } from '@n8n/backend-services';
import {
EventService,
RoleService,
CredentialsFinderService,
FolderFinderService,
} from '@n8n/backend-services';
import { GlobalConfig } from '@n8n/config';
import { Time, TOOL_EXECUTOR_NODE_NAME } from '@n8n/constants';
import type { User, ExecutionSummaries, EvaluationConfig } from '@n8n/db';
@ -152,7 +157,6 @@ import path from 'node:path';
import { ActiveExecutions } from '@/active-executions';
import { CollaborationService } from '@/collaboration/collaboration.service';
import { CredentialsOverwrites } from '@/credentials-overwrites';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsService } from '@/credentials/credentials.service';
import { ConflictError, LockedError, NotFoundError } from '@n8n/errors';
import { EvaluationConfigService } from '@/evaluation.ee/evaluation-config.service';
@ -187,7 +191,6 @@ import { PostHogClient } from '@/posthog';
import { AiGatewayService } from '@/services/ai-gateway.service';
import { writeAssistantPreference } from '@/services/ai-preference-write';
import { AiPreferenceService } from '@/services/ai-preference.service';
import { FolderFinderService } from '@/services/folder-finder.service';
import { FolderService } from '@/services/folder.service';
import { InstanceWriteAccessService } from '@/services/instance-write-access.service';
import { NodeResourceExplorerService } from '@/services/node-resource-explorer.service';

View File

@ -1,7 +1,7 @@
import type { AuthenticatedRequest, CredentialsEntity, User } from '@n8n/db';
import { mock } from 'vitest-mock-extended';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { CredentialsFinderService } from '@n8n/backend-services';
import { NotFoundError } from '@n8n/errors';
import type { McpRegistryService } from '@/modules/mcp-registry/registry/mcp-registry.service';
import type { McpRegistryServer } from '@/modules/mcp-registry/registry/mcp-registry.types';

View File

@ -1,12 +1,11 @@
import type { BuiltTool } from '@n8n/agents';
import type { Logger } from '@n8n/backend-common';
import type { CustomFetch, HttpTransport, OutboundHttp } from '@n8n/backend-network';
import type { EventService } from '@n8n/backend-services';
import { type EventService, type CredentialsFinderService } from '@n8n/backend-services';
import type { CredentialsEntity, User } from '@n8n/db';
import { QueryFailedError } from '@n8n/typeorm';
import { mock } from 'vitest-mock-extended';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { CredentialsService } from '@/credentials/credentials.service';
import type { CredentialTypes } from '@/credential-types';
import { BadRequestError, ConflictError, NotFoundError } from '@n8n/errors';

View File

@ -19,7 +19,7 @@ import {
} from '@n8n/decorators';
import type { Response } from 'express';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService } from '@n8n/backend-services';
import { NotFoundError } from '@n8n/errors';
import { McpRegistryService } from '@/modules/mcp-registry/registry/mcp-registry.service';
import type { McpRegistryServer } from '@/modules/mcp-registry/registry/mcp-registry.types';

View File

@ -9,7 +9,7 @@ import type {
import { isObjectLiteral, Logger } from '@n8n/backend-common';
import type { CustomFetch } from '@n8n/backend-network';
import { OutboundHttp } from '@n8n/backend-network';
import { EventService } from '@n8n/backend-services';
import { EventService, CredentialsFinderService } from '@n8n/backend-services';
import { isUniqueConstraintError, type CredentialsEntity, type User } from '@n8n/db';
import { Service } from '@n8n/di';
import type { McpServerConfig } from '@n8n/instance-ai';
@ -18,7 +18,6 @@ import type { ICredentialDataDecryptedObject, LiteralMcpRegistryConnection } fro
import { randomUUID } from 'node:crypto';
import { CredentialTypes } from '@/credential-types';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsService } from '@/credentials/credentials.service';
import { BadRequestError, ConflictError, NotFoundError } from '@n8n/errors';
import {

View File

@ -8,7 +8,7 @@ import type {
} from 'n8n-workflow';
import { mock } from 'vitest-mock-extended';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { CredentialsFinderService } from '@n8n/backend-services';
import { BadRequestError, ForbiddenError } from '@n8n/errors';
import type { MessageEventBus } from '@/eventbus/message-event-bus/message-event-bus';

View File

@ -2,7 +2,7 @@ import type { CredentialsEntity, User } from '@n8n/db';
import type { MessageEventBusDestinationOptions } from 'n8n-workflow';
import { mock } from 'vitest-mock-extended';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { CredentialsFinderService } from '@n8n/backend-services';
import { ForbiddenError } from '@n8n/errors';
import { assertUserCanUseDestinationCredentials } from '../destination-credentials-access';

View File

@ -1,7 +1,7 @@
import type { User } from '@n8n/db';
import type { MessageEventBusDestinationOptions } from 'n8n-workflow';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { CredentialsFinderService } from '@n8n/backend-services';
import { ForbiddenError } from '@n8n/errors';
/**

View File

@ -10,7 +10,7 @@ import type { AuthenticatedRequest } from '@n8n/db';
import { Delete, Get, GlobalScope, Licensed, Post, Query, RestController } from '@n8n/decorators';
import type { MessageEventBusDestinationOptions } from 'n8n-workflow';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService } from '@n8n/backend-services';
import { BadRequestError, ForbiddenError } from '@n8n/errors';
import { eventNamesAll } from '@/eventbus/event-message-classes';
import { MessageEventBus } from '@/eventbus/message-event-bus/message-event-bus';

View File

@ -1,5 +1,5 @@
import { LicenseState, ModuleRegistry } from '@n8n/backend-common';
import { EventService, UrlService, RoleService } from '@n8n/backend-services';
import { EventService, UrlService, RoleService, FolderFinderService } from '@n8n/backend-services';
import { mockInstance, mockLogger } from '@n8n/backend-test-utils';
import { ExecutionsConfig, GlobalConfig, WorkflowsConfig } from '@n8n/config';
import { ExecutionRepository, ProjectRepository, SharedWorkflowRepository, User } from '@n8n/db';
@ -17,7 +17,6 @@ import { NodeTypes } from '@/node-types';
import { PostHogClient } from '@/posthog';
import { AiGatewayService } from '@/services/ai-gateway.service';
import { AiPreferenceService } from '@/services/ai-preference.service';
import { FolderFinderService } from '@/services/folder-finder.service';
import { FolderService } from '@/services/folder.service';
import { NodeResourceExplorerService } from '@/services/node-resource-explorer.service';
import { ProjectService } from '@/services/project.service.ee';

View File

@ -1,6 +1,6 @@
import { INSTANCE_ACTIVITY_CONTEXT_FLAG } from '@n8n/api-types';
import { LicenseState, ModuleRegistry } from '@n8n/backend-common';
import { EventService, UrlService, RoleService } from '@n8n/backend-services';
import { EventService, UrlService, RoleService, FolderFinderService } from '@n8n/backend-services';
import { mockInstance, mockLogger } from '@n8n/backend-test-utils';
import { EndpointsConfig, ExecutionsConfig, GlobalConfig, WorkflowsConfig } from '@n8n/config';
import {
@ -45,7 +45,6 @@ import { NodeTypes } from '@/node-types';
import { PostHogClient } from '@/posthog';
import { AiGatewayService } from '@/services/ai-gateway.service';
import { AiPreferenceService } from '@/services/ai-preference.service';
import { FolderFinderService } from '@/services/folder-finder.service';
import { FolderService } from '@/services/folder.service';
import { NodeResourceExplorerService } from '@/services/node-resource-explorer.service';
import { ProjectService } from '@/services/project.service.ee';

View File

@ -9,7 +9,7 @@ import {
INSTANCE_ACTIVITY_CONTEXT_FLAG,
} from '@n8n/api-types';
import { LicenseState, ModuleRegistry, type Logger } from '@n8n/backend-common';
import { EventService, UrlService, RoleService } from '@n8n/backend-services';
import { EventService, UrlService, RoleService, FolderFinderService } from '@n8n/backend-services';
import { mockInstance, mockLogger } from '@n8n/backend-test-utils';
import { EndpointsConfig, ExecutionsConfig, GlobalConfig, WorkflowsConfig } from '@n8n/config';
import {
@ -38,7 +38,6 @@ import { NodeTypes } from '@/node-types';
import { PostHogClient } from '@/posthog';
import { AiGatewayService } from '@/services/ai-gateway.service';
import { AiPreferenceService } from '@/services/ai-preference.service';
import { FolderFinderService } from '@/services/folder-finder.service';
import { FolderService } from '@/services/folder.service';
import { NodeResourceExplorerService } from '@/services/node-resource-explorer.service';
import { ProjectService } from '@/services/project.service.ee';

View File

@ -2,7 +2,7 @@ import { mockInstance } from '@n8n/backend-test-utils';
import { User } from '@n8n/db';
import { PROJECT_ROOT } from 'n8n-workflow';
import { FolderFinderService } from '@/services/folder-finder.service';
import { FolderFinderService } from '@n8n/backend-services';
import { Telemetry } from '@/telemetry';
import { WorkflowFinderService } from '@/workflows/workflow-finder.service';
import { WorkflowService } from '@/workflows/workflow.service';

View File

@ -12,7 +12,7 @@ import {
import { v4 as uuid } from 'uuid';
import { FolderNotFoundError } from '@/errors/folder-not-found.error';
import { FolderFinderService } from '@/services/folder-finder.service';
import { FolderFinderService } from '@n8n/backend-services';
import { Telemetry } from '@/telemetry';
import { WorkflowService } from '@/workflows/workflow.service';

View File

@ -7,7 +7,7 @@ import {
INSTANCE_ACTIVITY_CONTEXT_FLAG,
} from '@n8n/api-types';
import { LicenseState, Logger, ModuleRegistry } from '@n8n/backend-common';
import { EventService, UrlService, RoleService } from '@n8n/backend-services';
import { EventService, UrlService, RoleService, FolderFinderService } from '@n8n/backend-services';
import { ExecutionsConfig, GlobalConfig, WorkflowsConfig } from '@n8n/config';
import { ExecutionRepository, ProjectRepository, SharedWorkflowRepository, User } from '@n8n/db';
import { Container, Service } from '@n8n/di';
@ -36,7 +36,6 @@ import { NodeTypes } from '@/node-types';
import { PostHogClient } from '@/posthog';
import { AiGatewayService } from '@/services/ai-gateway.service';
import { AiPreferenceService } from '@/services/ai-preference.service';
import { FolderFinderService } from '@/services/folder-finder.service';
import { FolderService } from '@/services/folder.service';
import { NodeResourceExplorerService } from '@/services/node-resource-explorer.service';
import { ProjectService } from '@/services/project.service.ee';

View File

@ -4,7 +4,7 @@ import { PROJECT_ROOT } from 'n8n-workflow';
import z from 'zod';
import { FolderNotFoundError } from '@/errors/folder-not-found.error';
import type { FolderFinderService } from '@/services/folder-finder.service';
import type { FolderFinderService } from '@n8n/backend-services';
import type { Telemetry } from '@/telemetry';
import { createWorkflowEntityFromPayload } from '@/workflows/workflow-entity-mapper';
import type { WorkflowFinderService } from '@/workflows/workflow-finder.service';

View File

@ -16,7 +16,7 @@ import type {
import { FolderNotFoundError } from '@/errors/folder-not-found.error';
import type { ListQuery } from '@/requests';
import type { FolderFinderService } from '@/services/folder-finder.service';
import type { FolderFinderService } from '@n8n/backend-services';
import type { Telemetry } from '@/telemetry';
import type { WorkflowService } from '@/workflows/workflow.service';
import { describeFolderError } from './folder-error.utils';

View File

@ -3,7 +3,7 @@ import { CredentialDataError, Credentials } from 'n8n-core';
import { jsonParse, type ICredentialDataDecryptedObject } from 'n8n-workflow';
import { mock } from 'vitest-mock-extended';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { CredentialsFinderService } from '@n8n/backend-services';
import { CapturingWriter } from '../../../io/__tests__/utils/capturing-writer';
import { CredentialExporter } from '../credential.exporter';

View File

@ -2,7 +2,7 @@ import type { CredentialsEntity, User } from '@n8n/db';
import { Service } from '@n8n/di';
import { Credentials } from 'n8n-core';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService } from '@n8n/backend-services';
import { selectCredentialDataForExport } from './credential-export-policy';
import { CredentialSerializer } from './credential.serializer';

View File

@ -1,7 +1,7 @@
import type { Folder, User } from '@n8n/db';
import { mock } from 'vitest-mock-extended';
import type { FolderFinderService } from '@/services/folder-finder.service';
import type { FolderFinderService } from '@n8n/backend-services';
import type { WorkflowFinderService } from '@/workflows/workflow-finder.service';
import { CapturingWriter } from '../../../io/__tests__/utils/capturing-writer';

View File

@ -1,7 +1,7 @@
import type { Folder, User } from '@n8n/db';
import { Service } from '@n8n/di';
import { FolderFinderService } from '@/services/folder-finder.service';
import { FolderFinderService } from '@n8n/backend-services';
import { WorkflowFinderService } from '@/workflows/workflow-finder.service';
import { FolderSerializer } from './folder.serializer';

View File

@ -2,7 +2,7 @@ import type { Project, User } from '@n8n/db';
import type { Readable } from 'node:stream';
import { mock } from 'vitest-mock-extended';
import type { FolderFinderService } from '@/services/folder-finder.service';
import type { FolderFinderService } from '@n8n/backend-services';
import type { ProjectService } from '@/services/project.service.ee';
import type { WorkflowFinderService } from '@/workflows/workflow-finder.service';

View File

@ -1,7 +1,7 @@
import type { Project, User } from '@n8n/db';
import { Service } from '@n8n/di';
import { FolderFinderService } from '@/services/folder-finder.service';
import { FolderFinderService } from '@n8n/backend-services';
import { ProjectService } from '@/services/project.service.ee';
import { WorkflowFinderService } from '@/workflows/workflow-finder.service';

View File

@ -1,7 +1,7 @@
import type { Folder, Project, SharedWorkflowRepository, User, WorkflowEntity } from '@n8n/db';
import { mock } from 'vitest-mock-extended';
import type { FolderFinderService } from '@/services/folder-finder.service';
import type { FolderFinderService } from '@n8n/backend-services';
import type { ProjectService } from '@/services/project.service.ee';
import type { WorkflowFinderService } from '@/workflows/workflow-finder.service';

View File

@ -2,7 +2,7 @@ import type { Folder, Project, User, WorkflowEntity } from '@n8n/db';
import { SharedWorkflowRepository } from '@n8n/db';
import { Service } from '@n8n/di';
import { FolderFinderService } from '@/services/folder-finder.service';
import { FolderFinderService } from '@n8n/backend-services';
import { ProjectService } from '@/services/project.service.ee';
import { WorkflowFinderService } from '@/workflows/workflow-finder.service';

View File

@ -8,8 +8,7 @@ import type {
} from '@n8n/db';
import { chunkIds } from '@n8n/db';
import type { DataTableRepository } from '@/modules/data-table/data-table.repository';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { RoleService } from '@n8n/backend-services';
import { type CredentialsFinderService, type RoleService } from '@n8n/backend-services';
import type { WorkflowFinderService } from '@/workflows/workflow-finder.service';
import { mock } from 'vitest-mock-extended';

View File

@ -16,10 +16,9 @@ import { Service } from '@n8n/di';
import { hasGlobalScope } from '@n8n/permissions';
import { In, type FindManyOptions } from '@n8n/typeorm';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService, RoleService } from '@n8n/backend-services';
import { isCredSharingEnabled } from '@/constants/credential-sharing';
import { DataTableRepository } from '@/modules/data-table/data-table.repository';
import { RoleService } from '@n8n/backend-services';
import { WorkflowFinderService } from '@/workflows/workflow-finder.service';
import { AgentUsageProviderProxy } from './agent-usage-provider-proxy.service';

View File

@ -7,7 +7,7 @@ import type { INodeType, INodeTypeDescription, IRunExecutionData } from 'n8n-wor
import { mock } from 'vitest-mock-extended';
import { ActiveExecutions } from '@/active-executions';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService } from '@n8n/backend-services';
import { BadRequestError, ForbiddenError } from '@n8n/errors';
import { ExecutionPersistence } from '@/executions/execution-persistence';
import { NodeTypes } from '@/node-types';

View File

@ -17,7 +17,7 @@ import type {
import { v4 as uuid } from 'uuid';
import { ActiveExecutions } from '@/active-executions';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService } from '@n8n/backend-services';
import { BadRequestError, ForbiddenError } from '@n8n/errors';
import { ExecutionPersistence } from '@/executions/execution-persistence';
import { NodeTypes } from '@/node-types';

View File

@ -1,7 +1,12 @@
import type { LockService, Logger } from '@n8n/backend-common';
import { OutboundHttp, type SsrfProtectionService } from '@n8n/backend-network';
import { type LocalServer, startServer } from '@n8n/backend-network/testing';
import type { CacheService, EventService, UrlService } from '@n8n/backend-services';
import {
type CacheService,
type EventService,
type UrlService,
type CredentialsFinderService,
} from '@n8n/backend-services';
import type { GlobalConfig, SsrfProtectionConfig } from '@n8n/config';
import type { CredentialsRepository } from '@n8n/db';
import { mock } from 'vitest-mock-extended';
@ -9,7 +14,6 @@ import type { Cipher } from 'n8n-core';
import type { IncomingHttpHeaders } from 'node:http';
import type { AuthService } from '@/auth/auth.service';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { DynamicCredentialsProxy } from '@/credentials/dynamic-credentials-proxy';
import type { CredentialsHelper } from '@/credentials-helper';
import type { ExternalHooks } from '@/external-hooks';

View File

@ -1,6 +1,11 @@
import { LockAcquisitionTimeoutError, LockService, Logger } from '@n8n/backend-common';
import { OutboundHttp, SsrfProtectionService, type HttpRequestClient } from '@n8n/backend-network';
import { CacheService, EventService, UrlService } from '@n8n/backend-services';
import {
CacheService,
EventService,
UrlService,
CredentialsFinderService,
} from '@n8n/backend-services';
import { mockInstance } from '@n8n/backend-test-utils';
import type { OAuth2CredentialData } from '@n8n/client-oauth2';
import { AuthError as OAuth2AuthError } from '@n8n/client-oauth2';
@ -17,7 +22,6 @@ import type { Mock } from 'vitest';
import { mock } from 'vitest-mock-extended';
import { AuthService } from '@/auth/auth.service';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { DynamicCredentialsProxy } from '@/credentials/dynamic-credentials-proxy';
import { CredentialsHelper } from '@/credentials-helper';
import { AuthError, BadRequestError, NotFoundError } from '@n8n/errors';

View File

@ -5,7 +5,12 @@ import {
type HttpRequestClient,
type SsrfBridge,
} from '@n8n/backend-network';
import { CacheService, EventService, UrlService } from '@n8n/backend-services';
import {
CacheService,
EventService,
UrlService,
CredentialsFinderService,
} from '@n8n/backend-services';
import { GlobalConfig, SsrfProtectionConfig } from '@n8n/config';
import type { AuthenticatedRequest, CredentialsEntity, ICredentialsDb } from '@n8n/db';
import { CredentialsRepository } from '@n8n/db';
@ -22,7 +27,6 @@ import {
RESPONSE_ERROR_MESSAGES,
} from '@/constants';
import { AuthService } from '@/auth/auth.service';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsHelper } from '@/credentials-helper';
import { AuthError, BadRequestError, NotFoundError } from '@n8n/errors';
import type { OAuthRequest } from '@/requests';

View File

@ -14,9 +14,8 @@ import type { EntityManager } from '@n8n/typeorm';
import type { Mock } from 'vitest';
import { mock } from 'vitest-mock-extended';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService, RoleService } from '@n8n/backend-services';
import { NotFoundError } from '@n8n/errors';
import { RoleService } from '@n8n/backend-services';
import { userHasScopes } from '../check-access';

View File

@ -15,9 +15,8 @@ import { Container } from '@n8n/di';
import { hasGlobalScope, type Scope } from '@n8n/permissions';
import { UnexpectedError } from 'n8n-workflow';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService, RoleService } from '@n8n/backend-services';
import { NotFoundError } from '@n8n/errors';
import { RoleService } from '@n8n/backend-services';
const INSTANCE_CREDENTIAL_MANAGEMENT_SCOPES = new Set<Scope>([
'credential:read',

View File

@ -12,7 +12,7 @@ import {
TransferCredentialPublicDto,
} from '@n8n/api-types';
import { LicenseState } from '@n8n/backend-common';
import { EventService } from '@n8n/backend-services';
import { EventService, CredentialsFinderService } from '@n8n/backend-services';
import type { AuthenticatedRequest, CredentialsEntity, ICredentialsDb, User } from '@n8n/db';
import {
ApiDescription,
@ -39,7 +39,6 @@ import type { ICredentialDataDecryptedObject } from 'n8n-workflow';
import { CredentialDescriptionsService } from '@/credentials/credential-descriptions.service';
import { CredentialTypes } from '@/credential-types';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsService } from '@/credentials/credentials.service';
import { EnterpriseCredentialsService } from '@/credentials/credentials.service.ee';
import { CredentialsHelper } from '@/credentials-helper';

View File

@ -4,7 +4,6 @@ import { InstanceSettingsLoaderConfig } from '@n8n/config';
import { Container } from '@n8n/di';
import type { MessageEventBusDestinationOptions } from 'n8n-workflow';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { BadRequestError, ConflictError, NotFoundError } from '@n8n/errors';
import { eventNamesAll } from '@/eventbus/event-message-classes';
import { MessageEventBus } from '@/eventbus/message-event-bus/message-event-bus';
@ -36,6 +35,11 @@ const findDestinationOrFail = async (id: string): Promise<MessageEventBusDestina
return destination;
};
const getCredentialsFinderService = async () => {
const { CredentialsFinderService } = await import('@n8n/backend-services');
return Container.get(CredentialsFinderService);
};
type LogStreamingHandlers = {
getEventTypes: PublicAPIEndpoint<LogStreamingRequest.GetEventTypes>;
getDestinations: PublicAPIEndpoint<LogStreamingRequest.GetDestinations>;
@ -87,7 +91,7 @@ const logStreamingHandlers: LogStreamingHandlers = {
const options = toInternalDestinationOptions(parseResult.data);
await assertUserCanUseDestinationCredentials(
Container.get(CredentialsFinderService),
await getCredentialsFinderService(),
req.user,
options,
);
@ -121,7 +125,7 @@ const logStreamingHandlers: LogStreamingHandlers = {
const options = { ...toInternalDestinationOptions(parseResult.data), id: req.params.id };
await assertUserCanUseDestinationCredentials(
Container.get(CredentialsFinderService),
await getCredentialsFinderService(),
req.user,
options,
);
@ -145,7 +149,7 @@ const logStreamingHandlers: LogStreamingHandlers = {
async (req, res) => {
const destination = await findDestinationOrFail(req.params.id);
await assertUserCanUseDestinationCredentials(
Container.get(CredentialsFinderService),
await getCredentialsFinderService(),
req.user,
destination,
);

View File

@ -29,7 +29,7 @@ vi.mock('n8n-core', async () => {
import { DynamicNodeParametersService } from '../dynamic-node-parameters.service';
import { WorkflowLoaderService } from '../workflow-loader.service';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService } from '@n8n/backend-services';
import { BadRequestError, ForbiddenError } from '@n8n/errors';
import { NodeTypes } from '@/node-types';
import * as checkAccess from '@/permissions.ee/check-access';

View File

@ -4,7 +4,7 @@ import type { ProjectRepository, User } from '@n8n/db';
import { mock } from 'vitest-mock-extended';
import type { INodeTypeDescription } from 'n8n-workflow';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { CredentialsFinderService } from '@n8n/backend-services';
import type { NodeTypes } from '@/node-types';
import type { DynamicNodeParametersService } from '@/services/dynamic-node-parameters.service';
import { NodeResourceExplorerService } from '@/services/node-resource-explorer.service';

View File

@ -28,7 +28,7 @@ import {
findDisplayedProperty,
} from 'n8n-workflow';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService } from '@n8n/backend-services';
import { BadRequestError, ForbiddenError } from '@n8n/errors';
import { NodeTypes } from '@/node-types';
import { userHasScopes } from '@/permissions.ee/check-access';

View File

@ -15,7 +15,7 @@ import type {
} from 'n8n-workflow';
import { NodeHelpers } from 'n8n-workflow';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService } from '@n8n/backend-services';
import { NodeTypes } from '@/node-types';
import { DynamicNodeParametersService } from '@/services/dynamic-node-parameters.service';
import { getBase } from '@/workflow-execute-additional-data';

View File

@ -13,7 +13,7 @@ import type { PolicyCleared } from '@n8n/decorators';
import type { MockProxy } from 'vitest-mock-extended';
import { mock } from 'vitest-mock-extended';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { CredentialsFinderService } from '@n8n/backend-services';
import { BadRequestError, ForbiddenError, NotFoundError } from '@n8n/errors';
import type { ExternalHooks, WorkflowLifecycleHookActor } from '@/external-hooks';
import type { McpSettingsService } from '@/modules/mcp/mcp.settings.service';

View File

@ -15,7 +15,7 @@ import { WorkflowActivationError } from 'n8n-workflow';
import { mock } from 'vitest-mock-extended';
import type { ActiveWorkflowManager } from '@/active-workflow-manager';
import type { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import type { CredentialsFinderService } from '@n8n/backend-services';
import type { CredentialsService } from '@/credentials/credentials.service';
import type { PolicyEnforcementService } from '@/policy/policy-enforcement.service';
import type { OwnershipService } from '@/services/ownership.service';

View File

@ -1,6 +1,6 @@
import type { RedactionFloor } from '@n8n/api-types';
import { LicenseState, Logger } from '@n8n/backend-common';
import { EventService } from '@n8n/backend-services';
import { EventService, CredentialsFinderService } from '@n8n/backend-services';
import { GlobalConfig } from '@n8n/config';
import type { EntityManager, User, Project, Folder } from '@n8n/db';
import {
@ -15,7 +15,6 @@ import { Service } from '@n8n/di';
import { PROJECT_ROOT } from 'n8n-workflow';
import { v4 as uuid } from 'uuid';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { BadRequestError, ForbiddenError, InternalServerError, NotFoundError } from '@n8n/errors';
import { WorkflowValidationError } from '@/errors/response-errors/workflow-validation.error';
import type { WorkflowActionSource } from '@/events/maps/relay.event-map';

View File

@ -32,7 +32,7 @@ import {
import { ActiveWorkflowManager } from '@/active-workflow-manager';
import { isCredSharingEnabled } from '@/constants/credential-sharing';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService } from '@n8n/backend-services';
import { CredentialsService } from '@/credentials/credentials.service';
import { EnterpriseCredentialsService } from '@/credentials/credentials.service.ee';
import { FolderNotFoundError } from '@/errors/folder-not-found.error';

View File

@ -7,7 +7,7 @@ import {
import type { CredentialsEntity, User } from '@n8n/db';
import { Container } from '@n8n/di';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService } from '@n8n/backend-services';
import { CredentialsService } from '@/credentials/credentials.service';
import { saveCredential, shareCredentialWithUsers } from '../shared/db/credentials';

View File

@ -469,9 +469,7 @@ describe('CredentialsRepository', () => {
const { createMember } = await import('../../shared/db/users.js');
const { createTeamProject, linkUserToProject } = await import('@n8n/backend-test-utils');
const { createCredentials } = await import('../../shared/db/credentials.js');
const { CredentialsFinderService } = await import(
'@/credentials/credentials-finder.service.js'
);
const { CredentialsFinderService } = await import('@n8n/backend-services');
const { RoleService } = await import('@n8n/backend-services');
const member = await createMember();
@ -518,9 +516,7 @@ describe('CredentialsRepository', () => {
const { createOwner } = await import('../../shared/db/users.js');
const { getPersonalProject } = await import('@n8n/backend-test-utils');
const { createCredentials } = await import('../../shared/db/credentials.js');
const { CredentialsFinderService } = await import(
'@/credentials/credentials-finder.service.js'
);
const { CredentialsFinderService } = await import('@n8n/backend-services');
const owner = await createOwner();
const personalProject = await getPersonalProject(owner);
@ -563,9 +559,7 @@ describe('CredentialsRepository', () => {
const { createMember } = await import('../../shared/db/users.js');
const { createTeamProject, linkUserToProject } = await import('@n8n/backend-test-utils');
const { createCredentials } = await import('../../shared/db/credentials.js');
const { CredentialsFinderService } = await import(
'@/credentials/credentials-finder.service.js'
);
const { CredentialsFinderService } = await import('@n8n/backend-services');
const { RoleService } = await import('@n8n/backend-services');
const member = await createMember();
@ -633,9 +627,7 @@ describe('CredentialsRepository', () => {
const { createMember } = await import('../../shared/db/users.js');
const { createTeamProject, linkUserToProject } = await import('@n8n/backend-test-utils');
const { createCredentials } = await import('../../shared/db/credentials.js');
const { CredentialsFinderService } = await import(
'@/credentials/credentials-finder.service.js'
);
const { CredentialsFinderService } = await import('@n8n/backend-services');
const { RoleService } = await import('@n8n/backend-services');
const member = await createMember();
@ -720,9 +712,7 @@ describe('CredentialsRepository', () => {
const { createMember } = await import('../../shared/db/users.js');
const { createTeamProject, linkUserToProject } = await import('@n8n/backend-test-utils');
const { createCredentials } = await import('../../shared/db/credentials.js');
const { CredentialsFinderService } = await import(
'@/credentials/credentials-finder.service.js'
);
const { CredentialsFinderService } = await import('@n8n/backend-services');
const { RoleService } = await import('@n8n/backend-services');
// Create two separate users
@ -818,9 +808,7 @@ describe('CredentialsRepository', () => {
const { createMember } = await import('../../shared/db/users.js');
const { createTeamProject, linkUserToProject } = await import('@n8n/backend-test-utils');
const { createCredentials } = await import('../../shared/db/credentials.js');
const { CredentialsFinderService } = await import(
'@/credentials/credentials-finder.service.js'
);
const { CredentialsFinderService } = await import('@n8n/backend-services');
const { RoleCacheService } = await import('@n8n/backend-services');
const member = await createMember();

View File

@ -3,7 +3,7 @@ import { InstanceSettingsLoaderConfig } from '@n8n/config';
import { GLOBAL_OWNER_ROLE, type CredentialsEntity, type User } from '@n8n/db';
import { Container } from '@n8n/di';
import { CredentialsFinderService } from '@/credentials/credentials-finder.service';
import { CredentialsFinderService } from '@n8n/backend-services';
import { MessageEventBus } from '@/eventbus/message-event-bus/message-event-bus';
import { ExecutionRecoveryService } from '@/executions/execution-recovery.service';
import { LogStreamingDestinationService } from '@/modules/log-streaming.ee/log-streaming-destination.service';

View File

@ -16,7 +16,7 @@ import { FolderNotFoundError } from '@/errors/folder-not-found.error';
import { License } from '@/license';
import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials';
import { searchWorkflows } from '@/modules/mcp/tools/search-workflows.tool';
import { FolderFinderService } from '@/services/folder-finder.service';
import { FolderFinderService } from '@n8n/backend-services';
import { WorkflowService } from '@/workflows/workflow.service';
import { createFolder } from '@test-integration/db/folders';
import { LicenseMocker } from '@test-integration/license';