n8n 2.3.1 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/active-workflow-manager.d.ts +3 -1
- package/dist/active-workflow-manager.js +13 -2
- package/dist/active-workflow-manager.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/collaboration/collaboration.message.d.ts +70 -1
- package/dist/collaboration/collaboration.message.js +22 -1
- package/dist/collaboration/collaboration.message.js.map +1 -1
- package/dist/collaboration/collaboration.service.d.ts +9 -0
- package/dist/collaboration/collaboration.service.js +90 -1
- package/dist/collaboration/collaboration.service.js.map +1 -1
- package/dist/collaboration/collaboration.state.d.ts +6 -0
- package/dist/collaboration/collaboration.state.js +24 -0
- package/dist/collaboration/collaboration.state.js.map +1 -1
- package/dist/commands/execute.js +8 -0
- package/dist/commands/execute.js.map +1 -1
- package/dist/commands/start.d.ts +0 -3
- package/dist/commands/start.js +0 -4
- package/dist/commands/start.js.map +1 -1
- package/dist/controllers/auth.controller.js +1 -1
- package/dist/controllers/auth.controller.js.map +1 -1
- package/dist/controllers/invitation.controller.d.ts +2 -0
- package/dist/controllers/invitation.controller.js +36 -6
- package/dist/controllers/invitation.controller.js.map +1 -1
- package/dist/controllers/users.controller.d.ts +10 -1
- package/dist/controllers/users.controller.js +32 -2
- package/dist/controllers/users.controller.js.map +1 -1
- package/dist/credentials/credential-resolution-provider.interface.d.ts +1 -1
- package/dist/credentials/dynamic-credentials-proxy.d.ts +3 -3
- package/dist/credentials/dynamic-credentials-proxy.js +4 -3
- package/dist/credentials/dynamic-credentials-proxy.js.map +1 -1
- package/dist/credentials-helper.d.ts +2 -2
- package/dist/credentials-helper.js +5 -5
- package/dist/credentials-helper.js.map +1 -1
- package/dist/environments.ee/variables/variables.controller.ee.js +1 -0
- package/dist/environments.ee/variables/variables.controller.ee.js.map +1 -1
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.d.ts +3 -1
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.js +12 -2
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.js.map +1 -1
- package/dist/eventbus/event-message-classes/index.d.ts +2 -2
- package/dist/eventbus/event-message-classes/index.js +4 -0
- package/dist/eventbus/event-message-classes/index.js.map +1 -1
- package/dist/eventbus/message-event-bus-destination/message-event-bus-destination-syslog.ee.d.ts +5 -4
- package/dist/eventbus/message-event-bus-destination/message-event-bus-destination-syslog.ee.js +17 -16
- package/dist/eventbus/message-event-bus-destination/message-event-bus-destination-syslog.ee.js.map +1 -1
- package/dist/events/maps/relay.event-map.d.ts +15 -0
- package/dist/events/relays/log-streaming.event-relay.d.ts +6 -0
- package/dist/events/relays/log-streaming.event-relay.js +72 -0
- package/dist/events/relays/log-streaming.event-relay.js.map +1 -1
- package/dist/events/relays/telemetry.event-relay.d.ts +1 -0
- package/dist/events/relays/telemetry.event-relay.js +6 -0
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js +4 -0
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
- package/dist/execution-lifecycle/shared/shared-hook-functions.d.ts +1 -0
- package/dist/execution-lifecycle/shared/shared-hook-functions.js +13 -9
- package/dist/execution-lifecycle/shared/shared-hook-functions.js.map +1 -1
- package/dist/executions/execution.service.d.ts +3 -1
- package/dist/executions/execution.service.js +29 -2
- package/dist/executions/execution.service.js.map +1 -1
- package/dist/ldap.ee/helpers.ee.js +14 -1
- package/dist/ldap.ee/helpers.ee.js.map +1 -1
- package/dist/ldap.ee/ldap.controller.ee.js +5 -0
- package/dist/ldap.ee/ldap.controller.ee.js.map +1 -1
- package/dist/load-nodes-and-credentials.js +13 -2
- package/dist/load-nodes-and-credentials.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-agent.service.js +2 -0
- package/dist/modules/chat-hub/chat-hub-agent.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.constants.d.ts +1 -0
- package/dist/modules/chat-hub/chat-hub.constants.js +2 -1
- package/dist/modules/chat-hub/chat-hub.constants.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.models.service.js +9 -1
- package/dist/modules/chat-hub/chat-hub.models.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.service.d.ts +1 -0
- package/dist/modules/chat-hub/chat-hub.service.js +53 -4
- package/dist/modules/chat-hub/chat-hub.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.types.d.ts +3 -0
- package/dist/modules/chat-hub/chat-hub.types.js +2 -0
- package/dist/modules/chat-hub/chat-hub.types.js.map +1 -1
- package/dist/modules/chat-hub/chat-session.repository.js +0 -5
- package/dist/modules/chat-hub/chat-session.repository.js.map +1 -1
- package/dist/modules/chat-hub/stream-capturer.d.ts +6 -6
- package/dist/modules/chat-hub/stream-capturer.js +55 -22
- package/dist/modules/chat-hub/stream-capturer.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/oauth-credential-resolver.d.ts +1 -0
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/oauth-credential-resolver.js +3 -0
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/oauth-credential-resolver.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/storage/dynamic-credential-entry-storage.d.ts +2 -0
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/storage/dynamic-credential-entry-storage.js +3 -0
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/storage/dynamic-credential-entry-storage.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.d.ts +2 -2
- package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.js +7 -4
- package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.d.ts +7 -1
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.js +33 -7
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.d.ts +3 -3
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.js +4 -4
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.d.ts +4 -2
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js +8 -4
- 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 +7 -0
- package/dist/modules/dynamic-credentials.ee/services/resolver-config-expression.service.js +47 -0
- package/dist/modules/dynamic-credentials.ee/services/resolver-config-expression.service.js.map +1 -0
- package/dist/modules/external-secrets.ee/external-secrets-manager.ee.d.ts +1 -1
- package/dist/modules/external-secrets.ee/external-secrets-manager.ee.js +7 -0
- package/dist/modules/external-secrets.ee/external-secrets-manager.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/external-secrets.controller.ee.d.ts +1 -1
- package/dist/modules/external-secrets.ee/external-secrets.service.ee.d.ts +1 -1
- package/dist/modules/provisioning.ee/provisioning.service.ee.d.ts +1 -1
- package/dist/modules/provisioning.ee/provisioning.service.ee.js +4 -1
- package/dist/modules/provisioning.ee/provisioning.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/constants.js.map +1 -0
- package/dist/modules/source-control.ee/middleware/source-control-enabled-middleware.ee.d.ts +2 -0
- package/dist/modules/source-control.ee/middleware/source-control-enabled-middleware.ee.js +19 -0
- package/dist/modules/source-control.ee/middleware/source-control-enabled-middleware.ee.js.map +1 -0
- package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control-export.service.ee.d.ts +1 -1
- package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control-export.service.ee.js +1 -1
- package/dist/modules/source-control.ee/source-control-export.service.ee.js.map +1 -0
- package/dist/modules/source-control.ee/source-control-git.service.ee.js.map +1 -0
- package/dist/modules/source-control.ee/source-control-helper.ee.js.map +1 -0
- package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control-import.service.ee.d.ts +1 -1
- package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control-import.service.ee.js +10 -19
- package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -0
- package/dist/modules/source-control.ee/source-control-preferences.service.ee.js.map +1 -0
- package/dist/modules/source-control.ee/source-control-resource-helper.js.map +1 -0
- package/dist/modules/source-control.ee/source-control-scoped.service.js.map +1 -0
- package/dist/modules/source-control.ee/source-control-status.service.ee.js.map +1 -0
- package/dist/modules/source-control.ee/source-control.config.js.map +1 -0
- package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control.controller.ee.d.ts +5 -3
- package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control.controller.ee.js +25 -15
- package/dist/modules/source-control.ee/source-control.controller.ee.js.map +1 -0
- package/dist/modules/source-control.ee/source-control.module.d.ts +4 -0
- package/dist/modules/source-control.ee/source-control.module.js +56 -0
- package/dist/modules/source-control.ee/source-control.module.js.map +1 -0
- package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control.service.ee.d.ts +1 -1
- package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control.service.ee.js +1 -1
- package/dist/modules/source-control.ee/source-control.service.ee.js.map +1 -0
- package/dist/modules/source-control.ee/types/export-result.js.map +1 -0
- package/dist/modules/source-control.ee/types/exportable-credential.js.map +1 -0
- package/dist/modules/source-control.ee/types/exportable-folders.js.map +1 -0
- package/dist/modules/source-control.ee/types/exportable-project.js.map +1 -0
- package/dist/modules/source-control.ee/types/exportable-tags.js.map +1 -0
- package/dist/modules/source-control.ee/types/exportable-variable.js.map +1 -0
- package/dist/modules/source-control.ee/types/exportable-workflow.js.map +1 -0
- package/dist/modules/source-control.ee/types/import-result.js.map +1 -0
- package/dist/modules/source-control.ee/types/key-pair-type.js.map +1 -0
- package/dist/modules/source-control.ee/types/key-pair.js.map +1 -0
- package/dist/modules/source-control.ee/types/requests.js.map +1 -0
- package/dist/modules/source-control.ee/types/resource-owner.js.map +1 -0
- package/dist/modules/source-control.ee/types/source-control-commit.js.map +1 -0
- package/dist/modules/source-control.ee/types/source-control-context.js.map +1 -0
- package/dist/modules/source-control.ee/types/source-control-disconnect.js.map +1 -0
- package/dist/modules/source-control.ee/types/source-control-generate-key-pair.js.map +1 -0
- package/dist/modules/source-control.ee/types/source-control-get-status.js.map +1 -0
- package/dist/modules/source-control.ee/types/source-control-preferences.js.map +1 -0
- package/dist/modules/source-control.ee/types/source-control-push.js.map +1 -0
- package/dist/modules/source-control.ee/types/source-control-set-branch.js.map +1 -0
- package/dist/modules/source-control.ee/types/source-control-set-read-only.js.map +1 -0
- package/dist/modules/source-control.ee/types/source-control-stage.js.map +1 -0
- package/dist/modules/source-control.ee/types/source-control-workflow-version-id.js.map +1 -0
- package/dist/oauth/oauth.service.js +2 -1
- package/dist/oauth/oauth.service.js.map +1 -1
- package/dist/public-api/v1/handlers/source-control/source-control.handler.d.ts +1 -1
- package/dist/public-api/v1/handlers/source-control/source-control.handler.js +3 -3
- package/dist/public-api/v1/handlers/source-control/source-control.handler.js.map +1 -1
- package/dist/public-api/v1/openapi.yml +10 -10
- package/dist/security-audit/risk-reporters/nodes-risk-reporter.js +2 -1
- package/dist/security-audit/risk-reporters/nodes-risk-reporter.js.map +1 -1
- package/dist/server.js +0 -8
- package/dist/server.js.map +1 -1
- package/dist/services/access.service.d.ts +1 -0
- package/dist/services/access.service.js +9 -0
- package/dist/services/access.service.js.map +1 -1
- package/dist/services/credentials-tester.service.js +2 -1
- package/dist/services/credentials-tester.service.js.map +1 -1
- package/dist/services/frontend.service.js.map +1 -1
- package/dist/services/pruning/workflow-history-compaction.service.d.ts +2 -0
- package/dist/services/pruning/workflow-history-compaction.service.js +25 -10
- package/dist/services/pruning/workflow-history-compaction.service.js.map +1 -1
- package/dist/services/user.service.d.ts +15 -2
- package/dist/services/user.service.js +84 -3
- package/dist/services/user.service.js.map +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/telemetry/index.js.map +1 -1
- package/dist/webhooks/webhook-helpers.js +7 -0
- package/dist/webhooks/webhook-helpers.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/workflows/workflow-execution.service.d.ts +3 -1
- package/dist/workflows/workflow-execution.service.js +19 -3
- package/dist/workflows/workflow-execution.service.js.map +1 -1
- package/dist/workflows/workflows.controller.d.ts +16 -11
- package/dist/workflows/workflows.controller.js +72 -34
- package/dist/workflows/workflows.controller.js.map +1 -1
- package/package.json +22 -23
- package/dist/environments.ee/source-control/constants.js.map +0 -1
- package/dist/environments.ee/source-control/middleware/source-control-enabled-middleware.ee.d.ts +0 -3
- package/dist/environments.ee/source-control/middleware/source-control-enabled-middleware.ee.js +0 -34
- package/dist/environments.ee/source-control/middleware/source-control-enabled-middleware.ee.js.map +0 -1
- package/dist/environments.ee/source-control/source-control-export.service.ee.js.map +0 -1
- package/dist/environments.ee/source-control/source-control-git.service.ee.js.map +0 -1
- package/dist/environments.ee/source-control/source-control-helper.ee.js.map +0 -1
- package/dist/environments.ee/source-control/source-control-import.service.ee.js.map +0 -1
- package/dist/environments.ee/source-control/source-control-preferences.service.ee.js.map +0 -1
- package/dist/environments.ee/source-control/source-control-resource-helper.js.map +0 -1
- package/dist/environments.ee/source-control/source-control-scoped.service.js.map +0 -1
- package/dist/environments.ee/source-control/source-control-status.service.ee.js.map +0 -1
- package/dist/environments.ee/source-control/source-control.config.js.map +0 -1
- package/dist/environments.ee/source-control/source-control.controller.ee.js.map +0 -1
- package/dist/environments.ee/source-control/source-control.service.ee.js.map +0 -1
- package/dist/environments.ee/source-control/types/export-result.js.map +0 -1
- package/dist/environments.ee/source-control/types/exportable-credential.js.map +0 -1
- package/dist/environments.ee/source-control/types/exportable-folders.js.map +0 -1
- package/dist/environments.ee/source-control/types/exportable-project.js.map +0 -1
- package/dist/environments.ee/source-control/types/exportable-tags.js.map +0 -1
- package/dist/environments.ee/source-control/types/exportable-variable.js.map +0 -1
- package/dist/environments.ee/source-control/types/exportable-workflow.js.map +0 -1
- package/dist/environments.ee/source-control/types/import-result.js.map +0 -1
- package/dist/environments.ee/source-control/types/key-pair-type.js.map +0 -1
- package/dist/environments.ee/source-control/types/key-pair.js.map +0 -1
- package/dist/environments.ee/source-control/types/requests.js.map +0 -1
- package/dist/environments.ee/source-control/types/resource-owner.js.map +0 -1
- package/dist/environments.ee/source-control/types/source-control-commit.js.map +0 -1
- package/dist/environments.ee/source-control/types/source-control-context.js.map +0 -1
- package/dist/environments.ee/source-control/types/source-control-disconnect.js.map +0 -1
- package/dist/environments.ee/source-control/types/source-control-generate-key-pair.js.map +0 -1
- package/dist/environments.ee/source-control/types/source-control-get-status.js.map +0 -1
- package/dist/environments.ee/source-control/types/source-control-preferences.js.map +0 -1
- package/dist/environments.ee/source-control/types/source-control-push.js.map +0 -1
- package/dist/environments.ee/source-control/types/source-control-set-branch.js.map +0 -1
- package/dist/environments.ee/source-control/types/source-control-set-read-only.js.map +0 -1
- package/dist/environments.ee/source-control/types/source-control-stage.js.map +0 -1
- package/dist/environments.ee/source-control/types/source-control-workflow-version-id.js.map +0 -1
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/constants.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/constants.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control-git.service.ee.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control-git.service.ee.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control-helper.ee.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control-helper.ee.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control-preferences.service.ee.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control-preferences.service.ee.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control-resource-helper.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control-resource-helper.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control-scoped.service.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control-scoped.service.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control-status.service.ee.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control-status.service.ee.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control.config.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/source-control.config.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/export-result.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/export-result.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/exportable-credential.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/exportable-credential.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/exportable-folders.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/exportable-folders.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/exportable-project.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/exportable-project.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/exportable-tags.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/exportable-tags.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/exportable-variable.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/exportable-variable.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/exportable-workflow.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/exportable-workflow.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/import-result.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/import-result.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/key-pair-type.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/key-pair-type.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/key-pair.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/key-pair.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/requests.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/requests.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/resource-owner.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/resource-owner.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-commit.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-commit.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-context.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-context.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-disconnect.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-disconnect.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-generate-key-pair.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-generate-key-pair.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-get-status.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-get-status.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-preferences.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-preferences.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-push.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-push.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-set-branch.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-set-branch.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-set-read-only.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-set-read-only.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-stage.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-stage.js +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-workflow-version-id.d.ts +0 -0
- /package/dist/{environments.ee/source-control → modules/source-control.ee}/types/source-control-workflow-version-id.js +0 -0
|
@@ -5,22 +5,55 @@ exports.createStructuredChunkAggregator = createStructuredChunkAggregator;
|
|
|
5
5
|
const uuid_1 = require("uuid");
|
|
6
6
|
function interceptResponseWrites(res, transform) {
|
|
7
7
|
const originalWrite = res.write.bind(res);
|
|
8
|
+
const originalEnd = res.end.bind(res);
|
|
8
9
|
const defaultEncoding = 'utf8';
|
|
10
|
+
let writeChain = Promise.resolve();
|
|
9
11
|
const toText = (data, enc) => Buffer.isBuffer(data) ? data.toString(enc ?? defaultEncoding) : String(data);
|
|
10
12
|
function write(chunk, encodingOrCallback, callbackFn) {
|
|
11
13
|
const inputText = toText(chunk, typeof encodingOrCallback === 'string' ? encodingOrCallback : undefined);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
writeChain = writeChain
|
|
15
|
+
.then(async () => await transform(inputText))
|
|
16
|
+
.then((outputText) => {
|
|
17
|
+
if (!encodingOrCallback) {
|
|
18
|
+
originalWrite(outputText);
|
|
19
|
+
}
|
|
20
|
+
else if (typeof encodingOrCallback === 'function') {
|
|
21
|
+
originalWrite(outputText, encodingOrCallback);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
originalWrite(outputText, encodingOrCallback, callbackFn);
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
.catch((error) => {
|
|
28
|
+
const originalCb = typeof encodingOrCallback === 'function' ? encodingOrCallback : callbackFn;
|
|
29
|
+
if (originalCb) {
|
|
30
|
+
originalCb(error);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
function end(chunkOrCallback, encodingOrCallback, callbackFn) {
|
|
36
|
+
void writeChain.then(() => {
|
|
37
|
+
if (!chunkOrCallback) {
|
|
38
|
+
originalEnd();
|
|
39
|
+
}
|
|
40
|
+
else if (typeof chunkOrCallback === 'function') {
|
|
41
|
+
originalEnd(chunkOrCallback);
|
|
42
|
+
}
|
|
43
|
+
else if (!encodingOrCallback) {
|
|
44
|
+
originalEnd(chunkOrCallback);
|
|
45
|
+
}
|
|
46
|
+
else if (typeof encodingOrCallback === 'function') {
|
|
47
|
+
originalEnd(chunkOrCallback, encodingOrCallback);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
originalEnd(chunkOrCallback, encodingOrCallback, callbackFn);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
return res;
|
|
22
54
|
}
|
|
23
55
|
res.write = write;
|
|
56
|
+
res.end = end;
|
|
24
57
|
return res;
|
|
25
58
|
}
|
|
26
59
|
const keyOf = (m) => `${m.nodeId}|${m.runIndex}|${m.itemIndex}`;
|
|
@@ -29,7 +62,7 @@ function createStructuredChunkAggregator(initialPreviousMessageId, retryOfMessag
|
|
|
29
62
|
const active = new Map();
|
|
30
63
|
const activeByKey = new Map();
|
|
31
64
|
let previousMessageId = initialPreviousMessageId;
|
|
32
|
-
const startNew = () => {
|
|
65
|
+
const startNew = async () => {
|
|
33
66
|
const message = {
|
|
34
67
|
id: (0, uuid_1.v4)(),
|
|
35
68
|
previousMessageId,
|
|
@@ -42,52 +75,52 @@ function createStructuredChunkAggregator(initialPreviousMessageId, retryOfMessag
|
|
|
42
75
|
status: 'running',
|
|
43
76
|
};
|
|
44
77
|
previousMessageId = message.id;
|
|
45
|
-
onBegin?.(message);
|
|
78
|
+
await onBegin?.(message);
|
|
46
79
|
return message;
|
|
47
80
|
};
|
|
48
|
-
const ensureMessage = (key) => {
|
|
81
|
+
const ensureMessage = async (key) => {
|
|
49
82
|
let message = activeByKey.get(key);
|
|
50
83
|
if (!message) {
|
|
51
|
-
message = startNew();
|
|
84
|
+
message = await startNew();
|
|
52
85
|
activeByKey.set(key, message);
|
|
53
86
|
}
|
|
54
87
|
return message;
|
|
55
88
|
};
|
|
56
|
-
const ingest = (chunk) => {
|
|
89
|
+
const ingest = async (chunk) => {
|
|
57
90
|
const { type, content, metadata } = chunk;
|
|
58
91
|
const key = keyOf(metadata);
|
|
59
92
|
if (type === 'begin') {
|
|
60
93
|
if (activeByKey.has(key)) {
|
|
61
94
|
throw new Error(`Duplicate begin for key ${key}`);
|
|
62
95
|
}
|
|
63
|
-
const message = startNew();
|
|
96
|
+
const message = await startNew();
|
|
64
97
|
activeByKey.set(key, message);
|
|
65
98
|
return message;
|
|
66
99
|
}
|
|
67
100
|
if (type === 'item') {
|
|
68
|
-
const message = ensureMessage(key);
|
|
101
|
+
const message = await ensureMessage(key);
|
|
69
102
|
if (typeof content === 'string' && content.length) {
|
|
70
103
|
message.content += content;
|
|
71
|
-
onItem?.(message, content);
|
|
104
|
+
await onItem?.(message, content);
|
|
72
105
|
}
|
|
73
106
|
return message;
|
|
74
107
|
}
|
|
75
108
|
if (type === 'end') {
|
|
76
|
-
const message = ensureMessage(key);
|
|
109
|
+
const message = await ensureMessage(key);
|
|
77
110
|
message.status = 'success';
|
|
78
111
|
message.updatedAt = new Date();
|
|
79
112
|
activeByKey.delete(key);
|
|
80
|
-
onEnd?.(message);
|
|
113
|
+
await onEnd?.(message);
|
|
81
114
|
return message;
|
|
82
115
|
}
|
|
83
|
-
const message = ensureMessage(key);
|
|
116
|
+
const message = await ensureMessage(key);
|
|
84
117
|
message.status = 'error';
|
|
85
118
|
message.updatedAt = new Date();
|
|
86
119
|
if (typeof content === 'string') {
|
|
87
120
|
message.content = (message.content ? message.content + '\n\n' : '') + content;
|
|
88
121
|
}
|
|
89
122
|
activeByKey.delete(key);
|
|
90
|
-
onError?.(message, content);
|
|
123
|
+
await onError?.(message, content);
|
|
91
124
|
return message;
|
|
92
125
|
};
|
|
93
126
|
const finalizeAll = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream-capturer.js","sourceRoot":"","sources":["../../../src/modules/chat-hub/stream-capturer.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"stream-capturer.js","sourceRoot":"","sources":["../../../src/modules/chat-hub/stream-capturer.ts"],"names":[],"mappings":";;AAaA,0DAgFC;AAkBD,0EA2FC;AAtMD,+BAAoC;AASpC,SAAgB,uBAAuB,CACtC,GAAM,EACN,SAA2B;IAE3B,MAAM,aAAa,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAU,CAAC;IACnD,MAAM,WAAW,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAQ,CAAC;IAC7C,MAAM,eAAe,GAAG,MAAM,CAAC;IAE/B,IAAI,UAAU,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAEnC,MAAM,MAAM,GAAG,CAAC,IAAqB,EAAE,GAAoB,EAAE,EAAE,CAC9D,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAQ9E,SAAS,KAAK,CACb,KAAsB,EACtB,kBAAkE,EAClE,UAAuC;QAEvC,MAAM,SAAS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th-credential-resolver.d.ts
CHANGED
|
@@ -96,6 +96,7 @@ export declare class OAuthCredentialResolver implements ICredentialResolver {
|
|
|
96
96
|
getSecret(credentialId: string, context: ICredentialContext, handle: CredentialResolverHandle): Promise<ICredentialDataDecryptedObject>;
|
|
97
97
|
setSecret(credentialId: string, context: ICredentialContext, data: ICredentialDataDecryptedObject, handle: CredentialResolverHandle): Promise<void>;
|
|
98
98
|
deleteSecret(credentialId: string, context: ICredentialContext, handle: CredentialResolverHandle): Promise<void>;
|
|
99
|
+
deleteAllSecrets(handle: CredentialResolverHandle): Promise<void>;
|
|
99
100
|
private parseOptions;
|
|
100
101
|
validateOptions(options: CredentialResolverConfiguration): Promise<void>;
|
|
101
102
|
private getIdentifier;
|
package/dist/modules/dynamic-credentials.ee/credential-resolvers/oauth-credential-resolver.js
CHANGED
|
@@ -134,6 +134,9 @@ let OAuthCredentialResolver = class OAuthCredentialResolver {
|
|
|
134
134
|
const key = await this.resolveIdentifier(context, parsedOptions);
|
|
135
135
|
await this.storage.deleteCredentialData(credentialId, key, handle.resolverId, parsedOptions);
|
|
136
136
|
}
|
|
137
|
+
async deleteAllSecrets(handle) {
|
|
138
|
+
await this.storage.deleteAllCredentialData(handle);
|
|
139
|
+
}
|
|
137
140
|
async parseOptions(options) {
|
|
138
141
|
const result = await OAuthCredentialResolverOptionsSchema.safeParseAsync(options);
|
|
139
142
|
if (result.error) {
|
package/dist/modules/dynamic-credentials.ee/credential-resolvers/oauth-credential-resolver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-credential-resolver.js","sourceRoot":"","sources":["../../../../src/modules/dynamic-credentials.ee/credential-resolvers/oauth-credential-resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,wDAA6C;AAC7C,gDAOyB;AACzB,uCAAkC;AAClC,+CAA6F;AAC7F,8CAAoB;AAGpB,mGAGuD;AACvD,yFAGkD;AAClD,iGAA2F;AAE3F,MAAM,oCAAoC,GAA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AQ,EAAE,EAAE;SACZ,EACD,aAAa,CACb,CAAC;IACH,CAAC;CACD,CAAA;
|
|
1
|
+
{"version":3,"file":"oauth-credential-resolver.js","sourceRoot":"","sources":["../../../../src/modules/dynamic-credentials.ee/credential-resolvers/oauth-credential-resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,wDAA6C;AAC7C,gDAOyB;AACzB,uCAAkC;AAClC,+CAA6F;AAC7F,8CAAoB;AAGpB,mGAGuD;AACvD,yFAGkD;AAClD,iGAA2F;AAE3F,MAAM,oCAAoC,GAAG,aAAC,CAAC,kBAAkB,CAAC,YAAY,EAAE;IAC/E,kEAAgC;IAChC,wDAA2B;CAC3B,CAAC,CAAC;AAUI,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IACnC,YACkB,MAAc,EACd,kCAAsE,EACtE,wBAAkD,EAClD,OAAsC,EACtC,MAAc;QAJd,WAAM,GAAN,MAAM,CAAQ;QACd,uCAAkC,GAAlC,kCAAkC,CAAoC;QACtE,6BAAwB,GAAxB,wBAAwB,CAA0B;QAClD,YAAO,GAAP,OAAO,CAA+B;QACtC,WAAM,GAAN,MAAM,CAAQ;QAGhC,aAAQ,GAAG;YACV,IAAI,EAAE,gCAAgC;YACtC,WAAW,EAAE,kCAAkC;YAC/C,WAAW,EAAE,iBAAiB;YAC9B,OAAO,EAAE;gBACR;oBACC,WAAW,EAAE,cAAc;oBAC3B,IAAI,EAAE,aAAa;oBACnB,IAAI,EAAE,QAAiB;oBACvB,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,2DAA2D;oBACxE,WAAW,EAAE,qCAAqC;iBAClD;gBACD;oBACC,WAAW,EAAE,mBAAmB;oBAChC,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,SAAkB;oBACxB,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,4BAA4B;4BAClC,KAAK,EAAE,sBAAsB;4BAC7B,WAAW,EAAE,wDAAwD;yBACr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AAC;IACF,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAC9B,OAA2B,EAC3B,OAAwC;QAExC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACtE,OAAO,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,QAAgB,EAAE,MAAgC;QACxE,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QACpE,MAAM,IAAI,CAAC,iBAAiB,CAC3B;YACC,QAAQ;YACR,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,EAAE;SACZ,EACD,aAAa,CACb,CAAC;IACH,CAAC;CACD,CAAA;AAvMY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,+BAAkB,GAAE;qCAGM,uBAAM;QACsB,oEAAkC;QAC5C,qDAAwB;QACzC,gEAA6B;QAC9B,iBAAM;GANpB,uBAAuB,CAuMnC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ICredentialEntriesStorage } from './storage-interface';
|
|
2
2
|
import { DynamicCredentialEntryRepository } from '../../database/repositories/dynamic-credential-entry.repository';
|
|
3
|
+
import { CredentialResolverHandle } from '@n8n/decorators';
|
|
3
4
|
export declare class DynamicCredentialEntryStorage implements ICredentialEntriesStorage {
|
|
4
5
|
private readonly dynamicCredentialEntryRepository;
|
|
5
6
|
constructor(dynamicCredentialEntryRepository: DynamicCredentialEntryRepository);
|
|
6
7
|
getCredentialData(credentialId: string, subjectId: string, resolverId: string, _: Record<string, unknown>): Promise<string | null>;
|
|
7
8
|
setCredentialData(credentialId: string, subjectId: string, resolverId: string, data: string, _: Record<string, unknown>): Promise<void>;
|
|
8
9
|
deleteCredentialData(credentialId: string, subjectId: string, resolverId: string, _: Record<string, unknown>): Promise<void>;
|
|
10
|
+
deleteAllCredentialData(handle: CredentialResolverHandle): Promise<void>;
|
|
9
11
|
}
|
|
@@ -47,6 +47,9 @@ let DynamicCredentialEntryStorage = class DynamicCredentialEntryStorage {
|
|
|
47
47
|
resolverId,
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
+
async deleteAllCredentialData(handle) {
|
|
51
|
+
await this.dynamicCredentialEntryRepository.delete({ resolverId: handle.resolverId });
|
|
52
|
+
}
|
|
50
53
|
};
|
|
51
54
|
exports.DynamicCredentialEntryStorage = DynamicCredentialEntryStorage;
|
|
52
55
|
exports.DynamicCredentialEntryStorage = DynamicCredentialEntryStorage = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-credential-entry-storage.js","sourceRoot":"","sources":["../../../../../src/modules/dynamic-credentials.ee/credential-resolvers/storage/dynamic-credential-entry-storage.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAGlC,+FAA0F;AAC1F,yHAAmH;
|
|
1
|
+
{"version":3,"file":"dynamic-credential-entry-storage.js","sourceRoot":"","sources":["../../../../../src/modules/dynamic-credentials.ee/credential-resolvers/storage/dynamic-credential-entry-storage.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAGlC,+FAA0F;AAC1F,yHAAmH;AAI5G,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IACzC,YACkB,gCAAkE;QAAlE,qCAAgC,GAAhC,gCAAgC,CAAkC;IACjF,CAAC;IAEJ,KAAK,CAAC,iBAAiB,CACtB,YAAoB,EACpB,SAAiB,EACjB,UAAkB,EAClB,CAA0B;QAE1B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,gCAAgC,CAAC,OAAO,CAAC;YACjE,KAAK,EAAE;gBACN,YAAY;gBACZ,SAAS;gBACT,UAAU;aACV;SACD,CAAC,CAAC;QAEH,OAAO,KAAK,EAAE,IAAI,IAAI,IAAI,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,iBAAiB,CACtB,YAAoB,EACpB,SAAiB,EACjB,UAAkB,EAClB,IAAY,EACZ,CAA0B;QAE1B,IAAI,KAAK,GAAG,MAAM,IAAI,CAAC,gCAAgC,CAAC,OAAO,CAAC;YAC/D,KAAK,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE;SAC9C,CAAC,CAAC;QAEH,IAAI,CAAC,KAAK,EAAE,CAAC;YACZ,KAAK,GAAG,IAAI,iDAAsB,EAAE,CAAC;YACrC,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC;YAClC,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;YAC5B,KAAK,CAAC,UAAU,GAAG,UAAU,CAAC;QAC/B,CAAC;QAED,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;QAClB,MAAM,IAAI,CAAC,gCAAgC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,oBAAoB,CACzB,YAAoB,EACpB,SAAiB,EACjB,UAAkB,EAClB,CAA0B;QAE1B,MAAM,IAAI,CAAC,gCAAgC,CAAC,MAAM,CAAC;YAClD,YAAY;YACZ,SAAS;YACT,UAAU;SACV,CAAC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,uBAAuB,CAAC,MAAgC;QAC7D,MAAM,IAAI,CAAC,gCAAgC,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;IACvF,CAAC;CACD,CAAA;AA5DY,sEAA6B;wCAA7B,6BAA6B;IADzC,IAAA,YAAO,GAAE;qCAG2C,sEAAgC;GAFxE,6BAA6B,CA4DzC"}
|
|
@@ -7,9 +7,9 @@ export declare class CredentialResolversController {
|
|
|
7
7
|
constructor(service: DynamicCredentialResolverService);
|
|
8
8
|
listResolvers(_req: AuthenticatedRequest, _res: Response): Promise<CredentialResolver[]>;
|
|
9
9
|
listResolverTypes(_req: AuthenticatedRequest, _res: Response): CredentialResolverType[];
|
|
10
|
-
createResolver(
|
|
10
|
+
createResolver(req: AuthenticatedRequest, _res: Response, dto: CreateCredentialResolverDto): Promise<CredentialResolver>;
|
|
11
11
|
getResolver(_req: AuthenticatedRequest, _res: Response, id: string): Promise<CredentialResolver>;
|
|
12
|
-
updateResolver(
|
|
12
|
+
updateResolver(req: AuthenticatedRequest, _res: Response, id: string, dto: UpdateCredentialResolverDto): Promise<CredentialResolver>;
|
|
13
13
|
deleteResolver(_req: AuthenticatedRequest, _res: Response, id: string): Promise<{
|
|
14
14
|
success: true;
|
|
15
15
|
}>;
|
|
@@ -15,11 +15,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.CredentialResolversController = void 0;
|
|
16
16
|
const api_types_1 = require("@n8n/api-types");
|
|
17
17
|
const decorators_1 = require("@n8n/decorators");
|
|
18
|
+
const credential_resolver_not_found_error_1 = require("./errors/credential-resolver-not-found.error");
|
|
19
|
+
const credential_resolver_service_1 = require("./services/credential-resolver.service");
|
|
18
20
|
const bad_request_error_1 = require("../../errors/response-errors/bad-request.error");
|
|
19
21
|
const internal_server_error_1 = require("../../errors/response-errors/internal-server.error");
|
|
20
22
|
const not_found_error_1 = require("../../errors/response-errors/not-found.error");
|
|
21
|
-
const credential_resolver_not_found_error_1 = require("./errors/credential-resolver-not-found.error");
|
|
22
|
-
const credential_resolver_service_1 = require("./services/credential-resolver.service");
|
|
23
23
|
let CredentialResolversController = class CredentialResolversController {
|
|
24
24
|
constructor(service) {
|
|
25
25
|
this.service = service;
|
|
@@ -47,12 +47,13 @@ let CredentialResolversController = class CredentialResolversController {
|
|
|
47
47
|
throw e;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
async createResolver(
|
|
50
|
+
async createResolver(req, _res, dto) {
|
|
51
51
|
try {
|
|
52
52
|
const createdResolver = await this.service.create({
|
|
53
53
|
name: dto.name,
|
|
54
54
|
type: dto.type,
|
|
55
55
|
config: dto.config,
|
|
56
|
+
user: req.user,
|
|
56
57
|
});
|
|
57
58
|
return api_types_1.credentialResolverSchema.parse(createdResolver);
|
|
58
59
|
}
|
|
@@ -80,12 +81,14 @@ let CredentialResolversController = class CredentialResolversController {
|
|
|
80
81
|
throw e;
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
|
-
async updateResolver(
|
|
84
|
+
async updateResolver(req, _res, id, dto) {
|
|
84
85
|
try {
|
|
85
86
|
return api_types_1.credentialResolverSchema.parse(await this.service.update(id, {
|
|
86
87
|
type: dto.type,
|
|
87
88
|
name: dto.name,
|
|
88
89
|
config: dto.config,
|
|
90
|
+
clearCredentials: dto.clearCredentials,
|
|
91
|
+
user: req.user,
|
|
89
92
|
}));
|
|
90
93
|
}
|
|
91
94
|
catch (e) {
|
|
@@ -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,kFAA6E;AAC7E,0FAAqF;AACrF,8EAAyE;
|
|
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,OAAO,qCAAyB,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QACtE,CAAC;QAAC,OAAO,CAAU,EAAE,CAAC;Y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AC,yBAAyB,CAAC;IAIrC,WAAA,IAAA,kBAAK,EAAC,IAAI,CAAC,CAAA;;;;gEAaZ;AAIK;IAFL,IAAA,kBAAK,EAAC,MAAM,CAAC;IACb,IAAA,wBAAW,EAAC,2BAA2B,CAAC;IAIvC,WAAA,IAAA,kBAAK,EAAC,IAAI,CAAC,CAAA;IACX,WAAA,iBAAI,CAAA;;6DAAM,uCAA2B;;mEAwBtC;AAIK;IAFL,IAAA,mBAAM,EAAC,MAAM,CAAC;IACd,IAAA,wBAAW,EAAC,2BAA2B,CAAC;IAIvC,WAAA,IAAA,kBAAK,EAAC,IAAI,CAAC,CAAA;;;;mEAcZ;wCA/HW,6BAA6B;IADzC,IAAA,2BAAc,EAAC,uBAAuB,CAAC;qCAED,8DAAgC;GAD1D,6BAA6B,CAgIzC"}
|
|
@@ -1,25 +1,31 @@
|
|
|
1
1
|
import { Logger } from '@n8n/backend-common';
|
|
2
|
+
import { User } from '@n8n/db';
|
|
2
3
|
import { CredentialResolverConfiguration, ICredentialResolver } from '@n8n/decorators';
|
|
3
4
|
import { Cipher } from 'n8n-core';
|
|
4
5
|
import { DynamicCredentialResolverRegistry } from './credential-resolver-registry.service';
|
|
6
|
+
import { ResolverConfigExpressionService } from './resolver-config-expression.service';
|
|
5
7
|
import { DynamicCredentialResolver } from '../database/entities/credential-resolver';
|
|
6
8
|
import { DynamicCredentialResolverRepository } from '../database/repositories/credential-resolver.repository';
|
|
7
9
|
export interface CreateResolverParams {
|
|
8
10
|
name: string;
|
|
9
11
|
type: string;
|
|
10
12
|
config: CredentialResolverConfiguration;
|
|
13
|
+
user: User;
|
|
11
14
|
}
|
|
12
15
|
export interface UpdateResolverParams {
|
|
13
16
|
name?: string;
|
|
14
17
|
type?: string;
|
|
15
18
|
config?: CredentialResolverConfiguration;
|
|
19
|
+
clearCredentials?: boolean;
|
|
20
|
+
user: User;
|
|
16
21
|
}
|
|
17
22
|
export declare class DynamicCredentialResolverService {
|
|
18
23
|
private readonly logger;
|
|
19
24
|
private readonly repository;
|
|
20
25
|
private readonly registry;
|
|
21
26
|
private readonly cipher;
|
|
22
|
-
|
|
27
|
+
private readonly expressionService;
|
|
28
|
+
constructor(logger: Logger, repository: DynamicCredentialResolverRepository, registry: DynamicCredentialResolverRegistry, cipher: Cipher, expressionService: ResolverConfigExpressionService);
|
|
23
29
|
create(params: CreateResolverParams): Promise<DynamicCredentialResolver>;
|
|
24
30
|
findAll(): Promise<DynamicCredentialResolver[]>;
|
|
25
31
|
getAvailableTypes(): ICredentialResolver[];
|
|
@@ -13,21 +13,25 @@ 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");
|
|
16
17
|
const n8n_core_1 = require("n8n-core");
|
|
17
18
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
18
19
|
const credential_resolver_registry_service_1 = require("./credential-resolver-registry.service");
|
|
20
|
+
const resolver_config_expression_service_1 = require("./resolver-config-expression.service");
|
|
19
21
|
const credential_resolver_repository_1 = require("../database/repositories/credential-resolver.repository");
|
|
20
22
|
const credential_resolver_not_found_error_1 = require("../errors/credential-resolver-not-found.error");
|
|
21
23
|
let DynamicCredentialResolverService = class DynamicCredentialResolverService {
|
|
22
|
-
constructor(logger, repository, registry, cipher) {
|
|
24
|
+
constructor(logger, repository, registry, cipher, expressionService) {
|
|
23
25
|
this.logger = logger;
|
|
24
26
|
this.repository = repository;
|
|
25
27
|
this.registry = registry;
|
|
26
28
|
this.cipher = cipher;
|
|
29
|
+
this.expressionService = expressionService;
|
|
27
30
|
this.logger = this.logger.scoped('dynamic-credentials');
|
|
28
31
|
}
|
|
29
32
|
async create(params) {
|
|
30
|
-
|
|
33
|
+
const canUseExternalSecrets = (0, permissions_1.hasGlobalScope)(params.user, 'externalSecret:list');
|
|
34
|
+
await this.validateConfig(params.type, params.config, canUseExternalSecrets);
|
|
31
35
|
const encryptedConfig = this.encryptConfig(params.config);
|
|
32
36
|
const resolver = this.repository.create({
|
|
33
37
|
name: params.name,
|
|
@@ -57,20 +61,34 @@ let DynamicCredentialResolverService = class DynamicCredentialResolverService {
|
|
|
57
61
|
if (!existing) {
|
|
58
62
|
throw new credential_resolver_not_found_error_1.DynamicCredentialResolverNotFoundError(id);
|
|
59
63
|
}
|
|
64
|
+
const canUseExternalSecrets = (0, permissions_1.hasGlobalScope)(params.user, 'externalSecret:list');
|
|
60
65
|
if (params.type !== undefined) {
|
|
61
66
|
existing.type = params.type;
|
|
62
67
|
if (params.config === undefined) {
|
|
63
68
|
const existingConfig = this.decryptConfig(existing.config);
|
|
64
|
-
await this.validateConfig(existing.type, existingConfig);
|
|
69
|
+
await this.validateConfig(existing.type, existingConfig, canUseExternalSecrets);
|
|
65
70
|
}
|
|
66
71
|
}
|
|
67
72
|
if (params.config !== undefined) {
|
|
68
|
-
await this.validateConfig(existing.type, params.config);
|
|
73
|
+
await this.validateConfig(existing.type, params.config, canUseExternalSecrets);
|
|
69
74
|
existing.config = this.encryptConfig(params.config);
|
|
70
75
|
}
|
|
71
76
|
if (params.name !== undefined) {
|
|
72
77
|
existing.name = params.name;
|
|
73
78
|
}
|
|
79
|
+
if (params.clearCredentials === true) {
|
|
80
|
+
const resolver = this.registry.getResolverByTypename(existing.type);
|
|
81
|
+
if (!resolver) {
|
|
82
|
+
throw new decorators_1.CredentialResolverValidationError(`Unknown resolver type: ${existing.type}`);
|
|
83
|
+
}
|
|
84
|
+
if ('deleteAllSecrets' in resolver && typeof resolver.deleteAllSecrets === 'function') {
|
|
85
|
+
await resolver.deleteAllSecrets({
|
|
86
|
+
resolverId: id,
|
|
87
|
+
resolverName: resolver.metadata.name,
|
|
88
|
+
configuration: this.decryptConfig(existing.config),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
74
92
|
const saved = await this.repository.save(existing);
|
|
75
93
|
this.logger.debug(`Updated credential resolver "${saved.name}" (${saved.id})`);
|
|
76
94
|
return this.withDecryptedConfig(saved);
|
|
@@ -83,12 +101,19 @@ let DynamicCredentialResolverService = class DynamicCredentialResolverService {
|
|
|
83
101
|
await this.repository.remove(existing);
|
|
84
102
|
this.logger.debug(`Deleted credential resolver "${existing.name}" (${id})`);
|
|
85
103
|
}
|
|
86
|
-
async validateConfig(type, config) {
|
|
104
|
+
async validateConfig(type, config, canUseExternalSecrets = false) {
|
|
87
105
|
const resolverImplementation = this.registry.getResolverByTypename(type);
|
|
88
106
|
if (!resolverImplementation) {
|
|
89
107
|
throw new decorators_1.CredentialResolverValidationError(`Unknown resolver type: ${type}`);
|
|
90
108
|
}
|
|
91
|
-
|
|
109
|
+
let resolvedConfig = config;
|
|
110
|
+
try {
|
|
111
|
+
resolvedConfig = await this.expressionService.resolve(config, canUseExternalSecrets ?? false);
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
throw new decorators_1.CredentialResolverValidationError(`Invalid expression in resolver config: ${error instanceof Error ? error.message : String(error)}`);
|
|
115
|
+
}
|
|
116
|
+
await resolverImplementation.validateOptions(resolvedConfig);
|
|
92
117
|
}
|
|
93
118
|
encryptConfig(config) {
|
|
94
119
|
return this.cipher.encrypt(config);
|
|
@@ -113,6 +138,7 @@ exports.DynamicCredentialResolverService = DynamicCredentialResolverService = __
|
|
|
113
138
|
__metadata("design:paramtypes", [backend_common_1.Logger,
|
|
114
139
|
credential_resolver_repository_1.DynamicCredentialResolverRepository,
|
|
115
140
|
credential_resolver_registry_service_1.DynamicCredentialResolverRegistry,
|
|
116
|
-
n8n_core_1.Cipher
|
|
141
|
+
n8n_core_1.Cipher,
|
|
142
|
+
resolver_config_expression_service_1.ResolverConfigExpressionService])
|
|
117
143
|
], DynamicCredentialResolverService);
|
|
118
144
|
//# sourceMappingURL=credential-resolver.service.js.map
|
|
@@ -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;
|
|
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,kDAAkD;AAClD,uCAAkC;AAClC,+CAA0D;AAE1D,iGAA2F;AAC3F,6FAAuF;AAEvF,4GAA8G;AAC9G,uGAAuG;AAyBhG,IAAM,gCAAgC,GAAtC,MAAM,gCAAgC;IAC5C,YACkB,MAAc,EACd,UAA+C,EAC/C,QAA2C,EAC3C,MAAc,EACd,iBAAkD;QAJlD,WAAM,GAAN,MAAM,CAAQ;QACd,eAAU,GAAV,UAAU,CAAqC;QAC/C,aAAQ,GAAR,QAAQ,CAAmC;QAC3C,WAAM,GAAN,MAAM,CAAQ;QACd,sBAAiB,GAAjB,iBAAiB,CAAiC;QAEnE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;IACzD,CAAC;IAMD,KAAK,CAAC,MAAM,CAAC,MAA4B;QACxC,MAAM,qBAAqB,GAAG,IAAA,4BAAc,EAAC,MAAM,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;QAEjF,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;QAE7E,MAAM,eAAe,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAE1D,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;YACvC,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,MAAM,EAAE,eAAe;SACvB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AC;QAAC,OAAO,KAAK,EAAE,CAAC;YAEhB,MAAM,IAAI,8CAAiC,CAC1C,0CAA0C,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAClG,CAAC;QACH,CAAC;QAGD,MAAM,sBAAsB,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;IAC9D,CAAC;IAKO,aAAa,CAAC,MAAuC;QAC5D,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IAKO,aAAa,CAAC,eAAuB;QAC5C,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QAC3D,IAAI,CAAC;YACJ,OAAO,IAAA,wBAAS,EAAkC,aAAa,CAAC,CAAC;QAClE,CAAC;QAAC,MAAM,CAAC;YACR,MAAM,IAAI,8BAAe,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;AA5LY,4EAAgC;2CAAhC,gCAAgC;IAD5C,IAAA,YAAO,GAAE;qCAGiB,uBAAM;QACF,oEAAmC;QACrC,wEAAiC;QACnC,iBAAM;QACK,oEAA+B;GANxD,gCAAgC,CA4L5C"}
|
package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Logger } from '@n8n/backend-common';
|
|
2
|
+
import { Cipher } from 'n8n-core';
|
|
2
3
|
import { type ICredentialContext, type ICredentialDataDecryptedObject, type IWorkflowSettings } from 'n8n-workflow';
|
|
3
4
|
import { DynamicCredentialResolverRegistry } from './credential-resolver-registry.service';
|
|
4
5
|
import { DynamicCredentialResolverRepository } from '../database/repositories/credential-resolver.repository';
|
|
5
|
-
import {
|
|
6
|
+
import type { CredentialStoreMetadata, IDynamicCredentialStorageProvider } from '../../../credentials/dynamic-credential-storage.interface';
|
|
6
7
|
import { LoadNodesAndCredentials } from '../../../load-nodes-and-credentials';
|
|
7
|
-
import { Logger } from '@n8n/backend-common';
|
|
8
8
|
export declare class DynamicCredentialStorageService implements IDynamicCredentialStorageProvider {
|
|
9
9
|
private readonly resolverRegistry;
|
|
10
10
|
private readonly resolverRepository;
|
|
@@ -10,15 +10,15 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.DynamicCredentialStorageService = void 0;
|
|
13
|
+
const backend_common_1 = require("@n8n/backend-common");
|
|
14
|
+
const di_1 = require("@n8n/di");
|
|
15
|
+
const n8n_core_1 = require("n8n-core");
|
|
13
16
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
14
17
|
const credential_resolver_registry_service_1 = require("./credential-resolver-registry.service");
|
|
18
|
+
const shared_fields_1 = require("./shared-fields");
|
|
15
19
|
const credential_resolver_repository_1 = require("../database/repositories/credential-resolver.repository");
|
|
16
|
-
const n8n_core_1 = require("n8n-core");
|
|
17
20
|
const credential_storage_error_1 = require("../errors/credential-storage.error");
|
|
18
21
|
const load_nodes_and_credentials_1 = require("../../../load-nodes-and-credentials");
|
|
19
|
-
const backend_common_1 = require("@n8n/backend-common");
|
|
20
|
-
const di_1 = require("@n8n/di");
|
|
21
|
-
const shared_fields_1 = require("./shared-fields");
|
|
22
22
|
let DynamicCredentialStorageService = class DynamicCredentialStorageService {
|
|
23
23
|
constructor(resolverRegistry, resolverRepository, loadNodesAndCredentials, cipher, logger) {
|
|
24
24
|
this.resolverRegistry = resolverRegistry;
|
package/dist/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-credential-storage.service.js","sourceRoot":"","sources":["../../../../src/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"dynamic-credential-storage.service.js","sourceRoot":"","sources":["../../../../src/modules/dynamic-credentials.ee/services/dynamic-credential-storage.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA6C;AAC7C,gCAAkC;AAClC,uCAAkC;AAClC,+CAKsB;AAEtB,iGAA2F;AAC3F,mDAAsD;AACtD,4GAA8G;AAC9G,iFAA4E;AAM5E,6EAAuE;AAGhE,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAC3C,YACkB,gBAAmD,EACnD,kBAAuD,EACvD,uBAAgD,EAChD,MAAc,EACd,MAAc;QAJd,qBAAgB,GAAhB,gBAAgB,CAAmC;QACnD,uBAAkB,GAAlB,kBAAkB,CAAqC;QACvD,4BAAuB,GAAvB,uBAAuB,CAAyB;QAChD,WAAM,GAAN,MAAM,CAAQ;QACd,WAAM,GAAN,MAAM,CAAQ;IAC7B,CAAC;IAEJ,KAAK,CAAC,aAAa,CAClB,uBAAgD,EAChD,WAA2C,EAC3C,iBAAqC,EACrC,UAA2C,EAC3C,gBAAoC;QAEpC,IAAI,CAAC;YACJ,IAAI,CAAC,uBAAuB,CAAC,YAAY,EAAE,CAAC;gBAE3C,OAAO;YACR,CAAC;YAGD,MAAM,UAAU,GACf,uBAAuB,CAAC,UAAU,IAAI,gBAAgB,EAAE,oBAAoB,CAAC;YAG9E,IAAI,CAAC,UAAU,EAAE,CAAC;gBACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,CAAC;YACvD,CAAC;YAGD,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC;gBAC9D,EAAE,EAAE,UAAU;aACd,CAAC,CAAC;YAEH,I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xC,UAAU;gBACV,cAAc,EAAE,uBAAuB,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU;gBAC9E,QAAQ,EAAE,iBAAiB,CAAC,QAAQ;aACpC,CAAC,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,IAAI,iDAAsB,CAC/B,iDAAiD,uBAAuB,CAAC,IAAI,GAAG,EAChF,EAAE,KAAK,EAAE,KAAK,EAAE,CAChB,CAAC;QACH,CAAC;IACF,CAAC;IAEO,gBAAgB,CAAC,uBAAgD;QACxE,MAAM,IAAI,iDAAsB,CAC/B,qCAAqC,uBAAuB,CAAC,IAAI,GAAG,CACpE,CAAC;IACH,CAAC;IAEO,qBAAqB,CAC5B,uBAAgD,EAChD,UAAkB;QAElB,MAAM,IAAI,iDAAsB,CAC/B,aAAa,UAAU,+BAA+B,uBAAuB,CAAC,IAAI,GAAG,CACrF,CAAC;IACH,CAAC;CACD,CAAA;AAtGY,0EAA+B;0CAA/B,+BAA+B;IAD3C,IAAA,YAAO,GAAE;qCAG2B,wEAAiC;QAC/B,oEAAmC;QAC9B,oDAAuB;QACxC,iBAAM;QACN,uBAAM;GANpB,+BAA+B,CAsG3C"}
|
|
@@ -3,6 +3,7 @@ import { Cipher } from 'n8n-core';
|
|
|
3
3
|
import type { ICredentialDataDecryptedObject, IExecutionContext, IWorkflowSettings } from 'n8n-workflow';
|
|
4
4
|
import { LoadNodesAndCredentials } from '../../../load-nodes-and-credentials';
|
|
5
5
|
import { DynamicCredentialResolverRegistry } from './credential-resolver-registry.service';
|
|
6
|
+
import { ResolverConfigExpressionService } from './resolver-config-expression.service';
|
|
6
7
|
import type { CredentialResolveMetadata, ICredentialResolutionProvider } from '../../../credentials/credential-resolution-provider.interface';
|
|
7
8
|
import { DynamicCredentialResolverRepository } from '../database/repositories/credential-resolver.repository';
|
|
8
9
|
export declare class DynamicCredentialService implements ICredentialResolutionProvider {
|
|
@@ -11,8 +12,9 @@ export declare class DynamicCredentialService implements ICredentialResolutionPr
|
|
|
11
12
|
private readonly loadNodesAndCredentials;
|
|
12
13
|
private readonly cipher;
|
|
13
14
|
private readonly logger;
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
private readonly expressionService;
|
|
16
|
+
constructor(resolverRegistry: DynamicCredentialResolverRegistry, resolverRepository: DynamicCredentialResolverRepository, loadNodesAndCredentials: LoadNodesAndCredentials, cipher: Cipher, logger: Logger, expressionService: ResolverConfigExpressionService);
|
|
17
|
+
resolveIfNeeded(credentialsResolveMetadata: CredentialResolveMetadata, staticData: ICredentialDataDecryptedObject, executionContext?: IExecutionContext, workflowSettings?: IWorkflowSettings, canUseExternalSecrets?: boolean): Promise<ICredentialDataDecryptedObject>;
|
|
16
18
|
private buildCredentialContext;
|
|
17
19
|
private handleResolutionError;
|
|
18
20
|
private handleMissingResolver;
|
|
@@ -17,18 +17,20 @@ const n8n_core_1 = require("n8n-core");
|
|
|
17
17
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
18
18
|
const load_nodes_and_credentials_1 = require("../../../load-nodes-and-credentials");
|
|
19
19
|
const credential_resolver_registry_service_1 = require("./credential-resolver-registry.service");
|
|
20
|
+
const resolver_config_expression_service_1 = require("./resolver-config-expression.service");
|
|
20
21
|
const shared_fields_1 = require("./shared-fields");
|
|
21
22
|
const credential_resolver_repository_1 = require("../database/repositories/credential-resolver.repository");
|
|
22
23
|
const credential_resolution_error_1 = require("../errors/credential-resolution.error");
|
|
23
24
|
let DynamicCredentialService = class DynamicCredentialService {
|
|
24
|
-
constructor(resolverRegistry, resolverRepository, loadNodesAndCredentials, cipher, logger) {
|
|
25
|
+
constructor(resolverRegistry, resolverRepository, loadNodesAndCredentials, cipher, logger, expressionService) {
|
|
25
26
|
this.resolverRegistry = resolverRegistry;
|
|
26
27
|
this.resolverRepository = resolverRepository;
|
|
27
28
|
this.loadNodesAndCredentials = loadNodesAndCredentials;
|
|
28
29
|
this.cipher = cipher;
|
|
29
30
|
this.logger = logger;
|
|
31
|
+
this.expressionService = expressionService;
|
|
30
32
|
}
|
|
31
|
-
async resolveIfNeeded(credentialsResolveMetadata, staticData, executionContext, workflowSettings) {
|
|
33
|
+
async resolveIfNeeded(credentialsResolveMetadata, staticData, executionContext, workflowSettings, canUseExternalSecrets) {
|
|
32
34
|
const resolverId = credentialsResolveMetadata.resolverId ?? workflowSettings?.credentialResolverId;
|
|
33
35
|
if (!credentialsResolveMetadata.isResolvable || !resolverId) {
|
|
34
36
|
return staticData;
|
|
@@ -51,7 +53,8 @@ let DynamicCredentialService = class DynamicCredentialService {
|
|
|
51
53
|
const credentialType = this.loadNodesAndCredentials.getCredential(credentialsResolveMetadata.type);
|
|
52
54
|
const sharedFields = (0, shared_fields_1.extractSharedFields)(credentialType.type);
|
|
53
55
|
const decryptedConfig = this.cipher.decrypt(resolverEntity.config);
|
|
54
|
-
const
|
|
56
|
+
const parsedConfig = (0, n8n_workflow_1.jsonParse)(decryptedConfig);
|
|
57
|
+
const resolverConfig = await this.expressionService.resolve(parsedConfig, canUseExternalSecrets ?? false);
|
|
55
58
|
const dynamicData = await resolver.getSecret(credentialsResolveMetadata.id, credentialContext, {
|
|
56
59
|
resolverId: resolverEntity.id,
|
|
57
60
|
resolverName: resolverEntity.type,
|
|
@@ -141,6 +144,7 @@ exports.DynamicCredentialService = DynamicCredentialService = __decorate([
|
|
|
141
144
|
credential_resolver_repository_1.DynamicCredentialResolverRepository,
|
|
142
145
|
load_nodes_and_credentials_1.LoadNodesAndCredentials,
|
|
143
146
|
n8n_core_1.Cipher,
|
|
144
|
-
backend_common_1.Logger
|
|
147
|
+
backend_common_1.Logger,
|
|
148
|
+
resolver_config_expression_service_1.ResolverConfigExpressionService])
|
|
145
149
|
], DynamicCredentialService);
|
|
146
150
|
//# sourceMappingURL=dynamic-credential.service.js.map
|