n8n 2.4.4 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/active-executions.js +1 -0
- package/dist/active-executions.js.map +1 -1
- package/dist/auth/auth.service.js +2 -1
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/chat/chat-service.d.ts +2 -1
- package/dist/chat/chat-service.js +33 -11
- package/dist/chat/chat-service.js.map +1 -1
- package/dist/chat/utils.d.ts +1 -1
- package/dist/chat/utils.js +5 -0
- package/dist/chat/utils.js.map +1 -1
- package/dist/commands/base-command.js +2 -0
- package/dist/commands/base-command.js.map +1 -1
- package/dist/commands/export/credentials.d.ts +2 -2
- package/dist/commands/export/workflow.d.ts +2 -2
- package/dist/commands/import/entities.d.ts +3 -0
- package/dist/commands/import/entities.js +11 -1
- package/dist/commands/import/entities.js.map +1 -1
- package/dist/commands/start.js +1 -4
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/webhook.js +2 -0
- package/dist/commands/webhook.js.map +1 -1
- package/dist/commands/worker.js +1 -0
- package/dist/commands/worker.js.map +1 -1
- package/dist/config/index.js +0 -1
- package/dist/config/index.js.map +1 -1
- package/dist/controller.registry.js +6 -0
- package/dist/controller.registry.js.map +1 -1
- package/dist/controllers/ai.controller.d.ts +1 -2
- package/dist/controllers/ai.controller.js +0 -18
- package/dist/controllers/ai.controller.js.map +1 -1
- package/dist/controllers/auth.controller.js +2 -1
- package/dist/controllers/auth.controller.js.map +1 -1
- package/dist/controllers/e2e.controller.d.ts +3 -3
- package/dist/controllers/e2e.controller.js +10 -8
- package/dist/controllers/e2e.controller.js.map +1 -1
- package/dist/controllers/me.controller.js +13 -15
- package/dist/controllers/me.controller.js.map +1 -1
- package/dist/controllers/node-types.controller.d.ts +2 -0
- package/dist/controllers/node-types.controller.js +40 -22
- package/dist/controllers/node-types.controller.js.map +1 -1
- package/dist/controllers/orchestration.controller.d.ts +2 -1
- package/dist/controllers/orchestration.controller.js +3 -3
- package/dist/controllers/orchestration.controller.js.map +1 -1
- package/dist/credentials-helper.js +3 -1
- package/dist/credentials-helper.js.map +1 -1
- package/dist/deprecation/deprecation.service.js +5 -0
- package/dist/deprecation/deprecation.service.js.map +1 -1
- package/dist/eventbus/message-event-bus/message-event-bus.d.ts +2 -21
- package/dist/eventbus/message-event-bus/message-event-bus.js +1 -110
- package/dist/eventbus/message-event-bus/message-event-bus.js.map +1 -1
- package/dist/events/maps/relay.event-map.d.ts +6 -0
- package/dist/events/relays/telemetry.event-relay.d.ts +1 -0
- package/dist/events/relays/telemetry.event-relay.js +18 -4
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/events/relays/workflow-failure-notification.event-relay.d.ts +13 -0
- package/dist/events/relays/workflow-failure-notification.event-relay.js +78 -0
- package/dist/events/relays/workflow-failure-notification.event-relay.js.map +1 -0
- package/dist/executions/execution-data/types.d.ts +17 -0
- package/dist/executions/execution-data/types.js.map +1 -0
- package/dist/executions/{execution-data.service.d.ts → failed-run-factory.d.ts} +1 -1
- package/dist/executions/{execution-data.service.js → failed-run-factory.js} +6 -6
- package/dist/executions/failed-run-factory.js.map +1 -0
- package/dist/license/license.controller.js +6 -1
- package/dist/license/license.controller.js.map +1 -1
- package/dist/license/license.service.d.ts +2 -1
- package/dist/license/license.service.js +10 -2
- package/dist/license/license.service.js.map +1 -1
- package/dist/license.d.ts +2 -1
- package/dist/license.js +2 -2
- package/dist/license.js.map +1 -1
- package/dist/load-nodes-and-credentials.d.ts +1 -0
- package/dist/load-nodes-and-credentials.js +7 -0
- package/dist/load-nodes-and-credentials.js.map +1 -1
- package/dist/mfa/mfa.service.d.ts +5 -3
- package/dist/mfa/mfa.service.js +15 -10
- package/dist/mfa/mfa.service.js.map +1 -1
- package/dist/modules/breaking-changes/breaking-changes.module.js +1 -1
- package/dist/modules/breaking-changes/breaking-changes.module.js.map +1 -1
- package/dist/modules/breaking-changes/breaking-changes.service.d.ts +4 -3
- package/dist/modules/breaking-changes/breaking-changes.service.js +25 -6
- package/dist/modules/breaking-changes/breaking-changes.service.js.map +1 -1
- package/dist/modules/breaking-changes/rules/index.d.ts +1 -1
- package/dist/modules/breaking-changes/rules/v2/index.d.ts +2 -3
- package/dist/modules/breaking-changes/rules/v2/index.js +0 -4
- package/dist/modules/breaking-changes/rules/v2/index.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-agent.service.d.ts +2 -2
- package/dist/modules/chat-hub/chat-hub-agent.service.js +2 -2
- package/dist/modules/chat-hub/chat-hub-agent.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-extractor.d.ts +22 -0
- package/dist/modules/chat-hub/chat-hub-extractor.js +64 -0
- package/dist/modules/chat-hub/chat-hub-extractor.js.map +1 -0
- package/dist/modules/chat-hub/chat-hub-message.entity.js +1 -1
- package/dist/modules/chat-hub/chat-hub-message.entity.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-session.entity.js +1 -1
- package/dist/modules/chat-hub/chat-hub-session.entity.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-workflow.service.d.ts +1 -1
- package/dist/modules/chat-hub/chat-hub-workflow.service.js +2 -2
- package/dist/modules/chat-hub/chat-hub-workflow.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.constants.d.ts +2 -0
- package/dist/modules/chat-hub/chat-hub.constants.js +6 -1
- package/dist/modules/chat-hub/chat-hub.constants.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.controller.js +17 -5
- package/dist/modules/chat-hub/chat-hub.controller.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.service.d.ts +16 -3
- package/dist/modules/chat-hub/chat-hub.service.js +290 -56
- package/dist/modules/chat-hub/chat-hub.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.types.d.ts +8 -2
- package/dist/modules/chat-hub/chat-hub.types.js.map +1 -1
- package/dist/modules/community-packages/community-node-types.service.js +2 -5
- package/dist/modules/community-packages/community-node-types.service.js.map +1 -1
- package/dist/modules/community-packages/community-packages.module.d.ts +1 -0
- package/dist/modules/community-packages/community-packages.module.js +3 -0
- package/dist/modules/community-packages/community-packages.module.js.map +1 -1
- package/dist/modules/community-packages/community-packages.service.js +4 -0
- package/dist/modules/community-packages/community-packages.service.js.map +1 -1
- package/dist/modules/data-table/data-table-file-cleanup.service.d.ts +3 -1
- package/dist/modules/data-table/data-table-file-cleanup.service.js +7 -2
- package/dist/modules/data-table/data-table-file-cleanup.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.config.d.ts +4 -0
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.config.js +32 -0
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.config.js.map +1 -0
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.d.ts +9 -2
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js +63 -7
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-cors.service.d.ts +12 -0
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-cors.service.js +70 -0
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-cors.service.js.map +1 -0
- package/dist/modules/dynamic-credentials.ee/workflow-status.controller.d.ts +5 -2
- package/dist/modules/dynamic-credentials.ee/workflow-status.controller.js +17 -3
- package/dist/modules/dynamic-credentials.ee/workflow-status.controller.js.map +1 -1
- package/dist/modules/external-secrets.ee/external-secrets.config.d.ts +1 -0
- package/dist/modules/external-secrets.ee/external-secrets.config.js +5 -0
- package/dist/modules/external-secrets.ee/external-secrets.config.js.map +1 -1
- package/dist/modules/log-streaming.ee/database/entities/event-destination.entity.d.ts +6 -0
- package/dist/modules/log-streaming.ee/database/entities/event-destination.entity.js +29 -0
- package/dist/modules/log-streaming.ee/database/entities/event-destination.entity.js.map +1 -0
- package/dist/modules/log-streaming.ee/database/entities/index.d.ts +1 -0
- package/dist/modules/log-streaming.ee/database/entities/index.js +6 -0
- package/dist/modules/log-streaming.ee/database/entities/index.js.map +1 -0
- package/dist/modules/log-streaming.ee/database/repositories/event-destination.repository.d.ts +5 -0
- package/dist/modules/log-streaming.ee/database/repositories/event-destination.repository.js +26 -0
- package/dist/modules/log-streaming.ee/database/repositories/event-destination.repository.js.map +1 -0
- package/dist/{eventbus/message-event-bus-destination → modules/log-streaming.ee/destinations}/message-event-bus-destination-from-db.d.ts +2 -2
- package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-from-db.js.map +1 -0
- package/dist/{eventbus/message-event-bus-destination → modules/log-streaming.ee/destinations}/message-event-bus-destination-sentry.ee.d.ts +1 -1
- package/dist/{eventbus/message-event-bus-destination → modules/log-streaming.ee/destinations}/message-event-bus-destination-sentry.ee.js +3 -4
- package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-sentry.ee.js.map +1 -0
- package/dist/{eventbus/message-event-bus-destination → modules/log-streaming.ee/destinations}/message-event-bus-destination-syslog.ee.d.ts +1 -1
- package/dist/{eventbus/message-event-bus-destination → modules/log-streaming.ee/destinations}/message-event-bus-destination-syslog.ee.js +1 -1
- package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-syslog.ee.js.map +1 -0
- package/dist/{eventbus/message-event-bus-destination → modules/log-streaming.ee/destinations}/message-event-bus-destination-webhook.ee.d.ts +2 -2
- package/dist/{eventbus/message-event-bus-destination → modules/log-streaming.ee/destinations}/message-event-bus-destination-webhook.ee.js +3 -3
- package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-webhook.ee.js.map +1 -0
- package/dist/{eventbus/message-event-bus-destination → modules/log-streaming.ee/destinations}/message-event-bus-destination.ee.d.ts +6 -12
- package/dist/{eventbus/message-event-bus-destination → modules/log-streaming.ee/destinations}/message-event-bus-destination.ee.js +9 -49
- package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination.ee.js.map +1 -0
- package/dist/modules/log-streaming.ee/log-streaming-destination.service.d.ts +32 -0
- package/dist/modules/log-streaming.ee/log-streaming-destination.service.js +176 -0
- package/dist/modules/log-streaming.ee/log-streaming-destination.service.js.map +1 -0
- package/dist/{eventbus/event-bus.controller.d.ts → modules/log-streaming.ee/log-streaming.controller.d.ts} +5 -3
- package/dist/{eventbus/event-bus.controller.js → modules/log-streaming.ee/log-streaming.controller.js} +19 -18
- package/dist/modules/log-streaming.ee/log-streaming.controller.js.map +1 -0
- package/dist/modules/log-streaming.ee/log-streaming.module.d.ts +5 -0
- package/dist/modules/log-streaming.ee/log-streaming.module.js +67 -0
- package/dist/modules/log-streaming.ee/log-streaming.module.js.map +1 -0
- package/dist/modules/mcp/mcp.errors.d.ts +5 -0
- package/dist/modules/mcp/mcp.errors.js +9 -1
- package/dist/modules/mcp/mcp.errors.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +7 -2
- package/dist/modules/mcp/mcp.service.js +13 -4
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/mcp.types.d.ts +9 -5
- package/dist/modules/mcp/tools/execute-workflow.tool.d.ts +3 -3
- package/dist/modules/mcp/tools/execute-workflow.tool.js +34 -10
- package/dist/modules/mcp/tools/execute-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/get-workflow-details.tool.d.ts +4 -2
- package/dist/modules/mcp/tools/get-workflow-details.tool.js +9 -3
- package/dist/modules/mcp/tools/get-workflow-details.tool.js.map +1 -1
- package/dist/modules/mcp/tools/schemas.d.ts +10 -0
- package/dist/modules/mcp/tools/schemas.js +2 -0
- package/dist/modules/mcp/tools/schemas.js.map +1 -1
- package/dist/modules/mcp/tools/search-workflows.tool.js +25 -14
- package/dist/modules/mcp/tools/search-workflows.tool.js.map +1 -1
- package/dist/modules/provisioning.ee/provisioning.module.js +5 -1
- package/dist/modules/provisioning.ee/provisioning.module.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-git.service.ee.d.ts +1 -0
- package/dist/modules/source-control.ee/source-control-git.service.ee.js +40 -3
- package/dist/modules/source-control.ee/source-control-git.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-preferences.service.ee.d.ts +3 -1
- package/dist/modules/source-control.ee/source-control-preferences.service.ee.js +61 -11
- package/dist/modules/source-control.ee/source-control-preferences.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.controller.ee.d.ts +1 -1
- package/dist/modules/source-control.ee/source-control.controller.ee.js +35 -5
- package/dist/modules/source-control.ee/source-control.controller.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.module.js +5 -1
- package/dist/modules/source-control.ee/source-control.module.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.service.ee.d.ts +4 -0
- package/dist/modules/source-control.ee/source-control.service.ee.js +77 -5
- package/dist/modules/source-control.ee/source-control.service.ee.js.map +1 -1
- package/dist/modules/sso-oidc/constants.js.map +1 -0
- package/dist/{sso.ee/oidc/routes → modules/sso-oidc}/oidc.controller.ee.d.ts +4 -4
- package/dist/{sso.ee/oidc/routes → modules/sso-oidc}/oidc.controller.ee.js +6 -6
- package/dist/modules/sso-oidc/oidc.controller.ee.js.map +1 -0
- package/dist/{sso.ee/oidc → modules/sso-oidc}/oidc.service.ee.js +2 -2
- package/dist/modules/sso-oidc/oidc.service.ee.js.map +1 -0
- package/dist/modules/sso-oidc/sso-oidc.module.d.ts +4 -0
- package/dist/modules/sso-oidc/sso-oidc.module.js +56 -0
- package/dist/modules/sso-oidc/sso-oidc.module.js.map +1 -0
- package/dist/modules/sso-saml/constants.js.map +1 -0
- package/dist/modules/sso-saml/errors/invalid-saml-metadata-url.error.js.map +1 -0
- package/dist/modules/sso-saml/errors/invalid-saml-metadata.error.js.map +1 -0
- package/dist/{sso.ee/saml → modules/sso-saml}/middleware/saml-enabled-middleware.js +3 -3
- package/dist/modules/sso-saml/middleware/saml-enabled-middleware.js.map +1 -0
- package/dist/{sso.ee/saml → modules/sso-saml}/saml-helpers.d.ts +0 -4
- package/dist/{sso.ee/saml → modules/sso-saml}/saml-helpers.js +1 -18
- package/dist/modules/sso-saml/saml-helpers.js.map +1 -0
- package/dist/modules/sso-saml/saml-validator.js.map +1 -0
- package/dist/{sso.ee/saml/routes → modules/sso-saml}/saml.controller.ee.d.ts +5 -5
- package/dist/{sso.ee/saml/routes → modules/sso-saml}/saml.controller.ee.js +12 -11
- package/dist/modules/sso-saml/saml.controller.ee.js.map +1 -0
- package/dist/{sso.ee/saml → modules/sso-saml}/saml.service.ee.js +12 -12
- package/dist/modules/sso-saml/saml.service.ee.js.map +1 -0
- package/dist/modules/sso-saml/schema/metadata-exchange.xsd.js.map +1 -0
- package/dist/modules/sso-saml/schema/oasis-200401-wss-wssecurity-secext-1.0.xsd.js.map +1 -0
- package/dist/modules/sso-saml/schema/oasis-200401-wss-wssecurity-utility-1.0.xsd.js.map +1 -0
- package/dist/{sso.ee/saml → modules/sso-saml}/schema/saml-schema-assertion-2.0.xsd.js.map +1 -1
- package/dist/{sso.ee/saml → modules/sso-saml}/schema/saml-schema-metadata-2.0.xsd.js.map +1 -1
- package/dist/{sso.ee/saml → modules/sso-saml}/schema/saml-schema-protocol-2.0.xsd.js.map +1 -1
- package/dist/modules/sso-saml/schema/ws-addr.xsd.js.map +1 -0
- package/dist/modules/sso-saml/schema/ws-authorization.xsd.js.map +1 -0
- package/dist/{sso.ee/saml → modules/sso-saml}/schema/ws-federation.xsd.js.map +1 -1
- package/dist/{sso.ee/saml → modules/sso-saml}/schema/ws-securitypolicy-1.2.xsd.js.map +1 -1
- package/dist/modules/sso-saml/schema/xenc-schema.xsd.js.map +1 -0
- package/dist/modules/sso-saml/schema/xml.xsd.js.map +1 -0
- package/dist/{sso.ee/saml → modules/sso-saml}/schema/xmldsig-core-schema.xsd.js.map +1 -1
- package/dist/modules/sso-saml/service-provider.ee.js.map +1 -0
- package/dist/modules/sso-saml/sso-saml.module.d.ts +4 -0
- package/dist/modules/sso-saml/sso-saml.module.js +56 -0
- package/dist/modules/sso-saml/sso-saml.module.js.map +1 -0
- package/dist/modules/sso-saml/types.js +3 -0
- package/dist/{sso.ee/saml → modules/sso-saml}/types.js.map +1 -1
- package/dist/modules/sso-saml/views/init-sso-post.js.map +1 -0
- package/dist/modules/workflow-index/workflow-index.service.js +8 -0
- package/dist/modules/workflow-index/workflow-index.service.js.map +1 -1
- package/dist/node-types.d.ts +1 -0
- package/dist/node-types.js +17 -0
- package/dist/node-types.js.map +1 -1
- package/dist/scaling/constants.d.ts +2 -2
- package/dist/scaling/pubsub/pubsub.event-map.d.ts +7 -2
- package/dist/scaling/pubsub/pubsub.types.d.ts +2 -1
- package/dist/scaling/worker-status.service.ee.d.ts +7 -3
- package/dist/scaling/worker-status.service.ee.js +13 -7
- package/dist/scaling/worker-status.service.ee.js.map +1 -1
- package/dist/server.d.ts +0 -1
- package/dist/server.js +5 -22
- package/dist/server.js.map +1 -1
- package/dist/services/ai-workflow-builder.service.d.ts +2 -3
- package/dist/services/ai-workflow-builder.service.js +36 -36
- package/dist/services/ai-workflow-builder.service.js.map +1 -1
- package/dist/services/cors-service.d.ts +7 -0
- package/dist/services/cors-service.js +51 -0
- package/dist/services/cors-service.js.map +1 -0
- package/dist/services/frontend.service.d.ts +3 -1
- package/dist/services/frontend.service.js +19 -4
- package/dist/services/frontend.service.js.map +1 -1
- package/dist/services/import.service.d.ts +2 -4
- package/dist/services/import.service.js +11 -11
- package/dist/services/import.service.js.map +1 -1
- package/dist/services/project.service.ee.d.ts +1 -3
- package/dist/services/project.service.ee.js +4 -12
- package/dist/services/project.service.ee.js.map +1 -1
- package/dist/services/pruning/workflow-history-compaction.service.d.ts +11 -6
- package/dist/services/pruning/workflow-history-compaction.service.js +72 -25
- package/dist/services/pruning/workflow-history-compaction.service.js.map +1 -1
- package/dist/services/public-api-key.service.js +2 -1
- package/dist/services/public-api-key.service.js.map +1 -1
- package/dist/services/role-cache.service.d.ts +2 -1
- package/dist/services/role-cache.service.js +4 -4
- package/dist/services/role-cache.service.js.map +1 -1
- package/dist/services/role.service.d.ts +2 -1
- package/dist/services/role.service.js +3 -3
- package/dist/services/role.service.js.map +1 -1
- package/dist/services/user.service.d.ts +5 -3
- package/dist/services/user.service.js +15 -1
- package/dist/services/user.service.js.map +1 -1
- package/dist/services/workflow-statistics.service.d.ts +4 -2
- package/dist/services/workflow-statistics.service.js +35 -4
- package/dist/services/workflow-statistics.service.js.map +1 -1
- package/dist/sso.ee/sso-helpers.d.ts +4 -0
- package/dist/sso.ee/sso-helpers.js +17 -1
- package/dist/sso.ee/sso-helpers.js.map +1 -1
- package/dist/user-management/email/templates/workflow-failure.handlebars +211 -0
- package/dist/user-management/email/user-management-mailer.d.ts +7 -1
- package/dist/user-management/email/user-management-mailer.js +19 -0
- package/dist/user-management/email/user-management-mailer.js.map +1 -1
- package/dist/workflow-execute-additional-data.js +2 -2
- package/dist/workflow-execute-additional-data.js.map +1 -1
- package/dist/workflow-helpers.d.ts +2 -1
- package/dist/workflow-helpers.js +21 -0
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflow-runner.d.ts +3 -3
- package/dist/workflow-runner.js +5 -5
- package/dist/workflow-runner.js.map +1 -1
- package/dist/workflows/workflow-execution.service.d.ts +4 -4
- package/dist/workflows/workflow-execution.service.js +7 -7
- package/dist/workflows/workflow-execution.service.js.map +1 -1
- package/dist/workflows/workflow-finder.service.d.ts +0 -1
- package/dist/workflows/workflow-finder.service.js +2 -2
- package/dist/workflows/workflow-finder.service.js.map +1 -1
- package/dist/workflows/workflow.service.js +10 -17
- package/dist/workflows/workflow.service.js.map +1 -1
- package/dist/workflows/workflows.controller.d.ts +0 -8
- package/package.json +18 -18
- package/dist/eventbus/event-bus.controller.js.map +0 -1
- package/dist/eventbus/message-event-bus-destination/message-event-bus-destination-from-db.js.map +0 -1
- package/dist/eventbus/message-event-bus-destination/message-event-bus-destination-sentry.ee.js.map +0 -1
- package/dist/eventbus/message-event-bus-destination/message-event-bus-destination-syslog.ee.js.map +0 -1
- package/dist/eventbus/message-event-bus-destination/message-event-bus-destination-webhook.ee.js.map +0 -1
- package/dist/eventbus/message-event-bus-destination/message-event-bus-destination.ee.js.map +0 -1
- package/dist/executions/execution-data.service.js.map +0 -1
- package/dist/executions/legacy-sqlite-execution-recovery.service.d.ts +0 -11
- package/dist/executions/legacy-sqlite-execution-recovery.service.js +0 -48
- package/dist/executions/legacy-sqlite-execution-recovery.service.js.map +0 -1
- package/dist/modules/breaking-changes/rules/v2/git-node-bare-repos.rule.d.ts +0 -10
- package/dist/modules/breaking-changes/rules/v2/git-node-bare-repos.rule.js +0 -66
- package/dist/modules/breaking-changes/rules/v2/git-node-bare-repos.rule.js.map +0 -1
- package/dist/modules/breaking-changes/rules/v2/sqlite-legacy-driver.rule.d.ts +0 -9
- package/dist/modules/breaking-changes/rules/v2/sqlite-legacy-driver.rule.js +0 -75
- package/dist/modules/breaking-changes/rules/v2/sqlite-legacy-driver.rule.js.map +0 -1
- package/dist/sso.ee/oidc/constants.js.map +0 -1
- package/dist/sso.ee/oidc/oidc.service.ee.js.map +0 -1
- package/dist/sso.ee/oidc/routes/oidc.controller.ee.js.map +0 -1
- package/dist/sso.ee/saml/constants.js.map +0 -1
- package/dist/sso.ee/saml/errors/invalid-saml-metadata-url.error.js.map +0 -1
- package/dist/sso.ee/saml/errors/invalid-saml-metadata.error.js.map +0 -1
- package/dist/sso.ee/saml/middleware/saml-enabled-middleware.js.map +0 -1
- package/dist/sso.ee/saml/routes/saml.controller.ee.js.map +0 -1
- package/dist/sso.ee/saml/saml-helpers.js.map +0 -1
- package/dist/sso.ee/saml/saml-validator.js.map +0 -1
- package/dist/sso.ee/saml/saml.service.ee.js.map +0 -1
- package/dist/sso.ee/saml/schema/metadata-exchange.xsd.js.map +0 -1
- package/dist/sso.ee/saml/schema/oasis-200401-wss-wssecurity-secext-1.0.xsd.js.map +0 -1
- package/dist/sso.ee/saml/schema/oasis-200401-wss-wssecurity-utility-1.0.xsd.js.map +0 -1
- package/dist/sso.ee/saml/schema/ws-addr.xsd.js.map +0 -1
- package/dist/sso.ee/saml/schema/ws-authorization.xsd.js.map +0 -1
- package/dist/sso.ee/saml/schema/xenc-schema.xsd.js.map +0 -1
- package/dist/sso.ee/saml/schema/xml.xsd.js.map +0 -1
- package/dist/sso.ee/saml/service-provider.ee.js.map +0 -1
- package/dist/sso.ee/saml/views/init-sso-post.js.map +0 -1
- package/dist/{sso.ee/saml → executions/execution-data}/types.js +0 -0
- package/dist/{eventbus/message-event-bus-destination → modules/log-streaming.ee/destinations}/message-event-bus-destination-from-db.js +0 -0
- package/dist/{sso.ee/oidc → modules/sso-oidc}/constants.d.ts +0 -0
- package/dist/{sso.ee/oidc → modules/sso-oidc}/constants.js +0 -0
- package/dist/{sso.ee/oidc → modules/sso-oidc}/oidc.service.ee.d.ts +0 -0
- package/dist/{sso.ee/saml → modules/sso-saml}/constants.d.ts +0 -0
- package/dist/{sso.ee/saml → modules/sso-saml}/constants.js +0 -0
- package/dist/{sso.ee/saml → modules/sso-saml}/errors/invalid-saml-metadata-url.error.d.ts +0 -0
- package/dist/{sso.ee/saml → modules/sso-saml}/errors/invalid-saml-metadata-url.error.js +0 -0
- package/dist/{sso.ee/saml → modules/sso-saml}/errors/invalid-saml-metadata.error.d.ts +0 -0
- package/dist/{sso.ee/saml → modules/sso-saml}/errors/invalid-saml-metadata.error.js +0 -0
- package/dist/{sso.ee/saml → modules/sso-saml}/middleware/saml-enabled-middleware.d.ts +0 -0
- package/dist/{sso.ee/saml → modules/sso-saml}/saml-validator.d.ts +0 -0
- package/dist/{sso.ee/saml → modules/sso-saml}/saml-validator.js +0 -0
- package/dist/{sso.ee/saml → modules/sso-saml}/saml.service.ee.d.ts +2 -2
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/metadata-exchange.xsd.d.ts +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/metadata-exchange.xsd.js +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/oasis-200401-wss-wssecurity-secext-1.0.xsd.d.ts +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/oasis-200401-wss-wssecurity-secext-1.0.xsd.js +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/oasis-200401-wss-wssecurity-utility-1.0.xsd.d.ts +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/oasis-200401-wss-wssecurity-utility-1.0.xsd.js +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/saml-schema-assertion-2.0.xsd.d.ts +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/saml-schema-assertion-2.0.xsd.js +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/saml-schema-metadata-2.0.xsd.d.ts +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/saml-schema-metadata-2.0.xsd.js +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/saml-schema-protocol-2.0.xsd.d.ts +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/saml-schema-protocol-2.0.xsd.js +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/ws-addr.xsd.d.ts +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/ws-addr.xsd.js +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/ws-authorization.xsd.d.ts +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/ws-authorization.xsd.js +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/ws-federation.xsd.d.ts +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/ws-federation.xsd.js +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/ws-securitypolicy-1.2.xsd.d.ts +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/ws-securitypolicy-1.2.xsd.js +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/xenc-schema.xsd.d.ts +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/xenc-schema.xsd.js +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/xml.xsd.d.ts +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/xml.xsd.js +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/xmldsig-core-schema.xsd.d.ts +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/schema/xmldsig-core-schema.xsd.js +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/service-provider.ee.d.ts +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/service-provider.ee.js +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/types.d.ts +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/views/init-sso-post.d.ts +0 -0
- /package/dist/{sso.ee/saml → modules/sso-saml}/views/init-sso-post.js +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Logger } from '@n8n/backend-common';
|
|
2
2
|
import type { INodeCredentials, MessageEventBusDestinationOptions } from 'n8n-workflow';
|
|
3
3
|
import { MessageEventBusDestinationTypeNames } from 'n8n-workflow';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
4
|
+
import type { AbstractEventMessage } from '../../../eventbus/event-message-classes/abstract-event-message';
|
|
5
|
+
import type { MessageEventBus, MessageWithCallback } from '../../../eventbus/message-event-bus/message-event-bus';
|
|
6
|
+
import { License } from '../../../license';
|
|
7
|
+
import { CircuitBreaker } from '../../../utils/circuit-breaker';
|
|
8
8
|
export declare abstract class MessageEventBusDestination implements MessageEventBusDestinationOptions {
|
|
9
9
|
readonly id: string;
|
|
10
10
|
readonly eventBusInstance: MessageEventBus;
|
|
@@ -18,17 +18,11 @@ export declare abstract class MessageEventBusDestination implements MessageEvent
|
|
|
18
18
|
credentials: INodeCredentials;
|
|
19
19
|
anonymizeAuditMessages: boolean;
|
|
20
20
|
constructor(eventBusInstance: MessageEventBus, options: MessageEventBusDestinationOptions);
|
|
21
|
-
startListening(): void;
|
|
22
|
-
stopListening(): void;
|
|
23
|
-
enable(): void;
|
|
24
|
-
disable(): void;
|
|
25
21
|
getId(): string;
|
|
26
22
|
hasSubscribedToEvent(msg: AbstractEventMessage): boolean;
|
|
27
|
-
saveToDb(): Promise<import("@n8n/typeorm").InsertResult>;
|
|
28
|
-
deleteFromDb(): Promise<import("@n8n/typeorm").DeleteResult>;
|
|
29
|
-
static deleteFromDb(id: string): Promise<import("@n8n/typeorm").DeleteResult>;
|
|
30
23
|
serialize(): MessageEventBusDestinationOptions;
|
|
31
24
|
abstract receiveFromEventBus(emitterPayload: MessageWithCallback): Promise<boolean>;
|
|
25
|
+
sendMessage(emitterPayload: MessageWithCallback): Promise<boolean>;
|
|
32
26
|
toString(): string;
|
|
33
|
-
close():
|
|
27
|
+
close(): Promise<void>;
|
|
34
28
|
}
|
|
@@ -3,11 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MessageEventBusDestination = void 0;
|
|
4
4
|
const backend_common_1 = require("@n8n/backend-common");
|
|
5
5
|
const constants_1 = require("@n8n/constants");
|
|
6
|
-
const db_1 = require("@n8n/db");
|
|
7
6
|
const di_1 = require("@n8n/di");
|
|
8
7
|
const uuid_1 = require("uuid");
|
|
9
|
-
const license_1 = require("
|
|
10
|
-
const circuit_breaker_1 = require("
|
|
8
|
+
const license_1 = require("../../../license");
|
|
9
|
+
const circuit_breaker_1 = require("../../../utils/circuit-breaker");
|
|
11
10
|
class MessageEventBusDestination {
|
|
12
11
|
constructor(eventBusInstance, options) {
|
|
13
12
|
this.credentials = {};
|
|
@@ -37,32 +36,6 @@ class MessageEventBusDestination {
|
|
|
37
36
|
this.credentials = options.credentials;
|
|
38
37
|
this.logger.debug(`${this.__type}(${this.id}) event destination constructed`);
|
|
39
38
|
}
|
|
40
|
-
startListening() {
|
|
41
|
-
if (this.enabled) {
|
|
42
|
-
this.eventBusInstance.on(this.getId(), async (msg, confirmCallback) => {
|
|
43
|
-
try {
|
|
44
|
-
await this.circuitBreakerInstance.execute(async () => {
|
|
45
|
-
await this.receiveFromEventBus({ msg, confirmCallback });
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
catch (error) {
|
|
49
|
-
this.logger.error(`${this.__type}(${this.id}) event destination ${this.label} failed to send message`, { error });
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
this.logger.debug(`${this.id} listener started`);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
stopListening() {
|
|
56
|
-
this.eventBusInstance.removeAllListeners(this.getId());
|
|
57
|
-
}
|
|
58
|
-
enable() {
|
|
59
|
-
this.enabled = true;
|
|
60
|
-
this.startListening();
|
|
61
|
-
}
|
|
62
|
-
disable() {
|
|
63
|
-
this.enabled = false;
|
|
64
|
-
this.stopListening();
|
|
65
|
-
}
|
|
66
39
|
getId() {
|
|
67
40
|
return this.id;
|
|
68
41
|
}
|
|
@@ -76,24 +49,6 @@ class MessageEventBusDestination {
|
|
|
76
49
|
}
|
|
77
50
|
return false;
|
|
78
51
|
}
|
|
79
|
-
async saveToDb() {
|
|
80
|
-
const data = {
|
|
81
|
-
id: this.getId(),
|
|
82
|
-
destination: this.serialize(),
|
|
83
|
-
};
|
|
84
|
-
const dbResult = await di_1.Container.get(db_1.EventDestinationsRepository).upsert(data, {
|
|
85
|
-
skipUpdateIfNoValuesChanged: true,
|
|
86
|
-
conflictPaths: ['id'],
|
|
87
|
-
});
|
|
88
|
-
return dbResult;
|
|
89
|
-
}
|
|
90
|
-
async deleteFromDb() {
|
|
91
|
-
return await MessageEventBusDestination.deleteFromDb(this.getId());
|
|
92
|
-
}
|
|
93
|
-
static async deleteFromDb(id) {
|
|
94
|
-
const dbResult = await di_1.Container.get(db_1.EventDestinationsRepository).delete({ id });
|
|
95
|
-
return dbResult;
|
|
96
|
-
}
|
|
97
52
|
serialize() {
|
|
98
53
|
return {
|
|
99
54
|
__type: this.__type,
|
|
@@ -104,11 +59,16 @@ class MessageEventBusDestination {
|
|
|
104
59
|
anonymizeAuditMessages: this.anonymizeAuditMessages,
|
|
105
60
|
};
|
|
106
61
|
}
|
|
62
|
+
async sendMessage(emitterPayload) {
|
|
63
|
+
return await this.circuitBreakerInstance.execute(async () => {
|
|
64
|
+
return await this.receiveFromEventBus(emitterPayload);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
107
67
|
toString() {
|
|
108
68
|
return JSON.stringify(this.serialize());
|
|
109
69
|
}
|
|
110
|
-
close() {
|
|
111
|
-
this.
|
|
70
|
+
async close() {
|
|
71
|
+
this.enabled = false;
|
|
112
72
|
}
|
|
113
73
|
}
|
|
114
74
|
exports.MessageEventBusDestination = MessageEventBusDestination;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-event-bus-destination.ee.js","sourceRoot":"","sources":["../../../../src/modules/log-streaming.ee/destinations/message-event-bus-destination.ee.ts"],"names":[],"mappings":";;;AAAA,wDAA6C;AAC7C,8CAMwB;AACxB,gCAAoC;AAGpC,+BAAkC;AAOlC,uCAAoC;AACpC,6DAAyD;AAEzD,MAAsB,0BAA0B;IAyB/C,YAAY,gBAAiC,EAAE,OAA0C;QAJzF,gBAAW,GAAqB,EAAE,CAAC;QAMlC,IAAI,CAAC,MAAM,GAAG,cAAS,CAAC,GAAG,CAAC,uBAAM,CAAC,CAAC;QACpC,IAAI,CAAC,OAAO,GAAG,cAAS,CAAC,GAAG,CAAC,iBAAO,CAAC,CAAC;QAEtC,MAAM,OAAO,GAAG,OAAO,CAAC,cAAc,EAAE,WAAW,IAAI,mDAAuC,CAAC;QAC/F,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,EAAE,WAAW,IAAI,gDAAoC,CAAC;QAChG,MAAM,gBAAgB,GACrB,OAAO,CAAC,cAAc,EAAE,gBAAgB,IAAI,sDAA0C,CAAC;QACxF,MAAM,aAAa,GAClB,OAAO,CAAC,cAAc,EAAE,aAAa,IAAI,qDAAyC,CAAC;QACpF,MAAM,6BAA6B,GAClC,OAAO,CAAC,cAAc,EAAE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C,EAAE,CAAC;gBAC9D,OAAO,IAAI,CAAC;YACb,CAAC;QACF,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IAED,SAAS;QACR,OAAO;YACN,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE;YAChB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,sBAAsB,EAAE,IAAI,CAAC,sBAAsB;SACnD,CAAC;IACH,CAAC;IAOD,KAAK,CAAC,WAAW,CAAC,cAAmC;QACpD,OAAO,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE;YAC3D,OAAO,MAAM,IAAI,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,QAAQ;QACP,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,KAAK;QACV,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACtB,CAAC;CACD;AAtGD,gEAsGC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LicenseState, Logger } from '@n8n/backend-common';
|
|
2
|
+
import type { DeleteResult } from '@n8n/typeorm';
|
|
3
|
+
import type { MessageEventBusDestinationOptions } from 'n8n-workflow';
|
|
4
|
+
import type { EventMessageTypes } from '../../eventbus';
|
|
5
|
+
import { MessageEventBus } from '../../eventbus/message-event-bus/message-event-bus';
|
|
6
|
+
import { Publisher } from '../../scaling/pubsub/publisher.service';
|
|
7
|
+
import { EventDestinationsRepository } from './database/repositories/event-destination.repository';
|
|
8
|
+
import { MessageEventBusDestination } from './destinations/message-event-bus-destination.ee';
|
|
9
|
+
export declare class LogStreamingDestinationService {
|
|
10
|
+
private readonly logger;
|
|
11
|
+
private readonly eventDestinationsRepository;
|
|
12
|
+
private readonly eventBus;
|
|
13
|
+
private readonly licenseState;
|
|
14
|
+
private readonly publisher;
|
|
15
|
+
private destinations;
|
|
16
|
+
private isListening;
|
|
17
|
+
private readonly messageHandler;
|
|
18
|
+
constructor(logger: Logger, eventDestinationsRepository: EventDestinationsRepository, eventBus: MessageEventBus, licenseState: LicenseState, publisher: Publisher);
|
|
19
|
+
loadDestinationsFromDb(): Promise<void>;
|
|
20
|
+
saveDestinationToDb(destination: MessageEventBusDestination): Promise<import("@n8n/typeorm").InsertResult>;
|
|
21
|
+
deleteDestinationFromDb(id: string): Promise<DeleteResult>;
|
|
22
|
+
addDestination(destination: MessageEventBusDestination, notifyWorkers?: boolean): Promise<MessageEventBusDestination>;
|
|
23
|
+
removeDestination(id: string, notifyWorkers?: boolean): Promise<DeleteResult>;
|
|
24
|
+
initialize(): Promise<void>;
|
|
25
|
+
private handleMessage;
|
|
26
|
+
findDestination(id?: string): Promise<MessageEventBusDestinationOptions[]>;
|
|
27
|
+
testDestination(destinationId: string): Promise<boolean>;
|
|
28
|
+
private hasAnyDestinationSubscribedToEvent;
|
|
29
|
+
shouldSendMsg(msg: EventMessageTypes): boolean;
|
|
30
|
+
close(): Promise<void>;
|
|
31
|
+
restart(): Promise<void>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.LogStreamingDestinationService = void 0;
|
|
13
|
+
const backend_common_1 = require("@n8n/backend-common");
|
|
14
|
+
const decorators_1 = require("@n8n/decorators");
|
|
15
|
+
const di_1 = require("@n8n/di");
|
|
16
|
+
const event_message_generic_1 = require("../../eventbus/event-message-classes/event-message-generic");
|
|
17
|
+
const message_event_bus_1 = require("../../eventbus/message-event-bus/message-event-bus");
|
|
18
|
+
const publisher_service_1 = require("../../scaling/pubsub/publisher.service");
|
|
19
|
+
const event_destination_repository_1 = require("./database/repositories/event-destination.repository");
|
|
20
|
+
const message_event_bus_destination_from_db_1 = require("./destinations/message-event-bus-destination-from-db");
|
|
21
|
+
let LogStreamingDestinationService = class LogStreamingDestinationService {
|
|
22
|
+
constructor(logger, eventDestinationsRepository, eventBus, licenseState, publisher) {
|
|
23
|
+
this.logger = logger;
|
|
24
|
+
this.eventDestinationsRepository = eventDestinationsRepository;
|
|
25
|
+
this.eventBus = eventBus;
|
|
26
|
+
this.licenseState = licenseState;
|
|
27
|
+
this.publisher = publisher;
|
|
28
|
+
this.destinations = {};
|
|
29
|
+
this.isListening = false;
|
|
30
|
+
this.messageHandler = this.handleMessage.bind(this);
|
|
31
|
+
}
|
|
32
|
+
async loadDestinationsFromDb() {
|
|
33
|
+
const savedEventDestinations = await this.eventDestinationsRepository.find({});
|
|
34
|
+
if (savedEventDestinations.length > 0) {
|
|
35
|
+
for (const destinationData of savedEventDestinations) {
|
|
36
|
+
try {
|
|
37
|
+
const destination = (0, message_event_bus_destination_from_db_1.messageEventBusDestinationFromDb)(this.eventBus, destinationData);
|
|
38
|
+
if (destination) {
|
|
39
|
+
this.destinations[destination.getId()] = destination;
|
|
40
|
+
this.logger.debug(`Loaded destination ${destination.getId()} from database`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
this.logger.debug('Failed to load destination from database', { error });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async saveDestinationToDb(destination) {
|
|
50
|
+
const data = {
|
|
51
|
+
id: destination.getId(),
|
|
52
|
+
destination: destination.serialize(),
|
|
53
|
+
};
|
|
54
|
+
const dbResult = await this.eventDestinationsRepository.upsert(data, {
|
|
55
|
+
skipUpdateIfNoValuesChanged: true,
|
|
56
|
+
conflictPaths: ['id'],
|
|
57
|
+
});
|
|
58
|
+
return dbResult;
|
|
59
|
+
}
|
|
60
|
+
async deleteDestinationFromDb(id) {
|
|
61
|
+
return await this.eventDestinationsRepository.delete({ id });
|
|
62
|
+
}
|
|
63
|
+
async addDestination(destination, notifyWorkers = true) {
|
|
64
|
+
await this.destinations[destination.getId()]?.close();
|
|
65
|
+
this.destinations[destination.getId()] = destination;
|
|
66
|
+
this.logger.debug(`Added destination ${destination.getId()}`);
|
|
67
|
+
await this.saveDestinationToDb(destination);
|
|
68
|
+
if (notifyWorkers) {
|
|
69
|
+
void this.publisher.publishCommand({ command: 'restart-event-bus' });
|
|
70
|
+
}
|
|
71
|
+
return destination;
|
|
72
|
+
}
|
|
73
|
+
async removeDestination(id, notifyWorkers = true) {
|
|
74
|
+
if (this.destinations[id]) {
|
|
75
|
+
await this.destinations[id].close();
|
|
76
|
+
delete this.destinations[id];
|
|
77
|
+
this.logger.debug(`Removed destination ${id}`);
|
|
78
|
+
}
|
|
79
|
+
if (notifyWorkers) {
|
|
80
|
+
void this.publisher.publishCommand({ command: 'restart-event-bus' });
|
|
81
|
+
}
|
|
82
|
+
return await this.deleteDestinationFromDb(id);
|
|
83
|
+
}
|
|
84
|
+
async initialize() {
|
|
85
|
+
if (this.isListening) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
this.logger.debug('Initializing log streaming destination service...');
|
|
89
|
+
this.eventBus.on('message', this.messageHandler);
|
|
90
|
+
this.isListening = true;
|
|
91
|
+
this.logger.debug(`Log streaming destination service initialized with ${Object.keys(this.destinations).length} destinations`);
|
|
92
|
+
}
|
|
93
|
+
async handleMessage(msg, confirmCallback) {
|
|
94
|
+
if (!this.shouldSendMsg(msg)) {
|
|
95
|
+
this.eventBus.confirmSent(msg, { id: '0', name: 'eventBus' });
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
for (const destination of Object.values(this.destinations)) {
|
|
99
|
+
if (destination.hasSubscribedToEvent(msg)) {
|
|
100
|
+
try {
|
|
101
|
+
await destination.sendMessage({ msg, confirmCallback });
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
this.logger.error(`Failed to send message to destination ${destination.getId()}`, {
|
|
105
|
+
error,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
async findDestination(id) {
|
|
112
|
+
const result = id
|
|
113
|
+
? this.destinations[id]
|
|
114
|
+
? [this.destinations[id].serialize()]
|
|
115
|
+
: []
|
|
116
|
+
: Object.values(this.destinations).map((dest) => dest.serialize());
|
|
117
|
+
return result.sort((a, b) => (a.__type ?? '').localeCompare(b.__type ?? ''));
|
|
118
|
+
}
|
|
119
|
+
async testDestination(destinationId) {
|
|
120
|
+
const msg = new event_message_generic_1.EventMessageGeneric({
|
|
121
|
+
eventName: event_message_generic_1.eventMessageGenericDestinationTestEvent,
|
|
122
|
+
});
|
|
123
|
+
const destination = await this.findDestination(destinationId);
|
|
124
|
+
if (destination.length > 0) {
|
|
125
|
+
const sendResult = await this.destinations[destinationId].receiveFromEventBus({
|
|
126
|
+
msg,
|
|
127
|
+
confirmCallback: () => this.eventBus.confirmSent(msg, { id: '0', name: 'eventBus' }),
|
|
128
|
+
});
|
|
129
|
+
return sendResult;
|
|
130
|
+
}
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
hasAnyDestinationSubscribedToEvent(msg) {
|
|
134
|
+
return Object.values(this.destinations).some((destination) => destination.hasSubscribedToEvent(msg));
|
|
135
|
+
}
|
|
136
|
+
shouldSendMsg(msg) {
|
|
137
|
+
return (this.licenseState.isLogStreamingLicensed() &&
|
|
138
|
+
Object.keys(this.destinations).length > 0 &&
|
|
139
|
+
this.hasAnyDestinationSubscribedToEvent(msg));
|
|
140
|
+
}
|
|
141
|
+
async close() {
|
|
142
|
+
this.logger.debug('Closing log streaming destination service...');
|
|
143
|
+
if (this.isListening) {
|
|
144
|
+
this.eventBus.removeListener('message', this.messageHandler);
|
|
145
|
+
this.isListening = false;
|
|
146
|
+
}
|
|
147
|
+
for (const destination of Object.values(this.destinations)) {
|
|
148
|
+
this.logger.debug(`Closing destination ${destination.getId()}...`);
|
|
149
|
+
await destination.close();
|
|
150
|
+
}
|
|
151
|
+
this.destinations = {};
|
|
152
|
+
this.logger.debug('Log streaming destination service closed');
|
|
153
|
+
}
|
|
154
|
+
async restart() {
|
|
155
|
+
this.logger.debug('Restarting log streaming destination service...');
|
|
156
|
+
await this.close();
|
|
157
|
+
await this.loadDestinationsFromDb();
|
|
158
|
+
await this.initialize();
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
exports.LogStreamingDestinationService = LogStreamingDestinationService;
|
|
162
|
+
__decorate([
|
|
163
|
+
(0, decorators_1.OnPubSubEvent)('restart-event-bus'),
|
|
164
|
+
__metadata("design:type", Function),
|
|
165
|
+
__metadata("design:paramtypes", []),
|
|
166
|
+
__metadata("design:returntype", Promise)
|
|
167
|
+
], LogStreamingDestinationService.prototype, "restart", null);
|
|
168
|
+
exports.LogStreamingDestinationService = LogStreamingDestinationService = __decorate([
|
|
169
|
+
(0, di_1.Service)(),
|
|
170
|
+
__metadata("design:paramtypes", [backend_common_1.Logger,
|
|
171
|
+
event_destination_repository_1.EventDestinationsRepository,
|
|
172
|
+
message_event_bus_1.MessageEventBus,
|
|
173
|
+
backend_common_1.LicenseState,
|
|
174
|
+
publisher_service_1.Publisher])
|
|
175
|
+
], LogStreamingDestinationService);
|
|
176
|
+
//# sourceMappingURL=log-streaming-destination.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-streaming-destination.service.js","sourceRoot":"","sources":["../../../src/modules/log-streaming.ee/log-streaming-destination.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA2D;AAC3D,gDAAgD;AAChD,gCAAkC;AAMlC,kGAGgE;AAChE,sFAAiF;AACjF,0EAA+D;AAE/D,uGAAmG;AACnG,gHAAwG;AAUjG,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IAU1C,YACkB,MAAc,EACd,2BAAwD,EACxD,QAAyB,EACzB,YAA0B,EAC1B,SAAoB;QAJpB,WAAM,GAAN,MAAM,CAAQ;QACd,gCAA2B,GAA3B,2BAA2B,CAA6B;QACxD,aAAQ,GAAR,QAAQ,CAAiB;QACzB,iBAAY,GAAZ,YAAY,CAAc;QAC1B,cAAS,GAAT,SAAS,CAAW;QAd9B,iBAAY,GAAkD,EAAE,CAAC;QAEjE,gBAAW,GAAG,KAAK,CAAC;QAc3B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;IAKD,KAAK,CAAC,sBAAsB;QAC3B,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC/E,IAAI,sBAAsB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvC,KAAK,MAAM,eAAe,IAAI,sBAAsB,EAAE,CAAC;gBACtD,IAAI,CAAC;oBACJ,MAAM,WAAW,GAAG,IAAA,wEAAgC,EAAC,IAAI,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;oBACrF,IAAI,WAAW,EAAE,CAAC;wBACjB,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,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GD,KAAK,MAAM,WAAW,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;YAC5D,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAuB,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YACnE,MAAM,WAAW,CAAC,KAAK,EAAE,CAAC;QAC3B,CAAC;QAGD,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QAEvB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC/D,CAAC;IAMK,AAAN,KAAK,CAAC,OAAO;QACZ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACrE,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACnB,MAAM,IAAI,CAAC,sBAAsB,EAAE,CAAC;QACpC,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IACzB,CAAC;CACD,CAAA;AA9OY,wEAA8B;AAwOpC;IADL,IAAA,0BAAa,EAAC,mBAAmB,CAAC;;;;6DAMlC;yCA7OW,8BAA8B;IAD1C,IAAA,YAAO,GAAE;qCAYiB,uBAAM;QACe,0DAA2B;QAC9C,mCAAe;QACX,6BAAY;QACf,6BAAS;GAf1B,8BAA8B,CA8O1C"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { AuthenticatedRequest } from '@n8n/db';
|
|
2
2
|
import express from 'express';
|
|
3
3
|
import type { MessageEventBusDestinationOptions } from 'n8n-workflow';
|
|
4
|
-
import { MessageEventBus } from '
|
|
4
|
+
import { MessageEventBus } from '../../eventbus/message-event-bus/message-event-bus';
|
|
5
|
+
import { LogStreamingDestinationService } from './log-streaming-destination.service';
|
|
5
6
|
export declare class EventBusController {
|
|
6
7
|
private readonly eventBus;
|
|
7
|
-
|
|
8
|
+
private readonly destinationService;
|
|
9
|
+
constructor(eventBus: MessageEventBus, destinationService: LogStreamingDestinationService);
|
|
8
10
|
getEventNames(): Promise<string[]>;
|
|
9
11
|
getDestination(req: express.Request): Promise<MessageEventBusDestinationOptions[]>;
|
|
10
12
|
postDestination(req: AuthenticatedRequest): Promise<any>;
|
|
11
13
|
sendTestMessage(req: express.Request): Promise<boolean>;
|
|
12
|
-
deleteDestination(req: AuthenticatedRequest): Promise<
|
|
14
|
+
deleteDestination(req: AuthenticatedRequest): Promise<void>;
|
|
13
15
|
}
|
|
@@ -15,12 +15,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.EventBusController = void 0;
|
|
16
16
|
const decorators_1 = require("@n8n/decorators");
|
|
17
17
|
const express_1 = __importDefault(require("express"));
|
|
18
|
-
const bad_request_error_1 = require("
|
|
19
|
-
const event_message_classes_1 = require("
|
|
20
|
-
const message_event_bus_1 = require("
|
|
21
|
-
const message_event_bus_destination_sentry_ee_1 = require("./
|
|
22
|
-
const message_event_bus_destination_syslog_ee_1 = require("./
|
|
23
|
-
const message_event_bus_destination_webhook_ee_1 = require("./
|
|
18
|
+
const bad_request_error_1 = require("../../errors/response-errors/bad-request.error");
|
|
19
|
+
const event_message_classes_1 = require("../../eventbus/event-message-classes");
|
|
20
|
+
const message_event_bus_1 = require("../../eventbus/message-event-bus/message-event-bus");
|
|
21
|
+
const message_event_bus_destination_sentry_ee_1 = require("./destinations/message-event-bus-destination-sentry.ee");
|
|
22
|
+
const message_event_bus_destination_syslog_ee_1 = require("./destinations/message-event-bus-destination-syslog.ee");
|
|
23
|
+
const message_event_bus_destination_webhook_ee_1 = require("./destinations/message-event-bus-destination-webhook.ee");
|
|
24
|
+
const log_streaming_destination_service_1 = require("./log-streaming-destination.service");
|
|
24
25
|
const isWithIdString = (candidate) => {
|
|
25
26
|
const o = candidate;
|
|
26
27
|
if (!o)
|
|
@@ -40,18 +41,19 @@ const isMessageEventBusDestinationOptions = (candidate) => {
|
|
|
40
41
|
return o.__type !== undefined;
|
|
41
42
|
};
|
|
42
43
|
let EventBusController = class EventBusController {
|
|
43
|
-
constructor(eventBus) {
|
|
44
|
+
constructor(eventBus, destinationService) {
|
|
44
45
|
this.eventBus = eventBus;
|
|
46
|
+
this.destinationService = destinationService;
|
|
45
47
|
}
|
|
46
48
|
async getEventNames() {
|
|
47
49
|
return event_message_classes_1.eventNamesAll;
|
|
48
50
|
}
|
|
49
51
|
async getDestination(req) {
|
|
50
52
|
if (isWithIdString(req.query)) {
|
|
51
|
-
return await this.
|
|
53
|
+
return await this.destinationService.findDestination(req.query.id);
|
|
52
54
|
}
|
|
53
55
|
else {
|
|
54
|
-
return await this.
|
|
56
|
+
return await this.destinationService.findDestination();
|
|
55
57
|
}
|
|
56
58
|
}
|
|
57
59
|
async postDestination(req) {
|
|
@@ -60,24 +62,23 @@ let EventBusController = class EventBusController {
|
|
|
60
62
|
switch (req.body.__type) {
|
|
61
63
|
case "$$MessageEventBusDestinationSentry":
|
|
62
64
|
if ((0, message_event_bus_destination_sentry_ee_1.isMessageEventBusDestinationSentryOptions)(req.body)) {
|
|
63
|
-
result = await this.
|
|
65
|
+
result = await this.destinationService.addDestination(new message_event_bus_destination_sentry_ee_1.MessageEventBusDestinationSentry(this.eventBus, req.body));
|
|
64
66
|
}
|
|
65
67
|
break;
|
|
66
68
|
case "$$MessageEventBusDestinationWebhook":
|
|
67
69
|
if (isMessageEventBusDestinationWebhookOptions(req.body)) {
|
|
68
|
-
result = await this.
|
|
70
|
+
result = await this.destinationService.addDestination(new message_event_bus_destination_webhook_ee_1.MessageEventBusDestinationWebhook(this.eventBus, req.body));
|
|
69
71
|
}
|
|
70
72
|
break;
|
|
71
73
|
case "$$MessageEventBusDestinationSyslog":
|
|
72
74
|
if ((0, message_event_bus_destination_syslog_ee_1.isMessageEventBusDestinationSyslogOptions)(req.body)) {
|
|
73
|
-
result = await this.
|
|
75
|
+
result = await this.destinationService.addDestination(new message_event_bus_destination_syslog_ee_1.MessageEventBusDestinationSyslog(this.eventBus, req.body));
|
|
74
76
|
}
|
|
75
77
|
break;
|
|
76
78
|
default:
|
|
77
79
|
throw new bad_request_error_1.BadRequestError(`Body is missing ${req.body.__type} options or type ${req.body.__type} is unknown`);
|
|
78
80
|
}
|
|
79
81
|
if (result) {
|
|
80
|
-
await result.saveToDb();
|
|
81
82
|
return {
|
|
82
83
|
...result.serialize(),
|
|
83
84
|
eventBusInstance: undefined,
|
|
@@ -89,14 +90,13 @@ let EventBusController = class EventBusController {
|
|
|
89
90
|
}
|
|
90
91
|
async sendTestMessage(req) {
|
|
91
92
|
if (isWithIdString(req.query)) {
|
|
92
|
-
return await this.
|
|
93
|
+
return await this.destinationService.testDestination(req.query.id);
|
|
93
94
|
}
|
|
94
95
|
return false;
|
|
95
96
|
}
|
|
96
97
|
async deleteDestination(req) {
|
|
97
98
|
if (isWithIdString(req.query)) {
|
|
98
|
-
await this.
|
|
99
|
-
return await this.eventBus.deleteDestination(req.query.id);
|
|
99
|
+
await this.destinationService.removeDestination(req.query.id);
|
|
100
100
|
}
|
|
101
101
|
else {
|
|
102
102
|
throw new bad_request_error_1.BadRequestError('Query is missing id');
|
|
@@ -144,6 +144,7 @@ __decorate([
|
|
|
144
144
|
], EventBusController.prototype, "deleteDestination", null);
|
|
145
145
|
exports.EventBusController = EventBusController = __decorate([
|
|
146
146
|
(0, decorators_1.RestController)('/eventbus'),
|
|
147
|
-
__metadata("design:paramtypes", [message_event_bus_1.MessageEventBus
|
|
147
|
+
__metadata("design:paramtypes", [message_event_bus_1.MessageEventBus,
|
|
148
|
+
log_streaming_destination_service_1.LogStreamingDestinationService])
|
|
148
149
|
], EventBusController);
|
|
149
|
-
//# sourceMappingURL=
|
|
150
|
+
//# sourceMappingURL=log-streaming.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-streaming.controller.js","sourceRoot":"","sources":["../../../src/modules/log-streaming.ee/log-streaming.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,gDAA2F;AAC3F,sDAA8B;AAO9B,kFAA6E;AAC7E,4EAAiE;AACj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,EAAC,4BAA4B,CAAC;;;;2DAOzC;6BArFW,kBAAkB;IAD9B,IAAA,2BAAc,EAAC,WAAW,CAAC;qCAGC,mCAAe;QACL,kEAA8B;GAHxD,kBAAkB,CAsF9B"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.LogStreamingModule = void 0;
|
|
43
|
+
const constants_1 = require("@n8n/constants");
|
|
44
|
+
const decorators_1 = require("@n8n/decorators");
|
|
45
|
+
const di_1 = require("@n8n/di");
|
|
46
|
+
let LogStreamingModule = class LogStreamingModule {
|
|
47
|
+
async init() {
|
|
48
|
+
await Promise.resolve().then(() => __importStar(require('./log-streaming.controller')));
|
|
49
|
+
const { LogStreamingDestinationService } = await Promise.resolve().then(() => __importStar(require('./log-streaming-destination.service')));
|
|
50
|
+
const destinationService = di_1.Container.get(LogStreamingDestinationService);
|
|
51
|
+
await destinationService.loadDestinationsFromDb();
|
|
52
|
+
await destinationService.initialize();
|
|
53
|
+
}
|
|
54
|
+
async entities() {
|
|
55
|
+
const { EventDestinations } = await Promise.resolve().then(() => __importStar(require('./database/entities/event-destination.entity')));
|
|
56
|
+
return [EventDestinations];
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
exports.LogStreamingModule = LogStreamingModule;
|
|
60
|
+
exports.LogStreamingModule = LogStreamingModule = __decorate([
|
|
61
|
+
(0, decorators_1.BackendModule)({
|
|
62
|
+
name: 'log-streaming',
|
|
63
|
+
licenseFlag: constants_1.LICENSE_FEATURES.LOG_STREAMING,
|
|
64
|
+
instanceTypes: ['main', 'worker', 'webhook'],
|
|
65
|
+
})
|
|
66
|
+
], LogStreamingModule);
|
|
67
|
+
//# sourceMappingURL=log-streaming.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-streaming.module.js","sourceRoot":"","sources":["../../../src/modules/log-streaming.ee/log-streaming.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAkD;AAElD,gDAAgD;AAChD,gCAAoC;AAc7B,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC9B,KAAK,CAAC,IAAI;QACT,wDAAa,4BAA4B,GAAC,CAAC;QAE3C,MAAM,EAAE,8BAA8B,EAAE,GAAG,wDAAa,qCAAqC,GAAC,CAAC;QAC/F,MAAM,kBAAkB,GAAG,cAAS,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QACzE,MAAM,kBAAkB,CAAC,sBAAsB,EAAE,CAAC;QAClD,MAAM,kBAAkB,CAAC,UAAU,EAAE,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,QAAQ;QACb,MAAM,EAAE,iBAAiB,EAAE,GAAG,wDAAa,8CAA8C,GAAC,CAAC;QAC3F,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC5B,CAAC;CACD,CAAA;AAdY,gDAAkB;6BAAlB,kBAAkB;IAL9B,IAAA,0BAAa,EAAC;QACd,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,4BAAgB,CAAC,aAAa;QAC3C,aAAa,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC;KAC5C,CAAC;GACW,kBAAkB,CAc9B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UserError } from 'n8n-workflow';
|
|
2
2
|
import { AuthError } from '../../errors/response-errors/auth.error';
|
|
3
|
+
import type { WorkflowNotFoundReason } from './mcp.types';
|
|
3
4
|
export declare class McpExecutionTimeoutError extends UserError {
|
|
4
5
|
executionId: string | null;
|
|
5
6
|
timeoutMs: number;
|
|
@@ -11,3 +12,7 @@ export declare class JWTVerificationError extends AuthError {
|
|
|
11
12
|
export declare class AccessTokenNotFoundError extends AuthError {
|
|
12
13
|
constructor();
|
|
13
14
|
}
|
|
15
|
+
export declare class WorkflowAccessError extends UserError {
|
|
16
|
+
readonly reason: WorkflowNotFoundReason;
|
|
17
|
+
constructor(message: string, reason: WorkflowNotFoundReason);
|
|
18
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AccessTokenNotFoundError = exports.JWTVerificationError = exports.McpExecutionTimeoutError = void 0;
|
|
3
|
+
exports.WorkflowAccessError = exports.AccessTokenNotFoundError = exports.JWTVerificationError = exports.McpExecutionTimeoutError = void 0;
|
|
4
4
|
const constants_1 = require("@n8n/constants");
|
|
5
5
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
6
|
const auth_error_1 = require("../../errors/response-errors/auth.error");
|
|
@@ -28,4 +28,12 @@ class AccessTokenNotFoundError extends auth_error_1.AuthError {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
exports.AccessTokenNotFoundError = AccessTokenNotFoundError;
|
|
31
|
+
class WorkflowAccessError extends n8n_workflow_1.UserError {
|
|
32
|
+
constructor(message, reason) {
|
|
33
|
+
super(message);
|
|
34
|
+
this.name = 'WorkflowAccessError';
|
|
35
|
+
this.reason = reason;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.WorkflowAccessError = WorkflowAccessError;
|
|
31
39
|
//# sourceMappingURL=mcp.errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.errors.js","sourceRoot":"","sources":["../../../src/modules/mcp/mcp.errors.ts"],"names":[],"mappings":";;;AAAA,8CAAsC;AACtC,+CAAyC;AAEzC,oEAAgE;
|
|
1
|
+
{"version":3,"file":"mcp.errors.js","sourceRoot":"","sources":["../../../src/modules/mcp/mcp.errors.ts"],"names":[],"mappings":";;;AAAA,8CAAsC;AACtC,+CAAyC;AAEzC,oEAAgE;AAOhE,MAAa,wBAAyB,SAAQ,wBAAS;IAItD,YAAY,WAA0B,EAAE,SAAiB;QACxD,MAAM,cAAc,GAAG,SAAS,GAAG,gBAAI,CAAC,YAAY,CAAC,SAAS,CAAC;QAC/D,KAAK,CAAC,sCAAsC,cAAc,UAAU,CAAC,CAAC;QAEtE,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;QACvC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5B,CAAC;CACD;AAZD,4DAYC;AAED,MAAa,oBAAqB,SAAQ,sBAAS;IAClD;QACC,KAAK,CAAC,yBAAyB,CAAC,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACpC,CAAC;CACD;AALD,oDAKC;AAED,MAAa,wBAAyB,SAAQ,sBAAS;IACtD;QACC,KAAK,CAAC,oCAAoC,CAAC,CAAC;QAC5C,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACxC,CAAC;CACD;AALD,4DAKC;AAMD,MAAa,mBAAoB,SAAQ,wBAAS;IAGjD,YAAY,OAAe,EAAE,MAA8B;QAC1D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;CACD;AARD,kDAQC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { GlobalConfig } from '@n8n/config';
|
|
3
|
-
import { User } from '@n8n/db';
|
|
3
|
+
import { User, WorkflowRepository } from '@n8n/db';
|
|
4
4
|
import { ActiveExecutions } from '../../active-executions';
|
|
5
5
|
import { CredentialsService } from '../../credentials/credentials.service';
|
|
6
|
+
import { ProjectService } from '../../services/project.service.ee';
|
|
7
|
+
import { RoleService } from '../../services/role.service';
|
|
6
8
|
import { UrlService } from '../../services/url.service';
|
|
7
9
|
import { Telemetry } from '../../telemetry';
|
|
8
10
|
import { WorkflowRunner } from '../../workflow-runner';
|
|
@@ -10,6 +12,7 @@ import { WorkflowFinderService } from '../../workflows/workflow-finder.service';
|
|
|
10
12
|
import { WorkflowService } from '../../workflows/workflow.service';
|
|
11
13
|
export declare class McpService {
|
|
12
14
|
private readonly workflowFinderService;
|
|
15
|
+
private readonly workflowRepository;
|
|
13
16
|
private readonly workflowService;
|
|
14
17
|
private readonly urlService;
|
|
15
18
|
private readonly credentialsService;
|
|
@@ -17,6 +20,8 @@ export declare class McpService {
|
|
|
17
20
|
private readonly globalConfig;
|
|
18
21
|
private readonly telemetry;
|
|
19
22
|
private readonly workflowRunner;
|
|
20
|
-
|
|
23
|
+
private readonly roleService;
|
|
24
|
+
private readonly projectService;
|
|
25
|
+
constructor(workflowFinderService: WorkflowFinderService, workflowRepository: WorkflowRepository, workflowService: WorkflowService, urlService: UrlService, credentialsService: CredentialsService, activeExecutions: ActiveExecutions, globalConfig: GlobalConfig, telemetry: Telemetry, workflowRunner: WorkflowRunner, roleService: RoleService, projectService: ProjectService);
|
|
21
26
|
getServer(user: User): McpServer;
|
|
22
27
|
}
|