n8n-workflow 2.31.1 → 2.32.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/cjs/augment-object.js +136 -146
- package/dist/cjs/augment-object.js.map +1 -1
- package/dist/cjs/build.tsbuildinfo +1 -1
- package/dist/cjs/common/find-ai-root-node-names.js +36 -46
- package/dist/cjs/common/find-ai-root-node-names.js.map +1 -1
- package/dist/cjs/common/get-child-nodes.js +8 -18
- package/dist/cjs/common/get-child-nodes.js.map +1 -1
- package/dist/cjs/common/get-connected-nodes.js +84 -94
- package/dist/cjs/common/get-connected-nodes.js.map +1 -1
- package/dist/cjs/common/get-node-by-name.js +16 -26
- package/dist/cjs/common/get-node-by-name.js.map +1 -1
- package/dist/cjs/common/get-parent-nodes.js +14 -24
- package/dist/cjs/common/get-parent-nodes.js.map +1 -1
- package/dist/cjs/common/index.js +9 -19
- package/dist/cjs/common/index.js.map +1 -1
- package/dist/cjs/common/map-connections-by-destination.js +31 -41
- package/dist/cjs/common/map-connections-by-destination.js.map +1 -1
- package/dist/cjs/common/resolve-variables.d.ts +8 -0
- package/dist/cjs/common/resolve-variables.d.ts.map +1 -1
- package/dist/cjs/common/resolve-variables.js +46 -33
- package/dist/cjs/common/resolve-variables.js.map +1 -1
- package/dist/cjs/connections-diff.js +58 -68
- package/dist/cjs/connections-diff.js.map +1 -1
- package/dist/cjs/constants.d.ts +3 -3
- package/dist/cjs/constants.d.ts.map +1 -1
- package/dist/cjs/constants.js +157 -166
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/credential-domain-restrictions.js +153 -163
- package/dist/cjs/credential-domain-restrictions.js.map +1 -1
- package/dist/cjs/cron.d.ts.map +1 -1
- package/dist/cjs/cron.js +25 -35
- package/dist/cjs/cron.js.map +1 -1
- package/dist/cjs/data-table.types.js +10 -20
- package/dist/cjs/data-table.types.js.map +1 -1
- package/dist/cjs/dynamic-credentials-helpers.js +93 -103
- package/dist/cjs/dynamic-credentials-helpers.js.map +1 -1
- package/dist/cjs/errors/abstract/execution-base.error.d.ts.map +1 -1
- package/dist/cjs/errors/abstract/execution-base.error.js +41 -51
- package/dist/cjs/errors/abstract/execution-base.error.js.map +1 -1
- package/dist/cjs/errors/abstract/node.error.d.ts.map +1 -1
- package/dist/cjs/errors/abstract/node.error.js +142 -152
- package/dist/cjs/errors/abstract/node.error.js.map +1 -1
- package/dist/cjs/errors/base/base.error.d.ts.map +1 -1
- package/dist/cjs/errors/base/base.error.js +35 -45
- package/dist/cjs/errors/base/base.error.js.map +1 -1
- package/dist/cjs/errors/base/operational.error.d.ts.map +1 -1
- package/dist/cjs/errors/base/operational.error.js +17 -27
- package/dist/cjs/errors/base/operational.error.js.map +1 -1
- package/dist/cjs/errors/base/unexpected.error.d.ts.map +1 -1
- package/dist/cjs/errors/base/unexpected.error.js +17 -27
- package/dist/cjs/errors/base/unexpected.error.js.map +1 -1
- package/dist/cjs/errors/base/user.error.d.ts.map +1 -1
- package/dist/cjs/errors/base/user.error.js +17 -27
- package/dist/cjs/errors/base/user.error.js.map +1 -1
- package/dist/cjs/errors/cli-subworkflow-operation.error.js +7 -17
- package/dist/cjs/errors/cli-subworkflow-operation.error.js.map +1 -1
- package/dist/cjs/errors/db-connection-timeout-error.d.ts.map +1 -1
- package/dist/cjs/errors/db-connection-timeout-error.js +11 -21
- package/dist/cjs/errors/db-connection-timeout-error.js.map +1 -1
- package/dist/cjs/errors/execution-cancelled.error.d.ts.map +1 -1
- package/dist/cjs/errors/execution-cancelled.error.js +33 -43
- package/dist/cjs/errors/execution-cancelled.error.js.map +1 -1
- package/dist/cjs/errors/expression-class-extension.error.d.ts.map +1 -1
- package/dist/cjs/errors/expression-class-extension.error.js +9 -19
- package/dist/cjs/errors/expression-class-extension.error.js.map +1 -1
- package/dist/cjs/errors/expression-computed-destructuring.error.d.ts.map +1 -1
- package/dist/cjs/errors/expression-computed-destructuring.error.js +9 -19
- package/dist/cjs/errors/expression-computed-destructuring.error.js.map +1 -1
- package/dist/cjs/errors/expression-destructuring.error.d.ts.map +1 -1
- package/dist/cjs/errors/expression-destructuring.error.js +9 -19
- package/dist/cjs/errors/expression-destructuring.error.js.map +1 -1
- package/dist/cjs/errors/expression-extension.error.js +7 -17
- package/dist/cjs/errors/expression-extension.error.js.map +1 -1
- package/dist/cjs/errors/expression-reserved-variable.error.d.ts.map +1 -1
- package/dist/cjs/errors/expression-reserved-variable.error.js +9 -19
- package/dist/cjs/errors/expression-reserved-variable.error.js.map +1 -1
- package/dist/cjs/errors/expression-with-statement.error.d.ts.map +1 -1
- package/dist/cjs/errors/expression-with-statement.error.js +9 -19
- package/dist/cjs/errors/expression-with-statement.error.js.map +1 -1
- package/dist/cjs/errors/expression.error.d.ts.map +1 -1
- package/dist/cjs/errors/expression.error.js +33 -43
- package/dist/cjs/errors/expression.error.js.map +1 -1
- package/dist/cjs/errors/index.js +62 -72
- package/dist/cjs/errors/index.js.map +1 -1
- package/dist/cjs/errors/node-api.error.d.ts.map +1 -1
- package/dist/cjs/errors/node-api.error.js +227 -237
- package/dist/cjs/errors/node-api.error.js.map +1 -1
- package/dist/cjs/errors/node-operation.error.d.ts.map +1 -1
- package/dist/cjs/errors/node-operation.error.js +43 -53
- package/dist/cjs/errors/node-operation.error.js.map +1 -1
- package/dist/cjs/errors/node-ssl.error.d.ts.map +1 -1
- package/dist/cjs/errors/node-ssl.error.js +9 -19
- package/dist/cjs/errors/node-ssl.error.js.map +1 -1
- package/dist/cjs/errors/subworkflow-operation.error.d.ts.map +1 -1
- package/dist/cjs/errors/subworkflow-operation.error.js +18 -28
- package/dist/cjs/errors/subworkflow-operation.error.js.map +1 -1
- package/dist/cjs/errors/trigger-close.error.d.ts.map +1 -1
- package/dist/cjs/errors/trigger-close.error.js +11 -21
- package/dist/cjs/errors/trigger-close.error.js.map +1 -1
- package/dist/cjs/errors/webhook-taken.error.d.ts.map +1 -1
- package/dist/cjs/errors/webhook-taken.error.js +9 -19
- package/dist/cjs/errors/webhook-taken.error.js.map +1 -1
- package/dist/cjs/errors/workflow-activation.error.d.ts.map +1 -1
- package/dist/cjs/errors/workflow-activation.error.js +54 -64
- package/dist/cjs/errors/workflow-activation.error.js.map +1 -1
- package/dist/cjs/errors/workflow-configuration.error.js +10 -20
- package/dist/cjs/errors/workflow-configuration.error.js.map +1 -1
- package/dist/cjs/errors/workflow-deactivation.error.js +7 -17
- package/dist/cjs/errors/workflow-deactivation.error.js.map +1 -1
- package/dist/cjs/errors/workflow-operation.error.d.ts.map +1 -1
- package/dist/cjs/errors/workflow-operation.error.js +20 -30
- package/dist/cjs/errors/workflow-operation.error.js.map +1 -1
- package/dist/cjs/evaluation-helpers.js +16 -26
- package/dist/cjs/evaluation-helpers.js.map +1 -1
- package/dist/cjs/execution-context-establishment-hooks.d.ts.map +1 -1
- package/dist/cjs/execution-context-establishment-hooks.js +43 -49
- package/dist/cjs/execution-context-establishment-hooks.js.map +1 -1
- package/dist/cjs/execution-context.d.ts +14 -14
- package/dist/cjs/execution-context.d.ts.map +1 -1
- package/dist/cjs/execution-context.js +203 -213
- package/dist/cjs/execution-context.js.map +1 -1
- package/dist/cjs/execution-status.d.ts +2 -2
- package/dist/cjs/execution-status.d.ts.map +1 -1
- package/dist/cjs/execution-status.js +27 -37
- package/dist/cjs/execution-status.js.map +1 -1
- package/dist/cjs/expression-evaluator-proxy.d.ts.map +1 -1
- package/dist/cjs/expression-evaluator-proxy.js +18 -28
- package/dist/cjs/expression-evaluator-proxy.js.map +1 -1
- package/dist/cjs/expression-sandboxing.d.ts.map +1 -1
- package/dist/cjs/expression-sandboxing.js +447 -457
- package/dist/cjs/expression-sandboxing.js.map +1 -1
- package/dist/cjs/expression.d.ts.map +1 -1
- package/dist/cjs/expression.js +535 -546
- package/dist/cjs/expression.js.map +1 -1
- package/dist/cjs/expressions/expression-helpers.d.ts.map +1 -1
- package/dist/cjs/expressions/expression-helpers.js +13 -23
- package/dist/cjs/expressions/expression-helpers.js.map +1 -1
- package/dist/cjs/extensions/array-extensions.js +591 -601
- package/dist/cjs/extensions/array-extensions.js.map +1 -1
- package/dist/cjs/extensions/boolean-extensions.d.ts +1 -1
- package/dist/cjs/extensions/boolean-extensions.js +38 -48
- package/dist/cjs/extensions/boolean-extensions.js.map +1 -1
- package/dist/cjs/extensions/date-extensions.js +507 -517
- package/dist/cjs/extensions/date-extensions.js.map +1 -1
- package/dist/cjs/extensions/expression-extension.d.ts.map +1 -1
- package/dist/cjs/extensions/expression-extension.js +455 -465
- package/dist/cjs/extensions/expression-extension.js.map +1 -1
- package/dist/cjs/extensions/expression-parser.d.ts.map +1 -1
- package/dist/cjs/extensions/expression-parser.js +82 -92
- package/dist/cjs/extensions/expression-parser.js.map +1 -1
- package/dist/cjs/extensions/extended-functions.d.ts +10 -18
- package/dist/cjs/extensions/extended-functions.d.ts.map +1 -1
- package/dist/cjs/extensions/extended-functions.js +80 -90
- package/dist/cjs/extensions/extended-functions.js.map +1 -1
- package/dist/cjs/extensions/extensions.js +2 -12
- package/dist/cjs/extensions/index.js +10 -20
- package/dist/cjs/extensions/index.js.map +1 -1
- package/dist/cjs/extensions/number-extensions.js +226 -236
- package/dist/cjs/extensions/number-extensions.js.map +1 -1
- package/dist/cjs/extensions/object-extensions.js +274 -284
- package/dist/cjs/extensions/object-extensions.js.map +1 -1
- package/dist/cjs/extensions/string-extensions.d.ts +1 -1
- package/dist/cjs/extensions/string-extensions.d.ts.map +1 -1
- package/dist/cjs/extensions/string-extensions.js +769 -779
- package/dist/cjs/extensions/string-extensions.js.map +1 -1
- package/dist/cjs/extensions/utils.d.ts.map +1 -1
- package/dist/cjs/extensions/utils.js +35 -45
- package/dist/cjs/extensions/utils.js.map +1 -1
- package/dist/cjs/from-ai-parse-utils.js +393 -403
- package/dist/cjs/from-ai-parse-utils.js.map +1 -1
- package/dist/cjs/global-state.js +12 -22
- package/dist/cjs/global-state.js.map +1 -1
- package/dist/cjs/graph/graph-utils.js +166 -176
- package/dist/cjs/graph/graph-utils.js.map +1 -1
- package/dist/cjs/highlighted-data.js +13 -23
- package/dist/cjs/highlighted-data.js.map +1 -1
- package/dist/cjs/index.js +105 -115
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interfaces.d.ts +112 -22
- package/dist/cjs/interfaces.d.ts.map +1 -1
- package/dist/cjs/interfaces.js +62 -72
- package/dist/cjs/interfaces.js.map +1 -1
- package/dist/cjs/jmespath-query.js +26 -36
- package/dist/cjs/jmespath-query.js.map +1 -1
- package/dist/cjs/logger-proxy.d.ts.map +1 -1
- package/dist/cjs/logger-proxy.js +15 -25
- package/dist/cjs/logger-proxy.js.map +1 -1
- package/dist/cjs/mcp-helpers.js +10 -20
- package/dist/cjs/mcp-helpers.js.map +1 -1
- package/dist/cjs/message-event-bus.d.ts +184 -165
- package/dist/cjs/message-event-bus.d.ts.map +1 -1
- package/dist/cjs/message-event-bus.js +207 -217
- package/dist/cjs/message-event-bus.js.map +1 -1
- package/dist/cjs/metadata-utils.js +35 -45
- package/dist/cjs/metadata-utils.js.map +1 -1
- package/dist/cjs/native-methods/array.methods.js +527 -537
- package/dist/cjs/native-methods/array.methods.js.map +1 -1
- package/dist/cjs/native-methods/boolean.methods.js +18 -28
- package/dist/cjs/native-methods/boolean.methods.js.map +1 -1
- package/dist/cjs/native-methods/index.js +16 -26
- package/dist/cjs/native-methods/index.js.map +1 -1
- package/dist/cjs/native-methods/number.methods.js +79 -89
- package/dist/cjs/native-methods/number.methods.js.map +1 -1
- package/dist/cjs/native-methods/object.methods.js +7 -17
- package/dist/cjs/native-methods/object.methods.js.map +1 -1
- package/dist/cjs/native-methods/string.methods.js +474 -484
- package/dist/cjs/native-methods/string.methods.js.map +1 -1
- package/dist/cjs/node-grouping-validation.d.ts +6 -0
- package/dist/cjs/node-grouping-validation.d.ts.map +1 -1
- package/dist/cjs/node-grouping-validation.js +165 -144
- package/dist/cjs/node-grouping-validation.js.map +1 -1
- package/dist/cjs/node-helpers.d.ts.map +1 -1
- package/dist/cjs/node-helpers.js +1486 -1493
- package/dist/cjs/node-helpers.js.map +1 -1
- package/dist/cjs/node-parameters/filter-parameter.d.ts.map +1 -1
- package/dist/cjs/node-parameters/filter-parameter.js +315 -325
- package/dist/cjs/node-parameters/filter-parameter.js.map +1 -1
- package/dist/cjs/node-parameters/node-parameter-value-type-guard.js +105 -115
- package/dist/cjs/node-parameters/node-parameter-value-type-guard.js.map +1 -1
- package/dist/cjs/node-parameters/parameter-type-validation.js +120 -130
- package/dist/cjs/node-parameters/parameter-type-validation.js.map +1 -1
- package/dist/cjs/node-parameters/path-utils.js +21 -31
- package/dist/cjs/node-parameters/path-utils.js.map +1 -1
- package/dist/cjs/node-parameters/rename-node-utils.js +22 -32
- package/dist/cjs/node-parameters/rename-node-utils.js.map +1 -1
- package/dist/cjs/node-reference-parser-utils.js +472 -482
- package/dist/cjs/node-reference-parser-utils.js.map +1 -1
- package/dist/cjs/node-validation.js +59 -69
- package/dist/cjs/node-validation.js.map +1 -1
- package/dist/cjs/observable-object.js +56 -66
- package/dist/cjs/observable-object.js.map +1 -1
- package/dist/cjs/redaction-channels.js +36 -46
- package/dist/cjs/redaction-channels.js.map +1 -1
- package/dist/cjs/run-execution-data/run-execution-data.js +15 -25
- package/dist/cjs/run-execution-data/run-execution-data.js.map +1 -1
- package/dist/cjs/run-execution-data/run-execution-data.v0.js +2 -12
- package/dist/cjs/run-execution-data/run-execution-data.v1.js +26 -36
- package/dist/cjs/run-execution-data/run-execution-data.v1.js.map +1 -1
- package/dist/cjs/run-execution-data-factory.js +113 -123
- package/dist/cjs/run-execution-data-factory.js.map +1 -1
- package/dist/cjs/schemas.d.ts +13 -13
- package/dist/cjs/schemas.d.ts.map +1 -1
- package/dist/cjs/schemas.js +351 -360
- package/dist/cjs/schemas.js.map +1 -1
- package/dist/cjs/sub-workflow-output.js +10 -20
- package/dist/cjs/sub-workflow-output.js.map +1 -1
- package/dist/cjs/telemetry-helpers.d.ts.map +1 -1
- package/dist/cjs/telemetry-helpers.js +716 -726
- package/dist/cjs/telemetry-helpers.js.map +1 -1
- package/dist/cjs/tool-helpers.js +18 -28
- package/dist/cjs/tool-helpers.js.map +1 -1
- package/dist/cjs/trigger-identity.js +41 -51
- package/dist/cjs/trigger-identity.js.map +1 -1
- package/dist/cjs/trimmed-task-data.js +21 -31
- package/dist/cjs/trimmed-task-data.js.map +1 -1
- package/dist/cjs/type-guards.d.ts +3 -3
- package/dist/cjs/type-guards.d.ts.map +1 -1
- package/dist/cjs/type-guards.js +74 -84
- package/dist/cjs/type-guards.js.map +1 -1
- package/dist/cjs/type-validation.d.ts.map +1 -1
- package/dist/cjs/type-validation.js +383 -393
- package/dist/cjs/type-validation.js.map +1 -1
- package/dist/cjs/utils.d.ts +2 -2
- package/dist/cjs/utils.d.ts.map +1 -1
- package/dist/cjs/utils.js +430 -440
- package/dist/cjs/utils.js.map +1 -1
- package/dist/cjs/versioned-node-type.d.ts.map +1 -1
- package/dist/cjs/versioned-node-type.js +20 -30
- package/dist/cjs/versioned-node-type.js.map +1 -1
- package/dist/cjs/workflow-checksum.js +67 -77
- package/dist/cjs/workflow-checksum.js.map +1 -1
- package/dist/cjs/workflow-data-proxy-env-provider.js +58 -68
- package/dist/cjs/workflow-data-proxy-env-provider.js.map +1 -1
- package/dist/cjs/workflow-data-proxy-helpers.js +8 -18
- package/dist/cjs/workflow-data-proxy-helpers.js.map +1 -1
- package/dist/cjs/workflow-data-proxy.d.ts.map +1 -1
- package/dist/cjs/workflow-data-proxy.js +1162 -1172
- package/dist/cjs/workflow-data-proxy.js.map +1 -1
- package/dist/cjs/workflow-diff.d.ts +2 -1
- package/dist/cjs/workflow-diff.d.ts.map +1 -1
- package/dist/cjs/workflow-diff.js +292 -300
- package/dist/cjs/workflow-diff.js.map +1 -1
- package/dist/cjs/workflow-environments-helper.js +23 -33
- package/dist/cjs/workflow-environments-helper.js.map +1 -1
- package/dist/cjs/workflow-expression.d.ts.map +1 -1
- package/dist/cjs/workflow-expression.js +97 -107
- package/dist/cjs/workflow-expression.js.map +1 -1
- package/dist/cjs/workflow-structure-validation.d.ts.map +1 -1
- package/dist/cjs/workflow-structure-validation.js +140 -150
- package/dist/cjs/workflow-structure-validation.js.map +1 -1
- package/dist/cjs/workflow-validation.js +40 -50
- package/dist/cjs/workflow-validation.js.map +1 -1
- package/dist/cjs/workflow.d.ts.map +1 -1
- package/dist/cjs/workflow.js +612 -622
- package/dist/cjs/workflow.js.map +1 -1
- package/dist/esm/common/get-child-nodes.js.map +1 -1
- package/dist/esm/common/get-connected-nodes.js.map +1 -1
- package/dist/esm/common/get-parent-nodes.js.map +1 -1
- package/dist/esm/common/resolve-variables.d.ts +8 -0
- package/dist/esm/common/resolve-variables.d.ts.map +1 -1
- package/dist/esm/common/resolve-variables.js +22 -0
- package/dist/esm/common/resolve-variables.js.map +1 -1
- package/dist/esm/constants.d.ts +3 -3
- package/dist/esm/constants.d.ts.map +1 -1
- package/dist/esm/cron.d.ts.map +1 -1
- package/dist/esm/errors/abstract/execution-base.error.d.ts.map +1 -1
- package/dist/esm/errors/abstract/execution-base.error.js.map +1 -1
- package/dist/esm/errors/abstract/node.error.d.ts.map +1 -1
- package/dist/esm/errors/abstract/node.error.js.map +1 -1
- package/dist/esm/errors/base/base.error.d.ts.map +1 -1
- package/dist/esm/errors/base/base.error.js.map +1 -1
- package/dist/esm/errors/base/operational.error.d.ts.map +1 -1
- package/dist/esm/errors/base/operational.error.js.map +1 -1
- package/dist/esm/errors/base/unexpected.error.d.ts.map +1 -1
- package/dist/esm/errors/base/unexpected.error.js.map +1 -1
- package/dist/esm/errors/base/user.error.d.ts.map +1 -1
- package/dist/esm/errors/base/user.error.js.map +1 -1
- package/dist/esm/errors/db-connection-timeout-error.d.ts.map +1 -1
- package/dist/esm/errors/execution-cancelled.error.d.ts.map +1 -1
- package/dist/esm/errors/expression-class-extension.error.d.ts.map +1 -1
- package/dist/esm/errors/expression-computed-destructuring.error.d.ts.map +1 -1
- package/dist/esm/errors/expression-destructuring.error.d.ts.map +1 -1
- package/dist/esm/errors/expression-reserved-variable.error.d.ts.map +1 -1
- package/dist/esm/errors/expression-with-statement.error.d.ts.map +1 -1
- package/dist/esm/errors/expression.error.d.ts.map +1 -1
- package/dist/esm/errors/node-api.error.d.ts.map +1 -1
- package/dist/esm/errors/node-api.error.js.map +1 -1
- package/dist/esm/errors/node-operation.error.d.ts.map +1 -1
- package/dist/esm/errors/node-operation.error.js.map +1 -1
- package/dist/esm/errors/node-ssl.error.d.ts.map +1 -1
- package/dist/esm/errors/subworkflow-operation.error.d.ts.map +1 -1
- package/dist/esm/errors/trigger-close.error.d.ts.map +1 -1
- package/dist/esm/errors/trigger-close.error.js.map +1 -1
- package/dist/esm/errors/webhook-taken.error.d.ts.map +1 -1
- package/dist/esm/errors/workflow-activation.error.d.ts.map +1 -1
- package/dist/esm/errors/workflow-activation.error.js.map +1 -1
- package/dist/esm/errors/workflow-operation.error.d.ts.map +1 -1
- package/dist/esm/execution-context-establishment-hooks.d.ts.map +1 -1
- package/dist/esm/execution-context-establishment-hooks.js +7 -3
- package/dist/esm/execution-context-establishment-hooks.js.map +1 -1
- package/dist/esm/execution-context.d.ts +14 -14
- package/dist/esm/execution-context.d.ts.map +1 -1
- package/dist/esm/execution-status.d.ts +2 -2
- package/dist/esm/execution-status.d.ts.map +1 -1
- package/dist/esm/expression-evaluator-proxy.d.ts.map +1 -1
- package/dist/esm/expression-sandboxing.d.ts.map +1 -1
- package/dist/esm/expression-sandboxing.js.map +1 -1
- package/dist/esm/expression.d.ts.map +1 -1
- package/dist/esm/expression.js.map +1 -1
- package/dist/esm/expressions/expression-helpers.d.ts.map +1 -1
- package/dist/esm/extensions/boolean-extensions.d.ts +1 -1
- package/dist/esm/extensions/expression-extension.d.ts.map +1 -1
- package/dist/esm/extensions/expression-parser.d.ts.map +1 -1
- package/dist/esm/extensions/extended-functions.d.ts +10 -18
- package/dist/esm/extensions/extended-functions.d.ts.map +1 -1
- package/dist/esm/extensions/number-extensions.js.map +1 -1
- package/dist/esm/extensions/string-extensions.d.ts +1 -1
- package/dist/esm/extensions/string-extensions.d.ts.map +1 -1
- package/dist/esm/extensions/string-extensions.js.map +1 -1
- package/dist/esm/extensions/utils.d.ts.map +1 -1
- package/dist/esm/from-ai-parse-utils.js.map +1 -1
- package/dist/esm/interfaces.d.ts +112 -22
- package/dist/esm/interfaces.d.ts.map +1 -1
- package/dist/esm/interfaces.js.map +1 -1
- package/dist/esm/logger-proxy.d.ts.map +1 -1
- package/dist/esm/message-event-bus.d.ts +184 -165
- package/dist/esm/message-event-bus.d.ts.map +1 -1
- package/dist/esm/message-event-bus.js +2 -2
- package/dist/esm/message-event-bus.js.map +1 -1
- package/dist/esm/node-grouping-validation.d.ts +6 -0
- package/dist/esm/node-grouping-validation.d.ts.map +1 -1
- package/dist/esm/node-grouping-validation.js +34 -5
- package/dist/esm/node-grouping-validation.js.map +1 -1
- package/dist/esm/node-helpers.d.ts.map +1 -1
- package/dist/esm/node-helpers.js +3 -0
- package/dist/esm/node-helpers.js.map +1 -1
- package/dist/esm/node-parameters/filter-parameter.d.ts.map +1 -1
- package/dist/esm/node-parameters/filter-parameter.js.map +1 -1
- package/dist/esm/node-reference-parser-utils.js.map +1 -1
- package/dist/esm/run-execution-data-factory.js.map +1 -1
- package/dist/esm/schemas.d.ts +13 -13
- package/dist/esm/schemas.d.ts.map +1 -1
- package/dist/esm/schemas.js +1 -0
- package/dist/esm/schemas.js.map +1 -1
- package/dist/esm/telemetry-helpers.d.ts.map +1 -1
- package/dist/esm/telemetry-helpers.js.map +1 -1
- package/dist/esm/type-guards.d.ts +3 -3
- package/dist/esm/type-guards.d.ts.map +1 -1
- package/dist/esm/type-validation.d.ts.map +1 -1
- package/dist/esm/type-validation.js.map +1 -1
- package/dist/esm/typecheck.tsbuildinfo +1 -1
- package/dist/esm/utils.d.ts +2 -2
- package/dist/esm/utils.d.ts.map +1 -1
- package/dist/esm/utils.js.map +1 -1
- package/dist/esm/versioned-node-type.d.ts.map +1 -1
- package/dist/esm/workflow-data-proxy.d.ts.map +1 -1
- package/dist/esm/workflow-data-proxy.js.map +1 -1
- package/dist/esm/workflow-diff.d.ts +2 -1
- package/dist/esm/workflow-diff.d.ts.map +1 -1
- package/dist/esm/workflow-diff.js +3 -1
- package/dist/esm/workflow-diff.js.map +1 -1
- package/dist/esm/workflow-expression.d.ts.map +1 -1
- package/dist/esm/workflow-expression.js.map +1 -1
- package/dist/esm/workflow-structure-validation.d.ts.map +1 -1
- package/dist/esm/workflow-structure-validation.js.map +1 -1
- package/dist/esm/workflow.d.ts.map +1 -1
- package/dist/esm/workflow.js.map +1 -1
- package/package.json +9 -8
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2
3
|
if (k2 === undefined) k2 = k;
|
|
3
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -31,365 +32,354 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
31
32
|
return result;
|
|
32
33
|
};
|
|
33
34
|
})();
|
|
34
|
-
(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.validateFilterParameter = exports.FilterError = void 0;
|
|
37
|
+
exports.arrayContainsValue = arrayContainsValue;
|
|
38
|
+
exports.executeFilterCondition = executeFilterCondition;
|
|
39
|
+
exports.executeFilter = executeFilter;
|
|
40
|
+
const user_error_1 = require("../errors/base/user.error");
|
|
41
|
+
const LoggerProxy = __importStar(require("../logger-proxy"));
|
|
42
|
+
const type_validation_1 = require("../type-validation");
|
|
43
|
+
class FilterError extends user_error_1.UserError {
|
|
44
|
+
description;
|
|
45
|
+
constructor(message, description) {
|
|
46
|
+
super(message, { level: 'warning', description });
|
|
47
|
+
this.description = description;
|
|
38
48
|
}
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
}
|
|
50
|
+
exports.FilterError = FilterError;
|
|
51
|
+
function parseSingleFilterValue(value, type, strict = false, version = 1) {
|
|
52
|
+
if (type === 'any' || value === null || value === undefined) {
|
|
53
|
+
return { valid: true, newValue: value };
|
|
41
54
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
exports.executeFilterCondition = executeFilterCondition;
|
|
48
|
-
exports.executeFilter = executeFilter;
|
|
49
|
-
const user_error_1 = require("../errors/base/user.error");
|
|
50
|
-
const LoggerProxy = __importStar(require("../logger-proxy"));
|
|
51
|
-
const type_validation_1 = require("../type-validation");
|
|
52
|
-
class FilterError extends user_error_1.UserError {
|
|
53
|
-
description;
|
|
54
|
-
constructor(message, description) {
|
|
55
|
-
super(message, { level: 'warning', description });
|
|
56
|
-
this.description = description;
|
|
55
|
+
if (type === 'boolean' && !strict) {
|
|
56
|
+
if (version >= 2) {
|
|
57
|
+
const result = (0, type_validation_1.validateFieldType)('filter', value, type);
|
|
58
|
+
if (result.valid)
|
|
59
|
+
return result;
|
|
57
60
|
}
|
|
61
|
+
return { valid: true, newValue: Boolean(value) };
|
|
58
62
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (type === 'any' || value === null || value === undefined) {
|
|
63
|
+
if (type === 'number') {
|
|
64
|
+
if (Number.isNaN(value)) {
|
|
62
65
|
return { valid: true, newValue: value };
|
|
63
66
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
return { valid: true, newValue: Boolean(value) };
|
|
67
|
+
const isEmptyString = typeof value === 'string' && value.trim() === '';
|
|
68
|
+
const isEmptyArray = Array.isArray(value) && value.length === 0;
|
|
69
|
+
// Number('') and Number([]) convert to 0 in validateFieldType, which is not intuitive, consider them empty values
|
|
70
|
+
if ((isEmptyString || isEmptyArray) && version >= 3) {
|
|
71
|
+
return { valid: true, newValue: null };
|
|
71
72
|
}
|
|
72
|
-
if (type === 'number') {
|
|
73
|
-
if (Number.isNaN(value)) {
|
|
74
|
-
return { valid: true, newValue: value };
|
|
75
|
-
}
|
|
76
|
-
const isEmptyString = typeof value === 'string' && value.trim() === '';
|
|
77
|
-
const isEmptyArray = Array.isArray(value) && value.length === 0;
|
|
78
|
-
// Number('') and Number([]) convert to 0 in validateFieldType, which is not intuitive, consider them empty values
|
|
79
|
-
if ((isEmptyString || isEmptyArray) && version >= 3) {
|
|
80
|
-
return { valid: true, newValue: null };
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return (0, type_validation_1.validateFieldType)('filter', value, type, { strict, parseStrings: true });
|
|
84
73
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
74
|
+
return (0, type_validation_1.validateFieldType)('filter', value, type, { strict, parseStrings: true });
|
|
75
|
+
}
|
|
76
|
+
const withIndefiniteArticle = (noun) => {
|
|
77
|
+
const article = 'aeiou'.includes(noun.charAt(0)) ? 'an' : 'a';
|
|
78
|
+
return `${article} ${noun}`;
|
|
79
|
+
};
|
|
80
|
+
function parseFilterConditionValues(condition, options, metadata) {
|
|
81
|
+
const index = metadata.index ?? 0;
|
|
82
|
+
const itemIndex = metadata.itemIndex ?? 0;
|
|
83
|
+
const errorFormat = metadata.errorFormat ?? 'full';
|
|
84
|
+
const strict = options.typeValidation === 'strict';
|
|
85
|
+
const version = options.version ?? 1;
|
|
86
|
+
const { operator } = condition;
|
|
87
|
+
const rightType = operator.rightType ?? operator.type;
|
|
88
|
+
const parsedLeftValue = parseSingleFilterValue(condition.leftValue, operator.type, strict, version);
|
|
89
|
+
const parsedRightValue = parseSingleFilterValue(condition.rightValue, rightType, strict, version);
|
|
90
|
+
const leftValid = parsedLeftValue.valid ||
|
|
91
|
+
(metadata.unresolvedExpressions &&
|
|
92
|
+
typeof condition.leftValue === 'string' &&
|
|
93
|
+
condition.leftValue.startsWith('='));
|
|
94
|
+
const rightValid = parsedRightValue.valid ||
|
|
95
|
+
!!operator.singleValue ||
|
|
96
|
+
(metadata.unresolvedExpressions &&
|
|
97
|
+
typeof condition.rightValue === 'string' &&
|
|
98
|
+
condition.rightValue.startsWith('='));
|
|
99
|
+
const leftValueString = String(condition.leftValue);
|
|
100
|
+
const rightValueString = String(condition.rightValue);
|
|
101
|
+
const suffix = errorFormat === 'full' ? `[condition ${index}, item ${itemIndex}]` : `[item ${itemIndex}]`;
|
|
102
|
+
const composeInvalidTypeMessage = (type, fromType, value) => {
|
|
103
|
+
fromType = fromType.toLocaleLowerCase();
|
|
104
|
+
if (strict) {
|
|
105
|
+
return `Wrong type: '${value}' is ${withIndefiniteArticle(fromType)} but was expecting ${withIndefiniteArticle(type)} ${suffix}`;
|
|
106
|
+
}
|
|
107
|
+
return `Conversion error: the ${fromType} '${value}' can't be converted to ${withIndefiniteArticle(type)} ${suffix}`;
|
|
88
108
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const suffix = errorFormat === 'full' ? `[condition ${index}, item ${itemIndex}]` : `[item ${itemIndex}]`;
|
|
111
|
-
const composeInvalidTypeMessage = (type, fromType, value) => {
|
|
112
|
-
fromType = fromType.toLocaleLowerCase();
|
|
113
|
-
if (strict) {
|
|
114
|
-
return `Wrong type: '${value}' is ${withIndefiniteArticle(fromType)} but was expecting ${withIndefiniteArticle(type)} ${suffix}`;
|
|
115
|
-
}
|
|
116
|
-
return `Conversion error: the ${fromType} '${value}' can't be converted to ${withIndefiniteArticle(type)} ${suffix}`;
|
|
117
|
-
};
|
|
118
|
-
const getTypeDescription = (isStrict) => {
|
|
119
|
-
if (isStrict)
|
|
120
|
-
return "Try changing the type of comparison. Alternatively you can enable 'Convert types where required'.";
|
|
121
|
-
return 'Try changing the type of the comparison.';
|
|
122
|
-
};
|
|
123
|
-
const composeInvalidTypeDescription = (type, fromType, valuePosition) => {
|
|
124
|
-
fromType = fromType.toLocaleLowerCase();
|
|
125
|
-
const expectedType = withIndefiniteArticle(type);
|
|
126
|
-
let convertionFunction = '';
|
|
127
|
-
if (type === 'string') {
|
|
128
|
-
convertionFunction = '.toString()';
|
|
129
|
-
}
|
|
130
|
-
else if (type === 'number') {
|
|
131
|
-
convertionFunction = '.toNumber()';
|
|
132
|
-
}
|
|
133
|
-
else if (type === 'boolean') {
|
|
134
|
-
convertionFunction = '.toBoolean()';
|
|
135
|
-
}
|
|
136
|
-
if (strict && convertionFunction) {
|
|
137
|
-
const suggestFunction = ` by adding <code>${convertionFunction}</code>`;
|
|
138
|
-
return `
|
|
109
|
+
const getTypeDescription = (isStrict) => {
|
|
110
|
+
if (isStrict)
|
|
111
|
+
return "Try changing the type of comparison. Alternatively you can enable 'Convert types where required'.";
|
|
112
|
+
return 'Try changing the type of the comparison.';
|
|
113
|
+
};
|
|
114
|
+
const composeInvalidTypeDescription = (type, fromType, valuePosition) => {
|
|
115
|
+
fromType = fromType.toLocaleLowerCase();
|
|
116
|
+
const expectedType = withIndefiniteArticle(type);
|
|
117
|
+
let convertionFunction = '';
|
|
118
|
+
if (type === 'string') {
|
|
119
|
+
convertionFunction = '.toString()';
|
|
120
|
+
}
|
|
121
|
+
else if (type === 'number') {
|
|
122
|
+
convertionFunction = '.toNumber()';
|
|
123
|
+
}
|
|
124
|
+
else if (type === 'boolean') {
|
|
125
|
+
convertionFunction = '.toBoolean()';
|
|
126
|
+
}
|
|
127
|
+
if (strict && convertionFunction) {
|
|
128
|
+
const suggestFunction = ` by adding <code>${convertionFunction}</code>`;
|
|
129
|
+
return `
|
|
139
130
|
<p>Try either:</p>
|
|
140
131
|
<ol>
|
|
141
132
|
<li>Enabling 'Convert types where required'</li>
|
|
142
133
|
<li>Converting the ${valuePosition} field to ${expectedType}${suggestFunction}</li>
|
|
143
134
|
</ol>
|
|
144
135
|
`;
|
|
145
|
-
}
|
|
146
|
-
return getTypeDescription(strict);
|
|
147
|
-
};
|
|
148
|
-
if (!leftValid && !rightValid && typeof condition.leftValue === typeof condition.rightValue) {
|
|
149
|
-
return {
|
|
150
|
-
ok: false,
|
|
151
|
-
error: new FilterError(`Comparison type expects ${withIndefiniteArticle(operator.type)} but both fields are ${withIndefiniteArticle(typeof condition.leftValue)}`, getTypeDescription(strict)),
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
if (!leftValid) {
|
|
155
|
-
return {
|
|
156
|
-
ok: false,
|
|
157
|
-
error: new FilterError(composeInvalidTypeMessage(operator.type, typeof condition.leftValue, leftValueString), composeInvalidTypeDescription(operator.type, typeof condition.leftValue, 'first')),
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
if (!rightValid) {
|
|
161
|
-
return {
|
|
162
|
-
ok: false,
|
|
163
|
-
error: new FilterError(composeInvalidTypeMessage(rightType, typeof condition.rightValue, rightValueString), composeInvalidTypeDescription(rightType, typeof condition.rightValue, 'second')),
|
|
164
|
-
};
|
|
165
136
|
}
|
|
137
|
+
return getTypeDescription(strict);
|
|
138
|
+
};
|
|
139
|
+
if (!leftValid && !rightValid && typeof condition.leftValue === typeof condition.rightValue) {
|
|
166
140
|
return {
|
|
167
|
-
ok:
|
|
168
|
-
|
|
169
|
-
left: parsedLeftValue.valid ? parsedLeftValue.newValue : undefined,
|
|
170
|
-
right: parsedRightValue.valid ? parsedRightValue.newValue : undefined,
|
|
171
|
-
},
|
|
141
|
+
ok: false,
|
|
142
|
+
error: new FilterError(`Comparison type expects ${withIndefiniteArticle(operator.type)} but both fields are ${withIndefiniteArticle(typeof condition.leftValue)}`, getTypeDescription(strict)),
|
|
172
143
|
};
|
|
173
144
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
regex = new RegExp(regexMatch[1], regexMatch[2]);
|
|
182
|
-
}
|
|
183
|
-
return regex;
|
|
145
|
+
if (!leftValid) {
|
|
146
|
+
return {
|
|
147
|
+
ok: false,
|
|
148
|
+
error: new FilterError(composeInvalidTypeMessage(operator.type, typeof condition.leftValue, leftValueString), composeInvalidTypeDescription(operator.type, typeof condition.leftValue, 'first')),
|
|
149
|
+
};
|
|
184
150
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
return item.toString().toLocaleLowerCase() === value.toLocaleLowerCase();
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
return array.includes(value);
|
|
151
|
+
if (!rightValid) {
|
|
152
|
+
return {
|
|
153
|
+
ok: false,
|
|
154
|
+
error: new FilterError(composeInvalidTypeMessage(rightType, typeof condition.rightValue, rightValueString), composeInvalidTypeDescription(rightType, typeof condition.rightValue, 'second')),
|
|
155
|
+
};
|
|
195
156
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
157
|
+
return {
|
|
158
|
+
ok: true,
|
|
159
|
+
result: {
|
|
160
|
+
left: parsedLeftValue.valid ? parsedLeftValue.newValue : undefined,
|
|
161
|
+
right: parsedRightValue.valid ? parsedRightValue.newValue : undefined,
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function parseRegexPattern(pattern) {
|
|
166
|
+
const regexMatch = (pattern || '').match(new RegExp('^/(.*?)/([gimusy]*)$'));
|
|
167
|
+
let regex;
|
|
168
|
+
if (!regexMatch) {
|
|
169
|
+
regex = new RegExp((pattern || '').toString());
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
regex = new RegExp(regexMatch[1], regexMatch[2]);
|
|
173
|
+
}
|
|
174
|
+
return regex;
|
|
175
|
+
}
|
|
176
|
+
function arrayContainsValue(array, value, ignoreCase) {
|
|
177
|
+
if (ignoreCase && typeof value === 'string') {
|
|
178
|
+
return array.some((item) => {
|
|
179
|
+
if (typeof item !== 'string') {
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
return item.toString().toLocaleLowerCase() === value.toLocaleLowerCase();
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
return array.includes(value);
|
|
186
|
+
}
|
|
187
|
+
// eslint-disable-next-line complexity
|
|
188
|
+
function executeFilterCondition(condition, filterOptions, metadata = {}) {
|
|
189
|
+
const ignoreCase = !filterOptions.caseSensitive;
|
|
190
|
+
const { operator } = condition;
|
|
191
|
+
const parsedValues = parseFilterConditionValues(condition, filterOptions, metadata);
|
|
192
|
+
if (!parsedValues.ok) {
|
|
193
|
+
throw parsedValues.error;
|
|
194
|
+
}
|
|
195
|
+
let { left: leftValue, right: rightValue } = parsedValues.result;
|
|
196
|
+
const exists = leftValue !== undefined && leftValue !== null && !Number.isNaN(leftValue);
|
|
197
|
+
if (condition.operator.operation === 'exists') {
|
|
198
|
+
return exists;
|
|
199
|
+
}
|
|
200
|
+
else if (condition.operator.operation === 'notExists') {
|
|
201
|
+
return !exists;
|
|
202
|
+
}
|
|
203
|
+
switch (operator.type) {
|
|
204
|
+
case 'string': {
|
|
205
|
+
if (ignoreCase) {
|
|
206
|
+
if (typeof leftValue === 'string') {
|
|
207
|
+
leftValue = leftValue.toLocaleLowerCase();
|
|
222
208
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
case 'empty':
|
|
227
|
-
return left.length === 0;
|
|
228
|
-
case 'notEmpty':
|
|
229
|
-
return left.length !== 0;
|
|
230
|
-
case 'equals':
|
|
231
|
-
return left === right;
|
|
232
|
-
case 'notEquals':
|
|
233
|
-
return left !== right;
|
|
234
|
-
case 'contains':
|
|
235
|
-
return left.includes(right);
|
|
236
|
-
case 'notContains':
|
|
237
|
-
return !left.includes(right);
|
|
238
|
-
case 'startsWith':
|
|
239
|
-
return left.startsWith(right);
|
|
240
|
-
case 'notStartsWith':
|
|
241
|
-
return !left.startsWith(right);
|
|
242
|
-
case 'endsWith':
|
|
243
|
-
return left.endsWith(right);
|
|
244
|
-
case 'notEndsWith':
|
|
245
|
-
return !left.endsWith(right);
|
|
246
|
-
case 'regex':
|
|
247
|
-
return parseRegexPattern(right).test(left);
|
|
248
|
-
case 'notRegex':
|
|
249
|
-
return !parseRegexPattern(right).test(left);
|
|
209
|
+
if (typeof rightValue === 'string' &&
|
|
210
|
+
!(condition.operator.operation === 'regex' || condition.operator.operation === 'notRegex')) {
|
|
211
|
+
rightValue = rightValue.toLocaleLowerCase();
|
|
250
212
|
}
|
|
251
|
-
break;
|
|
252
213
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
214
|
+
const left = (leftValue ?? '');
|
|
215
|
+
const right = (rightValue ?? '');
|
|
216
|
+
switch (condition.operator.operation) {
|
|
217
|
+
case 'empty':
|
|
218
|
+
return left.length === 0;
|
|
219
|
+
case 'notEmpty':
|
|
220
|
+
return left.length !== 0;
|
|
221
|
+
case 'equals':
|
|
222
|
+
return left === right;
|
|
223
|
+
case 'notEquals':
|
|
224
|
+
return left !== right;
|
|
225
|
+
case 'contains':
|
|
226
|
+
return left.includes(right);
|
|
227
|
+
case 'notContains':
|
|
228
|
+
return !left.includes(right);
|
|
229
|
+
case 'startsWith':
|
|
230
|
+
return left.startsWith(right);
|
|
231
|
+
case 'notStartsWith':
|
|
232
|
+
return !left.startsWith(right);
|
|
233
|
+
case 'endsWith':
|
|
234
|
+
return left.endsWith(right);
|
|
235
|
+
case 'notEndsWith':
|
|
236
|
+
return !left.endsWith(right);
|
|
237
|
+
case 'regex':
|
|
238
|
+
return parseRegexPattern(right).test(left);
|
|
239
|
+
case 'notRegex':
|
|
240
|
+
return !parseRegexPattern(right).test(left);
|
|
275
241
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
case 'number': {
|
|
245
|
+
const left = leftValue;
|
|
246
|
+
const right = rightValue;
|
|
247
|
+
switch (condition.operator.operation) {
|
|
248
|
+
case 'empty':
|
|
280
249
|
return !exists;
|
|
281
|
-
|
|
282
|
-
else if (condition.operator.operation === 'notEmpty') {
|
|
250
|
+
case 'notEmpty':
|
|
283
251
|
return exists;
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
return left.toMillis() < right.toMillis();
|
|
297
|
-
case 'afterOrEquals':
|
|
298
|
-
return left.toMillis() >= right.toMillis();
|
|
299
|
-
case 'beforeOrEquals':
|
|
300
|
-
return left.toMillis() <= right.toMillis();
|
|
301
|
-
}
|
|
302
|
-
break;
|
|
252
|
+
case 'equals':
|
|
253
|
+
return left === right;
|
|
254
|
+
case 'notEquals':
|
|
255
|
+
return left !== right;
|
|
256
|
+
case 'gt':
|
|
257
|
+
return left > right;
|
|
258
|
+
case 'lt':
|
|
259
|
+
return left < right;
|
|
260
|
+
case 'gte':
|
|
261
|
+
return left >= right;
|
|
262
|
+
case 'lte':
|
|
263
|
+
return left <= right;
|
|
303
264
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
return exists;
|
|
312
|
-
case 'true':
|
|
313
|
-
return left;
|
|
314
|
-
case 'false':
|
|
315
|
-
return !left;
|
|
316
|
-
case 'equals':
|
|
317
|
-
return left === right;
|
|
318
|
-
case 'notEquals':
|
|
319
|
-
return left !== right;
|
|
320
|
-
}
|
|
321
|
-
break;
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
case 'dateTime': {
|
|
268
|
+
const left = leftValue;
|
|
269
|
+
const right = rightValue;
|
|
270
|
+
if (condition.operator.operation === 'empty') {
|
|
271
|
+
return !exists;
|
|
322
272
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
const rightNumber = rightValue;
|
|
326
|
-
switch (condition.operator.operation) {
|
|
327
|
-
case 'contains':
|
|
328
|
-
return arrayContainsValue(left, rightValue, ignoreCase);
|
|
329
|
-
case 'notContains':
|
|
330
|
-
return !arrayContainsValue(left, rightValue, ignoreCase);
|
|
331
|
-
case 'lengthEquals':
|
|
332
|
-
return left.length === rightNumber;
|
|
333
|
-
case 'lengthNotEquals':
|
|
334
|
-
return left.length !== rightNumber;
|
|
335
|
-
case 'lengthGt':
|
|
336
|
-
return left.length > rightNumber;
|
|
337
|
-
case 'lengthLt':
|
|
338
|
-
return left.length < rightNumber;
|
|
339
|
-
case 'lengthGte':
|
|
340
|
-
return left.length >= rightNumber;
|
|
341
|
-
case 'lengthLte':
|
|
342
|
-
return left.length <= rightNumber;
|
|
343
|
-
case 'empty':
|
|
344
|
-
return left.length === 0;
|
|
345
|
-
case 'notEmpty':
|
|
346
|
-
return left.length !== 0;
|
|
347
|
-
}
|
|
348
|
-
break;
|
|
273
|
+
else if (condition.operator.operation === 'notEmpty') {
|
|
274
|
+
return exists;
|
|
349
275
|
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
276
|
+
if (!left || !right) {
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
switch (condition.operator.operation) {
|
|
280
|
+
case 'equals':
|
|
281
|
+
return left.toMillis() === right.toMillis();
|
|
282
|
+
case 'notEquals':
|
|
283
|
+
return left.toMillis() !== right.toMillis();
|
|
284
|
+
case 'after':
|
|
285
|
+
return left.toMillis() > right.toMillis();
|
|
286
|
+
case 'before':
|
|
287
|
+
return left.toMillis() < right.toMillis();
|
|
288
|
+
case 'afterOrEquals':
|
|
289
|
+
return left.toMillis() >= right.toMillis();
|
|
290
|
+
case 'beforeOrEquals':
|
|
291
|
+
return left.toMillis() <= right.toMillis();
|
|
359
292
|
}
|
|
293
|
+
break;
|
|
360
294
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
295
|
+
case 'boolean': {
|
|
296
|
+
const left = leftValue;
|
|
297
|
+
const right = rightValue;
|
|
298
|
+
switch (condition.operator.operation) {
|
|
299
|
+
case 'empty':
|
|
300
|
+
return !exists;
|
|
301
|
+
case 'notEmpty':
|
|
302
|
+
return exists;
|
|
303
|
+
case 'true':
|
|
304
|
+
return left;
|
|
305
|
+
case 'false':
|
|
306
|
+
return !left;
|
|
307
|
+
case 'equals':
|
|
308
|
+
return left === right;
|
|
309
|
+
case 'notEquals':
|
|
310
|
+
return left !== right;
|
|
311
|
+
}
|
|
312
|
+
break;
|
|
368
313
|
}
|
|
369
|
-
|
|
370
|
-
|
|
314
|
+
case 'array': {
|
|
315
|
+
const left = (leftValue ?? []);
|
|
316
|
+
const rightNumber = rightValue;
|
|
317
|
+
switch (condition.operator.operation) {
|
|
318
|
+
case 'contains':
|
|
319
|
+
return arrayContainsValue(left, rightValue, ignoreCase);
|
|
320
|
+
case 'notContains':
|
|
321
|
+
return !arrayContainsValue(left, rightValue, ignoreCase);
|
|
322
|
+
case 'lengthEquals':
|
|
323
|
+
return left.length === rightNumber;
|
|
324
|
+
case 'lengthNotEquals':
|
|
325
|
+
return left.length !== rightNumber;
|
|
326
|
+
case 'lengthGt':
|
|
327
|
+
return left.length > rightNumber;
|
|
328
|
+
case 'lengthLt':
|
|
329
|
+
return left.length < rightNumber;
|
|
330
|
+
case 'lengthGte':
|
|
331
|
+
return left.length >= rightNumber;
|
|
332
|
+
case 'lengthLte':
|
|
333
|
+
return left.length <= rightNumber;
|
|
334
|
+
case 'empty':
|
|
335
|
+
return left.length === 0;
|
|
336
|
+
case 'notEmpty':
|
|
337
|
+
return left.length !== 0;
|
|
338
|
+
}
|
|
339
|
+
break;
|
|
371
340
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
parseFilterConditionValues(condition, value.options, {
|
|
380
|
-
index,
|
|
381
|
-
unresolvedExpressions: true,
|
|
382
|
-
errorFormat: 'inline',
|
|
383
|
-
});
|
|
341
|
+
case 'object': {
|
|
342
|
+
const left = leftValue;
|
|
343
|
+
switch (condition.operator.operation) {
|
|
344
|
+
case 'empty':
|
|
345
|
+
return !left || Object.keys(left).length === 0;
|
|
346
|
+
case 'notEmpty':
|
|
347
|
+
return !!left && Object.keys(left).length !== 0;
|
|
384
348
|
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
349
|
+
break;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
LoggerProxy.warn(`Unknown filter parameter operator "${operator.type}:${operator.operation}"`);
|
|
353
|
+
return false;
|
|
354
|
+
}
|
|
355
|
+
function executeFilter(value, { itemIndex } = {}) {
|
|
356
|
+
const conditionPass = (condition, index) => executeFilterCondition(condition, value.options, { index, itemIndex });
|
|
357
|
+
if (value.combinator === 'and') {
|
|
358
|
+
return value.conditions.every(conditionPass);
|
|
359
|
+
}
|
|
360
|
+
else if (value.combinator === 'or') {
|
|
361
|
+
return value.conditions.some(conditionPass);
|
|
362
|
+
}
|
|
363
|
+
LoggerProxy.warn(`Unknown filter combinator "${value.combinator}"`);
|
|
364
|
+
return false;
|
|
365
|
+
}
|
|
366
|
+
const validateFilterParameter = (nodeProperties, value) => {
|
|
367
|
+
return value.conditions.reduce((issues, condition, index) => {
|
|
368
|
+
const key = `${nodeProperties.name}.${index}`;
|
|
369
|
+
try {
|
|
370
|
+
parseFilterConditionValues(condition, value.options, {
|
|
371
|
+
index,
|
|
372
|
+
unresolvedExpressions: true,
|
|
373
|
+
errorFormat: 'inline',
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
catch (error) {
|
|
377
|
+
if (error instanceof FilterError) {
|
|
378
|
+
issues[key].push(error.message);
|
|
389
379
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
|
|
380
|
+
}
|
|
381
|
+
return issues;
|
|
382
|
+
}, {});
|
|
383
|
+
};
|
|
384
|
+
exports.validateFilterParameter = validateFilterParameter;
|
|
395
385
|
//# sourceMappingURL=filter-parameter.js.map
|