From 768044933e8588f2f75d4d3144277c37988d54e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Fri, 27 Dec 2024 20:04:17 +0100 Subject: [PATCH] refactor(core): Replace typedi with our custom DI package (no-changelog) --- package.json | 1 - packages/@n8n/config/package.json | 4 +- packages/@n8n/config/src/decorators.ts | 7 +- packages/@n8n/config/test/config.test.ts | 2 +- packages/@n8n/config/test/decorators.test.ts | 2 +- packages/@n8n/config/tsconfig.json | 3 +- packages/@n8n/di/.eslintrc.js | 7 + packages/@n8n/di/README.md | 1 + packages/@n8n/di/jest.config.js | 2 + packages/@n8n/di/package.json | 26 ++ packages/@n8n/di/src/__tests__/di.test.ts | 287 ++++++++++++++++++ packages/@n8n/di/src/di.ts | 147 +++++++++ packages/@n8n/di/tsconfig.build.json | 11 + packages/@n8n/di/tsconfig.json | 12 + packages/@n8n/task-runner/package.json | 2 +- packages/@n8n/task-runner/src/start.ts | 2 +- packages/cli/package.json | 2 +- .../workflow-execute-additional-data.test.ts | 2 +- .../cli/src/__tests__/workflow-runner.test.ts | 2 +- packages/cli/src/abstract-server.ts | 2 +- packages/cli/src/activation-errors.service.ts | 2 +- packages/cli/src/active-executions.ts | 2 +- packages/cli/src/active-workflow-manager.ts | 2 +- packages/cli/src/auth/auth.service.ts | 2 +- packages/cli/src/auth/jwt.ts | 2 +- packages/cli/src/auth/methods/email.ts | 2 +- packages/cli/src/auth/methods/ldap.ts | 2 +- .../collaboration/collaboration.service.ts | 2 +- .../src/collaboration/collaboration.state.ts | 2 +- packages/cli/src/commands/audit.ts | 2 +- packages/cli/src/commands/base-command.ts | 2 +- packages/cli/src/commands/db/revert.ts | 2 +- packages/cli/src/commands/execute-batch.ts | 2 +- packages/cli/src/commands/execute.ts | 2 +- .../cli/src/commands/export/credentials.ts | 2 +- packages/cli/src/commands/export/workflow.ts | 2 +- .../cli/src/commands/import/credentials.ts | 2 +- packages/cli/src/commands/import/workflow.ts | 2 +- packages/cli/src/commands/ldap/reset.ts | 2 +- packages/cli/src/commands/license/clear.ts | 2 +- packages/cli/src/commands/license/info.ts | 2 +- packages/cli/src/commands/list/workflow.ts | 2 +- packages/cli/src/commands/mfa/disable.ts | 2 +- packages/cli/src/commands/start.ts | 2 +- packages/cli/src/commands/update/workflow.ts | 2 +- .../cli/src/commands/user-management/reset.ts | 2 +- packages/cli/src/commands/webhook.ts | 2 +- packages/cli/src/commands/worker.ts | 2 +- .../concurrency-control.service.ts | 2 +- .../cli/src/concurrency/concurrency-queue.ts | 2 +- packages/cli/src/config/index.ts | 2 +- packages/cli/src/config/schema.ts | 2 +- .../__tests__/api-keys.controller.test.ts | 2 +- .../__tests__/me.controller.test.ts | 2 +- .../cli/src/controllers/e2e.controller.ts | 2 +- .../oauth1-credential.controller.test.ts | 2 +- .../oauth2-credential.controller.test.ts | 2 +- .../oauth/abstract-oauth.controller.ts | 2 +- packages/cli/src/crash-journal.ts | 2 +- packages/cli/src/credential-types.ts | 2 +- packages/cli/src/credentials-helper.ts | 2 +- packages/cli/src/credentials-overwrites.ts | 2 +- .../src/credentials/credentials.service.ee.ts | 2 +- .../src/credentials/credentials.service.ts | 2 +- packages/cli/src/databases/config.ts | 2 +- .../src/databases/entities/abstract-entity.ts | 2 +- .../1711390882123-MoveSshKeysToDatabase.ts | 2 +- ...690000000002-MigrateIntegerKeysToString.ts | 2 +- .../__tests__/execution.repository.test.ts | 2 +- .../shared-credentials.repository.test.ts | 2 +- .../__tests__/workflow-statistics.test.ts | 2 +- .../annotation-tag-mapping.repository.ee.ts | 2 +- .../annotation-tag.repository.ee.ts | 2 +- .../repositories/api-key.repository.ts | 2 +- .../repositories/auth-identity.repository.ts | 2 +- .../auth-provider-sync-history.repository.ts | 2 +- .../repositories/auth-user.repository.ts | 2 +- .../repositories/credentials.repository.ts | 2 +- .../event-destinations.repository.ts | 2 +- .../execution-annotation.repository.ts | 2 +- .../repositories/execution-data.repository.ts | 2 +- .../execution-metadata.repository.ts | 2 +- .../repositories/execution.repository.ts | 2 +- .../installed-nodes.repository.ts | 2 +- .../installed-packages.repository.ts | 2 +- .../invalid-auth-token.repository.ts | 2 +- .../license-metrics.repository.ts | 2 +- .../repositories/processed-data.repository.ts | 2 +- .../project-relation.repository.ts | 2 +- .../repositories/project.repository.ts | 2 +- .../repositories/settings.repository.ts | 2 +- .../shared-credentials.repository.ts | 2 +- .../shared-workflow.repository.ts | 2 +- .../databases/repositories/tag.repository.ts | 2 +- .../test-definition.repository.ee.ts | 2 +- .../repositories/test-metric.repository.ee.ts | 2 +- .../repositories/test-run.repository.ee.ts | 2 +- .../databases/repositories/user.repository.ts | 2 +- .../repositories/variables.repository.ts | 2 +- .../repositories/webhook.repository.ts | 2 +- .../workflow-history.repository.ts | 2 +- .../workflow-statistics.repository.ts | 2 +- .../workflow-tag-mapping.repository.ts | 2 +- .../repositories/workflow.repository.ts | 2 +- .../databases/subscribers/user-subscriber.ts | 2 +- .../src/databases/utils/migration-helpers.ts | 2 +- .../cli/src/databases/utils/transformers.ts | 2 +- packages/cli/src/db.ts | 2 +- .../decorators/__tests__/on-shutdown.test.ts | 2 +- .../cli/src/decorators/controller.registry.ts | 4 +- packages/cli/src/decorators/on-shutdown.ts | 2 +- .../cli/src/decorators/rest-controller.ts | 2 +- packages/cli/src/decorators/types.ts | 4 +- .../src/deduplication/deduplication-helper.ts | 2 +- .../src/deprecation/deprecation.service.ts | 2 +- .../source-control-export.service.test.ts | 2 +- .../source-control-helper.ee.test.ts | 2 +- .../__tests__/source-control.service.test.ts | 2 +- .../source-control-enabled-middleware.ee.ts | 2 +- .../source-control-export.service.ee.ts | 2 +- .../source-control-git.service.ee.ts | 2 +- .../source-control-helper.ee.ts | 2 +- .../source-control-import.service.ee.ts | 2 +- .../source-control-preferences.service.ee.ts | 2 +- .../source-control.service.ee.ts | 2 +- .../variables/environment-helpers.ts | 2 +- .../variables/variables.service.ee.ts | 2 +- .../test-definition.service.ee.ts | 2 +- .../test-runner/test-runner.service.ee.ts | 2 +- .../message-event-bus-destination-from-db.ts | 2 +- ...message-event-bus-destination-syslog.ee.ts | 2 +- ...essage-event-bus-destination-webhook.ee.ts | 2 +- .../message-event-bus-destination.ee.ts | 2 +- .../message-event-bus-log-writer.ts | 2 +- .../message-event-bus/message-event-bus.ts | 2 +- packages/cli/src/events/event.service.ts | 2 +- packages/cli/src/events/relays/event-relay.ts | 2 +- .../relays/log-streaming.event-relay.ts | 2 +- .../events/relays/telemetry.event-relay.ts | 2 +- .../restore-binary-data-id.ts | 2 +- .../save-execution-progress.ts | 2 +- .../shared/shared-hook-functions.ts | 2 +- .../execution-recovery.service.test.ts | 2 +- .../executions/execution-recovery.service.ts | 2 +- .../src/executions/execution.service.ee.ts | 2 +- .../cli/src/executions/execution.service.ts | 2 +- packages/cli/src/expression-evaluator.ts | 2 +- packages/cli/src/external-hooks.ts | 2 +- .../external-secrets-manager.ee.test.ts | 2 +- .../external-secrets-helper.ee.ts | 2 +- .../external-secrets-manager.ee.ts | 2 +- .../external-secrets-providers.ee.ts | 2 +- .../external-secrets.service.ee.ts | 2 +- .../aws-secrets/aws-secrets-manager.ts | 2 +- .../azure-key-vault/azure-key-vault.ts | 2 +- .../gcp-secrets-manager.ts | 2 +- .../external-secrets.ee/providers/vault.ts | 2 +- packages/cli/src/help.ts | 2 +- packages/cli/src/ldap.ee/helpers.ee.ts | 2 +- packages/cli/src/ldap.ee/ldap.service.ee.ts | 2 +- packages/cli/src/license.ts | 2 +- packages/cli/src/license/license.service.ts | 2 +- .../cli/src/load-nodes-and-credentials.ts | 2 +- packages/cli/src/manual-execution.service.ts | 2 +- .../src/metrics/license-metrics.service.ts | 2 +- .../src/metrics/prometheus-metrics.service.ts | 2 +- packages/cli/src/mfa/helpers.ts | 2 +- packages/cli/src/mfa/mfa.service.ts | 2 +- packages/cli/src/mfa/totp.service.ts | 2 +- packages/cli/src/middlewares/body-parser.ts | 2 +- packages/cli/src/node-types.ts | 2 +- .../cli/src/permissions.ee/check-access.ts | 2 +- packages/cli/src/posthog/index.ts | 2 +- packages/cli/src/public-api/index.ts | 2 +- .../v1/handlers/audit/audit.handler.ts | 2 +- .../credentials/credentials.handler.ts | 2 +- .../credentials/credentials.middleware.ts | 2 +- .../credentials/credentials.service.ts | 2 +- .../handlers/executions/executions.handler.ts | 2 +- .../v1/handlers/projects/projects.handler.ts | 2 +- .../source-control/source-control.handler.ts | 2 +- .../v1/handlers/tags/tags.handler.ts | 2 +- .../v1/handlers/users/users.handler.ee.ts | 2 +- .../v1/handlers/users/users.service.ee.ts | 2 +- .../handlers/variables/variables.handler.ts | 2 +- .../handlers/workflows/workflows.handler.ts | 2 +- .../handlers/workflows/workflows.service.ts | 2 +- .../shared/middlewares/global.middleware.ts | 2 +- .../src/push/__tests__/websocket.push.test.ts | 2 +- packages/cli/src/push/abstract.push.ts | 2 +- packages/cli/src/push/index.ts | 2 +- packages/cli/src/push/sse.push.ts | 2 +- packages/cli/src/push/websocket.push.ts | 2 +- packages/cli/src/response-helper.ts | 2 +- .../auth/task-runner-auth.controller.ts | 2 +- .../runners/auth/task-runner-auth.service.ts | 2 +- ...default-task-runner-disconnect-analyzer.ts | 2 +- ...nternal-task-runner-disconnect-analyzer.ts | 2 +- .../src/runners/runner-lifecycle-events.ts | 2 +- packages/cli/src/runners/runner-ws-server.ts | 2 +- .../cli/src/runners/task-broker.service.ts | 2 +- .../task-managers/local-task-manager.ts | 2 +- .../src/runners/task-managers/task-manager.ts | 2 +- .../cli/src/runners/task-runner-module.ts | 2 +- .../cli/src/runners/task-runner-process.ts | 2 +- .../cli/src/runners/task-runner-server.ts | 2 +- .../scaling/__tests__/scaling.service.test.ts | 2 +- packages/cli/src/scaling/job-processor.ts | 2 +- .../cli/src/scaling/multi-main-setup.ee.ts | 2 +- .../src/scaling/pubsub/publisher.service.ts | 2 +- .../cli/src/scaling/pubsub/pubsub-handler.ts | 2 +- .../src/scaling/pubsub/subscriber.service.ts | 2 +- packages/cli/src/scaling/scaling.service.ts | 2 +- packages/cli/src/scaling/worker-server.ts | 2 +- .../src/scaling/worker-status.service.ee.ts | 2 +- packages/cli/src/secrets-helpers.ee.ts | 2 +- .../credentials-risk-reporter.ts | 2 +- .../risk-reporters/database-risk-reporter.ts | 2 +- .../filesystem-risk-reporter.ts | 2 +- .../risk-reporters/instance-risk-reporter.ts | 2 +- .../risk-reporters/nodes-risk-reporter.ts | 2 +- .../security-audit/security-audit.service.ts | 2 +- packages/cli/src/server.ts | 2 +- .../execution-metadata.service.test.ts | 2 +- .../__tests__/orchestration.service.test.ts | 2 +- .../__tests__/password.utility.test.ts | 2 +- .../workflow-statistics.service.test.ts | 2 +- packages/cli/src/services/access.service.ts | 2 +- .../src/services/active-workflows.service.ts | 2 +- packages/cli/src/services/ai.service.ts | 2 +- .../src/services/annotation-tag.service.ee.ts | 2 +- .../__tests__/cache-mock.service.test.ts | 2 +- .../cache/__tests__/cache.service.test.ts | 2 +- .../cli/src/services/cache/cache.service.ts | 2 +- .../services/community-packages.service.ts | 2 +- .../services/credentials-tester.service.ts | 2 +- packages/cli/src/services/cta.service.ts | 2 +- packages/cli/src/services/curl.service.ts | 2 +- .../dynamic-node-parameters.service.ts | 2 +- .../services/execution-metadata.service.ts | 2 +- packages/cli/src/services/frontend.service.ts | 2 +- packages/cli/src/services/hooks.service.ts | 2 +- packages/cli/src/services/import.service.ts | 2 +- packages/cli/src/services/jwt.service.ts | 2 +- packages/cli/src/services/naming.service.ts | 2 +- .../cli/src/services/orchestration.service.ts | 2 +- .../cli/src/services/ownership.service.ts | 2 +- packages/cli/src/services/password.utility.ts | 2 +- .../cli/src/services/project.service.ee.ts | 2 +- .../src/services/pruning/pruning.service.ts | 2 +- .../src/services/public-api-key.service.ts | 2 +- .../cli/src/services/redis-client.service.ts | 2 +- packages/cli/src/services/role.service.ts | 2 +- packages/cli/src/services/tag.service.ts | 2 +- packages/cli/src/services/url.service.ts | 2 +- packages/cli/src/services/user.service.ts | 2 +- .../src/services/workflow-loader.service.ts | 2 +- .../services/workflow-statistics.service.ts | 2 +- .../__tests__/shutdown.service.test.ts | 2 +- packages/cli/src/shutdown/shutdown.service.ts | 2 +- packages/cli/src/sso.ee/saml/saml-helpers.ts | 2 +- .../cli/src/sso.ee/saml/saml-validator.ts | 2 +- .../cli/src/sso.ee/saml/saml.service.ee.ts | 2 +- .../src/sso.ee/saml/service-provider.ee.ts | 2 +- packages/cli/src/sso.ee/sso-helpers.ts | 2 +- .../subworkflow-policy-checker.service.ts | 2 +- packages/cli/src/telemetry/index.ts | 2 +- .../src/user-management/email/node-mailer.ts | 2 +- .../email/user-management-mailer.ts | 2 +- .../src/user-management/permission-checker.ts | 2 +- packages/cli/src/wait-tracker.ts | 2 +- packages/cli/src/webhooks/live-webhooks.ts | 2 +- .../test-webhook-registrations.service.ts | 2 +- packages/cli/src/webhooks/test-webhooks.ts | 2 +- packages/cli/src/webhooks/waiting-forms.ts | 2 +- packages/cli/src/webhooks/waiting-webhooks.ts | 2 +- packages/cli/src/webhooks/webhook-helpers.ts | 2 +- packages/cli/src/webhooks/webhook-server.ts | 2 +- packages/cli/src/webhooks/webhook.service.ts | 2 +- .../src/workflow-execute-additional-data.ts | 2 +- packages/cli/src/workflow-helpers.ts | 2 +- packages/cli/src/workflow-runner.ts | 2 +- .../workflows/workflow-execution.service.ts | 2 +- .../workflow-history-helper.ee.ts | 2 +- .../workflow-history-manager.ee.ts | 2 +- .../workflow-history.service.ee.ts | 2 +- .../src/workflows/workflow-sharing.service.ts | 2 +- .../workflows/workflow-static-data.service.ts | 2 +- .../cli/src/workflows/workflow.service.ee.ts | 2 +- .../cli/src/workflows/workflow.service.ts | 2 +- .../active-workflow-manager.test.ts | 2 +- .../cli/test/integration/ai/ai.api.test.ts | 2 +- .../cli/test/integration/api-keys.api.test.ts | 2 +- .../cli/test/integration/auth.api.test.ts | 2 +- .../collaboration.service.test.ts | 2 +- .../integration/commands/ldap/reset.test.ts | 2 +- .../integration/commands/license.cmd.test.ts | 2 +- .../integration/commands/reset.cmd.test.ts | 2 +- .../integration/commands/worker.cmd.test.ts | 2 +- .../invitation.controller.integration.test.ts | 2 +- .../controllers/oauth/oauth2.api.test.ts | 2 +- .../integration/credentials-helper.test.ts | 2 +- .../credentials/credentials.api.ee.test.ts | 2 +- .../credentials/credentials.api.test.ts | 2 +- .../credentials/credentials.service.test.ts | 2 +- .../cli/test/integration/cta.service.test.ts | 2 +- .../repositories/execution.repository.test.ts | 2 +- .../repositories/project.repository.test.ts | 2 +- .../repositories/workflow.repository.test.ts | 2 +- .../test/integration/debug.controller.test.ts | 2 +- .../source-control-import.service.test.ts | 2 +- .../environments/source-control.test.ts | 2 +- .../evaluation/metrics.api.test.ts | 2 +- .../evaluation/test-definitions.api.test.ts | 2 +- .../evaluation/test-runs.api.test.ts | 2 +- .../cli/test/integration/eventbus.ee.test.ts | 2 +- .../execution.service.integration.test.ts | 2 +- .../external-secrets.api.test.ts | 2 +- .../test/integration/import.service.test.ts | 2 +- .../test/integration/ldap/ldap.api.test.ts | 2 +- .../license-metrics.repository.test.ts | 2 +- packages/cli/test/integration/me.api.test.ts | 2 +- .../cli/test/integration/mfa/mfa.api.test.ts | 2 +- .../cli/test/integration/owner.api.test.ts | 2 +- .../integration/password-reset.api.test.ts | 2 +- .../integration/permission-checker.test.ts | 2 +- .../cli/test/integration/project.api.test.ts | 2 +- .../project.service.integration.test.ts | 2 +- .../integration/prometheus-metrics.test.ts | 2 +- .../test/integration/pruning.service.test.ts | 2 +- .../public-api/credentials.test.ts | 2 +- .../test/integration/public-api/tags.test.ts | 2 +- .../integration/public-api/workflows.test.ts | 2 +- .../cli/test/integration/role.api.test.ts | 2 +- .../task-runner-module.external.test.ts | 2 +- .../task-runner-module.internal.test.ts | 2 +- .../runners/task-runner-process.test.ts | 2 +- .../credentials-risk-reporter.test.ts | 2 +- .../database-risk-reporter.test.ts | 2 +- .../filesystem-risk-reporter.test.ts | 2 +- .../instance-risk-reporter.test.ts | 2 +- .../nodes-risk-reporter.test.ts | 2 +- .../test/integration/security-audit/utils.ts | 2 +- .../execution-metadata.service.test.ts | 2 +- .../services/project.service.test.ts | 2 +- .../workflow-static-data.service.test.ts | 2 +- .../cli/test/integration/shared/constants.ts | 2 +- .../test/integration/shared/db/credentials.ts | 2 +- .../test/integration/shared/db/executions.ts | 2 +- .../test/integration/shared/db/projects.ts | 2 +- .../cli/test/integration/shared/db/tags.ts | 2 +- .../cli/test/integration/shared/db/users.ts | 2 +- .../test/integration/shared/db/variables.ts | 2 +- .../integration/shared/db/workflow-history.ts | 2 +- .../shared/db/workflow-statistics.ts | 2 +- .../test/integration/shared/db/workflows.ts | 2 +- packages/cli/test/integration/shared/ldap.ts | 2 +- .../cli/test/integration/shared/test-db.ts | 2 +- .../shared/utils/community-nodes.ts | 2 +- .../test/integration/shared/utils/index.ts | 2 +- .../shared/utils/task-broker-test-server.ts | 2 +- .../integration/shared/utils/test-server.ts | 2 +- .../cli/test/integration/tags.api.test.ts | 2 +- .../test/integration/user.repository.test.ts | 2 +- .../cli/test/integration/users.api.test.ts | 2 +- .../cli/test/integration/variables.test.ts | 2 +- .../cli/test/integration/webhooks.test.ts | 2 +- .../workflow-history-manager.test.ts | 2 +- ...tag-mapping.repository.integration.test.ts | 2 +- .../workflow-sharing.service.test.ts | 2 +- .../workflows/workflow.service.ee.test.ts | 2 +- .../workflows/workflow.service.test.ts | 2 +- .../workflows/workflows.controller.ee.test.ts | 2 +- .../workflows/workflows.controller.test.ts | 2 +- packages/cli/test/shared/mocking.ts | 2 +- packages/cli/test/teardown.ts | 2 +- packages/cli/tsconfig.json | 1 + packages/core/package.json | 2 +- packages/core/src/ActiveWorkflows.ts | 2 +- .../core/src/BinaryData/BinaryData.service.ts | 2 +- .../src/BinaryData/ObjectStore.manager.ts | 2 +- packages/core/src/Cipher.ts | 2 +- packages/core/src/Credentials.ts | 2 +- packages/core/src/DirectoryLoader.ts | 2 +- packages/core/src/InstanceSettings.ts | 2 +- packages/core/src/NodeExecuteFunctions.ts | 2 +- .../src/ObjectStore/ObjectStore.service.ee.ts | 2 +- packages/core/src/SSHClientsManager.ts | 2 +- packages/core/src/ScheduledTaskManager.ts | 2 +- packages/core/src/TriggersAndPollers.ts | 2 +- packages/core/src/WorkflowExecute.ts | 2 +- packages/core/src/error-reporter.ts | 2 +- packages/core/src/logging/logger.ts | 2 +- .../__tests__/node-execution-context.test.ts | 2 +- .../__tests__/shared-tests.ts | 2 +- .../base-execute-context.ts | 2 +- .../node-execution-context.ts | 2 +- packages/core/test/Cipher.test.ts | 2 +- packages/core/test/Credentials.test.ts | 2 +- .../core/test/NodeExecuteFunctions.test.ts | 2 +- packages/core/test/utils.ts | 4 +- packages/core/tsconfig.json | 1 + packages/node-dev/commands/build.ts | 2 +- packages/node-dev/package.json | 4 +- packages/node-dev/src/Build.ts | 2 +- packages/nodes-base/nodes/Code/Code.node.ts | 2 +- packages/nodes-base/package.json | 2 +- packages/nodes-base/test/nodes/Helpers.ts | 2 +- patches/typedi@0.10.0.patch | 14 - pnpm-lock.yaml | 53 ++-- pnpm-workspace.yaml | 1 - turbo.json | 2 + 412 files changed, 927 insertions(+), 449 deletions(-) create mode 100644 packages/@n8n/di/.eslintrc.js create mode 100644 packages/@n8n/di/README.md create mode 100644 packages/@n8n/di/jest.config.js create mode 100644 packages/@n8n/di/package.json create mode 100644 packages/@n8n/di/src/__tests__/di.test.ts create mode 100644 packages/@n8n/di/src/di.ts create mode 100644 packages/@n8n/di/tsconfig.build.json create mode 100644 packages/@n8n/di/tsconfig.json delete mode 100644 patches/typedi@0.10.0.patch diff --git a/package.json b/package.json index 063accd8558ca..90e48e9bd8eaf 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,6 @@ "ws": ">=8.17.1" }, "patchedDependencies": { - "typedi@0.10.0": "patches/typedi@0.10.0.patch", "pkce-challenge@3.0.0": "patches/pkce-challenge@3.0.0.patch", "pyodide@0.23.4": "patches/pyodide@0.23.4.patch", "@types/express-serve-static-core@4.17.43": "patches/@types__express-serve-static-core@4.17.43.patch", diff --git a/packages/@n8n/config/package.json b/packages/@n8n/config/package.json index c4368a75c555b..33f708078869f 100644 --- a/packages/@n8n/config/package.json +++ b/packages/@n8n/config/package.json @@ -21,7 +21,7 @@ "dist/**/*" ], "dependencies": { - "reflect-metadata": "0.2.2", - "typedi": "catalog:" + "@n8n/di": "workspace:*", + "reflect-metadata": "0.2.2" } } diff --git a/packages/@n8n/config/src/decorators.ts b/packages/@n8n/config/src/decorators.ts index cafdf3fcd4ff9..a91f93361d12b 100644 --- a/packages/@n8n/config/src/decorators.ts +++ b/packages/@n8n/config/src/decorators.ts @@ -1,6 +1,6 @@ import 'reflect-metadata'; +import { Container, Service } from '@n8n/di'; import { readFileSync } from 'fs'; -import { Container, Service } from 'typedi'; // eslint-disable-next-line @typescript-eslint/ban-types type Class = Function; @@ -24,6 +24,7 @@ const readEnv = (envName: string) => { return undefined; }; +// @ts-expect-error xyzy export const Config: ClassDecorator = (ConfigClass: Class) => { const factory = function () { const config = new (ConfigClass as new () => Record)(); @@ -35,7 +36,7 @@ export const Config: ClassDecorator = (ConfigClass: Class) => { for (const [key, { type, envName }] of classMetadata) { if (typeof type === 'function' && globalMetadata.has(type)) { - config[key] = Container.get(type); + config[key] = Container.get(type as Constructable); } else if (envName) { const value = readEnv(envName); if (value === undefined) continue; @@ -64,7 +65,7 @@ export const Config: ClassDecorator = (ConfigClass: Class) => { } return config; }; - // eslint-disable-next-line @typescript-eslint/no-unsafe-return + // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call return Service({ factory })(ConfigClass); }; diff --git a/packages/@n8n/config/test/config.test.ts b/packages/@n8n/config/test/config.test.ts index d6d19c47fe2fc..9fd0a35d5a284 100644 --- a/packages/@n8n/config/test/config.test.ts +++ b/packages/@n8n/config/test/config.test.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import fs from 'fs'; import { mock } from 'jest-mock-extended'; -import { Container } from 'typedi'; import { GlobalConfig } from '../src/index'; diff --git a/packages/@n8n/config/test/decorators.test.ts b/packages/@n8n/config/test/decorators.test.ts index c5c90b70a0bcd..a346b442e0c51 100644 --- a/packages/@n8n/config/test/decorators.test.ts +++ b/packages/@n8n/config/test/decorators.test.ts @@ -1,4 +1,4 @@ -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import { Config, Env } from '../src/decorators'; diff --git a/packages/@n8n/config/tsconfig.json b/packages/@n8n/config/tsconfig.json index 15e134d6b4ffd..f26ea23c2458b 100644 --- a/packages/@n8n/config/tsconfig.json +++ b/packages/@n8n/config/tsconfig.json @@ -9,5 +9,6 @@ "baseUrl": "src", "tsBuildInfoFile": "dist/typecheck.tsbuildinfo" }, - "include": ["src/**/*.ts", "test/**/*.ts"] + "include": ["src/**/*.ts", "test/**/*.ts"], + "references": [{ "path": "../di/tsconfig.build.json" }] } diff --git a/packages/@n8n/di/.eslintrc.js b/packages/@n8n/di/.eslintrc.js new file mode 100644 index 0000000000000..1c42fddcdcc94 --- /dev/null +++ b/packages/@n8n/di/.eslintrc.js @@ -0,0 +1,7 @@ +const sharedOptions = require('@n8n_io/eslint-config/shared'); + +/** @type {import('@types/eslint').ESLint.ConfigData} */ +module.exports = { + extends: ['@n8n_io/eslint-config/base'], + ...sharedOptions(__dirname), +}; diff --git a/packages/@n8n/di/README.md b/packages/@n8n/di/README.md new file mode 100644 index 0000000000000..1a4d9ff2bcd43 --- /dev/null +++ b/packages/@n8n/di/README.md @@ -0,0 +1 @@ +## @n8n/di diff --git a/packages/@n8n/di/jest.config.js b/packages/@n8n/di/jest.config.js new file mode 100644 index 0000000000000..d6c48554a79a4 --- /dev/null +++ b/packages/@n8n/di/jest.config.js @@ -0,0 +1,2 @@ +/** @type {import('jest').Config} */ +module.exports = require('../../../jest.config'); diff --git a/packages/@n8n/di/package.json b/packages/@n8n/di/package.json new file mode 100644 index 0000000000000..6a5b19d8f84ee --- /dev/null +++ b/packages/@n8n/di/package.json @@ -0,0 +1,26 @@ +{ + "name": "@n8n/di", + "version": "0.1.0", + "scripts": { + "clean": "rimraf dist .turbo", + "dev": "pnpm watch", + "typecheck": "tsc --noEmit", + "build": "tsc -p tsconfig.build.json", + "format": "biome format --write .", + "format:check": "biome ci .", + "lint": "eslint .", + "lintfix": "eslint . --fix", + "watch": "tsc -p tsconfig.build.json --watch", + "test": "jest", + "test:dev": "jest --watch" + }, + "main": "dist/di.js", + "module": "src/di.ts", + "types": "dist/di.d.ts", + "files": [ + "dist/**/*" + ], + "peerDependencies": { + "reflect-metadata": "*" + } +} diff --git a/packages/@n8n/di/src/__tests__/di.test.ts b/packages/@n8n/di/src/__tests__/di.test.ts new file mode 100644 index 0000000000000..795a6507bfd2d --- /dev/null +++ b/packages/@n8n/di/src/__tests__/di.test.ts @@ -0,0 +1,287 @@ +import { Injectable, Container } from '../di'; + +@Injectable() +class SimpleService { + getValue() { + return 'simple'; + } +} + +@Injectable() +class DependentService { + constructor(readonly simple: SimpleService) {} + + getValue() { + return this.simple.getValue() + '-dependent'; + } +} + +class CustomFactory { + getValue() { + return 'factory-made'; + } +} + +@Injectable({ factory: () => new CustomFactory() }) +class FactoryService { + getValue() { + return 'should-not-be-called'; + } +} + +abstract class AbstractService { + abstract getValue(): string; +} + +@Injectable() +class ConcreteService extends AbstractService { + getValue(): string { + return 'concrete'; + } +} + +describe('DI Container', () => { + beforeEach(() => { + jest.clearAllMocks(); + Container.reset(); + }); + + describe('basic functionality', () => { + it('should create a simple instance', () => { + const instance = Container.get(SimpleService); + expect(instance).toBeInstanceOf(SimpleService); + expect(instance.getValue()).toBe('simple'); + }); + + it('should return same instance on multiple gets', () => { + const instance1 = Container.get(SimpleService); + const instance2 = Container.get(SimpleService); + expect(instance1).toBe(instance2); + }); + + it('should handle classes with no dependencies (empty constructor)', () => { + @Injectable() + class EmptyConstructorService {} + + const instance = Container.get(EmptyConstructorService); + expect(instance).toBeInstanceOf(EmptyConstructorService); + }); + + it('should throw when trying to resolve an undecorated class', () => { + class UnDecoratedService {} + + expect(() => Container.get(UnDecoratedService)).toThrow(); + }); + }); + + describe('dependency injection', () => { + it('should inject dependencies correctly', () => { + const dependent = Container.get(DependentService); + expect(dependent).toBeInstanceOf(DependentService); + expect(dependent.getValue()).toBe('simple-dependent'); + expect(dependent.simple).toBeInstanceOf(SimpleService); + }); + + it('should handle deep dependency chains', () => { + @Injectable() + class ServiceC { + getValue() { + return 'C'; + } + } + + @Injectable() + class ServiceB { + constructor(private c: ServiceC) {} + + getValue() { + return this.c.getValue() + 'B'; + } + } + + @Injectable() + class ServiceA { + constructor(private b: ServiceB) {} + + getValue() { + return this.b.getValue() + 'A'; + } + } + + const instance = Container.get(ServiceA); + expect(instance.getValue()).toBe('CBA'); + }); + + it('should return undefined for non-decorated dependencies in resolution chain', () => { + class NonDecoratedDep {} + + @Injectable() + class ServiceWithNonDecoratedDep { + constructor(readonly dep: NonDecoratedDep) {} + } + + const instance = Container.get(ServiceWithNonDecoratedDep); + expect(instance).toBeInstanceOf(ServiceWithNonDecoratedDep); + expect(instance.dep).toBeUndefined(); + }); + }); + + describe('factory handling', () => { + it('should use factory when provided', () => { + const instance = Container.get(FactoryService); + expect(instance).toBeInstanceOf(CustomFactory); + expect(instance.getValue()).toBe('factory-made'); + }); + + it('should preserve factory metadata when setting instance', () => { + const customInstance = new CustomFactory(); + Container.set(FactoryService, customInstance); + const instance = Container.get(FactoryService); + expect(instance).toBe(customInstance); + }); + + it('should preserve factory when resetting container', () => { + const factoryInstance1 = Container.get(FactoryService); + Container.reset(); + const factoryInstance2 = Container.get(FactoryService); + + expect(factoryInstance1).not.toBe(factoryInstance2); + expect(factoryInstance2.getValue()).toBe('factory-made'); + }); + + it('should throw error when factory throws', () => { + @Injectable({ + factory: () => { + throw new Error('Factory error'); + }, + }) + class ErrorFactoryService {} + + expect(() => Container.get(ErrorFactoryService)).toThrow('Factory error'); + }); + }); + + describe('instance management', () => { + it('should allow manual instance setting', () => { + const customInstance = new SimpleService(); + Container.set(SimpleService, customInstance); + const instance = Container.get(SimpleService); + expect(instance).toBe(customInstance); + }); + }); + + describe('abstract classes', () => { + it('should throw when trying to instantiate an abstract class directly', () => { + @Injectable() + abstract class TestAbstractClass { + abstract doSomething(): void; + + // Add a concrete method to make the class truly abstract at runtime + constructor() { + if (this.constructor === TestAbstractClass) { + throw new TypeError('Abstract class "TestAbstractClass" cannot be instantiated'); + } + } + } + + expect(() => Container.get(TestAbstractClass)).toThrow( + '[DI] TestAbstractClass is an abstract class, and cannot be instantiated', + ); + }); + + it('should allow setting an implementation for an abstract class', () => { + const concrete = new ConcreteService(); + Container.set(AbstractService, concrete); + + const instance = Container.get(AbstractService); + expect(instance).toBe(concrete); + expect(instance.getValue()).toBe('concrete'); + }); + + it('should allow factory for abstract class', () => { + @Injectable({ factory: () => new ConcreteService() }) + abstract class FactoryAbstractService { + abstract getValue(): string; + } + + const instance = Container.get(FactoryAbstractService); + expect(instance).toBeInstanceOf(ConcreteService); + expect(instance.getValue()).toBe('concrete'); + }); + }); + + describe('inheritance', () => { + it('should handle inheritance in injectable classes', () => { + @Injectable() + class BaseService { + getValue() { + return 'base'; + } + } + + @Injectable() + class DerivedService extends BaseService { + getValue() { + return 'derived-' + super.getValue(); + } + } + + const instance = Container.get(DerivedService); + expect(instance.getValue()).toBe('derived-base'); + }); + + it('should maintain separate instances for base and derived classes', () => { + @Injectable() + class BaseService { + getValue() { + return 'base'; + } + } + + @Injectable() + class DerivedService extends BaseService {} + + const baseInstance = Container.get(BaseService); + const derivedInstance = Container.get(DerivedService); + + expect(baseInstance).not.toBe(derivedInstance); + expect(baseInstance).toBeInstanceOf(BaseService); + expect(derivedInstance).toBeInstanceOf(DerivedService); + }); + }); + + describe('type registration checking', () => { + it('should return true for registered classes', () => { + expect(Container.has(SimpleService)).toBe(true); + }); + + it('should return false for unregistered classes', () => { + class UnregisteredService {} + expect(Container.has(UnregisteredService)).toBe(false); + }); + + it('should return true for abstract classes with implementations', () => { + const concrete = new ConcreteService(); + Container.set(AbstractService, concrete); + expect(Container.has(AbstractService)).toBe(true); + }); + + it('should return true for factory-provided services before instantiation', () => { + expect(Container.has(FactoryService)).toBe(true); + }); + + it('should maintain registration after reset', () => { + expect(Container.has(SimpleService)).toBe(true); + Container.reset(); + expect(Container.has(SimpleService)).toBe(true); + }); + + it('should return true after manual instance setting', () => { + class ManualService {} + expect(Container.has(ManualService)).toBe(false); + + Container.set(ManualService, new ManualService()); + expect(Container.has(ManualService)).toBe(true); + }); + }); +}); diff --git a/packages/@n8n/di/src/di.ts b/packages/@n8n/di/src/di.ts new file mode 100644 index 0000000000000..415a99d569886 --- /dev/null +++ b/packages/@n8n/di/src/di.ts @@ -0,0 +1,147 @@ +import 'reflect-metadata'; + +/** + * Represents a class constructor type that can be instantiated with 'new' + * @template T The type of instance the constructor creates + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type Constructable = new (...args: any[]) => T; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +type AbstractConstructable = abstract new (...args: any[]) => T; + +interface Metadata { + instance?: T; + factory?: () => T; +} + +interface Options { + factory?: () => T; +} + +const instances = new Map(); + +/** + * Decorator that marks a class as available for dependency injection. + * @param options Configuration options for the injectable class + * @param options.factory Optional factory function to create instances of this class + * @returns A class decorator to be applied to the target class + */ +export function Injectable({ factory }: Options = {}): ClassDecorator { + return (target) => { + instances.set(target as unknown as Constructable, { factory }); + return target; + }; +} + +class DIError extends Error { + constructor(message: string) { + super(`[DI] ${message}`); + } +} + +class ContainerClass { + /** Stack to track types being resolved to detect circular dependencies */ + private readonly resolutionStack: Array = []; + + /** + * Checks if a type is registered in the container + * @template T The type to check for + * @param type The constructor of the type to check + * @returns True if the type is registered (has metadata), false otherwise + */ + has(type: Constructable | AbstractConstructable): boolean { + return instances.has(type); + } + + /** + * Retrieves or creates an instance of the specified type from the container + * @template T The type of instance to retrieve + * @param type The constructor of the type to retrieve + * @returns An instance of the specified type with all dependencies injected + * @throws {DIError} If circular dependencies are detected or if the type is not injectable + */ + get(type: Constructable | AbstractConstructable): T { + const { resolutionStack } = this; + // Get metadata for the requested type, including any factory or existing instance + const metadata = instances.get(type) as Metadata; + if (!metadata) { + // Special case: Allow undefined returns for non-decorated constructor params + // when resolving a dependency chain (i.e., resolutionStack not empty) + if (resolutionStack.length) return undefined as T; + throw new DIError(`${type.name} is not decorated with ${Injectable.name}`); + } + + // Return cached instance if it exists + if (metadata?.instance) return metadata.instance as T; + + // Check for circular dependencies before proceeding with instantiation + if (resolutionStack.includes(type)) { + throw new DIError( + `Circular dependency detected. ${resolutionStack.map((t) => t.name).join(' -> ')}`, + ); + } + + // Add current type to resolution stack before resolving dependencies + resolutionStack.push(type); + + try { + let instance: T; + + if (metadata?.factory) { + instance = metadata.factory(); + } else { + // Get constructor parameter types using reflect-metadata + const paramTypes = (Reflect.getMetadata('design:paramtypes', type) || + []) as Constructable[]; + // Recursively resolve all dependencies + const dependencies = paramTypes.map(

