n8n-workflow 1.97.0 → 1.99.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{augment-object.d.ts → cjs/augment-object.d.ts} +1 -0
- package/dist/cjs/augment-object.d.ts.map +1 -0
- package/dist/cjs/augment-object.js +159 -0
- package/dist/cjs/augment-object.js.map +1 -0
- package/dist/{constants.d.ts → cjs/constants.d.ts} +12 -0
- package/dist/cjs/constants.d.ts.map +1 -0
- package/dist/cjs/constants.js +112 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/{cron.d.ts → cjs/cron.d.ts} +1 -0
- package/dist/cjs/cron.d.ts.map +1 -0
- package/dist/cjs/cron.js +37 -0
- package/dist/cjs/cron.js.map +1 -0
- package/dist/{deferred-promise.d.ts → cjs/deferred-promise.d.ts} +1 -0
- package/dist/cjs/deferred-promise.d.ts.map +1 -0
- package/dist/cjs/deferred-promise.js +22 -0
- package/dist/cjs/deferred-promise.js.map +1 -0
- package/dist/{errors → cjs/errors}/abstract/execution-base.error.d.ts +1 -0
- package/dist/cjs/errors/abstract/execution-base.error.d.ts.map +1 -0
- package/dist/cjs/errors/abstract/execution-base.error.js +50 -0
- package/dist/cjs/errors/abstract/execution-base.error.js.map +1 -0
- package/dist/cjs/errors/abstract/node.error.d.ts +48 -0
- package/dist/cjs/errors/abstract/node.error.d.ts.map +1 -0
- package/dist/cjs/errors/abstract/node.error.js +178 -0
- package/dist/cjs/errors/abstract/node.error.js.map +1 -0
- package/dist/{errors → cjs/errors}/application.error.d.ts +6 -2
- package/dist/cjs/errors/application.error.d.ts.map +1 -0
- package/dist/cjs/errors/application.error.js +41 -0
- package/dist/cjs/errors/application.error.js.map +1 -0
- package/dist/{errors → cjs/errors}/base/base.error.d.ts +12 -0
- package/dist/cjs/errors/base/base.error.d.ts.map +1 -0
- package/dist/cjs/errors/base/base.error.js +53 -0
- package/dist/cjs/errors/base/base.error.js.map +1 -0
- package/dist/{errors → cjs/errors}/base/operational.error.d.ts +8 -0
- package/dist/cjs/errors/base/operational.error.d.ts.map +1 -0
- package/dist/cjs/errors/base/operational.error.js +29 -0
- package/dist/cjs/errors/base/operational.error.js.map +1 -0
- package/dist/{errors → cjs/errors}/base/unexpected.error.d.ts +8 -0
- package/dist/cjs/errors/base/unexpected.error.d.ts.map +1 -0
- package/dist/cjs/errors/base/unexpected.error.js +29 -0
- package/dist/cjs/errors/base/unexpected.error.js.map +1 -0
- package/dist/{errors → cjs/errors}/base/user.error.d.ts +8 -0
- package/dist/cjs/errors/base/user.error.d.ts.map +1 -0
- package/dist/cjs/errors/base/user.error.js +29 -0
- package/dist/cjs/errors/base/user.error.js.map +1 -0
- package/dist/{errors → cjs/errors}/cli-subworkflow-operation.error.d.ts +1 -0
- package/dist/cjs/errors/cli-subworkflow-operation.error.d.ts.map +1 -0
- package/dist/cjs/errors/cli-subworkflow-operation.error.js +18 -0
- package/dist/cjs/errors/cli-subworkflow-operation.error.js.map +1 -0
- package/dist/{errors → cjs/errors}/db-connection-timeout-error.d.ts +1 -0
- package/dist/cjs/errors/db-connection-timeout-error.d.ts.map +1 -0
- package/dist/cjs/errors/db-connection-timeout-error.js +23 -0
- package/dist/cjs/errors/db-connection-timeout-error.js.map +1 -0
- package/dist/cjs/errors/ensure-error.d.ts +3 -0
- package/dist/cjs/errors/ensure-error.d.ts.map +1 -0
- package/dist/cjs/errors/ensure-error.js +23 -0
- package/dist/cjs/errors/ensure-error.js.map +1 -0
- package/dist/{errors → cjs/errors}/error.types.d.ts +2 -0
- package/dist/cjs/errors/error.types.d.ts.map +1 -0
- package/dist/cjs/errors/error.types.js +13 -0
- package/dist/{errors → cjs/errors}/error.types.js.map +1 -1
- package/dist/{errors → cjs/errors}/execution-cancelled.error.d.ts +1 -0
- package/dist/cjs/errors/execution-cancelled.error.d.ts.map +1 -0
- package/dist/cjs/errors/execution-cancelled.error.js +24 -0
- package/dist/cjs/errors/execution-cancelled.error.js.map +1 -0
- package/dist/{errors → cjs/errors}/expression-extension.error.d.ts +1 -0
- package/dist/cjs/errors/expression-extension.error.d.ts.map +1 -0
- package/dist/cjs/errors/expression-extension.error.js +18 -0
- package/dist/cjs/errors/expression-extension.error.js.map +1 -0
- package/dist/{errors → cjs/errors}/expression.error.d.ts +4 -0
- package/dist/cjs/errors/expression.error.d.ts.map +1 -0
- package/dist/cjs/errors/expression.error.js +48 -0
- package/dist/cjs/errors/expression.error.js.map +1 -0
- package/dist/{errors → cjs/errors}/index.d.ts +1 -0
- package/dist/cjs/errors/index.d.ts.map +1 -0
- package/dist/cjs/errors/index.js +58 -0
- package/dist/cjs/errors/index.js.map +1 -0
- package/dist/{errors → cjs/errors}/node-api.error.d.ts +8 -0
- package/dist/cjs/errors/node-api.error.d.ts.map +1 -0
- package/dist/cjs/errors/node-api.error.js +257 -0
- package/dist/cjs/errors/node-api.error.js.map +1 -0
- package/dist/{errors → cjs/errors}/node-operation.error.d.ts +4 -0
- package/dist/cjs/errors/node-operation.error.d.ts.map +1 -0
- package/dist/cjs/errors/node-operation.error.js +50 -0
- package/dist/cjs/errors/node-operation.error.js.map +1 -0
- package/dist/{errors → cjs/errors}/node-ssl.error.d.ts +1 -0
- package/dist/cjs/errors/node-ssl.error.d.ts.map +1 -0
- package/dist/cjs/errors/node-ssl.error.js +21 -0
- package/dist/cjs/errors/node-ssl.error.js.map +1 -0
- package/dist/{errors → cjs/errors}/subworkflow-operation.error.d.ts +1 -0
- package/dist/cjs/errors/subworkflow-operation.error.d.ts.map +1 -0
- package/dist/cjs/errors/subworkflow-operation.error.js +30 -0
- package/dist/cjs/errors/subworkflow-operation.error.js.map +1 -0
- package/dist/{errors → cjs/errors}/trigger-close.error.d.ts +1 -0
- package/dist/cjs/errors/trigger-close.error.d.ts.map +1 -0
- package/dist/cjs/errors/trigger-close.error.js +24 -0
- package/dist/cjs/errors/trigger-close.error.js.map +1 -0
- package/dist/{errors → cjs/errors}/webhook-taken.error.d.ts +1 -0
- package/dist/cjs/errors/webhook-taken.error.d.ts.map +1 -0
- package/dist/cjs/errors/webhook-taken.error.js +21 -0
- package/dist/cjs/errors/webhook-taken.error.js.map +1 -0
- package/dist/{errors → cjs/errors}/workflow-activation.error.d.ts +4 -0
- package/dist/cjs/errors/workflow-activation.error.d.ts.map +1 -0
- package/dist/cjs/errors/workflow-activation.error.js +54 -0
- package/dist/cjs/errors/workflow-activation.error.js.map +1 -0
- package/dist/{errors → cjs/errors}/workflow-deactivation.error.d.ts +1 -0
- package/dist/cjs/errors/workflow-deactivation.error.d.ts.map +1 -0
- package/dist/cjs/errors/workflow-deactivation.error.js +18 -0
- package/dist/cjs/errors/workflow-deactivation.error.js.map +1 -0
- package/dist/{errors → cjs/errors}/workflow-operation.error.d.ts +4 -0
- package/dist/cjs/errors/workflow-operation.error.d.ts.map +1 -0
- package/dist/cjs/errors/workflow-operation.error.js +32 -0
- package/dist/cjs/errors/workflow-operation.error.js.map +1 -0
- package/dist/{execution-status.d.ts → cjs/execution-status.d.ts} +1 -0
- package/dist/cjs/execution-status.d.ts.map +1 -0
- package/dist/cjs/execution-status.js +24 -0
- package/dist/cjs/execution-status.js.map +1 -0
- package/dist/{expression-evaluator-proxy.d.ts → cjs/expression-evaluator-proxy.d.ts} +1 -0
- package/dist/cjs/expression-evaluator-proxy.d.ts.map +1 -0
- package/dist/cjs/expression-evaluator-proxy.js +30 -0
- package/dist/cjs/expression-evaluator-proxy.js.map +1 -0
- package/dist/{expression-sandboxing.d.ts → cjs/expression-sandboxing.d.ts} +1 -0
- package/dist/cjs/expression-sandboxing.d.ts.map +1 -0
- package/dist/cjs/expression-sandboxing.js +62 -0
- package/dist/cjs/expression-sandboxing.js.map +1 -0
- package/dist/{expression.d.ts → cjs/expression.d.ts} +33 -0
- package/dist/cjs/expression.d.ts.map +1 -0
- package/dist/cjs/expression.js +368 -0
- package/dist/cjs/expression.js.map +1 -0
- package/dist/cjs/expressions/expression-helpers.d.ts +6 -0
- package/dist/cjs/expressions/expression-helpers.d.ts.map +1 -0
- package/dist/cjs/expressions/expression-helpers.js +24 -0
- package/dist/cjs/expressions/expression-helpers.js.map +1 -0
- package/dist/{extensions → cjs/extensions}/array-extensions.d.ts +1 -0
- package/dist/cjs/extensions/array-extensions.d.ts.map +1 -0
- package/dist/cjs/extensions/array-extensions.js +627 -0
- package/dist/cjs/extensions/array-extensions.js.map +1 -0
- package/dist/{extensions → cjs/extensions}/boolean-extensions.d.ts +1 -0
- package/dist/cjs/extensions/boolean-extensions.d.ts.map +1 -0
- package/dist/cjs/extensions/boolean-extensions.js +49 -0
- package/dist/cjs/extensions/boolean-extensions.js.map +1 -0
- package/dist/{extensions → cjs/extensions}/date-extensions.d.ts +1 -0
- package/dist/cjs/extensions/date-extensions.d.ts.map +1 -0
- package/dist/cjs/extensions/date-extensions.js +528 -0
- package/dist/cjs/extensions/date-extensions.js.map +1 -0
- package/dist/{extensions → cjs/extensions}/expression-extension.d.ts +22 -0
- package/dist/cjs/extensions/expression-extension.d.ts.map +1 -0
- package/dist/cjs/extensions/expression-extension.js +493 -0
- package/dist/cjs/extensions/expression-extension.js.map +1 -0
- package/dist/{extensions → cjs/extensions}/expression-parser.d.ts +1 -0
- package/dist/cjs/extensions/expression-parser.d.ts.map +1 -0
- package/dist/cjs/extensions/expression-parser.js +94 -0
- package/dist/cjs/extensions/expression-parser.js.map +1 -0
- package/dist/{extensions → cjs/extensions}/extended-functions.d.ts +1 -0
- package/dist/cjs/extensions/extended-functions.d.ts.map +1 -0
- package/dist/cjs/extensions/extended-functions.js +89 -0
- package/dist/cjs/extensions/extended-functions.js.map +1 -0
- package/dist/{extensions → cjs/extensions}/extensions.d.ts +1 -0
- package/dist/cjs/extensions/extensions.d.ts.map +1 -0
- package/dist/cjs/extensions/extensions.js +13 -0
- package/dist/cjs/extensions/extensions.js.map +1 -0
- package/dist/{extensions → cjs/extensions}/index.d.ts +1 -0
- package/dist/cjs/extensions/index.d.ts.map +1 -0
- package/dist/cjs/extensions/index.js +21 -0
- package/dist/cjs/extensions/index.js.map +1 -0
- package/dist/{extensions → cjs/extensions}/number-extensions.d.ts +1 -0
- package/dist/cjs/extensions/number-extensions.d.ts.map +1 -0
- package/dist/cjs/extensions/number-extensions.js +236 -0
- package/dist/cjs/extensions/number-extensions.js.map +1 -0
- package/dist/{extensions → cjs/extensions}/object-extensions.d.ts +1 -0
- package/dist/cjs/extensions/object-extensions.d.ts.map +1 -0
- package/dist/cjs/extensions/object-extensions.js +296 -0
- package/dist/cjs/extensions/object-extensions.js.map +1 -0
- package/dist/{extensions → cjs/extensions}/string-extensions.d.ts +1 -0
- package/dist/cjs/extensions/string-extensions.d.ts.map +1 -0
- package/dist/cjs/extensions/string-extensions.js +788 -0
- package/dist/cjs/extensions/string-extensions.js.map +1 -0
- package/dist/{extensions → cjs/extensions}/utils.d.ts +1 -0
- package/dist/cjs/extensions/utils.d.ts.map +1 -0
- package/dist/cjs/extensions/utils.js +42 -0
- package/dist/cjs/extensions/utils.js.map +1 -0
- package/dist/cjs/from-ai-parse-utils.d.ts +44 -0
- package/dist/cjs/from-ai-parse-utils.d.ts.map +1 -0
- package/dist/cjs/from-ai-parse-utils.js +291 -0
- package/dist/cjs/from-ai-parse-utils.js.map +1 -0
- package/dist/{global-state.d.ts → cjs/global-state.d.ts} +1 -0
- package/dist/cjs/global-state.d.ts.map +1 -0
- package/dist/cjs/global-state.js +23 -0
- package/dist/cjs/global-state.js.map +1 -0
- package/dist/{graph → cjs/graph}/graph-utils.d.ts +21 -0
- package/dist/cjs/graph/graph-utils.d.ts.map +1 -0
- package/dist/cjs/graph/graph-utils.js +195 -0
- package/dist/cjs/graph/graph-utils.js.map +1 -0
- package/dist/{index.d.ts → cjs/index.d.ts} +3 -1
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +114 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/{interfaces.d.ts → cjs/interfaces.d.ts} +106 -3
- package/dist/cjs/interfaces.d.ts.map +1 -0
- package/dist/cjs/interfaces.js +53 -0
- package/dist/cjs/interfaces.js.map +1 -0
- package/dist/{logger-proxy.d.ts → cjs/logger-proxy.d.ts} +1 -0
- package/dist/cjs/logger-proxy.d.ts.map +1 -0
- package/dist/cjs/logger-proxy.js +26 -0
- package/dist/cjs/logger-proxy.js.map +1 -0
- package/dist/{message-event-bus.d.ts → cjs/message-event-bus.d.ts} +1 -0
- package/dist/cjs/message-event-bus.d.ts.map +1 -0
- package/dist/cjs/message-event-bus.js +96 -0
- package/dist/cjs/message-event-bus.js.map +1 -0
- package/dist/{metadata-utils.d.ts → cjs/metadata-utils.d.ts} +1 -0
- package/dist/cjs/metadata-utils.d.ts.map +1 -0
- package/dist/cjs/metadata-utils.js +37 -0
- package/dist/cjs/metadata-utils.js.map +1 -0
- package/dist/{native-methods → cjs/native-methods}/array.methods.d.ts +1 -0
- package/dist/cjs/native-methods/array.methods.d.ts.map +1 -0
- package/dist/cjs/native-methods/array.methods.js +552 -0
- package/dist/cjs/native-methods/array.methods.js.map +1 -0
- package/dist/{native-methods → cjs/native-methods}/boolean.methods.d.ts +1 -0
- package/dist/cjs/native-methods/boolean.methods.d.ts.map +1 -0
- package/dist/cjs/native-methods/boolean.methods.js +31 -0
- package/dist/cjs/native-methods/boolean.methods.js.map +1 -0
- package/dist/{native-methods → cjs/native-methods}/index.d.ts +1 -0
- package/dist/cjs/native-methods/index.d.ts.map +1 -0
- package/dist/cjs/native-methods/index.js +27 -0
- package/dist/cjs/native-methods/index.js.map +1 -0
- package/dist/{native-methods → cjs/native-methods}/number.methods.d.ts +1 -0
- package/dist/cjs/native-methods/number.methods.d.ts.map +1 -0
- package/dist/cjs/native-methods/number.methods.js +95 -0
- package/dist/cjs/native-methods/number.methods.js.map +1 -0
- package/dist/{native-methods → cjs/native-methods}/object.methods.d.ts +1 -0
- package/dist/cjs/native-methods/object.methods.d.ts.map +1 -0
- package/dist/cjs/native-methods/object.methods.js +18 -0
- package/dist/cjs/native-methods/object.methods.js.map +1 -0
- package/dist/{native-methods → cjs/native-methods}/string.methods.d.ts +1 -0
- package/dist/cjs/native-methods/string.methods.d.ts.map +1 -0
- package/dist/cjs/native-methods/string.methods.js +499 -0
- package/dist/cjs/native-methods/string.methods.js.map +1 -0
- package/dist/{node-helpers.d.ts → cjs/node-helpers.d.ts} +109 -1
- package/dist/cjs/node-helpers.d.ts.map +1 -0
- package/dist/cjs/node-helpers.js +1369 -0
- package/dist/cjs/node-helpers.js.map +1 -0
- package/dist/{node-parameters → cjs/node-parameters}/filter-parameter.d.ts +1 -0
- package/dist/cjs/node-parameters/filter-parameter.d.ts.map +1 -0
- package/dist/cjs/node-parameters/filter-parameter.js +383 -0
- package/dist/cjs/node-parameters/filter-parameter.js.map +1 -0
- package/dist/{node-parameters → cjs/node-parameters}/rename-node-utils.d.ts +2 -1
- package/dist/cjs/node-parameters/rename-node-utils.d.ts.map +1 -0
- package/dist/cjs/node-parameters/rename-node-utils.js +36 -0
- package/dist/cjs/node-parameters/rename-node-utils.js.map +1 -0
- package/dist/{node-reference-parser-utils.d.ts → cjs/node-reference-parser-utils.d.ts} +11 -0
- package/dist/cjs/node-reference-parser-utils.d.ts.map +1 -0
- package/dist/cjs/node-reference-parser-utils.js +468 -0
- package/dist/cjs/node-reference-parser-utils.js.map +1 -0
- package/dist/{observable-object.d.ts → cjs/observable-object.d.ts} +1 -0
- package/dist/cjs/observable-object.d.ts.map +1 -0
- package/dist/cjs/observable-object.js +72 -0
- package/dist/cjs/observable-object.js.map +1 -0
- package/dist/{result.d.ts → cjs/result.d.ts} +7 -0
- package/dist/cjs/result.d.ts.map +1 -0
- package/dist/cjs/result.js +41 -0
- package/dist/cjs/result.js.map +1 -0
- package/dist/{telemetry-helpers.d.ts → cjs/telemetry-helpers.d.ts} +7 -0
- package/dist/cjs/telemetry-helpers.d.ts.map +1 -0
- package/dist/cjs/telemetry-helpers.js +522 -0
- package/dist/cjs/telemetry-helpers.js.map +1 -0
- package/dist/{type-guards.d.ts → cjs/type-guards.d.ts} +1 -0
- package/dist/cjs/type-guards.d.ts.map +1 -0
- package/dist/cjs/type-guards.js +56 -0
- package/dist/cjs/type-guards.js.map +1 -0
- package/dist/{type-validation.d.ts → cjs/type-validation.d.ts} +1 -0
- package/dist/cjs/type-validation.d.ts.map +1 -0
- package/dist/cjs/type-validation.js +408 -0
- package/dist/cjs/type-validation.js.map +1 -0
- package/dist/cjs/typecheck.tsbuildinfo +1 -0
- package/dist/{utils.d.ts → cjs/utils.d.ts} +32 -0
- package/dist/cjs/utils.d.ts.map +1 -0
- package/dist/cjs/utils.js +334 -0
- package/dist/cjs/utils.js.map +1 -0
- package/dist/{versioned-node-type.d.ts → cjs/versioned-node-type.d.ts} +1 -0
- package/dist/cjs/versioned-node-type.d.ts.map +1 -0
- package/dist/cjs/versioned-node-type.js +36 -0
- package/dist/cjs/versioned-node-type.js.map +1 -0
- package/dist/cjs/workflow-data-proxy-env-provider.d.ts +25 -0
- package/dist/cjs/workflow-data-proxy-env-provider.d.ts.map +1 -0
- package/dist/cjs/workflow-data-proxy-env-provider.js +70 -0
- package/dist/cjs/workflow-data-proxy-env-provider.js.map +1 -0
- package/dist/{workflow-data-proxy-helpers.d.ts → cjs/workflow-data-proxy-helpers.d.ts} +1 -0
- package/dist/cjs/workflow-data-proxy-helpers.d.ts.map +1 -0
- package/dist/cjs/workflow-data-proxy-helpers.js +20 -0
- package/dist/cjs/workflow-data-proxy-helpers.js.map +1 -0
- package/dist/{workflow-data-proxy.d.ts → cjs/workflow-data-proxy.d.ts} +45 -0
- package/dist/cjs/workflow-data-proxy.d.ts.map +1 -0
- package/dist/cjs/workflow-data-proxy.js +1189 -0
- package/dist/cjs/workflow-data-proxy.js.map +1 -0
- package/dist/cjs/workflow.d.ts +157 -0
- package/dist/cjs/workflow.d.ts.map +1 -0
- package/dist/cjs/workflow.js +765 -0
- package/dist/cjs/workflow.js.map +1 -0
- package/dist/esm/augment-object.d.ts +3 -0
- package/dist/esm/augment-object.d.ts.map +1 -0
- package/dist/{augment-object.js → esm/augment-object.js} +9 -6
- package/dist/esm/augment-object.js.map +1 -0
- package/dist/esm/constants.d.ts +73 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/constants.js +99 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/cron.d.ts +35 -0
- package/dist/esm/cron.d.ts.map +1 -0
- package/dist/{cron.js → esm/cron.js} +4 -8
- package/dist/esm/cron.js.map +1 -0
- package/dist/esm/deferred-promise.d.ts +10 -0
- package/dist/esm/deferred-promise.d.ts.map +1 -0
- package/dist/esm/deferred-promise.js +9 -0
- package/dist/esm/deferred-promise.js.map +1 -0
- package/dist/esm/errors/abstract/execution-base.error.d.ts +28 -0
- package/dist/esm/errors/abstract/execution-base.error.d.ts.map +1 -0
- package/dist/{errors → esm/errors}/abstract/execution-base.error.js +9 -8
- package/dist/esm/errors/abstract/execution-base.error.js.map +1 -0
- package/dist/esm/errors/abstract/node.error.d.ts +48 -0
- package/dist/esm/errors/abstract/node.error.d.ts.map +1 -0
- package/dist/{errors → esm/errors}/abstract/node.error.js +52 -12
- package/dist/esm/errors/abstract/node.error.js.map +1 -0
- package/dist/esm/errors/application.error.d.ts +13 -0
- package/dist/esm/errors/application.error.d.ts.map +1 -0
- package/dist/esm/errors/application.error.js +24 -0
- package/dist/esm/errors/application.error.js.map +1 -0
- package/dist/esm/errors/base/base.error.d.ts +26 -0
- package/dist/esm/errors/base/base.error.d.ts.map +1 -0
- package/dist/{errors → esm/errors}/base/base.error.js +20 -10
- package/dist/esm/errors/base/base.error.js.map +1 -0
- package/dist/esm/errors/base/operational.error.d.ts +16 -0
- package/dist/esm/errors/base/operational.error.d.ts.map +1 -0
- package/dist/esm/errors/base/operational.error.js +15 -0
- package/dist/esm/errors/base/operational.error.js.map +1 -0
- package/dist/esm/errors/base/unexpected.error.d.ts +16 -0
- package/dist/esm/errors/base/unexpected.error.d.ts.map +1 -0
- package/dist/esm/errors/base/unexpected.error.js +15 -0
- package/dist/esm/errors/base/unexpected.error.js.map +1 -0
- package/dist/esm/errors/base/user.error.d.ts +18 -0
- package/dist/esm/errors/base/user.error.d.ts.map +1 -0
- package/dist/esm/errors/base/user.error.js +15 -0
- package/dist/esm/errors/base/user.error.js.map +1 -0
- package/dist/esm/errors/cli-subworkflow-operation.error.d.ts +4 -0
- package/dist/esm/errors/cli-subworkflow-operation.error.d.ts.map +1 -0
- package/dist/esm/errors/cli-subworkflow-operation.error.js +4 -0
- package/dist/esm/errors/cli-subworkflow-operation.error.js.map +1 -0
- package/dist/esm/errors/db-connection-timeout-error.d.ts +9 -0
- package/dist/esm/errors/db-connection-timeout-error.d.ts.map +1 -0
- package/dist/{errors → esm/errors}/db-connection-timeout-error.js +2 -6
- package/dist/esm/errors/db-connection-timeout-error.js.map +1 -0
- package/dist/esm/errors/ensure-error.d.ts +3 -0
- package/dist/esm/errors/ensure-error.d.ts.map +1 -0
- package/dist/esm/errors/ensure-error.js +10 -0
- package/dist/esm/errors/ensure-error.js.map +1 -0
- package/dist/esm/errors/error.types.d.ts +12 -0
- package/dist/esm/errors/error.types.d.ts.map +1 -0
- package/dist/esm/errors/error.types.js +2 -0
- package/dist/esm/errors/error.types.js.map +1 -0
- package/dist/esm/errors/execution-cancelled.error.d.ts +5 -0
- package/dist/esm/errors/execution-cancelled.error.d.ts.map +1 -0
- package/dist/esm/errors/execution-cancelled.error.js +10 -0
- package/dist/esm/errors/execution-cancelled.error.js.map +1 -0
- package/dist/esm/errors/expression-extension.error.d.ts +4 -0
- package/dist/esm/errors/expression-extension.error.d.ts.map +1 -0
- package/dist/esm/errors/expression-extension.error.js +4 -0
- package/dist/esm/errors/expression-extension.error.js.map +1 -0
- package/dist/esm/errors/expression.error.d.ts +22 -0
- package/dist/esm/errors/expression.error.d.ts.map +1 -0
- package/dist/{errors → esm/errors}/expression.error.js +5 -6
- package/dist/esm/errors/expression.error.js.map +1 -0
- package/dist/esm/errors/index.d.ts +24 -0
- package/dist/esm/errors/index.d.ts.map +1 -0
- package/dist/esm/errors/index.js +23 -0
- package/dist/esm/errors/index.js.map +1 -0
- package/dist/esm/errors/node-api.error.d.ts +39 -0
- package/dist/esm/errors/node-api.error.d.ts.map +1 -0
- package/dist/{errors → esm/errors}/node-api.error.js +55 -19
- package/dist/esm/errors/node-api.error.js.map +1 -0
- package/dist/esm/errors/node-operation.error.d.ts +11 -0
- package/dist/esm/errors/node-operation.error.d.ts.map +1 -0
- package/dist/{errors → esm/errors}/node-operation.error.js +9 -9
- package/dist/esm/errors/node-operation.error.js.map +1 -0
- package/dist/esm/errors/node-ssl.error.d.ts +5 -0
- package/dist/esm/errors/node-ssl.error.d.ts.map +1 -0
- package/dist/esm/errors/node-ssl.error.js +7 -0
- package/dist/esm/errors/node-ssl.error.js.map +1 -0
- package/dist/esm/errors/subworkflow-operation.error.d.ts +7 -0
- package/dist/esm/errors/subworkflow-operation.error.d.ts.map +1 -0
- package/dist/esm/errors/subworkflow-operation.error.js +16 -0
- package/dist/esm/errors/subworkflow-operation.error.js.map +1 -0
- package/dist/esm/errors/trigger-close.error.d.ts +12 -0
- package/dist/esm/errors/trigger-close.error.d.ts.map +1 -0
- package/dist/esm/errors/trigger-close.error.js +10 -0
- package/dist/esm/errors/trigger-close.error.js.map +1 -0
- package/dist/esm/errors/webhook-taken.error.d.ts +5 -0
- package/dist/esm/errors/webhook-taken.error.d.ts.map +1 -0
- package/dist/esm/errors/webhook-taken.error.js +7 -0
- package/dist/esm/errors/webhook-taken.error.js.map +1 -0
- package/dist/esm/errors/workflow-activation.error.d.ts +20 -0
- package/dist/esm/errors/workflow-activation.error.d.ts.map +1 -0
- package/dist/{errors → esm/errors}/workflow-activation.error.js +12 -11
- package/dist/esm/errors/workflow-activation.error.js.map +1 -0
- package/dist/esm/errors/workflow-deactivation.error.d.ts +4 -0
- package/dist/esm/errors/workflow-deactivation.error.d.ts.map +1 -0
- package/dist/esm/errors/workflow-deactivation.error.js +4 -0
- package/dist/esm/errors/workflow-deactivation.error.js.map +1 -0
- package/dist/esm/errors/workflow-operation.error.d.ts +11 -0
- package/dist/esm/errors/workflow-operation.error.d.ts.map +1 -0
- package/dist/esm/errors/workflow-operation.error.js +18 -0
- package/dist/esm/errors/workflow-operation.error.js.map +1 -0
- package/dist/esm/execution-status.d.ts +3 -0
- package/dist/esm/execution-status.d.ts.map +1 -0
- package/dist/esm/execution-status.js +11 -0
- package/dist/esm/execution-status.js.map +1 -0
- package/dist/esm/expression-evaluator-proxy.d.ts +6 -0
- package/dist/esm/expression-evaluator-proxy.d.ts.map +1 -0
- package/dist/esm/expression-evaluator-proxy.js +15 -0
- package/dist/esm/expression-evaluator-proxy.js.map +1 -0
- package/dist/esm/expression-sandboxing.d.ts +5 -0
- package/dist/esm/expression-sandboxing.d.ts.map +1 -0
- package/dist/esm/expression-sandboxing.js +47 -0
- package/dist/esm/expression-sandboxing.js.map +1 -0
- package/dist/esm/expression.d.ts +46 -0
- package/dist/esm/expression.d.ts.map +1 -0
- package/dist/{expression.js → esm/expression.js} +125 -44
- package/dist/esm/expression.js.map +1 -0
- package/dist/esm/expressions/expression-helpers.d.ts +6 -0
- package/dist/esm/expressions/expression-helpers.d.ts.map +1 -0
- package/dist/esm/expressions/expression-helpers.js +10 -0
- package/dist/esm/expressions/expression-helpers.js.map +1 -0
- package/dist/esm/extensions/array-extensions.d.ts +33 -0
- package/dist/esm/extensions/array-extensions.d.ts.map +1 -0
- package/dist/{extensions → esm/extensions}/array-extensions.js +41 -42
- package/dist/esm/extensions/array-extensions.js.map +1 -0
- package/dist/esm/extensions/boolean-extensions.d.ts +6 -0
- package/dist/esm/extensions/boolean-extensions.d.ts.map +1 -0
- package/dist/{extensions → esm/extensions}/boolean-extensions.js +4 -10
- package/dist/esm/extensions/boolean-extensions.js.map +1 -0
- package/dist/esm/extensions/date-extensions.d.ts +3 -0
- package/dist/esm/extensions/date-extensions.d.ts.map +1 -0
- package/dist/{extensions → esm/extensions}/date-extensions.js +27 -29
- package/dist/esm/extensions/date-extensions.js.map +1 -0
- package/dist/esm/extensions/expression-extension.d.ts +32 -0
- package/dist/esm/extensions/expression-extension.d.ts.map +1 -0
- package/dist/esm/extensions/expression-extension.js +474 -0
- package/dist/esm/extensions/expression-extension.js.map +1 -0
- package/dist/esm/extensions/expression-parser.d.ts +14 -0
- package/dist/esm/extensions/expression-parser.d.ts.map +1 -0
- package/dist/{extensions → esm/extensions}/expression-parser.js +9 -11
- package/dist/esm/extensions/expression-parser.js.map +1 -0
- package/dist/esm/extensions/extended-functions.d.ts +28 -0
- package/dist/esm/extensions/extended-functions.d.ts.map +1 -0
- package/dist/{extensions → esm/extensions}/extended-functions.js +8 -10
- package/dist/esm/extensions/extended-functions.js.map +1 -0
- package/dist/esm/extensions/extensions.d.ts +42 -0
- package/dist/esm/extensions/extensions.d.ts.map +1 -0
- package/dist/esm/extensions/extensions.js +2 -0
- package/dist/esm/extensions/extensions.js.map +1 -0
- package/dist/esm/extensions/index.d.ts +3 -0
- package/dist/esm/extensions/index.d.ts.map +1 -0
- package/dist/esm/extensions/index.js +2 -0
- package/dist/esm/extensions/index.js.map +1 -0
- package/dist/esm/extensions/number-extensions.d.ts +27 -0
- package/dist/esm/extensions/number-extensions.d.ts.map +1 -0
- package/dist/{extensions → esm/extensions}/number-extensions.js +14 -15
- package/dist/esm/extensions/number-extensions.js.map +1 -0
- package/dist/esm/extensions/object-extensions.d.ts +46 -0
- package/dist/esm/extensions/object-extensions.d.ts.map +1 -0
- package/dist/{extensions → esm/extensions}/object-extensions.js +18 -21
- package/dist/esm/extensions/object-extensions.js.map +1 -0
- package/dist/esm/extensions/string-extensions.d.ts +38 -0
- package/dist/esm/extensions/string-extensions.d.ts.map +1 -0
- package/dist/{extensions → esm/extensions}/string-extensions.js +121 -40
- package/dist/esm/extensions/string-extensions.js.map +1 -0
- package/dist/esm/extensions/utils.d.ts +4 -0
- package/dist/esm/extensions/utils.d.ts.map +1 -0
- package/dist/esm/extensions/utils.js +27 -0
- package/dist/esm/extensions/utils.js.map +1 -0
- package/dist/esm/from-ai-parse-utils.d.ts +44 -0
- package/dist/esm/from-ai-parse-utils.d.ts.map +1 -0
- package/dist/{from-ai-parse-utils.js → esm/from-ai-parse-utils.js} +63 -18
- package/dist/esm/from-ai-parse-utils.js.map +1 -0
- package/dist/esm/global-state.d.ts +6 -0
- package/dist/esm/global-state.d.ts.map +1 -0
- package/dist/esm/global-state.js +9 -0
- package/dist/esm/global-state.js.map +1 -0
- package/dist/esm/graph/graph-utils.d.ts +57 -0
- package/dist/esm/graph/graph-utils.d.ts.map +1 -0
- package/dist/{graph → esm/graph}/graph-utils.js +35 -16
- package/dist/esm/graph/graph-utils.js.map +1 -0
- package/dist/esm/index.d.ts +49 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +33 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/interfaces.d.ts +2172 -0
- package/dist/esm/interfaces.d.ts.map +1 -0
- package/dist/{interfaces.js → esm/interfaces.js} +13 -11
- package/dist/esm/interfaces.js.map +1 -0
- package/dist/esm/logger-proxy.d.ts +7 -0
- package/dist/esm/logger-proxy.d.ts.map +1 -0
- package/dist/esm/logger-proxy.js +12 -0
- package/dist/esm/logger-proxy.js.map +1 -0
- package/dist/esm/message-event-bus.d.ts +107 -0
- package/dist/esm/message-event-bus.d.ts.map +1 -0
- package/dist/{message-event-bus.js → esm/message-event-bus.js} +26 -23
- package/dist/esm/message-event-bus.js.map +1 -0
- package/dist/esm/metadata-utils.d.ts +5 -0
- package/dist/esm/metadata-utils.d.ts.map +1 -0
- package/dist/{metadata-utils.js → esm/metadata-utils.js} +6 -7
- package/dist/esm/metadata-utils.js.map +1 -0
- package/dist/esm/native-methods/array.methods.d.ts +3 -0
- package/dist/esm/native-methods/array.methods.d.ts.map +1 -0
- package/dist/{native-methods → esm/native-methods}/array.methods.js +1 -4
- package/dist/esm/native-methods/array.methods.js.map +1 -0
- package/dist/esm/native-methods/boolean.methods.d.ts +3 -0
- package/dist/esm/native-methods/boolean.methods.d.ts.map +1 -0
- package/dist/{native-methods → esm/native-methods}/boolean.methods.js +1 -4
- package/dist/esm/native-methods/boolean.methods.js.map +1 -0
- package/dist/esm/native-methods/index.d.ts +4 -0
- package/dist/esm/native-methods/index.d.ts.map +1 -0
- package/dist/esm/native-methods/index.js +14 -0
- package/dist/esm/native-methods/index.js.map +1 -0
- package/dist/esm/native-methods/number.methods.d.ts +3 -0
- package/dist/esm/native-methods/number.methods.d.ts.map +1 -0
- package/dist/{native-methods → esm/native-methods}/number.methods.js +1 -4
- package/dist/esm/native-methods/number.methods.js.map +1 -0
- package/dist/esm/native-methods/object.methods.d.ts +3 -0
- package/dist/esm/native-methods/object.methods.d.ts.map +1 -0
- package/dist/esm/native-methods/object.methods.js +5 -0
- package/dist/esm/native-methods/object.methods.js.map +1 -0
- package/dist/esm/native-methods/string.methods.d.ts +3 -0
- package/dist/esm/native-methods/string.methods.d.ts.map +1 -0
- package/dist/{native-methods → esm/native-methods}/string.methods.js +1 -4
- package/dist/esm/native-methods/string.methods.js.map +1 -0
- package/dist/esm/node-helpers.d.ts +145 -0
- package/dist/esm/node-helpers.d.ts.map +1 -0
- package/dist/{node-helpers.js → esm/node-helpers.js} +302 -106
- package/dist/esm/node-helpers.js.map +1 -0
- package/dist/esm/node-parameters/filter-parameter.d.ts +21 -0
- package/dist/esm/node-parameters/filter-parameter.d.ts.map +1 -0
- package/dist/{node-parameters → esm/node-parameters}/filter-parameter.js +13 -51
- package/dist/esm/node-parameters/filter-parameter.js.map +1 -0
- package/dist/esm/node-parameters/rename-node-utils.d.ts +3 -0
- package/dist/esm/node-parameters/rename-node-utils.d.ts.map +1 -0
- package/dist/{node-parameters → esm/node-parameters}/rename-node-utils.js +4 -5
- package/dist/esm/node-parameters/rename-node-utils.js.map +1 -0
- package/dist/esm/node-reference-parser-utils.d.ts +20 -0
- package/dist/esm/node-reference-parser-utils.d.ts.map +1 -0
- package/dist/{node-reference-parser-utils.js → esm/node-reference-parser-utils.js} +135 -46
- package/dist/esm/node-reference-parser-utils.js.map +1 -0
- package/dist/esm/observable-object.d.ts +7 -0
- package/dist/esm/observable-object.d.ts.map +1 -0
- package/dist/{observable-object.js → esm/observable-object.js} +13 -5
- package/dist/esm/observable-object.js.map +1 -0
- package/dist/esm/result.d.ts +19 -0
- package/dist/esm/result.d.ts.map +1 -0
- package/dist/esm/result.js +25 -0
- package/dist/esm/result.js.map +1 -0
- package/dist/esm/telemetry-helpers.d.ts +45 -0
- package/dist/esm/telemetry-helpers.d.ts.map +1 -0
- package/dist/{telemetry-helpers.js → esm/telemetry-helpers.js} +67 -62
- package/dist/esm/telemetry-helpers.js.map +1 -0
- package/dist/esm/type-guards.d.ts +12 -0
- package/dist/esm/type-guards.d.ts.map +1 -0
- package/dist/esm/type-guards.js +33 -0
- package/dist/esm/type-guards.js.map +1 -0
- package/dist/esm/type-validation.d.ts +22 -0
- package/dist/esm/type-validation.d.ts.map +1 -0
- package/dist/{type-validation.js → esm/type-validation.js} +66 -78
- package/dist/esm/type-validation.js.map +1 -0
- package/dist/esm/typecheck.tsbuildinfo +1 -0
- package/dist/esm/utils.d.ts +94 -0
- package/dist/esm/utils.d.ts.map +1 -0
- package/dist/esm/utils.js +300 -0
- package/dist/esm/utils.js.map +1 -0
- package/dist/esm/versioned-node-type.d.ts +10 -0
- package/dist/esm/versioned-node-type.d.ts.map +1 -0
- package/dist/{versioned-node-type.js → esm/versioned-node-type.js} +4 -5
- package/dist/esm/versioned-node-type.js.map +1 -0
- package/dist/esm/workflow-data-proxy-env-provider.d.ts +25 -0
- package/dist/esm/workflow-data-proxy-env-provider.d.ts.map +1 -0
- package/dist/{workflow-data-proxy-env-provider.js → esm/workflow-data-proxy-env-provider.js} +22 -9
- package/dist/esm/workflow-data-proxy-env-provider.js.map +1 -0
- package/dist/esm/workflow-data-proxy-helpers.d.ts +3 -0
- package/dist/esm/workflow-data-proxy-helpers.d.ts.map +1 -0
- package/dist/esm/workflow-data-proxy-helpers.js +7 -0
- package/dist/esm/workflow-data-proxy-helpers.js.map +1 -0
- package/dist/esm/workflow-data-proxy.d.ts +80 -0
- package/dist/esm/workflow-data-proxy.d.ts.map +1 -0
- package/dist/{workflow-data-proxy.js → esm/workflow-data-proxy.js} +174 -109
- package/dist/esm/workflow-data-proxy.js.map +1 -0
- package/dist/esm/workflow.d.ts +157 -0
- package/dist/esm/workflow.d.ts.map +1 -0
- package/dist/{workflow.js → esm/workflow.js} +223 -73
- package/dist/esm/workflow.js.map +1 -0
- package/package.json +20 -16
- package/dist/augment-object.js.map +0 -1
- package/dist/build.tsbuildinfo +0 -1
- package/dist/constants.js +0 -89
- package/dist/constants.js.map +0 -1
- package/dist/cron.js.map +0 -1
- package/dist/deferred-promise.js +0 -12
- package/dist/deferred-promise.js.map +0 -1
- package/dist/errors/abstract/execution-base.error.js.map +0 -1
- package/dist/errors/abstract/node.error.d.ts +0 -12
- package/dist/errors/abstract/node.error.js.map +0 -1
- package/dist/errors/application.error.js +0 -24
- package/dist/errors/application.error.js.map +0 -1
- package/dist/errors/base/base.error.js.map +0 -1
- package/dist/errors/base/operational.error.js +0 -12
- package/dist/errors/base/operational.error.js.map +0 -1
- package/dist/errors/base/unexpected.error.js +0 -12
- package/dist/errors/base/unexpected.error.js.map +0 -1
- package/dist/errors/base/user.error.js +0 -12
- package/dist/errors/base/user.error.js.map +0 -1
- package/dist/errors/cli-subworkflow-operation.error.js +0 -8
- package/dist/errors/cli-subworkflow-operation.error.js.map +0 -1
- package/dist/errors/db-connection-timeout-error.js.map +0 -1
- package/dist/errors/ensure-error.d.ts +0 -1
- package/dist/errors/ensure-error.js +0 -11
- package/dist/errors/ensure-error.js.map +0 -1
- package/dist/errors/error.types.js +0 -3
- package/dist/errors/execution-cancelled.error.js +0 -14
- package/dist/errors/execution-cancelled.error.js.map +0 -1
- package/dist/errors/expression-extension.error.js +0 -8
- package/dist/errors/expression-extension.error.js.map +0 -1
- package/dist/errors/expression.error.js.map +0 -1
- package/dist/errors/index.js +0 -48
- package/dist/errors/index.js.map +0 -1
- package/dist/errors/node-api.error.js.map +0 -1
- package/dist/errors/node-operation.error.js.map +0 -1
- package/dist/errors/node-ssl.error.js +0 -11
- package/dist/errors/node-ssl.error.js.map +0 -1
- package/dist/errors/subworkflow-operation.error.js +0 -19
- package/dist/errors/subworkflow-operation.error.js.map +0 -1
- package/dist/errors/trigger-close.error.js +0 -13
- package/dist/errors/trigger-close.error.js.map +0 -1
- package/dist/errors/webhook-taken.error.js +0 -11
- package/dist/errors/webhook-taken.error.js.map +0 -1
- package/dist/errors/workflow-activation.error.js.map +0 -1
- package/dist/errors/workflow-deactivation.error.js +0 -8
- package/dist/errors/workflow-deactivation.error.js.map +0 -1
- package/dist/errors/workflow-operation.error.js +0 -17
- package/dist/errors/workflow-operation.error.js.map +0 -1
- package/dist/execution-status.js +0 -14
- package/dist/execution-status.js.map +0 -1
- package/dist/expression-evaluator-proxy.js +0 -20
- package/dist/expression-evaluator-proxy.js.map +0 -1
- package/dist/expression-sandboxing.js +0 -43
- package/dist/expression-sandboxing.js.map +0 -1
- package/dist/expression.js.map +0 -1
- package/dist/extensions/array-extensions.js.map +0 -1
- package/dist/extensions/boolean-extensions.js.map +0 -1
- package/dist/extensions/date-extensions.js.map +0 -1
- package/dist/extensions/expression-extension.js +0 -362
- package/dist/extensions/expression-extension.js.map +0 -1
- package/dist/extensions/expression-parser.js.map +0 -1
- package/dist/extensions/extended-functions.js.map +0 -1
- package/dist/extensions/extensions.js +0 -3
- package/dist/extensions/extensions.js.map +0 -1
- package/dist/extensions/index.js +0 -11
- package/dist/extensions/index.js.map +0 -1
- package/dist/extensions/number-extensions.js.map +0 -1
- package/dist/extensions/object-extensions.js.map +0 -1
- package/dist/extensions/string-extensions.js.map +0 -1
- package/dist/extensions/utils.js +0 -31
- package/dist/extensions/utils.js.map +0 -1
- package/dist/from-ai-parse-utils.d.ts +0 -12
- package/dist/from-ai-parse-utils.js.map +0 -1
- package/dist/global-state.js +0 -13
- package/dist/global-state.js.map +0 -1
- package/dist/graph/graph-utils.js.map +0 -1
- package/dist/index.js +0 -102
- package/dist/index.js.map +0 -1
- package/dist/interfaces.js.map +0 -1
- package/dist/logger-proxy.js +0 -16
- package/dist/logger-proxy.js.map +0 -1
- package/dist/message-event-bus.js.map +0 -1
- package/dist/metadata-utils.js.map +0 -1
- package/dist/native-methods/array.methods.js.map +0 -1
- package/dist/native-methods/boolean.methods.js.map +0 -1
- package/dist/native-methods/index.js +0 -17
- package/dist/native-methods/index.js.map +0 -1
- package/dist/native-methods/number.methods.js.map +0 -1
- package/dist/native-methods/object.methods.js +0 -8
- package/dist/native-methods/object.methods.js.map +0 -1
- package/dist/native-methods/string.methods.js.map +0 -1
- package/dist/node-helpers.js.map +0 -1
- package/dist/node-parameters/filter-parameter.js.map +0 -1
- package/dist/node-parameters/rename-node-utils.js.map +0 -1
- package/dist/node-reference-parser-utils.js.map +0 -1
- package/dist/observable-object.js.map +0 -1
- package/dist/result.js +0 -25
- package/dist/result.js.map +0 -1
- package/dist/telemetry-helpers.js.map +0 -1
- package/dist/type-guards.js +0 -46
- package/dist/type-guards.js.map +0 -1
- package/dist/type-validation.js.map +0 -1
- package/dist/utils.js +0 -245
- package/dist/utils.js.map +0 -1
- package/dist/versioned-node-type.js.map +0 -1
- package/dist/workflow-data-proxy-env-provider.d.ts +0 -7
- package/dist/workflow-data-proxy-env-provider.js.map +0 -1
- package/dist/workflow-data-proxy-helpers.js +0 -10
- package/dist/workflow-data-proxy-helpers.js.map +0 -1
- package/dist/workflow-data-proxy.js.map +0 -1
- package/dist/workflow.d.ts +0 -54
- package/dist/workflow.js.map +0 -1
|
@@ -0,0 +1,1189 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-this-alias */
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
+
}) : function(o, v) {
|
|
18
|
+
o["default"] = v;
|
|
19
|
+
});
|
|
20
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
21
|
+
var ownKeys = function(o) {
|
|
22
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
23
|
+
var ar = [];
|
|
24
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
25
|
+
return ar;
|
|
26
|
+
};
|
|
27
|
+
return ownKeys(o);
|
|
28
|
+
};
|
|
29
|
+
return function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
(function (factory) {
|
|
38
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
39
|
+
var v = factory(require, exports);
|
|
40
|
+
if (v !== undefined) module.exports = v;
|
|
41
|
+
}
|
|
42
|
+
else if (typeof define === "function" && define.amd) {
|
|
43
|
+
define(["require", "exports", "jmespath", "luxon", "./augment-object", "./constants", "./errors/application.error", "./errors/expression.error", "./global-state", "./interfaces", "./node-helpers", "./result", "./type-guards", "./utils", "./workflow-data-proxy-env-provider", "./workflow-data-proxy-helpers"], factory);
|
|
44
|
+
}
|
|
45
|
+
})(function (require, exports) {
|
|
46
|
+
"use strict";
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.WorkflowDataProxy = void 0;
|
|
49
|
+
const jmespath = __importStar(require("jmespath"));
|
|
50
|
+
const luxon_1 = require("luxon");
|
|
51
|
+
const augment_object_1 = require("./augment-object");
|
|
52
|
+
const constants_1 = require("./constants");
|
|
53
|
+
const application_error_1 = require("./errors/application.error");
|
|
54
|
+
const expression_error_1 = require("./errors/expression.error");
|
|
55
|
+
const global_state_1 = require("./global-state");
|
|
56
|
+
const interfaces_1 = require("./interfaces");
|
|
57
|
+
const NodeHelpers = __importStar(require("./node-helpers"));
|
|
58
|
+
const result_1 = require("./result");
|
|
59
|
+
const type_guards_1 = require("./type-guards");
|
|
60
|
+
const utils_1 = require("./utils");
|
|
61
|
+
const workflow_data_proxy_env_provider_1 = require("./workflow-data-proxy-env-provider");
|
|
62
|
+
const workflow_data_proxy_helpers_1 = require("./workflow-data-proxy-helpers");
|
|
63
|
+
const isScriptingNode = (nodeName, workflow) => {
|
|
64
|
+
const node = workflow.getNode(nodeName);
|
|
65
|
+
return node && constants_1.SCRIPTING_NODE_TYPES.includes(node.type);
|
|
66
|
+
};
|
|
67
|
+
const PAIRED_ITEM_METHOD = {
|
|
68
|
+
PAIRED_ITEM: 'pairedItem',
|
|
69
|
+
ITEM_MATCHING: 'itemMatching',
|
|
70
|
+
ITEM: 'item',
|
|
71
|
+
$GET_PAIRED_ITEM: '$getPairedItem',
|
|
72
|
+
};
|
|
73
|
+
class WorkflowDataProxy {
|
|
74
|
+
workflow;
|
|
75
|
+
runIndex;
|
|
76
|
+
itemIndex;
|
|
77
|
+
activeNodeName;
|
|
78
|
+
siblingParameters;
|
|
79
|
+
mode;
|
|
80
|
+
additionalKeys;
|
|
81
|
+
executeData;
|
|
82
|
+
defaultReturnRunIndex;
|
|
83
|
+
selfData;
|
|
84
|
+
contextNodeName;
|
|
85
|
+
envProviderState;
|
|
86
|
+
runExecutionData;
|
|
87
|
+
connectionInputData;
|
|
88
|
+
timezone;
|
|
89
|
+
// TODO: Clean that up at some point and move all the options into an options object
|
|
90
|
+
constructor(workflow, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, siblingParameters, mode, additionalKeys, executeData, defaultReturnRunIndex = -1, selfData = {}, contextNodeName = activeNodeName, envProviderState) {
|
|
91
|
+
this.workflow = workflow;
|
|
92
|
+
this.runIndex = runIndex;
|
|
93
|
+
this.itemIndex = itemIndex;
|
|
94
|
+
this.activeNodeName = activeNodeName;
|
|
95
|
+
this.siblingParameters = siblingParameters;
|
|
96
|
+
this.mode = mode;
|
|
97
|
+
this.additionalKeys = additionalKeys;
|
|
98
|
+
this.executeData = executeData;
|
|
99
|
+
this.defaultReturnRunIndex = defaultReturnRunIndex;
|
|
100
|
+
this.selfData = selfData;
|
|
101
|
+
this.contextNodeName = contextNodeName;
|
|
102
|
+
this.envProviderState = envProviderState;
|
|
103
|
+
this.runExecutionData = isScriptingNode(this.contextNodeName, workflow)
|
|
104
|
+
? runExecutionData !== null
|
|
105
|
+
? (0, augment_object_1.augmentObject)(runExecutionData)
|
|
106
|
+
: null
|
|
107
|
+
: runExecutionData;
|
|
108
|
+
this.connectionInputData = isScriptingNode(this.contextNodeName, workflow)
|
|
109
|
+
? (0, augment_object_1.augmentArray)(connectionInputData)
|
|
110
|
+
: connectionInputData;
|
|
111
|
+
this.timezone = workflow.settings?.timezone ?? (0, global_state_1.getGlobalState)().defaultTimezone;
|
|
112
|
+
luxon_1.Settings.defaultZone = this.timezone;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Returns a proxy which allows to query context data of a given node
|
|
116
|
+
*
|
|
117
|
+
* @private
|
|
118
|
+
* @param {string} nodeName The name of the node to get the context from
|
|
119
|
+
*/
|
|
120
|
+
nodeContextGetter(nodeName) {
|
|
121
|
+
const that = this;
|
|
122
|
+
const node = this.workflow.nodes[nodeName];
|
|
123
|
+
if (!that.runExecutionData?.executionData && that.connectionInputData.length > 0) {
|
|
124
|
+
return {}; // incoming connection has pinned data, so stub context object
|
|
125
|
+
}
|
|
126
|
+
if (!that.runExecutionData?.executionData && !that.runExecutionData?.resultData) {
|
|
127
|
+
throw new expression_error_1.ExpressionError("The workflow hasn't been executed yet, so you can't reference any context data", {
|
|
128
|
+
runIndex: that.runIndex,
|
|
129
|
+
itemIndex: that.itemIndex,
|
|
130
|
+
type: 'no_execution_data',
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
return new Proxy({}, {
|
|
134
|
+
has: () => true,
|
|
135
|
+
ownKeys(target) {
|
|
136
|
+
if (Reflect.ownKeys(target).length === 0) {
|
|
137
|
+
// Target object did not get set yet
|
|
138
|
+
Object.assign(target, NodeHelpers.getContext(that.runExecutionData, 'node', node));
|
|
139
|
+
}
|
|
140
|
+
return Reflect.ownKeys(target);
|
|
141
|
+
},
|
|
142
|
+
getOwnPropertyDescriptor() {
|
|
143
|
+
return {
|
|
144
|
+
enumerable: true,
|
|
145
|
+
configurable: true,
|
|
146
|
+
};
|
|
147
|
+
},
|
|
148
|
+
get(_, name) {
|
|
149
|
+
if (name === 'isProxy')
|
|
150
|
+
return true;
|
|
151
|
+
name = name.toString();
|
|
152
|
+
const contextData = NodeHelpers.getContext(that.runExecutionData, 'node', node);
|
|
153
|
+
return contextData[name];
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
selfGetter() {
|
|
158
|
+
const that = this;
|
|
159
|
+
return new Proxy({}, {
|
|
160
|
+
has: () => true,
|
|
161
|
+
ownKeys(target) {
|
|
162
|
+
return Reflect.ownKeys(target);
|
|
163
|
+
},
|
|
164
|
+
get(_, name) {
|
|
165
|
+
if (name === 'isProxy')
|
|
166
|
+
return true;
|
|
167
|
+
name = name.toString();
|
|
168
|
+
return that.selfData[name];
|
|
169
|
+
},
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
buildAgentToolInfo(node) {
|
|
173
|
+
const nodeType = this.workflow.nodeTypes.getByNameAndVersion(node.type, node.typeVersion);
|
|
174
|
+
const type = nodeType.description.displayName;
|
|
175
|
+
const params = NodeHelpers.getNodeParameters(nodeType.description.properties, node.parameters, true, false, node, nodeType.description);
|
|
176
|
+
const resourceKey = params?.resource;
|
|
177
|
+
const operationKey = params?.operation;
|
|
178
|
+
const resource = nodeType.description.properties
|
|
179
|
+
.find((nodeProperties) => nodeProperties.name === 'resource')
|
|
180
|
+
?.options?.find((option) => 'value' in option && option.value === resourceKey)?.name ??
|
|
181
|
+
null;
|
|
182
|
+
const operation = nodeType.description.properties
|
|
183
|
+
.find((nodeProperty) => nodeProperty.name === 'operation' &&
|
|
184
|
+
nodeProperty.displayOptions?.show?.resource?.some((y) => y === resourceKey))
|
|
185
|
+
?.options?.find((y) => 'value' in y && y.value === operationKey)?.name ?? null;
|
|
186
|
+
const hasCredentials = !(0, utils_1.isObjectEmpty)(node.credentials ?? {});
|
|
187
|
+
const hasValidCalendar = nodeType.description.name.includes('googleCalendar')
|
|
188
|
+
? (0, type_guards_1.isResourceLocatorValue)(node.parameters.calendar) && node.parameters.calendar.value !== ''
|
|
189
|
+
: undefined;
|
|
190
|
+
const aiDefinedFields = Object.entries(node.parameters)
|
|
191
|
+
.map(([key, value]) => [key, (0, type_guards_1.isResourceLocatorValue)(value) ? value.value : value])
|
|
192
|
+
.filter(([_, value]) => value?.toString().toLowerCase().includes('$fromai'))
|
|
193
|
+
.map(([key]) => nodeType.description.properties.find((property) => property.name === key)?.displayName);
|
|
194
|
+
return {
|
|
195
|
+
name: node.name,
|
|
196
|
+
type,
|
|
197
|
+
resource,
|
|
198
|
+
operation,
|
|
199
|
+
hasCredentials,
|
|
200
|
+
hasValidCalendar,
|
|
201
|
+
aiDefinedFields,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
agentInfo() {
|
|
205
|
+
const agentNode = this.workflow.getNode(this.activeNodeName);
|
|
206
|
+
if (!agentNode || agentNode.type !== constants_1.AGENT_LANGCHAIN_NODE_TYPE)
|
|
207
|
+
return undefined;
|
|
208
|
+
const connectedTools = this.workflow
|
|
209
|
+
.getParentNodes(this.activeNodeName, interfaces_1.NodeConnectionTypes.AiTool)
|
|
210
|
+
.map((nodeName) => this.workflow.getNode(nodeName))
|
|
211
|
+
.filter((node) => node);
|
|
212
|
+
const memoryConnectedToAgent = this.workflow.getParentNodes(this.activeNodeName, interfaces_1.NodeConnectionTypes.AiMemory).length > 0;
|
|
213
|
+
const allTools = this.workflow.queryNodes((nodeType) => {
|
|
214
|
+
return nodeType.description.name.toLowerCase().includes('tool');
|
|
215
|
+
});
|
|
216
|
+
const unconnectedTools = allTools
|
|
217
|
+
.filter((node) => this.workflow.getChildNodes(node.name, interfaces_1.NodeConnectionTypes.AiTool, 1).length === 0)
|
|
218
|
+
.filter((node) => !connectedTools.includes(node));
|
|
219
|
+
return {
|
|
220
|
+
memoryConnectedToAgent,
|
|
221
|
+
tools: [
|
|
222
|
+
...connectedTools.map((node) => ({ connected: true, ...this.buildAgentToolInfo(node) })),
|
|
223
|
+
...unconnectedTools.map((node) => ({ connected: false, ...this.buildAgentToolInfo(node) })),
|
|
224
|
+
],
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Returns a proxy which allows to query parameter data of a given node
|
|
229
|
+
*
|
|
230
|
+
* @private
|
|
231
|
+
* @param {string} nodeName The name of the node to query data from
|
|
232
|
+
* @param {boolean} [resolveValue=true] If the expression value should get resolved
|
|
233
|
+
*/
|
|
234
|
+
nodeParameterGetter(nodeName, resolveValue = true) {
|
|
235
|
+
const that = this;
|
|
236
|
+
const node = this.workflow.nodes[nodeName];
|
|
237
|
+
// `node` is `undefined` only in expressions in credentials
|
|
238
|
+
return new Proxy(node?.parameters ?? {}, {
|
|
239
|
+
has: () => true,
|
|
240
|
+
ownKeys(target) {
|
|
241
|
+
return Reflect.ownKeys(target);
|
|
242
|
+
},
|
|
243
|
+
getOwnPropertyDescriptor() {
|
|
244
|
+
return {
|
|
245
|
+
enumerable: true,
|
|
246
|
+
configurable: true,
|
|
247
|
+
};
|
|
248
|
+
},
|
|
249
|
+
get(target, name) {
|
|
250
|
+
if (name === 'isProxy')
|
|
251
|
+
return true;
|
|
252
|
+
if (name === 'toJSON')
|
|
253
|
+
return () => (0, utils_1.deepCopy)(target);
|
|
254
|
+
name = name.toString();
|
|
255
|
+
let returnValue;
|
|
256
|
+
if (name[0] === '&') {
|
|
257
|
+
const key = name.slice(1);
|
|
258
|
+
if (!that.siblingParameters.hasOwnProperty(key)) {
|
|
259
|
+
throw new application_error_1.ApplicationError('Could not find sibling parameter on node', {
|
|
260
|
+
extra: { nodeName, parameter: key },
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
returnValue = that.siblingParameters[key];
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
if (!node.parameters.hasOwnProperty(name)) {
|
|
267
|
+
// Parameter does not exist on node
|
|
268
|
+
return undefined;
|
|
269
|
+
}
|
|
270
|
+
returnValue = node.parameters[name];
|
|
271
|
+
}
|
|
272
|
+
// Avoid recursion
|
|
273
|
+
if (returnValue === `={{ $parameter.${name} }}`)
|
|
274
|
+
return undefined;
|
|
275
|
+
if ((0, type_guards_1.isResourceLocatorValue)(returnValue)) {
|
|
276
|
+
if (returnValue.__regex && typeof returnValue.value === 'string') {
|
|
277
|
+
const expr = new RegExp(returnValue.__regex);
|
|
278
|
+
const extracted = expr.exec(returnValue.value);
|
|
279
|
+
if (extracted && extracted.length >= 2) {
|
|
280
|
+
returnValue = extracted[1];
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
return returnValue.value;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
returnValue = returnValue.value;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
if (resolveValue && typeof returnValue === 'string' && returnValue.charAt(0) === '=') {
|
|
291
|
+
// The found value is an expression so resolve it
|
|
292
|
+
return that.workflow.expression.getParameterValue(returnValue, that.runExecutionData, that.runIndex, that.itemIndex, that.activeNodeName, that.connectionInputData, that.mode, that.additionalKeys, that.executeData, false, {}, that.contextNodeName);
|
|
293
|
+
}
|
|
294
|
+
return returnValue;
|
|
295
|
+
},
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
getNodeExecutionOrPinnedData({ nodeName, branchIndex, runIndex, shortSyntax = false, }) {
|
|
299
|
+
try {
|
|
300
|
+
return this.getNodeExecutionData(nodeName, shortSyntax, branchIndex, runIndex);
|
|
301
|
+
}
|
|
302
|
+
catch (e) {
|
|
303
|
+
const pinData = (0, workflow_data_proxy_helpers_1.getPinDataIfManualExecution)(this.workflow, nodeName, this.mode);
|
|
304
|
+
if (pinData) {
|
|
305
|
+
return pinData;
|
|
306
|
+
}
|
|
307
|
+
throw e;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Returns the node ExecutionData
|
|
312
|
+
*
|
|
313
|
+
* @private
|
|
314
|
+
* @param {string} nodeName The name of the node query data from
|
|
315
|
+
* @param {boolean} [shortSyntax=false] If short syntax got used
|
|
316
|
+
* @param {number} [outputIndex] The index of the output, if not given the first one gets used
|
|
317
|
+
* @param {number} [runIndex] The index of the run, if not given the current one does get used
|
|
318
|
+
*/
|
|
319
|
+
getNodeExecutionData(nodeName, shortSyntax = false, outputIndex, runIndex) {
|
|
320
|
+
const that = this;
|
|
321
|
+
let executionData;
|
|
322
|
+
if (!shortSyntax) {
|
|
323
|
+
// Long syntax got used to return data from node in path
|
|
324
|
+
if (that.runExecutionData === null) {
|
|
325
|
+
throw new expression_error_1.ExpressionError("The workflow hasn't been executed yet, so you can't reference any output data", {
|
|
326
|
+
runIndex: that.runIndex,
|
|
327
|
+
itemIndex: that.itemIndex,
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
if (!that.workflow.getNode(nodeName)) {
|
|
331
|
+
throw new expression_error_1.ExpressionError("Referenced node doesn't exist", {
|
|
332
|
+
runIndex: that.runIndex,
|
|
333
|
+
itemIndex: that.itemIndex,
|
|
334
|
+
nodeCause: nodeName,
|
|
335
|
+
descriptionKey: 'nodeNotFound',
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
if (!that.runExecutionData.resultData.runData.hasOwnProperty(nodeName) &&
|
|
339
|
+
!(0, workflow_data_proxy_helpers_1.getPinDataIfManualExecution)(that.workflow, nodeName, that.mode)) {
|
|
340
|
+
throw new expression_error_1.ExpressionError('Referenced node is unexecuted', {
|
|
341
|
+
runIndex: that.runIndex,
|
|
342
|
+
itemIndex: that.itemIndex,
|
|
343
|
+
type: 'no_node_execution_data',
|
|
344
|
+
descriptionKey: 'noNodeExecutionData',
|
|
345
|
+
nodeCause: nodeName,
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
runIndex = runIndex === undefined ? that.defaultReturnRunIndex : runIndex;
|
|
349
|
+
runIndex =
|
|
350
|
+
runIndex === -1 ? that.runExecutionData.resultData.runData[nodeName].length - 1 : runIndex;
|
|
351
|
+
if (that.runExecutionData.resultData.runData[nodeName].length <= runIndex) {
|
|
352
|
+
throw new expression_error_1.ExpressionError(`Run ${runIndex} of node "${nodeName}" not found`, {
|
|
353
|
+
runIndex: that.runIndex,
|
|
354
|
+
itemIndex: that.itemIndex,
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
const taskData = that.runExecutionData.resultData.runData[nodeName][runIndex].data;
|
|
358
|
+
if (!taskData.main?.length || taskData.main[0] === null) {
|
|
359
|
+
// throw new ApplicationError('No data found for item-index', { extra: { itemIndex } });
|
|
360
|
+
throw new expression_error_1.ExpressionError('No data found from `main` input', {
|
|
361
|
+
runIndex: that.runIndex,
|
|
362
|
+
itemIndex: that.itemIndex,
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
// Check from which output to read the data.
|
|
366
|
+
// Depends on how the nodes are connected.
|
|
367
|
+
// (example "IF" node. If node is connected to "true" or to "false" output)
|
|
368
|
+
if (outputIndex === undefined) {
|
|
369
|
+
const nodeConnection = that.workflow.getNodeConnectionIndexes(that.contextNodeName, nodeName, interfaces_1.NodeConnectionTypes.Main);
|
|
370
|
+
if (nodeConnection === undefined) {
|
|
371
|
+
throw new expression_error_1.ExpressionError(`connect "${that.contextNodeName}" to "${nodeName}"`, {
|
|
372
|
+
runIndex: that.runIndex,
|
|
373
|
+
itemIndex: that.itemIndex,
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
outputIndex = nodeConnection.sourceIndex;
|
|
377
|
+
}
|
|
378
|
+
if (outputIndex === undefined) {
|
|
379
|
+
outputIndex = 0;
|
|
380
|
+
}
|
|
381
|
+
if (taskData.main.length <= outputIndex) {
|
|
382
|
+
throw new expression_error_1.ExpressionError(`Node "${nodeName}" has no branch with index ${outputIndex}.`, {
|
|
383
|
+
runIndex: that.runIndex,
|
|
384
|
+
itemIndex: that.itemIndex,
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
executionData = taskData.main[outputIndex];
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
// Short syntax got used to return data from active node
|
|
391
|
+
executionData = that.connectionInputData;
|
|
392
|
+
}
|
|
393
|
+
return executionData;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Returns a proxy which allows to query data of a given node
|
|
397
|
+
*
|
|
398
|
+
* @private
|
|
399
|
+
* @param {string} nodeName The name of the node query data from
|
|
400
|
+
* @param {boolean} [shortSyntax=false] If short syntax got used
|
|
401
|
+
* @param {boolean} [throwOnMissingExecutionData=true] If an error should get thrown if no execution data is available
|
|
402
|
+
*/
|
|
403
|
+
nodeDataGetter(nodeName, shortSyntax = false, throwOnMissingExecutionData = true) {
|
|
404
|
+
const that = this;
|
|
405
|
+
const node = this.workflow.nodes[nodeName];
|
|
406
|
+
return new Proxy({ binary: undefined, data: undefined, json: undefined }, {
|
|
407
|
+
has: () => true,
|
|
408
|
+
get(target, name, receiver) {
|
|
409
|
+
if (name === 'isProxy')
|
|
410
|
+
return true;
|
|
411
|
+
name = name.toString();
|
|
412
|
+
if (!node) {
|
|
413
|
+
throw new expression_error_1.ExpressionError("Referenced node doesn't exist", {
|
|
414
|
+
runIndex: that.runIndex,
|
|
415
|
+
itemIndex: that.itemIndex,
|
|
416
|
+
nodeCause: nodeName,
|
|
417
|
+
descriptionKey: 'nodeNotFound',
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
if (['binary', 'data', 'json'].includes(name)) {
|
|
421
|
+
const executionData = that.getNodeExecutionOrPinnedData({
|
|
422
|
+
nodeName,
|
|
423
|
+
shortSyntax,
|
|
424
|
+
});
|
|
425
|
+
if (executionData.length === 0 && !throwOnMissingExecutionData) {
|
|
426
|
+
return undefined;
|
|
427
|
+
}
|
|
428
|
+
if (executionData.length === 0) {
|
|
429
|
+
if (that.workflow.getParentNodes(nodeName).length === 0) {
|
|
430
|
+
throw new expression_error_1.ExpressionError('No execution data available', {
|
|
431
|
+
messageTemplate: 'No execution data available to expression under ‘%%PARAMETER%%’',
|
|
432
|
+
descriptionKey: 'noInputConnection',
|
|
433
|
+
nodeCause: nodeName,
|
|
434
|
+
runIndex: that.runIndex,
|
|
435
|
+
itemIndex: that.itemIndex,
|
|
436
|
+
type: 'no_input_connection',
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
throw new expression_error_1.ExpressionError('No execution data available', {
|
|
440
|
+
runIndex: that.runIndex,
|
|
441
|
+
itemIndex: that.itemIndex,
|
|
442
|
+
type: 'no_execution_data',
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
if (executionData.length <= that.itemIndex) {
|
|
446
|
+
throw new expression_error_1.ExpressionError(`No data found for item-index: "${that.itemIndex}"`, {
|
|
447
|
+
runIndex: that.runIndex,
|
|
448
|
+
itemIndex: that.itemIndex,
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
if (['data', 'json'].includes(name)) {
|
|
452
|
+
// JSON-Data
|
|
453
|
+
return executionData[that.itemIndex].json;
|
|
454
|
+
}
|
|
455
|
+
if (name === 'binary') {
|
|
456
|
+
// Binary-Data
|
|
457
|
+
const returnData = {};
|
|
458
|
+
if (!executionData[that.itemIndex].binary) {
|
|
459
|
+
return returnData;
|
|
460
|
+
}
|
|
461
|
+
const binaryKeyData = executionData[that.itemIndex].binary;
|
|
462
|
+
for (const keyName of Object.keys(binaryKeyData)) {
|
|
463
|
+
returnData[keyName] = {};
|
|
464
|
+
const binaryData = binaryKeyData[keyName];
|
|
465
|
+
for (const propertyName in binaryData) {
|
|
466
|
+
if (propertyName === 'data') {
|
|
467
|
+
// Skip the data property
|
|
468
|
+
continue;
|
|
469
|
+
}
|
|
470
|
+
returnData[keyName][propertyName] = binaryData[propertyName];
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
return returnData;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
else if (name === 'context') {
|
|
477
|
+
return that.nodeContextGetter(nodeName);
|
|
478
|
+
}
|
|
479
|
+
else if (name === 'parameter') {
|
|
480
|
+
// Get node parameter data
|
|
481
|
+
return that.nodeParameterGetter(nodeName);
|
|
482
|
+
}
|
|
483
|
+
else if (name === 'runIndex') {
|
|
484
|
+
if (!that.runExecutionData?.resultData.runData[nodeName]) {
|
|
485
|
+
return -1;
|
|
486
|
+
}
|
|
487
|
+
return that.runExecutionData.resultData.runData[nodeName].length - 1;
|
|
488
|
+
}
|
|
489
|
+
return Reflect.get(target, name, receiver);
|
|
490
|
+
},
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
prevNodeGetter() {
|
|
494
|
+
const allowedValues = ['name', 'outputIndex', 'runIndex'];
|
|
495
|
+
const that = this;
|
|
496
|
+
return new Proxy({}, {
|
|
497
|
+
has: () => true,
|
|
498
|
+
ownKeys() {
|
|
499
|
+
return allowedValues;
|
|
500
|
+
},
|
|
501
|
+
getOwnPropertyDescriptor() {
|
|
502
|
+
return {
|
|
503
|
+
enumerable: true,
|
|
504
|
+
configurable: true,
|
|
505
|
+
};
|
|
506
|
+
},
|
|
507
|
+
get(target, name, receiver) {
|
|
508
|
+
if (name === 'isProxy')
|
|
509
|
+
return true;
|
|
510
|
+
if (!that.executeData?.source) {
|
|
511
|
+
// Means the previous node did not get executed yet
|
|
512
|
+
return undefined;
|
|
513
|
+
}
|
|
514
|
+
const sourceData = that.executeData.source.main[0];
|
|
515
|
+
if (name === 'name') {
|
|
516
|
+
return sourceData.previousNode;
|
|
517
|
+
}
|
|
518
|
+
if (name === 'outputIndex') {
|
|
519
|
+
return sourceData.previousNodeOutput || 0;
|
|
520
|
+
}
|
|
521
|
+
if (name === 'runIndex') {
|
|
522
|
+
return sourceData.previousNodeRun || 0;
|
|
523
|
+
}
|
|
524
|
+
return Reflect.get(target, name, receiver);
|
|
525
|
+
},
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Returns a proxy to query data from the workflow
|
|
530
|
+
*
|
|
531
|
+
* @private
|
|
532
|
+
*/
|
|
533
|
+
workflowGetter() {
|
|
534
|
+
const allowedValues = ['active', 'id', 'name'];
|
|
535
|
+
const that = this;
|
|
536
|
+
return new Proxy({}, {
|
|
537
|
+
has: () => true,
|
|
538
|
+
ownKeys() {
|
|
539
|
+
return allowedValues;
|
|
540
|
+
},
|
|
541
|
+
getOwnPropertyDescriptor() {
|
|
542
|
+
return {
|
|
543
|
+
enumerable: true,
|
|
544
|
+
configurable: true,
|
|
545
|
+
};
|
|
546
|
+
},
|
|
547
|
+
get(target, name, receiver) {
|
|
548
|
+
if (name === 'isProxy')
|
|
549
|
+
return true;
|
|
550
|
+
if (allowedValues.includes(name.toString())) {
|
|
551
|
+
const value = that.workflow[name];
|
|
552
|
+
if (value === undefined && name === 'id') {
|
|
553
|
+
throw new expression_error_1.ExpressionError('save workflow to view', {
|
|
554
|
+
description: 'Please save the workflow first to use $workflow',
|
|
555
|
+
runIndex: that.runIndex,
|
|
556
|
+
itemIndex: that.itemIndex,
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
return value;
|
|
560
|
+
}
|
|
561
|
+
return Reflect.get(target, name, receiver);
|
|
562
|
+
},
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Returns a proxy to query data of all nodes
|
|
567
|
+
*
|
|
568
|
+
* @private
|
|
569
|
+
*/
|
|
570
|
+
nodeGetter() {
|
|
571
|
+
const that = this;
|
|
572
|
+
return new Proxy({}, {
|
|
573
|
+
has: () => true,
|
|
574
|
+
get(_, name) {
|
|
575
|
+
if (name === 'isProxy')
|
|
576
|
+
return true;
|
|
577
|
+
const nodeName = name.toString();
|
|
578
|
+
if (that.workflow.getNode(nodeName) === null) {
|
|
579
|
+
throw new expression_error_1.ExpressionError("Referenced node doesn't exist", {
|
|
580
|
+
runIndex: that.runIndex,
|
|
581
|
+
itemIndex: that.itemIndex,
|
|
582
|
+
nodeCause: nodeName,
|
|
583
|
+
descriptionKey: 'nodeNotFound',
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
return that.nodeDataGetter(nodeName);
|
|
587
|
+
},
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Returns the data proxy object which allows to query data from current run
|
|
592
|
+
*
|
|
593
|
+
*/
|
|
594
|
+
getDataProxy(opts) {
|
|
595
|
+
const that = this;
|
|
596
|
+
// replacing proxies with the actual data.
|
|
597
|
+
const jmespathWrapper = (data, query) => {
|
|
598
|
+
if (typeof data !== 'object' || typeof query !== 'string') {
|
|
599
|
+
throw new expression_error_1.ExpressionError('expected two arguments (Object, string) for this function', {
|
|
600
|
+
runIndex: that.runIndex,
|
|
601
|
+
itemIndex: that.itemIndex,
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
if (!Array.isArray(data) && typeof data === 'object') {
|
|
605
|
+
return jmespath.search({ ...data }, query);
|
|
606
|
+
}
|
|
607
|
+
return jmespath.search(data, query);
|
|
608
|
+
};
|
|
609
|
+
const createExpressionError = (message, context) => {
|
|
610
|
+
if (isScriptingNode(that.activeNodeName, that.workflow) && context?.functionOverrides) {
|
|
611
|
+
// If the node in which the error is thrown is a function node,
|
|
612
|
+
// display a different error message in case there is one defined
|
|
613
|
+
message = context.functionOverrides.message || message;
|
|
614
|
+
context.description = context.functionOverrides.description || context.description;
|
|
615
|
+
// The error will be in the code and not on an expression on a parameter
|
|
616
|
+
// so remove the messageTemplate as it would overwrite the message
|
|
617
|
+
context.messageTemplate = undefined;
|
|
618
|
+
}
|
|
619
|
+
if (context?.nodeCause) {
|
|
620
|
+
const nodeName = context.nodeCause;
|
|
621
|
+
const pinData = (0, workflow_data_proxy_helpers_1.getPinDataIfManualExecution)(that.workflow, nodeName, that.mode);
|
|
622
|
+
if (pinData) {
|
|
623
|
+
if (!context) {
|
|
624
|
+
context = {};
|
|
625
|
+
}
|
|
626
|
+
message = `Unpin '${nodeName}' to execute`;
|
|
627
|
+
context.messageTemplate = undefined;
|
|
628
|
+
context.descriptionKey = 'pairedItemPinned';
|
|
629
|
+
}
|
|
630
|
+
if (context.moreInfoLink && (pinData || isScriptingNode(nodeName, that.workflow))) {
|
|
631
|
+
const moreInfoLink = ' <a target="_blank" href="https://docs.n8n.io/data/data-mapping/data-item-linking/item-linking-errors/">More info</a>';
|
|
632
|
+
context.description += moreInfoLink;
|
|
633
|
+
if (context.descriptionTemplate)
|
|
634
|
+
context.descriptionTemplate += moreInfoLink;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
return new expression_error_1.ExpressionError(message, {
|
|
638
|
+
runIndex: that.runIndex,
|
|
639
|
+
itemIndex: that.itemIndex,
|
|
640
|
+
...context,
|
|
641
|
+
});
|
|
642
|
+
};
|
|
643
|
+
const createInvalidPairedItemError = ({ nodeName }) => {
|
|
644
|
+
return createExpressionError("Can't get data for expression", {
|
|
645
|
+
messageTemplate: 'Expression info invalid',
|
|
646
|
+
functionality: 'pairedItem',
|
|
647
|
+
functionOverrides: {
|
|
648
|
+
message: "Can't get data",
|
|
649
|
+
},
|
|
650
|
+
nodeCause: nodeName,
|
|
651
|
+
descriptionKey: 'pairedItemInvalidInfo',
|
|
652
|
+
type: 'paired_item_invalid_info',
|
|
653
|
+
});
|
|
654
|
+
};
|
|
655
|
+
const createMissingPairedItemError = (nodeCause, usedMethodName = PAIRED_ITEM_METHOD.PAIRED_ITEM) => {
|
|
656
|
+
const pinData = (0, workflow_data_proxy_helpers_1.getPinDataIfManualExecution)(that.workflow, nodeCause, that.mode);
|
|
657
|
+
const message = pinData
|
|
658
|
+
? `Using the ${usedMethodName} method doesn't work with pinned data in this scenario. Please unpin '${nodeCause}' and try again.`
|
|
659
|
+
: `Paired item data for ${usedMethodName} from node '${nodeCause}' is unavailable. Ensure '${nodeCause}' is providing the required output.`;
|
|
660
|
+
return new expression_error_1.ExpressionError(message, {
|
|
661
|
+
runIndex: that.runIndex,
|
|
662
|
+
itemIndex: that.itemIndex,
|
|
663
|
+
functionality: 'pairedItem',
|
|
664
|
+
descriptionKey: isScriptingNode(nodeCause, that.workflow)
|
|
665
|
+
? 'pairedItemNoInfoCodeNode'
|
|
666
|
+
: 'pairedItemNoInfo',
|
|
667
|
+
nodeCause,
|
|
668
|
+
causeDetailed: `Missing pairedItem data (node '${nodeCause}' probably didn't supply it)`,
|
|
669
|
+
type: 'paired_item_no_info',
|
|
670
|
+
});
|
|
671
|
+
};
|
|
672
|
+
const createNoConnectionError = (nodeCause) => {
|
|
673
|
+
return createExpressionError('Invalid expression', {
|
|
674
|
+
messageTemplate: 'No path back to referenced node',
|
|
675
|
+
functionality: 'pairedItem',
|
|
676
|
+
descriptionKey: isScriptingNode(nodeCause, that.workflow)
|
|
677
|
+
? 'pairedItemNoConnectionCodeNode'
|
|
678
|
+
: 'pairedItemNoConnection',
|
|
679
|
+
type: 'paired_item_no_connection',
|
|
680
|
+
moreInfoLink: true,
|
|
681
|
+
nodeCause,
|
|
682
|
+
});
|
|
683
|
+
};
|
|
684
|
+
function createBranchNotFoundError(node, item, cause) {
|
|
685
|
+
return createExpressionError('Branch not found', {
|
|
686
|
+
messageTemplate: 'Paired item references non-existent branch',
|
|
687
|
+
functionality: 'pairedItem',
|
|
688
|
+
nodeCause: cause,
|
|
689
|
+
functionOverrides: { message: 'Invalid branch reference' },
|
|
690
|
+
description: `Item ${item} in node ${node} references a branch that doesn't exist.`,
|
|
691
|
+
type: 'paired_item_invalid_info',
|
|
692
|
+
});
|
|
693
|
+
}
|
|
694
|
+
function createPairedItemNotFound(destNode, cause) {
|
|
695
|
+
return createExpressionError('Paired item resolution failed', {
|
|
696
|
+
messageTemplate: 'Unable to find paired item source',
|
|
697
|
+
functionality: 'pairedItem',
|
|
698
|
+
nodeCause: cause,
|
|
699
|
+
functionOverrides: { message: 'Data not found' },
|
|
700
|
+
description: `Could not trace back to node '${destNode}'`,
|
|
701
|
+
type: 'paired_item_no_info',
|
|
702
|
+
moreInfoLink: true,
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
function createPairedItemMultipleItemsFound(destNode, itemIndex) {
|
|
706
|
+
return createExpressionError('Multiple matches found', {
|
|
707
|
+
messageTemplate: `Multiple matching items for item [${itemIndex}]`,
|
|
708
|
+
functionality: 'pairedItem',
|
|
709
|
+
functionOverrides: { message: 'Multiple matches' },
|
|
710
|
+
nodeCause: destNode,
|
|
711
|
+
descriptionKey: isScriptingNode(destNode, that.workflow)
|
|
712
|
+
? 'pairedItemMultipleMatchesCodeNode'
|
|
713
|
+
: 'pairedItemMultipleMatches',
|
|
714
|
+
type: 'paired_item_multiple_matches',
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
function normalizeInputs(pairedItem, sourceData) {
|
|
718
|
+
if (typeof pairedItem === 'number') {
|
|
719
|
+
pairedItem = { item: pairedItem };
|
|
720
|
+
}
|
|
721
|
+
const finalSource = pairedItem.sourceOverwrite || sourceData;
|
|
722
|
+
return [pairedItem, finalSource];
|
|
723
|
+
}
|
|
724
|
+
function pinDataToTask(pinData) {
|
|
725
|
+
if (!pinData)
|
|
726
|
+
return undefined;
|
|
727
|
+
return {
|
|
728
|
+
data: { main: [pinData] },
|
|
729
|
+
startTime: 0,
|
|
730
|
+
executionTime: 0,
|
|
731
|
+
executionIndex: 0,
|
|
732
|
+
source: [],
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
function getTaskData(source) {
|
|
736
|
+
return (that.runExecutionData?.resultData?.runData?.[source.previousNode]?.[source.previousNodeRun || 0] ??
|
|
737
|
+
pinDataToTask((0, workflow_data_proxy_helpers_1.getPinDataIfManualExecution)(that.workflow, source.previousNode, that.mode)));
|
|
738
|
+
}
|
|
739
|
+
function getNodeOutput(taskData, source, nodeCause) {
|
|
740
|
+
const outputIndex = source.previousNodeOutput || 0;
|
|
741
|
+
const outputs = taskData?.data?.main?.[outputIndex];
|
|
742
|
+
if (!outputs) {
|
|
743
|
+
throw createExpressionError('Can’t get data for expression', {
|
|
744
|
+
messageTemplate: 'Missing output data',
|
|
745
|
+
functionOverrides: { message: 'Missing output' },
|
|
746
|
+
nodeCause,
|
|
747
|
+
description: `Expected output #${outputIndex} from node ${source.previousNode}`,
|
|
748
|
+
type: 'internal',
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
return outputs;
|
|
752
|
+
}
|
|
753
|
+
const normalizePairedItem = (paired) => {
|
|
754
|
+
if (paired === null || paired === undefined) {
|
|
755
|
+
return [];
|
|
756
|
+
}
|
|
757
|
+
const pairedItems = Array.isArray(paired) ? paired : [paired];
|
|
758
|
+
return pairedItems.map((p) => (typeof p === 'number' ? { item: p } : p));
|
|
759
|
+
};
|
|
760
|
+
const getPairedItem = (destinationNodeName, incomingSourceData, initialPairedItem, usedMethodName = PAIRED_ITEM_METHOD.$GET_PAIRED_ITEM, nodeBeforeLast) => {
|
|
761
|
+
// Normalize inputs
|
|
762
|
+
const [pairedItem, sourceData] = normalizeInputs(initialPairedItem, incomingSourceData);
|
|
763
|
+
if (!sourceData) {
|
|
764
|
+
throw createPairedItemNotFound(destinationNodeName, nodeBeforeLast);
|
|
765
|
+
}
|
|
766
|
+
const taskData = getTaskData(sourceData);
|
|
767
|
+
const outputData = getNodeOutput(taskData, sourceData, nodeBeforeLast);
|
|
768
|
+
const item = outputData[pairedItem.item];
|
|
769
|
+
const sourceArray = taskData?.source ?? [];
|
|
770
|
+
// Done: reached the destination node in the ancestry chain
|
|
771
|
+
if (sourceData.previousNode === destinationNodeName) {
|
|
772
|
+
if (pairedItem.item >= outputData.length) {
|
|
773
|
+
throw createInvalidPairedItemError({ nodeName: sourceData.previousNode });
|
|
774
|
+
}
|
|
775
|
+
return item;
|
|
776
|
+
}
|
|
777
|
+
// Normalize paired item to always be IPairedItemData[]
|
|
778
|
+
const nextPairedItems = normalizePairedItem(item.pairedItem);
|
|
779
|
+
if (nextPairedItems.length === 0) {
|
|
780
|
+
throw createMissingPairedItemError(sourceData.previousNode, usedMethodName);
|
|
781
|
+
}
|
|
782
|
+
// Recursively traverse ancestry to find the destination node + paired item
|
|
783
|
+
const results = nextPairedItems.flatMap((nextPairedItem) => {
|
|
784
|
+
const inputIndex = nextPairedItem.input ?? 0;
|
|
785
|
+
if (inputIndex >= sourceArray.length)
|
|
786
|
+
return [];
|
|
787
|
+
const nextSource = nextPairedItem.sourceOverwrite ?? sourceArray[inputIndex];
|
|
788
|
+
try {
|
|
789
|
+
return (0, result_1.createResultOk)(getPairedItem(destinationNodeName, nextSource, { ...nextPairedItem, input: inputIndex }, usedMethodName, sourceData.previousNode));
|
|
790
|
+
}
|
|
791
|
+
catch (error) {
|
|
792
|
+
return (0, result_1.createResultError)(error);
|
|
793
|
+
}
|
|
794
|
+
});
|
|
795
|
+
if (results.every((result) => !result.ok)) {
|
|
796
|
+
throw results[0].error;
|
|
797
|
+
}
|
|
798
|
+
const matchedItems = results.filter((result) => result.ok).map((result) => result.result);
|
|
799
|
+
if (matchedItems.length === 0) {
|
|
800
|
+
if (sourceArray.length === 0)
|
|
801
|
+
throw createNoConnectionError(destinationNodeName);
|
|
802
|
+
throw createBranchNotFoundError(sourceData.previousNode, pairedItem.item, nodeBeforeLast);
|
|
803
|
+
}
|
|
804
|
+
const [first, ...rest] = matchedItems;
|
|
805
|
+
if (rest.some((r) => r !== first)) {
|
|
806
|
+
throw createPairedItemMultipleItemsFound(destinationNodeName, pairedItem.item);
|
|
807
|
+
}
|
|
808
|
+
return first;
|
|
809
|
+
};
|
|
810
|
+
const handleFromAi = (name, _description, _type = 'string', defaultValue) => {
|
|
811
|
+
const { itemIndex, runIndex } = that;
|
|
812
|
+
if (!name || name === '') {
|
|
813
|
+
throw new expression_error_1.ExpressionError("Add a key, e.g. $fromAI('placeholder_name')", {
|
|
814
|
+
runIndex,
|
|
815
|
+
itemIndex,
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
const nameValidationRegex = /^[a-zA-Z0-9_-]{0,64}$/;
|
|
819
|
+
if (!nameValidationRegex.test(name)) {
|
|
820
|
+
throw new expression_error_1.ExpressionError('Invalid parameter key, must be between 1 and 64 characters long and only contain lowercase letters, uppercase letters, numbers, underscores, and hyphens', {
|
|
821
|
+
runIndex,
|
|
822
|
+
itemIndex,
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
const inputData = that.runExecutionData?.resultData.runData[that.activeNodeName]?.[runIndex].inputOverride;
|
|
826
|
+
const placeholdersDataInputData = inputData?.[interfaces_1.NodeConnectionTypes.AiTool]?.[0]?.[itemIndex].json;
|
|
827
|
+
if (Boolean(!placeholdersDataInputData)) {
|
|
828
|
+
throw new expression_error_1.ExpressionError('No execution data available', {
|
|
829
|
+
runIndex,
|
|
830
|
+
itemIndex,
|
|
831
|
+
type: 'no_execution_data',
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
return (
|
|
835
|
+
// TS does not know that the key exists, we need to address this in refactor
|
|
836
|
+
placeholdersDataInputData?.query?.[name] ??
|
|
837
|
+
placeholdersDataInputData?.[name] ??
|
|
838
|
+
defaultValue);
|
|
839
|
+
};
|
|
840
|
+
const base = {
|
|
841
|
+
$: (nodeName) => {
|
|
842
|
+
if (!nodeName) {
|
|
843
|
+
throw createExpressionError('When calling $(), please specify a node');
|
|
844
|
+
}
|
|
845
|
+
const referencedNode = that.workflow.getNode(nodeName);
|
|
846
|
+
if (referencedNode === null) {
|
|
847
|
+
throw createExpressionError("Referenced node doesn't exist", {
|
|
848
|
+
runIndex: that.runIndex,
|
|
849
|
+
itemIndex: that.itemIndex,
|
|
850
|
+
nodeCause: nodeName,
|
|
851
|
+
descriptionKey: 'nodeNotFound',
|
|
852
|
+
});
|
|
853
|
+
}
|
|
854
|
+
const ensureNodeExecutionData = () => {
|
|
855
|
+
if (!that?.runExecutionData?.resultData?.runData.hasOwnProperty(nodeName) &&
|
|
856
|
+
!(0, workflow_data_proxy_helpers_1.getPinDataIfManualExecution)(that.workflow, nodeName, that.mode)) {
|
|
857
|
+
throw createExpressionError('Referenced node is unexecuted', {
|
|
858
|
+
runIndex: that.runIndex,
|
|
859
|
+
itemIndex: that.itemIndex,
|
|
860
|
+
type: 'no_node_execution_data',
|
|
861
|
+
descriptionKey: 'noNodeExecutionData',
|
|
862
|
+
nodeCause: nodeName,
|
|
863
|
+
});
|
|
864
|
+
}
|
|
865
|
+
};
|
|
866
|
+
return new Proxy({}, {
|
|
867
|
+
has: () => true,
|
|
868
|
+
ownKeys() {
|
|
869
|
+
return [
|
|
870
|
+
PAIRED_ITEM_METHOD.PAIRED_ITEM,
|
|
871
|
+
'isExecuted',
|
|
872
|
+
PAIRED_ITEM_METHOD.ITEM_MATCHING,
|
|
873
|
+
PAIRED_ITEM_METHOD.ITEM,
|
|
874
|
+
'first',
|
|
875
|
+
'last',
|
|
876
|
+
'all',
|
|
877
|
+
'context',
|
|
878
|
+
'params',
|
|
879
|
+
];
|
|
880
|
+
},
|
|
881
|
+
get(target, property, receiver) {
|
|
882
|
+
if (property === 'isProxy')
|
|
883
|
+
return true;
|
|
884
|
+
if (property === 'isExecuted') {
|
|
885
|
+
return (that?.runExecutionData?.resultData?.runData.hasOwnProperty(nodeName) ?? false);
|
|
886
|
+
}
|
|
887
|
+
if (property === PAIRED_ITEM_METHOD.PAIRED_ITEM ||
|
|
888
|
+
property === PAIRED_ITEM_METHOD.ITEM_MATCHING ||
|
|
889
|
+
property === PAIRED_ITEM_METHOD.ITEM) {
|
|
890
|
+
// Before resolving the pairedItem make sure that the requested node comes in the
|
|
891
|
+
// graph before the current one
|
|
892
|
+
const activeNode = that.workflow.getNode(that.activeNodeName);
|
|
893
|
+
let contextNode = that.contextNodeName;
|
|
894
|
+
if (activeNode) {
|
|
895
|
+
const parentMainInputNode = that.workflow.getParentMainInputNode(activeNode);
|
|
896
|
+
contextNode = parentMainInputNode.name ?? contextNode;
|
|
897
|
+
}
|
|
898
|
+
const parentNodes = that.workflow.getParentNodes(contextNode);
|
|
899
|
+
if (!parentNodes.includes(nodeName)) {
|
|
900
|
+
throw createNoConnectionError(nodeName);
|
|
901
|
+
}
|
|
902
|
+
ensureNodeExecutionData();
|
|
903
|
+
const pairedItemMethod = (itemIndex) => {
|
|
904
|
+
if (itemIndex === undefined) {
|
|
905
|
+
if (property === PAIRED_ITEM_METHOD.ITEM_MATCHING) {
|
|
906
|
+
throw createExpressionError('Missing item index for .itemMatching()', {
|
|
907
|
+
itemIndex,
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
itemIndex = that.itemIndex;
|
|
911
|
+
}
|
|
912
|
+
if (!that.connectionInputData.length) {
|
|
913
|
+
const pinnedData = (0, workflow_data_proxy_helpers_1.getPinDataIfManualExecution)(that.workflow, nodeName, that.mode);
|
|
914
|
+
if (pinnedData) {
|
|
915
|
+
return pinnedData[itemIndex];
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
const executionData = that.connectionInputData;
|
|
919
|
+
const input = executionData?.[itemIndex];
|
|
920
|
+
if (!input) {
|
|
921
|
+
throw createExpressionError('Can’t get data for expression', {
|
|
922
|
+
messageTemplate: 'Can’t get data for expression under ‘%%PARAMETER%%’ field',
|
|
923
|
+
functionality: 'pairedItem',
|
|
924
|
+
functionOverrides: {
|
|
925
|
+
description: `Some intermediate nodes between ‘<strong>${nodeName}</strong>‘ and ‘<strong>${that.activeNodeName}</strong>‘ have not executed yet.`,
|
|
926
|
+
message: 'Can’t get data',
|
|
927
|
+
},
|
|
928
|
+
description: `Some intermediate nodes between ‘<strong>${nodeName}</strong>‘ and ‘<strong>${that.activeNodeName}</strong>‘ have not executed yet.`,
|
|
929
|
+
causeDetailed: `pairedItem can\'t be found when intermediate nodes between ‘<strong>${nodeName}</strong>‘ and ‘<strong>${that.activeNodeName}</strong> have not executed yet.`,
|
|
930
|
+
itemIndex,
|
|
931
|
+
type: 'paired_item_intermediate_nodes',
|
|
932
|
+
});
|
|
933
|
+
}
|
|
934
|
+
// As we operate on the incoming item we can be sure that pairedItem is not an
|
|
935
|
+
// array. After all can it only come from exactly one previous node via a certain
|
|
936
|
+
// input. For that reason do we not have to consider the array case.
|
|
937
|
+
const pairedItem = input.pairedItem;
|
|
938
|
+
if (pairedItem === undefined) {
|
|
939
|
+
throw createMissingPairedItemError(that.activeNodeName, property);
|
|
940
|
+
}
|
|
941
|
+
if (!that.executeData?.source) {
|
|
942
|
+
throw createExpressionError('Can’t get data for expression', {
|
|
943
|
+
messageTemplate: 'Can’t get data for expression under ‘%%PARAMETER%%’ field',
|
|
944
|
+
functionality: 'pairedItem',
|
|
945
|
+
functionOverrides: {
|
|
946
|
+
message: 'Can’t get data',
|
|
947
|
+
},
|
|
948
|
+
description: 'Apologies, this is an internal error. See details for more information',
|
|
949
|
+
causeDetailed: 'Missing sourceData (probably an internal error)',
|
|
950
|
+
itemIndex,
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
const sourceData = that.executeData.source.main[pairedItem.input || 0] ??
|
|
954
|
+
that.executeData.source.main[0];
|
|
955
|
+
return getPairedItem(nodeName, sourceData, pairedItem, property);
|
|
956
|
+
};
|
|
957
|
+
if (property === PAIRED_ITEM_METHOD.ITEM) {
|
|
958
|
+
return pairedItemMethod();
|
|
959
|
+
}
|
|
960
|
+
return pairedItemMethod;
|
|
961
|
+
}
|
|
962
|
+
if (property === 'first') {
|
|
963
|
+
ensureNodeExecutionData();
|
|
964
|
+
return (branchIndex, runIndex) => {
|
|
965
|
+
branchIndex =
|
|
966
|
+
branchIndex ??
|
|
967
|
+
// default to the output the active node is connected to
|
|
968
|
+
that.workflow.getNodeConnectionIndexes(that.activeNodeName, nodeName)
|
|
969
|
+
?.sourceIndex ??
|
|
970
|
+
0;
|
|
971
|
+
const executionData = that.getNodeExecutionOrPinnedData({
|
|
972
|
+
nodeName,
|
|
973
|
+
branchIndex,
|
|
974
|
+
runIndex,
|
|
975
|
+
});
|
|
976
|
+
if (executionData[0])
|
|
977
|
+
return executionData[0];
|
|
978
|
+
return undefined;
|
|
979
|
+
};
|
|
980
|
+
}
|
|
981
|
+
if (property === 'last') {
|
|
982
|
+
ensureNodeExecutionData();
|
|
983
|
+
return (branchIndex, runIndex) => {
|
|
984
|
+
branchIndex =
|
|
985
|
+
branchIndex ??
|
|
986
|
+
// default to the output the active node is connected to
|
|
987
|
+
that.workflow.getNodeConnectionIndexes(that.activeNodeName, nodeName)
|
|
988
|
+
?.sourceIndex ??
|
|
989
|
+
0;
|
|
990
|
+
const executionData = that.getNodeExecutionOrPinnedData({
|
|
991
|
+
nodeName,
|
|
992
|
+
branchIndex,
|
|
993
|
+
runIndex,
|
|
994
|
+
});
|
|
995
|
+
if (!executionData.length)
|
|
996
|
+
return undefined;
|
|
997
|
+
if (executionData[executionData.length - 1]) {
|
|
998
|
+
return executionData[executionData.length - 1];
|
|
999
|
+
}
|
|
1000
|
+
return undefined;
|
|
1001
|
+
};
|
|
1002
|
+
}
|
|
1003
|
+
if (property === 'all') {
|
|
1004
|
+
ensureNodeExecutionData();
|
|
1005
|
+
return (branchIndex, runIndex) => {
|
|
1006
|
+
branchIndex =
|
|
1007
|
+
branchIndex ??
|
|
1008
|
+
// default to the output the active node is connected to
|
|
1009
|
+
that.workflow.getNodeConnectionIndexes(that.activeNodeName, nodeName)
|
|
1010
|
+
?.sourceIndex ??
|
|
1011
|
+
0;
|
|
1012
|
+
return that.getNodeExecutionOrPinnedData({ nodeName, branchIndex, runIndex });
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
if (property === 'context') {
|
|
1016
|
+
return that.nodeContextGetter(nodeName);
|
|
1017
|
+
}
|
|
1018
|
+
if (property === 'params') {
|
|
1019
|
+
return that.workflow.getNode(nodeName)?.parameters;
|
|
1020
|
+
}
|
|
1021
|
+
return Reflect.get(target, property, receiver);
|
|
1022
|
+
},
|
|
1023
|
+
});
|
|
1024
|
+
},
|
|
1025
|
+
$input: new Proxy({}, {
|
|
1026
|
+
has: () => true,
|
|
1027
|
+
ownKeys() {
|
|
1028
|
+
return ['all', 'context', 'first', 'item', 'last', 'params'];
|
|
1029
|
+
},
|
|
1030
|
+
getOwnPropertyDescriptor() {
|
|
1031
|
+
return {
|
|
1032
|
+
enumerable: true,
|
|
1033
|
+
configurable: true,
|
|
1034
|
+
};
|
|
1035
|
+
},
|
|
1036
|
+
get(target, property, receiver) {
|
|
1037
|
+
if (property === 'isProxy')
|
|
1038
|
+
return true;
|
|
1039
|
+
if (that.connectionInputData.length === 0) {
|
|
1040
|
+
throw createExpressionError('No execution data available', {
|
|
1041
|
+
runIndex: that.runIndex,
|
|
1042
|
+
itemIndex: that.itemIndex,
|
|
1043
|
+
type: 'no_execution_data',
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
if (property === 'item') {
|
|
1047
|
+
return that.connectionInputData[that.itemIndex];
|
|
1048
|
+
}
|
|
1049
|
+
if (property === 'first') {
|
|
1050
|
+
return (...args) => {
|
|
1051
|
+
if (args.length) {
|
|
1052
|
+
throw createExpressionError('$input.first() should have no arguments');
|
|
1053
|
+
}
|
|
1054
|
+
const result = that.connectionInputData;
|
|
1055
|
+
if (result[0]) {
|
|
1056
|
+
return result[0];
|
|
1057
|
+
}
|
|
1058
|
+
return undefined;
|
|
1059
|
+
};
|
|
1060
|
+
}
|
|
1061
|
+
if (property === 'last') {
|
|
1062
|
+
return (...args) => {
|
|
1063
|
+
if (args.length) {
|
|
1064
|
+
throw createExpressionError('$input.last() should have no arguments');
|
|
1065
|
+
}
|
|
1066
|
+
const result = that.connectionInputData;
|
|
1067
|
+
if (result.length && result[result.length - 1]) {
|
|
1068
|
+
return result[result.length - 1];
|
|
1069
|
+
}
|
|
1070
|
+
return undefined;
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
if (property === 'all') {
|
|
1074
|
+
return () => {
|
|
1075
|
+
const result = that.connectionInputData;
|
|
1076
|
+
if (result.length) {
|
|
1077
|
+
return result;
|
|
1078
|
+
}
|
|
1079
|
+
return [];
|
|
1080
|
+
};
|
|
1081
|
+
}
|
|
1082
|
+
if (['context', 'params'].includes(property)) {
|
|
1083
|
+
// For the following properties we need the source data so fail in case it is missing
|
|
1084
|
+
// for some reason (even though that should actually never happen)
|
|
1085
|
+
if (!that.executeData?.source) {
|
|
1086
|
+
throw createExpressionError('Can’t get data for expression', {
|
|
1087
|
+
messageTemplate: 'Can’t get data for expression under ‘%%PARAMETER%%’ field',
|
|
1088
|
+
functionOverrides: {
|
|
1089
|
+
message: 'Can’t get data',
|
|
1090
|
+
},
|
|
1091
|
+
description: 'Apologies, this is an internal error. See details for more information',
|
|
1092
|
+
causeDetailed: 'Missing sourceData (probably an internal error)',
|
|
1093
|
+
runIndex: that.runIndex,
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
1096
|
+
const sourceData = that.executeData.source.main[0];
|
|
1097
|
+
if (property === 'context') {
|
|
1098
|
+
return that.nodeContextGetter(sourceData.previousNode);
|
|
1099
|
+
}
|
|
1100
|
+
if (property === 'params') {
|
|
1101
|
+
return that.workflow.getNode(sourceData.previousNode)?.parameters;
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
return Reflect.get(target, property, receiver);
|
|
1105
|
+
},
|
|
1106
|
+
}),
|
|
1107
|
+
$binary: {}, // Placeholder
|
|
1108
|
+
$data: {}, // Placeholder
|
|
1109
|
+
$env: (0, workflow_data_proxy_env_provider_1.createEnvProvider)(that.runIndex, that.itemIndex, that.envProviderState ?? (0, workflow_data_proxy_env_provider_1.createEnvProviderState)()),
|
|
1110
|
+
$evaluateExpression: (expression, itemIndex) => {
|
|
1111
|
+
itemIndex = itemIndex || that.itemIndex;
|
|
1112
|
+
return that.workflow.expression.getParameterValue(`=${expression}`, that.runExecutionData, that.runIndex, itemIndex, that.activeNodeName, that.connectionInputData, that.mode, that.additionalKeys, that.executeData, false, {}, that.contextNodeName);
|
|
1113
|
+
},
|
|
1114
|
+
$item: (itemIndex, runIndex) => {
|
|
1115
|
+
const defaultReturnRunIndex = runIndex === undefined ? -1 : runIndex;
|
|
1116
|
+
const dataProxy = new WorkflowDataProxy(this.workflow, this.runExecutionData, this.runIndex, itemIndex, this.activeNodeName, this.connectionInputData, that.siblingParameters, that.mode, that.additionalKeys, that.executeData, defaultReturnRunIndex, {}, that.contextNodeName);
|
|
1117
|
+
return dataProxy.getDataProxy();
|
|
1118
|
+
},
|
|
1119
|
+
$fromAI: handleFromAi,
|
|
1120
|
+
// Make sure mis-capitalized $fromAI is handled correctly even though we don't auto-complete it
|
|
1121
|
+
$fromai: handleFromAi,
|
|
1122
|
+
$fromAi: handleFromAi,
|
|
1123
|
+
$items: (nodeName, outputIndex, runIndex) => {
|
|
1124
|
+
if (nodeName === undefined) {
|
|
1125
|
+
nodeName = that.prevNodeGetter().name;
|
|
1126
|
+
const node = this.workflow.nodes[nodeName];
|
|
1127
|
+
let result = that.connectionInputData;
|
|
1128
|
+
if (node.executeOnce === true) {
|
|
1129
|
+
result = result.slice(0, 1);
|
|
1130
|
+
}
|
|
1131
|
+
if (result.length) {
|
|
1132
|
+
return result;
|
|
1133
|
+
}
|
|
1134
|
+
return [];
|
|
1135
|
+
}
|
|
1136
|
+
outputIndex = outputIndex || 0;
|
|
1137
|
+
runIndex = runIndex === undefined ? -1 : runIndex;
|
|
1138
|
+
return that.getNodeExecutionData(nodeName, false, outputIndex, runIndex);
|
|
1139
|
+
},
|
|
1140
|
+
$json: {}, // Placeholder
|
|
1141
|
+
$node: this.nodeGetter(),
|
|
1142
|
+
$self: this.selfGetter(),
|
|
1143
|
+
$parameter: this.nodeParameterGetter(this.activeNodeName),
|
|
1144
|
+
$rawParameter: this.nodeParameterGetter(this.activeNodeName, false),
|
|
1145
|
+
$prevNode: this.prevNodeGetter(),
|
|
1146
|
+
$runIndex: this.runIndex,
|
|
1147
|
+
$mode: this.mode,
|
|
1148
|
+
$workflow: this.workflowGetter(),
|
|
1149
|
+
$itemIndex: this.itemIndex,
|
|
1150
|
+
$now: luxon_1.DateTime.now(),
|
|
1151
|
+
$today: luxon_1.DateTime.now().set({ hour: 0, minute: 0, second: 0, millisecond: 0 }),
|
|
1152
|
+
$jmesPath: jmespathWrapper,
|
|
1153
|
+
DateTime: luxon_1.DateTime,
|
|
1154
|
+
Interval: luxon_1.Interval,
|
|
1155
|
+
Duration: luxon_1.Duration,
|
|
1156
|
+
...that.additionalKeys,
|
|
1157
|
+
$getPairedItem: getPairedItem,
|
|
1158
|
+
// deprecated
|
|
1159
|
+
$jmespath: jmespathWrapper,
|
|
1160
|
+
$position: this.itemIndex,
|
|
1161
|
+
$thisItem: that.connectionInputData[that.itemIndex],
|
|
1162
|
+
$thisItemIndex: this.itemIndex,
|
|
1163
|
+
$thisRunIndex: this.runIndex,
|
|
1164
|
+
$nodeVersion: that.workflow.getNode(that.activeNodeName)?.typeVersion,
|
|
1165
|
+
$nodeId: that.workflow.getNode(that.activeNodeName)?.id,
|
|
1166
|
+
$agentInfo: this.agentInfo(),
|
|
1167
|
+
$webhookId: that.workflow.getNode(that.activeNodeName)?.webhookId,
|
|
1168
|
+
};
|
|
1169
|
+
const throwOnMissingExecutionData = opts?.throwOnMissingExecutionData ?? true;
|
|
1170
|
+
return new Proxy(base, {
|
|
1171
|
+
has: () => true,
|
|
1172
|
+
get(target, name, receiver) {
|
|
1173
|
+
if (name === 'isProxy')
|
|
1174
|
+
return true;
|
|
1175
|
+
if (['$data', '$json'].includes(name)) {
|
|
1176
|
+
return that.nodeDataGetter(that.contextNodeName, true, throwOnMissingExecutionData)?.json;
|
|
1177
|
+
}
|
|
1178
|
+
if (name === '$binary') {
|
|
1179
|
+
return that.nodeDataGetter(that.contextNodeName, true, throwOnMissingExecutionData)
|
|
1180
|
+
?.binary;
|
|
1181
|
+
}
|
|
1182
|
+
return Reflect.get(target, name, receiver);
|
|
1183
|
+
},
|
|
1184
|
+
});
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
exports.WorkflowDataProxy = WorkflowDataProxy;
|
|
1188
|
+
});
|
|
1189
|
+
//# sourceMappingURL=workflow-data-proxy.js.map
|