n8n 2.23.2 → 2.24.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 +8 -4
- package/dist/active-workflow-manager.js +26 -9
- package/dist/active-workflow-manager.js.map +1 -1
- package/dist/auth/auth.service.d.ts +1 -1
- package/dist/auth/auth.service.js +2 -1
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/controllers/ai.controller.js +1 -1
- package/dist/controllers/ai.controller.js.map +1 -1
- package/dist/controllers/api-keys.controller.d.ts +20 -15
- package/dist/controllers/api-keys.controller.js +7 -4
- package/dist/controllers/api-keys.controller.js.map +1 -1
- package/dist/controllers/oauth/oauth1-credential.controller.d.ts +4 -2
- package/dist/controllers/oauth/oauth1-credential.controller.js +15 -5
- package/dist/controllers/oauth/oauth1-credential.controller.js.map +1 -1
- package/dist/controllers/oauth/oauth2-credential.controller.d.ts +4 -2
- package/dist/controllers/oauth/oauth2-credential.controller.js +15 -6
- package/dist/controllers/oauth/oauth2-credential.controller.js.map +1 -1
- package/dist/controllers/project.controller.d.ts +8 -0
- package/dist/controllers/project.controller.js +2 -1
- package/dist/controllers/project.controller.js.map +1 -1
- package/dist/controllers/security-settings.controller.js +18 -1
- package/dist/controllers/security-settings.controller.js.map +1 -1
- package/dist/controllers/telemetry.controller.js +4 -1
- package/dist/controllers/telemetry.controller.js.map +1 -1
- package/dist/credentials/credential-connection-status-provider.interface.d.ts +3 -0
- package/dist/credentials/credential-connection-status-proxy.d.ts +3 -0
- package/dist/credentials/credential-connection-status-proxy.js +10 -0
- package/dist/credentials/credential-connection-status-proxy.js.map +1 -1
- package/dist/credentials/credentials.controller.d.ts +6 -0
- package/dist/credentials/credentials.controller.js +39 -2
- package/dist/credentials/credentials.controller.js.map +1 -1
- package/dist/credentials/credentials.service.d.ts +29 -13
- package/dist/credentials/credentials.service.ee.d.ts +2 -0
- package/dist/credentials/credentials.service.ee.js +3 -0
- package/dist/credentials/credentials.service.ee.js.map +1 -1
- package/dist/credentials/credentials.service.js +27 -6
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/credentials-helper.d.ts +1 -0
- package/dist/credentials-helper.js +14 -4
- package/dist/credentials-helper.js.map +1 -1
- package/dist/errors/credential-missing-id.error.d.ts +4 -0
- package/dist/errors/credential-missing-id.error.js +14 -0
- package/dist/errors/credential-missing-id.error.js.map +1 -0
- package/dist/eventbus/event-message-classes/index.d.ts +2 -2
- package/dist/eventbus/event-message-classes/index.js +3 -0
- package/dist/eventbus/event-message-classes/index.js.map +1 -1
- package/dist/events/maps/relay.event-map.d.ts +54 -2
- package/dist/events/relays/log-streaming.event-relay.d.ts +3 -0
- package/dist/events/relays/log-streaming.event-relay.js +39 -1
- package/dist/events/relays/log-streaming.event-relay.js.map +1 -1
- package/dist/events/relays/telemetry.event-relay.d.ts +6 -0
- package/dist/events/relays/telemetry.event-relay.js +74 -3
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js +6 -5
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
- package/dist/executions/execution-persistence.js +4 -0
- package/dist/executions/execution-persistence.js.map +1 -1
- package/dist/expression-observability/expression-observability.provider.d.ts +3 -1
- package/dist/expression-observability/expression-observability.provider.js +48 -46
- package/dist/expression-observability/expression-observability.provider.js.map +1 -1
- package/dist/interfaces.d.ts +3 -1
- package/dist/modules/agents/agent-execution.service.d.ts +4 -2
- package/dist/modules/agents/agent-execution.service.js +3 -3
- package/dist/modules/agents/agent-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-knowledge-command.service.d.ts +40 -0
- package/dist/modules/agents/agent-knowledge-command.service.js +221 -0
- package/dist/modules/agents/agent-knowledge-command.service.js.map +1 -0
- package/dist/modules/agents/agent-knowledge.service.d.ts +42 -0
- package/dist/modules/agents/agent-knowledge.service.js +300 -0
- package/dist/modules/agents/agent-knowledge.service.js.map +1 -0
- package/dist/modules/agents/agent-task.service.d.ts +52 -0
- package/dist/modules/agents/agent-task.service.js +487 -0
- package/dist/modules/agents/agent-task.service.js.map +1 -0
- package/dist/modules/agents/agent-upload.middleware.d.ts +7 -0
- package/dist/modules/agents/agent-upload.middleware.js +62 -0
- package/dist/modules/agents/agent-upload.middleware.js.map +1 -0
- package/dist/modules/agents/agents-tools.service.d.ts +1 -1
- package/dist/modules/agents/agents-tools.service.js +12 -3
- package/dist/modules/agents/agents-tools.service.js.map +1 -1
- package/dist/modules/agents/agents.controller.d.ts +138 -45
- package/dist/modules/agents/agents.controller.js +176 -48
- package/dist/modules/agents/agents.controller.js.map +1 -1
- package/dist/modules/agents/agents.module.d.ts +2 -2
- package/dist/modules/agents/agents.module.js +13 -5
- package/dist/modules/agents/agents.module.js.map +1 -1
- package/dist/modules/agents/agents.service.d.ts +43 -7
- package/dist/modules/agents/agents.service.js +341 -57
- package/dist/modules/agents/agents.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-prompts.d.ts +6 -5
- package/dist/modules/agents/builder/agents-builder-prompts.js +92 -18
- package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +11 -1
- package/dist/modules/agents/builder/agents-builder-tools.service.js +164 -26
- package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder.service.d.ts +3 -1
- package/dist/modules/agents/builder/agents-builder.service.js +8 -3
- package/dist/modules/agents/builder/agents-builder.service.js.map +1 -1
- package/dist/modules/agents/builder/builder-tool-names.d.ts +3 -0
- package/dist/modules/agents/builder/builder-tool-names.js +3 -0
- package/dist/modules/agents/builder/builder-tool-names.js.map +1 -1
- package/dist/modules/agents/builder/interactive/ask-credential.tool.d.ts +1 -0
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js +25 -4
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js.map +1 -1
- package/dist/modules/agents/builder/interactive/ask-question.tool.js +6 -5
- package/dist/modules/agents/builder/interactive/ask-question.tool.js.map +1 -1
- package/dist/modules/agents/builder/prompts/config-mutation.prompt.js +20 -5
- package/dist/modules/agents/builder/prompts/config-mutation.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/config-rules.prompt.js +23 -4
- package/dist/modules/agents/builder/prompts/config-rules.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/llm-selection.prompt.js +18 -1
- package/dist/modules/agents/builder/prompts/llm-selection.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/memory.prompt.d.ts +1 -1
- package/dist/modules/agents/builder/prompts/memory.prompt.js +5 -3
- package/dist/modules/agents/builder/prompts/memory.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/tools.prompt.d.ts +1 -1
- package/dist/modules/agents/builder/prompts/tools.prompt.js +11 -2
- package/dist/modules/agents/builder/prompts/tools.prompt.js.map +1 -1
- package/dist/modules/agents/builder/search-mcp-servers.tool.d.ts +6 -0
- package/dist/modules/agents/builder/search-mcp-servers.tool.js +85 -0
- package/dist/modules/agents/builder/search-mcp-servers.tool.js.map +1 -0
- package/dist/modules/agents/builder/skill-body-template.d.ts +4 -0
- package/dist/modules/agents/builder/skill-body-template.js +31 -0
- package/dist/modules/agents/builder/skill-body-template.js.map +1 -0
- package/dist/modules/agents/builder/skills/index.js +6 -1
- package/dist/modules/agents/builder/skills/index.js.map +1 -1
- package/dist/modules/agents/builder/skills/integrations.skill.js +39 -18
- package/dist/modules/agents/builder/skills/integrations.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/mcp.skill.d.ts +2 -0
- package/dist/modules/agents/builder/skills/mcp.skill.js +110 -0
- package/dist/modules/agents/builder/skills/mcp.skill.js.map +1 -0
- package/dist/modules/agents/builder/skills/research.skill.js +8 -5
- package/dist/modules/agents/builder/skills/research.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/target-skills.skill.js +41 -13
- package/dist/modules/agents/builder/skills/target-skills.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/target-tasks.skill.d.ts +2 -0
- package/dist/modules/agents/builder/skills/target-tasks.skill.js +82 -0
- package/dist/modules/agents/builder/skills/target-tasks.skill.js.map +1 -0
- package/dist/modules/agents/builder/task-objective-template.d.ts +3 -0
- package/dist/modules/agents/builder/task-objective-template.js +27 -0
- package/dist/modules/agents/builder/task-objective-template.js.map +1 -0
- package/dist/modules/agents/builder/verify-mcp-server.tool.d.ts +8 -0
- package/dist/modules/agents/builder/verify-mcp-server.tool.js +79 -0
- package/dist/modules/agents/builder/verify-mcp-server.tool.js.map +1 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.d.ts +4 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.js +26 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.js.map +1 -1
- package/dist/modules/agents/entities/agent-file.entity.d.ts +11 -0
- package/dist/modules/agents/entities/agent-file.entity.js +48 -0
- package/dist/modules/agents/entities/agent-file.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-task-run-lock.entity.d.ts +10 -0
- package/dist/modules/agents/entities/agent-task-run-lock.entity.js +54 -0
- package/dist/modules/agents/entities/agent-task-run-lock.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-task-snapshot.entity.d.ts +12 -0
- package/dist/modules/agents/entities/agent-task-snapshot.entity.js +70 -0
- package/dist/modules/agents/entities/agent-task-snapshot.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-task.entity.d.ts +11 -0
- package/dist/modules/agents/entities/agent-task.entity.js +64 -0
- package/dist/modules/agents/entities/agent-task.entity.js.map +1 -0
- package/dist/modules/agents/execution-recorder.d.ts +1 -0
- package/dist/modules/agents/execution-recorder.js +9 -5
- package/dist/modules/agents/execution-recorder.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +16 -4
- package/dist/modules/agents/integrations/agent-chat-bridge.js +372 -116
- package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-integration.d.ts +27 -2
- package/dist/modules/agents/integrations/agent-chat-integration.js +5 -0
- package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -1
- package/dist/modules/agents/integrations/chat-integration.service.d.ts +15 -6
- package/dist/modules/agents/integrations/chat-integration.service.js +9 -10
- package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
- package/dist/modules/agents/integrations/component-mapper.d.ts +14 -0
- package/dist/modules/agents/integrations/component-mapper.js +9 -1
- package/dist/modules/agents/integrations/component-mapper.js.map +1 -1
- package/dist/modules/agents/integrations/integration-action-executor.d.ts +22 -0
- package/dist/modules/agents/integrations/integration-action-executor.js +171 -0
- package/dist/modules/agents/integrations/integration-action-executor.js.map +1 -0
- package/dist/modules/agents/integrations/integration-context-query-executor.d.ts +18 -0
- package/dist/modules/agents/integrations/integration-context-query-executor.js +58 -0
- package/dist/modules/agents/integrations/integration-context-query-executor.js.map +1 -0
- package/dist/modules/agents/integrations/integration-error-codes.d.ts +13 -0
- package/dist/modules/agents/integrations/integration-error-codes.js +16 -0
- package/dist/modules/agents/integrations/integration-error-codes.js.map +1 -0
- package/dist/modules/agents/integrations/integration-helpers.d.ts +21 -0
- package/dist/modules/agents/integrations/integration-helpers.js +72 -0
- package/dist/modules/agents/integrations/integration-helpers.js.map +1 -0
- package/dist/modules/agents/integrations/integration-message-context.service.d.ts +13 -0
- package/dist/modules/agents/integrations/integration-message-context.service.js +129 -0
- package/dist/modules/agents/integrations/integration-message-context.service.js.map +1 -0
- package/dist/modules/agents/integrations/integration-tools.d.ts +205 -0
- package/dist/modules/agents/integrations/integration-tools.js +955 -0
- package/dist/modules/agents/integrations/integration-tools.js.map +1 -0
- package/dist/modules/agents/integrations/integrations-sync.d.ts +1 -1
- package/dist/modules/agents/integrations/integrations-sync.js +1 -29
- package/dist/modules/agents/integrations/integrations-sync.js.map +1 -1
- package/dist/modules/agents/integrations/n8n-memory.d.ts +2 -0
- package/dist/modules/agents/integrations/n8n-memory.js +18 -11
- package/dist/modules/agents/integrations/n8n-memory.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/linear-integration.d.ts +13 -2
- package/dist/modules/agents/integrations/platforms/linear-integration.js +70 -15
- package/dist/modules/agents/integrations/platforms/linear-integration.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/linear-operations.d.ts +18 -0
- package/dist/modules/agents/integrations/platforms/linear-operations.js +679 -0
- package/dist/modules/agents/integrations/platforms/linear-operations.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/slack-integration.d.ts +11 -1
- package/dist/modules/agents/integrations/platforms/slack-integration.js +53 -1
- package/dist/modules/agents/integrations/platforms/slack-integration.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/slack-operations.d.ts +17 -0
- package/dist/modules/agents/integrations/platforms/slack-operations.js +288 -0
- package/dist/modules/agents/integrations/platforms/slack-operations.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/telegram-integration.d.ts +9 -2
- package/dist/modules/agents/integrations/platforms/telegram-integration.js +17 -0
- package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -1
- package/dist/modules/agents/integrations/slack-app-setup.service.js +7 -1
- package/dist/modules/agents/integrations/slack-app-setup.service.js.map +1 -1
- package/dist/modules/agents/json-config/from-json-config.d.ts +4 -2
- package/dist/modules/agents/json-config/from-json-config.js +88 -11
- package/dist/modules/agents/json-config/from-json-config.js.map +1 -1
- package/dist/modules/agents/json-config/mcp-client-factory.d.ts +16 -0
- package/dist/modules/agents/json-config/mcp-client-factory.js +155 -0
- package/dist/modules/agents/json-config/mcp-client-factory.js.map +1 -0
- package/dist/modules/agents/json-config/native-web-search-provider-tools.d.ts +8 -0
- package/dist/modules/agents/json-config/native-web-search-provider-tools.js +59 -0
- package/dist/modules/agents/json-config/native-web-search-provider-tools.js.map +1 -0
- package/dist/modules/agents/json-config/schema-text-serializer.js +12 -2
- package/dist/modules/agents/json-config/schema-text-serializer.js.map +1 -1
- package/dist/modules/agents/repositories/agent-execution-thread.repository.d.ts +1 -1
- package/dist/modules/agents/repositories/agent-execution-thread.repository.js +5 -3
- package/dist/modules/agents/repositories/agent-execution-thread.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-file.repository.d.ts +7 -0
- package/dist/modules/agents/repositories/agent-file.repository.js +35 -0
- package/dist/modules/agents/repositories/agent-file.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-history.repository.d.ts +2 -0
- package/dist/modules/agents/repositories/agent-history.repository.js +18 -0
- package/dist/modules/agents/repositories/agent-history.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-task-run-lock.repository.d.ts +12 -0
- package/dist/modules/agents/repositories/agent-task-run-lock.repository.js +72 -0
- package/dist/modules/agents/repositories/agent-task-run-lock.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-task-snapshot.repository.d.ts +11 -0
- package/dist/modules/agents/repositories/agent-task-snapshot.repository.js +45 -0
- package/dist/modules/agents/repositories/agent-task-snapshot.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-task.repository.d.ts +7 -0
- package/dist/modules/agents/repositories/agent-task.repository.js +32 -0
- package/dist/modules/agents/repositories/agent-task.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent.repository.js +1 -2
- package/dist/modules/agents/repositories/agent.repository.js.map +1 -1
- package/dist/modules/agents/tools/knowledge/csv-helpers.d.ts +73 -0
- package/dist/modules/agents/tools/knowledge/csv-helpers.js +341 -0
- package/dist/modules/agents/tools/knowledge/csv-helpers.js.map +1 -0
- package/dist/modules/agents/tools/knowledge/csv.operation.d.ts +61 -0
- package/dist/modules/agents/tools/knowledge/csv.operation.js +207 -0
- package/dist/modules/agents/tools/knowledge/csv.operation.js.map +1 -0
- package/dist/modules/agents/tools/knowledge/file-references.d.ts +16 -0
- package/dist/modules/agents/tools/knowledge/file-references.js +35 -0
- package/dist/modules/agents/tools/knowledge/file-references.js.map +1 -0
- package/dist/modules/agents/tools/knowledge/read.operation.d.ts +8 -0
- package/dist/modules/agents/tools/knowledge/read.operation.js +38 -0
- package/dist/modules/agents/tools/knowledge/read.operation.js.map +1 -0
- package/dist/modules/agents/tools/knowledge/schemas.d.ts +1505 -0
- package/dist/modules/agents/tools/knowledge/schemas.js +441 -0
- package/dist/modules/agents/tools/knowledge/schemas.js.map +1 -0
- package/dist/modules/agents/tools/knowledge/search.operation.d.ts +9 -0
- package/dist/modules/agents/tools/knowledge/search.operation.js +332 -0
- package/dist/modules/agents/tools/knowledge/search.operation.js.map +1 -0
- package/dist/modules/agents/tools/knowledge/tool.d.ts +8 -0
- package/dist/modules/agents/tools/knowledge/tool.js +121 -0
- package/dist/modules/agents/tools/knowledge/tool.js.map +1 -0
- package/dist/modules/agents/utils/agent-memory-scope.d.ts +1 -1
- package/dist/modules/agents/utils/agent-memory-scope.js +4 -4
- package/dist/modules/agents/utils/agent-memory-scope.js.map +1 -1
- package/dist/modules/agents/utils/agent-resource-id.d.ts +1 -1
- package/dist/modules/chat-hub/chat-hub.module.d.ts +2 -2
- package/dist/modules/chat-hub/chat-hub.settings.controller.d.ts +4 -4
- package/dist/modules/chat-hub/chat-hub.types.d.ts +5 -5
- package/dist/modules/chat-hub/dto/chat-models-request.dto.d.ts +1 -1
- package/dist/modules/dynamic-credentials.ee/constants.d.ts +1 -1
- package/dist/modules/dynamic-credentials.ee/constants.js +2 -1
- package/dist/modules/dynamic-credentials.ee/constants.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.d.ts +9 -2
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js +45 -14
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.d.ts +4 -0
- package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js +16 -0
- package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js +6 -2
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.d.ts +1 -0
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.js +21 -2
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.js.map +1 -1
- package/dist/modules/instance-ai/eval/execution.service.d.ts +4 -1
- package/dist/modules/instance-ai/eval/execution.service.js +118 -24
- package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/llm-wire-server.d.ts +8 -3
- package/dist/modules/instance-ai/eval/llm-wire-server.js +147 -50
- package/dist/modules/instance-ai/eval/llm-wire-server.js.map +1 -1
- package/dist/modules/instance-ai/eval/mock-handler.js +45 -8
- package/dist/modules/instance-ai/eval/mock-handler.js.map +1 -1
- package/dist/modules/instance-ai/eval/mock-quirks.d.ts +4 -2
- package/dist/modules/instance-ai/eval/mock-quirks.js +83 -4
- package/dist/modules/instance-ai/eval/mock-quirks.js.map +1 -1
- package/dist/modules/instance-ai/eval/openai-envelope.d.ts +8 -0
- package/dist/modules/instance-ai/eval/openai-envelope.js +121 -8
- package/dist/modules/instance-ai/eval/openai-envelope.js.map +1 -1
- package/dist/modules/instance-ai/eval/openai-responses-envelope.d.ts +11 -0
- package/dist/modules/instance-ai/eval/openai-responses-envelope.js +238 -0
- package/dist/modules/instance-ai/eval/openai-responses-envelope.js.map +1 -0
- package/dist/modules/instance-ai/eval/request-binary-redactor.d.ts +1 -0
- package/dist/modules/instance-ai/eval/request-binary-redactor.js +74 -0
- package/dist/modules/instance-ai/eval/request-binary-redactor.js.map +1 -0
- package/dist/modules/instance-ai/eval/workflow-analysis.d.ts +19 -1
- package/dist/modules/instance-ai/eval/workflow-analysis.js +159 -76
- package/dist/modules/instance-ai/eval/workflow-analysis.js.map +1 -1
- package/dist/modules/instance-ai/extract-resolved-node-parameters.d.ts +7 -0
- package/dist/modules/instance-ai/extract-resolved-node-parameters.js +221 -0
- package/dist/modules/instance-ai/extract-resolved-node-parameters.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai-memory.service.d.ts +7 -1
- package/dist/modules/instance-ai/instance-ai-memory.service.js +80 -3
- package/dist/modules/instance-ai/instance-ai-memory.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-settings.service.js +1 -16
- package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +1 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +67 -7
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.module.d.ts +1 -1
- package/dist/modules/instance-ai/instance-ai.service.d.ts +24 -1
- package/dist/modules/instance-ai/instance-ai.service.js +400 -26
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.d.ts +1 -0
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js +1 -0
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js.map +1 -1
- package/dist/modules/instance-ai/message-parser.d.ts +2 -0
- package/dist/modules/instance-ai/message-parser.js +165 -36
- package/dist/modules/instance-ai/message-parser.js.map +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.d.ts +2 -0
- package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.js +13 -0
- package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.js.map +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-pending-confirmation.repository.d.ts +12 -0
- package/dist/modules/instance-ai/repositories/instance-ai-pending-confirmation.repository.js +80 -0
- package/dist/modules/instance-ai/repositories/instance-ai-pending-confirmation.repository.js.map +1 -0
- package/dist/modules/instance-ai/storage/db-snapshot-storage.d.ts +1 -0
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js +23 -0
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js.map +1 -1
- package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.d.ts +10 -4
- package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.js +49 -37
- package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.js.map +1 -1
- package/dist/modules/instance-ai/web-research/index.d.ts +0 -2
- package/dist/modules/instance-ai/web-research/index.js +1 -5
- package/dist/modules/instance-ai/web-research/index.js.map +1 -1
- package/dist/modules/ldap.ee/helpers.ee.js +6 -2
- package/dist/modules/ldap.ee/helpers.ee.js.map +1 -1
- package/dist/modules/mcp/mcp.controller.js +13 -6
- package/dist/modules/mcp/mcp.controller.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +10 -2
- package/dist/modules/mcp/mcp.service.js +36 -6
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/mcp.settings.controller.d.ts +2 -0
- package/dist/modules/mcp/mcp.settings.service.d.ts +2 -0
- package/dist/modules/mcp/mcp.settings.service.js +6 -5
- package/dist/modules/mcp/mcp.settings.service.js.map +1 -1
- package/dist/modules/mcp/mcp.types.d.ts +6 -0
- package/dist/modules/mcp/mcp.types.js +9 -0
- package/dist/modules/mcp/mcp.types.js.map +1 -1
- package/dist/modules/mcp/tools/execute-workflow.tool.d.ts +6 -6
- package/dist/modules/mcp/tools/search-workflows.tool.d.ts +2 -1
- package/dist/modules/mcp/tools/search-workflows.tool.js +12 -4
- package/dist/modules/mcp/tools/search-workflows.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +1 -1
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.d.ts +67 -6
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.d.ts +67 -6
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js +51 -0
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry.types.js.map +1 -1
- package/dist/modules/mcp-registry/synthesize-type-def.d.ts +2 -0
- package/dist/modules/mcp-registry/synthesize-type-def.js +35 -0
- package/dist/modules/mcp-registry/synthesize-type-def.js.map +1 -0
- package/dist/modules/n8n-packages/engine/import-pipeline.d.ts +24 -0
- package/dist/modules/n8n-packages/engine/import-pipeline.js +206 -0
- package/dist/modules/n8n-packages/engine/import-pipeline.js.map +1 -0
- package/dist/modules/n8n-packages/entities/credential/credential-requirements.extractor.d.ts +6 -0
- package/dist/modules/n8n-packages/entities/credential/credential-requirements.extractor.js +33 -0
- package/dist/modules/n8n-packages/entities/credential/credential-requirements.extractor.js.map +1 -0
- package/dist/modules/n8n-packages/entities/credential/credential.exporter.d.ts +23 -0
- package/dist/modules/n8n-packages/entities/credential/credential.exporter.js +68 -0
- package/dist/modules/n8n-packages/entities/credential/credential.exporter.js.map +1 -0
- package/dist/modules/n8n-packages/entities/credential/credential.serializer.d.ts +5 -0
- package/dist/modules/n8n-packages/entities/credential/credential.serializer.js +25 -0
- package/dist/modules/n8n-packages/entities/credential/credential.serializer.js.map +1 -0
- package/dist/modules/n8n-packages/entities/credential/credential.types.d.ts +6 -0
- package/dist/modules/n8n-packages/entities/credential/credential.types.js +3 -0
- package/dist/modules/n8n-packages/entities/credential/credential.types.js.map +1 -0
- package/dist/modules/n8n-packages/entities/requirements-extractor.d.ts +4 -0
- package/dist/modules/n8n-packages/entities/requirements-extractor.js +3 -0
- package/dist/modules/n8n-packages/entities/requirements-extractor.js.map +1 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.d.ts +12 -3
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js +11 -20
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.d.ts +3 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js +10 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js.map +1 -1
- package/dist/modules/n8n-packages/io/package-reader.d.ts +6 -0
- package/dist/modules/n8n-packages/io/package-reader.js +3 -0
- package/dist/modules/n8n-packages/io/package-reader.js.map +1 -0
- package/dist/modules/n8n-packages/io/slug.utils.d.ts +1 -1
- package/dist/modules/n8n-packages/io/slug.utils.js +3 -3
- package/dist/modules/n8n-packages/io/slug.utils.js.map +1 -1
- package/dist/modules/n8n-packages/io/tar/tar-package-reader.d.ts +13 -0
- package/dist/modules/n8n-packages/io/tar/tar-package-reader.js +84 -0
- package/dist/modules/n8n-packages/io/tar/tar-package-reader.js.map +1 -0
- package/dist/modules/n8n-packages/io/unique-filename-allocator.d.ts +7 -0
- package/dist/modules/n8n-packages/io/unique-filename-allocator.js +27 -0
- package/dist/modules/n8n-packages/io/unique-filename-allocator.js.map +1 -0
- package/dist/modules/n8n-packages/n8n-packages.service.d.ts +7 -2
- package/dist/modules/n8n-packages/n8n-packages.service.js +21 -3
- package/dist/modules/n8n-packages/n8n-packages.service.js.map +1 -1
- package/dist/modules/n8n-packages/n8n-packages.types.d.ts +22 -0
- package/dist/modules/n8n-packages/spec/manifest.schema.d.ts +121 -4
- package/dist/modules/n8n-packages/spec/manifest.schema.js +22 -3
- package/dist/modules/n8n-packages/spec/manifest.schema.js.map +1 -1
- package/dist/modules/n8n-packages/spec/requirements.schema.d.ts +51 -0
- package/dist/modules/n8n-packages/spec/requirements.schema.js +14 -0
- package/dist/modules/n8n-packages/spec/requirements.schema.js.map +1 -0
- package/dist/modules/n8n-packages/spec/serialized/credential.schema.d.ts +15 -0
- package/dist/modules/n8n-packages/spec/serialized/credential.schema.js +12 -0
- package/dist/modules/n8n-packages/spec/serialized/credential.schema.js.map +1 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.d.ts +4 -4
- package/dist/modules/n8n-packages/utils/import-package-upload.d.ts +13 -0
- package/dist/modules/n8n-packages/utils/import-package-upload.js +59 -0
- package/dist/modules/n8n-packages/utils/import-package-upload.js.map +1 -0
- package/dist/modules/otel/execution-level-tracer.js +15 -6
- package/dist/modules/otel/execution-level-tracer.js.map +1 -1
- package/dist/modules/otel/execution-level-tracer.types.d.ts +3 -0
- package/dist/modules/otel/execution-level-tracer.types.js.map +1 -1
- package/dist/modules/otel/otel-lifecycle-handler.d.ts +4 -2
- package/dist/modules/otel/otel-lifecycle-handler.js +69 -4
- package/dist/modules/otel/otel-lifecycle-handler.js.map +1 -1
- package/dist/modules/otel/otel.config.d.ts +1 -0
- package/dist/modules/otel/otel.config.js +5 -0
- package/dist/modules/otel/otel.config.js.map +1 -1
- package/dist/modules/otel/otel.constants.d.ts +2 -0
- package/dist/modules/otel/otel.constants.js +2 -0
- package/dist/modules/otel/otel.constants.js.map +1 -1
- package/dist/modules/redaction/instance-redaction-enforcement.service.d.ts +4 -0
- package/dist/modules/redaction/instance-redaction-enforcement.service.js +8 -0
- package/dist/modules/redaction/instance-redaction-enforcement.service.js.map +1 -1
- package/dist/modules/redaction/redaction-context-hook.d.ts +9 -0
- package/dist/modules/redaction/redaction-context-hook.js +57 -0
- package/dist/modules/redaction/redaction-context-hook.js.map +1 -0
- package/dist/modules/redaction/redaction.module.js +1 -0
- package/dist/modules/redaction/redaction.module.js.map +1 -1
- package/dist/modules/source-control.ee/constants.d.ts +1 -0
- package/dist/modules/source-control.ee/constants.js +2 -1
- package/dist/modules/source-control.ee/constants.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-status.service.ee.js +5 -0
- package/dist/modules/source-control.ee/source-control-status.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.controller.ee.d.ts +4 -2
- package/dist/modules/source-control.ee/source-control.controller.ee.js +32 -5
- package/dist/modules/source-control.ee/source-control.controller.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.service.ee.js +2 -0
- package/dist/modules/source-control.ee/source-control.service.ee.js.map +1 -1
- package/dist/modules/workflow-builder/workflow-builder-session.repository.js +2 -1
- package/dist/modules/workflow-builder/workflow-builder-session.repository.js.map +1 -1
- package/dist/node-catalog/node-catalog.service.d.ts +2 -0
- package/dist/node-catalog/node-catalog.service.js +38 -2
- package/dist/node-catalog/node-catalog.service.js.map +1 -1
- package/dist/oauth/oauth-browser-binding.service.d.ts +18 -0
- package/dist/oauth/oauth-browser-binding.service.js +68 -0
- package/dist/oauth/oauth-browser-binding.service.js.map +1 -0
- package/dist/oauth/oauth.service.d.ts +10 -4
- package/dist/oauth/oauth.service.js +87 -4
- package/dist/oauth/oauth.service.js.map +1 -1
- package/dist/oauth/types.d.ts +1 -0
- package/dist/oauth/types.js.map +1 -1
- package/dist/public-api/index.js +5 -1
- package/dist/public-api/index.js.map +1 -1
- package/dist/public-api/types.d.ts +6 -0
- package/dist/public-api/v1/handlers/credentials/credentials.service.js +1 -0
- package/dist/public-api/v1/handlers/credentials/credentials.service.js.map +1 -1
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.d.ts +5 -0
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js +22 -0
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js.map +1 -1
- package/dist/public-api/v1/openapi.yml +207 -59
- package/dist/requests.d.ts +4 -0
- package/dist/scaling/constants.d.ts +2 -2
- package/dist/scaling/pubsub/pubsub.event-map.d.ts +5 -2
- package/dist/scaling/pubsub/pubsub.types.d.ts +2 -1
- package/dist/services/ai-workflow-builder.service.d.ts +6 -3
- package/dist/services/ai-workflow-builder.service.js +13 -5
- package/dist/services/ai-workflow-builder.service.js.map +1 -1
- package/dist/services/api-key-auth.strategy.d.ts +4 -1
- package/dist/services/api-key-auth.strategy.js +18 -2
- package/dist/services/api-key-auth.strategy.js.map +1 -1
- package/dist/services/ownership.service.d.ts +1 -0
- package/dist/services/ownership.service.js +7 -0
- package/dist/services/ownership.service.js.map +1 -1
- package/dist/services/project.service.ee.d.ts +6 -2
- package/dist/services/project.service.ee.js +30 -8
- package/dist/services/project.service.ee.js.map +1 -1
- package/dist/services/public-api-key.service.d.ts +21 -14
- package/dist/services/public-api-key.service.js +14 -9
- package/dist/services/public-api-key.service.js.map +1 -1
- package/dist/telemetry/index.d.ts +6 -9
- package/dist/telemetry/index.js +23 -9
- package/dist/telemetry/index.js.map +1 -1
- package/dist/webhooks/constants.js +5 -1
- package/dist/webhooks/constants.js.map +1 -1
- package/dist/webhooks/live-webhooks.d.ts +8 -1
- package/dist/webhooks/live-webhooks.js +37 -22
- package/dist/webhooks/live-webhooks.js.map +1 -1
- package/dist/webhooks/waiting-forms.js +8 -1
- package/dist/webhooks/waiting-forms.js.map +1 -1
- package/dist/webhooks/webhook-helpers.d.ts +1 -1
- package/dist/webhooks/webhook-helpers.js +20 -10
- package/dist/webhooks/webhook-helpers.js.map +1 -1
- package/dist/webhooks/webhook-request-handler.js +1 -1
- package/dist/webhooks/webhook-request-handler.js.map +1 -1
- package/dist/workflow-helpers.d.ts +6 -1
- package/dist/workflow-helpers.js +9 -1
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflows/workflow-creation.service.d.ts +4 -1
- package/dist/workflows/workflow-creation.service.js +12 -3
- package/dist/workflows/workflow-creation.service.js.map +1 -1
- package/dist/workflows/workflow-finder.service.d.ts +1 -0
- package/dist/workflows/workflow-published-data.service.d.ts +11 -0
- package/dist/workflows/workflow-published-data.service.js +39 -0
- package/dist/workflows/workflow-published-data.service.js.map +1 -0
- package/dist/workflows/workflow-validation.service.d.ts +5 -1
- package/dist/workflows/workflow-validation.service.js +55 -2
- package/dist/workflows/workflow-validation.service.js.map +1 -1
- package/dist/workflows/workflow.service.js +4 -0
- package/dist/workflows/workflow.service.js.map +1 -1
- package/dist/workflows/workflows.controller.d.ts +8 -0
- package/package.json +40 -32
- package/templates/form-trigger-completion.handlebars +12 -1
- package/dist/modules/agents/integrations/agent-schedule.service.d.ts +0 -30
- package/dist/modules/agents/integrations/agent-schedule.service.js +0 -331
- package/dist/modules/agents/integrations/agent-schedule.service.js.map +0 -1
- package/dist/modules/instance-ai/web-research/brave-search.d.ts +0 -10
- package/dist/modules/instance-ai/web-research/brave-search.js +0 -44
- package/dist/modules/instance-ai/web-research/brave-search.js.map +0 -1
- package/dist/modules/instance-ai/web-research/searxng-search.d.ts +0 -6
- package/dist/modules/instance-ai/web-research/searxng-search.js +0 -39
- package/dist/modules/instance-ai/web-research/searxng-search.js.map +0 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.synthesizeMcpRegistryTypeDef = synthesizeMcpRegistryTypeDef;
|
|
4
|
+
const workflow_sdk_1 = require("@n8n/workflow-sdk");
|
|
5
|
+
function synthesizeMcpRegistryTypeDef(description) {
|
|
6
|
+
const visibleDescription = {
|
|
7
|
+
...description,
|
|
8
|
+
properties: description.properties.filter((property) => property.type !== 'hidden'),
|
|
9
|
+
};
|
|
10
|
+
if (!isSdkNodeTypeDescription(visibleDescription)) {
|
|
11
|
+
throw new Error(`Cannot synthesize MCP registry type definition for ${description.name}`);
|
|
12
|
+
}
|
|
13
|
+
return (0, workflow_sdk_1.generateNodeTypeFile)(visibleDescription);
|
|
14
|
+
}
|
|
15
|
+
function isSdkNodeTypeDescription(description) {
|
|
16
|
+
return (Array.isArray(description.group) &&
|
|
17
|
+
Array.isArray(description.properties) &&
|
|
18
|
+
typeof description.inputs !== 'string' &&
|
|
19
|
+
typeof description.outputs !== 'string' &&
|
|
20
|
+
hasSdkConnections(description.inputs) &&
|
|
21
|
+
hasSdkConnections(description.outputs) &&
|
|
22
|
+
hasSdkCredentials(description.credentials));
|
|
23
|
+
}
|
|
24
|
+
function hasSdkConnections(connections) {
|
|
25
|
+
return (Array.isArray(connections) &&
|
|
26
|
+
connections.every((connection) => typeof connection === 'string' ||
|
|
27
|
+
(typeof connection.type === 'string' &&
|
|
28
|
+
(connection.displayName === undefined || typeof connection.displayName === 'string'))));
|
|
29
|
+
}
|
|
30
|
+
function hasSdkCredentials(credentials) {
|
|
31
|
+
return (credentials === undefined ||
|
|
32
|
+
credentials.every((credential) => typeof credential.name === 'string' &&
|
|
33
|
+
(credential.required === undefined || typeof credential.required === 'boolean')));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=synthesize-type-def.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"synthesize-type-def.js","sourceRoot":"","sources":["../../../src/modules/mcp-registry/synthesize-type-def.ts"],"names":[],"mappings":";;AAgBA,oEAWC;AA3BD,oDAAyD;AAgBzD,SAAgB,4BAA4B,CAAC,WAAiC;IAC7E,MAAM,kBAAkB,GAAG;QAC1B,GAAG,WAAW;QACd,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC;KACnF,CAAC;IAEF,IAAI,CAAC,wBAAwB,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,sDAAsD,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED,OAAO,IAAA,mCAAoB,EAAC,kBAAkB,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,wBAAwB,CAChC,WAAiC;IAEjC,OAAO,CACN,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC;QAChC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC;QACrC,OAAO,WAAW,CAAC,MAAM,KAAK,QAAQ;QACtC,OAAO,WAAW,CAAC,OAAO,KAAK,QAAQ;QACvC,iBAAiB,CAAC,WAAW,CAAC,MAAM,CAAC;QACrC,iBAAiB,CAAC,WAAW,CAAC,OAAO,CAAC;QACtC,iBAAiB,CAAC,WAAW,CAAC,WAAW,CAAC,CAC1C,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB,CACzB,WAA6E;IAG7E,OAAO,CACN,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;QAC1B,WAAW,CAAC,KAAK,CAChB,CAAC,UAAU,EAAE,EAAE,CACd,OAAO,UAAU,KAAK,QAAQ;YAC9B,CAAC,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ;gBACnC,CAAC,UAAU,CAAC,WAAW,KAAK,SAAS,IAAI,OAAO,UAAU,CAAC,WAAW,KAAK,QAAQ,CAAC,CAAC,CACvF,CACD,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB,CACzB,WAAgD;IAEhD,OAAO,CACN,WAAW,KAAK,SAAS;QACzB,WAAW,CAAC,KAAK,CAChB,CAAC,UAAU,EAAE,EAAE,CACd,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ;YACnC,CAAC,UAAU,CAAC,QAAQ,KAAK,SAAS,IAAI,OAAO,UAAU,CAAC,QAAQ,KAAK,SAAS,CAAC,CAChF,CACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GlobalConfig } from '@n8n/config';
|
|
2
|
+
import { ProjectRepository } from '@n8n/db';
|
|
3
|
+
import { EventService } from '../../../events/event.service';
|
|
4
|
+
import { FolderService } from '../../../services/folder.service';
|
|
5
|
+
import { ProjectService } from '../../../services/project.service.ee';
|
|
6
|
+
import { WorkflowCreationService } from '../../../workflows/workflow-creation.service';
|
|
7
|
+
import { WorkflowSerializer } from '../entities/workflow/workflow.serializer';
|
|
8
|
+
import type { ImportPackageRequest, ImportResult } from '../n8n-packages.types';
|
|
9
|
+
export declare class ImportPipeline {
|
|
10
|
+
private readonly workflowSerializer;
|
|
11
|
+
private readonly workflowCreationService;
|
|
12
|
+
private readonly projectRepository;
|
|
13
|
+
private readonly projectService;
|
|
14
|
+
private readonly folderService;
|
|
15
|
+
private readonly eventService;
|
|
16
|
+
private readonly maxUncompressedPackageBytes;
|
|
17
|
+
constructor(workflowSerializer: WorkflowSerializer, workflowCreationService: WorkflowCreationService, globalConfig: GlobalConfig, projectRepository: ProjectRepository, projectService: ProjectService, folderService: FolderService, eventService: EventService);
|
|
18
|
+
run(request: ImportPackageRequest): Promise<ImportResult>;
|
|
19
|
+
private loadPackageManifest;
|
|
20
|
+
private prepareWorkflows;
|
|
21
|
+
private resolveTarget;
|
|
22
|
+
private resolveImportProject;
|
|
23
|
+
private assertFolderExistsInProject;
|
|
24
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.ImportPipeline = void 0;
|
|
46
|
+
const config_1 = require("@n8n/config");
|
|
47
|
+
const db_1 = require("@n8n/db");
|
|
48
|
+
const di_1 = require("@n8n/di");
|
|
49
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
50
|
+
const zod_1 = require("zod");
|
|
51
|
+
const bad_request_error_1 = require("../../../errors/response-errors/bad-request.error");
|
|
52
|
+
const forbidden_error_1 = require("../../../errors/response-errors/forbidden.error");
|
|
53
|
+
const not_found_error_1 = require("../../../errors/response-errors/not-found.error");
|
|
54
|
+
const event_service_1 = require("../../../events/event.service");
|
|
55
|
+
const folder_service_1 = require("../../../services/folder.service");
|
|
56
|
+
const project_service_ee_1 = require("../../../services/project.service.ee");
|
|
57
|
+
const WorkflowHelpers = __importStar(require("../../../workflow-helpers"));
|
|
58
|
+
const workflow_creation_service_1 = require("../../../workflows/workflow-creation.service");
|
|
59
|
+
const workflow_serializer_1 = require("../entities/workflow/workflow.serializer");
|
|
60
|
+
const tar_package_reader_1 = require("../io/tar/tar-package-reader");
|
|
61
|
+
const manifest_schema_1 = require("../spec/manifest.schema");
|
|
62
|
+
const MEGABYTE_IN_BYTES = 1024 * 1024;
|
|
63
|
+
let ImportPipeline = class ImportPipeline {
|
|
64
|
+
constructor(workflowSerializer, workflowCreationService, globalConfig, projectRepository, projectService, folderService, eventService) {
|
|
65
|
+
this.workflowSerializer = workflowSerializer;
|
|
66
|
+
this.workflowCreationService = workflowCreationService;
|
|
67
|
+
this.projectRepository = projectRepository;
|
|
68
|
+
this.projectService = projectService;
|
|
69
|
+
this.folderService = folderService;
|
|
70
|
+
this.eventService = eventService;
|
|
71
|
+
this.maxUncompressedPackageBytes = globalConfig.endpoints.payloadSizeMax * MEGABYTE_IN_BYTES;
|
|
72
|
+
}
|
|
73
|
+
async run(request) {
|
|
74
|
+
const reader = new tar_package_reader_1.TarPackageReader(request.packageBuffer, this.maxUncompressedPackageBytes);
|
|
75
|
+
const manifest = await this.loadPackageManifest(reader);
|
|
76
|
+
const { target } = await this.resolveTarget(request.user, request.projectId, request.folderId);
|
|
77
|
+
const prepared = await this.prepareWorkflows(manifest.workflows ?? [], reader);
|
|
78
|
+
const created = [];
|
|
79
|
+
for (const { entity, sourceId } of prepared) {
|
|
80
|
+
const saved = await this.workflowCreationService.createWorkflow(request.user, entity, {
|
|
81
|
+
projectId: target.projectId,
|
|
82
|
+
parentFolderId: target.folderId ?? undefined,
|
|
83
|
+
publicApi: true,
|
|
84
|
+
source: 'import',
|
|
85
|
+
sourceWorkflowId: sourceId,
|
|
86
|
+
});
|
|
87
|
+
created.push(saved);
|
|
88
|
+
}
|
|
89
|
+
this.eventService.emit('workflows-imported', {
|
|
90
|
+
user: request.user,
|
|
91
|
+
projectId: target.projectId,
|
|
92
|
+
workflowIds: created.map((w) => w.id),
|
|
93
|
+
packageSourceId: manifest.sourceId,
|
|
94
|
+
packageVersion: manifest.packageFormatVersion,
|
|
95
|
+
});
|
|
96
|
+
return {
|
|
97
|
+
package: {
|
|
98
|
+
sourceN8nVersion: manifest.sourceN8nVersion,
|
|
99
|
+
sourceId: manifest.sourceId,
|
|
100
|
+
exportedAt: manifest.exportedAt,
|
|
101
|
+
},
|
|
102
|
+
workflows: created.map((w) => ({
|
|
103
|
+
sourceId: w.sourceWorkflowId ?? '',
|
|
104
|
+
localId: w.id,
|
|
105
|
+
name: w.name,
|
|
106
|
+
projectId: target.projectId,
|
|
107
|
+
parentFolderId: w.parentFolder?.id ?? null,
|
|
108
|
+
activeVersionId: w.activeVersionId ?? null,
|
|
109
|
+
})),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
async loadPackageManifest(reader) {
|
|
113
|
+
try {
|
|
114
|
+
const rawManifest = await reader.readManifest();
|
|
115
|
+
return manifest_schema_1.packageManifestSchema.parse(rawManifest);
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
if (error instanceof bad_request_error_1.BadRequestError)
|
|
119
|
+
throw error;
|
|
120
|
+
if (error instanceof zod_1.ZodError) {
|
|
121
|
+
throw new bad_request_error_1.BadRequestError('Package manifest failed validation');
|
|
122
|
+
}
|
|
123
|
+
throw new bad_request_error_1.BadRequestError('Failed to read package manifest');
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
async prepareWorkflows(entries, reader) {
|
|
127
|
+
const prepared = [];
|
|
128
|
+
for (const entry of entries) {
|
|
129
|
+
const path = `${entry.target}/workflow.json`;
|
|
130
|
+
let content;
|
|
131
|
+
try {
|
|
132
|
+
content = await reader.readFile(path);
|
|
133
|
+
}
|
|
134
|
+
catch (cause) {
|
|
135
|
+
throw new n8n_workflow_1.UserError(`Package manifest references a missing workflow file at ${path}.`, {
|
|
136
|
+
cause,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
const wire = (0, n8n_workflow_1.jsonParse)(content.toString('utf-8'), {
|
|
140
|
+
errorMessage: `Package workflow file at ${path} is not valid JSON.`,
|
|
141
|
+
});
|
|
142
|
+
let entity;
|
|
143
|
+
try {
|
|
144
|
+
const partial = this.workflowSerializer.deserialize(wire);
|
|
145
|
+
entity = Object.assign(new db_1.WorkflowEntity(), partial);
|
|
146
|
+
}
|
|
147
|
+
catch (cause) {
|
|
148
|
+
if (cause instanceof zod_1.ZodError) {
|
|
149
|
+
throw new n8n_workflow_1.UserError(`Package workflow file at ${path} failed schema validation.`, {
|
|
150
|
+
cause,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
throw cause;
|
|
154
|
+
}
|
|
155
|
+
WorkflowHelpers.validateWorkflowStructure(entity);
|
|
156
|
+
prepared.push({ entity, sourceId: entry.id });
|
|
157
|
+
}
|
|
158
|
+
return prepared;
|
|
159
|
+
}
|
|
160
|
+
async resolveTarget(user, projectId, folderId) {
|
|
161
|
+
const project = await this.resolveImportProject(user, projectId);
|
|
162
|
+
await this.assertFolderExistsInProject(folderId, project.id);
|
|
163
|
+
return {
|
|
164
|
+
project,
|
|
165
|
+
target: { projectId: project.id, folderId: folderId ?? null },
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
async resolveImportProject(user, projectId) {
|
|
169
|
+
if (projectId === undefined) {
|
|
170
|
+
return await this.projectRepository.getPersonalProjectForUserOrFail(user.id);
|
|
171
|
+
}
|
|
172
|
+
const project = await this.projectService.getProjectWithScope(user, projectId, [
|
|
173
|
+
'workflow:import',
|
|
174
|
+
]);
|
|
175
|
+
if (project) {
|
|
176
|
+
return project;
|
|
177
|
+
}
|
|
178
|
+
if (!(await this.projectRepository.existsBy({ id: projectId }))) {
|
|
179
|
+
throw new not_found_error_1.NotFoundError(`Project not found: ${projectId}`);
|
|
180
|
+
}
|
|
181
|
+
throw new forbidden_error_1.ForbiddenError('You do not have permission to import workflows into this project.');
|
|
182
|
+
}
|
|
183
|
+
async assertFolderExistsInProject(folderId, projectId) {
|
|
184
|
+
if (folderId === undefined) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
try {
|
|
188
|
+
await this.folderService.findFolderInProjectOrFail(folderId, projectId);
|
|
189
|
+
}
|
|
190
|
+
catch (cause) {
|
|
191
|
+
throw new n8n_workflow_1.UserError(`Folder not found in target project: ${folderId}`, { cause });
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
exports.ImportPipeline = ImportPipeline;
|
|
196
|
+
exports.ImportPipeline = ImportPipeline = __decorate([
|
|
197
|
+
(0, di_1.Service)(),
|
|
198
|
+
__metadata("design:paramtypes", [workflow_serializer_1.WorkflowSerializer,
|
|
199
|
+
workflow_creation_service_1.WorkflowCreationService,
|
|
200
|
+
config_1.GlobalConfig,
|
|
201
|
+
db_1.ProjectRepository,
|
|
202
|
+
project_service_ee_1.ProjectService,
|
|
203
|
+
folder_service_1.FolderService,
|
|
204
|
+
event_service_1.EventService])
|
|
205
|
+
], ImportPipeline);
|
|
206
|
+
//# sourceMappingURL=import-pipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-pipeline.js","sourceRoot":"","sources":["../../../../src/modules/n8n-packages/engine/import-pipeline.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAA2C;AAE3C,gCAA4D;AAC5D,gCAAkC;AAClC,+CAAoD;AACpD,6BAA+B;AAE/B,kFAA6E;AAC7E,8EAA0E;AAC1E,8EAAyE;AACzE,0DAAsD;AACtD,8DAA0D;AAC1D,sEAA+D;AAC/D,oEAAsD;AACtD,qFAAgF;AAEhF,kFAA8E;AAC9E,qEAAgE;AAEhE,6DAAgE;AAGhE,MAAM,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAAC;AAa/B,IAAM,cAAc,GAApB,MAAM,cAAc;IAG1B,YACkB,kBAAsC,EACtC,uBAAgD,EACjE,YAA0B,EACT,iBAAoC,EACpC,cAA8B,EAC9B,aAA4B,EAC5B,YAA0B;QAN1B,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,4BAAuB,GAAvB,uBAAuB,CAAyB;QAEhD,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,mBAAc,GAAd,cAAc,CAAgB;QAC9B,kBAAa,G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E,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,IAAI,wBAAS,CAAC,uCAAuC,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QACnF,CAAC;IACF,CAAC;CACD,CAAA;AApKY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,YAAO,GAAE;qCAK6B,wCAAkB;QACb,mDAAuB;QACnD,qBAAY;QACU,sBAAiB;QACpB,mCAAc;QACf,8BAAa;QACd,4BAAY;GAVhC,cAAc,CAoK1B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { WorkflowEntity } from '@n8n/db';
|
|
2
|
+
import type { WorkflowCredentialRequirement } from './credential.types';
|
|
3
|
+
import type { RequirementsExtractor } from '../requirements-extractor';
|
|
4
|
+
export declare class CredentialRequirementsExtractor implements RequirementsExtractor<WorkflowCredentialRequirement> {
|
|
5
|
+
extract(workflow: WorkflowEntity): WorkflowCredentialRequirement[];
|
|
6
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.CredentialRequirementsExtractor = void 0;
|
|
10
|
+
const di_1 = require("@n8n/di");
|
|
11
|
+
let CredentialRequirementsExtractor = class CredentialRequirementsExtractor {
|
|
12
|
+
extract(workflow) {
|
|
13
|
+
const byId = new Map();
|
|
14
|
+
for (const node of workflow.nodes ?? []) {
|
|
15
|
+
for (const [credentialType, details] of Object.entries(node.credentials ?? {})) {
|
|
16
|
+
if (!details?.id || byId.has(details.id))
|
|
17
|
+
continue;
|
|
18
|
+
byId.set(details.id, {
|
|
19
|
+
workflowId: workflow.id,
|
|
20
|
+
credentialId: details.id,
|
|
21
|
+
credentialName: details.name,
|
|
22
|
+
credentialType,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return [...byId.values()];
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.CredentialRequirementsExtractor = CredentialRequirementsExtractor;
|
|
30
|
+
exports.CredentialRequirementsExtractor = CredentialRequirementsExtractor = __decorate([
|
|
31
|
+
(0, di_1.Service)()
|
|
32
|
+
], CredentialRequirementsExtractor);
|
|
33
|
+
//# sourceMappingURL=credential-requirements.extractor.js.map
|
package/dist/modules/n8n-packages/entities/credential/credential-requirements.extractor.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-requirements.extractor.js","sourceRoot":"","sources":["../../../../../src/modules/n8n-packages/entities/credential/credential-requirements.extractor.ts"],"names":[],"mappings":";;;;;;;;;AACA,gCAAkC;AAM3B,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAG3C,OAAO,CAAC,QAAwB;QAC/B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAyC,CAAC;QAE9D,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;YACzC,KAAK,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC,EAAE,CAAC;gBAChF,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;oBAAE,SAAS;gBAEnD,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE;oBACpB,UAAU,EAAE,QAAQ,CAAC,EAAE;oBACvB,YAAY,EAAE,OAAO,CAAC,EAAE;oBACxB,cAAc,EAAE,OAAO,CAAC,IAAI;oBAC5B,cAAc;iBACd,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3B,CAAC;CACD,CAAA;AArBY,0EAA+B;0CAA/B,+BAA+B;IAD3C,IAAA,YAAO,GAAE;GACG,+BAA+B,CAqB3C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { User } from '@n8n/db';
|
|
2
|
+
import { CredentialsFinderService } from '../../../../credentials/credentials-finder.service';
|
|
3
|
+
import { CredentialSerializer } from './credential.serializer';
|
|
4
|
+
import type { WorkflowCredentialRequirement } from './credential.types';
|
|
5
|
+
import type { PackageWriter } from '../../io/package-writer';
|
|
6
|
+
import type { ManifestEntry } from '../../spec/manifest.schema';
|
|
7
|
+
import type { PackageCredentialRequirement } from '../../spec/requirements.schema';
|
|
8
|
+
export interface CredentialExportRequest {
|
|
9
|
+
user: User;
|
|
10
|
+
requirements: WorkflowCredentialRequirement[];
|
|
11
|
+
writer: PackageWriter;
|
|
12
|
+
}
|
|
13
|
+
export interface CredentialExportResult {
|
|
14
|
+
entries: ManifestEntry[];
|
|
15
|
+
requirements: PackageCredentialRequirement[];
|
|
16
|
+
}
|
|
17
|
+
export declare class CredentialExporter {
|
|
18
|
+
private readonly credentialsFinder;
|
|
19
|
+
private readonly credentialSerializer;
|
|
20
|
+
constructor(credentialsFinder: CredentialsFinderService, credentialSerializer: CredentialSerializer);
|
|
21
|
+
export(request: CredentialExportRequest): Promise<CredentialExportResult>;
|
|
22
|
+
private groupByCredentialId;
|
|
23
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CredentialExporter = void 0;
|
|
13
|
+
const di_1 = require("@n8n/di");
|
|
14
|
+
const credentials_finder_service_1 = require("../../../../credentials/credentials-finder.service");
|
|
15
|
+
const credential_serializer_1 = require("./credential.serializer");
|
|
16
|
+
const unique_filename_allocator_1 = require("../../io/unique-filename-allocator");
|
|
17
|
+
let CredentialExporter = class CredentialExporter {
|
|
18
|
+
constructor(credentialsFinder, credentialSerializer) {
|
|
19
|
+
this.credentialsFinder = credentialsFinder;
|
|
20
|
+
this.credentialSerializer = credentialSerializer;
|
|
21
|
+
}
|
|
22
|
+
async export(request) {
|
|
23
|
+
const allocator = new unique_filename_allocator_1.UniqueFilenameAllocator('credentials', 'credential');
|
|
24
|
+
const entries = [];
|
|
25
|
+
const requirements = [];
|
|
26
|
+
for (const [credentialId, { fallback, usedByWorkflows }] of this.groupByCredentialId(request.requirements)) {
|
|
27
|
+
const credential = await this.credentialsFinder.findCredentialForUser(credentialId, request.user, ['credential:read']);
|
|
28
|
+
const { id, name, type } = credential ?? {
|
|
29
|
+
id: credentialId,
|
|
30
|
+
name: fallback.credentialName,
|
|
31
|
+
type: fallback.credentialType,
|
|
32
|
+
};
|
|
33
|
+
if (credential) {
|
|
34
|
+
const target = allocator.allocate(name);
|
|
35
|
+
request.writer.writeDirectory(target);
|
|
36
|
+
request.writer.writeFile(`${target}/credential.json`, JSON.stringify(this.credentialSerializer.serialize(credential), null, '\t'));
|
|
37
|
+
entries.push({ id, name, target });
|
|
38
|
+
}
|
|
39
|
+
requirements.push({ id, name, type, usedByWorkflows });
|
|
40
|
+
}
|
|
41
|
+
return { entries, requirements };
|
|
42
|
+
}
|
|
43
|
+
groupByCredentialId(requirements) {
|
|
44
|
+
const grouped = new Map();
|
|
45
|
+
for (const requirement of requirements) {
|
|
46
|
+
const existing = grouped.get(requirement.credentialId);
|
|
47
|
+
if (existing) {
|
|
48
|
+
if (!existing.usedByWorkflows.includes(requirement.workflowId)) {
|
|
49
|
+
existing.usedByWorkflows.push(requirement.workflowId);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
grouped.set(requirement.credentialId, {
|
|
54
|
+
fallback: requirement,
|
|
55
|
+
usedByWorkflows: [requirement.workflowId],
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return grouped;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
exports.CredentialExporter = CredentialExporter;
|
|
63
|
+
exports.CredentialExporter = CredentialExporter = __decorate([
|
|
64
|
+
(0, di_1.Service)(),
|
|
65
|
+
__metadata("design:paramtypes", [credentials_finder_service_1.CredentialsFinderService,
|
|
66
|
+
credential_serializer_1.CredentialSerializer])
|
|
67
|
+
], CredentialExporter);
|
|
68
|
+
//# sourceMappingURL=credential.exporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential.exporter.js","sourceRoot":"","sources":["../../../../../src/modules/n8n-packages/entities/credential/credential.exporter.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,gCAAkC;AAElC,yFAAoF;AAEpF,mEAA+D;AAG/D,kFAA6E;AAsBtE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC9B,YACkB,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,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;QACxD,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;IAClC,CAAC;IAEO,mBAAmB,CAC1B,YAA6C;QAE7C,MAAM,OAAO,GAAG,IAAI,GAAG,EAA2B,CAAC;QACnD,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;YACxC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;YACvD,IAAI,QAAQ,EAAE,CAAC;gBACd,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,CAAC;oBAChE,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;gBACvD,CAAC;YACF,CAAC;iBAAM,CAAC;gBACP,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,YAAY,EAAE;oBACrC,QAAQ,EAAE,WAAW;oBACrB,eAAe,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC;iBACzC,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QACD,OAAO,OAAO,CAAC;IAChB,CAAC;CACD,CAAA;AA9DY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,YAAO,GAAE;qCAG4B,qDAAwB;QACrB,4CAAoB;GAHhD,kBAAkB,CA8D9B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.CredentialSerializer = void 0;
|
|
10
|
+
const di_1 = require("@n8n/di");
|
|
11
|
+
const credential_schema_1 = require("../../spec/serialized/credential.schema");
|
|
12
|
+
let CredentialSerializer = class CredentialSerializer {
|
|
13
|
+
serialize(credential) {
|
|
14
|
+
return credential_schema_1.serializedCredentialSchema.parse({
|
|
15
|
+
id: credential.id,
|
|
16
|
+
name: credential.name,
|
|
17
|
+
type: credential.type,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.CredentialSerializer = CredentialSerializer;
|
|
22
|
+
exports.CredentialSerializer = CredentialSerializer = __decorate([
|
|
23
|
+
(0, di_1.Service)()
|
|
24
|
+
], CredentialSerializer);
|
|
25
|
+
//# sourceMappingURL=credential.serializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential.serializer.js","sourceRoot":"","sources":["../../../../../src/modules/n8n-packages/entities/credential/credential.serializer.ts"],"names":[],"mappings":";;;;;;;;;AACA,gCAAkC;AAElC,+EAGiD;AAG1C,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAChC,SAAS,CAAC,UAA6B;QACtC,OAAO,8CAA0B,CAAC,KAAK,CAAC;YACvC,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,IAAI,EAAE,UAAU,CAAC,IAAI;SACrB,CAAC,CAAC;IACJ,CAAC;CACD,CAAA;AARY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,YAAO,GAAE;GACG,oBAAoB,CAQhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential.types.js","sourceRoot":"","sources":["../../../../../src/modules/n8n-packages/entities/credential/credential.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requirements-extractor.js","sourceRoot":"","sources":["../../../../src/modules/n8n-packages/entities/requirements-extractor.ts"],"names":[],"mappings":""}
|
|
@@ -3,16 +3,25 @@ import { WorkflowFinderService } from '../../../../workflows/workflow-finder.ser
|
|
|
3
3
|
import { WorkflowSerializer } from './workflow.serializer';
|
|
4
4
|
import type { PackageWriter } from '../../io/package-writer';
|
|
5
5
|
import type { ManifestEntry } from '../../spec/manifest.schema';
|
|
6
|
+
import { CredentialRequirementsExtractor } from '../credential/credential-requirements.extractor';
|
|
7
|
+
import type { WorkflowCredentialRequirement } from '../credential/credential.types';
|
|
6
8
|
export interface WorkflowExportRequest {
|
|
7
9
|
user: User;
|
|
8
10
|
workflowIds: string[];
|
|
9
11
|
writer: PackageWriter;
|
|
10
12
|
}
|
|
13
|
+
export interface WorkflowExportRequirements {
|
|
14
|
+
credentials: WorkflowCredentialRequirement[];
|
|
15
|
+
}
|
|
16
|
+
export interface WorkflowExportResult {
|
|
17
|
+
entries: ManifestEntry[];
|
|
18
|
+
requirements: WorkflowExportRequirements;
|
|
19
|
+
}
|
|
11
20
|
export declare class WorkflowExporter {
|
|
12
21
|
private readonly workflowFinder;
|
|
13
22
|
private readonly workflowSerializer;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
23
|
+
private readonly credentialRequirementsExtractor;
|
|
24
|
+
constructor(workflowFinder: WorkflowFinderService, workflowSerializer: WorkflowSerializer, credentialRequirementsExtractor: CredentialRequirementsExtractor);
|
|
25
|
+
export(request: WorkflowExportRequest): Promise<WorkflowExportResult>;
|
|
17
26
|
private assertAllRequestedWorkflowsFound;
|
|
18
27
|
}
|
|
@@ -14,19 +14,22 @@ const di_1 = require("@n8n/di");
|
|
|
14
14
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
15
15
|
const workflow_finder_service_1 = require("../../../../workflows/workflow-finder.service");
|
|
16
16
|
const workflow_serializer_1 = require("./workflow.serializer");
|
|
17
|
-
const
|
|
17
|
+
const unique_filename_allocator_1 = require("../../io/unique-filename-allocator");
|
|
18
|
+
const credential_requirements_extractor_1 = require("../credential/credential-requirements.extractor");
|
|
18
19
|
let WorkflowExporter = class WorkflowExporter {
|
|
19
|
-
constructor(workflowFinder, workflowSerializer) {
|
|
20
|
+
constructor(workflowFinder, workflowSerializer, credentialRequirementsExtractor) {
|
|
20
21
|
this.workflowFinder = workflowFinder;
|
|
21
22
|
this.workflowSerializer = workflowSerializer;
|
|
23
|
+
this.credentialRequirementsExtractor = credentialRequirementsExtractor;
|
|
22
24
|
}
|
|
23
25
|
async export(request) {
|
|
24
26
|
const workflows = await this.workflowFinder.findWorkflowsByIdsForUser(request.workflowIds, request.user, ['workflow:export'], { includeParentFolder: true });
|
|
25
27
|
this.assertAllRequestedWorkflowsFound(request.workflowIds, workflows);
|
|
26
28
|
const entries = [];
|
|
27
|
-
const
|
|
29
|
+
const credentials = [];
|
|
30
|
+
const fileNames = new unique_filename_allocator_1.UniqueFilenameAllocator('workflows');
|
|
28
31
|
for (const workflow of workflows) {
|
|
29
|
-
const target =
|
|
32
|
+
const target = fileNames.allocate(workflow.name);
|
|
30
33
|
const serialized = this.workflowSerializer.serialize(workflow);
|
|
31
34
|
request.writer.writeDirectory(target);
|
|
32
35
|
request.writer.writeFile(`${target}/workflow.json`, JSON.stringify(serialized, null, '\t'));
|
|
@@ -35,22 +38,9 @@ let WorkflowExporter = class WorkflowExporter {
|
|
|
35
38
|
name: workflow.name,
|
|
36
39
|
target,
|
|
37
40
|
});
|
|
41
|
+
credentials.push(...this.credentialRequirementsExtractor.extract(workflow));
|
|
38
42
|
}
|
|
39
|
-
return entries;
|
|
40
|
-
}
|
|
41
|
-
allocateUniqueFileName(name, used) {
|
|
42
|
-
const base = `workflows/${(0, slug_utils_1.generateSlug)(name)}`;
|
|
43
|
-
if (!used.has(base)) {
|
|
44
|
-
used.add(base);
|
|
45
|
-
return base;
|
|
46
|
-
}
|
|
47
|
-
for (let suffix = 2;; suffix++) {
|
|
48
|
-
const candidate = `${base}-${suffix}`;
|
|
49
|
-
if (!used.has(candidate)) {
|
|
50
|
-
used.add(candidate);
|
|
51
|
-
return candidate;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
43
|
+
return { entries, requirements: { credentials } };
|
|
54
44
|
}
|
|
55
45
|
assertAllRequestedWorkflowsFound(requestedWorkflowIds, foundWorkflows) {
|
|
56
46
|
const foundWorkflowIds = new Set(foundWorkflows.map(({ id }) => id));
|
|
@@ -68,6 +58,7 @@ exports.WorkflowExporter = WorkflowExporter;
|
|
|
68
58
|
exports.WorkflowExporter = WorkflowExporter = __decorate([
|
|
69
59
|
(0, di_1.Service)(),
|
|
70
60
|
__metadata("design:paramtypes", [workflow_finder_service_1.WorkflowFinderService,
|
|
71
|
-
workflow_serializer_1.WorkflowSerializer
|
|
61
|
+
workflow_serializer_1.WorkflowSerializer,
|
|
62
|
+
credential_requirements_extractor_1.CredentialRequirementsExtractor])
|
|
72
63
|
], WorkflowExporter);
|
|
73
64
|
//# sourceMappingURL=workflow.exporter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.exporter.js","sourceRoot":"","sources":["../../../../../src/modules/n8n-packages/entities/workflow/workflow.exporter.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,gCAAkC;AAClC,+CAAyC;AAEzC,iFAA4E;AAE5E,+DAA2D;AAE3D,
|
|
1
|
+
{"version":3,"file":"workflow.exporter.js","sourceRoot":"","sources":["../../../../../src/modules/n8n-packages/entities/workflow/workflow.exporter.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,gCAAkC;AAClC,+CAAyC;AAEzC,iFAA4E;AAE5E,+DAA2D;AAE3D,kFAA6E;AAE7E,uGAAkG;AAmB3F,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC5B,YACkB,cAAqC,EACrC,kBAAsC,EACtC,+BAAgE;QAF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AO,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,WAAW,EAAE,EAAE,CAAC;IACnD,CAAC;IAEO,gCAAgC,CACvC,oBAA8B,EAC9B,cAAqC;QAErC,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACrE,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAE1F,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC7D,MAAM,YAAY,GAAG,kBAAkB,CAAC,MAAM,GAAG,oBAAoB,CAAC,MAAM,CAAC;YAE7E,MAAM,IAAI,wBAAS,CAClB,GAAG,kBAAkB,CAAC,MAAM,2DAA2D,EACvF;gBACC,WAAW,EAAE,yBAAyB,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,GACpE,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,YAAY,OAAO,CAAC,CAAC,CAAC,EACnD,EAAE;aACF,CACD,CAAC;QACH,CAAC;IACF,CAAC;CACD,CAAA;AA7DY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,YAAO,GAAE;qCAGyB,+CAAqB;QACjB,wCAAkB;QACL,mEAA+B;GAJtE,gBAAgB,CA6D5B"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { WorkflowEntity } from '@n8n/db';
|
|
2
2
|
import { type SerializedWorkflow } from '../../spec/serialized/workflow.schema';
|
|
3
|
+
type WorkflowPackageContent = Pick<WorkflowEntity, 'name' | 'nodes' | 'connections' | 'isArchived' | 'settings'>;
|
|
3
4
|
export declare class WorkflowSerializer {
|
|
4
5
|
serialize(workflow: WorkflowEntity): SerializedWorkflow;
|
|
6
|
+
deserialize(wire: SerializedWorkflow): WorkflowPackageContent;
|
|
5
7
|
}
|
|
8
|
+
export {};
|