@renatoascencio/n8n-nodes-evolution-api 0.1.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 (423) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +330 -0
  3. package/dist/credentials/EvolutionApi.credentials.d.ts +10 -0
  4. package/dist/credentials/EvolutionApi.credentials.js +84 -0
  5. package/dist/credentials/EvolutionApi.credentials.js.map +1 -0
  6. package/dist/nodes/EvolutionApi/EvolutionApi.node.d.ts +19 -0
  7. package/dist/nodes/EvolutionApi/EvolutionApi.node.js +180 -0
  8. package/dist/nodes/EvolutionApi/EvolutionApi.node.js.map +1 -0
  9. package/dist/nodes/EvolutionApi/EvolutionApi.node.json +22 -0
  10. package/dist/nodes/EvolutionApi/EvolutionApiTrigger.node.d.ts +18 -0
  11. package/dist/nodes/EvolutionApi/EvolutionApiTrigger.node.js +615 -0
  12. package/dist/nodes/EvolutionApi/EvolutionApiTrigger.node.js.map +1 -0
  13. package/dist/nodes/EvolutionApi/EvolutionApiTrigger.node.json +19 -0
  14. package/dist/nodes/EvolutionApi/GenericFunctions.d.ts +114 -0
  15. package/dist/nodes/EvolutionApi/GenericFunctions.js +681 -0
  16. package/dist/nodes/EvolutionApi/GenericFunctions.js.map +1 -0
  17. package/dist/nodes/EvolutionApi/constants.d.ts +7 -0
  18. package/dist/nodes/EvolutionApi/constants.js +77 -0
  19. package/dist/nodes/EvolutionApi/constants.js.map +1 -0
  20. package/dist/nodes/EvolutionApi/evolution.svg +11 -0
  21. package/dist/nodes/EvolutionApi/resources/call/index.d.ts +5 -0
  22. package/dist/nodes/EvolutionApi/resources/call/index.js +62 -0
  23. package/dist/nodes/EvolutionApi/resources/call/index.js.map +1 -0
  24. package/dist/nodes/EvolutionApi/resources/call/offer.operation.d.ts +29 -0
  25. package/dist/nodes/EvolutionApi/resources/call/offer.operation.js +56 -0
  26. package/dist/nodes/EvolutionApi/resources/call/offer.operation.js.map +1 -0
  27. package/dist/nodes/EvolutionApi/resources/chat/archive.operation.d.ts +29 -0
  28. package/dist/nodes/EvolutionApi/resources/chat/archive.operation.js +44 -0
  29. package/dist/nodes/EvolutionApi/resources/chat/archive.operation.js.map +1 -0
  30. package/dist/nodes/EvolutionApi/resources/chat/checkNumbers.operation.d.ts +29 -0
  31. package/dist/nodes/EvolutionApi/resources/chat/checkNumbers.operation.js +28 -0
  32. package/dist/nodes/EvolutionApi/resources/chat/checkNumbers.operation.js.map +1 -0
  33. package/dist/nodes/EvolutionApi/resources/chat/deleteMessage.operation.d.ts +29 -0
  34. package/dist/nodes/EvolutionApi/resources/chat/deleteMessage.operation.js +68 -0
  35. package/dist/nodes/EvolutionApi/resources/chat/deleteMessage.operation.js.map +1 -0
  36. package/dist/nodes/EvolutionApi/resources/chat/downloadMedia.operation.d.ts +30 -0
  37. package/dist/nodes/EvolutionApi/resources/chat/downloadMedia.operation.js +143 -0
  38. package/dist/nodes/EvolutionApi/resources/chat/downloadMedia.operation.js.map +1 -0
  39. package/dist/nodes/EvolutionApi/resources/chat/editMessage.operation.d.ts +29 -0
  40. package/dist/nodes/EvolutionApi/resources/chat/editMessage.operation.js +49 -0
  41. package/dist/nodes/EvolutionApi/resources/chat/editMessage.operation.js.map +1 -0
  42. package/dist/nodes/EvolutionApi/resources/chat/get.operation.d.ts +29 -0
  43. package/dist/nodes/EvolutionApi/resources/chat/get.operation.js +28 -0
  44. package/dist/nodes/EvolutionApi/resources/chat/get.operation.js.map +1 -0
  45. package/dist/nodes/EvolutionApi/resources/chat/getChannels.operation.d.ts +29 -0
  46. package/dist/nodes/EvolutionApi/resources/chat/getChannels.operation.js +23 -0
  47. package/dist/nodes/EvolutionApi/resources/chat/getChannels.operation.js.map +1 -0
  48. package/dist/nodes/EvolutionApi/resources/chat/getContacts.operation.d.ts +29 -0
  49. package/dist/nodes/EvolutionApi/resources/chat/getContacts.operation.js +55 -0
  50. package/dist/nodes/EvolutionApi/resources/chat/getContacts.operation.js.map +1 -0
  51. package/dist/nodes/EvolutionApi/resources/chat/getMany.operation.d.ts +30 -0
  52. package/dist/nodes/EvolutionApi/resources/chat/getMany.operation.js +74 -0
  53. package/dist/nodes/EvolutionApi/resources/chat/getMany.operation.js.map +1 -0
  54. package/dist/nodes/EvolutionApi/resources/chat/getMessages.operation.d.ts +29 -0
  55. package/dist/nodes/EvolutionApi/resources/chat/getMessages.operation.js +124 -0
  56. package/dist/nodes/EvolutionApi/resources/chat/getMessages.operation.js.map +1 -0
  57. package/dist/nodes/EvolutionApi/resources/chat/getPollVotes.operation.d.ts +29 -0
  58. package/dist/nodes/EvolutionApi/resources/chat/getPollVotes.operation.js +36 -0
  59. package/dist/nodes/EvolutionApi/resources/chat/getPollVotes.operation.js.map +1 -0
  60. package/dist/nodes/EvolutionApi/resources/chat/getStatusUpdates.operation.d.ts +29 -0
  61. package/dist/nodes/EvolutionApi/resources/chat/getStatusUpdates.operation.js +57 -0
  62. package/dist/nodes/EvolutionApi/resources/chat/getStatusUpdates.operation.js.map +1 -0
  63. package/dist/nodes/EvolutionApi/resources/chat/helpers.d.ts +25 -0
  64. package/dist/nodes/EvolutionApi/resources/chat/helpers.js +219 -0
  65. package/dist/nodes/EvolutionApi/resources/chat/helpers.js.map +1 -0
  66. package/dist/nodes/EvolutionApi/resources/chat/index.d.ts +5 -0
  67. package/dist/nodes/EvolutionApi/resources/chat/index.js +209 -0
  68. package/dist/nodes/EvolutionApi/resources/chat/index.js.map +1 -0
  69. package/dist/nodes/EvolutionApi/resources/chat/markAsPlayed.operation.d.ts +29 -0
  70. package/dist/nodes/EvolutionApi/resources/chat/markAsPlayed.operation.js +49 -0
  71. package/dist/nodes/EvolutionApi/resources/chat/markAsPlayed.operation.js.map +1 -0
  72. package/dist/nodes/EvolutionApi/resources/chat/markAsRead.operation.d.ts +29 -0
  73. package/dist/nodes/EvolutionApi/resources/chat/markAsRead.operation.js +48 -0
  74. package/dist/nodes/EvolutionApi/resources/chat/markAsRead.operation.js.map +1 -0
  75. package/dist/nodes/EvolutionApi/resources/chat/markUnread.operation.d.ts +29 -0
  76. package/dist/nodes/EvolutionApi/resources/chat/markUnread.operation.js +35 -0
  77. package/dist/nodes/EvolutionApi/resources/chat/markUnread.operation.js.map +1 -0
  78. package/dist/nodes/EvolutionApi/resources/chat/sendPresence.operation.d.ts +29 -0
  79. package/dist/nodes/EvolutionApi/resources/chat/sendPresence.operation.js +53 -0
  80. package/dist/nodes/EvolutionApi/resources/chat/sendPresence.operation.js.map +1 -0
  81. package/dist/nodes/EvolutionApi/resources/chat/updateBlockStatus.operation.d.ts +29 -0
  82. package/dist/nodes/EvolutionApi/resources/chat/updateBlockStatus.operation.js +44 -0
  83. package/dist/nodes/EvolutionApi/resources/chat/updateBlockStatus.operation.js.map +1 -0
  84. package/dist/nodes/EvolutionApi/resources/chatbot/changeStatus.operation.d.ts +31 -0
  85. package/dist/nodes/EvolutionApi/resources/chatbot/changeStatus.operation.js +73 -0
  86. package/dist/nodes/EvolutionApi/resources/chatbot/changeStatus.operation.js.map +1 -0
  87. package/dist/nodes/EvolutionApi/resources/chatbot/create.operation.d.ts +38 -0
  88. package/dist/nodes/EvolutionApi/resources/chatbot/create.operation.js +251 -0
  89. package/dist/nodes/EvolutionApi/resources/chatbot/create.operation.js.map +1 -0
  90. package/dist/nodes/EvolutionApi/resources/chatbot/createCredential.operation.d.ts +29 -0
  91. package/dist/nodes/EvolutionApi/resources/chatbot/createCredential.operation.js +44 -0
  92. package/dist/nodes/EvolutionApi/resources/chatbot/createCredential.operation.js.map +1 -0
  93. package/dist/nodes/EvolutionApi/resources/chatbot/delete.operation.d.ts +3 -0
  94. package/dist/nodes/EvolutionApi/resources/chatbot/delete.operation.js +19 -0
  95. package/dist/nodes/EvolutionApi/resources/chatbot/delete.operation.js.map +1 -0
  96. package/dist/nodes/EvolutionApi/resources/chatbot/deleteCredential.operation.d.ts +29 -0
  97. package/dist/nodes/EvolutionApi/resources/chatbot/deleteCredential.operation.js +30 -0
  98. package/dist/nodes/EvolutionApi/resources/chatbot/deleteCredential.operation.js.map +1 -0
  99. package/dist/nodes/EvolutionApi/resources/chatbot/fields.d.ts +10 -0
  100. package/dist/nodes/EvolutionApi/resources/chatbot/fields.js +229 -0
  101. package/dist/nodes/EvolutionApi/resources/chatbot/fields.js.map +1 -0
  102. package/dist/nodes/EvolutionApi/resources/chatbot/get.operation.d.ts +30 -0
  103. package/dist/nodes/EvolutionApi/resources/chatbot/get.operation.js +29 -0
  104. package/dist/nodes/EvolutionApi/resources/chatbot/get.operation.js.map +1 -0
  105. package/dist/nodes/EvolutionApi/resources/chatbot/getCredentials.operation.d.ts +29 -0
  106. package/dist/nodes/EvolutionApi/resources/chatbot/getCredentials.operation.js +17 -0
  107. package/dist/nodes/EvolutionApi/resources/chatbot/getCredentials.operation.js.map +1 -0
  108. package/dist/nodes/EvolutionApi/resources/chatbot/getMany.operation.d.ts +29 -0
  109. package/dist/nodes/EvolutionApi/resources/chatbot/getMany.operation.js +18 -0
  110. package/dist/nodes/EvolutionApi/resources/chatbot/getMany.operation.js.map +1 -0
  111. package/dist/nodes/EvolutionApi/resources/chatbot/getModels.operation.d.ts +29 -0
  112. package/dist/nodes/EvolutionApi/resources/chatbot/getModels.operation.js +39 -0
  113. package/dist/nodes/EvolutionApi/resources/chatbot/getModels.operation.js.map +1 -0
  114. package/dist/nodes/EvolutionApi/resources/chatbot/getSessions.operation.d.ts +29 -0
  115. package/dist/nodes/EvolutionApi/resources/chatbot/getSessions.operation.js +69 -0
  116. package/dist/nodes/EvolutionApi/resources/chatbot/getSessions.operation.js.map +1 -0
  117. package/dist/nodes/EvolutionApi/resources/chatbot/getSettings.operation.d.ts +29 -0
  118. package/dist/nodes/EvolutionApi/resources/chatbot/getSettings.operation.js +17 -0
  119. package/dist/nodes/EvolutionApi/resources/chatbot/getSettings.operation.js.map +1 -0
  120. package/dist/nodes/EvolutionApi/resources/chatbot/helpers.d.ts +24 -0
  121. package/dist/nodes/EvolutionApi/resources/chatbot/helpers.js +273 -0
  122. package/dist/nodes/EvolutionApi/resources/chatbot/helpers.js.map +1 -0
  123. package/dist/nodes/EvolutionApi/resources/chatbot/ignoreJid.operation.d.ts +29 -0
  124. package/dist/nodes/EvolutionApi/resources/chatbot/ignoreJid.operation.js +35 -0
  125. package/dist/nodes/EvolutionApi/resources/chatbot/ignoreJid.operation.js.map +1 -0
  126. package/dist/nodes/EvolutionApi/resources/chatbot/index.d.ts +6 -0
  127. package/dist/nodes/EvolutionApi/resources/chatbot/index.js +210 -0
  128. package/dist/nodes/EvolutionApi/resources/chatbot/index.js.map +1 -0
  129. package/dist/nodes/EvolutionApi/resources/chatbot/methods.d.ts +2 -0
  130. package/dist/nodes/EvolutionApi/resources/chatbot/methods.js +58 -0
  131. package/dist/nodes/EvolutionApi/resources/chatbot/methods.js.map +1 -0
  132. package/dist/nodes/EvolutionApi/resources/chatbot/setSettings.operation.d.ts +33 -0
  133. package/dist/nodes/EvolutionApi/resources/chatbot/setSettings.operation.js +133 -0
  134. package/dist/nodes/EvolutionApi/resources/chatbot/setSettings.operation.js.map +1 -0
  135. package/dist/nodes/EvolutionApi/resources/chatbot/start.operation.d.ts +29 -0
  136. package/dist/nodes/EvolutionApi/resources/chatbot/start.operation.js +112 -0
  137. package/dist/nodes/EvolutionApi/resources/chatbot/start.operation.js.map +1 -0
  138. package/dist/nodes/EvolutionApi/resources/chatbot/update.operation.d.ts +29 -0
  139. package/dist/nodes/EvolutionApi/resources/chatbot/update.operation.js +191 -0
  140. package/dist/nodes/EvolutionApi/resources/chatbot/update.operation.js.map +1 -0
  141. package/dist/nodes/EvolutionApi/resources/chatwoot/get.operation.d.ts +29 -0
  142. package/dist/nodes/EvolutionApi/resources/chatwoot/get.operation.js +25 -0
  143. package/dist/nodes/EvolutionApi/resources/chatwoot/get.operation.js.map +1 -0
  144. package/dist/nodes/EvolutionApi/resources/chatwoot/helpers.d.ts +4 -0
  145. package/dist/nodes/EvolutionApi/resources/chatwoot/helpers.js +26 -0
  146. package/dist/nodes/EvolutionApi/resources/chatwoot/helpers.js.map +1 -0
  147. package/dist/nodes/EvolutionApi/resources/chatwoot/index.d.ts +5 -0
  148. package/dist/nodes/EvolutionApi/resources/chatwoot/index.js +70 -0
  149. package/dist/nodes/EvolutionApi/resources/chatwoot/index.js.map +1 -0
  150. package/dist/nodes/EvolutionApi/resources/chatwoot/set.operation.d.ts +30 -0
  151. package/dist/nodes/EvolutionApi/resources/chatwoot/set.operation.js +252 -0
  152. package/dist/nodes/EvolutionApi/resources/chatwoot/set.operation.js.map +1 -0
  153. package/dist/nodes/EvolutionApi/resources/group/acceptInvite.operation.d.ts +29 -0
  154. package/dist/nodes/EvolutionApi/resources/group/acceptInvite.operation.js +25 -0
  155. package/dist/nodes/EvolutionApi/resources/group/acceptInvite.operation.js.map +1 -0
  156. package/dist/nodes/EvolutionApi/resources/group/create.operation.d.ts +29 -0
  157. package/dist/nodes/EvolutionApi/resources/group/create.operation.js +68 -0
  158. package/dist/nodes/EvolutionApi/resources/group/create.operation.js.map +1 -0
  159. package/dist/nodes/EvolutionApi/resources/group/get.operation.d.ts +29 -0
  160. package/dist/nodes/EvolutionApi/resources/group/get.operation.js +15 -0
  161. package/dist/nodes/EvolutionApi/resources/group/get.operation.js.map +1 -0
  162. package/dist/nodes/EvolutionApi/resources/group/getInviteCode.operation.d.ts +29 -0
  163. package/dist/nodes/EvolutionApi/resources/group/getInviteCode.operation.js +15 -0
  164. package/dist/nodes/EvolutionApi/resources/group/getInviteCode.operation.js.map +1 -0
  165. package/dist/nodes/EvolutionApi/resources/group/getInviteInfo.operation.d.ts +29 -0
  166. package/dist/nodes/EvolutionApi/resources/group/getInviteInfo.operation.js +25 -0
  167. package/dist/nodes/EvolutionApi/resources/group/getInviteInfo.operation.js.map +1 -0
  168. package/dist/nodes/EvolutionApi/resources/group/getMany.operation.d.ts +29 -0
  169. package/dist/nodes/EvolutionApi/resources/group/getMany.operation.js +72 -0
  170. package/dist/nodes/EvolutionApi/resources/group/getMany.operation.js.map +1 -0
  171. package/dist/nodes/EvolutionApi/resources/group/getParticipants.operation.d.ts +29 -0
  172. package/dist/nodes/EvolutionApi/resources/group/getParticipants.operation.js +21 -0
  173. package/dist/nodes/EvolutionApi/resources/group/getParticipants.operation.js.map +1 -0
  174. package/dist/nodes/EvolutionApi/resources/group/helpers.d.ts +8 -0
  175. package/dist/nodes/EvolutionApi/resources/group/helpers.js +139 -0
  176. package/dist/nodes/EvolutionApi/resources/group/helpers.js.map +1 -0
  177. package/dist/nodes/EvolutionApi/resources/group/index.d.ts +7 -0
  178. package/dist/nodes/EvolutionApi/resources/group/index.js +216 -0
  179. package/dist/nodes/EvolutionApi/resources/group/index.js.map +1 -0
  180. package/dist/nodes/EvolutionApi/resources/group/leave.operation.d.ts +29 -0
  181. package/dist/nodes/EvolutionApi/resources/group/leave.operation.js +15 -0
  182. package/dist/nodes/EvolutionApi/resources/group/leave.operation.js.map +1 -0
  183. package/dist/nodes/EvolutionApi/resources/group/revokeInviteCode.operation.d.ts +29 -0
  184. package/dist/nodes/EvolutionApi/resources/group/revokeInviteCode.operation.js +20 -0
  185. package/dist/nodes/EvolutionApi/resources/group/revokeInviteCode.operation.js.map +1 -0
  186. package/dist/nodes/EvolutionApi/resources/group/sendInvite.operation.d.ts +29 -0
  187. package/dist/nodes/EvolutionApi/resources/group/sendInvite.operation.js +48 -0
  188. package/dist/nodes/EvolutionApi/resources/group/sendInvite.operation.js.map +1 -0
  189. package/dist/nodes/EvolutionApi/resources/group/toggleEphemeral.operation.d.ts +29 -0
  190. package/dist/nodes/EvolutionApi/resources/group/toggleEphemeral.operation.js +43 -0
  191. package/dist/nodes/EvolutionApi/resources/group/toggleEphemeral.operation.js.map +1 -0
  192. package/dist/nodes/EvolutionApi/resources/group/updateDescription.operation.d.ts +29 -0
  193. package/dist/nodes/EvolutionApi/resources/group/updateDescription.operation.js +34 -0
  194. package/dist/nodes/EvolutionApi/resources/group/updateDescription.operation.js.map +1 -0
  195. package/dist/nodes/EvolutionApi/resources/group/updateMemberAddMode.operation.d.ts +29 -0
  196. package/dist/nodes/EvolutionApi/resources/group/updateMemberAddMode.operation.js +47 -0
  197. package/dist/nodes/EvolutionApi/resources/group/updateMemberAddMode.operation.js.map +1 -0
  198. package/dist/nodes/EvolutionApi/resources/group/updateParticipants.operation.d.ts +29 -0
  199. package/dist/nodes/EvolutionApi/resources/group/updateParticipants.operation.js +67 -0
  200. package/dist/nodes/EvolutionApi/resources/group/updateParticipants.operation.js.map +1 -0
  201. package/dist/nodes/EvolutionApi/resources/group/updatePicture.operation.d.ts +29 -0
  202. package/dist/nodes/EvolutionApi/resources/group/updatePicture.operation.js +99 -0
  203. package/dist/nodes/EvolutionApi/resources/group/updatePicture.operation.js.map +1 -0
  204. package/dist/nodes/EvolutionApi/resources/group/updateSetting.operation.d.ts +29 -0
  205. package/dist/nodes/EvolutionApi/resources/group/updateSetting.operation.js +57 -0
  206. package/dist/nodes/EvolutionApi/resources/group/updateSetting.operation.js.map +1 -0
  207. package/dist/nodes/EvolutionApi/resources/group/updateSubject.operation.d.ts +29 -0
  208. package/dist/nodes/EvolutionApi/resources/group/updateSubject.operation.js +31 -0
  209. package/dist/nodes/EvolutionApi/resources/group/updateSubject.operation.js.map +1 -0
  210. package/dist/nodes/EvolutionApi/resources/index.d.ts +6 -0
  211. package/dist/nodes/EvolutionApi/resources/index.js +144 -0
  212. package/dist/nodes/EvolutionApi/resources/index.js.map +1 -0
  213. package/dist/nodes/EvolutionApi/resources/instance/connect.operation.d.ts +29 -0
  214. package/dist/nodes/EvolutionApi/resources/instance/connect.operation.js +40 -0
  215. package/dist/nodes/EvolutionApi/resources/instance/connect.operation.js.map +1 -0
  216. package/dist/nodes/EvolutionApi/resources/instance/create.operation.d.ts +30 -0
  217. package/dist/nodes/EvolutionApi/resources/instance/create.operation.js +519 -0
  218. package/dist/nodes/EvolutionApi/resources/instance/create.operation.js.map +1 -0
  219. package/dist/nodes/EvolutionApi/resources/instance/delete.operation.d.ts +3 -0
  220. package/dist/nodes/EvolutionApi/resources/instance/delete.operation.js +11 -0
  221. package/dist/nodes/EvolutionApi/resources/instance/delete.operation.js.map +1 -0
  222. package/dist/nodes/EvolutionApi/resources/instance/getConnectionState.operation.d.ts +3 -0
  223. package/dist/nodes/EvolutionApi/resources/instance/getConnectionState.operation.js +11 -0
  224. package/dist/nodes/EvolutionApi/resources/instance/getConnectionState.operation.js.map +1 -0
  225. package/dist/nodes/EvolutionApi/resources/instance/getMany.operation.d.ts +31 -0
  226. package/dist/nodes/EvolutionApi/resources/instance/getMany.operation.js +149 -0
  227. package/dist/nodes/EvolutionApi/resources/instance/getMany.operation.js.map +1 -0
  228. package/dist/nodes/EvolutionApi/resources/instance/helpers.d.ts +5 -0
  229. package/dist/nodes/EvolutionApi/resources/instance/helpers.js +60 -0
  230. package/dist/nodes/EvolutionApi/resources/instance/helpers.js.map +1 -0
  231. package/dist/nodes/EvolutionApi/resources/instance/index.d.ts +6 -0
  232. package/dist/nodes/EvolutionApi/resources/instance/index.js +128 -0
  233. package/dist/nodes/EvolutionApi/resources/instance/index.js.map +1 -0
  234. package/dist/nodes/EvolutionApi/resources/instance/logout.operation.d.ts +3 -0
  235. package/dist/nodes/EvolutionApi/resources/instance/logout.operation.js +11 -0
  236. package/dist/nodes/EvolutionApi/resources/instance/logout.operation.js.map +1 -0
  237. package/dist/nodes/EvolutionApi/resources/instance/restart.operation.d.ts +3 -0
  238. package/dist/nodes/EvolutionApi/resources/instance/restart.operation.js +13 -0
  239. package/dist/nodes/EvolutionApi/resources/instance/restart.operation.js.map +1 -0
  240. package/dist/nodes/EvolutionApi/resources/instance/setPresence.operation.d.ts +29 -0
  241. package/dist/nodes/EvolutionApi/resources/instance/setPresence.operation.js +24 -0
  242. package/dist/nodes/EvolutionApi/resources/instance/setPresence.operation.js.map +1 -0
  243. package/dist/nodes/EvolutionApi/resources/label/addToChat.operation.d.ts +29 -0
  244. package/dist/nodes/EvolutionApi/resources/label/addToChat.operation.js +11 -0
  245. package/dist/nodes/EvolutionApi/resources/label/addToChat.operation.js.map +1 -0
  246. package/dist/nodes/EvolutionApi/resources/label/getMany.operation.d.ts +3 -0
  247. package/dist/nodes/EvolutionApi/resources/label/getMany.operation.js +12 -0
  248. package/dist/nodes/EvolutionApi/resources/label/getMany.operation.js.map +1 -0
  249. package/dist/nodes/EvolutionApi/resources/label/helpers.d.ts +4 -0
  250. package/dist/nodes/EvolutionApi/resources/label/helpers.js +69 -0
  251. package/dist/nodes/EvolutionApi/resources/label/helpers.js.map +1 -0
  252. package/dist/nodes/EvolutionApi/resources/label/index.d.ts +6 -0
  253. package/dist/nodes/EvolutionApi/resources/label/index.js +88 -0
  254. package/dist/nodes/EvolutionApi/resources/label/index.js.map +1 -0
  255. package/dist/nodes/EvolutionApi/resources/label/removeFromChat.operation.d.ts +29 -0
  256. package/dist/nodes/EvolutionApi/resources/label/removeFromChat.operation.js +11 -0
  257. package/dist/nodes/EvolutionApi/resources/label/removeFromChat.operation.js.map +1 -0
  258. package/dist/nodes/EvolutionApi/resources/message/generateMessageId.operation.d.ts +29 -0
  259. package/dist/nodes/EvolutionApi/resources/message/generateMessageId.operation.js +21 -0
  260. package/dist/nodes/EvolutionApi/resources/message/generateMessageId.operation.js.map +1 -0
  261. package/dist/nodes/EvolutionApi/resources/message/helpers.d.ts +39 -0
  262. package/dist/nodes/EvolutionApi/resources/message/helpers.js +566 -0
  263. package/dist/nodes/EvolutionApi/resources/message/helpers.js.map +1 -0
  264. package/dist/nodes/EvolutionApi/resources/message/index.d.ts +6 -0
  265. package/dist/nodes/EvolutionApi/resources/message/index.js +192 -0
  266. package/dist/nodes/EvolutionApi/resources/message/index.js.map +1 -0
  267. package/dist/nodes/EvolutionApi/resources/message/sendAudio.operation.d.ts +29 -0
  268. package/dist/nodes/EvolutionApi/resources/message/sendAudio.operation.js +36 -0
  269. package/dist/nodes/EvolutionApi/resources/message/sendAudio.operation.js.map +1 -0
  270. package/dist/nodes/EvolutionApi/resources/message/sendButtons.operation.d.ts +29 -0
  271. package/dist/nodes/EvolutionApi/resources/message/sendButtons.operation.js +114 -0
  272. package/dist/nodes/EvolutionApi/resources/message/sendButtons.operation.js.map +1 -0
  273. package/dist/nodes/EvolutionApi/resources/message/sendCarousel.operation.d.ts +30 -0
  274. package/dist/nodes/EvolutionApi/resources/message/sendCarousel.operation.js +162 -0
  275. package/dist/nodes/EvolutionApi/resources/message/sendCarousel.operation.js.map +1 -0
  276. package/dist/nodes/EvolutionApi/resources/message/sendContact.operation.d.ts +29 -0
  277. package/dist/nodes/EvolutionApi/resources/message/sendContact.operation.js +105 -0
  278. package/dist/nodes/EvolutionApi/resources/message/sendContact.operation.js.map +1 -0
  279. package/dist/nodes/EvolutionApi/resources/message/sendList.operation.d.ts +30 -0
  280. package/dist/nodes/EvolutionApi/resources/message/sendList.operation.js +197 -0
  281. package/dist/nodes/EvolutionApi/resources/message/sendList.operation.js.map +1 -0
  282. package/dist/nodes/EvolutionApi/resources/message/sendLocation.operation.d.ts +29 -0
  283. package/dist/nodes/EvolutionApi/resources/message/sendLocation.operation.js +70 -0
  284. package/dist/nodes/EvolutionApi/resources/message/sendLocation.operation.js.map +1 -0
  285. package/dist/nodes/EvolutionApi/resources/message/sendMedia.operation.d.ts +29 -0
  286. package/dist/nodes/EvolutionApi/resources/message/sendMedia.operation.js +142 -0
  287. package/dist/nodes/EvolutionApi/resources/message/sendMedia.operation.js.map +1 -0
  288. package/dist/nodes/EvolutionApi/resources/message/sendPoll.operation.d.ts +29 -0
  289. package/dist/nodes/EvolutionApi/resources/message/sendPoll.operation.js +67 -0
  290. package/dist/nodes/EvolutionApi/resources/message/sendPoll.operation.js.map +1 -0
  291. package/dist/nodes/EvolutionApi/resources/message/sendPtv.operation.d.ts +29 -0
  292. package/dist/nodes/EvolutionApi/resources/message/sendPtv.operation.js +22 -0
  293. package/dist/nodes/EvolutionApi/resources/message/sendPtv.operation.js.map +1 -0
  294. package/dist/nodes/EvolutionApi/resources/message/sendReaction.operation.d.ts +29 -0
  295. package/dist/nodes/EvolutionApi/resources/message/sendReaction.operation.js +81 -0
  296. package/dist/nodes/EvolutionApi/resources/message/sendReaction.operation.js.map +1 -0
  297. package/dist/nodes/EvolutionApi/resources/message/sendStatus.operation.d.ts +29 -0
  298. package/dist/nodes/EvolutionApi/resources/message/sendStatus.operation.js +147 -0
  299. package/dist/nodes/EvolutionApi/resources/message/sendStatus.operation.js.map +1 -0
  300. package/dist/nodes/EvolutionApi/resources/message/sendSticker.operation.d.ts +29 -0
  301. package/dist/nodes/EvolutionApi/resources/message/sendSticker.operation.js +41 -0
  302. package/dist/nodes/EvolutionApi/resources/message/sendSticker.operation.js.map +1 -0
  303. package/dist/nodes/EvolutionApi/resources/message/sendTemplate.operation.d.ts +29 -0
  304. package/dist/nodes/EvolutionApi/resources/message/sendTemplate.operation.js +92 -0
  305. package/dist/nodes/EvolutionApi/resources/message/sendTemplate.operation.js.map +1 -0
  306. package/dist/nodes/EvolutionApi/resources/message/sendText.operation.d.ts +29 -0
  307. package/dist/nodes/EvolutionApi/resources/message/sendText.operation.js +38 -0
  308. package/dist/nodes/EvolutionApi/resources/message/sendText.operation.js.map +1 -0
  309. package/dist/nodes/EvolutionApi/resources/profile/get.operation.d.ts +29 -0
  310. package/dist/nodes/EvolutionApi/resources/profile/get.operation.js +27 -0
  311. package/dist/nodes/EvolutionApi/resources/profile/get.operation.js.map +1 -0
  312. package/dist/nodes/EvolutionApi/resources/profile/getBusinessProfile.operation.d.ts +29 -0
  313. package/dist/nodes/EvolutionApi/resources/profile/getBusinessProfile.operation.js +24 -0
  314. package/dist/nodes/EvolutionApi/resources/profile/getBusinessProfile.operation.js.map +1 -0
  315. package/dist/nodes/EvolutionApi/resources/profile/getPicture.operation.d.ts +29 -0
  316. package/dist/nodes/EvolutionApi/resources/profile/getPicture.operation.js +27 -0
  317. package/dist/nodes/EvolutionApi/resources/profile/getPicture.operation.js.map +1 -0
  318. package/dist/nodes/EvolutionApi/resources/profile/getPrivacySettings.operation.d.ts +3 -0
  319. package/dist/nodes/EvolutionApi/resources/profile/getPrivacySettings.operation.js +11 -0
  320. package/dist/nodes/EvolutionApi/resources/profile/getPrivacySettings.operation.js.map +1 -0
  321. package/dist/nodes/EvolutionApi/resources/profile/index.d.ts +5 -0
  322. package/dist/nodes/EvolutionApi/resources/profile/index.js +136 -0
  323. package/dist/nodes/EvolutionApi/resources/profile/index.js.map +1 -0
  324. package/dist/nodes/EvolutionApi/resources/profile/removePicture.operation.d.ts +3 -0
  325. package/dist/nodes/EvolutionApi/resources/profile/removePicture.operation.js +11 -0
  326. package/dist/nodes/EvolutionApi/resources/profile/removePicture.operation.js.map +1 -0
  327. package/dist/nodes/EvolutionApi/resources/profile/updateName.operation.d.ts +29 -0
  328. package/dist/nodes/EvolutionApi/resources/profile/updateName.operation.js +27 -0
  329. package/dist/nodes/EvolutionApi/resources/profile/updateName.operation.js.map +1 -0
  330. package/dist/nodes/EvolutionApi/resources/profile/updatePicture.operation.d.ts +29 -0
  331. package/dist/nodes/EvolutionApi/resources/profile/updatePicture.operation.js +86 -0
  332. package/dist/nodes/EvolutionApi/resources/profile/updatePicture.operation.js.map +1 -0
  333. package/dist/nodes/EvolutionApi/resources/profile/updatePrivacySettings.operation.d.ts +30 -0
  334. package/dist/nodes/EvolutionApi/resources/profile/updatePrivacySettings.operation.js +133 -0
  335. package/dist/nodes/EvolutionApi/resources/profile/updatePrivacySettings.operation.js.map +1 -0
  336. package/dist/nodes/EvolutionApi/resources/profile/updateStatus.operation.d.ts +29 -0
  337. package/dist/nodes/EvolutionApi/resources/profile/updateStatus.operation.js +28 -0
  338. package/dist/nodes/EvolutionApi/resources/profile/updateStatus.operation.js.map +1 -0
  339. package/dist/nodes/EvolutionApi/resources/proxy/get.operation.d.ts +29 -0
  340. package/dist/nodes/EvolutionApi/resources/proxy/get.operation.js +25 -0
  341. package/dist/nodes/EvolutionApi/resources/proxy/get.operation.js.map +1 -0
  342. package/dist/nodes/EvolutionApi/resources/proxy/helpers.d.ts +3 -0
  343. package/dist/nodes/EvolutionApi/resources/proxy/helpers.js +28 -0
  344. package/dist/nodes/EvolutionApi/resources/proxy/helpers.js.map +1 -0
  345. package/dist/nodes/EvolutionApi/resources/proxy/index.d.ts +5 -0
  346. package/dist/nodes/EvolutionApi/resources/proxy/index.js +70 -0
  347. package/dist/nodes/EvolutionApi/resources/proxy/index.js.map +1 -0
  348. package/dist/nodes/EvolutionApi/resources/proxy/set.operation.d.ts +30 -0
  349. package/dist/nodes/EvolutionApi/resources/proxy/set.operation.js +137 -0
  350. package/dist/nodes/EvolutionApi/resources/proxy/set.operation.js.map +1 -0
  351. package/dist/nodes/EvolutionApi/resources/settings/get.operation.d.ts +29 -0
  352. package/dist/nodes/EvolutionApi/resources/settings/get.operation.js +25 -0
  353. package/dist/nodes/EvolutionApi/resources/settings/get.operation.js.map +1 -0
  354. package/dist/nodes/EvolutionApi/resources/settings/helpers.d.ts +5 -0
  355. package/dist/nodes/EvolutionApi/resources/settings/helpers.js +37 -0
  356. package/dist/nodes/EvolutionApi/resources/settings/helpers.js.map +1 -0
  357. package/dist/nodes/EvolutionApi/resources/settings/index.d.ts +5 -0
  358. package/dist/nodes/EvolutionApi/resources/settings/index.js +70 -0
  359. package/dist/nodes/EvolutionApi/resources/settings/index.js.map +1 -0
  360. package/dist/nodes/EvolutionApi/resources/settings/set.operation.d.ts +30 -0
  361. package/dist/nodes/EvolutionApi/resources/settings/set.operation.js +128 -0
  362. package/dist/nodes/EvolutionApi/resources/settings/set.operation.js.map +1 -0
  363. package/dist/nodes/EvolutionApi/resources/template/create.operation.d.ts +29 -0
  364. package/dist/nodes/EvolutionApi/resources/template/create.operation.js +97 -0
  365. package/dist/nodes/EvolutionApi/resources/template/create.operation.js.map +1 -0
  366. package/dist/nodes/EvolutionApi/resources/template/delete.operation.d.ts +29 -0
  367. package/dist/nodes/EvolutionApi/resources/template/delete.operation.js +50 -0
  368. package/dist/nodes/EvolutionApi/resources/template/delete.operation.js.map +1 -0
  369. package/dist/nodes/EvolutionApi/resources/template/getCatalog.operation.d.ts +30 -0
  370. package/dist/nodes/EvolutionApi/resources/template/getCatalog.operation.js +48 -0
  371. package/dist/nodes/EvolutionApi/resources/template/getCatalog.operation.js.map +1 -0
  372. package/dist/nodes/EvolutionApi/resources/template/getCollections.operation.d.ts +29 -0
  373. package/dist/nodes/EvolutionApi/resources/template/getCollections.operation.js +41 -0
  374. package/dist/nodes/EvolutionApi/resources/template/getCollections.operation.js.map +1 -0
  375. package/dist/nodes/EvolutionApi/resources/template/getMany.operation.d.ts +29 -0
  376. package/dist/nodes/EvolutionApi/resources/template/getMany.operation.js +109 -0
  377. package/dist/nodes/EvolutionApi/resources/template/getMany.operation.js.map +1 -0
  378. package/dist/nodes/EvolutionApi/resources/template/helpers.d.ts +3 -0
  379. package/dist/nodes/EvolutionApi/resources/template/helpers.js +32 -0
  380. package/dist/nodes/EvolutionApi/resources/template/helpers.js.map +1 -0
  381. package/dist/nodes/EvolutionApi/resources/template/index.d.ts +5 -0
  382. package/dist/nodes/EvolutionApi/resources/template/index.js +109 -0
  383. package/dist/nodes/EvolutionApi/resources/template/index.js.map +1 -0
  384. package/dist/nodes/EvolutionApi/resources/template/update.operation.d.ts +29 -0
  385. package/dist/nodes/EvolutionApi/resources/template/update.operation.js +89 -0
  386. package/dist/nodes/EvolutionApi/resources/template/update.operation.js.map +1 -0
  387. package/dist/nodes/EvolutionApi/resources/webhook/get.operation.d.ts +29 -0
  388. package/dist/nodes/EvolutionApi/resources/webhook/get.operation.js +25 -0
  389. package/dist/nodes/EvolutionApi/resources/webhook/get.operation.js.map +1 -0
  390. package/dist/nodes/EvolutionApi/resources/webhook/getTransport.operation.d.ts +30 -0
  391. package/dist/nodes/EvolutionApi/resources/webhook/getTransport.operation.js +49 -0
  392. package/dist/nodes/EvolutionApi/resources/webhook/getTransport.operation.js.map +1 -0
  393. package/dist/nodes/EvolutionApi/resources/webhook/helpers.d.ts +17 -0
  394. package/dist/nodes/EvolutionApi/resources/webhook/helpers.js +144 -0
  395. package/dist/nodes/EvolutionApi/resources/webhook/helpers.js.map +1 -0
  396. package/dist/nodes/EvolutionApi/resources/webhook/index.d.ts +5 -0
  397. package/dist/nodes/EvolutionApi/resources/webhook/index.js +91 -0
  398. package/dist/nodes/EvolutionApi/resources/webhook/index.js.map +1 -0
  399. package/dist/nodes/EvolutionApi/resources/webhook/set.operation.d.ts +29 -0
  400. package/dist/nodes/EvolutionApi/resources/webhook/set.operation.js +174 -0
  401. package/dist/nodes/EvolutionApi/resources/webhook/set.operation.js.map +1 -0
  402. package/dist/nodes/EvolutionApi/resources/webhook/setTransport.operation.d.ts +29 -0
  403. package/dist/nodes/EvolutionApi/resources/webhook/setTransport.operation.js +159 -0
  404. package/dist/nodes/EvolutionApi/resources/webhook/setTransport.operation.js.map +1 -0
  405. package/dist/nodes/EvolutionApi/trigger/auth.d.ts +26 -0
  406. package/dist/nodes/EvolutionApi/trigger/auth.js +96 -0
  407. package/dist/nodes/EvolutionApi/trigger/auth.js.map +1 -0
  408. package/dist/nodes/EvolutionApi/trigger/constants.d.ts +10 -0
  409. package/dist/nodes/EvolutionApi/trigger/constants.js +154 -0
  410. package/dist/nodes/EvolutionApi/trigger/constants.js.map +1 -0
  411. package/dist/nodes/EvolutionApi/trigger/dedupe.d.ts +5 -0
  412. package/dist/nodes/EvolutionApi/trigger/dedupe.js +87 -0
  413. package/dist/nodes/EvolutionApi/trigger/dedupe.js.map +1 -0
  414. package/dist/nodes/EvolutionApi/trigger/payload.d.ts +48 -0
  415. package/dist/nodes/EvolutionApi/trigger/payload.js +265 -0
  416. package/dist/nodes/EvolutionApi/trigger/payload.js.map +1 -0
  417. package/dist/nodes/EvolutionApi/trigger/registration.d.ts +36 -0
  418. package/dist/nodes/EvolutionApi/trigger/registration.js +156 -0
  419. package/dist/nodes/EvolutionApi/trigger/registration.js.map +1 -0
  420. package/dist/nodes/EvolutionApi/types.d.ts +44 -0
  421. package/dist/nodes/EvolutionApi/types.js +3 -0
  422. package/dist/nodes/EvolutionApi/types.js.map +1 -0
  423. package/package.json +83 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Renato Ascencio
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,330 @@
1
+ # n8n-nodes-evolution-api
2
+
3
+ n8n community node for **[Evolution API](https://github.com/EvolutionAPI/evolution-api) v2**
4
+ (WhatsApp): instances, messages, chats, groups, profiles, labels, webhooks, and the Chatwoot and
5
+ chatbot (Typebot, OpenAI, Dify, Flowise, EvoAI, Evolution Bot) integrations, plus a webhook
6
+ trigger. 13 resources, 101 operations, zero runtime dependencies, usable as an AI Agent tool.
7
+
8
+ > Resumen en español: nodo comunitario de n8n para **Evolution API v2** (WhatsApp) — 13 recursos
9
+ > (instancias, mensajes, chats, grupos, perfiles, etiquetas, webhooks, Chatwoot, chatbots) y un
10
+ > nodo Trigger para recibir eventos por webhook (modo automático con toma del webhook de la
11
+ > instancia, o manual). Sin dependencias en tiempo de ejecución; usable como herramienta de un AI
12
+ > Agent. Compatible con Evolution API 2.3.7 y 2.4.0-rc2 (2.4 requiere activar la licencia del
13
+ > servidor). Instalación, credenciales y todas las secciones de abajo están en inglés; usa el
14
+ > traductor de tu navegador si lo necesitas.
15
+
16
+ - [Screenshots and examples](#screenshots-and-examples)
17
+ - [Installation](#installation)
18
+ - [Credentials: "Evolution API v2"](#credentials-evolution-api-v2)
19
+ - [Resources and operations](#resources-and-operations)
20
+ - [Evolution API 2.4 license gate](#evolution-api-24-license-gate)
21
+ - [Trigger: setup and security](#trigger-setup-and-security)
22
+ - [Using with Chatwoot](#using-with-chatwoot)
23
+ - [AI Agent tool usage](#ai-agent-tool-usage)
24
+ - [Behavior notes](#behavior-notes)
25
+ - [Compatibility](#compatibility)
26
+ - [Development](#development)
27
+ - [Release process](#release-process)
28
+
29
+ ## Screenshots and examples
30
+
31
+ Taken in n8n 2.40.7 with the example workflows in [`examples/workflows`](examples/workflows) (sample data is fictional and pinned, so you can open them without an Evolution API server). Import a file with **Workflows → Import from File**, then select your own credentials.
32
+
33
+ | File | What it does |
34
+ |---|---|
35
+ | [`whatsapp-auto-reply.json`](examples/workflows/whatsapp-auto-reply.json) | Evolution API Trigger (automatic mode, own messages and groups ignored) → IF the customer asks for opening hours → reply quoting their message |
36
+ | [`tag-whatsapp-leads-in-chatwoot.json`](examples/workflows/tag-whatsapp-leads-in-chatwoot.json) | New WhatsApp message → find the Chatwoot contact by WhatsApp number (needs [`@renatoascencio/n8n-nodes-chatwoot`](https://www.npmjs.com/package/@renatoascencio/n8n-nodes-chatwoot)) → add the `whatsapp-lead` label |
37
+
38
+ ![WhatsApp auto-reply workflow](assets/screenshots/workflow-whatsapp-auto-reply.png)
39
+
40
+ | Trigger in automatic mode (JWT + secret header) | Message › Send Text |
41
+ |---|---|
42
+ | ![Evolution API Trigger parameters](assets/screenshots/trigger-automatic-mode.png) | ![Send text](assets/screenshots/message-send-text.png) |
43
+
44
+ **Evolution API + Chatwoot:**
45
+
46
+ ![Evolution API and Chatwoot workflow](assets/screenshots/workflow-evolution-chatwoot.png)
47
+
48
+ ## Installation
49
+
50
+ In n8n: **Settings → Community Nodes → Install** and enter
51
+ `@renatoascencio/n8n-nodes-evolution-api`. On a self-hosted instance you can also add it to your
52
+ `N8N_CUSTOM_EXTENSIONS` image or run `npm install @renatoascencio/n8n-nodes-evolution-api` in your
53
+ n8n installation's custom-nodes directory.
54
+
55
+ **n8n 2.x**: community nodes install normally (unverified packages are allowed by default).
56
+
57
+ **n8n 3.0** (scheduled October 2026) turns unverified community packages off by default
58
+ (`N8N_UNVERIFIED_PACKAGES_ENABLED` changes from `true` to `false`). Until this package is verified
59
+ by n8n, set `N8N_UNVERIFIED_PACKAGES_ENABLED=true` on self-hosted n8n 3.0+ instances to keep
60
+ installing and using it.
61
+
62
+ The credential type is internally named `evolutionWhatsAppApi`, not `evolutionApi`,
63
+ `evolutionApiApi` or `evolutionApiV2Api` (already used by other community packages for Evolution
64
+ API). Because n8n credential type names are global per instance, this lets you install this
65
+ package **alongside** another Evolution API community node without either one breaking the
66
+ other's saved credentials.
67
+
68
+ ## Credentials: "Evolution API v2"
69
+
70
+ | Field | Description |
71
+ |---|---|
72
+ | Base URL | Your Evolution server, e.g. `https://evolution.example.com` (the address that answers `GET /` with the version), no trailing slash. |
73
+ | API Key | Either the **global key** (`AUTHENTICATION_API_KEY`) or **one instance's token** (the `hash` value Evolution returns from Instance → Create). A global key can act on every instance and is required for Instance → Create and (usually) Instance → Get Many; an instance token only works for that one instance. |
74
+ | Default Instance Name | Optional. Used whenever a node's *Instance Name* field is left empty. Recommended when the API Key is an instance token, since the credential test then checks that specific instance. |
75
+
76
+ The credential test calls `GET /instance/connectionState/<Default Instance>` when a default
77
+ instance is set (works with both key types), or `GET /instance/fetchInstances` otherwise (global
78
+ key, or an instance token when the server has `DATABASE_SAVE_DATA_INSTANCE=true`). It reports a
79
+ `503` as the Evolution 2.4 license gate, a `401` as an invalid key, and a `404` as a wrong Base URL
80
+ or Default Instance Name.
81
+
82
+ Evolution API does not treat an instance token as a hard tenant boundary: on 2.3.7 and 2.4.0-rc2 a
83
+ request can override which instance it targets via a query parameter, using *any* valid token.
84
+ This node never forwards arbitrary query parameters itself, but don't rely on instance tokens as
85
+ your only isolation between tenants on those server versions.
86
+
87
+ ## Resources and operations
88
+
89
+ Generated from the node's own operation descriptions (13 resources, 101 operations).
90
+
91
+ ### Instance (8)
92
+
93
+ | Operation | What it does |
94
+ |---|---|
95
+ | Connect | Start the WhatsApp session and get a QR code or pairing code |
96
+ | Create | Create a new instance (requires the global API key) |
97
+ | Delete | Delete an instance, logging it out first when connected |
98
+ | Get Connection State | Get the connection state of an instance (open, connecting or close) |
99
+ | Get Many | List instances with their settings and integrations |
100
+ | Logout | Log out the WhatsApp session but keep the instance |
101
+ | Restart | Restart the connection of a connected instance |
102
+ | Set Presence | Set the global presence of the account (WhatsApp Baileys only) |
103
+
104
+ ### Message (15)
105
+
106
+ | Operation | What it does |
107
+ |---|---|
108
+ | Send Text | Send a text message, optionally as a reply or with mentions |
109
+ | Send Media | Send an image, video, document or audio file from a URL, base64 or binary file, with an optional caption |
110
+ | Send Audio | Send a voice note (push-to-talk) from a URL, base64 or binary file; converted to OGG/Opus by Evolution |
111
+ | Send Video Note | Send a round video note (PTV) from an MP4 URL, base64 or binary file (Baileys only) |
112
+ | Send Status | Post a text, image, video or audio status (story) to selected contacts (Baileys only) |
113
+ | Send Sticker | Send an image as a sticker; Evolution converts it to WebP (Baileys only) |
114
+ | Send Location | Send a map location with a name and an address |
115
+ | Send Contact | Send one or more contact cards (vCards) |
116
+ | Send Reaction | React to a message with an emoji, or remove a reaction |
117
+ | Send Poll | Send a poll with 2-10 options (Baileys only) |
118
+ | Send List | Send a message with a button that opens a list of selectable rows |
119
+ | Send Buttons | Send a message with quick reply, URL, call, copy code or PIX buttons |
120
+ | Send Carousel *(2.4+)* | Send a carousel of 1-10 cards with image, text and buttons (Baileys only) |
121
+ | Send Template | Send an approved WhatsApp Business template (Cloud API instances only) |
122
+ | Generate Message ID *(2.4+)* | Generate a valid WhatsApp message ID for the Custom Message ID option, e.g. for retries without duplicates (Baileys only) |
123
+
124
+ ### Chat (17)
125
+
126
+ | Operation | What it does |
127
+ |---|---|
128
+ | Check Numbers | Check whether phone numbers have WhatsApp and get their JIDs (one item per number) |
129
+ | Get | Get a chat stored by Evolution (name, labels, unread count) |
130
+ | Get Many | Get many chats with their last message and unread count, newest first |
131
+ | Get Contacts | Get contacts stored by Evolution, optionally filtered by JID or push name |
132
+ | Get Messages | Get messages stored by Evolution, newest first, filtered by chat, ID, type or date |
133
+ | Get Status Updates | Get delivery/read receipts of messages (sent, delivered, read, played) |
134
+ | Get Poll Votes *(2.4+)* | Get the results and voters of a poll |
135
+ | Get Channels *(2.4+)* | Get the WhatsApp channels (newsletters) with stored messages |
136
+ | Download Media | Download the media of a message as a binary file |
137
+ | Edit Message | Edit the text or caption of a message sent by this instance |
138
+ | Delete Message for Everyone | Delete (revoke) a sent message for everyone in the chat |
139
+ | Mark as Read | Send read receipts (blue ticks) for messages |
140
+ | Mark as Played *(2.4+)* | Send the "played" receipt (blue microphone) for voice messages |
141
+ | Mark as Unread | Mark a whole chat as unread |
142
+ | Archive | Archive or unarchive a chat |
143
+ | Send Presence | Show "typing…" or "recording audio…" in a chat for a while |
144
+ | Update Block Status | Block or unblock a contact |
145
+
146
+ ### Group (17)
147
+
148
+ | Operation | What it does |
149
+ |---|---|
150
+ | Create | Create a group with a subject and initial participants |
151
+ | Get | Get the details of a group by JID, including its participants |
152
+ | Get Many | Get the groups the instance belongs to, one item per group |
153
+ | Get Participants | Get the participants of a group and their admin role |
154
+ | Update Subject / Description / Picture / Setting | Change a group's name, description, picture, or who can send/edit |
155
+ | Update Member Add Mode *(2.4+)* | Choose whether only admins or all members can add participants |
156
+ | Update Participants | Add, remove, promote or demote participants |
157
+ | Toggle Ephemeral | Turn disappearing messages on (24h/7d/90d) or off |
158
+ | Get / Revoke Invite Code | Get or invalidate a group's invite link |
159
+ | Get Invite Info | Preview a group from an invite code, without joining |
160
+ | Accept Invite | Join a group with an invite code or link |
161
+ | Send Invite | Send a group's invite link to one or more numbers |
162
+ | Leave | Make the instance leave a group |
163
+
164
+ ### Profile (9)
165
+
166
+ Get, Get Business Profile, Get Picture, Get Privacy Settings, Remove Picture, Update Name, Update
167
+ Picture, Update Privacy Settings, Update Status — of a contact, group, or the instance's own
168
+ WhatsApp account.
169
+
170
+ ### Chatbot (15)
171
+
172
+ Create, Get, Get Many, Update, Delete, Change Session Status, Get Sessions, Ignore JID, Get/Set
173
+ Settings — for the n8n, Typebot, OpenAI, Dify, Flowise, EvoAI and Evolution Bot integrations of an
174
+ instance, plus Start Typebot, and Create/Delete/Get OpenAI Credential and Get OpenAI Models for
175
+ the OpenAI integration.
176
+
177
+ ### Chatwoot (2), Settings (2), Proxy (2), Webhook (4)
178
+
179
+ - **Chatwoot**: Get / Set the Chatwoot integration of an instance.
180
+ - **Settings**: Get / Set instance behavior (reject calls, ignore groups, always online, read
181
+ receipts…).
182
+ - **Proxy**: Get / Set the proxy of an instance (Evolution tests it before saving).
183
+ - **Webhook**: Get / Set the instance webhook, and Get Transport / Set Transport for the
184
+ WebSocket, RabbitMQ, Amazon SQS, NATS, Kafka or Pusher event transports.
185
+
186
+ **Set/Setting operations read the current configuration first and merge in only the fields you
187
+ add**, because Evolution's `settings/set`, `chatwoot/set`, `proxy/set` and
188
+ `chat/updatePrivacySettings` all require the complete object on every write — the node reads it,
189
+ merges your changes, and writes the full object back so unrelated fields aren't reset.
190
+
191
+ ### Label (3)
192
+
193
+ Add to Chat, Get Many, Remove from Chat — WhatsApp Business labels.
194
+
195
+ ### Template (6)
196
+
197
+ Create, Update, Delete, Get Many, Get Catalog, Get Catalog Collections — WhatsApp Cloud API
198
+ message templates and (Baileys) the WhatsApp Business product catalog.
199
+
200
+ ### Call (1)
201
+
202
+ Offer — **experimental / no-op**: on both Evolution API 2.3.x and 2.4.x this route returns a
203
+ placeholder call ID and places no actual call (the upstream Baileys call code is commented out).
204
+ Included for completeness, not as a working feature.
205
+
206
+ ## Evolution API 2.4 license gate
207
+
208
+ Evolution API 2.4 answers **HTTP 503 with `code: "LICENSE_REQUIRED"` on every route** until the
209
+ server itself is activated (this also blocks its inbound webhook receivers, e.g. for Chatwoot).
210
+ This node turns that into a clear, **never retried** error: *"Evolution API license not activated
211
+ (503 LICENSE_REQUIRED). Activate it at `<register_url>`"*. Activate the server at
212
+ `<Base URL>/manager/login`, and confirm with `GET <Base URL>/license/status` before relying on it
213
+ in production. Operations and fields that only exist on Evolution 2.4+ (see the tables above) are
214
+ marked "Requires Evolution API 2.4+" in the node UI; calling one against a 2.3.7 server surfaces
215
+ Evolution's own 404 instead.
216
+
217
+ ## Trigger: setup and security
218
+
219
+ The **Evolution API Trigger** node starts a workflow for each webhook event Evolution sends.
220
+
221
+ - **Automatic mode** (default): on activation, the trigger registers this workflow's URL as the
222
+ target instance's webhook (`POST /webhook/set`), protected with a random secret it generates
223
+ (an HS256 JWT `jwt_key`, a secret header, or both). On deactivation it restores the webhook
224
+ configuration that was there before (or disables the webhook if there was none), including after
225
+ an n8n restart.
226
+
227
+ > ⚠️ **Evolution API keeps only ONE webhook per instance.** While an automatic-mode trigger is
228
+ > active (or listening for a test event), it takes over that instance's webhook entirely. Do
229
+ > not point two automatic triggers, or an automatic trigger and some other webhook consumer, at
230
+ > the same instance at the same time — whichever one activates last wins the instance's single
231
+ > webhook slot.
232
+
233
+ - **Manual mode**: you configure Evolution yourself (the instance webhook, or the global
234
+ `WEBHOOK_GLOBAL_URL`) with "Webhook by Events" off and this node's URL, and the trigger only
235
+ verifies and parses incoming deliveries.
236
+
237
+ > ⚠️ **The global webhook (`WEBHOOK_GLOBAL_URL`) cannot be authenticated.** Evolution's global
238
+ > webhook has no per-instance headers and cannot carry a `jwt_key`, so Manual mode's
239
+ > Authentication must be set to "None" for it — the webhook URL itself is the only protection.
240
+ > Treat that URL as a secret and/or restrict it at the network/reverse-proxy level. An instance
241
+ > webhook, by contrast, can carry a secret header and/or a `jwt_key`, both of which this trigger
242
+ > verifies.
243
+
244
+ Both modes support: filtering by event type, message type, instance name, and
245
+ group/newsletter/broadcast/"from me" origin; deduplicating retried deliveries (Evolution retries
246
+ an undelivered webhook up to 10 times, and an instance can have both an instance and a global
247
+ webhook firing for the same event); stripping the `apikey` field Evolution sometimes embeds in the
248
+ payload before it reaches your workflow data (there's an option to keep it, off by default); and
249
+ turning embedded media (when "Include Media as Base64" is on in the webhook config) into n8n
250
+ binary data.
251
+
252
+ ## Using with Chatwoot
253
+
254
+ Configure the integration from the **Chatwoot** resource's **Set** operation (Account ID, API
255
+ Access Token, URL, Inbox Name, and the conversation/behavior toggles); it reads the current
256
+ configuration first and only changes the fields you add. Evolution's Chatwoot webhook
257
+ (`POST /chatwoot/webhook/:instanceName`) has **no authentication of its own** — protect it at your
258
+ reverse proxy (e.g. restrict it to Chatwoot's IP range) rather than relying on Evolution. Also
259
+ note that the Evolution 2.4 license gate (above) blocks that inbound webhook route too: until a
260
+ 2.4 server is activated, Chatwoot agent replies stop reaching WhatsApp.
261
+
262
+ ## AI Agent tool usage
263
+
264
+ The Evolution API node has `usableAsTool: true`: add it as a tool under an **AI Agent** node's
265
+ Tools list (or connect it to the Agent's Tool input) to let a model send messages, look up chats,
266
+ contacts or groups, manage labels, etc. Prefer operations with simple, flat parameters (Send Text,
267
+ Check Numbers, Get Many, Get Contacts…) for tool use; operations with nested structures (Send
268
+ List's sections/rows, Send Carousel's cards, Group → Update Participants) are harder for a model
269
+ to fill in correctly through the Agent's generated tool call and are better suited to a regular
270
+ workflow step. The **Evolution API Trigger** cannot be used as a tool (n8n doesn't support trigger
271
+ nodes as AI Agent tools).
272
+
273
+ ## Behavior notes
274
+
275
+ - Every input item is processed independently, with `pairedItem` on the output and full *Continue
276
+ On Fail* support (failed items come back as `{ error, description?, httpCode? }`).
277
+ - Errors surface Evolution's own message (`response.message`) plus a hint for the HTTP status.
278
+ `429` is retried with backoff (honoring `Retry-After`); `502`/`503` are retried only for
279
+ idempotent requests; `504` only for reads (Evolution may already have applied the write). Send
280
+ operations are never retried on a 5xx, so messages are never duplicated. `503 LICENSE_REQUIRED`
281
+ is never retried.
282
+ - Numbers such as `+52 1 (55) 1234-5678` are normalized using the same rules Evolution's own
283
+ `createJid` applies (including the Mexico/Argentina/Brazil digit-count quirks); JIDs you already
284
+ have (`@lid`, `@g.us`, `@s.whatsapp.net`, `@broadcast`, `@newsletter`) are passed through
285
+ untouched, never rewritten.
286
+ - Instance names and other path IDs containing `.` or `..` are rejected instead of being encoded
287
+ literally, which would otherwise let a value like `..` change which route the request hits.
288
+ - Instance → Get Many hides secrets (instance token, Chatwoot token, proxy password) unless
289
+ *Include Secrets* is turned on, and returns no items when a filter matches no instance instead
290
+ of failing.
291
+
292
+ ## Compatibility
293
+
294
+ | Component | Versions |
295
+ |---|---|
296
+ | Evolution API | **2.3.7** (tested against its sources) and **2.4.0-rc2** (2.4-only features are marked in the UI, see above; 2.4 requires server license activation). `develop`/nightly builds are **not supported** — they change contract details from release to release (and had at least one release-blocking regression in instance creation at the time this node was built). **Evolution Go is not supported** (different API entirely). |
297
+ | n8n | 2.x (built and tested against `n8n-workflow` ~2.13); expected to keep working on n8n 3.0 once you enable unverified packages, see [Installation](#installation). |
298
+ | Node.js | 18+ |
299
+
300
+ ## Development
301
+
302
+ ```bash
303
+ npm install --ignore-scripts # this package has no runtime deps and needs no native addon builds
304
+ npm run build # tsc, then copies icons and .node.json codex files into dist/
305
+ npm run lint # project ESLint rules (eslint:recommended, typescript-eslint, n8n-nodes-base)
306
+ npm run lint:n8n # n8n community-node verification rules (@n8n/eslint-plugin-community-nodes)
307
+ npm test # Jest, full suite
308
+ ```
309
+
310
+ `npm run lint:n8n` runs `@n8n/eslint-plugin-community-nodes`'s recommended rules through a
311
+ separate flat config (`eslint.n8n.config.mjs`), independent of the project's own `.eslintrc.js` /
312
+ `npm run lint`. CI (`.github/workflows/ci.yml`) runs `npm ci`, both lint scripts, the test suite
313
+ and the build on every push and pull request, across Node 18/20/22.
314
+
315
+ ## Release process
316
+
317
+ Tagging a commit `vX.Y.Z` and pushing the tag runs `.github/workflows/publish.yml`, which installs
318
+ dependencies, runs the test suite, builds, and runs `npm publish --provenance --access public`
319
+ with `permissions: id-token: write` — the GitHub Actions + npm provenance setup n8n has required
320
+ for community-node verification since May 2026.
321
+
322
+ Publishing currently authenticates with an `NPM_TOKEN` repository secret (a classic npm automation
323
+ token), not npm Trusted Publishing (OIDC): Trusted Publishing can only be configured for a package
324
+ that already exists on the registry, and this package has not been published yet. After the first
325
+ release, a maintainer can switch to Trusted Publishing from the package's settings on npmjs.com
326
+ and remove the `NPM_TOKEN` secret; see the comments in `publish.yml` for the exact steps.
327
+
328
+ ## License
329
+
330
+ [MIT](LICENSE)
@@ -0,0 +1,10 @@
1
+ import type { IAuthenticateGeneric, Icon, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class EvolutionApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ icon: Icon;
6
+ documentationUrl: string;
7
+ properties: INodeProperties[];
8
+ authenticate: IAuthenticateGeneric;
9
+ test: ICredentialTestRequest;
10
+ }
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EvolutionApi = void 0;
4
+ class EvolutionApi {
5
+ constructor() {
6
+ this.name = 'evolutionWhatsAppApi';
7
+ this.displayName = 'Evolution API v2';
8
+ this.icon = {
9
+ light: 'file:../nodes/EvolutionApi/evolution.svg',
10
+ dark: 'file:../nodes/EvolutionApi/evolution.svg',
11
+ };
12
+ this.documentationUrl = 'https://doc.evolution-api.com/v2/en/get-started/introduction';
13
+ this.properties = [
14
+ {
15
+ displayName: 'Base URL',
16
+ name: 'baseUrl',
17
+ type: 'string',
18
+ default: '',
19
+ placeholder: 'https://evolution.example.com',
20
+ description: 'URL of your Evolution API server (the address that answers GET / with the version), without a trailing slash',
21
+ required: true,
22
+ },
23
+ {
24
+ displayName: 'API Key',
25
+ name: 'apiKey',
26
+ type: 'string',
27
+ typeOptions: {
28
+ password: true,
29
+ },
30
+ default: '',
31
+ description: 'The global API key (AUTHENTICATION_API_KEY) or the token of one instance. An instance token only works for that instance; creating instances and listing all instances require the global key.',
32
+ required: true,
33
+ },
34
+ {
35
+ displayName: 'Default Instance Name',
36
+ name: 'defaultInstance',
37
+ type: 'string',
38
+ default: '',
39
+ placeholder: 'my-instance',
40
+ description: 'Instance used when the node\'s "Instance Name" field is left empty. Recommended when the API key is an instance token: the credential test then checks that instance.',
41
+ },
42
+ ];
43
+ this.authenticate = {
44
+ type: 'generic',
45
+ properties: {
46
+ headers: {
47
+ apikey: '={{$credentials.apiKey}}',
48
+ },
49
+ },
50
+ };
51
+ this.test = {
52
+ request: {
53
+ baseURL: '={{$credentials.baseUrl.trim().replace(/\\/+$/, "")}}',
54
+ url: '={{ ($credentials.defaultInstance || "").trim() ? "/instance/connectionState/" + encodeURIComponent($credentials.defaultInstance.trim()) : "/instance/fetchInstances" }}',
55
+ method: 'GET',
56
+ },
57
+ rules: [
58
+ {
59
+ type: 'responseCode',
60
+ properties: {
61
+ value: 503,
62
+ message: 'Evolution API answered 503. On Evolution API 2.4+ this means the server license is not activated (LICENSE_REQUIRED): open <Base URL>/manager/login to activate it and check GET <Base URL>/license/status, then test again. Otherwise the server is temporarily unavailable.',
63
+ },
64
+ },
65
+ {
66
+ type: 'responseCode',
67
+ properties: {
68
+ value: 401,
69
+ message: 'Invalid API key. Use the global key (AUTHENTICATION_API_KEY) or an instance token; when using an instance token, set "Default Instance Name" to that instance.',
70
+ },
71
+ },
72
+ {
73
+ type: 'responseCode',
74
+ properties: {
75
+ value: 404,
76
+ message: 'Not found. Check the Base URL and, if set, that the "Default Instance Name" exists on this server.',
77
+ },
78
+ },
79
+ ],
80
+ };
81
+ }
82
+ }
83
+ exports.EvolutionApi = EvolutionApi;
84
+ //# sourceMappingURL=EvolutionApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EvolutionApi.credentials.js","sourceRoot":"","sources":["../../credentials/EvolutionApi.credentials.ts"],"names":[],"mappings":";;;AAeA,MAAa,YAAY;IAAzB;QACE,SAAI,GAAG,sBAAsB,CAAC;QAE9B,gBAAW,GAAG,kBAAkB,CAAC;QAGjC,SAAI,GAAS;YACX,KAAK,EAAE,0CAA0C;YACjD,IAAI,EAAE,0CAA0C;SACjD,CAAC;QAEF,qBAAgB,GAAG,8DAA8D,CAAC;QAElF,eAAU,GAAsB;YAC9B;gBACE,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,+BAA+B;gBAC5C,WAAW,EACT,8GAA8G;gBAChH,QAAQ,EAAE,IAAI;aACf;YACD;gBACE,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACX,QAAQ,EAAE,IAAI;iBACf;gBACD,OAAO,EAAE,EAAE;gBACX,WAAW,EACT,gMAAgM;gBAClM,QAAQ,EAAE,IAAI;aACf;YACD;gBACE,WAAW,EAAE,uBAAuB;gBACpC,IAAI,EAAE,iBAAiB;gBACvB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,aAAa;gBAC1B,WAAW,EACT,uKAAuK;aAC1K;SACF,CAAC;QAEF,iBAAY,GAAyB;YACnC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP,MAAM,EAAE,0BAA0B;iBACnC;aACF;SACF,CAAC;QAKF,SAAI,GAA2B;YAC7B,OAAO,EAAE;gBACP,OAAO,EAAE,uDAAuD;gBAChE,GAAG,EAAE,0KAA0K;gBAC/K,MAAM,EAAE,KAAK;aACd;YACD,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,cAAc;oBACpB,UAAU,EAAE;wBACV,KAAK,EAAE,GAAG;wBACV,OAAO,EACL,8QAA8Q;qBACjR;iBACF;gBACD;oBACE,IAAI,EAAE,cAAc;oBACpB,UAAU,EAAE;wBACV,KAAK,EAAE,GAAG;wBACV,OAAO,EACL,gKAAgK;qBACnK;iBACF;gBACD;oBACE,IAAI,EAAE,cAAc;oBACpB,UAAU,EAAE;wBACV,KAAK,EAAE,GAAG;wBACV,OAAO,EACL,oGAAoG;qBACvG;iBACF;aACF;SACF,CAAC;IACJ,CAAC;CAAA;AA5FD,oCA4FC"}
@@ -0,0 +1,19 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeProperties, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ import type { ListSearchMethod, LoadOptionsMethod, OperationHandler, OperationResult, ResourceDefinition, ResourceModule } from './types';
3
+ export declare const instanceNameProperty: INodeProperties;
4
+ export declare function buildInstanceNameProperties(resources: ResourceDefinition[]): INodeProperties[];
5
+ export declare function buildMethods(resources: ResourceDefinition[]): {
6
+ loadOptions: Record<string, LoadOptionsMethod>;
7
+ listSearch: Record<string, ListSearchMethod>;
8
+ };
9
+ export declare function getOperationHandler(resourceModule: ResourceModule | undefined, operation: string): OperationHandler | undefined;
10
+ export declare function isExecutionDataArray(result: OperationResult): result is INodeExecutionData[];
11
+ export declare function toOutputItems(result: OperationResult, inputItem: INodeExecutionData | undefined, passThroughBinary: boolean): INodeExecutionData[];
12
+ export declare class EvolutionApi implements INodeType {
13
+ description: INodeTypeDescription;
14
+ methods: {
15
+ loadOptions: Record<string, LoadOptionsMethod>;
16
+ listSearch: Record<string, ListSearchMethod>;
17
+ };
18
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
19
+ }
@@ -0,0 +1,180 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EvolutionApi = exports.instanceNameProperty = void 0;
4
+ exports.buildInstanceNameProperties = buildInstanceNameProperties;
5
+ exports.buildMethods = buildMethods;
6
+ exports.getOperationHandler = getOperationHandler;
7
+ exports.isExecutionDataArray = isExecutionDataArray;
8
+ exports.toOutputItems = toOutputItems;
9
+ const n8n_workflow_1 = require("n8n-workflow");
10
+ const GenericFunctions_1 = require("./GenericFunctions");
11
+ const resources_1 = require("./resources");
12
+ exports.instanceNameProperty = {
13
+ displayName: 'Instance Name',
14
+ name: 'instanceName',
15
+ type: 'resourceLocator',
16
+ default: { mode: 'list', value: '' },
17
+ description: 'Evolution API instance to use. Leave empty to use the credential default, except for Delete and Logout, which require an explicit instance. Empty expressions always fail.',
18
+ modes: [
19
+ {
20
+ displayName: 'From List',
21
+ name: 'list',
22
+ type: 'list',
23
+ placeholder: 'Select an instance...',
24
+ typeOptions: {
25
+ searchListMethod: 'searchInstances',
26
+ searchable: true,
27
+ },
28
+ },
29
+ {
30
+ displayName: 'By Name',
31
+ name: 'name',
32
+ type: 'string',
33
+ placeholder: 'e.g. my-instance',
34
+ },
35
+ ],
36
+ };
37
+ function buildInstanceNameProperties(resources) {
38
+ var _a, _b;
39
+ const properties = [];
40
+ const everyOperation = resources
41
+ .filter(({ module }) => { var _a; return !((_a = module.noInstanceOperations) === null || _a === void 0 ? void 0 : _a.length); })
42
+ .map(({ value }) => value);
43
+ if (everyOperation.length > 0) {
44
+ properties.push({
45
+ ...exports.instanceNameProperty,
46
+ displayOptions: { show: { resource: everyOperation } },
47
+ });
48
+ }
49
+ for (const { value, module } of resources) {
50
+ const excluded = (_a = module.noInstanceOperations) !== null && _a !== void 0 ? _a : [];
51
+ if (excluded.length === 0)
52
+ continue;
53
+ const operations = ((_b = module.operations.options) !== null && _b !== void 0 ? _b : [])
54
+ .map((option) => String(option.value))
55
+ .filter((operation) => !excluded.includes(operation));
56
+ if (operations.length === 0)
57
+ continue;
58
+ properties.push({
59
+ ...exports.instanceNameProperty,
60
+ displayOptions: { show: { resource: [value], operation: operations } },
61
+ });
62
+ }
63
+ return properties;
64
+ }
65
+ function buildMethods(resources) {
66
+ var _a, _b, _c, _d;
67
+ const loadOptions = {};
68
+ const listSearch = { searchInstances: GenericFunctions_1.searchInstances };
69
+ for (const { module } of resources) {
70
+ for (const [name, method] of Object.entries((_b = (_a = module.methods) === null || _a === void 0 ? void 0 : _a.loadOptions) !== null && _b !== void 0 ? _b : {})) {
71
+ if (!(name in loadOptions))
72
+ loadOptions[name] = method;
73
+ }
74
+ for (const [name, method] of Object.entries((_d = (_c = module.methods) === null || _c === void 0 ? void 0 : _c.listSearch) !== null && _d !== void 0 ? _d : {})) {
75
+ if (!(name in listSearch))
76
+ listSearch[name] = method;
77
+ }
78
+ }
79
+ return { loadOptions, listSearch };
80
+ }
81
+ function getOperationHandler(resourceModule, operation) {
82
+ if (!resourceModule || !Object.prototype.hasOwnProperty.call(resourceModule.execute, operation)) {
83
+ return undefined;
84
+ }
85
+ return resourceModule.execute[operation];
86
+ }
87
+ const EXECUTION_DATA_KEYS = new Set(['json', 'binary', 'pairedItem', 'error', 'metadata']);
88
+ function isExecutionDataArray(result) {
89
+ return (Array.isArray(result) &&
90
+ result.length > 0 &&
91
+ result.every((entry) => (0, GenericFunctions_1.isPlainObject)(entry) &&
92
+ (0, GenericFunctions_1.isPlainObject)(entry.json) &&
93
+ Object.keys(entry).every((key) => EXECUTION_DATA_KEYS.has(key))));
94
+ }
95
+ function toOutputItems(result, inputItem, passThroughBinary) {
96
+ if (isExecutionDataArray(result))
97
+ return result;
98
+ const jsonItems = Array.isArray(result)
99
+ ? result.map((entry) => (0, GenericFunctions_1.isPlainObject)(entry) ? entry : { value: entry })
100
+ : [(0, GenericFunctions_1.isPlainObject)(result) ? result : {}];
101
+ return jsonItems.map((json) => {
102
+ const item = { json };
103
+ if (passThroughBinary && (inputItem === null || inputItem === void 0 ? void 0 : inputItem.binary))
104
+ item.binary = inputItem.binary;
105
+ return item;
106
+ });
107
+ }
108
+ class EvolutionApi {
109
+ constructor() {
110
+ this.description = {
111
+ displayName: 'Evolution API',
112
+ name: 'evolutionApi',
113
+ icon: { light: 'file:evolution.svg', dark: 'file:evolution.svg' },
114
+ group: ['transform'],
115
+ version: 1,
116
+ subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
117
+ description: 'Send WhatsApp messages and manage instances, chats, groups and integrations with Evolution API v2',
118
+ defaults: {
119
+ name: 'Evolution API',
120
+ },
121
+ usableAsTool: true,
122
+ inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
123
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
124
+ credentials: [
125
+ {
126
+ name: GenericFunctions_1.CREDENTIAL_TYPE,
127
+ required: true,
128
+ },
129
+ ],
130
+ properties: [
131
+ resources_1.resourceProperty,
132
+ ...resources_1.RESOURCES.map(({ module }) => module.operations),
133
+ ...buildInstanceNameProperties(resources_1.RESOURCES),
134
+ ...resources_1.RESOURCES.flatMap(({ module }) => module.fields),
135
+ ],
136
+ };
137
+ this.methods = buildMethods(resources_1.RESOURCES);
138
+ }
139
+ async execute() {
140
+ var _a, _b;
141
+ const items = this.getInputData();
142
+ const returnData = [];
143
+ const resource = this.getNodeParameter('resource', 0);
144
+ const operation = this.getNodeParameter('operation', 0);
145
+ const resourceModule = (0, resources_1.getResourceModule)(resource);
146
+ const handler = getOperationHandler(resourceModule, operation);
147
+ if (!handler) {
148
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" is not supported for resource "${resource}"`);
149
+ }
150
+ const passThroughBinary = (_b = (_a = resourceModule === null || resourceModule === void 0 ? void 0 : resourceModule.binaryPassThrough) === null || _a === void 0 ? void 0 : _a.includes(operation)) !== null && _b !== void 0 ? _b : false;
151
+ for (let i = 0; i < items.length; i++) {
152
+ try {
153
+ const result = await handler.call(this, i);
154
+ const executionData = this.helpers.constructExecutionMetaData(toOutputItems(result, items[i], passThroughBinary), { itemData: { item: i } });
155
+ returnData.push(...executionData);
156
+ }
157
+ catch (error) {
158
+ const nodeError = error instanceof n8n_workflow_1.NodeApiError || error instanceof n8n_workflow_1.NodeOperationError
159
+ ? error
160
+ : new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex: i });
161
+ if (nodeError.context.itemIndex === undefined)
162
+ nodeError.context.itemIndex = i;
163
+ if (this.continueOnFail()) {
164
+ const json = { error: nodeError.message };
165
+ if (nodeError.description)
166
+ json.description = nodeError.description;
167
+ if (nodeError instanceof n8n_workflow_1.NodeApiError && nodeError.httpCode) {
168
+ json.httpCode = nodeError.httpCode;
169
+ }
170
+ returnData.push({ json, pairedItem: { item: i } });
171
+ continue;
172
+ }
173
+ throw nodeError;
174
+ }
175
+ }
176
+ return [returnData];
177
+ }
178
+ }
179
+ exports.EvolutionApi = EvolutionApi;
180
+ //# sourceMappingURL=EvolutionApi.node.js.map