n8n-workflow 2.31.3 → 2.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (406) hide show
  1. package/dist/cjs/augment-object.js +136 -146
  2. package/dist/cjs/augment-object.js.map +1 -1
  3. package/dist/cjs/build.tsbuildinfo +1 -1
  4. package/dist/cjs/common/find-ai-root-node-names.js +36 -46
  5. package/dist/cjs/common/find-ai-root-node-names.js.map +1 -1
  6. package/dist/cjs/common/get-child-nodes.js +8 -18
  7. package/dist/cjs/common/get-child-nodes.js.map +1 -1
  8. package/dist/cjs/common/get-connected-nodes.js +84 -94
  9. package/dist/cjs/common/get-connected-nodes.js.map +1 -1
  10. package/dist/cjs/common/get-node-by-name.js +16 -26
  11. package/dist/cjs/common/get-node-by-name.js.map +1 -1
  12. package/dist/cjs/common/get-parent-nodes.js +14 -24
  13. package/dist/cjs/common/get-parent-nodes.js.map +1 -1
  14. package/dist/cjs/common/index.js +9 -19
  15. package/dist/cjs/common/index.js.map +1 -1
  16. package/dist/cjs/common/map-connections-by-destination.js +31 -41
  17. package/dist/cjs/common/map-connections-by-destination.js.map +1 -1
  18. package/dist/cjs/common/resolve-variables.d.ts +8 -0
  19. package/dist/cjs/common/resolve-variables.d.ts.map +1 -1
  20. package/dist/cjs/common/resolve-variables.js +46 -33
  21. package/dist/cjs/common/resolve-variables.js.map +1 -1
  22. package/dist/cjs/connections-diff.js +58 -68
  23. package/dist/cjs/connections-diff.js.map +1 -1
  24. package/dist/cjs/constants.d.ts +3 -3
  25. package/dist/cjs/constants.d.ts.map +1 -1
  26. package/dist/cjs/constants.js +157 -166
  27. package/dist/cjs/constants.js.map +1 -1
  28. package/dist/cjs/credential-domain-restrictions.js +153 -163
  29. package/dist/cjs/credential-domain-restrictions.js.map +1 -1
  30. package/dist/cjs/cron.d.ts.map +1 -1
  31. package/dist/cjs/cron.js +25 -35
  32. package/dist/cjs/cron.js.map +1 -1
  33. package/dist/cjs/data-table.types.js +10 -20
  34. package/dist/cjs/data-table.types.js.map +1 -1
  35. package/dist/cjs/dynamic-credentials-helpers.js +93 -103
  36. package/dist/cjs/dynamic-credentials-helpers.js.map +1 -1
  37. package/dist/cjs/errors/abstract/execution-base.error.d.ts.map +1 -1
  38. package/dist/cjs/errors/abstract/execution-base.error.js +41 -51
  39. package/dist/cjs/errors/abstract/execution-base.error.js.map +1 -1
  40. package/dist/cjs/errors/abstract/node.error.d.ts.map +1 -1
  41. package/dist/cjs/errors/abstract/node.error.js +142 -152
  42. package/dist/cjs/errors/abstract/node.error.js.map +1 -1
  43. package/dist/cjs/errors/base/base.error.d.ts.map +1 -1
  44. package/dist/cjs/errors/base/base.error.js +35 -45
  45. package/dist/cjs/errors/base/base.error.js.map +1 -1
  46. package/dist/cjs/errors/base/operational.error.d.ts.map +1 -1
  47. package/dist/cjs/errors/base/operational.error.js +17 -27
  48. package/dist/cjs/errors/base/operational.error.js.map +1 -1
  49. package/dist/cjs/errors/base/unexpected.error.d.ts.map +1 -1
  50. package/dist/cjs/errors/base/unexpected.error.js +17 -27
  51. package/dist/cjs/errors/base/unexpected.error.js.map +1 -1
  52. package/dist/cjs/errors/base/user.error.d.ts.map +1 -1
  53. package/dist/cjs/errors/base/user.error.js +17 -27
  54. package/dist/cjs/errors/base/user.error.js.map +1 -1
  55. package/dist/cjs/errors/cli-subworkflow-operation.error.js +7 -17
  56. package/dist/cjs/errors/cli-subworkflow-operation.error.js.map +1 -1
  57. package/dist/cjs/errors/db-connection-timeout-error.d.ts.map +1 -1
  58. package/dist/cjs/errors/db-connection-timeout-error.js +11 -21
  59. package/dist/cjs/errors/db-connection-timeout-error.js.map +1 -1
  60. package/dist/cjs/errors/execution-cancelled.error.d.ts.map +1 -1
  61. package/dist/cjs/errors/execution-cancelled.error.js +33 -43
  62. package/dist/cjs/errors/execution-cancelled.error.js.map +1 -1
  63. package/dist/cjs/errors/expression-class-extension.error.d.ts.map +1 -1
  64. package/dist/cjs/errors/expression-class-extension.error.js +9 -19
  65. package/dist/cjs/errors/expression-class-extension.error.js.map +1 -1
  66. package/dist/cjs/errors/expression-computed-destructuring.error.d.ts.map +1 -1
  67. package/dist/cjs/errors/expression-computed-destructuring.error.js +9 -19
  68. package/dist/cjs/errors/expression-computed-destructuring.error.js.map +1 -1
  69. package/dist/cjs/errors/expression-destructuring.error.d.ts.map +1 -1
  70. package/dist/cjs/errors/expression-destructuring.error.js +9 -19
  71. package/dist/cjs/errors/expression-destructuring.error.js.map +1 -1
  72. package/dist/cjs/errors/expression-extension.error.js +7 -17
  73. package/dist/cjs/errors/expression-extension.error.js.map +1 -1
  74. package/dist/cjs/errors/expression-reserved-variable.error.d.ts.map +1 -1
  75. package/dist/cjs/errors/expression-reserved-variable.error.js +9 -19
  76. package/dist/cjs/errors/expression-reserved-variable.error.js.map +1 -1
  77. package/dist/cjs/errors/expression-with-statement.error.d.ts.map +1 -1
  78. package/dist/cjs/errors/expression-with-statement.error.js +9 -19
  79. package/dist/cjs/errors/expression-with-statement.error.js.map +1 -1
  80. package/dist/cjs/errors/expression.error.d.ts.map +1 -1
  81. package/dist/cjs/errors/expression.error.js +33 -43
  82. package/dist/cjs/errors/expression.error.js.map +1 -1
  83. package/dist/cjs/errors/index.js +62 -72
  84. package/dist/cjs/errors/index.js.map +1 -1
  85. package/dist/cjs/errors/node-api.error.d.ts.map +1 -1
  86. package/dist/cjs/errors/node-api.error.js +227 -237
  87. package/dist/cjs/errors/node-api.error.js.map +1 -1
  88. package/dist/cjs/errors/node-operation.error.d.ts.map +1 -1
  89. package/dist/cjs/errors/node-operation.error.js +43 -53
  90. package/dist/cjs/errors/node-operation.error.js.map +1 -1
  91. package/dist/cjs/errors/node-ssl.error.d.ts.map +1 -1
  92. package/dist/cjs/errors/node-ssl.error.js +9 -19
  93. package/dist/cjs/errors/node-ssl.error.js.map +1 -1
  94. package/dist/cjs/errors/subworkflow-operation.error.d.ts.map +1 -1
  95. package/dist/cjs/errors/subworkflow-operation.error.js +18 -28
  96. package/dist/cjs/errors/subworkflow-operation.error.js.map +1 -1
  97. package/dist/cjs/errors/trigger-close.error.d.ts.map +1 -1
  98. package/dist/cjs/errors/trigger-close.error.js +11 -21
  99. package/dist/cjs/errors/trigger-close.error.js.map +1 -1
  100. package/dist/cjs/errors/webhook-taken.error.d.ts.map +1 -1
  101. package/dist/cjs/errors/webhook-taken.error.js +9 -19
  102. package/dist/cjs/errors/webhook-taken.error.js.map +1 -1
  103. package/dist/cjs/errors/workflow-activation.error.d.ts.map +1 -1
  104. package/dist/cjs/errors/workflow-activation.error.js +54 -64
  105. package/dist/cjs/errors/workflow-activation.error.js.map +1 -1
  106. package/dist/cjs/errors/workflow-configuration.error.js +10 -20
  107. package/dist/cjs/errors/workflow-configuration.error.js.map +1 -1
  108. package/dist/cjs/errors/workflow-deactivation.error.js +7 -17
  109. package/dist/cjs/errors/workflow-deactivation.error.js.map +1 -1
  110. package/dist/cjs/errors/workflow-operation.error.d.ts.map +1 -1
  111. package/dist/cjs/errors/workflow-operation.error.js +20 -30
  112. package/dist/cjs/errors/workflow-operation.error.js.map +1 -1
  113. package/dist/cjs/evaluation-helpers.js +16 -26
  114. package/dist/cjs/evaluation-helpers.js.map +1 -1
  115. package/dist/cjs/execution-context-establishment-hooks.d.ts.map +1 -1
  116. package/dist/cjs/execution-context-establishment-hooks.js +43 -53
  117. package/dist/cjs/execution-context-establishment-hooks.js.map +1 -1
  118. package/dist/cjs/execution-context.d.ts +14 -14
  119. package/dist/cjs/execution-context.d.ts.map +1 -1
  120. package/dist/cjs/execution-context.js +203 -213
  121. package/dist/cjs/execution-context.js.map +1 -1
  122. package/dist/cjs/execution-status.d.ts +2 -2
  123. package/dist/cjs/execution-status.d.ts.map +1 -1
  124. package/dist/cjs/execution-status.js +27 -37
  125. package/dist/cjs/execution-status.js.map +1 -1
  126. package/dist/cjs/expression-evaluator-proxy.d.ts.map +1 -1
  127. package/dist/cjs/expression-evaluator-proxy.js +18 -28
  128. package/dist/cjs/expression-evaluator-proxy.js.map +1 -1
  129. package/dist/cjs/expression-sandboxing.d.ts.map +1 -1
  130. package/dist/cjs/expression-sandboxing.js +447 -457
  131. package/dist/cjs/expression-sandboxing.js.map +1 -1
  132. package/dist/cjs/expression.d.ts.map +1 -1
  133. package/dist/cjs/expression.js +535 -546
  134. package/dist/cjs/expression.js.map +1 -1
  135. package/dist/cjs/expressions/expression-helpers.d.ts.map +1 -1
  136. package/dist/cjs/expressions/expression-helpers.js +13 -23
  137. package/dist/cjs/expressions/expression-helpers.js.map +1 -1
  138. package/dist/cjs/extensions/array-extensions.js +591 -601
  139. package/dist/cjs/extensions/array-extensions.js.map +1 -1
  140. package/dist/cjs/extensions/boolean-extensions.d.ts +1 -1
  141. package/dist/cjs/extensions/boolean-extensions.js +38 -48
  142. package/dist/cjs/extensions/boolean-extensions.js.map +1 -1
  143. package/dist/cjs/extensions/date-extensions.js +507 -517
  144. package/dist/cjs/extensions/date-extensions.js.map +1 -1
  145. package/dist/cjs/extensions/expression-extension.d.ts.map +1 -1
  146. package/dist/cjs/extensions/expression-extension.js +455 -465
  147. package/dist/cjs/extensions/expression-extension.js.map +1 -1
  148. package/dist/cjs/extensions/expression-parser.d.ts.map +1 -1
  149. package/dist/cjs/extensions/expression-parser.js +82 -92
  150. package/dist/cjs/extensions/expression-parser.js.map +1 -1
  151. package/dist/cjs/extensions/extended-functions.d.ts +10 -18
  152. package/dist/cjs/extensions/extended-functions.d.ts.map +1 -1
  153. package/dist/cjs/extensions/extended-functions.js +80 -90
  154. package/dist/cjs/extensions/extended-functions.js.map +1 -1
  155. package/dist/cjs/extensions/extensions.js +2 -12
  156. package/dist/cjs/extensions/index.js +10 -20
  157. package/dist/cjs/extensions/index.js.map +1 -1
  158. package/dist/cjs/extensions/number-extensions.js +226 -236
  159. package/dist/cjs/extensions/number-extensions.js.map +1 -1
  160. package/dist/cjs/extensions/object-extensions.js +274 -284
  161. package/dist/cjs/extensions/object-extensions.js.map +1 -1
  162. package/dist/cjs/extensions/string-extensions.d.ts +1 -1
  163. package/dist/cjs/extensions/string-extensions.d.ts.map +1 -1
  164. package/dist/cjs/extensions/string-extensions.js +769 -779
  165. package/dist/cjs/extensions/string-extensions.js.map +1 -1
  166. package/dist/cjs/extensions/utils.d.ts.map +1 -1
  167. package/dist/cjs/extensions/utils.js +35 -45
  168. package/dist/cjs/extensions/utils.js.map +1 -1
  169. package/dist/cjs/from-ai-parse-utils.js +393 -403
  170. package/dist/cjs/from-ai-parse-utils.js.map +1 -1
  171. package/dist/cjs/global-state.js +12 -22
  172. package/dist/cjs/global-state.js.map +1 -1
  173. package/dist/cjs/graph/graph-utils.js +166 -176
  174. package/dist/cjs/graph/graph-utils.js.map +1 -1
  175. package/dist/cjs/highlighted-data.js +13 -23
  176. package/dist/cjs/highlighted-data.js.map +1 -1
  177. package/dist/cjs/index.js +105 -115
  178. package/dist/cjs/index.js.map +1 -1
  179. package/dist/cjs/interfaces.d.ts +112 -22
  180. package/dist/cjs/interfaces.d.ts.map +1 -1
  181. package/dist/cjs/interfaces.js +62 -72
  182. package/dist/cjs/interfaces.js.map +1 -1
  183. package/dist/cjs/jmespath-query.js +26 -36
  184. package/dist/cjs/jmespath-query.js.map +1 -1
  185. package/dist/cjs/logger-proxy.d.ts.map +1 -1
  186. package/dist/cjs/logger-proxy.js +15 -25
  187. package/dist/cjs/logger-proxy.js.map +1 -1
  188. package/dist/cjs/mcp-helpers.js +10 -20
  189. package/dist/cjs/mcp-helpers.js.map +1 -1
  190. package/dist/cjs/message-event-bus.d.ts +184 -165
  191. package/dist/cjs/message-event-bus.d.ts.map +1 -1
  192. package/dist/cjs/message-event-bus.js +207 -217
  193. package/dist/cjs/message-event-bus.js.map +1 -1
  194. package/dist/cjs/metadata-utils.js +35 -45
  195. package/dist/cjs/metadata-utils.js.map +1 -1
  196. package/dist/cjs/native-methods/array.methods.js +527 -537
  197. package/dist/cjs/native-methods/array.methods.js.map +1 -1
  198. package/dist/cjs/native-methods/boolean.methods.js +18 -28
  199. package/dist/cjs/native-methods/boolean.methods.js.map +1 -1
  200. package/dist/cjs/native-methods/index.js +16 -26
  201. package/dist/cjs/native-methods/index.js.map +1 -1
  202. package/dist/cjs/native-methods/number.methods.js +79 -89
  203. package/dist/cjs/native-methods/number.methods.js.map +1 -1
  204. package/dist/cjs/native-methods/object.methods.js +7 -17
  205. package/dist/cjs/native-methods/object.methods.js.map +1 -1
  206. package/dist/cjs/native-methods/string.methods.js +474 -484
  207. package/dist/cjs/native-methods/string.methods.js.map +1 -1
  208. package/dist/cjs/node-grouping-validation.d.ts +6 -0
  209. package/dist/cjs/node-grouping-validation.d.ts.map +1 -1
  210. package/dist/cjs/node-grouping-validation.js +165 -144
  211. package/dist/cjs/node-grouping-validation.js.map +1 -1
  212. package/dist/cjs/node-helpers.d.ts.map +1 -1
  213. package/dist/cjs/node-helpers.js +1486 -1493
  214. package/dist/cjs/node-helpers.js.map +1 -1
  215. package/dist/cjs/node-parameters/filter-parameter.d.ts.map +1 -1
  216. package/dist/cjs/node-parameters/filter-parameter.js +315 -325
  217. package/dist/cjs/node-parameters/filter-parameter.js.map +1 -1
  218. package/dist/cjs/node-parameters/node-parameter-value-type-guard.js +105 -115
  219. package/dist/cjs/node-parameters/node-parameter-value-type-guard.js.map +1 -1
  220. package/dist/cjs/node-parameters/parameter-type-validation.js +120 -130
  221. package/dist/cjs/node-parameters/parameter-type-validation.js.map +1 -1
  222. package/dist/cjs/node-parameters/path-utils.js +21 -31
  223. package/dist/cjs/node-parameters/path-utils.js.map +1 -1
  224. package/dist/cjs/node-parameters/rename-node-utils.js +22 -32
  225. package/dist/cjs/node-parameters/rename-node-utils.js.map +1 -1
  226. package/dist/cjs/node-reference-parser-utils.js +472 -482
  227. package/dist/cjs/node-reference-parser-utils.js.map +1 -1
  228. package/dist/cjs/node-validation.js +59 -69
  229. package/dist/cjs/node-validation.js.map +1 -1
  230. package/dist/cjs/observable-object.js +56 -66
  231. package/dist/cjs/observable-object.js.map +1 -1
  232. package/dist/cjs/redaction-channels.js +36 -46
  233. package/dist/cjs/redaction-channels.js.map +1 -1
  234. package/dist/cjs/run-execution-data/run-execution-data.js +15 -25
  235. package/dist/cjs/run-execution-data/run-execution-data.js.map +1 -1
  236. package/dist/cjs/run-execution-data/run-execution-data.v0.js +2 -12
  237. package/dist/cjs/run-execution-data/run-execution-data.v1.js +26 -36
  238. package/dist/cjs/run-execution-data/run-execution-data.v1.js.map +1 -1
  239. package/dist/cjs/run-execution-data-factory.js +113 -123
  240. package/dist/cjs/run-execution-data-factory.js.map +1 -1
  241. package/dist/cjs/schemas.d.ts +13 -13
  242. package/dist/cjs/schemas.d.ts.map +1 -1
  243. package/dist/cjs/schemas.js +351 -360
  244. package/dist/cjs/schemas.js.map +1 -1
  245. package/dist/cjs/sub-workflow-output.js +10 -20
  246. package/dist/cjs/sub-workflow-output.js.map +1 -1
  247. package/dist/cjs/telemetry-helpers.d.ts.map +1 -1
  248. package/dist/cjs/telemetry-helpers.js +716 -726
  249. package/dist/cjs/telemetry-helpers.js.map +1 -1
  250. package/dist/cjs/tool-helpers.js +18 -28
  251. package/dist/cjs/tool-helpers.js.map +1 -1
  252. package/dist/cjs/trigger-identity.js +41 -51
  253. package/dist/cjs/trigger-identity.js.map +1 -1
  254. package/dist/cjs/trimmed-task-data.js +21 -31
  255. package/dist/cjs/trimmed-task-data.js.map +1 -1
  256. package/dist/cjs/type-guards.d.ts +3 -3
  257. package/dist/cjs/type-guards.d.ts.map +1 -1
  258. package/dist/cjs/type-guards.js +74 -84
  259. package/dist/cjs/type-guards.js.map +1 -1
  260. package/dist/cjs/type-validation.d.ts.map +1 -1
  261. package/dist/cjs/type-validation.js +383 -393
  262. package/dist/cjs/type-validation.js.map +1 -1
  263. package/dist/cjs/utils.d.ts +2 -2
  264. package/dist/cjs/utils.d.ts.map +1 -1
  265. package/dist/cjs/utils.js +430 -440
  266. package/dist/cjs/utils.js.map +1 -1
  267. package/dist/cjs/versioned-node-type.d.ts.map +1 -1
  268. package/dist/cjs/versioned-node-type.js +20 -30
  269. package/dist/cjs/versioned-node-type.js.map +1 -1
  270. package/dist/cjs/workflow-checksum.js +67 -77
  271. package/dist/cjs/workflow-checksum.js.map +1 -1
  272. package/dist/cjs/workflow-data-proxy-env-provider.js +58 -68
  273. package/dist/cjs/workflow-data-proxy-env-provider.js.map +1 -1
  274. package/dist/cjs/workflow-data-proxy-helpers.js +8 -18
  275. package/dist/cjs/workflow-data-proxy-helpers.js.map +1 -1
  276. package/dist/cjs/workflow-data-proxy.d.ts.map +1 -1
  277. package/dist/cjs/workflow-data-proxy.js +1162 -1172
  278. package/dist/cjs/workflow-data-proxy.js.map +1 -1
  279. package/dist/cjs/workflow-diff.d.ts +2 -1
  280. package/dist/cjs/workflow-diff.d.ts.map +1 -1
  281. package/dist/cjs/workflow-diff.js +292 -300
  282. package/dist/cjs/workflow-diff.js.map +1 -1
  283. package/dist/cjs/workflow-environments-helper.js +23 -33
  284. package/dist/cjs/workflow-environments-helper.js.map +1 -1
  285. package/dist/cjs/workflow-expression.d.ts.map +1 -1
  286. package/dist/cjs/workflow-expression.js +97 -107
  287. package/dist/cjs/workflow-expression.js.map +1 -1
  288. package/dist/cjs/workflow-structure-validation.d.ts.map +1 -1
  289. package/dist/cjs/workflow-structure-validation.js +140 -150
  290. package/dist/cjs/workflow-structure-validation.js.map +1 -1
  291. package/dist/cjs/workflow-validation.js +40 -50
  292. package/dist/cjs/workflow-validation.js.map +1 -1
  293. package/dist/cjs/workflow.d.ts.map +1 -1
  294. package/dist/cjs/workflow.js +612 -622
  295. package/dist/cjs/workflow.js.map +1 -1
  296. package/dist/esm/common/get-child-nodes.js.map +1 -1
  297. package/dist/esm/common/get-connected-nodes.js.map +1 -1
  298. package/dist/esm/common/get-parent-nodes.js.map +1 -1
  299. package/dist/esm/common/resolve-variables.d.ts +8 -0
  300. package/dist/esm/common/resolve-variables.d.ts.map +1 -1
  301. package/dist/esm/common/resolve-variables.js +22 -0
  302. package/dist/esm/common/resolve-variables.js.map +1 -1
  303. package/dist/esm/constants.d.ts +3 -3
  304. package/dist/esm/constants.d.ts.map +1 -1
  305. package/dist/esm/cron.d.ts.map +1 -1
  306. package/dist/esm/errors/abstract/execution-base.error.d.ts.map +1 -1
  307. package/dist/esm/errors/abstract/execution-base.error.js.map +1 -1
  308. package/dist/esm/errors/abstract/node.error.d.ts.map +1 -1
  309. package/dist/esm/errors/abstract/node.error.js.map +1 -1
  310. package/dist/esm/errors/base/base.error.d.ts.map +1 -1
  311. package/dist/esm/errors/base/base.error.js.map +1 -1
  312. package/dist/esm/errors/base/operational.error.d.ts.map +1 -1
  313. package/dist/esm/errors/base/operational.error.js.map +1 -1
  314. package/dist/esm/errors/base/unexpected.error.d.ts.map +1 -1
  315. package/dist/esm/errors/base/unexpected.error.js.map +1 -1
  316. package/dist/esm/errors/base/user.error.d.ts.map +1 -1
  317. package/dist/esm/errors/base/user.error.js.map +1 -1
  318. package/dist/esm/errors/db-connection-timeout-error.d.ts.map +1 -1
  319. package/dist/esm/errors/execution-cancelled.error.d.ts.map +1 -1
  320. package/dist/esm/errors/expression-class-extension.error.d.ts.map +1 -1
  321. package/dist/esm/errors/expression-computed-destructuring.error.d.ts.map +1 -1
  322. package/dist/esm/errors/expression-destructuring.error.d.ts.map +1 -1
  323. package/dist/esm/errors/expression-reserved-variable.error.d.ts.map +1 -1
  324. package/dist/esm/errors/expression-with-statement.error.d.ts.map +1 -1
  325. package/dist/esm/errors/expression.error.d.ts.map +1 -1
  326. package/dist/esm/errors/node-api.error.d.ts.map +1 -1
  327. package/dist/esm/errors/node-api.error.js.map +1 -1
  328. package/dist/esm/errors/node-operation.error.d.ts.map +1 -1
  329. package/dist/esm/errors/node-operation.error.js.map +1 -1
  330. package/dist/esm/errors/node-ssl.error.d.ts.map +1 -1
  331. package/dist/esm/errors/subworkflow-operation.error.d.ts.map +1 -1
  332. package/dist/esm/errors/trigger-close.error.d.ts.map +1 -1
  333. package/dist/esm/errors/trigger-close.error.js.map +1 -1
  334. package/dist/esm/errors/webhook-taken.error.d.ts.map +1 -1
  335. package/dist/esm/errors/workflow-activation.error.d.ts.map +1 -1
  336. package/dist/esm/errors/workflow-activation.error.js.map +1 -1
  337. package/dist/esm/errors/workflow-operation.error.d.ts.map +1 -1
  338. package/dist/esm/execution-context-establishment-hooks.d.ts.map +1 -1
  339. package/dist/esm/execution-context.d.ts +14 -14
  340. package/dist/esm/execution-context.d.ts.map +1 -1
  341. package/dist/esm/execution-status.d.ts +2 -2
  342. package/dist/esm/execution-status.d.ts.map +1 -1
  343. package/dist/esm/expression-evaluator-proxy.d.ts.map +1 -1
  344. package/dist/esm/expression-sandboxing.d.ts.map +1 -1
  345. package/dist/esm/expression-sandboxing.js.map +1 -1
  346. package/dist/esm/expression.d.ts.map +1 -1
  347. package/dist/esm/expression.js.map +1 -1
  348. package/dist/esm/expressions/expression-helpers.d.ts.map +1 -1
  349. package/dist/esm/extensions/boolean-extensions.d.ts +1 -1
  350. package/dist/esm/extensions/expression-extension.d.ts.map +1 -1
  351. package/dist/esm/extensions/expression-parser.d.ts.map +1 -1
  352. package/dist/esm/extensions/extended-functions.d.ts +10 -18
  353. package/dist/esm/extensions/extended-functions.d.ts.map +1 -1
  354. package/dist/esm/extensions/number-extensions.js.map +1 -1
  355. package/dist/esm/extensions/string-extensions.d.ts +1 -1
  356. package/dist/esm/extensions/string-extensions.d.ts.map +1 -1
  357. package/dist/esm/extensions/string-extensions.js.map +1 -1
  358. package/dist/esm/extensions/utils.d.ts.map +1 -1
  359. package/dist/esm/from-ai-parse-utils.js.map +1 -1
  360. package/dist/esm/interfaces.d.ts +112 -22
  361. package/dist/esm/interfaces.d.ts.map +1 -1
  362. package/dist/esm/interfaces.js.map +1 -1
  363. package/dist/esm/logger-proxy.d.ts.map +1 -1
  364. package/dist/esm/message-event-bus.d.ts +184 -165
  365. package/dist/esm/message-event-bus.d.ts.map +1 -1
  366. package/dist/esm/message-event-bus.js +2 -2
  367. package/dist/esm/message-event-bus.js.map +1 -1
  368. package/dist/esm/node-grouping-validation.d.ts +6 -0
  369. package/dist/esm/node-grouping-validation.d.ts.map +1 -1
  370. package/dist/esm/node-grouping-validation.js +34 -5
  371. package/dist/esm/node-grouping-validation.js.map +1 -1
  372. package/dist/esm/node-helpers.d.ts.map +1 -1
  373. package/dist/esm/node-helpers.js +3 -0
  374. package/dist/esm/node-helpers.js.map +1 -1
  375. package/dist/esm/node-parameters/filter-parameter.d.ts.map +1 -1
  376. package/dist/esm/node-parameters/filter-parameter.js.map +1 -1
  377. package/dist/esm/node-reference-parser-utils.js.map +1 -1
  378. package/dist/esm/run-execution-data-factory.js.map +1 -1
  379. package/dist/esm/schemas.d.ts +13 -13
  380. package/dist/esm/schemas.d.ts.map +1 -1
  381. package/dist/esm/schemas.js +1 -0
  382. package/dist/esm/schemas.js.map +1 -1
  383. package/dist/esm/telemetry-helpers.d.ts.map +1 -1
  384. package/dist/esm/telemetry-helpers.js.map +1 -1
  385. package/dist/esm/type-guards.d.ts +3 -3
  386. package/dist/esm/type-guards.d.ts.map +1 -1
  387. package/dist/esm/type-validation.d.ts.map +1 -1
  388. package/dist/esm/type-validation.js.map +1 -1
  389. package/dist/esm/typecheck.tsbuildinfo +1 -1
  390. package/dist/esm/utils.d.ts +2 -2
  391. package/dist/esm/utils.d.ts.map +1 -1
  392. package/dist/esm/utils.js.map +1 -1
  393. package/dist/esm/versioned-node-type.d.ts.map +1 -1
  394. package/dist/esm/workflow-data-proxy.d.ts.map +1 -1
  395. package/dist/esm/workflow-data-proxy.js.map +1 -1
  396. package/dist/esm/workflow-diff.d.ts +2 -1
  397. package/dist/esm/workflow-diff.d.ts.map +1 -1
  398. package/dist/esm/workflow-diff.js +3 -1
  399. package/dist/esm/workflow-diff.js.map +1 -1
  400. package/dist/esm/workflow-expression.d.ts.map +1 -1
  401. package/dist/esm/workflow-expression.js.map +1 -1
  402. package/dist/esm/workflow-structure-validation.d.ts.map +1 -1
  403. package/dist/esm/workflow-structure-validation.js.map +1 -1
  404. package/dist/esm/workflow.d.ts.map +1 -1
  405. package/dist/esm/workflow.js.map +1 -1
  406. package/package.json +9 -8
