mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-17 05:29:44 +02:00
refactor(core): Move feature provider proxies into backend services (#41087)
This commit is contained in:
parent
9c0b546a30
commit
ed2500ffb2
|
|
@ -5,8 +5,8 @@ import type {
|
|||
ExecutionRedaction,
|
||||
ExecutionRedactionOptions,
|
||||
RedactableExecution,
|
||||
} from '@/executions/execution-redaction';
|
||||
import { ExecutionRedactionServiceProxy } from '@/executions/execution-redaction-proxy.service';
|
||||
} from '../execution-redaction';
|
||||
import { ExecutionRedactionServiceProxy } from '../execution-redaction-proxy.service';
|
||||
|
||||
describe('ExecutionRedactionServiceProxy', () => {
|
||||
let proxy: ExecutionRedactionServiceProxy;
|
||||
|
|
@ -74,3 +74,33 @@ export {
|
|||
type PublishedWorkflowData,
|
||||
type PublishedWorkflowDataForExecution,
|
||||
} from './workflows/workflow-published-data.service';
|
||||
|
||||
export {
|
||||
RuntimeCredentialProxyService,
|
||||
type RuntimeCredentialProvider,
|
||||
} from './services/runtime-credential-proxy.service';
|
||||
export {
|
||||
InstanceRegistryProxyService,
|
||||
type InstanceRegistryProvider,
|
||||
} from './services/instance-registry-proxy.service';
|
||||
export { ExecutingUserIdentifierProxy } from './credentials/executing-user-identifier-proxy';
|
||||
export type { IExecutingUserIdentifier } from './credentials/executing-user-identifier.interface';
|
||||
export { ExecutionRedactionServiceProxy } from './executions/execution-redaction-proxy.service';
|
||||
export {
|
||||
isRedactableExecution,
|
||||
type ExecutionRedactionOptions,
|
||||
type ExecutionRedaction,
|
||||
type RedactableExecution,
|
||||
} from './executions/execution-redaction';
|
||||
export {
|
||||
WorkflowMutationHooksProxy,
|
||||
type WorkflowMutationHooks,
|
||||
} from './workflows/workflow-mutation-hooks-proxy.service';
|
||||
export {
|
||||
WorkflowPublishGuardProxy,
|
||||
type WorkflowPublishGuard,
|
||||
} from './workflows/workflow-publish-guard-proxy.service';
|
||||
export {
|
||||
RestrictedNodeTypesProviderProxy,
|
||||
type RestrictedNodeTypesProvider,
|
||||
} from './workflows/restricted-node-types-provider-proxy.service';
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import type { IRunExecutionData } from 'n8n-workflow';
|
|||
import {
|
||||
RuntimeCredentialProxyService,
|
||||
type RuntimeCredentialProvider,
|
||||
} from '@/services/runtime-credential-proxy.service';
|
||||
} from '../runtime-credential-proxy.service';
|
||||
|
||||
const runExecutionData = {} as IRunExecutionData;
|
||||
|
||||
|
|
@ -7,10 +7,13 @@ import type { IConnections, IRunData } from 'n8n-workflow';
|
|||
|
||||
import { BadRequestError, ForbiddenError, NotFoundError } from '@n8n/errors';
|
||||
import type { ExecutionPersistence } from '@/executions/execution-persistence';
|
||||
import type { ExecutionRedactionServiceProxy } from '@/executions/execution-redaction-proxy.service';
|
||||
import type {
|
||||
ExecutionRedactionServiceProxy,
|
||||
InstanceWriteAccessService,
|
||||
} from '@n8n/backend-services';
|
||||
import type { DataTableColumn } from '@/modules/data-table/data-table-column.entity';
|
||||
import type { DataTableService } from '@/modules/data-table/data-table.service';
|
||||
import type { InstanceWriteAccessService } from '@n8n/backend-services';
|
||||
|
||||
import { userHasScopes } from '@/permissions.ee/check-access';
|
||||
|
||||
import { EvaluationDatasetService } from '../evaluation-dataset.service';
|
||||
|
|
|
|||
|
|
@ -25,11 +25,10 @@ import type {
|
|||
|
||||
import { BadRequestError, ForbiddenError, NotFoundError } from '@n8n/errors';
|
||||
import { ExecutionPersistence } from '@/executions/execution-persistence';
|
||||
import { ExecutionRedactionServiceProxy } from '@/executions/execution-redaction-proxy.service';
|
||||
import { ExecutionRedactionServiceProxy, InstanceWriteAccessService } from '@n8n/backend-services';
|
||||
import type { DataTableColumn } from '@/modules/data-table/data-table-column.entity';
|
||||
import { DataTableService } from '@/modules/data-table/data-table.service';
|
||||
import { userHasScopes } from '@/permissions.ee/check-access';
|
||||
import { InstanceWriteAccessService } from '@n8n/backend-services';
|
||||
|
||||
/** First-item `json` of a node's last run output, keyed by field name. */
|
||||
type FieldMap = IDataObject;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { PushMessage } from '@n8n/api-types';
|
||||
import { Logger } from '@n8n/backend-common';
|
||||
import { EventService } from '@n8n/backend-services';
|
||||
import { EventService, ExecutionRedactionServiceProxy } from '@n8n/backend-services';
|
||||
import { mockInstance } from '@n8n/backend-test-utils';
|
||||
import { ExecutionsConfig } from '@n8n/config';
|
||||
import type { Project, User } from '@n8n/db';
|
||||
|
|
@ -39,7 +39,7 @@ import {
|
|||
} from '../execution-lifecycle-hooks';
|
||||
|
||||
import { ExecutionPersistence } from '@/executions/execution-persistence';
|
||||
import { ExecutionRedactionServiceProxy } from '@/executions/execution-redaction-proxy.service';
|
||||
|
||||
import { ExternalHooks } from '@/external-hooks';
|
||||
import { Push } from '@/push';
|
||||
import { ExecutionMetadataService } from '@/services/execution-metadata.service';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
import { Logger } from '@n8n/backend-common';
|
||||
import { EventService } from '@n8n/backend-services';
|
||||
import {
|
||||
EventService,
|
||||
type RedactableExecution,
|
||||
ExecutionRedactionServiceProxy,
|
||||
} from '@n8n/backend-services';
|
||||
import { ExecutionsConfig } from '@n8n/config';
|
||||
import type { User } from '@n8n/db';
|
||||
import { ExecutionRepository, UserRepository } from '@n8n/db';
|
||||
|
|
@ -37,8 +41,7 @@ import {
|
|||
import { type ExecutionSaveSettings, toSaveSettings } from './to-save-settings';
|
||||
|
||||
import { ExecutionPersistence } from '@/executions/execution-persistence';
|
||||
import type { RedactableExecution } from '@/executions/execution-redaction';
|
||||
import { ExecutionRedactionServiceProxy } from '@/executions/execution-redaction-proxy.service';
|
||||
|
||||
import { ExternalHooks } from '@/external-hooks';
|
||||
import { Push } from '@/push';
|
||||
import { WorkflowStatisticsService } from '@/services/workflow-statistics.service';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { DeleteExecutionsDto } from '@n8n/api-types';
|
||||
import type { EventService } from '@n8n/backend-services';
|
||||
import type { EventService, ExecutionRedactionServiceProxy } from '@n8n/backend-services';
|
||||
import { mockInstance } from '@n8n/backend-test-utils';
|
||||
import { GlobalConfig } from '@n8n/config';
|
||||
import type {
|
||||
|
|
@ -27,7 +27,7 @@ import { BadRequestError, NotFoundError } from '@n8n/errors';
|
|||
import type { EngineV2ExecutionReader } from '@/executions/engine-v2-execution-reader.service';
|
||||
import { MissingExecutionDataError } from '@/executions/execution-data/missing-execution-data.error';
|
||||
import type { ExecutionPersistence } from '@/executions/execution-persistence';
|
||||
import type { ExecutionRedactionServiceProxy } from '@/executions/execution-redaction-proxy.service';
|
||||
|
||||
import { ExecutionService } from '@/executions/execution.service';
|
||||
import type { ExecutionRequest } from '@/executions/execution.types';
|
||||
import type { ExecutionStopService } from '@/scaling/execution-stop.service';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { DeleteExecutionsDto } from '@n8n/api-types';
|
||||
import { ExecutionRedactionQueryDtoSchema } from '@n8n/api-types';
|
||||
import { Logger } from '@n8n/backend-common';
|
||||
import { EventService } from '@n8n/backend-services';
|
||||
import { EventService, ExecutionRedactionServiceProxy } from '@n8n/backend-services';
|
||||
import { GlobalConfig } from '@n8n/config';
|
||||
import type {
|
||||
CreateExecutionPayload,
|
||||
|
|
@ -61,7 +61,7 @@ import { EngineV2ExecutionReader } from './engine-v2-execution-reader.service';
|
|||
import { MissingExecutionDataError } from './execution-data/missing-execution-data.error';
|
||||
import { isExecutionIdV2, type ExecutionIdV2 } from './execution-id';
|
||||
import { ExecutionPersistence } from './execution-persistence';
|
||||
import { ExecutionRedactionServiceProxy } from './execution-redaction-proxy.service';
|
||||
|
||||
import type { ExecutionRequest, StopResult } from './execution.types';
|
||||
|
||||
export const schemaGetExecutionsQueryFilter = {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import type { INodeExecutionData, PlaintextExecutionContext } from 'n8n-workflow
|
|||
import type { Mocked } from 'vitest';
|
||||
import { mock } from 'vitest-mock-extended';
|
||||
|
||||
import type { ExecutingUserIdentifierProxy } from '@/credentials/executing-user-identifier-proxy';
|
||||
import type { ExecutingUserIdentifierProxy } from '@n8n/backend-services';
|
||||
|
||||
import { ChatHubExtractor } from '../chat-hub-extractor';
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import { type ICredentialContext, jsonParse } from 'n8n-workflow';
|
|||
import { z } from 'zod';
|
||||
|
||||
import { AuthService } from '@/auth/auth.service';
|
||||
import { ExecutingUserIdentifierProxy } from '@/credentials/executing-user-identifier-proxy';
|
||||
import { ExecutingUserIdentifierProxy } from '@n8n/backend-services';
|
||||
|
||||
const EncryptedMetadataSchema = z.object({
|
||||
encryptedMetadata: z.string(),
|
||||
|
|
|
|||
|
|
@ -61,9 +61,7 @@ export class DynamicCredentialsModule implements ModuleInterface {
|
|||
// Register the executing-user identifier so the redaction layer can attribute
|
||||
// a run to its user from the established identity carrier — the same source
|
||||
// credential resolution uses.
|
||||
const { ExecutingUserIdentifierProxy } = await import(
|
||||
'../../credentials/executing-user-identifier-proxy.js'
|
||||
);
|
||||
const { ExecutingUserIdentifierProxy } = await import('@n8n/backend-services');
|
||||
const { N8NIdentifier } = await import('./credential-resolvers/identifiers/n8n-identifier.js');
|
||||
Container.get(ExecutingUserIdentifierProxy).setProvider(Container.get(N8NIdentifier));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import { AuthHandlerRegistry } from '@/auth/auth-handler.registry';
|
|||
import { CollaborationService } from '@/collaboration/collaboration.service';
|
||||
import { ControllerRegistry } from '@/controller.registry';
|
||||
import { WorkflowPublicationNotifier } from '@/workflows/publication/workflow-publication-notifier';
|
||||
import { WorkflowPublishGuardProxy } from '@/workflows/workflow-publish-guard-proxy.service';
|
||||
import { WorkflowPublishGuardProxy } from '@n8n/backend-services';
|
||||
import { WorkflowValidationService } from '@/workflows/workflow-validation.service';
|
||||
import { WorkflowService } from '@/workflows/workflow.service';
|
||||
import { createExecution } from '@test-integration/db/executions';
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import { PolicyEnforcementService } from '@/policy/policy-enforcement.service';
|
|||
import { WorkflowValidationService } from '@/workflows/workflow-validation.service';
|
||||
import { WorkflowService } from '@/workflows/workflow.service';
|
||||
import { WorkflowPublicationNotifier } from '@/workflows/publication/workflow-publication-notifier';
|
||||
import { WorkflowPublishGuardProxy } from '@/workflows/workflow-publish-guard-proxy.service';
|
||||
import { WorkflowPublishGuardProxy } from '@n8n/backend-services';
|
||||
import { createAdmin, createUser } from '@test-integration/db/users';
|
||||
import { initNodeTypes, setupTestServer } from '@test-integration/utils';
|
||||
|
||||
|
|
|
|||
|
|
@ -19,9 +19,7 @@ export class InstanceRegistryModule implements ModuleInterface {
|
|||
const instanceRegistryService = Container.get(InstanceRegistryService);
|
||||
await instanceRegistryService.init();
|
||||
|
||||
const { InstanceRegistryProxyService } = await import(
|
||||
'@/services/instance-registry-proxy.service.js'
|
||||
);
|
||||
const { InstanceRegistryProxyService } = await import('@n8n/backend-services');
|
||||
Container.get(InstanceRegistryProxyService).registerProvider(instanceRegistryService);
|
||||
|
||||
await import('./checks/index.js');
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { Container } from '@n8n/di';
|
|||
import { mock } from 'vitest-mock-extended';
|
||||
|
||||
import { ExecutionListService } from '@/executions/execution-list.service';
|
||||
import { ExecutionRedactionServiceProxy } from '@/executions/execution-redaction-proxy.service';
|
||||
import { ExecutionRedactionServiceProxy } from '@n8n/backend-services';
|
||||
import type { Telemetry } from '@/telemetry';
|
||||
import { WorkflowFinderService } from '@/workflows/workflow-finder.service';
|
||||
import { createSuccessfulExecution } from '@test-integration/db/executions';
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { USER_CALLED_MCP_TOOL_EVENT } from '../mcp.constants';
|
|||
import { createGetExecutionTool } from '../tools/get-execution.tool';
|
||||
|
||||
import { ExecutionPersistence } from '@/executions/execution-persistence';
|
||||
import { ExecutionRedactionServiceProxy } from '@/executions/execution-redaction-proxy.service';
|
||||
import { ExecutionRedactionServiceProxy } from '@n8n/backend-services';
|
||||
import { Telemetry } from '@/telemetry';
|
||||
import { WorkflowFinderService } from '@/workflows/workflow-finder.service';
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import {
|
|||
UrlService,
|
||||
RoleService,
|
||||
FolderFinderService,
|
||||
ExecutionRedactionServiceProxy,
|
||||
WorkflowPublishedDataService,
|
||||
} from '@n8n/backend-services';
|
||||
import { mockInstance, mockLogger } from '@n8n/backend-test-utils';
|
||||
|
|
@ -16,7 +17,7 @@ import { CollaborationService } from '@/collaboration/collaboration.service';
|
|||
import { CredentialsService } from '@/credentials/credentials.service';
|
||||
import { ExecutionService } from '@/executions/execution.service';
|
||||
import { ExecutionListService } from '@/executions/execution-list.service';
|
||||
import { ExecutionRedactionServiceProxy } from '@/executions/execution-redaction-proxy.service';
|
||||
|
||||
import { DataTableProxyService } from '@/modules/data-table/data-table-proxy.service';
|
||||
import { NodeCatalogService } from '@/node-catalog';
|
||||
import { NodeTypes } from '@/node-types';
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import {
|
|||
UrlService,
|
||||
RoleService,
|
||||
FolderFinderService,
|
||||
ExecutionRedactionServiceProxy,
|
||||
WorkflowPublishedDataService,
|
||||
} from '@n8n/backend-services';
|
||||
import { mockInstance, mockLogger } from '@n8n/backend-test-utils';
|
||||
|
|
@ -36,7 +37,7 @@ import { ActiveExecutions } from '@/active-executions';
|
|||
import { CollaborationService } from '@/collaboration/collaboration.service';
|
||||
import { CredentialsService } from '@/credentials/credentials.service';
|
||||
import { ExecutionListService } from '@/executions/execution-list.service';
|
||||
import { ExecutionRedactionServiceProxy } from '@/executions/execution-redaction-proxy.service';
|
||||
|
||||
import { ExecutionService } from '@/executions/execution.service';
|
||||
import { DataTableProxyService } from '@/modules/data-table/data-table-proxy.service';
|
||||
import { InstanceContextService } from '@/modules/instance-ai/instance-context.service';
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import {
|
|||
UrlService,
|
||||
RoleService,
|
||||
FolderFinderService,
|
||||
ExecutionRedactionServiceProxy,
|
||||
WorkflowPublishedDataService,
|
||||
} from '@n8n/backend-services';
|
||||
import { mockInstance, mockLogger } from '@n8n/backend-test-utils';
|
||||
|
|
@ -36,7 +37,7 @@ import { ActiveExecutions } from '@/active-executions';
|
|||
import { CollaborationService } from '@/collaboration/collaboration.service';
|
||||
import { CredentialsService } from '@/credentials/credentials.service';
|
||||
import { ExecutionListService } from '@/executions/execution-list.service';
|
||||
import { ExecutionRedactionServiceProxy } from '@/executions/execution-redaction-proxy.service';
|
||||
|
||||
import { ExecutionService } from '@/executions/execution.service';
|
||||
import { DataTableProxyService } from '@/modules/data-table/data-table-proxy.service';
|
||||
import { NodeCatalogService } from '@/node-catalog';
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import {
|
|||
UrlService,
|
||||
RoleService,
|
||||
FolderFinderService,
|
||||
ExecutionRedactionServiceProxy,
|
||||
WorkflowPublishedDataService,
|
||||
} from '@n8n/backend-services';
|
||||
import { ExecutionsConfig, GlobalConfig, WorkflowsConfig } from '@n8n/config';
|
||||
|
|
@ -34,7 +35,7 @@ import { CollaborationService } from '@/collaboration/collaboration.service';
|
|||
import { N8N_VERSION } from '@/constants';
|
||||
import { CredentialsService } from '@/credentials/credentials.service';
|
||||
import { ExecutionListService } from '@/executions/execution-list.service';
|
||||
import { ExecutionRedactionServiceProxy } from '@/executions/execution-redaction-proxy.service';
|
||||
|
||||
import { ExecutionService } from '@/executions/execution.service';
|
||||
import { DataTableProxyService } from '@/modules/data-table/data-table-proxy.service';
|
||||
import { NodeCatalogService } from '@/node-catalog';
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import type { ToolDefinition, UserCalledMCPToolEventPayload } from '../mcp.types
|
|||
import { getMcpWorkflow } from './workflow-validation.utils';
|
||||
|
||||
import { ExecutionPersistence } from '@/executions/execution-persistence';
|
||||
import type { ExecutionRedactionServiceProxy } from '@/executions/execution-redaction-proxy.service';
|
||||
import type { ExecutionRedactionServiceProxy } from '@n8n/backend-services';
|
||||
import type { Telemetry } from '@/telemetry';
|
||||
import type { WorkflowFinderService } from '@/workflows/workflow-finder.service';
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import type { ICredentialContext, INode, PlaintextExecutionContext, Workflow } f
|
|||
import type { MockProxy } from 'vitest-mock-extended';
|
||||
import { mock } from 'vitest-mock-extended';
|
||||
|
||||
import type { ExecutingUserIdentifierProxy } from '@/credentials/executing-user-identifier-proxy';
|
||||
import type { ExecutingUserIdentifierProxy } from '@n8n/backend-services';
|
||||
|
||||
import { DynamicCredentialsContextHook } from '../dynamic-credentials-context-hook';
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { ContextEstablishmentHookMetadata, ModuleMetadata } from '@n8n/decorator
|
|||
import { Container } from '@n8n/di';
|
||||
import { mock } from 'vitest-mock-extended';
|
||||
|
||||
import { ExecutionRedactionServiceProxy } from '@/executions/execution-redaction-proxy.service';
|
||||
import { ExecutionRedactionServiceProxy } from '@n8n/backend-services';
|
||||
|
||||
import { ExecutionRedactionService } from '../executions/execution-redaction.service';
|
||||
// For the @BackendModule side effect. Importing the hook here would void the assertion.
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { Container } from '@n8n/di';
|
|||
import type { Mocked } from 'vitest';
|
||||
import { mock } from 'vitest-mock-extended';
|
||||
|
||||
import { ExecutionRedactionServiceProxy } from '@/executions/execution-redaction-proxy.service';
|
||||
import { ExecutionRedactionServiceProxy } from '@n8n/backend-services';
|
||||
|
||||
import { ExecutionRedactionService } from '../executions/execution-redaction.service';
|
||||
// For the @BackendModule side effect.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { Container } from '@n8n/di';
|
|||
import type { Mocked } from 'vitest';
|
||||
import { mock } from 'vitest-mock-extended';
|
||||
|
||||
import { ExecutionRedactionServiceProxy } from '@/executions/execution-redaction-proxy.service';
|
||||
import { ExecutionRedactionServiceProxy } from '@n8n/backend-services';
|
||||
|
||||
import { ExecutionRedactionService } from '../executions/execution-redaction.service';
|
||||
import { RedactionModule } from '../redaction.module';
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import {
|
|||
} from '@n8n/decorators';
|
||||
import type { PlaintextExecutionContext } from 'n8n-workflow';
|
||||
|
||||
import { ExecutingUserIdentifierProxy } from '@/credentials/executing-user-identifier-proxy';
|
||||
import { ExecutingUserIdentifierProxy } from '@n8n/backend-services';
|
||||
|
||||
@ContextEstablishmentHook({
|
||||
alwaysExecute: true,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
import { LicenseState, Logger } from '@n8n/backend-common';
|
||||
import type { EventService } from '@n8n/backend-services';
|
||||
import type {
|
||||
EventService,
|
||||
ExecutionRedactionOptions,
|
||||
RedactableExecution,
|
||||
} from '@n8n/backend-services';
|
||||
import { mockInstance } from '@n8n/backend-test-utils';
|
||||
import type { User } from '@n8n/db';
|
||||
import type { INode, IRunExecutionData, ITaskData, WorkflowExecuteMode } from 'n8n-workflow';
|
||||
|
|
@ -7,10 +11,7 @@ import { shouldRedactConsoleOutput } from 'n8n-workflow';
|
|||
import { mock } from 'vitest-mock-extended';
|
||||
|
||||
import { ForbiddenError, ScopeForbiddenError } from '@n8n/errors';
|
||||
import type {
|
||||
ExecutionRedactionOptions,
|
||||
RedactableExecution,
|
||||
} from '@/executions/execution-redaction';
|
||||
|
||||
import { CredentialsPermissionChecker } from '@/executions/pre-execution-checks/credentials-permission-checker';
|
||||
import { WorkflowFinderService } from '@/workflows/workflow-finder.service';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { User } from '@n8n/db';
|
||||
|
||||
import type { RedactableExecution } from '@/executions/execution-redaction';
|
||||
import type { RedactableExecution } from '@n8n/backend-services';
|
||||
|
||||
/**
|
||||
* Context passed to every redaction strategy by the orchestrator.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
import { LicenseState, Logger } from '@n8n/backend-common';
|
||||
import { EventService } from '@n8n/backend-services';
|
||||
import {
|
||||
EventService,
|
||||
type ExecutionRedaction,
|
||||
type ExecutionRedactionOptions,
|
||||
type RedactableExecution,
|
||||
} from '@n8n/backend-services';
|
||||
import type { User } from '@n8n/db';
|
||||
import { Service } from '@n8n/di';
|
||||
import {
|
||||
|
|
@ -12,11 +17,7 @@ import {
|
|||
|
||||
import { isCredSharingEnabled } from '@/constants/credential-sharing';
|
||||
import { ForbiddenError, ScopeForbiddenError } from '@n8n/errors';
|
||||
import type {
|
||||
ExecutionRedaction,
|
||||
ExecutionRedactionOptions,
|
||||
RedactableExecution,
|
||||
} from '@/executions/execution-redaction';
|
||||
|
||||
import { CredentialsPermissionChecker } from '@/executions/pre-execution-checks/credentials-permission-checker';
|
||||
import { WorkflowFinderService } from '@/workflows/workflow-finder.service';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { IRunExecutionData } from 'n8n-workflow';
|
||||
import { NodeApiError, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import type { RedactableExecution } from '@/executions/execution-redaction';
|
||||
import type { RedactableExecution } from '@n8n/backend-services';
|
||||
|
||||
import type { RedactionContext } from '../../execution-redaction.interfaces';
|
||||
import { FullItemRedactionStrategy } from '../full-item-redaction.strategy';
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { Logger } from '@n8n/backend-common';
|
|||
import { mockInstance } from '@n8n/backend-test-utils';
|
||||
import type { IRedactedFieldMarker } from 'n8n-workflow';
|
||||
|
||||
import type { RedactableExecution } from '@/executions/execution-redaction';
|
||||
import type { RedactableExecution } from '@n8n/backend-services';
|
||||
import { NodeTypes } from '@/node-types';
|
||||
|
||||
import type { RedactionContext } from '../../execution-redaction.interfaces';
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import type {
|
|||
ITaskDataConnections,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import type { RedactableExecution } from '@/executions/execution-redaction';
|
||||
import type { RedactableExecution } from '@n8n/backend-services';
|
||||
|
||||
import type {
|
||||
IExecutionRedactionStrategy,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { Logger } from '@n8n/backend-common';
|
|||
import { Service } from '@n8n/di';
|
||||
import type { INodeExecutionData, IRedactedFieldMarker, ITaskDataConnections } from 'n8n-workflow';
|
||||
|
||||
import type { RedactableExecution } from '@/executions/execution-redaction';
|
||||
import type { RedactableExecution } from '@n8n/backend-services';
|
||||
import { NodeTypes } from '@/node-types';
|
||||
|
||||
import type {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import type { ModuleInterface } from '@n8n/decorators';
|
|||
import { BackendModule } from '@n8n/decorators';
|
||||
import { Container } from '@n8n/di';
|
||||
|
||||
import { ExecutionRedactionServiceProxy } from '@/executions/execution-redaction-proxy.service';
|
||||
import { ExecutionRedactionServiceProxy } from '@n8n/backend-services';
|
||||
|
||||
/**
|
||||
* Context is established by whichever instance runs the workflow — main, queue worker or
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { Cipher } from 'n8n-core';
|
|||
import type { IDataObject, IRunExecutionData } from 'n8n-workflow';
|
||||
import { toSecureArtifacts } from 'n8n-workflow';
|
||||
|
||||
import { RuntimeCredentialProvider } from '@/services/runtime-credential-proxy.service';
|
||||
import { RuntimeCredentialProvider } from '@n8n/backend-services';
|
||||
|
||||
@Service()
|
||||
export class RuntimeCredentialsAccessService implements RuntimeCredentialProvider {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import type { ModuleInterface } from '@n8n/decorators';
|
|||
import { BackendModule } from '@n8n/decorators';
|
||||
import { Container } from '@n8n/di';
|
||||
|
||||
import { RuntimeCredentialProxyService } from '@/services/runtime-credential-proxy.service';
|
||||
import { RuntimeCredentialProxyService } from '@n8n/backend-services';
|
||||
|
||||
@BackendModule({ name: 'runtime-credentials' })
|
||||
export class RuntimeCredentialsModule implements ModuleInterface {
|
||||
|
|
|
|||
|
|
@ -49,8 +49,8 @@ import type { PolicyEnforcementService } from '@/policy/policy-enforcement.servi
|
|||
import { PolicyViolationError } from '@/policy/policy-violation.error';
|
||||
import type { DeprecatedNodesValidationService } from '@/workflows/deprecated-nodes-validation.service';
|
||||
import type { WorkflowHistoryService } from '@/workflows/workflow-history/workflow-history.service';
|
||||
import type { WorkflowMutationHooksProxy } from '@/workflows/workflow-mutation-hooks-proxy.service';
|
||||
import type { WorkflowPublishGuardProxy } from '@/workflows/workflow-publish-guard-proxy.service';
|
||||
import type { WorkflowMutationHooksProxy, WorkflowPublishGuardProxy } from '@n8n/backend-services';
|
||||
|
||||
import type { WorkflowFinderService } from '@/workflows/workflow-finder.service';
|
||||
import type { WorkflowService } from '@/workflows/workflow.service';
|
||||
|
||||
|
|
|
|||
|
|
@ -59,8 +59,8 @@ import { validateWorkflowNodeGroups, sanitizeNodeGroupDescriptions } from '@/wor
|
|||
import { DeprecatedNodesValidationService } from '@/workflows/deprecated-nodes-validation.service';
|
||||
import { WorkflowFinderService } from '@/workflows/workflow-finder.service';
|
||||
import { WorkflowHistoryService } from '@/workflows/workflow-history/workflow-history.service';
|
||||
import { WorkflowMutationHooksProxy } from '@/workflows/workflow-mutation-hooks-proxy.service';
|
||||
import { WorkflowPublishGuardProxy } from '@/workflows/workflow-publish-guard-proxy.service';
|
||||
import { WorkflowMutationHooksProxy, WorkflowPublishGuardProxy } from '@n8n/backend-services';
|
||||
|
||||
import { WorkflowService } from '@/workflows/workflow.service';
|
||||
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { ControllerRegistryMetadata, ModuleMetadata, PolicyCheckMetadata } from
|
|||
import { Container } from '@n8n/di';
|
||||
import { mock } from 'vitest-mock-extended';
|
||||
|
||||
import { RestrictedNodeTypesProviderProxy } from '@/workflows/restricted-node-types-provider-proxy.service';
|
||||
import { RestrictedNodeTypesProviderProxy } from '@n8n/backend-services';
|
||||
|
||||
import { NodeTypePolicyRestrictedTypesProvider } from '../restricted-node-types.provider';
|
||||
// Importing the module runs the @BackendModule decorator, registering its metadata.
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { Service } from '@n8n/di';
|
|||
import { singleFlight } from '@n8n/utils/promise/single-flight';
|
||||
|
||||
import { PolicyEnforcementService } from '@/policy/policy-enforcement.service';
|
||||
import type { RestrictedNodeTypesProvider } from '@/workflows/restricted-node-types-provider-proxy.service';
|
||||
import type { RestrictedNodeTypesProvider } from '@n8n/backend-services';
|
||||
|
||||
import { NODE_TYPES_KIND } from './constants';
|
||||
import type {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import type { ModuleInterface } from '@n8n/decorators';
|
|||
import { BackendModule } from '@n8n/decorators';
|
||||
import { Container } from '@n8n/di';
|
||||
|
||||
import { RestrictedNodeTypesProviderProxy } from '@/workflows/restricted-node-types-provider-proxy.service';
|
||||
import { RestrictedNodeTypesProviderProxy } from '@n8n/backend-services';
|
||||
|
||||
/**
|
||||
* The module-level `licenseFlag` skips `init()` on an unlicensed instance, so neither the
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { SourceControlledFile } from '@n8n/api-types';
|
||||
import { EventService } from '@n8n/backend-services';
|
||||
import { EventService, WorkflowMutationHooksProxy } from '@n8n/backend-services';
|
||||
import { createTeamProject, mockInstance, testDb } from '@n8n/backend-test-utils';
|
||||
import { GlobalConfig } from '@n8n/config';
|
||||
import type { Project, User } from '@n8n/db';
|
||||
|
|
@ -28,7 +28,7 @@ import { WorkflowReviewPolicyService } from '@/services/workflow-review-policy.s
|
|||
import { WorkflowPublicationNotifier } from '@/workflows/publication/workflow-publication-notifier';
|
||||
import { WorkflowFinderService } from '@/workflows/workflow-finder.service';
|
||||
import { WorkflowHistoryService } from '@/workflows/workflow-history/workflow-history.service';
|
||||
import { WorkflowMutationHooksProxy } from '@/workflows/workflow-mutation-hooks-proxy.service';
|
||||
|
||||
import { WorkflowValidationService } from '@/workflows/workflow-validation.service';
|
||||
import { WorkflowService } from '@/workflows/workflow.service';
|
||||
import { EnterpriseWorkflowService } from '@/workflows/workflow.service.ee';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { WorkflowReviewWorkflowCauseActivityType } from '@n8n/api-types';
|
||||
import { EventService } from '@n8n/backend-services';
|
||||
import { EventService, type WorkflowMutationHooks } from '@n8n/backend-services';
|
||||
import type { OperationContext } from '@n8n/db';
|
||||
import { Logger } from '@n8n/backend-common';
|
||||
import {
|
||||
|
|
@ -12,8 +12,6 @@ import {
|
|||
} from '@n8n/db';
|
||||
import { Service } from '@n8n/di';
|
||||
|
||||
import type { WorkflowMutationHooks } from '@/workflows/workflow-mutation-hooks-proxy.service';
|
||||
|
||||
import { WorkflowReviewStateNotifier } from './workflow-review-state-notifier.service';
|
||||
|
||||
/** Review data captured before a workflow is deleted, keyed by workflow ID. */
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { WorkflowReviewRequestRepository } from '@n8n/db';
|
|||
import { Service } from '@n8n/di';
|
||||
|
||||
import { WorkflowPublishBlockedError } from '@/errors/response-errors/workflow-publish-blocked.error';
|
||||
import type { WorkflowPublishGuard } from '@/workflows/workflow-publish-guard-proxy.service';
|
||||
import type { WorkflowPublishGuard } from '@n8n/backend-services';
|
||||
|
||||
import { WorkflowReviewFeatureGate } from './workflow-review-feature-gate.service';
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@ import type { ModuleInterface } from '@n8n/decorators';
|
|||
import { BackendModule } from '@n8n/decorators';
|
||||
import { Container } from '@n8n/di';
|
||||
|
||||
import { WorkflowMutationHooksProxy } from '@/workflows/workflow-mutation-hooks-proxy.service';
|
||||
import { WorkflowPublishGuardProxy } from '@/workflows/workflow-publish-guard-proxy.service';
|
||||
import { WorkflowMutationHooksProxy, WorkflowPublishGuardProxy } from '@n8n/backend-services';
|
||||
|
||||
@BackendModule({ name: 'workflow-reviews', licenseFlag: LICENSE_FEATURES.WORKFLOW_REVIEWS })
|
||||
export class WorkflowReviewsModule implements ModuleInterface {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,12 @@ import {
|
|||
StoppedExecutionsPublicDto,
|
||||
TagIdsPublicDto,
|
||||
} from '@n8n/api-types';
|
||||
import { EventService, WorkflowSharingService } from '@n8n/backend-services';
|
||||
import {
|
||||
EventService,
|
||||
WorkflowSharingService,
|
||||
isRedactableExecution,
|
||||
ExecutionRedactionServiceProxy,
|
||||
} from '@n8n/backend-services';
|
||||
import { ExecutionsConfig } from '@n8n/config';
|
||||
import type { AuthenticatedRequest, IExecutionBase, IExecutionResponse } from '@n8n/db';
|
||||
import {
|
||||
|
|
@ -42,8 +47,7 @@ import { AbortedExecutionRetryError } from '@/errors/aborted-execution-retry.err
|
|||
import { MissingExecutionStopError } from '@/errors/missing-execution-stop.error';
|
||||
import { QueuedExecutionRetryError } from '@/errors/queued-execution-retry.error';
|
||||
import { BadRequestError, ConflictError, NotFoundError } from '@n8n/errors';
|
||||
import { isRedactableExecution } from '@/executions/execution-redaction';
|
||||
import { ExecutionRedactionServiceProxy } from '@/executions/execution-redaction-proxy.service';
|
||||
|
||||
import { ExecutionService } from '@/executions/execution.service';
|
||||
import type { StopResult } from '@/executions/execution.types';
|
||||
import type { TracingContext } from '@/modules/otel/tracing-context';
|
||||
|
|
|
|||
|
|
@ -3,7 +3,12 @@
|
|||
import type { PushMessage, PushType } from '@n8n/api-types';
|
||||
import { Logger, ModuleRegistry } from '@n8n/backend-common';
|
||||
import { SsrfProtectionService } from '@n8n/backend-network';
|
||||
import { EventService, UrlService, WorkflowPublishedDataService } from '@n8n/backend-services';
|
||||
import {
|
||||
EventService,
|
||||
UrlService,
|
||||
RuntimeCredentialProxyService,
|
||||
WorkflowPublishedDataService,
|
||||
} from '@n8n/backend-services';
|
||||
import { ExecutionsConfig, GlobalConfig, SsrfProtectionConfig, WorkflowsConfig } from '@n8n/config';
|
||||
import { Time } from '@n8n/constants';
|
||||
import { ExecutionRepository, WorkflowRepository } from '@n8n/db';
|
||||
|
|
@ -54,7 +59,6 @@ import {
|
|||
import type { PrepareWorkflowAgentForEval } from './modules/agents/agent-runtime-instrumentation';
|
||||
import type { WorkflowAgentRunOptions } from './modules/agents/agent-workflow-execution.service';
|
||||
import { createWorkflowAgentStreamObserver } from './modules/agents/workflow-agent-stream';
|
||||
import { RuntimeCredentialProxyService } from './services/runtime-credential-proxy.service';
|
||||
|
||||
import { ActiveExecutions } from '@/active-executions';
|
||||
import { isCredSharingEnabled } from '@/constants/credential-sharing';
|
||||
|
|
|
|||
|
|
@ -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 '@n8n/backend-services';
|
||||
import type { CredentialsFinderService, WorkflowMutationHooksProxy } from '@n8n/backend-services';
|
||||
import type { CredentialsService } from '@/credentials/credentials.service';
|
||||
import type { NodeTypes } from '@/node-types';
|
||||
import type { CredentialsPermissionChecker } from '@/executions/pre-execution-checks/credentials-permission-checker';
|
||||
|
|
@ -23,7 +23,7 @@ import type { PolicyEnforcementService } from '@/policy/policy-enforcement.servi
|
|||
import type { OwnershipService } from '@/services/ownership.service';
|
||||
import type { ProjectService } from '@/services/project.service.ee';
|
||||
import type { WorkflowFinderService } from '@/workflows/workflow-finder.service';
|
||||
import type { WorkflowMutationHooksProxy } from '@/workflows/workflow-mutation-hooks-proxy.service';
|
||||
|
||||
import { EnterpriseWorkflowService } from '@/workflows/workflow.service.ee';
|
||||
|
||||
const flags = { credSharingEnabled: false };
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
import type { LicenseState } from '@n8n/backend-common';
|
||||
import { type EventService, type RoleService } from '@n8n/backend-services';
|
||||
import type {
|
||||
EventService,
|
||||
RoleService,
|
||||
WorkflowMutationHooksProxy,
|
||||
WorkflowPublishGuardProxy,
|
||||
RestrictedNodeTypesProviderProxy,
|
||||
} from '@n8n/backend-services';
|
||||
import type { GlobalConfig, WorkflowsConfig } from '@n8n/config';
|
||||
import type {
|
||||
Transaction,
|
||||
|
|
@ -55,11 +61,10 @@ import type { WorkflowHookContextService } from '@/workflow-hook-context.service
|
|||
import type { WorkflowFinderService } from '@/workflows/workflow-finder.service';
|
||||
import type { WorkflowHistoryService } from '@/workflows/workflow-history/workflow-history.service';
|
||||
import type { WorkflowPublicationStatusService } from '@/workflows/publication/workflow-publication-status.service';
|
||||
import type { WorkflowMutationHooksProxy } from '@/workflows/workflow-mutation-hooks-proxy.service';
|
||||
import type { WorkflowPublishGuardProxy } from '@/workflows/workflow-publish-guard-proxy.service';
|
||||
|
||||
import type { WorkflowValidationService } from '@/workflows/workflow-validation.service';
|
||||
import type { NodeGroupRulesFlagGate } from '@/workflows/node-group-rules-flag-gate';
|
||||
import type { RestrictedNodeTypesProviderProxy } from '@/workflows/restricted-node-types-provider-proxy.service';
|
||||
|
||||
import { WorkflowService } from '@/workflows/workflow.service';
|
||||
import { ALL_RULES_RELAXED, NO_RULES_RELAXED } from './node-group-rules.test-data';
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import {
|
|||
|
||||
import { ActiveWorkflowManager } from '@/active-workflow-manager';
|
||||
import { isCredSharingEnabled } from '@/constants/credential-sharing';
|
||||
import { CredentialsFinderService } from '@n8n/backend-services';
|
||||
import { CredentialsFinderService, WorkflowMutationHooksProxy } from '@n8n/backend-services';
|
||||
import { CredentialsService } from '@/credentials/credentials.service';
|
||||
import { EnterpriseCredentialsService } from '@/credentials/credentials.service.ee';
|
||||
import { CredentialsPermissionChecker } from '@/executions/pre-execution-checks/credentials-permission-checker';
|
||||
|
|
@ -51,7 +51,6 @@ import { ProjectService } from '@/services/project.service.ee';
|
|||
import { stripToolSuffix } from '@/utils';
|
||||
|
||||
import { WorkflowFinderService } from './workflow-finder.service';
|
||||
import { WorkflowMutationHooksProxy } from './workflow-mutation-hooks-proxy.service';
|
||||
|
||||
/**
|
||||
* Database workflows use their own project permissions at runtime.
|
||||
|
|
|
|||
|
|
@ -6,7 +6,13 @@ import type {
|
|||
WorkflowListPublicationStatus,
|
||||
} from '@n8n/api-types';
|
||||
import { LicenseState, Logger } from '@n8n/backend-common';
|
||||
import { EventService, RoleService } from '@n8n/backend-services';
|
||||
import {
|
||||
EventService,
|
||||
RoleService,
|
||||
RestrictedNodeTypesProviderProxy,
|
||||
WorkflowMutationHooksProxy,
|
||||
WorkflowPublishGuardProxy,
|
||||
} from '@n8n/backend-services';
|
||||
import { GlobalConfig } from '@n8n/config';
|
||||
import type {
|
||||
User,
|
||||
|
|
@ -61,13 +67,12 @@ import { DeprecatedNodesValidationService } from './deprecated-nodes-validation.
|
|||
import { WorkflowPublicationNotifier } from './publication/workflow-publication-notifier';
|
||||
import { WorkflowPublicationStatusService } from './publication/workflow-publication-status.service';
|
||||
import { NodeGroupRulesFlagGate } from './node-group-rules-flag-gate';
|
||||
import { RestrictedNodeTypesProviderProxy } from './restricted-node-types-provider-proxy.service';
|
||||
|
||||
import { getEnabledTriggerNodes } from './triggers/enabled-trigger-nodes';
|
||||
import { getErrorDescription, getErrorNodeId, getRequiredRedactionScopes } from './utils';
|
||||
import { WorkflowFinderService } from './workflow-finder.service';
|
||||
import { WorkflowHistoryService } from './workflow-history/workflow-history.service';
|
||||
import { WorkflowMutationHooksProxy } from './workflow-mutation-hooks-proxy.service';
|
||||
import { WorkflowPublishGuardProxy } from './workflow-publish-guard-proxy.service';
|
||||
|
||||
import { WorkflowValidationService } from './workflow-validation.service';
|
||||
|
||||
import { ActiveWorkflowManager } from '@/active-workflow-manager';
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import { createEmptyRunExecutionData, type IRunExecutionData } from 'n8n-workflo
|
|||
import { createExecution } from '../shared/db/executions';
|
||||
import { createMember, createOwner } from '../shared/db/users';
|
||||
|
||||
import { ExecutionRedactionServiceProxy } from '@/executions/execution-redaction-proxy.service';
|
||||
import { ExecutionRedactionServiceProxy } from '@n8n/backend-services';
|
||||
import { createGetExecutionTool } from '@/modules/mcp/tools/get-execution.tool';
|
||||
import { RedactionModule } from '@/modules/redaction/redaction.module';
|
||||
import { Telemetry } from '@/telemetry';
|
||||
|
|
|
|||
|
|
@ -37,7 +37,11 @@ import { NodeTypes } from '@/node-types';
|
|||
import { PolicyEnforcementService } from '@/policy/policy-enforcement.service';
|
||||
import { OwnershipService } from '@/services/ownership.service';
|
||||
import { ProjectService } from '@/services/project.service.ee';
|
||||
import { RoleService } from '@n8n/backend-services';
|
||||
import {
|
||||
RoleService,
|
||||
RestrictedNodeTypesProviderProxy,
|
||||
type WorkflowPublishGuardProxy,
|
||||
} from '@n8n/backend-services';
|
||||
import { Telemetry } from '@/telemetry';
|
||||
import { WebhookService } from '@/webhooks/webhook.service';
|
||||
import { WorkflowHookContextService } from '@/workflow-hook-context.service';
|
||||
|
|
@ -45,10 +49,10 @@ import { WorkflowPublishBlockedError } from '@/errors/response-errors/workflow-p
|
|||
import type { WorkflowPublicationNotifier } from '@/workflows/publication/workflow-publication-notifier';
|
||||
import { WorkflowFinderService } from '@/workflows/workflow-finder.service';
|
||||
import { NodeGroupRulesFlagGate } from '@/workflows/node-group-rules-flag-gate';
|
||||
import { RestrictedNodeTypesProviderProxy } from '@/workflows/restricted-node-types-provider-proxy.service';
|
||||
|
||||
import { WorkflowPublicationStatusService } from '@/workflows/publication/workflow-publication-status.service';
|
||||
import { WorkflowHistoryService } from '@/workflows/workflow-history/workflow-history.service';
|
||||
import type { WorkflowPublishGuardProxy } from '@/workflows/workflow-publish-guard-proxy.service';
|
||||
|
||||
import { WorkflowValidationService } from '@/workflows/workflow-validation.service';
|
||||
import { ErrorWorkflowValidationService } from '@/workflows/error-workflow-validation.service';
|
||||
import { WorkflowService } from '@/workflows/workflow.service';
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user