n8n-workflow 2.31.2 → 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 -53
- 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.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 +10 -9
|
@@ -1,535 +1,525 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dateExtensions = void 0;
|
|
4
|
+
// NOTE: This file is intentionally mirrored in @n8n/expression-runtime/src/extensions/
|
|
5
|
+
// for use inside the isolated VM. Changes here must be reflected there and vice versa.
|
|
6
|
+
// TODO: Eliminate the duplication. The blocker is that @n8n/expression-runtime is
|
|
7
|
+
// Vite-stubbed for browser builds (to exclude isolated-vm), which prevents n8n-workflow
|
|
8
|
+
// from importing these extension utilities directly from the runtime package. Fix by
|
|
9
|
+
// splitting @n8n/expression-runtime into a browser-safe extensions subpath (not stubbed)
|
|
10
|
+
// and a node-only VM entry (stubbed).
|
|
11
|
+
const luxon_1 = require("luxon");
|
|
12
|
+
const string_extensions_1 = require("./string-extensions");
|
|
13
|
+
const utils_1 = require("./utils");
|
|
14
|
+
const expression_extension_error_1 = require("../errors/expression-extension.error");
|
|
15
|
+
const durationUnits = [
|
|
16
|
+
'milliseconds',
|
|
17
|
+
'seconds',
|
|
18
|
+
'minutes',
|
|
19
|
+
'hours',
|
|
20
|
+
'days',
|
|
21
|
+
'weeks',
|
|
22
|
+
'months',
|
|
23
|
+
'quarters',
|
|
24
|
+
'years',
|
|
25
|
+
];
|
|
26
|
+
const dateParts = [
|
|
27
|
+
'day',
|
|
28
|
+
'week',
|
|
29
|
+
'month',
|
|
30
|
+
'year',
|
|
31
|
+
'hour',
|
|
32
|
+
'minute',
|
|
33
|
+
'second',
|
|
34
|
+
'millisecond',
|
|
35
|
+
'weekNumber',
|
|
36
|
+
'yearDayNumber',
|
|
37
|
+
'weekday',
|
|
38
|
+
];
|
|
39
|
+
const DURATION_MAP = {
|
|
40
|
+
day: 'days',
|
|
41
|
+
month: 'months',
|
|
42
|
+
year: 'years',
|
|
43
|
+
week: 'weeks',
|
|
44
|
+
hour: 'hours',
|
|
45
|
+
minute: 'minutes',
|
|
46
|
+
second: 'seconds',
|
|
47
|
+
millisecond: 'milliseconds',
|
|
48
|
+
ms: 'milliseconds',
|
|
49
|
+
sec: 'seconds',
|
|
50
|
+
secs: 'seconds',
|
|
51
|
+
hr: 'hours',
|
|
52
|
+
hrs: 'hours',
|
|
53
|
+
min: 'minutes',
|
|
54
|
+
mins: 'minutes',
|
|
55
|
+
};
|
|
56
|
+
const DATETIMEUNIT_MAP = {
|
|
57
|
+
days: 'day',
|
|
58
|
+
months: 'month',
|
|
59
|
+
years: 'year',
|
|
60
|
+
hours: 'hour',
|
|
61
|
+
minutes: 'minute',
|
|
62
|
+
seconds: 'second',
|
|
63
|
+
milliseconds: 'millisecond',
|
|
64
|
+
hrs: 'hour',
|
|
65
|
+
hr: 'hour',
|
|
66
|
+
mins: 'minute',
|
|
67
|
+
min: 'minute',
|
|
68
|
+
secs: 'second',
|
|
69
|
+
sec: 'second',
|
|
70
|
+
ms: 'millisecond',
|
|
71
|
+
};
|
|
72
|
+
function isDateTime(date) {
|
|
73
|
+
return date ? luxon_1.DateTime.isDateTime(date) : false;
|
|
74
|
+
}
|
|
75
|
+
function toDateTime(date) {
|
|
76
|
+
if (isDateTime(date))
|
|
77
|
+
return date;
|
|
78
|
+
if (typeof date === 'string') {
|
|
79
|
+
return (0, string_extensions_1.toDateTime)(date);
|
|
5
80
|
}
|
|
6
|
-
|
|
7
|
-
|
|
81
|
+
return luxon_1.DateTime.fromJSDate(date);
|
|
82
|
+
}
|
|
83
|
+
function generateDurationObject(durationValue, unit) {
|
|
84
|
+
const convertedUnit = DURATION_MAP[unit] || unit;
|
|
85
|
+
return { [`${convertedUnit}`]: durationValue };
|
|
86
|
+
}
|
|
87
|
+
function beginningOf(date, extraArgs) {
|
|
88
|
+
const [rawUnit = 'week'] = extraArgs;
|
|
89
|
+
const unit = DATETIMEUNIT_MAP[rawUnit] || rawUnit;
|
|
90
|
+
if (isDateTime(date))
|
|
91
|
+
return date.startOf(unit);
|
|
92
|
+
return luxon_1.DateTime.fromJSDate(date).startOf(unit).toJSDate();
|
|
93
|
+
}
|
|
94
|
+
function endOfMonth(date) {
|
|
95
|
+
if (isDateTime(date))
|
|
96
|
+
return date.endOf('month');
|
|
97
|
+
return luxon_1.DateTime.fromJSDate(date).endOf('month').toJSDate();
|
|
98
|
+
}
|
|
99
|
+
function extract(date, args) {
|
|
100
|
+
let [part = 'week'] = args;
|
|
101
|
+
if (part === 'yearDayNumber') {
|
|
102
|
+
date = isDateTime(date) ? date.toJSDate() : date;
|
|
103
|
+
const firstDayOfTheYear = new Date(date.getFullYear(), 0, 0);
|
|
104
|
+
const diff = date.getTime() -
|
|
105
|
+
firstDayOfTheYear.getTime() +
|
|
106
|
+
(firstDayOfTheYear.getTimezoneOffset() - date.getTimezoneOffset()) * 60 * 1000;
|
|
107
|
+
return Math.floor(diff / (1000 * 60 * 60 * 24));
|
|
8
108
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const luxon_1 = require("luxon");
|
|
21
|
-
const string_extensions_1 = require("./string-extensions");
|
|
22
|
-
const utils_1 = require("./utils");
|
|
23
|
-
const expression_extension_error_1 = require("../errors/expression-extension.error");
|
|
24
|
-
const durationUnits = [
|
|
25
|
-
'milliseconds',
|
|
26
|
-
'seconds',
|
|
27
|
-
'minutes',
|
|
28
|
-
'hours',
|
|
29
|
-
'days',
|
|
30
|
-
'weeks',
|
|
31
|
-
'months',
|
|
32
|
-
'quarters',
|
|
33
|
-
'years',
|
|
34
|
-
];
|
|
35
|
-
const dateParts = [
|
|
36
|
-
'day',
|
|
37
|
-
'week',
|
|
38
|
-
'month',
|
|
39
|
-
'year',
|
|
40
|
-
'hour',
|
|
41
|
-
'minute',
|
|
42
|
-
'second',
|
|
43
|
-
'millisecond',
|
|
44
|
-
'weekNumber',
|
|
45
|
-
'yearDayNumber',
|
|
46
|
-
'weekday',
|
|
47
|
-
];
|
|
48
|
-
const DURATION_MAP = {
|
|
49
|
-
day: 'days',
|
|
50
|
-
month: 'months',
|
|
51
|
-
year: 'years',
|
|
52
|
-
week: 'weeks',
|
|
53
|
-
hour: 'hours',
|
|
54
|
-
minute: 'minutes',
|
|
55
|
-
second: 'seconds',
|
|
56
|
-
millisecond: 'milliseconds',
|
|
57
|
-
ms: 'milliseconds',
|
|
58
|
-
sec: 'seconds',
|
|
59
|
-
secs: 'seconds',
|
|
60
|
-
hr: 'hours',
|
|
61
|
-
hrs: 'hours',
|
|
62
|
-
min: 'minutes',
|
|
63
|
-
mins: 'minutes',
|
|
64
|
-
};
|
|
65
|
-
const DATETIMEUNIT_MAP = {
|
|
66
|
-
days: 'day',
|
|
67
|
-
months: 'month',
|
|
68
|
-
years: 'year',
|
|
69
|
-
hours: 'hour',
|
|
70
|
-
minutes: 'minute',
|
|
71
|
-
seconds: 'second',
|
|
72
|
-
milliseconds: 'millisecond',
|
|
73
|
-
hrs: 'hour',
|
|
74
|
-
hr: 'hour',
|
|
75
|
-
mins: 'minute',
|
|
76
|
-
min: 'minute',
|
|
77
|
-
secs: 'second',
|
|
78
|
-
sec: 'second',
|
|
79
|
-
ms: 'millisecond',
|
|
80
|
-
};
|
|
81
|
-
function isDateTime(date) {
|
|
82
|
-
return date ? luxon_1.DateTime.isDateTime(date) : false;
|
|
109
|
+
if (part === 'week')
|
|
110
|
+
part = 'weekNumber';
|
|
111
|
+
const unit = DATETIMEUNIT_MAP[part] || part;
|
|
112
|
+
if (isDateTime(date))
|
|
113
|
+
return date.get(unit);
|
|
114
|
+
return luxon_1.DateTime.fromJSDate(date).get(unit);
|
|
115
|
+
}
|
|
116
|
+
function format(date, extraArgs) {
|
|
117
|
+
const [dateFormat, localeOpts = {}] = extraArgs;
|
|
118
|
+
if (isDateTime(date)) {
|
|
119
|
+
return date.toFormat(dateFormat, { ...localeOpts });
|
|
83
120
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
return luxon_1.DateTime.fromJSDate(date);
|
|
91
|
-
}
|
|
92
|
-
function generateDurationObject(durationValue, unit) {
|
|
93
|
-
const convertedUnit = DURATION_MAP[unit] || unit;
|
|
94
|
-
return { [`${convertedUnit}`]: durationValue };
|
|
95
|
-
}
|
|
96
|
-
function beginningOf(date, extraArgs) {
|
|
97
|
-
const [rawUnit = 'week'] = extraArgs;
|
|
98
|
-
const unit = DATETIMEUNIT_MAP[rawUnit] || rawUnit;
|
|
99
|
-
if (isDateTime(date))
|
|
100
|
-
return date.startOf(unit);
|
|
101
|
-
return luxon_1.DateTime.fromJSDate(date).startOf(unit).toJSDate();
|
|
102
|
-
}
|
|
103
|
-
function endOfMonth(date) {
|
|
104
|
-
if (isDateTime(date))
|
|
105
|
-
return date.endOf('month');
|
|
106
|
-
return luxon_1.DateTime.fromJSDate(date).endOf('month').toJSDate();
|
|
107
|
-
}
|
|
108
|
-
function extract(date, args) {
|
|
109
|
-
let [part = 'week'] = args;
|
|
110
|
-
if (part === 'yearDayNumber') {
|
|
111
|
-
date = isDateTime(date) ? date.toJSDate() : date;
|
|
112
|
-
const firstDayOfTheYear = new Date(date.getFullYear(), 0, 0);
|
|
113
|
-
const diff = date.getTime() -
|
|
114
|
-
firstDayOfTheYear.getTime() +
|
|
115
|
-
(firstDayOfTheYear.getTimezoneOffset() - date.getTimezoneOffset()) * 60 * 1000;
|
|
116
|
-
return Math.floor(diff / (1000 * 60 * 60 * 24));
|
|
117
|
-
}
|
|
118
|
-
if (part === 'week')
|
|
119
|
-
part = 'weekNumber';
|
|
120
|
-
const unit = DATETIMEUNIT_MAP[part] || part;
|
|
121
|
-
if (isDateTime(date))
|
|
122
|
-
return date.get(unit);
|
|
123
|
-
return luxon_1.DateTime.fromJSDate(date).get(unit);
|
|
124
|
-
}
|
|
125
|
-
function format(date, extraArgs) {
|
|
126
|
-
const [dateFormat, localeOpts = {}] = extraArgs;
|
|
127
|
-
if (isDateTime(date)) {
|
|
128
|
-
return date.toFormat(dateFormat, { ...localeOpts });
|
|
129
|
-
}
|
|
130
|
-
return luxon_1.DateTime.fromJSDate(date).toFormat(dateFormat, { ...localeOpts });
|
|
121
|
+
return luxon_1.DateTime.fromJSDate(date).toFormat(dateFormat, { ...localeOpts });
|
|
122
|
+
}
|
|
123
|
+
function isBetween(date, extraArgs) {
|
|
124
|
+
if (extraArgs.length !== 2) {
|
|
125
|
+
throw new expression_extension_error_1.ExpressionExtensionError('isBetween(): expected exactly two args');
|
|
131
126
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const firstDate = (0, utils_1.convertToDateTime)(first);
|
|
138
|
-
const secondDate = (0, utils_1.convertToDateTime)(second);
|
|
139
|
-
if (!firstDate || !secondDate) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
if (firstDate > secondDate) {
|
|
143
|
-
return secondDate < date && date < firstDate;
|
|
144
|
-
}
|
|
145
|
-
return secondDate > date && date > firstDate;
|
|
127
|
+
const [first, second] = extraArgs;
|
|
128
|
+
const firstDate = (0, utils_1.convertToDateTime)(first);
|
|
129
|
+
const secondDate = (0, utils_1.convertToDateTime)(second);
|
|
130
|
+
if (!firstDate || !secondDate) {
|
|
131
|
+
return;
|
|
146
132
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
return date.isInDST;
|
|
150
|
-
}
|
|
151
|
-
return luxon_1.DateTime.fromJSDate(date).isInDST;
|
|
133
|
+
if (firstDate > secondDate) {
|
|
134
|
+
return secondDate < date && date < firstDate;
|
|
152
135
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
thisDate = luxon_1.DateTime.fromJSDate(thisDate);
|
|
159
|
-
}
|
|
160
|
-
return dateInThePast <= thisDate && thisDate <= luxon_1.DateTime.now();
|
|
136
|
+
return secondDate > date && date > firstDate;
|
|
137
|
+
}
|
|
138
|
+
function isDst(date) {
|
|
139
|
+
if (isDateTime(date)) {
|
|
140
|
+
return date.isInDST;
|
|
161
141
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
142
|
+
return luxon_1.DateTime.fromJSDate(date).isInDST;
|
|
143
|
+
}
|
|
144
|
+
function isInLast(date, extraArgs) {
|
|
145
|
+
const [durationValue = 0, unit = 'minutes'] = extraArgs;
|
|
146
|
+
const dateInThePast = luxon_1.DateTime.now().minus(generateDurationObject(durationValue, unit));
|
|
147
|
+
let thisDate = date;
|
|
148
|
+
if (!isDateTime(thisDate)) {
|
|
149
|
+
thisDate = luxon_1.DateTime.fromJSDate(thisDate);
|
|
166
150
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
151
|
+
return dateInThePast <= thisDate && thisDate <= luxon_1.DateTime.now();
|
|
152
|
+
}
|
|
153
|
+
const WEEKEND_DAYS = [6, 7];
|
|
154
|
+
function isWeekend(date) {
|
|
155
|
+
const { weekday } = isDateTime(date) ? date : luxon_1.DateTime.fromJSDate(date);
|
|
156
|
+
return WEEKEND_DAYS.includes(weekday);
|
|
157
|
+
}
|
|
158
|
+
function minus(date, args) {
|
|
159
|
+
if (args.length === 1) {
|
|
160
|
+
const [arg] = args;
|
|
176
161
|
if (isDateTime(date))
|
|
177
|
-
return date.minus(
|
|
178
|
-
return luxon_1.DateTime.fromJSDate(date).minus(
|
|
162
|
+
return date.minus(arg);
|
|
163
|
+
return luxon_1.DateTime.fromJSDate(date).minus(arg).toJSDate();
|
|
179
164
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
const
|
|
165
|
+
const [durationValue = 0, unit = 'minutes'] = args;
|
|
166
|
+
const duration = generateDurationObject(durationValue, unit);
|
|
167
|
+
if (isDateTime(date))
|
|
168
|
+
return date.minus(duration);
|
|
169
|
+
return luxon_1.DateTime.fromJSDate(date).minus(duration).toJSDate();
|
|
170
|
+
}
|
|
171
|
+
function plus(date, args) {
|
|
172
|
+
if (args.length === 1) {
|
|
173
|
+
const [arg] = args;
|
|
189
174
|
if (isDateTime(date))
|
|
190
|
-
return date.plus(
|
|
191
|
-
return luxon_1.DateTime.fromJSDate(date).plus(
|
|
175
|
+
return date.plus(arg);
|
|
176
|
+
return luxon_1.DateTime.fromJSDate(date).plus(arg).toJSDate();
|
|
192
177
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
.join(', ')}.`);
|
|
205
|
-
}
|
|
206
|
-
const diffResult = date.diff(toDateTime(otherDate), units);
|
|
207
|
-
if (units.length > 1) {
|
|
208
|
-
return diffResult.toObject();
|
|
209
|
-
}
|
|
210
|
-
return diffResult.as(units[0]);
|
|
178
|
+
const [durationValue = 0, unit = 'minutes'] = args;
|
|
179
|
+
const duration = generateDurationObject(durationValue, unit);
|
|
180
|
+
if (isDateTime(date))
|
|
181
|
+
return date.plus(duration);
|
|
182
|
+
return luxon_1.DateTime.fromJSDate(date).plus(duration).toJSDate();
|
|
183
|
+
}
|
|
184
|
+
function diffTo(date, args) {
|
|
185
|
+
const [otherDate, unit = 'days'] = args;
|
|
186
|
+
let units = Array.isArray(unit) ? unit : [unit];
|
|
187
|
+
if (units.length === 0) {
|
|
188
|
+
units = ['days'];
|
|
211
189
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
190
|
+
const allowedUnitSet = new Set([...dateParts, ...durationUnits]);
|
|
191
|
+
const errorUnit = units.find((u) => !allowedUnitSet.has(u));
|
|
192
|
+
if (errorUnit) {
|
|
193
|
+
throw new expression_extension_error_1.ExpressionExtensionError(`Unsupported unit '${String(errorUnit)}'. Supported: ${durationUnits
|
|
194
|
+
.map((u) => `'${u}'`)
|
|
195
|
+
.join(', ')}.`);
|
|
215
196
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
return date.getTime();
|
|
197
|
+
const diffResult = date.diff(toDateTime(otherDate), units);
|
|
198
|
+
if (units.length > 1) {
|
|
199
|
+
return diffResult.toObject();
|
|
221
200
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
201
|
+
return diffResult.as(units[0]);
|
|
202
|
+
}
|
|
203
|
+
function diffToNow(date, args) {
|
|
204
|
+
const [unit] = args;
|
|
205
|
+
return diffTo(date, [luxon_1.DateTime.now(), unit]);
|
|
206
|
+
}
|
|
207
|
+
function toInt(date) {
|
|
208
|
+
if (isDateTime(date)) {
|
|
209
|
+
return date.toMillis();
|
|
225
210
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
name: '
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
{
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
{
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
description: 'Returns <code>false</code> for all DateTimes. Returns <code>true</code> for <code>null</code>.',
|
|
494
|
-
examples: [
|
|
495
|
-
{ example: "dt = '2023-03-30T18:49:07.234'.toDateTime()\ndt.isEmpty()", evaluated: 'false' },
|
|
496
|
-
{ example: 'dt = null\ndt.isEmpty()', evaluated: 'true' },
|
|
497
|
-
],
|
|
498
|
-
returnType: 'boolean',
|
|
499
|
-
docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/arrays/#array-isEmpty',
|
|
500
|
-
};
|
|
501
|
-
isNotEmpty.doc = {
|
|
502
|
-
name: 'isNotEmpty',
|
|
503
|
-
description: 'Returns <code>true</code> for all DateTimes. Returns <code>false</code> for <code>null</code>.',
|
|
504
|
-
examples: [
|
|
505
|
-
{ example: "dt = '2023-03-30T18:49:07.234'.toDateTime()\ndt.isNotEmpty()", evaluated: 'true' },
|
|
506
|
-
{ example: 'dt = null\ndt.isNotEmpty()', evaluated: 'false' },
|
|
507
|
-
],
|
|
508
|
-
returnType: 'boolean',
|
|
509
|
-
docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/arrays/#array-isNotEmpty',
|
|
510
|
-
};
|
|
511
|
-
exports.dateExtensions = {
|
|
512
|
-
typeName: 'Date',
|
|
513
|
-
functions: {
|
|
514
|
-
beginningOf,
|
|
515
|
-
endOfMonth,
|
|
516
|
-
extract,
|
|
517
|
-
isBetween,
|
|
518
|
-
isDst,
|
|
519
|
-
isInLast,
|
|
520
|
-
isWeekend,
|
|
521
|
-
minus,
|
|
522
|
-
plus,
|
|
523
|
-
format,
|
|
524
|
-
toDateTime,
|
|
525
|
-
diffTo,
|
|
526
|
-
diffToNow,
|
|
527
|
-
toInt,
|
|
528
|
-
toFloat,
|
|
529
|
-
toBoolean,
|
|
530
|
-
isEmpty,
|
|
531
|
-
isNotEmpty,
|
|
211
|
+
return date.getTime();
|
|
212
|
+
}
|
|
213
|
+
const toFloat = toInt;
|
|
214
|
+
function toBoolean() {
|
|
215
|
+
return undefined;
|
|
216
|
+
}
|
|
217
|
+
// Only null/undefined return true, this is handled in ExpressionExtension.ts
|
|
218
|
+
function isEmpty() {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
function isNotEmpty() {
|
|
222
|
+
return true;
|
|
223
|
+
}
|
|
224
|
+
endOfMonth.doc = {
|
|
225
|
+
name: 'endOfMonth',
|
|
226
|
+
returnType: 'DateTime',
|
|
227
|
+
hidden: true,
|
|
228
|
+
description: 'Transforms a date to the last possible moment that lies within the month.',
|
|
229
|
+
section: 'edit',
|
|
230
|
+
docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-endOfMonth',
|
|
231
|
+
};
|
|
232
|
+
isDst.doc = {
|
|
233
|
+
name: 'isDst',
|
|
234
|
+
returnType: 'boolean',
|
|
235
|
+
hidden: true,
|
|
236
|
+
description: 'Checks if a Date is within Daylight Savings Time.',
|
|
237
|
+
section: 'query',
|
|
238
|
+
docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-isDst',
|
|
239
|
+
};
|
|
240
|
+
isWeekend.doc = {
|
|
241
|
+
name: 'isWeekend',
|
|
242
|
+
returnType: 'boolean',
|
|
243
|
+
hidden: true,
|
|
244
|
+
description: 'Checks if the Date falls on a Saturday or Sunday.',
|
|
245
|
+
section: 'query',
|
|
246
|
+
docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-isWeekend',
|
|
247
|
+
};
|
|
248
|
+
beginningOf.doc = {
|
|
249
|
+
name: 'beginningOf',
|
|
250
|
+
description: 'Transform a Date to the start of the given time period. Default unit is `week`.',
|
|
251
|
+
section: 'edit',
|
|
252
|
+
hidden: true,
|
|
253
|
+
returnType: 'DateTime',
|
|
254
|
+
args: [{ name: 'unit?', type: 'DurationUnit' }],
|
|
255
|
+
docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-beginningOf',
|
|
256
|
+
};
|
|
257
|
+
extract.doc = {
|
|
258
|
+
name: 'extract',
|
|
259
|
+
description: 'Extracts a part of the date or time, e.g. the month, as a number. To extract textual names instead, see <code>format()</code>.',
|
|
260
|
+
examples: [
|
|
261
|
+
{ example: "dt = '2024-03-30T18:49'.toDateTime()\ndt.extract('month')", evaluated: '3' },
|
|
262
|
+
{ example: "dt = '2024-03-30T18:49'.toDateTime()\ndt.extract('hour')", evaluated: '18' },
|
|
263
|
+
],
|
|
264
|
+
section: 'query',
|
|
265
|
+
returnType: 'number',
|
|
266
|
+
args: [
|
|
267
|
+
{
|
|
268
|
+
name: 'unit',
|
|
269
|
+
optional: true,
|
|
270
|
+
description: 'The part of the date or time to return. One of: <code>year</code>, <code>month</code>, <code>week</code>, <code>day</code>, <code>hour</code>, <code>minute</code>, <code>second</code>',
|
|
271
|
+
default: '"week"',
|
|
272
|
+
type: 'string',
|
|
273
|
+
},
|
|
274
|
+
],
|
|
275
|
+
docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-extract',
|
|
276
|
+
};
|
|
277
|
+
format.doc = {
|
|
278
|
+
name: 'format',
|
|
279
|
+
description: 'Converts the DateTime to a string, using the format specified. <a target="_blank" href="https://moment.github.io/luxon/#/formatting?id=table-of-tokens">Formatting guide</a>. For common formats, <code>toLocaleString()</code> may be easier.',
|
|
280
|
+
examples: [
|
|
281
|
+
{
|
|
282
|
+
example: "dt = '2024-04-30T18:49'.toDateTime()\ndt.format('dd/LL/yyyy')",
|
|
283
|
+
evaluated: "'30/04/2024'",
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
example: "dt = '2024-04-30T18:49'.toDateTime()\ndt.format('dd LLL yy')",
|
|
287
|
+
evaluated: "'30 Apr 24'",
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
example: "dt = '2024-04-30T18:49'.toDateTime()\ndt.setLocale('fr').format('dd LLL yyyy')",
|
|
291
|
+
evaluated: "'30 avr. 2024'",
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
example: "dt = '2024-04-30T18:49'.toDateTime()\ndt.format(\"HH 'hours and' mm 'minutes'\")",
|
|
295
|
+
evaluated: "'18 hours and 49 minutes'",
|
|
296
|
+
},
|
|
297
|
+
],
|
|
298
|
+
returnType: 'string',
|
|
299
|
+
section: 'format',
|
|
300
|
+
args: [
|
|
301
|
+
{
|
|
302
|
+
name: 'fmt',
|
|
303
|
+
description: 'The <a target="_blank" href="https://moment.github.io/luxon/#/formatting?id=table-of-tokens">format</a> of the string to return ',
|
|
304
|
+
default: "'yyyy-MM-dd'",
|
|
305
|
+
type: 'string',
|
|
306
|
+
},
|
|
307
|
+
],
|
|
308
|
+
docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-format',
|
|
309
|
+
};
|
|
310
|
+
isBetween.doc = {
|
|
311
|
+
name: 'isBetween',
|
|
312
|
+
description: 'Returns <code>true</code> if the DateTime lies between the two moments specified',
|
|
313
|
+
examples: [
|
|
314
|
+
{
|
|
315
|
+
example: "dt = '2024-03-30T18:49'.toDateTime()\ndt.isBetween('2020-06-01', '2025-06-01')",
|
|
316
|
+
evaluated: 'true',
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
example: "dt = '2024-03-30T18:49'.toDateTime()\ndt.isBetween('2020', '2025')",
|
|
320
|
+
evaluated: 'true',
|
|
321
|
+
},
|
|
322
|
+
],
|
|
323
|
+
section: 'compare',
|
|
324
|
+
returnType: 'boolean',
|
|
325
|
+
args: [
|
|
326
|
+
{
|
|
327
|
+
name: 'date1',
|
|
328
|
+
description: 'The moment that the base DateTime must be after. Can be an ISO date string or a Luxon DateTime.',
|
|
329
|
+
type: 'string | DateTime',
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
name: 'date2',
|
|
333
|
+
description: 'The moment that the base DateTime must be before. Can be an ISO date string or a Luxon DateTime.',
|
|
334
|
+
type: 'string | DateTime',
|
|
335
|
+
},
|
|
336
|
+
],
|
|
337
|
+
docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-isBetween',
|
|
338
|
+
};
|
|
339
|
+
isInLast.doc = {
|
|
340
|
+
name: 'isInLast',
|
|
341
|
+
hidden: true,
|
|
342
|
+
description: 'Checks if a Date is within a given time period. Default unit is `minute`.',
|
|
343
|
+
section: 'query',
|
|
344
|
+
returnType: 'boolean',
|
|
345
|
+
args: [
|
|
346
|
+
{ name: 'n', type: 'number' },
|
|
347
|
+
{ name: 'unit?', type: 'DurationUnit' },
|
|
348
|
+
],
|
|
349
|
+
docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-isInLast',
|
|
350
|
+
};
|
|
351
|
+
toDateTime.doc = {
|
|
352
|
+
name: 'toDateTime',
|
|
353
|
+
description: 'Converts a JavaScript Date to a Luxon DateTime. The DateTime contains the same information, but is easier to manipulate.',
|
|
354
|
+
examples: [
|
|
355
|
+
{
|
|
356
|
+
example: "jsDate = new Date('2024-03-30T18:49')\njsDate.toDateTime().plus(5, 'days')",
|
|
357
|
+
evaluated: '[DateTime: 2024-05-05T18:49:00.000Z]',
|
|
358
|
+
},
|
|
359
|
+
],
|
|
360
|
+
returnType: 'DateTime',
|
|
361
|
+
hidden: true,
|
|
362
|
+
docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-toDateTime',
|
|
363
|
+
};
|
|
364
|
+
minus.doc = {
|
|
365
|
+
name: 'minus',
|
|
366
|
+
description: 'Subtracts a given period of time from the DateTime',
|
|
367
|
+
examples: [
|
|
368
|
+
{
|
|
369
|
+
example: "dt = '2024-03-30T18:49'.toDateTime()\ndt.minus(7, 'days')",
|
|
370
|
+
evaluated: '[DateTime: 2024-04-23T18:49:00.000Z]',
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
example: "dt = '2024-03-30T18:49'.toDateTime()\ndt.minus(4, 'years')",
|
|
374
|
+
evaluated: '[DateTime: 2020-04-30T18:49:00.000Z]',
|
|
375
|
+
},
|
|
376
|
+
],
|
|
377
|
+
section: 'edit',
|
|
378
|
+
returnType: 'DateTime',
|
|
379
|
+
args: [
|
|
380
|
+
{
|
|
381
|
+
name: 'n',
|
|
382
|
+
description: 'The number of units to subtract. Or use a Luxon <a target="_blank" href=”https://moment.github.io/luxon/api-docs/index.html#duration”>Duration</a> object to subtract multiple units at once.',
|
|
383
|
+
type: 'number | object',
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
name: 'unit',
|
|
387
|
+
optional: true,
|
|
388
|
+
description: 'The units of the number. One of: <code>years</code>, <code>months</code>, <code>weeks</code>, <code>days</code>, <code>hours</code>, <code>minutes</code>, <code>seconds</code>, <code>milliseconds</code>',
|
|
389
|
+
default: '"milliseconds"',
|
|
390
|
+
type: 'string',
|
|
391
|
+
},
|
|
392
|
+
],
|
|
393
|
+
docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-minus',
|
|
394
|
+
};
|
|
395
|
+
plus.doc = {
|
|
396
|
+
name: 'plus',
|
|
397
|
+
description: 'Adds a given period of time to the DateTime',
|
|
398
|
+
examples: [
|
|
399
|
+
{
|
|
400
|
+
example: "dt = '2024-03-30T18:49'.toDateTime()\ndt.plus(7, 'days')",
|
|
401
|
+
evaluated: '[DateTime: 2024-04-07T18:49:00.000Z]',
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
example: "dt = '2024-03-30T18:49'.toDateTime()\ndt.plus(4, 'years')",
|
|
405
|
+
evaluated: '[DateTime: 2028-03-30T18:49:00.000Z]',
|
|
406
|
+
},
|
|
407
|
+
],
|
|
408
|
+
section: 'edit',
|
|
409
|
+
returnType: 'DateTime',
|
|
410
|
+
args: [
|
|
411
|
+
{
|
|
412
|
+
name: 'n',
|
|
413
|
+
description: 'The number of units to add. Or use a Luxon <a target="_blank" href=”https://moment.github.io/luxon/api-docs/index.html#duration”>Duration</a> object to add multiple units at once.',
|
|
414
|
+
type: 'number | object',
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
name: 'unit',
|
|
418
|
+
optional: true,
|
|
419
|
+
description: 'The units of the number. One of: <code>years</code>, <code>months</code>, <code>weeks</code>, <code>days</code>, <code>hours</code>, <code>minutes</code>, <code>seconds</code>, <code>milliseconds</code>',
|
|
420
|
+
default: '"milliseconds"',
|
|
421
|
+
type: 'string',
|
|
422
|
+
},
|
|
423
|
+
],
|
|
424
|
+
docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-plus',
|
|
425
|
+
};
|
|
426
|
+
diffTo.doc = {
|
|
427
|
+
name: 'diffTo',
|
|
428
|
+
description: 'Returns the difference between two DateTimes, in the given unit(s)',
|
|
429
|
+
examples: [
|
|
430
|
+
{
|
|
431
|
+
example: "dt = '2025-01-01'.toDateTime()\ndt.diffTo('2024-03-30T18:49:07.234', 'days')",
|
|
432
|
+
evaluated: '276.21',
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
example: "dt1 = '2025-01-01T00:00:00.000'.toDateTime();\ndt2 = '2024-03-30T18:49:07.234'.toDateTime();\ndt1.diffTo(dt2, ['months', 'days'])",
|
|
436
|
+
evaluated: '{ months: 9, days: 1.21 }',
|
|
437
|
+
},
|
|
438
|
+
],
|
|
439
|
+
section: 'compare',
|
|
440
|
+
returnType: 'number | Record<DurationUnit, number>',
|
|
441
|
+
args: [
|
|
442
|
+
{
|
|
443
|
+
name: 'otherDateTime',
|
|
444
|
+
default: '$now',
|
|
445
|
+
description: 'The moment to subtract the base DateTime from. Can be an ISO date string or a Luxon DateTime.',
|
|
446
|
+
type: 'string | DateTime',
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
name: 'unit',
|
|
450
|
+
default: "'days'",
|
|
451
|
+
description: 'The unit, or array of units, to return the result in. Possible values: <code>years</code>, <code>months</code>, <code>weeks</code>, <code>days</code>, <code>hours</code>, <code>minutes</code>, <code>seconds</code>, <code>milliseconds</code>.',
|
|
452
|
+
type: 'string | string[]',
|
|
453
|
+
},
|
|
454
|
+
],
|
|
455
|
+
docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-diffTo',
|
|
456
|
+
};
|
|
457
|
+
diffToNow.doc = {
|
|
458
|
+
name: 'diffToNow',
|
|
459
|
+
description: 'Returns the difference between the current moment and the DateTime, in the given unit(s). For a textual representation, use <code>toRelative()</code> instead.',
|
|
460
|
+
examples: [
|
|
461
|
+
{
|
|
462
|
+
example: "dt = '2023-03-30T18:49:07.234'.toDateTime()\ndt.diffToNow('days')",
|
|
463
|
+
evaluated: '371.9',
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
example: "dt = '2023-03-30T18:49:07.234'.toDateTime()\ndt.diffToNow(['months', 'days'])",
|
|
467
|
+
evaluated: '{ months: 12, days: 5.9 }',
|
|
468
|
+
},
|
|
469
|
+
],
|
|
470
|
+
section: 'compare',
|
|
471
|
+
returnType: 'number | Record<DurationUnit, number>',
|
|
472
|
+
args: [
|
|
473
|
+
{
|
|
474
|
+
name: 'unit',
|
|
475
|
+
description: 'The unit, or array of units, to return the result in. Possible values: <code>years</code>, <code>months</code>, <code>weeks</code>, <code>days</code>, <code>hours</code>, <code>minutes</code>, <code>seconds</code>, <code>milliseconds</code>.',
|
|
476
|
+
default: "'days'",
|
|
477
|
+
type: 'string | string[]',
|
|
532
478
|
},
|
|
533
|
-
|
|
534
|
-
|
|
479
|
+
],
|
|
480
|
+
docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-diffToNow',
|
|
481
|
+
};
|
|
482
|
+
isEmpty.doc = {
|
|
483
|
+
name: 'isEmpty',
|
|
484
|
+
description: 'Returns <code>false</code> for all DateTimes. Returns <code>true</code> for <code>null</code>.',
|
|
485
|
+
examples: [
|
|
486
|
+
{ example: "dt = '2023-03-30T18:49:07.234'.toDateTime()\ndt.isEmpty()", evaluated: 'false' },
|
|
487
|
+
{ example: 'dt = null\ndt.isEmpty()', evaluated: 'true' },
|
|
488
|
+
],
|
|
489
|
+
returnType: 'boolean',
|
|
490
|
+
docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/arrays/#array-isEmpty',
|
|
491
|
+
};
|
|
492
|
+
isNotEmpty.doc = {
|
|
493
|
+
name: 'isNotEmpty',
|
|
494
|
+
description: 'Returns <code>true</code> for all DateTimes. Returns <code>false</code> for <code>null</code>.',
|
|
495
|
+
examples: [
|
|
496
|
+
{ example: "dt = '2023-03-30T18:49:07.234'.toDateTime()\ndt.isNotEmpty()", evaluated: 'true' },
|
|
497
|
+
{ example: 'dt = null\ndt.isNotEmpty()', evaluated: 'false' },
|
|
498
|
+
],
|
|
499
|
+
returnType: 'boolean',
|
|
500
|
+
docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/arrays/#array-isNotEmpty',
|
|
501
|
+
};
|
|
502
|
+
exports.dateExtensions = {
|
|
503
|
+
typeName: 'Date',
|
|
504
|
+
functions: {
|
|
505
|
+
beginningOf,
|
|
506
|
+
endOfMonth,
|
|
507
|
+
extract,
|
|
508
|
+
isBetween,
|
|
509
|
+
isDst,
|
|
510
|
+
isInLast,
|
|
511
|
+
isWeekend,
|
|
512
|
+
minus,
|
|
513
|
+
plus,
|
|
514
|
+
format,
|
|
515
|
+
toDateTime,
|
|
516
|
+
diffTo,
|
|
517
|
+
diffToNow,
|
|
518
|
+
toInt,
|
|
519
|
+
toFloat,
|
|
520
|
+
toBoolean,
|
|
521
|
+
isEmpty,
|
|
522
|
+
isNotEmpty,
|
|
523
|
+
},
|
|
524
|
+
};
|
|
535
525
|
//# sourceMappingURL=date-extensions.js.map
|