n8n 2.40.5 → 2.41.1
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/build.tsbuildinfo +1 -1
- package/dist/commands/import/credentials.js +12 -3
- package/dist/commands/import/credentials.js.map +1 -1
- package/dist/commands/import/workflow.js +4 -4
- package/dist/commands/import/workflow.js.map +1 -1
- package/dist/commands/start.js +5 -2
- package/dist/commands/start.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -1
- package/dist/constants.js.map +1 -1
- package/dist/controllers/ai-preference.controller.js +1 -1
- package/dist/controllers/ai-preference.controller.js.map +1 -1
- package/dist/controllers/ai.controller.d.ts +1 -0
- package/dist/controllers/dev.controller.d.ts +8 -0
- package/dist/controllers/dev.controller.js +35 -0
- package/dist/controllers/dev.controller.js.map +1 -0
- package/dist/controllers/me.controller.d.ts +2 -4
- package/dist/controllers/me.controller.js +9 -24
- package/dist/controllers/me.controller.js.map +1 -1
- package/dist/controllers/role.controller.js +1 -0
- package/dist/controllers/role.controller.js.map +1 -1
- package/dist/crash-journal.js +1 -1
- package/dist/crash-journal.js.map +1 -1
- package/dist/credentials/credential-dependency.service.d.ts +2 -2
- package/dist/credentials/credential-dependency.service.js +5 -4
- package/dist/credentials/credential-dependency.service.js.map +1 -1
- package/dist/credentials/credentials-finder.service.d.ts +1 -0
- package/dist/credentials/credentials.controller.d.ts +4 -0
- package/dist/credentials/credentials.controller.js +5 -0
- package/dist/credentials/credentials.controller.js.map +1 -1
- package/dist/credentials/credentials.service.d.ts +16 -3
- package/dist/credentials/credentials.service.ee.d.ts +2 -0
- package/dist/credentials/credentials.service.js +112 -30
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/credentials/validation.d.ts +1 -0
- package/dist/credentials/validation.js +11 -0
- package/dist/credentials/validation.js.map +1 -1
- package/dist/credentials-helper.d.ts +3 -2
- package/dist/credentials-helper.js +39 -19
- package/dist/credentials-helper.js.map +1 -1
- package/dist/credentials-overwrites.js +2 -0
- package/dist/credentials-overwrites.js.map +1 -1
- package/dist/errors/response-errors/incompatible-nodes-api-version.error.d.ts +11 -0
- package/dist/errors/response-errors/incompatible-nodes-api-version.error.js +13 -0
- package/dist/errors/response-errors/incompatible-nodes-api-version.error.js.map +1 -0
- package/dist/errors/unsupported-end-user-credential-trigger.error.d.ts +4 -0
- package/dist/errors/unsupported-end-user-credential-trigger.error.js +13 -0
- package/dist/errors/unsupported-end-user-credential-trigger.error.js.map +1 -0
- package/dist/eventbus/event-message-classes/abstract-event-message.d.ts +1 -1
- package/dist/eventbus/event-message-classes/abstract-event-message.js +8 -0
- package/dist/eventbus/event-message-classes/abstract-event-message.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-ai-node.d.ts +0 -2
- package/dist/eventbus/event-message-classes/event-message-ai-node.js +0 -8
- package/dist/eventbus/event-message-classes/event-message-ai-node.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-audit.d.ts +1 -2
- package/dist/eventbus/event-message-classes/event-message-audit.js +0 -8
- package/dist/eventbus/event-message-classes/event-message-audit.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-execution.d.ts +0 -2
- package/dist/eventbus/event-message-classes/event-message-execution.js +0 -8
- package/dist/eventbus/event-message-classes/event-message-execution.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-generic.d.ts +0 -2
- package/dist/eventbus/event-message-classes/event-message-generic.js +0 -8
- package/dist/eventbus/event-message-classes/event-message-generic.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-mcp.d.ts +0 -2
- package/dist/eventbus/event-message-classes/event-message-mcp.js +0 -8
- package/dist/eventbus/event-message-classes/event-message-mcp.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-node.d.ts +0 -2
- package/dist/eventbus/event-message-classes/event-message-node.js +0 -8
- package/dist/eventbus/event-message-classes/event-message-node.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-queue.d.ts +0 -2
- package/dist/eventbus/event-message-classes/event-message-queue.js +0 -8
- package/dist/eventbus/event-message-classes/event-message-queue.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-runner.d.ts +0 -2
- package/dist/eventbus/event-message-classes/event-message-runner.js +0 -8
- package/dist/eventbus/event-message-classes/event-message-runner.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-workflow.d.ts +1 -2
- package/dist/eventbus/event-message-classes/event-message-workflow.js +0 -8
- package/dist/eventbus/event-message-classes/event-message-workflow.js.map +1 -1
- package/dist/events/event.service.d.ts +3 -2
- package/dist/events/event.service.js.map +1 -1
- package/dist/events/maps/mcp-post-save-metrics.event-map.d.ts +7 -0
- package/dist/events/maps/mcp-post-save-metrics.event-map.js +3 -0
- package/dist/events/maps/mcp-post-save-metrics.event-map.js.map +1 -0
- package/dist/events/maps/relay.event-map.d.ts +3 -0
- package/dist/events/maps/system-task-metrics.event-map.d.ts +45 -0
- package/dist/events/maps/system-task-metrics.event-map.js +3 -0
- package/dist/events/maps/system-task-metrics.event-map.js.map +1 -0
- package/dist/events/relays/activity.event-relay.d.ts +9 -3
- package/dist/events/relays/activity.event-relay.js +33 -4
- package/dist/events/relays/activity.event-relay.js.map +1 -1
- package/dist/events/relays/telemetry.event-relay.js +34 -14
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js +10 -6
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
- package/dist/execution-lifecycle/shared/shared-hook-functions.d.ts +1 -1
- package/dist/execution-lifecycle/shared/shared-hook-functions.js +2 -1
- package/dist/execution-lifecycle/shared/shared-hook-functions.js.map +1 -1
- package/dist/executions/engine-v2-execution-reader.service.d.ts +26 -0
- package/dist/executions/engine-v2-execution-reader.service.js +58 -13
- package/dist/executions/engine-v2-execution-reader.service.js.map +1 -1
- package/dist/executions/engine-v2-mapping.d.ts +5 -0
- package/dist/executions/engine-v2-mapping.js +30 -0
- package/dist/executions/engine-v2-mapping.js.map +1 -0
- package/dist/executions/execution-cursor.d.ts +51 -0
- package/dist/executions/execution-cursor.js +39 -0
- package/dist/executions/execution-cursor.js.map +1 -0
- package/dist/executions/execution-id.js +2 -2
- package/dist/executions/execution-id.js.map +1 -1
- package/dist/executions/execution-list-v1.service.d.ts +27 -0
- package/dist/executions/execution-list-v1.service.js +98 -0
- package/dist/executions/execution-list-v1.service.js.map +1 -0
- package/dist/executions/execution-list-v2.service.d.ts +25 -0
- package/dist/executions/execution-list-v2.service.js +168 -0
- package/dist/executions/execution-list-v2.service.js.map +1 -0
- package/dist/executions/execution-list.service.d.ts +19 -0
- package/dist/executions/execution-list.service.js +67 -0
- package/dist/executions/execution-list.service.js.map +1 -0
- package/dist/executions/execution-recovery.service.d.ts +1 -2
- package/dist/executions/execution-recovery.service.js +1 -2
- package/dist/executions/execution-recovery.service.js.map +1 -1
- package/dist/executions/execution.service.d.ts +1 -34
- package/dist/executions/execution.service.js +4 -73
- package/dist/executions/execution.service.js.map +1 -1
- package/dist/executions/execution.types.d.ts +4 -2
- package/dist/executions/executions.controller.d.ts +4 -1
- package/dist/executions/executions.controller.js +12 -23
- package/dist/executions/executions.controller.js.map +1 -1
- package/dist/executions/merge-execution-pages.d.ts +10 -0
- package/dist/executions/merge-execution-pages.js +30 -0
- package/dist/executions/merge-execution-pages.js.map +1 -0
- package/dist/executions/parse-range-query.middleware.d.ts +2 -3
- package/dist/executions/parse-range-query.middleware.js +27 -21
- package/dist/executions/parse-range-query.middleware.js.map +1 -1
- package/dist/external-hooks.d.ts +6 -2
- package/dist/load-nodes-and-credentials.d.ts +3 -0
- package/dist/load-nodes-and-credentials.js +37 -15
- package/dist/load-nodes-and-credentials.js.map +1 -1
- package/dist/metrics/prometheus/constant.d.ts +1 -0
- package/dist/metrics/prometheus/constant.js +4 -1
- package/dist/metrics/prometheus/constant.js.map +1 -1
- package/dist/metrics/prometheus/mcp-post-save-metrics.service.d.ts +10 -0
- package/dist/metrics/prometheus/mcp-post-save-metrics.service.js +44 -0
- package/dist/metrics/prometheus/mcp-post-save-metrics.service.js.map +1 -0
- package/dist/metrics/prometheus/prometheus.service.d.ts +3 -1
- package/dist/metrics/prometheus/prometheus.service.js +6 -2
- package/dist/metrics/prometheus/prometheus.service.js.map +1 -1
- package/dist/metrics/prometheus/system-task-metrics.service.d.ts +12 -0
- package/dist/metrics/prometheus/system-task-metrics.service.js +157 -0
- package/dist/metrics/prometheus/system-task-metrics.service.js.map +1 -0
- package/dist/middlewares/list-query/dtos/credentials.select.dto.js +1 -0
- package/dist/middlewares/list-query/dtos/credentials.select.dto.js.map +1 -1
- package/dist/modules/agents/adapters/agents-credential-provider.d.ts +2 -1
- package/dist/modules/agents/adapters/agents-credential-provider.js +3 -1
- package/dist/modules/agents/adapters/agents-credential-provider.js.map +1 -1
- package/dist/modules/agents/agent-chat.controller.js +32 -37
- package/dist/modules/agents/agent-chat.controller.js.map +1 -1
- package/dist/modules/agents/agent-config.service.js +1 -1
- package/dist/modules/agents/agent-config.service.js.map +1 -1
- package/dist/modules/agents/agent-conversation-state.service.d.ts +12 -0
- package/dist/modules/agents/agent-conversation-state.service.js +34 -0
- package/dist/modules/agents/agent-conversation-state.service.js.map +1 -0
- package/dist/modules/agents/agent-custom-tools.service.js +2 -2
- package/dist/modules/agents/agent-custom-tools.service.js.map +1 -1
- package/dist/modules/agents/agent-execution-orchestrator.service.d.ts +13 -6
- package/dist/modules/agents/agent-execution-orchestrator.service.js +284 -417
- package/dist/modules/agents/agent-execution-orchestrator.service.js.map +1 -1
- package/dist/modules/agents/agent-execution-recording.error.d.ts +21 -0
- package/dist/modules/agents/agent-execution-recording.error.js +17 -0
- package/dist/modules/agents/agent-execution-recording.error.js.map +1 -0
- package/dist/modules/agents/agent-execution.service.d.ts +1 -1
- package/dist/modules/agents/agent-execution.service.js +51 -20
- package/dist/modules/agents/agent-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-integration-management.service.d.ts +5 -3
- package/dist/modules/agents/agent-integration-management.service.js +9 -6
- package/dist/modules/agents/agent-integration-management.service.js.map +1 -1
- package/dist/modules/agents/agent-integrations.controller.d.ts +1 -3
- package/dist/modules/agents/agent-integrations.controller.js +4 -6
- package/dist/modules/agents/agent-integrations.controller.js.map +1 -1
- package/dist/modules/agents/agent-message-mapper.d.ts +1 -1
- package/dist/modules/agents/agent-message-mapper.js +3 -0
- package/dist/modules/agents/agent-message-mapper.js.map +1 -1
- package/dist/modules/agents/agent-modification-telemetry.service.d.ts +2 -2
- package/dist/modules/agents/agent-modification-telemetry.service.js.map +1 -1
- package/dist/modules/agents/agent-publish.service.js +5 -5
- package/dist/modules/agents/agent-publish.service.js.map +1 -1
- package/dist/modules/agents/agent-runnable-state.service.js +1 -1
- package/dist/modules/agents/agent-runnable-state.service.js.map +1 -1
- package/dist/modules/agents/agent-runtime-cache.service.js +1 -1
- package/dist/modules/agents/agent-runtime-cache.service.js.map +1 -1
- package/dist/modules/agents/agent-runtime-reconstruction.service.js +1 -1
- package/dist/modules/agents/agent-runtime-reconstruction.service.js.map +1 -1
- package/dist/modules/agents/agent-skills.service.js +3 -3
- package/dist/modules/agents/agent-skills.service.js.map +1 -1
- package/dist/modules/agents/agent-sse-stream.d.ts +4 -1
- package/dist/modules/agents/agent-sse-stream.js +46 -33
- package/dist/modules/agents/agent-sse-stream.js.map +1 -1
- package/dist/modules/agents/agent-task.service.js +3 -3
- package/dist/modules/agents/agent-task.service.js.map +1 -1
- package/dist/modules/agents/agent-test-run.service.d.ts +24 -41
- package/dist/modules/agents/agent-test-run.service.js +83 -59
- package/dist/modules/agents/agent-test-run.service.js.map +1 -1
- package/dist/modules/agents/agent-turn-execution.service.d.ts +49 -0
- package/dist/modules/agents/agent-turn-execution.service.js +212 -0
- package/dist/modules/agents/agent-turn-execution.service.js.map +1 -0
- package/dist/modules/agents/agent-workflow-execution.service.d.ts +6 -3
- package/dist/modules/agents/agent-workflow-execution.service.js +77 -105
- package/dist/modules/agents/agent-workflow-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-workflow-tool-resume.service.d.ts +0 -1
- package/dist/modules/agents/agent-workflow-tool-resume.service.js +46 -20
- package/dist/modules/agents/agent-workflow-tool-resume.service.js.map +1 -1
- package/dist/modules/agents/agents-config.controller.js +1 -1
- package/dist/modules/agents/agents-config.controller.js.map +1 -1
- package/dist/modules/agents/background/agent-wake.service.d.ts +3 -5
- package/dist/modules/agents/background/agent-wake.service.js +6 -10
- package/dist/modules/agents/background/agent-wake.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-prompts.d.ts +1 -1
- package/dist/modules/agents/builder/agents-builder-prompts.js +21 -0
- package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -1
- package/dist/modules/agents/builder/get-resource-locator-options.tool.d.ts +2 -2
- package/dist/modules/agents/builder/skills/external-services.skill.js +4 -1
- package/dist/modules/agents/builder/skills/external-services.skill.js.map +1 -1
- package/dist/modules/agents/entities/agent-checkpoint.entity.d.ts +1 -0
- package/dist/modules/agents/entities/agent-checkpoint.entity.js +10 -1
- package/dist/modules/agents/entities/agent-checkpoint.entity.js.map +1 -1
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.d.ts +1 -1
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.js +3 -3
- package/dist/modules/agents/instance-ai-builder-delegate.adapter.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +11 -24
- package/dist/modules/agents/integrations/agent-chat-bridge.js +58 -28
- package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.d.ts +5 -12
- package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js +8 -3
- package/dist/modules/agents/integrations/agent-chat-hitl-resume-handler.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-integration.d.ts +2 -1
- package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-message-context.d.ts +4 -4
- package/dist/modules/agents/integrations/agent-chat-message-context.js +4 -37
- package/dist/modules/agents/integrations/agent-chat-message-context.js.map +1 -1
- package/dist/modules/agents/integrations/integration-message-context.d.ts +7 -0
- package/dist/modules/agents/integrations/integration-message-context.js +115 -0
- package/dist/modules/agents/integrations/integration-message-context.js.map +1 -0
- package/dist/modules/agents/integrations/integration-message-context.service.d.ts +8 -3
- package/dist/modules/agents/integrations/integration-message-context.service.js +36 -58
- package/dist/modules/agents/integrations/integration-message-context.service.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-definitions.js +1 -1
- package/dist/modules/agents/integrations/integration-tool-definitions.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-execution.d.ts +0 -1
- package/dist/modules/agents/integrations/integration-tool-execution.js +19 -42
- package/dist/modules/agents/integrations/integration-tool-execution.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-factory.d.ts +0 -1
- package/dist/modules/agents/integrations/integration-tool-factory.js +1 -3
- package/dist/modules/agents/integrations/integration-tool-factory.js.map +1 -1
- package/dist/modules/agents/integrations/integration-tool-types.d.ts +13 -0
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.js +4 -2
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/telegram-bridge-behavior.d.ts +2 -0
- package/dist/modules/agents/integrations/platforms/telegram-bridge-behavior.js +40 -0
- package/dist/modules/agents/integrations/platforms/telegram-bridge-behavior.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/telegram-integration.d.ts +1 -0
- package/dist/modules/agents/integrations/platforms/telegram-integration.js +4 -0
- package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -1
- package/dist/modules/agents/repositories/agent-checkpoint.repository.d.ts +1 -1
- package/dist/modules/agents/repositories/agent-checkpoint.repository.js +2 -2
- package/dist/modules/agents/repositories/agent-checkpoint.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-execution.repository.d.ts +2 -1
- package/dist/modules/agents/repositories/agent-execution.repository.js +7 -4
- package/dist/modules/agents/repositories/agent-execution.repository.js.map +1 -1
- package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js +3 -0
- package/dist/modules/agents/sub-agents/delegate-sub-agent-tool.js.map +1 -1
- package/dist/modules/agents/sub-agents/sub-agent-runner.d.ts +3 -4
- package/dist/modules/agents/sub-agents/sub-agent-runner.js +95 -151
- package/dist/modules/agents/sub-agents/sub-agent-runner.js.map +1 -1
- package/dist/modules/agents/tools/workflow-tool-factory.js +1 -1
- package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -1
- package/dist/modules/agents/utils/agent-credential-provider.d.ts +1 -1
- package/dist/modules/agents/utils/agent-credential-provider.js +2 -2
- package/dist/modules/agents/utils/agent-credential-provider.js.map +1 -1
- package/dist/modules/agents/utils/execution-to-message-mapper.d.ts +1 -1
- package/dist/modules/agents/utils/execution-to-message-mapper.js +3 -0
- package/dist/modules/agents/utils/execution-to-message-mapper.js.map +1 -1
- package/dist/modules/agents/utils/mcp-attribution.js +3 -1
- package/dist/modules/agents/utils/mcp-attribution.js.map +1 -1
- package/dist/modules/breaking-changes/breaking-changes.migration-registry.service.d.ts +2 -2
- package/dist/modules/breaking-changes/breaking-changes.migration-registry.service.js.map +1 -1
- package/dist/modules/breaking-changes/breaking-changes.migration.service.d.ts +4 -11
- package/dist/modules/breaking-changes/breaking-changes.migration.service.js +52 -28
- package/dist/modules/breaking-changes/breaking-changes.migration.service.js.map +1 -1
- package/dist/modules/breaking-changes/detection-report.d.ts +5 -0
- package/dist/modules/breaking-changes/detection-report.js +18 -0
- package/dist/modules/breaking-changes/detection-report.js.map +1 -0
- package/dist/modules/breaking-changes/migrations/execute-workflow-each-to-loop.migration.d.ts +2 -0
- package/dist/modules/breaking-changes/migrations/execute-workflow-each-to-loop.migration.js +159 -0
- package/dist/modules/breaking-changes/migrations/execute-workflow-each-to-loop.migration.js.map +1 -0
- package/dist/modules/breaking-changes/migrations/index.d.ts +2 -2
- package/dist/modules/breaking-changes/migrations/index.js +2 -1
- package/dist/modules/breaking-changes/migrations/index.js.map +1 -1
- package/dist/modules/breaking-changes/migrations/node-migration.d.ts +30 -1
- package/dist/modules/breaking-changes/migrations/node-migration.js +12 -0
- package/dist/modules/breaking-changes/migrations/node-migration.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/oauth-callback-auth.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v2/oauth-callback-auth.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/pyodide-removed.rule.js +6 -12
- package/dist/modules/breaking-changes/rules/v2/pyodide-removed.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/agent-node-version.rule.js +6 -12
- package/dist/modules/breaking-changes/rules/v3/agent-node-version.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/agent-removed-modes.rule.js +7 -13
- package/dist/modules/breaking-changes/rules/v3/agent-removed-modes.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/ai-transform-deprecated.rule.js +6 -12
- package/dist/modules/breaking-changes/rules/v3/ai-transform-deprecated.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/always-output-data-multi-output.rule.js +6 -13
- package/dist/modules/breaking-changes/rules/v3/always-output-data-multi-output.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/caller-policy-default-any.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/caller-policy-default-any.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/chat-hub-deprecated.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/chat-hub-deprecated.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/chat-trigger-embedded-json.rule.js +6 -12
- package/dist/modules/breaking-changes/rules/v3/chat-trigger-embedded-json.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/compression-node-limits.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/compression-node-limits.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/docker-only-deployment.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/docker-only-deployment.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/execute-workflow-each-mode.rule.js +6 -12
- package/dist/modules/breaking-changes/rules/v3/execute-workflow-each-mode.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/execute-workflow-source-modes.rule.js +6 -12
- package/dist/modules/breaking-changes/rules/v3/execute-workflow-source-modes.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/external-secrets-project-roles-default.rule.js +3 -2
- package/dist/modules/breaking-changes/rules/v3/external-secrets-project-roles-default.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/get-paired-item.rule.js +6 -12
- package/dist/modules/breaking-changes/rules/v3/get-paired-item.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/gmail-trigger-version.rule.js +6 -12
- package/dist/modules/breaking-changes/rules/v3/gmail-trigger-version.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/in-memory-binary-data.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/in-memory-binary-data.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/offload-manual-executions.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/offload-manual-executions.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/pre-execute-error-creates-execution.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/pre-execute-error-creates-execution.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/ssrf-default-blocked-ranges.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/ssrf-default-blocked-ranges.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/task-runner-task-timeout.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/task-runner-task-timeout.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v3/unverified-packages.rule.js +2 -1
- package/dist/modules/breaking-changes/rules/v3/unverified-packages.rule.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-workflow.service.d.ts +1 -0
- package/dist/modules/chat-hub/chat-hub-workflow.service.js +7 -2
- package/dist/modules/chat-hub/chat-hub-workflow.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.attachment.service.js +3 -1
- package/dist/modules/chat-hub/chat-hub.attachment.service.js.map +1 -1
- package/dist/modules/community-packages/community-node-types-utils.d.ts +2 -2
- package/dist/modules/community-packages/community-node-types-utils.js +4 -2
- package/dist/modules/community-packages/community-node-types-utils.js.map +1 -1
- package/dist/modules/community-packages/community-node-types.service.d.ts +1 -0
- package/dist/modules/community-packages/community-node-types.service.js +12 -6
- package/dist/modules/community-packages/community-node-types.service.js.map +1 -1
- package/dist/modules/community-packages/community-packages.config.d.ts +1 -0
- package/dist/modules/community-packages/community-packages.config.js +2 -0
- package/dist/modules/community-packages/community-packages.config.js.map +1 -1
- package/dist/modules/community-packages/community-packages.lifecycle.service.d.ts +2 -1
- package/dist/modules/community-packages/community-packages.lifecycle.service.js +23 -18
- package/dist/modules/community-packages/community-packages.lifecycle.service.js.map +1 -1
- package/dist/modules/community-packages/community-packages.service.d.ts +1 -0
- package/dist/modules/community-packages/community-packages.service.js +33 -2
- package/dist/modules/community-packages/community-packages.service.js.map +1 -1
- package/dist/modules/engine-v2/engine-data-plane-client.d.ts +2 -1
- package/dist/modules/engine-v2/engine-data-plane-client.js +14 -0
- package/dist/modules/engine-v2/engine-data-plane-client.js.map +1 -1
- package/dist/modules/engine-v2/engine-v2.module.d.ts +1 -0
- package/dist/modules/engine-v2/engine-v2.module.js +11 -2
- package/dist/modules/engine-v2/engine-v2.module.js.map +1 -1
- package/dist/modules/engine-v2/engine-v2.runtime.d.ts +11 -2
- package/dist/modules/engine-v2/engine-v2.runtime.js +29 -11
- package/dist/modules/engine-v2/engine-v2.runtime.js.map +1 -1
- package/dist/modules/external-secrets.ee/constants.d.ts +0 -1
- package/dist/modules/external-secrets.ee/constants.js +1 -2
- package/dist/modules/external-secrets.ee/constants.js.map +1 -1
- package/dist/modules/external-secrets.ee/external-secrets-provider-connection-manager.ee.d.ts +1 -2
- package/dist/modules/external-secrets.ee/external-secrets-provider-connection-manager.ee.js +28 -29
- package/dist/modules/external-secrets.ee/external-secrets-provider-connection-manager.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/external-secrets.config.d.ts +2 -0
- package/dist/modules/external-secrets.ee/external-secrets.config.js +12 -0
- package/dist/modules/external-secrets.ee/external-secrets.config.js.map +1 -1
- package/dist/modules/external-secrets.ee/provider-lifecycle.service.js +1 -1
- package/dist/modules/external-secrets.ee/provider-lifecycle.service.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/infisical.js +6 -2
- package/dist/modules/external-secrets.ee/providers/infisical.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/vault.d.ts +1 -0
- package/dist/modules/external-secrets.ee/providers/vault.js +43 -13
- package/dist/modules/external-secrets.ee/providers/vault.js.map +1 -1
- package/dist/modules/external-secrets.ee/retry-manager.service.js +9 -1
- package/dist/modules/external-secrets.ee/retry-manager.service.js.map +1 -1
- package/dist/modules/external-secrets.ee/secrets-cache.service.d.ts +5 -2
- package/dist/modules/external-secrets.ee/secrets-cache.service.js +23 -20
- package/dist/modules/external-secrets.ee/secrets-cache.service.js.map +1 -1
- package/dist/modules/external-secrets.ee/types.d.ts +1 -0
- package/dist/modules/external-secrets.ee/types.js +7 -1
- package/dist/modules/external-secrets.ee/types.js.map +1 -1
- package/dist/modules/external-secrets.ee/with-timeout.d.ts +4 -0
- package/dist/modules/external-secrets.ee/with-timeout.js +21 -0
- package/dist/modules/external-secrets.ee/with-timeout.js.map +1 -0
- package/dist/modules/insights/database/repositories/insights-by-period.repository.d.ts +3 -2
- package/dist/modules/insights/database/repositories/insights-by-period.repository.js +4 -3
- package/dist/modules/insights/database/repositories/insights-by-period.repository.js.map +1 -1
- package/dist/modules/insights/insights-collection.service.js +10 -2
- package/dist/modules/insights/insights-collection.service.js.map +1 -1
- package/dist/modules/insights/insights.module.d.ts +1 -1
- package/dist/modules/instance-ai/computer-use-availability.d.ts +14 -0
- package/dist/modules/instance-ai/computer-use-availability.js +42 -0
- package/dist/modules/instance-ai/computer-use-availability.js.map +1 -0
- package/dist/modules/instance-ai/eval/agent-execution.service.js +1 -1
- package/dist/modules/instance-ai/eval/agent-execution.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.d.ts +4 -2
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.js +17 -3
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.js.map +1 -1
- package/dist/modules/instance-ai/eval/execution.service.js +14 -4
- package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/thread-restore.service.d.ts +9 -3
- package/dist/modules/instance-ai/eval/thread-restore.service.js +75 -7
- package/dist/modules/instance-ai/eval/thread-restore.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/workflow-analysis.d.ts +3 -1
- package/dist/modules/instance-ai/eval/workflow-analysis.js +16 -2
- package/dist/modules/instance-ai/eval/workflow-analysis.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-conversation-history.service.js +1 -1
- package/dist/modules/instance-ai/instance-ai-conversation-history.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-execution-wait.d.ts +14 -0
- package/dist/modules/instance-ai/instance-ai-execution-wait.js +66 -0
- package/dist/modules/instance-ai/instance-ai-execution-wait.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai-settings.service.js +1 -4
- package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-step-run.d.ts +32 -0
- package/dist/modules/instance-ai/instance-ai-step-run.js +135 -0
- package/dist/modules/instance-ai/instance-ai-step-run.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +9 -2
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +305 -92
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.controller.d.ts +1 -0
- package/dist/modules/instance-ai/instance-ai.controller.js +17 -4
- package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.service.d.ts +4 -4
- package/dist/modules/instance-ai/instance-ai.service.js +85 -121
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-context.service.d.ts +39 -10
- package/dist/modules/instance-ai/instance-context.service.js +283 -69
- package/dist/modules/instance-ai/instance-context.service.js.map +1 -1
- package/dist/modules/instance-ai/internal-messages.d.ts +11 -2
- package/dist/modules/instance-ai/internal-messages.js +183 -16
- package/dist/modules/instance-ai/internal-messages.js.map +1 -1
- package/dist/modules/instance-ai/message-parser.js.map +1 -1
- package/dist/modules/instance-registry/instance-registry.module.d.ts +2 -2
- package/dist/modules/instance-registry/instance-registry.module.js +5 -1
- package/dist/modules/instance-registry/instance-registry.module.js.map +1 -1
- package/dist/modules/instance-registry/stale-member-cleanup.task.d.ts +1 -1
- package/dist/modules/instance-registry/stale-member-cleanup.task.js +1 -1
- package/dist/modules/instance-registry/stale-member-cleanup.task.js.map +1 -1
- package/dist/modules/instance-registry/storage/redis-instance-storage.js +2 -10
- package/dist/modules/instance-registry/storage/redis-instance-storage.js.map +1 -1
- package/dist/modules/mcp/mcp-post-save-metrics.service.d.ts +10 -0
- package/dist/modules/mcp/mcp-post-save-metrics.service.js +40 -0
- package/dist/modules/mcp/mcp-post-save-metrics.service.js.map +1 -0
- package/dist/modules/mcp/mcp-protected-resource.d.ts +5 -2
- package/dist/modules/mcp/mcp-protected-resource.js +25 -4
- package/dist/modules/mcp/mcp-protected-resource.js.map +1 -1
- package/dist/modules/mcp/mcp-scopes.d.ts +3 -0
- package/dist/modules/mcp/mcp-scopes.js +21 -1
- package/dist/modules/mcp/mcp-scopes.js.map +1 -1
- package/dist/modules/mcp/mcp-tool-availability.d.ts +7 -0
- package/dist/modules/mcp/mcp-tool-availability.js +11 -0
- package/dist/modules/mcp/mcp-tool-availability.js.map +1 -1
- package/dist/modules/mcp/mcp.config.d.ts +1 -0
- package/dist/modules/mcp/mcp.config.js +5 -0
- package/dist/modules/mcp/mcp.config.js.map +1 -1
- package/dist/modules/mcp/mcp.constants.d.ts +6 -0
- package/dist/modules/mcp/mcp.constants.js +7 -1
- package/dist/modules/mcp/mcp.constants.js.map +1 -1
- package/dist/modules/mcp/mcp.controller.js +3 -6
- package/dist/modules/mcp/mcp.controller.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +11 -7
- package/dist/modules/mcp/mcp.service.js +116 -43
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/mcp.types.d.ts +0 -1
- package/dist/modules/mcp/tools/get-instance-context.tool.d.ts +29 -0
- package/dist/modules/mcp/tools/get-instance-context.tool.js +109 -0
- package/dist/modules/mcp/tools/get-instance-context.tool.js.map +1 -0
- package/dist/modules/mcp/tools/get-node-usage.tool.d.ts +13 -0
- package/dist/modules/mcp/tools/get-node-usage.tool.js +117 -0
- package/dist/modules/mcp/tools/get-node-usage.tool.js.map +1 -0
- package/dist/modules/mcp/tools/get-user-preferences.tool.d.ts +10 -0
- package/dist/modules/mcp/tools/get-user-preferences.tool.js +108 -0
- package/dist/modules/mcp/tools/get-user-preferences.tool.js.map +1 -0
- package/dist/modules/mcp/tools/instance-activity.tool.d.ts +27 -0
- package/dist/modules/mcp/tools/instance-activity.tool.js +205 -0
- package/dist/modules/mcp/tools/instance-activity.tool.js.map +1 -0
- package/dist/modules/mcp/tools/list-credentials.tool.d.ts +63 -13
- package/dist/modules/mcp/tools/list-credentials.tool.js +8 -1
- package/dist/modules/mcp/tools/list-credentials.tool.js.map +1 -1
- package/dist/modules/mcp/tools/search-executions.tool.d.ts +3 -3
- package/dist/modules/mcp/tools/search-executions.tool.js +22 -14
- package/dist/modules/mcp/tools/search-executions.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.d.ts +8 -4
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +128 -70
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/error-code.utils.d.ts +1 -0
- package/dist/modules/mcp/tools/workflow-builder/error-code.utils.js +22 -0
- package/dist/modules/mcp/tools/workflow-builder/error-code.utils.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.d.ts +1 -3
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.js +5 -6
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-best-practices.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.d.ts +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js +2 -2
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.d.ts +2 -5
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js +10 -16
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/install-community-node.tool.d.ts +12 -0
- package/dist/modules/mcp/tools/workflow-builder/install-community-node.tool.js +140 -0
- package/dist/modules/mcp/tools/workflow-builder/install-community-node.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.d.ts +2 -2
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +17 -9
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.d.ts +1 -3
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js +2 -6
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.d.ts +1 -1
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js +9 -8
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/uninstalled-node-warnings.d.ts +13 -0
- package/dist/modules/mcp/tools/workflow-builder/uninstalled-node-warnings.js +23 -0
- package/dist/modules/mcp/tools/workflow-builder/uninstalled-node-warnings.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.d.ts +18 -14
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +200 -87
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.d.ts +1 -4
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js +3 -5
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.d.ts +1 -3
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js +2 -2
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js.map +1 -1
- package/dist/modules/mcp-registry/node-description-transform.js +3 -0
- package/dist/modules/mcp-registry/node-description-transform.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry-api.client.js +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry-api.client.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry-capabilities.d.ts +6 -0
- package/dist/modules/mcp-registry/registry/mcp-registry-capabilities.js +34 -0
- package/dist/modules/mcp-registry/registry/mcp-registry-capabilities.js.map +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry-server.entity.d.ts +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry-server.entity.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry.service.d.ts +4 -1
- package/dist/modules/mcp-registry/registry/mcp-registry.service.js +20 -9
- package/dist/modules/mcp-registry/registry/mcp-registry.service.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry.types.d.ts +3 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.types.js +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.types.js.map +1 -1
- package/dist/modules/n8n-packages/engine/n8n-package-parser.js +1 -1
- package/dist/modules/n8n-packages/engine/n8n-package-parser.js.map +1 -1
- package/dist/modules/n8n-packages/entities/credential/credential.serializer.js.map +1 -1
- package/dist/modules/n8n-packages/entities/variable/variable-requirements.extractor.d.ts +8 -2
- package/dist/modules/n8n-packages/entities/variable/variable-requirements.extractor.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-published-state.d.ts +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow-published-state.js +2 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow-published-state.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.d.ts +1 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js +4 -2
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js.map +1 -1
- package/dist/modules/n8n-packages/io/directory/package-directory-inventory-reader.d.ts +43 -0
- package/dist/modules/n8n-packages/io/directory/package-directory-inventory-reader.js +177 -0
- package/dist/modules/n8n-packages/io/directory/package-directory-inventory-reader.js.map +1 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow-metadata.schema.d.ts +3 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow-metadata.schema.js +1 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow-metadata.schema.js.map +1 -1
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.d.ts +0 -3
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js +0 -1
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.js.map +1 -1
- package/dist/modules/oauth-jwe/oauth-jwe-key.service.d.ts +1 -0
- package/dist/modules/oauth-jwe/oauth-jwe-key.service.js +10 -3
- package/dist/modules/oauth-jwe/oauth-jwe-key.service.js.map +1 -1
- package/dist/modules/oauth-server/oauth-clients.controller.js +1 -1
- package/dist/modules/oauth-server/oauth-clients.controller.js.map +1 -1
- package/dist/modules/oauth-server/oauth-consent.service.d.ts +1 -0
- package/dist/modules/oauth-server/oauth-consent.service.js +21 -10
- package/dist/modules/oauth-server/oauth-consent.service.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 +2 -2
- package/dist/modules/oauth-server/oauth-server.service.js.map +1 -1
- package/dist/modules/oauth-server/oauth-token.service.d.ts +3 -1
- package/dist/modules/oauth-server/oauth-token.service.js +10 -2
- package/dist/modules/oauth-server/oauth-token.service.js.map +1 -1
- package/dist/modules/policy-infrastructure/policy-decision-audit.d.ts +1 -1
- package/dist/modules/policy-infrastructure/policy-decision-audit.js +8 -1
- package/dist/modules/policy-infrastructure/policy-decision-audit.js.map +1 -1
- package/dist/modules/policy-infrastructure/policy-decision.service.js +1 -0
- package/dist/modules/policy-infrastructure/policy-decision.service.js.map +1 -1
- package/dist/modules/promotions.ee/base-branch-files.d.ts +2 -2
- package/dist/modules/promotions.ee/base-branch-files.js +2 -3
- package/dist/modules/promotions.ee/base-branch-files.js.map +1 -1
- package/dist/modules/promotions.ee/constants.d.ts +1 -0
- package/dist/modules/promotions.ee/constants.js +2 -1
- package/dist/modules/promotions.ee/constants.js.map +1 -1
- package/dist/modules/promotions.ee/database/repositories/promotion-provider.repository.js +1 -14
- package/dist/modules/promotions.ee/database/repositories/promotion-provider.repository.js.map +1 -1
- package/dist/modules/promotions.ee/promotion-binding-preflight.service.d.ts +22 -0
- package/dist/modules/promotions.ee/promotion-binding-preflight.service.js +264 -0
- package/dist/modules/promotions.ee/promotion-binding-preflight.service.js.map +1 -0
- package/dist/modules/promotions.ee/promotion-change.service.d.ts +8 -3
- package/dist/modules/promotions.ee/promotion-change.service.js +133 -24
- package/dist/modules/promotions.ee/promotion-change.service.js.map +1 -1
- package/dist/modules/promotions.ee/promotion-changes.controller.d.ts +2 -2
- package/dist/modules/promotions.ee/promotion-changes.controller.js +10 -12
- package/dist/modules/promotions.ee/promotion-changes.controller.js.map +1 -1
- package/dist/modules/promotions.ee/promotion-connections.service.d.ts +48 -2
- package/dist/modules/promotions.ee/promotion-connections.service.js +66 -14
- package/dist/modules/promotions.ee/promotion-connections.service.js.map +1 -1
- package/dist/modules/promotions.ee/promotions-git.service.d.ts +8 -1
- package/dist/modules/promotions.ee/promotions-git.service.js +27 -9
- package/dist/modules/promotions.ee/promotions-git.service.js.map +1 -1
- package/dist/modules/promotions.ee/promotions-git.utils.d.ts +8 -2
- package/dist/modules/promotions.ee/promotions-git.utils.js +10 -0
- package/dist/modules/promotions.ee/promotions-git.utils.js.map +1 -1
- package/dist/modules/promotions.ee/promotions.service.d.ts +9 -5
- package/dist/modules/promotions.ee/promotions.service.js +78 -21
- package/dist/modules/promotions.ee/promotions.service.js.map +1 -1
- package/dist/modules/promotions.ee/promotions.types.d.ts +6 -0
- package/dist/modules/promotions.ee/promotions.types.js.map +1 -1
- package/dist/modules/token-exchange/database/repositories/token-exchange-jti.repository.js +1 -0
- package/dist/modules/token-exchange/database/repositories/token-exchange-jti.repository.js.map +1 -1
- package/dist/modules/token-exchange/services/jti-cleanup.task.d.ts +1 -1
- package/dist/modules/token-exchange/services/jti-cleanup.task.js +1 -1
- package/dist/modules/token-exchange/services/jti-cleanup.task.js.map +1 -1
- package/dist/modules/type-availability-policies/constants.d.ts +1 -0
- package/dist/modules/type-availability-policies/constants.js +2 -1
- package/dist/modules/type-availability-policies/constants.js.map +1 -1
- package/dist/modules/type-availability-policies/database/entities/type-availability-policy.entity.js +2 -1
- package/dist/modules/type-availability-policies/database/entities/type-availability-policy.entity.js.map +1 -1
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.d.ts +2 -1
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.js +12 -0
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy-scope.repository.js.map +1 -1
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.d.ts +5 -1
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.js +11 -2
- package/dist/modules/type-availability-policies/database/repositories/type-availability-policy.repository.js.map +1 -1
- package/dist/modules/type-availability-policies/node-type-policy.check.d.ts +17 -0
- package/dist/modules/type-availability-policies/node-type-policy.check.js +87 -0
- package/dist/modules/type-availability-policies/node-type-policy.check.js.map +1 -0
- package/dist/modules/type-availability-policies/package-resolver.d.ts +4 -0
- package/dist/modules/type-availability-policies/package-resolver.js +26 -0
- package/dist/modules/type-availability-policies/package-resolver.js.map +1 -0
- package/dist/modules/type-availability-policies/policy-evaluator.d.ts +6 -4
- package/dist/modules/type-availability-policies/policy-evaluator.js +16 -13
- package/dist/modules/type-availability-policies/policy-evaluator.js.map +1 -1
- package/dist/modules/type-availability-policies/policy-rule.types.d.ts +4 -0
- package/dist/modules/type-availability-policies/policy-shadow-lint.d.ts +2 -1
- package/dist/modules/type-availability-policies/policy-shadow-lint.js +7 -5
- package/dist/modules/type-availability-policies/policy-shadow-lint.js.map +1 -1
- package/dist/modules/type-availability-policies/type-availability-policies.module.d.ts +1 -1
- package/dist/modules/type-availability-policies/type-availability-policies.module.js +1 -0
- package/dist/modules/type-availability-policies/type-availability-policies.module.js.map +1 -1
- package/dist/modules/type-availability-policies/type-availability-policy-instance.controller.js +3 -3
- package/dist/modules/type-availability-policies/type-availability-policy-instance.controller.js.map +1 -1
- package/dist/modules/type-availability-policies/type-availability-policy.service.d.ts +33 -4
- package/dist/modules/type-availability-policies/type-availability-policy.service.js +189 -28
- package/dist/modules/type-availability-policies/type-availability-policy.service.js.map +1 -1
- package/dist/modules/workflow-index/workflow-index.service.js +5 -2
- package/dist/modules/workflow-index/workflow-index.service.js.map +1 -1
- package/dist/node-catalog/index.d.ts +1 -1
- package/dist/node-catalog/index.js.map +1 -1
- package/dist/node-catalog/node-catalog.service.d.ts +28 -4
- package/dist/node-catalog/node-catalog.service.js +202 -7
- package/dist/node-catalog/node-catalog.service.js.map +1 -1
- package/dist/node-catalog/registry-lookup.d.ts +12 -0
- package/dist/node-catalog/registry-lookup.js +68 -0
- package/dist/node-catalog/registry-lookup.js.map +1 -0
- package/dist/node-execution/execute-node.service.d.ts +72 -0
- package/dist/node-execution/execute-node.service.js +297 -0
- package/dist/node-execution/execute-node.service.js.map +1 -0
- package/dist/node-execution/index.d.ts +2 -0
- package/dist/node-execution/index.js +5 -1
- package/dist/node-execution/index.js.map +1 -1
- package/dist/oauth/dcr-managed-fields.d.ts +1 -1
- package/dist/oauth/dcr-managed-fields.js +4 -2
- package/dist/oauth/dcr-managed-fields.js.map +1 -1
- package/dist/policy/policy-enforcement-backend.d.ts +2 -1
- package/dist/policy/policy-enforcement.service.d.ts +3 -1
- package/dist/policy/policy-enforcement.service.js +9 -0
- package/dist/policy/policy-enforcement.service.js.map +1 -1
- package/dist/posthog/index.d.ts +1 -0
- package/dist/posthog/index.js +35 -14
- package/dist/posthog/index.js.map +1 -1
- package/dist/public-api/constants.d.ts +1 -0
- package/dist/public-api/constants.js +5 -0
- package/dist/public-api/constants.js.map +1 -0
- package/dist/public-api/public-api-controller.registry.d.ts +1 -0
- package/dist/public-api/public-api-controller.registry.js +15 -0
- package/dist/public-api/public-api-controller.registry.js.map +1 -1
- package/dist/public-api/types.d.ts +2 -27
- package/dist/public-api/v1/controllers/credentials.public.controller.d.ts +3 -1
- package/dist/public-api/v1/controllers/credentials.public.controller.js +52 -1
- package/dist/public-api/v1/controllers/credentials.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/executions.public.controller.js +3 -3
- package/dist/public-api/v1/controllers/executions.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/folders.public.controller.d.ts +10 -0
- package/dist/public-api/v1/controllers/folders.public.controller.js +121 -0
- package/dist/public-api/v1/controllers/folders.public.controller.js.map +1 -0
- package/dist/public-api/v1/controllers/index.d.ts +2 -0
- package/dist/public-api/v1/controllers/index.js +2 -0
- package/dist/public-api/v1/controllers/index.js.map +1 -1
- package/dist/public-api/v1/controllers/insights.public.controller.d.ts +9 -0
- package/dist/public-api/v1/controllers/insights.public.controller.js +69 -0
- package/dist/public-api/v1/controllers/insights.public.controller.js.map +1 -0
- package/dist/public-api/v1/controllers/node-type-policies.public.controller.d.ts +11 -5
- package/dist/public-api/v1/controllers/node-type-policies.public.controller.js +152 -4
- package/dist/public-api/v1/controllers/node-type-policies.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/promotions.public.controller.d.ts +5 -2
- package/dist/public-api/v1/controllers/promotions.public.controller.js +60 -4
- package/dist/public-api/v1/controllers/promotions.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/roles.public.controller.js +1 -0
- package/dist/public-api/v1/controllers/roles.public.controller.js.map +1 -1
- package/dist/public-api/v1/controllers/tags.public.controller.d.ts +3 -1
- package/dist/public-api/v1/controllers/tags.public.controller.js +61 -0
- package/dist/public-api/v1/controllers/tags.public.controller.js.map +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.utils.d.ts +3 -3
- package/dist/public-api/v1/handlers/credentials/credentials.utils.js +1 -6
- package/dist/public-api/v1/handlers/credentials/credentials.utils.js.map +1 -1
- package/dist/public-api/v1/handlers/folders/folders.handler.d.ts +0 -7
- package/dist/public-api/v1/handlers/folders/folders.handler.js +0 -29
- package/dist/public-api/v1/handlers/folders/folders.handler.js.map +1 -1
- package/dist/public-api/v1/openapi.yml +4051 -2008
- package/dist/public-api/v1/shared/middlewares/global.middleware.d.ts +1 -1
- package/dist/public-api/v1/shared/middlewares/global.middleware.js +4 -3
- package/dist/public-api/v1/shared/middlewares/global.middleware.js.map +1 -1
- package/dist/requests.d.ts +1 -0
- package/dist/scaling/constants.d.ts +2 -0
- package/dist/scaling/constants.js +4 -1
- package/dist/scaling/constants.js.map +1 -1
- package/dist/scaling/pubsub/subscriber.service.d.ts +5 -0
- package/dist/scaling/pubsub/subscriber.service.js +47 -0
- package/dist/scaling/pubsub/subscriber.service.js.map +1 -1
- package/dist/scheduling/durable-job-provisioner.d.ts +10 -1
- package/dist/scheduling/durable-job-provisioner.js +26 -9
- package/dist/scheduling/durable-job-provisioner.js.map +1 -1
- package/dist/scheduling/durable-scheduler.d.ts +2 -1
- package/dist/scheduling/durable-scheduler.js +4 -3
- package/dist/scheduling/durable-scheduler.js.map +1 -1
- package/dist/scheduling/scheduled-job-owner-registry.d.ts +2 -1
- package/dist/scheduling/scheduled-job-owner-registry.js +2 -1
- package/dist/scheduling/scheduled-job-owner-registry.js.map +1 -1
- package/dist/scheduling/system-tasks/emit-system-task-metric.d.ts +3 -0
- package/dist/scheduling/system-tasks/emit-system-task-metric.js +11 -0
- package/dist/scheduling/system-tasks/emit-system-task-metric.js.map +1 -0
- package/dist/scheduling/system-tasks/system-task-handler.d.ts +5 -1
- package/dist/scheduling/system-tasks/system-task-handler.js +9 -8
- package/dist/scheduling/system-tasks/system-task-handler.js.map +1 -1
- package/dist/scheduling/system-tasks/system-task-job-registrar.d.ts +28 -0
- package/dist/scheduling/system-tasks/system-task-job-registrar.js +130 -0
- package/dist/scheduling/system-tasks/system-task-job-registrar.js.map +1 -0
- package/dist/scheduling/system-tasks/system-task-run-observer.d.ts +13 -0
- package/dist/scheduling/system-tasks/system-task-run-observer.js +54 -0
- package/dist/scheduling/system-tasks/system-task-run-observer.js.map +1 -0
- package/dist/scheduling/system-tasks/system-task-runner.d.ts +13 -3
- package/dist/scheduling/system-tasks/system-task-runner.js +85 -15
- package/dist/scheduling/system-tasks/system-task-runner.js.map +1 -1
- package/dist/scheduling/system-tasks/system-task-scheduled-job-owner.d.ts +13 -0
- package/dist/scheduling/system-tasks/system-task-scheduled-job-owner.js +51 -0
- package/dist/scheduling/system-tasks/system-task-scheduled-job-owner.js.map +1 -0
- package/dist/scheduling/system-tasks/system-task-timer.d.ts +3 -1
- package/dist/scheduling/system-tasks/system-task-timer.js +33 -9
- package/dist/scheduling/system-tasks/system-task-timer.js.map +1 -1
- package/dist/scheduling/system-tasks/system-task-version-stamp.d.ts +5 -0
- package/dist/scheduling/system-tasks/system-task-version-stamp.js +14 -0
- package/dist/scheduling/system-tasks/system-task-version-stamp.js.map +1 -0
- package/dist/server.d.ts +0 -1
- package/dist/server.js +4 -2
- package/dist/server.js.map +1 -1
- package/dist/services/ai-gateway.service.d.ts +2 -1
- package/dist/services/ai-gateway.service.js +7 -4
- package/dist/services/ai-gateway.service.js.map +1 -1
- package/dist/services/ai-preference.service.d.ts +29 -5
- package/dist/services/ai-preference.service.js +119 -20
- package/dist/services/ai-preference.service.js.map +1 -1
- package/dist/services/credentials-tester.service.js +12 -0
- package/dist/services/credentials-tester.service.js.map +1 -1
- package/dist/services/engine-data-plane-proxy.service.d.ts +3 -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/free-ai-credits.service.d.ts +1 -0
- package/dist/services/frontend.service.js +2 -1
- package/dist/services/frontend.service.js.map +1 -1
- package/dist/services/protected-resource.registry.d.ts +2 -1
- package/dist/services/protected-resource.registry.js.map +1 -1
- package/dist/services/role.service.js +5 -4
- package/dist/services/role.service.js.map +1 -1
- package/dist/utils/strapi-utils.d.ts +1 -0
- package/dist/utils/strapi-utils.js.map +1 -1
- package/dist/wait-tracker.d.ts +5 -0
- package/dist/wait-tracker.js +130 -20
- package/dist/wait-tracker.js.map +1 -1
- package/dist/webhooks/live-webhooks.js +2 -2
- package/dist/webhooks/live-webhooks.js.map +1 -1
- package/dist/webhooks/test-webhook-registrations.service.d.ts +3 -1
- package/dist/webhooks/test-webhook-registrations.service.js +24 -11
- package/dist/webhooks/test-webhook-registrations.service.js.map +1 -1
- package/dist/webhooks/test-webhooks.d.ts +1 -0
- package/dist/webhooks/test-webhooks.js +9 -4
- package/dist/webhooks/test-webhooks.js.map +1 -1
- package/dist/webhooks/webhook-helpers.d.ts +1 -1
- package/dist/webhooks/webhook-helpers.js +113 -92
- package/dist/webhooks/webhook-helpers.js.map +1 -1
- package/dist/workflow-helpers.d.ts +1 -1
- package/dist/workflow-helpers.js +10 -3
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflow-runner.js +104 -7
- package/dist/workflow-runner.js.map +1 -1
- package/dist/workflows/workflow.service.d.ts +1 -1
- package/package.json +42 -36
- package/dist/controllers/instance-ai-examples.controller.d.ts +0 -31
- package/dist/controllers/instance-ai-examples.controller.js +0 -104
- package/dist/controllers/instance-ai-examples.controller.js.map +0 -1
- package/dist/instance-ai-examples.data.json +0 -277957
- package/dist/public-api/v1/handlers/credentials/credentials.handler.d.ts +0 -8
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js +0 -45
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js.map +0 -1
- package/dist/public-api/v1/handlers/insights/insights.handler.d.ts +0 -7
- package/dist/public-api/v1/handlers/insights/insights.handler.js +0 -62
- package/dist/public-api/v1/handlers/insights/insights.handler.js.map +0 -1
- package/dist/public-api/v1/handlers/tags/tags.handler.d.ts +0 -8
- package/dist/public-api/v1/handlers/tags/tags.handler.js +0 -46
- package/dist/public-api/v1/handlers/tags/tags.handler.js.map +0 -1
|
@@ -10,21 +10,25 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.PromotionChangeService = void 0;
|
|
13
|
+
exports.scopeManifestToProject = scopeManifestToProject;
|
|
13
14
|
const backend_common_1 = require("@n8n/backend-common");
|
|
14
15
|
const db_1 = require("@n8n/db");
|
|
15
16
|
const di_1 = require("@n8n/di");
|
|
16
17
|
const permissions_1 = require("@n8n/permissions");
|
|
17
18
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
18
19
|
const node_crypto_1 = require("node:crypto");
|
|
20
|
+
const bad_request_error_1 = require("../../errors/response-errors/bad-request.error");
|
|
19
21
|
const forbidden_error_1 = require("../../errors/response-errors/forbidden.error");
|
|
20
22
|
const hashing_package_writer_1 = require("../../modules/n8n-packages/io/hashing-package-writer");
|
|
21
23
|
const manifest_entry_1 = require("../../modules/n8n-packages/io/manifest-entry");
|
|
22
24
|
const slug_utils_1 = require("../../modules/n8n-packages/io/slug.utils");
|
|
23
25
|
const n8n_packages_service_1 = require("../../modules/n8n-packages/n8n-packages.service");
|
|
24
26
|
const n8n_packages_types_1 = require("../../modules/n8n-packages/n8n-packages.types");
|
|
27
|
+
const constants_1 = require("../../modules/n8n-packages/spec/constants");
|
|
28
|
+
const manifest_schema_1 = require("../../modules/n8n-packages/spec/manifest.schema");
|
|
25
29
|
const check_access_1 = require("../../permissions.ee/check-access");
|
|
26
30
|
const base_branch_files_1 = require("./base-branch-files");
|
|
27
|
-
const
|
|
31
|
+
const constants_2 = require("./constants");
|
|
28
32
|
const diff_package_files_1 = require("./diff-package-files");
|
|
29
33
|
const promotions_service_1 = require("./promotions.service");
|
|
30
34
|
const DEPENDENCY_COLLECTIONS = {
|
|
@@ -35,6 +39,10 @@ const DEPENDENCY_COLLECTIONS = {
|
|
|
35
39
|
workflows: 'workflows',
|
|
36
40
|
nodeTypes: null,
|
|
37
41
|
};
|
|
42
|
+
const GIT_SCOPES = {
|
|
43
|
+
promote: 'gitConnection:push',
|
|
44
|
+
apply: 'gitConnection:pull',
|
|
45
|
+
};
|
|
38
46
|
let PromotionChangeService = class PromotionChangeService {
|
|
39
47
|
constructor(promotionsService, packagesService, workflowRepository, logger) {
|
|
40
48
|
this.promotionsService = promotionsService;
|
|
@@ -43,15 +51,33 @@ let PromotionChangeService = class PromotionChangeService {
|
|
|
43
51
|
this.logger = logger;
|
|
44
52
|
this.logger = this.logger.scoped('promotions');
|
|
45
53
|
}
|
|
46
|
-
async getChanges(user, projectId) {
|
|
47
|
-
|
|
54
|
+
async getChanges(user, projectId, direction, query) {
|
|
55
|
+
await this.assertCanPreview(user, projectId, direction);
|
|
56
|
+
const branch = await this.promotionsService.readBranchPackage(projectId, direction);
|
|
57
|
+
const branchDesired = direction === 'apply' ? await this.readBranchDesired(branch, projectId) : null;
|
|
58
|
+
const instance = await this.exportInstancePackage(user, projectId);
|
|
59
|
+
const { base, desired } = branchDesired === null
|
|
60
|
+
? { base: branch.files, desired: instance }
|
|
61
|
+
: { base: instance.files, desired: branchDesired };
|
|
62
|
+
const diff = this.diffPackages({ projectId, direction, base, desired });
|
|
63
|
+
const archiveState = direction === 'promote'
|
|
64
|
+
? instance.archiveState
|
|
65
|
+
: await readBranchArchiveState(branch, diff.archiveCheckPaths);
|
|
66
|
+
const metadata = await this.workflowRepository.findByIds([...diff.changedIds].filter((id) => direction === 'apply' || diff.desiredWorkflows.has(id)), { fields: ['name', 'updatedAt', 'versionCounter'] });
|
|
67
|
+
const rows = buildPromotableResources({ ...diff, base, archiveState, metadata });
|
|
68
|
+
return { commitSha: branch.commitSha, changes: applyQuery(rows, query) };
|
|
69
|
+
}
|
|
70
|
+
async assertCanPreview(user, projectId, direction) {
|
|
71
|
+
if (!(0, permissions_1.hasGlobalScope)(user, GIT_SCOPES[direction]) ||
|
|
48
72
|
!(await (0, check_access_1.userHasScopes)(user, ['project:export'], false, { projectId }))) {
|
|
49
|
-
|
|
73
|
+
const operation = direction === 'promote' ? 'push' : 'pull';
|
|
74
|
+
throw new forbidden_error_1.ForbiddenError(`Change preview requires project export and promotion ${operation} permissions. Ask an administrator for access.`);
|
|
50
75
|
}
|
|
51
|
-
|
|
76
|
+
}
|
|
77
|
+
diffPackages({ projectId, direction, base, desired, }) {
|
|
52
78
|
const previewId = (0, node_crypto_1.randomUUID)();
|
|
53
|
-
const {
|
|
54
|
-
const changes = (0, diff_package_files_1.diffPackageFiles)(base, desired);
|
|
79
|
+
const { manifest } = desired;
|
|
80
|
+
const changes = (0, diff_package_files_1.diffPackageFiles)(base, desired.files);
|
|
55
81
|
const changedIds = new Set();
|
|
56
82
|
const renamedIds = new Set();
|
|
57
83
|
const modifiedIds = new Set();
|
|
@@ -70,7 +96,12 @@ let PromotionChangeService = class PromotionChangeService {
|
|
|
70
96
|
if (fileChange.change !== 'renamed')
|
|
71
97
|
modifiedIds.add(file.entityId);
|
|
72
98
|
}
|
|
73
|
-
this.logger.debug('Promotion file change', {
|
|
99
|
+
this.logger.debug('Promotion file change', {
|
|
100
|
+
previewId,
|
|
101
|
+
projectId,
|
|
102
|
+
direction,
|
|
103
|
+
...fileChange,
|
|
104
|
+
});
|
|
74
105
|
}
|
|
75
106
|
const { affectedWorkflowIds, dependencyCounts } = calculateDependencyImpact({
|
|
76
107
|
base,
|
|
@@ -86,24 +117,33 @@ let PromotionChangeService = class PromotionChangeService {
|
|
|
86
117
|
this.logger.debug('Promotion change preview', {
|
|
87
118
|
previewId,
|
|
88
119
|
projectId,
|
|
120
|
+
direction,
|
|
89
121
|
baseFileCount: base.length,
|
|
90
|
-
desiredFileCount: desired.length,
|
|
122
|
+
desiredFileCount: desired.files.length,
|
|
91
123
|
fileChangeCount: changes.length,
|
|
92
124
|
workflowIds: [...changedIds],
|
|
93
125
|
});
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
126
|
+
const baseWorkflowIds = new Set(base.filter(({ type }) => type === 'workflow').map(({ entityId }) => entityId));
|
|
127
|
+
const desiredWorkflowPaths = new Map(desired.files
|
|
128
|
+
.filter(({ type }) => type === 'workflow')
|
|
129
|
+
.map(({ entityId, path }) => [entityId, path]));
|
|
130
|
+
const archiveCheckPaths = [...changedIds].flatMap((id) => {
|
|
131
|
+
const path = desiredWorkflowPaths.get(id);
|
|
132
|
+
return path !== undefined && desiredWorkflows.has(id) && baseWorkflowIds.has(id)
|
|
133
|
+
? [path]
|
|
134
|
+
: [];
|
|
135
|
+
});
|
|
136
|
+
return {
|
|
99
137
|
changedIds,
|
|
100
138
|
renamedIds,
|
|
101
139
|
modifiedIds,
|
|
102
|
-
metadata,
|
|
103
140
|
dependencyCounts,
|
|
104
|
-
|
|
141
|
+
desiredWorkflows,
|
|
142
|
+
desiredWorkflowPaths,
|
|
143
|
+
archiveCheckPaths,
|
|
144
|
+
};
|
|
105
145
|
}
|
|
106
|
-
async
|
|
146
|
+
async exportInstancePackage(user, projectId) {
|
|
107
147
|
const writer = new hashing_package_writer_1.HashingPackageWriter();
|
|
108
148
|
const archiveState = new Map();
|
|
109
149
|
const { manifest } = await this.packagesService.exportPackageToWriter({
|
|
@@ -120,22 +160,90 @@ let PromotionChangeService = class PromotionChangeService {
|
|
|
120
160
|
writer.writeFile(path, content);
|
|
121
161
|
if (path.endsWith(`/${manifest_entry_1.PACKAGE_ENTITY_LAYOUT.workflows.fileName}`)) {
|
|
122
162
|
const workflow = (0, n8n_workflow_1.jsonParse)(String(content));
|
|
123
|
-
archiveState.set(path
|
|
163
|
+
archiveState.set(`${constants_2.PACKAGE_SUBFOLDER}/${path}`, workflow.isArchived);
|
|
124
164
|
}
|
|
125
165
|
},
|
|
126
166
|
});
|
|
127
167
|
const files = (0, base_branch_files_1.parsePackageFiles)(writer.finalize().map((file) => ({
|
|
128
168
|
...file,
|
|
129
|
-
path: `${
|
|
130
|
-
})), { exportRoot:
|
|
169
|
+
path: `${constants_2.PACKAGE_SUBFOLDER}/${file.path}`,
|
|
170
|
+
})), { exportRoot: constants_2.PACKAGE_SUBFOLDER, projectId });
|
|
131
171
|
return { files, manifest, archiveState };
|
|
132
172
|
}
|
|
173
|
+
async readBranchDesired(branch, projectId) {
|
|
174
|
+
const manifestPath = `${constants_2.PACKAGE_SUBFOLDER}/${constants_1.MANIFEST_FILE}`;
|
|
175
|
+
const manifest = manifest_schema_1.packageManifestSchema.safeParse(parseBranchJson((await branch.readFiles([manifestPath])).get(manifestPath) ?? ''));
|
|
176
|
+
if (!manifest.success) {
|
|
177
|
+
throw new bad_request_error_1.BadRequestError('The package manifest on the branch cannot be read');
|
|
178
|
+
}
|
|
179
|
+
return { files: branch.files, manifest: scopeManifestToProject(manifest.data, projectId) };
|
|
180
|
+
}
|
|
133
181
|
};
|
|
134
182
|
exports.PromotionChangeService = PromotionChangeService;
|
|
135
183
|
exports.PromotionChangeService = PromotionChangeService = __decorate([
|
|
136
184
|
(0, di_1.Service)(),
|
|
137
185
|
__metadata("design:paramtypes", [promotions_service_1.PromotionsService, n8n_packages_service_1.N8nPackagesService, db_1.WorkflowRepository, backend_common_1.Logger])
|
|
138
186
|
], PromotionChangeService);
|
|
187
|
+
function parseBranchJson(raw) {
|
|
188
|
+
try {
|
|
189
|
+
return (0, n8n_workflow_1.jsonParse)(raw);
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
return undefined;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
async function readBranchArchiveState(branch, paths) {
|
|
196
|
+
const files = await branch.readFiles(paths);
|
|
197
|
+
return new Map([...files].map(([path, raw]) => [
|
|
198
|
+
path,
|
|
199
|
+
parseBranchJson(raw)?.isArchived ?? false,
|
|
200
|
+
]));
|
|
201
|
+
}
|
|
202
|
+
function scopeManifestToProject(manifest, projectId) {
|
|
203
|
+
const projectTarget = manifest.projects?.find(({ id }) => id === projectId)?.target;
|
|
204
|
+
const inProject = ({ target }) => projectTarget !== undefined && target.startsWith(`${projectTarget}/`);
|
|
205
|
+
const workflows = (manifest.workflows ?? []).filter(inProject);
|
|
206
|
+
const workflowIds = new Set(workflows.map(({ id }) => id));
|
|
207
|
+
const variables = new Map();
|
|
208
|
+
for (const entry of manifest.variables ?? []) {
|
|
209
|
+
const isGlobal = !entry.target.startsWith(`${manifest_entry_1.PACKAGE_ENTITY_LAYOUT.projects.directory}/`);
|
|
210
|
+
if (inProject(entry) || (isGlobal && !variables.has(entry.name))) {
|
|
211
|
+
variables.set(entry.name, entry);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
const scopeRows = (rows) => {
|
|
215
|
+
const kept = rows
|
|
216
|
+
?.map((row) => ({
|
|
217
|
+
...row,
|
|
218
|
+
usedByWorkflows: row.usedByWorkflows.filter((id) => workflowIds.has(id)),
|
|
219
|
+
}))
|
|
220
|
+
.filter((row) => row.usedByWorkflows.length > 0);
|
|
221
|
+
return kept?.length ? kept : undefined;
|
|
222
|
+
};
|
|
223
|
+
const { requirements } = manifest;
|
|
224
|
+
return {
|
|
225
|
+
...manifest,
|
|
226
|
+
workflows,
|
|
227
|
+
variables: [...variables.values()],
|
|
228
|
+
requirements: requirements && {
|
|
229
|
+
credentials: scopeRows(requirements.credentials),
|
|
230
|
+
dataTables: scopeRows(requirements.dataTables),
|
|
231
|
+
workflows: scopeRows(requirements.workflows),
|
|
232
|
+
variables: scopeRows(requirements.variables),
|
|
233
|
+
tags: scopeRows(requirements.tags),
|
|
234
|
+
nodeTypes: scopeRows(requirements.nodeTypes),
|
|
235
|
+
},
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
function applyQuery(changes, query) {
|
|
239
|
+
const search = query.search?.toLowerCase();
|
|
240
|
+
return changes
|
|
241
|
+
.filter(({ name }) => !search || name.toLowerCase().includes(search))
|
|
242
|
+
.sort((a, b) => {
|
|
243
|
+
const comparison = (a[query.sort] ?? '').localeCompare(b[query.sort] ?? '');
|
|
244
|
+
return (query.order === 'desc' ? -comparison : comparison) || a.id.localeCompare(b.id);
|
|
245
|
+
});
|
|
246
|
+
}
|
|
139
247
|
function calculateDependencyImpact({ base, manifest, changedPaths, projectId, }) {
|
|
140
248
|
const baseDependencies = new Map();
|
|
141
249
|
for (const file of base) {
|
|
@@ -166,7 +274,7 @@ function calculateDependencyImpact({ base, manifest, changedPaths, projectId, })
|
|
|
166
274
|
const sameId = entry ? scopedFiles.filter(({ entityId }) => entityId === entry.id) : [];
|
|
167
275
|
const previous = sameId.length ? sameId : scopedFiles;
|
|
168
276
|
const currentPath = entry
|
|
169
|
-
? `${
|
|
277
|
+
? `${constants_2.PACKAGE_SUBFOLDER}/${(0, manifest_entry_1.entityFilePath)(collection, entry.target)}`
|
|
170
278
|
: undefined;
|
|
171
279
|
const dependencyChanged = collection !== 'workflows' &&
|
|
172
280
|
(previous.some(({ path }) => changedPaths.has(path)) ||
|
|
@@ -180,25 +288,26 @@ function calculateDependencyImpact({ base, manifest, changedPaths, projectId, })
|
|
|
180
288
|
}
|
|
181
289
|
return { affectedWorkflowIds, dependencyCounts };
|
|
182
290
|
}
|
|
183
|
-
function buildPromotableResources({ base, desiredWorkflows, archiveState, changedIds, renamedIds, modifiedIds, metadata, dependencyCounts, }) {
|
|
291
|
+
function buildPromotableResources({ base, desiredWorkflows, desiredWorkflowPaths, archiveState, changedIds, renamedIds, modifiedIds, metadata, dependencyCounts, }) {
|
|
184
292
|
const metadataById = new Map(metadata.map((workflow) => [workflow.id, workflow]));
|
|
185
293
|
const baseWorkflowSlugs = new Map(base.filter(({ type }) => type === 'workflow').map(({ entityId, slug }) => [entityId, slug]));
|
|
186
294
|
return [...changedIds].map((id) => {
|
|
187
295
|
const entry = desiredWorkflows.get(id);
|
|
188
296
|
const workflow = metadataById.get(id);
|
|
297
|
+
const path = desiredWorkflowPaths.get(id);
|
|
189
298
|
let status = 'modified';
|
|
190
299
|
if (!entry)
|
|
191
300
|
status = 'deleted';
|
|
192
301
|
else if (!baseWorkflowSlugs.has(id))
|
|
193
302
|
status = 'new';
|
|
194
|
-
else if (archiveState.get(
|
|
303
|
+
else if (path !== undefined && archiveState.get(path))
|
|
195
304
|
status = 'archived';
|
|
196
305
|
else if (renamedIds.has(id)) {
|
|
197
306
|
status = modifiedIds.has(id) ? 'renamed-and-modified' : 'renamed';
|
|
198
307
|
}
|
|
199
308
|
return {
|
|
200
309
|
id,
|
|
201
|
-
name: entry?.name ?? baseWorkflowSlugs.get(id) ?? id,
|
|
310
|
+
name: entry?.name ?? workflow?.name ?? baseWorkflowSlugs.get(id) ?? id,
|
|
202
311
|
type: 'workflow',
|
|
203
312
|
status,
|
|
204
313
|
version: workflow?.versionCounter ?? null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promotion-change.service.js","sourceRoot":"","sources":["../../../src/modules/promotions.ee/promotion-change.service.ts"],"names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E;QACjC,MAAM,KAAK,GAAG,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACvC,MAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACtC,IAAI,MAAM,GAAiC,UAAU,CAAC;QACtD,IAAI,CAAC,KAAK;YAAE,MAAM,GAAG,SAAS,CAAC;aAC1B,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;YAAE,MAAM,GAAG,KAAK,CAAC;aAC/C,IAAI,YAAY,CAAC,GAAG,CAAC,IAAA,+BAAc,EAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YAAE,MAAM,GAAG,UAAU,CAAC;aACrF,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YAC7B,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,SAAS,CAAC;QACnE,CAAC;QACD,OAAO;YACN,EAAE;YACF,IAAI,EAAE,KAAK,EAAE,IAAI,IAAI,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE;YACpD,IAAI,EAAE,UAAU;YAChB,MAAM;YACN,OAAO,EAAE,QAAQ,EAAE,cAAc,IAAI,IAAI;YACzC,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,WAAW,EAAE,IAAI,IAAI;YACpD,SAAS,EAAE,IAAI;YACf,eAAe,EAAE,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC;SAC9C,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"promotion-change.service.js","sourceRoot":"","sources":["../../../src/modules/promotions.ee/promotion-change.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAMA,wDAA6C;AAC7C,gCAA6E;AAC7E,gCAAkC;AAClC,kDAA8D;AAC9D,+CAAyC;AACzC,6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, type PromotionChanges } from '@n8n/api-types';
|
|
2
2
|
import { AuthenticatedRequest } from '@n8n/db';
|
|
3
3
|
import type { Response } from 'express';
|
|
4
4
|
import { PromotionChangeService } from './promotion-change.service';
|
|
5
5
|
export declare class PromotionChangesController {
|
|
6
6
|
private readonly changeService;
|
|
7
7
|
constructor(changeService: PromotionChangeService);
|
|
8
|
-
getChanges(req: AuthenticatedRequest, _res: Response, projectId: string, query: PromotionChangesQueryDto): Promise<
|
|
8
|
+
getChanges(req: AuthenticatedRequest, _res: Response, projectId: string, direction: string, query: PromotionChangesQueryDto): Promise<PromotionChanges>;
|
|
9
9
|
}
|
|
@@ -16,31 +16,29 @@ exports.PromotionChangesController = void 0;
|
|
|
16
16
|
const api_types_1 = require("@n8n/api-types");
|
|
17
17
|
const constants_1 = require("@n8n/constants");
|
|
18
18
|
const decorators_1 = require("@n8n/decorators");
|
|
19
|
+
const not_found_error_1 = require("../../errors/response-errors/not-found.error");
|
|
19
20
|
const promotion_change_service_1 = require("./promotion-change.service");
|
|
20
21
|
let PromotionChangesController = class PromotionChangesController {
|
|
21
22
|
constructor(changeService) {
|
|
22
23
|
this.changeService = changeService;
|
|
23
24
|
}
|
|
24
|
-
async getChanges(req, _res, projectId, query) {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
.sort((a, b) => {
|
|
30
|
-
const comparison = (a[query.sort] ?? '').localeCompare(b[query.sort] ?? '');
|
|
31
|
-
return (query.order === 'desc' ? -comparison : comparison) || a.id.localeCompare(b.id);
|
|
32
|
-
});
|
|
25
|
+
async getChanges(req, _res, projectId, direction, query) {
|
|
26
|
+
const parsed = api_types_1.promotionDirectionSchema.safeParse(direction);
|
|
27
|
+
if (!parsed.success)
|
|
28
|
+
throw new not_found_error_1.NotFoundError(`Unknown promotion direction: ${direction}`);
|
|
29
|
+
return await this.changeService.getChanges(req.user, projectId, parsed.data, query);
|
|
33
30
|
}
|
|
34
31
|
};
|
|
35
32
|
exports.PromotionChangesController = PromotionChangesController;
|
|
36
33
|
__decorate([
|
|
37
|
-
(0, decorators_1.Get)('/:projectId/changes'),
|
|
34
|
+
(0, decorators_1.Get)('/:projectId/changes/:direction'),
|
|
38
35
|
(0, decorators_1.ProjectScope)('project:export'),
|
|
39
36
|
(0, decorators_1.Licensed)(constants_1.LICENSE_FEATURES.GIT_CONNECTIONS),
|
|
40
37
|
__param(2, (0, decorators_1.Param)('projectId')),
|
|
41
|
-
__param(3, decorators_1.
|
|
38
|
+
__param(3, (0, decorators_1.Param)('direction')),
|
|
39
|
+
__param(4, decorators_1.Query),
|
|
42
40
|
__metadata("design:type", Function),
|
|
43
|
-
__metadata("design:paramtypes", [Object, Object, String, api_types_1.PromotionChangesQueryDto]),
|
|
41
|
+
__metadata("design:paramtypes", [Object, Object, String, String, api_types_1.PromotionChangesQueryDto]),
|
|
44
42
|
__metadata("design:returntype", Promise)
|
|
45
43
|
], PromotionChangesController.prototype, "getChanges", null);
|
|
46
44
|
exports.PromotionChangesController = PromotionChangesController = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promotion-changes.controller.js","sourceRoot":"","sources":["../../../src/modules/promotions.ee/promotion-changes.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"promotion-changes.controller.js","sourceRoot":"","sources":["../../../src/modules/promotions.ee/promotion-changes.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,8CAIwB;AACxB,8CAAkD;AAElD,gDAA4F;AAG5F,8EAAyE;AAEzE,yEAAoE;AAG7D,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACtC,YAA6B,aAAqC;6BAArC,aAAa;IAA2B,CAAC;IAKhE,AAAN,KAAK,CAAC,UAAU,CACf,GAAyB,EACzB,IAAc,EACM,SAAiB,EACjB,SAAiB,EAC9B,KAA+B;QAEtC,MAAM,MAAM,GAAG,oCAAwB,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAE7D,IAAI,CAAC,MAAM,CAAC,OAAO;YAAE,MAAM,IAAI,+BAAa,CAAC,gCAAgC,SAAS,EAAE,CAAC,CAAC;QAC1F,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACrF,CAAC;CACD,CAAA;;AAZM;IAHL,IAAA,gBAAG,EAAC,gCAAgC,CAAC;IACrC,IAAA,yBAAY,EAAC,gBAAgB,CAAC;IAC9B,IAAA,qBAAQ,EAAC,4BAAgB,CAAC,eAAe,CAAC;IAIzC,WAAA,IAAA,kBAAK,EAAC,WAAW,CAAC,CAAA;IAClB,WAAA,IAAA,kBAAK,EAAC,WAAW,CAAC,CAAA;IAClB,WAAA,kBAAK,CAAA;;qEAAQ,oCAAwB;;4DAMtC;qCAjBW,0BAA0B;IADtC,IAAA,2BAAc,EAAC,aAAa,CAAC;qCAEe,iDAAsB;GADtD,0BAA0B,CAkBtC"}
|
|
@@ -44,7 +44,48 @@ export declare class PromotionConnectionsService {
|
|
|
44
44
|
findOne(id: string): Promise<PromotionConnectionPublicDto>;
|
|
45
45
|
list(offset: number, limit: number, filter: PromotionConnectionFilter): Promise<{
|
|
46
46
|
count: number;
|
|
47
|
-
data:
|
|
47
|
+
data: {
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
scope: "instance" | "projects";
|
|
51
|
+
target: {
|
|
52
|
+
schemaVersion: 1;
|
|
53
|
+
remoteUrl: string;
|
|
54
|
+
};
|
|
55
|
+
provider: {
|
|
56
|
+
id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
type: "git";
|
|
59
|
+
authType: "ssh-key" | "token";
|
|
60
|
+
createdAt: string;
|
|
61
|
+
updatedAt: string;
|
|
62
|
+
};
|
|
63
|
+
createdAt: string;
|
|
64
|
+
updatedAt: string;
|
|
65
|
+
configs: {
|
|
66
|
+
apply?: {
|
|
67
|
+
id: string;
|
|
68
|
+
name: string;
|
|
69
|
+
createdAt: string;
|
|
70
|
+
updatedAt: string;
|
|
71
|
+
settings: {
|
|
72
|
+
schemaVersion: 1;
|
|
73
|
+
branchName: string;
|
|
74
|
+
};
|
|
75
|
+
} | undefined;
|
|
76
|
+
promote?: {
|
|
77
|
+
id: string;
|
|
78
|
+
name: string;
|
|
79
|
+
createdAt: string;
|
|
80
|
+
updatedAt: string;
|
|
81
|
+
settings: {
|
|
82
|
+
schemaVersion: 1;
|
|
83
|
+
baseBranchName: string;
|
|
84
|
+
createBranchOnPromotion: boolean;
|
|
85
|
+
};
|
|
86
|
+
} | undefined;
|
|
87
|
+
};
|
|
88
|
+
}[];
|
|
48
89
|
}>;
|
|
49
90
|
update(id: string, input: UpdatePromotionConnectionDto): Promise<PromotionConnectionPublicDto>;
|
|
50
91
|
delete(id: string): Promise<void>;
|
|
@@ -55,10 +96,15 @@ export declare class PromotionConnectionsService {
|
|
|
55
96
|
addProject({ user, connectionId, projectId, }: ManageProjectLinkOptions): Promise<PromotionConnectionProjectPublicDto>;
|
|
56
97
|
removeProject({ user, connectionId, projectId }: ManageProjectLinkOptions): Promise<void>;
|
|
57
98
|
getEntity(id: string): Promise<PromotionConnection>;
|
|
58
|
-
toPublic(connection: PromotionConnection, configs: PromotionConfig[]): PromotionConnectionPublicDto
|
|
99
|
+
toPublic(connection: PromotionConnection, configs: PromotionConfig[]): Promise<PromotionConnectionPublicDto>;
|
|
100
|
+
private toSummary;
|
|
101
|
+
private connectionFields;
|
|
59
102
|
private toConfigsPublic;
|
|
103
|
+
private toConfigsSummary;
|
|
60
104
|
private toConfigPublic;
|
|
61
105
|
private configFields;
|
|
106
|
+
private configSummaryFields;
|
|
107
|
+
private checkoutStateFor;
|
|
62
108
|
private insertConfig;
|
|
63
109
|
private replaceConfig;
|
|
64
110
|
private assertLinkableScope;
|
|
@@ -10,6 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.PromotionConnectionsService = void 0;
|
|
13
|
+
const api_types_1 = require("@n8n/api-types");
|
|
13
14
|
const backend_common_1 = require("@n8n/backend-common");
|
|
14
15
|
const db_1 = require("@n8n/db");
|
|
15
16
|
const di_1 = require("@n8n/di");
|
|
@@ -61,12 +62,12 @@ let PromotionConnectionsService = class PromotionConnectionsService {
|
|
|
61
62
|
}
|
|
62
63
|
return { connection, configs };
|
|
63
64
|
}));
|
|
64
|
-
return this.toPublic({ ...created.connection, provider }, created.configs);
|
|
65
|
+
return await this.toPublic({ ...created.connection, provider }, created.configs);
|
|
65
66
|
}
|
|
66
67
|
async findOne(id) {
|
|
67
68
|
const connection = await this.getEntity(id);
|
|
68
69
|
const configs = await this.configRepository.findByConnectionIds([id]);
|
|
69
|
-
return this.toPublic(connection, configs);
|
|
70
|
+
return await this.toPublic(connection, configs);
|
|
70
71
|
}
|
|
71
72
|
async list(offset, limit, filter) {
|
|
72
73
|
const { data, count } = await this.connectionRepository.listConnections({
|
|
@@ -77,7 +78,7 @@ let PromotionConnectionsService = class PromotionConnectionsService {
|
|
|
77
78
|
const configs = await this.configRepository.findByConnectionIds(data.map(({ id }) => id));
|
|
78
79
|
return {
|
|
79
80
|
count,
|
|
80
|
-
data: data.map((connection) => this.
|
|
81
|
+
data: data.map((connection) => this.toSummary(connection, configs.filter((config) => config.connectionId === connection.id))),
|
|
81
82
|
};
|
|
82
83
|
}
|
|
83
84
|
async update(id, input) {
|
|
@@ -105,14 +106,14 @@ let PromotionConnectionsService = class PromotionConnectionsService {
|
|
|
105
106
|
await this.purgeCache(config.id);
|
|
106
107
|
}
|
|
107
108
|
async upsertConfig(connectionId, write) {
|
|
108
|
-
await this.getEntity(connectionId);
|
|
109
|
+
const connection = await this.getEntity(connectionId);
|
|
109
110
|
await this.gitService.validateBranchName((0, promotions_git_utils_1.checkoutBranchName)(write.config));
|
|
110
111
|
const { direction } = write.config;
|
|
111
112
|
const existing = await this.configRepository.findByConnectionAndDirection(connectionId, direction);
|
|
112
113
|
const stored = existing
|
|
113
114
|
? await this.replaceConfig(existing.id, write)
|
|
114
115
|
: await (0, promotion_conflicts_1.mapPromotionConflicts)(async () => await this.insertConfig(connectionId, write));
|
|
115
|
-
return this.toConfigPublic(stored);
|
|
116
|
+
return await this.toConfigPublic(connection, stored);
|
|
116
117
|
}
|
|
117
118
|
async deleteConfig(connectionId, direction) {
|
|
118
119
|
await this.getEntity(connectionId);
|
|
@@ -155,43 +156,78 @@ let PromotionConnectionsService = class PromotionConnectionsService {
|
|
|
155
156
|
throw new not_found_error_1.NotFoundError('Promotion connection not found');
|
|
156
157
|
return connection;
|
|
157
158
|
}
|
|
158
|
-
toPublic(connection, configs) {
|
|
159
|
+
async toPublic(connection, configs) {
|
|
160
|
+
return {
|
|
161
|
+
...this.connectionFields(connection),
|
|
162
|
+
configs: await this.toConfigsPublic(connection, configs),
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
toSummary(connection, configs) {
|
|
166
|
+
return {
|
|
167
|
+
...this.connectionFields(connection),
|
|
168
|
+
configs: this.toConfigsSummary(configs),
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
connectionFields(connection) {
|
|
159
172
|
return {
|
|
160
173
|
id: connection.id,
|
|
161
174
|
name: connection.name,
|
|
162
175
|
scope: connection.scope,
|
|
163
176
|
target: connection.target,
|
|
164
177
|
provider: this.providersService.toSummary(connection.provider),
|
|
165
|
-
configs: this.toConfigsPublic(configs),
|
|
166
178
|
createdAt: connection.createdAt.toISOString(),
|
|
167
179
|
updatedAt: connection.updatedAt.toISOString(),
|
|
168
180
|
};
|
|
169
181
|
}
|
|
170
|
-
toConfigsPublic(configs) {
|
|
182
|
+
async toConfigsPublic(connection, configs) {
|
|
171
183
|
const byDirection = {};
|
|
172
184
|
for (const config of configs) {
|
|
173
185
|
const resolved = (0, promotion_config_settings_1.resolveStoredConfig)(config);
|
|
174
186
|
if (!resolved)
|
|
175
187
|
continue;
|
|
188
|
+
const fields = await this.configFields(connection, config, resolved);
|
|
176
189
|
if (resolved.direction === 'apply') {
|
|
177
|
-
byDirection.apply = { ...
|
|
190
|
+
byDirection.apply = { ...fields, settings: resolved.settings };
|
|
178
191
|
}
|
|
179
192
|
else {
|
|
180
|
-
byDirection.promote = { ...
|
|
193
|
+
byDirection.promote = { ...fields, settings: resolved.settings };
|
|
181
194
|
}
|
|
182
195
|
}
|
|
183
196
|
return byDirection;
|
|
184
197
|
}
|
|
185
|
-
|
|
198
|
+
toConfigsSummary(configs) {
|
|
199
|
+
const byDirection = {};
|
|
200
|
+
for (const config of configs) {
|
|
201
|
+
const resolved = (0, promotion_config_settings_1.resolveStoredConfig)(config);
|
|
202
|
+
if (!resolved)
|
|
203
|
+
continue;
|
|
204
|
+
const fields = this.configSummaryFields(config);
|
|
205
|
+
if (resolved.direction === 'apply') {
|
|
206
|
+
byDirection.apply = { ...fields, settings: resolved.settings };
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
byDirection.promote = { ...fields, settings: resolved.settings };
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return byDirection;
|
|
213
|
+
}
|
|
214
|
+
async toConfigPublic(connection, config) {
|
|
186
215
|
const resolved = (0, promotion_config_settings_1.resolveStoredConfig)(config);
|
|
187
216
|
if (!resolved) {
|
|
188
217
|
throw new bad_request_error_1.BadRequestError('The stored promotion configuration cannot be read');
|
|
189
218
|
}
|
|
219
|
+
const fields = await this.configFields(connection, config, resolved);
|
|
190
220
|
return resolved.direction === 'apply'
|
|
191
|
-
? { ...
|
|
192
|
-
: { ...
|
|
221
|
+
? { ...fields, settings: resolved.settings }
|
|
222
|
+
: { ...fields, settings: resolved.settings };
|
|
223
|
+
}
|
|
224
|
+
async configFields(connection, config, resolved) {
|
|
225
|
+
return {
|
|
226
|
+
...this.configSummaryFields(config),
|
|
227
|
+
checkout: await this.checkoutStateFor(connection, config, resolved),
|
|
228
|
+
};
|
|
193
229
|
}
|
|
194
|
-
|
|
230
|
+
configSummaryFields(config) {
|
|
195
231
|
return {
|
|
196
232
|
id: config.id,
|
|
197
233
|
name: config.name,
|
|
@@ -199,6 +235,22 @@ let PromotionConnectionsService = class PromotionConnectionsService {
|
|
|
199
235
|
updatedAt: config.updatedAt.toISOString(),
|
|
200
236
|
};
|
|
201
237
|
}
|
|
238
|
+
async checkoutStateFor(connection, config, resolved) {
|
|
239
|
+
const { repositoryFolder } = this.workingDirectory.paths(config.id);
|
|
240
|
+
const hasCheckout = await this.gitService.hasCheckout(repositoryFolder);
|
|
241
|
+
if (!hasCheckout)
|
|
242
|
+
return { hasCheckout: false, matchesConfig: false };
|
|
243
|
+
const target = api_types_1.promotionConnectionTargetSchema.safeParse(connection.target);
|
|
244
|
+
if (!target.success)
|
|
245
|
+
return { hasCheckout, matchesConfig: false };
|
|
246
|
+
const matchesConfig = await this.workingDirectory.matchesDescriptor((0, promotions_git_utils_1.buildCacheDescriptor)({
|
|
247
|
+
connectionId: connection.id,
|
|
248
|
+
configId: config.id,
|
|
249
|
+
target: target.data,
|
|
250
|
+
config: resolved,
|
|
251
|
+
}));
|
|
252
|
+
return { hasCheckout, matchesConfig };
|
|
253
|
+
}
|
|
202
254
|
async insertConfig(connectionId, { config, name }, ctx = {}) {
|
|
203
255
|
return await this.configRepository.insertConfig({
|
|
204
256
|
connectionId,
|