n8n 2.37.6 → 2.38.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 +2 -1
- package/dist/active-executions.js.map +1 -1
- package/dist/active-workflow-manager.d.ts +5 -1
- package/dist/active-workflow-manager.js +64 -33
- package/dist/active-workflow-manager.js.map +1 -1
- package/dist/binary-data/binary-data-access.service.d.ts +11 -0
- package/dist/binary-data/binary-data-access.service.js +50 -0
- package/dist/binary-data/binary-data-access.service.js.map +1 -0
- package/dist/build.tsbuildinfo +1 -1
- package/dist/commands/base-command.d.ts +2 -0
- package/dist/commands/base-command.js +8 -0
- package/dist/commands/base-command.js.map +1 -1
- package/dist/commands/import/workflow.d.ts +1 -0
- package/dist/commands/import/workflow.js +12 -3
- package/dist/commands/import/workflow.js.map +1 -1
- package/dist/commands/start.d.ts +1 -0
- package/dist/commands/start.js +2 -1
- package/dist/commands/start.js.map +1 -1
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +3 -1
- package/dist/constants.js.map +1 -1
- package/dist/controllers/binary-data.controller.d.ts +5 -2
- package/dist/controllers/binary-data.controller.js +11 -3
- package/dist/controllers/binary-data.controller.js.map +1 -1
- package/dist/controllers/e2e.controller.d.ts +1 -6
- package/dist/controllers/e2e.controller.js +7 -20
- package/dist/controllers/e2e.controller.js.map +1 -1
- package/dist/controllers/project.controller.d.ts +4 -10
- package/dist/controllers/project.controller.js +14 -114
- package/dist/controllers/project.controller.js.map +1 -1
- package/dist/controllers/telemetry.controller.js +1 -1
- package/dist/controllers/telemetry.controller.js.map +1 -1
- package/dist/credentials/credentials-finder.service.d.ts +2 -0
- package/dist/credentials/credentials-finder.service.js +46 -12
- package/dist/credentials/credentials-finder.service.js.map +1 -1
- package/dist/credentials/credentials.service.d.ts +5 -2
- package/dist/credentials/credentials.service.js +4 -1
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/credentials-helper.d.ts +3 -1
- package/dist/credentials-helper.js +10 -2
- 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/errors/http-error-serializers.js +3 -0
- package/dist/errors/http-error-serializers.js.map +1 -1
- package/dist/errors/variable-validation.error.d.ts +2 -2
- package/dist/errors/variable-validation.error.js +1 -1
- package/dist/errors/variable-validation.error.js.map +1 -1
- package/dist/evaluation.ee/evaluation-config-validator.js +3 -2
- package/dist/evaluation.ee/evaluation-config-validator.js.map +1 -1
- package/dist/evaluation.ee/evaluation-dataset.service.js +8 -1
- package/dist/evaluation.ee/evaluation-dataset.service.js.map +1 -1
- package/dist/evaluation.ee/test-runner/workflow-compiler.service.js +96 -45
- package/dist/evaluation.ee/test-runner/workflow-compiler.service.js.map +1 -1
- package/dist/execution-lifecycle/execute-error-workflow.js +3 -0
- package/dist/execution-lifecycle/execute-error-workflow.js.map +1 -1
- package/dist/executions/engine-v2-execution-reader.service.d.ts +11 -0
- package/dist/executions/engine-v2-execution-reader.service.js +68 -0
- package/dist/executions/engine-v2-execution-reader.service.js.map +1 -0
- package/dist/executions/execution-id.d.ts +5 -0
- package/dist/executions/execution-id.js +10 -0
- package/dist/executions/execution-id.js.map +1 -0
- package/dist/executions/execution.service.d.ts +3 -1
- package/dist/executions/execution.service.js +16 -8
- package/dist/executions/execution.service.js.map +1 -1
- package/dist/executions/executions.controller.d.ts +1 -0
- package/dist/executions/executions.controller.js +12 -6
- package/dist/executions/executions.controller.js.map +1 -1
- package/dist/expression-observability/expression-observability.provider.js +3 -2
- package/dist/expression-observability/expression-observability.provider.js.map +1 -1
- package/dist/license/license.service.js +1 -1
- package/dist/license/license.service.js.map +1 -1
- package/dist/metrics/prometheus/instance-ai-metrics.service.js.map +1 -1
- package/dist/middlewares/content-security-policy.d.ts +10 -0
- package/dist/middlewares/content-security-policy.js +53 -0
- package/dist/middlewares/content-security-policy.js.map +1 -0
- package/dist/middlewares/index.d.ts +1 -0
- package/dist/middlewares/index.js +1 -0
- package/dist/middlewares/index.js.map +1 -1
- package/dist/modules/agents/agent-config.service.js +0 -3
- package/dist/modules/agents/agent-config.service.js.map +1 -1
- package/dist/modules/agents/agent-default-model-resolver.service.js +2 -4
- package/dist/modules/agents/agent-default-model-resolver.service.js.map +1 -1
- package/dist/modules/agents/agent-execution-orchestrator.service.js +13 -6
- package/dist/modules/agents/agent-execution-orchestrator.service.js.map +1 -1
- package/dist/modules/agents/agent-execution.service.d.ts +1 -0
- package/dist/modules/agents/agent-execution.service.js +3 -0
- package/dist/modules/agents/agent-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-integrations.controller.d.ts +7 -5
- package/dist/modules/agents/agent-integrations.controller.js +10 -17
- package/dist/modules/agents/agent-integrations.controller.js.map +1 -1
- package/dist/modules/agents/agent-model-catalog.service.js +6 -12
- package/dist/modules/agents/agent-model-catalog.service.js.map +1 -1
- package/dist/modules/agents/agent-publish.service.d.ts +2 -3
- package/dist/modules/agents/agent-publish.service.js +12 -5
- package/dist/modules/agents/agent-publish.service.js.map +1 -1
- package/dist/modules/agents/agent-runtime-cache.service.d.ts +5 -0
- package/dist/modules/agents/agent-runtime-cache.service.js +57 -3
- package/dist/modules/agents/agent-runtime-cache.service.js.map +1 -1
- package/dist/modules/agents/agent-runtime-reconstruction.service.d.ts +14 -7
- package/dist/modules/agents/agent-runtime-reconstruction.service.js +89 -36
- package/dist/modules/agents/agent-runtime-reconstruction.service.js.map +1 -1
- package/dist/modules/agents/agent-sandbox-runtime.service.d.ts +4 -2
- package/dist/modules/agents/agent-sandbox-runtime.service.js +21 -11
- package/dist/modules/agents/agent-sandbox-runtime.service.js.map +1 -1
- package/dist/modules/agents/agent-validation.service.js +0 -4
- package/dist/modules/agents/agent-validation.service.js.map +1 -1
- package/dist/modules/agents/agent-workflow-execution.service.js +1 -1
- package/dist/modules/agents/agent-workflow-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-workflow-tool-resume.service.d.ts +32 -0
- package/dist/modules/agents/agent-workflow-tool-resume.service.js +168 -0
- package/dist/modules/agents/agent-workflow-tool-resume.service.js.map +1 -0
- package/dist/modules/agents/agent-workspace.service.d.ts +8 -2
- package/dist/modules/agents/agent-workspace.service.js +15 -4
- package/dist/modules/agents/agent-workspace.service.js.map +1 -1
- package/dist/modules/agents/agents.module.d.ts +1 -1
- package/dist/modules/agents/agents.module.js +8 -7
- package/dist/modules/agents/agents.module.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +4 -6
- package/dist/modules/agents/builder/agents-builder-tools.service.js +16 -21
- package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder.service.d.ts +5 -7
- package/dist/modules/agents/builder/agents-builder.service.js +27 -36
- package/dist/modules/agents/builder/agents-builder.service.js.map +1 -1
- package/dist/modules/agents/builder/call-agent-failure.d.ts +5 -0
- package/dist/modules/agents/builder/call-agent-failure.js +28 -0
- package/dist/modules/agents/builder/call-agent-failure.js.map +1 -0
- package/dist/modules/agents/builder/interactive/ask-credential.tool.d.ts +3 -2
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js +8 -9
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js.map +1 -1
- package/dist/modules/agents/builder/interactive/finish-setup.tool.d.ts +3 -2
- package/dist/modules/agents/builder/interactive/finish-setup.tool.js +16 -6
- package/dist/modules/agents/builder/interactive/finish-setup.tool.js.map +1 -1
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js +57 -44
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js.map +1 -1
- package/dist/modules/agents/builder/prompts/llm-selection.prompt.js +3 -2
- package/dist/modules/agents/builder/prompts/llm-selection.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/tools.prompt.d.ts +1 -1
- package/dist/modules/agents/builder/prompts/tools.prompt.js +6 -0
- package/dist/modules/agents/builder/prompts/tools.prompt.js.map +1 -1
- package/dist/modules/agents/builder/skills/external-services.skill.js +51 -8
- package/dist/modules/agents/builder/skills/external-services.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/sub-agents.skill.js +15 -12
- package/dist/modules/agents/builder/skills/sub-agents.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/target-tasks.skill.js +16 -5
- package/dist/modules/agents/builder/skills/target-tasks.skill.js.map +1 -1
- package/dist/modules/agents/entities/agent-channel-status.entity.d.ts +16 -0
- package/dist/modules/agents/entities/agent-channel-status.entity.js +99 -0
- package/dist/modules/agents/entities/agent-channel-status.entity.js.map +1 -0
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.d.ts +3 -3
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.js +17 -7
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.js.map +1 -1
- package/dist/modules/agents/integrations/agent-channel-reconciler.service.d.ts +38 -0
- package/dist/modules/agents/integrations/agent-channel-reconciler.service.js +260 -0
- package/dist/modules/agents/integrations/agent-channel-reconciler.service.js.map +1 -0
- package/dist/modules/agents/integrations/agent-channel-status-reporter.d.ts +23 -0
- package/dist/modules/agents/integrations/agent-channel-status-reporter.js +114 -0
- package/dist/modules/agents/integrations/agent-channel-status-reporter.js.map +1 -0
- package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +9 -0
- package/dist/modules/agents/integrations/agent-chat-bridge.js +53 -1
- package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.d.ts +1 -1
- package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js +3 -2
- package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-integration.d.ts +5 -2
- package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -1
- package/dist/modules/agents/integrations/channel-status-report.d.ts +4 -0
- package/dist/modules/agents/integrations/channel-status-report.js +58 -0
- package/dist/modules/agents/integrations/channel-status-report.js.map +1 -0
- package/dist/modules/agents/integrations/chat-integration.service.d.ts +17 -2
- package/dist/modules/agents/integrations/chat-integration.service.js +63 -35
- package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
- package/dist/modules/agents/integrations/credential-claim.d.ts +3 -0
- package/dist/modules/agents/integrations/credential-claim.js +12 -0
- package/dist/modules/agents/integrations/credential-claim.js.map +1 -0
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.d.ts +2 -0
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.js +25 -0
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/discord-integration.d.ts +2 -1
- package/dist/modules/agents/integrations/platforms/discord-integration.js +9 -6
- package/dist/modules/agents/integrations/platforms/discord-integration.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/linear-integration.js +1 -1
- package/dist/modules/agents/integrations/platforms/linear-integration.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/slack/slack-integration.d.ts +2 -1
- package/dist/modules/agents/integrations/platforms/slack/slack-integration.js +7 -6
- package/dist/modules/agents/integrations/platforms/slack/slack-integration.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/slack/slack-methods.service.js +1 -1
- package/dist/modules/agents/integrations/platforms/slack/slack-methods.service.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/telegram-integration.d.ts +4 -6
- package/dist/modules/agents/integrations/platforms/telegram-integration.js +11 -14
- package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -1
- package/dist/modules/agents/json-config/credential-field-mapping.js +3 -0
- package/dist/modules/agents/json-config/credential-field-mapping.js.map +1 -1
- package/dist/modules/agents/llm-provider-defaults.js +16 -1
- package/dist/modules/agents/llm-provider-defaults.js.map +1 -1
- package/dist/modules/agents/repositories/agent-channel-status.repository.d.ts +29 -0
- package/dist/modules/agents/repositories/agent-channel-status.repository.js +63 -0
- package/dist/modules/agents/repositories/agent-channel-status.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-execution.repository.d.ts +1 -0
- package/dist/modules/agents/repositories/agent-execution.repository.js +4 -0
- package/dist/modules/agents/repositories/agent-execution.repository.js.map +1 -1
- package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js +29 -19
- package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js.map +1 -1
- package/dist/modules/agents/sub-agents/sub-agent-cleanup.service.js.map +1 -1
- package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.d.ts +6 -3
- package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js +43 -16
- package/dist/modules/agents/sub-agents/sub-agent-foreground-runner.js.map +1 -1
- package/dist/modules/agents/sub-agents/sub-agent-source-resolver.d.ts +1 -0
- package/dist/modules/agents/sub-agents/sub-agent-source-resolver.js +18 -6
- package/dist/modules/agents/sub-agents/sub-agent-source-resolver.js.map +1 -1
- package/dist/modules/agents/tools/workflow-tool-factory.d.ts +24 -13
- package/dist/modules/agents/tools/workflow-tool-factory.js +147 -9
- package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
- package/dist/modules/agents/tools/workflow-tool-workflow-loader.service.d.ts +10 -2
- package/dist/modules/agents/tools/workflow-tool-workflow-loader.service.js +23 -4
- package/dist/modules/agents/tools/workflow-tool-workflow-loader.service.js.map +1 -1
- package/dist/modules/agents/utils/provider-model-id.d.ts +2 -0
- package/dist/modules/agents/utils/provider-model-id.js +21 -0
- package/dist/modules/agents/utils/provider-model-id.js.map +1 -0
- package/dist/modules/community-packages/community-packages.service.d.ts +4 -0
- package/dist/modules/community-packages/community-packages.service.js +96 -92
- package/dist/modules/community-packages/community-packages.service.js.map +1 -1
- package/dist/modules/community-packages/npm-utils.js +1 -5
- package/dist/modules/community-packages/npm-utils.js.map +1 -1
- package/dist/modules/data-table/data-table-aggregate.service.d.ts +1 -1
- package/dist/modules/data-table/data-table-aggregate.service.js +1 -1
- package/dist/modules/data-table/data-table-aggregate.service.js.map +1 -1
- package/dist/modules/data-table/data-table.service.d.ts +9 -4
- package/dist/modules/data-table/data-table.service.js +34 -4
- package/dist/modules/data-table/data-table.service.js.map +1 -1
- package/dist/modules/data-table/errors/data-table-access-denied.error.d.ts +4 -0
- package/dist/modules/data-table/errors/data-table-access-denied.error.js +13 -0
- package/dist/modules/data-table/errors/data-table-access-denied.error.js.map +1 -0
- package/dist/modules/dynamic-credentials.ee/config-redaction.d.ts +5 -0
- package/dist/modules/dynamic-credentials.ee/config-redaction.js +81 -0
- package/dist/modules/dynamic-credentials.ee/config-redaction.js.map +1 -0
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-metadata-http-client.d.ts +2 -3
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-metadata-http-client.js +2 -4
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-metadata-http-client.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.d.ts +1 -0
- package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.js +18 -4
- package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js +3 -2
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js +22 -4
- package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.d.ts +1 -0
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.js +12 -2
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.js.map +1 -1
- package/dist/modules/encryption-key-manager/key-manager.service.d.ts +7 -2
- package/dist/modules/encryption-key-manager/key-manager.service.js +27 -8
- package/dist/modules/encryption-key-manager/key-manager.service.js.map +1 -1
- package/dist/modules/engine-v2/engine-control-plane-auth.middleware.d.ts +6 -0
- package/dist/modules/engine-v2/engine-control-plane-auth.middleware.js +31 -0
- package/dist/modules/engine-v2/engine-control-plane-auth.middleware.js.map +1 -0
- package/dist/modules/engine-v2/engine-control-plane-client.d.ts +9 -0
- package/dist/modules/engine-v2/engine-control-plane-client.js +51 -0
- package/dist/modules/engine-v2/engine-control-plane-client.js.map +1 -0
- package/dist/modules/engine-v2/engine-control-plane-server.d.ts +14 -0
- package/dist/modules/engine-v2/engine-control-plane-server.js +84 -0
- package/dist/modules/engine-v2/engine-control-plane-server.js.map +1 -0
- package/dist/modules/engine-v2/engine-data-plane-client.d.ts +3 -1
- package/dist/modules/engine-v2/engine-data-plane-client.js +16 -1
- package/dist/modules/engine-v2/engine-data-plane-client.js.map +1 -1
- package/dist/modules/engine-v2/engine-lifecycle-event-push-relay.d.ts +18 -0
- package/dist/modules/engine-v2/engine-lifecycle-event-push-relay.js +150 -0
- package/dist/modules/engine-v2/engine-lifecycle-event-push-relay.js.map +1 -0
- package/dist/modules/engine-v2/engine-lifecycle-event.controller.d.ts +7 -0
- package/dist/modules/engine-v2/engine-lifecycle-event.controller.js +34 -0
- package/dist/modules/engine-v2/engine-lifecycle-event.controller.js.map +1 -0
- package/dist/modules/engine-v2/engine-v2.constants.d.ts +2 -0
- package/dist/modules/engine-v2/engine-v2.constants.js +6 -0
- package/dist/modules/engine-v2/engine-v2.constants.js.map +1 -0
- package/dist/modules/engine-v2/engine-v2.module.js +4 -0
- package/dist/modules/engine-v2/engine-v2.module.js.map +1 -1
- package/dist/modules/engine-v2/engine-v2.runtime.d.ts +3 -1
- package/dist/modules/engine-v2/engine-v2.runtime.js +6 -2
- package/dist/modules/engine-v2/engine-v2.runtime.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/aws-secrets-manager.js +1 -1
- package/dist/modules/external-secrets.ee/providers/aws-secrets-manager.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/infisical.js +1 -1
- package/dist/modules/external-secrets.ee/providers/infisical.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/vault.js +1 -1
- package/dist/modules/external-secrets.ee/providers/vault.js.map +1 -1
- package/dist/modules/git-connections.ee/database/repositories/git-connection-project.repository.d.ts +5 -3
- package/dist/modules/git-connections.ee/database/repositories/git-connection-project.repository.js +16 -4
- package/dist/modules/git-connections.ee/database/repositories/git-connection-project.repository.js.map +1 -1
- package/dist/modules/git-connections.ee/git-connections.service.d.ts +4 -2
- package/dist/modules/git-connections.ee/git-connections.service.js +87 -4
- package/dist/modules/git-connections.ee/git-connections.service.js.map +1 -1
- package/dist/modules/instance-ai/browser/browser-local-mcp-server.d.ts +3 -2
- package/dist/modules/instance-ai/browser/browser-local-mcp-server.js +48 -30
- package/dist/modules/instance-ai/browser/browser-local-mcp-server.js.map +1 -1
- package/dist/modules/instance-ai/event-bus/durable-event-log.js.map +1 -1
- package/dist/modules/instance-ai/event-bus/in-process-event-bus.d.ts +2 -28
- package/dist/modules/instance-ai/event-bus/in-process-event-bus.js +5 -228
- package/dist/modules/instance-ai/event-bus/in-process-event-bus.js.map +1 -1
- package/dist/modules/instance-ai/event-bus/interrupted-run-sweeper.d.ts +1 -3
- package/dist/modules/instance-ai/event-bus/interrupted-run-sweeper.js +2 -8
- package/dist/modules/instance-ai/event-bus/interrupted-run-sweeper.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-memory.service.js +1 -3
- package/dist/modules/instance-ai/instance-ai-memory.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-settings.service.d.ts +2 -0
- package/dist/modules/instance-ai/instance-ai-settings.service.js +10 -2
- package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-terminal-outcome.service.d.ts +0 -2
- package/dist/modules/instance-ai/instance-ai-terminal-outcome.service.js +1 -2
- package/dist/modules/instance-ai/instance-ai-terminal-outcome.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +2 -3
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +101 -44
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.controller.d.ts +1 -1
- package/dist/modules/instance-ai/instance-ai.controller.js +75 -83
- package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.module.js +8 -16
- package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.service.d.ts +2 -0
- package/dist/modules/instance-ai/instance-ai.service.js +55 -11
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
- package/dist/modules/instance-ai/internal-messages.d.ts +7 -0
- package/dist/modules/instance-ai/internal-messages.js +32 -2
- package/dist/modules/instance-ai/internal-messages.js.map +1 -1
- package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.d.ts +2 -5
- package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.js +4 -7
- package/dist/modules/instance-ai/mcp/instance-ai-mcp-registry.service.js.map +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-event-log.repository.js.map +1 -1
- package/dist/modules/instance-ai/tracing/instance-ai-tracing.service.js.map +1 -1
- package/dist/modules/instance-ai/workflow-templates.service.js +1 -1
- package/dist/modules/instance-ai/workflow-templates.service.js.map +1 -1
- package/dist/modules/ldap.ee/ldap.controller.ee.d.ts +4 -2
- package/dist/modules/ldap.ee/ldap.controller.ee.js +9 -2
- package/dist/modules/ldap.ee/ldap.controller.ee.js.map +1 -1
- package/dist/modules/ldap.ee/ldap.service.ee.js +4 -0
- package/dist/modules/ldap.ee/ldap.service.ee.js.map +1 -1
- package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-webhook.ee.js +1 -1
- package/dist/modules/log-streaming.ee/destinations/message-event-bus-destination-webhook.ee.js.map +1 -1
- package/dist/modules/mcp/mcp-server-middleware.service.js +1 -0
- package/dist/modules/mcp/mcp-server-middleware.service.js.map +1 -1
- package/dist/modules/mcp/mcp.constants.d.ts +2 -0
- package/dist/modules/mcp/mcp.constants.js +3 -1
- package/dist/modules/mcp/mcp.constants.js.map +1 -1
- package/dist/modules/mcp/mcp.controller.js +20 -6
- package/dist/modules/mcp/mcp.controller.js.map +1 -1
- package/dist/modules/mcp/mcp.types.d.ts +1 -0
- package/dist/modules/mcp/tools/agents/agent-reference.d.ts +1 -1
- package/dist/modules/mcp/tools/agents/agent-reference.js +2 -2
- package/dist/modules/mcp/tools/agents/agent-tools.service.d.ts +2 -5
- package/dist/modules/mcp/tools/agents/agent-tools.service.js +5 -9
- package/dist/modules/mcp/tools/agents/agent-tools.service.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-result.d.ts +2 -1
- package/dist/modules/n8n-packages/engine/import-result.js +1 -0
- package/dist/modules/n8n-packages/engine/import-result.js.map +1 -1
- package/dist/modules/n8n-packages/engine/import-telemetry.d.ts +5 -1
- package/dist/modules/n8n-packages/engine/import-telemetry.js.map +1 -1
- package/dist/modules/n8n-packages/engine/project-package-importer.d.ts +4 -5
- package/dist/modules/n8n-packages/engine/project-package-importer.js +9 -7
- package/dist/modules/n8n-packages/engine/project-package-importer.js.map +1 -1
- package/dist/modules/n8n-packages/engine/workflow-package-importer.d.ts +4 -5
- package/dist/modules/n8n-packages/engine/workflow-package-importer.js +18 -20
- package/dist/modules/n8n-packages/engine/workflow-package-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential-importer.js +1 -0
- package/dist/modules/n8n-packages/entities/credential/credential-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential-requirements.extractor.js +12 -12
- package/dist/modules/n8n-packages/entities/credential/credential-requirements.extractor.js.map +1 -1
- package/dist/modules/n8n-packages/entities/credential/workflow-credential-references.d.ts +4 -0
- package/dist/modules/n8n-packages/entities/credential/workflow-credential-references.js +34 -0
- package/dist/modules/n8n-packages/entities/credential/workflow-credential-references.js.map +1 -0
- package/dist/modules/n8n-packages/entities/project/project-importer.js +1 -1
- package/dist/modules/n8n-packages/entities/project/project-importer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js +22 -14
- package/dist/modules/n8n-packages/entities/workflow/workflow-importer.js.map +1 -1
- package/dist/modules/n8n-packages/io/directory/directory-package-reader.d.ts +21 -0
- package/dist/modules/n8n-packages/io/directory/directory-package-reader.js +146 -0
- package/dist/modules/n8n-packages/io/directory/directory-package-reader.js.map +1 -0
- package/dist/modules/n8n-packages/n8n-packages.service.d.ts +5 -1
- package/dist/modules/n8n-packages/n8n-packages.service.js +36 -0
- package/dist/modules/n8n-packages/n8n-packages.service.js.map +1 -1
- package/dist/modules/n8n-packages/n8n-packages.types.d.ts +10 -2
- package/dist/modules/n8n-packages/n8n-packages.types.js.map +1 -1
- package/dist/modules/oauth-server/database/entities/oauth-refresh-token.entity.d.ts +1 -0
- package/dist/modules/oauth-server/database/entities/oauth-refresh-token.entity.js +4 -0
- package/dist/modules/oauth-server/database/entities/oauth-refresh-token.entity.js.map +1 -1
- package/dist/modules/oauth-server/database/repositories/oauth-refresh-token.repository.d.ts +1 -0
- package/dist/modules/oauth-server/database/repositories/oauth-refresh-token.repository.js.map +1 -1
- package/dist/modules/oauth-server/oauth-server.service.d.ts +1 -1
- package/dist/modules/oauth-server/oauth-server.service.js +12 -16
- package/dist/modules/oauth-server/oauth-server.service.js.map +1 -1
- package/dist/modules/oauth-server/oauth-token.service.d.ts +2 -1
- package/dist/modules/oauth-server/oauth-token.service.js +15 -3
- package/dist/modules/oauth-server/oauth-token.service.js.map +1 -1
- package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.base.d.ts +22 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.base.js +60 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.base.js.map +1 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.resolver.d.ts +24 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.resolver.js +62 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-resource.resolver.js.map +1 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-test-resource.resolver.d.ts +22 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-test-resource.resolver.js +56 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/chat-trigger-test-resource.resolver.js.map +1 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/index.js +4 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/index.js.map +1 -1
- package/dist/modules/oauth-server/protected-resource-resolvers/utils.d.ts +4 -0
- package/dist/modules/oauth-server/protected-resource-resolvers/utils.js +17 -1
- package/dist/modules/oauth-server/protected-resource-resolvers/utils.js.map +1 -1
- package/dist/modules/oauth-server/resource-identity.d.ts +2 -0
- package/dist/modules/oauth-server/resource-identity.js +15 -0
- package/dist/modules/oauth-server/resource-identity.js.map +1 -0
- package/dist/modules/otel/otel.service.js +14 -7
- package/dist/modules/otel/otel.service.js.map +1 -1
- package/dist/modules/policy-infrastructure/policy-decision.service.d.ts +1 -0
- package/dist/modules/policy-infrastructure/policy-decision.service.js +3 -0
- package/dist/modules/policy-infrastructure/policy-decision.service.js.map +1 -1
- package/dist/modules/policy-infrastructure/policy-infrastructure.module.js +1 -0
- package/dist/modules/policy-infrastructure/policy-infrastructure.module.js.map +1 -1
- package/dist/modules/policy-infrastructure/policy-lifecycle-handler.d.ts +9 -0
- package/dist/modules/policy-infrastructure/policy-lifecycle-handler.js +45 -0
- package/dist/modules/policy-infrastructure/policy-lifecycle-handler.js.map +1 -0
- package/dist/modules/quick-connect/handlers/firecrawl.handler.js +1 -1
- package/dist/modules/quick-connect/handlers/firecrawl.handler.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-import.service.ee.d.ts +18 -1
- package/dist/modules/source-control.ee/source-control-import.service.ee.js +11 -3
- package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-status.service.ee.js +2 -0
- package/dist/modules/source-control.ee/source-control-status.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.controller.ee.d.ts +32 -0
- package/dist/modules/source-control.ee/source-control.service.ee.d.ts +16 -0
- package/dist/modules/source-control.ee/source-control.service.ee.js +11 -2
- package/dist/modules/source-control.ee/source-control.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/types/import-result.d.ts +2 -1
- package/dist/modules/sso-oidc/oidc.controller.ee.js +2 -2
- package/dist/modules/sso-oidc/oidc.controller.ee.js.map +1 -1
- package/dist/modules/sso-oidc/oidc.service.ee.js +1 -1
- package/dist/modules/sso-oidc/oidc.service.ee.js.map +1 -1
- package/dist/modules/sso-oidc/views/oidc-test-result.d.ts +2 -2
- package/dist/modules/sso-oidc/views/oidc-test-result.js +10 -4
- package/dist/modules/sso-oidc/views/oidc-test-result.js.map +1 -1
- package/dist/modules/sso-saml/saml.controller.ee.js +2 -2
- package/dist/modules/sso-saml/saml.controller.ee.js.map +1 -1
- package/dist/modules/sso-saml/saml.service.ee.js +1 -1
- package/dist/modules/sso-saml/saml.service.ee.js.map +1 -1
- package/dist/modules/sso-saml/views/init-sso-post.d.ts +1 -1
- package/dist/modules/sso-saml/views/init-sso-post.js +2 -2
- package/dist/modules/sso-saml/views/init-sso-post.js.map +1 -1
- package/dist/modules/token-exchange/services/jwks-resolver.js +1 -1
- package/dist/modules/token-exchange/services/jwks-resolver.js.map +1 -1
- package/dist/modules/type-availability-policies/database/entities/type-availability-policy-attachment.entity.d.ts +7 -0
- package/dist/modules/type-availability-policies/database/entities/type-availability-policy-attachment.entity.js +38 -0
- package/dist/modules/type-availability-policies/database/entities/type-availability-policy-attachment.entity.js.map +1 -0
- package/dist/modules/type-availability-policies/database/entities/type-availability-policy-scope.entity.d.ts +9 -0
- package/dist/modules/type-availability-policies/database/entities/type-availability-policy-scope.entity.js +41 -0
- package/dist/modules/type-availability-policies/database/entities/type-availability-policy-scope.entity.js.map +1 -0
- package/dist/modules/type-availability-policies/database/entities/type-availability-policy.entity.d.ts +8 -0
- package/dist/modules/type-availability-policies/database/entities/type-availability-policy.entity.js +37 -0
- package/dist/modules/type-availability-policies/database/entities/type-availability-policy.entity.js.map +1 -0
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-attachment.repository.d.ts +17 -0
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-attachment.repository.js +96 -0
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-attachment.repository.js.map +1 -0
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.d.ts +20 -0
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.js +69 -0
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.js.map +1 -0
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.d.ts +18 -0
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.js +63 -0
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.js.map +1 -0
- package/dist/modules/type-availability-policies/type-availability-policies.module.d.ts +1 -0
- package/dist/modules/type-availability-policies/type-availability-policies.module.js +6 -0
- package/dist/modules/type-availability-policies/type-availability-policies.module.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-activity.service.d.ts +3 -5
- package/dist/modules/workflow-reviews.ee/workflow-review-activity.service.js +7 -9
- package/dist/modules/workflow-reviews.ee/workflow-review-activity.service.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/{workflow-review-access.service.d.ts → workflow-review-authorization.service.d.ts} +12 -3
- package/dist/modules/workflow-reviews.ee/{workflow-review-access.service.js → workflow-review-authorization.service.js} +52 -17
- package/dist/modules/workflow-reviews.ee/workflow-review-authorization.service.js.map +1 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-decision-policy.d.ts +14 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-decision-policy.js +17 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-decision-policy.js.map +1 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.d.ts +8 -12
- package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.js +28 -82
- package/dist/modules/workflow-reviews.ee/workflow-review-inbox.service.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-lifecycle.service.d.ts +7 -6
- package/dist/modules/workflow-reviews.ee/workflow-review-lifecycle.service.js +80 -110
- package/dist/modules/workflow-reviews.ee/workflow-review-lifecycle.service.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-participant.resolver.d.ts +17 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-participant.resolver.js +69 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-participant.resolver.js.map +1 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-request-decision.service.d.ts +34 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-request-decision.service.js +237 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-request-decision.service.js.map +1 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-request-mutation-guard.service.d.ts +10 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-request-mutation-guard.service.js +57 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-request-mutation-guard.service.js.map +1 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-request-status.service.d.ts +17 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-request-status.service.js +93 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-request-status.service.js.map +1 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-request-submission.service.d.ts +34 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-request-submission.service.js +268 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-request-submission.service.js.map +1 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-requests.controller.d.ts +7 -3
- package/dist/modules/workflow-reviews.ee/workflow-review-requests.controller.js +13 -9
- package/dist/modules/workflow-reviews.ee/workflow-review-requests.controller.js.map +1 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-state-notifier.service.d.ts +9 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-state-notifier.service.js +37 -0
- package/dist/modules/workflow-reviews.ee/workflow-review-state-notifier.service.js.map +1 -0
- package/dist/oauth/oauth.service.js +0 -1
- package/dist/oauth/oauth.service.js.map +1 -1
- package/dist/permissions.ee/check-access.js +11 -7
- package/dist/permissions.ee/check-access.js.map +1 -1
- package/dist/permissions.ee/project-scope.service.d.ts +1 -0
- package/dist/permissions.ee/project-scope.service.js +7 -2
- package/dist/permissions.ee/project-scope.service.js.map +1 -1
- package/dist/policy/evaluate-content-import-safely.d.ts +5 -0
- package/dist/policy/evaluate-content-import-safely.js +18 -0
- package/dist/policy/evaluate-content-import-safely.js.map +1 -0
- package/dist/policy/policy-enforcement-backend.d.ts +1 -0
- package/dist/policy/policy-enforcement.service.d.ts +2 -2
- package/dist/policy/policy-enforcement.service.js +10 -14
- package/dist/policy/policy-enforcement.service.js.map +1 -1
- package/dist/policy/policy-violation.error.d.ts +2 -0
- package/dist/policy/policy-violation.error.js +10 -0
- package/dist/policy/policy-violation.error.js.map +1 -1
- package/dist/public-api/types.d.ts +1 -14
- package/dist/public-api/v1/controllers/git-connections.public.controller.d.ts +2 -1
- package/dist/public-api/v1/controllers/git-connections.public.controller.js +24 -3
- package/dist/public-api/v1/controllers/git-connections.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/workflows.public.controller.d.ts +8 -1
- package/dist/public-api/v1/controllers/workflows.public.controller.js +151 -14
- package/dist/public-api/v1/controllers/workflows.public.controller.js.map +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js +1 -0
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/data-tables/data-tables.handler.js +33 -44
- package/dist/public-api/v1/handlers/data-tables/data-tables.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/discover/discover.handler.d.ts +1 -1
- package/dist/public-api/v1/handlers/discover/discover.handler.js +3 -13
- package/dist/public-api/v1/handlers/discover/discover.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/discover/discover.service.d.ts +2 -3
- package/dist/public-api/v1/handlers/discover/discover.service.js.map +1 -1
- package/dist/public-api/v1/handlers/projects/projects.handler.d.ts +1 -1
- package/dist/public-api/v1/handlers/projects/projects.handler.js +23 -21
- package/dist/public-api/v1/handlers/projects/projects.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/variables/variables.handler.d.ts +1 -1
- package/dist/public-api/v1/handlers/variables/variables.handler.js +5 -6
- package/dist/public-api/v1/handlers/variables/variables.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/workflows/workflows.handler.d.ts +0 -4
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js +0 -102
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js.map +1 -1
- package/dist/public-api/v1/openapi.yml +4779 -2848
- package/dist/response-helper.js +3 -0
- package/dist/response-helper.js.map +1 -1
- package/dist/scaling/constants.d.ts +2 -2
- package/dist/scaling/constants.js +1 -0
- package/dist/scaling/constants.js.map +1 -1
- package/dist/scaling/pubsub/pubsub.event-map.d.ts +5 -1
- package/dist/scaling/pubsub/pubsub.types.d.ts +2 -1
- package/dist/scheduling/poll-trigger-node/poll-trigger-task-handler.js +2 -7
- package/dist/scheduling/poll-trigger-node/poll-trigger-task-handler.js.map +1 -1
- package/dist/security/content-security-policy.d.ts +8 -0
- package/dist/security/content-security-policy.js +18 -0
- package/dist/security/content-security-policy.js.map +1 -0
- package/dist/security-audit/risk-reporters/instance-risk-reporter.js +1 -1
- package/dist/security-audit/risk-reporters/instance-risk-reporter.js.map +1 -1
- package/dist/server.js +22 -21
- package/dist/server.js.map +1 -1
- package/dist/services/active-workflows.service.d.ts +3 -1
- package/dist/services/active-workflows.service.js +11 -9
- package/dist/services/active-workflows.service.js.map +1 -1
- package/dist/services/ai-gateway.service.js +1 -1
- package/dist/services/ai-gateway.service.js.map +1 -1
- package/dist/services/credentials-tester.service.js +7 -1
- package/dist/services/credentials-tester.service.js.map +1 -1
- package/dist/services/engine-data-plane-proxy.service.d.ts +4 -1
- package/dist/services/engine-data-plane-proxy.service.js +5 -0
- package/dist/services/engine-data-plane-proxy.service.js.map +1 -1
- package/dist/services/engine-v2-dispatcher.service.d.ts +5 -2
- package/dist/services/engine-v2-dispatcher.service.js +46 -24
- package/dist/services/engine-v2-dispatcher.service.js.map +1 -1
- package/dist/services/engine-v2-push-registry.service.d.ts +8 -0
- package/dist/services/engine-v2-push-registry.service.js +51 -0
- package/dist/services/engine-v2-push-registry.service.js.map +1 -0
- package/dist/services/engine-v2-push-session.d.ts +23 -0
- package/dist/services/engine-v2-push-session.js +24 -0
- package/dist/services/engine-v2-push-session.js.map +1 -0
- package/dist/services/folder-finder.service.js +10 -8
- package/dist/services/folder-finder.service.js.map +1 -1
- package/dist/services/folder.service.d.ts +1 -1
- package/dist/services/folder.service.js +1 -7
- package/dist/services/folder.service.js.map +1 -1
- package/dist/services/import.service.d.ts +14 -3
- package/dist/services/import.service.js +27 -2
- package/dist/services/import.service.js.map +1 -1
- package/dist/services/ownership-transfer/ownership-transfer.manifest.json +5 -0
- package/dist/services/project.service.ee.d.ts +47 -9
- package/dist/services/project.service.ee.js +128 -17
- package/dist/services/project.service.ee.js.map +1 -1
- package/dist/services/role.service.js +10 -5
- package/dist/services/role.service.js.map +1 -1
- package/dist/task-runners/task-runner-process-py.d.ts +1 -1
- package/dist/task-runners/task-runner-process-py.js.map +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/telemetry/index.js.map +1 -1
- package/dist/utils/ai-proxy-fetch.d.ts +3 -4
- package/dist/utils/ai-proxy-fetch.js +3 -5
- package/dist/utils/ai-proxy-fetch.js.map +1 -1
- package/dist/utils/strapi-utils.js +1 -1
- package/dist/utils/strapi-utils.js.map +1 -1
- package/dist/utils/ttl-map.d.ts +1 -0
- package/dist/utils/ttl-map.js +9 -0
- package/dist/utils/ttl-map.js.map +1 -1
- package/dist/webhooks/constants.d.ts +2 -0
- package/dist/webhooks/constants.js +2 -1
- package/dist/webhooks/constants.js.map +1 -1
- package/dist/webhooks/live-webhooks.js +1 -1
- package/dist/webhooks/live-webhooks.js.map +1 -1
- package/dist/webhooks/test-webhook-registrations.service.d.ts +1 -0
- package/dist/webhooks/test-webhook-registrations.service.js.map +1 -1
- package/dist/webhooks/test-webhooks.d.ts +6 -2
- package/dist/webhooks/test-webhooks.js +29 -6
- package/dist/webhooks/test-webhooks.js.map +1 -1
- package/dist/webhooks/waiting-forms.js +3 -4
- package/dist/webhooks/waiting-forms.js.map +1 -1
- package/dist/webhooks/waiting-webhooks.js +4 -0
- package/dist/webhooks/waiting-webhooks.js.map +1 -1
- package/dist/webhooks/webhook-helpers.d.ts +3 -1
- package/dist/webhooks/webhook-helpers.js +24 -1
- package/dist/webhooks/webhook-helpers.js.map +1 -1
- package/dist/webhooks/webhook-response-headers.d.ts +1 -0
- package/dist/webhooks/webhook-response-headers.js +6 -0
- package/dist/webhooks/webhook-response-headers.js.map +1 -1
- package/dist/workflow-execute-additional-data.js +5 -0
- package/dist/workflow-execute-additional-data.js.map +1 -1
- package/dist/workflow-helpers.d.ts +3 -2
- package/dist/workflow-helpers.js +35 -24
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflows/publication/publication-result.d.ts +5 -0
- package/dist/workflows/publication/publication-status-reporter.d.ts +1 -0
- package/dist/workflows/publication/publication-status-reporter.js +23 -5
- package/dist/workflows/publication/publication-status-reporter.js.map +1 -1
- package/dist/workflows/publication/workflow-publication-applier.d.ts +6 -1
- package/dist/workflows/publication/workflow-publication-applier.js +63 -10
- package/dist/workflows/publication/workflow-publication-applier.js.map +1 -1
- package/dist/workflows/triggers/poll-backoff.service.d.ts +2 -2
- package/dist/workflows/triggers/poll-backoff.service.js +3 -3
- package/dist/workflows/triggers/poll-backoff.service.js.map +1 -1
- package/dist/workflows/triggers/poll-cursor.service.d.ts +2 -2
- package/dist/workflows/triggers/poll-cursor.service.js +4 -1
- package/dist/workflows/triggers/poll-cursor.service.js.map +1 -1
- package/dist/workflows/triggers/trigger-execution-context.factory.d.ts +6 -4
- package/dist/workflows/triggers/trigger-execution-context.factory.js +13 -7
- package/dist/workflows/triggers/trigger-execution-context.factory.js.map +1 -1
- package/dist/workflows/triggers/webhook-trigger-registrar.d.ts +1 -0
- package/dist/workflows/triggers/webhook-trigger-registrar.js +3 -0
- package/dist/workflows/triggers/webhook-trigger-registrar.js.map +1 -1
- package/dist/workflows/triggers/workflow-trigger-activator.d.ts +10 -1
- package/dist/workflows/triggers/workflow-trigger-activator.js +78 -38
- package/dist/workflows/triggers/workflow-trigger-activator.js.map +1 -1
- package/dist/workflows/workflow-creation.service.d.ts +17 -4
- package/dist/workflows/workflow-creation.service.js +96 -16
- package/dist/workflows/workflow-creation.service.js.map +1 -1
- package/dist/workflows/workflow-execution.service.js +2 -0
- package/dist/workflows/workflow-execution.service.js.map +1 -1
- package/dist/workflows/workflow-finder.service.js +67 -56
- package/dist/workflows/workflow-finder.service.js.map +1 -1
- package/dist/workflows/workflow-validation.service.js +3 -2
- package/dist/workflows/workflow-validation.service.js.map +1 -1
- package/dist/workflows/workflow.service.d.ts +4 -1
- package/dist/workflows/workflow.service.ee.d.ts +9 -3
- package/dist/workflows/workflow.service.ee.js +16 -2
- package/dist/workflows/workflow.service.ee.js.map +1 -1
- package/dist/workflows/workflow.service.js +25 -4
- package/dist/workflows/workflow.service.js.map +1 -1
- package/dist/workflows/workflows.controller.d.ts +3 -5
- package/dist/workflows/workflows.controller.js +3 -7
- package/dist/workflows/workflows.controller.js.map +1 -1
- package/package.json +38 -38
- package/templates/oauth-callback.handlebars +1 -1
- package/templates/oauth-error-callback.handlebars +1 -1
- package/templates/saml-connection-test-failed.handlebars +4 -1
- package/templates/saml-connection-test-success.handlebars +4 -1
- package/dist/modules/instance-ai/output-redaction-config.d.ts +0 -3
- package/dist/modules/instance-ai/output-redaction-config.js +0 -21
- package/dist/modules/instance-ai/output-redaction-config.js.map +0 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-access.service.js.map +0 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-eligibility.service.d.ts +0 -18
- package/dist/modules/workflow-reviews.ee/workflow-review-eligibility.service.js +0 -77
- package/dist/modules/workflow-reviews.ee/workflow-review-eligibility.service.js.map +0 -1
- package/dist/modules/workflow-reviews.ee/workflow-review-request.service.d.ts +0 -51
- package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js +0 -538
- package/dist/modules/workflow-reviews.ee/workflow-review-request.service.js.map +0 -1
- package/dist/policy/policy-cleared.d.ts +0 -20
- package/dist/policy/policy-cleared.js +0 -22
- package/dist/policy/policy-cleared.js.map +0 -1
- package/dist/public-api/v1/handlers/data-tables/data-tables.service.d.ts +0 -4
- package/dist/public-api/v1/handlers/data-tables/data-tables.service.js +0 -44
- package/dist/public-api/v1/handlers/data-tables/data-tables.service.js.map +0 -1
|
@@ -0,0 +1,69 @@
|
|
|
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.WorkflowReviewParticipantResolver = void 0;
|
|
13
|
+
const db_1 = require("@n8n/db");
|
|
14
|
+
const di_1 = require("@n8n/di");
|
|
15
|
+
const workflow_review_mapper_1 = require("./workflow-review.mapper");
|
|
16
|
+
let WorkflowReviewParticipantResolver = class WorkflowReviewParticipantResolver {
|
|
17
|
+
constructor(workflowReviewRequestReviewerRepository, workflowReviewRequestAuthorRepository, userRepository) {
|
|
18
|
+
this.workflowReviewRequestReviewerRepository = workflowReviewRequestReviewerRepository;
|
|
19
|
+
this.workflowReviewRequestAuthorRepository = workflowReviewRequestAuthorRepository;
|
|
20
|
+
this.userRepository = userRepository;
|
|
21
|
+
}
|
|
22
|
+
async resolve(requests) {
|
|
23
|
+
const requestIds = requests.map((request) => request.id);
|
|
24
|
+
const [reviewerRows, authorRows] = await Promise.all([
|
|
25
|
+
this.workflowReviewRequestReviewerRepository.findByRequestIds(requestIds),
|
|
26
|
+
this.workflowReviewRequestAuthorRepository.findByRequestIds(requestIds),
|
|
27
|
+
]);
|
|
28
|
+
const reviewerIdsByRequestId = groupUserIdsByRequestId(reviewerRows);
|
|
29
|
+
const authorIdsByRequestId = groupUserIdsByRequestId(authorRows);
|
|
30
|
+
const userIds = new Set([
|
|
31
|
+
...requests.map((request) => request.createdById).filter((id) => id !== null),
|
|
32
|
+
...reviewerRows.map((row) => row.userId),
|
|
33
|
+
...authorRows.map((row) => row.userId),
|
|
34
|
+
]);
|
|
35
|
+
const usersById = new Map();
|
|
36
|
+
if (userIds.size > 0) {
|
|
37
|
+
for (const user of await this.userRepository.findManyByIds([...userIds])) {
|
|
38
|
+
usersById.set(user.id, (0, workflow_review_mapper_1.toEligibleReviewer)(user));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const project = (userIdsForRequest) => userIdsForRequest.map((userId) => usersById.get(userId)).filter((user) => user !== undefined);
|
|
42
|
+
const participantsByRequestId = new Map(requests.map((request) => [
|
|
43
|
+
request.id,
|
|
44
|
+
{
|
|
45
|
+
requester: request.createdById ? (usersById.get(request.createdById) ?? null) : null,
|
|
46
|
+
authors: project(authorIdsByRequestId.get(request.id) ?? []),
|
|
47
|
+
reviewers: project(reviewerIdsByRequestId.get(request.id) ?? []),
|
|
48
|
+
},
|
|
49
|
+
]));
|
|
50
|
+
return {
|
|
51
|
+
for: (requestId) => participantsByRequestId.get(requestId) ?? { requester: null, authors: [], reviewers: [] },
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
exports.WorkflowReviewParticipantResolver = WorkflowReviewParticipantResolver;
|
|
56
|
+
exports.WorkflowReviewParticipantResolver = WorkflowReviewParticipantResolver = __decorate([
|
|
57
|
+
(0, di_1.Service)(),
|
|
58
|
+
__metadata("design:paramtypes", [db_1.WorkflowReviewRequestReviewerRepository, db_1.WorkflowReviewRequestAuthorRepository, db_1.UserRepository])
|
|
59
|
+
], WorkflowReviewParticipantResolver);
|
|
60
|
+
function groupUserIdsByRequestId(rows) {
|
|
61
|
+
const idsByRequestId = new Map();
|
|
62
|
+
for (const { workflowReviewRequestId, userId } of rows) {
|
|
63
|
+
const ids = idsByRequestId.get(workflowReviewRequestId) ?? [];
|
|
64
|
+
ids.push(userId);
|
|
65
|
+
idsByRequestId.set(workflowReviewRequestId, ids);
|
|
66
|
+
}
|
|
67
|
+
return idsByRequestId;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=workflow-review-participant.resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-review-participant.resolver.js","sourceRoot":"","sources":["../../../src/modules/workflow-reviews.ee/workflow-review-participant.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,gCAKiB;AACjB,gCAAkC;AAElC,qEAA8D;AAoBvD,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAC7C,YACkB,uCAAgF,EAChF,qCAA4E,EAC5E,cAA8B;uDAF9B,uCAAuC;qDACvC,qCAAqC;8BACrC,cAAc;IAC7B,CAAC;IAOJ,KAAK,CAAC,OAAO,CAAC,QAAiC;QAC9C,MAAM,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACzD,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,GAAG,MAAM,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AED,OAAO,cAAc,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { DecideWorkflowReviewRequestDto, DecideWorkflowReviewRequestResponse } from '@n8n/api-types';
|
|
2
|
+
import { Logger } from '@n8n/backend-common';
|
|
3
|
+
import { DbLockService, UserRepository, WorkflowReviewActivityRepository, WorkflowReviewRequestAuthorRepository, WorkflowReviewRequestRepository, WorkflowReviewRequestReviewerRepository, WorkflowReviewRequestWorkflowRepository, type User } from '@n8n/db';
|
|
4
|
+
import { CollaborationService } from '../../collaboration/collaboration.service';
|
|
5
|
+
import { EventService } from '../../events/event.service';
|
|
6
|
+
import { WorkflowFinderService } from '../../workflows/workflow-finder.service';
|
|
7
|
+
import { WorkflowService } from '../../workflows/workflow.service';
|
|
8
|
+
import { WorkflowReviewAuthorizationService } from './workflow-review-authorization.service';
|
|
9
|
+
import { WorkflowReviewFeatureGate } from './workflow-review-feature-gate.service';
|
|
10
|
+
import { WorkflowReviewRequestMutationGuard } from './workflow-review-request-mutation-guard.service';
|
|
11
|
+
import { WorkflowReviewStateNotifier } from './workflow-review-state-notifier.service';
|
|
12
|
+
export declare class WorkflowReviewRequestDecisionService {
|
|
13
|
+
private readonly logger;
|
|
14
|
+
private readonly featureGate;
|
|
15
|
+
private readonly workflowFinderService;
|
|
16
|
+
private readonly workflowReviewRequestRepository;
|
|
17
|
+
private readonly workflowReviewRequestWorkflowRepository;
|
|
18
|
+
private readonly workflowReviewRequestAuthorRepository;
|
|
19
|
+
private readonly workflowReviewRequestReviewerRepository;
|
|
20
|
+
private readonly activityRepository;
|
|
21
|
+
private readonly userRepository;
|
|
22
|
+
private readonly dbLockService;
|
|
23
|
+
private readonly collaborationService;
|
|
24
|
+
private readonly workflowService;
|
|
25
|
+
private readonly authorizationService;
|
|
26
|
+
private readonly eventService;
|
|
27
|
+
private readonly mutationGuard;
|
|
28
|
+
private readonly stateNotifier;
|
|
29
|
+
constructor(logger: Logger, featureGate: WorkflowReviewFeatureGate, workflowFinderService: WorkflowFinderService, workflowReviewRequestRepository: WorkflowReviewRequestRepository, workflowReviewRequestWorkflowRepository: WorkflowReviewRequestWorkflowRepository, workflowReviewRequestAuthorRepository: WorkflowReviewRequestAuthorRepository, workflowReviewRequestReviewerRepository: WorkflowReviewRequestReviewerRepository, activityRepository: WorkflowReviewActivityRepository, userRepository: UserRepository, dbLockService: DbLockService, collaborationService: CollaborationService, workflowService: WorkflowService, authorizationService: WorkflowReviewAuthorizationService, eventService: EventService, mutationGuard: WorkflowReviewRequestMutationGuard, stateNotifier: WorkflowReviewStateNotifier);
|
|
30
|
+
decide(user: User, workflowReviewRequestId: string, dto: DecideWorkflowReviewRequestDto): Promise<DecideWorkflowReviewRequestResponse>;
|
|
31
|
+
private resolveRequesterPublishability;
|
|
32
|
+
private publishApprovedVersion;
|
|
33
|
+
private assertDecisionAllowed;
|
|
34
|
+
}
|
|
@@ -0,0 +1,237 @@
|
|
|
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.WorkflowReviewRequestDecisionService = void 0;
|
|
13
|
+
const backend_common_1 = require("@n8n/backend-common");
|
|
14
|
+
const db_1 = require("@n8n/db");
|
|
15
|
+
const di_1 = require("@n8n/di");
|
|
16
|
+
const ensure_error_1 = require("@n8n/utils/errors/ensure-error");
|
|
17
|
+
const collaboration_service_1 = require("../../collaboration/collaboration.service");
|
|
18
|
+
const bad_request_error_1 = require("../../errors/response-errors/bad-request.error");
|
|
19
|
+
const forbidden_error_1 = require("../../errors/response-errors/forbidden.error");
|
|
20
|
+
const not_found_error_1 = require("../../errors/response-errors/not-found.error");
|
|
21
|
+
const event_service_1 = require("../../events/event.service");
|
|
22
|
+
const workflow_finder_service_1 = require("../../workflows/workflow-finder.service");
|
|
23
|
+
const workflow_service_1 = require("../../workflows/workflow.service");
|
|
24
|
+
const workflow_review_authorization_service_1 = require("./workflow-review-authorization.service");
|
|
25
|
+
const workflow_review_decision_policy_1 = require("./workflow-review-decision-policy");
|
|
26
|
+
const workflow_review_feature_gate_service_1 = require("./workflow-review-feature-gate.service");
|
|
27
|
+
const workflow_review_mapper_1 = require("./workflow-review.mapper");
|
|
28
|
+
const workflow_review_request_mutation_guard_service_1 = require("./workflow-review-request-mutation-guard.service");
|
|
29
|
+
const workflow_review_state_notifier_service_1 = require("./workflow-review-state-notifier.service");
|
|
30
|
+
let WorkflowReviewRequestDecisionService = class WorkflowReviewRequestDecisionService {
|
|
31
|
+
constructor(logger, featureGate, workflowFinderService, workflowReviewRequestRepository, workflowReviewRequestWorkflowRepository, workflowReviewRequestAuthorRepository, workflowReviewRequestReviewerRepository, activityRepository, userRepository, dbLockService, collaborationService, workflowService, authorizationService, eventService, mutationGuard, stateNotifier) {
|
|
32
|
+
this.logger = logger;
|
|
33
|
+
this.featureGate = featureGate;
|
|
34
|
+
this.workflowFinderService = workflowFinderService;
|
|
35
|
+
this.workflowReviewRequestRepository = workflowReviewRequestRepository;
|
|
36
|
+
this.workflowReviewRequestWorkflowRepository = workflowReviewRequestWorkflowRepository;
|
|
37
|
+
this.workflowReviewRequestAuthorRepository = workflowReviewRequestAuthorRepository;
|
|
38
|
+
this.workflowReviewRequestReviewerRepository = workflowReviewRequestReviewerRepository;
|
|
39
|
+
this.activityRepository = activityRepository;
|
|
40
|
+
this.userRepository = userRepository;
|
|
41
|
+
this.dbLockService = dbLockService;
|
|
42
|
+
this.collaborationService = collaborationService;
|
|
43
|
+
this.workflowService = workflowService;
|
|
44
|
+
this.authorizationService = authorizationService;
|
|
45
|
+
this.eventService = eventService;
|
|
46
|
+
this.mutationGuard = mutationGuard;
|
|
47
|
+
this.stateNotifier = stateNotifier;
|
|
48
|
+
}
|
|
49
|
+
async decide(user, workflowReviewRequestId, dto) {
|
|
50
|
+
await this.featureGate.assertAvailable();
|
|
51
|
+
const request = await this.workflowReviewRequestRepository.findById(workflowReviewRequestId, {});
|
|
52
|
+
if (!request) {
|
|
53
|
+
throw new not_found_error_1.NotFoundError('Could not find review request');
|
|
54
|
+
}
|
|
55
|
+
const workflowRows = await this.workflowReviewRequestWorkflowRepository.findByRequestId(workflowReviewRequestId, {});
|
|
56
|
+
const [workflowRow] = workflowRows;
|
|
57
|
+
if (!workflowRow) {
|
|
58
|
+
throw new not_found_error_1.NotFoundError('Could not find review request');
|
|
59
|
+
}
|
|
60
|
+
const readableWorkflows = await Promise.all(workflowRows.map(async (row) => await this.workflowFinderService.findWorkflowForUser(row.workflowId, user, [
|
|
61
|
+
'workflow:read',
|
|
62
|
+
])));
|
|
63
|
+
const canReadEveryWorkflow = readableWorkflows.every((workflow) => workflow !== null);
|
|
64
|
+
if (!canReadEveryWorkflow) {
|
|
65
|
+
throw new not_found_error_1.NotFoundError('Could not find review request');
|
|
66
|
+
}
|
|
67
|
+
(0, workflow_review_request_mutation_guard_service_1.assertWorkflowReviewRequestUpdatable)(request);
|
|
68
|
+
const hasAdminOverride = await this.authorizationService.isAdminForProject(user, request.projectId);
|
|
69
|
+
const isAuthor = await this.workflowReviewRequestAuthorRepository.isAuthor({ workflowReviewRequestId, userId: user.id }, {});
|
|
70
|
+
const isAssignedReviewer = await this.workflowReviewRequestReviewerRepository.isReviewer({ workflowReviewRequestId, userId: user.id }, {});
|
|
71
|
+
this.assertDecisionAllowed({
|
|
72
|
+
canReadEveryWorkflow,
|
|
73
|
+
isAuthor,
|
|
74
|
+
isAssignedReviewer,
|
|
75
|
+
hasAdminOverride,
|
|
76
|
+
});
|
|
77
|
+
const requesterPublishability = dto.decision === 'approved'
|
|
78
|
+
? await this.resolveRequesterPublishability(request.createdById, workflowRow.workflowId)
|
|
79
|
+
: null;
|
|
80
|
+
if (dto.decision === 'changes_requested' && !dto.note) {
|
|
81
|
+
throw new bad_request_error_1.BadRequestError('A note is required when requesting changes');
|
|
82
|
+
}
|
|
83
|
+
const { request: saved, pinnedVersionId, decidedAsAssignedReviewer, } = await this.dbLockService.withLockContext(1004, async (ctx) => {
|
|
84
|
+
const current = await this.workflowReviewRequestRepository.findById(workflowReviewRequestId, ctx);
|
|
85
|
+
if (!current) {
|
|
86
|
+
throw new not_found_error_1.NotFoundError('Could not find review request');
|
|
87
|
+
}
|
|
88
|
+
(0, workflow_review_request_mutation_guard_service_1.assertWorkflowReviewRequestUpdatable)(current);
|
|
89
|
+
const isAuthorNow = await this.workflowReviewRequestAuthorRepository.isAuthor({ workflowReviewRequestId, userId: user.id }, ctx);
|
|
90
|
+
const isAssignedReviewerNow = await this.workflowReviewRequestReviewerRepository.isReviewer({ workflowReviewRequestId, userId: user.id }, ctx);
|
|
91
|
+
this.assertDecisionAllowed({
|
|
92
|
+
canReadEveryWorkflow,
|
|
93
|
+
isAuthor: isAuthorNow,
|
|
94
|
+
isAssignedReviewer: isAssignedReviewerNow,
|
|
95
|
+
hasAdminOverride,
|
|
96
|
+
});
|
|
97
|
+
const currentRows = await this.workflowReviewRequestWorkflowRepository.findByRequestId(workflowReviewRequestId, ctx);
|
|
98
|
+
const currentRow = currentRows.find((row) => row.workflowId === workflowRow.workflowId);
|
|
99
|
+
if (!currentRow) {
|
|
100
|
+
throw new not_found_error_1.NotFoundError('Could not find review request');
|
|
101
|
+
}
|
|
102
|
+
await this.mutationGuard.assertWorkflowStillReviewable(currentRow.workflowId, current.projectId, ctx, 'review');
|
|
103
|
+
if (dto.decision === 'approved') {
|
|
104
|
+
for (const row of currentRows) {
|
|
105
|
+
await this.workflowReviewRequestWorkflowRepository.captureApprovalBaseline({
|
|
106
|
+
workflowReviewRequestId,
|
|
107
|
+
workflowId: row.workflowId,
|
|
108
|
+
}, ctx);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
current.decision = dto.decision;
|
|
112
|
+
current.updatedById = user.id;
|
|
113
|
+
if (dto.decision === 'approved') {
|
|
114
|
+
current.state = 'closed';
|
|
115
|
+
current.closedById = requesterPublishability?.canPublish === true ? user.id : null;
|
|
116
|
+
current.approvedAt = new Date();
|
|
117
|
+
}
|
|
118
|
+
const savedRequest = await this.workflowReviewRequestRepository.saveRequest(current, ctx);
|
|
119
|
+
await this.activityRepository.createActivity({
|
|
120
|
+
workflowReviewRequestId,
|
|
121
|
+
type: dto.decision === 'approved' ? 'review.approved' : 'review.changes_requested',
|
|
122
|
+
data: {
|
|
123
|
+
workflowVersions: currentRows.flatMap((row) => row.workflowVersionId === null
|
|
124
|
+
? []
|
|
125
|
+
: [{ workflowId: row.workflowId, workflowVersionId: row.workflowVersionId }]),
|
|
126
|
+
note: dto.note ?? null,
|
|
127
|
+
},
|
|
128
|
+
createdById: user.id,
|
|
129
|
+
}, ctx);
|
|
130
|
+
return {
|
|
131
|
+
request: savedRequest,
|
|
132
|
+
pinnedVersionId: currentRow.workflowVersionId,
|
|
133
|
+
decidedAsAssignedReviewer: isAssignedReviewerNow,
|
|
134
|
+
};
|
|
135
|
+
});
|
|
136
|
+
this.stateNotifier.notify(workflowRow.workflowId);
|
|
137
|
+
this.eventService.emit('workflow-review-decided', {
|
|
138
|
+
user,
|
|
139
|
+
workflowReviewRequestId,
|
|
140
|
+
workflowId: workflowRow.workflowId,
|
|
141
|
+
workflowVersionId: pinnedVersionId,
|
|
142
|
+
decision: dto.decision,
|
|
143
|
+
decidedVia: decidedAsAssignedReviewer ? 'assigned-reviewer' : 'admin-override',
|
|
144
|
+
reviewCreatedAt: saved.createdAt,
|
|
145
|
+
});
|
|
146
|
+
const summary = (0, workflow_review_mapper_1.toRequestSummary)(saved, pinnedVersionId);
|
|
147
|
+
if (dto.decision !== 'approved' || requesterPublishability === null) {
|
|
148
|
+
return summary;
|
|
149
|
+
}
|
|
150
|
+
if (!requesterPublishability.canPublish) {
|
|
151
|
+
this.logger.warn('Cannot publish approved review: requester cannot publish', {
|
|
152
|
+
workflowId: workflowRow.workflowId,
|
|
153
|
+
message: requesterPublishability.failureMessage,
|
|
154
|
+
});
|
|
155
|
+
return {
|
|
156
|
+
...summary,
|
|
157
|
+
autoPublish: {
|
|
158
|
+
status: 'failed',
|
|
159
|
+
message: requesterPublishability.failureMessage,
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
...summary,
|
|
165
|
+
autoPublish: await this.publishApprovedVersion(requesterPublishability.requester, workflowRow.workflowId, pinnedVersionId),
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
async resolveRequesterPublishability(createdById, workflowId) {
|
|
169
|
+
if (!createdById) {
|
|
170
|
+
return {
|
|
171
|
+
canPublish: false,
|
|
172
|
+
failureMessage: 'The review requester is no longer available',
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
const [requester] = await this.userRepository.findManyByIds([createdById], {
|
|
176
|
+
includeRole: true,
|
|
177
|
+
});
|
|
178
|
+
if (!requester || requester.disabled) {
|
|
179
|
+
return {
|
|
180
|
+
canPublish: false,
|
|
181
|
+
failureMessage: 'The review requester is no longer available',
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
const workflow = await this.workflowFinderService.findWorkflowForUser(workflowId, requester, [
|
|
185
|
+
'workflow:publish',
|
|
186
|
+
]);
|
|
187
|
+
if (!workflow) {
|
|
188
|
+
return {
|
|
189
|
+
canPublish: false,
|
|
190
|
+
failureMessage: 'The review requester no longer has permission to publish this workflow',
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
return { canPublish: true, requester };
|
|
194
|
+
}
|
|
195
|
+
async publishApprovedVersion(requester, workflowId, pinnedVersionId) {
|
|
196
|
+
if (pinnedVersionId === null) {
|
|
197
|
+
this.logger.warn('Cannot publish approved review: the pinned version was pruned', {
|
|
198
|
+
workflowId,
|
|
199
|
+
});
|
|
200
|
+
return { status: 'failed', message: 'The reviewed workflow version no longer exists' };
|
|
201
|
+
}
|
|
202
|
+
try {
|
|
203
|
+
await this.workflowService.activateWorkflow(requester, workflowId, {
|
|
204
|
+
versionId: pinnedVersionId,
|
|
205
|
+
source: 'review-approval',
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
catch (error) {
|
|
209
|
+
this.logger.error('Failed to publish workflow after review approval', {
|
|
210
|
+
workflowId,
|
|
211
|
+
pinnedVersionId,
|
|
212
|
+
error,
|
|
213
|
+
});
|
|
214
|
+
return { status: 'failed', message: (0, ensure_error_1.ensureError)(error).message };
|
|
215
|
+
}
|
|
216
|
+
this.collaborationService
|
|
217
|
+
.broadcastWorkflowUpdate(workflowId, requester.id)
|
|
218
|
+
.catch((error) => this.logger.warn('Failed to broadcast workflow update', { workflowId, error }));
|
|
219
|
+
return { status: 'published' };
|
|
220
|
+
}
|
|
221
|
+
assertDecisionAllowed(facts) {
|
|
222
|
+
const capability = (0, workflow_review_decision_policy_1.resolveDecisionCapability)(facts);
|
|
223
|
+
if (capability.allowed) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
if (capability.reason === 'author') {
|
|
227
|
+
throw new forbidden_error_1.ForbiddenError('Authors cannot decide on their own review request');
|
|
228
|
+
}
|
|
229
|
+
throw new not_found_error_1.NotFoundError('Could not find review request');
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
exports.WorkflowReviewRequestDecisionService = WorkflowReviewRequestDecisionService;
|
|
233
|
+
exports.WorkflowReviewRequestDecisionService = WorkflowReviewRequestDecisionService = __decorate([
|
|
234
|
+
(0, di_1.Service)(),
|
|
235
|
+
__metadata("design:paramtypes", [backend_common_1.Logger, workflow_review_feature_gate_service_1.WorkflowReviewFeatureGate, workflow_finder_service_1.WorkflowFinderService, db_1.WorkflowReviewRequestRepository, db_1.WorkflowReviewRequestWorkflowRepository, db_1.WorkflowReviewRequestAuthorRepository, db_1.WorkflowReviewRequestReviewerRepository, db_1.WorkflowReviewActivityRepository, db_1.UserRepository, db_1.DbLockService, collaboration_service_1.CollaborationService, workflow_service_1.WorkflowService, workflow_review_authorization_service_1.WorkflowReviewAuthorizationService, event_service_1.EventService, workflow_review_request_mutation_guard_service_1.WorkflowReviewRequestMutationGuard, workflow_review_state_notifier_service_1.WorkflowReviewStateNotifier])
|
|
236
|
+
], WorkflowReviewRequestDecisionService);
|
|
237
|
+
//# sourceMappingURL=workflow-review-request-decision.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-review-request-decision.service.js","sourceRoot":"","sources":["../../../src/modules/workflow-reviews.ee/workflow-review-request-decision.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,wDAA6C;AAC7C,gCAUiB;AACjB,gCAAkC;AAClC,iEAA6D;AAE7D,iFAA6E;AAC7E,kFAA6E;AAC7E,8EAA0E;AAC1E,8EAAyE;AACzE,0DAAsD;AACtD,iFAA4E;AAC5E,mEAA+D;AAE/D,mGAA6F;AAC7F,uFAG2C;AAC3C,iGAAmF;AACnF,qEAA4D;AAC5D,qHAG0D;AAC1D,qGAAuF;AAGhF,IAAM,oCAAoC,GAA1C,MAAM,oCAAoC;IAChD,YACkB,MAAc,EACd,WAAsC,EACtC,qBAA4C,EAC5C,+BAAgE,EAChE,uCAAgF,EAChF,qCAA4E,EAC5E,uCAAgF,EAChF,kBAAoD,EACpD,cAA8B,EAC9B,aAA4B,EAC5B,oBAA0C,EAC1C,eAAgC,EAChC,oBAAwD,EACxD,YAA0B,EAC1B,aAAiD,EACjD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,UAAU;gBACV,eAAe;gBACf,KAAK;aACL,CAAC,CAAC;YACH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAA,0BAAW,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;QAClE,CAAC;QAGD,IAAI,CAAC,oBAAoB;aACvB,uBAAuB,CAAC,UAAU,EAAE,SAAS,CAAC,EAAE,CAAC;aACjD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAChB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,qCAAqC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAC9E,CAAC;QAEH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IAChC,CAAC;IAMO,qBAAqB,CAAC,KAAkC;QAC/D,MAAM,UAAU,GAAG,IAAA,2DAAyB,EAAC,KAAK,CAAC,CAAC;QACpD,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;YACxB,OAAO;QACR,CAAC;QAED,IAAI,UAAU,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YACpC,MAAM,IAAI,gCAAc,CAAC,mDAAmD,CAAC,CAAC;QAC/E,CAAC;QAED,MAAM,IAAI,+BAAa,CAAC,+BAA+B,CAAC,CAAC;IAC1D,CAAC;CACD,CAAA;;+CAzUY,oCAAoC;IADhD,IAAA,YAAO,GAAE;qCAGiB,uBAAM,EACD,gEAAyB,EACf,+CAAqB,EACX,oCAA+B,EACvB,4CAAuC,EACzC,0CAAqC,EACnC,4CAAuC,EAC5D,qCAAgC,EACpC,mBAAc,EACf,kBAAa,EACN,4CAAoB,EACzB,kCAAe,EACV,0EAAkC,EAC1C,4BAAY,EACX,mFAAkC,EAClC,oEAA2B;GAjBhD,oCAAoC,CAyUhD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SharedWorkflowRepository, WorkflowRepository, type OperationContext, type WorkflowReviewRequest } from '@n8n/db';
|
|
2
|
+
type BlockedAction = 'submit' | 'review' | 'update';
|
|
3
|
+
export declare function assertWorkflowReviewRequestUpdatable(request: WorkflowReviewRequest): void;
|
|
4
|
+
export declare class WorkflowReviewRequestMutationGuard {
|
|
5
|
+
private readonly workflowRepository;
|
|
6
|
+
private readonly sharedWorkflowRepository;
|
|
7
|
+
constructor(workflowRepository: WorkflowRepository, sharedWorkflowRepository: SharedWorkflowRepository);
|
|
8
|
+
assertWorkflowStillReviewable(workflowId: string, expectedProjectId: string, ctx: OperationContext, action: BlockedAction): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
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.WorkflowReviewRequestMutationGuard = void 0;
|
|
13
|
+
exports.assertWorkflowReviewRequestUpdatable = assertWorkflowReviewRequestUpdatable;
|
|
14
|
+
const db_1 = require("@n8n/db");
|
|
15
|
+
const di_1 = require("@n8n/di");
|
|
16
|
+
const bad_request_error_1 = require("../../errors/response-errors/bad-request.error");
|
|
17
|
+
const conflict_error_1 = require("../../errors/response-errors/conflict.error");
|
|
18
|
+
const not_found_error_1 = require("../../errors/response-errors/not-found.error");
|
|
19
|
+
const BLOCKED_ACTION_TEXT = {
|
|
20
|
+
submit: 'submitted for review',
|
|
21
|
+
review: 'reviewed',
|
|
22
|
+
update: 'submitted as a new review version',
|
|
23
|
+
};
|
|
24
|
+
function assertWorkflowReviewRequestUpdatable(request) {
|
|
25
|
+
if (request.state === 'closed' || request.decision === 'approved') {
|
|
26
|
+
throw new conflict_error_1.ConflictError('The review request is no longer open');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
let WorkflowReviewRequestMutationGuard = class WorkflowReviewRequestMutationGuard {
|
|
30
|
+
constructor(workflowRepository, sharedWorkflowRepository) {
|
|
31
|
+
this.workflowRepository = workflowRepository;
|
|
32
|
+
this.sharedWorkflowRepository = sharedWorkflowRepository;
|
|
33
|
+
}
|
|
34
|
+
async assertWorkflowStillReviewable(workflowId, expectedProjectId, ctx, action) {
|
|
35
|
+
const blockedAction = BLOCKED_ACTION_TEXT[action];
|
|
36
|
+
const workflow = await this.workflowRepository.findArchivedState(workflowId, ctx);
|
|
37
|
+
if (!workflow) {
|
|
38
|
+
throw new not_found_error_1.NotFoundError('Could not find workflow');
|
|
39
|
+
}
|
|
40
|
+
if (workflow.isArchived) {
|
|
41
|
+
throw new bad_request_error_1.BadRequestError(`The workflow '${workflowId}' is archived and cannot be ${blockedAction}`);
|
|
42
|
+
}
|
|
43
|
+
const project = await this.sharedWorkflowRepository.getWorkflowOwningProject(workflowId, ctx);
|
|
44
|
+
if (!project) {
|
|
45
|
+
throw new not_found_error_1.NotFoundError('Could not find workflow');
|
|
46
|
+
}
|
|
47
|
+
if (project.id !== expectedProjectId) {
|
|
48
|
+
throw new conflict_error_1.ConflictError(`The workflow '${workflowId}' moved to another project and cannot be ${blockedAction} here`, 'Retry from the project that now owns the workflow');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
exports.WorkflowReviewRequestMutationGuard = WorkflowReviewRequestMutationGuard;
|
|
53
|
+
exports.WorkflowReviewRequestMutationGuard = WorkflowReviewRequestMutationGuard = __decorate([
|
|
54
|
+
(0, di_1.Service)(),
|
|
55
|
+
__metadata("design:paramtypes", [db_1.WorkflowRepository, db_1.SharedWorkflowRepository])
|
|
56
|
+
], WorkflowReviewRequestMutationGuard);
|
|
57
|
+
//# sourceMappingURL=workflow-review-request-mutation-guard.service.js.map
|
package/dist/modules/workflow-reviews.ee/workflow-review-request-mutation-guard.service.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-review-request-mutation-guard.service.js","sourceRoot":"","sources":["../../../src/modules/workflow-reviews.ee/workflow-review-request-mutation-guard.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,gCAKiB;AACjB,gCAAkC;AAElC,kFAA6E;AAC7E,4EAAwE;AACxE,8EAAyE;AAIzE,MAAM,mBAAmB,GAAkC;IAC1D,MAAM,EAAE,sBAAsB;IAC9B,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,mCAAmC;CAC3C,CAAC;AAEF,8CAAqD,OAA8B;IAClF,IAAI,OAAO,CAAC,KAAK,KAAK,QAAQ,IAAI,OAAO,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC;QACnE,MAAM,IAAI,8BAAa,CAAC,sCAAsC,CAAC,CAAC;IACjE,CAAC;AACF,CAAC;AAGM,IAAM,kCAAkC,GAAxC,MAAM,kCAAkC;IAC9C,YACkB,kBAAsC,EACtC,wBAAkD;kCADlD,kBAAkB;wCAClB,wBAAwB;IACvC,CAAC;IAGJ,KAAK,CAAC,6BAA6B,CAClC,UAAkB,EAClB,iBAAyB,EACzB,GAAqB,EACrB,MAAqB;QAErB,MAAM,aAAa,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;QAClD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QAClF,IAAI,CAAC,QAAQ,EAAE,CAAC;YACf,MAAM,IAAI,+BAAa,CAAC,yBAAyB,CAAC,CAAC;QACpD,CAAC;QAED,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC;YACzB,MAAM,IAAI,mCAAe,CACxB,iBAAiB,UAAU,+BAA+B,aAAa,EAAE,CACzE,CAAC;QACH,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,wBAAwB,CAAC,wBAAwB,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QAC9F,IAAI,CAAC,OAAO,EAAE,CAAC;YACd,MAAM,IAAI,+BAAa,CAAC,yBAAyB,CAAC,CAAC;QACpD,CAAC;QAED,IAAI,OAAO,CAAC,EAAE,KAAK,iBAAiB,EAAE,CAAC;YACtC,MAAM,IAAI,8BAAa,CACtB,iBAAiB,UAAU,4CAA4C,aAAa,OAAO,EAC3F,mDAAmD,CACnD,CAAC;QACH,CAAC;IACF,CAAC;CACD,CAAA;;6CArCY,kCAAkC;IAD9C,IAAA,YAAO,GAAE;qCAG6B,uBAAkB,EACZ,6BAAwB;GAHxD,kCAAkC,CAqC9C"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ListWorkflowReviewRequestsQueryDto, WorkflowReviewRequestList } from '@n8n/api-types';
|
|
2
|
+
import { UserRepository, WorkflowReviewRequestRepository, type User } from '@n8n/db';
|
|
3
|
+
import { WorkflowFinderService } from '../../workflows/workflow-finder.service';
|
|
4
|
+
import { WorkflowReviewAuthorizationService } from './workflow-review-authorization.service';
|
|
5
|
+
import { WorkflowReviewFeatureGate } from './workflow-review-feature-gate.service';
|
|
6
|
+
export declare class WorkflowReviewRequestStatusService {
|
|
7
|
+
private readonly featureGate;
|
|
8
|
+
private readonly workflowFinderService;
|
|
9
|
+
private readonly workflowReviewRequestRepository;
|
|
10
|
+
private readonly userRepository;
|
|
11
|
+
private readonly authorizationService;
|
|
12
|
+
constructor(featureGate: WorkflowReviewFeatureGate, workflowFinderService: WorkflowFinderService, workflowReviewRequestRepository: WorkflowReviewRequestRepository, userRepository: UserRepository, authorizationService: WorkflowReviewAuthorizationService);
|
|
13
|
+
list(user: User, query: ListWorkflowReviewRequestsQueryDto): Promise<WorkflowReviewRequestList>;
|
|
14
|
+
private toWorkflowScopedItems;
|
|
15
|
+
private resolveDecisionActors;
|
|
16
|
+
private pickDecisionActor;
|
|
17
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
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.WorkflowReviewRequestStatusService = void 0;
|
|
13
|
+
const db_1 = require("@n8n/db");
|
|
14
|
+
const di_1 = require("@n8n/di");
|
|
15
|
+
const not_found_error_1 = require("../../errors/response-errors/not-found.error");
|
|
16
|
+
const workflow_finder_service_1 = require("../../workflows/workflow-finder.service");
|
|
17
|
+
const workflow_review_authorization_service_1 = require("./workflow-review-authorization.service");
|
|
18
|
+
const workflow_review_feature_gate_service_1 = require("./workflow-review-feature-gate.service");
|
|
19
|
+
const workflow_review_mapper_1 = require("./workflow-review.mapper");
|
|
20
|
+
let WorkflowReviewRequestStatusService = class WorkflowReviewRequestStatusService {
|
|
21
|
+
constructor(featureGate, workflowFinderService, workflowReviewRequestRepository, userRepository, authorizationService) {
|
|
22
|
+
this.featureGate = featureGate;
|
|
23
|
+
this.workflowFinderService = workflowFinderService;
|
|
24
|
+
this.workflowReviewRequestRepository = workflowReviewRequestRepository;
|
|
25
|
+
this.userRepository = userRepository;
|
|
26
|
+
this.authorizationService = authorizationService;
|
|
27
|
+
}
|
|
28
|
+
async list(user, query) {
|
|
29
|
+
await this.featureGate.assertAvailable();
|
|
30
|
+
const workflow = await this.workflowFinderService.findWorkflowForUser(query.workflowId, user, [
|
|
31
|
+
'workflow:read',
|
|
32
|
+
]);
|
|
33
|
+
if (!workflow) {
|
|
34
|
+
throw new not_found_error_1.NotFoundError('Could not find workflow');
|
|
35
|
+
}
|
|
36
|
+
const [[requests, count], canPublish] = await Promise.all([
|
|
37
|
+
this.workflowReviewRequestRepository.findRequestsForWorkflow(query.workflowId, {
|
|
38
|
+
state: query.state,
|
|
39
|
+
skip: query.skip,
|
|
40
|
+
take: query.take,
|
|
41
|
+
}),
|
|
42
|
+
this.workflowFinderService
|
|
43
|
+
.findWorkflowForUser(query.workflowId, user, ['workflow:publish'])
|
|
44
|
+
.then((found) => found !== null),
|
|
45
|
+
]);
|
|
46
|
+
return {
|
|
47
|
+
count,
|
|
48
|
+
data: await this.toWorkflowScopedItems(requests, canPublish, user),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
async toWorkflowScopedItems(requests, canPublish, user) {
|
|
52
|
+
const [decisionActors, openableIds] = await Promise.all([
|
|
53
|
+
this.resolveDecisionActors(requests),
|
|
54
|
+
this.authorizationService.resolveOpenableRequestIds(user, requests),
|
|
55
|
+
]);
|
|
56
|
+
return requests.map((request) => ({
|
|
57
|
+
id: request.id,
|
|
58
|
+
state: request.state,
|
|
59
|
+
decision: request.decision,
|
|
60
|
+
description: canPublish ? request.description : null,
|
|
61
|
+
workflowVersionId: request.workflowVersionId,
|
|
62
|
+
workflowVersionName: request.workflowVersionName,
|
|
63
|
+
createdAt: request.createdAt.toISOString(),
|
|
64
|
+
updatedAt: request.updatedAt.toISOString(),
|
|
65
|
+
decisionBy: this.pickDecisionActor(request, decisionActors),
|
|
66
|
+
viewerCanOpen: openableIds.has(request.id),
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
async resolveDecisionActors(requests) {
|
|
70
|
+
const actorIds = [
|
|
71
|
+
...new Set(requests.flatMap((request) => request.decision === 'changes_requested' && request.updatedById
|
|
72
|
+
? [request.updatedById]
|
|
73
|
+
: [])),
|
|
74
|
+
];
|
|
75
|
+
if (actorIds.length === 0) {
|
|
76
|
+
return new Map();
|
|
77
|
+
}
|
|
78
|
+
const actors = await this.userRepository.findManyByIds(actorIds);
|
|
79
|
+
return new Map(actors.map((actor) => [actor.id, (0, workflow_review_mapper_1.toEligibleReviewer)(actor)]));
|
|
80
|
+
}
|
|
81
|
+
pickDecisionActor(request, actors) {
|
|
82
|
+
if (request.decision !== 'changes_requested' || !request.updatedById) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
return actors.get(request.updatedById) ?? null;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
exports.WorkflowReviewRequestStatusService = WorkflowReviewRequestStatusService;
|
|
89
|
+
exports.WorkflowReviewRequestStatusService = WorkflowReviewRequestStatusService = __decorate([
|
|
90
|
+
(0, di_1.Service)(),
|
|
91
|
+
__metadata("design:paramtypes", [workflow_review_feature_gate_service_1.WorkflowReviewFeatureGate, workflow_finder_service_1.WorkflowFinderService, db_1.WorkflowReviewRequestRepository, db_1.UserRepository, workflow_review_authorization_service_1.WorkflowReviewAuthorizationService])
|
|
92
|
+
], WorkflowReviewRequestStatusService);
|
|
93
|
+
//# sourceMappingURL=workflow-review-request-status.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-review-request-status.service.js","sourceRoot":"","sources":["../../../src/modules/workflow-reviews.ee/workflow-review-request-status.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA,gCAKiB;AACjB,gCAAk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ACD;SACD,CAAC;QACF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO,IAAI,GAAG,EAAE,CAAC;QAClB,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QACjE,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,IAAA,2CAAkB,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC;IAEO,iBAAiB,CACxB,OAA4C,EAC5C,MAAmD;QAEnD,IAAI,OAAO,CAAC,QAAQ,KAAK,mBAAmB,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YACtE,OAAO,IAAI,CAAC;QACb,CAAC;QAED,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC;IAChD,CAAC;CACD,CAAA;;6CA7FY,kCAAkC;IAD9C,IAAA,YAAO,GAAE;qCAGsB,gEAAyB,EACf,+CAAqB,EACX,oCAA+B,EAChD,mBAAc,EACR,0EAAkC;GAN9D,kCAAkC,CA6F9C"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { CreateWorkflowReviewRequestDto, GetWorkflowReviewEligibleReviewersQueryDto, UpdateWorkflowReviewRequestVersionDto, WorkflowReviewEligibleReviewersList, WorkflowReviewRequestSummary } from '@n8n/api-types';
|
|
2
|
+
import { DbLockService, SharedWorkflowRepository, UserRepository, WorkflowHistoryRepository, WorkflowReviewRequestAuthorRepository, WorkflowReviewRequestRepository, WorkflowReviewActivityRepository, WorkflowReviewRequestReviewerRepository, WorkflowReviewRequestWorkflowRepository, type User } from '@n8n/db';
|
|
3
|
+
import { EventService } from '../../events/event.service';
|
|
4
|
+
import { RoleService } from '../../services/role.service';
|
|
5
|
+
import { WorkflowFinderService } from '../../workflows/workflow-finder.service';
|
|
6
|
+
import { WorkflowHistoryService } from '../../workflows/workflow-history/workflow-history.service';
|
|
7
|
+
import { WorkflowReviewFeatureGate } from './workflow-review-feature-gate.service';
|
|
8
|
+
import { WorkflowReviewRequestMutationGuard } from './workflow-review-request-mutation-guard.service';
|
|
9
|
+
import { WorkflowReviewStateNotifier } from './workflow-review-state-notifier.service';
|
|
10
|
+
export declare class WorkflowReviewRequestSubmissionService {
|
|
11
|
+
private readonly featureGate;
|
|
12
|
+
private readonly workflowFinderService;
|
|
13
|
+
private readonly workflowHistoryService;
|
|
14
|
+
private readonly workflowHistoryRepository;
|
|
15
|
+
private readonly sharedWorkflowRepository;
|
|
16
|
+
private readonly workflowReviewRequestRepository;
|
|
17
|
+
private readonly workflowReviewRequestWorkflowRepository;
|
|
18
|
+
private readonly workflowReviewRequestAuthorRepository;
|
|
19
|
+
private readonly workflowReviewRequestReviewerRepository;
|
|
20
|
+
private readonly activityRepository;
|
|
21
|
+
private readonly userRepository;
|
|
22
|
+
private readonly roleService;
|
|
23
|
+
private readonly dbLockService;
|
|
24
|
+
private readonly eventService;
|
|
25
|
+
private readonly mutationGuard;
|
|
26
|
+
private readonly stateNotifier;
|
|
27
|
+
constructor(featureGate: WorkflowReviewFeatureGate, workflowFinderService: WorkflowFinderService, workflowHistoryService: WorkflowHistoryService, workflowHistoryRepository: WorkflowHistoryRepository, sharedWorkflowRepository: SharedWorkflowRepository, workflowReviewRequestRepository: WorkflowReviewRequestRepository, workflowReviewRequestWorkflowRepository: WorkflowReviewRequestWorkflowRepository, workflowReviewRequestAuthorRepository: WorkflowReviewRequestAuthorRepository, workflowReviewRequestReviewerRepository: WorkflowReviewRequestReviewerRepository, activityRepository: WorkflowReviewActivityRepository, userRepository: UserRepository, roleService: RoleService, dbLockService: DbLockService, eventService: EventService, mutationGuard: WorkflowReviewRequestMutationGuard, stateNotifier: WorkflowReviewStateNotifier);
|
|
28
|
+
private findEligibleReviewers;
|
|
29
|
+
getEligibleReviewers(user: User, query: GetWorkflowReviewEligibleReviewersQueryDto): Promise<WorkflowReviewEligibleReviewersList>;
|
|
30
|
+
private nameVersion;
|
|
31
|
+
private updateVersionMetadataIfChanged;
|
|
32
|
+
create(user: User, dto: CreateWorkflowReviewRequestDto): Promise<WorkflowReviewRequestSummary>;
|
|
33
|
+
updateVersion(user: User, workflowReviewRequestId: string, dto: UpdateWorkflowReviewRequestVersionDto): Promise<WorkflowReviewRequestSummary>;
|
|
34
|
+
}
|