n8n 2.20.7 → 2.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abstract-server.d.ts +1 -0
- package/dist/abstract-server.js +10 -3
- package/dist/abstract-server.js.map +1 -1
- package/dist/agent-library-bundle.js +5989 -0
- package/dist/auth/auth.service.js +3 -3
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/commands/execute-batch.d.ts +2 -2
- package/dist/commands/export/workflow.d.ts +2 -2
- package/dist/commands/import/workflow.d.ts +3 -0
- package/dist/commands/import/workflow.js +15 -1
- package/dist/commands/import/workflow.js.map +1 -1
- package/dist/commands/start.js +2 -0
- package/dist/commands/start.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +6 -1
- package/dist/constants.js.map +1 -1
- package/dist/controller.registry.js +6 -0
- package/dist/controller.registry.js.map +1 -1
- package/dist/controllers/auth.controller.js +7 -2
- package/dist/controllers/auth.controller.js.map +1 -1
- package/dist/controllers/me.controller.d.ts +1 -0
- package/dist/controllers/me.controller.js +4 -1
- package/dist/controllers/me.controller.js.map +1 -1
- package/dist/controllers/users.controller.d.ts +2 -2
- package/dist/credentials/credentials.service.d.ts +1 -0
- package/dist/credentials/credentials.service.js +11 -4
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/evaluation.ee/evaluation-api-error.d.ts +7 -0
- package/dist/evaluation.ee/evaluation-api-error.js +16 -0
- package/dist/evaluation.ee/evaluation-api-error.js.map +1 -0
- package/dist/evaluation.ee/evaluation-config-validator.d.ts +30 -0
- package/dist/evaluation.ee/evaluation-config-validator.js +236 -0
- package/dist/evaluation.ee/evaluation-config-validator.js.map +1 -0
- package/dist/evaluation.ee/evaluation-config.controller.d.ts +24 -0
- package/dist/evaluation.ee/evaluation-config.controller.js +94 -0
- package/dist/evaluation.ee/evaluation-config.controller.js.map +1 -0
- package/dist/evaluation.ee/evaluation-config.service.d.ts +18 -0
- package/dist/evaluation.ee/evaluation-config.service.js +74 -0
- package/dist/evaluation.ee/evaluation-config.service.js.map +1 -0
- package/dist/evaluation.ee/llm-judge-provider-registry.d.ts +13 -0
- package/dist/evaluation.ee/llm-judge-provider-registry.js +122 -0
- package/dist/evaluation.ee/llm-judge-provider-registry.js.map +1 -0
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.d.ts +5 -0
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.js +32 -10
- package/dist/evaluation.ee/test-runner/test-runner.service.ee.js.map +1 -1
- package/dist/evaluation.ee/test-runner/workflow-compiler.service.d.ts +22 -0
- package/dist/evaluation.ee/test-runner/workflow-compiler.service.js +285 -0
- package/dist/evaluation.ee/test-runner/workflow-compiler.service.js.map +1 -0
- package/dist/evaluation.ee/test-runs.controller.ee.d.ts +3 -0
- package/dist/evaluation.ee/test-runs.controller.ee.js +26 -9
- package/dist/evaluation.ee/test-runs.controller.ee.js.map +1 -1
- package/dist/evaluation.ee/test-runs.types.ee.d.ts +3 -0
- package/dist/eventbus/message-event-bus/message-event-bus.d.ts +2 -0
- package/dist/eventbus/message-event-bus/message-event-bus.js +54 -46
- package/dist/eventbus/message-event-bus/message-event-bus.js.map +1 -1
- package/dist/events/maps/relay.event-map.d.ts +3 -0
- package/dist/instance-settings-loader/instance-settings-loader.service.d.ts +4 -2
- package/dist/instance-settings-loader/instance-settings-loader.service.js +7 -3
- package/dist/instance-settings-loader/instance-settings-loader.service.js.map +1 -1
- package/dist/instance-settings-loader/loaders/community-packages.instance-settings-loader.d.ts +20 -0
- package/dist/instance-settings-loader/loaders/community-packages.instance-settings-loader.js +235 -0
- package/dist/instance-settings-loader/loaders/community-packages.instance-settings-loader.js.map +1 -0
- package/dist/instance-settings-loader/loaders/{sso.instance-settings-loader.d.ts → sso/oidc.instance-settings-loader.d.ts} +4 -10
- package/dist/instance-settings-loader/loaders/sso/oidc.instance-settings-loader.js +98 -0
- package/dist/instance-settings-loader/loaders/sso/oidc.instance-settings-loader.js.map +1 -0
- package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.d.ts +10 -0
- package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.js +65 -0
- package/dist/instance-settings-loader/loaders/sso/provisioning.instance-settings-loader.js.map +1 -0
- package/dist/instance-settings-loader/loaders/sso/saml.instance-settings-loader.d.ts +12 -0
- package/dist/instance-settings-loader/loaders/sso/saml.instance-settings-loader.js +75 -0
- package/dist/instance-settings-loader/loaders/sso/saml.instance-settings-loader.js.map +1 -0
- package/dist/instance-settings-loader/loaders/sso/sso.instance-settings-loader.d.ts +15 -0
- package/dist/instance-settings-loader/loaders/sso/sso.instance-settings-loader.js +75 -0
- package/dist/instance-settings-loader/loaders/sso/sso.instance-settings-loader.js.map +1 -0
- package/dist/load-nodes-and-credentials.d.ts +3 -3
- package/dist/load-nodes-and-credentials.js +25 -17
- package/dist/load-nodes-and-credentials.js.map +1 -1
- package/dist/modules/agents/adapters/agents-credential-provider.d.ts +12 -0
- package/dist/modules/agents/adapters/agents-credential-provider.js +63 -0
- package/dist/modules/agents/adapters/agents-credential-provider.js.map +1 -0
- package/dist/modules/agents/agent-execution.service.d.ts +42 -0
- package/dist/modules/agents/agent-execution.service.js +153 -0
- package/dist/modules/agents/agent-execution.service.js.map +1 -0
- package/dist/modules/agents/agent-message-mapper.d.ts +5 -0
- package/dist/modules/agents/agent-message-mapper.js +43 -0
- package/dist/modules/agents/agent-message-mapper.js.map +1 -0
- package/dist/modules/agents/agent-skills.service.d.ts +24 -0
- package/dist/modules/agents/agent-skills.service.js +166 -0
- package/dist/modules/agents/agent-skills.service.js.map +1 -0
- package/dist/modules/agents/agent-sse-stream.d.ts +15 -0
- package/dist/modules/agents/agent-sse-stream.js +194 -0
- package/dist/modules/agents/agent-sse-stream.js.map +1 -0
- package/dist/modules/agents/agents-tools.service.d.ts +18 -0
- package/dist/modules/agents/agents-tools.service.js +193 -0
- package/dist/modules/agents/agents-tools.service.js.map +1 -0
- package/dist/modules/agents/agents.controller.d.ts +260 -0
- package/dist/modules/agents/agents.controller.js +818 -0
- package/dist/modules/agents/agents.controller.js.map +1 -0
- package/dist/modules/agents/agents.module.d.ts +12 -0
- package/dist/modules/agents/agents.module.js +136 -0
- package/dist/modules/agents/agents.module.js.map +1 -0
- package/dist/modules/agents/agents.service.d.ts +151 -0
- package/dist/modules/agents/agents.service.js +1134 -0
- package/dist/modules/agents/agents.service.js.map +1 -0
- package/dist/modules/agents/builder/agents-builder-prompts.d.ts +27 -0
- package/dist/modules/agents/builder/agents-builder-prompts.js +584 -0
- package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -0
- package/dist/modules/agents/builder/agents-builder-settings.controller.d.ts +11 -0
- package/dist/modules/agents/builder/agents-builder-settings.controller.js +61 -0
- package/dist/modules/agents/builder/agents-builder-settings.controller.js.map +1 -0
- package/dist/modules/agents/builder/agents-builder-settings.service.d.ts +31 -0
- package/dist/modules/agents/builder/agents-builder-settings.service.js +199 -0
- package/dist/modules/agents/builder/agents-builder-settings.service.js.map +1 -0
- package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +31 -0
- package/dist/modules/agents/builder/agents-builder-tools.service.js +420 -0
- package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -0
- package/dist/modules/agents/builder/agents-builder.service.d.ts +26 -0
- package/dist/modules/agents/builder/agents-builder.service.js +164 -0
- package/dist/modules/agents/builder/agents-builder.service.js.map +1 -0
- package/dist/modules/agents/builder/builder-model-lookup.service.d.ts +17 -0
- package/dist/modules/agents/builder/builder-model-lookup.service.js +67 -0
- package/dist/modules/agents/builder/builder-model-lookup.service.js.map +1 -0
- package/dist/modules/agents/builder/builder-tool-names.d.ts +14 -0
- package/dist/modules/agents/builder/builder-tool-names.js +17 -0
- package/dist/modules/agents/builder/builder-tool-names.js.map +1 -0
- package/dist/modules/agents/builder/errors.d.ts +6 -0
- package/dist/modules/agents/builder/errors.js +13 -0
- package/dist/modules/agents/builder/errors.js.map +1 -0
- package/dist/modules/agents/builder/interactive/ask-credential.tool.d.ts +5 -0
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js +29 -0
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js.map +1 -0
- package/dist/modules/agents/builder/interactive/ask-llm.tool.d.ts +2 -0
- package/dist/modules/agents/builder/interactive/ask-llm.tool.js +27 -0
- package/dist/modules/agents/builder/interactive/ask-llm.tool.js.map +1 -0
- package/dist/modules/agents/builder/interactive/ask-question.tool.d.ts +2 -0
- package/dist/modules/agents/builder/interactive/ask-question.tool.js +26 -0
- package/dist/modules/agents/builder/interactive/ask-question.tool.js.map +1 -0
- package/dist/modules/agents/builder/interactive/index.d.ts +4 -0
- package/dist/modules/agents/builder/interactive/index.js +12 -0
- package/dist/modules/agents/builder/interactive/index.js.map +1 -0
- package/dist/modules/agents/builder/interactive/llm-provider-defaults.d.ts +17 -0
- package/dist/modules/agents/builder/interactive/llm-provider-defaults.js +60 -0
- package/dist/modules/agents/builder/interactive/llm-provider-defaults.js.map +1 -0
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.d.ts +13 -0
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js +136 -0
- package/dist/modules/agents/builder/interactive/resolve-llm.tool.js.map +1 -0
- package/dist/modules/agents/entities/agent-checkpoint.entity.d.ts +9 -0
- package/dist/modules/agents/entities/agent-checkpoint.entity.js +43 -0
- package/dist/modules/agents/entities/agent-checkpoint.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.d.ts +16 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.js +74 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-execution.entity.d.ts +26 -0
- package/dist/modules/agents/entities/agent-execution.entity.js +100 -0
- package/dist/modules/agents/entities/agent-execution.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-message.entity.d.ts +10 -0
- package/dist/modules/agents/entities/agent-message.entity.js +47 -0
- package/dist/modules/agents/entities/agent-message.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-observation-cursor.entity.d.ts +8 -0
- package/dist/modules/agents/entities/agent-observation-cursor.entity.js +37 -0
- package/dist/modules/agents/entities/agent-observation-cursor.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-observation-lock.entity.d.ts +8 -0
- package/dist/modules/agents/entities/agent-observation-lock.entity.js +37 -0
- package/dist/modules/agents/entities/agent-observation-lock.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-observation.entity.d.ts +10 -0
- package/dist/modules/agents/entities/agent-observation.entity.js +47 -0
- package/dist/modules/agents/entities/agent-observation.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-published-version.entity.d.ts +22 -0
- package/dist/modules/agents/entities/agent-published-version.entity.js +67 -0
- package/dist/modules/agents/entities/agent-published-version.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-resource.entity.d.ts +5 -0
- package/dist/modules/agents/entities/agent-resource.entity.js +29 -0
- package/dist/modules/agents/entities/agent-resource.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-thread.entity.d.ts +6 -0
- package/dist/modules/agents/entities/agent-thread.entity.js +33 -0
- package/dist/modules/agents/entities/agent-thread.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent.entity.d.ts +24 -0
- package/dist/modules/agents/entities/agent.entity.js +74 -0
- package/dist/modules/agents/entities/agent.entity.js.map +1 -0
- package/dist/modules/agents/execution-recorder.d.ts +82 -0
- package/dist/modules/agents/execution-recorder.js +272 -0
- package/dist/modules/agents/execution-recorder.js.map +1 -0
- package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +62 -0
- package/dist/modules/agents/integrations/agent-chat-bridge.js +540 -0
- package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -0
- package/dist/modules/agents/integrations/agent-chat-integration.d.ts +39 -0
- package/dist/modules/agents/integrations/agent-chat-integration.js +45 -0
- package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -0
- package/dist/modules/agents/integrations/agent-schedule.service.d.ts +30 -0
- package/dist/modules/agents/integrations/agent-schedule.service.js +327 -0
- package/dist/modules/agents/integrations/agent-schedule.service.js.map +1 -0
- package/dist/modules/agents/integrations/callback-store.d.ts +11 -0
- package/dist/modules/agents/integrations/callback-store.js +30 -0
- package/dist/modules/agents/integrations/callback-store.js.map +1 -0
- package/dist/modules/agents/integrations/chat-integration.service.d.ts +58 -0
- package/dist/modules/agents/integrations/chat-integration.service.js +397 -0
- package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -0
- package/dist/modules/agents/integrations/component-mapper.d.ts +57 -0
- package/dist/modules/agents/integrations/component-mapper.js +223 -0
- package/dist/modules/agents/integrations/component-mapper.js.map +1 -0
- package/dist/modules/agents/integrations/cron-validation.d.ts +1 -0
- package/dist/modules/agents/integrations/cron-validation.js +8 -0
- package/dist/modules/agents/integrations/cron-validation.js.map +1 -0
- package/dist/modules/agents/integrations/esm-loader.d.ts +5 -0
- package/dist/modules/agents/integrations/esm-loader.js +24 -0
- package/dist/modules/agents/integrations/esm-loader.js.map +1 -0
- package/dist/modules/agents/integrations/integrations-sync.d.ts +4 -0
- package/dist/modules/agents/integrations/integrations-sync.js +78 -0
- package/dist/modules/agents/integrations/integrations-sync.js.map +1 -0
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.d.ts +36 -0
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.js +148 -0
- package/dist/modules/agents/integrations/n8n-checkpoint-storage.js.map +1 -0
- package/dist/modules/agents/integrations/n8n-memory.d.ts +76 -0
- package/dist/modules/agents/integrations/n8n-memory.js +383 -0
- package/dist/modules/agents/integrations/n8n-memory.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/linear-integration.d.ts +14 -0
- package/dist/modules/agents/integrations/platforms/linear-integration.js +83 -0
- package/dist/modules/agents/integrations/platforms/linear-integration.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/slack-integration.d.ts +12 -0
- package/dist/modules/agents/integrations/platforms/slack-integration.js +81 -0
- package/dist/modules/agents/integrations/platforms/slack-integration.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/telegram-integration.d.ts +30 -0
- package/dist/modules/agents/integrations/platforms/telegram-integration.js +122 -0
- package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -0
- package/dist/modules/agents/integrations/rich-interaction-tool.d.ts +47 -0
- package/dist/modules/agents/integrations/rich-interaction-tool.js +109 -0
- package/dist/modules/agents/integrations/rich-interaction-tool.js.map +1 -0
- package/dist/modules/agents/integrations/types.d.ts +8 -0
- package/dist/modules/agents/integrations/types.js +12 -0
- package/dist/modules/agents/integrations/types.js.map +1 -0
- package/dist/modules/agents/json-config/agent-config-composition.d.ts +9 -0
- package/dist/modules/agents/json-config/agent-config-composition.js +27 -0
- package/dist/modules/agents/json-config/agent-config-composition.js.map +1 -0
- package/dist/modules/agents/json-config/agent-json-config.d.ts +1022 -0
- package/dist/modules/agents/json-config/agent-json-config.js +128 -0
- package/dist/modules/agents/json-config/agent-json-config.js.map +1 -0
- package/dist/modules/agents/json-config/credential-field-mapping.d.ts +4 -0
- package/dist/modules/agents/json-config/credential-field-mapping.js +41 -0
- package/dist/modules/agents/json-config/credential-field-mapping.js.map +1 -0
- package/dist/modules/agents/json-config/from-json-config.d.ts +18 -0
- package/dist/modules/agents/json-config/from-json-config.js +209 -0
- package/dist/modules/agents/json-config/from-json-config.js.map +1 -0
- package/dist/modules/agents/json-config/integration-config.d.ts +61 -0
- package/dist/modules/agents/json-config/integration-config.js +33 -0
- package/dist/modules/agents/json-config/integration-config.js.map +1 -0
- package/dist/modules/agents/json-config/provider-tool-aliases.d.ts +1 -0
- package/dist/modules/agents/json-config/provider-tool-aliases.js +15 -0
- package/dist/modules/agents/json-config/provider-tool-aliases.js.map +1 -0
- package/dist/modules/agents/json-config/schema-text-serializer.d.ts +2 -0
- package/dist/modules/agents/json-config/schema-text-serializer.js +205 -0
- package/dist/modules/agents/json-config/schema-text-serializer.js.map +1 -0
- package/dist/modules/agents/repositories/agent-checkpoint.repository.d.ts +6 -0
- package/dist/modules/agents/repositories/agent-checkpoint.repository.js +35 -0
- package/dist/modules/agents/repositories/agent-checkpoint.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-execution-thread.repository.d.ts +18 -0
- package/dist/modules/agents/repositories/agent-execution-thread.repository.js +120 -0
- package/dist/modules/agents/repositories/agent-execution-thread.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-execution.repository.d.ts +10 -0
- package/dist/modules/agents/repositories/agent-execution.repository.js +59 -0
- package/dist/modules/agents/repositories/agent-execution.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-message.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-message.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-message.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-observation-cursor.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-observation-cursor.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-observation-cursor.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-observation-lock.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-observation-lock.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-observation-lock.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-observation.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-observation.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-observation.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-published-version.repository.d.ts +20 -0
- package/dist/modules/agents/repositories/agent-published-version.repository.js +35 -0
- package/dist/modules/agents/repositories/agent-published-version.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-resource.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-resource.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-resource.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-thread.repository.d.ts +5 -0
- package/dist/modules/agents/repositories/agent-thread.repository.js +26 -0
- package/dist/modules/agents/repositories/agent-thread.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent.repository.d.ts +9 -0
- package/dist/modules/agents/repositories/agent.repository.js +50 -0
- package/dist/modules/agents/repositories/agent.repository.js.map +1 -0
- package/dist/modules/agents/runtime/agent-isolate-pool.d.ts +48 -0
- package/dist/modules/agents/runtime/agent-isolate-pool.js +246 -0
- package/dist/modules/agents/runtime/agent-isolate-pool.js.map +1 -0
- package/dist/modules/agents/runtime/agent-secure-runtime.d.ts +21 -0
- package/dist/modules/agents/runtime/agent-secure-runtime.js +281 -0
- package/dist/modules/agents/runtime/agent-secure-runtime.js.map +1 -0
- package/dist/modules/agents/runtime/sandbox-polyfills.d.ts +1 -0
- package/dist/modules/agents/runtime/sandbox-polyfills.js +74 -0
- package/dist/modules/agents/runtime/sandbox-polyfills.js.map +1 -0
- package/dist/modules/agents/tool-registry.d.ts +13 -0
- package/dist/modules/agents/tool-registry.js +42 -0
- package/dist/modules/agents/tool-registry.js.map +1 -0
- package/dist/modules/agents/tools/environment-tool.d.ts +3 -0
- package/dist/modules/agents/tools/environment-tool.js +26 -0
- package/dist/modules/agents/tools/environment-tool.js.map +1 -0
- package/dist/modules/agents/tools/node-tool-factory.d.ts +10 -0
- package/dist/modules/agents/tools/node-tool-factory.js +100 -0
- package/dist/modules/agents/tools/node-tool-factory.js.map +1 -0
- package/dist/modules/agents/tools/workflow-tool-factory.d.ts +43 -0
- package/dist/modules/agents/tools/workflow-tool-factory.js +404 -0
- package/dist/modules/agents/tools/workflow-tool-factory.js.map +1 -0
- package/dist/modules/agents/tracing/builder-telemetry.d.ts +12 -0
- package/dist/modules/agents/tracing/builder-telemetry.js +48 -0
- package/dist/modules/agents/tracing/builder-telemetry.js.map +1 -0
- package/dist/modules/agents/types/components.d.ts +71 -0
- package/dist/modules/agents/types/components.js +3 -0
- package/dist/modules/agents/types/components.js.map +1 -0
- package/dist/modules/agents/types/index.d.ts +1 -0
- package/dist/modules/agents/types/index.js +3 -0
- package/dist/modules/agents/types/index.js.map +1 -0
- package/dist/modules/agents/utils/agent-draft.utils.d.ts +2 -0
- package/dist/modules/agents/utils/agent-draft.utils.js +11 -0
- package/dist/modules/agents/utils/agent-draft.utils.js.map +1 -0
- package/dist/modules/agents/utils/agent-resource-id.d.ts +3 -0
- package/dist/modules/agents/utils/agent-resource-id.js +14 -0
- package/dist/modules/agents/utils/agent-resource-id.js.map +1 -0
- 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 +2 -2
- package/dist/modules/chat-hub/dto/chat-models-request.dto.d.ts +1 -1
- package/dist/modules/community-packages/community-packages.config.js +2 -2
- package/dist/modules/community-packages/community-packages.config.js.map +1 -1
- package/dist/modules/community-packages/community-packages.lifecycle.service.d.ts +4 -1
- package/dist/modules/community-packages/community-packages.lifecycle.service.js +14 -2
- package/dist/modules/community-packages/community-packages.lifecycle.service.js.map +1 -1
- package/dist/modules/community-packages/community-packages.module.d.ts +1 -1
- package/dist/modules/community-packages/community-packages.module.js +10 -5
- package/dist/modules/community-packages/community-packages.module.js.map +1 -1
- package/dist/modules/data-table/data-table.service.js +6 -0
- package/dist/modules/data-table/data-table.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/slack-signature-identifier.d.ts +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.config.d.ts +2 -0
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.config.js +10 -0
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.config.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.d.ts +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js +16 -4
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/workflow-status.controller.d.ts +3 -3
- package/dist/modules/dynamic-credentials.ee/workflow-status.controller.js +11 -3
- package/dist/modules/dynamic-credentials.ee/workflow-status.controller.js.map +1 -1
- package/dist/modules/encryption-key-manager/encryption-bootstrap.service.js +4 -2
- package/dist/modules/encryption-key-manager/encryption-bootstrap.service.js.map +1 -1
- package/dist/modules/encryption-key-manager/encryption-key-manager.module.js +5 -2
- package/dist/modules/encryption-key-manager/encryption-key-manager.module.js.map +1 -1
- package/dist/modules/encryption-key-manager/encryption-key.controller.d.ts +3 -3
- package/dist/modules/encryption-key-manager/encryption-key.controller.js +8 -2
- package/dist/modules/encryption-key-manager/encryption-key.controller.js.map +1 -1
- package/dist/modules/encryption-key-manager/key-manager.service.d.ts +5 -1
- package/dist/modules/encryption-key-manager/key-manager.service.js +11 -4
- package/dist/modules/encryption-key-manager/key-manager.service.js.map +1 -1
- package/dist/modules/insights/insights-collection.service.js +1 -0
- package/dist/modules/insights/insights-collection.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/mock-handler.js +17 -49
- package/dist/modules/instance-ai/eval/mock-handler.js.map +1 -1
- package/dist/modules/instance-ai/filesystem/local-gateway-registry.d.ts +1 -0
- package/dist/modules/instance-ai/filesystem/local-gateway-registry.js +21 -3
- package/dist/modules/instance-ai/filesystem/local-gateway-registry.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-settings.service.d.ts +3 -2
- package/dist/modules/instance-ai/instance-ai-settings.service.js +10 -9
- package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-test.controller.d.ts +21 -2
- package/dist/modules/instance-ai/instance-ai-test.controller.js +35 -3
- package/dist/modules/instance-ai/instance-ai-test.controller.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +72 -42
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.controller.d.ts +2 -0
- package/dist/modules/instance-ai/instance-ai.controller.js +25 -1
- package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.module.d.ts +0 -1
- package/dist/modules/instance-ai/instance-ai.module.js +0 -2
- package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.service.d.ts +34 -5
- package/dist/modules/instance-ai/instance-ai.service.js +723 -76
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
- package/dist/modules/instance-ai/liveness/index.d.ts +1 -0
- package/dist/modules/instance-ai/liveness/index.js +7 -0
- package/dist/modules/instance-ai/liveness/index.js.map +1 -0
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.d.ts +72 -0
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js +123 -0
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js.map +1 -0
- package/dist/modules/instance-ai/message-parser.js +85 -6
- package/dist/modules/instance-ai/message-parser.js.map +1 -1
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js +4 -0
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js.map +1 -1
- package/dist/modules/instance-ai/storage/typeorm-memory-storage.js +1 -0
- package/dist/modules/instance-ai/storage/typeorm-memory-storage.js.map +1 -1
- package/dist/modules/instance-ai/web-research/fetch-and-extract.js +23 -7
- package/dist/modules/instance-ai/web-research/fetch-and-extract.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +3 -3
- package/dist/modules/mcp/mcp.service.js +12 -9
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/tools/get-execution.tool.js +6 -4
- package/dist/modules/mcp/tools/get-execution.tool.js.map +1 -1
- package/dist/modules/mcp/tools/list-credentials.tool.d.ts +40 -0
- package/dist/modules/mcp/tools/list-credentials.tool.js +148 -0
- package/dist/modules/mcp/tools/list-credentials.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +5 -4
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.d.ts +2 -2
- package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.js +3 -3
- package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.d.ts +2 -2
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js +2 -2
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js +3 -2
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +3 -3
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.d.ts +1 -1
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js +12 -4
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.d.ts +2 -2
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js +12 -5
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +1 -2
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js +1 -1
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-validation.utils.d.ts +5 -1
- package/dist/modules/mcp/tools/workflow-validation.utils.js +4 -2
- package/dist/modules/mcp/tools/workflow-validation.utils.js.map +1 -1
- package/dist/modules/mcp-registry/mcp-registry-node-loader.d.ts +27 -0
- package/dist/modules/mcp-registry/mcp-registry-node-loader.js +105 -0
- package/dist/modules/mcp-registry/mcp-registry-node-loader.js.map +1 -0
- package/dist/modules/mcp-registry/mcp-registry-node-loader.test.d.ts +1 -0
- package/dist/modules/mcp-registry/mcp-registry-node-loader.test.js +244 -0
- package/dist/modules/mcp-registry/mcp-registry-node-loader.test.js.map +1 -0
- package/dist/modules/mcp-registry/mcp-registry.module.d.ts +4 -0
- package/dist/modules/mcp-registry/mcp-registry.module.js +60 -0
- package/dist/modules/mcp-registry/mcp-registry.module.js.map +1 -0
- package/dist/modules/mcp-registry/node-description-transform.d.ts +8 -0
- package/dist/modules/mcp-registry/node-description-transform.js +133 -0
- package/dist/modules/mcp-registry/node-description-transform.js.map +1 -0
- package/dist/modules/mcp-registry/node-description-transform.test.d.ts +1 -0
- package/dist/modules/mcp-registry/node-description-transform.test.js +286 -0
- package/dist/modules/mcp-registry/node-description-transform.test.js.map +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.d.ts +8 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.js +31 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.js.map +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.test.d.ts +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.test.js +41 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.service.test.js.map +1 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.types.d.ts +36 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.types.js +3 -0
- package/dist/modules/mcp-registry/registry/mcp-registry.types.js.map +1 -0
- package/dist/modules/mcp-registry/registry/mock-servers.d.ts +3 -0
- package/dist/modules/mcp-registry/registry/mock-servers.js +80 -0
- package/dist/modules/mcp-registry/registry/mock-servers.js.map +1 -0
- package/dist/modules/otel/execution-level-tracer.d.ts +1 -1
- package/dist/modules/otel/execution-level-tracer.js +24 -9
- package/dist/modules/otel/execution-level-tracer.js.map +1 -1
- package/dist/modules/otel/execution-level-tracer.types.d.ts +9 -7
- package/dist/modules/otel/execution-level-tracer.types.js +14 -0
- package/dist/modules/otel/execution-level-tracer.types.js.map +1 -1
- package/dist/modules/quick-connect/quick-connect.config.d.ts +176 -0
- package/dist/modules/quick-connect/quick-connect.config.js +8 -0
- package/dist/modules/quick-connect/quick-connect.config.js.map +1 -1
- package/dist/modules/quick-connect/quick-connect.module.d.ts +15 -0
- package/dist/modules/redaction/executions/execution-redaction.service.d.ts +1 -3
- package/dist/modules/redaction/executions/execution-redaction.service.js +2 -6
- package/dist/modules/redaction/executions/execution-redaction.service.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.controller.ee.d.ts +2 -2
- package/dist/modules/source-control.ee/source-control.service.ee.d.ts +1 -1
- package/dist/modules/sso-oidc/oidc.controller.ee.d.ts +3 -1
- package/dist/modules/sso-oidc/oidc.controller.ee.js +8 -1
- package/dist/modules/sso-oidc/oidc.controller.ee.js.map +1 -1
- package/dist/node-catalog/index.d.ts +1 -0
- package/dist/node-catalog/index.js +6 -0
- package/dist/node-catalog/index.js.map +1 -0
- package/dist/{modules/mcp/tools/workflow-builder/workflow-builder-tools.service.d.ts → node-catalog/node-catalog.service.d.ts} +9 -15
- package/dist/{modules/mcp/tools/workflow-builder/workflow-builder-tools.service.js → node-catalog/node-catalog.service.js} +38 -28
- package/dist/node-catalog/node-catalog.service.js.map +1 -0
- package/dist/node-execution/ephemeral-node-executor.d.ts +47 -0
- package/dist/node-execution/ephemeral-node-executor.js +289 -0
- package/dist/node-execution/ephemeral-node-executor.js.map +1 -0
- package/dist/node-execution/index.d.ts +2 -0
- package/dist/node-execution/index.js +8 -0
- package/dist/node-execution/index.js.map +1 -0
- package/dist/public-api/v1/handlers/audit/audit.handler.d.ts +5 -4
- package/dist/public-api/v1/handlers/audit/audit.handler.js +5 -9
- package/dist/public-api/v1/handlers/audit/audit.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/community-packages/community-packages.handler.d.ts +20 -17
- package/dist/public-api/v1/handlers/community-packages/community-packages.handler.js +12 -39
- package/dist/public-api/v1/handlers/community-packages/community-packages.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.handler.d.ts +12 -49
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js +6 -5
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/data-tables/data-tables.columns.handler.d.ts +8 -19
- package/dist/public-api/v1/handlers/data-tables/data-tables.columns.handler.js +11 -11
- package/dist/public-api/v1/handlers/data-tables/data-tables.columns.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/data-tables/data-tables.handler.d.ts +9 -17
- package/dist/public-api/v1/handlers/data-tables/data-tables.handler.js +19 -23
- package/dist/public-api/v1/handlers/data-tables/data-tables.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.d.ts +9 -23
- package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.js +17 -27
- package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/discover/discover.handler.d.ts +11 -9
- package/dist/public-api/v1/handlers/discover/discover.handler.js +5 -3
- package/dist/public-api/v1/handlers/discover/discover.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/executions/executions.handler.d.ts +12 -11
- package/dist/public-api/v1/handlers/executions/executions.handler.js +46 -80
- package/dist/public-api/v1/handlers/executions/executions.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/folders/folders.handler.d.ts +12 -17
- package/dist/public-api/v1/handlers/folders/folders.handler.js +17 -20
- package/dist/public-api/v1/handlers/folders/folders.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/insights/insights.handler.d.ts +5 -4
- package/dist/public-api/v1/handlers/insights/insights.handler.js +9 -5
- package/dist/public-api/v1/handlers/insights/insights.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/projects/projects.handler.d.ts +28 -11
- package/dist/public-api/v1/handlers/projects/projects.handler.js +44 -75
- package/dist/public-api/v1/handlers/projects/projects.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/source-control/source-control.handler.d.ts +5 -6
- package/dist/public-api/v1/handlers/source-control/source-control.handler.js +3 -2
- package/dist/public-api/v1/handlers/source-control/source-control.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/tags/tags.handler.d.ts +9 -8
- package/dist/public-api/v1/handlers/tags/tags.handler.js +11 -8
- package/dist/public-api/v1/handlers/tags/tags.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/users/users.handler.ee.d.ts +14 -11
- package/dist/public-api/v1/handlers/users/users.handler.ee.js +7 -8
- package/dist/public-api/v1/handlers/users/users.handler.ee.js.map +1 -1
- package/dist/public-api/v1/handlers/variables/variables.handler.d.ts +13 -7
- package/dist/public-api/v1/handlers/variables/variables.handler.js +5 -3
- package/dist/public-api/v1/handlers/variables/variables.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/workflows/workflows.handler.d.ts +17 -49
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js +27 -46
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js.map +1 -1
- package/dist/public-api/v1/shared/handler.types.d.ts +7 -1
- package/dist/public-api/v1/shared/middlewares/global.middleware.d.ts +1 -2
- package/dist/public-api/v1/shared/middlewares/global.middleware.js +7 -6
- package/dist/public-api/v1/shared/middlewares/global.middleware.js.map +1 -1
- package/dist/scaling/constants.d.ts +2 -2
- package/dist/scaling/job-processor.js +2 -0
- package/dist/scaling/job-processor.js.map +1 -1
- package/dist/scaling/pubsub/pubsub.event-map.d.ts +9 -0
- package/dist/scaling/pubsub/pubsub.types.d.ts +3 -1
- package/dist/scaling/scaling.types.d.ts +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +2 -0
- package/dist/server.js.map +1 -1
- package/dist/services/frontend.service.js +7 -14
- package/dist/services/frontend.service.js.map +1 -1
- package/dist/services/import.service.d.ts +9 -3
- package/dist/services/import.service.js +72 -5
- package/dist/services/import.service.js.map +1 -1
- package/dist/services/proxy-token-manager.js.map +1 -0
- package/dist/services/workflow-statistics.service.js +1 -0
- package/dist/services/workflow-statistics.service.js.map +1 -1
- package/dist/task-runners/task-broker/task-broker.service.d.ts +2 -0
- package/dist/task-runners/task-broker/task-broker.service.js +13 -1
- package/dist/task-runners/task-broker/task-broker.service.js.map +1 -1
- package/dist/utils/ttl-map.d.ts +17 -0
- package/dist/utils/ttl-map.js +80 -0
- package/dist/utils/ttl-map.js.map +1 -0
- package/dist/webhooks/test-webhooks.d.ts +3 -1
- package/dist/webhooks/test-webhooks.js +11 -3
- package/dist/webhooks/test-webhooks.js.map +1 -1
- package/dist/workflow-execute-additional-data.d.ts +2 -1
- package/dist/workflow-execute-additional-data.js +34 -0
- package/dist/workflow-execute-additional-data.js.map +1 -1
- package/dist/workflow-helpers.d.ts +1 -0
- package/dist/workflow-helpers.js +15 -0
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflow-runner.js +2 -0
- package/dist/workflow-runner.js.map +1 -1
- package/dist/workflows/workflow-creation.service.js +1 -0
- package/dist/workflows/workflow-creation.service.js.map +1 -1
- package/dist/workflows/workflow.service.js +4 -0
- package/dist/workflows/workflow.service.js.map +1 -1
- package/package.json +40 -25
- package/dist/instance-settings-loader/loaders/sso.instance-settings-loader.js +0 -203
- package/dist/instance-settings-loader/loaders/sso.instance-settings-loader.js.map +0 -1
- package/dist/modules/instance-ai/proxy-token-manager.js.map +0 -1
- package/dist/modules/mcp/tools/workflow-builder/workflow-builder-tools.service.js.map +0 -1
- /package/dist/{modules/instance-ai → services}/proxy-token-manager.d.ts +0 -0
- /package/dist/{modules/instance-ai → services}/proxy-token-manager.js +0 -0
|
@@ -1,29 +1,24 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
type FoldersEndpoint<TParams extends Record<string, string>> = readonly [
|
|
4
|
-
ReturnType<typeof isLicensed>,
|
|
5
|
-
ReturnType<typeof apiKeyHasScopeWithGlobalScopeFallback>,
|
|
6
|
-
PublicAPIHandler<TParams>
|
|
7
|
-
];
|
|
1
|
+
import type { AuthenticatedRequest } from '@n8n/db';
|
|
2
|
+
import type { PublicAPIEndpoint } from '../../shared/handler.types';
|
|
8
3
|
type FolderHandlers = {
|
|
9
|
-
createFolder:
|
|
4
|
+
createFolder: PublicAPIEndpoint<AuthenticatedRequest<{
|
|
10
5
|
projectId: string;
|
|
11
|
-
}
|
|
12
|
-
getFolders:
|
|
6
|
+
}>>;
|
|
7
|
+
getFolders: PublicAPIEndpoint<AuthenticatedRequest<{
|
|
13
8
|
projectId: string;
|
|
14
|
-
}
|
|
15
|
-
deleteFolder:
|
|
9
|
+
}>>;
|
|
10
|
+
deleteFolder: PublicAPIEndpoint<AuthenticatedRequest<{
|
|
16
11
|
projectId: string;
|
|
17
12
|
folderId: string;
|
|
18
|
-
}
|
|
19
|
-
getFolder:
|
|
13
|
+
}>>;
|
|
14
|
+
getFolder: PublicAPIEndpoint<AuthenticatedRequest<{
|
|
20
15
|
projectId: string;
|
|
21
16
|
folderId: string;
|
|
22
|
-
}
|
|
23
|
-
updateFolder:
|
|
17
|
+
}>>;
|
|
18
|
+
updateFolder: PublicAPIEndpoint<AuthenticatedRequest<{
|
|
24
19
|
projectId: string;
|
|
25
20
|
folderId: string;
|
|
26
|
-
}
|
|
21
|
+
}>>;
|
|
27
22
|
};
|
|
28
23
|
declare const folderHandlers: FolderHandlers;
|
|
29
24
|
export = folderHandlers;
|
|
@@ -8,6 +8,15 @@ const not_found_error_1 = require("../../../../errors/response-errors/not-found.
|
|
|
8
8
|
const folder_service_1 = require("../../../../services/folder.service");
|
|
9
9
|
const global_middleware_1 = require("../../shared/middlewares/global.middleware");
|
|
10
10
|
const utils_service_1 = require("../../shared/services/utils.service");
|
|
11
|
+
const handleError = (error) => {
|
|
12
|
+
if (error instanceof folder_not_found_error_1.FolderNotFoundError) {
|
|
13
|
+
throw new not_found_error_1.NotFoundError(error.message);
|
|
14
|
+
}
|
|
15
|
+
if (error instanceof n8n_workflow_1.UserError) {
|
|
16
|
+
throw new bad_request_error_1.BadRequestError(error.message);
|
|
17
|
+
}
|
|
18
|
+
throw error;
|
|
19
|
+
};
|
|
11
20
|
const folderHandlers = {
|
|
12
21
|
createFolder: [
|
|
13
22
|
(0, global_middleware_1.isLicensed)('feat:folders'),
|
|
@@ -23,10 +32,8 @@ const folderHandlers = {
|
|
|
23
32
|
const folder = await di_1.Container.get(folder_service_1.FolderService).createFolder(payload.data, projectId);
|
|
24
33
|
return res.status(201).json(folder);
|
|
25
34
|
}
|
|
26
|
-
catch (
|
|
27
|
-
|
|
28
|
-
throw new not_found_error_1.NotFoundError(e.message);
|
|
29
|
-
throw e;
|
|
35
|
+
catch (error) {
|
|
36
|
+
return handleError(error);
|
|
30
37
|
}
|
|
31
38
|
},
|
|
32
39
|
],
|
|
@@ -58,12 +65,8 @@ const folderHandlers = {
|
|
|
58
65
|
await di_1.Container.get(folder_service_1.FolderService).deleteFolder(req.user, folderId, projectId, query.data);
|
|
59
66
|
return res.status(204).send();
|
|
60
67
|
}
|
|
61
|
-
catch (
|
|
62
|
-
|
|
63
|
-
throw new not_found_error_1.NotFoundError(e.message);
|
|
64
|
-
if (e instanceof n8n_workflow_1.UserError)
|
|
65
|
-
throw new bad_request_error_1.BadRequestError(e.message);
|
|
66
|
-
throw e;
|
|
68
|
+
catch (error) {
|
|
69
|
+
return handleError(error);
|
|
67
70
|
}
|
|
68
71
|
},
|
|
69
72
|
],
|
|
@@ -77,10 +80,8 @@ const folderHandlers = {
|
|
|
77
80
|
const { folder, totalSubFolders, totalWorkflows } = await di_1.Container.get(folder_service_1.FolderService).findFolderWithContentCounts(req.params.folderId, projectId);
|
|
78
81
|
return res.json({ ...folder, totalSubFolders, totalWorkflows });
|
|
79
82
|
}
|
|
80
|
-
catch (
|
|
81
|
-
|
|
82
|
-
throw new not_found_error_1.NotFoundError(e.message);
|
|
83
|
-
throw e;
|
|
83
|
+
catch (error) {
|
|
84
|
+
return handleError(error);
|
|
84
85
|
}
|
|
85
86
|
},
|
|
86
87
|
],
|
|
@@ -98,12 +99,8 @@ const folderHandlers = {
|
|
|
98
99
|
const folder = await di_1.Container.get(folder_service_1.FolderService).updateFolder(req.params.folderId, projectId, payload.data);
|
|
99
100
|
return res.json(folder);
|
|
100
101
|
}
|
|
101
|
-
catch (
|
|
102
|
-
|
|
103
|
-
throw new not_found_error_1.NotFoundError(e.message);
|
|
104
|
-
if (e instanceof n8n_workflow_1.UserError)
|
|
105
|
-
throw new bad_request_error_1.BadRequestError(e.message);
|
|
106
|
-
throw e;
|
|
102
|
+
catch (error) {
|
|
103
|
+
return handleError(error);
|
|
107
104
|
}
|
|
108
105
|
},
|
|
109
106
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"folders.handler.js","sourceRoot":"","sources":["../../../../../src/public-api/v1/handlers/folders/folders.handler.ts"],"names":[],"mappings":";AAAA,8CAKwB;
|
|
1
|
+
{"version":3,"file":"folders.handler.js","sourceRoot":"","sources":["../../../../../src/public-api/v1/handlers/folders/folders.handler.ts"],"names":[],"mappings":";AAAA,8CAKwB;AAExB,gCAAoC;AACpC,+CAAyC;AAEzC,4EAAsE;AACtE,kFAA6E;AAC7E,8EAAyE;AACzE,8DAA0D;AAG1D,kFAGoD;AACpD,uEAAyE;AAEzE,MAAM,WAAW,GAAG,CAAC,KAAc,EAAE,EAAE;IACtC,IAAI,KAAK,YAAY,4CAAmB,EAAE,CAAC;QAC1C,MAAM,IAAI,+BAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IACD,IAAI,KAAK,YAAY,wBAAS,EAAE,CAAC;QAChC,MAAM,IAAI,mCAAe,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,KAAK,CAAC;AACb,CAAC,CAAC;AAUF,MAAM,cAAc,GAAmB;IACtC,YAAY,EAAE;QACb,IAAA,8BAAU,EAAC,cAAc,CAAC;QAC1B,IAAA,yDAAqC,EAAC,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;QACjE,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AK,EAAE,CAAC;gBACnB,MAAM,IAAI,mCAAe,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;YAC5D,CAAC;YAED,IAAI,CAAC;gBACJ,MAAM,MAAM,GAAG,MAAM,cAAS,CAAC,GAAG,CAAC,8BAAa,CAAC,CAAC,YAAY,CAC7D,GAAG,CAAC,MAAM,CAAC,QAAQ,EACnB,SAAS,EACT,OAAO,CAAC,IAAI,CACZ,CAAC;gBACF,OAAO,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACzB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC;QACF,CAAC;KACD;CACD,CAAC;AAEF,iBAAS,cAAc,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type express from 'express';
|
|
2
1
|
import type { InsightsRequest } from '../../../../public-api/types';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { PublicAPIEndpoint } from '../../shared/handler.types';
|
|
3
|
+
type InsightsHandlers = {
|
|
4
|
+
getInsightsSummary: PublicAPIEndpoint<InsightsRequest.GetSummary>;
|
|
5
5
|
};
|
|
6
|
-
|
|
6
|
+
declare const insightsHandlers: InsightsHandlers;
|
|
7
|
+
export = insightsHandlers;
|
|
@@ -8,6 +8,12 @@ const bad_request_error_1 = require("../../../../errors/response-errors/bad-requ
|
|
|
8
8
|
const forbidden_error_1 = require("../../../../errors/response-errors/forbidden.error");
|
|
9
9
|
const insights_service_1 = require("../../../../modules/insights/insights.service");
|
|
10
10
|
const global_middleware_1 = require("../../shared/middlewares/global.middleware");
|
|
11
|
+
const handleError = (error) => {
|
|
12
|
+
if (error instanceof n8n_workflow_1.UserError) {
|
|
13
|
+
throw new forbidden_error_1.ForbiddenError(error.message);
|
|
14
|
+
}
|
|
15
|
+
throw error;
|
|
16
|
+
};
|
|
11
17
|
const dateFilterValidationSchema = zod_1.z
|
|
12
18
|
.object({
|
|
13
19
|
startDate: zod_1.z.coerce.date().optional(),
|
|
@@ -22,7 +28,7 @@ const dateFilterValidationSchema = zod_1.z
|
|
|
22
28
|
message: 'endDate must be the same as or after startDate',
|
|
23
29
|
path: ['endDate'],
|
|
24
30
|
});
|
|
25
|
-
|
|
31
|
+
const insightsHandlers = {
|
|
26
32
|
getInsightsSummary: [
|
|
27
33
|
(0, global_middleware_1.publicApiScope)('insights:read'),
|
|
28
34
|
async (req, res) => {
|
|
@@ -40,10 +46,7 @@ module.exports = {
|
|
|
40
46
|
di_1.Container.get(insights_service_1.InsightsService).validateDateFiltersLicense({ startDate, endDate });
|
|
41
47
|
}
|
|
42
48
|
catch (error) {
|
|
43
|
-
|
|
44
|
-
throw new forbidden_error_1.ForbiddenError(error.message);
|
|
45
|
-
}
|
|
46
|
-
throw error;
|
|
49
|
+
return handleError(error);
|
|
47
50
|
}
|
|
48
51
|
const summary = await di_1.Container.get(insights_service_1.InsightsService).getInsightsSummary({
|
|
49
52
|
startDate,
|
|
@@ -54,4 +57,5 @@ module.exports = {
|
|
|
54
57
|
},
|
|
55
58
|
],
|
|
56
59
|
};
|
|
60
|
+
module.exports = insightsHandlers;
|
|
57
61
|
//# sourceMappingURL=insights.handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insights.handler.js","sourceRoot":"","sources":["../../../../../src/public-api/v1/handlers/insights/insights.handler.ts"],"names":[],"mappings":";AAAA,8CAAuD;AACvD,gCAAoC;
|
|
1
|
+
{"version":3,"file":"insights.handler.js","sourceRoot":"","sources":["../../../../../src/public-api/v1/handlers/insights/insights.handler.ts"],"names":[],"mappings":";AAAA,8CAAuD;AACvD,gCAAoC;AACpC,iCAAiC;AACjC,+CAAyC;AACzC,6BAAwB;AAExB,kFAA6E;AAC7E,8EAA0E;AAC1E,0EAAsE;AAItE,kFAA4E;AAE5E,MAAM,WAAW,GAAG,CAAC,KAAc,EAAE,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,EAAE,CAAC;gBACzB,MAAM,IAAI,mCAAe,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YAC7F,CAAC;YAED,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,IAAI,EAAE,CAAC;YACjD,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI,gBAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;YAEvF,IAAI,CAAC;gBACJ,cAAS,CAAC,GAAG,CAAC,kCAAe,CAAC,CAAC,0BAA0B,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;YACnF,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC;YAED,MAAM,OAAO,GAAG,MAAM,cAAS,CAAC,GAAG,CAAC,kCAAe,CAAC,CAAC,kBAAkB,CAAC;gBACvE,SAAS;gBACT,OAAO;gBACP,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS;aAC/B,CAAC,CAAC;YAEH,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC;KACD;CACD,CAAC;AAEF,iBAAS,gBAAgB,CAAC"}
|
|
@@ -1,14 +1,31 @@
|
|
|
1
1
|
import type { AuthenticatedRequest } from '@n8n/db';
|
|
2
|
-
import type { Response } from 'express';
|
|
3
2
|
import type { PaginatedRequest } from '../../../../public-api/types';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
import type { PublicAPIEndpoint } from '../../shared/handler.types';
|
|
4
|
+
type GetAll = PaginatedRequest;
|
|
5
|
+
type GetProjectUsersRequest = AuthenticatedRequest<{
|
|
6
|
+
projectId: string;
|
|
7
|
+
}> & GetAll;
|
|
8
|
+
type ProjectHandlers = {
|
|
9
|
+
createProject: PublicAPIEndpoint<AuthenticatedRequest>;
|
|
10
|
+
updateProject: PublicAPIEndpoint<AuthenticatedRequest<{
|
|
11
|
+
projectId: string;
|
|
12
|
+
}>>;
|
|
13
|
+
deleteProject: PublicAPIEndpoint<AuthenticatedRequest<{
|
|
14
|
+
projectId: string;
|
|
15
|
+
}>>;
|
|
16
|
+
getProjects: PublicAPIEndpoint<GetAll>;
|
|
17
|
+
getProjectUsers: PublicAPIEndpoint<GetProjectUsersRequest>;
|
|
18
|
+
addUsersToProject: PublicAPIEndpoint<AuthenticatedRequest<{
|
|
19
|
+
projectId: string;
|
|
20
|
+
}>>;
|
|
21
|
+
changeUserRoleInProject: PublicAPIEndpoint<AuthenticatedRequest<{
|
|
22
|
+
projectId: string;
|
|
23
|
+
userId: string;
|
|
24
|
+
}>>;
|
|
25
|
+
deleteUserFromProject: PublicAPIEndpoint<AuthenticatedRequest<{
|
|
26
|
+
projectId: string;
|
|
27
|
+
userId: string;
|
|
28
|
+
}>>;
|
|
13
29
|
};
|
|
14
|
-
|
|
30
|
+
declare const projectHandlers: ProjectHandlers;
|
|
31
|
+
export = projectHandlers;
|
|
@@ -7,19 +7,19 @@ const db_1 = require("@n8n/db");
|
|
|
7
7
|
const di_1 = require("@n8n/di");
|
|
8
8
|
const pick_1 = __importDefault(require("lodash/pick"));
|
|
9
9
|
const project_controller_1 = require("../../../../controllers/project.controller");
|
|
10
|
+
const bad_request_error_1 = require("../../../../errors/response-errors/bad-request.error");
|
|
10
11
|
const not_found_error_1 = require("../../../../errors/response-errors/not-found.error");
|
|
11
|
-
const response_error_1 = require("../../../../errors/response-errors/abstract/response.error");
|
|
12
12
|
const project_service_ee_1 = require("../../../../services/project.service.ee");
|
|
13
13
|
const global_middleware_1 = require("../../shared/middlewares/global.middleware");
|
|
14
14
|
const pagination_service_1 = require("../../shared/services/pagination.service");
|
|
15
|
-
|
|
15
|
+
const projectHandlers = {
|
|
16
16
|
createProject: [
|
|
17
17
|
(0, global_middleware_1.isLicensed)('feat:projectRole:admin'),
|
|
18
18
|
(0, global_middleware_1.apiKeyHasScopeWithGlobalScopeFallback)({ scope: 'project:create' }),
|
|
19
19
|
async (req, res) => {
|
|
20
20
|
const payload = api_types_1.CreateProjectDto.safeParse(req.body);
|
|
21
21
|
if (payload.error) {
|
|
22
|
-
|
|
22
|
+
throw new bad_request_error_1.BadRequestError(payload.error.errors[0].message);
|
|
23
23
|
}
|
|
24
24
|
const project = await di_1.Container.get(project_controller_1.ProjectController).createProject(req, res, payload.data);
|
|
25
25
|
return res.status(201).json(project);
|
|
@@ -31,7 +31,7 @@ module.exports = {
|
|
|
31
31
|
async (req, res) => {
|
|
32
32
|
const payload = api_types_1.UpdateProjectWithRelationsDto.safeParse(req.body);
|
|
33
33
|
if (payload.error) {
|
|
34
|
-
|
|
34
|
+
throw new bad_request_error_1.BadRequestError(payload.error.errors[0].message);
|
|
35
35
|
}
|
|
36
36
|
await di_1.Container.get(project_controller_1.ProjectController).updateProject(req, res, payload.data, req.params.projectId);
|
|
37
37
|
return res.status(204).send();
|
|
@@ -43,7 +43,7 @@ module.exports = {
|
|
|
43
43
|
async (req, res) => {
|
|
44
44
|
const query = api_types_1.DeleteProjectDto.safeParse(req.query);
|
|
45
45
|
if (query.error) {
|
|
46
|
-
|
|
46
|
+
throw new bad_request_error_1.BadRequestError(query.error.errors[0].message);
|
|
47
47
|
}
|
|
48
48
|
await di_1.Container.get(project_controller_1.ProjectController).deleteProject(req, res, query.data, req.params.projectId);
|
|
49
49
|
return res.status(204).send();
|
|
@@ -77,48 +77,40 @@ module.exports = {
|
|
|
77
77
|
const { projectId } = req.params;
|
|
78
78
|
const offset = Number(req.query.offset) || 0;
|
|
79
79
|
const limit = Number(req.query.limit) || 100;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
throw new not_found_error_1.NotFoundError(`Could not find project with ID "${projectId}"`);
|
|
87
|
-
}
|
|
88
|
-
const projectRelationRepository = di_1.Container.get(db_1.ProjectRelationRepository);
|
|
89
|
-
const [relations, count] = await projectRelationRepository.findAndCount({
|
|
90
|
-
where: { projectId },
|
|
91
|
-
relations: { user: true, role: true },
|
|
92
|
-
skip: offset,
|
|
93
|
-
take: limit,
|
|
94
|
-
});
|
|
95
|
-
const memberFields = [
|
|
96
|
-
'id',
|
|
97
|
-
'email',
|
|
98
|
-
'firstName',
|
|
99
|
-
'lastName',
|
|
100
|
-
'createdAt',
|
|
101
|
-
'updatedAt',
|
|
102
|
-
];
|
|
103
|
-
const data = relations.map((relation) => ({
|
|
104
|
-
...(0, pick_1.default)(relation.user, memberFields),
|
|
105
|
-
role: relation.role?.slug ?? null,
|
|
106
|
-
}));
|
|
107
|
-
return res.json({
|
|
108
|
-
data,
|
|
109
|
-
nextCursor: (0, pagination_service_1.encodeNextCursor)({
|
|
110
|
-
offset,
|
|
111
|
-
limit,
|
|
112
|
-
numberOfTotalRecords: count,
|
|
113
|
-
}),
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
catch (error) {
|
|
117
|
-
if (error instanceof response_error_1.ResponseError) {
|
|
118
|
-
return res.status(error.httpStatusCode).json({ message: error.message });
|
|
119
|
-
}
|
|
120
|
-
throw error;
|
|
80
|
+
const projectService = di_1.Container.get(project_service_ee_1.ProjectService);
|
|
81
|
+
const project = await projectService.getProjectWithScope(req.user, projectId, [
|
|
82
|
+
'project:list',
|
|
83
|
+
]);
|
|
84
|
+
if (!project) {
|
|
85
|
+
throw new not_found_error_1.NotFoundError(`Could not find project with ID "${projectId}"`);
|
|
121
86
|
}
|
|
87
|
+
const projectRelationRepository = di_1.Container.get(db_1.ProjectRelationRepository);
|
|
88
|
+
const [relations, count] = await projectRelationRepository.findAndCount({
|
|
89
|
+
where: { projectId },
|
|
90
|
+
relations: { user: true, role: true },
|
|
91
|
+
skip: offset,
|
|
92
|
+
take: limit,
|
|
93
|
+
});
|
|
94
|
+
const memberFields = [
|
|
95
|
+
'id',
|
|
96
|
+
'email',
|
|
97
|
+
'firstName',
|
|
98
|
+
'lastName',
|
|
99
|
+
'createdAt',
|
|
100
|
+
'updatedAt',
|
|
101
|
+
];
|
|
102
|
+
const data = relations.map((relation) => ({
|
|
103
|
+
...(0, pick_1.default)(relation.user, memberFields),
|
|
104
|
+
role: relation.role?.slug ?? null,
|
|
105
|
+
}));
|
|
106
|
+
return res.json({
|
|
107
|
+
data,
|
|
108
|
+
nextCursor: (0, pagination_service_1.encodeNextCursor)({
|
|
109
|
+
offset,
|
|
110
|
+
limit,
|
|
111
|
+
numberOfTotalRecords: count,
|
|
112
|
+
}),
|
|
113
|
+
});
|
|
122
114
|
},
|
|
123
115
|
],
|
|
124
116
|
addUsersToProject: [
|
|
@@ -127,17 +119,9 @@ module.exports = {
|
|
|
127
119
|
async (req, res) => {
|
|
128
120
|
const payload = api_types_1.AddUsersToProjectDto.safeParse(req.body);
|
|
129
121
|
if (payload.error) {
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
try {
|
|
133
|
-
await di_1.Container.get(project_service_ee_1.ProjectService).addUsersToProject(req.params.projectId, payload.data.relations);
|
|
134
|
-
}
|
|
135
|
-
catch (error) {
|
|
136
|
-
if (error instanceof response_error_1.ResponseError) {
|
|
137
|
-
return res.status(error.httpStatusCode).send({ message: error.message });
|
|
138
|
-
}
|
|
139
|
-
throw error;
|
|
122
|
+
throw new bad_request_error_1.BadRequestError(payload.error.errors[0].message);
|
|
140
123
|
}
|
|
124
|
+
await di_1.Container.get(project_service_ee_1.ProjectService).addUsersToProject(req.params.projectId, payload.data.relations);
|
|
141
125
|
return res.status(201).send();
|
|
142
126
|
},
|
|
143
127
|
],
|
|
@@ -147,19 +131,11 @@ module.exports = {
|
|
|
147
131
|
async (req, res) => {
|
|
148
132
|
const payload = api_types_1.ChangeUserRoleInProject.safeParse(req.body);
|
|
149
133
|
if (payload.error) {
|
|
150
|
-
|
|
134
|
+
throw new bad_request_error_1.BadRequestError(payload.error.errors[0].message);
|
|
151
135
|
}
|
|
152
136
|
const { projectId, userId } = req.params;
|
|
153
137
|
const { role } = payload.data;
|
|
154
|
-
|
|
155
|
-
await di_1.Container.get(project_service_ee_1.ProjectService).changeUserRoleInProject(projectId, userId, role);
|
|
156
|
-
}
|
|
157
|
-
catch (error) {
|
|
158
|
-
if (error instanceof response_error_1.ResponseError) {
|
|
159
|
-
return res.status(error.httpStatusCode).send({ message: error.message });
|
|
160
|
-
}
|
|
161
|
-
throw error;
|
|
162
|
-
}
|
|
138
|
+
await di_1.Container.get(project_service_ee_1.ProjectService).changeUserRoleInProject(projectId, userId, role);
|
|
163
139
|
return res.status(204).send();
|
|
164
140
|
},
|
|
165
141
|
],
|
|
@@ -168,17 +144,10 @@ module.exports = {
|
|
|
168
144
|
(0, global_middleware_1.apiKeyHasScopeWithGlobalScopeFallback)({ scope: 'project:update' }),
|
|
169
145
|
async (req, res) => {
|
|
170
146
|
const { projectId, userId } = req.params;
|
|
171
|
-
|
|
172
|
-
await di_1.Container.get(project_service_ee_1.ProjectService).deleteUserFromProject(projectId, userId);
|
|
173
|
-
}
|
|
174
|
-
catch (error) {
|
|
175
|
-
if (error instanceof response_error_1.ResponseError) {
|
|
176
|
-
return res.status(error.httpStatusCode).send({ message: error.message });
|
|
177
|
-
}
|
|
178
|
-
throw error;
|
|
179
|
-
}
|
|
147
|
+
await di_1.Container.get(project_service_ee_1.ProjectService).deleteUserFromProject(projectId, userId);
|
|
180
148
|
return res.status(204).send();
|
|
181
149
|
},
|
|
182
150
|
],
|
|
183
151
|
};
|
|
152
|
+
module.exports = projectHandlers;
|
|
184
153
|
//# sourceMappingURL=projects.handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.handler.js","sourceRoot":"","sources":["../../../../../src/public-api/v1/handlers/projects/projects.handler.ts"],"names":[],"mappings":";;;;AAAA,8CAMwB;AAExB,gCAAuE;AACvE,gCAAoC;AACpC,uDAA+B;
|
|
1
|
+
{"version":3,"file":"projects.handler.js","sourceRoot":"","sources":["../../../../../src/public-api/v1/handlers/projects/projects.handler.ts"],"names":[],"mappings":";;;;AAAA,8CAMwB;AAExB,gCAAuE;AACvE,gCAAoC;AACpC,uDAA+B;AAE/B,yEAAqE;AACrE,kFAA6E;AAC7E,8EAAyE;AAEzE,sEAA+D;AAG/D,kFAIoD;AACpD,iFAA4E;AAoB5E,MAAM,eAAe,GAAoB;IACxC,aAAa,EAAE;QACd,IAAA,8BAAU,EAAC,wBAAwB,CAAC;QACpC,IAAA,yDAAqC,EAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC;QAClE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;YAClB,MAAM,OAAO,GAAG,4BAAgB,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACrD,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;gBACnB,MAAM,IAAI,mCAAe,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;YAC5D,CAAC;YAED,MAAM,OAAO,GAAG,MAAM,cAAS,CAAC,GAAG,CAAC,sCAAiB,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;YAE7F,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;KACD;IACD,aAAa,EAAE;QACd,IAAA,8BAAU,EAAC,wBAAwB,CAAC;QACpC,IAAA,yDAAqC,EAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC;QAClE,KAAK,EAAE,GA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B,EAAE,CAAC;QAClE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;YAClB,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC;YAEzC,MAAM,cAAS,CAAC,GAAG,CAAC,mCAAc,CAAC,CAAC,qBAAqB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;YAE7E,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QAC/B,CAAC;KACD;CACD,CAAC;AAEF,iBAAS,eAAe,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { AuthenticatedRequest } from '@n8n/db';
|
|
2
|
-
import type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const _default: {
|
|
6
|
-
pull: (import("../../shared/middlewares/global.middleware").ScopeTaggedMiddleware | ((req: AuthenticatedRequest, res: express.Response) => Promise<ImportResult | StatusResult | Promise<express.Response>>))[];
|
|
2
|
+
import type { PublicAPIEndpoint } from '../../shared/handler.types';
|
|
3
|
+
type SourceControlHandlers = {
|
|
4
|
+
pull: PublicAPIEndpoint<AuthenticatedRequest>;
|
|
7
5
|
};
|
|
8
|
-
|
|
6
|
+
declare const sourceControlHandlers: SourceControlHandlers;
|
|
7
|
+
export = sourceControlHandlers;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const api_types_1 = require("@n8n/api-types");
|
|
3
3
|
const di_1 = require("@n8n/di");
|
|
4
|
+
const event_service_1 = require("../../../../events/event.service");
|
|
4
5
|
const source_control_helper_ee_1 = require("../../../../modules/source-control.ee/source-control-helper.ee");
|
|
5
6
|
const source_control_preferences_service_ee_1 = require("../../../../modules/source-control.ee/source-control-preferences.service.ee");
|
|
6
7
|
const source_control_service_ee_1 = require("../../../../modules/source-control.ee/source-control.service.ee");
|
|
7
|
-
const event_service_1 = require("../../../../events/event.service");
|
|
8
8
|
const global_middleware_1 = require("../../shared/middlewares/global.middleware");
|
|
9
|
-
|
|
9
|
+
const sourceControlHandlers = {
|
|
10
10
|
pull: [
|
|
11
11
|
(0, global_middleware_1.apiKeyHasScopeWithGlobalScopeFallback)({ scope: 'sourceControl:pull' }),
|
|
12
12
|
async (req, res) => {
|
|
@@ -42,4 +42,5 @@ module.exports = {
|
|
|
42
42
|
},
|
|
43
43
|
],
|
|
44
44
|
};
|
|
45
|
+
module.exports = sourceControlHandlers;
|
|
45
46
|
//# sourceMappingURL=source-control.handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-control.handler.js","sourceRoot":"","sources":["../../../../../src/public-api/v1/handlers/source-control/source-control.handler.ts"],"names":[],"mappings":";AAAA,8CAA0D;AAE1D,gCAAoC;
|
|
1
|
+
{"version":3,"file":"source-control.handler.js","sourceRoot":"","sources":["../../../../../src/public-api/v1/handlers/source-control/source-control.handler.ts"],"names":[],"mappings":";AAAA,8CAA0D;AAE1D,gCAAoC;AAEpC,0DAAsD;AACtD,mGAG8D;AAC9D,6HAAoH;AACpH,qGAA6F;AAG7F,kFAAmG;AAMnG,MAAM,qBAAqB,GAA0B;IACpD,IAAI,EAAE;QACL,IAAA,yDAAqC,EAAC,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC;QACtE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;YAClB,MAAM,+BAA+B,GAAG,cAAS,CAAC,GAAG,CAAC,uEAA+B,CAAC,CAAC;YACvF,IAAI,CAAC,IAAA,kDAAuB,GAAE,EAAE,CAAC;gBAChC,OAAO,GAAG;qBACR,MAAM,CAAC,GAAG,CAAC;qBACX,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,wCAAwC,EAAE,CAAC,CAAC;YAChF,CAAC;YACD,IAAI,CAAC,+BAA+B,CAAC,wBAAwB,EAAE,EAAE,CAAC;gBACjE,OAAO,GAAG;qBACR,MAAM,CAAC,GAAG,CAAC;qBACX,I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
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import type { PublicAPIEndpoint } from '../../shared/handler.types';
|
|
3
|
+
type TagHandlers = {
|
|
4
|
+
createTag: PublicAPIEndpoint<TagRequest.Create>;
|
|
5
|
+
updateTag: PublicAPIEndpoint<TagRequest.Update>;
|
|
6
|
+
deleteTag: PublicAPIEndpoint<TagRequest.Delete>;
|
|
7
|
+
getTags: PublicAPIEndpoint<TagRequest.GetAll>;
|
|
8
|
+
getTag: PublicAPIEndpoint<TagRequest.Get>;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
declare const tagHandlers: TagHandlers;
|
|
11
|
+
export = tagHandlers;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const db_1 = require("@n8n/db");
|
|
3
3
|
const di_1 = require("@n8n/di");
|
|
4
|
+
const conflict_error_1 = require("../../../../errors/response-errors/conflict.error");
|
|
5
|
+
const not_found_error_1 = require("../../../../errors/response-errors/not-found.error");
|
|
4
6
|
const tag_service_1 = require("../../../../services/tag.service");
|
|
5
7
|
const global_middleware_1 = require("../../shared/middlewares/global.middleware");
|
|
6
8
|
const pagination_service_1 = require("../../shared/services/pagination.service");
|
|
7
|
-
|
|
9
|
+
const tagHandlers = {
|
|
8
10
|
createTag: [
|
|
9
11
|
(0, global_middleware_1.apiKeyHasScopeWithGlobalScopeFallback)({ scope: 'tag:create' }),
|
|
10
12
|
async (req, res) => {
|
|
@@ -14,8 +16,8 @@ module.exports = {
|
|
|
14
16
|
const createdTag = await di_1.Container.get(tag_service_1.TagService).save(newTag, 'create');
|
|
15
17
|
return res.status(201).json(createdTag);
|
|
16
18
|
}
|
|
17
|
-
catch
|
|
18
|
-
|
|
19
|
+
catch {
|
|
20
|
+
throw new conflict_error_1.ConflictError('Tag already exists');
|
|
19
21
|
}
|
|
20
22
|
},
|
|
21
23
|
],
|
|
@@ -28,15 +30,15 @@ module.exports = {
|
|
|
28
30
|
await di_1.Container.get(tag_service_1.TagService).getById(id);
|
|
29
31
|
}
|
|
30
32
|
catch (error) {
|
|
31
|
-
|
|
33
|
+
throw new not_found_error_1.NotFoundError('Not Found');
|
|
32
34
|
}
|
|
33
35
|
const updateTag = di_1.Container.get(tag_service_1.TagService).toEntity({ id, name: name.trim() });
|
|
34
36
|
try {
|
|
35
37
|
const updatedTag = await di_1.Container.get(tag_service_1.TagService).save(updateTag, 'update');
|
|
36
38
|
return res.json(updatedTag);
|
|
37
39
|
}
|
|
38
|
-
catch
|
|
39
|
-
|
|
40
|
+
catch {
|
|
41
|
+
throw new conflict_error_1.ConflictError('Tag already exists');
|
|
40
42
|
}
|
|
41
43
|
},
|
|
42
44
|
],
|
|
@@ -49,7 +51,7 @@ module.exports = {
|
|
|
49
51
|
tag = await di_1.Container.get(tag_service_1.TagService).getById(id);
|
|
50
52
|
}
|
|
51
53
|
catch (error) {
|
|
52
|
-
|
|
54
|
+
throw new not_found_error_1.NotFoundError('Not Found');
|
|
53
55
|
}
|
|
54
56
|
await di_1.Container.get(tag_service_1.TagService).delete(id);
|
|
55
57
|
return res.json(tag);
|
|
@@ -84,9 +86,10 @@ module.exports = {
|
|
|
84
86
|
return res.json(tag);
|
|
85
87
|
}
|
|
86
88
|
catch (error) {
|
|
87
|
-
|
|
89
|
+
throw new not_found_error_1.NotFoundError('Not Found');
|
|
88
90
|
}
|
|
89
91
|
},
|
|
90
92
|
],
|
|
91
93
|
};
|
|
94
|
+
module.exports = tagHandlers;
|
|
92
95
|
//# sourceMappingURL=tags.handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags.handler.js","sourceRoot":"","sources":["../../../../../src/public-api/v1/handlers/tags/tags.handler.ts"],"names":[],"mappings":";AACA,gCAAwC;AACxC,gCAAoC;AAKpC,wDAAoD;
|
|
1
|
+
{"version":3,"file":"tags.handler.js","sourceRoot":"","sources":["../../../../../src/public-api/v1/handlers/tags/tags.handler.ts"],"names":[],"mappings":";AACA,gCAAwC;AACxC,gCAAo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