@atom8n/n8n-core 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (352) hide show
  1. package/README.md +13 -0
  2. package/bin/common.js +19 -0
  3. package/bin/copy-static-files +24 -0
  4. package/bin/generate-metadata +75 -0
  5. package/bin/generate-translations +99 -0
  6. package/dist/binary-data/binary-data.config.d.ts +15 -0
  7. package/dist/binary-data/binary-data.config.js +62 -0
  8. package/dist/binary-data/binary-data.config.js.map +1 -0
  9. package/dist/binary-data/binary-data.service.d.ts +32 -0
  10. package/dist/binary-data/binary-data.service.js +243 -0
  11. package/dist/binary-data/binary-data.service.js.map +1 -0
  12. package/dist/binary-data/file-system.manager.d.ts +31 -0
  13. package/dist/binary-data/file-system.manager.js +154 -0
  14. package/dist/binary-data/file-system.manager.js.map +1 -0
  15. package/dist/binary-data/index.d.ts +5 -0
  16. package/dist/binary-data/index.js +27 -0
  17. package/dist/binary-data/index.js.map +1 -0
  18. package/dist/binary-data/object-store/object-store.config.d.ts +19 -0
  19. package/dist/binary-data/object-store/object-store.config.js +83 -0
  20. package/dist/binary-data/object-store/object-store.config.js.map +1 -0
  21. package/dist/binary-data/object-store/object-store.service.ee.d.ts +46 -0
  22. package/dist/binary-data/object-store/object-store.service.ee.js +235 -0
  23. package/dist/binary-data/object-store/object-store.service.ee.js.map +1 -0
  24. package/dist/binary-data/object-store/types.d.ts +8 -0
  25. package/dist/binary-data/object-store/types.js +3 -0
  26. package/dist/binary-data/object-store/types.js.map +1 -0
  27. package/dist/binary-data/object-store.manager.d.ts +23 -0
  28. package/dist/binary-data/object-store.manager.js +86 -0
  29. package/dist/binary-data/object-store.manager.js.map +1 -0
  30. package/dist/binary-data/types.d.ts +46 -0
  31. package/dist/binary-data/types.js +3 -0
  32. package/dist/binary-data/types.js.map +1 -0
  33. package/dist/binary-data/utils.d.ts +15 -0
  34. package/dist/binary-data/utils.js +66 -0
  35. package/dist/binary-data/utils.js.map +1 -0
  36. package/dist/build.tsbuildinfo +1 -0
  37. package/dist/constants.d.ts +19 -0
  38. package/dist/constants.js +23 -0
  39. package/dist/constants.js.map +1 -0
  40. package/dist/credentials.d.ts +12 -0
  41. package/dist/credentials.js +99 -0
  42. package/dist/credentials.js.map +1 -0
  43. package/dist/data-deduplication-service.d.ts +16 -0
  44. package/dist/data-deduplication-service.js +95 -0
  45. package/dist/data-deduplication-service.js.map +1 -0
  46. package/dist/encryption/cipher.d.ts +8 -0
  47. package/dist/encryption/cipher.js +57 -0
  48. package/dist/encryption/cipher.js.map +1 -0
  49. package/dist/encryption/index.d.ts +1 -0
  50. package/dist/encryption/index.js +6 -0
  51. package/dist/encryption/index.js.map +1 -0
  52. package/dist/errors/abstract/binary-data.error.d.ts +3 -0
  53. package/dist/errors/abstract/binary-data.error.js +8 -0
  54. package/dist/errors/abstract/binary-data.error.js.map +1 -0
  55. package/dist/errors/abstract/filesystem.error.d.ts +4 -0
  56. package/dist/errors/abstract/filesystem.error.js +11 -0
  57. package/dist/errors/abstract/filesystem.error.js.map +1 -0
  58. package/dist/errors/binary-data-file-not-found.error.d.ts +4 -0
  59. package/dist/errors/binary-data-file-not-found.error.js +11 -0
  60. package/dist/errors/binary-data-file-not-found.error.js.map +1 -0
  61. package/dist/errors/disallowed-filepath.error.d.ts +4 -0
  62. package/dist/errors/disallowed-filepath.error.js +11 -0
  63. package/dist/errors/disallowed-filepath.error.js.map +1 -0
  64. package/dist/errors/error-reporter.d.ts +35 -0
  65. package/dist/errors/error-reporter.js +256 -0
  66. package/dist/errors/error-reporter.js.map +1 -0
  67. package/dist/errors/file-not-found.error.d.ts +4 -0
  68. package/dist/errors/file-not-found.error.js +11 -0
  69. package/dist/errors/file-not-found.error.js.map +1 -0
  70. package/dist/errors/file-too-large.error.d.ts +9 -0
  71. package/dist/errors/file-too-large.error.js +13 -0
  72. package/dist/errors/file-too-large.error.js.map +1 -0
  73. package/dist/errors/index.d.ts +11 -0
  74. package/dist/errors/index.js +26 -0
  75. package/dist/errors/index.js.map +1 -0
  76. package/dist/errors/invalid-execution-metadata.error.d.ts +5 -0
  77. package/dist/errors/invalid-execution-metadata.error.js +12 -0
  78. package/dist/errors/invalid-execution-metadata.error.js.map +1 -0
  79. package/dist/errors/invalid-manager.error.d.ts +4 -0
  80. package/dist/errors/invalid-manager.error.js +11 -0
  81. package/dist/errors/invalid-manager.error.js.map +1 -0
  82. package/dist/errors/invalid-source-type.error.d.ts +4 -0
  83. package/dist/errors/invalid-source-type.error.js +11 -0
  84. package/dist/errors/invalid-source-type.error.js.map +1 -0
  85. package/dist/errors/missing-source-id.error.d.ts +4 -0
  86. package/dist/errors/missing-source-id.error.js +11 -0
  87. package/dist/errors/missing-source-id.error.js.map +1 -0
  88. package/dist/errors/unrecognized-credential-type.error.d.ts +4 -0
  89. package/dist/errors/unrecognized-credential-type.error.js +11 -0
  90. package/dist/errors/unrecognized-credential-type.error.js.map +1 -0
  91. package/dist/errors/unrecognized-node-type.error.d.ts +4 -0
  92. package/dist/errors/unrecognized-node-type.error.js +11 -0
  93. package/dist/errors/unrecognized-node-type.error.js.map +1 -0
  94. package/dist/errors/workflow-has-issues.error.d.ts +4 -0
  95. package/dist/errors/workflow-has-issues.error.js +11 -0
  96. package/dist/errors/workflow-has-issues.error.js.map +1 -0
  97. package/dist/execution-engine/active-workflows.d.ts +23 -0
  98. package/dist/execution-engine/active-workflows.js +153 -0
  99. package/dist/execution-engine/active-workflows.js.map +1 -0
  100. package/dist/execution-engine/execution-context-hook-registry.service.d.ts +12 -0
  101. package/dist/execution-engine/execution-context-hook-registry.service.js +69 -0
  102. package/dist/execution-engine/execution-context-hook-registry.service.js.map +1 -0
  103. package/dist/execution-engine/execution-context.d.ts +2 -0
  104. package/dist/execution-engine/execution-context.js +56 -0
  105. package/dist/execution-engine/execution-context.js.map +1 -0
  106. package/dist/execution-engine/execution-context.service.d.ts +17 -0
  107. package/dist/execution-engine/execution-context.service.js +108 -0
  108. package/dist/execution-engine/execution-context.service.js.map +1 -0
  109. package/dist/execution-engine/execution-lifecycle-hooks.d.ts +20 -0
  110. package/dist/execution-engine/execution-lifecycle-hooks.js +31 -0
  111. package/dist/execution-engine/execution-lifecycle-hooks.js.map +1 -0
  112. package/dist/execution-engine/external-secrets-proxy.d.ts +18 -0
  113. package/dist/execution-engine/external-secrets-proxy.js +38 -0
  114. package/dist/execution-engine/external-secrets-proxy.js.map +1 -0
  115. package/dist/execution-engine/index.d.ts +26 -0
  116. package/dist/execution-engine/index.js +31 -0
  117. package/dist/execution-engine/index.js.map +1 -0
  118. package/dist/execution-engine/interfaces.d.ts +7 -0
  119. package/dist/execution-engine/interfaces.js +3 -0
  120. package/dist/execution-engine/interfaces.js.map +1 -0
  121. package/dist/execution-engine/node-execution-context/base-execute-context.d.ts +47 -0
  122. package/dist/execution-engine/node-execution-context/base-execute-context.js +150 -0
  123. package/dist/execution-engine/node-execution-context/base-execute-context.js.map +1 -0
  124. package/dist/execution-engine/node-execution-context/credentials-test-context.d.ts +7 -0
  125. package/dist/execution-engine/node-execution-context/credentials-test-context.js +37 -0
  126. package/dist/execution-engine/node-execution-context/credentials-test-context.js.map +1 -0
  127. package/dist/execution-engine/node-execution-context/execute-context.d.ts +24 -0
  128. package/dist/execution-engine/node-execution-context/execute-context.js +108 -0
  129. package/dist/execution-engine/node-execution-context/execute-context.js.map +1 -0
  130. package/dist/execution-engine/node-execution-context/execute-single-context.d.ts +15 -0
  131. package/dist/execution-engine/node-execution-context/execute-single-context.js +53 -0
  132. package/dist/execution-engine/node-execution-context/execute-single-context.js.map +1 -0
  133. package/dist/execution-engine/node-execution-context/hook-context.d.ts +13 -0
  134. package/dist/execution-engine/node-execution-context/hook-context.js +35 -0
  135. package/dist/execution-engine/node-execution-context/hook-context.js.map +1 -0
  136. package/dist/execution-engine/node-execution-context/index.d.ts +17 -0
  137. package/dist/execution-engine/node-execution-context/index.js +51 -0
  138. package/dist/execution-engine/node-execution-context/index.js.map +1 -0
  139. package/dist/execution-engine/node-execution-context/load-options-context.d.ts +10 -0
  140. package/dist/execution-engine/node-execution-context/load-options-context.js +43 -0
  141. package/dist/execution-engine/node-execution-context/load-options-context.js.map +1 -0
  142. package/dist/execution-engine/node-execution-context/local-load-options-context.d.ts +10 -0
  143. package/dist/execution-engine/node-execution-context/local-load-options-context.js +51 -0
  144. package/dist/execution-engine/node-execution-context/local-load-options-context.js.map +1 -0
  145. package/dist/execution-engine/node-execution-context/node-execution-context.d.ts +68 -0
  146. package/dist/execution-engine/node-execution-context/node-execution-context.js +324 -0
  147. package/dist/execution-engine/node-execution-context/node-execution-context.js.map +1 -0
  148. package/dist/execution-engine/node-execution-context/poll-context.d.ts +11 -0
  149. package/dist/execution-engine/node-execution-context/poll-context.js +38 -0
  150. package/dist/execution-engine/node-execution-context/poll-context.js.map +1 -0
  151. package/dist/execution-engine/node-execution-context/supply-data-context.d.ts +26 -0
  152. package/dist/execution-engine/node-execution-context/supply-data-context.js +181 -0
  153. package/dist/execution-engine/node-execution-context/supply-data-context.js.map +1 -0
  154. package/dist/execution-engine/node-execution-context/trigger-context.d.ts +11 -0
  155. package/dist/execution-engine/node-execution-context/trigger-context.js +40 -0
  156. package/dist/execution-engine/node-execution-context/trigger-context.js.map +1 -0
  157. package/dist/execution-engine/node-execution-context/utils/binary-helper-functions.d.ts +10 -0
  158. package/dist/execution-engine/node-execution-context/utils/binary-helper-functions.js +213 -0
  159. package/dist/execution-engine/node-execution-context/utils/binary-helper-functions.js.map +1 -0
  160. package/dist/execution-engine/node-execution-context/utils/cleanup-parameter-data.d.ts +2 -0
  161. package/dist/execution-engine/node-execution-context/utils/cleanup-parameter-data.js +27 -0
  162. package/dist/execution-engine/node-execution-context/utils/cleanup-parameter-data.js.map +1 -0
  163. package/dist/execution-engine/node-execution-context/utils/construct-execution-metadata.d.ts +4 -0
  164. package/dist/execution-engine/node-execution-context/utils/construct-execution-metadata.js +11 -0
  165. package/dist/execution-engine/node-execution-context/utils/construct-execution-metadata.js.map +1 -0
  166. package/dist/execution-engine/node-execution-context/utils/copy-input-items.d.ts +2 -0
  167. package/dist/execution-engine/node-execution-context/utils/copy-input-items.js +19 -0
  168. package/dist/execution-engine/node-execution-context/utils/copy-input-items.js.map +1 -0
  169. package/dist/execution-engine/node-execution-context/utils/create-node-as-tool.d.ts +21 -0
  170. package/dist/execution-engine/node-execution-context/utils/create-node-as-tool.js +65 -0
  171. package/dist/execution-engine/node-execution-context/utils/create-node-as-tool.js.map +1 -0
  172. package/dist/execution-engine/node-execution-context/utils/data-table-helper-functions.d.ts +2 -0
  173. package/dist/execution-engine/node-execution-context/utils/data-table-helper-functions.js +13 -0
  174. package/dist/execution-engine/node-execution-context/utils/data-table-helper-functions.js.map +1 -0
  175. package/dist/execution-engine/node-execution-context/utils/deduplication-helper-functions.d.ts +2 -0
  176. package/dist/execution-engine/node-execution-context/utils/deduplication-helper-functions.js +38 -0
  177. package/dist/execution-engine/node-execution-context/utils/deduplication-helper-functions.js.map +1 -0
  178. package/dist/execution-engine/node-execution-context/utils/ensure-type.d.ts +6 -0
  179. package/dist/execution-engine/node-execution-context/utils/ensure-type.js +75 -0
  180. package/dist/execution-engine/node-execution-context/utils/ensure-type.js.map +1 -0
  181. package/dist/execution-engine/node-execution-context/utils/execution-metadata.d.ts +6 -0
  182. package/dist/execution-engine/node-execution-context/utils/execution-metadata.js +57 -0
  183. package/dist/execution-engine/node-execution-context/utils/execution-metadata.js.map +1 -0
  184. package/dist/execution-engine/node-execution-context/utils/extract-value.d.ts +2 -0
  185. package/dist/execution-engine/node-execution-context/utils/extract-value.js +135 -0
  186. package/dist/execution-engine/node-execution-context/utils/extract-value.js.map +1 -0
  187. package/dist/execution-engine/node-execution-context/utils/file-system-helper-functions.d.ts +2 -0
  188. package/dist/execution-engine/node-execution-context/utils/file-system-helper-functions.js +144 -0
  189. package/dist/execution-engine/node-execution-context/utils/file-system-helper-functions.js.map +1 -0
  190. package/dist/execution-engine/node-execution-context/utils/get-additional-keys.d.ts +4 -0
  191. package/dist/execution-engine/node-execution-context/utils/get-additional-keys.js +57 -0
  192. package/dist/execution-engine/node-execution-context/utils/get-additional-keys.js.map +1 -0
  193. package/dist/execution-engine/node-execution-context/utils/get-input-connection-data.d.ts +5 -0
  194. package/dist/execution-engine/node-execution-context/utils/get-input-connection-data.js +211 -0
  195. package/dist/execution-engine/node-execution-context/utils/get-input-connection-data.js.map +1 -0
  196. package/dist/execution-engine/node-execution-context/utils/get-secrets-proxy.d.ts +2 -0
  197. package/dist/execution-engine/node-execution-context/utils/get-secrets-proxy.js +68 -0
  198. package/dist/execution-engine/node-execution-context/utils/get-secrets-proxy.js.map +1 -0
  199. package/dist/execution-engine/node-execution-context/utils/normalize-items.d.ts +2 -0
  200. package/dist/execution-engine/node-execution-context/utils/normalize-items.js +36 -0
  201. package/dist/execution-engine/node-execution-context/utils/normalize-items.js.map +1 -0
  202. package/dist/execution-engine/node-execution-context/utils/parse-incoming-message.d.ts +16 -0
  203. package/dist/execution-engine/node-execution-context/utils/parse-incoming-message.js +57 -0
  204. package/dist/execution-engine/node-execution-context/utils/parse-incoming-message.js.map +1 -0
  205. package/dist/execution-engine/node-execution-context/utils/request-helper-functions.d.ts +18 -0
  206. package/dist/execution-engine/node-execution-context/utils/request-helper-functions.js +1213 -0
  207. package/dist/execution-engine/node-execution-context/utils/request-helper-functions.js.map +1 -0
  208. package/dist/execution-engine/node-execution-context/utils/return-json-array.d.ts +2 -0
  209. package/dist/execution-engine/node-execution-context/utils/return-json-array.js +19 -0
  210. package/dist/execution-engine/node-execution-context/utils/return-json-array.js.map +1 -0
  211. package/dist/execution-engine/node-execution-context/utils/scheduling-helper-functions.d.ts +2 -0
  212. package/dist/execution-engine/node-execution-context/utils/scheduling-helper-functions.js +22 -0
  213. package/dist/execution-engine/node-execution-context/utils/scheduling-helper-functions.js.map +1 -0
  214. package/dist/execution-engine/node-execution-context/utils/ssh-tunnel-helper-functions.d.ts +2 -0
  215. package/dist/execution-engine/node-execution-context/utils/ssh-tunnel-helper-functions.js +14 -0
  216. package/dist/execution-engine/node-execution-context/utils/ssh-tunnel-helper-functions.js.map +1 -0
  217. package/dist/execution-engine/node-execution-context/utils/validate-value-against-schema.d.ts +2 -0
  218. package/dist/execution-engine/node-execution-context/utils/validate-value-against-schema.js +132 -0
  219. package/dist/execution-engine/node-execution-context/utils/validate-value-against-schema.js.map +1 -0
  220. package/dist/execution-engine/node-execution-context/utils/webhook-helper-functions.d.ts +3 -0
  221. package/dist/execution-engine/node-execution-context/utils/webhook-helper-functions.js +31 -0
  222. package/dist/execution-engine/node-execution-context/utils/webhook-helper-functions.js.map +1 -0
  223. package/dist/execution-engine/node-execution-context/webhook-context.d.ts +21 -0
  224. package/dist/execution-engine/node-execution-context/webhook-context.js +87 -0
  225. package/dist/execution-engine/node-execution-context/webhook-context.js.map +1 -0
  226. package/dist/execution-engine/node-execution-context/workflow-node-context.d.ts +6 -0
  227. package/dist/execution-engine/node-execution-context/workflow-node-context.js +14 -0
  228. package/dist/execution-engine/node-execution-context/workflow-node-context.js.map +1 -0
  229. package/dist/execution-engine/partial-execution-utils/clean-run-data.d.ts +3 -0
  230. package/dist/execution-engine/partial-execution-utils/clean-run-data.js +28 -0
  231. package/dist/execution-engine/partial-execution-utils/clean-run-data.js.map +1 -0
  232. package/dist/execution-engine/partial-execution-utils/directed-graph.d.ts +65 -0
  233. package/dist/execution-engine/partial-execution-utils/directed-graph.js +370 -0
  234. package/dist/execution-engine/partial-execution-utils/directed-graph.js.map +1 -0
  235. package/dist/execution-engine/partial-execution-utils/filter-disabled-nodes.d.ts +2 -0
  236. package/dist/execution-engine/partial-execution-utils/filter-disabled-nodes.js +17 -0
  237. package/dist/execution-engine/partial-execution-utils/filter-disabled-nodes.js.map +1 -0
  238. package/dist/execution-engine/partial-execution-utils/find-start-nodes.d.ts +10 -0
  239. package/dist/execution-engine/partial-execution-utils/find-start-nodes.js +74 -0
  240. package/dist/execution-engine/partial-execution-utils/find-start-nodes.js.map +1 -0
  241. package/dist/execution-engine/partial-execution-utils/find-subgraph.d.ts +7 -0
  242. package/dist/execution-engine/partial-execution-utils/find-subgraph.js +59 -0
  243. package/dist/execution-engine/partial-execution-utils/find-subgraph.js.map +1 -0
  244. package/dist/execution-engine/partial-execution-utils/find-trigger-for-partial-execution.d.ts +4 -0
  245. package/dist/execution-engine/partial-execution-utils/find-trigger-for-partial-execution.js +102 -0
  246. package/dist/execution-engine/partial-execution-utils/find-trigger-for-partial-execution.js.map +1 -0
  247. package/dist/execution-engine/partial-execution-utils/get-incoming-data.d.ts +6 -0
  248. package/dist/execution-engine/partial-execution-utils/get-incoming-data.js +21 -0
  249. package/dist/execution-engine/partial-execution-utils/get-incoming-data.js.map +1 -0
  250. package/dist/execution-engine/partial-execution-utils/get-source-data-groups.d.ts +8 -0
  251. package/dist/execution-engine/partial-execution-utils/get-source-data-groups.js +65 -0
  252. package/dist/execution-engine/partial-execution-utils/get-source-data-groups.js.map +1 -0
  253. package/dist/execution-engine/partial-execution-utils/handle-cycles.d.ts +3 -0
  254. package/dist/execution-engine/partial-execution-utils/handle-cycles.js +60 -0
  255. package/dist/execution-engine/partial-execution-utils/handle-cycles.js.map +1 -0
  256. package/dist/execution-engine/partial-execution-utils/index.d.ts +10 -0
  257. package/dist/execution-engine/partial-execution-utils/index.js +25 -0
  258. package/dist/execution-engine/partial-execution-utils/index.js.map +1 -0
  259. package/dist/execution-engine/partial-execution-utils/recreate-node-execution-stack.d.ts +9 -0
  260. package/dist/execution-engine/partial-execution-utils/recreate-node-execution-stack.js +146 -0
  261. package/dist/execution-engine/partial-execution-utils/recreate-node-execution-stack.js.map +1 -0
  262. package/dist/execution-engine/partial-execution-utils/rewire-graph.d.ts +3 -0
  263. package/dist/execution-engine/partial-execution-utils/rewire-graph.js +72 -0
  264. package/dist/execution-engine/partial-execution-utils/rewire-graph.js.map +1 -0
  265. package/dist/execution-engine/partial-execution-utils/run-data-utils.d.ts +2 -0
  266. package/dist/execution-engine/partial-execution-utils/run-data-utils.js +15 -0
  267. package/dist/execution-engine/partial-execution-utils/run-data-utils.js.map +1 -0
  268. package/dist/execution-engine/requests-response.d.ts +23 -0
  269. package/dist/execution-engine/requests-response.js +128 -0
  270. package/dist/execution-engine/requests-response.js.map +1 -0
  271. package/dist/execution-engine/routing-node.d.ts +17 -0
  272. package/dist/execution-engine/routing-node.js +571 -0
  273. package/dist/execution-engine/routing-node.js.map +1 -0
  274. package/dist/execution-engine/scheduled-task-manager.d.ts +27 -0
  275. package/dist/execution-engine/scheduled-task-manager.js +140 -0
  276. package/dist/execution-engine/scheduled-task-manager.js.map +1 -0
  277. package/dist/execution-engine/ssh-clients-manager.d.ts +27 -0
  278. package/dist/execution-engine/ssh-clients-manager.js +170 -0
  279. package/dist/execution-engine/ssh-clients-manager.js.map +1 -0
  280. package/dist/execution-engine/triggers-and-pollers.d.ts +6 -0
  281. package/dist/execution-engine/triggers-and-pollers.js +66 -0
  282. package/dist/execution-engine/triggers-and-pollers.js.map +1 -0
  283. package/dist/execution-engine/workflow-execute.d.ts +46 -0
  284. package/dist/execution-engine/workflow-execute.js +1490 -0
  285. package/dist/execution-engine/workflow-execute.js.map +1 -0
  286. package/dist/html-sandbox.d.ts +3 -0
  287. package/dist/html-sandbox.js +19 -0
  288. package/dist/html-sandbox.js.map +1 -0
  289. package/dist/http-proxy.d.ts +6 -0
  290. package/dist/http-proxy.js +109 -0
  291. package/dist/http-proxy.js.map +1 -0
  292. package/dist/index.d.ts +17 -0
  293. package/dist/index.js +57 -0
  294. package/dist/index.js.map +1 -0
  295. package/dist/instance-settings/index.d.ts +1 -0
  296. package/dist/instance-settings/index.js +6 -0
  297. package/dist/instance-settings/index.js.map +1 -0
  298. package/dist/instance-settings/instance-settings.d.ts +49 -0
  299. package/dist/instance-settings/instance-settings.js +210 -0
  300. package/dist/instance-settings/instance-settings.js.map +1 -0
  301. package/dist/instance-settings/worker-missing-encryption-key.error.d.ts +4 -0
  302. package/dist/instance-settings/worker-missing-encryption-key.error.js +15 -0
  303. package/dist/instance-settings/worker-missing-encryption-key.error.js.map +1 -0
  304. package/dist/interfaces.d.ts +16 -0
  305. package/dist/interfaces.js +3 -0
  306. package/dist/interfaces.js.map +1 -0
  307. package/dist/node-execute-functions.d.ts +3 -0
  308. package/dist/node-execute-functions.js +12 -0
  309. package/dist/node-execute-functions.js.map +1 -0
  310. package/dist/nodes-loader/constants.d.ts +5 -0
  311. package/dist/nodes-loader/constants.js +106 -0
  312. package/dist/nodes-loader/constants.js.map +1 -0
  313. package/dist/nodes-loader/custom-directory-loader.d.ts +6 -0
  314. package/dist/nodes-loader/custom-directory-loader.js +34 -0
  315. package/dist/nodes-loader/custom-directory-loader.js.map +1 -0
  316. package/dist/nodes-loader/directory-loader.d.ts +41 -0
  317. package/dist/nodes-loader/directory-loader.js +371 -0
  318. package/dist/nodes-loader/directory-loader.js.map +1 -0
  319. package/dist/nodes-loader/index.d.ts +5 -0
  320. package/dist/nodes-loader/index.js +12 -0
  321. package/dist/nodes-loader/index.js.map +1 -0
  322. package/dist/nodes-loader/lazy-package-directory-loader.d.ts +4 -0
  323. package/dist/nodes-loader/lazy-package-directory-loader.js +42 -0
  324. package/dist/nodes-loader/lazy-package-directory-loader.js.map +1 -0
  325. package/dist/nodes-loader/load-class-in-isolation.d.ts +1 -0
  326. package/dist/nodes-loader/load-class-in-isolation.js +20 -0
  327. package/dist/nodes-loader/load-class-in-isolation.js.map +1 -0
  328. package/dist/nodes-loader/package-directory-loader.d.ts +12 -0
  329. package/dist/nodes-loader/package-directory-loader.js +86 -0
  330. package/dist/nodes-loader/package-directory-loader.js.map +1 -0
  331. package/dist/nodes-loader/types.d.ts +14 -0
  332. package/dist/nodes-loader/types.js +3 -0
  333. package/dist/nodes-loader/types.js.map +1 -0
  334. package/dist/utils/assertions.d.ts +2 -0
  335. package/dist/utils/assertions.js +16 -0
  336. package/dist/utils/assertions.js.map +1 -0
  337. package/dist/utils/deep-merge.d.ts +1 -0
  338. package/dist/utils/deep-merge.js +33 -0
  339. package/dist/utils/deep-merge.js.map +1 -0
  340. package/dist/utils/index.d.ts +2 -0
  341. package/dist/utils/index.js +19 -0
  342. package/dist/utils/index.js.map +1 -0
  343. package/dist/utils/is-json-compatible.d.ts +7 -0
  344. package/dist/utils/is-json-compatible.js +81 -0
  345. package/dist/utils/is-json-compatible.js.map +1 -0
  346. package/dist/utils/serialized-buffer.d.ts +6 -0
  347. package/dist/utils/serialized-buffer.js +16 -0
  348. package/dist/utils/serialized-buffer.js.map +1 -0
  349. package/dist/utils/signature-helpers.d.ts +2 -0
  350. package/dist/utils/signature-helpers.js +16 -0
  351. package/dist/utils/signature-helpers.js.map +1 -0
  352. package/package.json +81 -0
