@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,571 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.RoutingNode = void 0;
7
+ const get_1 = __importDefault(require("lodash/get"));
8
+ const merge_1 = __importDefault(require("lodash/merge"));
9
+ const set_1 = __importDefault(require("lodash/set"));
10
+ const n8n_workflow_1 = require("n8n-workflow");
11
+ const node_url_1 = __importDefault(require("node:url"));
12
+ const node_execution_context_1 = require("./node-execution-context");
13
+ class RoutingNode {
14
+ constructor(context, nodeType, credentialsDecrypted) {
15
+ this.context = context;
16
+ this.nodeType = nodeType;
17
+ this.credentialsDecrypted = credentialsDecrypted;
18
+ }
19
+ async runNode() {
20
+ const { context, nodeType, credentialsDecrypted } = this;
21
+ const { additionalData, executeData, inputData, node, workflow, mode, runIndex, connectionInputData, runExecutionData, } = context;
22
+ const abortSignal = context.getExecutionCancelSignal();
23
+ const items = (inputData[n8n_workflow_1.NodeConnectionTypes.Main] ??
24
+ inputData[n8n_workflow_1.NodeConnectionTypes.AiTool])[0];
25
+ const returnData = [];
26
+ const { credentials, credentialDescription } = await this.prepareCredentials();
27
+ const { batching } = context.getNodeParameter('requestOptions', 0, {});
28
+ const batchSize = batching?.batch?.batchSize > 0 ? batching?.batch?.batchSize : 1;
29
+ const batchInterval = batching?.batch.batchInterval;
30
+ const requestPromises = [];
31
+ const itemContext = [];
32
+ for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
33
+ if (itemIndex > 0 && batchSize >= 0 && batchInterval > 0) {
34
+ if (itemIndex % batchSize === 0) {
35
+ await (0, n8n_workflow_1.sleep)(batchInterval);
36
+ }
37
+ }
38
+ const thisArgs = new node_execution_context_1.ExecuteSingleContext(workflow, node, additionalData, mode, runExecutionData, runIndex, connectionInputData, inputData, itemIndex, executeData, abortSignal);
39
+ itemContext.push({
40
+ thisArgs,
41
+ requestData: {
42
+ options: {
43
+ qs: {},
44
+ body: {},
45
+ headers: {},
46
+ },
47
+ preSend: [],
48
+ postReceive: [],
49
+ requestOperations: {},
50
+ },
51
+ });
52
+ const { proxy, timeout, allowUnauthorizedCerts } = itemContext[itemIndex].thisArgs.getNodeParameter('requestOptions', 0, {});
53
+ if (nodeType.description.requestOperations) {
54
+ itemContext[itemIndex].requestData.requestOperations = {
55
+ ...nodeType.description.requestOperations,
56
+ };
57
+ }
58
+ if (nodeType.description.requestDefaults) {
59
+ for (const key of Object.keys(nodeType.description.requestDefaults)) {
60
+ let value = nodeType.description.requestDefaults[key];
61
+ value = this.getParameterValue(value, itemIndex, runIndex, executeData, { $credentials: credentials, $version: node.typeVersion }, false);
62
+ itemContext[itemIndex].requestData.options[key] = value;
63
+ }
64
+ }
65
+ for (const property of nodeType.description.properties) {
66
+ let value = (0, get_1.default)(node.parameters, property.name, []);
67
+ value = this.getParameterValue(value, itemIndex, runIndex, executeData, { $credentials: credentials, $version: node.typeVersion }, false);
68
+ const tempOptions = this.getRequestOptionsFromParameters(itemContext[itemIndex].thisArgs, property, itemIndex, runIndex, '', { $credentials: credentials, $value: value, $version: node.typeVersion });
69
+ this.mergeOptions(itemContext[itemIndex].requestData, tempOptions);
70
+ }
71
+ if (proxy) {
72
+ const proxyParsed = node_url_1.default.parse(proxy);
73
+ const proxyProperties = ['host', 'port'];
74
+ for (const property of proxyProperties) {
75
+ if (!(property in proxyParsed) ||
76
+ proxyParsed[property] === null) {
77
+ throw new n8n_workflow_1.NodeOperationError(node, 'The proxy is not value', {
78
+ runIndex,
79
+ itemIndex,
80
+ description: `The proxy URL does not contain a valid value for "${property}"`,
81
+ });
82
+ }
83
+ }
84
+ itemContext[itemIndex].requestData.options.proxy = {
85
+ host: proxyParsed.hostname,
86
+ port: parseInt(proxyParsed.port),
87
+ protocol: proxyParsed.protocol?.replace(/:$/, '') || undefined,
88
+ };
89
+ if (proxyParsed.auth) {
90
+ const [username, password] = proxyParsed.auth.split(':');
91
+ itemContext[itemIndex].requestData.options.proxy.auth = {
92
+ username,
93
+ password,
94
+ };
95
+ }
96
+ }
97
+ if (allowUnauthorizedCerts) {
98
+ itemContext[itemIndex].requestData.options.skipSslCertificateValidation =
99
+ allowUnauthorizedCerts;
100
+ }
101
+ if (timeout) {
102
+ itemContext[itemIndex].requestData.options.timeout = timeout;
103
+ }
104
+ else {
105
+ itemContext[itemIndex].requestData.options.timeout = 300_000;
106
+ }
107
+ requestPromises.push(this.makeRequest(itemContext[itemIndex].requestData, itemContext[itemIndex].thisArgs, itemIndex, runIndex, credentialDescription?.name, itemContext[itemIndex].requestData.requestOperations, credentialsDecrypted));
108
+ }
109
+ const promisesResponses = await Promise.allSettled(requestPromises);
110
+ let responseData;
111
+ for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
112
+ responseData = promisesResponses.shift();
113
+ if (responseData.status !== 'fulfilled') {
114
+ if (responseData.reason.statusCode === 429) {
115
+ responseData.reason.message =
116
+ "Try spacing your requests out using the batching settings under 'Options'";
117
+ }
118
+ const error = responseData.reason;
119
+ if (itemContext[itemIndex].thisArgs?.continueOnFail()) {
120
+ returnData.push({ json: {}, error: error });
121
+ continue;
122
+ }
123
+ if (error instanceof n8n_workflow_1.NodeApiError) {
124
+ (0, set_1.default)(error, 'context.itemIndex', itemIndex);
125
+ (0, set_1.default)(error, 'context.runIndex', runIndex);
126
+ throw error;
127
+ }
128
+ throw new n8n_workflow_1.NodeApiError(node, error, {
129
+ runIndex,
130
+ itemIndex,
131
+ message: error?.message,
132
+ description: error?.description,
133
+ httpCode: error.isAxiosError && error.response ? String(error.response?.status) : 'none',
134
+ });
135
+ }
136
+ if (itemContext[itemIndex].requestData.maxResults) {
137
+ responseData.value.splice(itemContext[itemIndex].requestData.maxResults);
138
+ }
139
+ returnData.push(...responseData.value);
140
+ }
141
+ return [returnData];
142
+ }
143
+ mergeOptions(destinationOptions, sourceOptions) {
144
+ if (sourceOptions) {
145
+ destinationOptions.paginate = destinationOptions.paginate ?? sourceOptions.paginate;
146
+ destinationOptions.maxResults = sourceOptions.maxResults
147
+ ? sourceOptions.maxResults
148
+ : destinationOptions.maxResults;
149
+ (0, merge_1.default)(destinationOptions.options, sourceOptions.options);
150
+ destinationOptions.preSend.push(...sourceOptions.preSend);
151
+ destinationOptions.postReceive.push(...sourceOptions.postReceive);
152
+ if (sourceOptions.requestOperations && destinationOptions.requestOperations) {
153
+ destinationOptions.requestOperations = Object.assign(destinationOptions.requestOperations, sourceOptions.requestOperations);
154
+ }
155
+ }
156
+ }
157
+ async runPostReceiveAction(executeSingleFunctions, action, inputData, responseData, parameterValue, itemIndex, runIndex) {
158
+ if (typeof action === 'function') {
159
+ return await action.call(executeSingleFunctions, inputData, responseData);
160
+ }
161
+ const { node } = this.context;
162
+ if (action.type === 'rootProperty') {
163
+ try {
164
+ return inputData.flatMap((item) => {
165
+ let itemContent = (0, get_1.default)(item.json, action.properties.property);
166
+ if (!Array.isArray(itemContent)) {
167
+ itemContent = [itemContent];
168
+ }
169
+ return itemContent.map((json) => {
170
+ return {
171
+ json,
172
+ };
173
+ });
174
+ });
175
+ }
176
+ catch (error) {
177
+ throw new n8n_workflow_1.NodeOperationError(node, error, {
178
+ runIndex,
179
+ itemIndex,
180
+ description: `The rootProperty "${action.properties.property}" could not be found on item.`,
181
+ });
182
+ }
183
+ }
184
+ if (action.type === 'filter') {
185
+ const passValue = action.properties.pass;
186
+ const { credentials } = await this.prepareCredentials();
187
+ inputData = inputData.filter((item) => {
188
+ return this.getParameterValue(passValue, itemIndex, runIndex, executeSingleFunctions.getExecuteData(), {
189
+ $credentials: credentials,
190
+ $response: responseData,
191
+ $responseItem: item.json,
192
+ $value: parameterValue,
193
+ $version: node.typeVersion,
194
+ }, false);
195
+ });
196
+ return inputData;
197
+ }
198
+ if (action.type === 'limit') {
199
+ const maxResults = this.getParameterValue(action.properties.maxResults, itemIndex, runIndex, executeSingleFunctions.getExecuteData(), { $response: responseData, $value: parameterValue, $version: node.typeVersion }, false);
200
+ return inputData.slice(0, parseInt(maxResults, 10));
201
+ }
202
+ if (action.type === 'set') {
203
+ const { value } = action.properties;
204
+ return [
205
+ {
206
+ json: this.getParameterValue(value, itemIndex, runIndex, executeSingleFunctions.getExecuteData(), { $response: responseData, $value: parameterValue, $version: node.typeVersion }, false),
207
+ },
208
+ ];
209
+ }
210
+ if (action.type === 'sort') {
211
+ const sortKey = action.properties.key;
212
+ inputData.sort((a, b) => {
213
+ const aSortValue = a.json[sortKey]?.toString().toLowerCase() ?? '';
214
+ const bSortValue = b.json[sortKey]?.toString().toLowerCase() ?? '';
215
+ if (aSortValue < bSortValue) {
216
+ return -1;
217
+ }
218
+ if (aSortValue > bSortValue) {
219
+ return 1;
220
+ }
221
+ return 0;
222
+ });
223
+ return inputData;
224
+ }
225
+ if (action.type === 'setKeyValue') {
226
+ const returnData = [];
227
+ inputData.forEach((item) => {
228
+ const returnItem = {};
229
+ for (const key of Object.keys(action.properties)) {
230
+ let propertyValue = action.properties[key];
231
+ propertyValue = this.getParameterValue(propertyValue, itemIndex, runIndex, executeSingleFunctions.getExecuteData(), {
232
+ $response: responseData,
233
+ $responseItem: item.json,
234
+ $value: parameterValue,
235
+ $version: node.typeVersion,
236
+ }, false);
237
+ returnItem[key] = propertyValue;
238
+ }
239
+ returnData.push({ json: returnItem });
240
+ });
241
+ return returnData;
242
+ }
243
+ if (action.type === 'binaryData') {
244
+ const body = (responseData.body = Buffer.from(responseData.body));
245
+ let { destinationProperty } = action.properties;
246
+ destinationProperty = this.getParameterValue(destinationProperty, itemIndex, runIndex, executeSingleFunctions.getExecuteData(), { $response: responseData, $value: parameterValue, $version: node.typeVersion }, false);
247
+ const binaryData = await executeSingleFunctions.helpers.prepareBinaryData(body);
248
+ return inputData.map((item) => {
249
+ if (typeof item.json === 'string') {
250
+ item.json = {};
251
+ }
252
+ item.binary = {
253
+ [destinationProperty]: binaryData,
254
+ };
255
+ return item;
256
+ });
257
+ }
258
+ return [];
259
+ }
260
+ async postProcessResponseData(executeSingleFunctions, responseData, requestData, itemIndex, runIndex) {
261
+ let returnData = [
262
+ {
263
+ json: responseData.body,
264
+ },
265
+ ];
266
+ if (requestData.postReceive.length) {
267
+ for (const postReceiveMethod of requestData.postReceive) {
268
+ for (const action of postReceiveMethod.actions) {
269
+ returnData = await this.runPostReceiveAction(executeSingleFunctions, action, returnData, responseData, postReceiveMethod.data.parameterValue, itemIndex, runIndex);
270
+ }
271
+ }
272
+ }
273
+ else {
274
+ if (Array.isArray(responseData.body)) {
275
+ returnData = responseData.body.map((json) => {
276
+ return {
277
+ json,
278
+ };
279
+ });
280
+ }
281
+ else {
282
+ returnData[0].json = responseData.body;
283
+ }
284
+ }
285
+ return returnData;
286
+ }
287
+ async rawRoutingRequest(executeSingleFunctions, requestData, credentialType, credentialsDecrypted) {
288
+ let responseData;
289
+ requestData.options.returnFullResponse = true;
290
+ if (credentialType) {
291
+ responseData = (await executeSingleFunctions.helpers.httpRequestWithAuthentication.call(executeSingleFunctions, credentialType, requestData.options, { credentialsDecrypted }));
292
+ }
293
+ else {
294
+ responseData = (await executeSingleFunctions.helpers.httpRequest(requestData.options));
295
+ }
296
+ return responseData;
297
+ }
298
+ async makeRequest(requestData, executeSingleFunctions, itemIndex, runIndex, credentialType, requestOperations, credentialsDecrypted) {
299
+ let responseData;
300
+ for (const preSendMethod of requestData.preSend) {
301
+ requestData.options = await preSendMethod.call(executeSingleFunctions, requestData.options);
302
+ }
303
+ const makeRoutingRequest = async (requestOptions) => {
304
+ return await this.rawRoutingRequest(executeSingleFunctions, requestOptions, credentialType, credentialsDecrypted).then(async (data) => await this.postProcessResponseData(executeSingleFunctions, data, requestData, itemIndex, runIndex));
305
+ };
306
+ const { node } = this.context;
307
+ const executePaginationFunctions = Object.create(executeSingleFunctions, {
308
+ makeRoutingRequest: { value: makeRoutingRequest },
309
+ });
310
+ if (requestData.paginate && requestOperations?.pagination) {
311
+ if (typeof requestOperations.pagination === 'function') {
312
+ responseData = await requestOperations.pagination.call(executePaginationFunctions, requestData);
313
+ }
314
+ else {
315
+ responseData = [];
316
+ if (!requestData.options.qs) {
317
+ requestData.options.qs = {};
318
+ }
319
+ if (requestOperations.pagination.type === 'generic') {
320
+ let tempResponseData;
321
+ let tempResponseItems;
322
+ let makeAdditionalRequest;
323
+ let paginateRequestData;
324
+ const additionalKeys = {
325
+ $request: requestData.options,
326
+ $response: {},
327
+ $version: node.typeVersion,
328
+ };
329
+ do {
330
+ additionalKeys.$request = requestData.options;
331
+ paginateRequestData = this.getParameterValue(requestOperations.pagination.properties.request, itemIndex, runIndex, executeSingleFunctions.getExecuteData(), additionalKeys, false);
332
+ tempResponseData = await this.rawRoutingRequest(executeSingleFunctions, { ...requestData, options: { ...requestData.options, ...paginateRequestData } }, credentialType, credentialsDecrypted);
333
+ additionalKeys.$response = tempResponseData;
334
+ tempResponseItems = await this.postProcessResponseData(executeSingleFunctions, tempResponseData, requestData, itemIndex, runIndex);
335
+ responseData.push(...tempResponseItems);
336
+ makeAdditionalRequest = this.getParameterValue(requestOperations.pagination.properties.continue, itemIndex, runIndex, executeSingleFunctions.getExecuteData(), additionalKeys, false);
337
+ } while (makeAdditionalRequest);
338
+ }
339
+ else if (requestOperations.pagination.type === 'offset') {
340
+ const { properties } = requestOperations.pagination;
341
+ const optionsType = properties.type === 'body' ? 'body' : 'qs';
342
+ if (properties.type === 'body' && !requestData.options.body) {
343
+ requestData.options.body = {};
344
+ }
345
+ requestData.options[optionsType][properties.limitParameter] =
346
+ properties.pageSize;
347
+ requestData.options[optionsType][properties.offsetParameter] = 0;
348
+ let tempResponseData;
349
+ do {
350
+ if (requestData?.maxResults) {
351
+ const resultsMissing = requestData?.maxResults - responseData.length;
352
+ if (resultsMissing < 1) {
353
+ break;
354
+ }
355
+ requestData.options[optionsType][properties.limitParameter] =
356
+ Math.min(properties.pageSize, resultsMissing);
357
+ }
358
+ tempResponseData = await this.rawRoutingRequest(executeSingleFunctions, requestData, credentialType, credentialsDecrypted).then(async (data) => await this.postProcessResponseData(executeSingleFunctions, data, requestData, itemIndex, runIndex));
359
+ requestData.options[optionsType][properties.offsetParameter] =
360
+ requestData.options[optionsType][properties.offsetParameter] + properties.pageSize;
361
+ if (properties.rootProperty) {
362
+ const tempResponseValue = (0, get_1.default)(tempResponseData[0].json, properties.rootProperty);
363
+ if (tempResponseValue === undefined) {
364
+ throw new n8n_workflow_1.NodeOperationError(node, `The rootProperty "${properties.rootProperty}" could not be found on item.`, { runIndex, itemIndex });
365
+ }
366
+ tempResponseData = tempResponseValue.map((item) => {
367
+ return {
368
+ json: item,
369
+ };
370
+ });
371
+ }
372
+ responseData.push(...tempResponseData);
373
+ } while (tempResponseData.length && tempResponseData.length === properties.pageSize);
374
+ }
375
+ }
376
+ }
377
+ else {
378
+ responseData = await this.rawRoutingRequest(executeSingleFunctions, requestData, credentialType, credentialsDecrypted).then(async (data) => await this.postProcessResponseData(executeSingleFunctions, data, requestData, itemIndex, runIndex));
379
+ }
380
+ return responseData;
381
+ }
382
+ getParameterValue(parameterValue, itemIndex, runIndex, executeData, additionalKeys, returnObjectAsString = false) {
383
+ if (typeof parameterValue === 'object' ||
384
+ (typeof parameterValue === 'string' && parameterValue.charAt(0) === '=')) {
385
+ const { node, workflow, mode, connectionInputData, runExecutionData } = this.context;
386
+ return workflow.expression.getParameterValue(parameterValue, runExecutionData ?? null, runIndex, itemIndex, node.name, connectionInputData, mode, additionalKeys ?? {}, executeData, returnObjectAsString);
387
+ }
388
+ return parameterValue;
389
+ }
390
+ getRequestOptionsFromParameters(executeSingleFunctions, nodeProperties, itemIndex, runIndex, path, additionalKeys) {
391
+ const returnData = {
392
+ options: {
393
+ qs: {},
394
+ body: {},
395
+ headers: {},
396
+ },
397
+ preSend: [],
398
+ postReceive: [],
399
+ requestOperations: {},
400
+ };
401
+ let basePath = path ? `${path}.` : '';
402
+ const { node, nodeType } = this.context;
403
+ if (!n8n_workflow_1.NodeHelpers.displayParameter(node.parameters, nodeProperties, node, nodeType.description, node.parameters)) {
404
+ return undefined;
405
+ }
406
+ if (nodeProperties.routing) {
407
+ let parameterValue;
408
+ if (basePath + nodeProperties.name && 'type' in nodeProperties) {
409
+ const shouldExtractValue = nodeProperties.extractValue !== undefined || nodeProperties.type === 'resourceLocator';
410
+ parameterValue = executeSingleFunctions.getNodeParameter(basePath + nodeProperties.name, undefined, { extractValue: shouldExtractValue });
411
+ }
412
+ if (nodeProperties.routing.operations) {
413
+ returnData.requestOperations = { ...nodeProperties.routing.operations };
414
+ }
415
+ if (nodeProperties.routing.request) {
416
+ for (const key of Object.keys(nodeProperties.routing.request)) {
417
+ let propertyValue = nodeProperties.routing.request[key];
418
+ propertyValue = this.getParameterValue(propertyValue, itemIndex, runIndex, executeSingleFunctions.getExecuteData(), { ...additionalKeys, $value: parameterValue }, false);
419
+ returnData.options[key] = propertyValue;
420
+ }
421
+ }
422
+ if (nodeProperties.routing.send) {
423
+ let propertyName = nodeProperties.routing.send.property;
424
+ if (propertyName !== undefined) {
425
+ propertyName = this.getParameterValue(propertyName, itemIndex, runIndex, executeSingleFunctions.getExecuteData(), additionalKeys, true);
426
+ let value = parameterValue;
427
+ if (nodeProperties.routing.send.value) {
428
+ const valueString = nodeProperties.routing.send.value;
429
+ value = this.getParameterValue(valueString, itemIndex, runIndex, executeSingleFunctions.getExecuteData(), { ...additionalKeys, $value: value }, false);
430
+ }
431
+ if (nodeProperties.routing.send.type === 'body') {
432
+ if (nodeProperties.routing.send.propertyInDotNotation === false) {
433
+ returnData.options.body[propertyName] = value;
434
+ }
435
+ else {
436
+ (0, set_1.default)(returnData.options.body, propertyName, value);
437
+ }
438
+ }
439
+ else {
440
+ if (nodeProperties.routing.send.propertyInDotNotation === false) {
441
+ returnData.options.qs[propertyName] = value;
442
+ }
443
+ else {
444
+ (0, set_1.default)(returnData.options.qs, propertyName, value);
445
+ }
446
+ }
447
+ }
448
+ if (nodeProperties.routing.send.paginate !== undefined) {
449
+ let paginateValue = nodeProperties.routing.send.paginate;
450
+ if (typeof paginateValue === 'string' && paginateValue.charAt(0) === '=') {
451
+ paginateValue = this.getParameterValue(paginateValue, itemIndex, runIndex, executeSingleFunctions.getExecuteData(), { ...additionalKeys, $value: parameterValue }, true);
452
+ }
453
+ returnData.paginate = !!paginateValue;
454
+ }
455
+ if (nodeProperties.routing.send.preSend) {
456
+ returnData.preSend.push(...nodeProperties.routing.send.preSend);
457
+ }
458
+ }
459
+ if (nodeProperties.routing.output) {
460
+ if (nodeProperties.routing.output.maxResults !== undefined) {
461
+ let maxResultsValue = nodeProperties.routing.output.maxResults;
462
+ if (typeof maxResultsValue === 'string' && maxResultsValue.charAt(0) === '=') {
463
+ maxResultsValue = this.getParameterValue(maxResultsValue, itemIndex, runIndex, executeSingleFunctions.getExecuteData(), { ...additionalKeys, $value: parameterValue }, true);
464
+ }
465
+ returnData.maxResults = maxResultsValue;
466
+ }
467
+ if (nodeProperties.routing.output.postReceive) {
468
+ const postReceiveActions = nodeProperties.routing.output.postReceive.filter((action) => {
469
+ if (typeof action === 'function') {
470
+ return true;
471
+ }
472
+ if (typeof action.enabled === 'string' && action.enabled.charAt(0) === '=') {
473
+ return this.getParameterValue(action.enabled, itemIndex, runIndex, executeSingleFunctions.getExecuteData(), { ...additionalKeys, $value: parameterValue }, true);
474
+ }
475
+ return action.enabled !== false;
476
+ });
477
+ if (postReceiveActions.length) {
478
+ returnData.postReceive.push({
479
+ data: {
480
+ parameterValue,
481
+ },
482
+ actions: postReceiveActions,
483
+ });
484
+ }
485
+ }
486
+ }
487
+ }
488
+ if (!Object.prototype.hasOwnProperty.call(nodeProperties, 'options')) {
489
+ return returnData;
490
+ }
491
+ nodeProperties = nodeProperties;
492
+ let value;
493
+ if (nodeProperties.type === 'options') {
494
+ const optionValue = n8n_workflow_1.NodeHelpers.getParameterValueByPath(node.parameters, nodeProperties.name, basePath.slice(0, -1));
495
+ const selectedOption = nodeProperties.options.filter((option) => option.value === optionValue);
496
+ if (selectedOption.length) {
497
+ const tempOptions = this.getRequestOptionsFromParameters(executeSingleFunctions, selectedOption[0], itemIndex, runIndex, `${basePath}${nodeProperties.name}`, { $value: optionValue, $version: node.typeVersion });
498
+ this.mergeOptions(returnData, tempOptions);
499
+ }
500
+ }
501
+ else if (nodeProperties.type === 'collection') {
502
+ value = n8n_workflow_1.NodeHelpers.getParameterValueByPath(node.parameters, nodeProperties.name, basePath.slice(0, -1));
503
+ for (const propertyOption of nodeProperties.options) {
504
+ if (Object.keys(value).includes(propertyOption.name) &&
505
+ propertyOption.type !== undefined) {
506
+ const tempOptions = this.getRequestOptionsFromParameters(executeSingleFunctions, propertyOption, itemIndex, runIndex, `${basePath}${nodeProperties.name}`, { $version: node.typeVersion });
507
+ this.mergeOptions(returnData, tempOptions);
508
+ }
509
+ }
510
+ }
511
+ else if (nodeProperties.type === 'fixedCollection') {
512
+ basePath = `${basePath}${nodeProperties.name}.`;
513
+ for (const propertyOptions of nodeProperties.options) {
514
+ value = n8n_workflow_1.NodeHelpers.getParameterValueByPath(node.parameters, propertyOptions.name, basePath.slice(0, -1));
515
+ if (value === undefined) {
516
+ continue;
517
+ }
518
+ if (!Array.isArray(value)) {
519
+ value = [value];
520
+ }
521
+ value = this.getParameterValue(value, itemIndex, runIndex, executeSingleFunctions.getExecuteData(), { ...additionalKeys }, false);
522
+ const loopBasePath = `${basePath}${propertyOptions.name}`;
523
+ for (let i = 0; i < value.length; i++) {
524
+ for (const option of propertyOptions.values) {
525
+ const tempOptions = this.getRequestOptionsFromParameters(executeSingleFunctions, option, itemIndex, runIndex, nodeProperties.typeOptions?.multipleValues ? `${loopBasePath}[${i}]` : loopBasePath, { ...(additionalKeys || {}), $index: i, $parent: value[i] });
526
+ this.mergeOptions(returnData, tempOptions);
527
+ }
528
+ }
529
+ }
530
+ }
531
+ return returnData;
532
+ }
533
+ async prepareCredentials() {
534
+ const { context, nodeType, credentialsDecrypted } = this;
535
+ const { node } = context;
536
+ let credentialDescription;
537
+ if (nodeType.description.credentials?.length) {
538
+ if (nodeType.description.credentials.length === 1) {
539
+ credentialDescription = nodeType.description.credentials[0];
540
+ }
541
+ else {
542
+ const authenticationMethod = context.getNodeParameter('authentication', 0);
543
+ credentialDescription = nodeType.description.credentials.find((x) => x.displayOptions?.show?.authentication?.includes(authenticationMethod));
544
+ if (!credentialDescription) {
545
+ throw new n8n_workflow_1.NodeOperationError(node, `Node type "${node.type}" does not have any credentials of type "${authenticationMethod}" defined`, { level: 'warning' });
546
+ }
547
+ }
548
+ }
549
+ let credentials;
550
+ if (credentialsDecrypted) {
551
+ credentials = credentialsDecrypted.data;
552
+ }
553
+ else if (credentialDescription) {
554
+ try {
555
+ credentials =
556
+ (await context.getCredentials(credentialDescription.name, 0)) || {};
557
+ }
558
+ catch (error) {
559
+ if (credentialDescription.required) {
560
+ throw error;
561
+ }
562
+ else {
563
+ credentialDescription = undefined;
564
+ }
565
+ }
566
+ }
567
+ return { credentials, credentialDescription };
568
+ }
569
+ }
570
+ exports.RoutingNode = RoutingNode;
571
+ //# sourceMappingURL=routing-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routing-node.js","sourceRoot":"","sources":["../../src/execution-engine/routing-node.ts"],"names":[],"mappings":";;;;;;AAKA,qDAA6B;AAC7B,yDAAiC;AACjC,qDAA6B;AAC7B,+CAMsB;AAyBtB,wDAA2B;AAE3B,qEAAqF;AAErF,MAAa,WAAW;IAC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+ import { CronJob } from 'cron';
4
+ import type { CronContext, Workflow } from 'n8n-workflow';
5
+ import { ErrorReporter } from '../errors';
6
+ import { InstanceSettings } from '../instance-settings';
7
+ type CronKey = string;
8
+ type Cron = {
9
+ job: CronJob;
10
+ summary: string;
11
+ ctx: CronContext;
12
+ };
13
+ type CronsByWorkflow = Map<Workflow['id'], Map<CronKey, Cron>>;
14
+ export declare class ScheduledTaskManager {
15
+ private readonly instanceSettings;
16
+ private readonly logger;
17
+ private readonly errorReporter;
18
+ readonly cronsByWorkflow: CronsByWorkflow;
19
+ private logInterval?;
20
+ private get loggableCrons();
21
+ constructor(instanceSettings: InstanceSettings, logger: Logger, { activeInterval }: CronLoggingConfig, errorReporter: ErrorReporter);
22
+ registerCron(ctx: CronContext, onTick: () => void): void;
23
+ deregisterCrons(workflowId: string): void;
24
+ deregisterAllCrons(): void;
25
+ private toCronKey;
26
+ }
27
+ export {};