@atom8n/n8n-core 2.2.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/README.md +13 -0
- package/bin/common.js +19 -0
- package/bin/copy-static-files +24 -0
- package/bin/generate-metadata +75 -0
- package/bin/generate-translations +99 -0
- package/dist/binary-data/binary-data.config.d.ts +15 -0
- package/dist/binary-data/binary-data.config.js +62 -0
- package/dist/binary-data/binary-data.config.js.map +1 -0
- package/dist/binary-data/binary-data.service.d.ts +32 -0
- package/dist/binary-data/binary-data.service.js +243 -0
- package/dist/binary-data/binary-data.service.js.map +1 -0
- package/dist/binary-data/file-system.manager.d.ts +31 -0
- package/dist/binary-data/file-system.manager.js +154 -0
- package/dist/binary-data/file-system.manager.js.map +1 -0
- package/dist/binary-data/index.d.ts +5 -0
- package/dist/binary-data/index.js +27 -0
- package/dist/binary-data/index.js.map +1 -0
- package/dist/binary-data/object-store/object-store.config.d.ts +19 -0
- package/dist/binary-data/object-store/object-store.config.js +83 -0
- package/dist/binary-data/object-store/object-store.config.js.map +1 -0
- package/dist/binary-data/object-store/object-store.service.ee.d.ts +46 -0
- package/dist/binary-data/object-store/object-store.service.ee.js +235 -0
- package/dist/binary-data/object-store/object-store.service.ee.js.map +1 -0
- package/dist/binary-data/object-store/types.d.ts +8 -0
- package/dist/binary-data/object-store/types.js +3 -0
- package/dist/binary-data/object-store/types.js.map +1 -0
- package/dist/binary-data/object-store.manager.d.ts +23 -0
- package/dist/binary-data/object-store.manager.js +86 -0
- package/dist/binary-data/object-store.manager.js.map +1 -0
- package/dist/binary-data/types.d.ts +46 -0
- package/dist/binary-data/types.js +3 -0
- package/dist/binary-data/types.js.map +1 -0
- package/dist/binary-data/utils.d.ts +15 -0
- package/dist/binary-data/utils.js +66 -0
- package/dist/binary-data/utils.js.map +1 -0
- package/dist/build.tsbuildinfo +1 -0
- package/dist/constants.d.ts +19 -0
- package/dist/constants.js +23 -0
- package/dist/constants.js.map +1 -0
- package/dist/credentials.d.ts +12 -0
- package/dist/credentials.js +99 -0
- package/dist/credentials.js.map +1 -0
- package/dist/data-deduplication-service.d.ts +16 -0
- package/dist/data-deduplication-service.js +95 -0
- package/dist/data-deduplication-service.js.map +1 -0
- package/dist/encryption/cipher.d.ts +8 -0
- package/dist/encryption/cipher.js +57 -0
- package/dist/encryption/cipher.js.map +1 -0
- package/dist/encryption/index.d.ts +1 -0
- package/dist/encryption/index.js +6 -0
- package/dist/encryption/index.js.map +1 -0
- package/dist/errors/abstract/binary-data.error.d.ts +3 -0
- package/dist/errors/abstract/binary-data.error.js +8 -0
- package/dist/errors/abstract/binary-data.error.js.map +1 -0
- package/dist/errors/abstract/filesystem.error.d.ts +4 -0
- package/dist/errors/abstract/filesystem.error.js +11 -0
- package/dist/errors/abstract/filesystem.error.js.map +1 -0
- package/dist/errors/binary-data-file-not-found.error.d.ts +4 -0
- package/dist/errors/binary-data-file-not-found.error.js +11 -0
- package/dist/errors/binary-data-file-not-found.error.js.map +1 -0
- package/dist/errors/disallowed-filepath.error.d.ts +4 -0
- package/dist/errors/disallowed-filepath.error.js +11 -0
- package/dist/errors/disallowed-filepath.error.js.map +1 -0
- package/dist/errors/error-reporter.d.ts +35 -0
- package/dist/errors/error-reporter.js +256 -0
- package/dist/errors/error-reporter.js.map +1 -0
- package/dist/errors/file-not-found.error.d.ts +4 -0
- package/dist/errors/file-not-found.error.js +11 -0
- package/dist/errors/file-not-found.error.js.map +1 -0
- package/dist/errors/file-too-large.error.d.ts +9 -0
- package/dist/errors/file-too-large.error.js +13 -0
- package/dist/errors/file-too-large.error.js.map +1 -0
- package/dist/errors/index.d.ts +11 -0
- package/dist/errors/index.js +26 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/invalid-execution-metadata.error.d.ts +5 -0
- package/dist/errors/invalid-execution-metadata.error.js +12 -0
- package/dist/errors/invalid-execution-metadata.error.js.map +1 -0
- package/dist/errors/invalid-manager.error.d.ts +4 -0
- package/dist/errors/invalid-manager.error.js +11 -0
- package/dist/errors/invalid-manager.error.js.map +1 -0
- package/dist/errors/invalid-source-type.error.d.ts +4 -0
- package/dist/errors/invalid-source-type.error.js +11 -0
- package/dist/errors/invalid-source-type.error.js.map +1 -0
- package/dist/errors/missing-source-id.error.d.ts +4 -0
- package/dist/errors/missing-source-id.error.js +11 -0
- package/dist/errors/missing-source-id.error.js.map +1 -0
- package/dist/errors/unrecognized-credential-type.error.d.ts +4 -0
- package/dist/errors/unrecognized-credential-type.error.js +11 -0
- package/dist/errors/unrecognized-credential-type.error.js.map +1 -0
- package/dist/errors/unrecognized-node-type.error.d.ts +4 -0
- package/dist/errors/unrecognized-node-type.error.js +11 -0
- package/dist/errors/unrecognized-node-type.error.js.map +1 -0
- package/dist/errors/workflow-has-issues.error.d.ts +4 -0
- package/dist/errors/workflow-has-issues.error.js +11 -0
- package/dist/errors/workflow-has-issues.error.js.map +1 -0
- package/dist/execution-engine/active-workflows.d.ts +23 -0
- package/dist/execution-engine/active-workflows.js +153 -0
- package/dist/execution-engine/active-workflows.js.map +1 -0
- package/dist/execution-engine/execution-context-hook-registry.service.d.ts +12 -0
- package/dist/execution-engine/execution-context-hook-registry.service.js +69 -0
- package/dist/execution-engine/execution-context-hook-registry.service.js.map +1 -0
- package/dist/execution-engine/execution-context.d.ts +2 -0
- package/dist/execution-engine/execution-context.js +56 -0
- package/dist/execution-engine/execution-context.js.map +1 -0
- package/dist/execution-engine/execution-context.service.d.ts +17 -0
- package/dist/execution-engine/execution-context.service.js +108 -0
- package/dist/execution-engine/execution-context.service.js.map +1 -0
- package/dist/execution-engine/execution-lifecycle-hooks.d.ts +20 -0
- package/dist/execution-engine/execution-lifecycle-hooks.js +31 -0
- package/dist/execution-engine/execution-lifecycle-hooks.js.map +1 -0
- package/dist/execution-engine/external-secrets-proxy.d.ts +18 -0
- package/dist/execution-engine/external-secrets-proxy.js +38 -0
- package/dist/execution-engine/external-secrets-proxy.js.map +1 -0
- package/dist/execution-engine/index.d.ts +26 -0
- package/dist/execution-engine/index.js +31 -0
- package/dist/execution-engine/index.js.map +1 -0
- package/dist/execution-engine/interfaces.d.ts +7 -0
- package/dist/execution-engine/interfaces.js +3 -0
- package/dist/execution-engine/interfaces.js.map +1 -0
- package/dist/execution-engine/node-execution-context/base-execute-context.d.ts +47 -0
- package/dist/execution-engine/node-execution-context/base-execute-context.js +150 -0
- package/dist/execution-engine/node-execution-context/base-execute-context.js.map +1 -0
- package/dist/execution-engine/node-execution-context/credentials-test-context.d.ts +7 -0
- package/dist/execution-engine/node-execution-context/credentials-test-context.js +37 -0
- package/dist/execution-engine/node-execution-context/credentials-test-context.js.map +1 -0
- package/dist/execution-engine/node-execution-context/execute-context.d.ts +24 -0
- package/dist/execution-engine/node-execution-context/execute-context.js +108 -0
- package/dist/execution-engine/node-execution-context/execute-context.js.map +1 -0
- package/dist/execution-engine/node-execution-context/execute-single-context.d.ts +15 -0
- package/dist/execution-engine/node-execution-context/execute-single-context.js +53 -0
- package/dist/execution-engine/node-execution-context/execute-single-context.js.map +1 -0
- package/dist/execution-engine/node-execution-context/hook-context.d.ts +13 -0
- package/dist/execution-engine/node-execution-context/hook-context.js +35 -0
- package/dist/execution-engine/node-execution-context/hook-context.js.map +1 -0
- package/dist/execution-engine/node-execution-context/index.d.ts +17 -0
- package/dist/execution-engine/node-execution-context/index.js +51 -0
- package/dist/execution-engine/node-execution-context/index.js.map +1 -0
- package/dist/execution-engine/node-execution-context/load-options-context.d.ts +10 -0
- package/dist/execution-engine/node-execution-context/load-options-context.js +43 -0
- package/dist/execution-engine/node-execution-context/load-options-context.js.map +1 -0
- package/dist/execution-engine/node-execution-context/local-load-options-context.d.ts +10 -0
- package/dist/execution-engine/node-execution-context/local-load-options-context.js +51 -0
- package/dist/execution-engine/node-execution-context/local-load-options-context.js.map +1 -0
- package/dist/execution-engine/node-execution-context/node-execution-context.d.ts +68 -0
- package/dist/execution-engine/node-execution-context/node-execution-context.js +324 -0
- package/dist/execution-engine/node-execution-context/node-execution-context.js.map +1 -0
- package/dist/execution-engine/node-execution-context/poll-context.d.ts +11 -0
- package/dist/execution-engine/node-execution-context/poll-context.js +38 -0
- package/dist/execution-engine/node-execution-context/poll-context.js.map +1 -0
- package/dist/execution-engine/node-execution-context/supply-data-context.d.ts +26 -0
- package/dist/execution-engine/node-execution-context/supply-data-context.js +181 -0
- package/dist/execution-engine/node-execution-context/supply-data-context.js.map +1 -0
- package/dist/execution-engine/node-execution-context/trigger-context.d.ts +11 -0
- package/dist/execution-engine/node-execution-context/trigger-context.js +40 -0
- package/dist/execution-engine/node-execution-context/trigger-context.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/binary-helper-functions.d.ts +10 -0
- package/dist/execution-engine/node-execution-context/utils/binary-helper-functions.js +213 -0
- package/dist/execution-engine/node-execution-context/utils/binary-helper-functions.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/cleanup-parameter-data.d.ts +2 -0
- package/dist/execution-engine/node-execution-context/utils/cleanup-parameter-data.js +27 -0
- package/dist/execution-engine/node-execution-context/utils/cleanup-parameter-data.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/construct-execution-metadata.d.ts +4 -0
- package/dist/execution-engine/node-execution-context/utils/construct-execution-metadata.js +11 -0
- package/dist/execution-engine/node-execution-context/utils/construct-execution-metadata.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/copy-input-items.d.ts +2 -0
- package/dist/execution-engine/node-execution-context/utils/copy-input-items.js +19 -0
- package/dist/execution-engine/node-execution-context/utils/copy-input-items.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/create-node-as-tool.d.ts +21 -0
- package/dist/execution-engine/node-execution-context/utils/create-node-as-tool.js +65 -0
- package/dist/execution-engine/node-execution-context/utils/create-node-as-tool.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/data-table-helper-functions.d.ts +2 -0
- package/dist/execution-engine/node-execution-context/utils/data-table-helper-functions.js +13 -0
- package/dist/execution-engine/node-execution-context/utils/data-table-helper-functions.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/deduplication-helper-functions.d.ts +2 -0
- package/dist/execution-engine/node-execution-context/utils/deduplication-helper-functions.js +38 -0
- package/dist/execution-engine/node-execution-context/utils/deduplication-helper-functions.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/ensure-type.d.ts +6 -0
- package/dist/execution-engine/node-execution-context/utils/ensure-type.js +75 -0
- package/dist/execution-engine/node-execution-context/utils/ensure-type.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/execution-metadata.d.ts +6 -0
- package/dist/execution-engine/node-execution-context/utils/execution-metadata.js +57 -0
- package/dist/execution-engine/node-execution-context/utils/execution-metadata.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/extract-value.d.ts +2 -0
- package/dist/execution-engine/node-execution-context/utils/extract-value.js +135 -0
- package/dist/execution-engine/node-execution-context/utils/extract-value.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/file-system-helper-functions.d.ts +2 -0
- package/dist/execution-engine/node-execution-context/utils/file-system-helper-functions.js +144 -0
- package/dist/execution-engine/node-execution-context/utils/file-system-helper-functions.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/get-additional-keys.d.ts +4 -0
- package/dist/execution-engine/node-execution-context/utils/get-additional-keys.js +57 -0
- package/dist/execution-engine/node-execution-context/utils/get-additional-keys.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/get-input-connection-data.d.ts +5 -0
- package/dist/execution-engine/node-execution-context/utils/get-input-connection-data.js +211 -0
- package/dist/execution-engine/node-execution-context/utils/get-input-connection-data.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/get-secrets-proxy.d.ts +2 -0
- package/dist/execution-engine/node-execution-context/utils/get-secrets-proxy.js +68 -0
- package/dist/execution-engine/node-execution-context/utils/get-secrets-proxy.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/normalize-items.d.ts +2 -0
- package/dist/execution-engine/node-execution-context/utils/normalize-items.js +36 -0
- package/dist/execution-engine/node-execution-context/utils/normalize-items.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/parse-incoming-message.d.ts +16 -0
- package/dist/execution-engine/node-execution-context/utils/parse-incoming-message.js +57 -0
- package/dist/execution-engine/node-execution-context/utils/parse-incoming-message.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/request-helper-functions.d.ts +18 -0
- package/dist/execution-engine/node-execution-context/utils/request-helper-functions.js +1213 -0
- package/dist/execution-engine/node-execution-context/utils/request-helper-functions.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/return-json-array.d.ts +2 -0
- package/dist/execution-engine/node-execution-context/utils/return-json-array.js +19 -0
- package/dist/execution-engine/node-execution-context/utils/return-json-array.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/scheduling-helper-functions.d.ts +2 -0
- package/dist/execution-engine/node-execution-context/utils/scheduling-helper-functions.js +22 -0
- package/dist/execution-engine/node-execution-context/utils/scheduling-helper-functions.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/ssh-tunnel-helper-functions.d.ts +2 -0
- package/dist/execution-engine/node-execution-context/utils/ssh-tunnel-helper-functions.js +14 -0
- package/dist/execution-engine/node-execution-context/utils/ssh-tunnel-helper-functions.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/validate-value-against-schema.d.ts +2 -0
- package/dist/execution-engine/node-execution-context/utils/validate-value-against-schema.js +132 -0
- package/dist/execution-engine/node-execution-context/utils/validate-value-against-schema.js.map +1 -0
- package/dist/execution-engine/node-execution-context/utils/webhook-helper-functions.d.ts +3 -0
- package/dist/execution-engine/node-execution-context/utils/webhook-helper-functions.js +31 -0
- package/dist/execution-engine/node-execution-context/utils/webhook-helper-functions.js.map +1 -0
- package/dist/execution-engine/node-execution-context/webhook-context.d.ts +21 -0
- package/dist/execution-engine/node-execution-context/webhook-context.js +87 -0
- package/dist/execution-engine/node-execution-context/webhook-context.js.map +1 -0
- package/dist/execution-engine/node-execution-context/workflow-node-context.d.ts +6 -0
- package/dist/execution-engine/node-execution-context/workflow-node-context.js +14 -0
- package/dist/execution-engine/node-execution-context/workflow-node-context.js.map +1 -0
- package/dist/execution-engine/partial-execution-utils/clean-run-data.d.ts +3 -0
- package/dist/execution-engine/partial-execution-utils/clean-run-data.js +28 -0
- package/dist/execution-engine/partial-execution-utils/clean-run-data.js.map +1 -0
- package/dist/execution-engine/partial-execution-utils/directed-graph.d.ts +65 -0
- package/dist/execution-engine/partial-execution-utils/directed-graph.js +370 -0
- package/dist/execution-engine/partial-execution-utils/directed-graph.js.map +1 -0
- package/dist/execution-engine/partial-execution-utils/filter-disabled-nodes.d.ts +2 -0
- package/dist/execution-engine/partial-execution-utils/filter-disabled-nodes.js +17 -0
- package/dist/execution-engine/partial-execution-utils/filter-disabled-nodes.js.map +1 -0
- package/dist/execution-engine/partial-execution-utils/find-start-nodes.d.ts +10 -0
- package/dist/execution-engine/partial-execution-utils/find-start-nodes.js +74 -0
- package/dist/execution-engine/partial-execution-utils/find-start-nodes.js.map +1 -0
- package/dist/execution-engine/partial-execution-utils/find-subgraph.d.ts +7 -0
- package/dist/execution-engine/partial-execution-utils/find-subgraph.js +59 -0
- package/dist/execution-engine/partial-execution-utils/find-subgraph.js.map +1 -0
- package/dist/execution-engine/partial-execution-utils/find-trigger-for-partial-execution.d.ts +4 -0
- package/dist/execution-engine/partial-execution-utils/find-trigger-for-partial-execution.js +102 -0
- package/dist/execution-engine/partial-execution-utils/find-trigger-for-partial-execution.js.map +1 -0
- package/dist/execution-engine/partial-execution-utils/get-incoming-data.d.ts +6 -0
- package/dist/execution-engine/partial-execution-utils/get-incoming-data.js +21 -0
- package/dist/execution-engine/partial-execution-utils/get-incoming-data.js.map +1 -0
- package/dist/execution-engine/partial-execution-utils/get-source-data-groups.d.ts +8 -0
- package/dist/execution-engine/partial-execution-utils/get-source-data-groups.js +65 -0
- package/dist/execution-engine/partial-execution-utils/get-source-data-groups.js.map +1 -0
- package/dist/execution-engine/partial-execution-utils/handle-cycles.d.ts +3 -0
- package/dist/execution-engine/partial-execution-utils/handle-cycles.js +60 -0
- package/dist/execution-engine/partial-execution-utils/handle-cycles.js.map +1 -0
- package/dist/execution-engine/partial-execution-utils/index.d.ts +10 -0
- package/dist/execution-engine/partial-execution-utils/index.js +25 -0
- package/dist/execution-engine/partial-execution-utils/index.js.map +1 -0
- package/dist/execution-engine/partial-execution-utils/recreate-node-execution-stack.d.ts +9 -0
- package/dist/execution-engine/partial-execution-utils/recreate-node-execution-stack.js +146 -0
- package/dist/execution-engine/partial-execution-utils/recreate-node-execution-stack.js.map +1 -0
- package/dist/execution-engine/partial-execution-utils/rewire-graph.d.ts +3 -0
- package/dist/execution-engine/partial-execution-utils/rewire-graph.js +72 -0
- package/dist/execution-engine/partial-execution-utils/rewire-graph.js.map +1 -0
- package/dist/execution-engine/partial-execution-utils/run-data-utils.d.ts +2 -0
- package/dist/execution-engine/partial-execution-utils/run-data-utils.js +15 -0
- package/dist/execution-engine/partial-execution-utils/run-data-utils.js.map +1 -0
- package/dist/execution-engine/requests-response.d.ts +23 -0
- package/dist/execution-engine/requests-response.js +128 -0
- package/dist/execution-engine/requests-response.js.map +1 -0
- package/dist/execution-engine/routing-node.d.ts +17 -0
- package/dist/execution-engine/routing-node.js +571 -0
- package/dist/execution-engine/routing-node.js.map +1 -0
- package/dist/execution-engine/scheduled-task-manager.d.ts +27 -0
- package/dist/execution-engine/scheduled-task-manager.js +140 -0
- package/dist/execution-engine/scheduled-task-manager.js.map +1 -0
- package/dist/execution-engine/ssh-clients-manager.d.ts +27 -0
- package/dist/execution-engine/ssh-clients-manager.js +170 -0
- package/dist/execution-engine/ssh-clients-manager.js.map +1 -0
- package/dist/execution-engine/triggers-and-pollers.d.ts +6 -0
- package/dist/execution-engine/triggers-and-pollers.js +66 -0
- package/dist/execution-engine/triggers-and-pollers.js.map +1 -0
- package/dist/execution-engine/workflow-execute.d.ts +46 -0
- package/dist/execution-engine/workflow-execute.js +1490 -0
- package/dist/execution-engine/workflow-execute.js.map +1 -0
- package/dist/html-sandbox.d.ts +3 -0
- package/dist/html-sandbox.js +19 -0
- package/dist/html-sandbox.js.map +1 -0
- package/dist/http-proxy.d.ts +6 -0
- package/dist/http-proxy.js +109 -0
- package/dist/http-proxy.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -0
- package/dist/instance-settings/index.d.ts +1 -0
- package/dist/instance-settings/index.js +6 -0
- package/dist/instance-settings/index.js.map +1 -0
- package/dist/instance-settings/instance-settings.d.ts +49 -0
- package/dist/instance-settings/instance-settings.js +210 -0
- package/dist/instance-settings/instance-settings.js.map +1 -0
- package/dist/instance-settings/worker-missing-encryption-key.error.d.ts +4 -0
- package/dist/instance-settings/worker-missing-encryption-key.error.js +15 -0
- package/dist/instance-settings/worker-missing-encryption-key.error.js.map +1 -0
- package/dist/interfaces.d.ts +16 -0
- package/dist/interfaces.js +3 -0
- package/dist/interfaces.js.map +1 -0
- package/dist/node-execute-functions.d.ts +3 -0
- package/dist/node-execute-functions.js +12 -0
- package/dist/node-execute-functions.js.map +1 -0
- package/dist/nodes-loader/constants.d.ts +5 -0
- package/dist/nodes-loader/constants.js +106 -0
- package/dist/nodes-loader/constants.js.map +1 -0
- package/dist/nodes-loader/custom-directory-loader.d.ts +6 -0
- package/dist/nodes-loader/custom-directory-loader.js +34 -0
- package/dist/nodes-loader/custom-directory-loader.js.map +1 -0
- package/dist/nodes-loader/directory-loader.d.ts +41 -0
- package/dist/nodes-loader/directory-loader.js +371 -0
- package/dist/nodes-loader/directory-loader.js.map +1 -0
- package/dist/nodes-loader/index.d.ts +5 -0
- package/dist/nodes-loader/index.js +12 -0
- package/dist/nodes-loader/index.js.map +1 -0
- package/dist/nodes-loader/lazy-package-directory-loader.d.ts +4 -0
- package/dist/nodes-loader/lazy-package-directory-loader.js +42 -0
- package/dist/nodes-loader/lazy-package-directory-loader.js.map +1 -0
- package/dist/nodes-loader/load-class-in-isolation.d.ts +1 -0
- package/dist/nodes-loader/load-class-in-isolation.js +20 -0
- package/dist/nodes-loader/load-class-in-isolation.js.map +1 -0
- package/dist/nodes-loader/package-directory-loader.d.ts +12 -0
- package/dist/nodes-loader/package-directory-loader.js +86 -0
- package/dist/nodes-loader/package-directory-loader.js.map +1 -0
- package/dist/nodes-loader/types.d.ts +14 -0
- package/dist/nodes-loader/types.js +3 -0
- package/dist/nodes-loader/types.js.map +1 -0
- package/dist/utils/assertions.d.ts +2 -0
- package/dist/utils/assertions.js +16 -0
- package/dist/utils/assertions.js.map +1 -0
- package/dist/utils/deep-merge.d.ts +1 -0
- package/dist/utils/deep-merge.js +33 -0
- package/dist/utils/deep-merge.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +19 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/is-json-compatible.d.ts +7 -0
- package/dist/utils/is-json-compatible.js +81 -0
- package/dist/utils/is-json-compatible.js.map +1 -0
- package/dist/utils/serialized-buffer.d.ts +6 -0
- package/dist/utils/serialized-buffer.js +16 -0
- package/dist/utils/serialized-buffer.js.map +1 -0
- package/dist/utils/signature-helpers.d.ts +2 -0
- package/dist/utils/signature-helpers.js +16 -0
- package/dist/utils/signature-helpers.js.map +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAdditionalKeys = getAdditionalKeys;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const constants_1 = require("../../../constants");
|
|
6
|
+
const execution_metadata_1 = require("./execution-metadata");
|
|
7
|
+
const get_secrets_proxy_1 = require("./get-secrets-proxy");
|
|
8
|
+
function getAdditionalKeys(additionalData, mode, runExecutionData, options) {
|
|
9
|
+
const executionId = additionalData.executionId ?? constants_1.PLACEHOLDER_EMPTY_EXECUTION_ID;
|
|
10
|
+
const resumeUrl = `${additionalData.webhookWaitingBaseUrl}/${executionId}`;
|
|
11
|
+
const resumeFormUrl = `${additionalData.formWaitingBaseUrl}/${executionId}`;
|
|
12
|
+
return {
|
|
13
|
+
$execution: {
|
|
14
|
+
id: executionId,
|
|
15
|
+
mode: mode === 'manual' ? 'test' : 'production',
|
|
16
|
+
resumeUrl,
|
|
17
|
+
resumeFormUrl,
|
|
18
|
+
customData: runExecutionData
|
|
19
|
+
? {
|
|
20
|
+
set(key, value) {
|
|
21
|
+
try {
|
|
22
|
+
(0, execution_metadata_1.setWorkflowExecutionMetadata)(runExecutionData, key, value);
|
|
23
|
+
}
|
|
24
|
+
catch (e) {
|
|
25
|
+
if (mode === 'manual') {
|
|
26
|
+
throw e;
|
|
27
|
+
}
|
|
28
|
+
n8n_workflow_1.LoggerProxy.debug(e.message);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
setAll(obj) {
|
|
32
|
+
try {
|
|
33
|
+
(0, execution_metadata_1.setAllWorkflowExecutionMetadata)(runExecutionData, obj);
|
|
34
|
+
}
|
|
35
|
+
catch (e) {
|
|
36
|
+
if (mode === 'manual') {
|
|
37
|
+
throw e;
|
|
38
|
+
}
|
|
39
|
+
n8n_workflow_1.LoggerProxy.debug(e.message);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
get(key) {
|
|
43
|
+
return (0, execution_metadata_1.getWorkflowExecutionMetadata)(runExecutionData, key);
|
|
44
|
+
},
|
|
45
|
+
getAll() {
|
|
46
|
+
return (0, execution_metadata_1.getAllWorkflowExecutionMetadata)(runExecutionData);
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
: undefined,
|
|
50
|
+
},
|
|
51
|
+
$vars: additionalData.variables,
|
|
52
|
+
$secrets: options?.secretsEnabled ? (0, get_secrets_proxy_1.getSecretsProxy)(additionalData) : undefined,
|
|
53
|
+
$executionId: executionId,
|
|
54
|
+
$resumeWebhookUrl: resumeUrl,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=get-additional-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-additional-keys.js","sourceRoot":"","sources":["../../../../src/execution-engine/node-execution-context/utils/get-additional-keys.ts"],"names":[],"mappings":";;AAmBA,8CAuDC;AApED,+CAA2C;AAE3C,2CAA6D;AAE7D,6DAK8B;AAC9B,2DAAsD;AAGtD,SAAgB,iBAAiB,CAChC,cAA8C,EAC9C,IAAyB,EACzB,gBAA0C,EAC1C,OAAsC;IAEtC,MAAM,WAAW,GAAG,cAAc,CAAC,WAAW,IAAI,0CAA8B,CAAC;IACjF,MAAM,SAAS,GAAG,GAAG,cAAc,CAAC,qBAAqB,IAAI,WAAW,EAAE,CAAC;IAC3E,MAAM,aAAa,GAAG,GAAG,cAAc,CAAC,kBAAkB,IAAI,WAAW,EAAE,CAAC;IAC5E,OAAO;QACN,UAAU,EAAE;YACX,EAAE,EAAE,WAAW;YACf,IAAI,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY;YAC/C,SAAS;YACT,aAAa;YACb,UAAU,EAAE,gBAAgB;gBAC3B,CAAC,CAAC;oBACA,GAAG,CAAC,GAAW,EAAE,KAAa;wBAC7B,IAAI,CAAC;4BACJ,IAAA,iDAA4B,EAAC,gBAAgB,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;wBAC5D,CAAC;wBAAC,OAAO,CAAC,EAAE,CAAC;4BACZ,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;gCACvB,MAAM,CAAC,CAAC;4BACT,CAAC;4BAED,0BAAW,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;wBAC9B,CAAC;oBACF,CAAC;oBACD,MAAM,CAAC,GAA2B;wBACjC,IAAI,CAAC;4BACJ,IAAA,oDAA+B,EAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC;wBACxD,CAAC;wBAAC,OAAO,CAAC,EAAE,CAAC;4BACZ,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;gCACvB,MAAM,CAAC,CAAC;4BACT,CAAC;4BAED,0BAAW,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;wBAC9B,CAAC;oBACF,CAAC;oBACD,GAAG,CAAC,GAAW;wBACd,OAAO,IAAA,iDAA4B,EAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC;oBAC5D,CAAC;oBACD,MAAM;wBACL,OAAO,IAAA,oDAA+B,EAAC,gBAAgB,CAAC,CAAC;oBAC1D,CAAC;iBACD;gBACF,CAAC,CAAC,SAAS;SACZ;QACD,KAAK,EAAE,cAAc,CAAC,SAAS;QAC/B,QAAQ,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,IAAA,mCAAe,EAAC,cAAc,CAAC,CAAC,CAAC,CAAC,SAAS;QAG/E,YAAY,EAAE,WAAW;QACzB,iBAAiB,EAAE,SAAS;KAC5B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CloseFunction, IExecuteData, INodeExecutionData, IRunExecutionData, ITaskDataConnections, IWorkflowExecuteAdditionalData, Workflow, WorkflowExecuteMode, AINodeConnectionType, IDataObject, ISupplyDataFunctions, INodeType, INode } from 'n8n-workflow';
|
|
2
|
+
import type { ExecuteContext, WebhookContext } from '../../node-execution-context';
|
|
3
|
+
import { SupplyDataContext } from '../../node-execution-context/supply-data-context';
|
|
4
|
+
export declare function makeHandleToolInvocation(contextFactory: (runIndex: number) => ISupplyDataFunctions, node: INode, nodeType: INodeType, runExecutionData: IRunExecutionData): (toolArgs: IDataObject) => Promise<string>;
|
|
5
|
+
export declare function getInputConnectionData(this: ExecuteContext | WebhookContext | SupplyDataContext, workflow: Workflow, runExecutionData: IRunExecutionData, parentRunIndex: number, connectionInputData: INodeExecutionData[], parentInputData: ITaskDataConnections, additionalData: IWorkflowExecuteAdditionalData, executeData: IExecuteData, mode: WorkflowExecuteMode, closeFunctions: CloseFunction[], connectionType: AINodeConnectionType, itemIndex: number, abortSignal?: AbortSignal): Promise<unknown>;
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeHandleToolInvocation = makeHandleToolInvocation;
|
|
4
|
+
exports.getInputConnectionData = getInputConnectionData;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const create_node_as_tool_1 = require("./create-node-as-tool");
|
|
7
|
+
const supply_data_context_1 = require("../../node-execution-context/supply-data-context");
|
|
8
|
+
const requests_response_1 = require("../../requests-response");
|
|
9
|
+
function getNextRunIndex(runExecutionData, nodeName) {
|
|
10
|
+
return runExecutionData.resultData.runData[nodeName]?.length ?? 0;
|
|
11
|
+
}
|
|
12
|
+
function containsBinaryData(nodeExecutionResult) {
|
|
13
|
+
if ((0, requests_response_1.isEngineRequest)(nodeExecutionResult)) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
if (nodeExecutionResult === undefined || nodeExecutionResult === null) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return nodeExecutionResult.some((outputBranch) => outputBranch.some((item) => item.binary));
|
|
20
|
+
}
|
|
21
|
+
function containsDataThatIsUsefulToTheAgent(nodeExecutionResult) {
|
|
22
|
+
if ((0, requests_response_1.isEngineRequest)(nodeExecutionResult)) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
if (nodeExecutionResult === undefined || nodeExecutionResult === null) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
return nodeExecutionResult.some((outputBranch) => outputBranch.some((item) => Object.keys(item.json).length > 0));
|
|
29
|
+
}
|
|
30
|
+
function mapResult(result) {
|
|
31
|
+
let response;
|
|
32
|
+
let nodeHasMixedJsonAndBinaryData = false;
|
|
33
|
+
if (result === undefined) {
|
|
34
|
+
response = undefined;
|
|
35
|
+
}
|
|
36
|
+
else if ((0, requests_response_1.isEngineRequest)(result)) {
|
|
37
|
+
response =
|
|
38
|
+
'Error: The Tool attempted to return an engine request, which is not supported in Agents';
|
|
39
|
+
}
|
|
40
|
+
else if (containsBinaryData(result) && !containsDataThatIsUsefulToTheAgent(result)) {
|
|
41
|
+
response = 'Error: The Tool attempted to return binary data, which is not supported in Agents';
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
if (containsBinaryData(result)) {
|
|
45
|
+
nodeHasMixedJsonAndBinaryData = true;
|
|
46
|
+
}
|
|
47
|
+
response = result?.[0]?.flatMap((item) => item.json);
|
|
48
|
+
}
|
|
49
|
+
return { response, nodeHasMixedJsonAndBinaryData };
|
|
50
|
+
}
|
|
51
|
+
function makeHandleToolInvocation(contextFactory, node, nodeType, runExecutionData) {
|
|
52
|
+
let runIndex = getNextRunIndex(runExecutionData, node.name);
|
|
53
|
+
return async (toolArgs) => {
|
|
54
|
+
let maxTries = 1;
|
|
55
|
+
if (node.retryOnFail === true) {
|
|
56
|
+
maxTries = Math.min(5, Math.max(2, node.maxTries ?? 3));
|
|
57
|
+
}
|
|
58
|
+
let waitBetweenTries = 0;
|
|
59
|
+
if (node.retryOnFail === true) {
|
|
60
|
+
waitBetweenTries = Math.min(5000, Math.max(0, node.waitBetweenTries ?? 1000));
|
|
61
|
+
}
|
|
62
|
+
let lastError;
|
|
63
|
+
for (let tryIndex = 0; tryIndex < maxTries; tryIndex++) {
|
|
64
|
+
const localRunIndex = runIndex++;
|
|
65
|
+
const context = contextFactory(localRunIndex);
|
|
66
|
+
const abortSignal = context.getExecutionCancelSignal?.();
|
|
67
|
+
if (abortSignal?.aborted) {
|
|
68
|
+
return 'Error during node execution: Execution was cancelled';
|
|
69
|
+
}
|
|
70
|
+
if (tryIndex !== 0) {
|
|
71
|
+
lastError = undefined;
|
|
72
|
+
if (waitBetweenTries !== 0) {
|
|
73
|
+
try {
|
|
74
|
+
await (0, n8n_workflow_1.sleepWithAbort)(waitBetweenTries, abortSignal);
|
|
75
|
+
}
|
|
76
|
+
catch (abortError) {
|
|
77
|
+
return 'Error during node execution: Execution was cancelled';
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
context.addInputData(n8n_workflow_1.NodeConnectionTypes.AiTool, [[{ json: toolArgs }]]);
|
|
82
|
+
try {
|
|
83
|
+
const result = await nodeType.execute?.call(context);
|
|
84
|
+
const { response, nodeHasMixedJsonAndBinaryData } = mapResult(result);
|
|
85
|
+
if (nodeHasMixedJsonAndBinaryData) {
|
|
86
|
+
context.logger.warn(`Response from Tool '${node.name}' included binary data, which is not supported in Agents. The binary data was omitted from the response.`);
|
|
87
|
+
}
|
|
88
|
+
context.addOutputData(n8n_workflow_1.NodeConnectionTypes.AiTool, localRunIndex, [
|
|
89
|
+
[{ json: { response } }],
|
|
90
|
+
]);
|
|
91
|
+
return JSON.stringify(response);
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
if (abortSignal?.aborted) {
|
|
95
|
+
throw new n8n_workflow_1.NodeOperationError(node, 'Execution was cancelled');
|
|
96
|
+
}
|
|
97
|
+
const nodeError = new n8n_workflow_1.NodeOperationError(node, error);
|
|
98
|
+
context.addOutputData(n8n_workflow_1.NodeConnectionTypes.AiTool, localRunIndex, nodeError);
|
|
99
|
+
lastError = nodeError;
|
|
100
|
+
if (tryIndex === maxTries - 1) {
|
|
101
|
+
if (nodeError.description && !nodeError.message.includes(nodeError.description)) {
|
|
102
|
+
nodeError.message = `${nodeError.message}\n\nDetails: ${nodeError.description}`;
|
|
103
|
+
}
|
|
104
|
+
throw nodeError;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (lastError) {
|
|
109
|
+
if (lastError.description && !lastError.message.includes(lastError.description)) {
|
|
110
|
+
lastError.message = `${lastError.message}\n\nDetails: ${lastError.description}`;
|
|
111
|
+
}
|
|
112
|
+
throw lastError;
|
|
113
|
+
}
|
|
114
|
+
throw new n8n_workflow_1.NodeOperationError(node, 'Unknown error during node execution');
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function validateInputConfiguration(context, connectionType, nodeInputs, connectedNodes) {
|
|
118
|
+
const parentNode = context.getNode();
|
|
119
|
+
const connections = context.getConnections(parentNode, connectionType);
|
|
120
|
+
for (let index = 0; index < nodeInputs.length; index++) {
|
|
121
|
+
const inputConfiguration = nodeInputs[index];
|
|
122
|
+
if (inputConfiguration.required) {
|
|
123
|
+
if (connections.length === 0 ||
|
|
124
|
+
connections.length <= index ||
|
|
125
|
+
connections.at(index)?.length === 0 ||
|
|
126
|
+
!connectedNodes.find((node) => connections
|
|
127
|
+
.at(index)
|
|
128
|
+
?.map((value) => value.node)
|
|
129
|
+
.includes(node.name))) {
|
|
130
|
+
throw new n8n_workflow_1.NodeOperationError(parentNode, `A ${inputConfiguration?.displayName ?? connectionType} sub-node must be connected and enabled`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
async function getInputConnectionData(workflow, runExecutionData, parentRunIndex, connectionInputData, parentInputData, additionalData, executeData, mode, closeFunctions, connectionType, itemIndex, abortSignal) {
|
|
136
|
+
const parentNode = this.getNode();
|
|
137
|
+
const inputConfigurations = this.nodeInputs.filter((input) => input.type === connectionType);
|
|
138
|
+
if (inputConfigurations === undefined || inputConfigurations.length === 0) {
|
|
139
|
+
throw new n8n_workflow_1.UserError('Node does not have input of type', {
|
|
140
|
+
extra: { nodeName: parentNode.name, connectionType },
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
const maxConnections = inputConfigurations.reduce((acc, currentItem) => currentItem.maxConnections !== undefined ? acc + currentItem.maxConnections : acc, 0);
|
|
144
|
+
const connectedNodes = this.getConnectedNodes(connectionType);
|
|
145
|
+
validateInputConfiguration(this, connectionType, inputConfigurations, connectedNodes);
|
|
146
|
+
if (connectedNodes.length === 0) {
|
|
147
|
+
return maxConnections === 1 ? undefined : [];
|
|
148
|
+
}
|
|
149
|
+
if (maxConnections !== undefined &&
|
|
150
|
+
maxConnections !== 0 &&
|
|
151
|
+
connectedNodes.length > maxConnections) {
|
|
152
|
+
throw new n8n_workflow_1.NodeOperationError(parentNode, `Only ${maxConnections} ${connectionType} sub-nodes are/is allowed to be connected`);
|
|
153
|
+
}
|
|
154
|
+
const nodes = [];
|
|
155
|
+
for (const connectedNode of connectedNodes) {
|
|
156
|
+
const connectedNodeType = workflow.nodeTypes.getByNameAndVersion(connectedNode.type, connectedNode.typeVersion);
|
|
157
|
+
const contextFactory = (runIndex, inputData) => new supply_data_context_1.SupplyDataContext(workflow, connectedNode, additionalData, mode, runExecutionData, runIndex, connectionInputData, inputData, connectionType, executeData, closeFunctions, abortSignal, parentNode);
|
|
158
|
+
if (!connectedNodeType.supplyData) {
|
|
159
|
+
if (connectedNodeType.description.outputs.includes(n8n_workflow_1.NodeConnectionTypes.AiTool)) {
|
|
160
|
+
const supplyData = (0, create_node_as_tool_1.createNodeAsTool)({
|
|
161
|
+
node: connectedNode,
|
|
162
|
+
nodeType: connectedNodeType,
|
|
163
|
+
handleToolInvocation: makeHandleToolInvocation((i) => contextFactory(i, {}), connectedNode, connectedNodeType, runExecutionData),
|
|
164
|
+
});
|
|
165
|
+
nodes.push(supplyData);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
throw new n8n_workflow_1.ApplicationError('Node does not have a `supplyData` method defined', {
|
|
169
|
+
extra: { nodeName: connectedNode.name },
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
const context = contextFactory(parentRunIndex, parentInputData);
|
|
175
|
+
try {
|
|
176
|
+
const supplyData = await connectedNodeType.supplyData.call(context, itemIndex);
|
|
177
|
+
if (supplyData.closeFunction) {
|
|
178
|
+
closeFunctions.push(supplyData.closeFunction);
|
|
179
|
+
}
|
|
180
|
+
if (context.hints.length > 0) {
|
|
181
|
+
supplyData.hints = context.hints;
|
|
182
|
+
}
|
|
183
|
+
nodes.push(supplyData);
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
if (error instanceof n8n_workflow_1.ExecutionBaseError) {
|
|
187
|
+
if (error.functionality === 'configuration-node')
|
|
188
|
+
throw error;
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
error = new n8n_workflow_1.NodeOperationError(connectedNode, error, {
|
|
192
|
+
itemIndex,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
let currentNodeRunIndex = 0;
|
|
196
|
+
if (runExecutionData.resultData.runData.hasOwnProperty(parentNode.name)) {
|
|
197
|
+
currentNodeRunIndex = runExecutionData.resultData.runData[parentNode.name].length;
|
|
198
|
+
}
|
|
199
|
+
await context.addExecutionDataFunctions('input', error, connectionType, parentNode.name, currentNodeRunIndex);
|
|
200
|
+
await context.addExecutionDataFunctions('output', error, connectionType, parentNode.name, currentNodeRunIndex);
|
|
201
|
+
throw new n8n_workflow_1.NodeOperationError(connectedNode, `Error in sub-node ${connectedNode.name}`, {
|
|
202
|
+
itemIndex,
|
|
203
|
+
functionality: 'configuration-node',
|
|
204
|
+
description: error.message,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return maxConnections === 1 ? (nodes || [])[0]?.response : nodes.map((node) => node.response);
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=get-input-connection-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-input-connection-data.js","sourceRoot":"","sources":["../../../../src/execution-engine/node-execution-context/utils/get-input-connection-data.ts"],"names":[],"mappings":";;AA+FA,4DA0GC;AAsCD,wDAmJC;AA5WD,+CAOsB;AAEtB,+DAAyD;AAGzD,0FAAqF;AACrF,+DAA0D;AAE1D,SAAS,eAAe,CAAC,gBAAmC,EAAE,QAAgB;IAC7E,OAAO,gBAAgB,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC;AACnE,CAAC;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|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSecretsProxy = getSecretsProxy;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
function buildSecretsValueProxy(value) {
|
|
6
|
+
return new Proxy(value, {
|
|
7
|
+
get(_target, valueName) {
|
|
8
|
+
if (typeof valueName !== 'string') {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
if (!(valueName in value)) {
|
|
12
|
+
throw new n8n_workflow_1.ExpressionError('Could not load secrets', {
|
|
13
|
+
description: 'The credential in use tries to use secret from an external store that could not be found',
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
const retValue = value[valueName];
|
|
17
|
+
if (typeof retValue === 'object' && retValue !== null) {
|
|
18
|
+
return buildSecretsValueProxy(retValue);
|
|
19
|
+
}
|
|
20
|
+
return retValue;
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function getSecretsProxy(additionalData) {
|
|
25
|
+
const { externalSecretsProxy } = additionalData;
|
|
26
|
+
return new Proxy({}, {
|
|
27
|
+
get(_target, providerName) {
|
|
28
|
+
if (typeof providerName !== 'string') {
|
|
29
|
+
return {};
|
|
30
|
+
}
|
|
31
|
+
if (externalSecretsProxy.hasProvider(providerName)) {
|
|
32
|
+
return new Proxy({}, {
|
|
33
|
+
get(_target2, secretName) {
|
|
34
|
+
if (typeof secretName !== 'string') {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (!externalSecretsProxy.hasSecret(providerName, secretName)) {
|
|
38
|
+
throw new n8n_workflow_1.ExpressionError('Could not load secrets', {
|
|
39
|
+
description: 'The credential in use tries to use secret from an external store that could not be found',
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
const retValue = externalSecretsProxy.getSecret(providerName, secretName);
|
|
43
|
+
if (typeof retValue === 'object' && retValue !== null) {
|
|
44
|
+
return buildSecretsValueProxy(retValue);
|
|
45
|
+
}
|
|
46
|
+
return retValue;
|
|
47
|
+
},
|
|
48
|
+
set() {
|
|
49
|
+
return false;
|
|
50
|
+
},
|
|
51
|
+
ownKeys() {
|
|
52
|
+
return externalSecretsProxy.listSecrets(providerName);
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
throw new n8n_workflow_1.ExpressionError('Could not load secrets', {
|
|
57
|
+
description: 'The credential in use pulls secrets from an external store that is not reachable',
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
set() {
|
|
61
|
+
return false;
|
|
62
|
+
},
|
|
63
|
+
ownKeys() {
|
|
64
|
+
return externalSecretsProxy.listProviders();
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=get-secrets-proxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-secrets-proxy.js","sourceRoot":"","sources":["../../../../src/execution-engine/node-execution-context/utils/get-secrets-proxy.ts"],"names":[],"mappings":";;AAwBA,0CAmDC;AA1ED,+CAA+C;AAE/C,SAAS,sBAAsB,CAAC,KAAkB;IACjD,OAAO,IAAI,KAAK,CAAC,KAAK,EAAE;QACvB,GAAG,CAAC,OAAO,EAAE,SAAS;YACrB,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;gBACnC,OAAO;YACR,CAAC;YACD,IAAI,CAAC,CAAC,SAAS,IAAI,KAAK,CAAC,EAAE,CAAC;gBAC3B,MAAM,IAAI,8BAAe,CAAC,wBAAwB,EAAE;oBACnD,WAAW,EACV,0FAA0F;iBAC3F,CAAC,CAAC;YACJ,CAAC;YACD,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;YAClC,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;gBACvD,OAAO,sBAAsB,CAAC,QAAuB,CAAC,CAAC;YACxD,CAAC;YACD,OAAO,QAA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AAO,KAAK,CAAC;QACd,CAAC;QACD,OAAO;YACN,OAAO,oBAAoB,CAAC,aAAa,EAAE,CAAC;QAC7C,CAAC;KACD,CACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeItems = normalizeItems;
|
|
4
|
+
const errors_1 = require("@n8n/errors");
|
|
5
|
+
function normalizeItems(executionData) {
|
|
6
|
+
if (typeof executionData === 'object' && !Array.isArray(executionData)) {
|
|
7
|
+
executionData = executionData.json ? [executionData] : [{ json: executionData }];
|
|
8
|
+
}
|
|
9
|
+
if (executionData.every((item) => typeof item === 'object' && 'json' in item))
|
|
10
|
+
return executionData;
|
|
11
|
+
if (executionData.some((item) => typeof item === 'object' && 'json' in item)) {
|
|
12
|
+
throw new errors_1.ApplicationError('Inconsistent item format');
|
|
13
|
+
}
|
|
14
|
+
if (executionData.every((item) => typeof item === 'object' && 'binary' in item)) {
|
|
15
|
+
const normalizedItems = [];
|
|
16
|
+
executionData.forEach((item) => {
|
|
17
|
+
const json = Object.keys(item).reduce((acc, key) => {
|
|
18
|
+
if (key === 'binary')
|
|
19
|
+
return acc;
|
|
20
|
+
return { ...acc, [key]: item[key] };
|
|
21
|
+
}, {});
|
|
22
|
+
normalizedItems.push({
|
|
23
|
+
json,
|
|
24
|
+
binary: item.binary,
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
return normalizedItems;
|
|
28
|
+
}
|
|
29
|
+
if (executionData.some((item) => typeof item === 'object' && 'binary' in item)) {
|
|
30
|
+
throw new errors_1.ApplicationError('Inconsistent item format');
|
|
31
|
+
}
|
|
32
|
+
return executionData.map((item) => {
|
|
33
|
+
return { json: item };
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=normalize-items.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-items.js","source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EAAE,EAAE,CAAC,CAAC;YAEP,eAAe,CAAC,IAAI,CAAC;gBACpB,IAAI;gBACJ,MAAM,EAAE,IAAI,CAAC,MAAM;aACnB,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,OAAO,eAAe,CAAC;IACxB,CAAC;IAED,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,QAAQ,IAAI,IAAI,CAAC,EAAE,CAAC;QAChF,MAAM,IAAI,yBAAgB,CAAC,0BAA0B,CAAC,CAAC;IACxD,CAAC;IAED,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACjC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IncomingMessage } from 'http';
|
|
2
|
+
interface IContentType {
|
|
3
|
+
type: string;
|
|
4
|
+
parameters: {
|
|
5
|
+
charset: string;
|
|
6
|
+
[key: string]: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare const parseContentType: (contentType?: string) => IContentType | null;
|
|
10
|
+
interface IContentDisposition {
|
|
11
|
+
type: string;
|
|
12
|
+
filename?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const parseContentDisposition: (contentDisposition?: string) => IContentDisposition | null;
|
|
15
|
+
export declare function parseIncomingMessage(message: IncomingMessage): void;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseContentDisposition = exports.parseContentType = void 0;
|
|
4
|
+
exports.parseIncomingMessage = parseIncomingMessage;
|
|
5
|
+
function parseHeaderParameters(parameters) {
|
|
6
|
+
return parameters.reduce((acc, param) => {
|
|
7
|
+
const [key, value] = param.split('=');
|
|
8
|
+
let decodedValue = decodeURIComponent(value).trim();
|
|
9
|
+
if (decodedValue.startsWith('"') && decodedValue.endsWith('"')) {
|
|
10
|
+
decodedValue = decodedValue.slice(1, -1);
|
|
11
|
+
}
|
|
12
|
+
acc[key.toLowerCase().trim()] = decodedValue;
|
|
13
|
+
return acc;
|
|
14
|
+
}, {});
|
|
15
|
+
}
|
|
16
|
+
const parseContentType = (contentType) => {
|
|
17
|
+
if (!contentType) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const [type, ...parameters] = contentType.split(';');
|
|
21
|
+
return {
|
|
22
|
+
type: type.toLowerCase(),
|
|
23
|
+
parameters: { charset: 'utf-8', ...parseHeaderParameters(parameters) },
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
exports.parseContentType = parseContentType;
|
|
27
|
+
const parseContentDisposition = (contentDisposition) => {
|
|
28
|
+
if (!contentDisposition) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
if (!contentDisposition.startsWith('attachment') && !contentDisposition.startsWith('inline')) {
|
|
32
|
+
contentDisposition = `attachment; ${contentDisposition}`;
|
|
33
|
+
}
|
|
34
|
+
const [type, ...parameters] = contentDisposition.split(';');
|
|
35
|
+
const parsedParameters = parseHeaderParameters(parameters);
|
|
36
|
+
let { filename } = parsedParameters;
|
|
37
|
+
const wildcard = parsedParameters['filename*'];
|
|
38
|
+
if (wildcard) {
|
|
39
|
+
const [_encoding, _locale, content] = wildcard?.split("'") ?? [];
|
|
40
|
+
filename = content;
|
|
41
|
+
}
|
|
42
|
+
return { type, filename };
|
|
43
|
+
};
|
|
44
|
+
exports.parseContentDisposition = parseContentDisposition;
|
|
45
|
+
function parseIncomingMessage(message) {
|
|
46
|
+
const contentType = (0, exports.parseContentType)(message.headers['content-type']);
|
|
47
|
+
if (contentType) {
|
|
48
|
+
const { type, parameters } = contentType;
|
|
49
|
+
message.contentType = type;
|
|
50
|
+
message.encoding = parameters.charset.toLowerCase();
|
|
51
|
+
}
|
|
52
|
+
const contentDisposition = (0, exports.parseContentDisposition)(message.headers['content-disposition']);
|
|
53
|
+
if (contentDisposition) {
|
|
54
|
+
message.contentDisposition = contentDisposition;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=parse-incoming-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-incoming-message.js","sourceRoot":"","sources":["../../../../src/execution-engine/node-execution-context/utils/parse-incoming-message.ts"],"names":[],"mappings":";;;AAkFA,oDAYC;AA5FD,SAAS,qBAAqB,CAAC,UAAoB;IAClD,OAAO,UAAU,CAAC,MAAM,CACvB,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QACd,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACtC,IAAI,YAAY,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;QACpD,IAAI,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAChE,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC1C,CAAC;QACD,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,YAAY,CAAC;QAC7C,OAAO,GAAG,CAAC;IACZ,CAAC,EACD,EAA4B,CAC5B,CAAC;AACH,CAAC;AAcM,MAAM,gBAAgB,GAAG,CAAC,WAAoB,EAAuB,EAAE;IAC7E,IAAI,CAAC,WAAW,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,MAAM,CAAC,IAAI,EAAE,GAAG,UAAU,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAErD,OAAO;QACN,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE;QACxB,U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,CAAC,WAAW,GAAG,IAAI,CAAC;QAC3B,OAAO,CAAC,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,WAAW,EAAoB,CAAC;IACvE,CAAC;IAED,MAAM,kBAAkB,GAAG,IAAA,+BAAuB,EAAC,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAC3F,IAAI,kBAAkB,EAAE,CAAC;QACxB,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IACjD,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ClientOAuth2TokenData } from '@n8n/client-oauth2';
|
|
2
|
+
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
3
|
+
import FormData from 'form-data';
|
|
4
|
+
import type { IAdditionalCredentialOptions, IAllExecuteFunctions, IHttpRequestOptions, IN8nHttpFullResponse, IN8nHttpResponse, INode, INodeExecutionData, IOAuth2Options, IRequestOptions, IRunExecutionData, IWorkflowExecuteAdditionalData, PaginationOptions, RequestHelperFunctions, Workflow } from 'n8n-workflow';
|
|
5
|
+
export declare function invokeAxios(axiosConfig: AxiosRequestConfig, authOptions?: IRequestOptions['auth']): Promise<AxiosResponse<any, any, {}>>;
|
|
6
|
+
export declare const createFormDataObject: (data: Record<string, unknown>) => FormData;
|
|
7
|
+
export declare function parseRequestObject(requestObject: IRequestOptions): Promise<AxiosRequestConfig<any>>;
|
|
8
|
+
export declare function proxyRequestToAxios(workflow: Workflow | undefined, additionalData: IWorkflowExecuteAdditionalData | undefined, node: INode | undefined, uriOrObject: string | IRequestOptions, options?: IRequestOptions): Promise<any>;
|
|
9
|
+
export declare function convertN8nRequestToAxios(n8nRequest: IHttpRequestOptions): AxiosRequestConfig;
|
|
10
|
+
export declare const removeEmptyBody: (requestOptions: IHttpRequestOptions | IRequestOptions) => void;
|
|
11
|
+
export declare function httpRequest(requestOptions: IHttpRequestOptions): Promise<IN8nHttpFullResponse | IN8nHttpResponse>;
|
|
12
|
+
export declare function applyPaginationRequestData(requestData: IRequestOptions, paginationRequestData: PaginationOptions['request']): IRequestOptions;
|
|
13
|
+
export declare function requestOAuth2(this: IAllExecuteFunctions, credentialsType: string, requestOptions: IHttpRequestOptions | IRequestOptions, node: INode, additionalData: IWorkflowExecuteAdditionalData, oAuth2Options?: IOAuth2Options, isN8nRequest?: boolean): Promise<any>;
|
|
14
|
+
export declare function requestOAuth1(this: IAllExecuteFunctions, credentialsType: string, requestOptions: IHttpRequestOptions | IRequestOptions, isN8nRequest?: boolean): Promise<any>;
|
|
15
|
+
export declare function refreshOAuth2Token(this: IAllExecuteFunctions, credentialsType: string, node: INode, additionalData: IWorkflowExecuteAdditionalData, oAuth2Options?: IOAuth2Options): Promise<ClientOAuth2TokenData>;
|
|
16
|
+
export declare function httpRequestWithAuthentication(this: IAllExecuteFunctions, credentialsType: string, requestOptions: IHttpRequestOptions, workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, additionalCredentialOptions?: IAdditionalCredentialOptions): Promise<any>;
|
|
17
|
+
export declare function requestWithAuthentication(this: IAllExecuteFunctions, credentialsType: string, requestOptions: IRequestOptions, workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, additionalCredentialOptions?: IAdditionalCredentialOptions, itemIndex?: number): Promise<any>;
|
|
18
|
+
export declare const getRequestHelperFunctions: (workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, runExecutionData?: IRunExecutionData | null, connectionInputData?: INodeExecutionData[]) => RequestHelperFunctions;
|