n8n 2.11.2 → 2.12.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/build.tsbuildinfo +1 -1
- package/dist/chat/chat-service.js +1 -1
- package/dist/chat/chat-service.js.map +1 -1
- package/dist/chat/utils.d.ts +1 -0
- package/dist/chat/utils.js +7 -0
- package/dist/chat/utils.js.map +1 -1
- package/dist/commands/base-command.js +1 -1
- package/dist/commands/base-command.js.map +1 -1
- package/dist/controllers/project.controller.js +0 -2
- package/dist/controllers/project.controller.js.map +1 -1
- package/dist/controllers/users.controller.d.ts +1 -3
- package/dist/controllers/users.controller.js +1 -7
- package/dist/controllers/users.controller.js.map +1 -1
- package/dist/credentials/credential-resolution-provider.interface.d.ts +1 -2
- package/dist/credentials/credentials.service.d.ts +1 -1
- package/dist/credentials/credentials.service.js +9 -4
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/credentials/dynamic-credentials-proxy.d.ts +1 -1
- package/dist/credentials/dynamic-credentials-proxy.js +2 -2
- package/dist/credentials/dynamic-credentials-proxy.js.map +1 -1
- package/dist/credentials/validation.d.ts +6 -1
- package/dist/credentials/validation.js +4 -3
- package/dist/credentials/validation.js.map +1 -1
- package/dist/credentials-helper.d.ts +8 -7
- package/dist/credentials-helper.js +22 -46
- package/dist/credentials-helper.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-audit.d.ts +5 -1
- package/dist/eventbus/event-message-classes/event-message-audit.js.map +1 -1
- package/dist/eventbus/event-message-classes/index.d.ts +2 -2
- package/dist/eventbus/event-message-classes/index.js +1 -0
- package/dist/eventbus/event-message-classes/index.js.map +1 -1
- package/dist/events/maps/relay.event-map.d.ts +9 -1
- package/dist/events/relays/log-streaming.event-relay.d.ts +1 -0
- package/dist/events/relays/log-streaming.event-relay.js +13 -0
- package/dist/events/relays/log-streaming.event-relay.js.map +1 -1
- package/dist/events/relays/telemetry.event-relay.d.ts +11 -3
- package/dist/events/relays/telemetry.event-relay.js +125 -4
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/executions/execution-redaction-proxy.service.d.ts +3 -3
- package/dist/executions/execution-redaction-proxy.service.js +5 -0
- package/dist/executions/execution-redaction-proxy.service.js.map +1 -1
- package/dist/executions/execution-redaction.d.ts +13 -2
- package/dist/executions/execution.service.d.ts +1 -1
- package/dist/executions/execution.service.js +21 -3
- package/dist/executions/execution.service.js.map +1 -1
- package/dist/license.d.ts +4 -0
- package/dist/license.js +40 -0
- package/dist/license.js.map +1 -1
- package/dist/modules/breaking-changes/breaking-changes.controller.js +1 -1
- package/dist/modules/breaking-changes/breaking-changes.controller.js.map +1 -1
- package/dist/modules/breaking-changes/breaking-changes.module.js +5 -1
- package/dist/modules/breaking-changes/breaking-changes.module.js.map +1 -1
- package/dist/modules/breaking-changes/breaking-changes.service.js +6 -4
- package/dist/modules/breaking-changes/breaking-changes.service.js.map +1 -1
- package/dist/modules/breaking-changes/rules/index.d.ts +16 -4
- package/dist/modules/breaking-changes/rules/index.js +16 -4
- package/dist/modules/breaking-changes/rules/index.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/binary-data-storage.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/binary-data-storage.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/cli-replace-update-workflow-command.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/cli-replace-update-workflow-command.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/disabled-nodes.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/disabled-nodes.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/dotenv-upgrade.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/dotenv-upgrade.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/file-access.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/file-access.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/oauth-callback-auth.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/oauth-callback-auth.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/process-env-access.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/process-env-access.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/pyodide-removed.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/pyodide-removed.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/queue-worker-max-stalled-count.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/queue-worker-max-stalled-count.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/removed-nodes.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/removed-nodes.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/settings-file-permissions.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/settings-file-permissions.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/start-node-removed.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/start-node-removed.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/task-runner-docker-image.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/task-runner-docker-image.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/tunnel-option.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/tunnel-option.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/wait-node-subworkflow.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/wait-node-subworkflow.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/workflow-hooks-deprecated.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/workflow-hooks-deprecated.rule.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-agent.entity.d.ts +11 -1
- package/dist/modules/chat-hub/chat-hub-agent.entity.js +8 -0
- package/dist/modules/chat-hub/chat-hub-agent.entity.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-agent.service.d.ts +22 -3
- package/dist/modules/chat-hub/chat-hub-agent.service.js +156 -6
- package/dist/modules/chat-hub/chat-hub-agent.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-event-relay.service.d.ts +10 -0
- package/dist/modules/chat-hub/chat-hub-event-relay.service.js +47 -0
- package/dist/modules/chat-hub/chat-hub-event-relay.service.js.map +1 -0
- package/dist/modules/chat-hub/chat-hub-execution-watcher.service.js +1 -1
- package/dist/modules/chat-hub/chat-hub-execution-watcher.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-execution.service.d.ts +2 -1
- package/dist/modules/chat-hub/chat-hub-execution.service.js +25 -3
- package/dist/modules/chat-hub/chat-hub-execution.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-title.service.js +2 -1
- package/dist/modules/chat-hub/chat-hub-title.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-upload.middleware.d.ts +7 -0
- package/dist/modules/chat-hub/chat-hub-upload.middleware.js +43 -0
- package/dist/modules/chat-hub/chat-hub-upload.middleware.js.map +1 -0
- package/dist/modules/chat-hub/chat-hub-workflow.service.d.ts +20 -5
- package/dist/modules/chat-hub/chat-hub-workflow.service.js +292 -14
- package/dist/modules/chat-hub/chat-hub-workflow.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.attachment.service.d.ts +1 -0
- package/dist/modules/chat-hub/chat-hub.attachment.service.js +11 -0
- package/dist/modules/chat-hub/chat-hub.attachment.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.constants.d.ts +5 -1
- package/dist/modules/chat-hub/chat-hub.constants.js +10 -1
- package/dist/modules/chat-hub/chat-hub.constants.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.controller.d.ts +5 -1
- package/dist/modules/chat-hub/chat-hub.controller.js +44 -10
- package/dist/modules/chat-hub/chat-hub.controller.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.module.d.ts +2 -1
- package/dist/modules/chat-hub/chat-hub.module.js +13 -3
- package/dist/modules/chat-hub/chat-hub.module.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.service.js +1 -1
- package/dist/modules/chat-hub/chat-hub.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.settings.controller.d.ts +2 -1
- package/dist/modules/chat-hub/chat-hub.settings.controller.js +20 -0
- package/dist/modules/chat-hub/chat-hub.settings.controller.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.settings.service.d.ts +5 -1
- package/dist/modules/chat-hub/chat-hub.settings.service.js +34 -0
- package/dist/modules/chat-hub/chat-hub.settings.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.types.d.ts +19 -8
- package/dist/modules/chat-hub/chat-hub.types.js.map +1 -1
- package/dist/modules/community-packages/npm-utils.js +3 -3
- package/dist/modules/community-packages/npm-utils.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/identifier-interface.d.ts +3 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/identifier-interface.js +6 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/identifier-interface.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.js +2 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/errors/credential-resolver-not-configured.error.d.ts +4 -0
- package/dist/modules/dynamic-credentials.ee/errors/credential-resolver-not-configured.error.js +12 -0
- package/dist/modules/dynamic-credentials.ee/errors/credential-resolver-not-configured.error.js.map +1 -0
- package/dist/modules/dynamic-credentials.ee/errors/credential-resolver-not-found.error.d.ts +4 -0
- package/dist/modules/dynamic-credentials.ee/errors/credential-resolver-not-found.error.js +9 -1
- package/dist/modules/dynamic-credentials.ee/errors/credential-resolver-not-found.error.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/errors/missing-execution-context.error.d.ts +4 -0
- package/dist/modules/dynamic-credentials.ee/errors/missing-execution-context.error.js +12 -0
- package/dist/modules/dynamic-credentials.ee/errors/missing-execution-context.error.js.map +1 -0
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.d.ts +4 -4
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.js +10 -7
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.js +5 -8
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.d.ts +4 -3
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js +37 -42
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/resolver-config-expression.service.d.ts +1 -1
- package/dist/modules/dynamic-credentials.ee/services/resolver-config-expression.service.js +2 -4
- package/dist/modules/dynamic-credentials.ee/services/resolver-config-expression.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/workflow-status.controller.js +6 -2
- package/dist/modules/dynamic-credentials.ee/workflow-status.controller.js.map +1 -1
- package/dist/modules/external-secrets.ee/external-secrets-providers.ee.js +2 -0
- package/dist/modules/external-secrets.ee/external-secrets-providers.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/external-secrets.controller.ee.js +1 -1
- package/dist/modules/external-secrets.ee/external-secrets.controller.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/one-password.d.ts +25 -0
- package/dist/modules/external-secrets.ee/providers/one-password.js +153 -0
- package/dist/modules/external-secrets.ee/providers/one-password.js.map +1 -0
- package/dist/modules/external-secrets.ee/providers/vault.js +6 -1
- package/dist/modules/external-secrets.ee/providers/vault.js.map +1 -1
- package/dist/modules/external-secrets.ee/secrets-providers-completions.controller.ee.d.ts +1 -0
- package/dist/modules/external-secrets.ee/secrets-providers-completions.controller.ee.js +15 -4
- package/dist/modules/external-secrets.ee/secrets-providers-completions.controller.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/secrets-providers-connections.controller.ee.js +1 -1
- package/dist/modules/external-secrets.ee/secrets-providers-connections.service.ee.d.ts +1 -0
- package/dist/modules/external-secrets.ee/secrets-providers-connections.service.ee.js +5 -0
- package/dist/modules/external-secrets.ee/secrets-providers-connections.service.ee.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +14 -4
- package/dist/modules/mcp/mcp.service.js +81 -6
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/mcp.types.d.ts +1 -1
- package/dist/modules/mcp/tools/execute-workflow.tool.d.ts +7 -8
- package/dist/modules/mcp/tools/execute-workflow.tool.js +26 -37
- package/dist/modules/mcp/tools/execute-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/get-execution.tool.d.ts +17 -0
- package/dist/modules/mcp/tools/get-execution.tool.js +126 -0
- package/dist/modules/mcp/tools/get-execution.tool.js.map +1 -0
- package/dist/modules/mcp/tools/get-workflow-details.tool.js +2 -5
- package/dist/modules/mcp/tools/get-workflow-details.tool.js.map +1 -1
- package/dist/modules/mcp/tools/publish-workflow.tool.d.ts +18 -0
- package/dist/modules/mcp/tools/publish-workflow.tool.js +91 -0
- package/dist/modules/mcp/tools/publish-workflow.tool.js.map +1 -0
- package/dist/modules/mcp/tools/unpublish-workflow.tool.d.ts +15 -0
- package/dist/modules/mcp/tools/unpublish-workflow.tool.js +81 -0
- package/dist/modules/mcp/tools/unpublish-workflow.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/constants.d.ts +1 -0
- package/dist/modules/mcp/tools/workflow-builder/constants.js +13 -0
- package/dist/modules/mcp/tools/workflow-builder/constants.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.d.ts +16 -0
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +167 -0
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.d.ts +14 -0
- package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.js +65 -0
- package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/delete-workflow.tool.d.ts +10 -0
- package/dist/modules/mcp/tools/workflow-builder/delete-workflow.tool.js +75 -0
- package/dist/modules/mcp/tools/workflow-builder/delete-workflow.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.d.ts +10 -0
- package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.js +100 -0
- package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.d.ts +28 -0
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js +102 -0
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.d.ts +9 -0
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js +60 -0
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.d.ts +1 -0
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +30 -0
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.d.ts +2 -0
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js +61 -0
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.d.ts +10 -0
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js +97 -0
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.d.ts +17 -0
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +164 -0
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.d.ts +9 -0
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js +119 -0
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/workflow-builder-tools.service.d.ts +17 -0
- package/dist/modules/mcp/tools/workflow-builder/workflow-builder-tools.service.js +117 -0
- package/dist/modules/mcp/tools/workflow-builder/workflow-builder-tools.service.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-validation.utils.d.ts +8 -0
- package/dist/modules/mcp/tools/workflow-validation.utils.js +20 -0
- package/dist/modules/mcp/tools/workflow-validation.utils.js.map +1 -0
- package/dist/modules/redaction/executions/execution-redaction.interfaces.d.ts +11 -0
- package/dist/modules/redaction/executions/execution-redaction.interfaces.js +3 -0
- package/dist/modules/redaction/executions/execution-redaction.interfaces.js.map +1 -0
- package/dist/modules/redaction/executions/execution-redaction.service.d.ts +11 -8
- package/dist/modules/redaction/executions/execution-redaction.service.js +61 -60
- package/dist/modules/redaction/executions/execution-redaction.service.js.map +1 -1
- package/dist/modules/redaction/executions/strategies/full-item-redaction.strategy.d.ts +9 -0
- package/dist/modules/redaction/executions/strategies/full-item-redaction.strategy.js +82 -0
- package/dist/modules/redaction/executions/strategies/full-item-redaction.strategy.js.map +1 -0
- package/dist/modules/redaction/executions/strategies/node-defined-field-redaction.strategy.d.ts +17 -0
- package/dist/modules/redaction/executions/strategies/node-defined-field-redaction.strategy.js +127 -0
- package/dist/modules/redaction/executions/strategies/node-defined-field-redaction.strategy.js.map +1 -0
- package/dist/oauth/oauth.service.d.ts +1 -0
- package/dist/oauth/oauth.service.js +81 -4
- package/dist/oauth/oauth.service.js.map +1 -1
- package/dist/posthog/index.d.ts +9 -0
- package/dist/posthog/index.js +19 -0
- package/dist/posthog/index.js.map +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.service.js +14 -5
- package/dist/public-api/v1/handlers/credentials/credentials.service.js.map +1 -1
- package/dist/public-api/v1/handlers/executions/executions.handler.js +13 -0
- package/dist/public-api/v1/handlers/executions/executions.handler.js.map +1 -1
- package/dist/response-helper.d.ts +3 -2
- package/dist/response-helper.js +14 -8
- package/dist/response-helper.js.map +1 -1
- package/dist/services/cache/cache.constants.d.ts +1 -0
- package/dist/services/cache/cache.constants.js +5 -0
- package/dist/services/cache/cache.constants.js.map +1 -0
- package/dist/services/cache/cache.service.d.ts +2 -4
- package/dist/services/cache/cache.service.js +26 -30
- package/dist/services/cache/cache.service.js.map +1 -1
- package/dist/services/credentials-tester.service.js +1 -2
- package/dist/services/credentials-tester.service.js.map +1 -1
- package/dist/services/project.service.ee.d.ts +1 -4
- package/dist/services/project.service.ee.js +1 -18
- package/dist/services/project.service.ee.js.map +1 -1
- package/dist/services/ssrf/dns-resolver.d.ts +13 -0
- package/dist/services/ssrf/dns-resolver.js +93 -0
- package/dist/services/ssrf/dns-resolver.js.map +1 -0
- package/dist/services/ssrf/hostname-matcher.d.ts +6 -0
- package/dist/services/ssrf/hostname-matcher.js +38 -0
- package/dist/services/ssrf/hostname-matcher.js.map +1 -0
- package/dist/services/ssrf/in-memory-dns-cache.service.d.ts +11 -0
- package/dist/services/ssrf/in-memory-dns-cache.service.js +61 -0
- package/dist/services/ssrf/in-memory-dns-cache.service.js.map +1 -0
- package/dist/services/ssrf/ip-range-builder.d.ts +10 -0
- package/dist/services/ssrf/ip-range-builder.js +52 -0
- package/dist/services/ssrf/ip-range-builder.js.map +1 -0
- package/dist/services/ssrf/ssrf-blocked-ip.error.d.ts +6 -0
- package/dist/services/ssrf/ssrf-blocked-ip.error.js +16 -0
- package/dist/services/ssrf/ssrf-blocked-ip.error.js.map +1 -0
- package/dist/services/ssrf/ssrf-protection.service.d.ts +26 -0
- package/dist/services/ssrf/ssrf-protection.service.js +159 -0
- package/dist/services/ssrf/ssrf-protection.service.js.map +1 -0
- package/dist/services/workflow-statistics.service.js +6 -8
- package/dist/services/workflow-statistics.service.js.map +1 -1
- package/dist/task-runners/task-runner-module.js +0 -1
- package/dist/task-runners/task-runner-module.js.map +1 -1
- package/dist/task-runners/task-runner-process-js.js +1 -1
- package/dist/task-runners/task-runner-process-js.js.map +1 -1
- package/dist/task-runners/task-runner-process-py.js +15 -3
- package/dist/task-runners/task-runner-process-py.js.map +1 -1
- package/dist/telemetry/index.d.ts +6 -1
- package/dist/telemetry/index.js +76 -9
- package/dist/telemetry/index.js.map +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +4 -0
- package/dist/utils.js.map +1 -1
- package/dist/workflow-execute-additional-data.js +7 -0
- package/dist/workflow-execute-additional-data.js.map +1 -1
- package/dist/workflow-helpers.js +3 -0
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflows/workflow-creation.service.d.ts +38 -0
- package/dist/workflows/workflow-creation.service.js +185 -0
- package/dist/workflows/workflow-creation.service.js.map +1 -0
- package/dist/workflows/workflow-finder.service.d.ts +1 -0
- package/dist/workflows/workflow-finder.service.js +10 -0
- package/dist/workflows/workflow-finder.service.js.map +1 -1
- package/dist/workflows/workflow-validation.service.d.ts +5 -3
- package/dist/workflows/workflow-validation.service.js +59 -2
- package/dist/workflows/workflow-validation.service.js.map +1 -1
- package/dist/workflows/workflow.service.d.ts +1 -0
- package/dist/workflows/workflow.service.js +11 -0
- package/dist/workflows/workflow.service.js.map +1 -1
- package/dist/workflows/workflows.controller.d.ts +5 -15
- package/dist/workflows/workflows.controller.js +16 -106
- package/dist/workflows/workflows.controller.js.map +1 -1
- package/package.json +21 -20
- package/dist/errors/cache-errors/malformed-refresh-value.error.d.ts +0 -4
- package/dist/errors/cache-errors/malformed-refresh-value.error.js +0 -11
- package/dist/errors/cache-errors/malformed-refresh-value.error.js.map +0 -1
- package/dist/modules/breaking-changes/rules/v2/index.d.ts +0 -9
- package/dist/modules/breaking-changes/rules/v2/index.js +0 -41
- package/dist/modules/breaking-changes/rules/v2/index.js.map +0 -1
- package/dist/modules/breaking-changes/rules/v2/task-runners.rule.d.ts +0 -10
- package/dist/modules/breaking-changes/rules/v2/task-runners.rule.js +0 -73
- package/dist/modules/breaking-changes/rules/v2/task-runners.rule.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChatHubConversationModel, ChatHubProvider, ChatMessageId, ChatSessionId, ChatAttachment } from '@n8n/api-types';
|
|
1
|
+
import type { ChatHubConversationModel, ChatHubProvider, ChatMessageId, ChatSessionId, ChatAttachment, ChatHubLLMProvider } from '@n8n/api-types';
|
|
2
2
|
import type { INodeCredentials, IRunExecutionData, IWorkflowBase } from 'n8n-workflow';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
export interface ModelWithCredentials {
|
|
@@ -96,31 +96,31 @@ export declare const chatTriggerParamsShape: z.ZodObject<{
|
|
|
96
96
|
allowFileUploads?: boolean | undefined;
|
|
97
97
|
allowedFilesMimeTypes?: string | undefined;
|
|
98
98
|
} | undefined;
|
|
99
|
-
agentName?: string | undefined;
|
|
100
|
-
agentDescription?: string | undefined;
|
|
101
|
-
agentIcon?: import("n8n-workflow").IconOrEmoji | undefined;
|
|
102
99
|
suggestedPrompts?: {
|
|
103
100
|
prompts?: {
|
|
104
101
|
text: string;
|
|
105
102
|
icon?: import("n8n-workflow").IconOrEmoji | undefined;
|
|
106
103
|
}[] | undefined;
|
|
107
104
|
} | undefined;
|
|
105
|
+
agentName?: string | undefined;
|
|
106
|
+
agentDescription?: string | undefined;
|
|
107
|
+
agentIcon?: import("n8n-workflow").IconOrEmoji | undefined;
|
|
108
108
|
}, {
|
|
109
109
|
options?: {
|
|
110
110
|
responseMode?: "lastNode" | "responseNode" | "streaming" | "responseNodes" | undefined;
|
|
111
111
|
allowFileUploads?: boolean | undefined;
|
|
112
112
|
allowedFilesMimeTypes?: string | undefined;
|
|
113
113
|
} | undefined;
|
|
114
|
-
agentName?: string | undefined;
|
|
115
|
-
availableInChat?: boolean | undefined;
|
|
116
|
-
agentDescription?: string | undefined;
|
|
117
|
-
agentIcon?: import("n8n-workflow").IconOrEmoji | undefined;
|
|
118
114
|
suggestedPrompts?: {
|
|
119
115
|
prompts?: {
|
|
120
116
|
text: string;
|
|
121
117
|
icon?: import("n8n-workflow").IconOrEmoji | undefined;
|
|
122
118
|
}[] | undefined;
|
|
123
119
|
} | undefined;
|
|
120
|
+
availableInChat?: boolean | undefined;
|
|
121
|
+
agentName?: string | undefined;
|
|
122
|
+
agentDescription?: string | undefined;
|
|
123
|
+
agentIcon?: import("n8n-workflow").IconOrEmoji | undefined;
|
|
124
124
|
}>;
|
|
125
125
|
export type ChatTriggerParams = z.infer<typeof chatTriggerParamsShape>;
|
|
126
126
|
export type PreparedChatWorkflow = {
|
|
@@ -128,4 +128,15 @@ export type PreparedChatWorkflow = {
|
|
|
128
128
|
executionData: IRunExecutionData;
|
|
129
129
|
responseMode: ChatTriggerResponseMode;
|
|
130
130
|
};
|
|
131
|
+
export interface SemanticSearchOptions {
|
|
132
|
+
embeddingModel: {
|
|
133
|
+
provider: ChatHubLLMProvider;
|
|
134
|
+
credentialId: string;
|
|
135
|
+
};
|
|
136
|
+
vectorStore: {
|
|
137
|
+
nodeType: string;
|
|
138
|
+
credentialType: string;
|
|
139
|
+
credentialId: string;
|
|
140
|
+
};
|
|
141
|
+
}
|
|
131
142
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-hub.types.js","sourceRoot":"","sources":["../../../src/modules/chat-hub/chat-hub.types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"chat-hub.types.js","sourceRoot":"","sources":["../../../src/modules/chat-hub/chat-hub.types.ts"],"names":[],"mappings":";;;AASA,+CAAiD;AACjD,6BAAwB;AAoDxB,MAAM,6BAA6B,GAAG,OAAC,CAAC,IAAI,CAAC;IAC5C,WAAW;IACX,UAAU;IACV,cAAc;IACd,eAAe;CACf,CAAC,CAAC;AAOU,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,eAAe,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACtD,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACvC,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC9C,SAAS,EAAE,gCAAiB,CAAC,QAAQ,EAAE;IACvC,gBAAgB,EAAE,OAAC;SACjB,MAAM,CAAC;QACP,OAAO,EAAE,OAAC;aACR,KAAK,CACL,OAAC,CAAC,MAAM,CAAC;YACR,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;YACvB,IAAI,EAAE,gCAAiB,CAAC,QAAQ,EAAE;SAClC,CAAC,CACF;aACA,QAAQ,EAAE;KACZ,CAAC;SACD,QAAQ,EAAE;IACZ,OAAO,EAAE,OAAC;SACR,MAAM,CAAC;QACP,gBAAgB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;QACxC,qBAAqB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC5C,YAAY,EAAE,6BAA6B,CAAC,QAAQ,EAAE;KACtD,CAAC;SACD,QAAQ,EAAE;CACZ,CAAC,CAAC"}
|
|
@@ -76,7 +76,7 @@ async function verifyIntegrity(packageName, version, registryUrl, expectedIntegr
|
|
|
76
76
|
});
|
|
77
77
|
const integrity = metadata?.data?.dist?.integrity;
|
|
78
78
|
if (integrity !== expectedIntegrity) {
|
|
79
|
-
throw new n8n_workflow_1.UnexpectedError('Checksum verification failed. Package integrity does not match.');
|
|
79
|
+
throw new n8n_workflow_1.UnexpectedError('Checksum verification failed. Package integrity does not match. Try restarting n8n and attempting the installation again.');
|
|
80
80
|
}
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
@@ -91,7 +91,7 @@ async function verifyIntegrity(packageName, version, registryUrl, expectedIntegr
|
|
|
91
91
|
], { doNotHandleError: true });
|
|
92
92
|
const integrity = (0, n8n_workflow_1.jsonParse)(stdout);
|
|
93
93
|
if (integrity !== expectedIntegrity) {
|
|
94
|
-
throw new n8n_workflow_1.UnexpectedError('Checksum verification failed. Package integrity does not match.');
|
|
94
|
+
throw new n8n_workflow_1.UnexpectedError('Checksum verification failed. Package integrity does not match. Try restarting n8n and attempting the installation again.');
|
|
95
95
|
}
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
@@ -99,7 +99,7 @@ async function verifyIntegrity(packageName, version, registryUrl, expectedIntegr
|
|
|
99
99
|
if (isDnsError(cliError) || isNpmError(cliError)) {
|
|
100
100
|
throw new n8n_workflow_1.UnexpectedError('Checksum verification failed. Please check your network connection and try again.');
|
|
101
101
|
}
|
|
102
|
-
throw new n8n_workflow_1.UnexpectedError('Checksum verification failed');
|
|
102
|
+
throw new n8n_workflow_1.UnexpectedError('Checksum verification failed. Try restarting n8n and attempting the installation again.');
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"npm-utils.js","sourceRoot":"","sources":["../../../src/modules/community-packages/npm-utils.ts"],"names":[],"mappings":";;;;;AAqDA,8CA8CC;AAED,
|
|
1
|
+
{"version":3,"file":"npm-utils.js","sourceRoot":"","sources":["../../../src/modules/community-packages/npm-utils.ts"],"names":[],"mappings":";;;;;AAqDA,8CA8CC;AAED,0CAmDC;AAED,kEA6CC;AAvMD,2CAA0E;AAC1E,kDAA0B;AAC1B,+CAAuE;AACvE,2DAA8C;AAC9C,yCAAsC;AAEtC,MAAM,aAAa,GAAG,IAAA,qBAAS,EAAC,6BAAQ,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AAe,CAAC,2CAA2C,CAAC,CAAC;QACxE,CAAC;QAAC,OAAO,QAAQ,EAAE,CAAC;YACnB,MAAM,OAAO,GAAG,QAAQ,YAAY,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAEhF,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;gBACnE,MAAM,IAAI,8BAAe,CAAC,gCAAgC,CAAC,CAAC;YAC7D,CAAC;YAED,IAAI,UAAU,CAAC,QAAQ,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAClD,MAAM,IAAI,8BAAe,CACxB,iFAAiF,CACjF,CAAC;YACH,CAAC;YAED,MAAM,IAAI,8BAAe,CAAC,2CAA2C,CAAC,CAAC;QACxE,CAAC;IACF,CAAC;AACF,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ICredentialContext } from 'n8n-workflow';
|
|
2
|
-
|
|
2
|
+
import { CredentialResolutionError } from '../../errors/credential-resolution.error';
|
|
3
|
+
export declare class IdentifierValidationError extends CredentialResolutionError {
|
|
4
|
+
constructor(message: string, options?: ErrorOptions);
|
|
3
5
|
}
|
|
4
6
|
export interface ITokenIdentifier {
|
|
5
7
|
resolve(context: ICredentialContext, identifierOptions: Record<string, unknown>): Promise<string>;
|
package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/identifier-interface.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IdentifierValidationError = void 0;
|
|
4
|
-
|
|
4
|
+
const credential_resolution_error_1 = require("../../errors/credential-resolution.error");
|
|
5
|
+
class IdentifierValidationError extends credential_resolution_error_1.CredentialResolutionError {
|
|
6
|
+
constructor(message, options) {
|
|
7
|
+
super(message, options);
|
|
8
|
+
this.name = 'IdentifierValidationError';
|
|
9
|
+
}
|
|
5
10
|
}
|
|
6
11
|
exports.IdentifierValidationError = IdentifierValidationError;
|
|
7
12
|
//# sourceMappingURL=identifier-interface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identifier-interface.js","sourceRoot":"","sources":["../../../../../src/modules/dynamic-credentials.ee/credential-resolvers/identifiers/identifier-interface.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"identifier-interface.js","sourceRoot":"","sources":["../../../../../src/modules/dynamic-credentials.ee/credential-resolvers/identifiers/identifier-interface.ts"],"names":[],"mappings":";;;AAEA,0FAAqF;AAMrF,MAAa,yBAA0B,SAAQ,uDAAyB;IACvE,YAAY,OAAe,EAAE,OAAsB;QAClD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IACzC,CAAC;CACD;AALD,8DAKC"}
|
|
@@ -26,7 +26,8 @@ let CredentialResolversController = class CredentialResolversController {
|
|
|
26
26
|
}
|
|
27
27
|
async listResolvers(_req, _res) {
|
|
28
28
|
try {
|
|
29
|
-
|
|
29
|
+
const resolvers = api_types_1.credentialResolversSchema.parse(await this.service.findAll());
|
|
30
|
+
return resolvers.map(({ decryptedConfig: _, ...rest }) => ({ ...rest, config: '' }));
|
|
30
31
|
}
|
|
31
32
|
catch (e) {
|
|
32
33
|
if (e instanceof Error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-resolvers.controller.js","sourceRoot":"","sources":["../../../src/modules/dynamic-credentials.ee/credential-resolvers.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,8CAQwB;AAExB,gDAUyB;AAGzB,sGAAsG;AACtG,wFAA0F;AAE1F,kFAA6E;AAC7E,0FAAqF;AACrF,8EAAyE;AAGlE,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IACzC,YAA6B,OAAyC;QAAzC,YAAO,GAAP,OAAO,CAAkC;IAAG,CAAC;IAIpE,AAAN,KAAK,CAAC,aAAa,CAAC,IAA0B,EAAE,IAAc;QAC7D,IAAI,CAAC;YACJ,
|
|
1
|
+
{"version":3,"file":"credential-resolvers.controller.js","sourceRoot":"","sources":["../../../src/modules/dynamic-credentials.ee/credential-resolvers.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,8CAQwB;AAExB,gDAUyB;AAGzB,sGAAsG;AACtG,wFAA0F;AAE1F,kFAA6E;AAC7E,0FAAqF;AACrF,8EAAyE;AAGlE,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IACzC,YAA6B,OAAyC;QAAzC,YAAO,GAAP,OAAO,CAAkC;IAAG,CAAC;IAIpE,AAAN,KAAK,CAAC,aAAa,CAAC,IAA0B,EAAE,IAAc;QAC7D,IAAI,CAAC;YACJ,MAAM,SAAS,GAAG,qCAAyB,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;YAChF,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QACtF,CAAC;QAAC,OAAO,CAAU,EAAE,CAAC;YACrB,IAAI,CAAC,YAAY,KAAK,EAAE,CAAC;gBACxB,MAAM,IAAI,2CAAmB,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;YAC7C,CAAC;YACD,MAAM,CAAC,CAAC;QACT,CAAC;IACF,CAAC;IAID,iBAAiB,CAAC,IAA0B,EAAE,IAAc;QAC3D,IAAI,CAAC;YACJ,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC;YAC/C,OAAO,yCAA6B,CAAC,KAAK,CAAC,K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AAC;IAIvC,WAAA,IAAA,kBAAK,EAAC,IAAI,CAAC,CAAA;;;;mEAcZ;wCAhIW,6BAA6B;IADzC,IAAA,2BAAc,EAAC,uBAAuB,CAAC;qCAED,8DAAgC;GAD1D,6BAA6B,CAiIzC"}
|
package/dist/modules/dynamic-credentials.ee/errors/credential-resolver-not-configured.error.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CredentialResolverNotConfiguredError = void 0;
|
|
4
|
+
const credential_resolution_error_1 = require("./credential-resolution.error");
|
|
5
|
+
class CredentialResolverNotConfiguredError extends credential_resolution_error_1.CredentialResolutionError {
|
|
6
|
+
constructor(credentialName) {
|
|
7
|
+
super(`No resolver configured for dynamic credential "${credentialName}"`);
|
|
8
|
+
this.name = 'CredentialResolverNotConfiguredError';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.CredentialResolverNotConfiguredError = CredentialResolverNotConfiguredError;
|
|
12
|
+
//# sourceMappingURL=credential-resolver-not-configured.error.js.map
|
package/dist/modules/dynamic-credentials.ee/errors/credential-resolver-not-configured.error.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-resolver-not-configured.error.js","sourceRoot":"","sources":["../../../../src/modules/dynamic-credentials.ee/errors/credential-resolver-not-configured.error.ts"],"names":[],"mappings":";;;AAAA,+EAA0E;AAM1E,MAAa,oCAAqC,SAAQ,uDAAyB;IAClF,YAAY,cAAsB;QACjC,KAAK,CAAC,kDAAkD,cAAc,GAAG,CAAC,CAAC;QAC3E,IAAI,CAAC,IAAI,GAAG,sCAAsC,CAAC;IACpD,CAAC;CACD;AALD,oFAKC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { UserError } from 'n8n-workflow';
|
|
2
|
+
import { CredentialResolutionError } from './credential-resolution.error';
|
|
2
3
|
export declare class DynamicCredentialResolverNotFoundError extends UserError {
|
|
3
4
|
constructor(resolverId: string);
|
|
4
5
|
}
|
|
6
|
+
export declare class CredentialResolverNotFoundError extends CredentialResolutionError {
|
|
7
|
+
constructor(credentialName: string, resolverId: string);
|
|
8
|
+
}
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DynamicCredentialResolverNotFoundError = void 0;
|
|
3
|
+
exports.CredentialResolverNotFoundError = exports.DynamicCredentialResolverNotFoundError = void 0;
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const credential_resolution_error_1 = require("./credential-resolution.error");
|
|
5
6
|
class DynamicCredentialResolverNotFoundError extends n8n_workflow_1.UserError {
|
|
6
7
|
constructor(resolverId) {
|
|
7
8
|
super(`Credential resolver with ID "${resolverId}" does not exist.`);
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
exports.DynamicCredentialResolverNotFoundError = DynamicCredentialResolverNotFoundError;
|
|
12
|
+
class CredentialResolverNotFoundError extends credential_resolution_error_1.CredentialResolutionError {
|
|
13
|
+
constructor(credentialName, resolverId) {
|
|
14
|
+
super(`Resolver "${resolverId}" not found for credential "${credentialName}"`);
|
|
15
|
+
this.name = 'CredentialResolverNotFoundError';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.CredentialResolverNotFoundError = CredentialResolverNotFoundError;
|
|
11
19
|
//# sourceMappingURL=credential-resolver-not-found.error.js.map
|
package/dist/modules/dynamic-credentials.ee/errors/credential-resolver-not-found.error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-resolver-not-found.error.js","sourceRoot":"","sources":["../../../../src/modules/dynamic-credentials.ee/errors/credential-resolver-not-found.error.ts"],"names":[],"mappings":";;;AAAA,+CAAyC;AAEzC,MAAa,sCAAuC,SAAQ,wBAAS;IACpE,YAAY,UAAkB;QAC7B,KAAK,CAAC,gCAAgC,UAAU,mBAAmB,CAAC,CAAC;IACtE,CAAC;CACD;AAJD,wFAIC"}
|
|
1
|
+
{"version":3,"file":"credential-resolver-not-found.error.js","sourceRoot":"","sources":["../../../../src/modules/dynamic-credentials.ee/errors/credential-resolver-not-found.error.ts"],"names":[],"mappings":";;;AAAA,+CAAyC;AAEzC,+EAA0E;AAG1E,MAAa,sCAAuC,SAAQ,wBAAS;IACpE,YAAY,UAAkB;QAC7B,KAAK,CAAC,gCAAgC,UAAU,mBAAmB,CAAC,CAAC;IACtE,CAAC;CACD;AAJD,wFAIC;AAMD,MAAa,+BAAgC,SAAQ,uDAAyB;IAC7E,YAAY,cAAsB,EAAE,UAAkB;QACrD,KAAK,CAAC,aAAa,UAAU,+BAA+B,cAAc,GAAG,CAAC,CAAC;QAC/E,IAAI,CAAC,IAAI,GAAG,iCAAiC,CAAC;IAC/C,CAAC;CACD;AALD,0EAKC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MissingExecutionContextError = void 0;
|
|
4
|
+
const credential_resolution_error_1 = require("./credential-resolution.error");
|
|
5
|
+
class MissingExecutionContextError extends credential_resolution_error_1.CredentialResolutionError {
|
|
6
|
+
constructor(credentialName) {
|
|
7
|
+
super(`Cannot resolve dynamic credentials without execution context for "${credentialName}"`);
|
|
8
|
+
this.name = 'MissingExecutionContextError';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.MissingExecutionContextError = MissingExecutionContextError;
|
|
12
|
+
//# sourceMappingURL=missing-execution-context.error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"missing-execution-context.error.js","sourceRoot":"","sources":["../../../../src/modules/dynamic-credentials.ee/errors/missing-execution-context.error.ts"],"names":[],"mappings":";;;AAAA,+EAA0E;AAM1E,MAAa,4BAA6B,SAAQ,uDAAyB;IAC1E,YAAY,cAAsB;QACjC,KAAK,CAAC,qEAAqE,cAAc,GAAG,CAAC,CAAC;QAC9F,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;IAC5C,CAAC;CACD;AALD,oEAKC"}
|
package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { CredentialsRepository, WorkflowRepository } from '@n8n/db';
|
|
2
|
-
import { DynamicCredentialResolverRegistry } from './credential-resolver-registry.service';
|
|
3
|
-
import { DynamicCredentialResolverRepository } from '../database/repositories/credential-resolver.repository';
|
|
4
2
|
import { Cipher } from 'n8n-core';
|
|
5
3
|
import { ICredentialContext } from 'n8n-workflow';
|
|
4
|
+
import { DynamicCredentialResolverRegistry } from './credential-resolver-registry.service';
|
|
5
|
+
import { DynamicCredentialResolverRepository } from '../database/repositories/credential-resolver.repository';
|
|
6
6
|
type CredentialStatus = {
|
|
7
7
|
credentialId: string;
|
|
8
8
|
credentialName: string;
|
|
9
|
-
resolverId
|
|
9
|
+
resolverId?: string;
|
|
10
10
|
credentialType: string;
|
|
11
|
-
status: 'missing' | 'configured';
|
|
11
|
+
status: 'missing' | 'configured' | 'resolver_missing';
|
|
12
12
|
};
|
|
13
13
|
export declare class CredentialResolverWorkflowService {
|
|
14
14
|
private readonly workflowRepository;
|
package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.js
CHANGED
|
@@ -11,23 +11,21 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.CredentialResolverWorkflowService = void 0;
|
|
13
13
|
const db_1 = require("@n8n/db");
|
|
14
|
-
const
|
|
15
|
-
const credential_resolver_repository_1 = require("../database/repositories/credential-resolver.repository");
|
|
14
|
+
const di_1 = require("@n8n/di");
|
|
16
15
|
const n8n_core_1 = require("n8n-core");
|
|
17
16
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
18
|
-
const
|
|
17
|
+
const credential_resolver_registry_service_1 = require("./credential-resolver-registry.service");
|
|
18
|
+
const credential_resolver_repository_1 = require("../database/repositories/credential-resolver.repository");
|
|
19
19
|
function isCredentialStatus(obj) {
|
|
20
20
|
if (typeof obj !== 'object' || obj === null) {
|
|
21
21
|
return false;
|
|
22
22
|
}
|
|
23
23
|
return ('credentialId' in obj &&
|
|
24
24
|
typeof obj.credentialId === 'string' &&
|
|
25
|
-
'resolverId' in obj &&
|
|
26
|
-
typeof obj.resolverId === 'string' &&
|
|
27
25
|
'credentialType' in obj &&
|
|
28
26
|
typeof obj.credentialType === 'string' &&
|
|
29
27
|
'status' in obj &&
|
|
30
|
-
(obj.status === 'missing' || obj.status === 'configured'));
|
|
28
|
+
(obj.status === 'missing' || obj.status === 'configured' || obj.status === 'resolver_missing'));
|
|
31
29
|
}
|
|
32
30
|
let CredentialResolverWorkflowService = class CredentialResolverWorkflowService {
|
|
33
31
|
constructor(workflowRepository, credentialRepository, resolverRegistry, resolverRepository, cipher) {
|
|
@@ -106,7 +104,12 @@ let CredentialResolverWorkflowService = class CredentialResolverWorkflowService
|
|
|
106
104
|
let resolverConfig = options.workflowResolverConfig;
|
|
107
105
|
const credentialResolverId = credential.resolverId ?? options.resolverId;
|
|
108
106
|
if (!credentialResolverId) {
|
|
109
|
-
return
|
|
107
|
+
return {
|
|
108
|
+
credentialId: credential.id,
|
|
109
|
+
credentialName: credential.name,
|
|
110
|
+
status: 'resolver_missing',
|
|
111
|
+
credentialType: credential.type,
|
|
112
|
+
};
|
|
110
113
|
}
|
|
111
114
|
if (credentialResolverId !== options.resolverId) {
|
|
112
115
|
const { resolverInstance: credentialResolverInstance, resolverConfig: credentialResolverConfig, } = await this.getResolver(credentialResolverId);
|
package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-resolver-workflow.service.js","sourceRoot":"","sources":["../../../../src/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAA2F;
|
|
1
|
+
{"version":3,"file":"credential-resolver-workflow.service.js","sourceRoot":"","sources":["../../../../src/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAA2F;AAE3F,gCAAkC;AAClC,uCAAkC;AAClC,+CAA6D;AAE7D,iGAA2F;AAC3F,4GAA8G;AAU9G,SAAS,kBAAkB,CAAC,GAAY;IACvC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QAC7C,OAAO,KAAK,CAAC;IACd,CAAC;IACD,OAAO,CACN,cAAc,IAAI,GAAG;QACrB,OAAO,GAAG,CAAC,YAAY,KAAK,QAAQ;QACpC,gBAAgB,IAAI,GAAG;QACvB,OAAO,GAAG,CAAC,cAAc,KAAK,QAAQ;QACtC,QAAQ,IAAI,GAAG;QACf,CAAC,GAAG,CAAC,MAAM,KAAK,SAAS,IAAI,GAAG,CAAC,MAAM,KAAK,YAAY,IAAI,GAAG,CAAC,MAAM,KAAK,kBAAkB,CAAC,CAC9F,CAAC;AACH,CAAC;AAGM,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAC7C,YACkB,kBAAsC,EACtC,oBAA2C,EAC3C,gBAAmD,EACnD,kBAAuD,EACvD,MAAc;QAJd,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,yBAAoB,GAApB,oBAAoB,CAAuB;QAC3C,qBAAgB,GAAhB,gBAAgB,CAAmC;QACnD,uBAAkB,GAAlB,kBAAkB,CAAqC;QACvD,WAAM,GAAN,MAAM,CAAQ;IAC7B,CAAC;IAEI,KAAK,CAAC,WAAW,CAAC,UAAkB;QAI3C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;QAC7E,IAAI,CAAC,QAAQ,EA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F,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAA;AA9JY,8EAAiC;4CAAjC,iCAAiC;IAD7C,IAAA,YAAO,GAAE;qCAG6B,uBAAkB;QAChB,0BAAqB;QACzB,wEAAiC;QAC/B,oEAAmC;QAC/C,iBAAM;GANpB,iCAAiC,CA8J7C"}
|
|
@@ -13,7 +13,6 @@ exports.DynamicCredentialResolverService = void 0;
|
|
|
13
13
|
const backend_common_1 = require("@n8n/backend-common");
|
|
14
14
|
const decorators_1 = require("@n8n/decorators");
|
|
15
15
|
const di_1 = require("@n8n/di");
|
|
16
|
-
const permissions_1 = require("@n8n/permissions");
|
|
17
16
|
const n8n_core_1 = require("n8n-core");
|
|
18
17
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
19
18
|
const credential_resolver_registry_service_1 = require("./credential-resolver-registry.service");
|
|
@@ -30,8 +29,7 @@ let DynamicCredentialResolverService = class DynamicCredentialResolverService {
|
|
|
30
29
|
this.logger = this.logger.scoped('dynamic-credentials');
|
|
31
30
|
}
|
|
32
31
|
async create(params) {
|
|
33
|
-
|
|
34
|
-
await this.validateConfig(params.type, params.config, canUseExternalSecrets);
|
|
32
|
+
await this.validateConfig(params.type, params.config);
|
|
35
33
|
const encryptedConfig = this.encryptConfig(params.config);
|
|
36
34
|
const resolver = this.repository.create({
|
|
37
35
|
name: params.name,
|
|
@@ -61,16 +59,15 @@ let DynamicCredentialResolverService = class DynamicCredentialResolverService {
|
|
|
61
59
|
if (!existing) {
|
|
62
60
|
throw new credential_resolver_not_found_error_1.DynamicCredentialResolverNotFoundError(id);
|
|
63
61
|
}
|
|
64
|
-
const canUseExternalSecrets = (0, permissions_1.hasGlobalScope)(params.user, 'externalSecret:list');
|
|
65
62
|
if (params.type !== undefined) {
|
|
66
63
|
existing.type = params.type;
|
|
67
64
|
if (params.config === undefined) {
|
|
68
65
|
const existingConfig = this.decryptConfig(existing.config);
|
|
69
|
-
await this.validateConfig(existing.type, existingConfig
|
|
66
|
+
await this.validateConfig(existing.type, existingConfig);
|
|
70
67
|
}
|
|
71
68
|
}
|
|
72
69
|
if (params.config !== undefined) {
|
|
73
|
-
await this.validateConfig(existing.type, params.config
|
|
70
|
+
await this.validateConfig(existing.type, params.config);
|
|
74
71
|
existing.config = this.encryptConfig(params.config);
|
|
75
72
|
}
|
|
76
73
|
if (params.name !== undefined) {
|
|
@@ -101,14 +98,14 @@ let DynamicCredentialResolverService = class DynamicCredentialResolverService {
|
|
|
101
98
|
await this.repository.remove(existing);
|
|
102
99
|
this.logger.debug(`Deleted credential resolver "${existing.name}" (${id})`);
|
|
103
100
|
}
|
|
104
|
-
async validateConfig(type, config
|
|
101
|
+
async validateConfig(type, config) {
|
|
105
102
|
const resolverImplementation = this.registry.getResolverByTypename(type);
|
|
106
103
|
if (!resolverImplementation) {
|
|
107
104
|
throw new decorators_1.CredentialResolverValidationError(`Unknown resolver type: ${type}`);
|
|
108
105
|
}
|
|
109
106
|
let resolvedConfig = config;
|
|
110
107
|
try {
|
|
111
|
-
resolvedConfig = await this.expressionService.resolve(config
|
|
108
|
+
resolvedConfig = await this.expressionService.resolve(config);
|
|
112
109
|
}
|
|
113
110
|
catch (error) {
|
|
114
111
|
throw new decorators_1.CredentialResolverValidationError(`Invalid expression in resolver config: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-resolver.service.js","sourceRoot":"","sources":["../../../../src/modules/dynamic-credentials.ee/services/credential-resolver.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA6C;AAE7C,gDAIyB;AACzB,gCAAkC;AAClC,
|
|
1
|
+
{"version":3,"file":"credential-resolver.service.js","sourceRoot":"","sources":["../../../../src/modules/dynamic-credentials.ee/services/credential-resolver.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA6C;AAE7C,gDAIyB;AACzB,gCAAkC;AAClC,uCAAkC;AAClC,+CAA0D;AAE1D,iGAA2F;AAC3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,CACxB,wIAAwI,CACxI,CAAC;QACH,CAAC;IACF,CAAC;IAKO,mBAAmB,CAAC,QAAmC;QAC9D,QAAQ,CAAC,eAAe,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC/D,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD,CAAA;AAvLY,4EAAgC;2CAAhC,gCAAgC;IAD5C,IAAA,YAAO,GAAE;qCAGiB,uBAAM;QACF,oEAAmC;QACrC,wEAAiC;QACnC,iBAAM;QACK,oEAA+B;GANxD,gCAAgC,CAuL5C"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Logger } from '@n8n/backend-common';
|
|
2
|
+
import { AuthenticatedRequest } from '@n8n/db';
|
|
2
3
|
import { NextFunction, Response } from 'express';
|
|
3
4
|
import { Cipher } from 'n8n-core';
|
|
4
5
|
import type { ICredentialDataDecryptedObject, IExecutionContext, IWorkflowSettings } from 'n8n-workflow';
|
|
@@ -8,7 +9,6 @@ import { ResolverConfigExpressionService } from './resolver-config-expression.se
|
|
|
8
9
|
import type { CredentialResolutionResult, CredentialResolveMetadata, ICredentialResolutionProvider } from '../../../credentials/credential-resolution-provider.interface';
|
|
9
10
|
import { DynamicCredentialResolverRepository } from '../database/repositories/credential-resolver.repository';
|
|
10
11
|
import { DynamicCredentialsConfig } from '../dynamic-credentials.config';
|
|
11
|
-
import { AuthenticatedRequest } from '@n8n/db';
|
|
12
12
|
export declare class DynamicCredentialService implements ICredentialResolutionProvider {
|
|
13
13
|
private readonly dynamicCredentialConfig;
|
|
14
14
|
private readonly resolverRegistry;
|
|
@@ -18,10 +18,11 @@ export declare class DynamicCredentialService implements ICredentialResolutionPr
|
|
|
18
18
|
private readonly logger;
|
|
19
19
|
private readonly expressionService;
|
|
20
20
|
constructor(dynamicCredentialConfig: DynamicCredentialsConfig, resolverRegistry: DynamicCredentialResolverRegistry, resolverRepository: DynamicCredentialResolverRepository, loadNodesAndCredentials: LoadNodesAndCredentials, cipher: Cipher, logger: Logger, expressionService: ResolverConfigExpressionService);
|
|
21
|
-
resolveIfNeeded(credentialsResolveMetadata: CredentialResolveMetadata, staticData: ICredentialDataDecryptedObject, executionContext?: IExecutionContext, workflowSettings?: IWorkflowSettings
|
|
21
|
+
resolveIfNeeded(credentialsResolveMetadata: CredentialResolveMetadata, staticData: ICredentialDataDecryptedObject, executionContext?: IExecutionContext, workflowSettings?: IWorkflowSettings): Promise<CredentialResolutionResult>;
|
|
22
22
|
private buildCredentialContext;
|
|
23
23
|
private handleResolutionError;
|
|
24
|
-
private
|
|
24
|
+
private handleResolverNotConfigured;
|
|
25
|
+
private handleResolverNotFound;
|
|
25
26
|
private handleMissingContext;
|
|
26
27
|
getDynamicCredentialsEndpointsMiddleware(): (req: AuthenticatedRequest, res: Response, next: NextFunction) => void;
|
|
27
28
|
}
|
|
@@ -23,6 +23,9 @@ const shared_fields_1 = require("./shared-fields");
|
|
|
23
23
|
const credential_resolver_repository_1 = require("../database/repositories/credential-resolver.repository");
|
|
24
24
|
const dynamic_credentials_config_1 = require("../dynamic-credentials.config");
|
|
25
25
|
const credential_resolution_error_1 = require("../errors/credential-resolution.error");
|
|
26
|
+
const credential_resolver_not_configured_error_1 = require("../errors/credential-resolver-not-configured.error");
|
|
27
|
+
const credential_resolver_not_found_error_1 = require("../errors/credential-resolver-not-found.error");
|
|
28
|
+
const missing_execution_context_error_1 = require("../errors/missing-execution-context.error");
|
|
26
29
|
let DynamicCredentialService = class DynamicCredentialService {
|
|
27
30
|
constructor(dynamicCredentialConfig, resolverRegistry, resolverRepository, loadNodesAndCredentials, cipher, logger, expressionService) {
|
|
28
31
|
this.dynamicCredentialConfig = dynamicCredentialConfig;
|
|
@@ -33,34 +36,34 @@ let DynamicCredentialService = class DynamicCredentialService {
|
|
|
33
36
|
this.logger = logger;
|
|
34
37
|
this.expressionService = expressionService;
|
|
35
38
|
}
|
|
36
|
-
async resolveIfNeeded(credentialsResolveMetadata, staticData, executionContext, workflowSettings
|
|
39
|
+
async resolveIfNeeded(credentialsResolveMetadata, staticData, executionContext, workflowSettings) {
|
|
37
40
|
const resolverId = credentialsResolveMetadata.resolverId ?? workflowSettings?.credentialResolverId;
|
|
38
41
|
if (!credentialsResolveMetadata.isResolvable) {
|
|
39
42
|
return { data: staticData, isDynamic: false };
|
|
40
43
|
}
|
|
41
44
|
if (!resolverId) {
|
|
42
|
-
return this.
|
|
45
|
+
return this.handleResolverNotConfigured(credentialsResolveMetadata);
|
|
43
46
|
}
|
|
44
47
|
const resolverEntity = await this.resolverRepository.findOneBy({
|
|
45
48
|
id: resolverId,
|
|
46
49
|
});
|
|
47
50
|
if (!resolverEntity) {
|
|
48
|
-
return this.
|
|
51
|
+
return this.handleResolverNotFound(credentialsResolveMetadata, resolverId);
|
|
49
52
|
}
|
|
50
53
|
const resolver = this.resolverRegistry.getResolverByTypename(resolverEntity.type);
|
|
51
54
|
if (!resolver) {
|
|
52
|
-
return this.
|
|
55
|
+
return this.handleResolverNotFound(credentialsResolveMetadata, resolverId);
|
|
53
56
|
}
|
|
54
57
|
const credentialContext = this.buildCredentialContext(executionContext);
|
|
55
58
|
if (!credentialContext) {
|
|
56
|
-
return this.handleMissingContext(credentialsResolveMetadata
|
|
59
|
+
return this.handleMissingContext(credentialsResolveMetadata);
|
|
57
60
|
}
|
|
58
61
|
try {
|
|
59
62
|
const credentialType = this.loadNodesAndCredentials.getCredential(credentialsResolveMetadata.type);
|
|
60
63
|
const sharedFields = (0, shared_fields_1.extractSharedFields)(credentialType.type);
|
|
61
64
|
const decryptedConfig = this.cipher.decrypt(resolverEntity.config);
|
|
62
65
|
const parsedConfig = (0, n8n_workflow_1.jsonParse)(decryptedConfig);
|
|
63
|
-
const resolverConfig = await this.expressionService.resolve(parsedConfig
|
|
66
|
+
const resolverConfig = await this.expressionService.resolve(parsedConfig);
|
|
64
67
|
const dynamicData = await resolver.getSecret(credentialsResolveMetadata.id, credentialContext, {
|
|
65
68
|
resolverId: resolverEntity.id,
|
|
66
69
|
resolverName: resolverEntity.type,
|
|
@@ -80,7 +83,7 @@ let DynamicCredentialService = class DynamicCredentialService {
|
|
|
80
83
|
return { data: { ...staticData, ...dynamicData }, isDynamic: true };
|
|
81
84
|
}
|
|
82
85
|
catch (error) {
|
|
83
|
-
return this.handleResolutionError(credentialsResolveMetadata,
|
|
86
|
+
return this.handleResolutionError(credentialsResolveMetadata, error, resolverId);
|
|
84
87
|
}
|
|
85
88
|
}
|
|
86
89
|
buildCredentialContext(executionContext) {
|
|
@@ -98,49 +101,41 @@ let DynamicCredentialService = class DynamicCredentialService {
|
|
|
98
101
|
return undefined;
|
|
99
102
|
}
|
|
100
103
|
}
|
|
101
|
-
handleResolutionError(credentialsResolveMetadata,
|
|
102
|
-
|
|
103
|
-
if (credentialsResolveMetadata.resolvableAllowFallback) {
|
|
104
|
-
this.logger.debug('Dynamic credential resolution failed, falling back to static', {
|
|
105
|
-
credentialId: credentialsResolveMetadata.id,
|
|
106
|
-
credentialName: credentialsResolveMetadata.name,
|
|
107
|
-
resolverId,
|
|
108
|
-
resolverSource: credentialsResolveMetadata.resolverId ? 'credential' : 'workflow',
|
|
109
|
-
error: error instanceof Error ? error.message : String(error),
|
|
110
|
-
isDataNotFound,
|
|
111
|
-
});
|
|
112
|
-
return { data: staticData, isDynamic: false };
|
|
113
|
-
}
|
|
114
|
-
this.logger.debug('Dynamic credential resolution failed without fallback', {
|
|
104
|
+
handleResolutionError(credentialsResolveMetadata, error, resolverId) {
|
|
105
|
+
this.logger.debug('Dynamic credential resolution failed', {
|
|
115
106
|
credentialId: credentialsResolveMetadata.id,
|
|
116
107
|
credentialName: credentialsResolveMetadata.name,
|
|
117
108
|
resolverId,
|
|
118
109
|
resolverSource: credentialsResolveMetadata.resolverId ? 'credential' : 'workflow',
|
|
119
|
-
error,
|
|
110
|
+
error: error instanceof Error ? error.message : String(error),
|
|
120
111
|
});
|
|
112
|
+
if (error instanceof credential_resolution_error_1.CredentialResolutionError || error instanceof decorators_1.CredentialResolverError) {
|
|
113
|
+
throw new credential_resolution_error_1.CredentialResolutionError(`Failed to resolve dynamic credentials for "${credentialsResolveMetadata.name}": ${error.message}`, { cause: error });
|
|
114
|
+
}
|
|
121
115
|
throw new credential_resolution_error_1.CredentialResolutionError(`Failed to resolve dynamic credentials for "${credentialsResolveMetadata.name}"`, { cause: error });
|
|
122
116
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
resolverSource: credentialsResolveMetadata.resolverId ? 'credential' : 'workflow',
|
|
130
|
-
});
|
|
131
|
-
return { data: staticData, isDynamic: false };
|
|
132
|
-
}
|
|
133
|
-
throw new credential_resolution_error_1.CredentialResolutionError(`Resolver "${resolverId ?? 'unknown'}" not found for credential "${credentialsResolveMetadata.name}"`);
|
|
117
|
+
handleResolverNotConfigured(credentialsResolveMetadata) {
|
|
118
|
+
this.logger.debug('No resolver configured for dynamic credential', {
|
|
119
|
+
credentialId: credentialsResolveMetadata.id,
|
|
120
|
+
credentialName: credentialsResolveMetadata.name,
|
|
121
|
+
});
|
|
122
|
+
throw new credential_resolver_not_configured_error_1.CredentialResolverNotConfiguredError(credentialsResolveMetadata.name);
|
|
134
123
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
124
|
+
handleResolverNotFound(credentialsResolveMetadata, resolverId) {
|
|
125
|
+
this.logger.debug('Resolver not found for dynamic credential', {
|
|
126
|
+
credentialId: credentialsResolveMetadata.id,
|
|
127
|
+
credentialName: credentialsResolveMetadata.name,
|
|
128
|
+
resolverId,
|
|
129
|
+
resolverSource: credentialsResolveMetadata.resolverId ? 'credential' : 'workflow',
|
|
130
|
+
});
|
|
131
|
+
throw new credential_resolver_not_found_error_1.CredentialResolverNotFoundError(credentialsResolveMetadata.name, resolverId);
|
|
132
|
+
}
|
|
133
|
+
handleMissingContext(credentialsResolveMetadata) {
|
|
134
|
+
this.logger.debug('No execution context available for dynamic credential', {
|
|
135
|
+
credentialId: credentialsResolveMetadata.id,
|
|
136
|
+
credentialName: credentialsResolveMetadata.name,
|
|
137
|
+
});
|
|
138
|
+
throw new missing_execution_context_error_1.MissingExecutionContextError(credentialsResolveMetadata.name);
|
|
144
139
|
}
|
|
145
140
|
getDynamicCredentialsEndpointsMiddleware() {
|
|
146
141
|
const { endpointAuthToken } = this.dynamicCredentialConfig;
|