@@ -0,0 +1,140 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ScheduledTaskManager = void 0;
13
+ const backend_common_1 = require("@n8n/backend-common");
14
+ const config_1 = require("@n8n/config");
15
+ const constants_1 = require("@n8n/constants");
16
+ const di_1 = require("@n8n/di");
17
+ const cron_1 = require("cron");
18
+ const errors_1 = require("../errors");
19
+ const instance_settings_1 = require("../instance-settings");
20
+ let ScheduledTaskManager = class ScheduledTaskManager {
21
+ get loggableCrons() {
22
+ const loggableCrons = {};
23
+ for (const [workflowId, crons] of this.cronsByWorkflow) {
24
+ loggableCrons[`workflowId-${workflowId}`] = Array.from(crons.values()).map(({ summary }) => summary);
25
+ }
26
+ return loggableCrons;
27
+ }
28
+ constructor(instanceSettings, logger, { activeInterval }, errorReporter) {
29
+ this.instanceSettings = instanceSettings;
30
+ this.logger = logger;
31
+ this.errorReporter = errorReporter;
32
+ this.cronsByWorkflow = new Map();
33
+ this.logger = this.logger.scoped('cron');
34
+ if (activeInterval === 0)
35
+ return;
36
+ this.logInterval = setInterval(() => {
37
+ if (Object.keys(this.loggableCrons).length === 0)
38
+ return;
39
+ this.logger.debug('Currently active crons', { active: this.loggableCrons });
40
+ }, activeInterval * constants_1.Time.minutes.toMilliseconds);
41
+ }
42
+ registerCron(ctx, onTick) {
43
+ const { workflowId, timezone, nodeId, expression, recurrence } = ctx;
44
+ const summary = recurrence?.activated
45
+ ? `${expression} (every ${recurrence.intervalSize} ${recurrence.typeInterval})`
46
+ : expression;
47
+ const workflowCrons = this.cronsByWorkflow.get(workflowId);
48
+ const key = this.toCronKey({ workflowId, nodeId, expression, timezone, recurrence });
49
+ if (workflowCrons?.has(key)) {
50
+ this.errorReporter.error('Skipped registration for already registered cron', {
51
+ tags: { cron: 'duplicate' },
52
+ extra: {
53
+ workflowId,
54
+ timezone,
55
+ nodeId,
56
+ expression,
57
+ recurrence,
58
+ instanceRole: this.instanceSettings.instanceRole,
59
+ },
60
+ });
61
+ return;
62
+ }
63
+ const job = new cron_1.CronJob(expression, () => {
64
+ if (!this.instanceSettings.isLeader)
65
+ return;
66
+ this.logger.debug('Executing cron for workflow', {
67
+ workflowId,
68
+ nodeId,
69
+ cron: summary,
70
+ instanceRole: this.instanceSettings.instanceRole,
71
+ });
72
+ onTick();
73
+ }, undefined, true, timezone);
74
+ const cron = { job, summary, ctx };
75
+ if (!workflowCrons) {
76
+ this.cronsByWorkflow.set(workflowId, new Map([[key, cron]]));
77
+ }
78
+ else {
79
+ workflowCrons.set(key, cron);
80
+ }
81
+ this.logger.debug('Registered cron for workflow', {
82
+ workflowId,
83
+ cron: summary,
84
+ instanceRole: this.instanceSettings.instanceRole,
85
+ });
86
+ }
87
+ deregisterCrons(workflowId) {
88
+ const workflowCrons = this.cronsByWorkflow.get(workflowId);
89
+ if (!workflowCrons || workflowCrons.size === 0)
90
+ return;
91
+ const summaries = [];
92
+ for (const cron of workflowCrons.values()) {
93
+ summaries.push(cron.summary);
94
+ cron.job.stop();
95
+ }
96
+ this.cronsByWorkflow.delete(workflowId);
97
+ this.logger.info('Deregistered all crons for workflow', {
98
+ workflowId,
99
+ crons: summaries,
100
+ instanceRole: this.instanceSettings.instanceRole,
101
+ });
102
+ }
103
+ deregisterAllCrons() {
104
+ for (const workflowId of this.cronsByWorkflow.keys()) {
105
+ this.deregisterCrons(workflowId);
106
+ }
107
+ clearInterval(this.logInterval);
108
+ this.logInterval = undefined;
109
+ }
110
+ toCronKey(ctx) {
111
+ const { recurrence, ...rest } = ctx;
112
+ const flattened = !recurrence
113
+ ? rest
114
+ : {
115
+ ...rest,
116
+ recurrenceActivated: recurrence.activated,
117
+ ...(recurrence.activated && {
118
+ recurrenceIndex: recurrence.index,
119
+ recurrenceIntervalSize: recurrence.intervalSize,
120
+ recurrenceTypeInterval: recurrence.typeInterval,
121
+ }),
122
+ };
123
+ const sorted = Object.keys(flattened)
124
+ .sort()
125
+ .reduce((result, key) => {
126
+ result[key] = flattened[key];
127
+ return result;
128
+ }, {});
129
+ return JSON.stringify(sorted);
130
+ }
131
+ };
132
+ exports.ScheduledTaskManager = ScheduledTaskManager;
133
+ exports.ScheduledTaskManager = ScheduledTaskManager = __decorate([
134
+ (0, di_1.Service)(),
135
+ __metadata("design:paramtypes", [instance_settings_1.InstanceSettings,
136
+ backend_common_1.Logger,
137
+ config_1.CronLoggingConfig,
138
+ errors_1.ErrorReporter])
139
+ ], ScheduledTaskManager);
140
+ //# sourceMappingURL=scheduled-task-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scheduled-task-manager.js","sourceRoot":"","sources":["../../src/execution-engine/scheduled-task-manager.ts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AAE,CAAC;YACtD,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;QAClC,CAAC;QAED,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAChC,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;IAC9B,CAAC;IAEO,SAAS,CAAC,GAAgB;QACjC,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,GAAG,CAAC;QACpC,MAAM,SAAS,GAA4B,CAAC,UAAU;YACrD,CAAC,CAAC,IAAI;YACN,CAAC,CAAC;gBACA,GAAG,IAAI;gBACP,mBAAmB,EAAE,UAAU,CAAC,SAAS;gBACzC,GAAG,CAAC,UAAU,CAAC,SAAS,IAAI;oBAC3B,eAAe,EAAE,UAAU,CAAC,KAAK;oBACjC,sBAAsB,EAAE,UAAU,CAAC,YAAY;oBAC/C,sBAAsB,EAAE,UAAU,CAAC,YAAY;iBAC/C,CAAC;aACF,CAAC;QAEJ,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;aACnC,IAAI,EAAE;aACN,MAAM,CAA0B,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;YAChD,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;YAC7B,OAAO,MAAM,CAAC;QACf,CAAC,EAAE,EAAE,CAAC,CAAC;QAER,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;CACD,CAAA;AAlJY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,YAAO,GAAE;qCAoB2B,oCAAgB;QAC1B,uBAAM;QACX,0BAAiB;QACL,sBAAa;GAtBlC,oBAAoB,CAkJhC"}
@@ -0,0 +1,27 @@
1
+ import { Logger } from '@n8n/backend-common';
2
+ import type { SSHCredentials } from 'n8n-workflow';
3
+ import { Client } from 'ssh2';
4
+ export declare class SSHClientsConfig {
5
+ idleTimeout: number;
6
+ }
7
+ type Registration = {
8
+ client: Client;
9
+ lastUsed: Date;
10
+ abortController: AbortController;
11
+ returnPromise: Promise<Client>;
12
+ };
13
+ export declare class SSHClientsManager {
14
+ private readonly config;
15
+ private readonly logger;
16
+ readonly clients: Map<string, Registration>;
17
+ readonly clientsReversed: WeakMap<Client, string>;
18
+ private cleanupTimer;
19
+ constructor(config: SSHClientsConfig, logger: Logger);
20
+ updateLastUsed(client: Client): void;
21
+ getClient(credentials: SSHCredentials, abortController?: AbortController): Promise<Client>;
22
+ private withCleanupHandler;
23
+ private cleanupClient;
24
+ onShutdown(): void;
25
+ cleanupStaleConnections(): void;
26
+ }
27
+ export {};
@@ -0,0 +1,170 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SSHClientsManager = exports.SSHClientsConfig = void 0;
13
+ const backend_common_1 = require("@n8n/backend-common");
14
+ const config_1 = require("@n8n/config");
15
+ const di_1 = require("@n8n/di");
16
+ const node_crypto_1 = require("node:crypto");
17
+ const ssh2_1 = require("ssh2");
18
+ const zod_1 = require("zod");
19
+ let SSHClientsConfig = class SSHClientsConfig {
20
+ constructor() {
21
+ this.idleTimeout = 5 * 60;
22
+ }
23
+ };
24
+ exports.SSHClientsConfig = SSHClientsConfig;
25
+ __decorate([
26
+ (0, config_1.Env)('N8N_SSH_TUNNEL_IDLE_TIMEOUT', zod_1.z
27
+ .string()
28
+ .transform((value) => Number.parseInt(value))
29
+ .superRefine((value, ctx) => {
30
+ if (Number.isNaN(value)) {
31
+ return ctx.addIssue({
32
+ message: 'must be a valid integer',
33
+ code: 'custom',
34
+ });
35
+ }
36
+ if (value <= 0) {
37
+ return ctx.addIssue({
38
+ message: 'must be positive',
39
+ code: 'too_small',
40
+ minimum: 0,
41
+ inclusive: false,
42
+ type: 'number',
43
+ });
44
+ }
45
+ })),
46
+ __metadata("design:type", Number)
47
+ ], SSHClientsConfig.prototype, "idleTimeout", void 0);
48
+ exports.SSHClientsConfig = SSHClientsConfig = __decorate([
49
+ config_1.Config
50
+ ], SSHClientsConfig);
51
+ let SSHClientsManager = class SSHClientsManager {
52
+ constructor(config, logger) {
53
+ this.config = config;
54
+ this.logger = logger;
55
+ this.clients = new Map();
56
+ this.clientsReversed = new WeakMap();
57
+ process.on('exit', () => this.onShutdown());
58
+ this.cleanupTimer = setInterval(() => this.cleanupStaleConnections(), 60 * 1000);
59
+ this.logger = logger.scoped('ssh-client');
60
+ }
61
+ updateLastUsed(client) {
62
+ const key = this.clientsReversed.get(client);
63
+ if (key) {
64
+ const registration = this.clients.get(key);
65
+ if (registration) {
66
+ registration.lastUsed = new Date();
67
+ }
68
+ }
69
+ else {
70
+ const metadata = {};
71
+ Error.captureStackTrace(metadata, this.updateLastUsed);
72
+ this.logger.warn('Tried to update `lastUsed` for a client that has been cleaned up already. Probably forgot to subscribe to the AbortController somewhere.', metadata);
73
+ }
74
+ }
75
+ async getClient(credentials, abortController) {
76
+ abortController = abortController ?? new AbortController();
77
+ const { sshAuthenticateWith, sshHost, sshPort, sshUser } = credentials;
78
+ const sshConfig = {
79
+ host: sshHost,
80
+ port: sshPort,
81
+ username: sshUser,
82
+ ...(sshAuthenticateWith === 'password'
83
+ ? { password: credentials.sshPassword }
84
+ : {
85
+ privateKey: credentials.privateKey,
86
+ passphrase: credentials.passphrase ?? undefined,
87
+ }),
88
+ };
89
+ const clientHash = (0, node_crypto_1.createHash)('sha1').update(JSON.stringify(sshConfig)).digest('base64');
90
+ const existing = this.clients.get(clientHash);
91
+ if (existing) {
92
+ existing.lastUsed = new Date();
93
+ return await existing.returnPromise;
94
+ }
95
+ const sshClient = this.withCleanupHandler(new ssh2_1.Client(), abortController, clientHash);
96
+ const returnPromise = new Promise((resolve, reject) => {
97
+ sshClient.once('error', reject);
98
+ sshClient.once('ready', () => {
99
+ sshClient.off('error', reject);
100
+ resolve(sshClient);
101
+ });
102
+ sshClient.connect(sshConfig);
103
+ });
104
+ this.clients.set(clientHash, {
105
+ client: sshClient,
106
+ lastUsed: new Date(),
107
+ abortController,
108
+ returnPromise,
109
+ });
110
+ this.clientsReversed.set(sshClient, clientHash);
111
+ return await returnPromise;
112
+ }
113
+ withCleanupHandler(sshClient, abortController, key) {
114
+ sshClient.on('error', (error) => {
115
+ this.logger.error('encountered error, calling cleanup', { error });
116
+ this.cleanupClient(key);
117
+ });
118
+ sshClient.on('end', () => {
119
+ this.logger.debug('socket was disconnected, calling abort signal', {});
120
+ this.cleanupClient(key);
121
+ });
122
+ sshClient.on('close', () => {
123
+ this.logger.debug('socket was closed, calling abort signal', {});
124
+ this.cleanupClient(key);
125
+ });
126
+ abortController.signal.addEventListener('abort', () => {
127
+ this.logger.debug('Got abort signal, cleaning up ssh client.', {
128
+ reason: abortController.signal.reason,
129
+ });
130
+ this.cleanupClient(key);
131
+ });
132
+ return sshClient;
133
+ }
134
+ cleanupClient(key) {
135
+ const registration = this.clients.get(key);
136
+ if (registration) {
137
+ this.clients.delete(key);
138
+ registration.client.end();
139
+ if (!registration.abortController.signal.aborted) {
140
+ registration.abortController.abort();
141
+ }
142
+ }
143
+ }
144
+ onShutdown() {
145
+ this.logger.debug('Shutting down. Cleaning up all clients');
146
+ clearInterval(this.cleanupTimer);
147
+ for (const key of this.clients.keys()) {
148
+ this.cleanupClient(key);
149
+ }
150
+ }
151
+ cleanupStaleConnections() {
152
+ const { clients } = this;
153
+ if (clients.size === 0)
154
+ return;
155
+ const now = Date.now();
156
+ for (const [key, { lastUsed }] of clients.entries()) {
157
+ if (now - lastUsed.getTime() > this.config.idleTimeout * 1000) {
158
+ this.logger.debug('Found stale client. Cleaning it up.');
159
+ this.cleanupClient(key);
160
+ }
161
+ }
162
+ }
163
+ };
164
+ exports.SSHClientsManager = SSHClientsManager;
165
+ exports.SSHClientsManager = SSHClientsManager = __decorate([
166
+ (0, di_1.Service)(),
167
+ __metadata("design:paramtypes", [SSHClientsConfig,
168
+ backend_common_1.Logger])
169
+ ], SSHClientsManager);
170
+ //# sourceMappingURL=ssh-clients-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ssh-clients-manager.js","sourceRoot":"","sources":["../../src/execution-engine/ssh-clients-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA6C;AAC7C,wCAA0C;AAC1C,gCAAkC;AAElC,6CAAyC;AACzC,+BAAkD;AAClD,6BAAwB;AAGjB,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAAtB;QA0BN,gBAAW,GAAW,CAAC,GAAG,EAAE,CAAC;IAC9B,CAAC;CAAA,CAAA;AA3BY,4CAAgB;AA0B5B;IAxBC,IAAA,YAAG,EACH,6BAA6B,EAC7B,OAAC;SACC,MAAM,EAAE;SACR,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SAC5C,WAAW,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QAC3B,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,GAAG,CAAC,QAAQ,CAAC;gBACnB,OAAO,EAAE,yBAAyB;gBAClC,IAAI,EAAE,QAAQ;aACd,CAAC,CAAC;QACJ,CAAC;QAED,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;YAChB,OAAO,GAAG,CAAC,QAAQ,CAAC;gBAC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QAAQ,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,GAAG,IAAI,EAAE,CAAC;gBAC/D,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;gBACzD,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;YACzB,CAAC;QACF,CAAC;IACF,CAAC;CACD,CAAA;AA/IY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,YAAO,GAAE;qCASiB,gBAAgB;QAChB,uBAAM;GATpB,iBAAiB,CA+I7B"}
@@ -0,0 +1,6 @@
1
+ import type { Workflow, INode, INodeExecutionData, IPollFunctions, IWorkflowExecuteAdditionalData, WorkflowExecuteMode, WorkflowActivateMode, ITriggerResponse } from 'n8n-workflow';
2
+ import type { IGetExecuteTriggerFunctions } from './interfaces';
3
+ export declare class TriggersAndPollers {
4
+ runTrigger(workflow: Workflow, node: INode, getTriggerFunctions: IGetExecuteTriggerFunctions, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode): Promise<ITriggerResponse | undefined>;
5
+ runPoll(workflow: Workflow, node: INode, pollFunctions: IPollFunctions): Promise<INodeExecutionData[][] | null>;
6
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.TriggersAndPollers = void 0;
13
+ const di_1 = require("@n8n/di");
14
+ const errors_1 = require("@n8n/errors");
15
+ const node_assert_1 = __importDefault(require("node:assert"));
16
+ let TriggersAndPollers = class TriggersAndPollers {
17
+ async runTrigger(workflow, node, getTriggerFunctions, additionalData, mode, activation) {
18
+ const triggerFunctions = getTriggerFunctions(workflow, node, additionalData, mode, activation);
19
+ const nodeType = workflow.nodeTypes.getByNameAndVersion(node.type, node.typeVersion);
20
+ if (!nodeType.trigger) {
21
+ throw new errors_1.ApplicationError('Node type does not have a trigger function defined', {
22
+ extra: { nodeName: node.name },
23
+ tags: { nodeType: node.type },
24
+ });
25
+ }
26
+ if (mode === 'manual') {
27
+ const triggerResponse = await nodeType.trigger.call(triggerFunctions);
28
+ triggerResponse.manualTriggerResponse = new Promise((resolve, reject) => {
29
+ const { hooks } = additionalData;
30
+ node_assert_1.default.ok(hooks, 'Execution lifecycle hooks are not defined');
31
+ triggerFunctions.emit = (data, responsePromise, donePromise) => {
32
+ if (responsePromise) {
33
+ hooks.addHandler('sendResponse', (response) => responsePromise.resolve(response));
34
+ }
35
+ if (donePromise) {
36
+ hooks.addHandler('workflowExecuteAfter', (runData) => donePromise.resolve(runData));
37
+ }
38
+ resolve(data);
39
+ };
40
+ triggerFunctions.emitError = (error, responsePromise) => {
41
+ if (responsePromise) {
42
+ hooks.addHandler('sendResponse', () => responsePromise.reject(error));
43
+ }
44
+ reject(error);
45
+ };
46
+ });
47
+ return triggerResponse;
48
+ }
49
+ return await nodeType.trigger.call(triggerFunctions);
50
+ }
51
+ async runPoll(workflow, node, pollFunctions) {
52
+ const nodeType = workflow.nodeTypes.getByNameAndVersion(node.type, node.typeVersion);
53
+ if (!nodeType.poll) {
54
+ throw new errors_1.ApplicationError('Node type does not have a poll function defined', {
55
+ extra: { nodeName: node.name },
56
+ tags: { nodeType: node.type },
57
+ });
58
+ }
59
+ return await nodeType.poll.call(pollFunctions);
60
+ }
61
+ };
62
+ exports.TriggersAndPollers = TriggersAndPollers;
63
+ exports.TriggersAndPollers = TriggersAndPollers = __decorate([
64
+ (0, di_1.Service)()
65
+ ], TriggersAndPollers);
66
+ //# sourceMappingURL=triggers-and-pollers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triggers-and-pollers.js","sourceRoot":"","sources":["../../src/execution-engine/triggers-and-pollers.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAClC,wCAA+C;AAc/C,8DAAiC;AAK1B,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAI9B,KAAK,CAAC,UAAU,CACf,QAAkB,EAClB,IAAW,EACX,mBAAgD,EAChD,cAA8C,EAC9C,IAAyB,EACzB,UAAgC;QAEhC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;QAE/F,MAAM,QAAQ,GAAG,QAAQ,CAAC,SAAS,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAErF,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACvB,MAAM,IAAI,yBAAgB,CAAC,oDAAoD,EAAE;gBAChF,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE;gBAC9B,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE;aAC7B,CAAC,CAAC;QACJ,CAAC;QAED,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;YAGvB,MAAM,eAAe,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAGtE,eAAgB,CAAC,qBAAqB,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBACxE,MAAM,EAAE,KAAK,EAAE,GAAG,cAAc,CAAC;gBACjC,qBAAM,CAAC,EAAE,CAA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AAE,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE;gBAC9B,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE;aAC7B,CAAC,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAChD,CAAC;CACD,CAAA;AArFY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,YAAO,GAAE;GACG,kBAAkB,CAqF9B"}
@@ -0,0 +1,46 @@
1
+ import type { ExecutionBaseError, IConnection, IExecuteData, INode, INodeExecutionData, IPinData, IRun, IRunData, ITaskMetadata, Workflow, IRunExecutionData, IWorkflowExecuteAdditionalData, WorkflowExecuteMode, IRunNodeResponse, IWorkflowIssues, AiAgentRequest, IWorkflowExecutionDataProcess, EngineRequest, EngineResponse, IDestinationNode } from 'n8n-workflow';
2
+ import PCancelable from 'p-cancelable';
3
+ export declare class WorkflowExecute {
4
+ private readonly additionalData;
5
+ private readonly mode;
6
+ private runExecutionData;
7
+ private status;
8
+ private readonly abortController;
9
+ timedOut: boolean;
10
+ constructor(additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, runExecutionData?: IRunExecutionData);
11
+ run(workflow: Workflow, startNode?: INode, destinationNode?: IDestinationNode, pinData?: IPinData, triggerToStartFrom?: IWorkflowExecutionDataProcess['triggerToStartFrom']): PCancelable<IRun>;
12
+ isLegacyExecutionOrder(workflow: Workflow): boolean;
13
+ runPartialWorkflow2(workflow: Workflow, runData: IRunData, pinData: IPinData | undefined, dirtyNodeNames: string[] | undefined, destinationNode: IDestinationNode, agentRequest?: AiAgentRequest): PCancelable<IRun>;
14
+ moveNodeMetadata(): void;
15
+ incomingConnectionIsEmpty(runData: IRunData, inputConnections: IConnection[], runIndex: number): boolean;
16
+ prepareWaitingToExecution(nodeName: string, numberOfConnections: number, runIndex: number): void;
17
+ addNodeToBeExecuted(workflow: Workflow, connectionData: IConnection, outputIndex: number, parentNodeName: string, nodeSuccessData: INodeExecutionData[][], runIndex: number, newRunIndex?: number, metadata?: ITaskMetadata): void;
18
+ checkReadyForExecution(workflow: Workflow, inputData?: {
19
+ startNode?: string;
20
+ destinationNode?: IDestinationNode;
21
+ pinDataNodeNames?: string[];
22
+ }): IWorkflowIssues | null;
23
+ private getCustomOperation;
24
+ private handleDisabledNode;
25
+ private prepareConnectionInputData;
26
+ private rethrowLastNodeError;
27
+ private handleExecuteOnce;
28
+ private reportJsonIncompatibleOutput;
29
+ private executeNode;
30
+ private executePollNode;
31
+ private executeTriggerNode;
32
+ private executeDeclarativeNodeInTest;
33
+ runNode(workflow: Workflow, executionData: IExecuteData, runExecutionData: IRunExecutionData, runIndex: number, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, abortSignal?: AbortSignal, subNodeExecutionResults?: EngineResponse): Promise<IRunNodeResponse | EngineRequest>;
34
+ private handleWaitingState;
35
+ private checkForWorkflowIssues;
36
+ private setupExecution;
37
+ private handleEngineRequest;
38
+ processRunExecutionData(workflow: Workflow): PCancelable<IRun>;
39
+ ensureInputData(workflow: Workflow, executionNode: INode, executionData: IExecuteData): boolean;
40
+ processSuccessExecution(startedAt: Date, workflow: Workflow, executionError?: ExecutionBaseError, closeFunction?: Promise<void>): Promise<IRun>;
41
+ getFullRunData(startedAt: Date, stoppedAt?: Date): IRun;
42
+ handleNodeErrorOutput(workflow: Workflow, executionData: IExecuteData, nodeSuccessData: INodeExecutionData[][], runIndex: number): void;
43
+ assignPairedItems(nodeSuccessData: INodeExecutionData[][] | null | undefined, executionData: IExecuteData): INodeExecutionData[][] | null;
44
+ private updateTaskStatusesToCancelled;
45
+ private get isCancelled();
46
+ }