(paramType: Constructable

) => + this.get(paramType), + ); + // Create new instance with resolved dependencies + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-assignment + instance = new (type as Constructable)(...dependencies); + } + + // Cache the instance for future retrievals + instances.set(type, { ...metadata, instance }); + return instance; + } catch (error) { + if (error instanceof TypeError && error.message.toLowerCase().includes('abstract')) { + throw new DIError(`${type.name} is an abstract class, and cannot be instantiated`); + } + throw error; + } finally { + // Always remove type from stack, even if an error occurred + resolutionStack.pop(); + } + } + + /** + * Manually sets an instance for a specific type in the container + * @template T The type of instance being set + * @param type The constructor of the type to set. This can also be an abstract class + * @param instance The instance to store in the container + */ + set(type: Constructable | AbstractConstructable, instance: T): void { + // Preserve any existing metadata (like factory) when setting new instance + const metadata = instances.get(type) ?? {}; + instances.set(type, { ...metadata, instance }); + } + + /** Clears all instantiated instances from the container while preserving type registrations */ + reset(): void { + for (const metadata of instances.values()) { + delete metadata.instance; + } + } +} + +/** @deprecated Use Injectable decorator instead */ +export const Service = Injectable; + +/** + * Global dependency injection container instance + * Used to retrieve and manage class instances and their dependencies + */ +export const Container = new ContainerClass(); diff --git a/packages/@n8n/di/tsconfig.build.json b/packages/@n8n/di/tsconfig.build.json new file mode 100644 index 0000000000000..59065a1e2bab8 --- /dev/null +++ b/packages/@n8n/di/tsconfig.build.json @@ -0,0 +1,11 @@ +{ + "extends": ["./tsconfig.json", "../../../tsconfig.build.json"], + "compilerOptions": { + "composite": true, + "rootDir": "src", + "outDir": "dist", + "tsBuildInfoFile": "dist/build.tsbuildinfo" + }, + "include": ["src/**/*.ts"], + "exclude": ["src/**/__tests__/**"] +} diff --git a/packages/@n8n/di/tsconfig.json b/packages/@n8n/di/tsconfig.json new file mode 100644 index 0000000000000..efe662ed2a8d5 --- /dev/null +++ b/packages/@n8n/di/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "rootDir": ".", + "types": ["node", "jest"], + "baseUrl": "src", + "tsBuildInfoFile": "dist/typecheck.tsbuildinfo", + "experimentalDecorators": true, + "emitDecoratorMetadata": true + }, + "include": ["src/**/*.ts"] +} diff --git a/packages/@n8n/task-runner/package.json b/packages/@n8n/task-runner/package.json index 212909990e5da..9f2b0f09602f5 100644 --- a/packages/@n8n/task-runner/package.json +++ b/packages/@n8n/task-runner/package.json @@ -35,6 +35,7 @@ }, "dependencies": { "@n8n/config": "workspace:*", + "@n8n/di": "workspace:*", "@sentry/node": "catalog:", "acorn": "8.14.0", "acorn-walk": "8.3.4", @@ -42,7 +43,6 @@ "n8n-core": "workspace:*", "n8n-workflow": "workspace:*", "nanoid": "catalog:", - "typedi": "catalog:", "ws": "^8.18.0" }, "devDependencies": { diff --git a/packages/@n8n/task-runner/src/start.ts b/packages/@n8n/task-runner/src/start.ts index 93ff7422501b3..536b550d17986 100644 --- a/packages/@n8n/task-runner/src/start.ts +++ b/packages/@n8n/task-runner/src/start.ts @@ -1,7 +1,7 @@ import './polyfills'; +import { Container } from '@n8n/di'; import type { ErrorReporter } from 'n8n-core'; import { ensureError, setGlobalState } from 'n8n-workflow'; -import Container from 'typedi'; import { MainConfig } from './config/main-config'; import type { HealthCheckServer } from './health-check-server'; diff --git a/packages/cli/package.json b/packages/cli/package.json index 3afa78ebade7d..e5cbe034ab3f7 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -89,6 +89,7 @@ "@n8n/api-types": "workspace:*", "@n8n/client-oauth2": "workspace:*", "@n8n/config": "workspace:*", + "@n8n/di": "workspace:*", "@n8n/localtunnel": "3.0.0", "@n8n/n8n-nodes-langchain": "workspace:*", "@n8n/permissions": "workspace:*", @@ -165,7 +166,6 @@ "sshpk": "1.17.0", "swagger-ui-express": "5.0.1", "syslog-client": "1.1.1", - "typedi": "catalog:", "uuid": "catalog:", "validator": "13.7.0", "ws": "8.17.1", diff --git a/packages/cli/src/__tests__/workflow-execute-additional-data.test.ts b/packages/cli/src/__tests__/workflow-execute-additional-data.test.ts index 641e2393931e6..4c3af0e69646a 100644 --- a/packages/cli/src/__tests__/workflow-execute-additional-data.test.ts +++ b/packages/cli/src/__tests__/workflow-execute-additional-data.test.ts @@ -1,3 +1,4 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; import type { IWorkflowBase } from 'n8n-workflow'; import type { @@ -8,7 +9,6 @@ import type { INodeExecutionData, } from 'n8n-workflow'; import type PCancelable from 'p-cancelable'; -import Container from 'typedi'; import { ActiveExecutions } from '@/active-executions'; import { CredentialsHelper } from '@/credentials-helper'; diff --git a/packages/cli/src/__tests__/workflow-runner.test.ts b/packages/cli/src/__tests__/workflow-runner.test.ts index 683343b44ce1c..7330f85997b48 100644 --- a/packages/cli/src/__tests__/workflow-runner.test.ts +++ b/packages/cli/src/__tests__/workflow-runner.test.ts @@ -1,3 +1,4 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; import { DirectedGraph, WorkflowExecute } from 'n8n-core'; import * as core from 'n8n-core'; @@ -18,7 +19,6 @@ import { type IWorkflowExecuteHooks, } from 'n8n-workflow'; import PCancelable from 'p-cancelable'; -import Container from 'typedi'; import { ActiveExecutions } from '@/active-executions'; import config from '@/config'; diff --git a/packages/cli/src/abstract-server.ts b/packages/cli/src/abstract-server.ts index aadd41fb051f5..a9340b0a87fe6 100644 --- a/packages/cli/src/abstract-server.ts +++ b/packages/cli/src/abstract-server.ts @@ -1,4 +1,5 @@ import { GlobalConfig } from '@n8n/config'; +import { Container, Service } from '@n8n/di'; import compression from 'compression'; import express from 'express'; import { engine as expressHandlebars } from 'express-handlebars'; @@ -6,7 +7,6 @@ import { readFile } from 'fs/promises'; import type { Server } from 'http'; import isbot from 'isbot'; import { Logger } from 'n8n-core'; -import { Container, Service } from 'typedi'; import config from '@/config'; import { N8N_VERSION, TEMPLATES_DIR, inDevelopment, inTest } from '@/constants'; diff --git a/packages/cli/src/activation-errors.service.ts b/packages/cli/src/activation-errors.service.ts index 9ddcad9317d4e..1d1bb349aa6a2 100644 --- a/packages/cli/src/activation-errors.service.ts +++ b/packages/cli/src/activation-errors.service.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import { CacheService } from '@/services/cache/cache.service'; diff --git a/packages/cli/src/active-executions.ts b/packages/cli/src/active-executions.ts index a3fdcf6fee644..9056271f644c9 100644 --- a/packages/cli/src/active-executions.ts +++ b/packages/cli/src/active-executions.ts @@ -1,3 +1,4 @@ +import { Service } from '@n8n/di'; import { Logger } from 'n8n-core'; import type { IDeferredPromise, @@ -9,7 +10,6 @@ import type { import { createDeferredPromise, ExecutionCancelledError, sleep } from 'n8n-workflow'; import { strict as assert } from 'node:assert'; import type PCancelable from 'p-cancelable'; -import { Service } from 'typedi'; import { ExecutionRepository } from '@/databases/repositories/execution.repository'; import { ExecutionNotFoundError } from '@/errors/execution-not-found-error'; diff --git a/packages/cli/src/active-workflow-manager.ts b/packages/cli/src/active-workflow-manager.ts index 368e2987c80aa..a002bc405436d 100644 --- a/packages/cli/src/active-workflow-manager.ts +++ b/packages/cli/src/active-workflow-manager.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ +import { Service } from '@n8n/di'; import { ActiveWorkflows, ErrorReporter, @@ -28,7 +29,6 @@ import { WebhookPathTakenError, ApplicationError, } from 'n8n-workflow'; -import { Service } from 'typedi'; import { ActivationErrorsService } from '@/activation-errors.service'; import { ActiveExecutions } from '@/active-executions'; diff --git a/packages/cli/src/auth/auth.service.ts b/packages/cli/src/auth/auth.service.ts index 3a2e4fb0cb127..190f788ba217a 100644 --- a/packages/cli/src/auth/auth.service.ts +++ b/packages/cli/src/auth/auth.service.ts @@ -1,9 +1,9 @@ import { GlobalConfig } from '@n8n/config'; +import { Container, Service } from '@n8n/di'; import { createHash } from 'crypto'; import type { NextFunction, Response } from 'express'; import { JsonWebTokenError, TokenExpiredError } from 'jsonwebtoken'; import { Logger } from 'n8n-core'; -import Container, { Service } from 'typedi'; import config from '@/config'; import { AUTH_COOKIE_NAME, RESPONSE_ERROR_MESSAGES, Time } from '@/constants'; diff --git a/packages/cli/src/auth/jwt.ts b/packages/cli/src/auth/jwt.ts index 63255f5f66fb1..0e35263462168 100644 --- a/packages/cli/src/auth/jwt.ts +++ b/packages/cli/src/auth/jwt.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import type { Response } from 'express'; -import { Container } from 'typedi'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/auth/methods/email.ts b/packages/cli/src/auth/methods/email.ts index 6f378e4357a89..61f344afaf4be 100644 --- a/packages/cli/src/auth/methods/email.ts +++ b/packages/cli/src/auth/methods/email.ts @@ -1,4 +1,4 @@ -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import type { User } from '@/databases/entities/user'; import { UserRepository } from '@/databases/repositories/user.repository'; diff --git a/packages/cli/src/auth/methods/ldap.ts b/packages/cli/src/auth/methods/ldap.ts index f067994215424..5466d0d8cb5ef 100644 --- a/packages/cli/src/auth/methods/ldap.ts +++ b/packages/cli/src/auth/methods/ldap.ts @@ -1,4 +1,4 @@ -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import type { User } from '@/databases/entities/user'; import { EventService } from '@/events/event.service'; diff --git a/packages/cli/src/collaboration/collaboration.service.ts b/packages/cli/src/collaboration/collaboration.service.ts index a6e957f510be2..9b2f3dec8ed65 100644 --- a/packages/cli/src/collaboration/collaboration.service.ts +++ b/packages/cli/src/collaboration/collaboration.service.ts @@ -1,8 +1,8 @@ import type { PushPayload } from '@n8n/api-types'; +import { Service } from '@n8n/di'; import { ErrorReporter } from 'n8n-core'; import type { Workflow } from 'n8n-workflow'; import { ApplicationError } from 'n8n-workflow'; -import { Service } from 'typedi'; import { CollaborationState } from '@/collaboration/collaboration.state'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/collaboration/collaboration.state.ts b/packages/cli/src/collaboration/collaboration.state.ts index 556dee2ace4e7..f2a3b31f245c9 100644 --- a/packages/cli/src/collaboration/collaboration.state.ts +++ b/packages/cli/src/collaboration/collaboration.state.ts @@ -1,6 +1,6 @@ import type { Iso8601DateTimeString } from '@n8n/api-types'; +import { Service } from '@n8n/di'; import type { Workflow } from 'n8n-workflow'; -import { Service } from 'typedi'; import { Time } from '@/constants'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/commands/audit.ts b/packages/cli/src/commands/audit.ts index e98bb8bce026d..1bd76bc4ed54d 100644 --- a/packages/cli/src/commands/audit.ts +++ b/packages/cli/src/commands/audit.ts @@ -1,7 +1,7 @@ import { SecurityConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import { Flags } from '@oclif/core'; import { ApplicationError } from 'n8n-workflow'; -import { Container } from 'typedi'; import { RISK_CATEGORIES } from '@/security-audit/constants'; import { SecurityAuditService } from '@/security-audit/security-audit.service'; diff --git a/packages/cli/src/commands/base-command.ts b/packages/cli/src/commands/base-command.ts index 7692ef79bed40..56799c508935a 100644 --- a/packages/cli/src/commands/base-command.ts +++ b/packages/cli/src/commands/base-command.ts @@ -1,5 +1,6 @@ import 'reflect-metadata'; import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import { Command, Errors } from '@oclif/core'; import { BinaryDataService, @@ -10,7 +11,6 @@ import { ErrorReporter, } from 'n8n-core'; import { ApplicationError, ensureError, sleep } from 'n8n-workflow'; -import { Container } from 'typedi'; import type { AbstractServer } from '@/abstract-server'; import config from '@/config'; diff --git a/packages/cli/src/commands/db/revert.ts b/packages/cli/src/commands/db/revert.ts index bc9e0f6b3f467..57780d4620971 100644 --- a/packages/cli/src/commands/db/revert.ts +++ b/packages/cli/src/commands/db/revert.ts @@ -1,10 +1,10 @@ +import { Container } from '@n8n/di'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import type { DataSourceOptions as ConnectionOptions } from '@n8n/typeorm'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import { MigrationExecutor, DataSource as Connection } from '@n8n/typeorm'; import { Command, Flags } from '@oclif/core'; import { Logger } from 'n8n-core'; -import { Container } from 'typedi'; import { getConnectionOptions } from '@/databases/config'; import type { Migration } from '@/databases/types'; diff --git a/packages/cli/src/commands/execute-batch.ts b/packages/cli/src/commands/execute-batch.ts index 0b19e256525e5..883cd7068d646 100644 --- a/packages/cli/src/commands/execute-batch.ts +++ b/packages/cli/src/commands/execute-batch.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-loop-func */ +import { Container } from '@n8n/di'; import { Flags } from '@oclif/core'; import fs from 'fs'; import { diff } from 'json-diff'; @@ -7,7 +8,6 @@ import type { IRun, ITaskData, IWorkflowExecutionDataProcess } from 'n8n-workflo import { ApplicationError, jsonParse } from 'n8n-workflow'; import os from 'os'; import { sep } from 'path'; -import { Container } from 'typedi'; import { ActiveExecutions } from '@/active-executions'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/commands/execute.ts b/packages/cli/src/commands/execute.ts index fd49a2b6191f5..786b91f7fc55a 100644 --- a/packages/cli/src/commands/execute.ts +++ b/packages/cli/src/commands/execute.ts @@ -1,7 +1,7 @@ +import { Container } from '@n8n/di'; import { Flags } from '@oclif/core'; import type { IWorkflowBase, IWorkflowExecutionDataProcess } from 'n8n-workflow'; import { ApplicationError, ExecutionBaseError } from 'n8n-workflow'; -import { Container } from 'typedi'; import { ActiveExecutions } from '@/active-executions'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; diff --git a/packages/cli/src/commands/export/credentials.ts b/packages/cli/src/commands/export/credentials.ts index 4644c2556cade..ad0b5784c14ab 100644 --- a/packages/cli/src/commands/export/credentials.ts +++ b/packages/cli/src/commands/export/credentials.ts @@ -1,9 +1,9 @@ +import { Container } from '@n8n/di'; import { Flags } from '@oclif/core'; import fs from 'fs'; import { Credentials } from 'n8n-core'; import { ApplicationError } from 'n8n-workflow'; import path from 'path'; -import Container from 'typedi'; import { CredentialsRepository } from '@/databases/repositories/credentials.repository'; import type { ICredentialsDb, ICredentialsDecryptedDb } from '@/interfaces'; diff --git a/packages/cli/src/commands/export/workflow.ts b/packages/cli/src/commands/export/workflow.ts index 8e129eec4d7e3..3fa0f1e0468ce 100644 --- a/packages/cli/src/commands/export/workflow.ts +++ b/packages/cli/src/commands/export/workflow.ts @@ -1,8 +1,8 @@ +import { Container } from '@n8n/di'; import { Flags } from '@oclif/core'; import fs from 'fs'; import { ApplicationError } from 'n8n-workflow'; import path from 'path'; -import Container from 'typedi'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; diff --git a/packages/cli/src/commands/import/credentials.ts b/packages/cli/src/commands/import/credentials.ts index 5f9e06f256440..aae6c7d23e941 100644 --- a/packages/cli/src/commands/import/credentials.ts +++ b/packages/cli/src/commands/import/credentials.ts @@ -1,3 +1,4 @@ +import { Container } from '@n8n/di'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import type { EntityManager } from '@n8n/typeorm'; import { Flags } from '@oclif/core'; @@ -6,7 +7,6 @@ import fs from 'fs'; import { Cipher } from 'n8n-core'; import type { ICredentialsEncrypted } from 'n8n-workflow'; import { ApplicationError, jsonParse } from 'n8n-workflow'; -import { Container } from 'typedi'; import { UM_FIX_INSTRUCTION } from '@/constants'; import { CredentialsEntity } from '@/databases/entities/credentials-entity'; diff --git a/packages/cli/src/commands/import/workflow.ts b/packages/cli/src/commands/import/workflow.ts index 2548ca9523362..d8813485a1036 100644 --- a/packages/cli/src/commands/import/workflow.ts +++ b/packages/cli/src/commands/import/workflow.ts @@ -1,8 +1,8 @@ +import { Container } from '@n8n/di'; import { Flags } from '@oclif/core'; import glob from 'fast-glob'; import fs from 'fs'; import { ApplicationError, jsonParse } from 'n8n-workflow'; -import { Container } from 'typedi'; import { UM_FIX_INSTRUCTION } from '@/constants'; import type { WorkflowEntity } from '@/databases/entities/workflow-entity'; diff --git a/packages/cli/src/commands/ldap/reset.ts b/packages/cli/src/commands/ldap/reset.ts index 6aaaa217d60ce..edbf9884340a0 100644 --- a/packages/cli/src/commands/ldap/reset.ts +++ b/packages/cli/src/commands/ldap/reset.ts @@ -1,8 +1,8 @@ +import { Container } from '@n8n/di'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import { In } from '@n8n/typeorm'; import { Flags } from '@oclif/core'; import { ApplicationError } from 'n8n-workflow'; -import Container from 'typedi'; import { UM_FIX_INSTRUCTION } from '@/constants'; import { CredentialsService } from '@/credentials/credentials.service'; diff --git a/packages/cli/src/commands/license/clear.ts b/packages/cli/src/commands/license/clear.ts index 427a150ebb0c1..03a2ea4dd4726 100644 --- a/packages/cli/src/commands/license/clear.ts +++ b/packages/cli/src/commands/license/clear.ts @@ -1,4 +1,4 @@ -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import { SETTINGS_LICENSE_CERT_KEY } from '@/constants'; import { SettingsRepository } from '@/databases/repositories/settings.repository'; diff --git a/packages/cli/src/commands/license/info.ts b/packages/cli/src/commands/license/info.ts index 5f3e31a573b59..cc99e925f7165 100644 --- a/packages/cli/src/commands/license/info.ts +++ b/packages/cli/src/commands/license/info.ts @@ -1,4 +1,4 @@ -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import { License } from '@/license'; diff --git a/packages/cli/src/commands/list/workflow.ts b/packages/cli/src/commands/list/workflow.ts index 39f5689fcc9dc..74f5916b5c350 100644 --- a/packages/cli/src/commands/list/workflow.ts +++ b/packages/cli/src/commands/list/workflow.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { Flags } from '@oclif/core'; -import Container from 'typedi'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; diff --git a/packages/cli/src/commands/mfa/disable.ts b/packages/cli/src/commands/mfa/disable.ts index 3458593252fb0..a739fbda88170 100644 --- a/packages/cli/src/commands/mfa/disable.ts +++ b/packages/cli/src/commands/mfa/disable.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { Flags } from '@oclif/core'; -import Container from 'typedi'; import { AuthUserRepository } from '@/databases/repositories/auth-user.repository'; diff --git a/packages/cli/src/commands/start.ts b/packages/cli/src/commands/start.ts index 63ec3d9240dfa..c26eaafa8271a 100644 --- a/packages/cli/src/commands/start.ts +++ b/packages/cli/src/commands/start.ts @@ -1,6 +1,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import { Flags } from '@oclif/core'; import glob from 'fast-glob'; import { createReadStream, createWriteStream, existsSync } from 'fs'; @@ -9,7 +10,6 @@ import { jsonParse, randomString, type IWorkflowExecutionDataProcess } from 'n8n import path from 'path'; import replaceStream from 'replacestream'; import { pipeline } from 'stream/promises'; -import { Container } from 'typedi'; import { ActiveExecutions } from '@/active-executions'; import { ActiveWorkflowManager } from '@/active-workflow-manager'; diff --git a/packages/cli/src/commands/update/workflow.ts b/packages/cli/src/commands/update/workflow.ts index 6c88ed6c43b55..903d6c9405863 100644 --- a/packages/cli/src/commands/update/workflow.ts +++ b/packages/cli/src/commands/update/workflow.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { Flags } from '@oclif/core'; -import { Container } from 'typedi'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; diff --git a/packages/cli/src/commands/user-management/reset.ts b/packages/cli/src/commands/user-management/reset.ts index 3c6709e80214a..3e8a1c14f1edd 100644 --- a/packages/cli/src/commands/user-management/reset.ts +++ b/packages/cli/src/commands/user-management/reset.ts @@ -1,4 +1,4 @@ -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import type { CredentialsEntity } from '@/databases/entities/credentials-entity'; import { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/commands/webhook.ts b/packages/cli/src/commands/webhook.ts index 77ec770aa0845..8b6f318576183 100644 --- a/packages/cli/src/commands/webhook.ts +++ b/packages/cli/src/commands/webhook.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import { Flags } from '@oclif/core'; import { ApplicationError } from 'n8n-workflow'; -import { Container } from 'typedi'; import { ActiveExecutions } from '@/active-executions'; import config from '@/config'; diff --git a/packages/cli/src/commands/worker.ts b/packages/cli/src/commands/worker.ts index ac413077d2f36..3819591e44b8b 100644 --- a/packages/cli/src/commands/worker.ts +++ b/packages/cli/src/commands/worker.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { Flags, type Config } from '@oclif/core'; -import { Container } from 'typedi'; import config from '@/config'; import { N8N_VERSION, inTest } from '@/constants'; diff --git a/packages/cli/src/concurrency/concurrency-control.service.ts b/packages/cli/src/concurrency/concurrency-control.service.ts index ede6cf899748b..6088d0f4c3bdd 100644 --- a/packages/cli/src/concurrency/concurrency-control.service.ts +++ b/packages/cli/src/concurrency/concurrency-control.service.ts @@ -1,6 +1,6 @@ +import { Service } from '@n8n/di'; import { Logger } from 'n8n-core'; import type { WorkflowExecuteMode as ExecutionMode } from 'n8n-workflow'; -import { Service } from 'typedi'; import config from '@/config'; import { ExecutionRepository } from '@/databases/repositories/execution.repository'; diff --git a/packages/cli/src/concurrency/concurrency-queue.ts b/packages/cli/src/concurrency/concurrency-queue.ts index c4c482226c20a..900018889aab8 100644 --- a/packages/cli/src/concurrency/concurrency-queue.ts +++ b/packages/cli/src/concurrency/concurrency-queue.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import { TypedEmitter } from '@/typed-emitter'; diff --git a/packages/cli/src/config/index.ts b/packages/cli/src/config/index.ts index 1ba49a1ef4ce1..8839d180ff16b 100644 --- a/packages/cli/src/config/index.ts +++ b/packages/cli/src/config/index.ts @@ -1,4 +1,5 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import convict from 'convict'; import { flatten } from 'flat'; import { readFileSync } from 'fs'; @@ -7,7 +8,6 @@ import { Logger } from 'n8n-core'; import { ApplicationError, setGlobalState } from 'n8n-workflow'; import assert from 'node:assert'; import colors from 'picocolors'; -import { Container } from 'typedi'; import { inTest, inE2ETests } from '@/constants'; diff --git a/packages/cli/src/config/schema.ts b/packages/cli/src/config/schema.ts index e8d28cb782e7c..e5bda7d81b204 100644 --- a/packages/cli/src/config/schema.ts +++ b/packages/cli/src/config/schema.ts @@ -1,8 +1,8 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import convict from 'convict'; import { InstanceSettings } from 'n8n-core'; import path from 'path'; -import { Container } from 'typedi'; import { ensureStringArray } from './utils'; diff --git a/packages/cli/src/controllers/__tests__/api-keys.controller.test.ts b/packages/cli/src/controllers/__tests__/api-keys.controller.test.ts index 3f34fc1d2cecb..dc40d3357d956 100644 --- a/packages/cli/src/controllers/__tests__/api-keys.controller.test.ts +++ b/packages/cli/src/controllers/__tests__/api-keys.controller.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; -import { Container } from 'typedi'; import type { ApiKey } from '@/databases/entities/api-key'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/controllers/__tests__/me.controller.test.ts b/packages/cli/src/controllers/__tests__/me.controller.test.ts index 37c391a2dcbbc..9ba6f8ada70ae 100644 --- a/packages/cli/src/controllers/__tests__/me.controller.test.ts +++ b/packages/cli/src/controllers/__tests__/me.controller.test.ts @@ -1,8 +1,8 @@ import { UserUpdateRequestDto } from '@n8n/api-types'; +import { Container } from '@n8n/di'; import type { Response } from 'express'; import { mock, anyObject } from 'jest-mock-extended'; import jwt from 'jsonwebtoken'; -import { Container } from 'typedi'; import { AUTH_COOKIE_NAME } from '@/constants'; import { MeController } from '@/controllers/me.controller'; diff --git a/packages/cli/src/controllers/e2e.controller.ts b/packages/cli/src/controllers/e2e.controller.ts index aa0226c754892..c846553d30d81 100644 --- a/packages/cli/src/controllers/e2e.controller.ts +++ b/packages/cli/src/controllers/e2e.controller.ts @@ -1,7 +1,7 @@ import type { PushMessage } from '@n8n/api-types'; +import { Container } from '@n8n/di'; import { Request } from 'express'; import { Logger } from 'n8n-core'; -import Container from 'typedi'; import { v4 as uuid } from 'uuid'; import { ActiveWorkflowManager } from '@/active-workflow-manager'; diff --git a/packages/cli/src/controllers/oauth/__tests__/oauth1-credential.controller.test.ts b/packages/cli/src/controllers/oauth/__tests__/oauth1-credential.controller.test.ts index 0c51f29f22f64..570181aa78fed 100644 --- a/packages/cli/src/controllers/oauth/__tests__/oauth1-credential.controller.test.ts +++ b/packages/cli/src/controllers/oauth/__tests__/oauth1-credential.controller.test.ts @@ -1,10 +1,10 @@ +import { Container } from '@n8n/di'; import Csrf from 'csrf'; import type { Response } from 'express'; import { mock } from 'jest-mock-extended'; import { Cipher } from 'n8n-core'; import { Logger } from 'n8n-core'; import nock from 'nock'; -import Container from 'typedi'; import { Time } from '@/constants'; import { OAuth1CredentialController } from '@/controllers/oauth/oauth1-credential.controller'; diff --git a/packages/cli/src/controllers/oauth/__tests__/oauth2-credential.controller.test.ts b/packages/cli/src/controllers/oauth/__tests__/oauth2-credential.controller.test.ts index c1c240425e65e..53bba08c58f1e 100644 --- a/packages/cli/src/controllers/oauth/__tests__/oauth2-credential.controller.test.ts +++ b/packages/cli/src/controllers/oauth/__tests__/oauth2-credential.controller.test.ts @@ -1,10 +1,10 @@ +import { Container } from '@n8n/di'; import Csrf from 'csrf'; import { type Response } from 'express'; import { mock } from 'jest-mock-extended'; import { Cipher } from 'n8n-core'; import { Logger } from 'n8n-core'; import nock from 'nock'; -import Container from 'typedi'; import { Time } from '@/constants'; import { OAuth2CredentialController } from '@/controllers/oauth/oauth2-credential.controller'; diff --git a/packages/cli/src/controllers/oauth/abstract-oauth.controller.ts b/packages/cli/src/controllers/oauth/abstract-oauth.controller.ts index 97fb7be24af28..bac924a0239f9 100644 --- a/packages/cli/src/controllers/oauth/abstract-oauth.controller.ts +++ b/packages/cli/src/controllers/oauth/abstract-oauth.controller.ts @@ -1,10 +1,10 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import Csrf from 'csrf'; import type { Response } from 'express'; import { Credentials, Logger } from 'n8n-core'; import type { ICredentialDataDecryptedObject, IWorkflowExecuteAdditionalData } from 'n8n-workflow'; import { jsonParse, ApplicationError } from 'n8n-workflow'; -import { Service } from 'typedi'; import { RESPONSE_ERROR_MESSAGES, Time } from '@/constants'; import { CredentialsHelper } from '@/credentials-helper'; diff --git a/packages/cli/src/crash-journal.ts b/packages/cli/src/crash-journal.ts index 8afae1e88c96a..93f7b2e737689 100644 --- a/packages/cli/src/crash-journal.ts +++ b/packages/cli/src/crash-journal.ts @@ -1,9 +1,9 @@ +import { Container } from '@n8n/di'; import { existsSync } from 'fs'; import { mkdir, utimes, open, rm } from 'fs/promises'; import { InstanceSettings, Logger } from 'n8n-core'; import { sleep } from 'n8n-workflow'; import { join, dirname } from 'path'; -import { Container } from 'typedi'; import { inProduction } from '@/constants'; diff --git a/packages/cli/src/credential-types.ts b/packages/cli/src/credential-types.ts index a6d3f29eb0035..5720b7cdbe2cc 100644 --- a/packages/cli/src/credential-types.ts +++ b/packages/cli/src/credential-types.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import type { ICredentialType, ICredentialTypes } from 'n8n-workflow'; -import { Service } from 'typedi'; import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials'; diff --git a/packages/cli/src/credentials-helper.ts b/packages/cli/src/credentials-helper.ts index 967ee9efe4dac..4c869222b51eb 100644 --- a/packages/cli/src/credentials-helper.ts +++ b/packages/cli/src/credentials-helper.ts @@ -2,6 +2,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-return */ +import { Service } from '@n8n/di'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import { In } from '@n8n/typeorm'; import { Credentials, getAdditionalKeys } from 'n8n-core'; @@ -26,7 +27,6 @@ import type { IDataObject, } from 'n8n-workflow'; import { ICredentialsHelper, NodeHelpers, Workflow, ApplicationError } from 'n8n-workflow'; -import { Service } from 'typedi'; import { CredentialTypes } from '@/credential-types'; import { CredentialsOverwrites } from '@/credentials-overwrites'; diff --git a/packages/cli/src/credentials-overwrites.ts b/packages/cli/src/credentials-overwrites.ts index 30f6bedfb8ba0..6689649b0fe34 100644 --- a/packages/cli/src/credentials-overwrites.ts +++ b/packages/cli/src/credentials-overwrites.ts @@ -1,8 +1,8 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import { Logger } from 'n8n-core'; import type { ICredentialDataDecryptedObject } from 'n8n-workflow'; import { deepCopy, jsonParse } from 'n8n-workflow'; -import { Service } from 'typedi'; import { CredentialTypes } from '@/credential-types'; import type { ICredentialsOverwrite } from '@/interfaces'; diff --git a/packages/cli/src/credentials/credentials.service.ee.ts b/packages/cli/src/credentials/credentials.service.ee.ts index 274feff81b6c4..189ace3c43718 100644 --- a/packages/cli/src/credentials/credentials.service.ee.ts +++ b/packages/cli/src/credentials/credentials.service.ee.ts @@ -1,7 +1,7 @@ +import { Service } from '@n8n/di'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import { In, type EntityManager } from '@n8n/typeorm'; import type { ICredentialDataDecryptedObject } from 'n8n-workflow'; -import { Service } from 'typedi'; import type { CredentialsEntity } from '@/databases/entities/credentials-entity'; import { Project } from '@/databases/entities/project'; diff --git a/packages/cli/src/credentials/credentials.service.ts b/packages/cli/src/credentials/credentials.service.ts index 84398b5475776..43b68c36508ec 100644 --- a/packages/cli/src/credentials/credentials.service.ts +++ b/packages/cli/src/credentials/credentials.service.ts @@ -1,3 +1,4 @@ +import { Service } from '@n8n/di'; import type { Scope } from '@n8n/permissions'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import { @@ -14,7 +15,6 @@ import type { INodeProperties, } from 'n8n-workflow'; import { ApplicationError, CREDENTIAL_EMPTY_VALUE, deepCopy, NodeHelpers } from 'n8n-workflow'; -import { Service } from 'typedi'; import { CREDENTIAL_BLANKING_VALUE } from '@/constants'; import { CredentialTypes } from '@/credential-types'; diff --git a/packages/cli/src/databases/config.ts b/packages/cli/src/databases/config.ts index 8845bd0b13f66..45348e0079a5d 100644 --- a/packages/cli/src/databases/config.ts +++ b/packages/cli/src/databases/config.ts @@ -1,4 +1,5 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import type { DataSourceOptions, LoggerOptions } from '@n8n/typeorm'; import type { MysqlConnectionOptions } from '@n8n/typeorm/driver/mysql/MysqlConnectionOptions'; import type { PostgresConnectionOptions } from '@n8n/typeorm/driver/postgres/PostgresConnectionOptions'; @@ -8,7 +9,6 @@ import { InstanceSettings } from 'n8n-core'; import { ApplicationError } from 'n8n-workflow'; import path from 'path'; import type { TlsOptions } from 'tls'; -import { Container } from 'typedi'; import { entities } from './entities'; import { mysqlMigrations } from './migrations/mysqldb'; diff --git a/packages/cli/src/databases/entities/abstract-entity.ts b/packages/cli/src/databases/entities/abstract-entity.ts index 0626a5621f83a..ac16b55bf560e 100644 --- a/packages/cli/src/databases/entities/abstract-entity.ts +++ b/packages/cli/src/databases/entities/abstract-entity.ts @@ -1,4 +1,5 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import type { ColumnOptions } from '@n8n/typeorm'; import { BeforeInsert, @@ -8,7 +9,6 @@ import { UpdateDateColumn, } from '@n8n/typeorm'; import type { Class } from 'n8n-core'; -import { Container } from 'typedi'; import { generateNanoId } from '../utils/generators'; diff --git a/packages/cli/src/databases/migrations/common/1711390882123-MoveSshKeysToDatabase.ts b/packages/cli/src/databases/migrations/common/1711390882123-MoveSshKeysToDatabase.ts index f8d4eb60a907b..2db009da071f3 100644 --- a/packages/cli/src/databases/migrations/common/1711390882123-MoveSshKeysToDatabase.ts +++ b/packages/cli/src/databases/migrations/common/1711390882123-MoveSshKeysToDatabase.ts @@ -1,8 +1,8 @@ +import { Container } from '@n8n/di'; import { Cipher, InstanceSettings } from 'n8n-core'; import { jsonParse } from 'n8n-workflow'; import { readFile, writeFile, rm } from 'node:fs/promises'; import path from 'node:path'; -import Container from 'typedi'; import type { MigrationContext, ReversibleMigration } from '@/databases/types'; diff --git a/packages/cli/src/databases/migrations/sqlite/1690000000002-MigrateIntegerKeysToString.ts b/packages/cli/src/databases/migrations/sqlite/1690000000002-MigrateIntegerKeysToString.ts index 99cbef5aac474..1c72db35eddd6 100644 --- a/packages/cli/src/databases/migrations/sqlite/1690000000002-MigrateIntegerKeysToString.ts +++ b/packages/cli/src/databases/migrations/sqlite/1690000000002-MigrateIntegerKeysToString.ts @@ -1,8 +1,8 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import { statSync } from 'fs'; import { InstanceSettings } from 'n8n-core'; import path from 'path'; -import { Container } from 'typedi'; import type { MigrationContext, IrreversibleMigration } from '@/databases/types'; diff --git a/packages/cli/src/databases/repositories/__tests__/execution.repository.test.ts b/packages/cli/src/databases/repositories/__tests__/execution.repository.test.ts index 10d1371f379d3..8e36f0189b644 100644 --- a/packages/cli/src/databases/repositories/__tests__/execution.repository.test.ts +++ b/packages/cli/src/databases/repositories/__tests__/execution.repository.test.ts @@ -1,10 +1,10 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import type { SelectQueryBuilder } from '@n8n/typeorm'; import { Not, LessThanOrEqual } from '@n8n/typeorm'; import { mock } from 'jest-mock-extended'; import { BinaryDataService } from 'n8n-core'; import { nanoid } from 'nanoid'; -import Container from 'typedi'; import { ExecutionEntity } from '@/databases/entities/execution-entity'; import { ExecutionRepository } from '@/databases/repositories/execution.repository'; diff --git a/packages/cli/src/databases/repositories/__tests__/shared-credentials.repository.test.ts b/packages/cli/src/databases/repositories/__tests__/shared-credentials.repository.test.ts index 5f8b441235c2f..d7e108389ad73 100644 --- a/packages/cli/src/databases/repositories/__tests__/shared-credentials.repository.test.ts +++ b/packages/cli/src/databases/repositories/__tests__/shared-credentials.repository.test.ts @@ -1,7 +1,7 @@ +import { Container } from '@n8n/di'; import { hasScope } from '@n8n/permissions'; import { In } from '@n8n/typeorm'; import { mock } from 'jest-mock-extended'; -import { Container } from 'typedi'; import type { CredentialsEntity } from '@/databases/entities/credentials-entity'; import { SharedCredentials } from '@/databases/entities/shared-credentials'; diff --git a/packages/cli/src/databases/repositories/__tests__/workflow-statistics.test.ts b/packages/cli/src/databases/repositories/__tests__/workflow-statistics.test.ts index 202938e526d50..b1d36b0263a0a 100644 --- a/packages/cli/src/databases/repositories/__tests__/workflow-statistics.test.ts +++ b/packages/cli/src/databases/repositories/__tests__/workflow-statistics.test.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import { type InsertResult, QueryFailedError } from '@n8n/typeorm'; import { mock, mockClear } from 'jest-mock-extended'; -import { Container } from 'typedi'; import { StatisticsNames, WorkflowStatistics } from '@/databases/entities/workflow-statistics'; import { WorkflowStatisticsRepository } from '@/databases/repositories/workflow-statistics.repository'; diff --git a/packages/cli/src/databases/repositories/annotation-tag-mapping.repository.ee.ts b/packages/cli/src/databases/repositories/annotation-tag-mapping.repository.ee.ts index 07bb79815b93b..7f1039c3a19e7 100644 --- a/packages/cli/src/databases/repositories/annotation-tag-mapping.repository.ee.ts +++ b/packages/cli/src/databases/repositories/annotation-tag-mapping.repository.ee.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { DataSource, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { AnnotationTagMapping } from '@/databases/entities/annotation-tag-mapping.ee'; diff --git a/packages/cli/src/databases/repositories/annotation-tag.repository.ee.ts b/packages/cli/src/databases/repositories/annotation-tag.repository.ee.ts index e3aa99346012f..3f4d5c161ffc4 100644 --- a/packages/cli/src/databases/repositories/annotation-tag.repository.ee.ts +++ b/packages/cli/src/databases/repositories/annotation-tag.repository.ee.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { DataSource, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity.ee'; diff --git a/packages/cli/src/databases/repositories/api-key.repository.ts b/packages/cli/src/databases/repositories/api-key.repository.ts index 21ad2c3e40f2a..b24a8984dc1a3 100644 --- a/packages/cli/src/databases/repositories/api-key.repository.ts +++ b/packages/cli/src/databases/repositories/api-key.repository.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { DataSource, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { ApiKey } from '../entities/api-key'; diff --git a/packages/cli/src/databases/repositories/auth-identity.repository.ts b/packages/cli/src/databases/repositories/auth-identity.repository.ts index 349fe29cd5b41..1036994680798 100644 --- a/packages/cli/src/databases/repositories/auth-identity.repository.ts +++ b/packages/cli/src/databases/repositories/auth-identity.repository.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { DataSource, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { AuthIdentity } from '../entities/auth-identity'; diff --git a/packages/cli/src/databases/repositories/auth-provider-sync-history.repository.ts b/packages/cli/src/databases/repositories/auth-provider-sync-history.repository.ts index d4c5d50b5a759..6f217e74549ee 100644 --- a/packages/cli/src/databases/repositories/auth-provider-sync-history.repository.ts +++ b/packages/cli/src/databases/repositories/auth-provider-sync-history.repository.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { DataSource, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { AuthProviderSyncHistory } from '../entities/auth-provider-sync-history'; diff --git a/packages/cli/src/databases/repositories/auth-user.repository.ts b/packages/cli/src/databases/repositories/auth-user.repository.ts index 0d94fc9ba64b7..c5a06d9b66ce7 100644 --- a/packages/cli/src/databases/repositories/auth-user.repository.ts +++ b/packages/cli/src/databases/repositories/auth-user.repository.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { DataSource, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { AuthUser } from '../entities/auth-user'; diff --git a/packages/cli/src/databases/repositories/credentials.repository.ts b/packages/cli/src/databases/repositories/credentials.repository.ts index e5aecf1069f0e..9e307ee5c7a56 100644 --- a/packages/cli/src/databases/repositories/credentials.repository.ts +++ b/packages/cli/src/databases/repositories/credentials.repository.ts @@ -1,7 +1,7 @@ +import { Service } from '@n8n/di'; import type { Scope } from '@n8n/permissions'; import { DataSource, In, Repository, Like } from '@n8n/typeorm'; import type { FindManyOptions, FindOptionsWhere } from '@n8n/typeorm'; -import { Service } from 'typedi'; import type { ListQuery } from '@/requests'; import { RoleService } from '@/services/role.service'; diff --git a/packages/cli/src/databases/repositories/event-destinations.repository.ts b/packages/cli/src/databases/repositories/event-destinations.repository.ts index 56a2ab0f9043f..2af7bca8bbad4 100644 --- a/packages/cli/src/databases/repositories/event-destinations.repository.ts +++ b/packages/cli/src/databases/repositories/event-destinations.repository.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { DataSource, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { EventDestinations } from '../entities/event-destinations'; diff --git a/packages/cli/src/databases/repositories/execution-annotation.repository.ts b/packages/cli/src/databases/repositories/execution-annotation.repository.ts index 97ca972733807..a8329669f98ee 100644 --- a/packages/cli/src/databases/repositories/execution-annotation.repository.ts +++ b/packages/cli/src/databases/repositories/execution-annotation.repository.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { DataSource, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { ExecutionAnnotation } from '@/databases/entities/execution-annotation.ee'; diff --git a/packages/cli/src/databases/repositories/execution-data.repository.ts b/packages/cli/src/databases/repositories/execution-data.repository.ts index f7de742941b28..75463fd0f5104 100644 --- a/packages/cli/src/databases/repositories/execution-data.repository.ts +++ b/packages/cli/src/databases/repositories/execution-data.repository.ts @@ -1,7 +1,7 @@ +import { Service } from '@n8n/di'; import { DataSource, In, Repository } from '@n8n/typeorm'; import type { EntityManager } from '@n8n/typeorm'; import type { QueryDeepPartialEntity } from '@n8n/typeorm/query-builder/QueryPartialEntity'; -import { Service } from 'typedi'; import { ExecutionData } from '../entities/execution-data'; diff --git a/packages/cli/src/databases/repositories/execution-metadata.repository.ts b/packages/cli/src/databases/repositories/execution-metadata.repository.ts index efaf239c4afb5..e0f27e6c09826 100644 --- a/packages/cli/src/databases/repositories/execution-metadata.repository.ts +++ b/packages/cli/src/databases/repositories/execution-metadata.repository.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { DataSource, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { ExecutionMetadata } from '../entities/execution-metadata'; diff --git a/packages/cli/src/databases/repositories/execution.repository.ts b/packages/cli/src/databases/repositories/execution.repository.ts index 617dde913681a..160b7ace87540 100644 --- a/packages/cli/src/databases/repositories/execution.repository.ts +++ b/packages/cli/src/databases/repositories/execution.repository.ts @@ -1,4 +1,5 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import type { FindManyOptions, FindOneOptions, @@ -29,7 +30,6 @@ import type { ExecutionSummary, IRunExecutionData, } from 'n8n-workflow'; -import { Service } from 'typedi'; import { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity.ee'; import { AnnotationTagMapping } from '@/databases/entities/annotation-tag-mapping.ee'; diff --git a/packages/cli/src/databases/repositories/installed-nodes.repository.ts b/packages/cli/src/databases/repositories/installed-nodes.repository.ts index 880b4375cac93..68fc564ca3141 100644 --- a/packages/cli/src/databases/repositories/installed-nodes.repository.ts +++ b/packages/cli/src/databases/repositories/installed-nodes.repository.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { DataSource, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { InstalledNodes } from '../entities/installed-nodes'; diff --git a/packages/cli/src/databases/repositories/installed-packages.repository.ts b/packages/cli/src/databases/repositories/installed-packages.repository.ts index 77faf9681747b..873880dc901a8 100644 --- a/packages/cli/src/databases/repositories/installed-packages.repository.ts +++ b/packages/cli/src/databases/repositories/installed-packages.repository.ts @@ -1,6 +1,6 @@ +import { Service } from '@n8n/di'; import { DataSource, Repository } from '@n8n/typeorm'; import type { PackageDirectoryLoader } from 'n8n-core'; -import { Service } from 'typedi'; import { InstalledNodesRepository } from './installed-nodes.repository'; import { InstalledPackages } from '../entities/installed-packages'; diff --git a/packages/cli/src/databases/repositories/invalid-auth-token.repository.ts b/packages/cli/src/databases/repositories/invalid-auth-token.repository.ts index 94909b998df62..b9c8e0a4d921c 100644 --- a/packages/cli/src/databases/repositories/invalid-auth-token.repository.ts +++ b/packages/cli/src/databases/repositories/invalid-auth-token.repository.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { DataSource, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { InvalidAuthToken } from '../entities/invalid-auth-token'; diff --git a/packages/cli/src/databases/repositories/license-metrics.repository.ts b/packages/cli/src/databases/repositories/license-metrics.repository.ts index d6cc7c1409287..26f4bd7328cb0 100644 --- a/packages/cli/src/databases/repositories/license-metrics.repository.ts +++ b/packages/cli/src/databases/repositories/license-metrics.repository.ts @@ -1,6 +1,6 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import { DataSource, Repository, Entity } from '@n8n/typeorm'; -import { Service } from 'typedi'; @Entity() export class LicenseMetrics {} diff --git a/packages/cli/src/databases/repositories/processed-data.repository.ts b/packages/cli/src/databases/repositories/processed-data.repository.ts index f02fbf270a919..0063cdf9db878 100644 --- a/packages/cli/src/databases/repositories/processed-data.repository.ts +++ b/packages/cli/src/databases/repositories/processed-data.repository.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { DataSource, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { ProcessedData } from '../entities/processed-data'; diff --git a/packages/cli/src/databases/repositories/project-relation.repository.ts b/packages/cli/src/databases/repositories/project-relation.repository.ts index 8d8faba1ba557..75aaed76df8ec 100644 --- a/packages/cli/src/databases/repositories/project-relation.repository.ts +++ b/packages/cli/src/databases/repositories/project-relation.repository.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { DataSource, In, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { ProjectRelation, type ProjectRole } from '../entities/project-relation'; diff --git a/packages/cli/src/databases/repositories/project.repository.ts b/packages/cli/src/databases/repositories/project.repository.ts index c67d4e94569d7..052668743b885 100644 --- a/packages/cli/src/databases/repositories/project.repository.ts +++ b/packages/cli/src/databases/repositories/project.repository.ts @@ -1,6 +1,6 @@ +import { Service } from '@n8n/di'; import type { EntityManager } from '@n8n/typeorm'; import { DataSource, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { Project } from '../entities/project'; diff --git a/packages/cli/src/databases/repositories/settings.repository.ts b/packages/cli/src/databases/repositories/settings.repository.ts index a00f52b4e7b4d..6e28b71c1b595 100644 --- a/packages/cli/src/databases/repositories/settings.repository.ts +++ b/packages/cli/src/databases/repositories/settings.repository.ts @@ -1,6 +1,6 @@ +import { Service } from '@n8n/di'; import { DataSource, Repository } from '@n8n/typeorm'; import { ErrorReporter } from 'n8n-core'; -import { Service } from 'typedi'; import config from '@/config'; import { EXTERNAL_SECRETS_DB_KEY } from '@/external-secrets.ee/constants'; diff --git a/packages/cli/src/databases/repositories/shared-credentials.repository.ts b/packages/cli/src/databases/repositories/shared-credentials.repository.ts index 516c546929ea3..d7e074595c370 100644 --- a/packages/cli/src/databases/repositories/shared-credentials.repository.ts +++ b/packages/cli/src/databases/repositories/shared-credentials.repository.ts @@ -1,7 +1,7 @@ +import { Service } from '@n8n/di'; import type { Scope } from '@n8n/permissions'; import type { EntityManager, FindOptionsRelations, FindOptionsWhere } from '@n8n/typeorm'; import { DataSource, In, Not, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { RoleService } from '@/services/role.service'; diff --git a/packages/cli/src/databases/repositories/shared-workflow.repository.ts b/packages/cli/src/databases/repositories/shared-workflow.repository.ts index 8f4bedcb15f37..f0a574fa0c906 100644 --- a/packages/cli/src/databases/repositories/shared-workflow.repository.ts +++ b/packages/cli/src/databases/repositories/shared-workflow.repository.ts @@ -1,7 +1,7 @@ +import { Service } from '@n8n/di'; import type { Scope } from '@n8n/permissions'; import { DataSource, Repository, In, Not } from '@n8n/typeorm'; import type { EntityManager, FindManyOptions, FindOptionsWhere } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { RoleService } from '@/services/role.service'; diff --git a/packages/cli/src/databases/repositories/tag.repository.ts b/packages/cli/src/databases/repositories/tag.repository.ts index 800fe225ae443..f58b0e5b6894a 100644 --- a/packages/cli/src/databases/repositories/tag.repository.ts +++ b/packages/cli/src/databases/repositories/tag.repository.ts @@ -1,7 +1,7 @@ +import { Service } from '@n8n/di'; import type { EntityManager } from '@n8n/typeorm'; import { DataSource, In, Repository } from '@n8n/typeorm'; import intersection from 'lodash/intersection'; -import { Service } from 'typedi'; import { TagEntity } from '../entities/tag-entity'; import type { WorkflowEntity } from '../entities/workflow-entity'; diff --git a/packages/cli/src/databases/repositories/test-definition.repository.ee.ts b/packages/cli/src/databases/repositories/test-definition.repository.ee.ts index 6866608b0264a..0955e6f89d97b 100644 --- a/packages/cli/src/databases/repositories/test-definition.repository.ee.ts +++ b/packages/cli/src/databases/repositories/test-definition.repository.ee.ts @@ -1,6 +1,6 @@ +import { Service } from '@n8n/di'; import type { FindManyOptions, FindOptionsWhere } from '@n8n/typeorm'; import { DataSource, In, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { TestDefinition } from '@/databases/entities/test-definition.ee'; import { ForbiddenError } from '@/errors/response-errors/forbidden.error'; diff --git a/packages/cli/src/databases/repositories/test-metric.repository.ee.ts b/packages/cli/src/databases/repositories/test-metric.repository.ee.ts index 01635ef8f7fb9..a08cf414f8589 100644 --- a/packages/cli/src/databases/repositories/test-metric.repository.ee.ts +++ b/packages/cli/src/databases/repositories/test-metric.repository.ee.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { DataSource, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { TestMetric } from '@/databases/entities/test-metric.ee'; diff --git a/packages/cli/src/databases/repositories/test-run.repository.ee.ts b/packages/cli/src/databases/repositories/test-run.repository.ee.ts index 1e889aadc758f..f0f235c551b74 100644 --- a/packages/cli/src/databases/repositories/test-run.repository.ee.ts +++ b/packages/cli/src/databases/repositories/test-run.repository.ee.ts @@ -1,6 +1,6 @@ +import { Service } from '@n8n/di'; import type { FindManyOptions } from '@n8n/typeorm'; import { DataSource, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import type { AggregatedTestRunMetrics } from '@/databases/entities/test-run.ee'; import { TestRun } from '@/databases/entities/test-run.ee'; diff --git a/packages/cli/src/databases/repositories/user.repository.ts b/packages/cli/src/databases/repositories/user.repository.ts index 61a4edffa5061..d785ce407d7fc 100644 --- a/packages/cli/src/databases/repositories/user.repository.ts +++ b/packages/cli/src/databases/repositories/user.repository.ts @@ -1,6 +1,6 @@ +import { Service } from '@n8n/di'; import type { DeepPartial, EntityManager, FindManyOptions } from '@n8n/typeorm'; import { DataSource, In, IsNull, Not, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import type { ListQuery } from '@/requests'; diff --git a/packages/cli/src/databases/repositories/variables.repository.ts b/packages/cli/src/databases/repositories/variables.repository.ts index 2f2500250b2b7..5ea971193503a 100644 --- a/packages/cli/src/databases/repositories/variables.repository.ts +++ b/packages/cli/src/databases/repositories/variables.repository.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { DataSource, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { Variables } from '../entities/variables'; diff --git a/packages/cli/src/databases/repositories/webhook.repository.ts b/packages/cli/src/databases/repositories/webhook.repository.ts index b89b9fba0f626..5254793a780ff 100644 --- a/packages/cli/src/databases/repositories/webhook.repository.ts +++ b/packages/cli/src/databases/repositories/webhook.repository.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { DataSource, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { WebhookEntity } from '../entities/webhook-entity'; diff --git a/packages/cli/src/databases/repositories/workflow-history.repository.ts b/packages/cli/src/databases/repositories/workflow-history.repository.ts index ca791ebcb7c57..7e0cdfac1e01b 100644 --- a/packages/cli/src/databases/repositories/workflow-history.repository.ts +++ b/packages/cli/src/databases/repositories/workflow-history.repository.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { DataSource, LessThan, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { WorkflowHistory } from '../entities/workflow-history'; diff --git a/packages/cli/src/databases/repositories/workflow-statistics.repository.ts b/packages/cli/src/databases/repositories/workflow-statistics.repository.ts index c2ea18fe2c656..ad94e83ec1a2e 100644 --- a/packages/cli/src/databases/repositories/workflow-statistics.repository.ts +++ b/packages/cli/src/databases/repositories/workflow-statistics.repository.ts @@ -1,6 +1,6 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import { DataSource, MoreThanOrEqual, QueryFailedError, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/databases/repositories/workflow-tag-mapping.repository.ts b/packages/cli/src/databases/repositories/workflow-tag-mapping.repository.ts index 108affaf116a7..0196437891114 100644 --- a/packages/cli/src/databases/repositories/workflow-tag-mapping.repository.ts +++ b/packages/cli/src/databases/repositories/workflow-tag-mapping.repository.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { DataSource, Repository } from '@n8n/typeorm'; -import { Service } from 'typedi'; import { WorkflowTagMapping } from '../entities/workflow-tag-mapping'; diff --git a/packages/cli/src/databases/repositories/workflow.repository.ts b/packages/cli/src/databases/repositories/workflow.repository.ts index 5dcd369def9c6..7edabdde968a4 100644 --- a/packages/cli/src/databases/repositories/workflow.repository.ts +++ b/packages/cli/src/databases/repositories/workflow.repository.ts @@ -1,4 +1,5 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import { DataSource, Repository, @@ -10,7 +11,6 @@ import { type FindManyOptions, type FindOptionsRelations, } from '@n8n/typeorm'; -import { Service } from 'typedi'; import config from '@/config'; import type { ListQuery } from '@/requests'; diff --git a/packages/cli/src/databases/subscribers/user-subscriber.ts b/packages/cli/src/databases/subscribers/user-subscriber.ts index 2dc6a1d8e24dd..485eeb6fc54ec 100644 --- a/packages/cli/src/databases/subscribers/user-subscriber.ts +++ b/packages/cli/src/databases/subscribers/user-subscriber.ts @@ -1,8 +1,8 @@ +import { Container } from '@n8n/di'; import type { EntitySubscriberInterface, UpdateEvent } from '@n8n/typeorm'; import { EventSubscriber } from '@n8n/typeorm'; import { ErrorReporter, Logger } from 'n8n-core'; import { ApplicationError } from 'n8n-workflow'; -import { Container } from 'typedi'; import { Project } from '../entities/project'; import { User } from '../entities/user'; diff --git a/packages/cli/src/databases/utils/migration-helpers.ts b/packages/cli/src/databases/utils/migration-helpers.ts index 70839b9337873..e248f19c834cd 100644 --- a/packages/cli/src/databases/utils/migration-helpers.ts +++ b/packages/cli/src/databases/utils/migration-helpers.ts @@ -1,10 +1,10 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import type { ObjectLiteral } from '@n8n/typeorm'; import type { QueryRunner } from '@n8n/typeorm/query-runner/QueryRunner'; import { readFileSync, rmSync } from 'fs'; import { InstanceSettings, Logger } from 'n8n-core'; import { ApplicationError, jsonParse } from 'n8n-workflow'; -import { Container } from 'typedi'; import { inTest } from '@/constants'; import { createSchemaBuilder } from '@/databases/dsl'; diff --git a/packages/cli/src/databases/utils/transformers.ts b/packages/cli/src/databases/utils/transformers.ts index a18d0cf633c13..7a454d519c311 100644 --- a/packages/cli/src/databases/utils/transformers.ts +++ b/packages/cli/src/databases/utils/transformers.ts @@ -1,7 +1,7 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import type { ValueTransformer, FindOperator } from '@n8n/typeorm'; import { jsonParse } from 'n8n-workflow'; -import { Container } from 'typedi'; export const idStringifier = { from: (value?: number): string | undefined => value?.toString(), diff --git a/packages/cli/src/db.ts b/packages/cli/src/db.ts index e1c2b0e402ccd..6f336d659db1a 100644 --- a/packages/cli/src/db.ts +++ b/packages/cli/src/db.ts @@ -1,10 +1,10 @@ +import { Container } from '@n8n/di'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import type { EntityManager } from '@n8n/typeorm'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import { DataSource as Connection } from '@n8n/typeorm'; import { ErrorReporter } from 'n8n-core'; import { DbConnectionTimeoutError, ensureError } from 'n8n-workflow'; -import { Container } from 'typedi'; import { inTest } from '@/constants'; import { getConnectionOptions, arePostgresOptions } from '@/databases/config'; diff --git a/packages/cli/src/decorators/__tests__/on-shutdown.test.ts b/packages/cli/src/decorators/__tests__/on-shutdown.test.ts index 774ae2ef4889b..a5c720c993ce7 100644 --- a/packages/cli/src/decorators/__tests__/on-shutdown.test.ts +++ b/packages/cli/src/decorators/__tests__/on-shutdown.test.ts @@ -1,5 +1,5 @@ +import { Container, Service } from '@n8n/di'; import { mock } from 'jest-mock-extended'; -import Container, { Service } from 'typedi'; import { OnShutdown } from '@/decorators/on-shutdown'; import { ShutdownService } from '@/shutdown/shutdown.service'; diff --git a/packages/cli/src/decorators/controller.registry.ts b/packages/cli/src/decorators/controller.registry.ts index c68945ca076b6..645a675011ce2 100644 --- a/packages/cli/src/decorators/controller.registry.ts +++ b/packages/cli/src/decorators/controller.registry.ts @@ -1,9 +1,9 @@ import { GlobalConfig } from '@n8n/config'; +import { Container, Service } from '@n8n/di'; import { Router } from 'express'; import type { Application, Request, Response, RequestHandler } from 'express'; import { rateLimit as expressRateLimit } from 'express-rate-limit'; import { ApplicationError } from 'n8n-workflow'; -import { Container, Service } from 'typedi'; import type { ZodClass } from 'zod-class'; import { AuthService } from '@/auth/auth.service'; @@ -73,7 +73,7 @@ export class ControllerRegistry { .replace(/\/$/, ''); app.use(prefix, router); - const controller = Container.get(controllerClass); + const controller = Container.get(controllerClass) as Controller; const controllerMiddlewares = metadata.middlewares.map( (handlerName) => controller[handlerName].bind(controller) as RequestHandler, ); diff --git a/packages/cli/src/decorators/on-shutdown.ts b/packages/cli/src/decorators/on-shutdown.ts index dbcb547d420de..3d170021051aa 100644 --- a/packages/cli/src/decorators/on-shutdown.ts +++ b/packages/cli/src/decorators/on-shutdown.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { ApplicationError } from 'n8n-workflow'; -import { Container } from 'typedi'; import { DEFAULT_SHUTDOWN_PRIORITY } from '@/constants'; import { type ServiceClass, ShutdownService } from '@/shutdown/shutdown.service'; diff --git a/packages/cli/src/decorators/rest-controller.ts b/packages/cli/src/decorators/rest-controller.ts index d540f6a8ac41d..cdd32b6e218ca 100644 --- a/packages/cli/src/decorators/rest-controller.ts +++ b/packages/cli/src/decorators/rest-controller.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import { getControllerMetadata } from './controller.registry'; import type { Controller } from './types'; diff --git a/packages/cli/src/decorators/types.ts b/packages/cli/src/decorators/types.ts index f410df78318b9..17a7425882b15 100644 --- a/packages/cli/src/decorators/types.ts +++ b/packages/cli/src/decorators/types.ts @@ -1,6 +1,6 @@ +import type { Constructable } from '@n8n/di'; import type { Scope } from '@n8n/permissions'; import type { RequestHandler } from 'express'; -import type { Class } from 'n8n-core'; import type { BooleanLicenseFeature } from '@/interfaces'; @@ -46,5 +46,5 @@ export interface ControllerMetadata { routes: Map; } -export type Controller = Class & +export type Controller = Constructable & Record Promise>; diff --git a/packages/cli/src/deduplication/deduplication-helper.ts b/packages/cli/src/deduplication/deduplication-helper.ts index a913a21a8c8a1..dc6b59ac29eea 100644 --- a/packages/cli/src/deduplication/deduplication-helper.ts +++ b/packages/cli/src/deduplication/deduplication-helper.ts @@ -1,3 +1,4 @@ +import { Container } from '@n8n/di'; import { createHash } from 'crypto'; import { type ICheckProcessedContextData, @@ -10,7 +11,6 @@ import { tryToParseDateTime, } from 'n8n-workflow'; import * as assert from 'node:assert/strict'; -import { Container } from 'typedi'; import type { ProcessedData } from '@/databases/entities/processed-data'; import { ProcessedDataRepository } from '@/databases/repositories/processed-data.repository'; diff --git a/packages/cli/src/deprecation/deprecation.service.ts b/packages/cli/src/deprecation/deprecation.service.ts index b3c4cb7d21173..1b2e6c61742c9 100644 --- a/packages/cli/src/deprecation/deprecation.service.ts +++ b/packages/cli/src/deprecation/deprecation.service.ts @@ -1,6 +1,6 @@ +import { Service } from '@n8n/di'; import { Logger } from 'n8n-core'; import { ApplicationError } from 'n8n-workflow'; -import { Service } from 'typedi'; type EnvVarName = string; diff --git a/packages/cli/src/environments.ee/source-control/__tests__/source-control-export.service.test.ts b/packages/cli/src/environments.ee/source-control/__tests__/source-control-export.service.test.ts index b04d8a2239946..2e5a5e63e3d0a 100644 --- a/packages/cli/src/environments.ee/source-control/__tests__/source-control-export.service.test.ts +++ b/packages/cli/src/environments.ee/source-control/__tests__/source-control-export.service.test.ts @@ -1,7 +1,7 @@ +import { Container } from '@n8n/di'; import mock from 'jest-mock-extended/lib/Mock'; import { Cipher, type InstanceSettings } from 'n8n-core'; import { ApplicationError, deepCopy } from 'n8n-workflow'; -import Container from 'typedi'; import type { CredentialsEntity } from '@/databases/entities/credentials-entity'; import type { SharedCredentials } from '@/databases/entities/shared-credentials'; diff --git a/packages/cli/src/environments.ee/source-control/__tests__/source-control-helper.ee.test.ts b/packages/cli/src/environments.ee/source-control/__tests__/source-control-helper.ee.test.ts index 5ecb04cf8ad33..c6d1b3857bef6 100644 --- a/packages/cli/src/environments.ee/source-control/__tests__/source-control-helper.ee.test.ts +++ b/packages/cli/src/environments.ee/source-control/__tests__/source-control-helper.ee.test.ts @@ -1,7 +1,7 @@ +import { Container } from '@n8n/di'; import { constants as fsConstants, accessSync } from 'fs'; import { InstanceSettings } from 'n8n-core'; import path from 'path'; -import Container from 'typedi'; import { SOURCE_CONTROL_SSH_FOLDER, diff --git a/packages/cli/src/environments.ee/source-control/__tests__/source-control.service.test.ts b/packages/cli/src/environments.ee/source-control/__tests__/source-control.service.test.ts index 8b32062d55a8d..9024a0a32c965 100644 --- a/packages/cli/src/environments.ee/source-control/__tests__/source-control.service.test.ts +++ b/packages/cli/src/environments.ee/source-control/__tests__/source-control.service.test.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; import { InstanceSettings } from 'n8n-core'; -import { Container } from 'typedi'; import { SourceControlPreferencesService } from '@/environments.ee/source-control/source-control-preferences.service.ee'; import { SourceControlService } from '@/environments.ee/source-control/source-control.service.ee'; diff --git a/packages/cli/src/environments.ee/source-control/middleware/source-control-enabled-middleware.ee.ts b/packages/cli/src/environments.ee/source-control/middleware/source-control-enabled-middleware.ee.ts index 2a8480561dad4..4157374d56851 100644 --- a/packages/cli/src/environments.ee/source-control/middleware/source-control-enabled-middleware.ee.ts +++ b/packages/cli/src/environments.ee/source-control/middleware/source-control-enabled-middleware.ee.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import type { RequestHandler } from 'express'; -import { Container } from 'typedi'; import { isSourceControlLicensed } from '../source-control-helper.ee'; import { SourceControlPreferencesService } from '../source-control-preferences.service.ee'; diff --git a/packages/cli/src/environments.ee/source-control/source-control-export.service.ee.ts b/packages/cli/src/environments.ee/source-control/source-control-export.service.ee.ts index cb678d534d41c..498046031876f 100644 --- a/packages/cli/src/environments.ee/source-control/source-control-export.service.ee.ts +++ b/packages/cli/src/environments.ee/source-control/source-control-export.service.ee.ts @@ -1,9 +1,9 @@ +import { Container, Service } from '@n8n/di'; import { rmSync } from 'fs'; import { Credentials, InstanceSettings, Logger } from 'n8n-core'; import { ApplicationError, type ICredentialDataDecryptedObject } from 'n8n-workflow'; import { writeFile as fsWriteFile, rm as fsRm } from 'node:fs/promises'; import path from 'path'; -import Container, { Service } from 'typedi'; import type { WorkflowEntity } from '@/databases/entities/workflow-entity'; import { SharedCredentialsRepository } from '@/databases/repositories/shared-credentials.repository'; diff --git a/packages/cli/src/environments.ee/source-control/source-control-git.service.ee.ts b/packages/cli/src/environments.ee/source-control/source-control-git.service.ee.ts index 0d87d4c2d18c5..01aaf78c68cea 100644 --- a/packages/cli/src/environments.ee/source-control/source-control-git.service.ee.ts +++ b/packages/cli/src/environments.ee/source-control/source-control-git.service.ee.ts @@ -1,3 +1,4 @@ +import { Service } from '@n8n/di'; import { execSync } from 'child_process'; import { Logger } from 'n8n-core'; import { ApplicationError } from 'n8n-workflow'; @@ -12,7 +13,6 @@ import type { SimpleGitOptions, StatusResult, } from 'simple-git'; -import { Service } from 'typedi'; import type { User } from '@/databases/entities/user'; import { OwnershipService } from '@/services/ownership.service'; diff --git a/packages/cli/src/environments.ee/source-control/source-control-helper.ee.ts b/packages/cli/src/environments.ee/source-control/source-control-helper.ee.ts index 6e8b92f09b444..031155a5b5838 100644 --- a/packages/cli/src/environments.ee/source-control/source-control-helper.ee.ts +++ b/packages/cli/src/environments.ee/source-control/source-control-helper.ee.ts @@ -1,10 +1,10 @@ +import { Container } from '@n8n/di'; import { generateKeyPairSync } from 'crypto'; import { constants as fsConstants, mkdirSync, accessSync } from 'fs'; import { Logger } from 'n8n-core'; import { ApplicationError } from 'n8n-workflow'; import { ok } from 'node:assert/strict'; import path from 'path'; -import { Container } from 'typedi'; import { License } from '@/license'; import { isContainedWithin } from '@/utils/path-util'; diff --git a/packages/cli/src/environments.ee/source-control/source-control-import.service.ee.ts b/packages/cli/src/environments.ee/source-control/source-control-import.service.ee.ts index 10ae293b601da..8da041297bb75 100644 --- a/packages/cli/src/environments.ee/source-control/source-control-import.service.ee.ts +++ b/packages/cli/src/environments.ee/source-control/source-control-import.service.ee.ts @@ -1,3 +1,4 @@ +import { Container, Service } from '@n8n/di'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import { In } from '@n8n/typeorm'; import glob from 'fast-glob'; @@ -5,7 +6,6 @@ import { Credentials, ErrorReporter, InstanceSettings, Logger } from 'n8n-core'; import { ApplicationError, jsonParse, ensureError } from 'n8n-workflow'; import { readFile as fsReadFile } from 'node:fs/promises'; import path from 'path'; -import { Container, Service } from 'typedi'; import { ActiveWorkflowManager } from '@/active-workflow-manager'; import type { Project } from '@/databases/entities/project'; diff --git a/packages/cli/src/environments.ee/source-control/source-control-preferences.service.ee.ts b/packages/cli/src/environments.ee/source-control/source-control-preferences.service.ee.ts index ec46e024549aa..e530d9d530f9f 100644 --- a/packages/cli/src/environments.ee/source-control/source-control-preferences.service.ee.ts +++ b/packages/cli/src/environments.ee/source-control/source-control-preferences.service.ee.ts @@ -1,3 +1,4 @@ +import { Container, Service } from '@n8n/di'; import type { ValidationError } from 'class-validator'; import { validate } from 'class-validator'; import { rm as fsRm } from 'fs/promises'; @@ -5,7 +6,6 @@ import { Cipher, InstanceSettings, Logger } from 'n8n-core'; import { ApplicationError, jsonParse } from 'n8n-workflow'; import { writeFile, chmod, readFile } from 'node:fs/promises'; import path from 'path'; -import Container, { Service } from 'typedi'; import config from '@/config'; import { SettingsRepository } from '@/databases/repositories/settings.repository'; diff --git a/packages/cli/src/environments.ee/source-control/source-control.service.ee.ts b/packages/cli/src/environments.ee/source-control/source-control.service.ee.ts index 8fcb1f35711fa..3952b6d6b5af3 100644 --- a/packages/cli/src/environments.ee/source-control/source-control.service.ee.ts +++ b/packages/cli/src/environments.ee/source-control/source-control.service.ee.ts @@ -1,9 +1,9 @@ +import { Service } from '@n8n/di'; import { writeFileSync } from 'fs'; import { Logger } from 'n8n-core'; import { ApplicationError } from 'n8n-workflow'; import path from 'path'; import type { PushResult } from 'simple-git'; -import { Service } from 'typedi'; import type { TagEntity } from '@/databases/entities/tag-entity'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/environments.ee/variables/environment-helpers.ts b/packages/cli/src/environments.ee/variables/environment-helpers.ts index 720d2f3a2392b..dd9a17c95b9f3 100644 --- a/packages/cli/src/environments.ee/variables/environment-helpers.ts +++ b/packages/cli/src/environments.ee/variables/environment-helpers.ts @@ -1,4 +1,4 @@ -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import { License } from '@/license'; diff --git a/packages/cli/src/environments.ee/variables/variables.service.ee.ts b/packages/cli/src/environments.ee/variables/variables.service.ee.ts index 38ad5703ea91e..ebb134efd3341 100644 --- a/packages/cli/src/environments.ee/variables/variables.service.ee.ts +++ b/packages/cli/src/environments.ee/variables/variables.service.ee.ts @@ -1,4 +1,4 @@ -import { Container, Service } from 'typedi'; +import { Container, Service } from '@n8n/di'; import type { Variables } from '@/databases/entities/variables'; import { VariablesRepository } from '@/databases/repositories/variables.repository'; diff --git a/packages/cli/src/evaluation.ee/test-definition.service.ee.ts b/packages/cli/src/evaluation.ee/test-definition.service.ee.ts index e9a31e7eeef5d..75fbeedfe973d 100644 --- a/packages/cli/src/evaluation.ee/test-definition.service.ee.ts +++ b/packages/cli/src/evaluation.ee/test-definition.service.ee.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import type { MockedNodeItem, TestDefinition } from '@/databases/entities/test-definition.ee'; import { AnnotationTagRepository } from '@/databases/repositories/annotation-tag.repository.ee'; diff --git a/packages/cli/src/evaluation.ee/test-runner/test-runner.service.ee.ts b/packages/cli/src/evaluation.ee/test-runner/test-runner.service.ee.ts index 9fcbe1de7c5bc..65c6c2d300475 100644 --- a/packages/cli/src/evaluation.ee/test-runner/test-runner.service.ee.ts +++ b/packages/cli/src/evaluation.ee/test-runner/test-runner.service.ee.ts @@ -1,3 +1,4 @@ +import { Service } from '@n8n/di'; import { parse } from 'flatted'; import type { IDataObject, @@ -8,7 +9,6 @@ import type { } from 'n8n-workflow'; import { NodeConnectionType, Workflow } from 'n8n-workflow'; import assert from 'node:assert'; -import { Service } from 'typedi'; import { ActiveExecutions } from '@/active-executions'; import type { ExecutionEntity } from '@/databases/entities/execution-entity'; diff --git a/packages/cli/src/eventbus/message-event-bus-destination/message-event-bus-destination-from-db.ts b/packages/cli/src/eventbus/message-event-bus-destination/message-event-bus-destination-from-db.ts index 90049da1fff6a..f091d529e42da 100644 --- a/packages/cli/src/eventbus/message-event-bus-destination/message-event-bus-destination-from-db.ts +++ b/packages/cli/src/eventbus/message-event-bus-destination/message-event-bus-destination-from-db.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import { Logger } from 'n8n-core'; import { MessageEventBusDestinationTypeNames } from 'n8n-workflow'; -import { Container } from 'typedi'; import type { EventDestinations } from '@/databases/entities/event-destinations'; diff --git a/packages/cli/src/eventbus/message-event-bus-destination/message-event-bus-destination-syslog.ee.ts b/packages/cli/src/eventbus/message-event-bus-destination/message-event-bus-destination-syslog.ee.ts index c0e7657e0fa95..b1f0675dab8ca 100644 --- a/packages/cli/src/eventbus/message-event-bus-destination/message-event-bus-destination-syslog.ee.ts +++ b/packages/cli/src/eventbus/message-event-bus-destination/message-event-bus-destination-syslog.ee.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ +import { Container } from '@n8n/di'; import { Logger } from 'n8n-core'; import type { MessageEventBusDestinationOptions, @@ -6,7 +7,6 @@ import type { } from 'n8n-workflow'; import { MessageEventBusDestinationTypeNames } from 'n8n-workflow'; import syslog from 'syslog-client'; -import Container from 'typedi'; import { MessageEventBusDestination } from './message-event-bus-destination.ee'; import { eventMessageGenericDestinationTestEvent } from '../event-message-classes/event-message-generic'; diff --git a/packages/cli/src/eventbus/message-event-bus-destination/message-event-bus-destination-webhook.ee.ts b/packages/cli/src/eventbus/message-event-bus-destination/message-event-bus-destination-webhook.ee.ts index 8bc967e789266..34d4eec569c79 100644 --- a/packages/cli/src/eventbus/message-event-bus-destination/message-event-bus-destination-webhook.ee.ts +++ b/packages/cli/src/eventbus/message-event-bus-destination/message-event-bus-destination-webhook.ee.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ +import { Container } from '@n8n/di'; import axios from 'axios'; import type { AxiosRequestConfig, Method } from 'axios'; import { Agent as HTTPSAgent } from 'https'; @@ -11,7 +12,6 @@ import type { IWorkflowExecuteAdditionalData, MessageEventBusDestinationWebhookOptions, } from 'n8n-workflow'; -import Container from 'typedi'; import { CredentialsHelper } from '@/credentials-helper'; import * as SecretsHelpers from '@/external-secrets.ee/external-secrets-helper.ee'; diff --git a/packages/cli/src/eventbus/message-event-bus-destination/message-event-bus-destination.ee.ts b/packages/cli/src/eventbus/message-event-bus-destination/message-event-bus-destination.ee.ts index c3aaf71173513..6f990a5cfb18a 100644 --- a/packages/cli/src/eventbus/message-event-bus-destination/message-event-bus-destination.ee.ts +++ b/packages/cli/src/eventbus/message-event-bus-destination/message-event-bus-destination.ee.ts @@ -1,7 +1,7 @@ +import { Container } from '@n8n/di'; import { Logger } from 'n8n-core'; import type { INodeCredentials, MessageEventBusDestinationOptions } from 'n8n-workflow'; import { MessageEventBusDestinationTypeNames } from 'n8n-workflow'; -import { Container } from 'typedi'; import { v4 as uuid } from 'uuid'; import { EventDestinationsRepository } from '@/databases/repositories/event-destinations.repository'; diff --git a/packages/cli/src/eventbus/message-event-bus-writer/message-event-bus-log-writer.ts b/packages/cli/src/eventbus/message-event-bus-writer/message-event-bus-log-writer.ts index c418035a70a2b..0cc5d5e3a6dfb 100644 --- a/packages/cli/src/eventbus/message-event-bus-writer/message-event-bus-log-writer.ts +++ b/packages/cli/src/eventbus/message-event-bus-writer/message-event-bus-log-writer.ts @@ -1,6 +1,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import { once as eventOnce } from 'events'; import { createReadStream, existsSync, rmSync } from 'fs'; import remove from 'lodash/remove'; @@ -8,7 +9,6 @@ import { InstanceSettings, Logger } from 'n8n-core'; import { EventMessageTypeNames, jsonParse } from 'n8n-workflow'; import path, { parse } from 'path'; import readline from 'readline'; -import Container from 'typedi'; import { Worker } from 'worker_threads'; import { inTest } from '@/constants'; diff --git a/packages/cli/src/eventbus/message-event-bus/message-event-bus.ts b/packages/cli/src/eventbus/message-event-bus/message-event-bus.ts index 2cd35a596f811..22a974f5ee8d5 100644 --- a/packages/cli/src/eventbus/message-event-bus/message-event-bus.ts +++ b/packages/cli/src/eventbus/message-event-bus/message-event-bus.ts @@ -1,4 +1,5 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import type { DeleteResult } from '@n8n/typeorm'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import @@ -7,7 +8,6 @@ import EventEmitter from 'events'; import uniqby from 'lodash/uniqBy'; import { Logger } from 'n8n-core'; import type { MessageEventBusDestinationOptions } from 'n8n-workflow'; -import { Service } from 'typedi'; import config from '@/config'; import { EventDestinationsRepository } from '@/databases/repositories/event-destinations.repository'; diff --git a/packages/cli/src/events/event.service.ts b/packages/cli/src/events/event.service.ts index b8e00ecea768e..dbcb5f295559c 100644 --- a/packages/cli/src/events/event.service.ts +++ b/packages/cli/src/events/event.service.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import { TypedEmitter } from '@/typed-emitter'; diff --git a/packages/cli/src/events/relays/event-relay.ts b/packages/cli/src/events/relays/event-relay.ts index 13e7dc01be78f..742bfcba27cfc 100644 --- a/packages/cli/src/events/relays/event-relay.ts +++ b/packages/cli/src/events/relays/event-relay.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import { EventService } from '@/events/event.service'; import type { RelayEventMap } from '@/events/maps/relay.event-map'; diff --git a/packages/cli/src/events/relays/log-streaming.event-relay.ts b/packages/cli/src/events/relays/log-streaming.event-relay.ts index c65af2874c37c..b048b09a8303d 100644 --- a/packages/cli/src/events/relays/log-streaming.event-relay.ts +++ b/packages/cli/src/events/relays/log-streaming.event-relay.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import type { IWorkflowBase } from 'n8n-workflow'; -import { Service } from 'typedi'; import { Redactable } from '@/decorators/redactable'; import { MessageEventBus } from '@/eventbus/message-event-bus/message-event-bus'; diff --git a/packages/cli/src/events/relays/telemetry.event-relay.ts b/packages/cli/src/events/relays/telemetry.event-relay.ts index a34646f100f5f..221449bbabaf3 100644 --- a/packages/cli/src/events/relays/telemetry.event-relay.ts +++ b/packages/cli/src/events/relays/telemetry.event-relay.ts @@ -1,11 +1,11 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import { snakeCase } from 'change-case'; import { InstanceSettings } from 'n8n-core'; import type { ExecutionStatus, INodesGraphResult, ITelemetryTrackProperties } from 'n8n-workflow'; import { TelemetryHelpers } from 'n8n-workflow'; import os from 'node:os'; import { get as pslGet } from 'psl'; -import { Service } from 'typedi'; import config from '@/config'; import { N8N_VERSION } from '@/constants'; diff --git a/packages/cli/src/execution-lifecycle-hooks/restore-binary-data-id.ts b/packages/cli/src/execution-lifecycle-hooks/restore-binary-data-id.ts index 15ac8b905cb4c..47c1031859e50 100644 --- a/packages/cli/src/execution-lifecycle-hooks/restore-binary-data-id.ts +++ b/packages/cli/src/execution-lifecycle-hooks/restore-binary-data-id.ts @@ -1,7 +1,7 @@ +import { Container } from '@n8n/di'; import type { BinaryData } from 'n8n-core'; import { BinaryDataService, Logger } from 'n8n-core'; import type { IRun, WorkflowExecuteMode } from 'n8n-workflow'; -import Container from 'typedi'; import config from '@/config'; diff --git a/packages/cli/src/execution-lifecycle-hooks/save-execution-progress.ts b/packages/cli/src/execution-lifecycle-hooks/save-execution-progress.ts index 2047c9e82eade..9e751c90f6ab9 100644 --- a/packages/cli/src/execution-lifecycle-hooks/save-execution-progress.ts +++ b/packages/cli/src/execution-lifecycle-hooks/save-execution-progress.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import { ErrorReporter, Logger } from 'n8n-core'; import type { IRunExecutionData, ITaskData, IWorkflowBase } from 'n8n-workflow'; -import { Container } from 'typedi'; import { ExecutionRepository } from '@/databases/repositories/execution.repository'; import { toSaveSettings } from '@/execution-lifecycle-hooks/to-save-settings'; diff --git a/packages/cli/src/execution-lifecycle-hooks/shared/shared-hook-functions.ts b/packages/cli/src/execution-lifecycle-hooks/shared/shared-hook-functions.ts index 4c91222126cae..657c430e170c1 100644 --- a/packages/cli/src/execution-lifecycle-hooks/shared/shared-hook-functions.ts +++ b/packages/cli/src/execution-lifecycle-hooks/shared/shared-hook-functions.ts @@ -1,7 +1,7 @@ +import { Container } from '@n8n/di'; import pick from 'lodash/pick'; import { Logger } from 'n8n-core'; import { ensureError, type ExecutionStatus, type IRun, type IWorkflowBase } from 'n8n-workflow'; -import { Container } from 'typedi'; import { ExecutionRepository } from '@/databases/repositories/execution.repository'; import type { IExecutionDb, UpdateExecutionPayload } from '@/interfaces'; diff --git a/packages/cli/src/executions/__tests__/execution-recovery.service.test.ts b/packages/cli/src/executions/__tests__/execution-recovery.service.test.ts index 0e6017a2bd395..9cb681a7ef21f 100644 --- a/packages/cli/src/executions/__tests__/execution-recovery.service.test.ts +++ b/packages/cli/src/executions/__tests__/execution-recovery.service.test.ts @@ -1,8 +1,8 @@ +import { Container } from '@n8n/di'; import { stringify } from 'flatted'; import { mock } from 'jest-mock-extended'; import { InstanceSettings } from 'n8n-core'; import { randomInt } from 'n8n-workflow'; -import Container from 'typedi'; import { ARTIFICIAL_TASK_DATA } from '@/constants'; import { ExecutionRepository } from '@/databases/repositories/execution.repository'; diff --git a/packages/cli/src/executions/execution-recovery.service.ts b/packages/cli/src/executions/execution-recovery.service.ts index f307ce0677f5c..503e53d02336b 100644 --- a/packages/cli/src/executions/execution-recovery.service.ts +++ b/packages/cli/src/executions/execution-recovery.service.ts @@ -1,8 +1,8 @@ +import { Service } from '@n8n/di'; import type { DateTime } from 'luxon'; import { InstanceSettings, Logger } from 'n8n-core'; import { sleep } from 'n8n-workflow'; import type { IRun, ITaskData } from 'n8n-workflow'; -import { Service } from 'typedi'; import { ARTIFICIAL_TASK_DATA } from '@/constants'; import { ExecutionRepository } from '@/databases/repositories/execution.repository'; diff --git a/packages/cli/src/executions/execution.service.ee.ts b/packages/cli/src/executions/execution.service.ee.ts index cb4ae332edd38..b345ef6c9959d 100644 --- a/packages/cli/src/executions/execution.service.ee.ts +++ b/packages/cli/src/executions/execution.service.ee.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; import type { IExecutionResponse, IExecutionFlattedResponse } from '@/interfaces'; diff --git a/packages/cli/src/executions/execution.service.ts b/packages/cli/src/executions/execution.service.ts index ffddb271649fa..1ce2985515c0a 100644 --- a/packages/cli/src/executions/execution.service.ts +++ b/packages/cli/src/executions/execution.service.ts @@ -1,4 +1,5 @@ import { GlobalConfig } from '@n8n/config'; +import { Container, Service } from '@n8n/di'; import { validate as jsonSchemaValidate } from 'jsonschema'; import { Logger } from 'n8n-core'; import type { @@ -16,7 +17,6 @@ import { Workflow, WorkflowOperationError, } from 'n8n-workflow'; -import { Container, Service } from 'typedi'; import { ActiveExecutions } from '@/active-executions'; import { ConcurrencyControlService } from '@/concurrency/concurrency-control.service'; diff --git a/packages/cli/src/expression-evaluator.ts b/packages/cli/src/expression-evaluator.ts index 434c78e114bbf..d77838dbc1590 100644 --- a/packages/cli/src/expression-evaluator.ts +++ b/packages/cli/src/expression-evaluator.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import { ErrorReporter } from 'n8n-core'; import { ExpressionEvaluatorProxy } from 'n8n-workflow'; -import Container from 'typedi'; import config from '@/config'; diff --git a/packages/cli/src/external-hooks.ts b/packages/cli/src/external-hooks.ts index 764625fa23cd3..8a0ba82c9853e 100644 --- a/packages/cli/src/external-hooks.ts +++ b/packages/cli/src/external-hooks.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-var-requires */ +import { Service } from '@n8n/di'; import { ApplicationError } from 'n8n-workflow'; -import { Service } from 'typedi'; import config from '@/config'; import { CredentialsRepository } from '@/databases/repositories/credentials.repository'; diff --git a/packages/cli/src/external-secrets.ee/__tests__/external-secrets-manager.ee.test.ts b/packages/cli/src/external-secrets.ee/__tests__/external-secrets-manager.ee.test.ts index 341558a5fe00f..f3ff03af85c78 100644 --- a/packages/cli/src/external-secrets.ee/__tests__/external-secrets-manager.ee.test.ts +++ b/packages/cli/src/external-secrets.ee/__tests__/external-secrets-manager.ee.test.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; import { Cipher } from 'n8n-core'; -import { Container } from 'typedi'; import { SettingsRepository } from '@/databases/repositories/settings.repository'; import { ExternalSecretsManager } from '@/external-secrets.ee/external-secrets-manager.ee'; diff --git a/packages/cli/src/external-secrets.ee/external-secrets-helper.ee.ts b/packages/cli/src/external-secrets.ee/external-secrets-helper.ee.ts index 946badde421d1..d2a8ba34bbe5d 100644 --- a/packages/cli/src/external-secrets.ee/external-secrets-helper.ee.ts +++ b/packages/cli/src/external-secrets.ee/external-secrets-helper.ee.ts @@ -1,5 +1,5 @@ import { GlobalConfig } from '@n8n/config'; -import Container from 'typedi'; +import { Container } from '@n8n/di'; import { License } from '@/license'; diff --git a/packages/cli/src/external-secrets.ee/external-secrets-manager.ee.ts b/packages/cli/src/external-secrets.ee/external-secrets-manager.ee.ts index d4adf17255554..83579c3e8e8e3 100644 --- a/packages/cli/src/external-secrets.ee/external-secrets-manager.ee.ts +++ b/packages/cli/src/external-secrets.ee/external-secrets-manager.ee.ts @@ -1,6 +1,6 @@ +import { Service } from '@n8n/di'; import { Cipher, Logger } from 'n8n-core'; import { jsonParse, type IDataObject, ApplicationError, ensureError } from 'n8n-workflow'; -import { Service } from 'typedi'; import { SettingsRepository } from '@/databases/repositories/settings.repository'; import { EventService } from '@/events/event.service'; diff --git a/packages/cli/src/external-secrets.ee/external-secrets-providers.ee.ts b/packages/cli/src/external-secrets.ee/external-secrets-providers.ee.ts index 642c107603cd4..8be0f4af061cb 100644 --- a/packages/cli/src/external-secrets.ee/external-secrets-providers.ee.ts +++ b/packages/cli/src/external-secrets.ee/external-secrets-providers.ee.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import type { SecretsProvider } from '@/interfaces'; diff --git a/packages/cli/src/external-secrets.ee/external-secrets.service.ee.ts b/packages/cli/src/external-secrets.ee/external-secrets.service.ee.ts index aab3b2069a7af..f9f0613348233 100644 --- a/packages/cli/src/external-secrets.ee/external-secrets.service.ee.ts +++ b/packages/cli/src/external-secrets.ee/external-secrets.service.ee.ts @@ -1,6 +1,6 @@ +import { Container, Service } from '@n8n/di'; import type { IDataObject } from 'n8n-workflow'; import { deepCopy } from 'n8n-workflow'; -import Container, { Service } from 'typedi'; import { CREDENTIAL_BLANKING_VALUE } from '@/constants'; import { ExternalSecretsProviderNotFoundError } from '@/errors/external-secrets-provider-not-found.error'; diff --git a/packages/cli/src/external-secrets.ee/providers/aws-secrets/aws-secrets-manager.ts b/packages/cli/src/external-secrets.ee/providers/aws-secrets/aws-secrets-manager.ts index b22c2f24364a4..3e43041735978 100644 --- a/packages/cli/src/external-secrets.ee/providers/aws-secrets/aws-secrets-manager.ts +++ b/packages/cli/src/external-secrets.ee/providers/aws-secrets/aws-secrets-manager.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import { Logger } from 'n8n-core'; import type { INodeProperties } from 'n8n-workflow'; -import Container from 'typedi'; import { UnknownAuthTypeError } from '@/errors/unknown-auth-type.error'; import { DOCS_HELP_NOTICE, EXTERNAL_SECRETS_NAME_REGEX } from '@/external-secrets.ee/constants'; diff --git a/packages/cli/src/external-secrets.ee/providers/azure-key-vault/azure-key-vault.ts b/packages/cli/src/external-secrets.ee/providers/azure-key-vault/azure-key-vault.ts index a03ef468b6b04..ce83b09146bd4 100644 --- a/packages/cli/src/external-secrets.ee/providers/azure-key-vault/azure-key-vault.ts +++ b/packages/cli/src/external-secrets.ee/providers/azure-key-vault/azure-key-vault.ts @@ -1,8 +1,8 @@ import type { SecretClient } from '@azure/keyvault-secrets'; +import { Container } from '@n8n/di'; import { Logger } from 'n8n-core'; import { ensureError } from 'n8n-workflow'; import type { INodeProperties } from 'n8n-workflow'; -import Container from 'typedi'; import { DOCS_HELP_NOTICE, EXTERNAL_SECRETS_NAME_REGEX } from '@/external-secrets.ee/constants'; import type { SecretsProvider, SecretsProviderState } from '@/interfaces'; diff --git a/packages/cli/src/external-secrets.ee/providers/gcp-secrets-manager/gcp-secrets-manager.ts b/packages/cli/src/external-secrets.ee/providers/gcp-secrets-manager/gcp-secrets-manager.ts index fe039fd50ae6f..72f9380ff4c7d 100644 --- a/packages/cli/src/external-secrets.ee/providers/gcp-secrets-manager/gcp-secrets-manager.ts +++ b/packages/cli/src/external-secrets.ee/providers/gcp-secrets-manager/gcp-secrets-manager.ts @@ -1,7 +1,7 @@ import type { SecretManagerServiceClient as GcpClient } from '@google-cloud/secret-manager'; +import { Container } from '@n8n/di'; import { Logger } from 'n8n-core'; import { ensureError, jsonParse, type INodeProperties } from 'n8n-workflow'; -import Container from 'typedi'; import { DOCS_HELP_NOTICE, EXTERNAL_SECRETS_NAME_REGEX } from '@/external-secrets.ee/constants'; import type { SecretsProvider, SecretsProviderState } from '@/interfaces'; diff --git a/packages/cli/src/external-secrets.ee/providers/vault.ts b/packages/cli/src/external-secrets.ee/providers/vault.ts index 8030832376fe9..e27df4cc6db89 100644 --- a/packages/cli/src/external-secrets.ee/providers/vault.ts +++ b/packages/cli/src/external-secrets.ee/providers/vault.ts @@ -1,8 +1,8 @@ +import { Container } from '@n8n/di'; import type { AxiosInstance, AxiosResponse } from 'axios'; import axios from 'axios'; import { Logger } from 'n8n-core'; import type { IDataObject, INodeProperties } from 'n8n-workflow'; -import { Container } from 'typedi'; import type { SecretsProviderSettings, SecretsProviderState } from '@/interfaces'; import { SecretsProvider } from '@/interfaces'; diff --git a/packages/cli/src/help.ts b/packages/cli/src/help.ts index 168b9c907933e..9213048fdd70d 100644 --- a/packages/cli/src/help.ts +++ b/packages/cli/src/help.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import { Help } from '@oclif/core'; import { Logger } from 'n8n-core'; -import { Container } from 'typedi'; // oclif expects a default export // eslint-disable-next-line import/no-default-export diff --git a/packages/cli/src/ldap.ee/helpers.ee.ts b/packages/cli/src/ldap.ee/helpers.ee.ts index 7af09170548d3..dcc643d8080d3 100644 --- a/packages/cli/src/ldap.ee/helpers.ee.ts +++ b/packages/cli/src/ldap.ee/helpers.ee.ts @@ -1,8 +1,8 @@ +import { Container } from '@n8n/di'; import { validate } from 'jsonschema'; import type { Entry as LdapUser } from 'ldapts'; import { Filter } from 'ldapts/filters/Filter'; import { randomString } from 'n8n-workflow'; -import { Container } from 'typedi'; import config from '@/config'; import { AuthIdentity } from '@/databases/entities/auth-identity'; diff --git a/packages/cli/src/ldap.ee/ldap.service.ee.ts b/packages/cli/src/ldap.ee/ldap.service.ee.ts index 9a794bd5fc8f4..a4d9cbc97d901 100644 --- a/packages/cli/src/ldap.ee/ldap.service.ee.ts +++ b/packages/cli/src/ldap.ee/ldap.service.ee.ts @@ -1,3 +1,4 @@ +import { Service } from '@n8n/di'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import { QueryFailedError } from '@n8n/typeorm'; import type { Entry as LdapUser, ClientOptions } from 'ldapts'; @@ -5,7 +6,6 @@ import { Client } from 'ldapts'; import { Cipher, Logger } from 'n8n-core'; import { ApplicationError, jsonParse } from 'n8n-workflow'; import type { ConnectionOptions } from 'tls'; -import { Service } from 'typedi'; import config from '@/config'; import type { RunningMode, SyncStatus } from '@/databases/entities/auth-provider-sync-history'; diff --git a/packages/cli/src/license.ts b/packages/cli/src/license.ts index ded98d3f3c01c..7a747530c2caa 100644 --- a/packages/cli/src/license.ts +++ b/packages/cli/src/license.ts @@ -1,8 +1,8 @@ import { GlobalConfig } from '@n8n/config'; +import { Container, Service } from '@n8n/di'; import type { TEntitlement, TFeatures, TLicenseBlock } from '@n8n_io/license-sdk'; import { LicenseManager } from '@n8n_io/license-sdk'; import { InstanceSettings, ObjectStoreService, Logger } from 'n8n-core'; -import Container, { Service } from 'typedi'; import config from '@/config'; import { SettingsRepository } from '@/databases/repositories/settings.repository'; diff --git a/packages/cli/src/license/license.service.ts b/packages/cli/src/license/license.service.ts index 750b42b432381..bd2eca414ccdc 100644 --- a/packages/cli/src/license/license.service.ts +++ b/packages/cli/src/license/license.service.ts @@ -1,7 +1,7 @@ +import { Service } from '@n8n/di'; import axios, { AxiosError } from 'axios'; import { Logger } from 'n8n-core'; import { ensureError } from 'n8n-workflow'; -import { Service } from 'typedi'; import type { User } from '@/databases/entities/user'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; diff --git a/packages/cli/src/load-nodes-and-credentials.ts b/packages/cli/src/load-nodes-and-credentials.ts index e462bd4157861..b027192388c7f 100644 --- a/packages/cli/src/load-nodes-and-credentials.ts +++ b/packages/cli/src/load-nodes-and-credentials.ts @@ -1,4 +1,5 @@ import { GlobalConfig } from '@n8n/config'; +import { Container, Service } from '@n8n/di'; import glob from 'fast-glob'; import fsPromises from 'fs/promises'; import type { Class, DirectoryLoader, Types } from 'n8n-core'; @@ -28,7 +29,6 @@ import type { import { ApplicationError, NodeConnectionType } from 'n8n-workflow'; import path from 'path'; import picocolors from 'picocolors'; -import { Container, Service } from 'typedi'; import { CUSTOM_API_CALL_KEY, diff --git a/packages/cli/src/manual-execution.service.ts b/packages/cli/src/manual-execution.service.ts index c6749696feb6b..fd6c27215f082 100644 --- a/packages/cli/src/manual-execution.service.ts +++ b/packages/cli/src/manual-execution.service.ts @@ -1,3 +1,4 @@ +import { Service } from '@n8n/di'; import * as a from 'assert/strict'; import { DirectedGraph, @@ -15,7 +16,6 @@ import type { Workflow, } from 'n8n-workflow'; import type PCancelable from 'p-cancelable'; -import { Service } from 'typedi'; @Service() export class ManualExecutionService { diff --git a/packages/cli/src/metrics/license-metrics.service.ts b/packages/cli/src/metrics/license-metrics.service.ts index 338fa70a3e72a..bd4ca6055ba09 100644 --- a/packages/cli/src/metrics/license-metrics.service.ts +++ b/packages/cli/src/metrics/license-metrics.service.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import { LicenseMetricsRepository } from '@/databases/repositories/license-metrics.repository'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; diff --git a/packages/cli/src/metrics/prometheus-metrics.service.ts b/packages/cli/src/metrics/prometheus-metrics.service.ts index 41714d25adff0..b17b8f85783ad 100644 --- a/packages/cli/src/metrics/prometheus-metrics.service.ts +++ b/packages/cli/src/metrics/prometheus-metrics.service.ts @@ -1,11 +1,11 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import type express from 'express'; import promBundle from 'express-prom-bundle'; import { InstanceSettings } from 'n8n-core'; import { EventMessageTypeNames } from 'n8n-workflow'; import promClient, { type Counter, type Gauge } from 'prom-client'; import semverParse from 'semver/functions/parse'; -import { Service } from 'typedi'; import config from '@/config'; import { N8N_VERSION } from '@/constants'; diff --git a/packages/cli/src/mfa/helpers.ts b/packages/cli/src/mfa/helpers.ts index d08ed98c16894..9e785d293cefa 100644 --- a/packages/cli/src/mfa/helpers.ts +++ b/packages/cli/src/mfa/helpers.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import config from '@/config'; import { UserRepository } from '@/databases/repositories/user.repository'; diff --git a/packages/cli/src/mfa/mfa.service.ts b/packages/cli/src/mfa/mfa.service.ts index 84433f5f18919..19bc9aead02fc 100644 --- a/packages/cli/src/mfa/mfa.service.ts +++ b/packages/cli/src/mfa/mfa.service.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { Cipher } from 'n8n-core'; -import { Service } from 'typedi'; import { v4 as uuid } from 'uuid'; import { AuthUserRepository } from '@/databases/repositories/auth-user.repository'; diff --git a/packages/cli/src/mfa/totp.service.ts b/packages/cli/src/mfa/totp.service.ts index ec9f651635b63..5d543fd2b16da 100644 --- a/packages/cli/src/mfa/totp.service.ts +++ b/packages/cli/src/mfa/totp.service.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import OTPAuth from 'otpauth'; -import { Service } from 'typedi'; @Service() export class TOTPService { diff --git a/packages/cli/src/middlewares/body-parser.ts b/packages/cli/src/middlewares/body-parser.ts index 59327ea080e0e..699ff72c6b970 100644 --- a/packages/cli/src/middlewares/body-parser.ts +++ b/packages/cli/src/middlewares/body-parser.ts @@ -1,11 +1,11 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import type { Request, RequestHandler } from 'express'; import { parseIncomingMessage } from 'n8n-core'; import { jsonParse } from 'n8n-workflow'; import { parse as parseQueryString } from 'querystring'; import getRawBody from 'raw-body'; import { type Readable } from 'stream'; -import Container from 'typedi'; import { Parser as XmlParser } from 'xml2js'; import { createGunzip, createInflate } from 'zlib'; diff --git a/packages/cli/src/node-types.ts b/packages/cli/src/node-types.ts index 1837cd7bcc4cb..77d872dc26af7 100644 --- a/packages/cli/src/node-types.ts +++ b/packages/cli/src/node-types.ts @@ -1,10 +1,10 @@ +import { Service } from '@n8n/di'; import type { NeededNodeType } from '@n8n/task-runner'; import type { Dirent } from 'fs'; import { readdir } from 'fs/promises'; import type { INodeType, INodeTypeDescription, INodeTypes, IVersionedNodeType } from 'n8n-workflow'; import { ApplicationError, NodeHelpers } from 'n8n-workflow'; import { join, dirname } from 'path'; -import { Service } from 'typedi'; import { LoadNodesAndCredentials } from './load-nodes-and-credentials'; diff --git a/packages/cli/src/permissions.ee/check-access.ts b/packages/cli/src/permissions.ee/check-access.ts index f4abfcc00ff25..062e3c1865759 100644 --- a/packages/cli/src/permissions.ee/check-access.ts +++ b/packages/cli/src/permissions.ee/check-access.ts @@ -1,8 +1,8 @@ +import { Container } from '@n8n/di'; import type { Scope } from '@n8n/permissions'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import { In } from '@n8n/typeorm'; import { ApplicationError } from 'n8n-workflow'; -import { Container } from 'typedi'; import type { User } from '@/databases/entities/user'; import { ProjectRepository } from '@/databases/repositories/project.repository'; diff --git a/packages/cli/src/posthog/index.ts b/packages/cli/src/posthog/index.ts index be025c8a85050..6dcc6dd650c8d 100644 --- a/packages/cli/src/posthog/index.ts +++ b/packages/cli/src/posthog/index.ts @@ -1,8 +1,8 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import { InstanceSettings } from 'n8n-core'; import type { FeatureFlags, ITelemetryTrackProperties } from 'n8n-workflow'; import type { PostHog } from 'posthog-node'; -import { Service } from 'typedi'; import type { PublicUser } from '@/interfaces'; diff --git a/packages/cli/src/public-api/index.ts b/packages/cli/src/public-api/index.ts index 92b360282845f..1696135990552 100644 --- a/packages/cli/src/public-api/index.ts +++ b/packages/cli/src/public-api/index.ts @@ -1,11 +1,11 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import type { Router } from 'express'; import express from 'express'; import type { HttpError } from 'express-openapi-validator/dist/framework/types'; import fs from 'fs/promises'; import path from 'path'; import type { JsonObject } from 'swagger-ui-express'; -import { Container } from 'typedi'; import validator from 'validator'; import YAML from 'yamljs'; diff --git a/packages/cli/src/public-api/v1/handlers/audit/audit.handler.ts b/packages/cli/src/public-api/v1/handlers/audit/audit.handler.ts index eb611d9ba5664..595dd0cf42b01 100644 --- a/packages/cli/src/public-api/v1/handlers/audit/audit.handler.ts +++ b/packages/cli/src/public-api/v1/handlers/audit/audit.handler.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import type { Response } from 'express'; -import Container from 'typedi'; import type { AuditRequest } from '@/public-api/types'; import { globalScope } from '@/public-api/v1/shared/middlewares/global.middleware'; diff --git a/packages/cli/src/public-api/v1/handlers/credentials/credentials.handler.ts b/packages/cli/src/public-api/v1/handlers/credentials/credentials.handler.ts index d987aa827ef8e..ef029cdaf6f31 100644 --- a/packages/cli/src/public-api/v1/handlers/credentials/credentials.handler.ts +++ b/packages/cli/src/public-api/v1/handlers/credentials/credentials.handler.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-unsafe-argument */ +import { Container } from '@n8n/di'; import type express from 'express'; -import { Container } from 'typedi'; import { z } from 'zod'; import { CredentialTypes } from '@/credential-types'; diff --git a/packages/cli/src/public-api/v1/handlers/credentials/credentials.middleware.ts b/packages/cli/src/public-api/v1/handlers/credentials/credentials.middleware.ts index 59ebb7b6d0627..181092a9b99a0 100644 --- a/packages/cli/src/public-api/v1/handlers/credentials/credentials.middleware.ts +++ b/packages/cli/src/public-api/v1/handlers/credentials/credentials.middleware.ts @@ -1,8 +1,8 @@ /* eslint-disable @typescript-eslint/no-invalid-void-type */ +import { Container } from '@n8n/di'; import type express from 'express'; import { validate } from 'jsonschema'; -import { Container } from 'typedi'; import { CredentialTypes } from '@/credential-types'; import { CredentialsHelper } from '@/credentials-helper'; diff --git a/packages/cli/src/public-api/v1/handlers/credentials/credentials.service.ts b/packages/cli/src/public-api/v1/handlers/credentials/credentials.service.ts index 2477ef928f807..4e2754a12e66f 100644 --- a/packages/cli/src/public-api/v1/handlers/credentials/credentials.service.ts +++ b/packages/cli/src/public-api/v1/handlers/credentials/credentials.service.ts @@ -1,3 +1,4 @@ +import { Container } from '@n8n/di'; import { Credentials } from 'n8n-core'; import type { DisplayCondition, @@ -5,7 +6,6 @@ import type { INodeProperties, INodePropertyOptions, } from 'n8n-workflow'; -import { Container } from 'typedi'; import { CredentialsEntity } from '@/databases/entities/credentials-entity'; import { SharedCredentials } from '@/databases/entities/shared-credentials'; diff --git a/packages/cli/src/public-api/v1/handlers/executions/executions.handler.ts b/packages/cli/src/public-api/v1/handlers/executions/executions.handler.ts index 896a4f2d0dcef..1eedc8de8b4d1 100644 --- a/packages/cli/src/public-api/v1/handlers/executions/executions.handler.ts +++ b/packages/cli/src/public-api/v1/handlers/executions/executions.handler.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import type express from 'express'; import { replaceCircularReferences } from 'n8n-workflow'; -import { Container } from 'typedi'; import { ActiveExecutions } from '@/active-executions'; import { ConcurrencyControlService } from '@/concurrency/concurrency-control.service'; diff --git a/packages/cli/src/public-api/v1/handlers/projects/projects.handler.ts b/packages/cli/src/public-api/v1/handlers/projects/projects.handler.ts index ea7220f7880d4..a693058f93507 100644 --- a/packages/cli/src/public-api/v1/handlers/projects/projects.handler.ts +++ b/packages/cli/src/public-api/v1/handlers/projects/projects.handler.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import type { Response } from 'express'; -import Container from 'typedi'; import { ProjectController } from '@/controllers/project.controller'; import { ProjectRepository } from '@/databases/repositories/project.repository'; diff --git a/packages/cli/src/public-api/v1/handlers/source-control/source-control.handler.ts b/packages/cli/src/public-api/v1/handlers/source-control/source-control.handler.ts index 6f960980ca715..646a3f075e222 100644 --- a/packages/cli/src/public-api/v1/handlers/source-control/source-control.handler.ts +++ b/packages/cli/src/public-api/v1/handlers/source-control/source-control.handler.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import type express from 'express'; import type { StatusResult } from 'simple-git'; -import { Container } from 'typedi'; import { getTrackingInformationFromPullResult, diff --git a/packages/cli/src/public-api/v1/handlers/tags/tags.handler.ts b/packages/cli/src/public-api/v1/handlers/tags/tags.handler.ts index daf5d78414e28..821be0c5fd29c 100644 --- a/packages/cli/src/public-api/v1/handlers/tags/tags.handler.ts +++ b/packages/cli/src/public-api/v1/handlers/tags/tags.handler.ts @@ -1,7 +1,7 @@ +import { Container } from '@n8n/di'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import type { FindManyOptions } from '@n8n/typeorm'; import type express from 'express'; -import { Container } from 'typedi'; import type { TagEntity } from '@/databases/entities/tag-entity'; import { TagRepository } from '@/databases/repositories/tag.repository'; diff --git a/packages/cli/src/public-api/v1/handlers/users/users.handler.ee.ts b/packages/cli/src/public-api/v1/handlers/users/users.handler.ee.ts index e6c36be3ce421..1a544aca292e7 100644 --- a/packages/cli/src/public-api/v1/handlers/users/users.handler.ee.ts +++ b/packages/cli/src/public-api/v1/handlers/users/users.handler.ee.ts @@ -1,7 +1,7 @@ import { InviteUsersRequestDto, RoleChangeRequestDto } from '@n8n/api-types'; +import { Container } from '@n8n/di'; import type express from 'express'; import type { Response } from 'express'; -import { Container } from 'typedi'; import { InvitationController } from '@/controllers/invitation.controller'; import { UsersController } from '@/controllers/users.controller'; diff --git a/packages/cli/src/public-api/v1/handlers/users/users.service.ee.ts b/packages/cli/src/public-api/v1/handlers/users/users.service.ee.ts index f4e1b868787c5..fa50ce3cf0eab 100644 --- a/packages/cli/src/public-api/v1/handlers/users/users.service.ee.ts +++ b/packages/cli/src/public-api/v1/handlers/users/users.service.ee.ts @@ -1,7 +1,7 @@ +import { Container } from '@n8n/di'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import { In } from '@n8n/typeorm'; import pick from 'lodash/pick'; -import { Container } from 'typedi'; import { validate as uuidValidate } from 'uuid'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/public-api/v1/handlers/variables/variables.handler.ts b/packages/cli/src/public-api/v1/handlers/variables/variables.handler.ts index 9e5b6dabe6dee..d3eec9b2d5e05 100644 --- a/packages/cli/src/public-api/v1/handlers/variables/variables.handler.ts +++ b/packages/cli/src/public-api/v1/handlers/variables/variables.handler.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import type { Response } from 'express'; -import Container from 'typedi'; import { VariablesRepository } from '@/databases/repositories/variables.repository'; import { VariablesController } from '@/environments.ee/variables/variables.controller.ee'; diff --git a/packages/cli/src/public-api/v1/handlers/workflows/workflows.handler.ts b/packages/cli/src/public-api/v1/handlers/workflows/workflows.handler.ts index 500eaf0d13fa1..b79ea4547bf2b 100644 --- a/packages/cli/src/public-api/v1/handlers/workflows/workflows.handler.ts +++ b/packages/cli/src/public-api/v1/handlers/workflows/workflows.handler.ts @@ -1,9 +1,9 @@ +import { Container } from '@n8n/di'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import type { FindOptionsWhere } from '@n8n/typeorm'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import { In, Like, QueryFailedError } from '@n8n/typeorm'; import type express from 'express'; -import { Container } from 'typedi'; import { v4 as uuid } from 'uuid'; import { z } from 'zod'; diff --git a/packages/cli/src/public-api/v1/handlers/workflows/workflows.service.ts b/packages/cli/src/public-api/v1/handlers/workflows/workflows.service.ts index f4a2d38156dab..53e67d8b0dc7b 100644 --- a/packages/cli/src/public-api/v1/handlers/workflows/workflows.service.ts +++ b/packages/cli/src/public-api/v1/handlers/workflows/workflows.service.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import type { Scope } from '@n8n/permissions'; -import { Container } from 'typedi'; import config from '@/config'; import type { Project } from '@/databases/entities/project'; diff --git a/packages/cli/src/public-api/v1/shared/middlewares/global.middleware.ts b/packages/cli/src/public-api/v1/shared/middlewares/global.middleware.ts index ace75ef6102fb..3343d8daac1ac 100644 --- a/packages/cli/src/public-api/v1/shared/middlewares/global.middleware.ts +++ b/packages/cli/src/public-api/v1/shared/middlewares/global.middleware.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-invalid-void-type */ +import { Container } from '@n8n/di'; import type { Scope } from '@n8n/permissions'; import type express from 'express'; -import { Container } from 'typedi'; import { FeatureNotLicensedError } from '@/errors/feature-not-licensed.error'; import type { BooleanLicenseFeature } from '@/interfaces'; diff --git a/packages/cli/src/push/__tests__/websocket.push.test.ts b/packages/cli/src/push/__tests__/websocket.push.test.ts index c13a319ebf27a..64a552630064f 100644 --- a/packages/cli/src/push/__tests__/websocket.push.test.ts +++ b/packages/cli/src/push/__tests__/websocket.push.test.ts @@ -1,7 +1,7 @@ import type { PushMessage } from '@n8n/api-types'; +import { Container } from '@n8n/di'; import { EventEmitter } from 'events'; import { Logger } from 'n8n-core'; -import { Container } from 'typedi'; import type WebSocket from 'ws'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/push/abstract.push.ts b/packages/cli/src/push/abstract.push.ts index b1c4514d8d6f6..d42fddb556213 100644 --- a/packages/cli/src/push/abstract.push.ts +++ b/packages/cli/src/push/abstract.push.ts @@ -1,7 +1,7 @@ import type { PushMessage } from '@n8n/api-types'; +import { Service } from '@n8n/di'; import { ErrorReporter, Logger } from 'n8n-core'; import { assert, jsonStringify } from 'n8n-workflow'; -import { Service } from 'typedi'; import type { User } from '@/databases/entities/user'; import type { OnPushMessage } from '@/push/types'; diff --git a/packages/cli/src/push/index.ts b/packages/cli/src/push/index.ts index 7325981d0bba5..7cb7a07437df3 100644 --- a/packages/cli/src/push/index.ts +++ b/packages/cli/src/push/index.ts @@ -1,10 +1,10 @@ import type { PushMessage } from '@n8n/api-types'; +import { Container, Service } from '@n8n/di'; import type { Application } from 'express'; import { ServerResponse } from 'http'; import type { Server } from 'http'; import { InstanceSettings } from 'n8n-core'; import type { Socket } from 'net'; -import { Container, Service } from 'typedi'; import { parse as parseUrl } from 'url'; import { Server as WSServer } from 'ws'; diff --git a/packages/cli/src/push/sse.push.ts b/packages/cli/src/push/sse.push.ts index 04e39d6d79664..9c92cc8cb30ab 100644 --- a/packages/cli/src/push/sse.push.ts +++ b/packages/cli/src/push/sse.push.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/push/websocket.push.ts b/packages/cli/src/push/websocket.push.ts index 97e45028b2bb7..297490f6cf417 100644 --- a/packages/cli/src/push/websocket.push.ts +++ b/packages/cli/src/push/websocket.push.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { ApplicationError } from 'n8n-workflow'; -import { Service } from 'typedi'; import type WebSocket from 'ws'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/response-helper.ts b/packages/cli/src/response-helper.ts index f7f448cc9dc6f..74f274560e0d3 100644 --- a/packages/cli/src/response-helper.ts +++ b/packages/cli/src/response-helper.ts @@ -1,10 +1,10 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ +import { Container } from '@n8n/di'; import type { Request, Response } from 'express'; import { ErrorReporter, Logger } from 'n8n-core'; import { FORM_TRIGGER_PATH_IDENTIFIER, NodeApiError } from 'n8n-workflow'; import { Readable } from 'node:stream'; import picocolors from 'picocolors'; -import Container from 'typedi'; import { inDevelopment } from '@/constants'; diff --git a/packages/cli/src/runners/auth/task-runner-auth.controller.ts b/packages/cli/src/runners/auth/task-runner-auth.controller.ts index a117dfca0dc4d..80bb444ab1d5d 100644 --- a/packages/cli/src/runners/auth/task-runner-auth.controller.ts +++ b/packages/cli/src/runners/auth/task-runner-auth.controller.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import type { NextFunction, Response } from 'express'; -import { Service } from 'typedi'; import type { AuthlessRequest } from '@/requests'; diff --git a/packages/cli/src/runners/auth/task-runner-auth.service.ts b/packages/cli/src/runners/auth/task-runner-auth.service.ts index 5907cf66783fb..c16afc5c639a7 100644 --- a/packages/cli/src/runners/auth/task-runner-auth.service.ts +++ b/packages/cli/src/runners/auth/task-runner-auth.service.ts @@ -1,6 +1,6 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import { randomBytes } from 'crypto'; -import { Service } from 'typedi'; import { Time } from '@/constants'; import { CacheService } from '@/services/cache/cache.service'; diff --git a/packages/cli/src/runners/default-task-runner-disconnect-analyzer.ts b/packages/cli/src/runners/default-task-runner-disconnect-analyzer.ts index 9db537ee9556b..d98d7e58ace66 100644 --- a/packages/cli/src/runners/default-task-runner-disconnect-analyzer.ts +++ b/packages/cli/src/runners/default-task-runner-disconnect-analyzer.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import config from '@/config'; diff --git a/packages/cli/src/runners/internal-task-runner-disconnect-analyzer.ts b/packages/cli/src/runners/internal-task-runner-disconnect-analyzer.ts index 26d8de568352c..c2293a96ee75b 100644 --- a/packages/cli/src/runners/internal-task-runner-disconnect-analyzer.ts +++ b/packages/cli/src/runners/internal-task-runner-disconnect-analyzer.ts @@ -1,5 +1,5 @@ import { TaskRunnersConfig } from '@n8n/config'; -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import { DefaultTaskRunnerDisconnectAnalyzer } from './default-task-runner-disconnect-analyzer'; import { TaskRunnerOomError } from './errors/task-runner-oom-error'; diff --git a/packages/cli/src/runners/runner-lifecycle-events.ts b/packages/cli/src/runners/runner-lifecycle-events.ts index 8ea2da38b183d..de5846c3039fd 100644 --- a/packages/cli/src/runners/runner-lifecycle-events.ts +++ b/packages/cli/src/runners/runner-lifecycle-events.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import { TypedEmitter } from '@/typed-emitter'; diff --git a/packages/cli/src/runners/runner-ws-server.ts b/packages/cli/src/runners/runner-ws-server.ts index 53b8f18cf8f71..b19af9435ea3b 100644 --- a/packages/cli/src/runners/runner-ws-server.ts +++ b/packages/cli/src/runners/runner-ws-server.ts @@ -1,8 +1,8 @@ import { TaskRunnersConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import type { BrokerMessage, RunnerMessage } from '@n8n/task-runner'; import { Logger } from 'n8n-core'; import { ApplicationError, jsonStringify } from 'n8n-workflow'; -import { Service } from 'typedi'; import type WebSocket from 'ws'; import { Time, WsStatusCodes } from '@/constants'; diff --git a/packages/cli/src/runners/task-broker.service.ts b/packages/cli/src/runners/task-broker.service.ts index ebbed80860b50..60cb6478a815d 100644 --- a/packages/cli/src/runners/task-broker.service.ts +++ b/packages/cli/src/runners/task-broker.service.ts @@ -1,4 +1,5 @@ import { TaskRunnersConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import type { BrokerMessage, RequesterMessage, @@ -8,7 +9,6 @@ import type { import { Logger } from 'n8n-core'; import { ApplicationError } from 'n8n-workflow'; import { nanoid } from 'nanoid'; -import { Service } from 'typedi'; import config from '@/config'; import { Time } from '@/constants'; diff --git a/packages/cli/src/runners/task-managers/local-task-manager.ts b/packages/cli/src/runners/task-managers/local-task-manager.ts index 7d898aaebea38..418de20562e91 100644 --- a/packages/cli/src/runners/task-managers/local-task-manager.ts +++ b/packages/cli/src/runners/task-managers/local-task-manager.ts @@ -1,5 +1,5 @@ +import { Container, Service } from '@n8n/di'; import type { RequesterMessage } from '@n8n/task-runner'; -import Container, { Service } from 'typedi'; import { NodeTypes } from '@/node-types'; diff --git a/packages/cli/src/runners/task-managers/task-manager.ts b/packages/cli/src/runners/task-managers/task-manager.ts index 44193f9377a17..46d467180ea6a 100644 --- a/packages/cli/src/runners/task-managers/task-manager.ts +++ b/packages/cli/src/runners/task-managers/task-manager.ts @@ -1,3 +1,4 @@ +import { Service } from '@n8n/di'; import type { TaskResultData, RequesterMessage, BrokerMessage, TaskData } from '@n8n/task-runner'; import { AVAILABLE_RPC_METHODS } from '@n8n/task-runner'; import { isSerializedBuffer, toBuffer } from 'n8n-core'; @@ -18,7 +19,6 @@ import type { Result, } from 'n8n-workflow'; import { nanoid } from 'nanoid'; -import { Service } from 'typedi'; import { NodeTypes } from '@/node-types'; diff --git a/packages/cli/src/runners/task-runner-module.ts b/packages/cli/src/runners/task-runner-module.ts index 97f3f4e481c71..5dc3732c81a46 100644 --- a/packages/cli/src/runners/task-runner-module.ts +++ b/packages/cli/src/runners/task-runner-module.ts @@ -1,8 +1,8 @@ import { TaskRunnersConfig } from '@n8n/config'; +import { Container, Service } from '@n8n/di'; import { ErrorReporter, Logger } from 'n8n-core'; import { sleep } from 'n8n-workflow'; import * as a from 'node:assert/strict'; -import Container, { Service } from 'typedi'; import { OnShutdown } from '@/decorators/on-shutdown'; import type { TaskRunnerRestartLoopError } from '@/runners/errors/task-runner-restart-loop-error'; diff --git a/packages/cli/src/runners/task-runner-process.ts b/packages/cli/src/runners/task-runner-process.ts index 668792994212e..e672adecf393d 100644 --- a/packages/cli/src/runners/task-runner-process.ts +++ b/packages/cli/src/runners/task-runner-process.ts @@ -1,9 +1,9 @@ import { TaskRunnersConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import { Logger } from 'n8n-core'; import * as a from 'node:assert/strict'; import { spawn } from 'node:child_process'; import * as process from 'node:process'; -import { Service } from 'typedi'; import { OnShutdown } from '@/decorators/on-shutdown'; diff --git a/packages/cli/src/runners/task-runner-server.ts b/packages/cli/src/runners/task-runner-server.ts index bbe1d7cd6adeb..30e97c9ac0e04 100644 --- a/packages/cli/src/runners/task-runner-server.ts +++ b/packages/cli/src/runners/task-runner-server.ts @@ -1,4 +1,5 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import compression from 'compression'; import express from 'express'; import { Logger } from 'n8n-core'; @@ -7,7 +8,6 @@ import { randomBytes } from 'node:crypto'; import { ServerResponse, type Server, createServer as createHttpServer } from 'node:http'; import type { AddressInfo, Socket } from 'node:net'; import { parse as parseUrl } from 'node:url'; -import { Service } from 'typedi'; import { Server as WSServer } from 'ws'; import { inTest } from '@/constants'; diff --git a/packages/cli/src/scaling/__tests__/scaling.service.test.ts b/packages/cli/src/scaling/__tests__/scaling.service.test.ts index b400bf6dfbbb7..885c45f0db74c 100644 --- a/packages/cli/src/scaling/__tests__/scaling.service.test.ts +++ b/packages/cli/src/scaling/__tests__/scaling.service.test.ts @@ -1,9 +1,9 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import * as BullModule from 'bull'; import { mock } from 'jest-mock-extended'; import { InstanceSettings } from 'n8n-core'; import { ApplicationError } from 'n8n-workflow'; -import Container from 'typedi'; import { mockInstance, mockLogger } from '@test/mocking'; diff --git a/packages/cli/src/scaling/job-processor.ts b/packages/cli/src/scaling/job-processor.ts index 5e760e40c1063..dc312aa0aa3c2 100644 --- a/packages/cli/src/scaling/job-processor.ts +++ b/packages/cli/src/scaling/job-processor.ts @@ -1,9 +1,9 @@ import type { RunningJobSummary } from '@n8n/api-types'; +import { Service } from '@n8n/di'; import { ErrorReporter, InstanceSettings, WorkflowExecute, Logger } from 'n8n-core'; import type { ExecutionStatus, IExecuteResponsePromiseData, IRun } from 'n8n-workflow'; import { BINARY_ENCODING, ApplicationError, Workflow } from 'n8n-workflow'; import type PCancelable from 'p-cancelable'; -import { Service } from 'typedi'; import config from '@/config'; import { ExecutionRepository } from '@/databases/repositories/execution.repository'; diff --git a/packages/cli/src/scaling/multi-main-setup.ee.ts b/packages/cli/src/scaling/multi-main-setup.ee.ts index 1a2554965c24e..52f186bdcc8ad 100644 --- a/packages/cli/src/scaling/multi-main-setup.ee.ts +++ b/packages/cli/src/scaling/multi-main-setup.ee.ts @@ -1,6 +1,6 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import { InstanceSettings, Logger } from 'n8n-core'; -import { Service } from 'typedi'; import config from '@/config'; import { Time } from '@/constants'; diff --git a/packages/cli/src/scaling/pubsub/publisher.service.ts b/packages/cli/src/scaling/pubsub/publisher.service.ts index 551d1b6caf02f..a0d2079704b8c 100644 --- a/packages/cli/src/scaling/pubsub/publisher.service.ts +++ b/packages/cli/src/scaling/pubsub/publisher.service.ts @@ -1,7 +1,7 @@ +import { Service } from '@n8n/di'; import type { Redis as SingleNodeClient, Cluster as MultiNodeClient } from 'ioredis'; import { InstanceSettings, Logger } from 'n8n-core'; import type { LogMetadata } from 'n8n-workflow'; -import { Service } from 'typedi'; import config from '@/config'; import { RedisClientService } from '@/services/redis-client.service'; diff --git a/packages/cli/src/scaling/pubsub/pubsub-handler.ts b/packages/cli/src/scaling/pubsub/pubsub-handler.ts index 10a763f8f1db2..a42759306c80e 100644 --- a/packages/cli/src/scaling/pubsub/pubsub-handler.ts +++ b/packages/cli/src/scaling/pubsub/pubsub-handler.ts @@ -1,6 +1,6 @@ +import { Service } from '@n8n/di'; import { InstanceSettings } from 'n8n-core'; import { ensureError } from 'n8n-workflow'; -import { Service } from 'typedi'; import { ActiveWorkflowManager } from '@/active-workflow-manager'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; diff --git a/packages/cli/src/scaling/pubsub/subscriber.service.ts b/packages/cli/src/scaling/pubsub/subscriber.service.ts index c2d5498243006..4d2b5e3314576 100644 --- a/packages/cli/src/scaling/pubsub/subscriber.service.ts +++ b/packages/cli/src/scaling/pubsub/subscriber.service.ts @@ -1,9 +1,9 @@ +import { Service } from '@n8n/di'; import type { Redis as SingleNodeClient, Cluster as MultiNodeClient } from 'ioredis'; import debounce from 'lodash/debounce'; import { InstanceSettings, Logger } from 'n8n-core'; import { jsonParse } from 'n8n-workflow'; import type { LogMetadata } from 'n8n-workflow'; -import { Service } from 'typedi'; import config from '@/config'; import { EventService } from '@/events/event.service'; diff --git a/packages/cli/src/scaling/scaling.service.ts b/packages/cli/src/scaling/scaling.service.ts index 5896e2976be42..c893a26e2e58e 100644 --- a/packages/cli/src/scaling/scaling.service.ts +++ b/packages/cli/src/scaling/scaling.service.ts @@ -1,9 +1,9 @@ import { GlobalConfig } from '@n8n/config'; +import { Container, Service } from '@n8n/di'; import { ErrorReporter, InstanceSettings, Logger } from 'n8n-core'; import { ApplicationError, BINARY_ENCODING, sleep, jsonStringify, ensureError } from 'n8n-workflow'; import type { IExecuteResponsePromiseData } from 'n8n-workflow'; import { strict } from 'node:assert'; -import Container, { Service } from 'typedi'; import { ActiveExecutions } from '@/active-executions'; import config from '@/config'; diff --git a/packages/cli/src/scaling/worker-server.ts b/packages/cli/src/scaling/worker-server.ts index 8112f3a4f5bdb..07b9533626f94 100644 --- a/packages/cli/src/scaling/worker-server.ts +++ b/packages/cli/src/scaling/worker-server.ts @@ -1,11 +1,11 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import type { Application } from 'express'; import express from 'express'; import { InstanceSettings, Logger } from 'n8n-core'; import { strict as assert } from 'node:assert'; import http from 'node:http'; import type { Server } from 'node:http'; -import { Service } from 'typedi'; import { CredentialsOverwrites } from '@/credentials-overwrites'; import * as Db from '@/db'; diff --git a/packages/cli/src/scaling/worker-status.service.ee.ts b/packages/cli/src/scaling/worker-status.service.ee.ts index a50a1b8d2e001..226ee3f70f964 100644 --- a/packages/cli/src/scaling/worker-status.service.ee.ts +++ b/packages/cli/src/scaling/worker-status.service.ee.ts @@ -1,7 +1,7 @@ import type { WorkerStatus } from '@n8n/api-types'; +import { Service } from '@n8n/di'; import { InstanceSettings } from 'n8n-core'; import os from 'node:os'; -import { Service } from 'typedi'; import { N8N_VERSION } from '@/constants'; diff --git a/packages/cli/src/secrets-helpers.ee.ts b/packages/cli/src/secrets-helpers.ee.ts index fdc18c4b85920..7390bf879506b 100644 --- a/packages/cli/src/secrets-helpers.ee.ts +++ b/packages/cli/src/secrets-helpers.ee.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import type { SecretsHelpersBase } from 'n8n-workflow'; -import { Service } from 'typedi'; import { ExternalSecretsManager } from './external-secrets.ee/external-secrets-manager.ee'; diff --git a/packages/cli/src/security-audit/risk-reporters/credentials-risk-reporter.ts b/packages/cli/src/security-audit/risk-reporters/credentials-risk-reporter.ts index 0c8d84211e0c2..ca8bf11415680 100644 --- a/packages/cli/src/security-audit/risk-reporters/credentials-risk-reporter.ts +++ b/packages/cli/src/security-audit/risk-reporters/credentials-risk-reporter.ts @@ -1,6 +1,6 @@ import { SecurityConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import type { IWorkflowBase } from 'n8n-workflow'; -import { Service } from 'typedi'; import type { WorkflowEntity } from '@/databases/entities/workflow-entity'; import { CredentialsRepository } from '@/databases/repositories/credentials.repository'; diff --git a/packages/cli/src/security-audit/risk-reporters/database-risk-reporter.ts b/packages/cli/src/security-audit/risk-reporters/database-risk-reporter.ts index 9dad0829aec94..f66ae02282e2d 100644 --- a/packages/cli/src/security-audit/risk-reporters/database-risk-reporter.ts +++ b/packages/cli/src/security-audit/risk-reporters/database-risk-reporter.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import type { WorkflowEntity as Workflow } from '@/databases/entities/workflow-entity'; import { diff --git a/packages/cli/src/security-audit/risk-reporters/filesystem-risk-reporter.ts b/packages/cli/src/security-audit/risk-reporters/filesystem-risk-reporter.ts index 645e6f8684aed..a73b152d2e232 100644 --- a/packages/cli/src/security-audit/risk-reporters/filesystem-risk-reporter.ts +++ b/packages/cli/src/security-audit/risk-reporters/filesystem-risk-reporter.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import type { WorkflowEntity } from '@/databases/entities/workflow-entity'; import { FILESYSTEM_INTERACTION_NODE_TYPES, FILESYSTEM_REPORT } from '@/security-audit/constants'; diff --git a/packages/cli/src/security-audit/risk-reporters/instance-risk-reporter.ts b/packages/cli/src/security-audit/risk-reporters/instance-risk-reporter.ts index 92874e87f05e1..8d870b5d76a33 100644 --- a/packages/cli/src/security-audit/risk-reporters/instance-risk-reporter.ts +++ b/packages/cli/src/security-audit/risk-reporters/instance-risk-reporter.ts @@ -1,7 +1,7 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import axios from 'axios'; import { InstanceSettings, Logger } from 'n8n-core'; -import { Service } from 'typedi'; import config from '@/config'; import { getN8nPackageJson, inDevelopment } from '@/constants'; diff --git a/packages/cli/src/security-audit/risk-reporters/nodes-risk-reporter.ts b/packages/cli/src/security-audit/risk-reporters/nodes-risk-reporter.ts index 4908ff9329543..58f6da5e18a2d 100644 --- a/packages/cli/src/security-audit/risk-reporters/nodes-risk-reporter.ts +++ b/packages/cli/src/security-audit/risk-reporters/nodes-risk-reporter.ts @@ -1,7 +1,7 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import glob from 'fast-glob'; import * as path from 'path'; -import { Service } from 'typedi'; import type { WorkflowEntity } from '@/databases/entities/workflow-entity'; import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials'; diff --git a/packages/cli/src/security-audit/security-audit.service.ts b/packages/cli/src/security-audit/security-audit.service.ts index 97b5424a19583..b0946b5409ee1 100644 --- a/packages/cli/src/security-audit/security-audit.service.ts +++ b/packages/cli/src/security-audit/security-audit.service.ts @@ -1,5 +1,5 @@ import { SecurityConfig } from '@n8n/config'; -import Container, { Service } from 'typedi'; +import { Container, Service } from '@n8n/di'; import config from '@/config'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; diff --git a/packages/cli/src/server.ts b/packages/cli/src/server.ts index b2b1c3a1c8bcf..09e3774aae842 100644 --- a/packages/cli/src/server.ts +++ b/packages/cli/src/server.ts @@ -1,10 +1,10 @@ +import { Container, Service } from '@n8n/di'; import cookieParser from 'cookie-parser'; import express from 'express'; import { access as fsAccess } from 'fs/promises'; import helmet from 'helmet'; import { InstanceSettings } from 'n8n-core'; import { resolve } from 'path'; -import { Container, Service } from 'typedi'; import { AbstractServer } from '@/abstract-server'; import config from '@/config'; diff --git a/packages/cli/src/services/__tests__/execution-metadata.service.test.ts b/packages/cli/src/services/__tests__/execution-metadata.service.test.ts index 4b713d6872cf4..309da5a3540d1 100644 --- a/packages/cli/src/services/__tests__/execution-metadata.service.test.ts +++ b/packages/cli/src/services/__tests__/execution-metadata.service.test.ts @@ -1,4 +1,4 @@ -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import { ExecutionMetadataRepository } from '@/databases/repositories/execution-metadata.repository'; import { ExecutionMetadataService } from '@/services/execution-metadata.service'; diff --git a/packages/cli/src/services/__tests__/orchestration.service.test.ts b/packages/cli/src/services/__tests__/orchestration.service.test.ts index 45e79036ac0d3..89c043a589e15 100644 --- a/packages/cli/src/services/__tests__/orchestration.service.test.ts +++ b/packages/cli/src/services/__tests__/orchestration.service.test.ts @@ -1,7 +1,7 @@ +import { Container } from '@n8n/di'; import type Redis from 'ioredis'; import { mock } from 'jest-mock-extended'; import { InstanceSettings } from 'n8n-core'; -import Container from 'typedi'; import { ActiveWorkflowManager } from '@/active-workflow-manager'; import config from '@/config'; diff --git a/packages/cli/src/services/__tests__/password.utility.test.ts b/packages/cli/src/services/__tests__/password.utility.test.ts index ff2956844b0a5..4662f7c32a80e 100644 --- a/packages/cli/src/services/__tests__/password.utility.test.ts +++ b/packages/cli/src/services/__tests__/password.utility.test.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import { PasswordUtility } from '@/services/password.utility'; diff --git a/packages/cli/src/services/__tests__/workflow-statistics.service.test.ts b/packages/cli/src/services/__tests__/workflow-statistics.service.test.ts index 6d28dbe563485..6336eb546a78e 100644 --- a/packages/cli/src/services/__tests__/workflow-statistics.service.test.ts +++ b/packages/cli/src/services/__tests__/workflow-statistics.service.test.ts @@ -1,4 +1,5 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import { QueryFailedError, type DataSource, @@ -8,7 +9,6 @@ import { import { mocked } from 'jest-mock'; import { mock } from 'jest-mock-extended'; import type { INode, IRun, WorkflowExecuteMode } from 'n8n-workflow'; -import { Container } from 'typedi'; import config from '@/config'; import type { Project } from '@/databases/entities/project'; diff --git a/packages/cli/src/services/access.service.ts b/packages/cli/src/services/access.service.ts index 49ac7bfe23589..7a7030b93ef1e 100644 --- a/packages/cli/src/services/access.service.ts +++ b/packages/cli/src/services/access.service.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import type { Workflow } from 'n8n-workflow'; -import { Service } from 'typedi'; import type { User } from '@/databases/entities/user'; import { SharedWorkflowRepository } from '@/databases/repositories/shared-workflow.repository'; diff --git a/packages/cli/src/services/active-workflows.service.ts b/packages/cli/src/services/active-workflows.service.ts index d2c50c74c2144..98b96af33a9fb 100644 --- a/packages/cli/src/services/active-workflows.service.ts +++ b/packages/cli/src/services/active-workflows.service.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { Logger } from 'n8n-core'; -import { Service } from 'typedi'; import { ActivationErrorsService } from '@/activation-errors.service'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/services/ai.service.ts b/packages/cli/src/services/ai.service.ts index 6a39306ef5ce0..32c6c8b0f9fff 100644 --- a/packages/cli/src/services/ai.service.ts +++ b/packages/cli/src/services/ai.service.ts @@ -4,9 +4,9 @@ import type { AiChatRequestDto, } from '@n8n/api-types'; import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import { AiAssistantClient } from '@n8n_io/ai-assistant-sdk'; import { assert, type IUser } from 'n8n-workflow'; -import { Service } from 'typedi'; import { N8N_VERSION } from '../constants'; import { License } from '../license'; diff --git a/packages/cli/src/services/annotation-tag.service.ee.ts b/packages/cli/src/services/annotation-tag.service.ee.ts index 671395168c0cf..9c56a7bee4ea9 100644 --- a/packages/cli/src/services/annotation-tag.service.ee.ts +++ b/packages/cli/src/services/annotation-tag.service.ee.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import type { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity.ee'; import { AnnotationTagRepository } from '@/databases/repositories/annotation-tag.repository.ee'; diff --git a/packages/cli/src/services/cache/__tests__/cache-mock.service.test.ts b/packages/cli/src/services/cache/__tests__/cache-mock.service.test.ts index d515aae5bec71..a6863997a5b9a 100644 --- a/packages/cli/src/services/cache/__tests__/cache-mock.service.test.ts +++ b/packages/cli/src/services/cache/__tests__/cache-mock.service.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; -import Container from 'typedi'; import { CacheService } from '@/services/cache/cache.service'; diff --git a/packages/cli/src/services/cache/__tests__/cache.service.test.ts b/packages/cli/src/services/cache/__tests__/cache.service.test.ts index e87e46984be15..5aaaf4b860ae2 100644 --- a/packages/cli/src/services/cache/__tests__/cache.service.test.ts +++ b/packages/cli/src/services/cache/__tests__/cache.service.test.ts @@ -1,6 +1,6 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import { sleep } from 'n8n-workflow'; -import Container from 'typedi'; import config from '@/config'; import { CacheService } from '@/services/cache/cache.service'; diff --git a/packages/cli/src/services/cache/cache.service.ts b/packages/cli/src/services/cache/cache.service.ts index f82bac3d02e7f..ab681d3e5bfb0 100644 --- a/packages/cli/src/services/cache/cache.service.ts +++ b/packages/cli/src/services/cache/cache.service.ts @@ -1,7 +1,7 @@ import { GlobalConfig } from '@n8n/config'; +import { Container, Service } from '@n8n/di'; import { caching } from 'cache-manager'; import { ApplicationError, jsonStringify } from 'n8n-workflow'; -import Container, { Service } from 'typedi'; import config from '@/config'; import { Time } from '@/constants'; diff --git a/packages/cli/src/services/community-packages.service.ts b/packages/cli/src/services/community-packages.service.ts index a94b4d5c4f784..c85872c5e21ee 100644 --- a/packages/cli/src/services/community-packages.service.ts +++ b/packages/cli/src/services/community-packages.service.ts @@ -1,11 +1,11 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import axios from 'axios'; import { exec } from 'child_process'; import { access as fsAccess, mkdir as fsMkdir } from 'fs/promises'; import type { PackageDirectoryLoader } from 'n8n-core'; import { InstanceSettings, Logger } from 'n8n-core'; import { ApplicationError, type PublicInstalledPackage } from 'n8n-workflow'; -import { Service } from 'typedi'; import { promisify } from 'util'; import { diff --git a/packages/cli/src/services/credentials-tester.service.ts b/packages/cli/src/services/credentials-tester.service.ts index 0709d77e06bb5..1954923481555 100644 --- a/packages/cli/src/services/credentials-tester.service.ts +++ b/packages/cli/src/services/credentials-tester.service.ts @@ -3,6 +3,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-unsafe-return */ /* eslint-disable @typescript-eslint/no-unsafe-call */ +import { Service } from '@n8n/di'; import get from 'lodash/get'; import { ErrorReporter, @@ -30,7 +31,6 @@ import type { IDataObject, } from 'n8n-workflow'; import { VersionedNodeType, NodeHelpers, Workflow, ApplicationError } from 'n8n-workflow'; -import { Service } from 'typedi'; import { CredentialTypes } from '@/credential-types'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/services/cta.service.ts b/packages/cli/src/services/cta.service.ts index 221674cfa7a52..ec0763dcda157 100644 --- a/packages/cli/src/services/cta.service.ts +++ b/packages/cli/src/services/cta.service.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import type { User } from '@/databases/entities/user'; import { WorkflowStatisticsRepository } from '@/databases/repositories/workflow-statistics.repository'; diff --git a/packages/cli/src/services/curl.service.ts b/packages/cli/src/services/curl.service.ts index 8875fd982820d..fae967154e208 100644 --- a/packages/cli/src/services/curl.service.ts +++ b/packages/cli/src/services/curl.service.ts @@ -1,7 +1,7 @@ +import { Service } from '@n8n/di'; import get from 'lodash/get'; import type { IDataObject } from 'n8n-workflow'; import { jsonParse } from 'n8n-workflow'; -import { Service } from 'typedi'; import curlconverter from 'curlconverter'; diff --git a/packages/cli/src/services/dynamic-node-parameters.service.ts b/packages/cli/src/services/dynamic-node-parameters.service.ts index 65c40ef0b647e..0cde1c8489448 100644 --- a/packages/cli/src/services/dynamic-node-parameters.service.ts +++ b/packages/cli/src/services/dynamic-node-parameters.service.ts @@ -1,3 +1,4 @@ +import { Service } from '@n8n/di'; import { LoadOptionsContext, RoutingNode, LocalLoadOptionsContext } from 'n8n-core'; import type { ILoadOptions, @@ -20,7 +21,6 @@ import type { ILocalLoadOptionsFunctions, } from 'n8n-workflow'; import { Workflow, ApplicationError } from 'n8n-workflow'; -import { Service } from 'typedi'; import { NodeTypes } from '@/node-types'; diff --git a/packages/cli/src/services/execution-metadata.service.ts b/packages/cli/src/services/execution-metadata.service.ts index b88b68f12f2c0..0c66b1daa2e5d 100644 --- a/packages/cli/src/services/execution-metadata.service.ts +++ b/packages/cli/src/services/execution-metadata.service.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import type { ExecutionMetadata } from '@/databases/entities/execution-metadata'; import { ExecutionMetadataRepository } from '@/databases/repositories/execution-metadata.repository'; diff --git a/packages/cli/src/services/frontend.service.ts b/packages/cli/src/services/frontend.service.ts index 34b4b3d6b9b69..099ae2c935255 100644 --- a/packages/cli/src/services/frontend.service.ts +++ b/packages/cli/src/services/frontend.service.ts @@ -1,12 +1,12 @@ import type { FrontendSettings, ITelemetrySettings } from '@n8n/api-types'; import { GlobalConfig, FrontendConfig, SecurityConfig } from '@n8n/config'; +import { Container, Service } from '@n8n/di'; import { createWriteStream } from 'fs'; import { mkdir } from 'fs/promises'; import uniq from 'lodash/uniq'; import { InstanceSettings, Logger } from 'n8n-core'; import type { ICredentialType, INodeTypeBaseDescription } from 'n8n-workflow'; import path from 'path'; -import { Container, Service } from 'typedi'; import config from '@/config'; import { inE2ETests, LICENSE_FEATURES, N8N_VERSION } from '@/constants'; diff --git a/packages/cli/src/services/hooks.service.ts b/packages/cli/src/services/hooks.service.ts index 19b2f8deb879c..2d2b137279726 100644 --- a/packages/cli/src/services/hooks.service.ts +++ b/packages/cli/src/services/hooks.service.ts @@ -1,9 +1,9 @@ +import { Service } from '@n8n/di'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import type { FindManyOptions, FindOneOptions, FindOptionsWhere } from '@n8n/typeorm'; import type { QueryDeepPartialEntity } from '@n8n/typeorm/query-builder/QueryPartialEntity'; import RudderStack, { type constructorOptions } from '@rudderstack/rudder-sdk-node'; import type { NextFunction, Response } from 'express'; -import { Service } from 'typedi'; import { AuthService } from '@/auth/auth.service'; import type { AuthUser } from '@/databases/entities/auth-user'; diff --git a/packages/cli/src/services/import.service.ts b/packages/cli/src/services/import.service.ts index 4f63357dd67a9..dcb7bff0ad58b 100644 --- a/packages/cli/src/services/import.service.ts +++ b/packages/cli/src/services/import.service.ts @@ -1,6 +1,6 @@ +import { Service } from '@n8n/di'; import { Logger } from 'n8n-core'; import { type INode, type INodeCredentialsDetails } from 'n8n-workflow'; -import { Service } from 'typedi'; import { v4 as uuid } from 'uuid'; import { Project } from '@/databases/entities/project'; diff --git a/packages/cli/src/services/jwt.service.ts b/packages/cli/src/services/jwt.service.ts index 8058de10dd283..060130901363e 100644 --- a/packages/cli/src/services/jwt.service.ts +++ b/packages/cli/src/services/jwt.service.ts @@ -1,7 +1,7 @@ +import { Service } from '@n8n/di'; import { createHash } from 'crypto'; import jwt from 'jsonwebtoken'; import { InstanceSettings } from 'n8n-core'; -import { Service } from 'typedi'; import config from '@/config'; diff --git a/packages/cli/src/services/naming.service.ts b/packages/cli/src/services/naming.service.ts index a715b2b360ed3..70384ac15aac6 100644 --- a/packages/cli/src/services/naming.service.ts +++ b/packages/cli/src/services/naming.service.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import { CredentialsRepository } from '@/databases/repositories/credentials.repository'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; diff --git a/packages/cli/src/services/orchestration.service.ts b/packages/cli/src/services/orchestration.service.ts index adf03d97bf230..2745108c69f04 100644 --- a/packages/cli/src/services/orchestration.service.ts +++ b/packages/cli/src/services/orchestration.service.ts @@ -1,6 +1,6 @@ import { GlobalConfig } from '@n8n/config'; +import { Container, Service } from '@n8n/di'; import { InstanceSettings } from 'n8n-core'; -import Container, { Service } from 'typedi'; import config from '@/config'; import type { Publisher } from '@/scaling/pubsub/publisher.service'; diff --git a/packages/cli/src/services/ownership.service.ts b/packages/cli/src/services/ownership.service.ts index 22403304a16ed..21ce4b573a50b 100644 --- a/packages/cli/src/services/ownership.service.ts +++ b/packages/cli/src/services/ownership.service.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import type { Project } from '@/databases/entities/project'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/services/password.utility.ts b/packages/cli/src/services/password.utility.ts index 352002fa95e05..f4119c47a0d73 100644 --- a/packages/cli/src/services/password.utility.ts +++ b/packages/cli/src/services/password.utility.ts @@ -1,5 +1,5 @@ +import { Service as Utility } from '@n8n/di'; import { compare, hash } from 'bcryptjs'; -import { Service as Utility } from 'typedi'; const SALT_ROUNDS = 10; diff --git a/packages/cli/src/services/project.service.ee.ts b/packages/cli/src/services/project.service.ee.ts index af4505217f9dc..aa933602877d9 100644 --- a/packages/cli/src/services/project.service.ee.ts +++ b/packages/cli/src/services/project.service.ee.ts @@ -1,10 +1,10 @@ +import { Container, Service } from '@n8n/di'; import { type Scope } from '@n8n/permissions'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import type { FindOptionsWhere, EntityManager } from '@n8n/typeorm'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import { In, Not } from '@n8n/typeorm'; import { ApplicationError } from 'n8n-workflow'; -import Container, { Service } from 'typedi'; import { UNLIMITED_LICENSE_QUOTA } from '@/constants'; import type { ProjectIcon, ProjectType } from '@/databases/entities/project'; diff --git a/packages/cli/src/services/pruning/pruning.service.ts b/packages/cli/src/services/pruning/pruning.service.ts index 15d81dc48ec0b..749c2d9d459ff 100644 --- a/packages/cli/src/services/pruning/pruning.service.ts +++ b/packages/cli/src/services/pruning/pruning.service.ts @@ -1,8 +1,8 @@ import { ExecutionsConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import { BinaryDataService, InstanceSettings, Logger } from 'n8n-core'; import { ensureError } from 'n8n-workflow'; import { strict } from 'node:assert'; -import { Service } from 'typedi'; import { Time } from '@/constants'; import { ExecutionRepository } from '@/databases/repositories/execution.repository'; diff --git a/packages/cli/src/services/public-api-key.service.ts b/packages/cli/src/services/public-api-key.service.ts index bca3cd0d62379..a6b1133bc29d0 100644 --- a/packages/cli/src/services/public-api-key.service.ts +++ b/packages/cli/src/services/public-api-key.service.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import type { OpenAPIV3 } from 'openapi-types'; -import { Service } from 'typedi'; import { ApiKey } from '@/databases/entities/api-key'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/services/redis-client.service.ts b/packages/cli/src/services/redis-client.service.ts index 894d3af67102d..6dea89a801c03 100644 --- a/packages/cli/src/services/redis-client.service.ts +++ b/packages/cli/src/services/redis-client.service.ts @@ -1,8 +1,8 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import ioRedis from 'ioredis'; import type { Cluster, RedisOptions } from 'ioredis'; import { Logger } from 'n8n-core'; -import { Service } from 'typedi'; import { Debounce } from '@/decorators/debounce'; import { TypedEmitter } from '@/typed-emitter'; diff --git a/packages/cli/src/services/role.service.ts b/packages/cli/src/services/role.service.ts index a4fd5daee1d09..7590dca2d5398 100644 --- a/packages/cli/src/services/role.service.ts +++ b/packages/cli/src/services/role.service.ts @@ -1,6 +1,6 @@ +import { Service } from '@n8n/di'; import { combineScopes, type Resource, type Scope } from '@n8n/permissions'; import { ApplicationError } from 'n8n-workflow'; -import { Service } from 'typedi'; import type { CredentialsEntity } from '@/databases/entities/credentials-entity'; import type { ProjectRelation, ProjectRole } from '@/databases/entities/project-relation'; diff --git a/packages/cli/src/services/tag.service.ts b/packages/cli/src/services/tag.service.ts index 7ed3feebffdb3..09695f44ff052 100644 --- a/packages/cli/src/services/tag.service.ts +++ b/packages/cli/src/services/tag.service.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import type { TagEntity } from '@/databases/entities/tag-entity'; import { TagRepository } from '@/databases/repositories/tag.repository'; diff --git a/packages/cli/src/services/url.service.ts b/packages/cli/src/services/url.service.ts index f9d3fcdbbdeb6..3851c011ca9ed 100644 --- a/packages/cli/src/services/url.service.ts +++ b/packages/cli/src/services/url.service.ts @@ -1,5 +1,5 @@ import { GlobalConfig } from '@n8n/config'; -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import config from '@/config'; diff --git a/packages/cli/src/services/user.service.ts b/packages/cli/src/services/user.service.ts index 3d2cb304719cb..ab188fc9721a0 100644 --- a/packages/cli/src/services/user.service.ts +++ b/packages/cli/src/services/user.service.ts @@ -1,7 +1,7 @@ +import { Service } from '@n8n/di'; import { Logger } from 'n8n-core'; import type { IUserSettings } from 'n8n-workflow'; import { ApplicationError } from 'n8n-workflow'; -import { Service } from 'typedi'; import type { User, AssignableRole } from '@/databases/entities/user'; import { UserRepository } from '@/databases/repositories/user.repository'; diff --git a/packages/cli/src/services/workflow-loader.service.ts b/packages/cli/src/services/workflow-loader.service.ts index ca1a9ff48c0b7..5d5e08c1fe7ec 100644 --- a/packages/cli/src/services/workflow-loader.service.ts +++ b/packages/cli/src/services/workflow-loader.service.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { ApplicationError, type IWorkflowBase, type IWorkflowLoader } from 'n8n-workflow'; -import { Service } from 'typedi'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; diff --git a/packages/cli/src/services/workflow-statistics.service.ts b/packages/cli/src/services/workflow-statistics.service.ts index 9c0282eb850b0..efcdc8320fff5 100644 --- a/packages/cli/src/services/workflow-statistics.service.ts +++ b/packages/cli/src/services/workflow-statistics.service.ts @@ -1,6 +1,6 @@ +import { Service } from '@n8n/di'; import { Logger } from 'n8n-core'; import type { INode, IRun, IWorkflowBase } from 'n8n-workflow'; -import { Service } from 'typedi'; import { StatisticsNames } from '@/databases/entities/workflow-statistics'; import { WorkflowStatisticsRepository } from '@/databases/repositories/workflow-statistics.repository'; diff --git a/packages/cli/src/shutdown/__tests__/shutdown.service.test.ts b/packages/cli/src/shutdown/__tests__/shutdown.service.test.ts index 26d6471584573..41afed9398db3 100644 --- a/packages/cli/src/shutdown/__tests__/shutdown.service.test.ts +++ b/packages/cli/src/shutdown/__tests__/shutdown.service.test.ts @@ -1,7 +1,7 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; import type { ErrorReporter } from 'n8n-core'; import { ApplicationError } from 'n8n-workflow'; -import Container from 'typedi'; import type { ServiceClass } from '@/shutdown/shutdown.service'; import { ShutdownService } from '@/shutdown/shutdown.service'; diff --git a/packages/cli/src/shutdown/shutdown.service.ts b/packages/cli/src/shutdown/shutdown.service.ts index 1597b2a27f43c..d31ca9b154ab8 100644 --- a/packages/cli/src/shutdown/shutdown.service.ts +++ b/packages/cli/src/shutdown/shutdown.service.ts @@ -1,7 +1,7 @@ +import { Container, Service } from '@n8n/di'; import { type Class, ErrorReporter } from 'n8n-core'; import { Logger } from 'n8n-core'; import { ApplicationError, assert } from 'n8n-workflow'; -import { Container, Service } from 'typedi'; import { LOWEST_SHUTDOWN_PRIORITY, HIGHEST_SHUTDOWN_PRIORITY } from '@/constants'; diff --git a/packages/cli/src/sso.ee/saml/saml-helpers.ts b/packages/cli/src/sso.ee/saml/saml-helpers.ts index 996e17b359832..cb067d1f886f6 100644 --- a/packages/cli/src/sso.ee/saml/saml-helpers.ts +++ b/packages/cli/src/sso.ee/saml/saml-helpers.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import { randomString } from 'n8n-workflow'; import type { FlowResult } from 'samlify/types/src/flow'; -import { Container } from 'typedi'; import config from '@/config'; import { AuthIdentity } from '@/databases/entities/auth-identity'; diff --git a/packages/cli/src/sso.ee/saml/saml-validator.ts b/packages/cli/src/sso.ee/saml/saml-validator.ts index 582fe624a5d88..3be374e6383c0 100644 --- a/packages/cli/src/sso.ee/saml/saml-validator.ts +++ b/packages/cli/src/sso.ee/saml/saml-validator.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { Logger } from 'n8n-core'; -import { Container } from 'typedi'; import type { XMLFileInfo } from 'xmllint-wasm'; let xmlMetadata: XMLFileInfo; diff --git a/packages/cli/src/sso.ee/saml/saml.service.ee.ts b/packages/cli/src/sso.ee/saml/saml.service.ee.ts index 2944d9adf1e4d..f34f3baeae8d2 100644 --- a/packages/cli/src/sso.ee/saml/saml.service.ee.ts +++ b/packages/cli/src/sso.ee/saml/saml.service.ee.ts @@ -1,3 +1,4 @@ +import { Container, Service } from '@n8n/di'; import axios from 'axios'; import type express from 'express'; import https from 'https'; @@ -5,7 +6,6 @@ import { Logger } from 'n8n-core'; import { ApplicationError, jsonParse } from 'n8n-workflow'; import type { IdentityProviderInstance, ServiceProviderInstance } from 'samlify'; import type { BindingContext, PostBindingContext } from 'samlify/types/src/entity'; -import Container, { Service } from 'typedi'; import type { Settings } from '@/databases/entities/settings'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/sso.ee/saml/service-provider.ee.ts b/packages/cli/src/sso.ee/saml/service-provider.ee.ts index 2e6511df09004..3793c8bd74ca3 100644 --- a/packages/cli/src/sso.ee/saml/service-provider.ee.ts +++ b/packages/cli/src/sso.ee/saml/service-provider.ee.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import type { ServiceProviderInstance } from 'samlify'; -import { Container } from 'typedi'; import { UrlService } from '@/services/url.service'; diff --git a/packages/cli/src/sso.ee/sso-helpers.ts b/packages/cli/src/sso.ee/sso-helpers.ts index f600e72cfd958..d69d9bc3a8de0 100644 --- a/packages/cli/src/sso.ee/sso-helpers.ts +++ b/packages/cli/src/sso.ee/sso-helpers.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import config from '@/config'; import type { AuthProviderType } from '@/databases/entities/auth-identity'; diff --git a/packages/cli/src/subworkflows/subworkflow-policy-checker.service.ts b/packages/cli/src/subworkflows/subworkflow-policy-checker.service.ts index 0415977e2e10f..218c083c54ef2 100644 --- a/packages/cli/src/subworkflows/subworkflow-policy-checker.service.ts +++ b/packages/cli/src/subworkflows/subworkflow-policy-checker.service.ts @@ -1,7 +1,7 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import { Logger } from 'n8n-core'; import { type Workflow, type INode, type WorkflowSettings } from 'n8n-workflow'; -import { Service } from 'typedi'; import type { Project } from '@/databases/entities/project'; import { SubworkflowPolicyDenialError } from '@/errors/subworkflow-policy-denial.error'; diff --git a/packages/cli/src/telemetry/index.ts b/packages/cli/src/telemetry/index.ts index 051ae4cf258a6..5b166567137dd 100644 --- a/packages/cli/src/telemetry/index.ts +++ b/packages/cli/src/telemetry/index.ts @@ -1,9 +1,9 @@ import { GlobalConfig } from '@n8n/config'; +import { Container, Service } from '@n8n/di'; import type RudderStack from '@rudderstack/rudder-sdk-node'; import axios from 'axios'; import { InstanceSettings, Logger } from 'n8n-core'; import type { ITelemetryTrackProperties } from 'n8n-workflow'; -import { Container, Service } from 'typedi'; import { LOWEST_SHUTDOWN_PRIORITY, N8N_VERSION } from '@/constants'; import { ProjectRelationRepository } from '@/databases/repositories/project-relation.repository'; diff --git a/packages/cli/src/user-management/email/node-mailer.ts b/packages/cli/src/user-management/email/node-mailer.ts index 4f4dc4f8953a8..ac555155d2863 100644 --- a/packages/cli/src/user-management/email/node-mailer.ts +++ b/packages/cli/src/user-management/email/node-mailer.ts @@ -1,11 +1,11 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import { pick } from 'lodash'; import { ErrorReporter, Logger } from 'n8n-core'; import path from 'node:path'; import type { Transporter } from 'nodemailer'; import { createTransport } from 'nodemailer'; import type SMTPConnection from 'nodemailer/lib/smtp-connection'; -import { Service } from 'typedi'; import type { MailData, SendEmailResult } from './interfaces'; diff --git a/packages/cli/src/user-management/email/user-management-mailer.ts b/packages/cli/src/user-management/email/user-management-mailer.ts index 25794cec8d6dc..53320c61e1f4c 100644 --- a/packages/cli/src/user-management/email/user-management-mailer.ts +++ b/packages/cli/src/user-management/email/user-management-mailer.ts @@ -1,10 +1,10 @@ import { GlobalConfig } from '@n8n/config'; +import { Container, Service } from '@n8n/di'; import { existsSync } from 'fs'; import { readFile } from 'fs/promises'; import Handlebars from 'handlebars'; import { Logger } from 'n8n-core'; import { join as pathJoin } from 'path'; -import { Container, Service } from 'typedi'; import { inTest } from '@/constants'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/user-management/permission-checker.ts b/packages/cli/src/user-management/permission-checker.ts index 51a6e8c6a3bc1..72ac867061052 100644 --- a/packages/cli/src/user-management/permission-checker.ts +++ b/packages/cli/src/user-management/permission-checker.ts @@ -1,6 +1,6 @@ +import { Service } from '@n8n/di'; import type { INode } from 'n8n-workflow'; import { CredentialAccessError, NodeOperationError } from 'n8n-workflow'; -import { Service } from 'typedi'; import { SharedCredentialsRepository } from '@/databases/repositories/shared-credentials.repository'; import { OwnershipService } from '@/services/ownership.service'; diff --git a/packages/cli/src/wait-tracker.ts b/packages/cli/src/wait-tracker.ts index 02480110ae9f2..d3c9d54c3aaea 100644 --- a/packages/cli/src/wait-tracker.ts +++ b/packages/cli/src/wait-tracker.ts @@ -1,6 +1,6 @@ +import { Service } from '@n8n/di'; import { InstanceSettings, Logger } from 'n8n-core'; import { ApplicationError, type IWorkflowExecutionDataProcess } from 'n8n-workflow'; -import { Service } from 'typedi'; import { ActiveExecutions } from '@/active-executions'; import { ExecutionRepository } from '@/databases/repositories/execution.repository'; diff --git a/packages/cli/src/webhooks/live-webhooks.ts b/packages/cli/src/webhooks/live-webhooks.ts index 1ebfef347033d..440e8254dc78f 100644 --- a/packages/cli/src/webhooks/live-webhooks.ts +++ b/packages/cli/src/webhooks/live-webhooks.ts @@ -1,8 +1,8 @@ +import { Service } from '@n8n/di'; import type { Response } from 'express'; import { Logger } from 'n8n-core'; import { Workflow, CHAT_TRIGGER_NODE_TYPE } from 'n8n-workflow'; import type { INode, IWebhookData, IHttpRequestMethods } from 'n8n-workflow'; -import { Service } from 'typedi'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; import { NotFoundError } from '@/errors/response-errors/not-found.error'; diff --git a/packages/cli/src/webhooks/test-webhook-registrations.service.ts b/packages/cli/src/webhooks/test-webhook-registrations.service.ts index e25b3102db3bc..565608c5839b9 100644 --- a/packages/cli/src/webhooks/test-webhook-registrations.service.ts +++ b/packages/cli/src/webhooks/test-webhook-registrations.service.ts @@ -1,6 +1,6 @@ +import { Service } from '@n8n/di'; import { InstanceSettings } from 'n8n-core'; import type { IWebhookData } from 'n8n-workflow'; -import { Service } from 'typedi'; import { TEST_WEBHOOK_TIMEOUT, TEST_WEBHOOK_TIMEOUT_BUFFER } from '@/constants'; import type { IWorkflowDb } from '@/interfaces'; diff --git a/packages/cli/src/webhooks/test-webhooks.ts b/packages/cli/src/webhooks/test-webhooks.ts index b90b1db59d985..732b35eb64887 100644 --- a/packages/cli/src/webhooks/test-webhooks.ts +++ b/packages/cli/src/webhooks/test-webhooks.ts @@ -1,3 +1,4 @@ +import { Service } from '@n8n/di'; import type express from 'express'; import { InstanceSettings } from 'n8n-core'; import { WebhookPathTakenError, Workflow } from 'n8n-workflow'; @@ -7,7 +8,6 @@ import type { IHttpRequestMethods, IRunData, } from 'n8n-workflow'; -import { Service } from 'typedi'; import { TEST_WEBHOOK_TIMEOUT } from '@/constants'; import { NotFoundError } from '@/errors/response-errors/not-found.error'; diff --git a/packages/cli/src/webhooks/waiting-forms.ts b/packages/cli/src/webhooks/waiting-forms.ts index cd2de74ed0dde..93294d24d0c4b 100644 --- a/packages/cli/src/webhooks/waiting-forms.ts +++ b/packages/cli/src/webhooks/waiting-forms.ts @@ -1,8 +1,8 @@ +import { Service } from '@n8n/di'; import axios from 'axios'; import type express from 'express'; import type { IRunData } from 'n8n-workflow'; import { FORM_NODE_TYPE, sleep, Workflow } from 'n8n-workflow'; -import { Service } from 'typedi'; import { ConflictError } from '@/errors/response-errors/conflict.error'; import { NotFoundError } from '@/errors/response-errors/not-found.error'; diff --git a/packages/cli/src/webhooks/waiting-webhooks.ts b/packages/cli/src/webhooks/waiting-webhooks.ts index ed2f8404bcaac..90413b433dc59 100644 --- a/packages/cli/src/webhooks/waiting-webhooks.ts +++ b/packages/cli/src/webhooks/waiting-webhooks.ts @@ -1,3 +1,4 @@ +import { Service } from '@n8n/di'; import type express from 'express'; import { Logger } from 'n8n-core'; import { @@ -8,7 +9,6 @@ import { WAIT_NODE_TYPE, Workflow, } from 'n8n-workflow'; -import { Service } from 'typedi'; import { ExecutionRepository } from '@/databases/repositories/execution.repository'; import { ConflictError } from '@/errors/response-errors/conflict.error'; diff --git a/packages/cli/src/webhooks/webhook-helpers.ts b/packages/cli/src/webhooks/webhook-helpers.ts index 51b81fad8371d..cdfdc97882799 100644 --- a/packages/cli/src/webhooks/webhook-helpers.ts +++ b/packages/cli/src/webhooks/webhook-helpers.ts @@ -7,6 +7,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/restrict-template-expressions */ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import type express from 'express'; import get from 'lodash/get'; import { BinaryDataService, ErrorReporter, Logger } from 'n8n-core'; @@ -38,7 +39,6 @@ import { NodeOperationError, } from 'n8n-workflow'; import { finished } from 'stream/promises'; -import { Container } from 'typedi'; import { ActiveExecutions } from '@/active-executions'; import type { Project } from '@/databases/entities/project'; diff --git a/packages/cli/src/webhooks/webhook-server.ts b/packages/cli/src/webhooks/webhook-server.ts index 263375325b418..648dcd7bfb5ef 100644 --- a/packages/cli/src/webhooks/webhook-server.ts +++ b/packages/cli/src/webhooks/webhook-server.ts @@ -1,4 +1,4 @@ -import { Service } from 'typedi'; +import { Service } from '@n8n/di'; import { AbstractServer } from '@/abstract-server'; diff --git a/packages/cli/src/webhooks/webhook.service.ts b/packages/cli/src/webhooks/webhook.service.ts index f571c9450bedc..1a3dbf37cbb53 100644 --- a/packages/cli/src/webhooks/webhook.service.ts +++ b/packages/cli/src/webhooks/webhook.service.ts @@ -1,3 +1,4 @@ +import { Service } from '@n8n/di'; import { HookContext, WebhookContext, Logger } from 'n8n-core'; import { ApplicationError, Node, NodeHelpers } from 'n8n-workflow'; import type { @@ -12,7 +13,6 @@ import type { WorkflowActivateMode, WorkflowExecuteMode, } from 'n8n-workflow'; -import { Service } from 'typedi'; import type { WebhookEntity } from '@/databases/entities/webhook-entity'; import { WebhookRepository } from '@/databases/repositories/webhook.repository'; diff --git a/packages/cli/src/workflow-execute-additional-data.ts b/packages/cli/src/workflow-execute-additional-data.ts index 69395b4ec87b8..3cfb74252dda3 100644 --- a/packages/cli/src/workflow-execute-additional-data.ts +++ b/packages/cli/src/workflow-execute-additional-data.ts @@ -4,6 +4,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ import type { PushMessage, PushType } from '@n8n/api-types'; import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import { stringify } from 'flatted'; import { ErrorReporter, Logger, WorkflowExecute, isObjectLiteral } from 'n8n-core'; import { ApplicationError, NodeOperationError, Workflow, WorkflowHooks } from 'n8n-workflow'; @@ -33,7 +34,6 @@ import type { ExecuteWorkflowData, RelatedExecution, } from 'n8n-workflow'; -import { Container } from 'typedi'; import { ActiveExecutions } from '@/active-executions'; import config from '@/config'; diff --git a/packages/cli/src/workflow-helpers.ts b/packages/cli/src/workflow-helpers.ts index b49e1ae556478..36946dd77e527 100644 --- a/packages/cli/src/workflow-helpers.ts +++ b/packages/cli/src/workflow-helpers.ts @@ -1,3 +1,4 @@ +import { Container } from '@n8n/di'; import type { IDataObject, INode, @@ -9,7 +10,6 @@ import type { WorkflowOperationError, NodeOperationError, } from 'n8n-workflow'; -import { Container } from 'typedi'; import { v4 as uuid } from 'uuid'; import type { WorkflowEntity } from '@/databases/entities/workflow-entity'; diff --git a/packages/cli/src/workflow-runner.ts b/packages/cli/src/workflow-runner.ts index 30cd50d6f0fd8..3a027659ff0f3 100644 --- a/packages/cli/src/workflow-runner.ts +++ b/packages/cli/src/workflow-runner.ts @@ -2,6 +2,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-shadow */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ +import { Container, Service } from '@n8n/di'; import { ErrorReporter, InstanceSettings, Logger, WorkflowExecute } from 'n8n-core'; import type { ExecutionError, @@ -15,7 +16,6 @@ import type { } from 'n8n-workflow'; import { ExecutionCancelledError, Workflow } from 'n8n-workflow'; import PCancelable from 'p-cancelable'; -import { Container, Service } from 'typedi'; import { ActiveExecutions } from '@/active-executions'; import config from '@/config'; diff --git a/packages/cli/src/workflows/workflow-execution.service.ts b/packages/cli/src/workflows/workflow-execution.service.ts index 842ddfe72661b..e231fe3e3a9eb 100644 --- a/packages/cli/src/workflows/workflow-execution.service.ts +++ b/packages/cli/src/workflows/workflow-execution.service.ts @@ -1,4 +1,5 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import { ErrorReporter, Logger } from 'n8n-core'; import type { IDeferredPromise, @@ -13,7 +14,6 @@ import type { IWorkflowExecutionDataProcess, } from 'n8n-workflow'; import { SubworkflowOperationError, Workflow } from 'n8n-workflow'; -import { Service } from 'typedi'; import type { Project } from '@/databases/entities/project'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/workflows/workflow-history.ee/workflow-history-helper.ee.ts b/packages/cli/src/workflows/workflow-history.ee/workflow-history-helper.ee.ts index 11363a45bc0a8..c8b06851e7164 100644 --- a/packages/cli/src/workflows/workflow-history.ee/workflow-history-helper.ee.ts +++ b/packages/cli/src/workflows/workflow-history.ee/workflow-history-helper.ee.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import config from '@/config'; import { License } from '@/license'; diff --git a/packages/cli/src/workflows/workflow-history.ee/workflow-history-manager.ee.ts b/packages/cli/src/workflows/workflow-history.ee/workflow-history-manager.ee.ts index f3a25bfb16fc3..b320c144f6bb2 100644 --- a/packages/cli/src/workflows/workflow-history.ee/workflow-history-manager.ee.ts +++ b/packages/cli/src/workflows/workflow-history.ee/workflow-history-manager.ee.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { DateTime } from 'luxon'; -import { Service } from 'typedi'; import { Time } from '@/constants'; import { WorkflowHistoryRepository } from '@/databases/repositories/workflow-history.repository'; diff --git a/packages/cli/src/workflows/workflow-history.ee/workflow-history.service.ee.ts b/packages/cli/src/workflows/workflow-history.ee/workflow-history.service.ee.ts index 2e23a7d64a3e0..05256ec7a62bc 100644 --- a/packages/cli/src/workflows/workflow-history.ee/workflow-history.service.ee.ts +++ b/packages/cli/src/workflows/workflow-history.ee/workflow-history.service.ee.ts @@ -1,6 +1,6 @@ +import { Service } from '@n8n/di'; import { Logger } from 'n8n-core'; import { ensureError } from 'n8n-workflow'; -import { Service } from 'typedi'; import type { User } from '@/databases/entities/user'; import type { WorkflowEntity } from '@/databases/entities/workflow-entity'; diff --git a/packages/cli/src/workflows/workflow-sharing.service.ts b/packages/cli/src/workflows/workflow-sharing.service.ts index 280c553a5ea9f..220c9adaf9476 100644 --- a/packages/cli/src/workflows/workflow-sharing.service.ts +++ b/packages/cli/src/workflows/workflow-sharing.service.ts @@ -1,7 +1,7 @@ +import { Service } from '@n8n/di'; import type { Scope } from '@n8n/permissions'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import { In } from '@n8n/typeorm'; -import { Service } from 'typedi'; import type { ProjectRole } from '@/databases/entities/project-relation'; import type { WorkflowSharingRole } from '@/databases/entities/shared-workflow'; diff --git a/packages/cli/src/workflows/workflow-static-data.service.ts b/packages/cli/src/workflows/workflow-static-data.service.ts index aaff18f319262..5ef9a52480048 100644 --- a/packages/cli/src/workflows/workflow-static-data.service.ts +++ b/packages/cli/src/workflows/workflow-static-data.service.ts @@ -1,7 +1,7 @@ import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import { ErrorReporter, Logger } from 'n8n-core'; import type { IDataObject, Workflow } from 'n8n-workflow'; -import { Service } from 'typedi'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; import { isWorkflowIdValid } from '@/utils'; diff --git a/packages/cli/src/workflows/workflow.service.ee.ts b/packages/cli/src/workflows/workflow.service.ee.ts index 830a3d2f98331..8122e909c4a0c 100644 --- a/packages/cli/src/workflows/workflow.service.ee.ts +++ b/packages/cli/src/workflows/workflow.service.ee.ts @@ -1,9 +1,9 @@ +import { Service } from '@n8n/di'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import { In, type EntityManager } from '@n8n/typeorm'; import omit from 'lodash/omit'; import { Logger } from 'n8n-core'; import { ApplicationError, NodeOperationError, WorkflowActivationError } from 'n8n-workflow'; -import { Service } from 'typedi'; import { ActiveWorkflowManager } from '@/active-workflow-manager'; import { CredentialsService } from '@/credentials/credentials.service'; diff --git a/packages/cli/src/workflows/workflow.service.ts b/packages/cli/src/workflows/workflow.service.ts index 21f792747e290..2141e79ed5adb 100644 --- a/packages/cli/src/workflows/workflow.service.ts +++ b/packages/cli/src/workflows/workflow.service.ts @@ -1,3 +1,4 @@ +import { Service } from '@n8n/di'; import type { Scope } from '@n8n/permissions'; // eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import import type { EntityManager } from '@n8n/typeorm'; @@ -7,7 +8,6 @@ import omit from 'lodash/omit'; import pick from 'lodash/pick'; import { BinaryDataService, Logger } from 'n8n-core'; import { NodeApiError } from 'n8n-workflow'; -import { Service } from 'typedi'; import { v4 as uuid } from 'uuid'; import { ActiveWorkflowManager } from '@/active-workflow-manager'; diff --git a/packages/cli/test/integration/active-workflow-manager.test.ts b/packages/cli/test/integration/active-workflow-manager.test.ts index f965efe709f62..3c98c2a4f1b72 100644 --- a/packages/cli/test/integration/active-workflow-manager.test.ts +++ b/packages/cli/test/integration/active-workflow-manager.test.ts @@ -1,8 +1,8 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; import { Logger } from 'n8n-core'; import { NodeApiError, Workflow } from 'n8n-workflow'; import type { IWebhookData, WorkflowActivateMode } from 'n8n-workflow'; -import { Container } from 'typedi'; import { ActiveExecutions } from '@/active-executions'; import { ActiveWorkflowManager } from '@/active-workflow-manager'; diff --git a/packages/cli/test/integration/ai/ai.api.test.ts b/packages/cli/test/integration/ai/ai.api.test.ts index 34255dc72f55d..721f2296ed5ce 100644 --- a/packages/cli/test/integration/ai/ai.api.test.ts +++ b/packages/cli/test/integration/ai/ai.api.test.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import { randomUUID } from 'crypto'; import { mock } from 'jest-mock-extended'; -import { Container } from 'typedi'; import { FREE_AI_CREDITS_CREDENTIAL_NAME, OPEN_AI_API_CREDENTIAL_TYPE } from '@/constants'; import type { Project } from '@/databases/entities/project'; diff --git a/packages/cli/test/integration/api-keys.api.test.ts b/packages/cli/test/integration/api-keys.api.test.ts index f577e0cf78b51..14050b543aa3a 100644 --- a/packages/cli/test/integration/api-keys.api.test.ts +++ b/packages/cli/test/integration/api-keys.api.test.ts @@ -1,5 +1,5 @@ import { GlobalConfig } from '@n8n/config'; -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import type { ApiKey } from '@/databases/entities/api-key'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/test/integration/auth.api.test.ts b/packages/cli/test/integration/auth.api.test.ts index 4fa2a7145cbce..7fd3f50eacd3d 100644 --- a/packages/cli/test/integration/auth.api.test.ts +++ b/packages/cli/test/integration/auth.api.test.ts @@ -1,4 +1,4 @@ -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import validator from 'validator'; import config from '@/config'; diff --git a/packages/cli/test/integration/collaboration/collaboration.service.test.ts b/packages/cli/test/integration/collaboration/collaboration.service.test.ts index ab7a8314b3a55..b11f1655d6d10 100644 --- a/packages/cli/test/integration/collaboration/collaboration.service.test.ts +++ b/packages/cli/test/integration/collaboration/collaboration.service.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; -import Container from 'typedi'; import type { WorkflowClosedMessage, diff --git a/packages/cli/test/integration/commands/ldap/reset.test.ts b/packages/cli/test/integration/commands/ldap/reset.test.ts index a199310f9c652..11051b9d983ea 100644 --- a/packages/cli/test/integration/commands/ldap/reset.test.ts +++ b/packages/cli/test/integration/commands/ldap/reset.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { EntityNotFoundError } from '@n8n/typeorm'; -import { Container } from 'typedi'; import { v4 as uuid } from 'uuid'; import { Reset } from '@/commands/ldap/reset'; diff --git a/packages/cli/test/integration/commands/license.cmd.test.ts b/packages/cli/test/integration/commands/license.cmd.test.ts index 363d2feae61c0..d35c4fdc4a1d9 100644 --- a/packages/cli/test/integration/commands/license.cmd.test.ts +++ b/packages/cli/test/integration/commands/license.cmd.test.ts @@ -1,4 +1,4 @@ -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import { ClearLicenseCommand } from '@/commands/license/clear'; import { SETTINGS_LICENSE_CERT_KEY } from '@/constants'; diff --git a/packages/cli/test/integration/commands/reset.cmd.test.ts b/packages/cli/test/integration/commands/reset.cmd.test.ts index 58e8e344e5933..19b301f5968a3 100644 --- a/packages/cli/test/integration/commands/reset.cmd.test.ts +++ b/packages/cli/test/integration/commands/reset.cmd.test.ts @@ -1,4 +1,4 @@ -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import { Reset } from '@/commands/user-management/reset'; import { CredentialsEntity } from '@/databases/entities/credentials-entity'; diff --git a/packages/cli/test/integration/commands/worker.cmd.test.ts b/packages/cli/test/integration/commands/worker.cmd.test.ts index f91c001e08daa..d7deb5493915c 100644 --- a/packages/cli/test/integration/commands/worker.cmd.test.ts +++ b/packages/cli/test/integration/commands/worker.cmd.test.ts @@ -1,8 +1,8 @@ process.argv[2] = 'worker'; import { TaskRunnersConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import { BinaryDataService } from 'n8n-core'; -import Container from 'typedi'; import { Worker } from '@/commands/worker'; import config from '@/config'; diff --git a/packages/cli/test/integration/controllers/invitation/invitation.controller.integration.test.ts b/packages/cli/test/integration/controllers/invitation/invitation.controller.integration.test.ts index f1e8e2a1b91dc..64ef210ab91e8 100644 --- a/packages/cli/test/integration/controllers/invitation/invitation.controller.integration.test.ts +++ b/packages/cli/test/integration/controllers/invitation/invitation.controller.integration.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { Not } from '@n8n/typeorm'; -import Container from 'typedi'; import type { User } from '@/databases/entities/user'; import { ProjectRelationRepository } from '@/databases/repositories/project-relation.repository'; diff --git a/packages/cli/test/integration/controllers/oauth/oauth2.api.test.ts b/packages/cli/test/integration/controllers/oauth/oauth2.api.test.ts index 59a853cee1db3..f20f9df5508e8 100644 --- a/packages/cli/test/integration/controllers/oauth/oauth2.api.test.ts +++ b/packages/cli/test/integration/controllers/oauth/oauth2.api.test.ts @@ -1,7 +1,7 @@ +import { Container } from '@n8n/di'; import { response as Response } from 'express'; import nock from 'nock'; import { parse as parseQs } from 'querystring'; -import { Container } from 'typedi'; import { OAuth2CredentialController } from '@/controllers/oauth/oauth2-credential.controller'; import { CredentialsHelper } from '@/credentials-helper'; diff --git a/packages/cli/test/integration/credentials-helper.test.ts b/packages/cli/test/integration/credentials-helper.test.ts index b3cb15555b3e0..7b8522589ad79 100644 --- a/packages/cli/test/integration/credentials-helper.test.ts +++ b/packages/cli/test/integration/credentials-helper.test.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import { CredentialsHelper } from '@/credentials-helper'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/test/integration/credentials/credentials.api.ee.test.ts b/packages/cli/test/integration/credentials/credentials.api.ee.test.ts index 962f5591d5708..039791eaf23c0 100644 --- a/packages/cli/test/integration/credentials/credentials.api.ee.test.ts +++ b/packages/cli/test/integration/credentials/credentials.api.ee.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { In } from '@n8n/typeorm'; -import { Container } from 'typedi'; import config from '@/config'; import type { Project } from '@/databases/entities/project'; diff --git a/packages/cli/test/integration/credentials/credentials.api.test.ts b/packages/cli/test/integration/credentials/credentials.api.test.ts index eb9712fefd00d..b33549945dd59 100644 --- a/packages/cli/test/integration/credentials/credentials.api.test.ts +++ b/packages/cli/test/integration/credentials/credentials.api.test.ts @@ -1,8 +1,8 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import type { Scope } from '@sentry/node'; import { Credentials } from 'n8n-core'; import { randomString } from 'n8n-workflow'; -import { Container } from 'typedi'; import type { Project } from '@/databases/entities/project'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/test/integration/credentials/credentials.service.test.ts b/packages/cli/test/integration/credentials/credentials.service.test.ts index ecfafada3fad1..9638228183ed8 100644 --- a/packages/cli/test/integration/credentials/credentials.service.test.ts +++ b/packages/cli/test/integration/credentials/credentials.service.test.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import { CredentialsService } from '@/credentials/credentials.service'; import type { CredentialsEntity } from '@/databases/entities/credentials-entity'; diff --git a/packages/cli/test/integration/cta.service.test.ts b/packages/cli/test/integration/cta.service.test.ts index 68c1f24c5f4e5..366b86e3ec9b3 100644 --- a/packages/cli/test/integration/cta.service.test.ts +++ b/packages/cli/test/integration/cta.service.test.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import type { User } from '@/databases/entities/user'; import { StatisticsNames } from '@/databases/entities/workflow-statistics'; diff --git a/packages/cli/test/integration/database/repositories/execution.repository.test.ts b/packages/cli/test/integration/database/repositories/execution.repository.test.ts index 1b50415686ae3..cb368b511c2c8 100644 --- a/packages/cli/test/integration/database/repositories/execution.repository.test.ts +++ b/packages/cli/test/integration/database/repositories/execution.repository.test.ts @@ -1,5 +1,5 @@ import { GlobalConfig } from '@n8n/config'; -import Container from 'typedi'; +import { Container } from '@n8n/di'; import { ExecutionDataRepository } from '@/databases/repositories/execution-data.repository'; import { ExecutionRepository } from '@/databases/repositories/execution.repository'; diff --git a/packages/cli/test/integration/database/repositories/project.repository.test.ts b/packages/cli/test/integration/database/repositories/project.repository.test.ts index cc494fd5425f2..334929e4e7142 100644 --- a/packages/cli/test/integration/database/repositories/project.repository.test.ts +++ b/packages/cli/test/integration/database/repositories/project.repository.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { EntityNotFoundError } from '@n8n/typeorm'; -import Container from 'typedi'; import { AuthIdentity } from '@/databases/entities/auth-identity'; import { ProjectRepository } from '@/databases/repositories/project.repository'; diff --git a/packages/cli/test/integration/database/repositories/workflow.repository.test.ts b/packages/cli/test/integration/database/repositories/workflow.repository.test.ts index acff2cbce9738..63b87df7e8286 100644 --- a/packages/cli/test/integration/database/repositories/workflow.repository.test.ts +++ b/packages/cli/test/integration/database/repositories/workflow.repository.test.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; diff --git a/packages/cli/test/integration/debug.controller.test.ts b/packages/cli/test/integration/debug.controller.test.ts index 8ab58bd1a03cf..7ca483a9123e3 100644 --- a/packages/cli/test/integration/debug.controller.test.ts +++ b/packages/cli/test/integration/debug.controller.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { InstanceSettings } from 'n8n-core'; -import Container from 'typedi'; import { ActiveWorkflowManager } from '@/active-workflow-manager'; import type { WorkflowEntity } from '@/databases/entities/workflow-entity'; diff --git a/packages/cli/test/integration/environments/source-control-import.service.test.ts b/packages/cli/test/integration/environments/source-control-import.service.test.ts index 3faa84b6759c5..6835d18f58bcc 100644 --- a/packages/cli/test/integration/environments/source-control-import.service.test.ts +++ b/packages/cli/test/integration/environments/source-control-import.service.test.ts @@ -1,10 +1,10 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; import { Cipher } from 'n8n-core'; import type { InstanceSettings } from 'n8n-core'; import * as utils from 'n8n-workflow'; import { nanoid } from 'nanoid'; import fsp from 'node:fs/promises'; -import Container from 'typedi'; import { CredentialsRepository } from '@/databases/repositories/credentials.repository'; import { ProjectRepository } from '@/databases/repositories/project.repository'; diff --git a/packages/cli/test/integration/environments/source-control.test.ts b/packages/cli/test/integration/environments/source-control.test.ts index 7e474e1f9adb6..11a7ad8a2b828 100644 --- a/packages/cli/test/integration/environments/source-control.test.ts +++ b/packages/cli/test/integration/environments/source-control.test.ts @@ -1,4 +1,4 @@ -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import config from '@/config'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/test/integration/evaluation/metrics.api.test.ts b/packages/cli/test/integration/evaluation/metrics.api.test.ts index d10bb106a5b03..996fd96148e3b 100644 --- a/packages/cli/test/integration/evaluation/metrics.api.test.ts +++ b/packages/cli/test/integration/evaluation/metrics.api.test.ts @@ -1,4 +1,4 @@ -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import type { TestDefinition } from '@/databases/entities/test-definition.ee'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/test/integration/evaluation/test-definitions.api.test.ts b/packages/cli/test/integration/evaluation/test-definitions.api.test.ts index 8dd778289d638..ad359f8731d66 100644 --- a/packages/cli/test/integration/evaluation/test-definitions.api.test.ts +++ b/packages/cli/test/integration/evaluation/test-definitions.api.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { mockInstance } from 'n8n-core/test/utils'; -import { Container } from 'typedi'; import type { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity.ee'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/test/integration/evaluation/test-runs.api.test.ts b/packages/cli/test/integration/evaluation/test-runs.api.test.ts index be8fb0b5d8fa8..8f01029ad27eb 100644 --- a/packages/cli/test/integration/evaluation/test-runs.api.test.ts +++ b/packages/cli/test/integration/evaluation/test-runs.api.test.ts @@ -1,4 +1,4 @@ -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import type { TestDefinition } from '@/databases/entities/test-definition.ee'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/test/integration/eventbus.ee.test.ts b/packages/cli/test/integration/eventbus.ee.test.ts index c2b6a7f23c600..0be15b6124034 100644 --- a/packages/cli/test/integration/eventbus.ee.test.ts +++ b/packages/cli/test/integration/eventbus.ee.test.ts @@ -1,3 +1,4 @@ +import { Container } from '@n8n/di'; import axios from 'axios'; import type { MessageEventBusDestinationSentryOptions, @@ -10,7 +11,6 @@ import { defaultMessageEventBusDestinationWebhookOptions, } from 'n8n-workflow'; import syslog from 'syslog-client'; -import { Container } from 'typedi'; import { v4 as uuid } from 'uuid'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/test/integration/execution.service.integration.test.ts b/packages/cli/test/integration/execution.service.integration.test.ts index 27163b3bea254..e1de129d7c8fd 100644 --- a/packages/cli/test/integration/execution.service.integration.test.ts +++ b/packages/cli/test/integration/execution.service.integration.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; -import Container from 'typedi'; import { ExecutionMetadataRepository } from '@/databases/repositories/execution-metadata.repository'; import { ExecutionRepository } from '@/databases/repositories/execution.repository'; diff --git a/packages/cli/test/integration/external-secrets/external-secrets.api.test.ts b/packages/cli/test/integration/external-secrets/external-secrets.api.test.ts index 7e01941c80329..095555b72bbc5 100644 --- a/packages/cli/test/integration/external-secrets/external-secrets.api.test.ts +++ b/packages/cli/test/integration/external-secrets/external-secrets.api.test.ts @@ -1,7 +1,7 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; import { Cipher } from 'n8n-core'; import { jsonParse, type IDataObject } from 'n8n-workflow'; -import { Container } from 'typedi'; import config from '@/config'; import { CREDENTIAL_BLANKING_VALUE } from '@/constants'; diff --git a/packages/cli/test/integration/import.service.test.ts b/packages/cli/test/integration/import.service.test.ts index 39cadde676b1f..0c40d868ce7ef 100644 --- a/packages/cli/test/integration/import.service.test.ts +++ b/packages/cli/test/integration/import.service.test.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; import type { INode } from 'n8n-workflow'; -import Container from 'typedi'; import { v4 as uuid } from 'uuid'; import type { Project } from '@/databases/entities/project'; diff --git a/packages/cli/test/integration/ldap/ldap.api.test.ts b/packages/cli/test/integration/ldap/ldap.api.test.ts index 884f72315ceb4..9a4c214f10b7d 100644 --- a/packages/cli/test/integration/ldap/ldap.api.test.ts +++ b/packages/cli/test/integration/ldap/ldap.api.test.ts @@ -1,7 +1,7 @@ +import { Container } from '@n8n/di'; import { Not } from '@n8n/typeorm'; import type { Entry as LdapUser } from 'ldapts'; import { Cipher } from 'n8n-core'; -import { Container } from 'typedi'; import config from '@/config'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/test/integration/license-metrics.repository.test.ts b/packages/cli/test/integration/license-metrics.repository.test.ts index 5396b4681f8e2..298c7d67fda4f 100644 --- a/packages/cli/test/integration/license-metrics.repository.test.ts +++ b/packages/cli/test/integration/license-metrics.repository.test.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import { StatisticsNames } from '@/databases/entities/workflow-statistics'; import { LicenseMetricsRepository } from '@/databases/repositories/license-metrics.repository'; diff --git a/packages/cli/test/integration/me.api.test.ts b/packages/cli/test/integration/me.api.test.ts index a29f158a326db..25cbe20b64cf8 100644 --- a/packages/cli/test/integration/me.api.test.ts +++ b/packages/cli/test/integration/me.api.test.ts @@ -1,6 +1,6 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import type { IPersonalizationSurveyAnswersV4 } from 'n8n-workflow'; -import { Container } from 'typedi'; import validator from 'validator'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/test/integration/mfa/mfa.api.test.ts b/packages/cli/test/integration/mfa/mfa.api.test.ts index f69d98a74fdcd..935ede4c17c1f 100644 --- a/packages/cli/test/integration/mfa/mfa.api.test.ts +++ b/packages/cli/test/integration/mfa/mfa.api.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { randomString } from 'n8n-workflow'; -import Container from 'typedi'; import { AuthService } from '@/auth/auth.service'; import config from '@/config'; diff --git a/packages/cli/test/integration/owner.api.test.ts b/packages/cli/test/integration/owner.api.test.ts index fe5284ffbed6a..13f660688e7e5 100644 --- a/packages/cli/test/integration/owner.api.test.ts +++ b/packages/cli/test/integration/owner.api.test.ts @@ -1,4 +1,4 @@ -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import validator from 'validator'; import config from '@/config'; diff --git a/packages/cli/test/integration/password-reset.api.test.ts b/packages/cli/test/integration/password-reset.api.test.ts index 2be4c0f0308f6..826b4ddef9500 100644 --- a/packages/cli/test/integration/password-reset.api.test.ts +++ b/packages/cli/test/integration/password-reset.api.test.ts @@ -1,7 +1,7 @@ +import { Container } from '@n8n/di'; import { compare } from 'bcryptjs'; import { mock } from 'jest-mock-extended'; import { randomString } from 'n8n-workflow'; -import { Container } from 'typedi'; import { v4 as uuid } from 'uuid'; import { AuthService } from '@/auth/auth.service'; diff --git a/packages/cli/test/integration/permission-checker.test.ts b/packages/cli/test/integration/permission-checker.test.ts index 1a0963b6851cd..71dd77b503470 100644 --- a/packages/cli/test/integration/permission-checker.test.ts +++ b/packages/cli/test/integration/permission-checker.test.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import type { INode } from 'n8n-workflow'; import { randomInt } from 'n8n-workflow'; -import { Container } from 'typedi'; import { v4 as uuid } from 'uuid'; import type { Project } from '@/databases/entities/project'; diff --git a/packages/cli/test/integration/project.api.test.ts b/packages/cli/test/integration/project.api.test.ts index 14707ad7643c9..a75aad9566499 100644 --- a/packages/cli/test/integration/project.api.test.ts +++ b/packages/cli/test/integration/project.api.test.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import type { Scope } from '@n8n/permissions'; import { EntityNotFoundError } from '@n8n/typeorm'; -import Container from 'typedi'; import { ActiveWorkflowManager } from '@/active-workflow-manager'; import type { Project } from '@/databases/entities/project'; diff --git a/packages/cli/test/integration/project.service.integration.test.ts b/packages/cli/test/integration/project.service.integration.test.ts index 4c4ad6be5d479..b2210b5210027 100644 --- a/packages/cli/test/integration/project.service.integration.test.ts +++ b/packages/cli/test/integration/project.service.integration.test.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import { SharedWorkflowRepository } from '@/databases/repositories/shared-workflow.repository'; import { ProjectService } from '@/services/project.service.ee'; diff --git a/packages/cli/test/integration/prometheus-metrics.test.ts b/packages/cli/test/integration/prometheus-metrics.test.ts index 2a13d2f09175a..c5accedbc6130 100644 --- a/packages/cli/test/integration/prometheus-metrics.test.ts +++ b/packages/cli/test/integration/prometheus-metrics.test.ts @@ -1,7 +1,7 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import { parse as semverParse } from 'semver'; import request, { type Response } from 'supertest'; -import { Container } from 'typedi'; import config from '@/config'; import { N8N_VERSION } from '@/constants'; diff --git a/packages/cli/test/integration/pruning.service.test.ts b/packages/cli/test/integration/pruning.service.test.ts index 9d4103e84e802..3a97350f7959d 100644 --- a/packages/cli/test/integration/pruning.service.test.ts +++ b/packages/cli/test/integration/pruning.service.test.ts @@ -1,8 +1,8 @@ import { ExecutionsConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; import { BinaryDataService, InstanceSettings } from 'n8n-core'; import type { ExecutionStatus } from 'n8n-workflow'; -import Container from 'typedi'; import { Time } from '@/constants'; import type { ExecutionEntity } from '@/databases/entities/execution-entity'; diff --git a/packages/cli/test/integration/public-api/credentials.test.ts b/packages/cli/test/integration/public-api/credentials.test.ts index 953a6e1c95221..c6e4dc5c122b9 100644 --- a/packages/cli/test/integration/public-api/credentials.test.ts +++ b/packages/cli/test/integration/public-api/credentials.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { randomString } from 'n8n-workflow'; -import { Container } from 'typedi'; import type { User } from '@/databases/entities/user'; import { CredentialsRepository } from '@/databases/repositories/credentials.repository'; diff --git a/packages/cli/test/integration/public-api/tags.test.ts b/packages/cli/test/integration/public-api/tags.test.ts index c2e25cc3f68b7..2be18285f49d8 100644 --- a/packages/cli/test/integration/public-api/tags.test.ts +++ b/packages/cli/test/integration/public-api/tags.test.ts @@ -1,4 +1,4 @@ -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import type { User } from '@/databases/entities/user'; import { TagRepository } from '@/databases/repositories/tag.repository'; diff --git a/packages/cli/test/integration/public-api/workflows.test.ts b/packages/cli/test/integration/public-api/workflows.test.ts index 51da846b5b03a..943d33bc35a49 100644 --- a/packages/cli/test/integration/public-api/workflows.test.ts +++ b/packages/cli/test/integration/public-api/workflows.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import type { INode } from 'n8n-workflow'; -import { Container } from 'typedi'; import { ActiveWorkflowManager } from '@/active-workflow-manager'; import config from '@/config'; diff --git a/packages/cli/test/integration/role.api.test.ts b/packages/cli/test/integration/role.api.test.ts index ad961c2565d2b..85888347ccfce 100644 --- a/packages/cli/test/integration/role.api.test.ts +++ b/packages/cli/test/integration/role.api.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import type { Scope } from '@n8n/permissions'; -import { Container } from 'typedi'; import type { ProjectRole } from '@/databases/entities/project-relation'; import type { CredentialSharingRole } from '@/databases/entities/shared-credentials'; diff --git a/packages/cli/test/integration/runners/task-runner-module.external.test.ts b/packages/cli/test/integration/runners/task-runner-module.external.test.ts index bb61dae6d476b..483e1dd0a96c0 100644 --- a/packages/cli/test/integration/runners/task-runner-module.external.test.ts +++ b/packages/cli/test/integration/runners/task-runner-module.external.test.ts @@ -1,6 +1,6 @@ import { TaskRunnersConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; -import Container from 'typedi'; import { MissingAuthTokenError } from '@/runners/errors/missing-auth-token.error'; import { TaskRunnerModule } from '@/runners/task-runner-module'; diff --git a/packages/cli/test/integration/runners/task-runner-module.internal.test.ts b/packages/cli/test/integration/runners/task-runner-module.internal.test.ts index db195001a7803..34863c90b421f 100644 --- a/packages/cli/test/integration/runners/task-runner-module.internal.test.ts +++ b/packages/cli/test/integration/runners/task-runner-module.internal.test.ts @@ -1,5 +1,5 @@ import { TaskRunnersConfig } from '@n8n/config'; -import Container from 'typedi'; +import { Container } from '@n8n/di'; import { TaskRunnerModule } from '@/runners/task-runner-module'; diff --git a/packages/cli/test/integration/runners/task-runner-process.test.ts b/packages/cli/test/integration/runners/task-runner-process.test.ts index b21ef68640e86..63b51a56750d1 100644 --- a/packages/cli/test/integration/runners/task-runner-process.test.ts +++ b/packages/cli/test/integration/runners/task-runner-process.test.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import { TaskRunnerWsServer } from '@/runners/runner-ws-server'; import { TaskBroker } from '@/runners/task-broker.service'; diff --git a/packages/cli/test/integration/security-audit/credentials-risk-reporter.test.ts b/packages/cli/test/integration/security-audit/credentials-risk-reporter.test.ts index b5b4c122df1af..ba38f04bd6b93 100644 --- a/packages/cli/test/integration/security-audit/credentials-risk-reporter.test.ts +++ b/packages/cli/test/integration/security-audit/credentials-risk-reporter.test.ts @@ -1,6 +1,6 @@ import type { SecurityConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; -import Container from 'typedi'; import { v4 as uuid } from 'uuid'; import { CredentialsRepository } from '@/databases/repositories/credentials.repository'; diff --git a/packages/cli/test/integration/security-audit/database-risk-reporter.test.ts b/packages/cli/test/integration/security-audit/database-risk-reporter.test.ts index 3aef57396b666..67927426b3326 100644 --- a/packages/cli/test/integration/security-audit/database-risk-reporter.test.ts +++ b/packages/cli/test/integration/security-audit/database-risk-reporter.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; -import Container from 'typedi'; import { v4 as uuid } from 'uuid'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; diff --git a/packages/cli/test/integration/security-audit/filesystem-risk-reporter.test.ts b/packages/cli/test/integration/security-audit/filesystem-risk-reporter.test.ts index ceb306935ff5e..85ab2e6ec4a2c 100644 --- a/packages/cli/test/integration/security-audit/filesystem-risk-reporter.test.ts +++ b/packages/cli/test/integration/security-audit/filesystem-risk-reporter.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; -import Container from 'typedi'; import { v4 as uuid } from 'uuid'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; diff --git a/packages/cli/test/integration/security-audit/instance-risk-reporter.test.ts b/packages/cli/test/integration/security-audit/instance-risk-reporter.test.ts index 58a2a2c9a8793..ddf3fce556b03 100644 --- a/packages/cli/test/integration/security-audit/instance-risk-reporter.test.ts +++ b/packages/cli/test/integration/security-audit/instance-risk-reporter.test.ts @@ -1,7 +1,7 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; import { NodeConnectionType } from 'n8n-workflow'; -import Container from 'typedi'; import { v4 as uuid } from 'uuid'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; diff --git a/packages/cli/test/integration/security-audit/nodes-risk-reporter.test.ts b/packages/cli/test/integration/security-audit/nodes-risk-reporter.test.ts index c1fb198b69bb0..461685ec5cbe5 100644 --- a/packages/cli/test/integration/security-audit/nodes-risk-reporter.test.ts +++ b/packages/cli/test/integration/security-audit/nodes-risk-reporter.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; -import { Container } from 'typedi'; import { v4 as uuid } from 'uuid'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; diff --git a/packages/cli/test/integration/security-audit/utils.ts b/packages/cli/test/integration/security-audit/utils.ts index d74bcc9d8747f..d153db28eb419 100644 --- a/packages/cli/test/integration/security-audit/utils.ts +++ b/packages/cli/test/integration/security-audit/utils.ts @@ -1,6 +1,6 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import nock from 'nock'; -import Container from 'typedi'; import { v4 as uuid } from 'uuid'; import * as constants from '@/constants'; diff --git a/packages/cli/test/integration/services/execution-metadata.service.test.ts b/packages/cli/test/integration/services/execution-metadata.service.test.ts index b69c78b5fe623..7288c4b98fb36 100644 --- a/packages/cli/test/integration/services/execution-metadata.service.test.ts +++ b/packages/cli/test/integration/services/execution-metadata.service.test.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import { ExecutionMetadataRepository } from '@/databases/repositories/execution-metadata.repository'; import { ExecutionMetadataService } from '@/services/execution-metadata.service'; diff --git a/packages/cli/test/integration/services/project.service.test.ts b/packages/cli/test/integration/services/project.service.test.ts index b475bc83ebdd8..bf83c6159cebe 100644 --- a/packages/cli/test/integration/services/project.service.test.ts +++ b/packages/cli/test/integration/services/project.service.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import type { Scope } from '@n8n/permissions'; -import Container from 'typedi'; import type { ProjectRole } from '@/databases/entities/project-relation'; import { ProjectRelationRepository } from '@/databases/repositories/project-relation.repository'; diff --git a/packages/cli/test/integration/services/workflow-static-data.service.test.ts b/packages/cli/test/integration/services/workflow-static-data.service.test.ts index c6ab9301ce8ad..8cb2cbc1cc4d2 100644 --- a/packages/cli/test/integration/services/workflow-static-data.service.test.ts +++ b/packages/cli/test/integration/services/workflow-static-data.service.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { Workflow } from 'n8n-workflow'; -import Container from 'typedi'; import { WorkflowRepository } from '@/databases/repositories/workflow.repository'; import { NodeTypes } from '@/node-types'; diff --git a/packages/cli/test/integration/shared/constants.ts b/packages/cli/test/integration/shared/constants.ts index 5fffacbd11788..377a0e45a4ab8 100644 --- a/packages/cli/test/integration/shared/constants.ts +++ b/packages/cli/test/integration/shared/constants.ts @@ -1,5 +1,5 @@ import { GlobalConfig } from '@n8n/config'; -import Container from 'typedi'; +import { Container } from '@n8n/di'; export const REST_PATH_SEGMENT = Container.get(GlobalConfig).endpoints.rest; diff --git a/packages/cli/test/integration/shared/db/credentials.ts b/packages/cli/test/integration/shared/db/credentials.ts index 5593b7d55a90c..08d99354f2f9f 100644 --- a/packages/cli/test/integration/shared/db/credentials.ts +++ b/packages/cli/test/integration/shared/db/credentials.ts @@ -1,4 +1,4 @@ -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import { CredentialsEntity } from '@/databases/entities/credentials-entity'; import type { Project } from '@/databases/entities/project'; diff --git a/packages/cli/test/integration/shared/db/executions.ts b/packages/cli/test/integration/shared/db/executions.ts index 4dd0b4fa764f7..9af7ad22edfba 100644 --- a/packages/cli/test/integration/shared/db/executions.ts +++ b/packages/cli/test/integration/shared/db/executions.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import type { AnnotationVote } from 'n8n-workflow'; -import Container from 'typedi'; import type { ExecutionData } from '@/databases/entities/execution-data'; import type { ExecutionEntity } from '@/databases/entities/execution-entity'; diff --git a/packages/cli/test/integration/shared/db/projects.ts b/packages/cli/test/integration/shared/db/projects.ts index 93310d5a99b8e..6ca0fcfad263a 100644 --- a/packages/cli/test/integration/shared/db/projects.ts +++ b/packages/cli/test/integration/shared/db/projects.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import type { Project } from '@/databases/entities/project'; import type { ProjectRelation, ProjectRole } from '@/databases/entities/project-relation'; diff --git a/packages/cli/test/integration/shared/db/tags.ts b/packages/cli/test/integration/shared/db/tags.ts index b9d943b938f33..af5638f902518 100644 --- a/packages/cli/test/integration/shared/db/tags.ts +++ b/packages/cli/test/integration/shared/db/tags.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import type { TagEntity } from '@/databases/entities/tag-entity'; import type { WorkflowEntity } from '@/databases/entities/workflow-entity'; diff --git a/packages/cli/test/integration/shared/db/users.ts b/packages/cli/test/integration/shared/db/users.ts index 64c4d8ad85c06..bb4332f9dedfb 100644 --- a/packages/cli/test/integration/shared/db/users.ts +++ b/packages/cli/test/integration/shared/db/users.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { hash } from 'bcryptjs'; -import Container from 'typedi'; import { AuthIdentity } from '@/databases/entities/auth-identity'; import { type GlobalRole, type User } from '@/databases/entities/user'; diff --git a/packages/cli/test/integration/shared/db/variables.ts b/packages/cli/test/integration/shared/db/variables.ts index 582d3ccc1be00..2ff052e7c0c81 100644 --- a/packages/cli/test/integration/shared/db/variables.ts +++ b/packages/cli/test/integration/shared/db/variables.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { randomString } from 'n8n-workflow'; -import Container from 'typedi'; import { VariablesRepository } from '@/databases/repositories/variables.repository'; import { generateNanoId } from '@/databases/utils/generators'; diff --git a/packages/cli/test/integration/shared/db/workflow-history.ts b/packages/cli/test/integration/shared/db/workflow-history.ts index 31d7e50cf5d61..ff7a2d5bec3b3 100644 --- a/packages/cli/test/integration/shared/db/workflow-history.ts +++ b/packages/cli/test/integration/shared/db/workflow-history.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import { v4 as uuid } from 'uuid'; import type { WorkflowHistory } from '@/databases/entities/workflow-history'; diff --git a/packages/cli/test/integration/shared/db/workflow-statistics.ts b/packages/cli/test/integration/shared/db/workflow-statistics.ts index 842ce6518abe0..0eee830816efd 100644 --- a/packages/cli/test/integration/shared/db/workflow-statistics.ts +++ b/packages/cli/test/integration/shared/db/workflow-statistics.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import type { Workflow } from 'n8n-workflow'; -import Container from 'typedi'; import { StatisticsNames, type WorkflowStatistics } from '@/databases/entities/workflow-statistics'; import { WorkflowStatisticsRepository } from '@/databases/repositories/workflow-statistics.repository'; diff --git a/packages/cli/test/integration/shared/db/workflows.ts b/packages/cli/test/integration/shared/db/workflows.ts index bc8099e494fed..dfd272b39607e 100644 --- a/packages/cli/test/integration/shared/db/workflows.ts +++ b/packages/cli/test/integration/shared/db/workflows.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import type { DeepPartial } from '@n8n/typeorm'; import { NodeConnectionType } from 'n8n-workflow'; -import Container from 'typedi'; import { v4 as uuid } from 'uuid'; import { Project } from '@/databases/entities/project'; diff --git a/packages/cli/test/integration/shared/ldap.ts b/packages/cli/test/integration/shared/ldap.ts index 9f87bd9962034..9cf37e6b62a9e 100644 --- a/packages/cli/test/integration/shared/ldap.ts +++ b/packages/cli/test/integration/shared/ldap.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { jsonParse } from 'n8n-workflow'; -import Container from 'typedi'; import { SettingsRepository } from '@/databases/repositories/settings.repository'; import { LDAP_DEFAULT_CONFIGURATION, LDAP_FEATURE_NAME } from '@/ldap.ee/constants'; diff --git a/packages/cli/test/integration/shared/test-db.ts b/packages/cli/test/integration/shared/test-db.ts index 4cfb131fb2fb9..052d383c27ac3 100644 --- a/packages/cli/test/integration/shared/test-db.ts +++ b/packages/cli/test/integration/shared/test-db.ts @@ -1,10 +1,10 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import type { DataSourceOptions, Repository } from '@n8n/typeorm'; import { DataSource as Connection } from '@n8n/typeorm'; import { kebabCase } from 'lodash'; import type { Class } from 'n8n-core'; import { randomString } from 'n8n-workflow'; -import { Container } from 'typedi'; import { getOptionOverrides } from '@/databases/config'; import * as Db from '@/db'; diff --git a/packages/cli/test/integration/shared/utils/community-nodes.ts b/packages/cli/test/integration/shared/utils/community-nodes.ts index d29a9361be31e..033d86c70984e 100644 --- a/packages/cli/test/integration/shared/utils/community-nodes.ts +++ b/packages/cli/test/integration/shared/utils/community-nodes.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import { NODE_PACKAGE_PREFIX } from '@/constants'; import { InstalledPackages } from '@/databases/entities/installed-packages'; diff --git a/packages/cli/test/integration/shared/utils/index.ts b/packages/cli/test/integration/shared/utils/index.ts index ba99e1ca07407..f43b102bd3854 100644 --- a/packages/cli/test/integration/shared/utils/index.ts +++ b/packages/cli/test/integration/shared/utils/index.ts @@ -1,3 +1,4 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; import { BinaryDataService, @@ -13,7 +14,6 @@ import { Set } from 'n8n-nodes-base/nodes/Set/Set.node'; import { Start } from 'n8n-nodes-base/nodes/Start/Start.node'; import type { INodeTypeData, INode } from 'n8n-workflow'; import type request from 'supertest'; -import { Container } from 'typedi'; import { v4 as uuid } from 'uuid'; import config from '@/config'; diff --git a/packages/cli/test/integration/shared/utils/task-broker-test-server.ts b/packages/cli/test/integration/shared/utils/task-broker-test-server.ts index 9363fc089ee49..2aea63beb3321 100644 --- a/packages/cli/test/integration/shared/utils/task-broker-test-server.ts +++ b/packages/cli/test/integration/shared/utils/task-broker-test-server.ts @@ -1,7 +1,7 @@ import { TaskRunnersConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import request from 'supertest'; import type TestAgent from 'supertest/lib/agent'; -import Container from 'typedi'; import { TaskRunnerServer } from '@/runners/task-runner-server'; diff --git a/packages/cli/test/integration/shared/utils/test-server.ts b/packages/cli/test/integration/shared/utils/test-server.ts index 52e97f8f31604..0adb57449f4d5 100644 --- a/packages/cli/test/integration/shared/utils/test-server.ts +++ b/packages/cli/test/integration/shared/utils/test-server.ts @@ -1,9 +1,9 @@ +import { Container } from '@n8n/di'; import cookieParser from 'cookie-parser'; import express from 'express'; import { Logger } from 'n8n-core'; import type superagent from 'superagent'; import request from 'supertest'; -import { Container } from 'typedi'; import { URL } from 'url'; import { AuthService } from '@/auth/auth.service'; diff --git a/packages/cli/test/integration/tags.api.test.ts b/packages/cli/test/integration/tags.api.test.ts index e3acc2a65019a..5d9a724f7816c 100644 --- a/packages/cli/test/integration/tags.api.test.ts +++ b/packages/cli/test/integration/tags.api.test.ts @@ -1,4 +1,4 @@ -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import { TagRepository } from '@/databases/repositories/tag.repository'; diff --git a/packages/cli/test/integration/user.repository.test.ts b/packages/cli/test/integration/user.repository.test.ts index 4de084ba39a5a..1e5ce846e0abb 100644 --- a/packages/cli/test/integration/user.repository.test.ts +++ b/packages/cli/test/integration/user.repository.test.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import { ProjectRelationRepository } from '@/databases/repositories/project-relation.repository'; import { UserRepository } from '@/databases/repositories/user.repository'; diff --git a/packages/cli/test/integration/users.api.test.ts b/packages/cli/test/integration/users.api.test.ts index 9ecacdec0c286..01fc50a17f8d5 100644 --- a/packages/cli/test/integration/users.api.test.ts +++ b/packages/cli/test/integration/users.api.test.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import { v4 as uuid } from 'uuid'; import { RESPONSE_ERROR_MESSAGES } from '@/constants'; diff --git a/packages/cli/test/integration/variables.test.ts b/packages/cli/test/integration/variables.test.ts index c331da8e9999f..cb47fb8a614b6 100644 --- a/packages/cli/test/integration/variables.test.ts +++ b/packages/cli/test/integration/variables.test.ts @@ -1,4 +1,4 @@ -import { Container } from 'typedi'; +import { Container } from '@n8n/di'; import type { Variables } from '@/databases/entities/variables'; import { VariablesRepository } from '@/databases/repositories/variables.repository'; diff --git a/packages/cli/test/integration/webhooks.test.ts b/packages/cli/test/integration/webhooks.test.ts index 7d7b5105cbb5a..0895f3caa8110 100644 --- a/packages/cli/test/integration/webhooks.test.ts +++ b/packages/cli/test/integration/webhooks.test.ts @@ -1,8 +1,8 @@ import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; import { agent as testAgent } from 'supertest'; import type SuperAgentTest from 'supertest/lib/agent'; -import Container from 'typedi'; import { ExternalHooks } from '@/external-hooks'; import { LiveWebhooks } from '@/webhooks/live-webhooks'; diff --git a/packages/cli/test/integration/workflow-history-manager.test.ts b/packages/cli/test/integration/workflow-history-manager.test.ts index eaf5d7447848d..12dd037357341 100644 --- a/packages/cli/test/integration/workflow-history-manager.test.ts +++ b/packages/cli/test/integration/workflow-history-manager.test.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import { In } from '@n8n/typeorm'; import { DateTime } from 'luxon'; -import Container from 'typedi'; import config from '@/config'; import { WorkflowHistoryRepository } from '@/databases/repositories/workflow-history.repository'; diff --git a/packages/cli/test/integration/workflow-tag-mapping.repository.integration.test.ts b/packages/cli/test/integration/workflow-tag-mapping.repository.integration.test.ts index 563764de7f115..c01adbc51ab1d 100644 --- a/packages/cli/test/integration/workflow-tag-mapping.repository.integration.test.ts +++ b/packages/cli/test/integration/workflow-tag-mapping.repository.integration.test.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import { TagRepository } from '@/databases/repositories/tag.repository'; import { WorkflowTagMappingRepository } from '@/databases/repositories/workflow-tag-mapping.repository'; diff --git a/packages/cli/test/integration/workflows/workflow-sharing.service.test.ts b/packages/cli/test/integration/workflows/workflow-sharing.service.test.ts index ab02af5b43a66..bfd068e2a07e1 100644 --- a/packages/cli/test/integration/workflows/workflow-sharing.service.test.ts +++ b/packages/cli/test/integration/workflows/workflow-sharing.service.test.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import type { User } from '@/databases/entities/user'; import { License } from '@/license'; diff --git a/packages/cli/test/integration/workflows/workflow.service.ee.test.ts b/packages/cli/test/integration/workflows/workflow.service.ee.test.ts index 5fbab55840286..0bb272d0c6a25 100644 --- a/packages/cli/test/integration/workflows/workflow.service.ee.test.ts +++ b/packages/cli/test/integration/workflows/workflow.service.ee.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; -import Container from 'typedi'; import { CredentialsEntity } from '@/databases/entities/credentials-entity'; import { CredentialsRepository } from '@/databases/repositories/credentials.repository'; diff --git a/packages/cli/test/integration/workflows/workflow.service.test.ts b/packages/cli/test/integration/workflows/workflow.service.test.ts index 759dbc54c8d7d..8e2c76c981f1f 100644 --- a/packages/cli/test/integration/workflows/workflow.service.test.ts +++ b/packages/cli/test/integration/workflows/workflow.service.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; -import Container from 'typedi'; import { ActiveWorkflowManager } from '@/active-workflow-manager'; import { SharedWorkflowRepository } from '@/databases/repositories/shared-workflow.repository'; diff --git a/packages/cli/test/integration/workflows/workflows.controller.ee.test.ts b/packages/cli/test/integration/workflows/workflows.controller.ee.test.ts index 2002843bfe829..d376500484a0e 100644 --- a/packages/cli/test/integration/workflows/workflows.controller.ee.test.ts +++ b/packages/cli/test/integration/workflows/workflows.controller.ee.test.ts @@ -1,5 +1,5 @@ +import { Container } from '@n8n/di'; import { ApplicationError, WorkflowActivationError, type INode } from 'n8n-workflow'; -import Container from 'typedi'; import { v4 as uuid } from 'uuid'; import { ActiveWorkflowManager } from '@/active-workflow-manager'; diff --git a/packages/cli/test/integration/workflows/workflows.controller.test.ts b/packages/cli/test/integration/workflows/workflows.controller.test.ts index e7e00d63c82e8..e69e172f97c0d 100644 --- a/packages/cli/test/integration/workflows/workflows.controller.test.ts +++ b/packages/cli/test/integration/workflows/workflows.controller.test.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import type { Scope } from '@n8n/permissions'; import type { INode, IPinData } from 'n8n-workflow'; -import Container from 'typedi'; import { v4 as uuid } from 'uuid'; import { ActiveWorkflowManager } from '@/active-workflow-manager'; diff --git a/packages/cli/test/shared/mocking.ts b/packages/cli/test/shared/mocking.ts index 535388c55626b..9fa9852f98269 100644 --- a/packages/cli/test/shared/mocking.ts +++ b/packages/cli/test/shared/mocking.ts @@ -1,9 +1,9 @@ +import { Container } from '@n8n/di'; import { DataSource, EntityManager, type EntityMetadata } from '@n8n/typeorm'; import { mock } from 'jest-mock-extended'; import type { Class } from 'n8n-core'; import type { Logger } from 'n8n-core'; import type { DeepPartial } from 'ts-essentials'; -import { Container } from 'typedi'; export const mockInstance = ( serviceClass: Class, diff --git a/packages/cli/test/teardown.ts b/packages/cli/test/teardown.ts index 1c40bf2df67ed..4d6339fde9411 100644 --- a/packages/cli/test/teardown.ts +++ b/packages/cli/test/teardown.ts @@ -1,7 +1,7 @@ import 'tsconfig-paths/register'; import { GlobalConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import { DataSource as Connection } from '@n8n/typeorm'; -import { Container } from 'typedi'; import { getBootstrapDBOptions, testDbPrefix } from './integration/shared/test-db'; diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index 3789372ef8b07..a427433aa6bd9 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -22,6 +22,7 @@ { "path": "../@n8n/api-types/tsconfig.build.json" }, { "path": "../@n8n/client-oauth2/tsconfig.build.json" }, { "path": "../@n8n/config/tsconfig.build.json" }, + { "path": "../@n8n/di/tsconfig.build.json" }, { "path": "../@n8n/permissions/tsconfig.build.json" } ] } diff --git a/packages/core/package.json b/packages/core/package.json index 401a9f81c749f..3b51aacf0639a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -39,6 +39,7 @@ "@langchain/core": "catalog:", "@n8n/client-oauth2": "workspace:*", "@n8n/config": "workspace:*", + "@n8n/di": "workspace:*", "@sentry/node": "catalog:", "aws4": "1.11.0", "axios": "catalog:", @@ -61,7 +62,6 @@ "pretty-bytes": "5.6.0", "qs": "6.11.0", "ssh2": "1.15.0", - "typedi": "catalog:", "uuid": "catalog:", "winston": "3.14.2", "xml2js": "catalog:", diff --git a/packages/core/src/ActiveWorkflows.ts b/packages/core/src/ActiveWorkflows.ts index 173f73baca939..abd544956aecd 100644 --- a/packages/core/src/ActiveWorkflows.ts +++ b/packages/core/src/ActiveWorkflows.ts @@ -1,3 +1,4 @@ +import { Service } from '@n8n/di'; import type { IGetExecutePollFunctions, IGetExecuteTriggerFunctions, @@ -16,7 +17,6 @@ import { WorkflowActivationError, WorkflowDeactivationError, } from 'n8n-workflow'; -import { Service } from 'typedi'; import { ErrorReporter } from './error-reporter'; import type { IWorkflowData } from './Interfaces'; diff --git a/packages/core/src/BinaryData/BinaryData.service.ts b/packages/core/src/BinaryData/BinaryData.service.ts index 556a3176deba4..5876ae075ee17 100644 --- a/packages/core/src/BinaryData/BinaryData.service.ts +++ b/packages/core/src/BinaryData/BinaryData.service.ts @@ -1,9 +1,9 @@ +import { Container, Service } from '@n8n/di'; import { BINARY_ENCODING } from 'n8n-workflow'; import type { INodeExecutionData, IBinaryData } from 'n8n-workflow'; import { readFile, stat } from 'node:fs/promises'; import prettyBytes from 'pretty-bytes'; import type { Readable } from 'stream'; -import Container, { Service } from 'typedi'; import type { BinaryData } from './types'; import { areConfigModes, binaryToBuffer } from './utils'; diff --git a/packages/core/src/BinaryData/ObjectStore.manager.ts b/packages/core/src/BinaryData/ObjectStore.manager.ts index 65827d4ef0973..5a2ab8ef551ff 100644 --- a/packages/core/src/BinaryData/ObjectStore.manager.ts +++ b/packages/core/src/BinaryData/ObjectStore.manager.ts @@ -1,6 +1,6 @@ +import { Service } from '@n8n/di'; import fs from 'node:fs/promises'; import type { Readable } from 'node:stream'; -import { Service } from 'typedi'; import { v4 as uuid } from 'uuid'; import type { BinaryData } from './types'; diff --git a/packages/core/src/Cipher.ts b/packages/core/src/Cipher.ts index d9ed93ddb63e7..812c8f452a78f 100644 --- a/packages/core/src/Cipher.ts +++ b/packages/core/src/Cipher.ts @@ -1,5 +1,5 @@ +import { Service } from '@n8n/di'; import { createHash, createCipheriv, createDecipheriv, randomBytes } from 'crypto'; -import { Service } from 'typedi'; import { InstanceSettings } from './InstanceSettings'; diff --git a/packages/core/src/Credentials.ts b/packages/core/src/Credentials.ts index da6deb742c525..f5f8eb834f734 100644 --- a/packages/core/src/Credentials.ts +++ b/packages/core/src/Credentials.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import type { ICredentialDataDecryptedObject, ICredentialsEncrypted } from 'n8n-workflow'; import { ApplicationError, ICredentials, jsonParse } from 'n8n-workflow'; -import { Container } from 'typedi'; import { Cipher } from './Cipher'; diff --git a/packages/core/src/DirectoryLoader.ts b/packages/core/src/DirectoryLoader.ts index fe9fee87694e4..26dace0fd1130 100644 --- a/packages/core/src/DirectoryLoader.ts +++ b/packages/core/src/DirectoryLoader.ts @@ -1,3 +1,4 @@ +import { Container } from '@n8n/di'; import glob from 'fast-glob'; import uniqBy from 'lodash/uniqBy'; import type { @@ -19,7 +20,6 @@ import { ApplicationError, applyDeclarativeNodeOptionParameters, jsonParse } fro import { readFileSync } from 'node:fs'; import { readFile } from 'node:fs/promises'; import * as path from 'path'; -import Container from 'typedi'; import { Logger } from '@/logging/logger'; diff --git a/packages/core/src/InstanceSettings.ts b/packages/core/src/InstanceSettings.ts index 814f75ef94835..65ce6bbf865b6 100644 --- a/packages/core/src/InstanceSettings.ts +++ b/packages/core/src/InstanceSettings.ts @@ -1,9 +1,9 @@ +import { Service } from '@n8n/di'; import { createHash, randomBytes } from 'crypto'; import { ApplicationError, jsonParse, ALPHABET, toResult } from 'n8n-workflow'; import { customAlphabet } from 'nanoid'; import { chmodSync, existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from 'node:fs'; import path from 'path'; -import { Service } from 'typedi'; import { Logger } from '@/logging/logger'; diff --git a/packages/core/src/NodeExecuteFunctions.ts b/packages/core/src/NodeExecuteFunctions.ts index 3a0ebf22f9309..9504ad1c78af4 100644 --- a/packages/core/src/NodeExecuteFunctions.ts +++ b/packages/core/src/NodeExecuteFunctions.ts @@ -13,6 +13,7 @@ import type { OAuth2CredentialData, } from '@n8n/client-oauth2'; import { ClientOAuth2 } from '@n8n/client-oauth2'; +import { Container } from '@n8n/di'; import type { AxiosError, AxiosHeaders, AxiosRequestConfig, AxiosResponse } from 'axios'; import axios from 'axios'; import chardet from 'chardet'; @@ -93,7 +94,6 @@ import clientOAuth1 from 'oauth-1.0a'; import path from 'path'; import { stringify } from 'qs'; import { Readable } from 'stream'; -import Container from 'typedi'; import url, { URL, URLSearchParams } from 'url'; import { Logger } from '@/logging/logger'; diff --git a/packages/core/src/ObjectStore/ObjectStore.service.ee.ts b/packages/core/src/ObjectStore/ObjectStore.service.ee.ts index 6379de7789f88..e1b98c6f5065a 100644 --- a/packages/core/src/ObjectStore/ObjectStore.service.ee.ts +++ b/packages/core/src/ObjectStore/ObjectStore.service.ee.ts @@ -1,3 +1,4 @@ +import { Service } from '@n8n/di'; import { sign } from 'aws4'; import type { Request as Aws4Options, Credentials as Aws4Credentials } from 'aws4'; import axios from 'axios'; @@ -5,7 +6,6 @@ import type { AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig, Met import { ApplicationError } from 'n8n-workflow'; import { createHash } from 'node:crypto'; import type { Readable } from 'stream'; -import { Service } from 'typedi'; import { Logger } from '@/logging/logger'; diff --git a/packages/core/src/SSHClientsManager.ts b/packages/core/src/SSHClientsManager.ts index 17046a26ebc11..a29c5facc7d55 100644 --- a/packages/core/src/SSHClientsManager.ts +++ b/packages/core/src/SSHClientsManager.ts @@ -1,7 +1,7 @@ +import { Service } from '@n8n/di'; import type { SSHCredentials } from 'n8n-workflow'; import { createHash } from 'node:crypto'; import { Client, type ConnectConfig } from 'ssh2'; -import { Service } from 'typedi'; @Service() export class SSHClientsManager { diff --git a/packages/core/src/ScheduledTaskManager.ts b/packages/core/src/ScheduledTaskManager.ts index 00396903a52b9..0c33f9872cdc1 100644 --- a/packages/core/src/ScheduledTaskManager.ts +++ b/packages/core/src/ScheduledTaskManager.ts @@ -1,6 +1,6 @@ +import { Service } from '@n8n/di'; import { CronJob } from 'cron'; import type { CronExpression, Workflow } from 'n8n-workflow'; -import { Service } from 'typedi'; import { InstanceSettings } from './InstanceSettings'; diff --git a/packages/core/src/TriggersAndPollers.ts b/packages/core/src/TriggersAndPollers.ts index b77926e136132..681d50641aebb 100644 --- a/packages/core/src/TriggersAndPollers.ts +++ b/packages/core/src/TriggersAndPollers.ts @@ -1,3 +1,4 @@ +import { Service } from '@n8n/di'; import { ApplicationError } from 'n8n-workflow'; import type { Workflow, @@ -13,7 +14,6 @@ import type { IExecuteResponsePromiseData, IRun, } from 'n8n-workflow'; -import { Service } from 'typedi'; @Service() export class TriggersAndPollers { diff --git a/packages/core/src/WorkflowExecute.ts b/packages/core/src/WorkflowExecute.ts index f340c8da675ba..c4880a5ea1b89 100644 --- a/packages/core/src/WorkflowExecute.ts +++ b/packages/core/src/WorkflowExecute.ts @@ -2,6 +2,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ +import { Container } from '@n8n/di'; import * as assert from 'assert/strict'; import { setMaxListeners } from 'events'; import { omit } from 'lodash'; @@ -53,7 +54,6 @@ import { Node, } from 'n8n-workflow'; import PCancelable from 'p-cancelable'; -import Container from 'typedi'; import { ErrorReporter } from './error-reporter'; import { ExecuteContext, PollContext } from './node-execution-context'; diff --git a/packages/core/src/error-reporter.ts b/packages/core/src/error-reporter.ts index b52fd6d2f6279..55089d1f2eeb7 100644 --- a/packages/core/src/error-reporter.ts +++ b/packages/core/src/error-reporter.ts @@ -1,10 +1,10 @@ +import { Service } from '@n8n/di'; import type { NodeOptions } from '@sentry/node'; import { close } from '@sentry/node'; import type { ErrorEvent, EventHint } from '@sentry/types'; import { AxiosError } from 'axios'; import { ApplicationError, type ReportingOptions } from 'n8n-workflow'; import { createHash } from 'node:crypto'; -import { Service } from 'typedi'; import type { InstanceType } from './InstanceSettings'; import { Logger } from './logging/logger'; diff --git a/packages/core/src/logging/logger.ts b/packages/core/src/logging/logger.ts index e959affba3b16..88065df728007 100644 --- a/packages/core/src/logging/logger.ts +++ b/packages/core/src/logging/logger.ts @@ -1,5 +1,6 @@ import type { LogScope } from '@n8n/config'; import { GlobalConfig } from '@n8n/config'; +import { Service } from '@n8n/di'; import callsites from 'callsites'; import type { TransformableInfo } from 'logform'; import { LoggerProxy, LOG_LEVELS } from 'n8n-workflow'; @@ -11,7 +12,6 @@ import type { } from 'n8n-workflow'; import path, { basename } from 'node:path'; import pc from 'picocolors'; -import { Service } from 'typedi'; import winston from 'winston'; import { inDevelopment, inProduction } from '@/Constants'; diff --git a/packages/core/src/node-execution-context/__tests__/node-execution-context.test.ts b/packages/core/src/node-execution-context/__tests__/node-execution-context.test.ts index 443460bb33706..a0a368df4c970 100644 --- a/packages/core/src/node-execution-context/__tests__/node-execution-context.test.ts +++ b/packages/core/src/node-execution-context/__tests__/node-execution-context.test.ts @@ -1,3 +1,4 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; import type { Expression, @@ -10,7 +11,6 @@ import type { WorkflowExecuteMode, } from 'n8n-workflow'; import { NodeConnectionType } from 'n8n-workflow'; -import { Container } from 'typedi'; import { InstanceSettings } from '@/InstanceSettings'; diff --git a/packages/core/src/node-execution-context/__tests__/shared-tests.ts b/packages/core/src/node-execution-context/__tests__/shared-tests.ts index 9992507bdd843..8b1d23930b10a 100644 --- a/packages/core/src/node-execution-context/__tests__/shared-tests.ts +++ b/packages/core/src/node-execution-context/__tests__/shared-tests.ts @@ -1,3 +1,4 @@ +import { Container } from '@n8n/di'; import { captor, mock, type MockProxy } from 'jest-mock-extended'; import type { IRunExecutionData, @@ -15,7 +16,6 @@ import type { IExecuteWorkflowInfo, } from 'n8n-workflow'; import { ApplicationError, NodeHelpers, WAIT_INDEFINITELY } from 'n8n-workflow'; -import Container from 'typedi'; import { BinaryDataService } from '@/BinaryData/BinaryData.service'; diff --git a/packages/core/src/node-execution-context/base-execute-context.ts b/packages/core/src/node-execution-context/base-execute-context.ts index 24b9e89301fca..04168703440a4 100644 --- a/packages/core/src/node-execution-context/base-execute-context.ts +++ b/packages/core/src/node-execution-context/base-execute-context.ts @@ -1,3 +1,4 @@ +import { Container } from '@n8n/di'; import { get } from 'lodash'; import type { Workflow, @@ -27,7 +28,6 @@ import { WAIT_INDEFINITELY, WorkflowDataProxy, } from 'n8n-workflow'; -import { Container } from 'typedi'; import { BinaryDataService } from '@/BinaryData/BinaryData.service'; diff --git a/packages/core/src/node-execution-context/node-execution-context.ts b/packages/core/src/node-execution-context/node-execution-context.ts index d303b10ba1b69..45a205637c625 100644 --- a/packages/core/src/node-execution-context/node-execution-context.ts +++ b/packages/core/src/node-execution-context/node-execution-context.ts @@ -1,3 +1,4 @@ +import { Container } from '@n8n/di'; import { get } from 'lodash'; import type { FunctionsBase, @@ -26,7 +27,6 @@ import { NodeHelpers, NodeOperationError, } from 'n8n-workflow'; -import { Container } from 'typedi'; import { HTTP_REQUEST_NODE_TYPE, HTTP_REQUEST_TOOL_NODE_TYPE } from '@/Constants'; import { Memoized } from '@/decorators'; diff --git a/packages/core/test/Cipher.test.ts b/packages/core/test/Cipher.test.ts index e3dfa609faf9d..7f6bcdedf3795 100644 --- a/packages/core/test/Cipher.test.ts +++ b/packages/core/test/Cipher.test.ts @@ -1,4 +1,4 @@ -import Container from 'typedi'; +import { Container } from '@n8n/di'; import { Cipher } from '@/Cipher'; import { InstanceSettings } from '@/InstanceSettings'; diff --git a/packages/core/test/Credentials.test.ts b/packages/core/test/Credentials.test.ts index fa7be59267d37..bf6ba29ca5717 100644 --- a/packages/core/test/Credentials.test.ts +++ b/packages/core/test/Credentials.test.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; import type { CredentialInformation } from 'n8n-workflow'; -import { Container } from 'typedi'; import { Cipher } from '@/Cipher'; import { Credentials } from '@/Credentials'; diff --git a/packages/core/test/NodeExecuteFunctions.test.ts b/packages/core/test/NodeExecuteFunctions.test.ts index b1b6e96577781..703e3f9bef6f4 100644 --- a/packages/core/test/NodeExecuteFunctions.test.ts +++ b/packages/core/test/NodeExecuteFunctions.test.ts @@ -1,3 +1,4 @@ +import { Container } from '@n8n/di'; import FormData from 'form-data'; import { mkdtempSync, readFileSync } from 'fs'; import { IncomingMessage } from 'http'; @@ -19,7 +20,6 @@ import { tmpdir } from 'os'; import { join } from 'path'; import { Readable } from 'stream'; import type { SecureContextOptions } from 'tls'; -import Container from 'typedi'; import { BinaryDataService } from '@/BinaryData/BinaryData.service'; import { InstanceSettings } from '@/InstanceSettings'; diff --git a/packages/core/test/utils.ts b/packages/core/test/utils.ts index f1ed54dd03660..49db471e7e95c 100644 --- a/packages/core/test/utils.ts +++ b/packages/core/test/utils.ts @@ -1,8 +1,8 @@ +import type { Constructable } from '@n8n/di'; +import { Container } from '@n8n/di'; import { mock } from 'jest-mock-extended'; import { Duplex } from 'stream'; import type { DeepPartial } from 'ts-essentials'; -import type { Constructable } from 'typedi'; -import { Container } from 'typedi'; export const mockInstance = ( constructor: Constructable, diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 654ae1be613ea..111dd828ddcf3 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -16,6 +16,7 @@ "references": [ { "path": "../workflow/tsconfig.build.json" }, { "path": "../@n8n/config/tsconfig.build.json" }, + { "path": "../@n8n/di/tsconfig.build.json" }, { "path": "../@n8n/client-oauth2/tsconfig.build.json" } ] } diff --git a/packages/node-dev/commands/build.ts b/packages/node-dev/commands/build.ts index ce42baf7ddcea..042a15111df14 100644 --- a/packages/node-dev/commands/build.ts +++ b/packages/node-dev/commands/build.ts @@ -1,6 +1,6 @@ +import { Container } from '@n8n/di'; import { Command, Flags } from '@oclif/core'; import { InstanceSettings } from 'n8n-core'; -import { Container } from 'typedi'; import type { IBuildOptions } from '../src'; import { buildFiles } from '../src'; diff --git a/packages/node-dev/package.json b/packages/node-dev/package.json index 96e133aa174ae..a2fd1b77662e0 100644 --- a/packages/node-dev/package.json +++ b/packages/node-dev/package.json @@ -39,6 +39,7 @@ "@types/inquirer": "^6.5.0" }, "dependencies": { + "@n8n/di": "workspace:*", "@oclif/core": "4.0.7", "change-case": "^4.1.1", "fast-glob": "catalog:", @@ -46,7 +47,6 @@ "n8n-core": "workspace:*", "n8n-workflow": "workspace:*", "replace-in-file": "^6.0.0", - "tmp-promise": "^3.0.3", - "typedi": "catalog:" + "tmp-promise": "^3.0.3" } } diff --git a/packages/node-dev/src/Build.ts b/packages/node-dev/src/Build.ts index de6d83a2cf67e..b0446472c2d12 100644 --- a/packages/node-dev/src/Build.ts +++ b/packages/node-dev/src/Build.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-unsafe-argument */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ +import { Container } from '@n8n/di'; import { spawn } from 'child_process'; import glob from 'fast-glob'; import { copyFile, mkdir, readFile, writeFile } from 'fs/promises'; @@ -7,7 +8,6 @@ import { InstanceSettings } from 'n8n-core'; import { jsonParse } from 'n8n-workflow'; import { join, dirname, resolve as resolvePath } from 'path'; import { file as tmpFile } from 'tmp-promise'; -import { Container } from 'typedi'; import type { IBuildOptions } from './Interfaces'; diff --git a/packages/nodes-base/nodes/Code/Code.node.ts b/packages/nodes-base/nodes/Code/Code.node.ts index 99604a712a081..24a26923e89cf 100644 --- a/packages/nodes-base/nodes/Code/Code.node.ts +++ b/packages/nodes-base/nodes/Code/Code.node.ts @@ -1,4 +1,5 @@ import { TaskRunnersConfig } from '@n8n/config'; +import { Container } from '@n8n/di'; import set from 'lodash/set'; import { NodeConnectionType, @@ -9,7 +10,6 @@ import { type INodeType, type INodeTypeDescription, } from 'n8n-workflow'; -import Container from 'typedi'; import { javascriptCodeDescription } from './descriptions/JavascriptCodeDescription'; import { pythonCodeDescription } from './descriptions/PythonCodeDescription'; diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 0307b66721640..51bbf93feaff0 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -851,6 +851,7 @@ "@aws-sdk/client-sso-oidc": "3.666.0", "@kafkajs/confluent-schema-registry": "1.0.6", "@n8n/config": "workspace:*", + "@n8n/di": "workspace:*", "@n8n/imap": "workspace:*", "@n8n/vm2": "3.9.25", "alasql": "4.4.0", @@ -910,7 +911,6 @@ "ssh2-sftp-client": "7.2.3", "tmp-promise": "3.0.3", "ts-ics": "1.2.2", - "typedi": "catalog:", "uuid": "catalog:", "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz", "xml2js": "catalog:" diff --git a/packages/nodes-base/test/nodes/Helpers.ts b/packages/nodes-base/test/nodes/Helpers.ts index 19e4f72b40793..017e2058f91ff 100644 --- a/packages/nodes-base/test/nodes/Helpers.ts +++ b/packages/nodes-base/test/nodes/Helpers.ts @@ -1,3 +1,4 @@ +import { Container } from '@n8n/di'; import { readFileSync, readdirSync, mkdtempSync } from 'fs'; import { mock } from 'jest-mock-extended'; import { get } from 'lodash'; @@ -38,7 +39,6 @@ import { ApplicationError, ICredentialsHelper, NodeHelpers, WorkflowHooks } from import nock from 'nock'; import { tmpdir } from 'os'; import path from 'path'; -import { Container } from 'typedi'; import { executeWorkflow } from './ExecuteWorkflow'; import { FAKE_CREDENTIALS_DATA } from './FakeCredentialsMap'; diff --git a/patches/typedi@0.10.0.patch b/patches/typedi@0.10.0.patch deleted file mode 100644 index d9b4ab659ca8b..0000000000000 --- a/patches/typedi@0.10.0.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/cjs/container-instance.class.js b/cjs/container-instance.class.js -index e473b1e652aa0b6e7462f7ba93fcef2812483b20..9e57857e5584373b88a9fad3fbb37bbcc56b554a 100644 ---- a/cjs/container-instance.class.js -+++ b/cjs/container-instance.class.js -@@ -234,6 +234,9 @@ class ContainerInstance { - */ - initializeParams(target, paramTypes) { - return paramTypes.map((paramType, index) => { -+ if (paramType === undefined) { -+ throw new ReferenceError(`Circular dependency: Target${target.name}. Index: ${index} `); -+ } - const paramHandler = container_class_1.Container.handlers.find(handler => { - /** - * @Inject()-ed values are stored as parameter handlers and they reference their target diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dcc3dfdf4317b..fb75e12985dcd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,9 +60,6 @@ catalogs: picocolors: specifier: 1.0.1 version: 1.0.1 - typedi: - specifier: 0.10.0 - version: 0.10.0 uuid: specifier: 10.0.0 version: 10.0.0 @@ -136,9 +133,6 @@ patchedDependencies: pyodide@0.23.4: hash: kzcwsjcayy5m6iezu7r4tdimjq path: patches/pyodide@0.23.4.patch - typedi@0.10.0: - hash: sk6omkefrosihg7lmqbzh7vfxe - path: patches/typedi@0.10.0.patch vue-tsc@2.1.10: hash: z2iuqlt7ype4qnrwd5eymeecl4 path: patches/vue-tsc@2.1.10.patch @@ -380,12 +374,18 @@ importers: packages/@n8n/config: dependencies: + '@n8n/di': + specifier: workspace:* + version: link:../di reflect-metadata: specifier: 0.2.2 version: 0.2.2 - typedi: - specifier: 'catalog:' - version: 0.10.0(patch_hash=sk6omkefrosihg7lmqbzh7vfxe) + + packages/@n8n/di: + dependencies: + reflect-metadata: + specifier: '*' + version: 0.2.2 packages/@n8n/imap: dependencies: @@ -669,6 +669,9 @@ importers: '@n8n/config': specifier: workspace:* version: link:../config + '@n8n/di': + specifier: workspace:* + version: link:../di '@sentry/node': specifier: 'catalog:' version: 8.42.0 @@ -690,9 +693,6 @@ importers: nanoid: specifier: 'catalog:' version: 3.3.8 - typedi: - specifier: 'catalog:' - version: 0.10.0(patch_hash=sk6omkefrosihg7lmqbzh7vfxe) ws: specifier: '>=8.17.1' version: 8.17.1 @@ -772,6 +772,9 @@ importers: '@n8n/config': specifier: workspace:* version: link:../@n8n/config + '@n8n/di': + specifier: workspace:* + version: link:../@n8n/di '@n8n/localtunnel': specifier: 3.0.0 version: 3.0.0 @@ -1000,9 +1003,6 @@ importers: syslog-client: specifier: 1.1.1 version: 1.1.1 - typedi: - specifier: 'catalog:' - version: 0.10.0(patch_hash=sk6omkefrosihg7lmqbzh7vfxe) uuid: specifier: 'catalog:' version: 10.0.0 @@ -1127,6 +1127,9 @@ importers: '@n8n/config': specifier: workspace:* version: link:../@n8n/config + '@n8n/di': + specifier: workspace:* + version: link:../@n8n/di '@sentry/node': specifier: 'catalog:' version: 8.42.0 @@ -1193,9 +1196,6 @@ importers: ssh2: specifier: 1.15.0 version: 1.15.0 - typedi: - specifier: 'catalog:' - version: 0.10.0(patch_hash=sk6omkefrosihg7lmqbzh7vfxe) uuid: specifier: 'catalog:' version: 10.0.0 @@ -1625,6 +1625,9 @@ importers: packages/node-dev: dependencies: + '@n8n/di': + specifier: workspace:* + version: link:../@n8n/di '@oclif/core': specifier: 4.0.7 version: 4.0.7 @@ -1649,9 +1652,6 @@ importers: tmp-promise: specifier: ^3.0.3 version: 3.0.3 - typedi: - specifier: 'catalog:' - version: 0.10.0(patch_hash=sk6omkefrosihg7lmqbzh7vfxe) devDependencies: '@types/inquirer': specifier: ^6.5.0 @@ -1668,6 +1668,9 @@ importers: '@n8n/config': specifier: workspace:* version: link:../@n8n/config + '@n8n/di': + specifier: workspace:* + version: link:../@n8n/di '@n8n/imap': specifier: workspace:* version: link:../@n8n/imap @@ -1845,9 +1848,6 @@ importers: ts-ics: specifier: 1.2.2 version: 1.2.2(date-fns@2.30.0)(lodash@4.17.21)(zod@3.23.8) - typedi: - specifier: 'catalog:' - version: 0.10.0(patch_hash=sk6omkefrosihg7lmqbzh7vfxe) uuid: specifier: 'catalog:' version: 10.0.0 @@ -12615,9 +12615,6 @@ packages: typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} - typedi@0.10.0: - resolution: {integrity: sha512-v3UJF8xm68BBj6AF4oQML3ikrfK2c9EmZUyLOfShpJuItAqVBHWP/KtpGinkSsIiP6EZyyb6Z3NXyW9dgS9X1w==} - typescript@5.7.2: resolution: {integrity: sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==} engines: {node: '>=14.17'} @@ -27008,8 +27005,6 @@ snapshots: typedarray@0.0.6: {} - typedi@0.10.0(patch_hash=sk6omkefrosihg7lmqbzh7vfxe): {} - typescript@5.7.2: {} uc.micro@1.0.6: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 9700a3a45bbdc..5a66d52b8e6cc 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -23,7 +23,6 @@ catalog: luxon: 3.4.4 nanoid: 3.3.8 picocolors: 1.0.1 - typedi: 0.10.0 uuid: 10.0.0 xml2js: 0.6.2 xss: 1.0.15 diff --git a/turbo.json b/turbo.json index 911702b0e0b1d..c2bd45d06bc0d 100644 --- a/turbo.json +++ b/turbo.json @@ -28,6 +28,7 @@ "dependsOn": [ "@n8n/api-types#lint", "@n8n/config#lint", + "@n8n/di#lint", "@n8n/client-oauth2#lint", "@n8n/imap#lint", "@n8n/permissions#lint", @@ -57,6 +58,7 @@ "dependsOn": [ "@n8n/api-types#test", "@n8n/config#test", + "@n8n/di#test", "@n8n/client-oauth2#test", "@n8n/imap#test", "@n8n/permissions#test",