n8n-nodes-base 2.34.2 → 2.35.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 (338) hide show
  1. package/dist/cjs/build.tsbuildinfo +1 -1
  2. package/dist/credentials/DiscordBotApi.credentials.d.ts.map +1 -1
  3. package/dist/credentials/DiscordBotApi.credentials.js +17 -0
  4. package/dist/credentials/DiscordBotApi.credentials.js.map +1 -1
  5. package/dist/credentials/SlackOAuth2Api.credentials.d.ts.map +1 -1
  6. package/dist/credentials/SlackOAuth2Api.credentials.js +9 -0
  7. package/dist/credentials/SlackOAuth2Api.credentials.js.map +1 -1
  8. package/dist/credentials/TwitterOAuth2Api.credentials.js +2 -2
  9. package/dist/credentials/TwitterOAuth2Api.credentials.js.map +1 -1
  10. package/dist/known/credentials.json +2 -1
  11. package/dist/known/nodes.json +4 -0
  12. package/dist/node-definitions/.nodes-hash +1 -1
  13. package/dist/node-definitions/nodes/n8n-nodes-base/executeWorkflow/v1/mode_each.ts +40 -0
  14. package/dist/node-definitions/nodes/n8n-nodes-base/executeWorkflow/v1/mode_once.ts +40 -0
  15. package/dist/node-definitions/nodes/n8n-nodes-base/executeWorkflow/v11/mode_each.ts +40 -0
  16. package/dist/node-definitions/nodes/n8n-nodes-base/executeWorkflow/v11/mode_once.ts +40 -0
  17. package/dist/node-definitions/nodes/n8n-nodes-base/executeWorkflow/v12/mode_each.ts +41 -0
  18. package/dist/node-definitions/nodes/n8n-nodes-base/executeWorkflow/v12/mode_once.ts +41 -0
  19. package/dist/node-definitions/nodes/n8n-nodes-base/executeWorkflow/v13/mode_each.ts +41 -0
  20. package/dist/node-definitions/nodes/n8n-nodes-base/executeWorkflow/v13/mode_once.ts +41 -0
  21. package/dist/node-definitions/nodes/n8n-nodes-base/github/v1/resource_workflow/operation_dispatch_and_wait.schema.js +1 -0
  22. package/dist/node-definitions/nodes/n8n-nodes-base/github/v1/resource_workflow/operation_dispatch_and_wait.ts +33 -0
  23. package/dist/node-definitions/nodes/n8n-nodes-base/github/v11/resource_workflow/operation_dispatch_and_wait.schema.js +1 -0
  24. package/dist/node-definitions/nodes/n8n-nodes-base/github/v11/resource_workflow/operation_dispatch_and_wait.ts +33 -0
  25. package/dist/node-definitions/nodes/n8n-nodes-base/googleAnalytics/v2/resource_report/operation_get.ts +2 -2
  26. package/dist/node-definitions/nodes/n8n-nodes-base/httpRequest/v2.schema.js +1 -1
  27. package/dist/node-definitions/nodes/n8n-nodes-base/httpRequest/v2.ts +3 -2
  28. package/dist/node-definitions/nodes/n8n-nodes-base/httpRequest/v3.schema.js +1 -1
  29. package/dist/node-definitions/nodes/n8n-nodes-base/httpRequest/v3.ts +8 -7
  30. package/dist/node-definitions/nodes/n8n-nodes-base/httpRequest/v4.schema.js +1 -1
  31. package/dist/node-definitions/nodes/n8n-nodes-base/httpRequest/v4.ts +8 -7
  32. package/dist/node-definitions/nodes/n8n-nodes-base/httpRequest/v41.schema.js +1 -1
  33. package/dist/node-definitions/nodes/n8n-nodes-base/httpRequest/v41.ts +8 -7
  34. package/dist/node-definitions/nodes/n8n-nodes-base/httpRequest/v42.schema.js +1 -1
  35. package/dist/node-definitions/nodes/n8n-nodes-base/httpRequest/v42.ts +8 -7
  36. package/dist/node-definitions/nodes/n8n-nodes-base/httpRequest/v43.schema.js +1 -1
  37. package/dist/node-definitions/nodes/n8n-nodes-base/httpRequest/v43.ts +8 -7
  38. package/dist/node-definitions/nodes/n8n-nodes-base/httpRequest/v44.schema.js +1 -1
  39. package/dist/node-definitions/nodes/n8n-nodes-base/httpRequest/v44.ts +8 -7
  40. package/dist/node-definitions/nodes/n8n-nodes-base/httpRequest/v45.schema.js +1 -1
  41. package/dist/node-definitions/nodes/n8n-nodes-base/httpRequest/v45.ts +8 -7
  42. package/dist/node-definitions/nodes/n8n-nodes-base/kafka/index.ts +3 -1
  43. package/dist/node-definitions/nodes/n8n-nodes-base/kafka/v2.schema.js +35 -0
  44. package/dist/node-definitions/nodes/n8n-nodes-base/kafka/v2.ts +100 -0
  45. package/dist/node-definitions/nodes/n8n-nodes-base/kafkaTrigger/index.ts +3 -1
  46. package/dist/node-definitions/nodes/n8n-nodes-base/kafkaTrigger/v2.schema.js +30 -0
  47. package/dist/node-definitions/nodes/n8n-nodes-base/kafkaTrigger/v2.ts +124 -0
  48. package/dist/node-definitions/nodes/n8n-nodes-base/microsoftOutlook/v2/resource_event/operation_create.ts +2 -2
  49. package/dist/node-definitions/nodes/n8n-nodes-base/salesforceTrigger/v1.schema.js +1 -0
  50. package/dist/node-definitions/nodes/n8n-nodes-base/salesforceTrigger/v1.ts +6 -0
  51. package/dist/node-definitions/nodes/n8n-nodes-base/salesforceTrigger/v11.schema.js +1 -0
  52. package/dist/node-definitions/nodes/n8n-nodes-base/salesforceTrigger/v11.ts +6 -0
  53. package/dist/node-definitions/nodes/n8n-nodes-base/slack/index.ts +3 -1
  54. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v2/resource_message/operation_search.schema.js +1 -1
  55. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v2/resource_message/operation_search.ts +26 -0
  56. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v21/resource_message/operation_search.schema.js +1 -1
  57. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v21/resource_message/operation_search.ts +26 -0
  58. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v22/resource_message/operation_search.schema.js +1 -1
  59. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v22/resource_message/operation_search.ts +26 -0
  60. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v23/resource_message/operation_search.schema.js +1 -1
  61. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v23/resource_message/operation_search.ts +26 -0
  62. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v24/resource_message/operation_search.schema.js +1 -1
  63. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v24/resource_message/operation_search.ts +26 -0
  64. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v25/resource_message/operation_search.schema.js +1 -1
  65. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v25/resource_message/operation_search.ts +26 -0
  66. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v26/resource_message/operation_search.schema.js +1 -1
  67. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v26/resource_message/operation_search.ts +26 -0
  68. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/index.schema.js +32 -0
  69. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/index.ts +30 -0
  70. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/index.schema.js +52 -0
  71. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/index.ts +60 -0
  72. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_archive.schema.js +23 -0
  73. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_archive.ts +29 -0
  74. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_close.schema.js +23 -0
  75. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_close.ts +29 -0
  76. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_create.schema.js +24 -0
  77. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_create.ts +32 -0
  78. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_get.schema.js +24 -0
  79. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_get.ts +39 -0
  80. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_get_all.schema.js +25 -0
  81. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_get_all.ts +48 -0
  82. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_history.schema.js +26 -0
  83. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_history.ts +56 -0
  84. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_invite.schema.js +24 -0
  85. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_invite.ts +35 -0
  86. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_join.schema.js +23 -0
  87. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_join.ts +29 -0
  88. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_kick.schema.js +24 -0
  89. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_kick.ts +34 -0
  90. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_leave.schema.js +23 -0
  91. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_leave.ts +29 -0
  92. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_member.schema.js +26 -0
  93. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_member.ts +45 -0
  94. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_open.schema.js +23 -0
  95. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_open.ts +41 -0
  96. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_rename.schema.js +24 -0
  97. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_rename.ts +33 -0
  98. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_replies.schema.js +27 -0
  99. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_replies.ts +60 -0
  100. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_set_purpose.schema.js +24 -0
  101. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_set_purpose.ts +33 -0
  102. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_set_topic.schema.js +24 -0
  103. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_set_topic.ts +33 -0
  104. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_unarchive.schema.js +23 -0
  105. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_channel/operation_unarchive.ts +29 -0
  106. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_file/index.schema.js +24 -0
  107. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_file/index.ts +18 -0
  108. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_file/operation_get.schema.js +23 -0
  109. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_file/operation_get.ts +27 -0
  110. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_file/operation_get_all.schema.js +25 -0
  111. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_file/operation_get_all.ts +62 -0
  112. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_file/operation_upload.schema.js +24 -0
  113. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_file/operation_upload.ts +56 -0
  114. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/index.schema.js +36 -0
  115. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/index.ts +36 -0
  116. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/operation_delete.schema.js +26 -0
  117. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/operation_delete.ts +44 -0
  118. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/operation_delete_scheduled.schema.js +24 -0
  119. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/operation_delete_scheduled.ts +32 -0
  120. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/operation_get_many_scheduled.schema.js +25 -0
  121. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/operation_get_many_scheduled.ts +50 -0
  122. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/operation_get_permalink.schema.js +24 -0
  123. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/operation_get_permalink.ts +32 -0
  124. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/operation_post.schema.js +30 -0
  125. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/operation_post.ts +237 -0
  126. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/operation_schedule.schema.js +31 -0
  127. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/operation_schedule.ts +241 -0
  128. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/operation_search.schema.js +26 -0
  129. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/operation_search.ts +98 -0
  130. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/operation_send_and_wait.schema.js +36 -0
  131. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/operation_send_and_wait.ts +341 -0
  132. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/operation_update.schema.js +29 -0
  133. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_message/operation_update.ts +72 -0
  134. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_reaction/index.schema.js +24 -0
  135. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_reaction/index.ts +18 -0
  136. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_reaction/operation_add.schema.js +25 -0
  137. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_reaction/operation_add.ts +37 -0
  138. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_reaction/operation_get.schema.js +24 -0
  139. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_reaction/operation_get.ts +33 -0
  140. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_reaction/operation_remove.schema.js +25 -0
  141. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_reaction/operation_remove.ts +37 -0
  142. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_star/index.schema.js +24 -0
  143. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_star/index.ts +18 -0
  144. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_star/operation_add.schema.js +27 -0
  145. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_star/operation_add.ts +53 -0
  146. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_star/operation_delete.schema.js +23 -0
  147. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_star/operation_delete.ts +42 -0
  148. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_star/operation_get_all.schema.js +24 -0
  149. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_star/operation_get_all.ts +34 -0
  150. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user/index.schema.js +30 -0
  151. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user/index.ts +27 -0
  152. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user/operation_get_all.schema.js +24 -0
  153. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user/operation_get_all.ts +34 -0
  154. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user/operation_get_presence.schema.js +23 -0
  155. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user/operation_get_presence.ts +29 -0
  156. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user/operation_get_profile.schema.js +23 -0
  157. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user/operation_get_profile.ts +29 -0
  158. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user/operation_info.schema.js +23 -0
  159. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user/operation_info.ts +29 -0
  160. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user/operation_lookup_by_email.schema.js +23 -0
  161. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user/operation_lookup_by_email.ts +27 -0
  162. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user/operation_update_profile.schema.js +23 -0
  163. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user/operation_update_profile.ts +78 -0
  164. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user_group/index.schema.js +32 -0
  165. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user_group/index.ts +30 -0
  166. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user_group/operation_create.schema.js +24 -0
  167. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user_group/operation_create.ts +48 -0
  168. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user_group/operation_disable.schema.js +24 -0
  169. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user_group/operation_disable.ts +36 -0
  170. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user_group/operation_enable.schema.js +24 -0
  171. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user_group/operation_enable.ts +36 -0
  172. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user_group/operation_get_all.schema.js +25 -0
  173. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user_group/operation_get_all.ts +52 -0
  174. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user_group/operation_get_users.schema.js +24 -0
  175. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user_group/operation_get_users.ts +36 -0
  176. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user_group/operation_update.schema.js +24 -0
  177. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user_group/operation_update.ts +50 -0
  178. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user_group/operation_update_users.schema.js +25 -0
  179. package/dist/node-definitions/nodes/n8n-nodes-base/slack/v27/resource_user_group/operation_update_users.ts +42 -0
  180. package/dist/nodes/Confluence/Confluence.node.d.ts +6 -0
  181. package/dist/nodes/Confluence/Confluence.node.d.ts.map +1 -0
  182. package/dist/nodes/Confluence/Confluence.node.js +13 -0
  183. package/dist/nodes/Confluence/Confluence.node.js.map +1 -0
  184. package/dist/nodes/Confluence/Confluence.node.json +18 -0
  185. package/dist/nodes/Confluence/actions/description.d.ts +3 -0
  186. package/dist/nodes/Confluence/actions/description.d.ts.map +1 -0
  187. package/dist/nodes/Confluence/actions/description.js +28 -0
  188. package/dist/nodes/Confluence/actions/description.js.map +1 -0
  189. package/dist/nodes/Confluence/actions/router.d.ts +9 -0
  190. package/dist/nodes/Confluence/actions/router.d.ts.map +1 -0
  191. package/dist/nodes/Confluence/actions/router.js +15 -0
  192. package/dist/nodes/Confluence/actions/router.js.map +1 -0
  193. package/dist/nodes/Confluence/confluence.svg +1 -0
  194. package/dist/nodes/Confluence/transport/index.d.ts +20 -0
  195. package/dist/nodes/Confluence/transport/index.d.ts.map +1 -0
  196. package/dist/nodes/Confluence/transport/index.js +117 -0
  197. package/dist/nodes/Confluence/transport/index.js.map +1 -0
  198. package/dist/nodes/ExecuteWorkflow/ExecuteWorkflow/ExecuteWorkflow.node.d.ts.map +1 -1
  199. package/dist/nodes/ExecuteWorkflow/ExecuteWorkflow/ExecuteWorkflow.node.js +48 -0
  200. package/dist/nodes/ExecuteWorkflow/ExecuteWorkflow/ExecuteWorkflow.node.js.map +1 -1
  201. package/dist/nodes/Form/interfaces.d.ts +1 -0
  202. package/dist/nodes/Form/interfaces.d.ts.map +1 -1
  203. package/dist/nodes/Form/interfaces.js.map +1 -1
  204. package/dist/nodes/Form/utils/utils.d.ts +4 -2
  205. package/dist/nodes/Form/utils/utils.d.ts.map +1 -1
  206. package/dist/nodes/Form/utils/utils.js +125 -2
  207. package/dist/nodes/Form/utils/utils.js.map +1 -1
  208. package/dist/nodes/Function/Function.node.d.ts.map +1 -1
  209. package/dist/nodes/Function/Function.node.js +7 -1
  210. package/dist/nodes/Function/Function.node.js.map +1 -1
  211. package/dist/nodes/FunctionItem/FunctionItem.node.d.ts.map +1 -1
  212. package/dist/nodes/FunctionItem/FunctionItem.node.js +7 -1
  213. package/dist/nodes/FunctionItem/FunctionItem.node.js.map +1 -1
  214. package/dist/nodes/Github/Github.node.d.ts.map +1 -1
  215. package/dist/nodes/Github/Github.node.js +25 -1
  216. package/dist/nodes/Github/Github.node.js.map +1 -1
  217. package/dist/nodes/HttpRequest/V3/Description.js +5 -5
  218. package/dist/nodes/HttpRequest/V3/Description.js.map +1 -1
  219. package/dist/nodes/Kafka/Kafka.node.d.ts +3 -9
  220. package/dist/nodes/Kafka/Kafka.node.d.ts.map +1 -1
  221. package/dist/nodes/Kafka/Kafka.node.js +17 -382
  222. package/dist/nodes/Kafka/Kafka.node.js.map +1 -1
  223. package/dist/nodes/Kafka/KafkaTrigger.node.d.ts +3 -4
  224. package/dist/nodes/Kafka/KafkaTrigger.node.d.ts.map +1 -1
  225. package/dist/nodes/Kafka/KafkaTrigger.node.js +18 -452
  226. package/dist/nodes/Kafka/KafkaTrigger.node.js.map +1 -1
  227. package/dist/nodes/Kafka/utils.d.ts +62 -1
  228. package/dist/nodes/Kafka/utils.d.ts.map +1 -1
  229. package/dist/nodes/Kafka/utils.js +151 -16
  230. package/dist/nodes/Kafka/utils.js.map +1 -1
  231. package/dist/nodes/Kafka/v1/KafkaTriggerV1.node.d.ts +7 -0
  232. package/dist/nodes/Kafka/v1/KafkaTriggerV1.node.d.ts.map +1 -0
  233. package/dist/nodes/Kafka/v1/KafkaTriggerV1.node.js +480 -0
  234. package/dist/nodes/Kafka/v1/KafkaTriggerV1.node.js.map +1 -0
  235. package/dist/nodes/Kafka/v1/KafkaV1.node.d.ts +12 -0
  236. package/dist/nodes/Kafka/v1/KafkaV1.node.d.ts.map +1 -0
  237. package/dist/nodes/Kafka/v1/KafkaV1.node.js +397 -0
  238. package/dist/nodes/Kafka/v1/KafkaV1.node.js.map +1 -0
  239. package/dist/nodes/Kafka/v2/KafkaTriggerV2.node.d.ts +7 -0
  240. package/dist/nodes/Kafka/v2/KafkaTriggerV2.node.d.ts.map +1 -0
  241. package/dist/nodes/Kafka/v2/KafkaTriggerV2.node.js +101 -0
  242. package/dist/nodes/Kafka/v2/KafkaTriggerV2.node.js.map +1 -0
  243. package/dist/nodes/Kafka/v2/KafkaTriggerV2Description.d.ts +3 -0
  244. package/dist/nodes/Kafka/v2/KafkaTriggerV2Description.d.ts.map +1 -0
  245. package/dist/nodes/Kafka/v2/KafkaTriggerV2Description.js +291 -0
  246. package/dist/nodes/Kafka/v2/KafkaTriggerV2Description.js.map +1 -0
  247. package/dist/nodes/Kafka/v2/KafkaV2.node.d.ts +7 -0
  248. package/dist/nodes/Kafka/v2/KafkaV2.node.d.ts.map +1 -0
  249. package/dist/nodes/Kafka/v2/KafkaV2.node.js +386 -0
  250. package/dist/nodes/Kafka/v2/KafkaV2.node.js.map +1 -0
  251. package/dist/nodes/Kafka/v2/TriggerSettings.d.ts +109 -0
  252. package/dist/nodes/Kafka/v2/TriggerSettings.d.ts.map +1 -0
  253. package/dist/nodes/Kafka/v2/TriggerSettings.js +273 -0
  254. package/dist/nodes/Kafka/v2/TriggerSettings.js.map +1 -0
  255. package/dist/nodes/Kafka/v2/consumer/ConsumeTopic.d.ts +51 -0
  256. package/dist/nodes/Kafka/v2/consumer/ConsumeTopic.d.ts.map +1 -0
  257. package/dist/nodes/Kafka/v2/consumer/ConsumeTopic.js +189 -0
  258. package/dist/nodes/Kafka/v2/consumer/ConsumeTopic.js.map +1 -0
  259. package/dist/nodes/Kafka/v2/consumer/DataEmitter.d.ts +45 -0
  260. package/dist/nodes/Kafka/v2/consumer/DataEmitter.d.ts.map +1 -0
  261. package/dist/nodes/Kafka/v2/consumer/DataEmitter.js +153 -0
  262. package/dist/nodes/Kafka/v2/consumer/DataEmitter.js.map +1 -0
  263. package/dist/nodes/Kafka/v2/consumer/MessageParser.d.ts +23 -0
  264. package/dist/nodes/Kafka/v2/consumer/MessageParser.d.ts.map +1 -0
  265. package/dist/nodes/Kafka/v2/consumer/MessageParser.js +100 -0
  266. package/dist/nodes/Kafka/v2/consumer/MessageParser.js.map +1 -0
  267. package/dist/nodes/Kafka/v2/consumer/index.d.ts +7 -0
  268. package/dist/nodes/Kafka/v2/consumer/index.d.ts.map +1 -0
  269. package/dist/nodes/Kafka/v2/consumer/index.js +13 -0
  270. package/dist/nodes/Kafka/v2/consumer/index.js.map +1 -0
  271. package/dist/nodes/Kafka/v2/transport/LibraryLogger.d.ts +18 -0
  272. package/dist/nodes/Kafka/v2/transport/LibraryLogger.d.ts.map +1 -0
  273. package/dist/nodes/Kafka/v2/transport/LibraryLogger.js +94 -0
  274. package/dist/nodes/Kafka/v2/transport/LibraryLogger.js.map +1 -0
  275. package/dist/nodes/Kafka/v2/transport/client.d.ts +20 -0
  276. package/dist/nodes/Kafka/v2/transport/client.d.ts.map +1 -0
  277. package/dist/nodes/Kafka/v2/transport/client.js +36 -0
  278. package/dist/nodes/Kafka/v2/transport/client.js.map +1 -0
  279. package/dist/nodes/Kafka/v2/transport/config.d.ts +13 -0
  280. package/dist/nodes/Kafka/v2/transport/config.d.ts.map +1 -0
  281. package/dist/nodes/Kafka/v2/transport/config.js +57 -0
  282. package/dist/nodes/Kafka/v2/transport/config.js.map +1 -0
  283. package/dist/nodes/Kafka/v2/transport/consumer.d.ts +66 -0
  284. package/dist/nodes/Kafka/v2/transport/consumer.d.ts.map +1 -0
  285. package/dist/nodes/Kafka/v2/transport/consumer.js +48 -0
  286. package/dist/nodes/Kafka/v2/transport/consumer.js.map +1 -0
  287. package/dist/nodes/Kafka/v2/transport/index.d.ts +6 -0
  288. package/dist/nodes/Kafka/v2/transport/index.d.ts.map +1 -0
  289. package/dist/nodes/Kafka/v2/transport/index.js +16 -0
  290. package/dist/nodes/Kafka/v2/transport/index.js.map +1 -0
  291. package/dist/nodes/Kafka/v2/transport/producer.d.ts +9 -0
  292. package/dist/nodes/Kafka/v2/transport/producer.d.ts.map +1 -0
  293. package/dist/nodes/Kafka/v2/transport/producer.js +18 -0
  294. package/dist/nodes/Kafka/v2/transport/producer.js.map +1 -0
  295. package/dist/nodes/Merge/Merge.node.json +1 -1
  296. package/dist/nodes/Microsoft/SharePoint/v2/file/index.d.ts.map +1 -1
  297. package/dist/nodes/Microsoft/SharePoint/v2/file/index.js +0 -3
  298. package/dist/nodes/Microsoft/SharePoint/v2/file/index.js.map +1 -1
  299. package/dist/nodes/Microsoft/SharePoint/v2/site/index.d.ts.map +1 -1
  300. package/dist/nodes/Microsoft/SharePoint/v2/site/index.js +10 -8
  301. package/dist/nodes/Microsoft/SharePoint/v2/site/index.js.map +1 -1
  302. package/dist/nodes/Notion/shared/GenericFunctions.d.ts +3 -3
  303. package/dist/nodes/Notion/shared/GenericFunctions.d.ts.map +1 -1
  304. package/dist/nodes/Salesforce/SalesforceTrigger.node.d.ts.map +1 -1
  305. package/dist/nodes/Salesforce/SalesforceTrigger.node.js +31 -0
  306. package/dist/nodes/Salesforce/SalesforceTrigger.node.js.map +1 -1
  307. package/dist/nodes/Schedule/GenericFunctions.d.ts +2 -1
  308. package/dist/nodes/Schedule/GenericFunctions.d.ts.map +1 -1
  309. package/dist/nodes/Schedule/GenericFunctions.js +43 -0
  310. package/dist/nodes/Schedule/GenericFunctions.js.map +1 -1
  311. package/dist/nodes/Schedule/ScheduleTrigger.node.d.ts.map +1 -1
  312. package/dist/nodes/Schedule/ScheduleTrigger.node.js +2 -1
  313. package/dist/nodes/Schedule/ScheduleTrigger.node.js.map +1 -1
  314. package/dist/nodes/Schedule/SchedulerInterface.d.ts +15 -1
  315. package/dist/nodes/Schedule/SchedulerInterface.d.ts.map +1 -1
  316. package/dist/nodes/Slack/Slack.node.d.ts.map +1 -1
  317. package/dist/nodes/Slack/Slack.node.js +2 -1
  318. package/dist/nodes/Slack/Slack.node.js.map +1 -1
  319. package/dist/nodes/Slack/V2/GenericFunctions.d.ts +12 -0
  320. package/dist/nodes/Slack/V2/GenericFunctions.d.ts.map +1 -1
  321. package/dist/nodes/Slack/V2/GenericFunctions.js +80 -19
  322. package/dist/nodes/Slack/V2/GenericFunctions.js.map +1 -1
  323. package/dist/nodes/Slack/V2/MessageDescription.d.ts.map +1 -1
  324. package/dist/nodes/Slack/V2/MessageDescription.js +137 -0
  325. package/dist/nodes/Slack/V2/MessageDescription.js.map +1 -1
  326. package/dist/nodes/Slack/V2/SlackHitlWebhook.d.ts +1 -1
  327. package/dist/nodes/Slack/V2/SlackV2.node.d.ts.map +1 -1
  328. package/dist/nodes/Slack/V2/SlackV2.node.js +64 -17
  329. package/dist/nodes/Slack/V2/SlackV2.node.js.map +1 -1
  330. package/dist/nodes/Slack/__schema__/v2.7.0/message/search.json +75 -0
  331. package/dist/nodes/Twitter/V2/GenericFunctions.js +1 -1
  332. package/dist/nodes/Twitter/V2/GenericFunctions.js.map +1 -1
  333. package/dist/nodes/Webhook/description.d.ts.map +1 -1
  334. package/dist/nodes/Webhook/description.js +15 -9
  335. package/dist/nodes/Webhook/description.js.map +1 -1
  336. package/dist/types/credentials.json +4 -4
  337. package/dist/types/nodes.json +18 -15
  338. package/package.json +14 -12
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_EXECUTION_TIMEOUT_SECONDS = void 0;
4
+ exports.createDataEmitter = createDataEmitter;
5
+ const ensure_error_1 = require("@n8n/utils/errors/ensure-error");
6
+ const sleep_1 = require("@n8n/utils/sleep");
7
+ const n8n_workflow_1 = require("n8n-workflow");
8
+ const utils_1 = require("../../utils");
9
+ // ---------------------------------------------------------------------------
10
+ // Constants
11
+ // ---------------------------------------------------------------------------
12
+ /**
13
+ * The wait an absent workflow execution timeout falls back to. Exported because
14
+ * the consumer's processing deadline has to agree with it: if the emitter waits
15
+ * an hour for an execution the broker fenced ten minutes in, the message is
16
+ * redelivered while n8n still thinks the run owns it.
17
+ */
18
+ exports.DEFAULT_EXECUTION_TIMEOUT_SECONDS = 3600;
19
+ // Every hand-off returns one of these two, so they are shared rather than
20
+ // rebuilt. Frozen because a caller mutating the one it was handed would change
21
+ // the verdict every later hand-off gets. `readonly` on the field catches that
22
+ // at compile time; the freeze covers callers outside this package's types.
23
+ const ADVANCE = Object.freeze({ mayAdvance: true });
24
+ const HOLD_BACK = Object.freeze({ mayAdvance: false });
25
+ // ---------------------------------------------------------------------------
26
+ // Entry point
27
+ // ---------------------------------------------------------------------------
28
+ /**
29
+ * Builds the function that starts an execution for a chunk of items and decides
30
+ * whether its offsets may advance. `mayAdvance: false` means the caller must not
31
+ * record the chunk as done, so Kafka delivers it again.
32
+ *
33
+ * `immediately` never waits, which is at-most-once. The other three wait for the
34
+ * execution and are at-least-once. This mirrors v1's `configureDataEmitter`,
35
+ * with the mode and its inputs resolved by the caller rather than read from node
36
+ * parameters here.
37
+ * @param ctx - Trigger context used to emit and log
38
+ * @param options - Resolved offset mode and its inputs
39
+ * @param closeSignal - Aborted on teardown, so a wait never outlives the trigger
40
+ */
41
+ function createDataEmitter(ctx, options, closeSignal) {
42
+ return options.resolveOffsetMode === 'immediately'
43
+ ? createImmediateEmitter(ctx, closeSignal)
44
+ : createAwaitingEmitter(ctx, options, closeSignal);
45
+ }
46
+ // ---------------------------------------------------------------------------
47
+ // The two emitter shapes
48
+ // ---------------------------------------------------------------------------
49
+ /** Hands the chunk over and advances at once, without waiting for the run. */
50
+ function createImmediateEmitter(ctx, closeSignal) {
51
+ return async (items) => {
52
+ // Never start an execution once the trigger is closing.
53
+ if (closeSignal.aborted)
54
+ return HOLD_BACK;
55
+ ctx.emit([items]);
56
+ return ADVANCE;
57
+ };
58
+ }
59
+ /** Waits for the execution and advances only if its status is allowed. */
60
+ function createAwaitingEmitter(ctx, options, closeSignal) {
61
+ const allowedStatuses = resolveAllowedStatuses(ctx, options);
62
+ const deadlineSeconds = options.executionTimeoutSeconds ?? exports.DEFAULT_EXECUTION_TIMEOUT_SECONDS;
63
+ const errorRetryDelay = (0, utils_1.resolveRetryDelay)(options.errorRetryDelay, ctx.logger);
64
+ // Two views of closing, because the two waits below want different things.
65
+ // The rejecting one ends the wait for an execution with a reason, which is
66
+ // what gets logged. The quiet one only needs to stop the retry pause, and
67
+ // deriving it here also handles the rejection, so the one that loses the race
68
+ // is not reported as an unhandled rejection.
69
+ const closedWithReason = rejectOnClose(closeSignal);
70
+ const closedQuietly = closedWithReason.catch(() => undefined);
71
+ return async (items) => {
72
+ if (closeSignal.aborted)
73
+ return HOLD_BACK;
74
+ try {
75
+ const run = await awaitExecution(ctx, items, deadlineSeconds, closedWithReason);
76
+ if (allowedStatuses && !allowedStatuses.includes(run.status)) {
77
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `Execution status is not allowed for resolving offsets, current status: ${run.status}`);
78
+ }
79
+ return ADVANCE;
80
+ }
81
+ catch (caught) {
82
+ // The retry backoff must not delay teardown.
83
+ if (!closeSignal.aborted)
84
+ await Promise.race([(0, sleep_1.sleep)(errorRetryDelay), closedQuietly]);
85
+ const error = (0, ensure_error_1.ensureError)(caught);
86
+ // Teardown cancelling an in-flight execution is expected, not a failure,
87
+ // so it must not surface as an error in the log.
88
+ if (closeSignal.aborted)
89
+ ctx.logger.debug(error.message, { error });
90
+ else
91
+ ctx.logger.error(error.message, { error });
92
+ return HOLD_BACK;
93
+ }
94
+ };
95
+ }
96
+ // ---------------------------------------------------------------------------
97
+ // Helpers
98
+ // ---------------------------------------------------------------------------
99
+ /** The statuses that let the offset advance, or undefined when any status does. */
100
+ function resolveAllowedStatuses(ctx, options) {
101
+ if (options.resolveOffsetMode === 'onCompletion')
102
+ return undefined;
103
+ if (options.resolveOffsetMode === 'onSuccess')
104
+ return ['success'];
105
+ if (!options.allowedStatuses?.length) {
106
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), 'At least one execution status must be selected to resolve offsets on selected statuses.');
107
+ }
108
+ return options.allowedStatuses;
109
+ }
110
+ /** Rejects when the trigger closes, so a wait ends with a reason rather than hanging. */
111
+ async function rejectOnClose(closeSignal) {
112
+ return await new Promise((_, reject) => {
113
+ const fail = () => reject(new n8n_workflow_1.OperationalError('Trigger closed before the execution finished, offsets not resolved.'));
114
+ // The abort event fires once. If it already fired, no listener would run.
115
+ if (closeSignal.aborted)
116
+ return fail();
117
+ closeSignal.addEventListener('abort', fail, { once: true });
118
+ });
119
+ }
120
+ /**
121
+ * Starts one execution and waits for it, bounded by the workflow's timeout and
122
+ * by close.
123
+ * @param deadlineSeconds - Zero or less means unbounded. n8n treats a workflow
124
+ * timeout of <= 0 that way (workflow-execute-additional-data.ts:255), and handing
125
+ * it to setTimeout would fire on the next tick and fail every hand-off. A
126
+ * deadline too large for a timer is treated the same way, for the same reason.
127
+ */
128
+ async function awaitExecution(ctx, items, deadlineSeconds, closedWithReason) {
129
+ const response = ctx.helpers.createDeferredPromise();
130
+ ctx.emit([items], undefined, response);
131
+ const finished = Promise.race([response.promise, closedWithReason]);
132
+ if (deadlineSeconds <= 0)
133
+ return await finished;
134
+ // Past the 32-bit timer limit setTimeout fires after 1ms instead of waiting,
135
+ // which would fail every hand-off rather than time out a slow one. A deadline
136
+ // of 24 days or more is unbounded in practice, so treat it as such.
137
+ const deadlineMs = deadlineSeconds * 1000;
138
+ if (deadlineMs > utils_1.MAX_TIMER_DELAY_MS)
139
+ return await finished;
140
+ let timer;
141
+ try {
142
+ return await Promise.race([
143
+ finished,
144
+ new Promise((_, reject) => {
145
+ timer = setTimeout(() => reject(new n8n_workflow_1.NodeOperationError(ctx.getNode(), `Execution took longer than the configured workflow timeout of ${deadlineSeconds} seconds to complete, offsets not resolved.`)), deadlineMs);
146
+ }),
147
+ ]);
148
+ }
149
+ finally {
150
+ clearTimeout(timer);
151
+ }
152
+ }
153
+ //# sourceMappingURL=DataEmitter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataEmitter.js","sourceRoot":"","sources":["../../../../../nodes/Kafka/v2/consumer/DataEmitter.ts"],"names":[],"mappings":";;;;AAAA,iEAA6D;AAC7D,4CAAyC;AAEzC,+CAAoE;AAEpE,uCAAoE;AAiCpE,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E;;;;;GAKG;AACU,QAAA,iCAAiC,GAAG,IAAI,CAAC;AAEtD,0EAA0E;AAC1E,+EAA+E;AAC/E,8EAA8E;AAC9E,2EAA2E;AAC3E,MAAM,OAAO,GAAkB,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;AACnE,MAAM,SAAS,GAAkB,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;AAEtE,8EAA8E;AAC9E,cAAc;AACd,8EAA8E;AAE9E;;;;;;;;;;;;GAYG;AACH,2BACC,GAAuB,EACvB,OAA2B,EAC3B,WAAwB;IAExB,OAAO,OAAO,CAAC,iBAAiB,KAAK,aAAa;QACjD,CAAC,CAAC,sBAAsB,CAAC,GAAG,EAAE,WAAW,CAAC;QAC1C,CAAC,CAAC,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;AACrD,CAAC;AAED,8EAA8E;AAC9E,yBAAyB;AACzB,8EAA8E;AAE9E,8EAA8E;AAC9E,SAAS,sBAAsB,CAAC,GAAuB,EAAE,WAAwB;IAChF,OAAO,KAAK,EAAE,KAAK,EAAE,EAAE;QACtB,wDAAwD;QACxD,IAAI,WAAW,CAAC,OAAO;YAAE,OAAO,SAAS,CAAC;QAC1C,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QAClB,OAAO,OAAO,CAAC;IAChB,CAAC,CAAC;AACH,CAAC;AAED,0EAA0E;AAC1E,SA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KAAK,UAAU,cAAc,CAC5B,GAAuB,EACvB,KAA2B,EAC3B,eAAuB,EACvB,gBAAgC;IAEhC,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,qBAAqB,EAAQ,CAAC;IAC3D,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IAEvC,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC;IACpE,IAAI,eAAe,IAAI,CAAC;QAAE,OAAO,MAAM,QAAQ,CAAC;IAEhD,6EAA6E;IAC7E,8EAA8E;IAC9E,oEAAoE;IACpE,MAAM,UAAU,GAAG,eAAe,GAAG,IAAI,CAAC;IAC1C,IAAI,UAAU,GAAG,0BAAkB;QAAE,OAAO,MAAM,QAAQ,CAAC;IAE3D,IAAI,KAAiC,CAAC;IACtC,IAAI,CAAC;QACJ,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC;YACzB,QAAQ;YACR,IAAI,OAAO,CAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE;gBAChC,KAAK,GAAG,UAAU,CACjB,GAAG,EAAE,CACJ,MAAM,CACL,IAAI,iCAAkB,CACrB,GAAG,CAAC,OAAO,EAAE,EACb,iEAAiE,eAAe,6CAA6C,CAC7H,CACD,EACF,UAAU,CACV,CAAC;YACH,CAAC,CAAC;SACF,CAAC,CAAC;IACJ,CAAC;YAAS,CAAC;QACV,YAAY,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;AACF,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { KafkaJS } from '@confluentinc/kafka-javascript';
2
+ import type { SchemaRegistry } from '@kafkajs/confluent-schema-registry';
3
+ import type { INodeExecutionData, ITriggerFunctions, Logger } from 'n8n-workflow';
4
+ /** The subset of trigger options that changes the parsed item shape. */
5
+ export interface KafkaMessageParserOptions {
6
+ jsonParseMessage?: boolean;
7
+ keepBinaryData?: boolean;
8
+ onlyMessage?: boolean;
9
+ returnHeaders?: boolean;
10
+ }
11
+ export type KafkaMessageParser = (message: KafkaJS.KafkaMessage, topic: string) => Promise<INodeExecutionData>;
12
+ /**
13
+ * Builds the parser that turns a library message into the item a workflow
14
+ * receives. The output shape is v1's, deliberately: `{ json: { message, topic,
15
+ * headers? }, binary? }`. The message key and timestamp stay absent — exposing
16
+ * them would be a behaviour change, not a migration.
17
+ * @param options - The trigger options that affect the item shape
18
+ * @param logger - Logger used for the warn-and-continue paths
19
+ * @param registry - Schema Registry client, when the user enabled decoding
20
+ * @param prepareBinaryData - Helper used to attach the raw value as binary data
21
+ */
22
+ export declare function createMessageParser(options: KafkaMessageParserOptions, logger: Logger, registry: SchemaRegistry | undefined, prepareBinaryData: ITriggerFunctions['helpers']['prepareBinaryData']): KafkaMessageParser;
23
+ //# sourceMappingURL=MessageParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageParser.d.ts","sourceRoot":"","sources":["../../../../../nodes/Kafka/v2/consumer/MessageParser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAIX,kBAAkB,EAClB,iBAAiB,EACjB,MAAM,EACN,MAAM,cAAc,CAAC;AAQtB,wEAAwE;AACxE,MAAM,WAAW,yBAAyB;IACzC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,kBAAkB,GAAG,CAChC,OAAO,EAAE,OAAO,CAAC,YAAY,EAC7B,KAAK,EAAE,MAAM,KACT,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAmBjC;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,yBAAyB,EAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,GAAG,SAAS,EACpC,iBAAiB,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC,mBAAmB,CAAC,GAClE,kBAAkB,CAyEpB"}
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createMessageParser = createMessageParser;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const utils_1 = require("../../utils");
6
+ /**
7
+ * Renders one Kafka header value the way v1 did: a Buffer decoded as UTF-8, an
8
+ * array joined with commas, a missing value as an empty string. v1 called
9
+ * `.toString('utf8')` on whatever kafkajs handed it; the new library also allows
10
+ * plain strings there, so the cases are spelled out instead.
11
+ */
12
+ function headerToString(value) {
13
+ if (value === undefined)
14
+ return '';
15
+ if (Buffer.isBuffer(value))
16
+ return value.toString('utf8');
17
+ if (Array.isArray(value)) {
18
+ return value
19
+ .map((entry) => (Buffer.isBuffer(entry) ? entry.toString('utf8') : entry))
20
+ .join(',');
21
+ }
22
+ return value;
23
+ }
24
+ /**
25
+ * Builds the parser that turns a library message into the item a workflow
26
+ * receives. The output shape is v1's, deliberately: `{ json: { message, topic,
27
+ * headers? }, binary? }`. The message key and timestamp stay absent — exposing
28
+ * them would be a behaviour change, not a migration.
29
+ * @param options - The trigger options that affect the item shape
30
+ * @param logger - Logger used for the warn-and-continue paths
31
+ * @param registry - Schema Registry client, when the user enabled decoding
32
+ * @param prepareBinaryData - Helper used to attach the raw value as binary data
33
+ */
34
+ function createMessageParser(options, logger, registry, prepareBinaryData) {
35
+ return async (message, topic) => {
36
+ let data = {};
37
+ let value = message.value?.toString();
38
+ const binary = {};
39
+ if (options.jsonParseMessage) {
40
+ try {
41
+ value = (0, n8n_workflow_1.jsonParse)(value);
42
+ }
43
+ catch (error) {
44
+ logger.warn('Could not parse message to JSON, returning as string', { error });
45
+ }
46
+ }
47
+ if (registry && message.value) {
48
+ try {
49
+ value = await registry.decode(message.value);
50
+ }
51
+ catch (error) {
52
+ // Deliberately fatal, unlike v1, which warns and hands the workflow the
53
+ // raw bytes. An undecoded Avro value is a magic byte, a schema id and
54
+ // binary rendered through UTF-8: unusable downstream, and v1 commits the
55
+ // offset anyway, so the message is gone for good. Measured against a real
56
+ // broker: stop the registry, consume, restart it, rejoin the same group,
57
+ // and the message never comes back.
58
+ //
59
+ // Throwing hands it to the consume loop, which paces a retry and leaves
60
+ // the chunk unresolved, so Kafka redelivers it and the message survives
61
+ // until the registry is healthy again. The partition stalls meanwhile,
62
+ // which is the visible, recoverable failure we want in place of silent
63
+ // corruption. A JSON parse failure above stays a warning: a message that
64
+ // is not JSON is a legitimate case and the string is still usable.
65
+ const sanitized = (0, utils_1.sanitizeRegistryError)(error);
66
+ logger.error('Could not decode message with Schema Registry, leaving it unread', sanitized);
67
+ // Sanitized, and deliberately without the original as `cause`. A registry
68
+ // error message can carry the URL it was built from, userinfo included,
69
+ // and the consume loop logs whatever this throws when it decides to leave
70
+ // the chunk unresolved. Rethrowing the raw error, or attaching it, would
71
+ // put the credential back in the log the line above just scrubbed.
72
+ throw new n8n_workflow_1.OperationalError(sanitized.message);
73
+ }
74
+ }
75
+ if (options.keepBinaryData && message.value) {
76
+ binary.data = await prepareBinaryData(message.value, 'message', 'application/octet-stream');
77
+ }
78
+ if (options.returnHeaders) {
79
+ // Unconditional, and empty when the message carries none: kafkajs always
80
+ // handed v1 a headers object, the new library leaves it undefined, and the
81
+ // item must not gain or lose the key depending on the library.
82
+ data.headers = Object.fromEntries(Object.entries(message.headers ?? {}).map(([headerKey, headerValue]) => [
83
+ headerKey,
84
+ headerToString(headerValue),
85
+ ]));
86
+ }
87
+ data.message = value;
88
+ data.topic = topic;
89
+ if (options.onlyMessage) {
90
+ // Matches v1: the parsed value replaces the whole item body, even when it
91
+ // is not an object.
92
+ data = value;
93
+ }
94
+ if (options.keepBinaryData && Object.keys(binary).length) {
95
+ return { json: data, binary };
96
+ }
97
+ return { json: data };
98
+ };
99
+ }
100
+ //# sourceMappingURL=MessageParser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageParser.js","sourceRoot":"","sources":["../../../../../nodes/Kafka/v2/consumer/MessageParser.ts"],"names":[],"mappings":";;;AAUA,+CAA2D;AAE3D,uCAAoD;AAkBpD;;;;;GAKG;AACH,SAAS,cAAc,CAAC,KAA+B;IACtD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACnC,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1D,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,KAAK;aACV,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;aACzE,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED;;;;;;;;;GASG;AACH,6BACC,OAAkC,EAClC,MAAc,EACd,QAAoC,EACpC,iBAAoE;IAEpE,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;QAC/B,IAAI,IAAI,GAAgB,EAAE,CAAC;QAC3B,IAAI,KAAK,GAAgB,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC;QACnD,MAAM,MAAM,GAAmB,EAAE,CAAC;QAElC,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;YAC9B,IAAI,CAAC;gBACJ,KAAK,GAAG,IAAA,wBAAS,EAAc,KAAe,CAAC,CAAC;YACjD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,MAAM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EAAE,CAAC;gBACvE,SAAS;gBACT,cAAc,CAAC,WAAW,CAAC;aAC3B,CAAC,CACF,CAAC;QACH,CAAC;QAED,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;YACzB,0EAA0E;YAC1E,oBAAoB;YACpB,IAAI,GAAG,KAAoB,CAAC;QAC7B,CAAC;QAED,IAAI,OAAO,CAAC,cAAc,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;YAC1D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC/B,CAAC;QAED,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACvB,CAAC,CAAC;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { consumeTopic, DEFAULT_BATCH_SIZE, DEFAULT_PARTITIONS_CONSUMED_CONCURRENTLY, } from './ConsumeTopic';
2
+ export type { ConsumeTopicOptions, KafkaConsumerHandle } from './ConsumeTopic';
3
+ export { createDataEmitter, DEFAULT_EXECUTION_TIMEOUT_SECONDS } from './DataEmitter';
4
+ export type { DataEmitter, DataEmitterContext, DataEmitterOptions, OffsetVerdict, ResolveOffsetMode, } from './DataEmitter';
5
+ export { createMessageParser } from './MessageParser';
6
+ export type { KafkaMessageParser, KafkaMessageParserOptions } from './MessageParser';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../nodes/Kafka/v2/consumer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,YAAY,EACZ,kBAAkB,EAClB,wCAAwC,GACxC,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAAC;AACrF,YAAY,EACX,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,YAAY,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createMessageParser = exports.DEFAULT_EXECUTION_TIMEOUT_SECONDS = exports.createDataEmitter = exports.DEFAULT_PARTITIONS_CONSUMED_CONCURRENTLY = exports.DEFAULT_BATCH_SIZE = exports.consumeTopic = void 0;
4
+ var ConsumeTopic_1 = require("./ConsumeTopic");
5
+ Object.defineProperty(exports, "consumeTopic", { enumerable: true, get: function () { return ConsumeTopic_1.consumeTopic; } });
6
+ Object.defineProperty(exports, "DEFAULT_BATCH_SIZE", { enumerable: true, get: function () { return ConsumeTopic_1.DEFAULT_BATCH_SIZE; } });
7
+ Object.defineProperty(exports, "DEFAULT_PARTITIONS_CONSUMED_CONCURRENTLY", { enumerable: true, get: function () { return ConsumeTopic_1.DEFAULT_PARTITIONS_CONSUMED_CONCURRENTLY; } });
8
+ var DataEmitter_1 = require("./DataEmitter");
9
+ Object.defineProperty(exports, "createDataEmitter", { enumerable: true, get: function () { return DataEmitter_1.createDataEmitter; } });
10
+ Object.defineProperty(exports, "DEFAULT_EXECUTION_TIMEOUT_SECONDS", { enumerable: true, get: function () { return DataEmitter_1.DEFAULT_EXECUTION_TIMEOUT_SECONDS; } });
11
+ var MessageParser_1 = require("./MessageParser");
12
+ Object.defineProperty(exports, "createMessageParser", { enumerable: true, get: function () { return MessageParser_1.createMessageParser; } });
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Kafka/v2/consumer/index.ts"],"names":[],"mappings":";;;AAAA,+CAIwB;AAHvB,4GAAA,YAAY,OAAA;AACZ,kHAAA,kBAAkB,OAAA;AAClB,wIAAA,wCAAwC,OAAA;AAGzC,6CAAqF;AAA5E,gHAAA,iBAAiB,OAAA;AAAE,gIAAA,iCAAiC,OAAA;AAQ7D,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA"}
@@ -0,0 +1,18 @@
1
+ import type { KafkaJS } from '@confluentinc/kafka-javascript';
2
+ import type { Logger } from 'n8n-workflow';
3
+ /** Called with an error the consumer will not recover from without intervention. */
4
+ export type FatalErrorHandler = (error: Error) => void;
5
+ /**
6
+ * Adapts n8n's logger to the one the Kafka library expects, and watches its
7
+ * error output for conditions worth surfacing.
8
+ *
9
+ * Two problems solved at once. The library's default logger writes to process
10
+ * stdout, outside n8n's logger, which is why the client otherwise has to pin
11
+ * its level to ERROR just to stay quiet. And there is no error event to attach
12
+ * to, so the log stream is the only place a fatal condition is visible.
13
+ * @param logger - The node's logger, which receives whatever the library says at
14
+ * or above the level the library itself asks for
15
+ * @param onFatalError - Called once per non-recoverable error seen
16
+ */
17
+ export declare function createLibraryLogger(logger: Logger, onFatalError?: FatalErrorHandler): KafkaJS.Logger;
18
+ //# sourceMappingURL=LibraryLogger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LibraryLogger.d.ts","sourceRoot":"","sources":["../../../../../nodes/Kafka/v2/transport/LibraryLogger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAyB3C,oFAAoF;AACpF,MAAM,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;AAgBvD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,MAAM,EACd,YAAY,CAAC,EAAE,iBAAiB,GAC9B,OAAO,CAAC,MAAM,CA0ChB"}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createLibraryLogger = createLibraryLogger;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ /**
6
+ * Conditions librdkafka will never recover from on its own, so the trigger has
7
+ * to stop waiting and tell n8n. Everything else is left to its automatic retry,
8
+ * which the ENT-8 findings (section 8) describe as always on and not
9
+ * configurable.
10
+ *
11
+ * Deliberately short. A false positive restarts a healthy trigger, which is
12
+ * worse than staying quiet, so anything that might resolve by itself is absent:
13
+ * an unreachable broker, a leader election, an unknown topic that is about to be
14
+ * created.
15
+ *
16
+ * Matching on the message is forced on us. The kafkaJS compatibility layer keeps
17
+ * no error code by the time it reaches a logger (`_consumer.js` builds the entry
18
+ * from `err.message` alone) and exposes no error event, so this is the only hook
19
+ * there is. v1 does the same thing in `toUserFacingConsumerError`.
20
+ */
21
+ const NON_RECOVERABLE = [/authorization failed/i, /authentication fail/i];
22
+ function isNonRecoverable(message) {
23
+ return NON_RECOVERABLE.some((pattern) => pattern.test(message));
24
+ }
25
+ /**
26
+ * The library's `logLevel` values, repeated as plain numbers because only
27
+ * `transport/client.ts` may import the library at runtime and these are needed
28
+ * to compare against the level handed to `setLogLevel`. Kept in the library's
29
+ * order, where a higher number is more verbose (`_common.js:66`).
30
+ */
31
+ const LEVEL = {
32
+ NOTHING: 0,
33
+ ERROR: 1,
34
+ WARN: 2,
35
+ INFO: 3,
36
+ DEBUG: 4,
37
+ };
38
+ /**
39
+ * Adapts n8n's logger to the one the Kafka library expects, and watches its
40
+ * error output for conditions worth surfacing.
41
+ *
42
+ * Two problems solved at once. The library's default logger writes to process
43
+ * stdout, outside n8n's logger, which is why the client otherwise has to pin
44
+ * its level to ERROR just to stay quiet. And there is no error event to attach
45
+ * to, so the log stream is the only place a fatal condition is visible.
46
+ * @param logger - The node's logger, which receives whatever the library says at
47
+ * or above the level the library itself asks for
48
+ * @param onFatalError - Called once per non-recoverable error seen
49
+ */
50
+ function createLibraryLogger(logger, onFatalError) {
51
+ const meta = (extra) => ({ kafka: { ...extra } });
52
+ // The library does no level filtering of its own. It resolves a level from
53
+ // the client config and hands it over, expecting the logger to drop anything
54
+ // below it (`_consumer.js:634`, and `DefaultLogger` in `_common.js:95`). The
55
+ // same level also reaches librdkafka as `log_level`, so ignoring it here left
56
+ // the JS side more verbose than the native side it is meant to match.
57
+ //
58
+ // Permissive until that call lands, so nothing is dropped before the library
59
+ // has said what it wants.
60
+ let level = LEVEL.DEBUG;
61
+ const libraryLogger = {
62
+ info: (message, extra) => {
63
+ if (level >= LEVEL.INFO)
64
+ logger.info(message, meta(extra));
65
+ },
66
+ warn: (message, extra) => {
67
+ if (level >= LEVEL.WARN)
68
+ logger.warn(message, meta(extra));
69
+ },
70
+ debug: (message, extra) => {
71
+ if (level >= LEVEL.DEBUG)
72
+ logger.debug(message, meta(extra));
73
+ },
74
+ error: (message, extra) => {
75
+ if (level >= LEVEL.ERROR)
76
+ logger.error(message, meta(extra));
77
+ // Not gated by the level: escalating a non-recoverable error is control
78
+ // flow rather than logging, and it has to keep working however quiet the
79
+ // client asks the library to be.
80
+ if (onFatalError && isNonRecoverable(message)) {
81
+ onFatalError(new n8n_workflow_1.UserError(message));
82
+ }
83
+ },
84
+ // The library namespaces its loggers per component. n8n's logger has no
85
+ // equivalent and the entries already say which component they came from,
86
+ // so the same logger is reused.
87
+ namespace: () => libraryLogger,
88
+ setLogLevel: (next) => {
89
+ level = next;
90
+ },
91
+ };
92
+ return libraryLogger;
93
+ }
94
+ //# sourceMappingURL=LibraryLogger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LibraryLogger.js","sourceRoot":"","sources":["../../../../../nodes/Kafka/v2/transport/LibraryLogger.ts"],"names":[],"mappings":";;;AAEA,+CAAyC;AAEzC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,eAAe,GAAG,CAAC,uBAAuB,EAAE,sBAAsB,CAAC,CAAC;AAE1E,SAAS,gBA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9D,CAAC;QACD,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;YACzB,IAAI,KAAK,IAAI,KAAK,CAAC,KAAK;gBAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YAC7D,wEAAwE;YACxE,yEAAyE;YACzE,iCAAiC;YACjC,IAAI,YAAY,IAAI,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC/C,YAAY,CAAC,IAAI,wBAAS,CAAC,OAAO,CAAC,CAAC,CAAC;YACtC,CAAC;QACF,CAAC;QACD,wEAAwE;QACxE,yEAAyE;QACzE,gCAAgC;QAChC,SAAS,EAAE,GAAG,EAAE,CAAC,aAAa;QAC9B,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE;YACrB,KAAK,GAAG,IAAI,CAAC;QACd,CAAC;KACD,CAAC;IAEF,OAAO,aAAa,CAAC;AACtB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { KafkaJS as KafkaJSNamespace } from '@confluentinc/kafka-javascript';
2
+ import type { KafkaCredentials } from '../../utils';
3
+ /**
4
+ * The only file allowed to import '@confluentinc/kafka-javascript' at runtime
5
+ * (enforced by eslint.config.mjs) — all v2 Kafka code must go through this
6
+ * lazy access point instead of importing the library directly.
7
+ *
8
+ * A rejected import (e.g. the native binding failing to load) propagates
9
+ * unwrapped and leaves the cache empty, so the next call retries from scratch
10
+ * rather than permanently wedging on a transient failure.
11
+ */
12
+ export declare function getKafkaLibrary(): Promise<typeof KafkaJSNamespace>;
13
+ /**
14
+ * Builds the library client for a credential. Shared by the producer and consumer
15
+ * factories so the credential conversion and the log-level pin stay in one place
16
+ * rather than being copied per factory.
17
+ * @param credentials - The decrypted Kafka credential
18
+ */
19
+ export declare function createKafkaClient(credentials: KafkaCredentials): Promise<KafkaJSNamespace.Kafka>;
20
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../nodes/Kafka/v2/transport/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAGlF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIpD;;;;;;;;GAQG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,OAAO,gBAAgB,CAAC,CAKxE;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACtC,WAAW,EAAE,gBAAgB,GAC3B,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAMjC"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getKafkaLibrary = getKafkaLibrary;
4
+ exports.createKafkaClient = createKafkaClient;
5
+ const config_1 = require("./config");
6
+ let _kafkaJS = null;
7
+ /**
8
+ * The only file allowed to import '@confluentinc/kafka-javascript' at runtime
9
+ * (enforced by eslint.config.mjs) — all v2 Kafka code must go through this
10
+ * lazy access point instead of importing the library directly.
11
+ *
12
+ * A rejected import (e.g. the native binding failing to load) propagates
13
+ * unwrapped and leaves the cache empty, so the next call retries from scratch
14
+ * rather than permanently wedging on a transient failure.
15
+ */
16
+ async function getKafkaLibrary() {
17
+ if (_kafkaJS)
18
+ return _kafkaJS;
19
+ const mod = await import('@confluentinc/kafka-javascript');
20
+ _kafkaJS = mod.KafkaJS;
21
+ return _kafkaJS;
22
+ }
23
+ /**
24
+ * Builds the library client for a credential. Shared by the producer and consumer
25
+ * factories so the credential conversion and the log-level pin stay in one place
26
+ * rather than being copied per factory.
27
+ * @param credentials - The decrypted Kafka credential
28
+ */
29
+ async function createKafkaClient(credentials) {
30
+ const { Kafka, logLevel } = await getKafkaLibrary();
31
+ const config = (0, config_1.toKafkaJSConfig)(credentials);
32
+ // Without an explicit level the library's own logger writes broker host:port to
33
+ // process stdout on every execution, outside n8n's logger.
34
+ return new Kafka({ ...config, kafkaJS: { ...config.kafkaJS, logLevel: logLevel.ERROR } });
35
+ }
36
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../nodes/Kafka/v2/transport/client.ts"],"names":[],"mappings":";;;;AAEA,qCAA2C;AAG3C,IAAI,QAAQ,GAAmC,IAAI,CAAC;AAEpD;;;;;;;;GAQG;AACI,KAAK;IACX,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC9B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,gCAAgC,CAAC,CAAC;IAC3D,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC;IACvB,OAAO,QAAQ,CAAC;AACjB,CAAC;AAED;;;;;GAKG;AACI,KAAK,4BACX,WAA6B;IAE7B,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,MAAM,eAAe,EAAE,CAAC;IACpD,MAAM,MAAM,GAAG,IAAA,wBAAe,EAAC,WAAW,CAAC,CAAC;IAC5C,gFAAgF;IAChF,2DAA2D;IAC3D,OAAO,IAAI,KAAK,CAAC,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,EAAE,GAAG,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAC3F,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { KafkaJS } from '@confluentinc/kafka-javascript';
2
+ import { type KafkaCredentials } from '../../utils';
3
+ /**
4
+ * Converts a decrypted Kafka credential into the library's
5
+ * `CommonConstructorConfig` — a `kafkaJS` block (app-level: brokers, clientId,
6
+ * ssl boolean, sasl) sitting alongside flat, dotted-key TLS/mTLS properties
7
+ * (native-librdkafka-level). No `security.protocol` is emitted: the library
8
+ * derives it from `kafkaJS.ssl` + presence of `kafkaJS.sasl` on its own.
9
+ */
10
+ export declare function toKafkaJSConfig(credentials: KafkaCredentials): KafkaJS.CommonConstructorConfig & {
11
+ kafkaJS: KafkaJS.KafkaConfig;
12
+ };
13
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../nodes/Kafka/v2/transport/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAG9D,OAAO,EAAwB,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AA+B1E;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC9B,WAAW,EAAE,gBAAgB,GAG3B,OAAO,CAAC,uBAAuB,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC,WAAW,CAAA;CAAE,CAqBpE"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toKafkaJSConfig = toKafkaJSConfig;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const utils_1 = require("../../utils");
6
+ /**
7
+ * Builds the flat, dotted-key TLS/mTLS properties the library expects at the
8
+ * top level of `CommonConstructorConfig` (native librdkafka config) — separate
9
+ * from the `kafkaJS` block, which only carries a plain `ssl: boolean`.
10
+ */
11
+ function toTlsProperties(credentials) {
12
+ if (!credentials.ssl)
13
+ return {};
14
+ const cert = credentials.cert?.trim() ? credentials.cert : undefined;
15
+ const key = credentials.key?.trim() ? credentials.key : undefined;
16
+ const ca = credentials.ca?.trim() ? credentials.ca : undefined;
17
+ // A client certificate and its private key are only meaningful together.
18
+ if (Boolean(cert) !== Boolean(key)) {
19
+ throw new n8n_workflow_1.UserError('Kafka mTLS needs both a client certificate and a client private key', {
20
+ level: 'warning',
21
+ description: 'Set both the "Client Certificate" and "Client Private Key" credential fields, or clear both.',
22
+ });
23
+ }
24
+ return {
25
+ ...(ca ? { 'ssl.ca.pem': (0, utils_1.formatAndValidatePem)(ca, 'CA certificate') } : {}),
26
+ ...(cert ? { 'ssl.certificate.pem': (0, utils_1.formatAndValidatePem)(cert, 'client certificate') } : {}),
27
+ ...(key ? { 'ssl.key.pem': (0, utils_1.formatAndValidatePem)(key, 'client private key') } : {}),
28
+ ...(credentials.allowUnauthorizedCerts ? { 'enable.ssl.certificate.verification': false } : {}),
29
+ };
30
+ }
31
+ /**
32
+ * Converts a decrypted Kafka credential into the library's
33
+ * `CommonConstructorConfig` — a `kafkaJS` block (app-level: brokers, clientId,
34
+ * ssl boolean, sasl) sitting alongside flat, dotted-key TLS/mTLS properties
35
+ * (native-librdkafka-level). No `security.protocol` is emitted: the library
36
+ * derives it from `kafkaJS.ssl` + presence of `kafkaJS.sasl` on its own.
37
+ */
38
+ function toKafkaJSConfig(credentials) {
39
+ const brokers = (credentials.brokers ?? '').split(',').map((broker) => broker.trim());
40
+ const kafkaJS = {
41
+ brokers,
42
+ clientId: credentials.clientId,
43
+ ssl: credentials.ssl,
44
+ };
45
+ if (credentials.authentication) {
46
+ if (!(credentials.username && credentials.password)) {
47
+ throw new n8n_workflow_1.UserError('Username and password are required for authentication');
48
+ }
49
+ kafkaJS.sasl = {
50
+ mechanism: credentials.saslMechanism ?? 'plain',
51
+ username: credentials.username,
52
+ password: credentials.password,
53
+ };
54
+ }
55
+ return { kafkaJS, ...toTlsProperties(credentials) };
56
+ }
57
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../nodes/Kafka/v2/transport/config.ts"],"names":[],"mappings":";;;AACA,+CAAyC;AAEzC,uCAA0E;AAE1E;;;;GAIG;AACH,SAAS,eAAe,CAAC,WAA6B;IACrD,IAAI,CAAC,WAAW,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IAEhC,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACrE,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CA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