@@ -1,535 +1,525 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
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
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "luxon", "./string-extensions", "./utils", "../errors/expression-extension.error"], factory);
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
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.dateExtensions = void 0;
13
- // NOTE: This file is intentionally mirrored in @n8n/expression-runtime/src/extensions/
14
- // for use inside the isolated VM. Changes here must be reflected there and vice versa.
15
- // TODO: Eliminate the duplication. The blocker is that @n8n/expression-runtime is
16
- // Vite-stubbed for browser builds (to exclude isolated-vm), which prevents n8n-workflow
17
- // from importing these extension utilities directly from the runtime package. Fix by
18
- // splitting @n8n/expression-runtime into a browser-safe extensions subpath (not stubbed)
19
- // and a node-only VM entry (stubbed).
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
- function toDateTime(date) {
85
- if (isDateTime(date))
86
- return date;
87
- if (typeof date === 'string') {
88
- return (0, string_extensions_1.toDateTime)(date);
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
- function isBetween(date, extraArgs) {
133
- if (extraArgs.length !== 2) {
134
- throw new expression_extension_error_1.ExpressionExtensionError('isBetween(): expected exactly two args');
135
- }
136
- const [first, second] = extraArgs;
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
- function isDst(date) {
148
- if (isDateTime(date)) {
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
- function isInLast(date, extraArgs) {
154
- const [durationValue = 0, unit = 'minutes'] = extraArgs;
155
- const dateInThePast = luxon_1.DateTime.now().minus(generateDurationObject(durationValue, unit));
156
- let thisDate = date;
157
- if (!isDateTime(thisDate)) {
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
- const WEEKEND_DAYS = [6, 7];
163
- function isWeekend(date) {
164
- const { weekday } = isDateTime(date) ? date : luxon_1.DateTime.fromJSDate(date);
165
- return WEEKEND_DAYS.includes(weekday);
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
- function minus(date, args) {
168
- if (args.length === 1) {
169
- const [arg] = args;
170
- if (isDateTime(date))
171
- return date.minus(arg);
172
- return luxon_1.DateTime.fromJSDate(date).minus(arg).toJSDate();
173
- }
174
- const [durationValue = 0, unit = 'minutes'] = args;
175
- const duration = generateDurationObject(durationValue, unit);
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(duration);
178
- return luxon_1.DateTime.fromJSDate(date).minus(duration).toJSDate();
162
+ return date.minus(arg);
163
+ return luxon_1.DateTime.fromJSDate(date).minus(arg).toJSDate();
179
164
  }
180
- function plus(date, args) {
181
- if (args.length === 1) {
182
- const [arg] = args;
183
- if (isDateTime(date))
184
- return date.plus(arg);
185
- return luxon_1.DateTime.fromJSDate(date).plus(arg).toJSDate();
186
- }
187
- const [durationValue = 0, unit = 'minutes'] = args;
188
- const duration = generateDurationObject(durationValue, unit);
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(duration);
191
- return luxon_1.DateTime.fromJSDate(date).plus(duration).toJSDate();
175
+ return date.plus(arg);
176
+ return luxon_1.DateTime.fromJSDate(date).plus(arg).toJSDate();
192
177
  }
193
- function diffTo(date, args) {
194
- const [otherDate, unit = 'days'] = args;
195
- let units = Array.isArray(unit) ? unit : [unit];
196
- if (units.length === 0) {
197
- units = ['days'];
198
- }
199
- const allowedUnitSet = new Set([...dateParts, ...durationUnits]);
200
- const errorUnit = units.find((u) => !allowedUnitSet.has(u));
201
- if (errorUnit) {
202
- throw new expression_extension_error_1.ExpressionExtensionError(`Unsupported unit '${String(errorUnit)}'. Supported: ${durationUnits
203
- .map((u) => `'${u}'`)
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
- function diffToNow(date, args) {
213
- const [unit] = args;
214
- return diffTo(date, [luxon_1.DateTime.now(), unit]);
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
- function toInt(date) {
217
- if (isDateTime(date)) {
218
- return date.toMillis();
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
- const toFloat = toInt;
223
- function toBoolean() {
224
- return undefined;
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
- // Only null/undefined return true, this is handled in ExpressionExtension.ts
227
- function isEmpty() {
228
- return false;
229
- }
230
- function isNotEmpty() {
231
- return true;
232
- }
233
- endOfMonth.doc = {
234
- name: 'endOfMonth',
235
- returnType: 'DateTime',
236
- hidden: true,
237
- description: 'Transforms a date to the last possible moment that lies within the month.',
238
- section: 'edit',
239
- docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-endOfMonth',
240
- };
241
- isDst.doc = {
242
- name: 'isDst',
243
- returnType: 'boolean',
244
- hidden: true,
245
- description: 'Checks if a Date is within Daylight Savings Time.',
246
- section: 'query',
247
- docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-isDst',
248
- };
249
- isWeekend.doc = {
250
- name: 'isWeekend',
251
- returnType: 'boolean',
252
- hidden: true,
253
- description: 'Checks if the Date falls on a Saturday or Sunday.',
254
- section: 'query',
255
- docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-isWeekend',
256
- };
257
- beginningOf.doc = {
258
- name: 'beginningOf',
259
- description: 'Transform a Date to the start of the given time period. Default unit is `week`.',
260
- section: 'edit',
261
- hidden: true,
262
- returnType: 'DateTime',
263
- args: [{ name: 'unit?', type: 'DurationUnit' }],
264
- docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-beginningOf',
265
- };
266
- extract.doc = {
267
- name: 'extract',
268
- 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>.',
269
- examples: [
270
- { example: "dt = '2024-03-30T18:49'.toDateTime()\ndt.extract('month')", evaluated: '3' },
271
- { example: "dt = '2024-03-30T18:49'.toDateTime()\ndt.extract('hour')", evaluated: '18' },
272
- ],
273
- section: 'query',
274
- returnType: 'number',
275
- args: [
276
- {
277
- name: 'unit',
278
- optional: true,
279
- 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>',
280
- default: '"week"',
281
- type: 'string',
282
- },
283
- ],
284
- docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-extract',
285
- };
286
- format.doc = {
287
- name: 'format',
288
- 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.',
289
- examples: [
290
- {
291
- example: "dt = '2024-04-30T18:49'.toDateTime()\ndt.format('dd/LL/yyyy')",
292
- evaluated: "'30/04/2024'",
293
- },
294
- {
295
- example: "dt = '2024-04-30T18:49'.toDateTime()\ndt.format('dd LLL yy')",
296
- evaluated: "'30 Apr 24'",
297
- },
298
- {
299
- example: "dt = '2024-04-30T18:49'.toDateTime()\ndt.setLocale('fr').format('dd LLL yyyy')",
300
- evaluated: "'30 avr. 2024'",
301
- },
302
- {
303
- example: "dt = '2024-04-30T18:49'.toDateTime()\ndt.format(\"HH 'hours and' mm 'minutes'\")",
304
- evaluated: "'18 hours and 49 minutes'",
305
- },
306
- ],
307
- returnType: 'string',
308
- section: 'format',
309
- args: [
310
- {
311
- name: 'fmt',
312
- description: 'The <a target="_blank" href="https://moment.github.io/luxon/#/formatting?id=table-of-tokens">format</a> of the string to return ',
313
- default: "'yyyy-MM-dd'",
314
- type: 'string',
315
- },
316
- ],
317
- docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-format',
318
- };
319
- isBetween.doc = {
320
- name: 'isBetween',
321
- description: 'Returns <code>true</code> if the DateTime lies between the two moments specified',
322
- examples: [
323
- {
324
- example: "dt = '2024-03-30T18:49'.toDateTime()\ndt.isBetween('2020-06-01', '2025-06-01')",
325
- evaluated: 'true',
326
- },
327
- {
328
- example: "dt = '2024-03-30T18:49'.toDateTime()\ndt.isBetween('2020', '2025')",
329
- evaluated: 'true',
330
- },
331
- ],
332
- section: 'compare',
333
- returnType: 'boolean',
334
- args: [
335
- {
336
- name: 'date1',
337
- description: 'The moment that the base DateTime must be after. Can be an ISO date string or a Luxon DateTime.',
338
- type: 'string | DateTime',
339
- },
340
- {
341
- name: 'date2',
342
- description: 'The moment that the base DateTime must be before. Can be an ISO date string or a Luxon DateTime.',
343
- type: 'string | DateTime',
344
- },
345
- ],
346
- docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-isBetween',
347
- };
348
- isInLast.doc = {
349
- name: 'isInLast',
350
- hidden: true,
351
- description: 'Checks if a Date is within a given time period. Default unit is `minute`.',
352
- section: 'query',
353
- returnType: 'boolean',
354
- args: [
355
- { name: 'n', type: 'number' },
356
- { name: 'unit?', type: 'DurationUnit' },
357
- ],
358
- docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-isInLast',
359
- };
360
- toDateTime.doc = {
361
- name: 'toDateTime',
362
- description: 'Converts a JavaScript Date to a Luxon DateTime. The DateTime contains the same information, but is easier to manipulate.',
363
- examples: [
364
- {
365
- example: "jsDate = new Date('2024-03-30T18:49')\njsDate.toDateTime().plus(5, 'days')",
366
- evaluated: '[DateTime: 2024-05-05T18:49:00.000Z]',
367
- },
368
- ],
369
- returnType: 'DateTime',
370
- hidden: true,
371
- docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-toDateTime',
372
- };
373
- minus.doc = {
374
- name: 'minus',
375
- description: 'Subtracts a given period of time from the DateTime',
376
- examples: [
377
- {
378
- example: "dt = '2024-03-30T18:49'.toDateTime()\ndt.minus(7, 'days')",
379
- evaluated: '[DateTime: 2024-04-23T18:49:00.000Z]',
380
- },
381
- {
382
- example: "dt = '2024-03-30T18:49'.toDateTime()\ndt.minus(4, 'years')",
383
- evaluated: '[DateTime: 2020-04-30T18:49:00.000Z]',
384
- },
385
- ],
386
- section: 'edit',
387
- returnType: 'DateTime',
388
- args: [
389
- {
390
- name: 'n',
391
- 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.',
392
- type: 'number | object',
393
- },
394
- {
395
- name: 'unit',
396
- optional: true,
397
- 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>',
398
- default: '"milliseconds"',
399
- type: 'string',
400
- },
401
- ],
402
- docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-minus',
403
- };
404
- plus.doc = {
405
- name: 'plus',
406
- description: 'Adds a given period of time to the DateTime',
407
- examples: [
408
- {
409
- example: "dt = '2024-03-30T18:49'.toDateTime()\ndt.plus(7, 'days')",
410
- evaluated: '[DateTime: 2024-04-07T18:49:00.000Z]',
411
- },
412
- {
413
- example: "dt = '2024-03-30T18:49'.toDateTime()\ndt.plus(4, 'years')",
414
- evaluated: '[DateTime: 2028-03-30T18:49:00.000Z]',
415
- },
416
- ],
417
- section: 'edit',
418
- returnType: 'DateTime',
419
- args: [
420
- {
421
- name: 'n',
422
- 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.',
423
- type: 'number | object',
424
- },
425
- {
426
- name: 'unit',
427
- optional: true,
428
- 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>',
429
- default: '"milliseconds"',
430
- type: 'string',
431
- },
432
- ],
433
- docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-plus',
434
- };
435
- diffTo.doc = {
436
- name: 'diffTo',
437
- description: 'Returns the difference between two DateTimes, in the given unit(s)',
438
- examples: [
439
- {
440
- example: "dt = '2025-01-01'.toDateTime()\ndt.diffTo('2024-03-30T18:49:07.234', 'days')",
441
- evaluated: '276.21',
442
- },
443
- {
444
- example: "dt1 = '2025-01-01T00:00:00.000'.toDateTime();\ndt2 = '2024-03-30T18:49:07.234'.toDateTime();\ndt1.diffTo(dt2, ['months', 'days'])",
445
- evaluated: '{ months: 9, days: 1.21 }',
446
- },
447
- ],
448
- section: 'compare',
449
- returnType: 'number | Record<DurationUnit, number>',
450
- args: [
451
- {
452
- name: 'otherDateTime',
453
- default: '$now',
454
- description: 'The moment to subtract the base DateTime from. Can be an ISO date string or a Luxon DateTime.',
455
- type: 'string | DateTime',
456
- },
457
- {
458
- name: 'unit',
459
- default: "'days'",
460
- 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>.',
461
- type: 'string | string[]',
462
- },
463
- ],
464
- docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-diffTo',
465
- };
466
- diffToNow.doc = {
467
- name: 'diffToNow',
468
- 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.',
469
- examples: [
470
- {
471
- example: "dt = '2023-03-30T18:49:07.234'.toDateTime()\ndt.diffToNow('days')",
472
- evaluated: '371.9',
473
- },
474
- {
475
- example: "dt = '2023-03-30T18:49:07.234'.toDateTime()\ndt.diffToNow(['months', 'days'])",
476
- evaluated: '{ months: 12, days: 5.9 }',
477
- },
478
- ],
479
- section: 'compare',
480
- returnType: 'number | Record<DurationUnit, number>',
481
- args: [
482
- {
483
- name: 'unit',
484
- 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>.',
485
- default: "'days'",
486
- type: 'string | string[]',
487
- },
488
- ],
489
- docURL: 'https://docs.n8n.io/code/builtin/data-transformation-functions/dates/#date-diffToNow',
490
- };
491
- isEmpty.doc = {
492
- name: 'isEmpty',
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